Avoid using fillRGBBuffer when no necessary

This commit is contained in:
jfmcarreira committed 2015-02-26 15:26:18 +00:00
1 parent 85cfa467b9
commit c3a82f758b
6 files changed
+55 -16

No files matched your search

-2
View File
@@ -467,7 +467,6 @@ Void VideoHandle::stop()
}
}
emit changed();
//update();
m_arrayActions[VIDEO_LOCK_ACT]->setVisible( false );
}
@@ -496,7 +495,6 @@ Void VideoHandle::playEvent()
m_pcCurrentVideoSubWindow->close();
}
emit changed();
//update();
}
Void VideoHandle::seekEvent( Int direction )
+1
View File
@@ -459,6 +459,7 @@ Bool VideoSubWindow::playEvent()
return true;
}
m_pCurrStream->readFrame();
m_pCurrStream->getNextFrame()->fillRGBBuffer();
}
return false;
}
+1 -1
View File
@@ -163,7 +163,7 @@ Void PlaYUVerFrame::frameFromBuffer( Pel *Buff, UInt64 uiBuffSize )
m_pcPelFormat->frameFromBuffer( Buff, m_pppcInputPel, m_uiWidth, m_uiHeight );
m_bHasRGBPel = false;
m_bHasHistogram = false;
fillRGBBuffer();
//fillRGBBuffer();
}
Void PlaYUVerFrame::frameToBuffer( Pel *output_buffer )
+43 -11
View File
@@ -37,7 +37,7 @@ class PixFcSSE;
namespace plaYUVer
{
class PlaYUVerFrame : public PlaYUVerFrameStats
class PlaYUVerFrame: public PlaYUVerFrameStats
{
public:
class Pixel
@@ -60,14 +60,38 @@ public:
PixelComponents[1] = c1;
PixelComponents[2] = c2;
}
Int ColorSpace() { return m_iColorSpace; }
Pel* Components() { return PixelComponents; }
Pel& Y() { return PixelComponents[0]; }
Pel& Cb() { return PixelComponents[1]; }
Pel& Cr() { return PixelComponents[2]; }
Pel& R() { return PixelComponents[0]; }
Pel& G() { return PixelComponents[1]; }
Pel& B() { return PixelComponents[2]; }
Int ColorSpace()
{
return m_iColorSpace;
}
Pel* Components()
{
return PixelComponents;
}
Pel& Y()
{
return PixelComponents[0];
}
Pel& Cb()
{
return PixelComponents[1];
}
Pel& Cr()
{
return PixelComponents[2];
}
Pel& R()
{
return PixelComponents[0];
}
Pel& G()
{
return PixelComponents[1];
}
Pel& B()
{
return PixelComponents[2];
}
};
enum ColorSpace
@@ -161,8 +185,16 @@ public:
m_bHasRGBPel = false;
return m_pppcInputPel;
}
UChar* getRGBBuffer() const
// UChar* getRGBBuffer() const
// {
// return m_pcRGB32;
// }
UChar* getRGBBuffer()
{
if( !m_bHasRGBPel )
{
fillRGBBuffer();
}
return m_pcRGB32;
}
@@ -185,7 +217,7 @@ public:
NUMBER_METRICS,
};
static std::vector<std::string> supportedQualityMetricsList()
static std::vector<std::string> supportedQualityMetricsList()
{
std::vector<std::string> metrics;
metrics.push_back( "PSNR" );
+7 -1
View File
@@ -514,7 +514,7 @@ Void PlaYUVerStream::readFrame()
}
m_pcNextFrame->frameFromBuffer( m_pStreamBuffer, bytes_read );
}
m_pcNextFrame->fillRGBBuffer();
//m_pcNextFrame->fillRGBBuffer();
return;
}
@@ -639,6 +639,12 @@ PlaYUVerFrame* PlaYUVerStream::getCurrFrame()
return m_pcCurrFrame;
}
PlaYUVerFrame* PlaYUVerStream::getNextFrame()
{
return m_pcNextFrame;
}
Bool PlaYUVerStream::seekInput( UInt64 new_frame_num )
{
if( !m_bInit || new_frame_num < 0 || new_frame_num >= m_uiTotalFrameNum || ( Int64 )new_frame_num == m_iCurrFrameNum )
+3 -1
View File
@@ -134,8 +134,10 @@ public:
static Bool saveFrame( const std::string& filename, PlaYUVerFrame *saveFrame );
Void setNextFrame();
PlaYUVerFrame* getCurrFrame();
PlaYUVerFrame* getCurrFrame( PlaYUVerFrame * );
PlaYUVerFrame* getCurrFrame();
PlaYUVerFrame* getNextFrame();
Bool seekInput( UInt64 new_frame_num );