libavcodec/rv34.c File Reference

RV30/40 decoder common data. More...

#include "avcodec.h"
#include "dsputil.h"
#include "mpegvideo.h"
#include "golomb.h"
#include "mathops.h"
#include "rectangle.h"
#include "rv34vlc.h"
#include "rv34data.h"
#include "rv34.h"

Go to the source code of this file.


#define GET_PTS_DIFF(a, b)   ((a - b + 8192) & 0x1FFF)
#define LUMA_CBP_BLOCK_MASK   0x33
 mask for retrieving all bits in coded block pattern corresponding to one 8x8 block
#define U_CBP_MASK   0x0F0000
#define V_CBP_MASK   0xF00000


static void rv34_gen_vlc (const uint8_t *bits, int size, VLC *vlc, const uint8_t *insyms)
 Generate VLC from codeword lengths.
static av_cold void rv34_init_tables (void)
 Initialize all tables.
static av_always_inline void rv34_row_transform (int temp[16], DCTELEM *block)
static void rv34_inv_transform (DCTELEM *block)
 Real Video 3.0/4.0 inverse transform Code is almost the same as in SVQ3, only scaling is different.
static void rv34_inv_transform_noround (DCTELEM *block)
 RealVideo 3.0/4.0 inverse transform for DC block.
static int rv34_decode_cbp (GetBitContext *gb, RV34VLC *vlc, int table)
 Decode coded block pattern.
static void decode_coeff (DCTELEM *dst, int coef, int esc, GetBitContext *gb, VLC *vlc)
 Get one coefficient value from the bistream and store it.
static void decode_subblock (DCTELEM *dst, int code, const int is_block2, GetBitContext *gb, VLC *vlc)
 Decode 2x2 subblock of coefficients.
static void rv34_decode_block (DCTELEM *dst, GetBitContext *gb, RV34VLC *rvlc, int fc, int sc)
 Decode coefficients for 4x4 block.
static void rv34_dequant4x4 (DCTELEM *block, int Qdc, int Q)
 Dequantize ordinary 4x4 block.
static void rv34_dequant4x4_16x16 (DCTELEM *block, int Qdc, int Q)
 Dequantize 4x4 block of DC values for 16x16 macroblock.
int ff_rv34_get_start_offset (GetBitContext *gb, int mb_size)
 Decode starting slice position.
static RV34VLCchoose_vlc_set (int quant, int mod, int type)
 Select VLC set for decoding from current quantizer, modifier and frame type.
static int rv34_decode_dquant (GetBitContext *gb, int quant)
 Decode quantizer difference and return modified quantizer.
static void rv34_pred_mv (RV34DecContext *r, int block_type, int subblock_no, int dmv_no)
 motion vector prediction
static int calc_add_mv (RV34DecContext *r, int dir, int val)
 Calculate motion vector component that should be added for direct blocks.
static void rv34_pred_b_vector (int A[2], int B[2], int C[2], int A_avail, int B_avail, int C_avail, int *mx, int *my)
 Predict motion vector for B-frame macroblock.
static void rv34_pred_mv_b (RV34DecContext *r, int block_type, int dir)
 motion vector prediction for B-frames
static void rv34_pred_mv_rv3 (RV34DecContext *r, int block_type, int dir)
 motion vector prediction - RV3 version
static void rv34_mc (RV34DecContext *r, const int block_type, const int xoff, const int yoff, int mv_off, const int width, const int height, int dir, const int thirdpel, qpel_mc_func(*qpel_mc)[16], h264_chroma_mc_func(*chroma_mc))
 generic motion compensation function
static void rv34_mc_1mv (RV34DecContext *r, const int block_type, const int xoff, const int yoff, int mv_off, const int width, const int height, int dir)
static void rv34_mc_2mv (RV34DecContext *r, const int block_type)
static void rv34_mc_2mv_skip (RV34DecContext *r)
static int rv34_decode_mv (RV34DecContext *r, int block_type)
 Decode motion vector differences and perform motion vector reconstruction and motion compensation.
static void rv34_pred_4x4_block (RV34DecContext *r, uint8_t *dst, int stride, int itype, int up, int left, int down, int right)
 Perform 4x4 intra prediction.
