Fix bits per pixel in calypTools

This commit is contained in:
2019-02-20 04:41:28 +00:00
parent b5a5bb90f9
commit 00ec0485f4
3 changed files with 7 additions and 6 deletions
+5 -4
View File
@@ -27,6 +27,7 @@
#include <climits> #include <climits>
#include <cstring> #include <cstring>
#include <iostream>
#include "lib/CalypFrame.h" #include "lib/CalypFrame.h"
#include "lib/CalypModuleIf.h" #include "lib/CalypModuleIf.h"
@@ -69,7 +70,7 @@ int CalypTools::openInputs()
ClpString resolutionString( "" ); ClpString resolutionString( "" );
ClpString fmtString( "yuv420p" ); ClpString fmtString( "yuv420p" );
unsigned int uiBitPerPixel = 8; unsigned int uiBitsPerPixel = 8;
unsigned int uiEndianness = 0; unsigned int uiEndianness = 0;
CalypStream* pcStream; CalypStream* pcStream;
@@ -85,7 +86,7 @@ int CalypTools::openInputs()
} }
if( Opts().hasOpt( "bits_pel" ) ) if( Opts().hasOpt( "bits_pel" ) )
{ {
uiBitPerPixel = GET_PARAM( m_uiBitsPerPixel, i ); uiBitsPerPixel = std::stoi( GET_PARAM( m_strBitsPerPixel, i ).c_str() );
} }
if( Opts().hasOpt( "endianness" ) ) if( Opts().hasOpt( "endianness" ) )
{ {
@@ -93,7 +94,7 @@ int CalypTools::openInputs()
{ {
uiEndianness = 0; uiEndianness = 0;
} }
if( GET_PARAM( m_strEndianness, i ) == "little" ) else if( GET_PARAM( m_strEndianness, i ) == "little" )
{ {
uiEndianness = 1; uiEndianness = 1;
} }
@@ -101,7 +102,7 @@ int CalypTools::openInputs()
pcStream = new CalypStream; pcStream = new CalypStream;
try try
{ {
if( !pcStream->open( inputFileNames[i], resolutionString, fmtString, uiBitPerPixel, uiEndianness, 1, true ) ) if( !pcStream->open( inputFileNames[i], resolutionString, fmtString, uiBitsPerPixel, uiEndianness, 1, true ) )
{ {
log( CLP_LOG_ERROR, "Cannot open input stream %s! ", inputFileNames[i].c_str() ); log( CLP_LOG_ERROR, "Cannot open input stream %s! ", inputFileNames[i].c_str() );
return -1; return -1;
+1 -1
View File
@@ -64,7 +64,7 @@ int CalypToolsCmdParser::parseToolsArgs( int argc, char* argv[] )
( "output,o", m_strOutput, "output file" ) /**/ ( "output,o", m_strOutput, "output file" ) /**/
( "size,s", m_strResolution, "size (WxH)" ) /**/ ( "size,s", m_strResolution, "size (WxH)" ) /**/
( "pel_fmt,p", m_strPelFmt, "pixel format" ) /**/ ( "pel_fmt,p", m_strPelFmt, "pixel format" ) /**/
( "bits_pel", m_uiBitsPerPixel, "bits per pixel" ) /**/ ( "bits_pel", m_strBitsPerPixel, "bits per pixel" ) /**/
( "endianness", m_strEndianness, "File endianness (big, little)" ) /**/ ( "endianness", m_strEndianness, "File endianness (big, little)" ) /**/
( "frames,f", m_iFrames, "number of frames to parse" ) /**/ ( "frames,f", m_iFrames, "number of frames to parse" ) /**/
( "quality", m_strQualityMetric, "select a quality metric" ) /**/ ( "quality", m_strQualityMetric, "select a quality metric" ) /**/
+1 -1
View File
@@ -67,7 +67,7 @@ protected:
std::vector<ClpString> m_apcInputs; std::vector<ClpString> m_apcInputs;
std::vector<ClpString> m_strResolution; std::vector<ClpString> m_strResolution;
std::vector<ClpString> m_strPelFmt; std::vector<ClpString> m_strPelFmt;
std::vector<unsigned int> m_uiBitsPerPixel; std::vector<ClpString> m_strBitsPerPixel;
std::vector<ClpString> m_strEndianness; std::vector<ClpString> m_strEndianness;
ClpString m_strOutput; ClpString m_strOutput;
long m_iFrames; long m_iFrames;