29 #ifndef AVCODEC_IVI_COMMON_H
30 #define AVCODEC_IVI_COMMON_H
36 #define IVI_VLC_BITS 13
37 #define IVI4_STREAM_ANALYSER 0
38 #define IVI5_IS_PROTECTED 0x20
239 #if IVI4_STREAM_ANALYSER
240 uint8_t has_b_frames;
244 uint8_t uses_fullpel;
266 #define IVI_NUM_TILES(stride, tile_size) (((stride) + (tile_size) - 1) / (tile_size))
269 #define IVI_MBs_PER_TILE(tile_width, tile_height, mb_size) \
270 ((((tile_width) + (mb_size) - 1) / (mb_size)) * (((tile_height) + (mb_size) - 1) / (mb_size)))
273 #define IVI_TOSIGNED(val) (-(((val) >> 1) ^ -((val) & 1)))
278 return (mv + (mv > 0) + (mv_scale - 1)) >> mv_scale;
int is_empty
= 1 if this band doesn't contain any data
uint32_t data_size
size of the frame data in bytes from picture header
uint8_t type
macroblock type: 0 - INTRA, 1 - INTER
int num_MBs
number of macroblocks in this tile
Huffman table is used for coding macroblocks.
macroblock/block huffman table descriptor
InvTransformPtr * inv_transform
int(* decode_pic_hdr)(struct IVI45DecContext *ctx, AVCodecContext *avctx)
int inter_scal
signals a sequence of scalable inter frames
int(* decode_mb_info)(struct IVI45DecContext *ctx, IVIBandDesc *band, IVITile *tile, AVCodecContext *avctx)
int num_tiles
number of tiles in this band
int dst_buf
buffer index for the currently decoded frame
int16_t * ref_buf
pointer to the reference frame buffer (for motion compensation)
uint8_t eob_sym
end of block symbol
int16_t * buf
pointer to the output buffer for this band
IVITile * tiles
array of tile descriptors
int is_halfpel
precision of the motion compensation: 0 - fullpel, 1 - halfpel
const RVMapDesc ff_ivi_rvmap_tabs[9]
Run-value (RLE) tables.
const uint8_t ff_ivi_direct_scan_4x4[16]
int plane
plane number this band belongs to
int bufsize
band buffer size in bytes
uint16_t ivi_calc_band_checksum(IVIBandDesc *band)
Calculate band checksum from band data.
void ff_ivi_init_static_vlc(void)
Initialize static codes used for macroblock and block decoding.
int quant_mat
dequant matrix index
RVMapDesc * rv_map
ptr to the RLE table for this band
const uint8_t * frame_data
input frame data pointer
const uint16_t * inter_base
quantization matrix for inter blocks
const uint8_t * data_ptr
ptr to the first byte of the band data
const uint8_t ff_ivi_vertical_scan_8x8[64]
Common scan patterns (defined in ivi_common.c)
int inherit_mv
tells if motion vector is inherited from reference macroblock
int pitch
pitch associated with the buffers above
uint8_t cbp
coded block pattern
int qdelta_present
tells if Qdelta signal is present in the bitstream (Indeo5 only)
uint16_t checksum
frame checksum
bitstream reader API header.
uint32_t pic_hdr_size
picture header size in bytes
IVIPlaneDesc planes[3]
color planes
int ff_ivi_init_planes(IVIPlaneDesc *planes, const IVIPicConfig *cfg)
Initialize planes (prepares descriptors, allocates buffers etc).
const uint16_t * intra_base
quantization matrix for intra blocks
int data_size
size of the band data
IVIHuffDesc cust_desc
pointer to the table associated with tab_sel
static int ivi_pic_config_cmp(IVIPicConfig *str1, IVIPicConfig *str2)
compare some properties of two pictures
RVMapDesc rvmap_tabs[9]
local corrected copy of the static rvmap tables
VLC ff_ivi_blk_vlc_tabs[8]
static block Huffman tables
uint8_t in_q
flag for explicitly stored quantiser delta
int ref_buf
inter frame reference buffer index
DCTransformPtr * dc_transform
int ff_ivi_init_tiles(IVIPlaneDesc *planes, int tile_width, int tile_height)
Initialize tile and macroblock descriptors.
int ivi_check_band(IVIBandDesc *band, const uint8_t *ref, int pitch)
Verify that band data lies in range.
int ff_ivi_huff_desc_cmp(const IVIHuffDesc *desc1, const IVIHuffDesc *desc2)
Compare two huffman codebook descriptors.
av_cold int ff_ivi_decode_close(AVCodecContext *avctx)
Close Indeo5 decoder and clean up its context.
struct IVI45DecContext IVI45DecContext
uint8_t esc_sym
escape symbol
run-value (RLE) table descriptor
int inherit_qdelta
tells if quantiser delta is inherited from reference macroblock
uint8_t num_bands
number of bands this plane subdivided into
int(* decode_band_hdr)(struct IVI45DecContext *ctx, IVIBandDesc *band, AVCodecContext *avctx)
IVIMbInfo * mbs
array of macroblock descriptors
const uint8_t * inter_scale
quantization coefficient for inter blocks
int8_t q_delta
quant delta
VLC ff_ivi_mb_vlc_tabs[8]
static macroblock Huffman tables
uint32_t frame_size
frame size in bytes
static const int8_t mv[256][2]
IVIHuffTab mb_vlc
current macroblock table descriptor
int is_2d_trans
1 indicates that the two-dimensional inverse transform is used
int glob_quant
quant base for this band
main external API structure.
static void(WINAPI *cond_broadcast)(pthread_cond_t *cond)
int aheight
aligned band height
int is_empty
= 1 if this tile doesn't contain any data
int num_corr
number of correction entries
information for Indeo tile
int(* is_nonnull_frame)(struct IVI45DecContext *ctx)
int buf_switch
used to switch between three buffers
void ff_ivi_output_plane(IVIPlaneDesc *plane, uint8_t *dst, int dst_pitch)
Convert and output the current plane.
void(* switch_buffers)(struct IVI45DecContext *ctx)
IVIBandDesc * bands
array of band descriptors
int32_t checksum
for debug purposes
int rvmap_sel
rvmap table selector
int8_t mv_x
motion vector (x component)
int8_t mv_y
motion vector (y component)
int mb_size
macroblock size
huffman codebook descriptor
int ff_ivi_create_huff_from_desc(const IVIHuffDesc *cb, VLC *vlc, int flag)
Generate a huffman codebook from the given descriptor and convert it into the Libav VLC table...
IVIMbInfo * ref_mbs
ptr to the macroblock descriptors of the reference tile
int ff_ivi_dec_tile_data_size(GetBitContext *gb)
Decode size of the tile data.
IVIHuffTab blk_vlc
current block table descriptor
void ff_ivi_free_buffers(IVIPlaneDesc *planes)
Free planes, bands and macroblocks buffers.
void( InvTransformPtr)(const int32_t *in, int16_t *out, uint32_t pitch, const uint8_t *flags)
Declare inverse transform function types.
int ref2_buf
temporal storage for switching buffers
VLC cust_tab
custom Huffman codebook descriptor
const uint8_t * scan
ptr to the scan pattern
int ff_ivi_decode_blocks(GetBitContext *gb, IVIBandDesc *band, IVITile *tile)
Decode block data: extract huffman-coded transform coefficients from the bitstream, dequantize them, apply inverse transform and motion compensation in order to reconstruct the picture.
static int ivi_scale_mv(int mv, int mv_scale)
scale motion vector
int transp_status
transparency mode status: 1 - enabled
static const struct @46 tab
TwinVQ codebooks.
int prev_frame_type
frame type of the previous frame
int ff_ivi_decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPacket *avpkt)
information for Indeo macroblock (16x16, 8x8 or 4x4)
IVIHuffTab blk_vlc
vlc table for decoding block data
const uint8_t * intra_scale
quantization coefficient for intra blocks
color plane (luma or chroma) information
int ff_ivi_dec_huff_desc(GetBitContext *gb, int desc_coded, int which_tab, IVIHuffTab *huff_tab, AVCodecContext *avctx)
Decode a huffman codebook descriptor from the bitstream and select specified huffman table...
uint32_t buf_offs
address in the output buffer for this mb
void ff_ivi_huff_desc_copy(IVIHuffDesc *dst, const IVIHuffDesc *src)
Copy huffman codebook descriptors.
information for Indeo wavelet band
void( DCTransformPtr)(const int32_t *in, int16_t *out, uint32_t pitch, int blk_size)
const uint8_t ff_ivi_horizontal_scan_8x8[64]
int data_size
size of the data in bytes