]> git.sesse.net Git - ffmpeg/commit
avcodec/adxdec: Remove unnecessary left-shift
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Mon, 20 Jan 2020 19:20:43 +0000 (20:20 +0100)
committerMichael Niedermayer <michael@niedermayer.cc>
Tue, 21 Jan 2020 09:01:46 +0000 (10:01 +0100)
commit340e6b018596837db950e82b4d5232d993e23934
tree3b936305c2241548fcad27ecce122987fb97b393
parent59a9d65e0d790821f88527a82569f56eb2f8a9be
avcodec/adxdec: Remove unnecessary left-shift

Replace "(a * (1 << shift) * b + c) >> shift" by "a * b + (c >> shift)".
It is equivalent to the old code because a is in the range of uint16_t,
shift is 12 and b is effectively a signed 4-bit number, so that no
overflow/truncation of high bits happens during the multiplication
(overflow would be undefined anyway).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavcodec/adxdec.c