aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKostya Shishkov <kostya.shishkov@gmail.com>2022-04-01 18:19:44 +0200
committerKostya Shishkov <kostya.shishkov@gmail.com>2022-04-01 18:19:44 +0200
commit243a5f4783410cb701c78cf353fd12135f7da3dd (patch)
treea427db5ff34efd753dec34457b95fd9703715508
parent999c25f70cce9929567ece9cb285a900f56727f7 (diff)
downloadnihav-243a5f4783410cb701c78cf353fd12135f7da3dd.tar.gz
aac: do not add 16 to large coefficients
-rw-r--r--nihav-mpeg/src/codecs/aac/coeff_read.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/nihav-mpeg/src/codecs/aac/coeff_read.rs b/nihav-mpeg/src/codecs/aac/coeff_read.rs
index d195b39..4a92f0a 100644
--- a/nihav-mpeg/src/codecs/aac/coeff_read.rs
+++ b/nihav-mpeg/src/codecs/aac/coeff_read.rs
@@ -97,10 +97,10 @@ fn decode_pairs(br: &mut BitReader, cb: &Codebook<u16>, unsigned: bool, escape:
}
if escape {
if (x == 16) || (x == -16) {
- x += read_escape(br, x > 0)?;
+ x = read_escape(br, x > 0)?;
}
if (y == 16) || (y == -16) {
- y += read_escape(br, y > 0)?;
+ y = read_escape(br, y > 0)?;
}
}
out[0] = iquant(f32::from(x)) * scale;