[FFmpeg-cvslog] avcodec/msmpeg4enc: Remove dead code for inexistent VC-1 encoder

Andreas Rheinhardt git at videolan.org
Mon Apr 12 19:57:06 EEST 2021


ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinhardt at outlook.com> | Thu Apr  8 14:40:04 2021 +0200| [5da07f18e5cb0a65b2eb5cd7308a80aa2749379c] | committer: Andreas Rheinhardt

avcodec/msmpeg4enc: Remove dead code for inexistent VC-1 encoder

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>

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

 libavcodec/msmpeg4enc.c | 23 ++++-------------------
 1 file changed, 4 insertions(+), 19 deletions(-)

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);
                             }



More information about the ffmpeg-cvslog mailing list