| Index: source/libvpx/vp8/encoder/pickinter.c
|
| ===================================================================
|
| --- source/libvpx/vp8/encoder/pickinter.c (revision 177019)
|
| +++ source/libvpx/vp8/encoder/pickinter.c (working copy)
|
| @@ -389,15 +389,16 @@
|
|
|
| }
|
|
|
| -static void update_mvcount(VP8_COMP *cpi, MACROBLOCKD *xd, int_mv *best_ref_mv)
|
| +static void update_mvcount(MACROBLOCK *x, int_mv *best_ref_mv)
|
| {
|
| + MACROBLOCKD *xd = &x->e_mbd;
|
| /* Split MV modes currently not supported when RD is nopt enabled,
|
| * therefore, only need to modify MVcount in NEWMV mode. */
|
| if (xd->mode_info_context->mbmi.mode == NEWMV)
|
| {
|
| - cpi->MVcount[0][mv_max+((xd->mode_info_context->mbmi.mv.as_mv.row -
|
| + x->MVcount[0][mv_max+((xd->mode_info_context->mbmi.mv.as_mv.row -
|
| best_ref_mv->as_mv.row) >> 1)]++;
|
| - cpi->MVcount[1][mv_max+((xd->mode_info_context->mbmi.mv.as_mv.col -
|
| + x->MVcount[1][mv_max+((xd->mode_info_context->mbmi.mv.as_mv.col -
|
| best_ref_mv->as_mv.col) >> 1)]++;
|
| }
|
| }
|
| @@ -679,7 +680,7 @@
|
| get_predictor_pointers(cpi, plane, recon_yoffset, recon_uvoffset);
|
|
|
| /* Count of the number of MBs tested so far this frame */
|
| - cpi->mbs_tested_so_far++;
|
| + x->mbs_tested_so_far++;
|
|
|
| *returnintra = INT_MAX;
|
| x->skip = 0;
|
| @@ -700,7 +701,7 @@
|
| int this_rd = INT_MAX;
|
| int this_ref_frame = ref_frame_map[vp8_ref_frame_order[mode_index]];
|
|
|
| - if (best_rd <= cpi->rd_threshes[mode_index])
|
| + if (best_rd <= x->rd_threshes[mode_index])
|
| continue;
|
|
|
| if (this_ref_frame < 0)
|
| @@ -745,22 +746,22 @@
|
| /* Check to see if the testing frequency for this mode is at its max
|
| * If so then prevent it from being tested and increase the threshold
|
| * for its testing */
|
| - if (cpi->mode_test_hit_counts[mode_index] &&
|
| + if (x->mode_test_hit_counts[mode_index] &&
|
| (cpi->mode_check_freq[mode_index] > 1))
|
| {
|
| - if (cpi->mbs_tested_so_far <= (cpi->mode_check_freq[mode_index] *
|
| - cpi->mode_test_hit_counts[mode_index]))
|
| + if (x->mbs_tested_so_far <= (cpi->mode_check_freq[mode_index] *
|
| + x->mode_test_hit_counts[mode_index]))
|
| {
|
| /* Increase the threshold for coding this mode to make it less
|
| * likely to be chosen */
|
| - cpi->rd_thresh_mult[mode_index] += 4;
|
| + x->rd_thresh_mult[mode_index] += 4;
|
|
|
| - if (cpi->rd_thresh_mult[mode_index] > MAX_THRESHMULT)
|
| - cpi->rd_thresh_mult[mode_index] = MAX_THRESHMULT;
|
| + if (x->rd_thresh_mult[mode_index] > MAX_THRESHMULT)
|
| + x->rd_thresh_mult[mode_index] = MAX_THRESHMULT;
|
|
|
| - cpi->rd_threshes[mode_index] =
|
| + x->rd_threshes[mode_index] =
|
| (cpi->rd_baseline_thresh[mode_index] >> 7) *
|
| - cpi->rd_thresh_mult[mode_index];
|
| + x->rd_thresh_mult[mode_index];
|
| continue;
|
| }
|
| }
|
| @@ -768,7 +769,7 @@
|
| /* We have now reached the point where we are going to test the current
|
| * mode so increment the counter for the number of times it has been
|
| * tested */
|
| - cpi->mode_test_hit_counts[mode_index] ++;
|
| + x->mode_test_hit_counts[mode_index] ++;
|
|
|
| rate2 = 0;
|
| distortion2 = 0;
|
| @@ -1108,12 +1109,12 @@
|
| /* Testing this mode gave rise to an improvement in best error
|
| * score. Lower threshold a bit for next time
|
| */
|
| - cpi->rd_thresh_mult[mode_index] =
|
| - (cpi->rd_thresh_mult[mode_index] >= (MIN_THRESHMULT + 2)) ?
|
| - cpi->rd_thresh_mult[mode_index] - 2 : MIN_THRESHMULT;
|
| - cpi->rd_threshes[mode_index] =
|
| + x->rd_thresh_mult[mode_index] =
|
| + (x->rd_thresh_mult[mode_index] >= (MIN_THRESHMULT + 2)) ?
|
| + x->rd_thresh_mult[mode_index] - 2 : MIN_THRESHMULT;
|
| + x->rd_threshes[mode_index] =
|
| (cpi->rd_baseline_thresh[mode_index] >> 7) *
|
| - cpi->rd_thresh_mult[mode_index];
|
| + x->rd_thresh_mult[mode_index];
|
| }
|
|
|
| /* If the mode did not help improve the best error case then raise the
|
| @@ -1121,14 +1122,14 @@
|
| */
|
| else
|
| {
|
| - cpi->rd_thresh_mult[mode_index] += 4;
|
| + x->rd_thresh_mult[mode_index] += 4;
|
|
|
| - if (cpi->rd_thresh_mult[mode_index] > MAX_THRESHMULT)
|
| - cpi->rd_thresh_mult[mode_index] = MAX_THRESHMULT;
|
| + if (x->rd_thresh_mult[mode_index] > MAX_THRESHMULT)
|
| + x->rd_thresh_mult[mode_index] = MAX_THRESHMULT;
|
|
|
| - cpi->rd_threshes[mode_index] =
|
| + x->rd_threshes[mode_index] =
|
| (cpi->rd_baseline_thresh[mode_index] >> 7) *
|
| - cpi->rd_thresh_mult[mode_index];
|
| + x->rd_thresh_mult[mode_index];
|
| }
|
|
|
| if (x->skip)
|
| @@ -1138,16 +1139,16 @@
|
| /* Reduce the activation RD thresholds for the best choice mode */
|
| if ((cpi->rd_baseline_thresh[best_mode_index] > 0) && (cpi->rd_baseline_thresh[best_mode_index] < (INT_MAX >> 2)))
|
| {
|
| - int best_adjustment = (cpi->rd_thresh_mult[best_mode_index] >> 3);
|
| + int best_adjustment = (x->rd_thresh_mult[best_mode_index] >> 3);
|
|
|
| - cpi->rd_thresh_mult[best_mode_index] =
|
| - (cpi->rd_thresh_mult[best_mode_index]
|
| + x->rd_thresh_mult[best_mode_index] =
|
| + (x->rd_thresh_mult[best_mode_index]
|
| >= (MIN_THRESHMULT + best_adjustment)) ?
|
| - cpi->rd_thresh_mult[best_mode_index] - best_adjustment :
|
| + x->rd_thresh_mult[best_mode_index] - best_adjustment :
|
| MIN_THRESHMULT;
|
| - cpi->rd_threshes[best_mode_index] =
|
| + x->rd_threshes[best_mode_index] =
|
| (cpi->rd_baseline_thresh[best_mode_index] >> 7) *
|
| - cpi->rd_thresh_mult[best_mode_index];
|
| + x->rd_thresh_mult[best_mode_index];
|
| }
|
|
|
|
|
| @@ -1159,7 +1160,7 @@
|
| this_rdbin = 1023;
|
| }
|
|
|
| - cpi->error_bins[this_rdbin] ++;
|
| + x->error_bins[this_rdbin] ++;
|
| }
|
|
|
| #if CONFIG_TEMPORAL_DENOISING
|
| @@ -1240,11 +1241,11 @@
|
| != cpi->common.ref_frame_sign_bias[xd->mode_info_context->mbmi.ref_frame])
|
| best_ref_mv.as_int = best_ref_mv_sb[!sign_bias].as_int;
|
|
|
| - update_mvcount(cpi, &x->e_mbd, &best_ref_mv);
|
| + update_mvcount(x, &best_ref_mv);
|
| }
|
|
|
|
|
| -void vp8_pick_intra_mode(VP8_COMP *cpi, MACROBLOCK *x, int *rate_)
|
| +void vp8_pick_intra_mode(MACROBLOCK *x, int *rate_)
|
| {
|
| int error4x4, error16x16 = INT_MAX;
|
| int rate, best_rate = 0, distortion, best_sse;
|
|
|