libavcodec/vc1.c File Reference

VC-1 and WMV3 decoder common code. More...

#include "internal.h"
#include "dsputil.h"
#include "avcodec.h"
#include "mpegvideo.h"
#include "vc1.h"
#include "vc1data.h"
#include "msmpeg4data.h"
#include "unary.h"
#include "simple_idct.h"
#include <assert.h>

Go to the source code of this file.

Defines

#define INIT_LUT(lumscale, lumshift, luty, lutuv)

Enumerations

VC-1 Bitplane decoding
See also:
8.7, p56


enum  Imode {
  IMODE_RAW, IMODE_NORM2, IMODE_DIFF2, IMODE_NORM6,
  IMODE_DIFF6, IMODE_ROWSKIP, IMODE_COLSKIP, IMODE_RAW,
  IMODE_NORM2, IMODE_DIFF2, IMODE_NORM6, IMODE_DIFF6,
  IMODE_ROWSKIP, IMODE_COLSKIP
}
 Imode types. More...

Functions

static void decode_rowskip (uint8_t *plane, int width, int height, int stride, GetBitContext *gb)
 Decode rows by checking if they are skipped.
static void decode_colskip (uint8_t *plane, int width, int height, int stride, GetBitContext *gb)
 Decode columns by checking if they are skipped.
static int bitplane_decoding (uint8_t *data, int *raw_flag, VC1Context *v)
 Decode a bitplane's bits.
static int vop_dquant_decoding (VC1Context *v)
 VOP Dquant decoding.
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.
int ff_vc1_decode_entry_point (AVCodecContext *avctx, 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)
int ff_vc1_init_common (VC1Context *v)
 Init VC-1 specific tables and VC1Context members.

Variables

static const uint32_t vc1_ac_tables [AC_MODES][186][2]
static const uint16_t vlc_offs []


Detailed Description

VC-1 and WMV3 decoder common code.

Definition in file vc1.c.


Define Documentation

#define INIT_LUT ( lumscale,
lumshift,
luty,
lutuv   ) 

Value:

if (!lumscale) {                                \
        scale = -64;                                \
        shift = (255 - lumshift * 2) << 6;          \
        if (lumshift > 31)                          \
            shift += 128 << 6;                      \
    } else {                                        \
        scale = lumscale + 32;                      \
        if (lumshift > 31)                          \
            shift = (lumshift - 64) << 6;           \
        else                                        \
            shift = lumshift << 6;                  \
    }                                               \
    for (i = 0; i < 256; i++) {                     \
        luty[i]  = av_clip_uint8((scale * i + shift + 32) >> 6);           \
        lutuv[i] = av_clip_uint8((scale * (i - 128) + 128*64 + 32) >> 6);  \
    }

Definition at line 804 of file vc1.c.

Referenced by ff_vc1_parse_frame_header_adv().


Enumeration Type Documentation

enum Imode

Imode types.

Enumerator:
IMODE_RAW 
IMODE_NORM2 
IMODE_DIFF2 
IMODE_NORM6 
IMODE_DIFF6 
IMODE_ROWSKIP 
IMODE_COLSKIP 
IMODE_RAW 
IMODE_NORM2 
IMODE_DIFF2 
IMODE_NORM6 
IMODE_DIFF6 
IMODE_ROWSKIP 
IMODE_COLSKIP 

Definition at line 54 of file vc1.c.


Function Documentation

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

Decode a bitplane's bits.

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

Definition at line 116 of file vc1.c.

Referenced by ff_vc1_parse_frame_header(), and ff_vc1_parse_frame_header_adv().

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:
plane Buffer to store decoded bits
[in] width Width of this buffer
[in] height Height of this buffer
[in] stride of this buffer
Todo:
FIXME: Optimize

Definition at line 93 of file vc1.c.

Referenced by bitplane_decoding().

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:
plane Buffer to store decoded bits
[in] width Width of this buffer
[in] height Height of this buffer
[in] stride of this buffer

Definition at line 71 of file vc1.c.

Referenced by bitplane_decoding().

static int decode_sequence_header_adv ( VC1Context v,
GetBitContext gb 
) [static]

Definition at line 419 of file vc1.c.

Referenced by ff_vc1_decode_sequence_header().

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

Definition at line 528 of file vc1.c.

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

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:
avctx Codec context
gb GetBit context initialized from Codec context extra_data
Returns:
Status

Definition at line 294 of file vc1.c.

Referenced by vc1_decode_init(), and vc1_extract_headers().

int ff_vc1_init_common ( VC1Context v  ) 

Init VC-1 specific tables and VC1Context members.

Parameters:
v The VC1Context to initialize
Returns:
Status

Definition at line 1490 of file vc1.c.

Referenced by vc1_decode_init(), and vc1_parse_init().

int ff_vc1_parse_frame_header ( VC1Context v,
GetBitContext gb 
)

Definition at line 579 of file vc1.c.

Referenced by vc1_decode_frame(), and vc1_extract_headers().

int ff_vc1_parse_frame_header_adv ( VC1Context v,
GetBitContext gb 
)

Definition at line 822 of file vc1.c.

Referenced by vc1_decode_frame(), and vc1_extract_headers().

static int vop_dquant_decoding ( VC1Context v  )  [static]

VOP Dquant decoding.

Parameters:
v VC-1 Context

Definition at line 245 of file vc1.c.

Referenced by ff_vc1_parse_frame_header(), and ff_vc1_parse_frame_header_adv().


Variable Documentation

const uint32_t vc1_ac_tables[AC_MODES][186][2] [static]

Definition at line 1254 of file vc1.c.

Referenced by ff_vc1_init_common().

const uint16_t vlc_offs[] [static]

Initial value:

 {
        0,   520,   552,   616,  1128,  1160,  1224,  1740,  1772,  1836,  1900,  2436,
     2986,  3050,  3610,  4154,  4218,  4746,  5326,  5390,  5902,  6554,  7658,  8342,
     9304,  9988, 10630, 11234, 12174, 13006, 13560, 14232, 14786, 15432, 16350, 17522,
    20372, 21818, 22330, 22394, 23166, 23678, 23742, 24820, 25332, 25396, 26460, 26980,
    27048, 27592, 27600, 27608, 27616, 27624, 28224, 28258, 28290, 28802, 28834, 28866,
    29378, 29412, 29444, 29960, 29994, 30026, 30538, 30572, 30604, 31120, 31154, 31186,
    31714, 31746, 31778, 32306, 32340, 32372
}

Definition at line 1475 of file vc1.c.

Referenced by ff_vc1_init_common().


Generated on Fri Oct 26 02:47:59 2012 for FFmpeg by  doxygen 1.5.8