From 833bd5f1c9a862f3f800856c03ad39091a0c4662 Mon Sep 17 00:00:00 2001 From: Joao Carreira Date: Mon, 6 May 2019 11:24:54 +0100 Subject: [PATCH] Use the same endianess for output as the input --- tools/CalypTools.cpp | 6 +++--- tools/CalypToolsCmdParser.h | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/tools/CalypTools.cpp b/tools/CalypTools.cpp index c1f1162..3fd6111 100644 --- a/tools/CalypTools.cpp +++ b/tools/CalypTools.cpp @@ -120,10 +120,10 @@ int CalypTools::openInputs() } catch( const char* msg ) { - log( CLP_LOG_ERROR, "Cannot open input stream %s with the following error: \n%s\n", inputFileNames[i].c_str(), - msg ); + log( CLP_LOG_ERROR, "Cannot open input stream %s with the following error: \n%s\n", inputFileNames[i].c_str(), msg ); return -1; } + m_uiOutEndianness = uiEndianness; } } @@ -234,7 +234,7 @@ int CalypTools::Open( int argc, char* argv[] ) try { pcOutputStream->open( m_pcOutputFileNames[0], pcInputFrame->getWidth(), pcInputFrame->getHeight(), - pcInputFrame->getPelFormat(), pcInputFrame->getBitsPel(), CLP_LITTLE_ENDIAN, 1, + pcInputFrame->getPelFormat(), pcInputFrame->getBitsPel(), m_uiOutEndianness, 1, false ); log( CLP_LOG_INFO, "Output stream from rate-reduction!\n" ); reportStreamInfo( pcOutputStream ); diff --git a/tools/CalypToolsCmdParser.h b/tools/CalypToolsCmdParser.h index 837ce79..180b3f0 100644 --- a/tools/CalypToolsCmdParser.h +++ b/tools/CalypToolsCmdParser.h @@ -71,6 +71,7 @@ protected: std::vector m_strEndianness; ClpString m_strOutput; long m_iFrames; + unsigned m_uiOutEndianness; int m_iRateReductionFactor; ClpString m_strQualityMetric;