FFmpeg
Loading...
Searching...
No Matches
ivi.h File Reference

This file contains structures and macros shared by both Indeo4 and Indeo5 decoders. More...

#include "avcodec.h"
#include "get_bits.h"
#include <stdint.h>

Go to the source code of this file.

Data Structures

struct  IVIHuffDesc
 huffman codebook descriptor More...
 
struct  IVIHuffTab
 macroblock/block huffman table descriptor More...
 
struct  RVMapDesc
 run-value (RLE) table descriptor More...
 
struct  IVIMbInfo
 information for Indeo macroblock (16x16, 8x8 or 4x4) More...
 
struct  IVITile
 information for Indeo tile More...
 
struct  IVIBandDesc
 information for Indeo wavelet band More...
 
struct  IVIPlaneDesc
 color plane (luma or chroma) information More...
 
struct  IVIPicConfig
 
struct  IVI45DecContext
 

Macros

#define IVI_VLC_BITS   13
 max number of bits of the ivi's huffman codes
 
#define IVI5_IS_PROTECTED   0x20
 
#define IVI_NUM_TILES(stride, tile_size)
 calculate number of tiles in a stride
 
#define IVI_MBs_PER_TILE(tile_width, tile_height, mb_size)
 calculate number of macroblocks in a tile
 
#define IVI_TOSIGNED(val)
 convert unsigned values into signed ones (the sign is in the LSB)
 

Typedefs

typedef void InvTransformPtr(const int32_t *in, int16_t *out, ptrdiff_t pitch, const uint8_t *flags)
 Declare inverse transform function types.
 
typedef void DCTransformPtr(const int32_t *in, int16_t *out, ptrdiff_t pitch, int blk_size)
 

Enumerations

enum  {
  IVI4_FRAMETYPE_INTRA = 0 , IVI4_FRAMETYPE_INTRA1 = 1 , IVI4_FRAMETYPE_INTER = 2 , IVI4_FRAMETYPE_BIDIR = 3 ,
  IVI4_FRAMETYPE_INTER_NOREF = 4 , IVI4_FRAMETYPE_NULL_FIRST = 5 , IVI4_FRAMETYPE_NULL_LAST = 6
}
 Indeo 4 frame types. More...
 
enum  { IVI_MB_HUFF = 0 , IVI_BLK_HUFF = 1 }
 

Functions

static int ivi_pic_config_cmp (IVIPicConfig *str1, IVIPicConfig *str2)
 compare some properties of two pictures
 
static int ivi_scale_mv (int mv, int mv_scale)
 scale motion vector
 
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.
 
int ff_ivi_init_planes (AVCodecContext *avctx, IVIPlaneDesc *planes, const IVIPicConfig *cfg, int is_indeo4)
 Initialize planes (prepares descriptors, allocates buffers etc).
 
int ff_ivi_init_tiles (IVIPlaneDesc *planes, int tile_width, int tile_height)
 Initialize tile and macroblock descriptors.
 
int ff_ivi_decode_frame (AVCodecContext *avctx, AVFrame *data, int *got_frame, AVPacket *avpkt)
 
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]
 Common scan patterns (defined in ivi_common.c)
 
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 structures and macros shared by both Indeo4 and Indeo5 decoders.

Definition in file ivi.h.

Macro Definition Documentation

◆ IVI_VLC_BITS

#define IVI_VLC_BITS   13

max number of bits of the ivi's huffman codes

Definition at line 49 of file ivi.h.

Referenced by decode_mb_info(), decode_mb_info(), ivi_create_huff_from_desc(), and ivi_decode_coded_blocks().

◆ IVI5_IS_PROTECTED

#define IVI5_IS_PROTECTED   0x20

Definition at line 50 of file ivi.h.

Referenced by decode_gop_header(), and ff_ivi_decode_frame().

◆ IVI_NUM_TILES

#define IVI_NUM_TILES ( stride,
tile_size )
Value:
(((stride) + (tile_size) - 1) / (tile_size))
#define stride

calculate number of tiles in a stride

Definition at line 282 of file ivi.h.

Referenced by ff_ivi_init_tiles().

◆ IVI_MBs_PER_TILE

#define IVI_MBs_PER_TILE ( tile_width,
tile_height,
mb_size )
Value:
((((tile_width) + (mb_size) - 1) / (mb_size)) * (((tile_height) + (mb_size) - 1) / (mb_size)))

calculate number of macroblocks in a tile

Definition at line 285 of file ivi.h.

Referenced by decode_mb_info(), ivi_init_tiles(), and ivi_process_empty_tile().

