Changeset 11514

Show
Ignore:
Timestamp:
05/14/07 13:39:27 (2 years ago)
Author:
warmerdam
Message:

fix handling of multi-tile ycbcr decocded data (#1636)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/1.4/gdal/frmts/jp2kak/jp2kakdataset.cpp

    r10646 r11514  
    185185    void        ApplyPalette( jp2_palette oJP2Palette ); 
    186186    void        ProcessYCbCrTile(kdu_tile tile, GByte *pabyBuffer,  
    187                                  int nBlockXOff, int nBlockYOff ); 
     187                                 int nBlockXOff, int nBlockYOff, 
     188                                 int nTileOffsetX, int nTileOffsetY ); 
    188189    void        ProcessTile(kdu_tile tile, GByte *pabyBuffer ); 
    189190}; 
     
    557558                kdu_coords offset = tile_dims.pos - dims.pos; 
    558559 
    559                 GByte *pabyDest; 
    560  
    561                 pabyDest = ((GByte *)pImage)  
    562                     + (offset.x + offset.y*nBlockXSize) * nWordSize; 
    563  
    564560                try  
    565561                { 
    566562                    if( tile.get_ycc() && nBand < 4 ) 
    567                         ProcessYCbCrTile( tile, pabyDest,  
    568                                           nBlockXOff, nBlockYOff ); 
     563                        ProcessYCbCrTile( tile, (GByte *) pImage, 
     564                                          nBlockXOff, nBlockYOff, 
     565                                          offset.x, offset.y ); 
    569566                    else 
     567                    { 
     568                        GByte *pabyDest; 
     569                         
     570                        pabyDest = ((GByte *)pImage)  
     571                            + (offset.x + offset.y*nBlockXSize) * nWordSize; 
     572 
    570573                        ProcessTile( tile, pabyDest ); 
     574                    } 
    571575                    tile.close(); 
    572576                } 
     
    650654 
    651655void JP2KAKRasterBand::ProcessYCbCrTile( kdu_tile tile, GByte *pabyDest,  
    652                                          int nTileXOff, int nTileYOff ) 
     656                                         int nBlockXOff, int nBlockYOff, 
     657                                         int nTileOffsetX, int nTileOffsetY ) 
    653658 
    654659{ 
     
    715720 
    716721            apoBlocks[iBand] =  
    717                 poBand->GetLockedBlockRef( nTileXOff, nTileYOff, TRUE ); 
     722                poBand->GetLockedBlockRef( nBlockXOff, nBlockYOff, TRUE ); 
    718723            apabyBandDest[iBand] = (GByte *) apoBlocks[iBand]->GetDataRef(); 
    719724        } 
     
    759764 
    760765        for( iBand = 0; iBand < 3; iBand++ ) 
    761             transfer_bytes(apabyBandDest[iBand] + y * nBlockXSize * nWordSize, 
     766            transfer_bytes(apabyBandDest[iBand]  
     767                           + (nTileOffsetX+nTileOffsetY*nBlockXSize)*nWordSize, 
    762768                           line[iBand], nWordSize, bit_depth, eDataType ); 
    763769    }