diff mbox series

[FFmpeg-devel,3/7] avcodec/msmpeg4enc: Remove dead code for inexistent VC-1 encoder

Message ID HE1PR0301MB2154761F6ED774DC002831688F749@HE1PR0301MB2154.eurprd03.prod.outlook.com
State Accepted
Commit 5da07f18e5cb0a65b2eb5cd7308a80aa2749379c
Headers show
Series [FFmpeg-devel,1/7] avcodec/rv34: Move dsp init code to rv30/rv40
Related show

Checks

Context Check Description
andriy/x86_make success Make finished
andriy/x86_make_fate success Make fate finished
andriy/PPC64_make success Make finished
andriy/PPC64_make_fate success Make fate finished

Commit Message

Andreas Rheinhardt April 8, 2021, 7:42 p.m. UTC
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavcodec/msmpeg4enc.c | 23 ++++-------------------
 1 file changed, 4 insertions(+), 19 deletions(-)
diff mbox series

Patch

diff --git a/libavcodec/msmpeg4enc.c b/libavcodec/msmpeg4enc.c
index 59a18532c2..7147015042 100644
--- a/libavcodec/msmpeg4enc.c
+++ b/libavcodec/msmpeg4enc.c
@@ -492,8 +492,7 @@  void ff_msmpeg4_encode_mb(MpegEncContext * s,
 static void msmpeg4_encode_dc(MpegEncContext * s, int level, int n, int *dir_ptr)
 {
     int sign, code;
-    int pred, av_uninit(extquant);
-    int extrabits = 0;
+    int pred;
 
     int16_t *dc_val;
     pred = ff_msmpeg4_pred_dc(s, n, &dc_val, dir_ptr);
@@ -527,15 +526,6 @@  static void msmpeg4_encode_dc(MpegEncContext * s, int level, int n, int *dir_ptr
         code = level;
         if (code > DC_MAX)
             code = DC_MAX;
-        else if( s->msmpeg4_version>=6 ) {
-            if( s->qscale == 1 ) {
-                extquant = (level + 3) & 0x3;
-                code  = ((level+3)>>2);
-            } else if( s->qscale == 2 ) {
-                extquant = (level + 1) & 0x1;
-                code  = ((level+1)>>1);
-            }
-        }
 
         if (s->dc_table_index == 0) {
             if (n < 4) {
@@ -551,13 +541,8 @@  static void msmpeg4_encode_dc(MpegEncContext * s, int level, int n, int *dir_ptr
             }
         }
 
-        if(s->msmpeg4_version>=6 && s->qscale<=2)
-            extrabits = 3 - s->qscale;
-
         if (code == DC_MAX)
-            put_bits(&s->pb, 8 + extrabits, level);
-        else if(extrabits > 0)//== VC1 && s->qscale<=2
-            put_bits(&s->pb, extrabits, extquant);
+            put_bits(&s->pb, 8, level);
 
         if (level != 0) {
             put_bits(&s->pb, 1, sign);
@@ -596,7 +581,7 @@  void ff_msmpeg4_encode_block(MpegEncContext * s, int16_t * block, int n)
     }
 
     /* recalculate block_last_index for M$ wmv1 */
-    if(s->msmpeg4_version>=4 && s->msmpeg4_version<6 && s->block_last_index[n]>0){
+    if (s->msmpeg4_version >= 4 && s->block_last_index[n] > 0) {
         for(last_index=63; last_index>=0; last_index--){
             if(block[scantable[last_index]]) break;
         }
@@ -656,7 +641,7 @@  void ff_msmpeg4_encode_block(MpegEncContext * s, int16_t * block, int n)
                                 s->esc3_run_length= 6;
                                 //ESCLVLSZ + ESCRUNSZ
                                 if(s->qscale<8)
-                                    put_bits(&s->pb, 6 + (s->msmpeg4_version>=6), 3);
+                                    put_bits(&s->pb, 6, 3);
                                 else
                                     put_bits(&s->pb, 8, 3);
                             }