diff options
author | John Koleszar <jkoleszar@google.com> | 2013-01-14 11:49:30 -0800 |
---|---|---|
committer | John Koleszar <jkoleszar@google.com> | 2013-01-14 15:57:21 -0800 |
commit | 24bc1a7189724e1b67703a6165ec7e170ce784d6 (patch) | |
tree | fcb7db94add83c857216859f4511ec6877d7a6ad /vp9 | |
parent | c9071601a251d773e95eeb5f94aff919174de398 (diff) | |
download | libvpx-24bc1a7189724e1b67703a6165ec7e170ce784d6.tar libvpx-24bc1a7189724e1b67703a6165ec7e170ce784d6.tar.gz libvpx-24bc1a7189724e1b67703a6165ec7e170ce784d6.tar.bz2 libvpx-24bc1a7189724e1b67703a6165ec7e170ce784d6.zip |
Use INT64_MAX instead of LLONG_MAX
These variables have the type int64_t, not long long. long long could
be a larger type than 64 bits. Emulate INT64_MAX for older versions of
MSVC, and remove the unreferenced vpx_ports/vpxtypes.h
Change-Id: Ideaca71838fcd3849d816d5ab17aa347c97d03b0
Diffstat (limited to 'vp9')
-rw-r--r-- | vp9/common/vp9_implicit_segmentation.c | 4 | ||||
-rw-r--r-- | vp9/encoder/vp9_firstpass.c | 2 | ||||
-rw-r--r-- | vp9/encoder/vp9_onyx_if.c | 5 | ||||
-rw-r--r-- | vp9/encoder/vp9_rdopt.c | 84 |
4 files changed, 46 insertions, 49 deletions
diff --git a/vp9/common/vp9_implicit_segmentation.c b/vp9/common/vp9_implicit_segmentation.c index 472c3d1a5..e88eec48c 100644 --- a/vp9/common/vp9_implicit_segmentation.c +++ b/vp9/common/vp9_implicit_segmentation.c @@ -33,8 +33,8 @@ typedef struct { int min_y; int max_x; int max_y; - long long sum_x; - long long sum_y; + int64_t sum_x; + int64_t sum_y; int pixels; int seg_value; int label; diff --git a/vp9/encoder/vp9_firstpass.c b/vp9/encoder/vp9_firstpass.c index 44b140319..db981754e 100644 --- a/vp9/encoder/vp9_firstpass.c +++ b/vp9/encoder/vp9_firstpass.c @@ -794,7 +794,7 @@ static double bitcost(double prob) { return -(log(prob) / log(2.0)); } -static long long estimate_modemvcost(VP9_COMP *cpi, +static int64_t estimate_modemvcost(VP9_COMP *cpi, FIRSTPASS_STATS *fpstats) { #if 0 int mv_cost; diff --git a/vp9/encoder/vp9_onyx_if.c b/vp9/encoder/vp9_onyx_if.c index b767ff0b3..fbdc2d2cc 100644 --- a/vp9/encoder/vp9_onyx_if.c +++ b/vp9/encoder/vp9_onyx_if.c @@ -1727,10 +1727,7 @@ VP9_PTR vp9_create_compressor(VP9_CONFIG *oxcf) { #endif -#ifndef LLONG_MAX -#define LLONG_MAX 9223372036854775807LL -#endif - cpi->first_time_stamp_ever = LLONG_MAX; + cpi->first_time_stamp_ever = INT64_MAX; cpi->frames_till_gf_update_due = 0; cpi->key_frame_count = 1; diff --git a/vp9/encoder/vp9_rdopt.c b/vp9/encoder/vp9_rdopt.c index 573c9a7e4..823476fb3 100644 --- a/vp9/encoder/vp9_rdopt.c +++ b/vp9/encoder/vp9_rdopt.c @@ -1088,7 +1088,7 @@ static int64_t rd_pick_intra4x4block(VP9_COMP *cpi, MACROBLOCK *x, BLOCK *be, int *bestdistortion) { B_PREDICTION_MODE mode; MACROBLOCKD *xd = &x->e_mbd; - int64_t best_rd = LLONG_MAX; + int64_t best_rd = INT64_MAX; int rate = 0; int distortion; @@ -1243,7 +1243,7 @@ static int64_t rd_pick_intra4x4mby_modes(VP9_COMP *cpi, MACROBLOCK *mb, } if (total_rd >= best_rd) - return LLONG_MAX; + return INT64_MAX; *Rate = cost; *rate_y = tot_rate_y; @@ -1263,7 +1263,7 @@ static int64_t rd_pick_intra_sby_mode(VP9_COMP *cpi, MB_PREDICTION_MODE UNINITIALIZED_IS_SAFE(mode_selected); int this_rate, this_rate_tokenonly; int this_distortion, s; - int64_t best_rd = LLONG_MAX, this_rd; + int64_t best_rd = INT64_MAX, this_rd; /* Y Search for 32x32 intra prediction mode */ for (mode = DC_PRED; mode <= TM_PRED; mode++) { @@ -1303,7 +1303,7 @@ static int64_t rd_pick_intra_sb64y_mode(VP9_COMP *cpi, MB_PREDICTION_MODE UNINITIALIZED_IS_SAFE(mode_selected); int this_rate, this_rate_tokenonly; int this_distortion, s; - int64_t best_rd = LLONG_MAX, this_rd; + int64_t best_rd = INT64_MAX, this_rd; /* Y Search for 32x32 intra prediction mode */ for (mode = DC_PRED; mode <= TM_PRED; mode++) { @@ -1346,12 +1346,12 @@ static int64_t rd_pick_intra16x16mby_mode(VP9_COMP *cpi, MB_MODE_INFO *const mbmi = &xd->mode_info_context->mbmi; int rate, ratey; int distortion, skip; - int64_t best_rd = LLONG_MAX; + int64_t best_rd = INT64_MAX; int64_t this_rd; int i; for (i = 0; i < NB_TXFM_MODES; i++) - txfm_cache[i] = LLONG_MAX; + txfm_cache[i] = INT64_MAX; // Y Search for 16x16 intra prediction mode for (mode = DC_PRED; mode <= TM_PRED; mode++) { @@ -1403,7 +1403,7 @@ static int64_t rd_pick_intra8x8block(VP9_COMP *cpi, MACROBLOCK *x, int ib, int *bestdistortion) { MB_PREDICTION_MODE mode; MACROBLOCKD *xd = &x->e_mbd; - int64_t best_rd = LLONG_MAX; + int64_t best_rd = INT64_MAX; int distortion = 0, rate = 0; BLOCK *be = x->block + ib; BLOCKD *b = xd->block + ib; @@ -1528,7 +1528,7 @@ static int64_t rd_pick_intra8x8mby_modes(VP9_COMP *cpi, MACROBLOCK *mb, int cost = mb->mbmode_cost [xd->frame_type] [I8X8_PRED]; int distortion = 0; int tot_rate_y = 0; - long long total_rd = 0; + int64_t total_rd = 0; ENTROPY_CONTEXT_PLANES t_above, t_left; ENTROPY_CONTEXT *ta, *tl; int *i8x8mode_costs; @@ -1769,7 +1769,7 @@ static void rd_pick_intra_mbuv_mode(VP9_COMP *cpi, MB_PREDICTION_MODE UNINITIALIZED_IS_SAFE(mode_selected); MACROBLOCKD *xd = &x->e_mbd; MB_MODE_INFO * mbmi = &x->e_mbd.mode_info_context->mbmi; - int64_t best_rd = LLONG_MAX; + int64_t best_rd = INT64_MAX; int UNINITIALIZED_IS_SAFE(d), UNINITIALIZED_IS_SAFE(r); int rate_to, UNINITIALIZED_IS_SAFE(skip); @@ -1821,7 +1821,7 @@ static void rd_pick_intra_mbuv_mode_8x8(VP9_COMP *cpi, MB_PREDICTION_MODE mode; MB_PREDICTION_MODE UNINITIALIZED_IS_SAFE(mode_selected); MB_MODE_INFO * mbmi = &x->e_mbd.mode_info_context->mbmi; - int64_t best_rd = LLONG_MAX; + int64_t best_rd = INT64_MAX; int UNINITIALIZED_IS_SAFE(d), UNINITIALIZED_IS_SAFE(r); int rate_to, UNINITIALIZED_IS_SAFE(skip); @@ -2010,7 +2010,7 @@ static int64_t rd_pick_intra_sbuv_mode(VP9_COMP *cpi, int *skippable) { MB_PREDICTION_MODE mode; MB_PREDICTION_MODE UNINITIALIZED_IS_SAFE(mode_selected); - int64_t best_rd = LLONG_MAX, this_rd; + int64_t best_rd = INT64_MAX, this_rd; int this_rate_tokenonly, this_rate; int this_distortion, s; @@ -2047,7 +2047,7 @@ static int64_t rd_pick_intra_sb64uv_mode(VP9_COMP *cpi, int *skippable) { MB_PREDICTION_MODE mode; MB_PREDICTION_MODE UNINITIALIZED_IS_SAFE(mode_selected); - int64_t best_rd = LLONG_MAX, this_rd; + int64_t best_rd = INT64_MAX, this_rd; int this_rate_tokenonly, this_rate; int this_distortion, s; @@ -2442,7 +2442,7 @@ static void rd_check_segment_txsize(VP9_COMP *cpi, MACROBLOCK *x, mbmi->txfm_size = tx_size; for (i = 0; i < label_count && this_segment_rd < bsi->segment_rd; i++) { int_mv mode_mv[B_MODE_COUNT], second_mode_mv[B_MODE_COUNT]; - int64_t best_label_rd = LLONG_MAX, best_other_rd = LLONG_MAX; + int64_t best_label_rd = INT64_MAX, best_other_rd = INT64_MAX; B_PREDICTION_MODE mode_selected = ZERO4X4; int bestlabelyrate = 0; @@ -2780,7 +2780,7 @@ static int rd_pick_best_mbsegmentation(VP9_COMP *cpi, MACROBLOCK *x, vpx_memset(&bsi, 0, sizeof(bsi)); for (i = 0; i < NB_TXFM_MODES; i++) - txfm_cache[i] = LLONG_MAX; + txfm_cache[i] = INT64_MAX; bsi.segment_rd = best_rd; bsi.ref_mv = best_ref_mv; @@ -3238,7 +3238,7 @@ static int64_t handle_inter_mode(VP9_COMP *cpi, MACROBLOCK *x, if (is_comp_pred) { if (frame_mv[NEWMV][refs[0]].as_int == INVALID_MV || frame_mv[NEWMV][refs[1]].as_int == INVALID_MV) - return LLONG_MAX; + return INT64_MAX; *rate2 += vp9_mv_bit_cost(&frame_mv[NEWMV][refs[0]], &ref_mv[0], x->nmvjointcost, x->mvcost, 96, @@ -3312,7 +3312,7 @@ static int64_t handle_inter_mode(VP9_COMP *cpi, MACROBLOCK *x, // near) is 0,0 as this should then be coded using the zeromv mode. for (i = 0; i < num_refs; ++i) if (frame_mv[this_mode][refs[i]].as_int == 0) - return LLONG_MAX; + return INT64_MAX; case ZEROMV: default: break; @@ -3322,7 +3322,7 @@ static int64_t handle_inter_mode(VP9_COMP *cpi, MACROBLOCK *x, // Clip "next_nearest" so that it does not extend to far out of image clamp_mv2(&cur_mv[i], xd); if (mv_check_bounds(x, &cur_mv[i])) - return LLONG_MAX; + return INT64_MAX; mbmi->mv[i].as_int = cur_mv[i].as_int; } @@ -3536,13 +3536,13 @@ static void rd_pick_inter_mode(VP9_COMP *cpi, MACROBLOCK *x, int64_t best_txfm_diff[NB_TXFM_MODES]; int64_t best_pred_diff[NB_PREDICTION_TYPES]; int64_t best_pred_rd[NB_PREDICTION_TYPES]; - int64_t best_rd = LLONG_MAX, best_intra_rd = LLONG_MAX; + int64_t best_rd = INT64_MAX, best_intra_rd = INT64_MAX; #if CONFIG_COMP_INTERINTRA_PRED int is_best_interintra = 0; - int64_t best_intra16_rd = LLONG_MAX; + int64_t best_intra16_rd = INT64_MAX; int best_intra16_mode = DC_PRED, best_intra16_uv_mode = DC_PRED; #endif - int64_t best_overall_rd = LLONG_MAX; + int64_t best_overall_rd = INT64_MAX; INTERPOLATIONFILTERTYPE best_filter = SWITCHABLE; int uv_intra_rate, uv_intra_distortion, uv_intra_rate_tokenonly; int uv_intra_skippable = 0; @@ -3550,7 +3550,7 @@ static void rd_pick_inter_mode(VP9_COMP *cpi, MACROBLOCK *x, int uv_intra_skippable_8x8 = 0; int rate_y, UNINITIALIZED_IS_SAFE(rate_uv); int distortion_uv = INT_MAX; - int64_t best_yrd = LLONG_MAX; + int64_t best_yrd = INT64_MAX; int switchable_filter_index = 0; MB_PREDICTION_MODE uv_intra_mode; @@ -3579,9 +3579,9 @@ static void rd_pick_inter_mode(VP9_COMP *cpi, MACROBLOCK *x, for (i = 0; i < MAX_REF_FRAMES; i++) frame_mv[NEWMV][i].as_int = INVALID_MV; for (i = 0; i < NB_PREDICTION_TYPES; ++i) - best_pred_rd[i] = LLONG_MAX; + best_pred_rd[i] = INT64_MAX; for (i = 0; i < NB_TXFM_MODES; i++) - best_txfm_rd[i] = LLONG_MAX; + best_txfm_rd[i] = INT64_MAX; for (i = 0; i < NB_PARTITIONINGS; i++) { int j, k; @@ -3612,7 +3612,7 @@ static void rd_pick_inter_mode(VP9_COMP *cpi, MACROBLOCK *x, frame_mdcounts, y_buffer, u_buffer, v_buffer); } - *returnintra = LLONG_MAX; + *returnintra = INT64_MAX; mbmi->ref_frame = INTRA_FRAME; @@ -3640,7 +3640,7 @@ static void rd_pick_inter_mode(VP9_COMP *cpi, MACROBLOCK *x, for (mode_index = 0; mode_index < MAX_MODES; mode_index += (!switchable_filter_index)) { - int64_t this_rd = LLONG_MAX; + int64_t this_rd = INT64_MAX; int disable_skip = 0, skippable = 0; int other_cost = 0; int compmode_cost = 0; @@ -3810,7 +3810,7 @@ static void rd_pick_inter_mode(VP9_COMP *cpi, MACROBLOCK *x, distortion2 += uv_intra_distortion; distortion_uv = uv_intra_distortion; } else { - this_rd = LLONG_MAX; + this_rd = INT64_MAX; disable_skip = 1; } } @@ -3887,7 +3887,7 @@ static void rd_pick_inter_mode(VP9_COMP *cpi, MACROBLOCK *x, distortion2 += uv_intra_distortion; distortion_uv = uv_intra_distortion; } else { - this_rd = LLONG_MAX; + this_rd = INT64_MAX; disable_skip = 1; } } @@ -3933,7 +3933,7 @@ static void rd_pick_inter_mode(VP9_COMP *cpi, MACROBLOCK *x, distortion2 += distortion_uv; skippable = skippable && uv_skippable; } else { - this_rd = LLONG_MAX; + this_rd = INT64_MAX; disable_skip = 1; } @@ -3971,7 +3971,7 @@ static void rd_pick_inter_mode(VP9_COMP *cpi, MACROBLOCK *x, &rate_uv, &distortion_uv, &mode_excluded, &disable_skip, recon_yoffset, mode_index, frame_mv); - if (this_rd == LLONG_MAX) + if (this_rd == INT64_MAX) continue; } @@ -4158,7 +4158,7 @@ static void rd_pick_inter_mode(VP9_COMP *cpi, MACROBLOCK *x, } /* keep record of best txfm size */ - if (!mode_excluded && this_rd != LLONG_MAX) { + if (!mode_excluded && this_rd != INT64_MAX) { for (i = 0; i < NB_TXFM_MODES; i++) { int64_t adj_rd; if (this_mode != B_PRED) { @@ -4256,7 +4256,7 @@ static void rd_pick_inter_mode(VP9_COMP *cpi, MACROBLOCK *x, } for (i = 0; i < NB_PREDICTION_TYPES; ++i) { - if (best_pred_rd[i] == LLONG_MAX) + if (best_pred_rd[i] == INT64_MAX) best_pred_diff[i] = INT_MIN; else best_pred_diff[i] = best_rd - best_pred_rd[i]; @@ -4264,7 +4264,7 @@ static void rd_pick_inter_mode(VP9_COMP *cpi, MACROBLOCK *x, if (!x->skip) { for (i = 0; i < NB_TXFM_MODES; i++) { - if (best_txfm_rd[i] == LLONG_MAX) + if (best_txfm_rd[i] == INT64_MAX) best_txfm_diff[i] = INT_MIN; else best_txfm_diff[i] = best_rd - best_txfm_rd[i]; @@ -4481,7 +4481,7 @@ static int64_t vp9_rd_pick_inter_mode_sb(VP9_COMP *cpi, MACROBLOCK *x, int mdcounts[4]; int near_sadidx[8] = { 0, 1, 2, 3, 4, 5, 6, 7 }; int saddone = 0; - int64_t best_rd = LLONG_MAX; + int64_t best_rd = INT64_MAX; int64_t best_txfm_rd[NB_TXFM_MODES]; int64_t best_txfm_diff[NB_TXFM_MODES]; int64_t best_pred_diff[NB_PREDICTION_TYPES]; @@ -4491,10 +4491,10 @@ static int64_t vp9_rd_pick_inter_mode_sb(VP9_COMP *cpi, MACROBLOCK *x, unsigned int ref_costs[MAX_REF_FRAMES]; #if CONFIG_COMP_INTERINTRA_PRED int is_best_interintra = 0; - int64_t best_intra16_rd = LLONG_MAX; + int64_t best_intra16_rd = INT64_MAX; int best_intra16_mode = DC_PRED, best_intra16_uv_mode = DC_PRED; #endif - int64_t best_overall_rd = LLONG_MAX; + int64_t best_overall_rd = INT64_MAX; INTERPOLATIONFILTERTYPE best_filter = SWITCHABLE; int rate_uv_4x4 = 0, rate_uv_8x8 = 0, rate_uv_tokenonly_4x4 = 0, rate_uv_tokenonly_8x8 = 0; @@ -4511,9 +4511,9 @@ static int64_t vp9_rd_pick_inter_mode_sb(VP9_COMP *cpi, MACROBLOCK *x, vpx_memset(&best_mbmode, 0, sizeof(best_mbmode)); for (i = 0; i < NB_PREDICTION_TYPES; ++i) - best_pred_rd[i] = LLONG_MAX; + best_pred_rd[i] = INT64_MAX; for (i = 0; i < NB_TXFM_MODES; i++) - best_txfm_rd[i] = LLONG_MAX; + best_txfm_rd[i] = INT64_MAX; for (ref_frame = LAST_FRAME; ref_frame <= ALTREF_FRAME; ref_frame++) { if (cpi->ref_frame_flags & flag_list[ref_frame]) { @@ -4573,7 +4573,7 @@ static int64_t vp9_rd_pick_inter_mode_sb(VP9_COMP *cpi, MACROBLOCK *x, for (mode_index = 0; mode_index < MAX_MODES; mode_index += (!switchable_filter_index)) { int mode_excluded = 0; - int64_t this_rd = LLONG_MAX; + int64_t this_rd = INT64_MAX; int disable_skip = 0; int other_cost = 0; int compmode_cost = 0; @@ -4744,7 +4744,7 @@ static int64_t vp9_rd_pick_inter_mode_sb(VP9_COMP *cpi, MACROBLOCK *x, &rate_uv, &distortion_uv, &mode_excluded, &disable_skip, recon_yoffset, mode_index, frame_mv); - if (this_rd == LLONG_MAX) + if (this_rd == INT64_MAX) continue; } @@ -4908,7 +4908,7 @@ static int64_t vp9_rd_pick_inter_mode_sb(VP9_COMP *cpi, MACROBLOCK *x, } /* keep record of best txfm size */ - if (!mode_excluded && this_rd != LLONG_MAX) { + if (!mode_excluded && this_rd != INT64_MAX) { for (i = 0; i < NB_TXFM_MODES; i++) { int64_t adj_rd; if (this_mode != B_PRED) { @@ -4982,7 +4982,7 @@ static int64_t vp9_rd_pick_inter_mode_sb(VP9_COMP *cpi, MACROBLOCK *x, vpx_memcpy(mbmi, &best_mbmode, sizeof(MB_MODE_INFO)); for (i = 0; i < NB_PREDICTION_TYPES; ++i) { - if (best_pred_rd[i] == LLONG_MAX) + if (best_pred_rd[i] == INT64_MAX) best_pred_diff[i] = INT_MIN; else best_pred_diff[i] = best_rd - best_pred_rd[i]; @@ -4990,7 +4990,7 @@ static int64_t vp9_rd_pick_inter_mode_sb(VP9_COMP *cpi, MACROBLOCK *x, if (!x->skip) { for (i = 0; i < NB_TXFM_MODES; i++) { - if (best_txfm_rd[i] == LLONG_MAX) + if (best_txfm_rd[i] == INT64_MAX) best_txfm_diff[i] = INT_MIN; else best_txfm_diff[i] = best_rd - best_txfm_rd[i]; |