Remove warnings in vp8_test
Most modifications are either reordering of the initializers in constructors, removed unused variables, or comparison mismatches taken care of. A few other special cases are commented. Review URL: http://webrtc-codereview.appspot.com/132008 git-svn-id: http://webrtc.googlecode.com/svn/trunk@518 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
parent
ef04cf4b2e
commit
2641fd1d19
@ -28,25 +28,25 @@ using namespace webrtc;
|
||||
|
||||
Benchmark::Benchmark()
|
||||
:
|
||||
NormalAsyncTest("Benchmark", "Codec benchmark over a range of test cases", 6),
|
||||
_resultsFileName("../../../../testFiles/benchmark.txt"),
|
||||
_codecName("Default"),
|
||||
NormalAsyncTest("Benchmark", "Codec benchmark over a range of test cases", 6)
|
||||
_codecName("Default")
|
||||
{
|
||||
}
|
||||
|
||||
Benchmark::Benchmark(std::string name, std::string description)
|
||||
:
|
||||
NormalAsyncTest(name, description, 6),
|
||||
_resultsFileName("../../../../testFiles/benchmark.txt"),
|
||||
_codecName("Default"),
|
||||
NormalAsyncTest(name, description, 6)
|
||||
_codecName("Default")
|
||||
{
|
||||
}
|
||||
|
||||
Benchmark::Benchmark(std::string name, std::string description, std::string resultsFileName, std::string codecName)
|
||||
:
|
||||
NormalAsyncTest(name, description, 6),
|
||||
_resultsFileName(resultsFileName),
|
||||
_codecName(codecName),
|
||||
NormalAsyncTest(name, description, 6)
|
||||
_codecName(codecName)
|
||||
{
|
||||
}
|
||||
|
||||
@ -86,7 +86,7 @@ Benchmark::Perform()
|
||||
|
||||
for (it = sources.begin() ; it < sources.end(); it++)
|
||||
{
|
||||
for (int i = 0; i < sizeof(size)/sizeof(*size); i++)
|
||||
for (int i = 0; i < static_cast<int>(sizeof(size)/sizeof(*size)); i++)
|
||||
{
|
||||
for (int j = 0; j < nFrameRates; j++)
|
||||
{
|
||||
|
@ -20,79 +20,79 @@ using namespace webrtc;
|
||||
|
||||
NormalAsyncTest::NormalAsyncTest()
|
||||
:
|
||||
NormalTest("Async Normal Test 1", "A test of normal execution of the codec",
|
||||
_testNo),
|
||||
_decodeCompleteTime(0),
|
||||
_encodeCompleteTime(0),
|
||||
_encFrameCnt(0),
|
||||
_decFrameCnt(0),
|
||||
_requestKeyFrame(false),
|
||||
_testNo(1),
|
||||
_appendNext(false),
|
||||
_decFrameCnt(0),
|
||||
_encFrameCnt(0),
|
||||
_missingFrames(false),
|
||||
_decodeCompleteTime(0),
|
||||
_encodeCompleteTime(0),
|
||||
_rttFrames(0),
|
||||
_hasReceivedSLI(false),
|
||||
_hasReceivedPLI(false),
|
||||
_waitForKey(false),
|
||||
NormalTest("Async Normal Test 1", "A test of normal execution of the codec",
|
||||
_testNo)
|
||||
_waitForKey(false)
|
||||
{
|
||||
}
|
||||
|
||||
NormalAsyncTest::NormalAsyncTest(WebRtc_UWord32 bitRate)
|
||||
:
|
||||
NormalTest("Async Normal Test 1", "A test of normal execution of the codec",
|
||||
bitRate, _testNo),
|
||||
_decodeCompleteTime(0),
|
||||
_encodeCompleteTime(0),
|
||||
_encFrameCnt(0),
|
||||
_decFrameCnt(0),
|
||||
_requestKeyFrame(false),
|
||||
_testNo(1),
|
||||
_appendNext(false),
|
||||
_decFrameCnt(0),
|
||||
_encFrameCnt(0),
|
||||
_missingFrames(false),
|
||||
_decodeCompleteTime(0),
|
||||
_encodeCompleteTime(0),
|
||||
_rttFrames(0),
|
||||
_hasReceivedSLI(false),
|
||||
_hasReceivedPLI(false),
|
||||
_waitForKey(false),
|
||||
NormalTest("Async Normal Test 1", "A test of normal execution of the codec",
|
||||
bitRate, _testNo)
|
||||
_waitForKey(false)
|
||||
{
|
||||
}
|
||||
|
||||
NormalAsyncTest::NormalAsyncTest(std::string name, std::string description,
|
||||
unsigned int testNo)
|
||||
:
|
||||
NormalTest(name, description, _testNo),
|
||||
_decodeCompleteTime(0),
|
||||
_encodeCompleteTime(0),
|
||||
_encFrameCnt(0),
|
||||
_decFrameCnt(0),
|
||||
_requestKeyFrame(false),
|
||||
_testNo(testNo),
|
||||
_lengthEncFrame(0),
|
||||
_appendNext(false),
|
||||
_decFrameCnt(0),
|
||||
_encFrameCnt(0),
|
||||
_missingFrames(false),
|
||||
_decodeCompleteTime(0),
|
||||
_encodeCompleteTime(0),
|
||||
_rttFrames(0),
|
||||
_hasReceivedSLI(false),
|
||||
_hasReceivedPLI(false),
|
||||
_waitForKey(false),
|
||||
NormalTest(name, description, _testNo)
|
||||
_waitForKey(false)
|
||||
{
|
||||
}
|
||||
|
||||
NormalAsyncTest::NormalAsyncTest(std::string name, std::string description,
|
||||
WebRtc_UWord32 bitRate, unsigned int testNo)
|
||||
:
|
||||
NormalTest(name, description, bitRate, _testNo),
|
||||
_decodeCompleteTime(0),
|
||||
_encodeCompleteTime(0),
|
||||
_encFrameCnt(0),
|
||||
_decFrameCnt(0),
|
||||
_requestKeyFrame(false),
|
||||
_testNo(testNo),
|
||||
_lengthEncFrame(0),
|
||||
_appendNext(false),
|
||||
_decFrameCnt(0),
|
||||
_encFrameCnt(0),
|
||||
_missingFrames(false),
|
||||
_decodeCompleteTime(0),
|
||||
_encodeCompleteTime(0),
|
||||
_rttFrames(0),
|
||||
_hasReceivedSLI(false),
|
||||
_hasReceivedPLI(false),
|
||||
_waitForKey(false),
|
||||
NormalTest(name, description, bitRate, _testNo)
|
||||
_waitForKey(false)
|
||||
{
|
||||
}
|
||||
|
||||
@ -100,20 +100,20 @@ NormalAsyncTest::NormalAsyncTest(std::string name, std::string description,
|
||||
WebRtc_UWord32 bitRate, unsigned int testNo,
|
||||
unsigned int rttFrames)
|
||||
:
|
||||
NormalTest(name, description, bitRate, _testNo),
|
||||
_decodeCompleteTime(0),
|
||||
_encodeCompleteTime(0),
|
||||
_encFrameCnt(0),
|
||||
_decFrameCnt(0),
|
||||
_requestKeyFrame(false),
|
||||
_testNo(testNo),
|
||||
_lengthEncFrame(0),
|
||||
_appendNext(false),
|
||||
_decFrameCnt(0),
|
||||
_encFrameCnt(0),
|
||||
_missingFrames(false),
|
||||
_decodeCompleteTime(0),
|
||||
_encodeCompleteTime(0),
|
||||
_rttFrames(rttFrames),
|
||||
_hasReceivedSLI(false),
|
||||
_hasReceivedPLI(false),
|
||||
_waitForKey(false),
|
||||
NormalTest(name, description, bitRate, _testNo)
|
||||
_waitForKey(false)
|
||||
{
|
||||
}
|
||||
|
||||
@ -469,7 +469,6 @@ int
|
||||
NormalAsyncTest::Decode(int lossValue)
|
||||
{
|
||||
_sumEncBytes += _frameToDecode->_frame->GetLength();
|
||||
double starttime = 0;
|
||||
EncodedImage encodedImage;
|
||||
VideoEncodedBufferToEncodedImage(*(_frameToDecode->_frame), encodedImage);
|
||||
encodedImage._completeFrame = !lossValue;
|
||||
|
@ -15,30 +15,30 @@
|
||||
|
||||
NormalTest::NormalTest()
|
||||
:
|
||||
Test("Normal Test 1", "A test of normal execution of the codec"),
|
||||
_testNo(1),
|
||||
_lengthEncFrame(0),
|
||||
_appendNext(false),
|
||||
Test("Normal Test 1", "A test of normal execution of the codec")
|
||||
_appendNext(false)
|
||||
{
|
||||
}
|
||||
|
||||
NormalTest::NormalTest(std::string name, std::string description, unsigned int testNo)
|
||||
:
|
||||
Test(name, description),
|
||||
_requestKeyFrame(false),
|
||||
_testNo(testNo),
|
||||
_lengthEncFrame(0),
|
||||
_appendNext(false),
|
||||
Test(name, description)
|
||||
_appendNext(false)
|
||||
{
|
||||
}
|
||||
|
||||
NormalTest::NormalTest(std::string name, std::string description, WebRtc_UWord32 bitRate, unsigned int testNo)
|
||||
:
|
||||
Test(name, description, bitRate),
|
||||
_requestKeyFrame(false),
|
||||
_testNo(testNo),
|
||||
_lengthEncFrame(0),
|
||||
_appendNext(false),
|
||||
Test(name, description, bitRate)
|
||||
_appendNext(false)
|
||||
{
|
||||
}
|
||||
|
||||
@ -229,7 +229,6 @@ NormalTest::Encode()
|
||||
int
|
||||
NormalTest::Decode()
|
||||
{
|
||||
double starttime = clock()/(double)CLOCKS_PER_SEC;
|
||||
_encodedVideoBuffer.SetWidth(_inst.width);
|
||||
_encodedVideoBuffer.SetHeight(_inst.height);
|
||||
int lengthDecFrame = 0;
|
||||
|
@ -18,30 +18,31 @@ using namespace webrtc;
|
||||
|
||||
PacketLossTest::PacketLossTest()
|
||||
:
|
||||
NormalAsyncTest("PacketLossTest", "Encode, remove lost packets, decode", 300,
|
||||
5),
|
||||
_lossRate(0.1),
|
||||
_lossProbability(0.1),
|
||||
_lastFrame(NULL),
|
||||
_lastFrameLength(0),
|
||||
NormalAsyncTest("PacketLossTest", "Encode, remove lost packets, decode", 300, 5)
|
||||
_lastFrameLength(0)
|
||||
{
|
||||
}
|
||||
|
||||
PacketLossTest::PacketLossTest(std::string name, std::string description)
|
||||
:
|
||||
NormalAsyncTest(name, description, 300, 5),
|
||||
_lossRate(0.1),
|
||||
_lossProbability(0.1),
|
||||
_lastFrame(NULL),
|
||||
_lastFrameLength(0),
|
||||
NormalAsyncTest(name, description, 300, 5)
|
||||
_lastFrameLength(0)
|
||||
{
|
||||
}
|
||||
|
||||
PacketLossTest::PacketLossTest(std::string name, std::string description, double lossRate, bool useNack, unsigned int rttFrames /* = 0*/)
|
||||
:
|
||||
NormalAsyncTest(name, description, 300, 5, rttFrames),
|
||||
_lossRate(lossRate),
|
||||
_lastFrame(NULL),
|
||||
_lastFrameLength(0),
|
||||
NormalAsyncTest(name, description, 300, 5, rttFrames)
|
||||
_lastFrameLength(0)
|
||||
{
|
||||
assert(lossRate >= 0 && lossRate <= 1);
|
||||
if (useNack)
|
||||
@ -177,7 +178,6 @@ int PacketLossTest::DoPacketLoss()
|
||||
int size = 1;
|
||||
int kept = 0;
|
||||
int thrown = 0;
|
||||
int count = 0;
|
||||
while ((size = NextPacket(1500, &packet)) > 0)
|
||||
{
|
||||
if (!PacketLoss(_lossProbability))
|
||||
|
@ -18,6 +18,7 @@ using namespace webrtc;
|
||||
|
||||
PerformanceTest::PerformanceTest(WebRtc_UWord32 bitRate)
|
||||
:
|
||||
NormalAsyncTest(bitRate),
|
||||
_numCodecs(0),
|
||||
_tests(NULL),
|
||||
_encoders(NULL),
|
||||
@ -27,13 +28,13 @@ _rawImageLock(NULL),
|
||||
_encodeEvents(new EventWrapper*[1]),
|
||||
_stopped(true),
|
||||
_encodeCompleteCallback(NULL),
|
||||
_decodeCompleteCallback(NULL),
|
||||
NormalAsyncTest(bitRate)
|
||||
_decodeCompleteCallback(NULL)
|
||||
{
|
||||
}
|
||||
|
||||
PerformanceTest::PerformanceTest(WebRtc_UWord32 bitRate, WebRtc_UWord8 numCodecs)
|
||||
:
|
||||
NormalAsyncTest(bitRate),
|
||||
_numCodecs(numCodecs),
|
||||
_tests(new PerformanceTest*[_numCodecs]),
|
||||
_encoders(new VideoEncoder*[_numCodecs]),
|
||||
@ -43,8 +44,7 @@ _rawImageLock(RWLockWrapper::CreateRWLock()),
|
||||
_encodeEvents(new EventWrapper*[_numCodecs]),
|
||||
_stopped(true),
|
||||
_encodeCompleteCallback(NULL),
|
||||
_decodeCompleteCallback(NULL),
|
||||
NormalAsyncTest(bitRate)
|
||||
_decodeCompleteCallback(NULL)
|
||||
{
|
||||
for (int i=0; i < _numCodecs; i++)
|
||||
{
|
||||
|
@ -46,12 +46,12 @@ struct SSIMcontext
|
||||
|
||||
Test::Test(std::string name, std::string description)
|
||||
:
|
||||
_name(name),
|
||||
_description(description),
|
||||
_bitRate(0),
|
||||
_inname(""),
|
||||
_outname(""),
|
||||
_encodedName("")
|
||||
_encodedName(""),
|
||||
_name(name),
|
||||
_description(description)
|
||||
{
|
||||
memset(&_inst, 0, sizeof(_inst));
|
||||
unsigned int seed = static_cast<unsigned int>(0);
|
||||
@ -60,12 +60,12 @@ _encodedName("")
|
||||
|
||||
Test::Test(std::string name, std::string description, WebRtc_UWord32 bitRate)
|
||||
:
|
||||
_name(name),
|
||||
_description(description),
|
||||
_bitRate(bitRate),
|
||||
_inname(""),
|
||||
_outname(""),
|
||||
_encodedName("")
|
||||
_encodedName(""),
|
||||
_name(name),
|
||||
_description(description)
|
||||
{
|
||||
memset(&_inst, 0, sizeof(_inst));
|
||||
unsigned int seed = static_cast<unsigned int>(0);
|
||||
|
@ -36,6 +36,7 @@ _decodeCompleteCallback(NULL)
|
||||
|
||||
UnitTest::UnitTest(std::string name, std::string description)
|
||||
:
|
||||
Test(name, description),
|
||||
_tests(0),
|
||||
_errors(0),
|
||||
_source(NULL),
|
||||
@ -45,8 +46,7 @@ _refDecFrame(NULL),
|
||||
_refEncFrameLength(0),
|
||||
_sourceFile(NULL),
|
||||
_encodeCompleteCallback(NULL),
|
||||
_decodeCompleteCallback(NULL),
|
||||
Test(name, description)
|
||||
_decodeCompleteCallback(NULL)
|
||||
{
|
||||
}
|
||||
|
||||
@ -248,7 +248,7 @@ UnitTest::Setup()
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
int frameLength = 0;
|
||||
unsigned int frameLength = 0;
|
||||
int i=0;
|
||||
while (frameLength == 0)
|
||||
{
|
||||
@ -339,7 +339,7 @@ UnitTest::Decode()
|
||||
return WEBRTC_VIDEO_CODEC_OK;
|
||||
}
|
||||
int ret = _decoder->Decode(encodedImage, 0, NULL);
|
||||
int frameLength = WaitForDecodedFrame();
|
||||
unsigned int frameLength = WaitForDecodedFrame();
|
||||
assert(ret == WEBRTC_VIDEO_CODEC_OK && (frameLength == 0 || frameLength
|
||||
== _lengthSourceFrame));
|
||||
VIDEO_TEST(ret == WEBRTC_VIDEO_CODEC_OK && (frameLength == 0 || frameLength
|
||||
@ -696,7 +696,8 @@ UnitTest::Perform()
|
||||
//VIDEO_TEST_EXIT_ON_ERR(frameLength);
|
||||
VIDEO_TEST(frameLength > 0);
|
||||
encTimeStamp = _encodedVideoBuffer.GetTimeStamp();
|
||||
VIDEO_TEST(_inputVideoBuffer.GetTimeStamp() == encTimeStamp);
|
||||
VIDEO_TEST(_inputVideoBuffer.GetTimeStamp() ==
|
||||
static_cast<unsigned>(encTimeStamp));
|
||||
|
||||
frameLength = Decode();
|
||||
if (frameLength == 0)
|
||||
@ -709,7 +710,8 @@ UnitTest::Perform()
|
||||
{
|
||||
encTimeStamp = 0;
|
||||
}
|
||||
VIDEO_TEST(_decodedVideoBuffer.GetTimeStamp() == encTimeStamp);
|
||||
VIDEO_TEST(_decodedVideoBuffer.GetTimeStamp() ==
|
||||
static_cast<unsigned>(encTimeStamp));
|
||||
frames++;
|
||||
sleepEvent.Wait(33);
|
||||
}
|
||||
@ -725,7 +727,6 @@ UnitTest::Perform()
|
||||
void
|
||||
UnitTest::RateControlTests()
|
||||
{
|
||||
FILE *outFile = NULL;
|
||||
std::string outFileName;
|
||||
int frames = 0;
|
||||
RawImage inputImage;
|
||||
|
@ -20,7 +20,9 @@
|
||||
// Refer to http://stackoverflow.com/questions/1946445/
|
||||
// is-there-better-way-to-write-do-while0-construct-to-avoid-compiler-warnings
|
||||
// for some discussion of the issue.
|
||||
#ifdef _WIN32
|
||||
#pragma warning(disable : 4127)
|
||||
#endif
|
||||
|
||||
#define VIDEO_TEST(expr) \
|
||||
do \
|
||||
@ -99,8 +101,8 @@ public:
|
||||
WebRtc_UWord32 decoderSpecificSize = 0,
|
||||
void* decoderSpecificInfo = NULL) :
|
||||
_encodedVideoBuffer(buffer),
|
||||
_decoderSpecificSize(decoderSpecificSize),
|
||||
_decoderSpecificInfo(decoderSpecificInfo),
|
||||
_decoderSpecificSize(decoderSpecificSize),
|
||||
_encodeComplete(false) {}
|
||||
WebRtc_Word32 Encoded(webrtc::EncodedImage& encodedImage,
|
||||
const webrtc::CodecSpecificInfo* codecSpecificInfo,
|
||||
|
@ -23,8 +23,8 @@ VP8NormalAsyncTest(bitRate)
|
||||
|
||||
VP8DualDecoderTest::VP8DualDecoderTest()
|
||||
:
|
||||
_decoder2(NULL),
|
||||
VP8NormalAsyncTest("VP8 Dual Decoder Test", "Tests VP8 dual decoder", 1)
|
||||
VP8NormalAsyncTest("VP8 Dual Decoder Test", "Tests VP8 dual decoder", 1),
|
||||
_decoder2(NULL)
|
||||
{}
|
||||
|
||||
VP8DualDecoderTest::~VP8DualDecoderTest()
|
||||
@ -148,7 +148,6 @@ int
|
||||
VP8DualDecoderTest::Decode(int lossValue)
|
||||
{
|
||||
_sumEncBytes += _frameToDecode->_frame->GetLength();
|
||||
double starttime = 0;
|
||||
webrtc::EncodedImage encodedImage;
|
||||
VideoEncodedBufferToEncodedImage(*(_frameToDecode->_frame), encodedImage);
|
||||
encodedImage._completeFrame = !lossValue;
|
||||
|
@ -38,7 +38,7 @@ VP8NormalAsyncTest::CodecSettings(int width, int height, WebRtc_UWord32 frameRat
|
||||
_inst.codecType = kVideoCodecVP8;
|
||||
_inst.codecSpecific.VP8.feedbackModeOn = true;
|
||||
_inst.codecSpecific.VP8.pictureLossIndicationOn = true;
|
||||
_inst.codecSpecific.VP8.complexity;
|
||||
_inst.codecSpecific.VP8.complexity = kComplexityNormal;
|
||||
_inst.maxFramerate = (unsigned char)frameRate;
|
||||
_inst.startBitrate = _bitRate;
|
||||
_inst.maxBitrate = 8000;
|
||||
|
@ -43,9 +43,9 @@ VP8UnitTest::Print()
|
||||
WebRtc_UWord32
|
||||
VP8UnitTest::CodecSpecific_SetBitrate(WebRtc_UWord32 bitRate, WebRtc_UWord32 /*frameRate*/)
|
||||
{
|
||||
bitRate = _encoder->SetRates(bitRate, _inst.maxFramerate);
|
||||
VIDEO_TEST_EXIT_ON_ERR(bitRate >= 0);
|
||||
return bitRate;
|
||||
int rate = _encoder->SetRates(bitRate, _inst.maxFramerate);
|
||||
VIDEO_TEST_EXIT_ON_ERR(rate >= 0);
|
||||
return rate;
|
||||
}
|
||||
|
||||
bool
|
||||
@ -84,7 +84,6 @@ VP8UnitTest::Perform()
|
||||
std::string outFileName;
|
||||
VP8Encoder* enc = (VP8Encoder*)_encoder;
|
||||
VP8Decoder* dec = (VP8Decoder*)_decoder;
|
||||
int frameLength = 0;
|
||||
|
||||
//----- Encoder parameter tests -----
|
||||
//-- Calls before InitEncode() --
|
||||
|
Loading…
x
Reference in New Issue
Block a user