Merge "cosmetics: consistently use [u]int64_t"

This commit is contained in:
John Koleszar 2011-07-26 12:57:43 -07:00 committed by Code Review
commit db8f0d2ca9
14 changed files with 101 additions and 101 deletions

View File

@ -211,8 +211,8 @@ extern "C"
// receive a frames worth of data caller can assume that a copy of this frame is made // receive a frames worth of data caller can assume that a copy of this frame is made
// and not just a copy of the pointer.. // and not just a copy of the pointer..
int vp8_receive_raw_frame(VP8_PTR comp, unsigned int frame_flags, YV12_BUFFER_CONFIG *sd, INT64 time_stamp, INT64 end_time_stamp); int vp8_receive_raw_frame(VP8_PTR comp, unsigned int frame_flags, YV12_BUFFER_CONFIG *sd, int64_t time_stamp, int64_t end_time_stamp);
int vp8_get_compressed_data(VP8_PTR comp, unsigned int *frame_flags, unsigned long *size, unsigned char *dest, INT64 *time_stamp, INT64 *time_end, int flush); int vp8_get_compressed_data(VP8_PTR comp, unsigned int *frame_flags, unsigned long *size, unsigned char *dest, int64_t *time_stamp, int64_t *time_end, int flush);
int vp8_get_preview_raw_frame(VP8_PTR comp, YV12_BUFFER_CONFIG *dest, vp8_ppflags_t *flags); int vp8_get_preview_raw_frame(VP8_PTR comp, YV12_BUFFER_CONFIG *dest, vp8_ppflags_t *flags);
int vp8_use_as_reference(VP8_PTR comp, int ref_frame_flags); int vp8_use_as_reference(VP8_PTR comp, int ref_frame_flags);

View File

@ -54,8 +54,8 @@ extern "C"
int vp8dx_get_setting(VP8D_PTR comp, VP8D_SETTING oxst); int vp8dx_get_setting(VP8D_PTR comp, VP8D_SETTING oxst);
int vp8dx_receive_compressed_data(VP8D_PTR comp, unsigned long size, const unsigned char *dest, INT64 time_stamp); int vp8dx_receive_compressed_data(VP8D_PTR comp, unsigned long size, const unsigned char *dest, int64_t time_stamp);
int vp8dx_get_raw_frame(VP8D_PTR comp, YV12_BUFFER_CONFIG *sd, INT64 *time_stamp, INT64 *time_end_stamp, vp8_ppflags_t *flags); int vp8dx_get_raw_frame(VP8D_PTR comp, YV12_BUFFER_CONFIG *sd, int64_t *time_stamp, int64_t *time_end_stamp, vp8_ppflags_t *flags);
vpx_codec_err_t vp8dx_get_reference(VP8D_PTR comp, VP8_REFFRAME ref_frame_flag, YV12_BUFFER_CONFIG *sd); vpx_codec_err_t vp8dx_get_reference(VP8D_PTR comp, VP8_REFFRAME ref_frame_flag, YV12_BUFFER_CONFIG *sd);
vpx_codec_err_t vp8dx_set_reference(VP8D_PTR comp, VP8_REFFRAME ref_frame_flag, YV12_BUFFER_CONFIG *sd); vpx_codec_err_t vp8dx_set_reference(VP8D_PTR comp, VP8_REFFRAME ref_frame_flag, YV12_BUFFER_CONFIG *sd);

View File

