This patch introduces a new frame side data type AVFilmGrainParams for use with video codecs which support it. It can save a lot of memory used for duplicate processed reference frames and reduce copies when applying film grain during presentation.