Changeset 14739

Show
Ignore:
Timestamp:
06/21/08 00:31:47 (5 months ago)
Author:
warmerdam
Message:

push extra bands of pixel interleaved data into block cache (#2435)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/1.5/gdal/frmts/gtiff/geotiff.cpp

    r14248 r14739  
    557557            } 
    558558            pabyImage += poGDS->nBands * nWordBytes; 
     559        } 
     560    } 
     561 
     562/* -------------------------------------------------------------------- */ 
     563/*      In the fairly common case of pixel interleaved 8bit data        */ 
     564/*      that is multi-band, lets push the rest of the data into the     */ 
     565/*      block cache too, to avoid (hopefully) having to redecode it.    */ 
     566/*                                                                      */ 
     567/*      Our following logic actually depends on the fact that the       */ 
     568/*      this block is already loaded, so subsequent calls will end      */ 
     569/*      up back in this method and pull from the loaded block.          */ 
     570/* -------------------------------------------------------------------- */ 
     571    if( poGDS->nBitsPerSample == 8 && poGDS->nBands != 1  
     572        && eErr == CE_None ) 
     573    { 
     574        int iOtherBand; 
     575 
     576        for( iOtherBand = 1; iOtherBand <= poGDS->nBands; iOtherBand++ ) 
     577        { 
     578            if( iOtherBand == nBand ) 
     579                continue; 
     580 
     581            GDALRasterBlock *poBlock; 
     582 
     583            poBlock = poGDS->GetRasterBand(iOtherBand)-> 
     584                GetLockedBlockRef(nBlockXOff,nBlockYOff); 
     585            poBlock->DropLock(); 
    559586        } 
    560587    }