diff options
author | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2025-03-07 16:12:42 +0100 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2025-03-17 03:26:07 +0100 |
commit | 0facdafd1e10f61f59897734d80e16b568bb9b00 (patch) | |
tree | fb0f98bf6c606b3db975aaf89c37cdeadc41fcca /libavcodec/get_bits.h | |
parent | 54d582e7495144605e1c5405b9420691428cafd8 (diff) | |
download | ffmpeg-0facdafd1e10f61f59897734d80e16b568bb9b00.tar.gz |
avcodec/vlc: Merge VLCElem and RL_VLC_ELEM
It will simplify creating RL-VLCs (which until now used
a stack-based VLC as temporary buffer).
Notice that there would be another option to merge them, namely:
struct VLCElem {
union {
VLCBaseType sym;
int16_t level;
};
int8_t len;
uint8_t run;
};
The main difference to the current patch is that this would change
the type of the length field of VLCElem to int8_t from int16_t.
It turns out that that this would entail additional sign extensions
on ppc, see https://godbolt.org/z/behWYEYE7. I have therefore refrained
from doing so, although it would make the patch simpler.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavcodec/get_bits.h')
-rw-r--r-- | libavcodec/get_bits.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libavcodec/get_bits.h b/libavcodec/get_bits.h index 39d8e5bc1e..1954296569 100644 --- a/libavcodec/get_bits.h +++ b/libavcodec/get_bits.h @@ -594,7 +594,7 @@ static inline const uint8_t *align_get_bits(GetBitContext *s) \ index = SHOW_UBITS(name, gb, bits); \ level = table[index].level; \ - n = table[index].len; \ + n = table[index].len8; \ \ if (max_depth > 1 && n < 0) { \ SKIP_BITS(name, gb, bits); \ @@ -606,7 +606,7 @@ static inline const uint8_t *align_get_bits(GetBitContext *s) \ index = SHOW_UBITS(name, gb, nb_bits) + level; \ level = table[index].level; \ - n = table[index].len; \ + n = table[index].len8; \ if (max_depth > 2 && n < 0) { \ LAST_SKIP_BITS(name, gb, nb_bits); \ if (need_update) { \ @@ -616,7 +616,7 @@ static inline const uint8_t *align_get_bits(GetBitContext *s) \ index = SHOW_UBITS(name, gb, nb_bits) + level; \ level = table[index].level; \ - n = table[index].len; \ + n = table[index].len8; \ } \ } \ run = table[index].run; \ |