◆ IVI_TOSIGNED

#define IVI_TOSIGNED ( val)
Value:
(-(((val) >> 1) ^ -((val) & 1)))
static double val(void *priv, double ch)
Definition aeval.c:77

convert unsigned values into signed ones (the sign is in the LSB)

Definition at line 289 of file ivi.h.

Referenced by decode_mb_info(), decode_mb_info(), and ivi_decode_coded_blocks().

Typedef Documentation

◆ InvTransformPtr

typedef void InvTransformPtr(const int32_t *in, int16_t *out, ptrdiff_t pitch, const uint8_t *flags)

Declare inverse transform function types.

Definition at line 89 of file ivi.h.

◆ DCTransformPtr

typedef void DCTransformPtr(const int32_t *in, int16_t *out, ptrdiff_t pitch, int blk_size)

Definition at line 90 of file ivi.h.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum

Indeo 4 frame types.

Enumerator
IVI4_FRAMETYPE_INTRA 
IVI4_FRAMETYPE_INTRA1 

intra frame with slightly different bitstream coding

IVI4_FRAMETYPE_INTER 

non-droppable P-frame

IVI4_FRAMETYPE_BIDIR 

bidirectional frame

IVI4_FRAMETYPE_INTER_NOREF 

droppable P-frame

IVI4_FRAMETYPE_NULL_FIRST 

empty frame with no data

IVI4_FRAMETYPE_NULL_LAST 

empty frame with no data

Definition at line 39 of file ivi.h.

◆ anonymous enum

anonymous enum
Enumerator
IVI_MB_HUFF 

Huffman table is used for coding macroblocks.

IVI_BLK_HUFF 

Huffman table is used for coding blocks.

Definition at line 72 of file ivi.h.

Function Documentation

◆ ivi_pic_config_cmp()

static int ivi_pic_config_cmp ( IVIPicConfig * str1,
IVIPicConfig * str2 )
inlinestatic

compare some properties of two pictures

Definition at line 273 of file ivi.h.

Referenced by decode_gop_header(), and decode_pic_hdr().

◆ ivi_scale_mv()

static int ivi_scale_mv ( int mv,
int mv_scale )
inlinestatic

scale motion vector

Definition at line 292 of file ivi.h.

Referenced by decode_mb_info(), decode_mb_info(), and ivi_process_empty_tile().

◆ ff_ivi_init_static_vlc()

void ff_ivi_init_static_vlc ( void )

Initialize static codes used for macroblock and block decoding.

Definition at line 179 of file ivi.c.

Referenced by decode_init(), and decode_init().

◆ 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

Definition at line 211 of file ivi.c.

Referenced by decode_band_hdr(), decode_band_hdr(), decode_pic_hdr(), and decode_pic_hdr().

◆ ff_ivi_init_planes()

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

Definition at line 292 of file ivi.c.

Referenced by decode_gop_header(), decode_init(), and decode_pic_hdr().

◆ ff_ivi_init_tiles()

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

Definition at line 396 of file ivi.c.

Referenced by decode_gop_header(), and decode_pic_hdr().

◆ ff_ivi_decode_frame()

int ff_ivi_decode_frame ( AVCodecContext * avctx,
AVFrame * data,
int * got_frame,
AVPacket * avpkt )

Definition at line 1071 of file ivi.c.

Referenced by ff_ivi_decode_frame().

◆ ff_ivi_decode_close()

int ff_ivi_decode_close ( AVCodecContext * avctx)

Close Indeo5 decoder and clean up its context.

Definition at line 1214 of file ivi.c.

Variable Documentation

◆ ff_ivi_vertical_scan_8x8

const uint8_t ff_ivi_vertical_scan_8x8[64]
extern

Common scan patterns (defined in ivi_common.c)

Common scan patterns (defined in ivi_common.c)

Definition at line 1235 of file ivi.c.

Referenced by decode_gop_header().

◆ ff_ivi_horizontal_scan_8x8

const uint8_t ff_ivi_horizontal_scan_8x8[64]
extern

Definition at line 1246 of file ivi.c.

Referenced by decode_gop_header().

◆ ff_ivi_direct_scan_4x4

const uint8_t ff_ivi_direct_scan_4x4[16]
extern

Definition at line 1257 of file ivi.c.

Referenced by decode_gop_header().

◆ ff_ivi_rvmap_tabs

const RVMapDesc ff_ivi_rvmap_tabs[9]
extern

Run-value (RLE) tables.

Definition at line 1265 of file ivi.c.

Referenced by decode_init(), and decode_init().