[FFmpeg-cvslog] avcodec/wmavoice: Avoid code table

Andreas Rheinhardt git at videolan.org
Wed Sep 7 02:04:16 EEST 2022


ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinhardt at outlook.com> | Sun Sep  4 19:38:38 2022 +0200| [af847fe000f9eb78e3aa013ee64ab2274bfd5e68] | committer: Andreas Rheinhardt

avcodec/wmavoice: Avoid code table

These codes are already ordered from left-to-right in the tree,
so one can just use ff_init_vlc_static_from_lengths().

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

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

 libavcodec/wmavoice.c | 14 +++-----------
 1 file changed, 3 insertions(+), 11 deletions(-)

diff --git a/libavcodec/wmavoice.c b/libavcodec/wmavoice.c
index 8fa9db63ee..4438089e51 100644
--- a/libavcodec/wmavoice.c
+++ b/libavcodec/wmavoice.c
@@ -320,18 +320,10 @@ static av_cold void wmavoice_init_static_data(void)
         10, 10, 10, 12, 12, 12,
         14, 14, 14, 14
     };
-    static const uint16_t codes[] = {
-          0x0000, 0x0001, 0x0002,        //              00/01/10
-          0x000c, 0x000d, 0x000e,        //           11+00/01/10
-          0x003c, 0x003d, 0x003e,        //         1111+00/01/10
-          0x00fc, 0x00fd, 0x00fe,        //       111111+00/01/10
-          0x03fc, 0x03fd, 0x03fe,        //     11111111+00/01/10
-          0x0ffc, 0x0ffd, 0x0ffe,        //   1111111111+00/01/10
-          0x3ffc, 0x3ffd, 0x3ffe, 0x3fff // 111111111111+xx
-    };
 
-    INIT_VLC_STATIC(&frame_type_vlc, VLC_NBITS, sizeof(bits),
-                    bits, 1, 1, codes, 2, 2, 132);
+    INIT_VLC_STATIC_FROM_LENGTHS(&frame_type_vlc, VLC_NBITS,
+                                 FF_ARRAY_ELEMS(bits), bits,
+                                 1, NULL, 0, 0, 0, 0, 132);
 }
 
 static av_cold void wmavoice_flush(AVCodecContext *ctx)



More information about the ffmpeg-cvslog mailing list