ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinha...@outlook.com> | 
Fri Mar  7 03:57:30 2025 +0100| [9aeb6940a22f8cf5a8fff3f161aaf7963021f61c] | 
committer: Andreas Rheinhardt

avcodec/mdec: Optimize processing escape codes

Said escape code is only six bits long, so that one has at least 25 - 6
bits in the bitstream reader's cache after reading it; therefore the
whole following 16 bits (containing the actual code) are already in the
bitstream reader's cache, making it unnecessary to reload the cache.

This is the mdec analogue of fe9bc1cc45e2bebba1efa7b9a20b0d66679bf2d5.

Signed-off-by: Andreas Rheinhardt <andreas.rheinha...@outlook.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=9aeb6940a22f8cf5a8fff3f161aaf7963021f61c
---

 libavcodec/mdec.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavcodec/mdec.c b/libavcodec/mdec.c
index 66331d9059..9789a94396 100644
--- a/libavcodec/mdec.c
+++ b/libavcodec/mdec.c
@@ -100,8 +100,8 @@ static inline int mdec_decode_block_intra(MDECContext *a, 
int16_t *block, int n)
                 LAST_SKIP_BITS(re, &a->gb, 1);
             } else {
                 /* escape */
-                run = SHOW_UBITS(re, &a->gb, 6)+1; LAST_SKIP_BITS(re, &a->gb, 
6);
-                UPDATE_CACHE(re, &a->gb);
+                run = SHOW_UBITS(re, &a->gb, 6) + 1;
+                SKIP_BITS(re, &a->gb, 6);
                 level = SHOW_SBITS(re, &a->gb, 10); SKIP_BITS(re, &a->gb, 10);
                 i += run;
                 if (i > 63) {

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

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

Reply via email to