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;
_______________________________________________
FFmpeg-soc mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-soc

Reply via email to