[FFmpeg-cvslog] avcodec/asvenc: Inline constants

Andreas Rheinhardt git at videolan.org
Fri Oct 16 01:59:32 EEST 2020


ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinhardt at gmail.com> | Mon Oct 12 23:22:27 2020 +0200| [8e58db7348b79b2f5d460632932e4f9a8e6312ed] | committer: Andreas Rheinhardt

avcodec/asvenc: Inline constants

Reviewed-by: Michael Niedermayer <michael at niedermayer.cc>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at gmail.com>

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

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

diff --git a/libavcodec/asvenc.c b/libavcodec/asvenc.c
index 28f7a94071..054ec8ee65 100644
--- a/libavcodec/asvenc.c
+++ b/libavcodec/asvenc.c
@@ -47,7 +47,7 @@ static inline void asv1_put_level(PutBitContext *pb, int level)
     if (index <= 6) {
         put_bits(pb, ff_asv_level_tab[index][1], ff_asv_level_tab[index][0]);
     } else {
-        put_bits(pb, ff_asv_level_tab[3][1], ff_asv_level_tab[3][0]);
+        put_bits(pb, 3, 0); /* Escape code */
         put_sbits(pb, 8, level);
     }
 }
@@ -59,7 +59,7 @@ static inline void asv2_put_level(ASV1Context *a, PutBitContext *pb, int level)
     if (index <= 62) {
         put_bits(pb, ff_asv2_level_tab[index][1], ff_asv2_level_tab[index][0]);
     } else {
-        put_bits(pb, ff_asv2_level_tab[31][1], ff_asv2_level_tab[31][0]);
+        put_bits(pb, 5, 0); /* Escape code */
         if (level < -128 || level > 127) {
             av_log(a->avctx, AV_LOG_WARNING, "Clipping level %d, increase qscale\n", level);
             level = av_clip_int8(level);
@@ -95,7 +95,7 @@ static inline void asv1_encode_block(ASV1Context *a, int16_t block[64])
 
         if (ccp) {
             for (; nc_count; nc_count--)
-                put_bits(&a->pb, ff_asv_ccp_tab[0][1], ff_asv_ccp_tab[0][0]);
+                put_bits(&a->pb, 2, 2); /* Skip */
 
             put_bits(&a->pb, ff_asv_ccp_tab[ccp][1], ff_asv_ccp_tab[ccp][0]);
 
@@ -111,7 +111,7 @@ static inline void asv1_encode_block(ASV1Context *a, int16_t block[64])
             nc_count++;
         }
     }
-    put_bits(&a->pb, ff_asv_ccp_tab[16][1], ff_asv_ccp_tab[16][0]);
+    put_bits(&a->pb, 5, 0xF); /* End of block */
 }
 
 static inline void asv2_encode_block(ASV1Context *a, int16_t block[64])



More information about the ffmpeg-cvslog mailing list