Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2017-01-02 02:28:33 +0300
committerMichael Niedermayer <michael@niedermayer.cc>2022-10-21 23:19:37 +0300
commit065b3e6009cb8942f9891f87ca051eb6f7264d27 (patch)
tree60cb808d80c1d482c236d1b8853d020867edfa8e
parentd03eb6c889dd3915681650993acd13017dcf2b1d (diff)
avcodec/texturedspenc: Fix indexing in color distribution determination
Fixes CID1396405 MSE and PSNR is slightly improved, and some noticable corruptions disappear as well. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Marton Balint <cus@passwd.hu> (cherry picked from commit ade36d61de8ea5a5acb30a05a0cbcda069127143) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/texturedspenc.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libavcodec/texturedspenc.c b/libavcodec/texturedspenc.c
index 8b2863033b..5171c69d82 100644
--- a/libavcodec/texturedspenc.c
+++ b/libavcodec/texturedspenc.c
@@ -255,11 +255,11 @@ static void optimize_colors(const uint8_t *block, ptrdiff_t stride,
muv = minv = maxv = bp[0];
for (y = 0; y < 4; y++) {
- for (x = 4; x < 4; x += 4) {
+ for (x = 0; x < 4; x++) {
muv += bp[x * 4 + y * stride];
- if (bp[x] < minv)
+ if (bp[x * 4 + y * stride] < minv)
minv = bp[x * 4 + y * stride];
- else if (bp[x] > maxv)
+ else if (bp[x * 4 + y * stride] > maxv)
maxv = bp[x * 4 + y * stride];
}
}