49 #define IVI_VLC_BITS 13 50 #define IVI5_IS_PROTECTED 0x20
283 #define IVI_NUM_TILES(stride, tile_size) (((stride) + (tile_size) - 1) / (tile_size)) 286 #define IVI_MBs_PER_TILE(tile_width, tile_height, mb_size) \ 287 ((((tile_width) + (mb_size) - 1) / (mb_size)) * (((tile_height) + (mb_size) - 1) / (mb_size))) 290 #define IVI_TOSIGNED(val) (-(((val) >> 1) ^ -((val) & 1))) 295 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
const uint8_t ff_ivi_direct_scan_4x4[16]
static av_always_inline void mv_scale(Mv *dst, Mv *src, int td, int tb)
This structure describes decoded (raw) audio or video data.
macroblock/block huffman table descriptor
InvTransformPtr * inv_transform
static int decode_pic_hdr(IVI45DecContext *ctx, AVCodecContext *avctx)
Decode Indeo 4 picture header.
int inter_scal
signals a sequence of scalable inter frames
int8_t b_mv_y
second motion vector (y component)
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
int plane
plane number this band belongs to
int bufsize
band buffer size in bytes
int quant_mat
dequant matrix index
RVMapDesc * rv_map
ptr to the RLE table for this band
int8_t b_mv_x
second motion vector (x component)
intra frame with slightly different bitstream coding
ptrdiff_t pitch
pitch associated with the buffers above
VLC * tab
index of one of the predefined tables or "7" for custom one
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
int inherit_mv
tells if motion vector is inherited from reference macroblock
static int decode_band_hdr(IVI45DecContext *ctx, IVIBandDesc *band, AVCodecContext *avctx)
Decode Indeo 4 band header.
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
int ff_ivi_init_tiles(IVIPlaneDesc *planes, int tile_width, int tile_height)
Initialize tile and macroblock descriptors.
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
const uint8_t ff_ivi_vertical_scan_8x8[64]
Common scan patterns (defined in ivi_common.c)
uint8_t in_q
flag for explicitly stored quantiser delta
int ref_buf
inter frame reference buffer index
DCTransformPtr * dc_transform
void ff_ivi_init_static_vlc(void)
Initialize static codes used for macroblock and block decoding.
static int ivi_pic_config_cmp(IVIPicConfig *str1, IVIPicConfig *str2)
compare some properties of two pictures
uint8_t esc_sym
escape symbol
run-value (RLE) table descriptor
int inherit_qdelta
tells if quantiser delta is inherited from reference macroblock
void() InvTransformPtr(const int32_t *in, int16_t *out, ptrdiff_t pitch, const uint8_t *flags)
Declare inverse transform function types.
uint8_t num_bands
number of bands this plane subdivided into
void() DCTransformPtr(const int32_t *in, int16_t *out, ptrdiff_t pitch, int blk_size)
IVIMbInfo * mbs
array of macroblock descriptors
int16_t * b_ref_buf
pointer to the second reference frame buffer (for motion compensation)
static void switch_buffers(IVI45DecContext *ctx)
Rearrange decoding and reference buffers.
const uint8_t * inter_scale
quantization coefficient for inter blocks
const uint8_t ff_ivi_horizontal_scan_8x8[64]
int8_t q_delta
quant delta
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
Libavcodec external API header.
int glob_quant
quant base for this band
typedef void(RENAME(mix_any_func_type))
main external API structure.
int aheight
aligned band height
int is_empty
= 1 if this tile doesn't contain any data
int num_corr
number of correction entries
static int ivi_scale_mv(int mv, int mv_scale)
scale motion vector
information for Indeo tile
int buf_switch
used to switch between three buffers
uint8_t pi<< 24) CONV_FUNC_GROUP(AV_SAMPLE_FMT_FLT, float, AV_SAMPLE_FMT_U8, uint8_t,(*(const uint8_t *) pi - 0x80) *(1.0f/(1<< 7))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_DBL, double, AV_SAMPLE_FMT_U8, uint8_t,(*(const uint8_t *) pi - 0x80) *(1.0/(1<< 7))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_S16, int16_t,(*(const int16_t *) pi >> 8)+0x80) CONV_FUNC_GROUP(AV_SAMPLE_FMT_FLT, float, AV_SAMPLE_FMT_S16, int16_t, *(const int16_t *) pi *(1.0f/(1<< 15))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_DBL, double, AV_SAMPLE_FMT_S16, int16_t, *(const int16_t *) pi *(1.0/(1<< 15))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_S32, int32_t,(*(const int32_t *) pi >> 24)+0x80) CONV_FUNC_GROUP(AV_SAMPLE_FMT_FLT, float, AV_SAMPLE_FMT_S32, int32_t, *(const int32_t *) pi *(1.0f/(1U<< 31))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_DBL, double, AV_SAMPLE_FMT_S32, int32_t, *(const int32_t *) pi *(1.0/(1U<< 31))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_FLT, float, av_clip_uint8(lrintf(*(const float *) pi *(1<< 7))+0x80)) CONV_FUNC_GROUP(AV_SAMPLE_FMT_S16, int16_t, AV_SAMPLE_FMT_FLT, float, av_clip_int16(lrintf(*(const float *) pi *(1<< 15)))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_S32, int32_t, AV_SAMPLE_FMT_FLT, float, av_clipl_int32(llrintf(*(const float *) pi *(1U<< 31)))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_DBL, double, av_clip_uint8(lrint(*(const double *) pi *(1<< 7))+0x80)) CONV_FUNC_GROUP(AV_SAMPLE_FMT_S16, int16_t, AV_SAMPLE_FMT_DBL, double, av_clip_int16(lrint(*(const double *) pi *(1<< 15)))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_S32, int32_t, AV_SAMPLE_FMT_DBL, double, av_clipl_int32(llrint(*(const double *) pi *(1U<< 31)))) #define SET_CONV_FUNC_GROUP(ofmt, ifmt) static void set_generic_function(AudioConvert *ac) { } void ff_audio_convert_free(AudioConvert **ac) { if(! *ac) return;ff_dither_free(&(*ac) ->dc);av_freep(ac);} AudioConvert *ff_audio_convert_alloc(AVAudioResampleContext *avr, enum AVSampleFormat out_fmt, enum AVSampleFormat in_fmt, int channels, int sample_rate, int apply_map) { AudioConvert *ac;int in_planar, out_planar;ac=av_mallocz(sizeof(*ac));if(!ac) return NULL;ac->avr=avr;ac->out_fmt=out_fmt;ac->in_fmt=in_fmt;ac->channels=channels;ac->apply_map=apply_map;if(avr->dither_method !=AV_RESAMPLE_DITHER_NONE &&av_get_packed_sample_fmt(out_fmt)==AV_SAMPLE_FMT_S16 &&av_get_bytes_per_sample(in_fmt) > 2) { ac->dc=ff_dither_alloc(avr, out_fmt, in_fmt, channels, sample_rate, apply_map);if(!ac->dc) { av_free(ac);return NULL;} return ac;} in_planar=ff_sample_fmt_is_planar(in_fmt, channels);out_planar=ff_sample_fmt_is_planar(out_fmt, channels);if(in_planar==out_planar) { ac->func_type=CONV_FUNC_TYPE_FLAT;ac->planes=in_planar ? ac->channels :1;} else if(in_planar) ac->func_type=CONV_FUNC_TYPE_INTERLEAVE;else ac->func_type=CONV_FUNC_TYPE_DEINTERLEAVE;set_generic_function(ac);if(ARCH_AARCH64) ff_audio_convert_init_aarch64(ac);if(ARCH_ARM) ff_audio_convert_init_arm(ac);if(ARCH_X86) ff_audio_convert_init_x86(ac);return ac;} int ff_audio_convert(AudioConvert *ac, AudioData *out, AudioData *in) { int use_generic=1;int len=in->nb_samples;int p;if(ac->dc) { av_log(ac->avr, AV_LOG_TRACE, "%d samples - audio_convert: %s to %s (dithered)\", len, av_get_sample_fmt_name(ac->in_fmt), av_get_sample_fmt_name(ac->out_fmt));return ff_convert_dither(ac-> in
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...
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
IVIMbInfo * ref_mbs
ptr to the macroblock descriptors of the reference tile
IVIHuffTab blk_vlc
current block table descriptor
const RVMapDesc ff_ivi_rvmap_tabs[9]
Run-value (RLE) tables.
int ref2_buf
temporal storage for switching buffers
static int is_nonnull_frame(IVI45DecContext *ctx)
VLC cust_tab
custom Huffman codebook descriptor
static const struct @272 planes[]
int ff_ivi_init_planes(AVCodecContext *avctx, IVIPlaneDesc *planes, const IVIPicConfig *cfg, int is_indeo4)
Initialize planes (prepares descriptors, allocates buffers etc).
static int decode_mb_info(IVI45DecContext *ctx, IVIBandDesc *band, IVITile *tile, AVCodecContext *avctx)
Decode information (block type, cbp, quant delta, motion vector) for all macroblocks in the current t...
const uint8_t * scan
ptr to the scan pattern
Huffman table is used for coding macroblocks.
uint8_t has_transp
transparency mode status: 1 - enabled
int prev_frame_type
frame type of the previous frame
information for Indeo macroblock (16x16, 8x8 or 4x4)
IVIHuffTab blk_vlc
vlc table for decoding block data
int scan_size
size of the scantable
const uint8_t * intra_scale
quantization coefficient for intra blocks
color plane (luma or chroma) information
int ff_ivi_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
uint32_t buf_offs
address in the output buffer for this mb
int b_ref_buf
second reference frame buffer index
information for Indeo wavelet band
This structure stores compressed data.
int ff_ivi_decode_close(AVCodecContext *avctx)
Close Indeo5 decoder and clean up its context.
int data_size
size of the data in bytes