AOMediaCodec / afgs1-spec

Film grain synthesis algorithm and parameters
https://aomediacodec.github.io/afgs1-spec/
Other
8 stars 7 forks source link

On tempGrainSeed #29

Closed podborski closed 11 months ago

podborski commented 11 months ago

When update_grain=0 you still use the same parameters but you can signal a different grain_seed value so that your grain looks different from the previous frame. Correct? I don’t understand why you need the tempGrainSeed. The grain_seed was already signaled before this:

    ...
    grain_seed
    ...
    if ( !update_grain ) {
        tempGrainSeed = grain_seed   
        load_grain_params( film_grain_param_set_idx )    
        grain_seed = tempGrainSeed
        return
    }

Was the idea to do the tempGrainSeed = grain_seed before the grain_seed is signaled and it got misplaced?

podborski commented 11 months ago

Explantation during one of the meetings was that the function load_grain_params is overwriting the grain_seed. Updated text explains it better now:

tempGrainSeed is a temporary variable that is used to avoid losing the value of grain_seed when load_grain_params is called. When update_grain is equal to 0, a previous set of parameters should be used for everything except grain_seed.