This is an automated email from the git hooks/post-receive script.

Git pushed a commit to branch master
in repository ffmpeg.

commit 87dd0b579bd6e37947de65dd5ece7035b0374605
Author:     Mark Thompson <[email protected]>
AuthorDate: Sun Oct 25 09:45:01 2026 +0000
Commit:     Mark Thompson <[email protected]>
CommitDate: Sun Nov 1 14:33:45 2026 +0000

    lavc/apv: Use a local copy of the GetBitContext
    
    Having it on the stack lets the compiler see within this translation
    unit that there are no side effects, improving optimisation.
---
 libavcodec/apv_entropy.c | 20 +++++++++++++++++---
 1 file changed, 17 insertions(+), 3 deletions(-)

diff --git a/libavcodec/apv_entropy.c b/libavcodec/apv_entropy.c
index 507318cafa..98aa9da62b 100644
--- a/libavcodec/apv_entropy.c
+++ b/libavcodec/apv_entropy.c
@@ -318,9 +318,10 @@ static int apv_apply_multi_entry(int16_t *restrict coeff,
     }
 }
 
-int ff_apv_entropy_decode_block(int16_t *restrict coeff,
-                                GetBitContext *restrict gbc,
-                                APVEntropyState *restrict state)
+av_always_inline
+static int apv_entropy_decode_block_internal(int16_t *restrict coeff,
+                                             GetBitContext *restrict gbc,
+                                             APVEntropyState *restrict state)
 {
     const APVVLCLUT *lut = state->decode_lut;
     const APVMultiVLCLUTEntry *tables = lut->multi_lut[0][0][0];
@@ -496,3 +497,16 @@ normal_loop:
         return 0;
     }
 }
+
+int ff_apv_entropy_decode_block(int16_t *restrict coeff,
+                                GetBitContext *restrict gbc,
+                                APVEntropyState *restrict state)
+{
+    // Use a local copy of the bitstream reader in this translation unit
+    // to improve optimisation opportunities.  Only the position in the
+    // bitstream needs to be written back.
+    GetBitContext gb = *gbc;
+    int err = apv_entropy_decode_block_internal(coeff, &gb, state);
+    gbc->index = gb.index;
+    return err;
+}

-- 
To stop receiving notification emails like this one, please contact
[email protected].
_______________________________________________
ffmpeg-cvslog mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to