diff mbox series

[FFmpeg-devel,3/4] avcodec/libdav1d: signal the presence of Film Grain in the decoder context

Message ID 20210816155102.9731-3-jamrial@gmail.com
State New
Headers show
Series [FFmpeg-devel,1/4] avcodec/pthread_frame: also keep AVCodecContext.properties in sync between threads
Related show

Checks

Context Check Description
andriy/x86_make success Make finished
andriy/x86_make_fate fail Make fate failed
andriy/PPC64_make success Make finished
andriy/PPC64_make_fate warning Make fate failed

Commit Message

James Almer Aug. 16, 2021, 3:51 p.m. UTC
Signed-off-by: James Almer <jamrial@gmail.com>
---
 libavcodec/libdav1d.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Andreas Rheinhardt Aug. 16, 2021, 4:17 p.m. UTC | #1
James Almer:
> Signed-off-by: James Almer <jamrial@gmail.com>
> ---
>  libavcodec/libdav1d.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/libavcodec/libdav1d.c b/libavcodec/libdav1d.c
> index 8a816da34d..2ee75310d7 100644
> --- a/libavcodec/libdav1d.c
> +++ b/libavcodec/libdav1d.c
> @@ -157,6 +157,9 @@ static void libdav1d_init_params(AVCodecContext *c, const Dav1dSequenceHeader *s
>          if (seq->equal_picture_interval)
>              c->ticks_per_frame = seq->num_ticks_per_picture;
>      }
> +
> +   if (seq->film_grain_present)
> +       c->properties |= FF_CODEC_PROPERTY_FILM_GRAIN;
>  }
>  
>  static av_cold int libdav1d_parse_extradata(AVCodecContext *c)
> 
If the properties of the underlying streams change from having film
grain to not having film grain, you do not reset said field.

- Andreas
diff mbox series

Patch

diff --git a/libavcodec/libdav1d.c b/libavcodec/libdav1d.c
index 8a816da34d..2ee75310d7 100644
--- a/libavcodec/libdav1d.c
+++ b/libavcodec/libdav1d.c
@@ -157,6 +157,9 @@  static void libdav1d_init_params(AVCodecContext *c, const Dav1dSequenceHeader *s
         if (seq->equal_picture_interval)
             c->ticks_per_frame = seq->num_ticks_per_picture;
     }
+
+   if (seq->film_grain_present)
+       c->properties |= FF_CODEC_PROPERTY_FILM_GRAIN;
 }
 
 static av_cold int libdav1d_parse_extradata(AVCodecContext *c)