diff options
author | Luca Barbato <lu_zero@gentoo.org> | 2014-11-21 12:57:36 +0000 |
---|---|---|
committer | Vittorio Giovara <vittorio.giovara@gmail.com> | 2014-12-02 15:28:22 +0000 |
commit | 7464e98f74c03d3efa0cdc8d7abad06e4c3c277a (patch) | |
tree | 5dee2e999d43eb0738a6c00d7475302e7c418f4e | |
parent | e4a77dc204f80a6876cbd91de9b71c30feebe119 (diff) | |
download | ffmpeg-7464e98f74c03d3efa0cdc8d7abad06e4c3c277a.tar.gz |
aac: Simplify decode_mid_side_stereo
Might spare few cycles if the compiler is naive and
makes the function more readable.
-rw-r--r-- | libavcodec/aacdec.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/libavcodec/aacdec.c b/libavcodec/aacdec.c index 76190e2088..9c0a46d0d5 100644 --- a/libavcodec/aacdec.c +++ b/libavcodec/aacdec.c @@ -1419,13 +1419,12 @@ static void decode_mid_side_stereo(ChannelElement *cpe, GetBitContext *gb, int ms_present) { int idx; + int max_idx = cpe->ch[0].ics.num_window_groups * cpe->ch[0].ics.max_sfb; if (ms_present == 1) { - for (idx = 0; - idx < cpe->ch[0].ics.num_window_groups * cpe->ch[0].ics.max_sfb; - idx++) + for (idx = 0; idx < max_idx; idx++) cpe->ms_mask[idx] = get_bits1(gb); } else if (ms_present == 2) { - memset(cpe->ms_mask, 1, cpe->ch[0].ics.num_window_groups * cpe->ch[0].ics.max_sfb * sizeof(cpe->ms_mask[0])); + memset(cpe->ms_mask, 1, max_idx * sizeof(cpe->ms_mask[0])); } } |