X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Fbitstream.c;h=c26650099f5981da02bfeb7544e3c9b5aa919f9f;hb=f84ece0a9831cbbdc53163eeb81a5d03cd840d70;hp=562ca1cb823d52fcbc4449e6d0591b899402daf0;hpb=724a71dced1c211fc64105ec9f1fb99d79f6ff35;p=ffmpeg diff --git a/libavcodec/bitstream.c b/libavcodec/bitstream.c index 562ca1cb823..c26650099f5 100644 --- a/libavcodec/bitstream.c +++ b/libavcodec/bitstream.c @@ -99,9 +99,11 @@ void avpriv_copy_bits(PutBitContext *pb, const uint8_t *src, int length) case 2: \ v = *(const uint16_t *)ptr; \ break; \ - default: \ + case 4: \ v = *(const uint32_t *)ptr; \ break; \ + default: \ + av_assert1(0); \ } \ } @@ -126,14 +128,6 @@ static int alloc_table(VLC *vlc, int size, int use_static) return index; } -static av_always_inline uint32_t bitswap_32(uint32_t x) -{ - return (uint32_t)ff_reverse[ x & 0xFF] << 24 | - (uint32_t)ff_reverse[(x >> 8) & 0xFF] << 16 | - (uint32_t)ff_reverse[(x >> 16) & 0xFF] << 8 | - (uint32_t)ff_reverse[ x >> 24]; -} - typedef struct VLCcode { uint8_t bits; uint16_t symbol; @@ -264,7 +258,7 @@ static int build_table(VLC *vlc, int table_nb_bits, int nb_codes, 'bits' or 'codes' tables. 'xxx_size' : gives the number of bytes of each entry of the 'bits' - or 'codes' tables. + or 'codes' tables. Currently 1,2 and 4 are supported. 'wrap' and 'size' make it possible to use any memory configuration and types (byte/word/long) to store the 'bits', 'codes', and 'symbols' tables.