]> git.sesse.net Git - ffmpeg/commitdiff
avcodec/mobiclip: Use smaller type for codes
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Sat, 24 Oct 2020 11:01:07 +0000 (13:01 +0200)
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Mon, 26 Oct 2020 06:56:51 +0000 (07:56 +0100)
Even though the length of these codes is > 8, only the lowest seven bits
are ever set (because the long codes are on the left of the tree), so
one can use an uint8_t for them, saving space.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
libavcodec/mobiclip.c

index 4e74033498b89bfa1acf9ff6b7e45b40b38c4ca9..9fa88e84a0589b5ed2602f4fa39abc0cdcd58862 100644 (file)
@@ -128,7 +128,7 @@ static const uint8_t bits0[] = {
      6,  6,  6,  6,  6,  6,  5,  5,  5,  4,  2,  3,  4,  4,
 };
 
-static const uint16_t codes0[] = {
+static const uint8_t codes0[] = {
     0x0, 0x4, 0x5, 0x6, 0x7, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0xA,
     0xB, 0xC, 0xD, 0xE, 0xF, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25,
     0x26, 0x27, 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57,