#include <math.h>


Go to the source code of this file.
Data Structures | |
| struct | estBitsCabacStruct |
| struct | levelDataStruct |
Defines | |
| #define | MAX_PREC_COEFF 25 |
| #define | SIGN_BITS 1 |
Functions | |
| void | init_rdoq_slice (int slice_type, int symbol_mode) |
| void | est_RunLevel_CAVLC (levelDataStruct *levelData, int *levelTrellis, int block_type, int b8, int b4, int coeff_num, double lambda) |
| int | est_CAVLC_bits (levelDataStruct *levelData, int level_to_enc[16], int sign_to_enc[16], int nnz, int block_type) |
| 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 kStart, int kStop, int noCoeff, int estCBP) |
| int | est_unary_exp_golomb_level_encode (unsigned int symbol, int ctx, int type) |
| void | init_trellis_data_4x4_CAVLC (int **tblock, int block_x, int qp_per, int qp_rem, int **levelscale, int **leveloffset, const byte *p_scan, Macroblock *currMB, levelDataStruct *dataLevel, 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) |
| void | init_trellis_data_8x8_CAVLC (int **tblock, int block_x, int qp_per, int qp_rem, int **levelscale, int **leveloffset, const byte *p_scan, Macroblock *currMB, levelDataStruct levelData[4][16]) |
| 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) |
| void | init_trellis_data_DC_CAVLC (int **tblock, int qp_per, int qp_rem, int levelscale, int leveloffset, const byte *p_scan, Macroblock *currMB, levelDataStruct *dataLevel, int type) |
| 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) |
| int | init_trellis_data_DC_cr_CAVLC (int **tblock, int qp_per, int qp_rem, int levelscale, int leveloffset, const byte *p_scan, Macroblock *currMB, levelDataStruct *dataLevel) |
| int | init_trellis_data_DC_cr_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) |
| void | RDOQ_update_mode (RD_PARAMS *enc_mb, int bslice) |
| void | copy_rddata_trellis (RD_DATA *dest, RD_DATA *src) |
| void | updateMV_mp (int *m_cost, short ref, int list, int h, int v, int blocktype, int *lambda_factor, int block8x8) |
| void | trellis_coding (Slice *currSlice, Macroblock *currMB, int CurrentMbAddr, Boolean prev_recode_mb) |
Variables | |
| double | norm_factor_4x4 |
| double | norm_factor_8x8 |
Definition in file rdoq.h.
| int est_CAVLC_bits | ( | levelDataStruct * | levelData, | |
| int | level_to_enc[16], | |||
| int | sign_to_enc[16], | |||
| int | nnz, | |||
| int | block_type | |||
| ) |
estimate CAVLC bits
Definition at line 96 of file rdoq_cavlc.c.
References estSyntaxElement_Level_VLC1(), estSyntaxElement_Level_VLCN(), syntaxelement::len, ImageParameters::num_cdc_coeff, syntaxelement::value1, syntaxelement::value2, and ImageParameters::yuv_format.
Referenced by est_RunLevel_CAVLC().

| 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_RunLevel_CAVLC | ( | levelDataStruct * | levelData, | |
| int * | levelTrellis, | |||
| int | block_type, | |||
| int | b8, | |||
| int | b4, | |||
| int | coeff_num, | |||
| double | lambda | |||
| ) |
estimate run and level for CAVLC
Definition at line 389 of file rdoq_cavlc.c.
References ImageParameters::current_mb_nr, est_CAVLC_bits(), ImageParameters::mb_data, ImageParameters::nz_coeff, predict_nnz(), predict_nnz_chroma(), ImageParameters::subblock_x, and ImageParameters::subblock_y.
Referenced by rdoq_4x4_CAVLC(), rdoq_8x8_CAVLC(), rdoq_ac4x4_CAVLC(), rdoq_dc_CAVLC(), and rdoq_dc_cr_CAVLC().

| 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().

| int est_write_and_store_CBP_block_bit | ( | Macroblock * | currMB, | |
| int | type | |||
| ) |
estimate CABAC CBP bits
Definition at line 267 of file rdoq_cabac.c.
References pix_pos::available, macroblock::cbp_bits, macroblock::cbp_bits_8x8, storable_picture::chroma_format_idc, get4x4Neighbour(), ImageParameters::is_v_block, pix_pos::mb_addr, ImageParameters::mb_data, ImageParameters::mb_size, macroblock::mb_type, ImageParameters::subblock_x, ImageParameters::subblock_y, pix_pos::x, pix_pos::y, and YUV444.
Referenced by rdoq_4x4_CABAC(), rdoq_ac4x4_CABAC(), rdoq_dc_CABAC(), and rdoq_dc_cr_CABAC().

| void est_writeRunLevel_CABAC | ( | levelDataStruct | levelData[], | |
| int | levelTabMin[], | |||
| int | type, | |||
| double | lambda, | |||
| int | kStart, | |||
| 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().

| 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.

| void init_rdoq_slice | ( | int | slice_type, | |
| int | symbol_mode | |||
| ) |
Initialize the parameters related to RDO_Q in slice level.
Definition at line 139 of file rdoq.c.
Referenced by init_slice().
| 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().
| void init_trellis_data_4x4_CAVLC | ( | int ** | tblock, | |
| int | block_x, | |||
| int | qp_per, | |||
| int | qp_rem, | |||
| int ** | levelscale, | |||
| int ** | leveloffset, | |||
| const byte * | p_scan, | |||
| Macroblock * | currMB, | |||
| levelDataStruct * | dataLevel, | |||
| int | type | |||
| ) |
Initialize levelData.
Definition at line 485 of file rdoq_cavlc.c.
Referenced by rdoq_4x4_CAVLC(), and rdoq_ac4x4_CAVLC().
| void init_trellis_data_8x8_CAVLC | ( | int ** | tblock, | |
| int | block_x, | |||
| int | qp_per, | |||
| int | qp_rem, | |||
| int ** | levelscale, | |||
| int ** | leveloffset, | |||
| const byte * | p_scan, | |||
| Macroblock * | currMB, | |||
| levelDataStruct | levelData[4][16] | |||
| ) |
| 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().
| void init_trellis_data_DC_CAVLC | ( | int ** | tblock, | |
| int | qp_per, | |||
| int | qp_rem, | |||
| int | levelscale, | |||
| int | leveloffset, | |||
| const byte * | p_scan, | |||
| Macroblock * | currMB, | |||
| levelDataStruct * | dataLevel, | |||
| int | type | |||
| ) |
Initialize levelData for Luma DC.
Definition at line 567 of file rdoq_cavlc.c.
Referenced by rdoq_dc_CAVLC().
| int init_trellis_data_DC_cr_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 Chroma DC.
Definition at line 232 of file rdoq.c.
References ImageParameters::num_cdc_coeff.
Referenced by rdoq_dc_cr_CABAC().
| int init_trellis_data_DC_cr_CAVLC | ( | int ** | tblock, | |
| int | qp_per, | |||
| int | qp_rem, | |||
| int | levelscale, | |||
| int | leveloffset, | |||
| const byte * | p_scan, | |||
| Macroblock * | currMB, | |||
| levelDataStruct * | dataLevel | |||
| ) |
Initialize levelData for Chroma DC.
Definition at line 152 of file rdoq.c.
References ImageParameters::num_cdc_coeff.
Referenced by rdoq_dc_cr_CAVLC().