FFmpeg
Macros | Functions
vc1.c File Reference
#include "avcodec.h"
#include "decode.h"
#include "mpegvideo.h"
#include "vc1.h"
#include "vc1data.h"
#include "wmv2data.h"
#include "unary.h"

Go to the source code of this file.

Macros

#define INIT_LUT(lumscale, lumshift, luty, lutuv, chain)
 
#define ROTATE(DEF, L, N, C, A)
 

Functions

static int vop_dquant_decoding (VC1Context *v)
 VOP Dquant decoding. More...
 
static int decode_sequence_header_adv (VC1Context *v, GetBitContext *gb)
 
int ff_vc1_decode_sequence_header (AVCodecContext *avctx, VC1Context *v, GetBitContext *gb)
 Decode Simple/Main Profiles sequence header. More...
 
int ff_vc1_decode_entry_point (AVCodecContext *avctx, VC1Context *v, GetBitContext *gb)
 
static void rotate_luts (VC1Context *v)
 
static int read_bfraction (VC1Context *v, GetBitContext *gb)
 
int ff_vc1_parse_frame_header (VC1Context *v, GetBitContext *gb)
 
int ff_vc1_parse_frame_header_adv (VC1Context *v, GetBitContext *gb)
 
VC-1 Bitplane decoding
See also
8.7, p56
static void decode_rowskip (uint8_t *plane, int width, int height, int stride, GetBitContext *gb)
 Decode rows by checking if they are skipped. More...
 
static void decode_colskip (uint8_t *plane, int width, int height, int stride, GetBitContext *gb)
 Decode columns by checking if they are skipped. More...
 
static int bitplane_decoding (uint8_t *data, int *raw_flag, VC1Context *v)
 Decode a bitplane's bits. More...
 

Detailed Description

VC-1 and WMV3 decoder common code

Definition in file vc1.c.

Macro Definition Documentation

◆ INIT_LUT

#define INIT_LUT (   lumscale,
  lumshift,
  luty,
  lutuv,
  chain 
)
Value:
do { \
int scale, shift, i; \
if (!lumscale) { \
scale = -64; \
shift = (255 - lumshift * 2) * 64; \
if (lumshift > 31) \
shift += 128 << 6; \
} else { \
scale = lumscale + 32; \
if (lumshift > 31) \
shift = (lumshift - 64) * 64; \
else \
shift = lumshift << 6; \
} \
for (i = 0; i < 256; i++) { \
int iy = chain ? luty[i] : i; \
int iu = chain ? lutuv[i] : i; \
luty[i] = av_clip_uint8((scale * iy + shift + 32) >> 6); \
lutuv[i] = av_clip_uint8((scale * (iu - 128) + 128*64 + 32) >> 6);\
} \
} while(0)

Definition at line 557 of file vc1.c.

◆ ROTATE

#define ROTATE (   DEF,
  L,
  N,
  C,
  A 
)
Value:
do { \
if (v->s.pict_type == AV_PICTURE_TYPE_BI || v->s.pict_type == AV_PICTURE_TYPE_B) { \
C = A; \
} else { \
DEF; \
memcpy(&tmp, L , sizeof(tmp)); \
memcpy(L , N , sizeof(tmp)); \
memcpy(N , &tmp, sizeof(tmp)); \
C = N; \
} \
} while(0)

Function Documentation

◆ decode_rowskip()

static void decode_rowskip ( uint8_t *  plane,
int  width,
int  height,
int  stride,
GetBitContext gb 
)
static

Decode rows by checking if they are skipped.

Parameters
planeBuffer to store decoded bits
[in]widthWidth of this buffer
[in]heightHeight of this buffer
[in]strideof this buffer

Definition at line 50 of file vc1.c.

Referenced by bitplane_decoding().

◆ decode_colskip()

static void decode_colskip ( uint8_t *  plane,
int  width,
int  height,
int  stride,
GetBitContext gb 
)
static

Decode columns by checking if they are skipped.

