FFmpeg
4.0
|
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"
Go to the source code of this file.
Macros | |
#define | BITSTREAM_READER_LE |
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 | |
static int | ivi_mc (IVIBandDesc *band, ivi_mc_func mc, ivi_mc_avg_func mc_avg, int offs, int mv_x, int mv_y, int mv_x2, int mv_y2, int mc_type, int mc_type2) |
static uint16_t | inv_bits (uint16_t val, int nbits) |
Reverse "nbits" bits of the value "val" and return the result in the least significant bits. More... | |
static int | ivi_create_huff_from_desc (const IVIHuffDesc *cb, VLC *vlc, int flag) |
av_cold void | ff_ivi_init_static_vlc (void) |
Initialize static codes used for macroblock and block decoding. More... | |
static void | ivi_huff_desc_copy (IVIHuffDesc *dst, const IVIHuffDesc *src) |
static int | ivi_huff_desc_cmp (const IVIHuffDesc *desc1, const IVIHuffDesc *desc2) |
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... | |
static av_cold void | ivi_free_buffers (IVIPlaneDesc *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). More... | |
static int | ivi_init_tiles (IVIBandDesc *band, IVITile *ref_tile, int p, int b, int t_height, int t_width) |
av_cold int | ff_ivi_init_tiles (IVIPlaneDesc *planes, int tile_width, int tile_height) |
Initialize tile and macroblock descriptors. More... | |
static int | ivi_dec_tile_data_size (GetBitContext *gb) |
static int | ivi_dc_transform (IVIBandDesc *band, int *prev_dc, int buf_offs, int blk_size) |
static int | ivi_decode_coded_blocks (GetBitContext *gb, IVIBandDesc *band, ivi_mc_func mc, ivi_mc_avg_func mc_avg, int mv_x, int mv_y, int mv_x2, int mv_y2, int *prev_dc, int is_intra, int mc_type, int mc_type2, uint32_t quant, int offs, AVCodecContext *avctx) |
static int | ivi_decode_blocks (GetBitContext *gb, IVIBandDesc *band, IVITile *tile, AVCodecContext *avctx) |
static int | ivi_process_empty_tile (AVCodecContext *avctx, IVIBandDesc *band, IVITile *tile, int32_t mv_scale) |
Handle empty tiles by performing data copying and motion compensation respectively. More... | |
static void | ivi_output_plane (IVIPlaneDesc *plane, uint8_t *dst, ptrdiff_t dst_pitch) |
static int | decode_band (IVI45DecContext *ctx, IVIBandDesc *band, AVCodecContext *avctx) |
Decode an Indeo 4 or 5 band. 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. More... | |
Variables | |
static const IVIHuffDesc | ivi_mb_huff_desc [8] |
These are 2x8 predefined Huffman codebooks for coding macroblock/block signals. More... | |
static const IVIHuffDesc | ivi_blk_huff_desc [8] |
static block huffman tables More... | |
static VLC | ivi_mb_vlc_tabs [8] |
static macroblock Huffman tables More... | |
static VLC | ivi_blk_vlc_tabs [8] |
static block Huffman tables More... | |
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. More... | |
This file contains functions and data shared by both Indeo4 and Indeo5 decoders.
Definition in file ivi.c.
|
static |
Definition at line 82 of file ivi.c.
Referenced by ivi_decode_blocks(), ivi_decode_coded_blocks(), and ivi_process_empty_tile().
|
static |
Reverse "nbits" bits of the value "val" and return the result in the least significant bits.
Definition at line 123 of file ivi.c.
Referenced by ivi_create_huff_from_desc().
|
static |
Definition at line 145 of file ivi.c.
Referenced by ff_ivi_dec_huff_desc(), and ff_ivi_init_static_vlc().
Initialize static codes used for macroblock and block decoding.
Definition at line 179 of file ivi.c.
Referenced by decode_init(), and ivi_scale_mv().
|
static |
Definition at line 206 of file ivi.c.
Referenced by ff_ivi_dec_huff_desc().
|
static |
Definition at line 219 of file ivi.c.
Referenced by 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.
[in,out] | gb | the GetBit context |
[in] | desc_coded | flag signalling if table descriptor was coded |
[in] | which_tab | codebook purpose (IVI_MB_HUFF or IVI_BLK_HUFF) |
[out] | huff_tab | pointer to the descriptor of the selected table |
[in] | avctx | AVCodecContext pointer |
Definition at line 226 of file ivi.c.
Referenced by decode_band_hdr(), decode_pic_hdr(), and ivi_scale_mv().
|
static |
Definition at line 282 of file ivi.c.
Referenced by ff_ivi_decode_close(), and 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).
[in,out] | planes | pointer to the array of the plane descriptors |
[in] | cfg | pointer to the ivi_pic_config structure describing picture layout |
[in] | is_indeo4 | flag signalling if it is Indeo 4 or not |
Definition at line 305 of file ivi.c.
Referenced by decode_gop_header(), decode_init(), decode_pic_hdr(), and ivi_scale_mv().
|
static |
Definition at line 382 of file ivi.c.
Referenced by ff_ivi_init_tiles().
av_cold int ff_ivi_init_tiles | ( | IVIPlaneDesc * | planes, |
int | tile_width, | ||
int | tile_height | ||
) |
Initialize tile and macroblock descriptors.
[in,out] | planes | pointer to the array of the plane descriptors |
[in] | tile_width | tile width |
[in] | tile_height | tile height |
Definition at line 421 of file ivi.c.
Referenced by decode_gop_header(), decode_pic_hdr(), and ivi_scale_mv().
|
static |
Definition at line 471 of file ivi.c.
Referenced by decode_band().
|
static |
Definition at line 488 of file ivi.c.
Referenced by ivi_decode_blocks().
|
static |
Definition at line 503 of file ivi.c.
Referenced by ivi_decode_blocks().
|
static |
Definition at line 614 of file ivi.c.
Referenced by decode_band().
|
static |
Handle empty tiles by performing data copying and motion compensation respectively.
[in] | avctx | ptr to the AVCodecContext |
[in] | band | pointer to the band descriptor |
[in] | tile | pointer to the tile descriptor |
[in] | mv_scale | scaling factor for motion vectors |
Definition at line 761 of file ivi.c.
Referenced by decode_band().
|
static |
Definition at line 906 of file ivi.c.
Referenced by ff_ivi_decode_frame().
|
static |
Decode an Indeo 4 or 5 band.
[in,out] | ctx | ptr to the decoder context |
[in,out] | band | ptr to the band descriptor |
[in] | avctx | ptr to the AVCodecContext |
Definition at line 931 of file ivi.c.
Referenced by ff_ivi_decode_frame().
int ff_ivi_decode_frame | ( | AVCodecContext * | avctx, |
void * | data, | ||
int * | got_frame, | ||
AVPacket * | avpkt | ||
) |
Definition at line 1054 of file ivi.c.
Referenced by ff_ivi_decode_frame(), and ivi_scale_mv().
av_cold int ff_ivi_decode_close | ( | AVCodecContext * | avctx | ) |
Close Indeo5 decoder and clean up its context.
Definition at line 1200 of file ivi.c.
Referenced by ivi_scale_mv().
|
static |
These are 2x8 predefined Huffman codebooks for coding macroblock/block signals.
They are specified using "huffman descriptors" in order to avoid huge static tables. The decoding tables will be generated at startup from these descriptors.static macroblock huffman tables
|
static |
static block huffman tables
const uint8_t ff_ivi_vertical_scan_8x8[64] |
Scan patterns shared between indeo4 and indeo5.
Common scan patterns (defined in ivi_common.c)
Definition at line 1221 of file ivi.c.
Referenced by decode_gop_header().
const uint8_t ff_ivi_horizontal_scan_8x8[64] |
Definition at line 1232 of file ivi.c.
Referenced by decode_gop_header().
const uint8_t ff_ivi_direct_scan_4x4[16] |
Definition at line 1243 of file ivi.c.
Referenced by decode_gop_header().
const RVMapDesc ff_ivi_rvmap_tabs[9] |