libavcodec/mjpegdec.h

Go to the documentation of this file.
00001 /*
00002  * MJPEG decoder
00003  * Copyright (c) 2000, 2001 Fabrice Bellard
00004  * Copyright (c) 2003 Alex Beregszaszi
00005  * Copyright (c) 2003-2004 Michael Niedermayer
00006  *
00007  * This file is part of FFmpeg.
00008  *
00009  * FFmpeg is free software; you can redistribute it and/or
00010  * modify it under the terms of the GNU Lesser General Public
00011  * License as published by the Free Software Foundation; either
00012  * version 2.1 of the License, or (at your option) any later version.
00013  *
00014  * FFmpeg is distributed in the hope that it will be useful,
00015  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00016  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
00017  * Lesser General Public License for more details.
00018  *
00019  * You should have received a copy of the GNU Lesser General Public
00020  * License along with FFmpeg; if not, write to the Free Software
00021  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
00022  */
00023 
00029 #ifndef AVCODEC_MJPEGDEC_H
00030 #define AVCODEC_MJPEGDEC_H
00031 
00032 #include "avcodec.h"
00033 #include "bitstream.h"
00034 #include "dsputil.h"
00035 
00036 #define MAX_COMPONENTS 4
00037 
00038 typedef struct MJpegDecodeContext {
00039 AVCodecContext *avctx;
00040 GetBitContext gb;
00041 
00042 int start_code; /* current start code */
00043 int buffer_size;
00044 uint8_t *buffer;
00045 
00046 int16_t quant_matrixes[4][64];
00047 VLC vlcs[2][4];
00048 int qscale[4]; 
00049 
00050 int org_height; /* size given at codec init */
00051 int first_picture; /* true if decoding first picture */
00052 int interlaced; /* true if interlaced */
00053 int bottom_field; /* true if bottom field */
00054 int lossless;
00055 int ls;
00056 int progressive;
00057 int rgb;
00058 int rct; /* standard rct */
00059 int pegasus_rct; /* pegasus reversible colorspace transform */
00060 int bits; /* bits per component */
00061 
00062 int maxval;
00063 int near; 
00064 int t1,t2,t3;
00065 int reset; 
00066 
00067 int width, height;
00068 int mb_width, mb_height;
00069 int nb_components;
00070 int block_stride[MAX_COMPONENTS];
00071 int component_id[MAX_COMPONENTS];
00072 int h_count[MAX_COMPONENTS]; /* horizontal and vertical count for each component */
00073 int v_count[MAX_COMPONENTS];
00074 int comp_index[MAX_COMPONENTS];
00075 int dc_index[MAX_COMPONENTS];
00076 int ac_index[MAX_COMPONENTS];
00077 int nb_blocks[MAX_COMPONENTS];
00078 int h_scount[MAX_COMPONENTS];
00079 int v_scount[MAX_COMPONENTS];
00080 int h_max, v_max; /* maximum h and v counts */
00081 int quant_index[4]; /* quant table index for each component */
00082 int last_dc[MAX_COMPONENTS]; /* last DEQUANTIZED dc (XXX: am I right to do that ?) */
00083 AVFrame picture; /* picture structure */
00084 int linesize[MAX_COMPONENTS]; 
00085 int8_t *qscale_table;
00086 DECLARE_ALIGNED_16(DCTELEM, block[64]);
00087 DCTELEM (*blocks[MAX_COMPONENTS])[64]; 
00088 uint8_t *last_nnz[MAX_COMPONENTS];
00089 uint64_t coefs_finished[MAX_COMPONENTS]; 
00090 ScanTable scantable;
00091 DSPContext dsp;
00092 
00093 int restart_interval;
00094 int restart_count;
00095 
00096 int buggy_avid;
00097 int cs_itu601;
00098 int interlace_polarity;
00099 
00100 int mjpb_skiptosod;
00101 
00102 int cur_scan; /* current scan, used by JPEG-LS */
00103 } MJpegDecodeContext;
00104 
00105 int ff_mjpeg_decode_init(AVCodecContext *avctx);
00106 int ff_mjpeg_decode_end(AVCodecContext *avctx);
00107 int ff_mjpeg_decode_frame(AVCodecContext *avctx,
00108 void *data, int *data_size,
00109 const uint8_t *buf, int buf_size);
00110 int ff_mjpeg_decode_dqt(MJpegDecodeContext *s);
00111 int ff_mjpeg_decode_dht(MJpegDecodeContext *s);
00112 int ff_mjpeg_decode_sof(MJpegDecodeContext *s);
00113 int ff_mjpeg_decode_sos(MJpegDecodeContext *s);
00114 
00115 #endif /* AVCODEC_MJPEGDEC_H */

Generated on Fri Oct 26 02:35:37 2012 for FFmpeg by doxygen 1.5.8

AltStyle によって変換されたページ (->オリジナル) /