Rate-Distortion Optimization related functionality.
More...
#include "cabac.h"
#include "cu.h"
#include "encoderstate.h"
#include "global.h"
#include "search_inter.h"
Go to the source code of this file.
|
int | kvz_init_rdcost_outfiles (const char *fn_template) |
|
void | kvz_close_rdcost_outfiles (void) |
|
void | kvz_rdoq (encoder_state_t *state, coeff_t *coef, coeff_t *dest_coeff, int32_t width, int32_t height, int8_t type, int8_t scan_mode, int8_t block_type, int8_t tr_depth) |
| RDOQ with CABAC. More...
|
|
double | kvz_get_coeff_cost (const encoder_state_t *const state, const coeff_t *coeff, int32_t width, int32_t type, int8_t scan_mode) |
| Estimate bitcost for coding coefficients. More...
|
|
int32_t | kvz_get_ic_rate (encoder_state_t *state, uint32_t abs_level, uint16_t ctx_num_one, uint16_t ctx_num_abs, uint16_t abs_go_rice, uint32_t c1_idx, uint32_t c2_idx, int8_t type) |
| Calculates the cost for specific absolute transform level. More...
|
|
uint32_t | kvz_get_coded_level (encoder_state_t *state, double *coded_cost, double *coded_cost0, double *coded_cost_sig, int32_t level_double, uint32_t max_abs_level, uint16_t ctx_num_sig, uint16_t ctx_num_one, uint16_t ctx_num_abs, uint16_t abs_go_rice, uint32_t c1_idx, uint32_t c2_idx, int32_t q_bits, double temp, int8_t last, int8_t type) |
| Get the best level in RD sense. More...
|
|
double | kvz_get_mvd_coding_cost_cabac (const encoder_state_t *state, const cabac_data_t *cabac, int32_t mvd_hor, int32_t mvd_ver) |
| Calculate cost of actual motion vectors using CABAC coding. More...
|
|
◆ CTX_ENTROPY_BITS
◆ CTX_FRAC_BITS
◆ CTX_FRAC_HALF_BIT
◆ CTX_FRAC_ONE_BIT
◆ kvz_close_rdcost_outfiles()
void kvz_close_rdcost_outfiles |
( |
void |
| ) |
|
◆ kvz_get_coded_level()
uint32_t kvz_get_coded_level |
( |
encoder_state_t *const |
state, |
|
|
double * |
coded_cost, |
|
|
double * |
coded_cost0, |
|
|
double * |
coded_cost_sig, |
|
|
int32_t |
level_double, |
|
|
uint32_t |
max_abs_level, |
|
|
uint16_t |
ctx_num_sig, |
|
|
uint16_t |
ctx_num_one, |
|
|
uint16_t |
ctx_num_abs, |
|
|
uint16_t |
abs_go_rice, |
|
|
uint32_t |
c1_idx, |
|
|
uint32_t |
c2_idx, |
|
|
int32_t |
q_bits, |
|
|
double |
temp, |
|
|
int8_t |
last, |
|
|
int8_t |
type |
|
) |
| |
|
inline |
- Parameters
-
coded_cost | reference to coded cost |
coded_cost0 | reference to cost when coefficient is 0 |
coded_cost_sig | reference to cost of significant coefficient |
level_double | reference to unscaled quantized level |
max_abs_level | scaled quantized level |
ctx_num_sig | current ctxInc for coeff_abs_significant_flag |
ctx_num_one | current ctxInc for coeff_abs_level_greater1 (1st bin of coeff_abs_level_minus1 in AVC) |
ctx_num_abs | current ctxInc for coeff_abs_level_greater2 (remaining bins of coeff_abs_level_minus1 in AVC) |
abs_go_rice | current Rice parameter for coeff_abs_level_minus3 |
q_bits | quantization step size |
temp | correction factor |
last | indicates if the coefficient is the last significant |
- Returns
- best quantized transform level for given scan position This method calculates the best quantized transform level for a given scan position. From HM 12.0
◆ kvz_get_coeff_cost()
double kvz_get_coeff_cost |
( |
const encoder_state_t *const |
state, |
|
|
const coeff_t * |
coeff, |
|
|
int32_t |
width, |
|
|
int32_t |
type, |
|
|
int8_t |
scan_mode |
|
) |
| |
- Parameters
-
coeff | coefficient array |
width | coeff block width |
type | data type (0 == luma) |
- Returns
- number of bits needed to code coefficients
◆ kvz_get_ic_rate()
int32_t kvz_get_ic_rate |
( |
encoder_state_t *const |
state, |
|
|
uint32_t |
abs_level, |
|
|
uint16_t |
ctx_num_one, |
|
|
uint16_t |
ctx_num_abs, |
|
|
uint16_t |
abs_go_rice, |
|
|
uint32_t |
c1_idx, |
|
|
uint32_t |
c2_idx, |
|
|
int8_t |
type |
|
) |
| |
|
inline |
- Parameters
-
abs_level | scaled quantized level |
ctx_num_one | current ctxInc for coeff_abs_level_greater1 (1st bin of coeff_abs_level_minus1 in AVC) |
ctx_num_abs | current ctxInc for coeff_abs_level_greater2 (remaining bins of coeff_abs_level_minus1 in AVC) |
abs_go_rice | Rice parameter for coeff_abs_level_minus3 |
- Returns
- cost of given absolute transform level From HM 12.0
◆ kvz_get_mvd_coding_cost_cabac()
◆ kvz_init_rdcost_outfiles()
int kvz_init_rdcost_outfiles |
( |
const char * |
fn_template | ) |
|
◆ kvz_rdoq()
void kvz_rdoq |
( |
encoder_state_t *const |
state, |
|
|
coeff_t * |
coef, |
|
|
coeff_t * |
dest_coeff, |
|
|
int32_t |
width, |
|
|
int32_t |
height, |
|
|
int8_t |
type, |
|
|
int8_t |
scan_mode, |
|
|
int8_t |
block_type, |
|
|
int8_t |
tr_depth |
|
) |
| |
- Returns
- void Rate distortion optimized quantization for entropy coding engines using probability models like CABAC From HM 12.0
◆ kvz_calc_mvd_cost_cabac
◆ kvz_entropy_bits
const uint32_t kvz_entropy_bits[128] |
|
extern |
◆ kvz_g_go_rice_prefix_len
const uint32_t kvz_g_go_rice_prefix_len[5] |
|
extern |
◆ kvz_g_go_rice_range
const uint32_t kvz_g_go_rice_range[5] |
|
extern |