Test some code

This commit is contained in:
2019-02-21 02:41:16 +00:00
parent c47192f5f3
commit bad10649e3
2 changed files with 15 additions and 7 deletions
+14 -6
View File
@@ -528,7 +528,7 @@ void CalypFrame::copyFrom( const CalypFrame& other )
return;
d->m_bHasRGBPel = false;
d->m_bHasHistogram = false;
memcpy( *d->m_pppcInputPel[CLP_LUMA], other.getPelBufferYUV()[CLP_LUMA][0], getTotalNumberOfPixels() * sizeof( ClpPel ) );
memcpy( &( d->m_pppcInputPel[CLP_LUMA][0][0]), &(other.getPelBufferYUV()[CLP_LUMA][0][0]), getTotalNumberOfPixels() * sizeof( ClpPel ) );
}
void CalypFrame::copyFrom( const CalypFrame* other )
@@ -542,15 +542,23 @@ void CalypFrame::copyFrom( const CalypFrame& other, unsigned int xPos, unsigned
if( !haveSameFmt( other, MATCH_COLOR_SPACE | MATCH_PEL_FMT | MATCH_BITS ) )
return;
// TODO: Protect width and height
ClpPel*** pInput = other.getPelBufferYUV();
ClpPel*** pInput = other.getPelBufferYUV();
// ClpPel* pInput;
// ClpPel* pOutput;
for( unsigned int ch = 0; ch < d->m_pcPelFormat->numberChannels; ch++ )
{
int ratioH = ch > 0 ? d->m_pcPelFormat->log2ChromaWidth : 0;
int ratioW = ch > 0 ? d->m_pcPelFormat->log2ChromaHeight : 0;
for( unsigned int i = 0; i < CHROMASHIFT( d->m_uiHeight, ratioH ); i++ )
{
memcpy( d->m_pppcInputPel[ch][i], &( pInput[ch][( yPos >> ratioH ) + i][( xPos >> ratioW )] ),
memcpy( &(d->m_pppcInputPel[ch][i][0]), &( pInput[ch][( yPos >> ratioH ) + i][( xPos >> ratioW )] ),
( d->m_uiWidth >> ratioW ) * sizeof( ClpPel ) );
// pOutput = d->m_pppcInputPel[ch][i];
// pInput = other.getPelBufferYUV()[ch][( yPos >> ratioH ) + i] + ( xPos >> ratioW );
// for( unsigned int j = 0; j < CHROMASHIFT( d->m_uiWidth, ratioW ); j++ )
// {
// *pOutput++ = *pInput++;
// }
}
}
d->m_bHasRGBPel = false;
@@ -611,7 +619,7 @@ void CalypFrame::frameFromBuffer( ClpByte* Buff, int iEndianness )
int b;
int maxval = pow( 2, d->m_uiBitsPel ) - 1;
if( iEndianness == 0 )
if( iEndianness == CLP_BIG_ENDIAN )
{
startByte = bytesPixel - 1;
endByte = -1;
@@ -669,7 +677,7 @@ void CalypFrame::frameToBuffer( ClpByte* output_buffer, int iEndianness )
int incByte = 1;
int b;
if( iEndianness == 0 )
if( iEndianness == CLP_BIG_ENDIAN )
{
startByte = bytesPixel - 1;
endByte = -1;
@@ -688,7 +696,7 @@ void CalypFrame::frameToBuffer( ClpByte* output_buffer, int iEndianness )
{
ratioW = ch > 0 ? d->m_pcPelFormat->log2ChromaWidth : 0;
ratioH = ch > 0 ? d->m_pcPelFormat->log2ChromaHeight : 0;
step = d->m_pcPelFormat->comp[ch].step_minus1;
step = ( d->m_pcPelFormat->comp[ch].step_minus1 ) * bytesPixel;
pTmpPel = d->m_pppcInputPel[ch][0];
pTmpBuff = ppBuff[d->m_pcPelFormat->comp[ch].plane];
+1 -1
View File
@@ -83,7 +83,7 @@ CalypFrame* ThreeSixtySpatialtoTemporal::process( std::vector<CalypFrame*> apcFr
if( m_iFrameBufferCount == 0 )
{
m_pcTmpFrame->copyFrom( apcFrameList[0] );
m_pcTmpFrame->copyFrom( apcFrameList[0], 0, 0 );
m_uiCopyX = 0;
m_uiCopyY = 0;