Simplify *num_lap_buffers in encoder_init()
Simplify the assignment of *num_lap_buffers in encoder_init(). Since
priv->cfg.g_lag_in_frames is of the unsigned int type, it is
nonnegative. So the clamp(*num_lap_buffers, 0, X) can be replaced by
AOMMIN(*num_lap_buffers, X).
Change-Id: I40384bcf789ef6fedb8000b85298642745fb3a92
diff --git a/av1/av1_cx_iface.c b/av1/av1_cx_iface.c
index 89b1915..360fa27 100644
--- a/av1/av1_cx_iface.c
+++ b/av1/av1_cx_iface.c
@@ -2021,11 +2021,10 @@
if (priv->oxcf.rc_cfg.mode != AOM_CBR && priv->oxcf.pass == 0 &&
priv->oxcf.mode == GOOD) {
// Enable look ahead - enabled for AOM_Q, AOM_CQ, AOM_VBR
- *num_lap_buffers = priv->cfg.g_lag_in_frames;
*num_lap_buffers =
- clamp(*num_lap_buffers, 0,
- AOMMIN(MAX_LAP_BUFFERS, priv->oxcf.kf_cfg.key_freq_max +
- SCENE_CUT_KEY_TEST_INTERVAL));
+ AOMMIN((int)priv->cfg.g_lag_in_frames,
+ AOMMIN(MAX_LAP_BUFFERS, priv->oxcf.kf_cfg.key_freq_max +
+ SCENE_CUT_KEY_TEST_INTERVAL));
if ((int)priv->cfg.g_lag_in_frames - (*num_lap_buffers) >=
LAP_LAG_IN_FRAMES) {
lap_lag_in_frames = LAP_LAG_IN_FRAMES;