Parameters
planeBuffer to store decoded bits
[in]widthWidth of this buffer
[in]heightHeight of this buffer
[in]strideof this buffer
Todo:
FIXME: Optimize

Definition at line 72 of file vc1.c.

Referenced by bitplane_decoding().

◆ bitplane_decoding()

static int bitplane_decoding ( uint8_t *  data,
int raw_flag,
VC1Context v 
)
static

Decode a bitplane's bits.

Parameters
databitplane where to store the decode bits
[out]raw_flagpointer to the flag indicating that this bitplane is not coded explicitly
vVC-1 context for bit reading and logging
Returns
Status
Todo:
FIXME: Optimize

Definition at line 95 of file vc1.c.

Referenced by ff_vc1_parse_frame_header(), and ff_vc1_parse_frame_header_adv().

◆ vop_dquant_decoding()

static int vop_dquant_decoding ( VC1Context v)
static

VOP Dquant decoding.

Parameters
vVC-1 Context

Definition at line 228 of file vc1.c.

Referenced by ff_vc1_parse_frame_header(), and ff_vc1_parse_frame_header_adv().

◆ decode_sequence_header_adv()

static int decode_sequence_header_adv ( VC1Context v,
GetBitContext gb 
)
static

Definition at line 385 of file vc1.c.

Referenced by ff_vc1_decode_sequence_header().

◆ ff_vc1_decode_sequence_header()

int ff_vc1_decode_sequence_header ( AVCodecContext avctx,
VC1Context v,
GetBitContext gb 
)

Decode Simple/Main Profiles sequence header.

See also
Figure 7-8, p16-17
Parameters
avctxCodec context
gbGetBit context initialized from Codec context extra_data
Returns
Status

Definition at line 274 of file vc1.c.

Referenced by vc1_decode_init(), and vc1_extract_header().

◆ ff_vc1_decode_entry_point()

int ff_vc1_decode_entry_point ( AVCodecContext avctx,
VC1Context v,
GetBitContext gb 
)

Definition at line 496 of file vc1.c.

Referenced by vc1_decode_frame(), vc1_decode_init(), and vc1_extract_header().

◆ rotate_luts()

static void rotate_luts ( VC1Context v)
static

Definition at line 579 of file vc1.c.

Referenced by ff_vc1_parse_frame_header(), and ff_vc1_parse_frame_header_adv().

◆ read_bfraction()

static int read_bfraction ( VC1Context v,
GetBitContext gb 
)
static

Definition at line 602 of file vc1.c.

Referenced by ff_vc1_parse_frame_header(), and ff_vc1_parse_frame_header_adv().

◆ ff_vc1_parse_frame_header()

int ff_vc1_parse_frame_header ( VC1Context v,
GetBitContext gb 
)

Definition at line 617 of file vc1.c.

Referenced by decode_wmv9(), vc1_decode_frame(), and vc1_extract_header().

◆ ff_vc1_parse_frame_header_adv()

int ff_vc1_parse_frame_header_adv ( VC1Context v,
GetBitContext gb 
)

Definition at line 839 of file vc1.c.

Referenced by vc1_decode_frame(), and vc1_extract_header().

A
#define A(x)
Definition: vpx_arith.h:28
tmp
static uint8_t tmp[11]
Definition: aes_ctr.c:28
scale
static av_always_inline float scale(float x, float s)
Definition: vf_v360.c:1389
shift
static int shift(int a, int b)
Definition: bonk.c:253
N
#define N
Definition: af_mcompand.c:53
i
#define i(width, name, range_min, range_max)
Definition: cbs_h2645.c:269
AV_PICTURE_TYPE_B
@ AV_PICTURE_TYPE_B
Bi-dir predicted.
Definition: avutil.h:276
L
#define L(x)
Definition: vpx_arith.h:36
av_clip_uint8
#define av_clip_uint8
Definition: common.h:101
AV_PICTURE_TYPE_BI
@ AV_PICTURE_TYPE_BI
BI type.
Definition: avutil.h:280