1. A method, comprising: determining flat image areas in a predicted image, the predicted image being predicted from a first image mapped from a second image that has a higher dynamic range than the first image; generating, based at least in part on the flat image areas and the predicted image, a set of optimized operational parameter values for decontouring operations; performing, based at least in part on the set of optimized operational parameter values for decontouring operations, one or more smoothen operations on the predicted image to derive a smoothened image; applying, based at least in part on the set of optimized operational parameter values for decontouring operations, a residual mask to a residual image between the predicted image and the smoothened image to derive a masked residual image; encoding the set of optimized operational parameter values into a part of a multi-layer video signal that includes the first image.