#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 "rdoq.h"

Go to the source code of this file.
Functions | |
| static int | biari_no_bits (signed short symbol, BiContextTypePtr bi_ct) |
| static int | biari_state (signed short symbol, BiContextTypePtr bi_ct) |
| static void | est_CBP_block_bit (Macroblock *currMB, int type) |
| static void | est_significance_map (Macroblock *currMB, int type) |
| static void | est_significant_coefficients (Macroblock *currMB, int type) |
| static int | est_unary_exp_golomb_level_encode (Macroblock *currMB, unsigned int symbol, int ctx, int type) |
| void | precalculate_unary_exp_golomb_level (ImageParameters *p_Img) |
| 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 (Macroblock *currMB, int context) |
| int | est_write_and_store_CBP_block_bit (Macroblock *currMB, int type) |
| void | est_writeRunLevel_CABAC (Macroblock *currMB, levelDataStruct levelData[], int levelTabMin[], int type, double lambda, int kInit, int kStop, int noCoeff, int estCBP) |
| int | init_trellis_data_4x4_CABAC (Macroblock *currMB, int **tblock, int block_x, int qp_per, int qp_rem, LevelQuantParams **q_params_4x4, const byte *p_scan, levelDataStruct *dataLevel, int *kStart, int *kStop, int type) |
| int | init_trellis_data_8x8_CABAC (Macroblock *currMB, int **tblock, int block_x, int qp_per, int qp_rem, LevelQuantParams **q_params_8x8, const byte *p_scan, levelDataStruct *dataLevel, int *kStart, int *kStop) |
| int | init_trellis_data_DC_CABAC (Macroblock *currMB, int **tblock, int qp_per, int qp_rem, LevelQuantParams *q_params_4x4, const byte *p_scan, levelDataStruct *dataLevel, int *kStart, int *kStop) |
Variables | |
| static const int | entropyBits [128] |
Definition in file rdoq_cabac.c.
| static void est_CBP_block_bit | ( | Macroblock * | currMB, | |
| int | type | |||
| ) | [static] |
estimate bit cost for each CBP bit
Definition at line 72 of file rdoq_cabac.c.
References macroblock::p_slice, and 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 257 of file rdoq_cabac.c.
Referenced by est_unary_exp_golomb_level_encode().
| static void est_significance_map | ( | Macroblock * | currMB, | |
| int | type | |||
| ) | [static] |
estimate CABAC bit cost for significant coefficient map
Definition at line 92 of file rdoq_cabac.c.
References macroblock::p_slice, and slice::tex_ctx.
Referenced by estRunLevel_CABAC().
| static void est_significant_coefficients | ( | Macroblock * | currMB, | |
| int | type | |||
| ) | [static] |
estimate bit cost of significant coefficient
Definition at line 132 of file rdoq_cabac.c.
References macroblock::p_slice, and slice::tex_ctx.
Referenced by estRunLevel_CABAC().
| static int est_unary_exp_golomb_level_encode | ( | Macroblock * | currMB, | |
| unsigned int | symbol, | |||
| int | ctx, | |||
| int | type | |||
| ) | [static] |
estimate unary exp golomb bit cost
Definition at line 164 of file rdoq_cabac.c.
References est_exp_golomb_encode_eq_prob(), and macroblock::p_slice.
Referenced by est_writeRunLevel_CABAC().

| int est_write_and_store_CBP_block_bit | ( | Macroblock * | currMB, | |
| int | type | |||
| ) |
estimate CABAC CBP bits
Definition at line 300 of file rdoq_cabac.c.
References get4x4Neighbour(), img_par::mb_data, macroblock::mb_type, macroblock::p_Img, macroblock::p_slice, macroblock::subblock_x, macroblock::subblock_y, and YUV444.
Referenced by rdoq_4x4_CABAC(), rdoq_ac4x4_CABAC(), rdoq_dc_CABAC(), and rdoq_dc_cr_CABAC().

| void est_writeRunLevel_CABAC | ( | Macroblock * | currMB, | |
| levelDataStruct | levelData[], | |||
| int | levelTabMin[], | |||
| int | type, | |||
| double | lambda, | |||
| int | kInit, | |||
| int | kStop, | |||
| int | noCoeff, | |||
| int | estCBP | |||
| ) |
Rate distortion optimized trellis quantization.
Definition at line 438 of file rdoq_cabac.c.
References est_unary_exp_golomb_level_encode(), macroblock::p_Img, and macroblock::p_slice.
Referenced by rdoq_4x4_CABAC(), rdoq_8x8_CABAC(), rdoq_ac4x4_CABAC(), rdoq_dc_CABAC(), and rdoq_dc_cr_CABAC().

| void estRunLevel_CABAC | ( | Macroblock * | currMB, | |
| int | context | |||
| ) |
estimate bit cost for CBP, significant map and significant coefficients
Definition at line 284 of file rdoq_cabac.c.
References est_CBP_block_bit(), est_significance_map(), and est_significant_coefficients().

| int init_trellis_data_4x4_CABAC | ( | Macroblock * | currMB, | |
| int ** | tblock, | |||
| int | block_x, | |||
| int | qp_per, | |||
| int | qp_rem, | |||
| LevelQuantParams ** | q_params_4x4, | |||
| const byte * | p_scan, | |||
| levelDataStruct * | dataLevel, | |||
| int * | kStart, | |||
| int * | kStop, | |||
| int | type | |||
| ) |
Initialize levelData.
Definition at line 605 of file rdoq_cabac.c.
References macroblock::p_slice.
Referenced by rdoq_4x4_CABAC(), and rdoq_ac4x4_CABAC().
| int init_trellis_data_DC_CABAC | ( | Macroblock * | currMB, | |
| int ** | tblock, | |||
| int | qp_per, | |||
| int | qp_rem, | |||
| LevelQuantParams * | q_params_4x4, | |||
| const byte * | p_scan, | |||
| levelDataStruct * | dataLevel, | |||
| int * | kStart, | |||
| int * | kStop | |||
| ) |
Initialize levelData for Luma DC.
Definition at line 774 of file rdoq_cabac.c.
References macroblock::p_slice.
Referenced by rdoq_dc_CABAC().
const int entropyBits[128] [static] |
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 23 of file rdoq_cabac.c.