ref: 970e9457950d915016456f474037a52685a9d73b
parent: b53113c3ca0cc0ca6590dca243084c0c3c09f4b8
parent: 0a74236bd486517ab91ee28b76e0f80428eb7904
author: Dmitry Kovalev <dkovalev@google.com>
date: Tue Jan 14 09:46:07 EST 2014
Merge changes I8eda5762,Ia2ffca07 * changes: Removing unused switchable_interp_count[] field from VP9_COMP. Using clamp() function instead of the same raw code.
--- a/vp9/encoder/vp9_firstpass.c
+++ b/vp9/encoder/vp9_firstpass.c
@@ -1933,13 +1933,10 @@
// Allocate bits to a normal frame that is neither a gf an arf or a key frame.
static void assign_std_frame_bits(VP9_COMP *cpi, FIRSTPASS_STATS *this_frame) {
int target_frame_size;
-
double modified_err;
double err_fraction;
+ const int max_bits = frame_max_bits(cpi); // Max for a single frame.
- // Max for a single frame.
- int max_bits = frame_max_bits(cpi);
-
// Calculate modified prediction error used in bit allocation.
modified_err = calculate_modified_err(cpi, this_frame);
@@ -1954,15 +1951,8 @@
// Clip target size to 0 - max_bits (or cpi->twopass.gf_group_bits) at
// the top end.
- if (target_frame_size < 0) {
- target_frame_size = 0;
- } else {
- if (target_frame_size > max_bits)
- target_frame_size = max_bits;
-
- if (target_frame_size > cpi->twopass.gf_group_bits)
- target_frame_size = (int)cpi->twopass.gf_group_bits;
- }
+ target_frame_size = clamp(target_frame_size, 0,
+ MIN(max_bits, (int)cpi->twopass.gf_group_bits));
// Adjust error and bits remaining.
cpi->twopass.gf_group_error_left -= (int64_t)modified_err;
--- a/vp9/encoder/vp9_onyx_int.h
+++ b/vp9/encoder/vp9_onyx_int.h
@@ -739,9 +739,6 @@
int dummy_packing; /* flag to indicate if packing is dummy */
- unsigned int switchable_interp_count[SWITCHABLE_FILTER_CONTEXTS]
- [SWITCHABLE_FILTERS];
-
unsigned int tx_stepdown_count[TX_SIZES];
int initial_width;
--
⑨