rdoq_cabac.c File Reference

Rate Distortion Optimized Quantization based on VCEG-AH21 related to CABAC. More...

#include "contributors.h"
#include <math.h>
#include <float.h>
#include "global.h"
#include "cabac.h"
#include "image.h"
#include "fmo.h"
#include "macroblock.h"
#include "mb_access.h"
#include "ratectl.h"
#include "rdoq.h"

Include dependency graph for rdoq_cabac.c:

Go to the source code of this file.

Functions

void precalculate_unary_exp_golomb_level ()
int est_unary_exp_golomb_level_bits (unsigned int symbol, int bits0, int bits1)
int est_exp_golomb_encode_eq_prob (unsigned int symbol)
void estRunLevel_CABAC (Slice *currSlice, Macroblock *currMB, int context)
void est_CBP_block_bit (Slice *currSlice, Macroblock *currMB, EncodingEnvironmentPtr eep_dp, int type)
void est_significance_map (Slice *currSlice, Macroblock *currMB, EncodingEnvironmentPtr eep_dp, int type)
void est_significant_coefficients (Slice *currSlice, Macroblock *currMB, EncodingEnvironmentPtr eep_dp, int type)
int biari_no_bits (EncodingEnvironmentPtr eep, signed short symbol, BiContextTypePtr bi_ct)
int biari_state (EncodingEnvironmentPtr eep, signed short symbol, BiContextTypePtr bi_ct)
int est_write_and_store_CBP_block_bit (Macroblock *currMB, int type)
void est_writeRunLevel_CABAC (levelDataStruct levelData[], int levelTabMin[], int type, double lambda, int kInit, int kStop, int noCoeff, int estCBP)
int est_unary_exp_golomb_level_encode (unsigned int symbol, int ctx, int type)
int init_trellis_data_4x4_CABAC (int **tblock, int block_x, int qp_per, int qp_rem, int **levelscale, int **leveloffset, const byte *p_scan, Macroblock *currMB, levelDataStruct *dataLevel, int *kStart, int *kStop, int type)
int init_trellis_data_8x8_CABAC (int **tblock, int block_x, int qp_per, int qp_rem, int **levelscale, int **leveloffset, const byte *p_scan, Macroblock *currMB, levelDataStruct *dataLevel, int *kStart, int *kStop, int symbolmode)
int init_trellis_data_DC_CABAC (int **tblock, int qp_per, int qp_rem, int levelscale, int leveloffset, const byte *p_scan, Macroblock *currMB, levelDataStruct *dataLevel, int *kStart, int *kStop)

Variables

const int entropyBits [128]
const int estErr4x4 [6][4][4]
const int estErr8x8 [6][8][8]
int precalcUnaryLevelTab [128][MAX_PREC_COEFF]
estBitsCabacStruct estBitsCabac [NUM_BLOCK_TYPES]


Detailed Description

Rate Distortion Optimized Quantization based on VCEG-AH21 related to CABAC.

Definition in file rdoq_cabac.c.


Function Documentation

void est_CBP_block_bit ( Slice *  currSlice,
Macroblock *  currMB,
EncodingEnvironmentPtr  eep_dp,
int  type 
)

estimate bit cost for each CBP bit

Definition at line 156 of file rdoq_cabac.c.

References Slice::tex_ctx.

Referenced by estRunLevel_CABAC().

int est_exp_golomb_encode_eq_prob ( unsigned int  symbol  ) 

estimate exp golomb bit cost

Definition at line 111 of file rdoq_cabac.c.

Referenced by est_unary_exp_golomb_level_encode().

void est_significance_map ( Slice *  currSlice,
Macroblock *  currMB,
EncodingEnvironmentPtr  eep_dp,
int  type 
)

estimate CABAC bit cost for significant coefficient map

Definition at line 175 of file rdoq_cabac.c.

References macroblock::mb_field, ImageParameters::structure, and Slice::tex_ctx.

Referenced by estRunLevel_CABAC().

void est_significant_coefficients ( Slice *  currSlice,
Macroblock *  currMB,
EncodingEnvironmentPtr  eep_dp,
int  type 
)

