FFmpeg
Macros | Functions | Variables
indeo4.c File Reference
#include "avcodec.h"
#include "codec_internal.h"
#include "get_bits.h"
#include "libavutil/imgutils.h"
#include "indeo4data.h"
#include "ivi.h"
#include "ivi_dsp.h"

Go to the source code of this file.

Macros

#define BITSTREAM_READER_LE
 
#define IVI4_PIC_SIZE_ESC   7
 

Functions

static int decode_plane_subdivision (GetBitContext *gb)
 Decode subdivision of a plane. More...
 
static int scale_tile_size (int def_size, int size_factor)
 
static int decode_pic_hdr (IVI45DecContext *ctx, AVCodecContext *avctx)
 Decode Indeo 4 picture header. More...
 
static int decode_band_hdr (IVI45DecContext *ctx, IVIBandDesc *arg_band, AVCodecContext *avctx)
 Decode Indeo 4 band header. More...
 
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 tile. More...
 
static void switch_buffers (IVI45DecContext *ctx)
 Rearrange decoding and reference buffers. More...
 
static int is_nonnull_frame (IVI45DecContext *ctx)
 
static av_cold int decode_init (AVCodecContext *avctx)
 

Variables

struct {
   InvTransformPtr *   inv_trans
 
   DCTransformPtr *   dc_trans
 
   int   is_2d_trans
 
transforms [18]
 
const FFCodec ff_indeo4_decoder
 

Detailed Description

Indeo Video Interactive version 4 decoder

Indeo 4 data is usually transported within .avi or .mov files. Known FOURCCs: 'IV41'

Definition in file indeo4.c.

Macro Definition Documentation

◆ BITSTREAM_READER_LE

#define BITSTREAM_READER_LE

Definition at line 30 of file indeo4.c.

◆ IVI4_PIC_SIZE_ESC

#define IVI4_PIC_SIZE_ESC   7

Definition at line 39 of file indeo4.c.

Function Documentation

◆ decode_plane_subdivision()

static int decode_plane_subdivision ( GetBitContext gb)
static

Decode subdivision of a plane.

This is a simplified version that checks for two supported subdivisions:

