[FFmpeg-devel] hevcdec: properly export some side data with frame threading

Submitted by wm4 on June 29, 2017, 1:37 p.m.

Details

Message ID 20170629133716.13688-1-nfxjfg@googlemail.com
State New
Headers show

Commit Message

wm4 June 29, 2017, 1:37 p.m.
I noticed this with mastering display data. If frame threading is
enabled, this side data is exported only for some frames. It turns out
it's not properly propagated to the worker threads.

I didn't touch A53 captions, because that involves memory allocation and
freeing the data as side data is exported.
---
 libavcodec/hevcdec.c | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

wm4 June 30, 2017, 5:19 p.m.
On Thu, 29 Jun 2017 15:37:16 +0200
wm4 <nfxjfg@googlemail.com> wrote:

> I noticed this with mastering display data. If frame threading is
> enabled, this side data is exported only for some frames. It turns out
> it's not properly propagated to the worker threads.
> 
> I didn't touch A53 captions, because that involves memory allocation and
> freeing the data as side data is exported.
> ---
>  libavcodec/hevcdec.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/libavcodec/hevcdec.c b/libavcodec/hevcdec.c
> index 3b24fb9bec..cc8ac82164 100644
> --- a/libavcodec/hevcdec.c
> +++ b/libavcodec/hevcdec.c
> @@ -3355,6 +3355,12 @@ static int hevc_update_thread_context(AVCodecContext *dst,
>          s->max_ra = INT_MAX;
>      }
>  
> +    s->sei.frame_packing        = s0->sei.frame_packing;
> +    s->sei.display_orientation  = s0->sei.display_orientation;
> +    s->sei.mastering_display    = s0->sei.mastering_display;
> +    s->sei.content_light        = s0->sei.content_light;
> +    s->sei.alternative_transfer = s0->sei.alternative_transfer;
> +
>      return 0;
>  }
>  

Pushed.

Patch hide | download patch | download mbox

diff --git a/libavcodec/hevcdec.c b/libavcodec/hevcdec.c
index 3b24fb9bec..cc8ac82164 100644
--- a/libavcodec/hevcdec.c
+++ b/libavcodec/hevcdec.c
@@ -3355,6 +3355,12 @@  static int hevc_update_thread_context(AVCodecContext *dst,
         s->max_ra = INT_MAX;
     }
 
+    s->sei.frame_packing        = s0->sei.frame_packing;
+    s->sei.display_orientation  = s0->sei.display_orientation;
+    s->sei.mastering_display    = s0->sei.mastering_display;
+    s->sei.content_light        = s0->sei.content_light;
+    s->sei.alternative_transfer = s0->sei.alternative_transfer;
+
     return 0;
 }