diff mbox series

[FFmpeg-devel,39/57] avcodec/ituh263enc: Inline constants

Message ID GV1P250MB0737362C1BDCD411BA3A3F858FC02@GV1P250MB0737.EURP250.PROD.OUTLOOK.COM
State New
Headers show
Series [FFmpeg-devel,01/57] avcodec/vc1: Combine identical checks | expand

Commit Message

Andreas Rheinhardt June 12, 2024, 1:48 p.m. UTC
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavcodec/ituh263enc.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)
diff mbox series

Patch

diff --git a/libavcodec/ituh263enc.c b/libavcodec/ituh263enc.c
index b1fe4e241e..3982b1e675 100644
--- a/libavcodec/ituh263enc.c
+++ b/libavcodec/ituh263enc.c
@@ -709,9 +709,8 @@  void ff_h263_encode_motion(PutBitContext *pb, int val, int f_code)
     int range, bit_size, sign, code, bits;
 
     if (val == 0) {
-        /* zero vector */
-        code = 0;
-        put_bits(pb, ff_mvtab[code][1], ff_mvtab[code][0]);
+        /* zero vector -- corresponds to ff_mvtab[0] */
+        put_bits(pb, 1, 1);
     } else {
         bit_size = f_code - 1;
         range = 1 << bit_size;
@@ -741,7 +740,7 @@  static av_cold void init_mv_penalty_and_fcode(void)
         for(mv=-MAX_DMV; mv<=MAX_DMV; mv++){
             int len;
 
-            if(mv==0) len= ff_mvtab[0][1];
+            if (mv==0) len = 1; // ff_mvtab[0][1]
             else{
                 int val, bit_size, code;
 
@@ -755,7 +754,7 @@  static av_cold void init_mv_penalty_and_fcode(void)
                 if(code<33){
                     len= ff_mvtab[code][1] + 1 + bit_size;
                 }else{
-                    len= ff_mvtab[32][1] + av_log2(code>>5) + 2 + bit_size;
+                    len = 12 /* ff_mvtab[32][1] */ + av_log2(code>>5) + 2 + bit_size;
                 }
             }