static void rv34_add_4x4_block (uint8_t *dst, int stride, DCTELEM block[64], int off)
 add_pixels_clamped for 4x4 block
static int adjust_pred16 (int itype, int up, int left)
static void rv34_output_macroblock (RV34DecContext *r, int8_t *intra_types, int cbp, int is16)
static int rv34_decode_mb_header (RV34DecContext *r, int8_t *intra_types)
static void rv34_apply_differences (RV34DecContext *r, int cbp)
static int is_mv_diff_gt_3 (int16_t(*motion_val)[2], int step)
static int rv34_set_deblock_coef (RV34DecContext *r)
static int rv34_decode_macroblock (RV34DecContext *r, int8_t *intra_types)
static int check_slice_end (RV34DecContext *r, MpegEncContext *s)
static int slice_compare (SliceInfo *si1, SliceInfo *si2)
static int rv34_decode_slice (RV34DecContext *r, int end, const uint8_t *buf, int buf_size)
av_cold int ff_rv34_decode_init (AVCodecContext *avctx)
 Initialize decoder.
static int get_slice_offset (AVCodecContext *avctx, const uint8_t *buf, int n)
int ff_rv34_decode_frame (AVCodecContext *avctx, void *data, int *data_size, const uint8_t *buf, int buf_size)
av_cold int ff_rv34_decode_end (AVCodecContext *avctx)


static const int rv34_mb_type_to_lavc [12]
 translation of RV30/40 macroblock types to lavc ones
static RV34VLC intra_vlcs [NUM_INTRA_TABLES]
static RV34VLC inter_vlcs [NUM_INTER_TABLES]
static const uint8_t part_sizes_w [RV34_MB_TYPES] = { 2, 2, 2, 1, 2, 2, 2, 2, 2, 1, 2, 2 }
 macroblock partition width in 8x8 blocks
static const uint8_t part_sizes_h [RV34_MB_TYPES] = { 2, 2, 2, 1, 2, 2, 2, 2, 1, 2, 2, 2 }
 macroblock partition height in 8x8 blocks
static const uint8_t avail_indexes [4] = { 5, 6, 9, 10 }
 availability index for subblocks
static const int chroma_coeffs [3] = { 0, 3, 5 }
static const int num_mvs [RV34_MB_TYPES] = { 0, 0, 1, 4, 1, 1, 0, 0, 2, 2, 2, 1 }
 number of motion vectors in each macroblock type
static const int ittrans [9]
 mapping of RV30/40 intra prediction types to standard H.264 types
static const int ittrans16 [4]
 mapping of RV30/40 intra 16x16 prediction types to standard H.264 types

Detailed Description

RV30/40 decoder common data.

Definition in file rv34.c.

Function Documentation

av_cold int ff_rv34_decode_end ( AVCodecContext avctx  ) 

Definition at line 1487 of file rv34.c.

int ff_rv34_decode_frame ( AVCodecContext avctx,
void *  data,
int *  data_size,
const uint8_t *  buf,
int  buf_size 

Definition at line 1382 of file rv34.c.

av_cold int ff_rv34_decode_init ( AVCodecContext avctx  ) 

Initialize decoder.

Definition at line 1336 of file rv34.c.

Referenced by rv30_decode_init(), and rv40_decode_init().

static int get_slice_offset ( AVCodecContext avctx,
const uint8_t *  buf,
int  n 
) [static]

Definition at line 1376 of file rv34.c.

static int rv34_decode_mb_header ( RV34DecContext r,
int8_t *  intra_types 
) [static]

Definition at line 998 of file rv34.c.

Referenced by rv34_decode_macroblock().

Variable Documentation

RV34VLC inter_vlcs[NUM_INTER_TABLES] [static]

Definition at line 57 of file rv34.c.

RV34VLC intra_vlcs[NUM_INTRA_TABLES] [static]

Definition at line 57 of file rv34.c.

const int rv34_mb_type_to_lavc[12] [static]

Generated on Fri Oct 26 02:35:44 2012 for FFmpeg by  doxygen 1.5.8