FFmpeg/libavcodec
Andreas Rheinhardt b2c42f0233 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>
2020-09-18 02:11:34 +02:00
..
2020-08-07 23:04:28 +10:00
2020-06-10 12:36:44 +02:00
2020-09-02 00:00:57 +01:00
2020-09-02 00:00:57 +01:00
2020-08-30 16:18:37 +02:00
2020-08-26 21:13:38 +02:00
2020-08-26 21:13:38 +02:00
2020-09-04 16:01:53 +02:00
2020-09-04 16:01:53 +02:00
2020-06-05 18:14:17 +02:00
2020-06-14 18:20:37 +02:00
2020-06-15 04:22:28 +02:00
2020-07-20 18:41:09 +02:00
2020-07-20 18:41:09 +02:00
2020-06-08 20:45:56 +02:00
2020-07-05 19:59:49 +02:00
2020-09-01 14:19:19 +02:00
2020-07-06 18:23:50 +01:00
2020-07-20 18:41:09 +02:00