Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
* [FFmpeg-devel] [PATCH] avcodec/mpegvideo_dec: Don't sync AVCodecContext fields manually
@ 2022-08-15 16:31 Andreas Rheinhardt
  2022-08-17 13:29 ` [FFmpeg-devel] [PATCH 2/2] avcodec/mpeg4videodec: Keep data_partitioning in sync between threads Andreas Rheinhardt
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Andreas Rheinhardt @ 2022-08-15 16:31 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Andreas Rheinhardt

They are already synced generically in update_context_from_thread()
in pthread_frame.c.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavcodec/mpegvideo_dec.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/libavcodec/mpegvideo_dec.c b/libavcodec/mpegvideo_dec.c
index 7566fe69f9..fd706070b2 100644
--- a/libavcodec/mpegvideo_dec.c
+++ b/libavcodec/mpegvideo_dec.c
@@ -92,11 +92,6 @@ int ff_mpeg_update_thread_context(AVCodecContext *dst,
             return ret;
     }
 
-    s->avctx->coded_height  = s1->avctx->coded_height;
-    s->avctx->coded_width   = s1->avctx->coded_width;
-    s->avctx->width         = s1->avctx->width;
-    s->avctx->height        = s1->avctx->height;
-
     s->quarter_sample       = s1->quarter_sample;
 
     s->coded_picture_number = s1->coded_picture_number;
-- 
2.34.1

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [FFmpeg-devel] [PATCH 2/2] avcodec/mpeg4videodec: Keep data_partitioning in sync between threads
  2022-08-15 16:31 [FFmpeg-devel] [PATCH] avcodec/mpegvideo_dec: Don't sync AVCodecContext fields manually Andreas Rheinhardt
@ 2022-08-17 13:29 ` Andreas Rheinhardt
  2022-08-19 20:16   ` Andreas Rheinhardt
  2022-08-17 15:49 ` [FFmpeg-devel] [PATCH 3/3] avcodec/mpegvideo: Allocate encoder-only tables in mpegvideo_enc.c Andreas Rheinhardt
  2022-08-18 14:57 ` [FFmpeg-devel] [PATCH] avcodec/mpegvideo_dec: Don't sync AVCodecContext fields manually Andreas Rheinhardt
  2 siblings, 1 reply; 5+ messages in thread
From: Andreas Rheinhardt @ 2022-08-17 13:29 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Andreas Rheinhardt

Fixes frame-threaded decoding of samples created by concatting
a video with data partitioning and a video not using it.
(Only the MPEG-4 decoder sets this, so it is synced in
mpeg4_update_thread_context() despite being a MpegEncContext-field.)

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavcodec/mpeg4videodec.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/libavcodec/mpeg4videodec.c b/libavcodec/mpeg4videodec.c
index bfebc3806c..d89adf8d63 100644
--- a/libavcodec/mpeg4videodec.c
+++ b/libavcodec/mpeg4videodec.c
@@ -3534,6 +3534,7 @@ static int mpeg4_update_thread_context(AVCodecContext *dst,
     s->vol_sprite_usage          = s1->vol_sprite_usage;
     s->sprite_brightness_change  = s1->sprite_brightness_change;
     s->num_sprite_warping_points = s1->num_sprite_warping_points;
+    s->m.data_partitioning       = s1->m.data_partitioning;
     s->rvlc                      = s1->rvlc;
     s->resync_marker             = s1->resync_marker;
     s->t_frame                   = s1->t_frame;
-- 
2.34.1

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [FFmpeg-devel] [PATCH 3/3] avcodec/mpegvideo: Allocate encoder-only tables in mpegvideo_enc.c
  2022-08-15 16:31 [FFmpeg-devel] [PATCH] avcodec/mpegvideo_dec: Don't sync AVCodecContext fields manually Andreas Rheinhardt
  2022-08-17 13:29 ` [FFmpeg-devel] [PATCH 2/2] avcodec/mpeg4videodec: Keep data_partitioning in sync between threads Andreas Rheinhardt
@ 2022-08-17 15:49 ` Andreas Rheinhardt
  2022-08-18 14:57 ` [FFmpeg-devel] [PATCH] avcodec/mpegvideo_dec: Don't sync AVCodecContext fields manually Andreas Rheinhardt
  2 siblings, 0 replies; 5+ messages in thread
