summaryrefslogtreecommitdiffstats
path: root/media/ffvpx/libavcodec/vlc.c
diff options
context:
space:
mode:
Diffstat (limited to 'media/ffvpx/libavcodec/vlc.c')
-rw-r--r--media/ffvpx/libavcodec/vlc.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/media/ffvpx/libavcodec/vlc.c b/media/ffvpx/libavcodec/vlc.c
index 78510e30d6..ee09d96fd6 100644
--- a/media/ffvpx/libavcodec/vlc.c
+++ b/media/ffvpx/libavcodec/vlc.c
@@ -440,8 +440,8 @@ static void add_level(VLC_MULTI_ELEM *table, const int is16bit,
code = curcode + (buf[t].code >> curlen);
newlimit = curlimit - l;
l += curlen;
- if (is16bit) AV_WN16(info.val+2*curlevel, sym);
- else info.val[curlevel] = sym&0xFF;
+ if (is16bit) info.val16[curlevel] = sym;
+ else info.val8[curlevel] = sym&0xFF;
if (curlevel) { // let's not add single entries
uint32_t val = code >> (32 - numbits);
@@ -468,7 +468,7 @@ static int vlc_multi_gen(VLC_MULTI_ELEM *table, const VLC *single,
{
int minbits, maxbits, max;
unsigned count[VLC_MULTI_MAX_SYMBOLS-1] = { 0, };
- VLC_MULTI_ELEM info = { { 0, }, 0, 0, };
+ VLC_MULTI_ELEM info = { 0 };
int count0 = 0;
for (int j = 0; j < 1<<numbits; j++) {
@@ -499,7 +499,10 @@ static int vlc_multi_gen(VLC_MULTI_ELEM *table, const VLC *single,
for (int j = 0; j < 1<<numbits; j++) {
table[j].len = single->table[j].len;
table[j].num = single->table[j].len > 0 ? 1 : 0;
- AV_WN16(table[j].val, single->table[j].sym);
+ if (is16bit)
+ table[j].val16[0] = single->table[j].sym;
+ else
+ table[j].val8[0] = single->table[j].sym;
}
add_level(table, is16bit, nb_codes, numbits, buf,