Fix bugs in CalypFrame

This commit is contained in:
jfmcarreira committed 2019-02-20 04:41:07 +00:00
1 parent 2129d05e6e
commit b5a5bb90f9
2 files changed
+18 -2

No files matched your search

+12 -2
View File
@@ -390,7 +390,17 @@ unsigned int CalypFrame::getHeight( int channel ) const
unsigned int CalypFrame::getPixels( int channel ) const
{
return getWidth( channel ) * getWidth( channel );
return getWidth( channel ) * getHeight( channel );
}
unsigned long CalypFrame::getTotalNumberOfPixels() const
{
unsigned long numberPixels = 0;
for( int i = 0; i < getNumberChannels(); i++ )
{
numberPixels += getPixels( i );
}
return numberPixels;
}
unsigned char CalypFrame::getChromaWidthRatio() const
@@ -518,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], getBytesPerFrame() * sizeof( ClpPel ) );
memcpy( *d->m_pppcInputPel[CLP_LUMA], other.getPelBufferYUV()[CLP_LUMA][0], getTotalNumberOfPixels() * sizeof( ClpPel ) );
}
void CalypFrame::copyFrom( const CalypFrame* other )