mi->segment_id = get_segment_id(cm, map, bsize, mi_row, mi_col);
break;
case PSNR_AQ: mi->segment_id = segment_index; break;
+ case PERCEPTUAL_AQ: mi->segment_id = x->segment_id; break;
default:
// NO_AQ or PSNR_AQ
break;
if (cpi->roi.enabled)
mi->segment_id = get_segment_id(cm, map, bsize, mi_row, mi_col);
- if (cpi->sf.enable_wiener_variance) mi->segment_id = x->segment_id;
-
vp9_init_plane_quantizers(cpi, x);
}
vpx_clear_system_state();
if (aq_mode == NO_AQ || aq_mode == PSNR_AQ) {
- if (cpi->sf.enable_tpl_model || cpi->sf.enable_wiener_variance)
- x->rdmult = x->cb_rdmult;
+ if (cpi->sf.enable_tpl_model) x->rdmult = x->cb_rdmult;
+ } else if (aq_mode == PERCEPTUAL_AQ) {
+ x->rdmult = x->cb_rdmult;
} else if (aq_mode == CYCLIC_REFRESH_AQ) {
// If segment is boosted, use rdmult for that segment.
if (cyclic_refresh_segment_id_boosted(
x->rdmult = vp9_cyclic_refresh_get_rdmult(cpi->cyclic_refresh);
} else {
x->rdmult = vp9_compute_rd_mult(cpi, cm->base_qindex + cm->y_dc_delta_q);
- if (cpi->sf.enable_wiener_variance && cm->show_frame) {
- if (cm->seg.enabled)
- x->rdmult = vp9_compute_rd_mult(
- cpi, vp9_get_qindex(&cm->seg, x->e_mbd.mi[0]->segment_id,
- cm->base_qindex));
- }
}
if (oxcf->tuning == VP8_TUNE_SSIM) {
MACROBLOCK *const x = &td->mb;
set_offsets(cpi, tile, x, mi_row, mi_col, bsize);
- if ((cpi->sf.enable_tpl_model || cpi->sf.enable_wiener_variance) &&
- cpi->oxcf.aq_mode == NO_AQ) {
+ if (cpi->sf.enable_tpl_model &&
+ (cpi->oxcf.aq_mode == NO_AQ || cpi->oxcf.aq_mode == PERCEPTUAL_AQ)) {
const VP9EncoderConfig *const oxcf = &cpi->oxcf;
x->rdmult = x->cb_rdmult;
if (oxcf->tuning == VP8_TUNE_SSIM) {
x->cb_rdmult = dr;
}
- if (cpi->sf.enable_wiener_variance && cm->show_frame) {
+ if (cpi->oxcf.aq_mode == PERCEPTUAL_AQ && cm->show_frame) {
x->segment_id = wiener_var_segment(cpi, BLOCK_64X64, mi_row, mi_col);
x->cb_rdmult = vp9_compute_rd_mult(
cpi, vp9_get_qindex(&cm->seg, x->segment_id, cm->base_qindex));
}
// Frame segmentation
- if (cpi->sf.enable_wiener_variance) build_kmeans_segmentation(cpi);
+ if (cpi->oxcf.aq_mode == PERCEPTUAL_AQ) build_kmeans_segmentation(cpi);
{
struct vpx_usec_timer emr_timer;
vp9_set_speed_features_framesize_independent(cpi, oxcf->speed);
vp9_set_speed_features_framesize_dependent(cpi, oxcf->speed);
- if (cpi->sf.enable_wiener_variance) {
- CHECK_MEM_ERROR(cm, cpi->stack_rank_buffer,
- vpx_calloc(UINT16_MAX, sizeof(*cpi->stack_rank_buffer)));
- CHECK_MEM_ERROR(cm, cpi->mb_wiener_variance,
- vpx_calloc(cm->mb_rows * cm->mb_cols,
- sizeof(*cpi->mb_wiener_variance)));
- }
+ // TODO(jingning): The buffer allocation will be refactored next.
+ CHECK_MEM_ERROR(cm, cpi->stack_rank_buffer,
+ vpx_calloc(UINT16_MAX, sizeof(*cpi->stack_rank_buffer)));
+ CHECK_MEM_ERROR(
+ cm, cpi->mb_wiener_variance,
+ vpx_calloc(cm->mb_rows * cm->mb_cols, sizeof(*cpi->mb_wiener_variance)));
{
const int bsize = BLOCK_64X64;
const int coeff_count = block_size * block_size;
const TX_SIZE tx_size = TX_16X16;
- if (cpi->sf.enable_wiener_variance == 0) return;
-
#if CONFIG_VP9_HIGHBITDEPTH
xd->cur_buf = cpi->Source;
if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) {
if (oxcf->tuning == VP8_TUNE_SSIM) set_mb_ssim_rdmult_scaling(cpi);
- set_mb_wiener_variance(cpi);
+ if (oxcf->aq_mode == PERCEPTUAL_AQ) set_mb_wiener_variance(cpi);
vpx_clear_system_state();