aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/ivi_common.h
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-10-25 16:17:41 +0200
committerMichael Niedermayer <michaelni@gmx.at>2012-10-25 16:17:41 +0200
commitfe8243d7a9e3dae000389ca2020f26679c779f04 (patch)
treebc4080990690408d4e1c88ae0843fd6a5e432267 /libavcodec/ivi_common.h
parentbe2dd2559f54c319f98fc324f84ac2cfb2e50265 (diff)
parentc5ec1908597824e93bbe20137ac9662f84f3cb07 (diff)
downloadffmpeg-fe8243d7a9e3dae000389ca2020f26679c779f04.tar.gz
Merge commit 'c5ec1908597824e93bbe20137ac9662f84f3cb07' into release/0.10
* commit 'c5ec1908597824e93bbe20137ac9662f84f3cb07': indeo: check for invalid motion vectors indeo: clear allocated band buffers indeo: track tile macroblock size factor out common decoding code for Indeo 4 and Indeo 5 indeo: check custom Huffman tables for errors dfa: improve boundary checks in decode_dds1() dfa: use more meaningful return codes dfa: add some checks to ensure that decoder won't write past frame end dfa: convert to bytestream2 API dfa: check that the caller set width/height properly. avsdec: Set dimensions instead of relying on the demuxer. ac3dec: ensure get_buffer() gets a buffer for the correct number of channels Conflicts: libavcodec/avs.c libavcodec/dfa.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/ivi_common.h')
-rw-r--r--libavcodec/ivi_common.h62
1 files changed, 62 insertions, 0 deletions
diff --git a/libavcodec/ivi_common.h b/libavcodec/ivi_common.h
index dd060854f3..79895efed8 100644
--- a/libavcodec/ivi_common.h
+++ b/libavcodec/ivi_common.h
@@ -34,6 +34,8 @@
#include <stdint.h>
#define IVI_VLC_BITS 13 ///< max number of bits of the ivi's huffman codes
+#define IVI4_STREAM_ANALYSER 0
+#define IVI5_IS_PROTECTED 0x20
/**
* huffman codebook descriptor
@@ -116,6 +118,7 @@ typedef struct {
int ypos;
int width;
int height;
+ int mb_size;
int is_empty; ///< = 1 if this tile doesn't contain any data
int data_size; ///< size of the data in bytes
int num_MBs; ///< number of macroblocks in this tile
@@ -132,6 +135,7 @@ typedef struct {
int band_num; ///< band number
int width;
int height;
+ int aheight; ///< aligned band height
const uint8_t *data_ptr; ///< ptr to the first byte of the band data
int data_size; ///< size of the band data
int16_t *buf; ///< pointer to the output buffer for this band
@@ -192,6 +196,60 @@ typedef struct {
uint8_t chroma_bands;
} IVIPicConfig;
+typedef struct IVI45DecContext {
+ GetBitContext gb;
+ AVFrame frame;
+ RVMapDesc rvmap_tabs[9]; ///< local corrected copy of the static rvmap tables
+
+ uint32_t frame_num;
+ int frame_type;
+ int prev_frame_type; ///< frame type of the previous frame
+ uint32_t data_size; ///< size of the frame data in bytes from picture header
+ int is_scalable;
+ int transp_status; ///< transparency mode status: 1 - enabled
+ const uint8_t *frame_data; ///< input frame data pointer
+ int inter_scal; ///< signals a sequence of scalable inter frames
+ uint32_t frame_size; ///< frame size in bytes
+ uint32_t pic_hdr_size; ///< picture header size in bytes
+ uint8_t frame_flags;
+ uint16_t checksum; ///< frame checksum
+
+ IVIPicConfig pic_conf;
+ IVIPlaneDesc planes[3]; ///< color planes
+
+ int buf_switch; ///< used to switch between three buffers
+ int dst_buf; ///< buffer index for the currently decoded frame
+ int ref_buf; ///< inter frame reference buffer index
+ int ref2_buf; ///< temporal storage for switching buffers
+
+ IVIHuffTab mb_vlc; ///< current macroblock table descriptor
+ IVIHuffTab blk_vlc; ///< current block table descriptor
+
+ uint8_t rvmap_sel;
+ uint8_t in_imf;
+ uint8_t in_q; ///< flag for explicitly stored quantiser delta
+ uint8_t pic_glob_quant;
+ uint8_t unknown1;
+
+ uint16_t gop_hdr_size;
+ uint8_t gop_flags;
+ uint32_t lock_word;
+
+#if IVI4_STREAM_ANALYSER
+ uint8_t has_b_frames;
+ uint8_t has_transp;
+ uint8_t uses_tiling;
+ uint8_t uses_haar;
+ uint8_t uses_fullpel;
+#endif
+
+ int (*decode_pic_hdr) (struct IVI45DecContext *ctx, AVCodecContext *avctx);
+ int (*decode_band_hdr) (struct IVI45DecContext *ctx, IVIBandDesc *band, AVCodecContext *avctx);
+ int (*decode_mb_info) (struct IVI45DecContext *ctx, IVIBandDesc *band, IVITile *tile, AVCodecContext *avctx);
+ void (*switch_buffers) (struct IVI45DecContext *ctx);
+ int (*is_nonnull_frame)(struct IVI45DecContext *ctx);
+} IVI45DecContext;
+
/** compare some properties of two pictures */
static inline int ivi_pic_config_cmp(IVIPicConfig *str1, IVIPicConfig *str2)
{
@@ -348,4 +406,8 @@ uint16_t ivi_calc_band_checksum (IVIBandDesc *band);
*/
int ivi_check_band (IVIBandDesc *band, const uint8_t *ref, int pitch);
+int ff_ivi_decode_frame(AVCodecContext *avctx, void *data, int *data_size,
+ AVPacket *avpkt);
+av_cold int ff_ivi_decode_close(AVCodecContext *avctx);
+
#endif /* AVCODEC_IVI_COMMON_H */