From d15b07d8c68e75a56267224381b63875c8789d50 Mon Sep 17 00:00:00 2001 From: "Ronald S. Bultje" Date: Thu, 2 Aug 2012 11:01:48 -0700 Subject: [PATCH] A few more conversions from 32-bit to 64-bit RD calculations. Change-Id: Ida01bb8f4b35fde24b0f096329d326833f1fdc7e --- vp8/encoder/block.h | 2 +- vp8/encoder/rdopt.c | 18 +++++++++--------- vp8/encoder/rdopt.h | 2 +- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/vp8/encoder/block.h b/vp8/encoder/block.h index b69ffa94e..106036a0d 100644 --- a/vp8/encoder/block.h +++ b/vp8/encoder/block.h @@ -70,7 +70,7 @@ typedef struct { int_mv second_best_ref_mv; int rate; int distortion; - int intra_error; + int64_t intra_error; int best_mode_index; int rddiv; int rdmult; diff --git a/vp8/encoder/rdopt.c b/vp8/encoder/rdopt.c index e3369ae35..66f342302 100644 --- a/vp8/encoder/rdopt.c +++ b/vp8/encoder/rdopt.c @@ -1389,7 +1389,7 @@ static int rd_cost_mbuv(MACROBLOCK *mb) { } -static int rd_inter16x16_uv(VP8_COMP *cpi, MACROBLOCK *x, int *rate, +static int64_t rd_inter16x16_uv(VP8_COMP *cpi, MACROBLOCK *x, int *rate, int *distortion, int fullpixel) { ENCODEMB_INVOKE(IF_RTCD(&cpi->rtcd.encodemb), submbuv)(x->src_diff, x->src.u_buffer, x->src.v_buffer, x->e_mbd.predictor, x->src.uv_stride); @@ -2688,7 +2688,7 @@ static void store_coding_context(MACROBLOCK *x, int mb_index, } void vp8_rd_pick_inter_mode(VP8_COMP *cpi, MACROBLOCK *x, int recon_yoffset, int recon_uvoffset, - int *returnrate, int *returndistortion, int *returnintra, + int *returnrate, int *returndistortion, int64_t *returnintra, int64_t *best_single_rd_diff, int64_t *best_comp_rd_diff, int64_t *best_hybrid_rd_diff) { VP8_COMMON *cm = &cpi->common; @@ -2718,7 +2718,7 @@ void vp8_rd_pick_inter_mode(VP8_COMP *cpi, MACROBLOCK *x, int recon_yoffset, int int64_t best_single_rd = INT64_MAX; int64_t best_hybrid_rd = INT64_MAX; #if CONFIG_PRED_FILTER - int64_t best_overall_rd = INT_MAX; + int64_t best_overall_rd = INT64_MAX; #endif int rate2, distortion2; int uv_intra_rate, uv_intra_distortion, uv_intra_rate_tokenonly; @@ -2727,7 +2727,7 @@ void vp8_rd_pick_inter_mode(VP8_COMP *cpi, MACROBLOCK *x, int recon_yoffset, int int uv_intra_skippable_8x8 = 0; int rate_y, UNINITIALIZED_IS_SAFE(rate_uv); int distortion_uv; - int best_yrd = INT_MAX; + int64_t best_yrd = INT64_MAX; #if CONFIG_PRED_FILTER int best_filter_state; #endif @@ -2818,7 +2818,7 @@ void vp8_rd_pick_inter_mode(VP8_COMP *cpi, MACROBLOCK *x, int recon_yoffset, int v_buffer[ALTREF_FRAME] = alt_yv12->v_buffer + recon_uvoffset; } - *returnintra = INT_MAX; + *returnintra = INT64_MAX; x->skip = 0; @@ -3831,15 +3831,15 @@ void vp8_rd_pick_inter_mode(VP8_COMP *cpi, MACROBLOCK *x, int recon_yoffset, int x->partition_info->bmi[15].second_mv.as_int; } - if (best_single_rd == INT_MAX) + if (best_single_rd == INT64_MAX) *best_single_rd_diff = INT_MIN; else *best_single_rd_diff = best_rd - best_single_rd; - if (best_comp_rd == INT_MAX) + if (best_comp_rd == INT64_MAX) *best_comp_rd_diff = INT_MIN; else *best_comp_rd_diff = best_rd - best_comp_rd; - if (best_hybrid_rd == INT_MAX) + if (best_hybrid_rd == INT64_MAX) *best_hybrid_rd_diff = INT_MIN; else *best_hybrid_rd_diff = best_rd - best_hybrid_rd; @@ -3968,7 +3968,7 @@ int vp8cx_pick_mode_inter_macroblock MACROBLOCKD *const xd = &x->e_mbd; int rate; int distortion; - int intra_error = 0; + int64_t intra_error = 0; unsigned char *segment_id = &xd->mode_info_context->mbmi.segment_id; if (xd->segmentation_enabled) diff --git a/vp8/encoder/rdopt.h b/vp8/encoder/rdopt.h index a88666cf0..c26708c71 100644 --- a/vp8/encoder/rdopt.h +++ b/vp8/encoder/rdopt.h @@ -17,7 +17,7 @@ extern void vp8_initialize_rd_consts(VP8_COMP *cpi, int Qvalue); extern void vp8_rd_pick_inter_mode(VP8_COMP *cpi, MACROBLOCK *x, int recon_yoffset, int recon_uvoffset, - int *returnrate, int *returndistortion, int *returnintra, + int *returnrate, int *returndistortion, int64_t *returnintra, int64_t *best_single_rd_diff, int64_t *best_comp_rd_diff, int64_t *best_hybrid_rd_diff); extern int vp8_rd_pick_intra_mode(VP8_COMP *cpi, MACROBLOCK *x);