avcodec/pngdec: Optimize has_trns code
authorMichael Niedermayer <michael@niedermayer.cc>
Sat, 17 Aug 2019 23:28:38 +0000 (01:28 +0200)
committerMichael Niedermayer <michael@niedermayer.cc>
Mon, 2 Sep 2019 19:37:18 +0000 (21:37 +0200)
commit361b3c873ee011598e16397db699bbfe5c045d7c
treebb14c2da55943199e5434ec0d0dbc3e96d53de65
parent8ae5d2cbb254e9e967184b2aad6fa43fe2780eaf
avcodec/pngdec: Optimize has_trns code

add inner loop specialisations for 2 bpp and 4 bpp
These are all cases for which i found testsamples.

30M cycles -> 5M cycles

Testcase: fate-rgbapng-4816
Testcase: 16097/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_APNG_fuzzer-5664690889293824

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavcodec/pngdec.c