Fix minor errors with the histogram data

This commit is contained in:
jfmcarreira committed 2015-08-01 20:15:16 +01:00
1 parent ffc7d8541e
commit d9b3fe0db0
2 files changed
+11 -5

No files matched your search

+11 -4
View File
@@ -136,6 +136,13 @@ PlaYUVerFrame::PlaYUVerFrame( PlaYUVerFrame *other, UInt posX, UInt posY, UInt a
PlaYUVerFrame::~PlaYUVerFrame()
{
if( m_puiHistogram )
{
freeMem1D( m_puiHistogram );
}
m_puiHistogram = NULL;
m_bHasHistogram = false;
if( m_pppcInputPel )
freeMem3ImageComponents<Pel>( m_pppcInputPel );
m_pppcInputPel = NULL;
@@ -209,6 +216,9 @@ Void PlaYUVerFrame::init( UInt width, UInt height, Int pel_format, Int bitsPixel
}
getMem1D( &m_pcARGB32, m_uiHeight * m_uiWidth * 4 );
m_puiHistogram = NULL;
m_bHasHistogram = false;
m_uiHistoSegments = 1 << m_iBitsPel;
if( m_pcPelFormat->colorSpace == PlaYUVerFrame::COLOR_RGB || m_pcPelFormat->colorSpace == PlaYUVerFrame::COLOR_ARGB )
@@ -492,7 +502,7 @@ Void PlaYUVerFrame::calcHistogram()
data[COLOR_G] = m_pppcInputPel[COLOR_G][0];
data[COLOR_B] = m_pppcInputPel[COLOR_B][0];
for( i = 0; ( i < m_uiHeight * m_uiWidth ) && m_bRunningFlag; i++ )
for( i = 0; ( i < m_uiHeight * m_uiWidth ) && m_bRunningFlag; i++ )
{
for( j = 0; j < numberChannels; j++ )
{
@@ -608,8 +618,6 @@ Double PlaYUVerFrame::getCount( Int channel, UInt start, UInt end )
return count;
}
Double PlaYUVerFrame::getMean( Int channel, UInt start, UInt end )
{
Int indexStart;
@@ -779,7 +787,6 @@ Double PlaYUVerFrame::getMaximum( Int channel )
return max;
}
Void PlaYUVerFrame::copyFrom( PlaYUVerFrame* input_frame )
{
if( m_iPixelFormat != input_frame->getPelFormat() && m_uiWidth == input_frame->getWidth() && m_uiHeight == input_frame->getHeight() )