diff mbox series

[FFmpeg-devel,26/39] lavc/ffv1dec: inline copy_fields() into update_thread_context()

Message ID 20240716171155.31838-26-anton@khirnov.net
State New
Headers show
Series [FFmpeg-devel,01/39] tests/fate/vcodec: add vsynth tests for FFV1 version 2 | expand

Checks

Context Check Description
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Anton Khirnov July 16, 2024, 5:11 p.m. UTC
It is now only called from a single place, so there is no point in it
being a separate function.
---
 libavcodec/ffv1dec.c | 38 ++++++++++++++++----------------------
 1 file changed, 16 insertions(+), 22 deletions(-)

Comments

Michael Niedermayer July 24, 2024, 7:48 p.m. UTC | #1
On Tue, Jul 16, 2024 at 07:11:41PM +0200, Anton Khirnov wrote:
> It is now only called from a single place, so there is no point in it
> being a separate function.
> ---
>  libavcodec/ffv1dec.c | 38 ++++++++++++++++----------------------
>  1 file changed, 16 insertions(+), 22 deletions(-)

ok

thx

[...]
diff mbox series

Patch

diff --git a/libavcodec/ffv1dec.c b/libavcodec/ffv1dec.c
index 8bb9b83daa..be4a1a2bf3 100644
--- a/libavcodec/ffv1dec.c
+++ b/libavcodec/ffv1dec.c
@@ -1021,27 +1021,6 @@  static int decode_frame(AVCodecContext *avctx, AVFrame *rframe,
 }
 
 #if HAVE_THREADS
-static void copy_fields(FFV1Context *fsdst, const FFV1Context *fssrc,
-                        const FFV1Context *fsrc)
-{
-    fsdst->version             = fsrc->version;
-    fsdst->micro_version       = fsrc->micro_version;
-    fsdst->chroma_planes       = fsrc->chroma_planes;
-    fsdst->chroma_h_shift      = fsrc->chroma_h_shift;
-    fsdst->chroma_v_shift      = fsrc->chroma_v_shift;
-    fsdst->transparency        = fsrc->transparency;
-    fsdst->plane_count         = fsrc->plane_count;
-    fsdst->ac                  = fsrc->ac;
-    fsdst->colorspace          = fsrc->colorspace;
-
-    fsdst->ec                  = fsrc->ec;
-    fsdst->intra               = fsrc->intra;
-    fsdst->key_frame_ok        = fsrc->key_frame_ok;
-
-    fsdst->packed_at_lsb       = fsrc->packed_at_lsb;
-    fsdst->slice_count         = fsrc->slice_count;
-}
-
 static int update_thread_context(AVCodecContext *dst, const AVCodecContext *src)
 {
     FFV1Context *fsrc = src->priv_data;
@@ -1050,7 +1029,22 @@  static int update_thread_context(AVCodecContext *dst, const AVCodecContext *src)
     if (dst == src)
         return 0;
 
-    copy_fields(fdst, fsrc, fsrc);
+    fdst->version             = fsrc->version;
+    fdst->micro_version       = fsrc->micro_version;
+    fdst->chroma_planes       = fsrc->chroma_planes;
+    fdst->chroma_h_shift      = fsrc->chroma_h_shift;
+    fdst->chroma_v_shift      = fsrc->chroma_v_shift;
+    fdst->transparency        = fsrc->transparency;
+    fdst->plane_count         = fsrc->plane_count;
+    fdst->ac                  = fsrc->ac;
+    fdst->colorspace          = fsrc->colorspace;
+
+    fdst->ec                  = fsrc->ec;
+    fdst->intra               = fsrc->intra;
+    fdst->key_frame_ok        = fsrc->key_frame_ok;
+
+    fdst->packed_at_lsb       = fsrc->packed_at_lsb;
+    fdst->slice_count         = fsrc->slice_count;
     fdst->use32bit     = fsrc->use32bit;
     memcpy(fdst->state_transition, fsrc->state_transition,
            sizeof(fdst->state_transition));