aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2020-01-29 19:20:29 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2020-01-30 18:47:21 +0100
commit20916f9bc4534678a87684994377c181d8aa16bc (patch)
tree9953bdc0fd187bafc504a33c9cbc602e24d94be4
parent6e8e8431e15a58aa44cfdd8c11f9ea096837c0fa (diff)
downloadffmpeg-20916f9bc4534678a87684994377c181d8aa16bc.tar.gz
avcodec/screenpresso: Optimize sum_delta_flipped()
553 -> 332 sec Testcase: 20280/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SCREENPRESSO_fuzzer-6238663432470528 Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/screenpresso.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libavcodec/screenpresso.c b/libavcodec/screenpresso.c
index 5fac100897..d73c24df83 100644
--- a/libavcodec/screenpresso.c
+++ b/libavcodec/screenpresso.c
@@ -94,8 +94,9 @@ static void sum_delta_flipped(uint8_t *dst, int dst_linesize,
{
int i;
for (; height > 0; height--) {
+ const uint8_t *src1 = &src[(height - 1) * src_linesize];
for (i = 0; i < bytewidth; i++)
- dst[i] += src[(height - 1) * src_linesize + i];
+ dst[i] += src1[i];
dst += dst_linesize;
}
}