]> git.nihav.org Git - nihav.git/commitdiff
aac/sbr: fix index in HF generation code
authorKostya Shishkov <kostya.shishkov@gmail.com>
Sat, 21 Jun 2025 15:35:15 +0000 (17:35 +0200)
committerKostya Shishkov <kostya.shishkov@gmail.com>
Sat, 21 Jun 2025 15:35:15 +0000 (17:35 +0200)
nihav-mpeg/src/codecs/aac/sbr/synth.rs

index cc7cd5c650470ec96ee73b0cb6c970eff8800efa..6d326bdea57d8944b0b661eefed6117c8e52a21a 100644 (file)
@@ -570,7 +570,7 @@ impl SBRChannel {
         }
 
         let index_noise = self.index_noise.wrapping_sub(self.env_border[0] * 2) & 511;
-        for (slot, y) in self.y.iter_mut().skip(HF_ADJ).take(envelope_end * 2).skip(envelope_start * 2).enumerate() {
+        for (slot, y) in self.y.iter_mut().skip(HF_ADJ).enumerate().take(envelope_end * 2).skip(envelope_start * 2) {
             for (k, y) in y.iter_mut().enumerate().skip(kx).take(km - kx) {
                 *y = self.x_high[HF_ADJ + slot][k].scale(g_filt[slot][k]);