@@ -127,6 +127,12 @@ int ff_aom_parse_film_grain_sets(AVFilmGrainAFGS1Params *s,
AVFilmGrainParams *fgp, *ref = NULL;
int ret, num_sets, n, i, uv, num_y_coeffs, update_grain, luma_only;
+ // Mark existing film grain parameters as ineligible for use in the current frame
+ for(n =0; n < 8; n++) {
+ if( s->sets[n].type == AV_FILM_GRAIN_PARAMS_AV1 )
+ s->sets[n].type = AV_FILM_GRAIN_PARAMS_AV1_INACTIVE;
+ }
+
ret = init_get_bits8(gb, payload, payload_size);
if (ret < 0)
return ret;
@@ -149,6 +155,7 @@ int ff_aom_parse_film_grain_sets(AVFilmGrainAFGS1Params *s,
fgp = &s->sets[set_idx];
aom = &fgp->codec.aom;
+ // Mark current film grain parameters as eligible for selection in the current frame
fgp->type = AV_FILM_GRAIN_PARAMS_AV1;
fgp->apply_grain = get_bits1(gb);
@@ -29,6 +29,11 @@ enum AVFilmGrainParamsType {
*/
AV_FILM_GRAIN_PARAMS_AV1,
+ /**
+ *
+ */
+ AV_FILM_GRAIN_PARAMS_AV1_INACTIVE,
+
/**
* The union is valid when interpreted as AVFilmGrainH274Params (codec.h274)
Details: Limit selection of the film grain parameters to (only) those received in the current message. Signed-off-by: Andrew Segall <asegall@amazon.com <mailto:asegall@amazon.com>> --- libavcodec/aom_film_grain.c | 7 +++++++ libavutil/film_grain_params.h | 5 +++++ 2 files changed, 12 insertions(+) */