Fix m_bHasHistogram flag

This commit is contained in:
2015-01-12 01:01:14 +00:00
parent 7f45d3c858
commit 9202d2e993
2 changed files with 8 additions and 2 deletions
+5 -1
View File
@@ -161,6 +161,7 @@ Void PlaYUVerFrame::frameFromBuffer( Pel *Buff, UInt64 uiBuffSize )
return;
m_pcPelFormat->frameFromBuffer( Buff, m_pppcInputPel, m_uiWidth, m_uiHeight );
m_bHasRGBPel = false;
m_bHasHistogram = false;
fillRGBBuffer();
}
@@ -182,6 +183,7 @@ Void PlaYUVerFrame::copyFrom( PlaYUVerFrame* input_frame )
if( m_iPixelFormat != input_frame->getPelFormat() && m_uiWidth == input_frame->getWidth() && m_uiHeight == input_frame->getHeight() )
return;
m_bHasRGBPel = false;
m_bHasHistogram = false;
memcpy( *m_pppcInputPel[LUMA], input_frame->getPelBufferYUV()[LUMA][0], getBytesPerFrame() * sizeof(Pel) );
}
@@ -210,7 +212,6 @@ Void PlaYUVerFrame::copyFrom( PlaYUVerFrame* input_frame, UInt xPos, UInt yPos )
{
if( m_iPixelFormat != input_frame->getPelFormat() )
return;
m_bHasRGBPel = false;
Pel ***pInput = input_frame->getPelBufferYUV();
for( UInt ch = 0; ch < m_pcPelFormat->numberChannels; ch++ )
{
@@ -221,6 +222,8 @@ Void PlaYUVerFrame::copyFrom( PlaYUVerFrame* input_frame, UInt xPos, UInt yPos )
memcpy( m_pppcInputPel[ch][i], &( pInput[ch][yPos / ratioH + i][xPos / ratioW] ), m_uiWidth / ratioW * sizeof(Pel) );
}
}
m_bHasRGBPel = false;
m_bHasHistogram = false;
}
PlaYUVerFrame::Pixel PlaYUVerFrame::getPixelValue( Int xPos, Int yPos, Int eColorSpace )
@@ -376,6 +379,7 @@ Void PlaYUVerFrame::fromCvMat( Void* voidFrame )
}
m_bHasRGBPel = false;
m_bHasHistogram = false;
if( m_iPixelFormat != GRAY )
{
+3 -1
View File
@@ -73,7 +73,9 @@ Void PlaYUVerFrameStats::xSetupStatistics( const PlaYUVerFrame *pcFrame, UInt op
Void PlaYUVerFrameStats::calcHistogram()
{
m_bRunningFlag = true;
m_bHasHistogram = false;
//m_bHasHistogram = false;
if( m_bHasHistogram )
return;
getMem1D<Double>( &( m_pdHistogram ), m_uiHistoSegments * histoChannels );
if( !m_pdHistogram )