]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/mjpeg.h
hevc: ppc: Add HEVC 4x4 IDCT for PowerPC
[ffmpeg] / libavcodec / mjpeg.h
index 4009b4a02a88a76ec0a94f00a0ee4944af6dd497..1ebe283748f5e844acd0e699837e48d9ee781ff7 100644 (file)
@@ -1,46 +1,40 @@
 /*
  * MJPEG encoder and decoder
- * Copyright (c) 2000, 2001 Fabrice Bellard.
+ * Copyright (c) 2000, 2001 Fabrice Bellard
  * Copyright (c) 2003 Alex Beregszaszi
  * Copyright (c) 2003-2004 Michael Niedermayer
  *
- * This file is part of FFmpeg.
+ * Support for external huffman table, various fixes (AVID workaround),
+ * aspecting, new decode_frame mechanism and apple mjpeg-b support
+ *                                  by Alex Beregszaszi
+ *
+ * This file is part of Libav.
  *
- * FFmpeg is free software; you can redistribute it and/or
+ * Libav is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
  * License as published by the Free Software Foundation; either
  * version 2.1 of the License, or (at your option) any later version.
  *
- * FFmpeg is distributed in the hope that it will be useful,
+ * Libav is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
+ * License along with Libav; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * Support for external huffman table, various fixes (AVID workaround),
- * aspecting, new decode_frame mechanism and apple mjpeg-b support
- *                                  by Alex Beregszaszi
  */
 
 /**
- * @file mjpeg.h
+ * @file
  * MJPEG encoder and decoder.
  */
 
-#ifndef MJPEG_H
-#define MJPEG_H
-
-#include "avcodec.h"
-#include "bitstream.h"
-#include "dsputil.h"
-#include "mpegvideo.h"
-
+#ifndef AVCODEC_MJPEG_H
+#define AVCODEC_MJPEG_H
 
 /* JPEG marker codes */
-typedef enum {
+enum JpegMarker {
     /* start of frame */
     SOF0  = 0xc0,       /* baseline */
     SOF1  = 0xc1,       /* extended sequential, huffman */
@@ -119,78 +113,7 @@ typedef enum {
     TEM   = 0x01,       /* temporary private use for arithmetic coding */
 
     /* 0x02 -> 0xbf reserved */
-} JPEG_MARKER;
-
-static inline void put_marker(PutBitContext *p, int code)
-{
-    put_bits(p, 8, 0xff);
-    put_bits(p, 8, code);
-}
-
-#define MAX_COMPONENTS 4
-
-typedef struct MJpegDecodeContext {
-    AVCodecContext *avctx;
-    GetBitContext gb;
-
-    int start_code; /* current start code */
-    int buffer_size;
-    uint8_t *buffer;
-
-    int16_t quant_matrixes[4][64];
-    VLC vlcs[2][4];
-    int qscale[4];      ///< quantizer scale calculated from quant_matrixes
-
-    int org_height;  /* size given at codec init */
-    int first_picture;    /* true if decoding first picture */
-    int interlaced;     /* true if interlaced */
-    int bottom_field;   /* true if bottom field */
-    int lossless;
-    int ls;
-    int progressive;
-    int rgb;
-    int rct;            /* standard rct */
-    int pegasus_rct;    /* pegasus reversible colorspace transform */
-    int bits;           /* bits per component */
-
-    int maxval;
-    int near;         ///< near lossless bound (si 0 for lossless)
-    int t1,t2,t3;
-    int reset;        ///< context halfing intervall ?rename
-
-    int width, height;
-    int mb_width, mb_height;
-    int nb_components;
-    int component_id[MAX_COMPONENTS];
-    int h_count[MAX_COMPONENTS]; /* horizontal and vertical count for each component */
-    int v_count[MAX_COMPONENTS];
-    int comp_index[MAX_COMPONENTS];
-    int dc_index[MAX_COMPONENTS];
-    int ac_index[MAX_COMPONENTS];
-    int nb_blocks[MAX_COMPONENTS];
-    int h_scount[MAX_COMPONENTS];
-    int v_scount[MAX_COMPONENTS];
-    int h_max, v_max; /* maximum h and v counts */
-    int quant_index[4];   /* quant table index for each component */
-    int last_dc[MAX_COMPONENTS]; /* last DEQUANTIZED dc (XXX: am I right to do that ?) */
-    AVFrame picture; /* picture structure */
-    int linesize[MAX_COMPONENTS];                   ///< linesize << interlaced
-    int8_t *qscale_table;
-    DECLARE_ALIGNED_8(DCTELEM, block[64]);
-    ScanTable scantable;
-    DSPContext dsp;
-
-    int restart_interval;
-    int restart_count;
-
-    int buggy_avid;
-    int cs_itu601;
-    int interlace_polarity;
-
-    int mjpb_skiptosod;
-
-    int cur_scan; /* current scan, used by JPEG-LS */
-} MJpegDecodeContext;
+};
 
 #define PREDICT(ret, topleft, top, left, predictor)\
     switch(predictor){\
@@ -204,20 +127,4 @@ typedef struct MJpegDecodeContext {
         case 7: ret= (left + top)>>1; break;\
     }
 
-extern const uint8_t ff_mjpeg_bits_dc_luminance[];
-extern const uint8_t ff_mjpeg_val_dc_luminance[];
-
-extern const uint8_t ff_mjpeg_bits_dc_chrominance[];
-extern const uint8_t ff_mjpeg_val_dc_chrominance[];
-
-extern const uint8_t ff_mjpeg_bits_ac_luminance[];
-extern const uint8_t ff_mjpeg_val_ac_luminance[];
-
-extern const uint8_t ff_mjpeg_bits_ac_chrominance[];
-extern const uint8_t ff_mjpeg_val_ac_chrominance[];
-
-void ff_mjpeg_build_huffman_codes(uint8_t *huff_size, uint16_t *huff_code,
-                                  const uint8_t *bits_table,
-                                  const uint8_t *val_table);
-
-#endif /* MJPEG_H */
+#endif /* AVCODEC_MJPEG_H */