diff --git a/lib/PlaYUVerFrame.cpp b/lib/PlaYUVerFrame.cpp index 40dc3a2..0135399 100644 --- a/lib/PlaYUVerFrame.cpp +++ b/lib/PlaYUVerFrame.cpp @@ -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( 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() ) diff --git a/lib/PlaYUVerFrame.h b/lib/PlaYUVerFrame.h index d25aa25..4b4ef0a 100644 --- a/lib/PlaYUVerFrame.h +++ b/lib/PlaYUVerFrame.h @@ -31,7 +31,6 @@ #include #include #include "PlaYUVerDefs.h" -#include "PlaYUVerFrameStats.h" class PixFcSSE; namespace cv