  • 1 wavelet band per plane, size factor 1:1, code pattern: 3
  • 4 wavelet bands per plane, size factor 1:4, code pattern: 2,3,3,3,3 Anything else is either unsupported or corrupt.
Parameters
[in,out]gbthe GetBit context
Returns
number of wavelet bands or 0 on error

Definition at line 77 of file indeo4.c.

Referenced by decode_pic_hdr().

◆ scale_tile_size()

static int scale_tile_size ( int  def_size,
int  size_factor 
)
inlinestatic

Definition at line 94 of file indeo4.c.

Referenced by decode_pic_hdr().

◆ decode_pic_hdr()

static int decode_pic_hdr ( IVI45DecContext ctx,
AVCodecContext avctx 
)
static

Decode Indeo 4 picture header.

Parameters
[in,out]ctxpointer to the decoder context
[in]avctxpointer to the AVCodecContext
Returns
result code: 0 = OK, negative number = error

Definition at line 106 of file indeo4.c.

Referenced by decode_init().

◆ decode_band_hdr()

static int decode_band_hdr ( IVI45DecContext ctx,
IVIBandDesc arg_band,
AVCodecContext avctx 
)
static

Decode Indeo 4 band header.

Parameters
[in,out]ctxpointer to the decoder context
[in,out]bandpointer to the band descriptor
[in]avctxpointer to the AVCodecContext
Returns
result code: 0 = OK, negative number = error

Definition at line 271 of file indeo4.c.

Referenced by decode_init().

◆ decode_mb_info()

static int decode_mb_info ( IVI45DecContext ctx,
IVIBandDesc band,
IVITile tile,
AVCodecContext avctx 
)
static

Decode information (block type, cbp, quant delta, motion vector) for all macroblocks in the current tile.

Parameters
[in,out]ctxpointer to the decoder context
[in,out]bandpointer to the band descriptor
[in,out]tilepointer to the tile descriptor
[in]avctxpointer to the AVCodecContext
Returns
result code: 0 = OK, negative number = error

Definition at line 469 of file indeo4.c.

Referenced by decode_init().

◆ switch_buffers()

static void switch_buffers ( IVI45DecContext ctx)
static

Rearrange decoding and reference buffers.

Parameters
[in,out]ctxpointer to the decoder context

Definition at line 635 of file indeo4.c.

Referenced by decode_init().

◆ is_nonnull_frame()

static int is_nonnull_frame ( IVI45DecContext ctx)
static

Definition at line 664 of file indeo4.c.

Referenced by decode_init().

◆ decode_init()

static av_cold int decode_init ( AVCodecContext avctx)
static

Definition at line 670 of file indeo4.c.

Variable Documentation

◆ inv_trans

InvTransformPtr* inv_trans

Definition at line 43 of file indeo4.c.

Referenced by decode_band_hdr().

◆ dc_trans

DCTransformPtr* dc_trans

Definition at line 44 of file indeo4.c.

◆ is_2d_trans

int is_2d_trans

Definition at line 45 of file indeo4.c.

◆ transforms

const { ... } transforms[18]

◆ ff_indeo4_decoder

const FFCodec ff_indeo4_decoder
Initial value:
= {
.p.name = "indeo4",
CODEC_LONG_NAME("Intel Indeo Video Interactive 4"),
.p.type = AVMEDIA_TYPE_VIDEO,
.priv_data_size = sizeof(IVI45DecContext),
.p.capabilities = AV_CODEC_CAP_DR1,
}

Definition at line 706 of file indeo4.c.

ff_ivi_inverse_haar_4x4
void ff_ivi_inverse_haar_4x4(const int32_t *in, int16_t *out, ptrdiff_t pitch, const uint8_t *flags)
two-dimensional inverse Haar 4x4 transform for Indeo 4
Definition: ivi_dsp.c:380
ff_ivi_row_haar4
void ff_ivi_row_haar4(const int32_t *in, int16_t *out, ptrdiff_t pitch, const uint8_t *flags)
one-dimensional inverse 4-point Haar transform on rows for Indeo 4
Definition: ivi_dsp.c:427
ff_ivi_col_haar8
void ff_ivi_col_haar8(const int32_t *in, int16_t *out, ptrdiff_t pitch, const uint8_t *flags)
one-dimensional inverse 8-point Haar transform on columns for Indeo 4
Definition: ivi_dsp.c:351
ff_ivi_put_pixels_8x8
void ff_ivi_put_pixels_8x8(const int32_t *in, int16_t *out, ptrdiff_t pitch, const uint8_t *flags)
Copy the pixels into the frame buffer.
Definition: ivi_dsp.c:752
ff_ivi_col_haar4
void ff_ivi_col_haar4(const int32_t *in, int16_t *out, ptrdiff_t pitch, const uint8_t *flags)
one-dimensional inverse 4-point Haar transform on columns for Indeo 4
Definition: ivi_dsp.c:449
ff_ivi_dc_row_slant
void ff_ivi_dc_row_slant(const int32_t *in, int16_t *out, ptrdiff_t pitch, int blk_size)
DC-only inverse row slant transform.
Definition: ivi_dsp.c:650
ff_ivi_decode_close
av_cold int ff_ivi_decode_close(AVCodecContext *avctx)
Close Indeo5 decoder and clean up its context.
Definition: ivi.c:1211
ff_ivi_col_slant8
void ff_ivi_col_slant8(const int32_t *in, int16_t *out, ptrdiff_t pitch, const uint8_t *flags)
inverse 1D column slant transform
Definition: ivi_dsp.c:668
FF_CODEC_DECODE_CB
#define FF_CODEC_DECODE_CB(func)
Definition: codec_internal.h:306
init
int(* init)(AVBSFContext *ctx)
Definition: dts2pts_bsf.c:365
ff_ivi_row_slant8
void ff_ivi_row_slant8(const int32_t *in, int16_t *out, ptrdiff_t pitch, const uint8_t *flags)
inverse 1D row slant transform
Definition: ivi_dsp.c:630
ff_ivi_col_slant4
void ff_ivi_col_slant4(const int32_t *in, int16_t *out, ptrdiff_t pitch, const uint8_t *flags)
inverse 1D column slant transform
Definition: ivi_dsp.c:729
CODEC_LONG_NAME
#define CODEC_LONG_NAME(str)
Definition: codec_internal.h:272
NULL
#define NULL
Definition: coverity.c:32
IVI45DecContext
Definition: ivi.h:213
AV_CODEC_CAP_DR1
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() or get_encode_buffer() for allocating buffers and supports custom allocators.
Definition: codec.h:52
ff_ivi_inverse_haar_8x8
void ff_ivi_inverse_haar_8x8(const int32_t *in, int16_t *out, ptrdiff_t pitch, const uint8_t *flags)
two-dimensional inverse Haar 8x8 transform for Indeo 4
Definition: ivi_dsp.c:271
ff_ivi_inverse_slant_8x8
void ff_ivi_inverse_slant_8x8(const int32_t *in, int16_t *out, ptrdiff_t pitch, const uint8_t *flags)
two-dimensional inverse slant 8x8 transform
Definition: ivi_dsp.c:537
AV_CODEC_ID_INDEO4
@ AV_CODEC_ID_INDEO4
Definition: codec_id.h:163
decode_init
static av_cold int decode_init(AVCodecContext *avctx)
Definition: indeo4.c:670
ff_ivi_row_slant4
void ff_ivi_row_slant4(const int32_t *in, int16_t *out, ptrdiff_t pitch, const uint8_t *flags)
inverse 1D row slant transform
Definition: ivi_dsp.c:709
ff_ivi_dc_slant_2d
void ff_ivi_dc_slant_2d(const int32_t *in, int16_t *out, ptrdiff_t pitch, int blk_size)
DC-only two-dimensional inverse slant transform.
Definition: ivi_dsp.c:617
ff_ivi_put_dc_pixel_8x8
void ff_ivi_put_dc_pixel_8x8(const int32_t *in, int16_t *out, ptrdiff_t pitch, int blk_size)
Copy the DC coefficient into the first pixel of the block and zero all others.
Definition: ivi_dsp.c:762
ff_ivi_dc_haar_2d
void ff_ivi_dc_haar_2d(const int32_t *in, int16_t *out, ptrdiff_t pitch, int blk_size)
DC-only two-dimensional inverse Haar transform for Indeo 4.
Definition: ivi_dsp.c:473
ff_ivi_decode_frame
int ff_ivi_decode_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame, AVPacket *avpkt)
Definition: ivi.c:1068
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
ff_ivi_row_haar8
void ff_ivi_row_haar8(const int32_t *in, int16_t *out, ptrdiff_t pitch, const uint8_t *flags)
one-dimensional inverse 8-point Haar transform on rows for Indeo 4
Definition: ivi_dsp.c:326
ff_ivi_dc_col_slant
void ff_ivi_dc_col_slant(const int32_t *in, int16_t *out, ptrdiff_t pitch, int blk_size)
DC-only inverse column slant transform.
Definition: ivi_dsp.c:695
ff_ivi_inverse_slant_4x4
void ff_ivi_inverse_slant_4x4(const int32_t *in, int16_t *out, ptrdiff_t pitch, const uint8_t *flags)
two-dimensional inverse slant 4x4 transform
Definition: ivi_dsp.c:577