Fixed indentation and added the description of how to supply argument with specification of a name for the ouputfile where the contentMetrics etc. are logged.

Added description for argument to specify filename for output file where feature vectors are stored.

Fixed indentation

BUG=

Review URL: https://webrtc-codereview.appspot.com/966019

git-svn-id: http://webrtc.googlecode.com/svn/trunk@3096 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
brykt@google.com
2012-11-14 14:46:52 +00:00
parent a36d75a03c
commit 71fd288b95
2 changed files with 45 additions and 44 deletions

View File

@@ -145,21 +145,21 @@ QualityModesTest::Print()
( _log) << "PSNR: " << psnr.average << std::endl; ( _log) << "PSNR: " << psnr.average << std::endl;
if (_flagSSIM == 1) if (_flagSSIM == 1)
{ {
printf("***computing SSIM***\n"); printf("***computing SSIM***\n");
I420SSIMFromFiles(_inname.c_str(), _outname.c_str(), _nativeWidth, I420SSIMFromFiles(_inname.c_str(), _outname.c_str(), _nativeWidth,
_nativeHeight, &ssim); _nativeHeight, &ssim);
printf("SSIM: %f \n", ssim.average); printf("SSIM: %f \n", ssim.average);
} }
(_log) << std::endl; (_log) << std::endl;
printf("\nVCM Quality Modes Test: \n\n%i tests completed\n", vcmMacrosTests); printf("\nVCM Quality Modes Test: \n\n%i tests completed\n", vcmMacrosTests);
if (vcmMacrosErrors > 0) if (vcmMacrosErrors > 0)
{ {
printf("%i FAILED\n\n", vcmMacrosErrors); printf("%i FAILED\n\n", vcmMacrosErrors);
} }
else else
{ {
printf("ALL PASSED\n\n"); printf("ALL PASSED\n\n");
} }
} }
void void
@@ -278,14 +278,14 @@ QualityModesTest::Perform(const CmdArgs& args)
ret = _vpm->PreprocessFrame(sourceFrame, &decimatedFrame); ret = _vpm->PreprocessFrame(sourceFrame, &decimatedFrame);
if (ret == 1) if (ret == 1)
{ {
printf("VD: frame drop %d \n",_frameCnt); printf("VD: frame drop %d \n",_frameCnt);
_numFramesDroppedVPM += 1; _numFramesDroppedVPM += 1;
continue; // frame drop continue; // frame drop
} }
else if (ret < 0) else if (ret < 0)
{ {
printf("Error in PreprocessFrame: %d\n", ret); printf("Error in PreprocessFrame: %d\n", ret);
//exit(1); //exit(1);
} }
// Frame was not re-sampled => use original. // Frame was not re-sampled => use original.
if (decimatedFrame == NULL) if (decimatedFrame == NULL)
@@ -295,7 +295,7 @@ QualityModesTest::Perform(const CmdArgs& args)
contentMetrics = _vpm->ContentMetrics(); contentMetrics = _vpm->ContentMetrics();
if (contentMetrics == NULL) if (contentMetrics == NULL)
{ {
printf("error: contentMetrics = NULL\n"); printf("error: contentMetrics = NULL\n");
} }
// counting only encoding time // counting only encoding time
@@ -309,8 +309,8 @@ QualityModesTest::Perform(const CmdArgs& args)
if (ret < 0) if (ret < 0)
{ {
printf("Error in AddFrame: %d\n", ret); printf("Error in AddFrame: %d\n", ret);
//exit(1); //exit(1);
} }
// Same timestamp value for encode and decode // Same timestamp value for encode and decode
@@ -323,30 +323,30 @@ QualityModesTest::Perform(const CmdArgs& args)
if (ret < 0) if (ret < 0)
{ {
printf("Error in Decode: %d\n", ret); printf("Error in Decode: %d\n", ret);
//exit(1); //exit(1);
} }
if (_vcm->TimeUntilNextProcess() <= 0) if (_vcm->TimeUntilNextProcess() <= 0)
{ {
_vcm->Process(); _vcm->Process();
} }
// mimicking setTargetRates - update every 1 sec // mimicking setTargetRates - update every 1 sec
// this will trigger QMSelect // this will trigger QMSelect
if (_frameCnt%((int)_frameRate) == 0) if (_frameCnt%((int)_frameRate) == 0)
{ {
_vcm->SetChannelParameters((WebRtc_UWord32)_bitRate, 0, 1); _vcm->SetChannelParameters((WebRtc_UWord32)_bitRate, 0, 1);
} }
// check for bit rate update // check for bit rate update
if (change < numChanges && _frameCnt == updateFrameNum[change]) if (change < numChanges && _frameCnt == updateFrameNum[change])
{ {
_bitRate = bitRateUpdate[change]; _bitRate = bitRateUpdate[change];
_frameRate = frameRateUpdate[change]; _frameRate = frameRateUpdate[change];
codec.startBitrate = (int)_bitRate; codec.startBitrate = (int)_bitRate;
codec.maxFramerate = (WebRtc_UWord8) _frameRate; codec.maxFramerate = (WebRtc_UWord8) _frameRate;
// Will also set and init the desired codec // Will also set and init the desired codec
TEST(_vcm->RegisterSendCodec(&codec, 2, 1440) == VCM_OK); TEST(_vcm->RegisterSendCodec(&codec, 2, 1440) == VCM_OK);
change++; change++;
} }
DataLog::InsertCell(feature_table_name_, "motion magnitude", DataLog::InsertCell(feature_table_name_, "motion magnitude",
@@ -413,8 +413,8 @@ QMTestVideoSettingsCallback::Updated()
{ {
if (_updated) if (_updated)
{ {
_updated = false; _updated = false;
return true; return true;
} }
return false; return false;
} }
@@ -430,17 +430,17 @@ QMTestVideoSettingsCallback::SetVideoQMSettings(const WebRtc_UWord32 frameRate,
//Initialize codec with new values - is this the best place to do it? //Initialize codec with new values - is this the best place to do it?
if (!retVal) if (!retVal)
{ {
// first get current settings // first get current settings
VideoCodec currentCodec; VideoCodec currentCodec;
_vcm->SendCodec(&currentCodec); _vcm->SendCodec(&currentCodec);
// now set new values: // now set new values:
currentCodec.height = (WebRtc_UWord16)height; currentCodec.height = (WebRtc_UWord16)height;
currentCodec.width = (WebRtc_UWord16)width; currentCodec.width = (WebRtc_UWord16)width;
currentCodec.maxFramerate = (WebRtc_UWord8)frameRate; currentCodec.maxFramerate = (WebRtc_UWord8)frameRate;
// re-register encoder // re-register encoder
retVal = _vcm->RegisterSendCodec(&currentCodec, 2, 1440); retVal = _vcm->RegisterSendCodec(&currentCodec, 2, 1440);
_updated = true; _updated = true;
} }
return retVal; return retVal;
@@ -475,8 +475,8 @@ VCMQMDecodeCompleCallback::~VCMQMDecodeCompleCallback()
// } // }
if (_decBuffer != NULL) if (_decBuffer != NULL)
{ {
delete [] _decBuffer; delete [] _decBuffer;
_decBuffer = NULL; _decBuffer = NULL;
} }
} }
@@ -517,8 +517,8 @@ VCMQMDecodeCompleCallback::FrameToRender(I420VideoFrame& videoFrame)
// no need for interpolator and decBuffer // no need for interpolator and decBuffer
if (_decBuffer != NULL) if (_decBuffer != NULL)
{ {
delete [] _decBuffer; delete [] _decBuffer;
_decBuffer = NULL; _decBuffer = NULL;
} }
_decWidth = 0; _decWidth = 0;
_decHeight = 0; _decHeight = 0;
@@ -552,12 +552,12 @@ WebRtc_Word32 VCMQMDecodeCompleCallback::buildInterpolator()
WebRtc_UWord32 decFrameLength = _origWidth*_origHeight*3 >> 1; WebRtc_UWord32 decFrameLength = _origWidth*_origHeight*3 >> 1;
if (_decBuffer != NULL) if (_decBuffer != NULL)
{ {
delete [] _decBuffer; delete [] _decBuffer;
} }
_decBuffer = new WebRtc_UWord8[decFrameLength]; _decBuffer = new WebRtc_UWord8[decFrameLength];
if (_decBuffer == NULL) if (_decBuffer == NULL)
{ {
return -1; return -1;
} }
return 0; return 0;
} }

View File

@@ -160,7 +160,8 @@ int main(int argc, char **argv)
printf("Unable to parse input arguments\n"); printf("Unable to parse input arguments\n");
printf("args: -n <test #> -w <width> -h <height> -f <fps> -b <bps> " printf("args: -n <test #> -w <width> -h <height> -f <fps> -b <bps> "
"-c <codec> -i <input file> -o <output file> -p <packet loss> " "-c <codec> -i <input file> -o <output file> -p <packet loss> "
"-r <round-trip-time> -e <cama enable> -m <protection mode> \n"); "-r <round-trip-time> -e <cama enable> -m <protection mode> "
"-v <feature vector output file>\n");
return -1; return -1;
} }