Quoting Diego Biurrun (2016-06-09 17:12:02) > From: Alexandra Hájková <[email protected]> > > --- > libavcodec/atrac1.c | 34 ++++++++++--------- > libavcodec/atrac3.c | 97 > +++++++++++++++++++++++++++-------------------------- > 2 files changed, 67 insertions(+), 64 deletions(-) > > diff --git a/libavcodec/atrac1.c b/libavcodec/atrac1.c > index e938976..b8fd188 100644 > --- a/libavcodec/atrac1.c > +++ b/libavcodec/atrac1.c > @@ -33,8 +33,9 @@ > #include <stdio.h> > > #include "libavutil/float_dsp.h" > + > #include "avcodec.h" > -#include "get_bits.h" > +#include "bitstream.h" > #include "fft.h" > #include "internal.h" > #include "sinewin.h" > @@ -164,30 +165,31 @@ static int at1_imdct_block(AT1SUCtx* su, AT1Ctx *q) > * Parse the block size mode byte > */ > > -static int at1_parse_bsm(GetBitContext* gb, int > log2_block_cnt[AT1_QMF_BANDS]) > +static int at1_parse_bsm(BitstreamContext *bc, > + int log2_block_cnt[AT1_QMF_BANDS]) > { > int log2_block_count_tmp, i; > > for (i = 0; i < 2; i++) { > /* low and mid band */ > - log2_block_count_tmp = get_bits(gb, 2); > + log2_block_count_tmp = bitstream_read(bc, 2); > if (log2_block_count_tmp & 1) > return AVERROR_INVALIDDATA; > log2_block_cnt[i] = 2 - log2_block_count_tmp; > } > > /* high band */ > - log2_block_count_tmp = get_bits(gb, 2); > + log2_block_count_tmp = bitstream_read(bc, 2); > if (log2_block_count_tmp != 0 && log2_block_count_tmp != 3) > return AVERROR_INVALIDDATA; > log2_block_cnt[IDX_HIGH_BAND] = 3 - log2_block_count_tmp; > > - skip_bits(gb, 2); > + bitstream_skip(bc, 2); > return 0; > } > > > -static int at1_unpack_dequant(GetBitContext* gb, AT1SUCtx* su, > +static int at1_unpack_dequant(BitstreamContext *bc, AT1SUCtx *su, > float spec[AT1_SU_SAMPLES]) > { > int bits_used, band_num, bfu_num, i; > @@ -195,22 +197,22 @@ static int at1_unpack_dequant(GetBitContext* gb, > AT1SUCtx* su, > uint8_t idsfs[AT1_MAX_BFU]; ///< the scalefactor indexes > for each BFU > > /* parse the info byte (2nd byte) telling how much BFUs were coded */ > - su->num_bfus = bfu_amount_tab1[get_bits(gb, 3)]; > + su->num_bfus = bfu_amount_tab1[bitstream_read(bc, 3)]; > > /* calc number of consumed bits: > num_BFUs * (idwl(4bits) + idsf(6bits)) + log2_block_count(8bits) + > info_byte(8bits) > + info_byte_copy(8bits) + log2_block_count_copy(8bits) */ > bits_used = su->num_bfus * 10 + 32 + > - bfu_amount_tab2[get_bits(gb, 2)] + > - (bfu_amount_tab3[get_bits(gb, 3)] << 1); > + bfu_amount_tab2[bitstream_read(bc, 2)] + ^^ Broken indentation.
Otherwise looks ok. -- Anton Khirnov _______________________________________________ libav-devel mailing list [email protected] https://lists.libav.org/mailman/listinfo/libav-devel
