コード例 #1
0
ファイル: misc_common.c プロジェクト: kazutomi/xiphqt
/****************************************************************************
 * 
 *  ROUTINE       :     CopyBackExtraFrags
 *
 *  INPUTS        :     None
 *
 *  OUTPUTS       :     None.
 *
 *  RETURNS       :     None .
 *
 *  FUNCTION      :     Copies the pixel data from any extra fragments
 *                      selected for update as part of the quality refresh process
 *                      from the source buffer into the conv. buffer.
 *
 *  SPECIAL NOTES :     None. 
 *
 *
 *  ERRORS        :     None.
 *
 ****************************************************************************/
void CopyBackExtraFrags(CP_INSTANCE *cpi)
{
	UINT32  i,j;
    UINT8 * SrcPtr;
    UINT8 * DestPtr;
    UINT32  PlaneLineStep;   
	UINT32  PixelIndex;
    
	// Copy back for Y plane.
    PlaneLineStep = cpi->pb.Configuration.VideoFrameWidth;
    for ( i = 0; i < cpi->pb.YPlaneFragments; i++ )
    {
        /* We are only interested in updated fragments. */
        if ( cpi->extra_fragments[i] )
        {
            /* Get the start index for the fragment. */
			PixelIndex = GetFragIndex(cpi->pb.pixel_index_table, i);
            SrcPtr = &cpi->yuv1ptr[PixelIndex];
            DestPtr = &cpi->ConvDestBuffer[PixelIndex];

            for ( j = 0; j < cpi->pb.Configuration.VFragPixels; j++ )
            {
                memcpy( DestPtr, SrcPtr, cpi->pb.Configuration.HFragPixels );

                SrcPtr += PlaneLineStep;
                DestPtr += PlaneLineStep;
            }
        }
    }


	// Now the U and V planes
    PlaneLineStep = cpi->pb.Configuration.VideoFrameWidth / 2;
    for ( i = cpi->pb.YPlaneFragments; i < (cpi->pb.YPlaneFragments + (2 * cpi->pb.UVPlaneFragments)) ; i++ )
    {
        /* We are only interested in updated fragments. */
        if ( cpi->extra_fragments[i] )
        {
            /* Get the start index for the fragment. */
			PixelIndex = GetFragIndex(cpi->pb.pixel_index_table, i);
            SrcPtr = &cpi->yuv1ptr[PixelIndex];
            DestPtr = &cpi->ConvDestBuffer[PixelIndex];

            for ( j = 0; j < cpi->pb.Configuration.VFragPixels; j++ )
            {
                memcpy( DestPtr, SrcPtr, cpi->pb.Configuration.HFragPixels );
                SrcPtr += PlaneLineStep;
                DestPtr += PlaneLineStep;
            }

        }
    }

}
コード例 #2
0
char *TlkFile::GetDataPtr(int tlkind)
{
    long blockind = GetFragIndex(tlkind);
    ShiAssert(blockind > 0);
    struct TlkBlock *tblock;
    tblock = (struct TlkBlock *) GetData(blockind, sizeof *tblock);
    ShiAssert(tblock != NULL);
    if (tblock == NULL) return 0;
    return tblock->data;
}
コード例 #3
0
unsigned long TlkFile::GetCompressedLength(int tlkind)
{
    long blockind = GetFragIndex(tlkind);
    ShiAssert(blockind > 0);
    struct TlkBlock *tblock;
    tblock = (struct TlkBlock *) GetData(blockind, sizeof *tblock);
    ShiAssert(tblock != NULL);
    if (tblock == NULL) return 0;
    return tblock->compressedlen;
}