You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-04 22:03:09 +02:00
avcodec/ac3dec: Read spx flags at once, not one bit at a time
Doing so gets rid of a stupid GCC -Wstringop-overflow= warning (GCC somehow believes that fbw_channels can be 7 with the old form of the code, so that channel_uses_spx[7] would be written to, but now it no longer believes so). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
@ -854,16 +854,18 @@ static void decode_band_structure(GetBitContext *gbc, int blk, int eac3,
|
|||||||
static inline int spx_strategy(AC3DecodeContext *s, int blk)
|
static inline int spx_strategy(AC3DecodeContext *s, int blk)
|
||||||
{
|
{
|
||||||
GetBitContext *bc = &s->gbc;
|
GetBitContext *bc = &s->gbc;
|
||||||
int fbw_channels = s->fbw_channels;
|
|
||||||
int dst_start_freq, dst_end_freq, src_start_freq,
|
int dst_start_freq, dst_end_freq, src_start_freq,
|
||||||
start_subband, end_subband, ch;
|
start_subband, end_subband;
|
||||||
|
|
||||||
/* determine which channels use spx */
|
/* determine which channels use spx */
|
||||||
if (s->channel_mode == AC3_CHMODE_MONO) {
|
if (s->channel_mode == AC3_CHMODE_MONO) {
|
||||||
s->channel_uses_spx[1] = 1;
|
s->channel_uses_spx[1] = 1;
|
||||||
} else {
|
} else {
|
||||||
for (ch = 1; ch <= fbw_channels; ch++)
|
unsigned channel_uses_spx = get_bits(bc, s->fbw_channels);
|
||||||
s->channel_uses_spx[ch] = get_bits1(bc);
|
for (int ch = s->fbw_channels; ch >= 1; --ch) {
|
||||||
|
s->channel_uses_spx[ch] = channel_uses_spx & 1;
|
||||||
|
channel_uses_spx >>= 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* get the frequency bins of the spx copy region and the spx start
|
/* get the frequency bins of the spx copy region and the spx start
|
||||||
|
Reference in New Issue
Block a user