xp_comm_proj/rd_dicom/Papyrus3/JpegDir/JpgLless/huffdoptimise.c
/*
 *--------------------------------------------------------------
 *
 * DecodeFirstRow --
 *
 *	Decode the first raster line of samples at the start of 
 *      the scan and at the beginning of each restart interval.
 *	This includes modifying the component value so the real
 *      value, not the difference is returned.
 *
 * Results:
 *	None.
 *
 * Side effects:
 *	Bitstream is parsed.
 *
 *--------------------------------------------------------------
 */
DecodeFirstRow
Decode the first raster line of samples at the start of
the scan and at the beginning of each restart interval.
This includes modifying the component value so the real
value, not the difference is returned.

None.

Side effects:
Bitstream is parsed.
DecodeFirstRow Decode the first raster line of samples at the start of the scan and at the beginning of each restart interval . This includes modifying the component value so the real value not the difference is returned . None . Side effects : Bitstream is parsed .
void DecodeFirstRow (DecompressInfo *dcPtr, MCU *curRowBuf)
{
    register short curComp,ci;
    register int s,col,compsInScan,numCOL;
    register JpegComponentInfo *compptr;
    int Pr,Pt,d;
    HuffmanTable *dctbl;
    Pr=dcPtr->dataPrecision;
    Pt=dcPtr->Pt;
    compsInScan=dcPtr->compsInScan;
    numCOL=dcPtr->imageWidth;
    for (curComp = 0; curComp < compsInScan; curComp++) {
        ci = dcPtr->MCUmembership[curComp];
        compptr = dcPtr->curCompInfo[ci];
        dctbl = dcPtr->dcHuffTblPtrs[compptr->dcTblNo];
        HuffDecode (dctbl,s);
        if (s && s!=MAGCAT16_NUMBITS_MARKER) {
           get_bits(s,d);
           HuffExtend(d,s);
        } else if ( s==MAGCAT16_NUMBITS_MARKER ) {
           d = 32768;
        } else d = 0;
        curRowBuf[0][curComp]=d+(1<<(Pr-Pt-1));
    }
    for (col=1; col<numCOL; col++) {
        for (curComp = 0; curComp < compsInScan; curComp++) {
            ci = dcPtr->MCUmembership[curComp];
            compptr = dcPtr->curCompInfo[ci];
            dctbl = dcPtr->dcHuffTblPtrs[compptr->dcTblNo];
            HuffDecode (dctbl,s);
            if (s && s!=MAGCAT16_NUMBITS_MARKER) {
               get_bits(s,d);
               HuffExtend(d,s);
            } else if ( s==MAGCAT16_NUMBITS_MARKER ) {
               d = 32768;
            } else d = 0;
            curRowBuf[col][curComp]=d+curRowBuf[col-1][curComp];
        }
    }
    if (dcPtr->restartInRows) {
       (dcPtr->restartRowsToGo)--;
    }
}
void DecodeFirstRow ( DecompressInfo * dcPtr , MCU * curRowBuf ) { register short curComp , ci ; register int s , col , compsInScan , numCOL ; register JpegComponentInfo * compptr ; int Pr , Pt , d ; HuffmanTable * dctbl ; Pr = dcPtr -> dataPrecision ; Pt = dcPtr -> Pt ; compsInScan = dcPtr -> compsInScan ; numCOL = dcPtr -> imageWidth ; for ( curComp = 0 ; curComp < compsInScan ; curComp ++ ) { ci = dcPtr -> MCUmembership [ curComp ] ; compptr = dcPtr -> curCompInfo [ ci ] ; dctbl = dcPtr -> dcHuffTblPtrs [ compptr -> dcTblNo ] ; HuffDecode ( dctbl , s ) ; if ( s && s != MAGCAT16_NUMBITS_MARKER ) { get_bits ( s , d ) ; HuffExtend ( d , s ) ; } else if ( s == MAGCAT16_NUMBITS_MARKER ) { d = 32768 ; } else d = 0 ; curRowBuf [ 0 ] [ curComp ] = d + ( 1 << ( Pr - Pt - 1 ) ) ; } for ( col = 1 ; col < numCOL ; col ++ ) { for ( curComp = 0 ; curComp < compsInScan ; curComp ++ ) { ci = dcPtr -> MCUmembership [ curComp ] ; compptr = dcPtr -> curCompInfo [ ci ] ; dctbl = dcPtr -> dcHuffTblPtrs [ compptr -> dcTblNo ] ; HuffDecode ( dctbl , s ) ; if ( s && s != MAGCAT16_NUMBITS_MARKER ) { get_bits ( s , d ) ; HuffExtend ( d , s ) ; } else if ( s == MAGCAT16_NUMBITS_MARKER ) { d = 32768 ; } else d = 0 ; curRowBuf [ col ] [ curComp ] = d + curRowBuf [ col - 1 ] [ curComp ] ; } } if ( dcPtr -> restartInRows ) { ( dcPtr -> restartRowsToGo ) -- ; } }
DecodeFirstRow
      Decode the first raster line of samples at the start of
      the scan and at the beginning of each restart interval.
DecodeFirstRow Decode the first raster line of samples at the start of the scan and at the beginning of each restart interval .
/*
     * the start of the scan or at the beginning of restart interval.
     */ /*
         * Section F.2.2.1: decode the difference
         */ /* 
         * Add the predictor to the difference.
         */ /*
     * the rest of the first row
     */ /*
             * Section F.2.2.1: decode the difference
             */ /* 
             * Add the predictor to the difference.
             */