xp_comm_proj/rd_dicom/Papyrus3/JpegDir/JpgLless/huffcoptimisebug.c
/*
 *--------------------------------------------------------------
 *
 * FreqCountSelValueSet --
 *
 *      Count the times each category symbol occurs in this
 *	image for each PSV in the psvSet.
 *
 * Results:
 *	None.
 *
 * Side effects:
 *	The freqCountPtrs[i] has counted all category 
 *	symbols appeared in the image, where i is a
 *      element in psvSet.        
 *
 *--------------------------------------------------------------
 */
FreqCountSelValueSet
Count the times each category symbol occurs in this
image for each PSV in the psvSet.

None.

Side effects:
The freqCountPtrs[i] has counted all category
symbols appeared in the image, where i is a
element in psvSet.
FreqCountSelValueSet Count the times each category symbol occurs in this image for each PSV in the psvSet . None . Side effects : The freqCountPtrs [ i ] has counted all category symbols appeared in the image where i is a element in psvSet .
void 
FreqCountSelValueSet(CompressInfo *cPtr)
{
    register short curComp,ci,tblNo ;
    register int col,row;
    register JpegComponentInfo *compptr;
    register int r,i,curCountTblNo;
    int numCOL,numROW,compsInScan;
    int Pr,Pt;
    int predictor;
    MCU *prevRowBuf,*curRowBuf;
    numCOL=cPtr->imageWidth;
    numROW=cPtr->imageHeight;
    compsInScan=cPtr->compsInScan;
    Pr=cPtr->dataPrecision;
    Pt=cPtr->Pt;
    prevRowBuf=NULL;
    curRowBuf=mcuTable;
    for (row=0; row<numROW; row++) {
        for (col=0; col<numCOL; col++) {
            for (curComp = 0; curComp < compsInScan; curComp++) {
                ci = cPtr->MCUmembership[curComp];
                compptr = cPtr->curCompInfo[ci];
                tblNo=compptr->dcTblNo;
                for (i=0;i<numSelValue;i++) {
                    Predict(row,col,curComp,curRowBuf,prevRowBuf,Pr,Pt,
                        psvSet[i],&predictor);
                    r = curRowBuf[col][curComp]-predictor; 
                    curCountTblNo=psvSet[i]-1;
                    CountOneDiff(r,freqCountPtrs[curCountTblNo][tblNo]);
                }
            }
        }
        prevRowBuf=curRowBuf;
        curRowBuf+=numCOL;
    }
}
void FreqCountSelValueSet ( CompressInfo * cPtr ) { register short curComp , ci , tblNo ; register int col , row ; register JpegComponentInfo * compptr ; register int r , i , curCountTblNo ; int numCOL , numROW , compsInScan ; int Pr , Pt ; int predictor ; MCU * prevRowBuf , * curRowBuf ; numCOL = cPtr -> imageWidth ; numROW = cPtr -> imageHeight ; compsInScan = cPtr -> compsInScan ; Pr = cPtr -> dataPrecision ; Pt = cPtr -> Pt ; prevRowBuf = NULL ; curRowBuf = mcuTable ; for ( row = 0 ; row < numROW ; row ++ ) { for ( col = 0 ; col < numCOL ; col ++ ) { for ( curComp = 0 ; curComp < compsInScan ; curComp ++ ) { ci = cPtr -> MCUmembership [ curComp ] ; compptr = cPtr -> curCompInfo [ ci ] ; tblNo = compptr -> dcTblNo ; for ( i = 0 ; i < numSelValue ; i ++ ) { Predict ( row , col , curComp , curRowBuf , prevRowBuf , Pr , Pt , psvSet [ i ] , & predictor ) ; r = curRowBuf [ col ] [ curComp ] - predictor ; curCountTblNo = psvSet [ i ] - 1 ; CountOneDiff ( r , freqCountPtrs [ curCountTblNo ] [ tblNo ] ) ; } } } prevRowBuf = curRowBuf ; curRowBuf += numCOL ; } }
FreqCountSelValueSet
      Count the times each category symbol occurs in this
      image for each PSV in the psvSet.
FreqCountSelValueSet Count the times each category symbol occurs in this image for each PSV in the psvSet .