Commit 9f81a50c authored by Jingning Han's avatar Jingning Han
Browse files

Fix use_uv_intra_estimate in rd loop

This commit fixes the use of uv_intra_estimate by properly restoring
the mode_info struct required by rd_pick_intra_sbuv_mode.

Change-Id: I6a156d79533c4e2e60dfd3b8c5bb0a42a8eca280
parent e237b7de
...@@ -786,7 +786,7 @@ void vp9_set_speed_features(VP9_COMP *cpi) { ...@@ -786,7 +786,7 @@ void vp9_set_speed_features(VP9_COMP *cpi) {
sf->last_partitioning_redo_frequency = 3; sf->last_partitioning_redo_frequency = 3;
sf->use_uv_intra_rd_estimate = 1; sf->use_uv_intra_rd_estimate = 1;
sf->skip_encode_sb = 1; sf->skip_encode_sb = 0;
sf->use_lp32x32fdct = 1; sf->use_lp32x32fdct = 1;
sf->subpel_iters_per_step = 1; sf->subpel_iters_per_step = 1;
sf->use_fast_coef_updates = 2; sf->use_fast_coef_updates = 2;
...@@ -819,7 +819,7 @@ void vp9_set_speed_features(VP9_COMP *cpi) { ...@@ -819,7 +819,7 @@ void vp9_set_speed_features(VP9_COMP *cpi) {
sf->last_partitioning_redo_frequency = 3; sf->last_partitioning_redo_frequency = 3;
sf->use_uv_intra_rd_estimate = 1; sf->use_uv_intra_rd_estimate = 1;
sf->skip_encode_sb = 1; sf->skip_encode_sb = 0;
sf->use_lp32x32fdct = 1; sf->use_lp32x32fdct = 1;
sf->subpel_iters_per_step = 1; sf->subpel_iters_per_step = 1;
sf->use_fast_coef_updates = 2; sf->use_fast_coef_updates = 2;
......
...@@ -270,7 +270,7 @@ void vp9_initialize_rd_consts(VP9_COMP *cpi) { ...@@ -270,7 +270,7 @@ void vp9_initialize_rd_consts(VP9_COMP *cpi) {
cpi->mb.select_txfm_size = (cpi->sf.tx_size_search_method == USE_LARGESTALL && cpi->mb.select_txfm_size = (cpi->sf.tx_size_search_method == USE_LARGESTALL &&
cm->frame_type != KEY_FRAME) ? cm->frame_type != KEY_FRAME) ?
0 : 1; 0 : 1;
set_block_thresholds(cpi); set_block_thresholds(cpi);
...@@ -1286,11 +1286,7 @@ static int64_t rd_pick_intra_sbuv_mode(VP9_COMP *cpi, MACROBLOCK *x, ...@@ -1286,11 +1286,7 @@ static int64_t rd_pick_intra_sbuv_mode(VP9_COMP *cpi, MACROBLOCK *x,
int this_rate_tokenonly, this_rate, s; int this_rate_tokenonly, this_rate, s;
int64_t this_distortion, this_sse; int64_t this_distortion, this_sse;
// int mode_mask = (bsize <= BLOCK_8X8) for (mode = DC_PRED; mode <= TM_PRED; ++mode) {
// ? ALL_INTRA_MODES : cpi->sf.intra_uv_mode_mask;
for (mode = DC_PRED; mode <= TM_PRED; mode ++) {
// if (!(mode_mask & (1 << mode)))
if (!(cpi->sf.intra_uv_mode_mask[max_uv_txsize_lookup[bsize]] if (!(cpi->sf.intra_uv_mode_mask[max_uv_txsize_lookup[bsize]]
& (1 << mode))) & (1 << mode)))
continue; continue;
...@@ -1318,7 +1314,7 @@ static int64_t rd_pick_intra_sbuv_mode(VP9_COMP *cpi, MACROBLOCK *x, ...@@ -1318,7 +1314,7 @@ static int64_t rd_pick_intra_sbuv_mode(VP9_COMP *cpi, MACROBLOCK *x,
struct macroblockd_plane *const pd = x->e_mbd.plane; struct macroblockd_plane *const pd = x->e_mbd.plane;
for (i = 1; i < MAX_MB_PLANE; ++i) { for (i = 1; i < MAX_MB_PLANE; ++i) {
p[i].coeff = ctx->coeff_pbuf[i][2]; p[i].coeff = ctx->coeff_pbuf[i][2];
p[i].qcoeff = ctx->qcoeff_pbuf[i][2]; p[i].qcoeff = ctx->qcoeff_pbuf[i][2];
pd[i].dqcoeff = ctx->dqcoeff_pbuf[i][2]; pd[i].dqcoeff = ctx->dqcoeff_pbuf[i][2];
pd[i].eobs = ctx->eobs_pbuf[i][2]; pd[i].eobs = ctx->eobs_pbuf[i][2];
...@@ -1337,7 +1333,6 @@ static int64_t rd_pick_intra_sbuv_mode(VP9_COMP *cpi, MACROBLOCK *x, ...@@ -1337,7 +1333,6 @@ static int64_t rd_pick_intra_sbuv_mode(VP9_COMP *cpi, MACROBLOCK *x,
} }
x->e_mbd.mi_8x8[0]->mbmi.uv_mode = mode_selected; x->e_mbd.mi_8x8[0]->mbmi.uv_mode = mode_selected;
return best_rd; return best_rd;
} }
...@@ -3662,7 +3657,9 @@ int64_t vp9_rd_pick_inter_mode_sb(VP9_COMP *cpi, MACROBLOCK *x, ...@@ -3662,7 +3657,9 @@ int64_t vp9_rd_pick_inter_mode_sb(VP9_COMP *cpi, MACROBLOCK *x,
if (cpi->sf.use_uv_intra_rd_estimate) { if (cpi->sf.use_uv_intra_rd_estimate) {
// Do Intra UV best rd mode selection if best mode choice above was intra. // Do Intra UV best rd mode selection if best mode choice above was intra.
if (vp9_mode_order[best_mode_index].ref_frame == INTRA_FRAME) { if (vp9_mode_order[best_mode_index].ref_frame == INTRA_FRAME) {
TX_SIZE uv_tx_size = get_uv_tx_size(mbmi); TX_SIZE uv_tx_size;
*mbmi = best_mbmode;
uv_tx_size = get_uv_tx_size(mbmi);
rd_pick_intra_sbuv_mode(cpi, x, ctx, &rate_uv_intra[uv_tx_size], rd_pick_intra_sbuv_mode(cpi, x, ctx, &rate_uv_intra[uv_tx_size],
&rate_uv_tokenonly[uv_tx_size], &rate_uv_tokenonly[uv_tx_size],
&dist_uv[uv_tx_size], &dist_uv[uv_tx_size],
...@@ -4410,7 +4407,9 @@ int64_t vp9_rd_pick_inter_mode_sub8x8(VP9_COMP *cpi, MACROBLOCK *x, ...@@ -4410,7 +4407,9 @@ int64_t vp9_rd_pick_inter_mode_sub8x8(VP9_COMP *cpi, MACROBLOCK *x,
if (cpi->sf.use_uv_intra_rd_estimate) { if (cpi->sf.use_uv_intra_rd_estimate) {
// Do Intra UV best rd mode selection if best mode choice above was intra. // Do Intra UV best rd mode selection if best mode choice above was intra.
if (vp9_ref_order[best_mode_index].ref_frame == INTRA_FRAME) { if (vp9_ref_order[best_mode_index].ref_frame == INTRA_FRAME) {
TX_SIZE uv_tx_size = get_uv_tx_size(mbmi); TX_SIZE uv_tx_size;
*mbmi = best_mbmode;
uv_tx_size = get_uv_tx_size(mbmi);
rd_pick_intra_sbuv_mode(cpi, x, ctx, &rate_uv_intra[uv_tx_size], rd_pick_intra_sbuv_mode(cpi, x, ctx, &rate_uv_intra[uv_tx_size],
&rate_uv_tokenonly[uv_tx_size], &rate_uv_tokenonly[uv_tx_size],
&dist_uv[uv_tx_size], &dist_uv[uv_tx_size],
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment