avcodec/ffv1dec_template: Optimize common case in run mode
authorMichael Niedermayer <michael@niedermayer.cc>
Wed, 22 May 2019 23:06:58 +0000 (01:06 +0200)
committerMichael Niedermayer <michael@niedermayer.cc>
Mon, 27 May 2019 17:01:38 +0000 (19:01 +0200)
commite6f4d5dc384af334a5c7b61969db9d7d9c1b7e0a
treecd0388b186a20cb715e32f3cf3cf49553c87e298
parent5ddaedcaec39162972b26487e68b75cd37804075
avcodec/ffv1dec_template: Optimize common case in run mode

Fixes: Timeout (14sec -> 9sec)
Fixes: 13398/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_FFV1_fuzzer-5664106709778432

decode_line() becomes 1% faster for fate/vsynth2-ffv1.avi
for another fate sample there is a 0.5% speedup
the effect should be bigger for files with "flat" colored areas
the new faster branch is used in 97-100% of the cases in fate samples
compared to the older more complex (which i tested)

vsynth3-ffv1-v3-bgr0.avi had the lowest percentual useage of about 97%

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