diff options
author | Andreas Rheinhardt <andreas.rheinhardt@gmail.com> | 2020-06-26 11:36:57 +0200 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@gmail.com> | 2020-09-18 02:11:34 +0200 |
commit | b2c42f02337301583b51bea2ede9dbfd837991c0 (patch) | |
tree | dfacb04223b14b1b4c3aeec7dd62e39799462a3a /libavcodec/xvididct.h | |
parent | 010e345afe5d9744956dbc6253a4999e6851e7e9 (diff) | |
download | ffmpeg-b2c42f02337301583b51bea2ede9dbfd837991c0.tar.gz |
avcodec/smacker: Use unsigned for prediction values
Up until now, the Smacker decoder has pretended that the prediction
values are signed in code like 'pred[0] += (unsigned)sign_extend(val, 16)'
(the cast has been added to this code later to fix undefined behaviour).
This has been even done in case the PCM format is u8.
Yet in case of 8/16 bit samples, only the lower 8/16 bit of the predicition
values are ever used, so one can just as well just use unsigned and
remove the sign extensions. This is what this commit does.
For GCC 9 the time for one call to smka_decode_frame() for the sample from
ticket #2425 decreased from 1709043 to 1693619 decicycles; for Clang 9
it went up from 1355273 to 1369089 decicycles.
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Diffstat (limited to 'libavcodec/xvididct.h')
0 files changed, 0 insertions, 0 deletions