@ -204,8 +204,8 @@ vpx_codec_err_t vp8dx_set_reference(VP8D_PTR ptr, VP8_REFFRAME ref_frame_flag, Y
/*For ARM NEON, d8-d15 are callee-saved registers, and need to be saved by us.*/ /*For ARM NEON, d8-d15 are callee-saved registers, and need to be saved by us.*/
#if HAVE_ARMV7 #if HAVE_ARMV7
extern void vp8_push_neon(INT64 *store); extern void vp8_push_neon(int64_t *store);
extern void vp8_pop_neon(INT64 *store); extern void vp8_pop_neon(int64_t *store);
#endif #endif
static int get_free_fb (VP8_COMMON *cm) static int get_free_fb (VP8_COMMON *cm)
@ -288,10 +288,10 @@ static int swap_frame_buffers (VP8_COMMON *cm)
return err; return err;
} }
int vp8dx_receive_compressed_data(VP8D_PTR ptr, unsigned long size, const unsigned char *source, INT64 time_stamp) int vp8dx_receive_compressed_data(VP8D_PTR ptr, unsigned long size, const unsigned char *source, int64_t time_stamp)
{ {
#if HAVE_ARMV7 #if HAVE_ARMV7
INT64 dx_store_reg[8]; int64_t dx_store_reg[8];
#endif #endif
VP8D_COMP *pbi = (VP8D_COMP *) ptr; VP8D_COMP *pbi = (VP8D_COMP *) ptr;
VP8_COMMON *cm = &pbi->common; VP8_COMMON *cm = &pbi->common;
@ -495,9 +495,9 @@ int vp8dx_receive_compressed_data(VP8D_PTR ptr, unsigned long size, const unsign
#if 0 #if 0
{ {
int i; int i;
INT64 earliest_time = pbi->dr[0].time_stamp; int64_t earliest_time = pbi->dr[0].time_stamp;
INT64 latest_time = pbi->dr[0].time_stamp; int64_t latest_time = pbi->dr[0].time_stamp;
INT64 time_diff = 0; int64_t time_diff = 0;
int bytes = 0; int bytes = 0;
pbi->dr[pbi->common.current_video_frame&0xf].size = pbi->bc.pos + pbi->bc2.pos + 4;; pbi->dr[pbi->common.current_video_frame&0xf].size = pbi->bc.pos + pbi->bc2.pos + 4;;
@ -537,7 +537,7 @@ int vp8dx_receive_compressed_data(VP8D_PTR ptr, unsigned long size, const unsign
pbi->common.error.setjmp = 0; pbi->common.error.setjmp = 0;
return retcode; return retcode;
} }
int vp8dx_get_raw_frame(VP8D_PTR ptr, YV12_BUFFER_CONFIG *sd, INT64 *time_stamp, INT64 *time_end_stamp, vp8_ppflags_t *flags) int vp8dx_get_raw_frame(VP8D_PTR ptr, YV12_BUFFER_CONFIG *sd, int64_t *time_stamp, int64_t *time_end_stamp, vp8_ppflags_t *flags)
{ {
int ret = -1; int ret = -1;
VP8D_COMP *pbi = (VP8D_COMP *) ptr; VP8D_COMP *pbi = (VP8D_COMP *) ptr;

View File

@ -38,7 +38,7 @@ typedef struct
typedef struct typedef struct
{ {
INT64 time_stamp; int64_t time_stamp;
int size; int size;
} DATARATE; } DATARATE;
@ -109,7 +109,7 @@ typedef struct VP8Decompressor
#endif #endif
vp8_reader *mbc; vp8_reader *mbc;
INT64 last_time_stamp; int64_t last_time_stamp;
int ready_for_new_data; int ready_for_new_data;
DATARATE dr[16]; DATARATE dr[16];

View File

@ -140,7 +140,7 @@ static unsigned int mb_activity_measure( VP8_COMP *cpi, MACROBLOCK *x,
// Calculate an "average" mb activity value for the frame // Calculate an "average" mb activity value for the frame
#define ACT_MEDIAN 0 #define ACT_MEDIAN 0
static void calc_av_activity( VP8_COMP *cpi, INT64 activity_sum ) static void calc_av_activity( VP8_COMP *cpi, int64_t activity_sum )
{ {
#if ACT_MEDIAN #if ACT_MEDIAN
// Find median: Simple n^2 algorithm for experimentation // Find median: Simple n^2 algorithm for experimentation
@ -208,9 +208,9 @@ static void calc_activity_index( VP8_COMP *cpi, MACROBLOCK *x )
VP8_COMMON *const cm = & cpi->common; VP8_COMMON *const cm = & cpi->common;
int mb_row, mb_col; int mb_row, mb_col;
INT64 act; int64_t act;
INT64 a; int64_t a;
INT64 b; int64_t b;
#if OUTPUT_NORM_ACT_STATS #if OUTPUT_NORM_ACT_STATS
FILE *f = fopen("norm_act.stt", "a"); FILE *f = fopen("norm_act.stt", "a");
@ -274,7 +274,7 @@ static void build_activity_map( VP8_COMP *cpi )
int mb_row, mb_col; int mb_row, mb_col;
unsigned int mb_activity; unsigned int mb_activity;
INT64 activity_sum = 0; int64_t activity_sum = 0;
// for each macroblock row in image // for each macroblock row in image
for (mb_row = 0; mb_row < cm->mb_rows; mb_row++) for (mb_row = 0; mb_row < cm->mb_rows; mb_row++)
@ -341,15 +341,15 @@ void vp8_activity_masking(VP8_COMP *cpi, MACROBLOCK *x)
x->errorperbit = x->rdmult * 100 /(110 * x->rddiv); x->errorperbit = x->rdmult * 100 /(110 * x->rddiv);
x->errorperbit += (x->errorperbit==0); x->errorperbit += (x->errorperbit==0);
#else #else
INT64 a; int64_t a;
INT64 b; int64_t b;
INT64 act = *(x->mb_activity_ptr); int64_t act = *(x->mb_activity_ptr);
// Apply the masking to the RD multiplier. // Apply the masking to the RD multiplier.
a = act + (2*cpi->activity_avg); a = act + (2*cpi->activity_avg);
b = (2*act) + cpi->activity_avg; b = (2*act) + cpi->activity_avg;
x->rdmult = (unsigned int)(((INT64)x->rdmult*b + (a>>1))/a); x->rdmult = (unsigned int)(((int64_t)x->rdmult*b + (a>>1))/a);
x->errorperbit = x->rdmult * 100 /(110 * x->rddiv); x->errorperbit = x->rdmult * 100 /(110 * x->rddiv);
x->errorperbit += (x->errorperbit==0); x->errorperbit += (x->errorperbit==0);
#endif #endif
@ -1102,18 +1102,18 @@ static void adjust_act_zbin( VP8_COMP *cpi, MACROBLOCK *x )
#if USE_ACT_INDEX #if USE_ACT_INDEX
x->act_zbin_adj = *(x->mb_activity_ptr); x->act_zbin_adj = *(x->mb_activity_ptr);
#else #else
INT64 a; int64_t a;
INT64 b; int64_t b;
INT64 act = *(x->mb_activity_ptr); int64_t act = *(x->mb_activity_ptr);
// Apply the masking to the RD multiplier. // Apply the masking to the RD multiplier.
a = act + 4*cpi->activity_avg; a = act + 4*cpi->activity_avg;
b = 4*act + cpi->activity_avg; b = 4*act + cpi->activity_avg;
if ( act > cpi->activity_avg ) if ( act > cpi->activity_avg )
x->act_zbin_adj = (int)(((INT64)b + (a>>1))/a) - 1; x->act_zbin_adj = (int)(((int64_t)b + (a>>1))/a) - 1;
else else
x->act_zbin_adj = 1 - (int)(((INT64)a + (b>>1))/b); x->act_zbin_adj = 1 - (int)(((int64_t)a + (b>>1))/b);
#endif #endif
} }

View File

@ -530,8 +530,8 @@ void vp8_first_pass(VP8_COMP *cpi)
YV12_BUFFER_CONFIG *gld_yv12 = &cm->yv12_fb[cm->gld_fb_idx]; YV12_BUFFER_CONFIG *gld_yv12 = &cm->yv12_fb[cm->gld_fb_idx];
int recon_y_stride = lst_yv12->y_stride; int recon_y_stride = lst_yv12->y_stride;
int recon_uv_stride = lst_yv12->uv_stride; int recon_uv_stride = lst_yv12->uv_stride;
long long intra_error = 0; int64_t intra_error = 0;
long long coded_error = 0; int64_t coded_error = 0;
int sum_mvr = 0, sum_mvc = 0; int sum_mvr = 0, sum_mvc = 0;
int sum_mvr_abs = 0, sum_mvc_abs = 0; int sum_mvr_abs = 0, sum_mvc_abs = 0;
@ -620,7 +620,7 @@ void vp8_first_pass(VP8_COMP *cpi)
this_error += intrapenalty; this_error += intrapenalty;
// Cumulative intra error total // Cumulative intra error total
intra_error += (long long)this_error; intra_error += (int64_t)this_error;
// Set up limit values for motion vectors to prevent them extending outside the UMV borders // Set up limit values for motion vectors to prevent them extending outside the UMV borders
x->mv_col_min = -((mb_col * 16) + (VP8BORDERINPIXELS - 16)); x->mv_col_min = -((mb_col * 16) + (VP8BORDERINPIXELS - 16));
@ -757,7 +757,7 @@ void vp8_first_pass(VP8_COMP *cpi)
} }
} }
coded_error += (long long)this_error; coded_error += (int64_t)this_error;
// adjust to the next column of macroblocks // adjust to the next column of macroblocks
x->src.y_buffer += 16; x->src.y_buffer += 16;
@ -1219,8 +1219,8 @@ void vp8_init_second_pass(VP8_COMP *cpi)
cpi->twopass.total_coded_error_left = cpi->twopass.total_stats->coded_error; cpi->twopass.total_coded_error_left = cpi->twopass.total_stats->coded_error;
cpi->twopass.start_tot_err_left = cpi->twopass.total_error_left; cpi->twopass.start_tot_err_left = cpi->twopass.total_error_left;
//cpi->twopass.bits_left = (long long)(cpi->twopass.total_stats->count * cpi->oxcf.target_bandwidth / DOUBLE_DIVIDE_CHECK((double)cpi->oxcf.frame_rate)); //cpi->twopass.bits_left = (int64_t)(cpi->twopass.total_stats->count * cpi->oxcf.target_bandwidth / DOUBLE_DIVIDE_CHECK((double)cpi->oxcf.frame_rate));
//cpi->twopass.bits_left -= (long long)(cpi->twopass.total_stats->count * two_pass_min_rate / DOUBLE_DIVIDE_CHECK((double)cpi->oxcf.frame_rate)); //cpi->twopass.bits_left -= (int64_t)(cpi->twopass.total_stats->count * two_pass_min_rate / DOUBLE_DIVIDE_CHECK((double)cpi->oxcf.frame_rate));
// each frame can have a different duration, as the frame rate in the source // each frame can have a different duration, as the frame rate in the source
// isn't guaranteed to be constant. The frame rate prior to the first frame // isn't guaranteed to be constant. The frame rate prior to the first frame
@ -1230,8 +1230,8 @@ void vp8_init_second_pass(VP8_COMP *cpi)
vp8_new_frame_rate(cpi, 10000000.0 * cpi->twopass.total_stats->count / cpi->twopass.total_stats->duration); vp8_new_frame_rate(cpi, 10000000.0 * cpi->twopass.total_stats->count / cpi->twopass.total_stats->duration);
cpi->output_frame_rate = cpi->oxcf.frame_rate; cpi->output_frame_rate = cpi->oxcf.frame_rate;
cpi->twopass.bits_left = (long long)(cpi->twopass.total_stats->duration * cpi->oxcf.target_bandwidth / 10000000.0) ; cpi->twopass.bits_left = (int64_t)(cpi->twopass.total_stats->duration * cpi->oxcf.target_bandwidth / 10000000.0) ;
cpi->twopass.bits_left -= (long long)(cpi->twopass.total_stats->duration * two_pass_min_rate / 10000000.0); cpi->twopass.bits_left -= (int64_t)(cpi->twopass.total_stats->duration * two_pass_min_rate / 10000000.0);
cpi->twopass.clip_bits_total = cpi->twopass.bits_left; cpi->twopass.clip_bits_total = cpi->twopass.bits_left;
// Calculate a minimum intra value to be used in determining the IIratio // Calculate a minimum intra value to be used in determining the IIratio
@ -2671,16 +2671,16 @@ static void find_next_key_frame(VP8_COMP *cpi, FIRSTPASS_STATS *this_frame)
int max_bits = frame_max_bits(cpi); int max_bits = frame_max_bits(cpi);
// Maximum bits for the kf group // Maximum bits for the kf group
long long max_grp_bits; int64_t max_grp_bits;
// Default allocation based on bits left and relative // Default allocation based on bits left and relative
// complexity of the section // complexity of the section
cpi->twopass.kf_group_bits = (long long)( cpi->twopass.bits_left * cpi->twopass.kf_group_bits = (int64_t)( cpi->twopass.bits_left *
( kf_group_err / ( kf_group_err /
cpi->twopass.modified_error_left )); cpi->twopass.modified_error_left ));
// Clip based on maximum per frame rate defined by the user. // Clip based on maximum per frame rate defined by the user.
max_grp_bits = (long long)max_bits * (long long)cpi->twopass.frames_to_key; max_grp_bits = (int64_t)max_bits * (int64_t)cpi->twopass.frames_to_key;
if (cpi->twopass.kf_group_bits > max_grp_bits) if (cpi->twopass.kf_group_bits > max_grp_bits)
cpi->twopass.kf_group_bits = max_grp_bits; cpi->twopass.kf_group_bits = max_grp_bits;
@ -2697,19 +2697,19 @@ static void find_next_key_frame(VP8_COMP *cpi, FIRSTPASS_STATS *this_frame)
int high_water_mark = (opt_buffer_lvl + int high_water_mark = (opt_buffer_lvl +
cpi->oxcf.maximum_buffer_size) >> 1; cpi->oxcf.maximum_buffer_size) >> 1;
long long av_group_bits; int64_t av_group_bits;
// Av bits per frame * number of frames // Av bits per frame * number of frames
av_group_bits = (long long)cpi->av_per_frame_bandwidth * av_group_bits = (int64_t)cpi->av_per_frame_bandwidth *
(long long)cpi->twopass.frames_to_key; (int64_t)cpi->twopass.frames_to_key;
// We are at or above the maximum. // We are at or above the maximum.
if (cpi->buffer_level >= high_water_mark) if (cpi->buffer_level >= high_water_mark)
{ {
long long min_group_bits; int64_t min_group_bits;
min_group_bits = av_group_bits + min_group_bits = av_group_bits +
(long long)(buffer_lvl - (int64_t)(buffer_lvl -
high_water_mark); high_water_mark);
if (cpi->twopass.kf_group_bits < min_group_bits) if (cpi->twopass.kf_group_bits < min_group_bits)
@ -2718,11 +2718,11 @@ static void find_next_key_frame(VP8_COMP *cpi, FIRSTPASS_STATS *this_frame)
// We are above optimal but below the maximum // We are above optimal but below the maximum
else if (cpi->twopass.kf_group_bits < av_group_bits) else if (cpi->twopass.kf_group_bits < av_group_bits)
{ {
long long bits_below_av = av_group_bits - int64_t bits_below_av = av_group_bits -
cpi->twopass.kf_group_bits; cpi->twopass.kf_group_bits;
cpi->twopass.kf_group_bits += cpi->twopass.kf_group_bits +=
(long long)((double)bits_below_av * (int64_t)((double)bits_below_av *
(double)(buffer_lvl - opt_buffer_lvl) / (double)(buffer_lvl - opt_buffer_lvl) /
(double)(high_water_mark - opt_buffer_lvl)); (double)(high_water_mark - opt_buffer_lvl));
} }
@ -3043,8 +3043,8 @@ static void find_next_key_frame(VP8_COMP *cpi, FIRSTPASS_STATS *this_frame)
} }
else else
{ {
long long clip_bits = (long long)(cpi->twopass.total_stats->count * cpi->oxcf.target_bandwidth / DOUBLE_DIVIDE_CHECK((double)cpi->oxcf.frame_rate)); int64_t clip_bits = (int64_t)(cpi->twopass.total_stats->count * cpi->oxcf.target_bandwidth / DOUBLE_DIVIDE_CHECK((double)cpi->oxcf.frame_rate));
long long over_spend = cpi->oxcf.starting_buffer_level - cpi->buffer_level; int64_t over_spend = cpi->oxcf.starting_buffer_level - cpi->buffer_level;
if ((last_kf_resampled && (kf_q > cpi->worst_quality)) || // If triggered last time the threshold for triggering again is reduced if ((last_kf_resampled && (kf_q > cpi->worst_quality)) || // If triggered last time the threshold for triggering again is reduced
((kf_q > cpi->worst_quality) && // Projected Q higher than allowed and ... ((kf_q > cpi->worst_quality) && // Projected Q higher than allowed and ...

View File

@ -3196,7 +3196,7 @@ void loopfilter_frame(VP8_COMP *cpi, VP8_COMMON *cm)
static void update_buffer_level(VP8_COMP *cpi) static void update_buffer_level(VP8_COMP *cpi)
{ {
long long tmp; int64_t tmp;
/* Update the buffered average bitrate. /* Update the buffered average bitrate.
* *
@ -3266,7 +3266,7 @@ static void update_buffer_level(VP8_COMP *cpi)
*/ */
if(cpi->total_actual_bits > cpi->oxcf.starting_buffer_level) if(cpi->total_actual_bits > cpi->oxcf.starting_buffer_level)
{ {
tmp = (long long)cpi->buffered_av_per_frame_bandwidth tmp = (int64_t)cpi->buffered_av_per_frame_bandwidth
* cpi->oxcf.maximum_buffer_size * cpi->oxcf.maximum_buffer_size
/ cpi->av_per_frame_bandwidth; / cpi->av_per_frame_bandwidth;
cpi->buffer_level = cpi->oxcf.maximum_buffer_size cpi->buffer_level = cpi->oxcf.maximum_buffer_size
@ -3284,7 +3284,7 @@ static void update_buffer_level(VP8_COMP *cpi)
*/ */
if(cpi->total_actual_bits > cpi->oxcf.starting_buffer_level) if(cpi->total_actual_bits > cpi->oxcf.starting_buffer_level)
{ {
long long decayed_overshoot; int64_t decayed_overshoot;
decayed_overshoot = cpi->accumulated_overshoot; decayed_overshoot = cpi->accumulated_overshoot;
decayed_overshoot *= (cpi->oxcf.maximum_buffer_size decayed_overshoot *= (cpi->oxcf.maximum_buffer_size
@ -4638,22 +4638,22 @@ static void Pass2Encode(VP8_COMP *cpi, unsigned long *size, unsigned char *dest,
{ {
double two_pass_min_rate = (double)(cpi->oxcf.target_bandwidth double two_pass_min_rate = (double)(cpi->oxcf.target_bandwidth
*cpi->oxcf.two_pass_vbrmin_section / 100); *cpi->oxcf.two_pass_vbrmin_section / 100);
cpi->twopass.bits_left += (long long)(two_pass_min_rate / cpi->oxcf.frame_rate); cpi->twopass.bits_left += (int64_t)(two_pass_min_rate / cpi->oxcf.frame_rate);
} }
} }
#endif #endif
//For ARM NEON, d8-d15 are callee-saved registers, and need to be saved by us. //For ARM NEON, d8-d15 are callee-saved registers, and need to be saved by us.
#if HAVE_ARMV7 #if HAVE_ARMV7
extern void vp8_push_neon(INT64 *store); extern void vp8_push_neon(int64_t *store);
extern void vp8_pop_neon(INT64 *store); extern void vp8_pop_neon(int64_t *store);
#endif #endif
int vp8_receive_raw_frame(VP8_PTR ptr, unsigned int frame_flags, YV12_BUFFER_CONFIG *sd, INT64 time_stamp, INT64 end_time) int vp8_receive_raw_frame(VP8_PTR ptr, unsigned int frame_flags, YV12_BUFFER_CONFIG *sd, int64_t time_stamp, int64_t end_time)
{ {
#if HAVE_ARMV7 #if HAVE_ARMV7
INT64 store_reg[8]; int64_t store_reg[8];
#endif #endif
VP8_COMP *cpi = (VP8_COMP *) ptr; VP8_COMP *cpi = (VP8_COMP *) ptr;
VP8_COMMON *cm = &cpi->common; VP8_COMMON *cm = &cpi->common;
@ -4704,10 +4704,10 @@ static int frame_is_reference(const VP8_COMP *cpi)
} }
int vp8_get_compressed_data(VP8_PTR ptr, unsigned int *frame_flags, unsigned long *size, unsigned char *dest, INT64 *time_stamp, INT64 *time_end, int flush) int vp8_get_compressed_data(VP8_PTR ptr, unsigned int *frame_flags, unsigned long *size, unsigned char *dest, int64_t *time_stamp, int64_t *time_end, int flush)
{ {
#if HAVE_ARMV7 #if HAVE_ARMV7
INT64 store_reg[8]; int64_t store_reg[8];
#endif #endif
VP8_COMP *cpi = (VP8_COMP *) ptr; VP8_COMP *cpi = (VP8_COMP *) ptr;
VP8_COMMON *cm = &cpi->common; VP8_COMMON *cm = &cpi->common;
@ -4814,7 +4814,7 @@ int vp8_get_compressed_data(VP8_PTR ptr, unsigned int *frame_flags, unsigned lon
// adjust frame rates based on timestamps given // adjust frame rates based on timestamps given
if (!cm->refresh_alt_ref_frame) if (!cm->refresh_alt_ref_frame)
{ {
long long this_duration; int64_t this_duration;
int step = 0; int step = 0;
if (cpi->source->ts_start == cpi->first_time_stamp_ever) if (cpi->source->ts_start == cpi->first_time_stamp_ever)
@ -4824,7 +4824,7 @@ int vp8_get_compressed_data(VP8_PTR ptr, unsigned int *frame_flags, unsigned lon
} }
else else
{ {
long long last_duration; int64_t last_duration;
this_duration = cpi->source->ts_end - cpi->last_end_time_stamp_seen; this_duration = cpi->source->ts_end - cpi->last_end_time_stamp_seen;
last_duration = cpi->last_end_time_stamp_seen last_duration = cpi->last_end_time_stamp_seen
@ -5000,7 +5000,7 @@ int vp8_get_compressed_data(VP8_PTR ptr, unsigned int *frame_flags, unsigned lon
int y_samples = orig->y_height * orig->y_width ; int y_samples = orig->y_height * orig->y_width ;
int uv_samples = orig->uv_height * orig->uv_width ; int uv_samples = orig->uv_height * orig->uv_width ;
int t_samples = y_samples + 2 * uv_samples; int t_samples = y_samples + 2 * uv_samples;
long long sq_error; int64_t sq_error;
ye = calc_plane_error(orig->y_buffer, orig->y_stride, ye = calc_plane_error(orig->y_buffer, orig->y_stride,
recon->y_buffer, recon->y_stride, orig->y_width, orig->y_height, recon->y_buffer, recon->y_stride, orig->y_width, orig->y_height,

View File

@ -317,10 +317,10 @@ typedef struct VP8_COMP
CODING_CONTEXT coding_context; CODING_CONTEXT coding_context;
// Rate targetting variables // Rate targetting variables
long long prediction_error; int64_t prediction_error;
long long last_prediction_error; int64_t last_prediction_error;
long long intra_error; int64_t intra_error;
long long last_intra_error; int64_t last_intra_error;
int this_frame_target; int this_frame_target;
int projected_frame_size; int projected_frame_size;
@ -343,7 +343,7 @@ typedef struct VP8_COMP
int baseline_gf_interval; int baseline_gf_interval;
int active_arnr_frames; // <= cpi->oxcf.arnr_max_frames int active_arnr_frames; // <= cpi->oxcf.arnr_max_frames
INT64 key_frame_count; int64_t key_frame_count;
int prior_key_frame_distance[KEY_FRAME_CONTEXT]; int prior_key_frame_distance[KEY_FRAME_CONTEXT];
int per_frame_bandwidth; // Current section per frame bandwidth target int per_frame_bandwidth; // Current section per frame bandwidth target
int av_per_frame_bandwidth; // Average frame size target for clip int av_per_frame_bandwidth; // Average frame size target for clip
@ -354,9 +354,9 @@ typedef struct VP8_COMP
int inter_frame_target; int inter_frame_target;
double output_frame_rate; double output_frame_rate;
long long last_time_stamp_seen; int64_t last_time_stamp_seen;
long long last_end_time_stamp_seen; int64_t last_end_time_stamp_seen;
long long first_time_stamp_ever; int64_t first_time_stamp_ever;
int ni_av_qi; int ni_av_qi;
int ni_tot_qi; int ni_tot_qi;
@ -367,7 +367,7 @@ typedef struct VP8_COMP
int zbin_mode_boost; int zbin_mode_boost;
int zbin_mode_boost_enabled; int zbin_mode_boost_enabled;
INT64 total_byte_count; int64_t total_byte_count;
int buffered_mode; int buffered_mode;
@ -380,7 +380,7 @@ typedef struct VP8_COMP
int long_rolling_target_bits; int long_rolling_target_bits;
int long_rolling_actual_bits; int long_rolling_actual_bits;
long long total_actual_bits; int64_t total_actual_bits;
int total_target_vs_actual; // debug stats int total_target_vs_actual; // debug stats
int worst_quality; int worst_quality;
@ -528,8 +528,8 @@ typedef struct VP8_COMP
FIRSTPASS_STATS *this_frame_stats; FIRSTPASS_STATS *this_frame_stats;
FIRSTPASS_STATS *stats_in, *stats_in_end, *stats_in_start; FIRSTPASS_STATS *stats_in, *stats_in_end, *stats_in_start;
int first_pass_done; int first_pass_done;
long long bits_left; int64_t bits_left;
long long clip_bits_total; int64_t clip_bits_total;
double avg_iiratio; double avg_iiratio;
double modified_error_total; double modified_error_total;
double modified_error_used; double modified_error_used;
@ -549,10 +549,10 @@ typedef struct VP8_COMP
int gf_group_error_left; // Remaining error from uncoded frames in a gf group. Two pass use only int gf_group_error_left; // Remaining error from uncoded frames in a gf group. Two pass use only
// Projected total bits available for a key frame group of frames // Projected total bits available for a key frame group of frames
long long kf_group_bits; int64_t kf_group_bits;
// Error score of frames still to be coded in kf group // Error score of frames still to be coded in kf group
long long kf_group_error_left; int64_t kf_group_error_left;
int gf_group_bits; // Projected Bits available for a group of frames including 1 GF or ARF int gf_group_bits; // Projected Bits available for a group of frames including 1 GF or ARF
int gf_bits; // Bits for the golden frame or ARF - 2 pass only int gf_bits; // Bits for the golden frame or ARF - 2 pass only

View File

@ -852,9 +852,9 @@ static void calc_pframe_target_size(VP8_COMP *cpi)
if ( critical_buffer_level > if ( critical_buffer_level >
(cpi->oxcf.optimal_buffer_level >> 2) ) (cpi->oxcf.optimal_buffer_level >> 2) )
{ {
INT64 qadjustment_range = int64_t qadjustment_range =
cpi->worst_quality - cpi->ni_av_qi; cpi->worst_quality - cpi->ni_av_qi;
INT64 above_base = int64_t above_base =
(critical_buffer_level - (critical_buffer_level -
(cpi->oxcf.optimal_buffer_level >> 2)); (cpi->oxcf.optimal_buffer_level >> 2));
@ -1118,7 +1118,7 @@ static void calc_pframe_target_size(VP8_COMP *cpi)
if (cpi->pass==0 if (cpi->pass==0
&& cpi->common.refresh_golden_frame && cpi->common.refresh_golden_frame
&& cpi->oxcf.end_usage == USAGE_STREAM_FROM_SERVER) { && cpi->oxcf.end_usage == USAGE_STREAM_FROM_SERVER) {
long long adjust; int64_t adjust;
/* /*
frames_in_buffer = cpi->oxcf.maximum_buffer_size frames_in_buffer = cpi->oxcf.maximum_buffer_size

View File

@ -665,7 +665,7 @@ static int rd_pick_intra4x4mby_modes(VP8_COMP *cpi, MACROBLOCK *mb, int *Rate,
int cost = mb->mbmode_cost [xd->frame_type] [B_PRED]; int cost = mb->mbmode_cost [xd->frame_type] [B_PRED];
int distortion = 0; int distortion = 0;
int tot_rate_y = 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_PLANES t_above, t_left;
ENTROPY_CONTEXT *ta; ENTROPY_CONTEXT *ta;
ENTROPY_CONTEXT *tl; ENTROPY_CONTEXT *tl;
@ -707,11 +707,11 @@ static int rd_pick_intra4x4mby_modes(VP8_COMP *cpi, MACROBLOCK *mb, int *Rate,
mic->bmi[i].as_mode = best_mode; mic->bmi[i].as_mode = best_mode;
if(total_rd >= (long long)best_rd) if(total_rd >= (int64_t)best_rd)
break; break;
} }
if(total_rd >= (long long)best_rd) if(total_rd >= (int64_t)best_rd)
return INT_MAX; return INT_MAX;
*Rate = cost; *Rate = cost;

View File

@ -73,8 +73,8 @@ void ssim_parms_8x8_c
} }
} }
const static long long cc1 = 26634; // (64^2*(.01*255)^2 const static int64_t cc1 = 26634; // (64^2*(.01*255)^2
const static long long cc2 = 239708; // (64^2*(.03*255)^2 const static int64_t cc2 = 239708; // (64^2*(.03*255)^2
static double similarity static double similarity
( (
@ -86,19 +86,19 @@ static double similarity
int count int count
) )
{ {
long long ssim_n, ssim_d; int64_t ssim_n, ssim_d;
long long c1, c2; int64_t c1, c2;
//scale the constants by number of pixels //scale the constants by number of pixels
c1 = (cc1*count*count)>>12; c1 = (cc1*count*count)>>12;
c2 = (cc2*count*count)>>12; c2 = (cc2*count*count)>>12;
ssim_n = (2*sum_s*sum_r+ c1)*((long long) 2*count*sum_sxr- ssim_n = (2*sum_s*sum_r+ c1)*((int64_t) 2*count*sum_sxr-
(long long) 2*sum_s*sum_r+c2); (int64_t) 2*sum_s*sum_r+c2);
ssim_d = (sum_s*sum_s +sum_r*sum_r+c1)* ssim_d = (sum_s*sum_s +sum_r*sum_r+c1)*
((long long)count*sum_sq_s-(long long)sum_s*sum_s + ((int64_t)count*sum_sq_s-(int64_t)sum_s*sum_s +
(long long)count*sum_sq_r-(long long) sum_r*sum_r +c2) ; (int64_t)count*sum_sq_r-(int64_t) sum_r*sum_r +c2) ;
return ssim_n * 1.0 / ssim_d; return ssim_n * 1.0 / ssim_d;
} }
@ -124,11 +124,11 @@ long dssim(unsigned char *s,int sp, unsigned char *r,int rp,
const vp8_variance_rtcd_vtable_t *rtcd) const vp8_variance_rtcd_vtable_t *rtcd)
{ {
unsigned long sum_s=0,sum_r=0,sum_sq_s=0,sum_sq_r=0,sum_sxr=0; unsigned long sum_s=0,sum_r=0,sum_sq_s=0,sum_sq_r=0,sum_sxr=0;
long long ssim3; int64_t ssim3;
long long ssim_n1,ssim_n2; int64_t ssim_n1,ssim_n2;
long long ssim_d1,ssim_d2; int64_t ssim_d1,ssim_d2;
long long ssim_t1,ssim_t2; int64_t ssim_t1,ssim_t2;
long long c1, c2; int64_t c1, c2;
// normalize by 256/64 // normalize by 256/64
c1 = cc1*16; c1 = cc1*16;
@ -137,12 +137,12 @@ long dssim(unsigned char *s,int sp, unsigned char *r,int rp,
rtcd->ssimpf(s, sp, r, rp, &sum_s, &sum_r, &sum_sq_s, &sum_sq_r, &sum_sxr); rtcd->ssimpf(s, sp, r, rp, &sum_s, &sum_r, &sum_sq_s, &sum_sq_r, &sum_sxr);
ssim_n1 = (2*sum_s*sum_r+ c1); ssim_n1 = (2*sum_s*sum_r+ c1);
ssim_n2 =((long long) 2*256*sum_sxr-(long long) 2*sum_s*sum_r+c2); ssim_n2 =((int64_t) 2*256*sum_sxr-(int64_t) 2*sum_s*sum_r+c2);
ssim_d1 =((long long)sum_s*sum_s +(long long)sum_r*sum_r+c1); ssim_d1 =((int64_t)sum_s*sum_s +(int64_t)sum_r*sum_r+c1);
ssim_d2 = (256 * (long long) sum_sq_s-(long long) sum_s*sum_s + ssim_d2 = (256 * (int64_t) sum_sq_s-(int64_t) sum_s*sum_s +
(long long) 256*sum_sq_r-(long long) sum_r*sum_r +c2) ; (int64_t) 256*sum_sq_r-(int64_t) sum_r*sum_r +c2) ;
ssim_t1 = 256 - 256 * ssim_n1 / ssim_d1; ssim_t1 = 256 - 256 * ssim_n1 / ssim_d1;
ssim_t2 = 256 - 256 * ssim_n2 / ssim_d2; ssim_t2 = 256 - 256 * ssim_n2 / ssim_d2;

View File

@ -723,7 +723,7 @@ static vpx_codec_err_t vp8e_encode(vpx_codec_alg_priv_t *ctx,
{ {
unsigned int lib_flags; unsigned int lib_flags;
YV12_BUFFER_CONFIG sd; YV12_BUFFER_CONFIG sd;
INT64 dst_time_stamp, dst_end_time_stamp; int64_t dst_time_stamp, dst_end_time_stamp;
unsigned long size, cx_data_sz; unsigned long size, cx_data_sz;
unsigned char *cx_data; unsigned char *cx_data;

View File

@ -427,7 +427,7 @@ static vpx_codec_err_t vp8_decode(vpx_codec_alg_priv_t *ctx,
if (!res && ctx->pbi) if (!res && ctx->pbi)
{ {
YV12_BUFFER_CONFIG sd; YV12_BUFFER_CONFIG sd;
INT64 time_stamp = 0, time_end_stamp = 0; int64_t time_stamp = 0, time_end_stamp = 0;
vp8_ppflags_t flags = {0}; vp8_ppflags_t flags = {0};
if (ctx->base.init_flags & VPX_CODEC_USE_POSTPROC) if (ctx->base.init_flags & VPX_CODEC_USE_POSTPROC)

View File

@ -556,7 +556,7 @@ Ebml_StartSubElement(EbmlGlobal *glob, EbmlLoc *ebmlLoc,
{ {
//todo this is always taking 8 bytes, this may need later optimization //todo this is always taking 8 bytes, this may need later optimization
//this is a key that says lenght unknown //this is a key that says lenght unknown
unsigned long long unknownLen = LITERALU64(0x01FFFFFFFFFFFFFF); uint64_t unknownLen = LITERALU64(0x01FFFFFFFFFFFFFF);
Ebml_WriteID(glob, class_id); Ebml_WriteID(glob, class_id);
*ebmlLoc = ftello(glob->stream); *ebmlLoc = ftello(glob->stream);