summaryrefslogtreecommitdiff
path: root/vp8
diff options
context:
space:
mode:
authorJames Zern <jzern@google.com>2013-07-12 17:12:46 -0700
committerJames Zern <jzern@google.com>2013-07-16 14:12:47 -0700
commit9581eb6e8a15438a27bba10ba6f8de024296f1f7 (patch)
tree6d259e66bd6dc128c5d3736329e45636a4ef88a6 /vp8
parentc0562d08f669683dc0d04a95e7d916195c39377a (diff)
downloadlibvpx-9581eb6e8a15438a27bba10ba6f8de024296f1f7.tar
libvpx-9581eb6e8a15438a27bba10ba6f8de024296f1f7.tar.gz
libvpx-9581eb6e8a15438a27bba10ba6f8de024296f1f7.tar.bz2
libvpx-9581eb6e8a15438a27bba10ba6f8de024296f1f7.zip
use consistent framerate naming
s/frame_rate/framerate/g Change-Id: I6fc3e088e419c5f46e3a9390dd8a2cad2677a2fc
Diffstat (limited to 'vp8')
-rw-r--r--vp8/common/postproc.c2
-rw-r--r--vp8/encoder/firstpass.c14
-rw-r--r--vp8/encoder/onyx_if.c80
-rw-r--r--vp8/encoder/onyx_int.h8
-rw-r--r--vp8/encoder/ratectrl.c8
-rw-r--r--vp8/encoder/rdopt.c2
6 files changed, 57 insertions, 57 deletions
diff --git a/vp8/common/postproc.c b/vp8/common/postproc.c
index 0266f4c09..dd998f16e 100644
--- a/vp8/common/postproc.c
+++ b/vp8/common/postproc.c
@@ -923,7 +923,7 @@ int vp8_post_proc_frame(VP8_COMMON *oci, YV12_BUFFER_CONFIG *dest, vp8_ppflags_t
if (flags & VP8D_DEBUG_TXT_RATE_INFO)
{
char message[512];
- sprintf(message, "Bitrate: %10.2f frame_rate: %10.2f ", oci->bitrate, oci->framerate);
+ sprintf(message, "Bitrate: %10.2f framerate: %10.2f ", oci->bitrate, oci->framerate);
vp8_blit_text(message, oci->post_proc_buffer.y_buffer, oci->post_proc_buffer.y_stride);
}
diff --git a/vp8/encoder/firstpass.c b/vp8/encoder/firstpass.c
index 433726df6..4eac3b661 100644
--- a/vp8/encoder/firstpass.c
+++ b/vp8/encoder/firstpass.c
@@ -1325,7 +1325,7 @@ static int estimate_kf_group_q(VP8_COMP *cpi, double section_err, int section_ta
return Q;
}
-extern void vp8_new_frame_rate(VP8_COMP *cpi, double framerate);
+extern void vp8_new_framerate(VP8_COMP *cpi, double framerate);
void vp8_init_second_pass(VP8_COMP *cpi)
{
@@ -1349,9 +1349,9 @@ void vp8_init_second_pass(VP8_COMP *cpi)
* sum duration is not. Its calculated based on the actual durations of
* all frames from the first pass.
*/
- vp8_new_frame_rate(cpi, 10000000.0 * cpi->twopass.total_stats.count / cpi->twopass.total_stats.duration);
+ vp8_new_framerate(cpi, 10000000.0 * cpi->twopass.total_stats.count / cpi->twopass.total_stats.duration);
- cpi->output_frame_rate = cpi->frame_rate;
+ cpi->output_framerate = cpi->framerate;
cpi->twopass.bits_left = (int64_t)(cpi->twopass.total_stats.duration * cpi->oxcf.target_bandwidth / 10000000.0) ;
cpi->twopass.bits_left -= (int64_t)(cpi->twopass.total_stats.duration * two_pass_min_rate / 10000000.0);
@@ -2529,7 +2529,7 @@ void vp8_second_pass(VP8_COMP *cpi)
/* Set nominal per second bandwidth for this frame */
cpi->target_bandwidth = (int)
- (cpi->per_frame_bandwidth * cpi->output_frame_rate);
+ (cpi->per_frame_bandwidth * cpi->output_framerate);
if (cpi->target_bandwidth < 0)
cpi->target_bandwidth = 0;
@@ -3185,7 +3185,7 @@ static void find_next_key_frame(VP8_COMP *cpi, FIRSTPASS_STATS *this_frame)
/* Convert to a per second bitrate */
cpi->target_bandwidth = (int)(cpi->twopass.kf_bits *
- cpi->output_frame_rate);
+ cpi->output_framerate);
}
/* Note the total error score of the kf group minus the key frame itself */
@@ -3224,7 +3224,7 @@ static void find_next_key_frame(VP8_COMP *cpi, FIRSTPASS_STATS *this_frame)
cpi->common.vert_scale = NORMAL;
/* Calculate Average bits per frame. */
- av_bits_per_frame = cpi->oxcf.target_bandwidth / DOUBLE_DIVIDE_CHECK((double)cpi->frame_rate);
+ av_bits_per_frame = cpi->oxcf.target_bandwidth / DOUBLE_DIVIDE_CHECK((double)cpi->framerate);
/* CBR... Use the clip average as the target for deciding resample */
if (cpi->oxcf.end_usage == USAGE_STREAM_FROM_SERVER)
@@ -3299,7 +3299,7 @@ static void find_next_key_frame(VP8_COMP *cpi, FIRSTPASS_STATS *this_frame)
}
else
{
- int64_t clip_bits = (int64_t)(cpi->twopass.total_stats.count * cpi->oxcf.target_bandwidth / DOUBLE_DIVIDE_CHECK((double)cpi->frame_rate));
+ int64_t clip_bits = (int64_t)(cpi->twopass.total_stats.count * cpi->oxcf.target_bandwidth / DOUBLE_DIVIDE_CHECK((double)cpi->framerate));
int64_t over_spend = cpi->oxcf.starting_buffer_level - cpi->buffer_level;
/* If triggered last time the threshold for triggering again is
diff --git a/vp8/encoder/onyx_if.c b/vp8/encoder/onyx_if.c
index 11f16955c..c73060f8e 100644
--- a/vp8/encoder/onyx_if.c
+++ b/vp8/encoder/onyx_if.c
@@ -301,11 +301,11 @@ static int rescale(int val, int num, int denom)
static void init_temporal_layer_context(VP8_COMP *cpi,
VP8_CONFIG *oxcf,
const int layer,
- double prev_layer_frame_rate)
+ double prev_layer_framerate)
{
LAYER_CONTEXT *lc = &cpi->layer_context[layer];
- lc->frame_rate = cpi->output_frame_rate / cpi->oxcf.rate_decimator[layer];
+ lc->framerate = cpi->output_framerate / cpi->oxcf.rate_decimator[layer];
lc->target_bandwidth = cpi->oxcf.target_bitrate[layer] * 1000;
lc->starting_buffer_level_in_ms = oxcf->starting_buffer_level;
@@ -335,7 +335,7 @@ static void init_temporal_layer_context(VP8_COMP *cpi,
lc->avg_frame_size_for_layer =
(int)((cpi->oxcf.target_bitrate[layer] -
cpi->oxcf.target_bitrate[layer-1]) * 1000 /
- (lc->frame_rate - prev_layer_frame_rate));
+ (lc->framerate - prev_layer_framerate));
lc->active_worst_quality = cpi->oxcf.worst_allowed_q;
lc->active_best_quality = cpi->oxcf.best_allowed_q;
@@ -363,7 +363,7 @@ static void reset_temporal_layer_change(VP8_COMP *cpi,
const int prev_num_layers)
{
int i;
- double prev_layer_frame_rate = 0;
+ double prev_layer_framerate = 0;
const int curr_num_layers = cpi->oxcf.number_of_layers;
// If the previous state was 1 layer, get current layer context from cpi.
// We need this to set the layer context for the new layers below.
@@ -377,7 +377,7 @@ static void reset_temporal_layer_change(VP8_COMP *cpi,
LAYER_CONTEXT *lc = &cpi->layer_context[i];
if (i >= prev_num_layers)
{
- init_temporal_layer_context(cpi, oxcf, i, prev_layer_frame_rate);
+ init_temporal_layer_context(cpi, oxcf, i, prev_layer_framerate);
}
// The initial buffer levels are set based on their starting levels.
// We could set the buffer levels based on the previous state (normalized
@@ -403,8 +403,8 @@ static void reset_temporal_layer_change(VP8_COMP *cpi,
lc->bits_off_target = lc->buffer_level;
restore_layer_context(cpi, 0);
}
- prev_layer_frame_rate = cpi->output_frame_rate /
- cpi->oxcf.rate_decimator[i];
+ prev_layer_framerate = cpi->output_framerate /
+ cpi->oxcf.rate_decimator[i];
}
}
@@ -1282,21 +1282,21 @@ int vp8_reverse_trans(int x)
return 63;
}
-void vp8_new_frame_rate(VP8_COMP *cpi, double framerate)
+void vp8_new_framerate(VP8_COMP *cpi, double framerate)
{
if(framerate < .1)
framerate = 30;
- cpi->frame_rate = framerate;
- cpi->output_frame_rate = framerate;
+ cpi->framerate = framerate;
+ cpi->output_framerate = framerate;
cpi->per_frame_bandwidth = (int)(cpi->oxcf.target_bandwidth /
- cpi->output_frame_rate);
+ cpi->output_framerate);
cpi->av_per_frame_bandwidth = cpi->per_frame_bandwidth;
cpi->min_frame_bandwidth = (int)(cpi->av_per_frame_bandwidth *
cpi->oxcf.two_pass_vbrmin_section / 100);
/* Set Maximum gf/arf interval */
- cpi->max_gf_interval = ((int)(cpi->output_frame_rate / 2.0) + 2);
+ cpi->max_gf_interval = ((int)(cpi->output_framerate / 2.0) + 2);
if(cpi->max_gf_interval < 12)
cpi->max_gf_interval = 12;
@@ -1337,13 +1337,13 @@ static void init_config(VP8_COMP *cpi, VP8_CONFIG *oxcf)
* seems like a reasonable framerate, then use that as a guess, otherwise
* use 30.
*/
- cpi->frame_rate = (double)(oxcf->timebase.den) /
- (double)(oxcf->timebase.num);
+ cpi->framerate = (double)(oxcf->timebase.den) /
+ (double)(oxcf->timebase.num);
- if (cpi->frame_rate > 180)
- cpi->frame_rate = 30;
+ if (cpi->framerate > 180)
+ cpi->framerate = 30;
- cpi->ref_frame_rate = cpi->frame_rate;
+ cpi->ref_framerate = cpi->framerate;
/* change includes all joint functionality */
vp8_change_config(cpi, oxcf);
@@ -1369,13 +1369,13 @@ static void init_config(VP8_COMP *cpi, VP8_CONFIG *oxcf)
if (cpi->oxcf.number_of_layers > 1)
{
unsigned int i;
- double prev_layer_frame_rate=0;
+ double prev_layer_framerate=0;
for (i=0; i<cpi->oxcf.number_of_layers; i++)
{
- init_temporal_layer_context(cpi, oxcf, i, prev_layer_frame_rate);
- prev_layer_frame_rate = cpi->output_frame_rate /
- cpi->oxcf.rate_decimator[i];
+ init_temporal_layer_context(cpi, oxcf, i, prev_layer_framerate);
+ prev_layer_framerate = cpi->output_framerate /
+ cpi->oxcf.rate_decimator[i];
}
}
@@ -1399,14 +1399,14 @@ static void update_layer_contexts (VP8_COMP *cpi)
if (oxcf->number_of_layers > 1)
{
unsigned int i;
- double prev_layer_frame_rate=0;
+ double prev_layer_framerate=0;
for (i=0; i<oxcf->number_of_layers; i++)
{
LAYER_CONTEXT *lc = &cpi->layer_context[i];
- lc->frame_rate =
- cpi->ref_frame_rate / oxcf->rate_decimator[i];
+ lc->framerate =
+ cpi->ref_framerate / oxcf->rate_decimator[i];
lc->target_bandwidth = oxcf->target_bitrate[i] * 1000;
lc->starting_buffer_level = rescale(
@@ -1432,9 +1432,9 @@ static void update_layer_contexts (VP8_COMP *cpi)
lc->avg_frame_size_for_layer =
(int)((oxcf->target_bitrate[i] -
oxcf->target_bitrate[i-1]) * 1000 /
- (lc->frame_rate - prev_layer_frame_rate));
+ (lc->framerate - prev_layer_framerate));
- prev_layer_frame_rate = lc->frame_rate;
+ prev_layer_framerate = lc->framerate;
}
}
}
@@ -1625,7 +1625,7 @@ void vp8_change_config(VP8_COMP *cpi, VP8_CONFIG *oxcf)
cpi->oxcf.target_bandwidth, 1000);
/* Set up frame rate and related parameters rate control values. */
- vp8_new_frame_rate(cpi, cpi->frame_rate);
+ vp8_new_framerate(cpi, cpi->framerate);
/* Set absolute upper and lower quality limits */
cpi->worst_quality = cpi->oxcf.worst_allowed_q;
@@ -1945,7 +1945,7 @@ struct VP8_COMP* vp8_create_compressor(VP8_CONFIG *oxcf)
for (i = 0; i < KEY_FRAME_CONTEXT; i++)
{
- cpi->prior_key_frame_distance[i] = (int)cpi->output_frame_rate;
+ cpi->prior_key_frame_distance[i] = (int)cpi->output_framerate;
}
#ifdef OUTPUT_YUV_SRC
@@ -2273,7 +2273,7 @@ void vp8_remove_compressor(VP8_COMP **ptr)
{
extern int count_mb_seg[4];
FILE *f = fopen("modes.stt", "a");
- double dr = (double)cpi->frame_rate * (double)bytes * (double)8 / (double)count / (double)1000 ;
+ double dr = (double)cpi->framerate * (double)bytes * (double)8 / (double)count / (double)1000 ;
fprintf(f, "intra_mode in Intra Frames:\n");
fprintf(f, "Y: %8d, %8d, %8d, %8d, %8d\n", y_modes[0], y_modes[1], y_modes[2], y_modes[3], y_modes[4]);
fprintf(f, "UV:%8d, %8d, %8d, %8d\n", uv_modes[0], uv_modes[1], uv_modes[2], uv_modes[3]);
@@ -3368,12 +3368,12 @@ static void encode_frame_to_data_rate
cpi->per_frame_bandwidth = cpi->twopass.gf_bits;
/* per second target bitrate */
cpi->target_bandwidth = (int)(cpi->twopass.gf_bits *
- cpi->output_frame_rate);
+ cpi->output_framerate);
}
}
else
#endif
- cpi->per_frame_bandwidth = (int)(cpi->target_bandwidth / cpi->output_frame_rate);
+ cpi->per_frame_bandwidth = (int)(cpi->target_bandwidth / cpi->output_framerate);
/* Default turn off buffer to buffer copying */
cm->copy_buffer_to_gf = 0;
@@ -4557,7 +4557,7 @@ static void encode_frame_to_data_rate
{
LAYER_CONTEXT *lc = &cpi->layer_context[i];
int bits_off_for_this_layer =
- (int)(lc->target_bandwidth / lc->frame_rate -
+ (int)(lc->target_bandwidth / lc->framerate -
cpi->projected_frame_size);
lc->bits_off_target += bits_off_for_this_layer;
@@ -4805,7 +4805,7 @@ static void Pass2Encode(VP8_COMP *cpi, unsigned long *size, unsigned char *dest,
{
double two_pass_min_rate = (double)(cpi->oxcf.target_bandwidth
*cpi->oxcf.two_pass_vbrmin_section / 100);
- cpi->twopass.bits_left += (int64_t)(two_pass_min_rate / cpi->frame_rate);
+ cpi->twopass.bits_left += (int64_t)(two_pass_min_rate / cpi->framerate);
}
}
#endif
@@ -5039,7 +5039,7 @@ int vp8_get_compressed_data(VP8_COMP *cpi, unsigned int *frame_flags, unsigned l
if (this_duration)
{
if (step)
- cpi->ref_frame_rate = 10000000.0 / this_duration;
+ cpi->ref_framerate = 10000000.0 / this_duration;
else
{
double avg_duration, interval;
@@ -5053,11 +5053,11 @@ int vp8_get_compressed_data(VP8_COMP *cpi, unsigned int *frame_flags, unsigned l
if(interval > 10000000.0)
interval = 10000000;
- avg_duration = 10000000.0 / cpi->ref_frame_rate;
+ avg_duration = 10000000.0 / cpi->ref_framerate;
avg_duration *= (interval - avg_duration + this_duration);
avg_duration /= interval;
- cpi->ref_frame_rate = 10000000.0 / avg_duration;
+ cpi->ref_framerate = 10000000.0 / avg_duration;
}
if (cpi->oxcf.number_of_layers > 1)
@@ -5068,12 +5068,12 @@ int vp8_get_compressed_data(VP8_COMP *cpi, unsigned int *frame_flags, unsigned l
for (i=0; i<cpi->oxcf.number_of_layers; i++)
{
LAYER_CONTEXT *lc = &cpi->layer_context[i];
- lc->frame_rate = cpi->ref_frame_rate /
- cpi->oxcf.rate_decimator[i];
+ lc->framerate = cpi->ref_framerate /
+ cpi->oxcf.rate_decimator[i];
}
}
else
- vp8_new_frame_rate(cpi, cpi->ref_frame_rate);
+ vp8_new_framerate(cpi, cpi->ref_framerate);
}
cpi->last_time_stamp_seen = cpi->source->ts_start;
@@ -5090,7 +5090,7 @@ int vp8_get_compressed_data(VP8_COMP *cpi, unsigned int *frame_flags, unsigned l
layer = cpi->oxcf.layer_id[
cpi->temporal_pattern_counter % cpi->oxcf.periodicity];
restore_layer_context (cpi, layer);
- vp8_new_frame_rate (cpi, cpi->layer_context[layer].frame_rate);
+ vp8_new_framerate(cpi, cpi->layer_context[layer].framerate);
}
if (cpi->compressor_speed == 2)
diff --git a/vp8/encoder/onyx_int.h b/vp8/encoder/onyx_int.h
index 5120fcce9..f49cfe39c 100644
--- a/vp8/encoder/onyx_int.h
+++ b/vp8/encoder/onyx_int.h
@@ -232,7 +232,7 @@ enum
typedef struct
{
/* Layer configuration */
- double frame_rate;
+ double framerate;
int target_bandwidth;
/* Layer specific coding parameters */
@@ -401,7 +401,7 @@ typedef struct VP8_COMP
/* Minimum allocation that should be used for any frame */
int min_frame_bandwidth;
int inter_frame_target;
- double output_frame_rate;
+ double output_framerate;
int64_t last_time_stamp_seen;
int64_t last_end_time_stamp_seen;
int64_t first_time_stamp_ever;
@@ -415,8 +415,8 @@ typedef struct VP8_COMP
int buffered_mode;
- double frame_rate;
- double ref_frame_rate;
+ double framerate;
+ double ref_framerate;
int64_t buffer_level;
int64_t bits_off_target;
diff --git a/vp8/encoder/ratectrl.c b/vp8/encoder/ratectrl.c
index 8e3c01d93..fd71b9aa1 100644
--- a/vp8/encoder/ratectrl.c
+++ b/vp8/encoder/ratectrl.c
@@ -388,7 +388,7 @@ static void calc_iframe_target_size(VP8_COMP *cpi)
int initial_boost = 32; /* |3.0 * per_frame_bandwidth| */
/* Boost depends somewhat on frame rate: only used for 1 layer case. */
if (cpi->oxcf.number_of_layers == 1) {
- kf_boost = MAX(initial_boost, (int)(2 * cpi->output_frame_rate - 16));
+ kf_boost = MAX(initial_boost, (int)(2 * cpi->output_framerate - 16));
}
else {
/* Initial factor: set target size to: |3.0 * per_frame_bandwidth|. */
@@ -399,9 +399,9 @@ static void calc_iframe_target_size(VP8_COMP *cpi)
kf_boost = kf_boost * kf_boost_qadjustment[Q] / 100;
/* frame separation adjustment ( down) */
- if (cpi->frames_since_key < cpi->output_frame_rate / 2)
+ if (cpi->frames_since_key < cpi->output_framerate / 2)
kf_boost = (int)(kf_boost
- * cpi->frames_since_key / (cpi->output_frame_rate / 2));
+ * cpi->frames_since_key / (cpi->output_framerate / 2));
/* Minimal target size is |2* per_frame_bandwidth|. */
if (kf_boost < 16)
@@ -1360,7 +1360,7 @@ static int estimate_keyframe_frequency(VP8_COMP *cpi)
* whichever is smaller.
*/
int key_freq = cpi->oxcf.key_freq>0 ? cpi->oxcf.key_freq : 1;
- av_key_frame_frequency = 1 + (int)cpi->output_frame_rate * 2;
+ av_key_frame_frequency = 1 + (int)cpi->output_framerate * 2;
if (cpi->oxcf.auto_key && av_key_frame_frequency > key_freq)
av_key_frame_frequency = key_freq;
diff --git a/vp8/encoder/rdopt.c b/vp8/encoder/rdopt.c
index 857961447..521e84fda 100644
--- a/vp8/encoder/rdopt.c
+++ b/vp8/encoder/rdopt.c
@@ -341,7 +341,7 @@ void vp8_initialize_rd_consts(VP8_COMP *cpi, MACROBLOCK *x, int Qvalue)
void vp8_auto_select_speed(VP8_COMP *cpi)
{
- int milliseconds_for_compress = (int)(1000000 / cpi->frame_rate);
+ int milliseconds_for_compress = (int)(1000000 / cpi->framerate);
milliseconds_for_compress = milliseconds_for_compress * (16 - cpi->oxcf.cpu_used) / 16;