mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
Revert "avcodec/vlc: Add macro for ff_init_vlc_sparse()"
This reverts commit 61669b7c40
.
This commit broke building with MSVC due to its spec-incompliant handling
of ',' in __VA_ARGS__: These are not treated as argument separators for
further macros, so that in our case the init_vlc2() macro is treated as
having only one argument whenever the init_vlc() macro is used. See [1]
for further details.
[1]: https://reviews.llvm.org/D69626
Reviewed-by: Hendrik Leppkes <h.leppkes@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
This commit is contained in:
parent
92396cee60
commit
6401a5d4b8
@ -222,9 +222,9 @@ static int smacker_decode_header_tree(SmackVContext *smk, GetBitContext *gb, int
|
|||||||
skip_bits1(gb);
|
skip_bits1(gb);
|
||||||
if (h.current > 1) {
|
if (h.current > 1) {
|
||||||
err = ff_init_vlc_sparse(&vlc[i], SMKTREE_BITS, h.current,
|
err = ff_init_vlc_sparse(&vlc[i], SMKTREE_BITS, h.current,
|
||||||
INIT_VLC_DEFAULT_SIZES(h.lengths),
|
h.lengths, sizeof(*h.lengths), sizeof(*h.lengths),
|
||||||
INIT_VLC_DEFAULT_SIZES(h.bits),
|
h.bits, sizeof(*h.bits), sizeof(*h.bits),
|
||||||
INIT_VLC_DEFAULT_SIZES(h.values),
|
h.values, sizeof(*h.values), sizeof(*h.values),
|
||||||
INIT_VLC_LE);
|
INIT_VLC_LE);
|
||||||
if (err < 0) {
|
if (err < 0) {
|
||||||
av_log(smk->avctx, AV_LOG_ERROR, "Cannot build VLC table\n");
|
av_log(smk->avctx, AV_LOG_ERROR, "Cannot build VLC table\n");
|
||||||
@ -653,9 +653,9 @@ static int smka_decode_frame(AVCodecContext *avctx, void *data,
|
|||||||
skip_bits1(&gb);
|
skip_bits1(&gb);
|
||||||
if (h.current > 1) {
|
if (h.current > 1) {
|
||||||
ret = ff_init_vlc_sparse(&vlc[i], SMKTREE_BITS, h.current,
|
ret = ff_init_vlc_sparse(&vlc[i], SMKTREE_BITS, h.current,
|
||||||
INIT_VLC_DEFAULT_SIZES(h.lengths),
|
h.lengths, sizeof(*h.lengths), sizeof(*h.lengths),
|
||||||
INIT_VLC_DEFAULT_SIZES(h.bits),
|
h.bits, sizeof(*h.bits), sizeof(*h.bits),
|
||||||
INIT_VLC_DEFAULT_SIZES(h.values),
|
h.values, sizeof(*h.values), sizeof(*h.values),
|
||||||
INIT_VLC_LE);
|
INIT_VLC_LE);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
av_log(avctx, AV_LOG_ERROR, "Cannot build VLC table\n");
|
av_log(avctx, AV_LOG_ERROR, "Cannot build VLC table\n");
|
||||||
|
@ -35,12 +35,7 @@ typedef struct RL_VLC_ELEM {
|
|||||||
uint8_t run;
|
uint8_t run;
|
||||||
} RL_VLC_ELEM;
|
} RL_VLC_ELEM;
|
||||||
|
|
||||||
#define INIT_VLC_DEFAULT_SIZES(ptr) \
|
#define init_vlc(vlc, nb_bits, nb_codes, \
|
||||||
(ptr), sizeof((ptr)[0]), sizeof((ptr)[0])
|
|
||||||
|
|
||||||
#define init_vlc(...) init_vlc2(__VA_ARGS__)
|
|
||||||
|
|
||||||
#define init_vlc2(vlc, nb_bits, nb_codes, \
|
|
||||||
bits, bits_wrap, bits_size, \
|
bits, bits_wrap, bits_size, \
|
||||||
codes, codes_wrap, codes_size, \
|
codes, codes_wrap, codes_size, \
|
||||||
flags) \
|
flags) \
|
||||||
|
Loading…
Reference in New Issue
Block a user