estimate bit cost of significant coefficient

Definition at line 214 of file rdoq_cabac.c.

References Slice::tex_ctx.

Referenced by estRunLevel_CABAC().

int est_unary_exp_golomb_level_encode ( unsigned int  symbol,
int  ctx,
int  type 
)

estimate unary exp golomb bit cost

Definition at line 567 of file rdoq_cabac.c.

References est_exp_golomb_encode_eq_prob().

Referenced by est_writeRunLevel_CABAC().

Here is the call graph for this function:

int est_write_and_store_CBP_block_bit ( Macroblock *  currMB,
int  type 
)

void est_writeRunLevel_CABAC ( levelDataStruct  levelData[],
int  levelTabMin[],
int  type,
double  lambda,
int  kInit,
int  kStop,
int  noCoeff,
int  estCBP 
)

Rate distortion optimized trellis quantization.

Definition at line 403 of file rdoq_cabac.c.

References est_unary_exp_golomb_level_encode().

Referenced by rdoq_4x4_CABAC(), rdoq_8x8_CABAC(), rdoq_ac4x4_CABAC(), rdoq_dc_CABAC(), and rdoq_dc_cr_CABAC().

Here is the call graph for this function:

void estRunLevel_CABAC ( Slice *  currSlice,
Macroblock *  currMB,
int  context 
)

estimate bit cost for CBP, significant map and significant coefficients

Definition at line 138 of file rdoq_cabac.c.

References datapartition::ee_cabac, est_CBP_block_bit(), est_significance_map(), est_significant_coefficients(), and Slice::partArr.

Here is the call graph for this function:

int init_trellis_data_4x4_CABAC ( int **  tblock,
int  block_x,
int  qp_per,
int  qp_rem,
int **  levelscale,
int **  leveloffset,
const byte *  p_scan,
Macroblock *  currMB,
levelDataStruct *  dataLevel,
int *  kStart,
int *  kStop,
int  type 
)

Initialize levelData.

Definition at line 606 of file rdoq_cabac.c.

Referenced by rdoq_4x4_CABAC(), and rdoq_ac4x4_CABAC().

int init_trellis_data_DC_CABAC ( int **  tblock,
int  qp_per,
int  qp_rem,
int  levelscale,
int  leveloffset,
const byte *  p_scan,
Macroblock *  currMB,
levelDataStruct *  dataLevel,
int *  kStart,
int *  kStop 
)

Initialize levelData for Luma DC.

Definition at line 772 of file rdoq_cabac.c.

Referenced by rdoq_dc_CABAC().


Variable Documentation

const int entropyBits[128]

Initial value:

 
{
     895,    943,    994,   1048,   1105,   1165,   1228,   1294, 
    1364,   1439,   1517,   1599,   1686,   1778,   1875,   1978, 
    2086,   2200,   2321,   2448,   2583,   2725,   2876,   3034, 
    3202,   3380,   3568,   3767,   3977,   4199,   4435,   4684, 
    4948,   5228,   5525,   5840,   6173,   6527,   6903,   7303, 
    7727,   8178,   8658,   9169,   9714,  10294,  10914,  11575, 
   12282,  13038,  13849,  14717,  15650,  16653,  17734,  18899, 
   20159,  21523,  23005,  24617,  26378,  28306,  30426,  32768, 
   32768,  35232,  37696,  40159,  42623,  45087,  47551,  50015, 
   52479,  54942,  57406,  59870,  62334,  64798,  67262,  69725, 
   72189,  74653,  77117,  79581,  82044,  84508,  86972,  89436, 
   91900,  94363,  96827,  99291, 101755, 104219, 106683, 109146, 
  111610, 114074, 116538, 119002, 121465, 123929, 126393, 128857, 
  131321, 133785, 136248, 138712, 141176, 143640, 146104, 148568, 
  151031, 153495, 155959, 158423, 160887, 163351, 165814, 168278, 
  170742, 173207, 175669, 178134, 180598, 183061, 185525, 187989
}

Definition at line 24 of file rdoq_cabac.c.


Documentation generated with DoxyGen