[FFmpeg-soc] [soc]: r4732 - jpeg2000/j2kdec.c

jai_menon subversion at mplayerhq.hu
Sun Jul 19 16:42:36 CEST 2009


Author: jai_menon
Date: Sun Jul 19 16:42:36 2009
New Revision: 4732

Log:
Compute bounds on a per-component basis.

Modified:
   jpeg2000/j2kdec.c

Modified: jpeg2000/j2kdec.c
==============================================================================
--- jpeg2000/j2kdec.c	Sun Jul 19 12:40:48 2009	(r4731)
+++ jpeg2000/j2kdec.c	Sun Jul 19 16:42:36 2009	(r4732)
@@ -795,15 +795,15 @@ static int decode_tile(J2kDecoderContext
 
     if (s->precision <= 8) {
         for (compno = 0; compno < s->ncomponents; compno++){
-            y = tile->comp[0].coord[1][0] - s->image_offset_y;
+            y = tile->comp[compno].coord[1][0] - s->image_offset_y;
             line = s->picture.data[0] + y * s->picture.linesize[0];
-            for (; y < tile->comp[0].coord[1][1] - s->image_offset_y; y++){
+            for (; y < tile->comp[compno].coord[1][1] - s->image_offset_y; y++){
                 uint8_t *dst;
 
-                x = tile->comp[0].coord[0][0] - s->image_offset_x;
+                x = tile->comp[compno].coord[0][0] - s->image_offset_x;
                 dst = line + x * s->ncomponents + compno;
 
-                for (; x < tile->comp[0].coord[0][1] - s->image_offset_x; x++) {
+                for (; x < tile->comp[compno].coord[0][1] - s->image_offset_x; x++) {
                     *src[compno] += 1 << (s->cbps[compno]-1);
                     if (*src[compno] < 0)
                         *src[compno] = 0;
@@ -817,13 +817,13 @@ static int decode_tile(J2kDecoderContext
         }
     } else {
         for (compno = 0; compno < s->ncomponents; compno++) {
-            y = tile->comp[0].coord[1][0] - s->image_offset_y;
+            y = tile->comp[compno].coord[1][0] - s->image_offset_y;
             line = s->picture.data[0] + y * s->picture.linesize[0];
-            for (; y < tile->comp[0].coord[1][1] - s->image_offset_y; y++) {
+            for (; y < tile->comp[compno].coord[1][1] - s->image_offset_y; y++) {
                 uint16_t *dst;
-                x = tile->comp[0].coord[0][0] - s->image_offset_x;
+                x = tile->comp[compno].coord[0][0] - s->image_offset_x;
                 dst = line + (x * s->ncomponents + compno) * 2;
-                for (; x < tile->comp[0].coord[0][1] - s->image_offset_x; x++) {
+                for (; x < tile->comp[compno].coord[0][1] - s->image_offset_x; x++) {
                     int32_t val;
                     val = *src[compno]++ << (16 - s->cbps[compno]);
                     val += 1 << 15;


More information about the FFmpeg-soc mailing list