Change AV1E_SET_MAX_CONSEC_FRAME_DROP_CBR to int Change the parameter type of AV1E_SET_MAX_CONSEC_FRAME_DROP_CBR from unsigned int to int because this value is stored in a struct member of the int type. Change the codec control to return AOM_CODEC_INVALID_PARAM if the value is negative. Document the parameter type in the comment. Note: A follow-up to https: //aomedia-review.googlesource.com/c/aom/+/182921. Change-Id: I99e6180358c1cdf72cf7a9ad32a138e784c8d461
diff --git a/aom/aomcx.h b/aom/aomcx.h index 8abc786..f061be3 100644 --- a/aom/aomcx.h +++ b/aom/aomcx.h
@@ -1527,9 +1527,9 @@ */ AV1E_SET_BITRATE_ONE_PASS_CBR = 163, - /*!\brief Codec control to set the maxium number of consecutive frame drops - * allowed for the frame_dropper in 1 pass CBR mode. Value of zero has no - * effect. + /*!\brief Codec control to set the maximum number of consecutive frame drops + * allowed for the frame dropper in 1 pass CBR mode, int parameter. Value of + * zero has no effect. */ AV1E_SET_MAX_CONSEC_FRAME_DROP_CBR = 164, @@ -2178,7 +2178,7 @@ AOM_CTRL_USE_TYPE(AV1E_SET_BITRATE_ONE_PASS_CBR, unsigned int) #define AOM_CTRL_AV1E_SET_BITRATE_ONE_PASS_CBR -AOM_CTRL_USE_TYPE(AV1E_SET_MAX_CONSEC_FRAME_DROP_CBR, unsigned int) +AOM_CTRL_USE_TYPE(AV1E_SET_MAX_CONSEC_FRAME_DROP_CBR, int) #define AOM_CTRL_AV1E_SET_MAX_CONSEC_FRAME_DROP_CBR /*!\endcond */
diff --git a/av1/av1_cx_iface.c b/av1/av1_cx_iface.c index 588b0a4..7256f48 100644 --- a/av1/av1_cx_iface.c +++ b/av1/av1_cx_iface.c
@@ -2589,7 +2589,9 @@ aom_codec_alg_priv_t *ctx, va_list args) { AV1_PRIMARY *const ppi = ctx->ppi; AV1_COMP *const cpi = ppi->cpi; - cpi->rc.max_consec_drop = CAST(AV1E_SET_MAX_CONSEC_FRAME_DROP_CBR, args); + const int max_consec_drop = CAST(AV1E_SET_MAX_CONSEC_FRAME_DROP_CBR, args); + if (max_consec_drop < 0) return AOM_CODEC_INVALID_PARAM; + cpi->rc.max_consec_drop = max_consec_drop; cpi->rc.drop_count_consec = 0; return AOM_CODEC_OK; }