From 8b37a1bc306c1d5a3cc92e9dc04fb95d5d9a0298 Mon Sep 17 00:00:00 2001 From: trav90 Date: Thu, 26 Apr 2018 16:49:15 -0500 Subject: [ffvpx] Update ffvp9/ffvp8 to 3.4.2-release Structure of code was slightly modified so that it should be no longer necessary to re-generate the config_*.h files, greatly simplifying the resync process in the future. --- media/ffvpx/libavcodec/bitstream.c | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) (limited to 'media/ffvpx/libavcodec/bitstream.c') diff --git a/media/ffvpx/libavcodec/bitstream.c b/media/ffvpx/libavcodec/bitstream.c index 562ca1cb8..ed528fe4a 100644 --- a/media/ffvpx/libavcodec/bitstream.c +++ b/media/ffvpx/libavcodec/bitstream.c @@ -28,7 +28,6 @@ * bitstream api. */ -#include "libavutil/atomic.h" #include "libavutil/avassert.h" #include "libavutil/qsort.h" #include "avcodec.h" @@ -99,9 +98,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 +127,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; @@ -183,7 +176,7 @@ static int build_table(VLC *vlc, int table_nb_bits, int nb_codes, n = codes[i].bits; code = codes[i].code; symbol = codes[i].symbol; - ff_dlog(NULL, "i=%d n=%d code=0x%x\n", i, n, code); + ff_dlog(NULL, "i=%d n=%d code=0x%"PRIx32"\n", i, n, code); if (n <= table_nb_bits) { /* no need to add another table */ j = code >> (32 - table_nb_bits); @@ -264,7 +257,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. @@ -317,7 +310,8 @@ int ff_init_vlc_sparse(VLC *vlc_arg, int nb_bits, int nb_codes, } \ GET_DATA(buf[j].code, codes, i, codes_wrap, codes_size); \ if (buf[j].code >= (1LL<