[FFmpeg-cvslog] avcodec/jpeg2000dec: Use 32x32->64bit for 5/3 dequantization

Michael Niedermayer git at videolan.org
Wed Jun 24 17:28:50 CEST 2015


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Wed Jun 24 17:00:58 2015 +0200| [8ff09e90986941942f4dc9eb3dc11073215589a3] | committer: Michael Niedermayer

avcodec/jpeg2000dec: Use 32x32->64bit for 5/3 dequantization

This fixes overflows, using fewer bits would impact high bit depth quality

Fixes Ticket4654

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=8ff09e90986941942f4dc9eb3dc11073215589a3
---

 libavcodec/jpeg2000dec.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/jpeg2000dec.c b/libavcodec/jpeg2000dec.c
index 8f38c1d..be78660 100644
--- a/libavcodec/jpeg2000dec.c
+++ b/libavcodec/jpeg2000dec.c
@@ -1437,7 +1437,7 @@ static void dequantization_int(int x, int y, Jpeg2000Cblk *cblk,
         int32_t *datap = &comp->i_data[(comp->coord[0][1] - comp->coord[0][0]) * (y + j) + x];
         int *src = t1->data[j];
         for (i = 0; i < w; ++i)
-            datap[i] = (src[i] * band->i_stepsize) / 32768;
+            datap[i] = (src[i] * (int64_t)band->i_stepsize) / 32768;
     }
 }
 



More information about the ffmpeg-cvslog mailing list