FFmpeg
Macros | Typedefs | Functions | Variables
ivi.c File Reference

This file contains functions and data shared by both Indeo4 and Indeo5 decoders. More...

#include <inttypes.h>
#include "libavutil/attributes.h"
#include "libavutil/imgutils.h"
#include "libavutil/timer.h"
#include "avcodec.h"
#include "get_bits.h"
#include "internal.h"
#include "mathops.h"
#include "ivi.h"
#include "ivi_dsp.h"

Typedefs

typedef void(* ivi_mc_func) (int16_t *buf, const int16_t *ref_buf, ptrdiff_t pitch, int mc_type)
 
typedef void(* ivi_mc_avg_func) (int16_t *buf, const int16_t *ref_buf1, const int16_t *ref_buf2, ptrdiff_t pitch, int mc_type, int mc_type2)
 

Functions

av_cold void ff_ivi_init_static_vlc (void)
 Initialize static codes used for macroblock and block decoding.
 
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. More...
 
av_cold int ff_ivi_init_planes (AVCodecContext *avctx, IVIPlaneDesc *planes, const IVIPicConfig *cfg, int is_indeo4)
 Initialize planes (prepares descriptors, allocates buffers etc). More...
 
av_cold int ff_ivi_init_tiles (IVIPlaneDesc *planes, int tile_width, int tile_height)
 Initialize tile and macroblock descriptors. More...
 
int ff_ivi_decode_frame (AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
 
av_cold int ff_ivi_decode_close (AVCodecContext *avctx)
 Close Indeo5 decoder and clean up its context.
 

Variables

const uint8_t ff_ivi_vertical_scan_8x8 [64]
 Scan patterns shared between indeo4 and indeo5. More...
 
const uint8_t ff_ivi_horizontal_scan_8x8 [64]
 
const uint8_t ff_ivi_direct_scan_4x4 [16]
 
const RVMapDesc ff_ivi_rvmap_tabs [9]
 Run-value (RLE) tables.
 

Detailed Description

This file contains functions and data shared by both Indeo4 and Indeo5 decoders.

Function Documentation

§ ff_ivi_dec_huff_desc()

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.

Parameters
[in,out]gbthe GetBit context
[in]desc_codedflag signalling if table descriptor was coded
[in]which_tabcodebook purpose (IVI_MB_HUFF or IVI_BLK_HUFF)
[out]huff_tabpointer to the descriptor of the selected table
[in]avctxAVCodecContext pointer
Returns
zero on success, negative value otherwise

§ ff_ivi_init_planes()

av_cold int ff_ivi_init_planes ( AVCodecContext avctx,
IVIPlaneDesc planes,
const IVIPicConfig cfg,
int  is_indeo4 
)

Initialize planes (prepares descriptors, allocates buffers etc).

Parameters
[in,out]planespointer to the array of the plane descriptors
[in]cfgpointer to the ivi_pic_config structure describing picture layout
[in]is_indeo4flag signalling if it is Indeo 4 or not
Returns
result code: 0 - OK

§ ff_ivi_init_tiles()

av_cold int ff_ivi_init_tiles ( IVIPlaneDesc planes,
int  tile_width,
int  tile_height 
)

Initialize tile and macroblock descriptors.

Parameters
[in,out]planespointer to the array of the plane descriptors
[in]tile_widthtile width
[in]tile_heighttile height
Returns
result code: 0 - OK

Variable Documentation

§ ff_ivi_direct_scan_4x4

const uint8_t ff_ivi_direct_scan_4x4[16]
Initial value:
= {
0, 1, 4, 8, 5, 2, 3, 6, 9, 12, 13, 10, 7, 11, 14, 15
}

§ ff_ivi_horizontal_scan_8x8

const uint8_t ff_ivi_horizontal_scan_8x8[64]
Initial value:
= {
0, 1, 2, 3, 4, 5, 6, 7,
8, 9, 10, 11, 12, 13, 14, 15,
16, 17, 18, 19, 20, 21, 22, 23,
24, 25, 26, 27, 28, 29, 30, 31,
32, 33, 34, 35, 36, 37, 38, 39,
40, 41, 42, 43, 44, 45, 46, 47,
48, 49, 50, 51, 52, 53, 54, 55,
56, 57, 58, 59, 60, 61, 62, 63
}

§ ff_ivi_vertical_scan_8x8

const uint8_t ff_ivi_vertical_scan_8x8[64]
Initial value:
= {
0, 8, 16, 24, 32, 40, 48, 56,
1, 9, 17, 25, 33, 41, 49, 57,
2, 10, 18, 26, 34, 42, 50, 58,
3, 11, 19, 27, 35, 43, 51, 59,
4, 12, 20, 28, 36, 44, 52, 60,
5, 13, 21, 29, 37, 45, 53, 61,
6, 14, 22, 30, 38, 46, 54, 62,
7, 15, 23, 31, 39, 47, 55, 63
}

Scan patterns shared between indeo4 and indeo5.

Common scan patterns (defined in ivi_common.c)