Merge branch 'master' into devel

This commit is contained in:
jfmcarreira committed 2017-09-15 18:26:35 +01:00
commit 69a1e2f03e
30 files changed
+170 -217

No files matched your search

+3 -3
View File
@@ -104,7 +104,7 @@ Int getMem2D( T*** array2D, Int dim0, Int dim1 )
template <typename T>
Int getMem3D( T**** array3D, Int dim0, Int dim1, Int dim2 )
{
Int i, mem_size = dim0 * sizeof( T ** );
Int i, mem_size = dim0 * sizeof( T** );
if( ( ( *array3D ) = (T***)xMallocMem( dim0 * sizeof( T** ) ) ) == NULL )
printf( "get_mem3Dint: array3D" );
@@ -120,7 +120,7 @@ Int getMem3D( T**** array3D, Int dim0, Int dim1, Int dim2 )
template <typename T>
Int getMem4D( T***** array4D, Int dim0, Int dim1, Int dim2, Int dim3 )
{
int i, mem_size = dim0 * sizeof( int *** );
int i, mem_size = dim0 * sizeof( int*** );
if( ( ( *array4D ) = (T****)xMallocMem( dim0 * sizeof( T*** ) ) ) == NULL )
printf( "get_mem4Dint: array4D" );
@@ -136,7 +136,7 @@ Int getMem4D( T***** array4D, Int dim0, Int dim1, Int dim2, Int dim3 )
template <typename T>
Int getMem5D( T****** array5D, Int dim0, Int dim1, Int dim2, Int dim3, Int dim4 )
{
int i, mem_size = dim0 * sizeof( T **** );
int i, mem_size = dim0 * sizeof( T**** );
if( ( ( *array5D ) = (T*****)xMallocMem( dim0 * sizeof( T**** ) ) ) == NULL )
printf( "get_mem5Dint: array5D" );
+14 -14
View File
@@ -40,7 +40,9 @@
std::vector<String> PlaYUVerFrame::supportedColorSpacesListNames()
{
return std::vector<String>{
"YUV", "RGB", "GRAY",
"YUV",
"RGB",
"GRAY",
};
}
@@ -84,9 +86,8 @@ static Int getImgMemory( Pel**** array3D,
Int dim0 = 3;
Int i;
UInt64 total_mem_size = 0;
UInt64 mem_size =
( dim1 * dim2 +
CHROMASHIFT( dim1, log2ChromaHeight ) * CHROMASHIFT( dim2, log2ChromaWidth ) * 2 );
UInt64 mem_size = ( dim1 * dim2 + CHROMASHIFT( dim1, log2ChromaHeight ) *
CHROMASHIFT( dim2, log2ChromaWidth ) * 2 );
total_mem_size += getMem2D<Pel*>( array3D, dim0, dim1 );
@@ -598,9 +599,8 @@ Void PlaYUVerFrame::frameFromBuffer( Byte* Buff, Int iEndianness )
{
ratioW = i > 1 ? d->m_pcPelFormat->log2ChromaWidth : 0;
ratioH = i > 1 ? d->m_pcPelFormat->log2ChromaHeight : 0;
ppBuff[i] =
ppBuff[i - 1] +
CHROMASHIFT( d->m_uiHeight, ratioH ) * CHROMASHIFT( d->m_uiWidth, ratioW ) * bytesPixel;
ppBuff[i] = ppBuff[i - 1] + CHROMASHIFT( d->m_uiHeight, ratioH ) *
CHROMASHIFT( d->m_uiWidth, ratioW ) * bytesPixel;
}
for( ch = 0; ch < d->m_pcPelFormat->numberChannels; ch++ )
@@ -660,9 +660,8 @@ Void PlaYUVerFrame::frameToBuffer( Byte* output_buffer, Int iEndianness )
{
ratioW = i > 1 ? d->m_pcPelFormat->log2ChromaWidth : 0;
ratioH = i > 1 ? d->m_pcPelFormat->log2ChromaHeight : 0;
ppBuff[i] =
ppBuff[i - 1] +
CHROMASHIFT( d->m_uiHeight, ratioH ) * CHROMASHIFT( d->m_uiWidth, ratioW ) * bytesPixel;
ppBuff[i] = ppBuff[i - 1] + CHROMASHIFT( d->m_uiHeight, ratioH ) *
CHROMASHIFT( d->m_uiWidth, ratioW ) * bytesPixel;
}
for( ch = 0; ch < d->m_pcPelFormat->numberChannels; ch++ )
@@ -1183,9 +1182,8 @@ Bool PlaYUVerFrame::toMat( cv::Mat& cvMat, Bool convertToGray )
{
Bool bRet = false;
#ifdef USE_OPENCV
if( convertToGray &&
!( d->m_pcPelFormat->colorSpace == PlaYUVerPixel::COLOR_YUV ||
d->m_pcPelFormat->colorSpace == PlaYUVerPixel::COLOR_GRAY ) )
if( convertToGray && !( d->m_pcPelFormat->colorSpace == PlaYUVerPixel::COLOR_YUV ||
d->m_pcPelFormat->colorSpace == PlaYUVerPixel::COLOR_GRAY ) )
{
return bRet;
}
@@ -1285,7 +1283,9 @@ Bool PlaYUVerFrame::fromMat( cv::Mat& cvMat )
std::vector<String> PlaYUVerFrame::supportedQualityMetricsList()
{
return std::vector<String>{
"PSNR", "MSE", "SSIM",
"PSNR",
"MSE",
"SSIM",
};
}
+1 -3
View File
@@ -54,9 +54,7 @@ PlaYUVerPixel::PlaYUVerPixel( const Int& ColorSpace, const Pel& c0, const Pel& c
PixelComponents[3] = 0;
}
PlaYUVerPixel::~PlaYUVerPixel()
{
}
PlaYUVerPixel::~PlaYUVerPixel() {}
Int PlaYUVerPixel::ColorSpaceType()
{
+1
View File
@@ -68,6 +68,7 @@ class PlaYUVerStreamHandlerIf
Void setBytesPerFrame( UInt64 uiNBytes ) { m_uiNBytesPerFrame = uiNBytes; }
String getFormatName() { return m_strFormatName; }
String getCodecName() { return m_strCodecName; }
protected:
Bool m_bIsInput;
String m_cFilename;
+3 -3
View File
@@ -119,7 +119,7 @@ Bool StreamHandlerLibav::openHandler( String strFilename, Bool bInput )
m_cStream = m_cFmtCtx->streams[m_iStreamIdx];
/* find decoder for the stream */
/* find decoder for the stream */
#ifdef FF_USER_CODEC_PARAM
AVCodecParameters* codec_param = m_cStream->codecpar;
@@ -234,9 +234,9 @@ Bool StreamHandlerLibav::openHandler( String strFilename, Bool bInput )
}
#if( ( LIBAVCODEC_VERSION_MAJOR >= 56 ) && ( LIBAVCODEC_VERSION_MINOR >= 0 ) )
m_cFrame = av_frame_alloc();
m_cFrame = av_frame_alloc();
#else
m_cFrame = avcodec_alloc_frame();
m_cFrame = avcodec_alloc_frame();
#endif
if( !m_cFrame )
{