[FFmpeg-soc] [soc]: r1290 - in jpeg2000: j2kdec.c j2kenc.c

k.nowosad subversion at mplayerhq.hu
Mon Sep 3 21:37:25 CEST 2007


Author: k.nowosad
Date: Mon Sep  3 21:37:25 2007
New Revision: 1290

Log:
fixed a bug in packet encoding and decoding


Modified:
   jpeg2000/j2kdec.c
   jpeg2000/j2kenc.c

Modified: jpeg2000/j2kdec.c
==============================================================================
--- jpeg2000/j2kdec.c	(original)
+++ jpeg2000/j2kdec.c	Mon Sep  3 21:37:25 2007
@@ -490,6 +490,10 @@ static int decode_packet(J2kDecoderConte
         J2kPrec *prec = band->prec + precno;
         int pos = 0;
 
+        if (band->coord[0][0] == band->coord[0][1]
+        ||  band->coord[1][0] == band->coord[1][1])
+            continue;
+
         for (cblkny = prec->yi0; cblkny < prec->yi1; cblkny++)
             for(cblknx = prec->xi0, cblkno = cblkny * band->cblknx + cblknx; cblknx < prec->xi1; cblknx++, cblkno++, pos++){
                 J2kCblk *cblk = band->cblk + cblkno;

Modified: jpeg2000/j2kenc.c
==============================================================================
--- jpeg2000/j2kenc.c	(original)
+++ jpeg2000/j2kenc.c	Mon Sep  3 21:37:25 2007
@@ -651,6 +651,10 @@ static int encode_packet(J2kEncoderConte
         int yi, xi, pos;
         int cblknw = prec->xi1 - prec->xi0;
 
+        if (band->coord[0][0] == band->coord[0][1]
+        ||  band->coord[1][0] == band->coord[1][1])
+            continue;
+
         for (pos=0, yi = prec->yi0; yi < prec->yi1; yi++){
             for (xi = prec->xi0; xi < prec->xi1; xi++, pos++){
                 prec->cblkincl[pos].val = band->cblk[yi * cblknw + xi].ninclpasses == 0;



More information about the FFmpeg-soc mailing list