[FFmpeg-cvslog] avcodec/jpeg2000dwt: Fix 9/7 IDWT for small sizes

Michael Niedermayer git at videolan.org
Tue Jun 16 20:49:50 CEST 2015


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Tue Jun 16 20:33:54 2015 +0200| [34121ca187340129851e2c41427b0e6db8820c8d] | committer: Michael Niedermayer

avcodec/jpeg2000dwt: Fix 9/7 IDWT for small sizes

Fixes Ticket4631

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

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

 libavcodec/jpeg2000dwt.c |   10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/libavcodec/jpeg2000dwt.c b/libavcodec/jpeg2000dwt.c
index a5eb0b7..dba8393 100644
--- a/libavcodec/jpeg2000dwt.c
+++ b/libavcodec/jpeg2000dwt.c
@@ -357,8 +357,11 @@ static void sr_1d97_float(float *p, int i0, int i1)
 {
     int i;
 
-    if (i1 == i0 + 1)
+    if (i1 <= i0 + 1) {
+        if (i0 == 1)
+            p[1] *= F_LFTG_K/2;
         return;
+    }
 
     extend97_float(p, i0, i1);
 
@@ -429,8 +432,11 @@ static void sr_1d97_int(int32_t *p, int i0, int i1)
 {
     int i;
 
-    if (i1 == i0 + 1)
+    if (i1 <= i0 + 1) {
+        if (i0 == 1)
+            p[1] = (p[1] * I_LFTG_K + (1<<16)) >> 17;
         return;
+    }
 
     extend97_int(p, i0, i1);
 



More information about the ffmpeg-cvslog mailing list