From: Andreas Rheinhardt @ 2022-08-17 15:49 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Andreas Rheinhardt

This commit moves the encoder-only allocations of the tables
owned solely by the main encoder context to mpegvideo_enc.c.
This avoids checks in mpegvideo.c for whether we are dealing
with an encoder; it also improves modularity (if encoders are
disabled, this code will no longer be included in the binary).
And it also avoids having to reset these pointers at the beginning
of ff_mpv_common_init() (in case the dst context is uninitialized,
ff_mpeg_update_thread_context() simply copies the src context
into dst which therefore may contain pointers not owned by it,
but this does not happen for encoders at all).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavcodec/mpegvideo.c     | 118 +++----------------------------------
 libavcodec/mpegvideo_enc.c |  67 ++++++++++++++++++++-
 2 files changed, 72 insertions(+), 113 deletions(-)

diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c
index 1190f29954..86fe5e4022 100644
--- a/libavcodec/mpegvideo.c
+++ b/libavcodec/mpegvideo.c
@@ -566,61 +566,13 @@ int ff_mpv_init_context_frame(MpegEncContext *s)
 
     s->mb_index2xy[s->mb_height * s->mb_width] = (s->mb_height - 1) * s->mb_stride + s->mb_width; // FIXME really needed?
 
-    if (s->encoding) {
-        /* Allocate MV tables */
-        if (!FF_ALLOCZ_TYPED_ARRAY(s->p_mv_table_base,            mv_table_size) ||
-            !FF_ALLOCZ_TYPED_ARRAY(s->b_forw_mv_table_base,       mv_table_size) ||
-            !FF_ALLOCZ_TYPED_ARRAY(s->b_back_mv_table_base,       mv_table_size) ||
-            !FF_ALLOCZ_TYPED_ARRAY(s->b_bidir_forw_mv_table_base, mv_table_size) ||
-            !FF_ALLOCZ_TYPED_ARRAY(s->b_bidir_back_mv_table_base, mv_table_size) ||
-            !FF_ALLOCZ_TYPED_ARRAY(s->b_direct_mv_table_base,     mv_table_size))
-            return AVERROR(ENOMEM);
-        s->p_mv_table            = s->p_mv_table_base + s->mb_stride + 1;
-        s->b_forw_mv_table       = s->b_forw_mv_table_base + s->mb_stride + 1;
-        s->b_back_mv_table       = s->b_back_mv_table_base + s->mb_stride + 1;
-        s->b_bidir_forw_mv_table = s->b_bidir_forw_mv_table_base + s->mb_stride + 1;
-        s->b_bidir_back_mv_table = s->b_bidir_back_mv_table_base + s->mb_stride + 1;
-        s->b_direct_mv_table     = s->b_direct_mv_table_base + s->mb_stride + 1;
-
-        /* Allocate MB type table */
-        if (!FF_ALLOCZ_TYPED_ARRAY(s->mb_type,      mb_array_size) ||
-            !FF_ALLOCZ_TYPED_ARRAY(s->lambda_table, mb_array_size) ||
-            !FF_ALLOC_TYPED_ARRAY (s->cplx_tab,     mb_array_size) ||
-            !FF_ALLOC_TYPED_ARRAY (s->bits_tab,     mb_array_size))
-            return AVERROR(ENOMEM);
-
-#define ALLOCZ_ARRAYS(p, mult, numb) ((p) = av_calloc(numb, mult * sizeof(*(p))))
-        if (s->codec_id == AV_CODEC_ID_MPEG4 ||
-            (s->avctx->flags & AV_CODEC_FLAG_INTERLACED_ME)) {
-            int16_t (*tmp1)[2];
-            uint8_t *tmp2;
-            if (!(tmp1 = ALLOCZ_ARRAYS(s->b_field_mv_table_base, 8, mv_table_size)) ||
-                !(tmp2 = ALLOCZ_ARRAYS(s->b_field_select_table[0][0], 2 * 4, mv_table_size)) ||
-                !ALLOCZ_ARRAYS(s->p_field_select_table[0], 2 * 2, mv_table_size))
-                return AVERROR(ENOMEM);
-
-            s->p_field_select_table[1] = s->p_field_select_table[0] + 2 * mv_table_size;
-            tmp1 += s->mb_stride + 1;
-
-            for (int i = 0; i < 2; i++) {
-                for (int j = 0; j < 2; j++) {
-                    for (int k = 0; k < 2; k++) {
-                        s->b_field_mv_table[i][j][k] = tmp1;
-                        tmp1 += mv_table_size;
-                    }
-                    s->b_field_select_table[i][j] = tmp2;
-                    tmp2 += 2 * mv_table_size;
-                }
-            }
-        }
-    }
-
     if (s->codec_id == AV_CODEC_ID_MPEG4 ||
         (s->avctx->flags & AV_CODEC_FLAG_INTERLACED_ME)) {
-        int16_t (*tmp)[2];
         /* interlaced direct mode decoding tables */
-        if (!(tmp = ALLOCZ_ARRAYS(s->p_field_mv_table_base, 4, mv_table_size)))
+        int16_t (*tmp)[2] = av_calloc(mv_table_size, 4 * sizeof(*tmp));
+        if (!tmp)
             return AVERROR(ENOMEM);
+        s->p_field_mv_table_base = tmp;
         tmp += s->mb_stride + 1;
         for (int i = 0; i < 2; i++) {
             for (int j = 0; j < 2; j++) {
@@ -663,8 +615,6 @@ int ff_mpv_init_context_frame(MpegEncContext *s)
 
 static void clear_context(MpegEncContext *s)
 {
-    int i, j, k;
-
     memset(&s->next_picture, 0, sizeof(s->next_picture));
     memset(&s->last_picture, 0, sizeof(s->last_picture));
     memset(&s->current_picture, 0, sizeof(s->current_picture));
@@ -693,31 +643,10 @@ static void clear_context(MpegEncContext *s)
     s->bitstream_buffer = NULL;
     s->allocated_bitstream_buffer_size = 0;
     s->picture          = NULL;
-    s->mb_type          = NULL;
-    s->p_mv_table_base  = NULL;
-    s->b_forw_mv_table_base = NULL;
-    s->b_back_mv_table_base = NULL;
-    s->b_bidir_forw_mv_table_base = NULL;
-    s->b_bidir_back_mv_table_base = NULL;
-    s->b_direct_mv_table_base = NULL;
-    s->p_mv_table            = NULL;
-    s->b_forw_mv_table       = NULL;
-    s->b_back_mv_table       = NULL;
-    s->b_bidir_forw_mv_table = NULL;
-    s->b_bidir_back_mv_table = NULL;
-    s->b_direct_mv_table     = NULL;
-    s->b_field_mv_table_base = NULL;
     s->p_field_mv_table_base = NULL;
-    for (i = 0; i < 2; i++) {
-        for (j = 0; j < 2; j++) {
-            for (k = 0; k < 2; k++) {
-                s->b_field_mv_table[i][j][k] = NULL;
-            }
-            s->b_field_select_table[i][j] = NULL;
+    for (int i = 0; i < 2; i++)
+        for (int j = 0; j < 2; j++)
             s->p_field_mv_table[i][j] = NULL;
-        }
-        s->p_field_select_table[i] = NULL;
-    }
 
     s->dc_val_base = NULL;
     s->coded_block_base = NULL;
@@ -730,10 +659,6 @@ static void clear_context(MpegEncContext *s)
     s->er.error_status_table = NULL;
     s->er.er_temp_buffer = NULL;
     s->mb_index2xy = NULL;
-    s->lambda_table = NULL;
-
-    s->cplx_tab = NULL;
-    s->bits_tab = NULL;
 }
 
 /**
@@ -824,37 +749,12 @@ av_cold int ff_mpv_common_init(MpegEncContext *s)
 
 void ff_mpv_free_context_frame(MpegEncContext *s)
 {
-    int i, j, k;
-
     free_duplicate_contexts(s);
 
-    av_freep(&s->mb_type);
-    av_freep(&s->p_mv_table_base);
-    av_freep(&s->b_forw_mv_table_base);
-    av_freep(&s->b_back_mv_table_base);
-    av_freep(&s->b_bidir_forw_mv_table_base);
-    av_freep(&s->b_bidir_back_mv_table_base);
-    av_freep(&s->b_direct_mv_table_base);
-    s->p_mv_table            = NULL;
-    s->b_forw_mv_table       = NULL;
-    s->b_back_mv_table       = NULL;
-    s->b_bidir_forw_mv_table = NULL;
-    s->b_bidir_back_mv_table = NULL;
-    s->b_direct_mv_table     = NULL;
-    av_freep(&s->b_field_mv_table_base);
-    av_freep(&s->b_field_select_table[0][0]);
     av_freep(&s->p_field_mv_table_base);
-    av_freep(&s->p_field_select_table[0]);
-    for (i = 0; i < 2; i++) {
-        for (j = 0; j < 2; j++) {
-            for (k = 0; k < 2; k++) {
-                s->b_field_mv_table[i][j][k] = NULL;
-            }
-            s->b_field_select_table[i][j] = NULL;
+    for (int i = 0; i < 2; i++)
+        for (int j = 0; j < 2; j++)
             s->p_field_mv_table[i][j] = NULL;
-        }
-        s->p_field_select_table[i] = NULL;
-    }
 
     av_freep(&s->dc_val_base);
     av_freep(&s->coded_block_base);
@@ -867,10 +767,6 @@ void ff_mpv_free_context_frame(MpegEncContext *s)
     av_freep(&s->er.error_status_table);
     av_freep(&s->er.er_temp_buffer);
     av_freep(&s->mb_index2xy);
-    av_freep(&s->lambda_table);
-
-    av_freep(&s->cplx_tab);
-    av_freep(&s->bits_tab);
 
     s->linesize = s->uvlinesize = 0;
 }
diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c
index 63fa0663d3..0b398c56ab 100644
--- a/libavcodec/mpegvideo_enc.c
+++ b/libavcodec/mpegvideo_enc.c
@@ -313,7 +313,7 @@ av_cold int ff_mpv_encode_init(AVCodecContext *avctx)
     MpegEncContext *s = avctx->priv_data;
     AVCPBProperties *cpb_props;
     int i, ret;
-    int mb_array_size;
+    int mb_array_size, mv_table_size;
 
     mpv_encode_defaults(s);
 
@@ -824,12 +824,59 @@ av_cold int ff_mpv_encode_init(AVCodecContext *avctx)
         !FF_ALLOCZ_TYPED_ARRAY(s->reordered_input_picture, MAX_PICTURE_COUNT))
         return AVERROR(ENOMEM);
 
+    /* Allocate MV tables; the MV and MB tables will be copied
+     * to slice contexts by ff_update_duplicate_context().  */
+    mv_table_size = (s->mb_height + 2) * s->mb_stride + 1;
+    if (!FF_ALLOCZ_TYPED_ARRAY(s->p_mv_table_base,            mv_table_size) ||
+        !FF_ALLOCZ_TYPED_ARRAY(s->b_forw_mv_table_base,       mv_table_size) ||
+        !FF_ALLOCZ_TYPED_ARRAY(s->b_back_mv_table_base,       mv_table_size) ||
+        !FF_ALLOCZ_TYPED_ARRAY(s->b_bidir_forw_mv_table_base, mv_table_size) ||
+        !FF_ALLOCZ_TYPED_ARRAY(s->b_bidir_back_mv_table_base, mv_table_size) ||
+        !FF_ALLOCZ_TYPED_ARRAY(s->b_direct_mv_table_base,     mv_table_size))
+        return AVERROR(ENOMEM);
+    s->p_mv_table            = s->p_mv_table_base + s->mb_stride + 1;
+    s->b_forw_mv_table       = s->b_forw_mv_table_base + s->mb_stride + 1;
+    s->b_back_mv_table       = s->b_back_mv_table_base + s->mb_stride + 1;
+    s->b_bidir_forw_mv_table = s->b_bidir_forw_mv_table_base + s->mb_stride + 1;
+    s->b_bidir_back_mv_table = s->b_bidir_back_mv_table_base + s->mb_stride + 1;
+    s->b_direct_mv_table     = s->b_direct_mv_table_base + s->mb_stride + 1;
+
+    /* Allocate MB type table */
     mb_array_size = s->mb_stride * s->mb_height;
-    if (!FF_ALLOCZ_TYPED_ARRAY(s->mc_mb_var, mb_array_size) ||
+    if (!FF_ALLOCZ_TYPED_ARRAY(s->mb_type,      mb_array_size) ||
+        !FF_ALLOCZ_TYPED_ARRAY(s->lambda_table, mb_array_size) ||
+        !FF_ALLOC_TYPED_ARRAY (s->cplx_tab,     mb_array_size) ||
+        !FF_ALLOC_TYPED_ARRAY (s->bits_tab,     mb_array_size) ||
+        !FF_ALLOCZ_TYPED_ARRAY(s->mc_mb_var,    mb_array_size) ||
         !FF_ALLOCZ_TYPED_ARRAY(s->mb_var, mb_array_size) ||
         !(s->mb_mean = av_mallocz(mb_array_size)))
         return AVERROR(ENOMEM);
 
+#define ALLOCZ_ARRAYS(p, mult, numb) ((p) = av_calloc(numb, mult * sizeof(*(p))))
+    if (s->codec_id == AV_CODEC_ID_MPEG4 ||
+        (s->avctx->flags & AV_CODEC_FLAG_INTERLACED_ME)) {
+        int16_t (*tmp1)[2];
+        uint8_t *tmp2;
+        if (!(tmp1 = ALLOCZ_ARRAYS(s->b_field_mv_table_base, 8, mv_table_size)) ||
+            !(tmp2 = ALLOCZ_ARRAYS(s->b_field_select_table[0][0], 2 * 4, mv_table_size)) ||
+            !ALLOCZ_ARRAYS(s->p_field_select_table[0], 2 * 2, mv_table_size))
+            return AVERROR(ENOMEM);
+
+        s->p_field_select_table[1] = s->p_field_select_table[0] + 2 * mv_table_size;
+        tmp1 += s->mb_stride + 1;
+
+        for (int i = 0; i < 2; i++) {
+            for (int j = 0; j < 2; j++) {
+                for (int k = 0; k < 2; k++) {
+                    s->b_field_mv_table[i][j][k] = tmp1;
+                    tmp1 += mv_table_size;
+                }
+                s->b_field_select_table[i][j] = tmp2;
+                tmp2 += 2 * mv_table_size;
+            }
+        }
+    }
+
     if (s->noise_reduction) {
         if (!FF_ALLOCZ_TYPED_ARRAY(s->dct_offset, 2))
             return AVERROR(ENOMEM);
@@ -945,6 +992,22 @@ av_cold int ff_mpv_encode_end(AVCodecContext *avctx)
 
     av_freep(&avctx->stats_out);
 
+    av_freep(&s->p_mv_table_base);
+    av_freep(&s->b_forw_mv_table_base);
+    av_freep(&s->b_back_mv_table_base);
+    av_freep(&s->b_bidir_forw_mv_table_base);
+    av_freep(&s->b_bidir_back_mv_table_base);
+    av_freep(&s->b_direct_mv_table_base);
+    av_freep(&s->b_field_mv_table_base);
+    av_freep(&s->b_field_select_table[0][0]);
+    av_freep(&s->p_field_select_table[0]);
+
+    av_freep(&s->mb_type);
+    av_freep(&s->lambda_table);
+
+    av_freep(&s->cplx_tab);
+    av_freep(&s->bits_tab);
+
     if(s->q_chroma_intra_matrix   != s->q_intra_matrix  ) av_freep(&s->q_chroma_intra_matrix);
     if(s->q_chroma_intra_matrix16 != s->q_intra_matrix16) av_freep(&s->q_chroma_intra_matrix16);
     s->q_chroma_intra_matrix=   NULL;
-- 
2.34.1

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [FFmpeg-devel] [PATCH] avcodec/mpegvideo_dec: Don't sync AVCodecContext fields manually
  2022-08-15 16:31 [FFmpeg-devel] [PATCH] avcodec/mpegvideo_dec: Don't sync AVCodecContext fields manually Andreas Rheinhardt
  2022-08-17 13:29 ` [FFmpeg-devel] [PATCH 2/2] avcodec/mpeg4videodec: Keep data_partitioning in sync between threads Andreas Rheinhardt
  2022-08-17 15:49 ` [FFmpeg-devel] [PATCH 3/3] avcodec/mpegvideo: Allocate encoder-only tables in mpegvideo_enc.c Andreas Rheinhardt
@ 2022-08-18 14:57 ` Andreas Rheinhardt
  2 siblings, 0 replies; 5+ messages in thread
From: Andreas Rheinhardt @ 2022-08-18 14:57 UTC (permalink / raw)
  To: ffmpeg-devel

Andreas Rheinhardt:
> They are already synced generically in update_context_from_thread()
> in pthread_frame.c.
> 
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
> ---
>  libavcodec/mpegvideo_dec.c | 5 -----
>  1 file changed, 5 deletions(-)
> 
> diff --git a/libavcodec/mpegvideo_dec.c b/libavcodec/mpegvideo_dec.c
> index 7566fe69f9..fd706070b2 100644
> --- a/libavcodec/mpegvideo_dec.c
> +++ b/libavcodec/mpegvideo_dec.c
> @@ -92,11 +92,6 @@ int ff_mpeg_update_thread_context(AVCodecContext *dst,
>              return ret;
>      }
>  
> -    s->avctx->coded_height  = s1->avctx->coded_height;
> -    s->avctx->coded_width   = s1->avctx->coded_width;
> -    s->avctx->width         = s1->avctx->width;
> -    s->avctx->height        = s1->avctx->height;
> -
>      s->quarter_sample       = s1->quarter_sample;
>  
>      s->coded_picture_number = s1->coded_picture_number;

Will apply this patch tonight unless there are objections.

- Andreas
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [FFmpeg-devel] [PATCH 2/2] avcodec/mpeg4videodec: Keep data_partitioning in sync between threads
  2022-08-17 13:29 ` [FFmpeg-devel] [PATCH 2/2] avcodec/mpeg4videodec: Keep data_partitioning in sync between threads Andreas Rheinhardt
@ 2022-08-19 20:16   ` Andreas Rheinhardt
  0 siblings, 0 replies; 5+ messages in thread
From: Andreas Rheinhardt @ 2022-08-19 20:16 UTC (permalink / raw)
  To: ffmpeg-devel

Andreas Rheinhardt:
> Fixes frame-threaded decoding of samples created by concatting
> a video with data partitioning and a video not using it.
> (Only the MPEG-4 decoder sets this, so it is synced in
> mpeg4_update_thread_context() despite being a MpegEncContext-field.)
> 
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
> ---
>  libavcodec/mpeg4videodec.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/libavcodec/mpeg4videodec.c b/libavcodec/mpeg4videodec.c
> index bfebc3806c..d89adf8d63 100644
> --- a/libavcodec/mpeg4videodec.c
> +++ b/libavcodec/mpeg4videodec.c
> @@ -3534,6 +3534,7 @@ static int mpeg4_update_thread_context(AVCodecContext *dst,
>      s->vol_sprite_usage          = s1->vol_sprite_usage;
>      s->sprite_brightness_change  = s1->sprite_brightness_change;
>      s->num_sprite_warping_points = s1->num_sprite_warping_points;
> +    s->m.data_partitioning       = s1->m.data_partitioning;
>      s->rvlc                      = s1->rvlc;
>      s->resync_marker             = s1->resync_marker;
>      s->t_frame                   = s1->t_frame;

Will apply the remaining two patches of this patchset tomorrow unless
there are exceptions.

- Andreas
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-08-19 20:16 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-15 16:31 [FFmpeg-devel] [PATCH] avcodec/mpegvideo_dec: Don't sync AVCodecContext fields manually Andreas Rheinhardt
2022-08-17 13:29 ` [FFmpeg-devel] [PATCH 2/2] avcodec/mpeg4videodec: Keep data_partitioning in sync between threads Andreas Rheinhardt
2022-08-19 20:16   ` Andreas Rheinhardt
2022-08-17 15:49 ` [FFmpeg-devel] [PATCH 3/3] avcodec/mpegvideo: Allocate encoder-only tables in mpegvideo_enc.c Andreas Rheinhardt
2022-08-18 14:57 ` [FFmpeg-devel] [PATCH] avcodec/mpegvideo_dec: Don't sync AVCodecContext fields manually Andreas Rheinhardt

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git