ref: c0f0245e8a905e1f78d0ca36cb79331f324cb091
parent: 91feec14529247b079421c83a8d15dca37e37773
parent: 49e0673659a5f92ab93a69a0be9af8f6db63a7a8
author: Aℓex Converse <[email protected]>
date: Thu Jul 30 15:37:28 EDT 2015
Merge "Clean up some casts."
--- a/vp9/encoder/vp9_ratectrl.c
+++ b/vp9/encoder/vp9_ratectrl.c
@@ -281,14 +281,14 @@
// Assume we do not need any constraint lower than 4K 20 fps
static const double factor_safe = 3840 * 2160 * 20.0;
const double factor = width * height * framerate;
- const double default_interval =
- MIN(MAX_GF_INTERVAL, MAX(MIN_GF_INTERVAL, (int)(framerate * 0.125)));
+ const int default_interval =
+ clamp((int)(framerate * 0.125), MIN_GF_INTERVAL, MAX_GF_INTERVAL);
if (factor <= factor_safe)
- return (int)default_interval;
+ return default_interval;
else
- return (int)MAX(default_interval,
- (int)(MIN_GF_INTERVAL * factor / factor_safe + 0.5));
+ return MAX(default_interval,
+ (int)(MIN_GF_INTERVAL * factor / factor_safe + 0.5));
// Note this logic makes:
// 4K24: 5
// 4K30: 6