Fixing warnings in the VCM tests. Also fixes a couple of bugs related

to those warnings.
Review URL: http://webrtc-codereview.appspot.com/98003

git-svn-id: http://webrtc.googlecode.com/svn/trunk@293 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
holmer@google.com
2011-08-03 07:49:56 +00:00
parent af874ebc90
commit e0f7d7b7e8
23 changed files with 196 additions and 158 deletions

View File

@@ -14,6 +14,7 @@
#include "codec_database_test.h" #include "codec_database_test.h"
#include "vp8.h" // for external codecs test #include "vp8.h" // for external codecs test
#include "../source/event.h" #include "../source/event.h"
#include "test_macros.h"
#include "test_util.h" #include "test_util.h"
#include "../../../../engine_configurations.h" #include "../../../../engine_configurations.h"
@@ -34,13 +35,11 @@ int CodecDataBaseTest::RunTest(CmdArgs& args)
} }
CodecDataBaseTest::CodecDataBaseTest(VideoCodingModule* vcm): CodecDataBaseTest::CodecDataBaseTest(VideoCodingModule* vcm):
_vcm(vcm),
_width(0), _width(0),
_height(0), _height(0),
_timeStamp(0),
_lengthSourceFrame(0), _lengthSourceFrame(0),
vcmMacrosTests(0), _timeStamp(0)
vcmMacrosErrors(0),
_vcm(vcm)
{ {
// //
} }

View File

@@ -12,7 +12,6 @@
#define WEBRTC_MODULES_VIDEO_CODING_TEST_CODEC_DATABASE_TEST_H_ #define WEBRTC_MODULES_VIDEO_CODING_TEST_CODEC_DATABASE_TEST_H_
#include "video_coding.h" #include "video_coding.h"
#include "test_macros.h"
#include "test_util.h" #include "test_util.h"
#include <string.h> #include <string.h>
@@ -46,9 +45,7 @@ private:
WebRtc_UWord16 _height; WebRtc_UWord16 _height;
WebRtc_UWord32 _lengthSourceFrame; WebRtc_UWord32 _lengthSourceFrame;
WebRtc_UWord32 _timeStamp; WebRtc_UWord32 _timeStamp;
int vcmMacrosTests; float _frameRate;
int vcmMacrosErrors;
float _frameRate;
}; // end of codecDBTest class definition }; // end of codecDBTest class definition
#endif // WEBRTC_MODULES_VIDEO_CODING_TEST_CODEC_DATABASE_TEST_H_ #endif // WEBRTC_MODULES_VIDEO_CODING_TEST_CODEC_DATABASE_TEST_H_

View File

@@ -14,7 +14,6 @@
#include "trace.h" #include "trace.h"
#include "tick_time.h" #include "tick_time.h"
#include "../source/event.h" #include "../source/event.h"
#include "test_macros.h"
#include "rtp_player.h" #include "rtp_player.h"
using namespace webrtc; using namespace webrtc;

View File

@@ -15,6 +15,7 @@
#include "../source/event.h" #include "../source/event.h"
#include "rtp_rtcp.h" #include "rtp_rtcp.h"
#include "module_common_types.h" #include "module_common_types.h"
#include "test_macros.h"
#include "test_util.h" #include "test_util.h"
using namespace webrtc; using namespace webrtc;
@@ -38,14 +39,12 @@ int GenericCodecTest::RunTest(CmdArgs& args)
} }
GenericCodecTest::GenericCodecTest(VideoCodingModule* vcm): GenericCodecTest::GenericCodecTest(VideoCodingModule* vcm):
_vcm(vcm),
_width(0), _width(0),
_height(0), _height(0),
_timeStamp(0),
_lengthSourceFrame(0),
_frameRate(0), _frameRate(0),
vcmMacrosTests(0), _lengthSourceFrame(0),
vcmMacrosErrors(0), _timeStamp(0)
_vcm(vcm)
{ {
} }
@@ -255,7 +254,7 @@ GenericCodecTest::Perform(CmdArgs& args)
//NOTE: time requirements are not part of the release tests //NOTE: time requirements are not part of the release tests
*/ */
double FullReq = 0.1; double FullReq = 0.1;
double OneSecReq = 0.15; //double OneSecReq = 0.15;
printf("\n RATE CONTROL TEST\n"); printf("\n RATE CONTROL TEST\n");
// initializing.... // initializing....
_vcm->InitializeSender(); _vcm->InitializeSender();
@@ -336,13 +335,12 @@ GenericCodecTest::Perform(CmdArgs& args)
currentTime = VCMTickTime::MicrosecondTimestamp(); currentTime = VCMTickTime::MicrosecondTimestamp();
totalBytes = _encodeCompleteCallback->EncodedBytes(); totalBytes = _encodeCompleteCallback->EncodedBytes();
actualBitrate = (float)(8.0/1000)*(totalBytes / (_frameCnt / _frameRate)); actualBitrate = (float)(8.0/1000)*(totalBytes / (_frameCnt / _frameRate));
WebRtc_Word64 timeDiff = (currentTime - startTime)/1000;
//actualBitrate = (float)(8.0*totalBytes)/timeDiff;
printf("Complete Seq.: target bitrate: %.0f kbps, actual bitrate: %.1f kbps\n", _bitRate, actualBitrate); printf("Complete Seq.: target bitrate: %.0f kbps, actual bitrate: %.1f kbps\n", _bitRate, actualBitrate);
TEST((fabs(actualBitrate - _bitRate) < FullReq * _bitRate) || TEST((fabs(actualBitrate - _bitRate) < FullReq * _bitRate) ||
(strncmp(_sendCodec.plName, "I420", 4) == 0)); (strncmp(_sendCodec.plName, "I420", 4) == 0));
// 1 Sec. // 1 Sec.
actualBitrate = (float)(8.0/1000)*(totalBytesOneSec); actualBitrate = (float)(8.0/1000)*(totalBytesOneSec);
//actualBitrate = (float)(8.0*totalBytesOneSec)/(oneSecTime - startTime); //actualBitrate = (float)(8.0*totalBytesOneSec)/(oneSecTime - startTime);
//printf("First 1Sec: target bitrate: %.0f kbps, actual bitrate: %.1f kbps\n", _bitRate, actualBitrate); //printf("First 1Sec: target bitrate: %.0f kbps, actual bitrate: %.1f kbps\n", _bitRate, actualBitrate);

View File

@@ -12,7 +12,6 @@
#define WEBRTC_MODULES_VIDEO_CODING_TEST_GENERIC_CODEC_TEST_H_ #define WEBRTC_MODULES_VIDEO_CODING_TEST_GENERIC_CODEC_TEST_H_
#include "video_coding.h" #include "video_coding.h"
#include "test_macros.h"
#include "test_util.h" #include "test_util.h"
#include <string.h> #include <string.h>
@@ -46,22 +45,20 @@ private:
webrtc::VideoCodingModule* _vcm; webrtc::VideoCodingModule* _vcm;
webrtc::VideoCodec _sendCodec; webrtc::VideoCodec _sendCodec;
webrtc::VideoCodec _receiveCodec; webrtc::VideoCodec _receiveCodec;
std::string _inname; std::string _inname;
std::string _outname; std::string _outname;
std::string _encodedName; std::string _encodedName;
WebRtc_Word32 _sumEncBytes; WebRtc_Word32 _sumEncBytes;
FILE* _sourceFile; FILE* _sourceFile;
FILE* _decodedFile; FILE* _decodedFile;
FILE* _encodedFile; FILE* _encodedFile;
WebRtc_UWord16 _width; WebRtc_UWord16 _width;
WebRtc_UWord16 _height; WebRtc_UWord16 _height;
float _frameRate; float _frameRate;
WebRtc_UWord32 _lengthSourceFrame; WebRtc_UWord32 _lengthSourceFrame;
WebRtc_UWord32 _timeStamp; WebRtc_UWord32 _timeStamp;
int vcmMacrosTests; VCMDecodeCompleteCallback* _decodeCallback;
int vcmMacrosErrors; VCMEncodeCompleteCallback* _encodeCompleteCallback;
VCMDecodeCompleteCallback* _decodeCallback;
VCMEncodeCompleteCallback* _encodeCompleteCallback;
}; // end of GenericCodecTest class definition }; // end of GenericCodecTest class definition

View File

@@ -17,20 +17,20 @@
#include "../source/event.h" #include "../source/event.h"
#include "frame_buffer.h" #include "frame_buffer.h"
#include "jitter_estimate_test.h" #include "jitter_estimate_test.h"
#include "test_macros.h"
#include "test_util.h" #include "test_util.h"
#include "test_macros.h"
#include <stdio.h> #include <stdio.h>
#include <math.h> #include <math.h>
using namespace webrtc; using namespace webrtc;
void CheckOutFrame(VCMEncodedFrame* frameOut, int size, bool startCode) void CheckOutFrame(VCMEncodedFrame* frameOut, unsigned int size, bool startCode)
{ {
TEST(frameOut != 0); TEST(frameOut != 0);
const WebRtc_UWord8* outData = frameOut->Buffer(); const WebRtc_UWord8* outData = frameOut->Buffer();
int i = 0; unsigned int i = 0;
if(startCode) if(startCode)
{ {
@@ -43,7 +43,6 @@ void CheckOutFrame(VCMEncodedFrame* frameOut, int size, bool startCode)
// check the frame data // check the frame data
int count = 3; int count = 3;
int layer = 0;
// check the frame length // check the frame length
TEST(frameOut->Length() == size); TEST(frameOut->Length() == size);
@@ -64,10 +63,6 @@ void CheckOutFrame(VCMEncodedFrame* frameOut, int size, bool startCode)
} }
else else
{ {
if (outData[i] != count)
{
int a=0;
}
TEST(outData[i] == count); TEST(outData[i] == count);
count++; count++;
if(count == 10) if(count == 10)
@@ -114,7 +109,8 @@ int JitterBufferTest(CmdArgs& args)
item = frameList.First(); item = frameList.First();
fb = static_cast<VCMFrameBuffer*>(item->GetItem()); fb = static_cast<VCMFrameBuffer*>(item->GetItem());
TEST(i > 0 || fb->TimeStamp() == 0xfffffff0); // Frame 0 has no prev TEST(i > 0 || fb->TimeStamp() == 0xfffffff0); // Frame 0 has no prev
TEST(prevTimestamp - fb->TimeStamp() == -1 || i == 0); TEST(prevTimestamp - fb->TimeStamp() == static_cast<WebRtc_UWord32>(-1)
|| i == 0);
prevTimestamp = fb->TimeStamp(); prevTimestamp = fb->TimeStamp();
frameList.Erase(item); frameList.Erase(item);
delete fb; delete fb;
@@ -127,11 +123,9 @@ int JitterBufferTest(CmdArgs& args)
seqNum = 1234; seqNum = 1234;
timeStamp = 123*90; timeStamp = 123*90;
VCMFrameBufferEnum retVal(kNoError);
FrameType incomingFrameType(kVideoFrameKey); FrameType incomingFrameType(kVideoFrameKey);
VCMEncodedFrame* frameOut=NULL; VCMEncodedFrame* frameOut=NULL;
WebRtc_Word64 renderTimeMs = 0; WebRtc_Word64 renderTimeMs = 0;
WebRtc_UWord8 payloadType = 0;
packet.timestamp = timeStamp; packet.timestamp = timeStamp;
packet.seqNum = seqNum; packet.seqNum = seqNum;
@@ -140,7 +134,7 @@ int JitterBufferTest(CmdArgs& args)
data[1] = 0; data[1] = 0;
data[2] = 0x80; data[2] = 0x80;
int count = 3; int count = 3;
for(int i = 3; i < sizeof(data) - 3; ++i ) for (unsigned int i = 3; i < sizeof(data) - 3; ++i)
{ {
data[i] = count; data[i] = count;
count++; count++;
@@ -2244,6 +2238,18 @@ int JitterBufferTest(CmdArgs& args)
jb.Stop(); jb.Stop();
printf("DONE !!!\n"); printf("DONE !!!\n");
printf("\nVCM Jitter Buffer Test: \n\n%i tests completed\n",
vcmMacrosTests);
if (vcmMacrosErrors > 0)
{
printf("%i FAILED\n\n", vcmMacrosErrors);
}
else
{
printf("ALL PASSED\n\n");
}
EventWrapper* waitEvent = EventWrapper::Create(); EventWrapper* waitEvent = EventWrapper::Create();
waitEvent->Wait(5000); waitEvent->Wait(5000);

View File

@@ -14,6 +14,7 @@
#include "receiver_tests.h" // receive side callbacks #include "receiver_tests.h" // receive side callbacks
#include "video_coding.h" #include "video_coding.h"
#include "rtp_rtcp.h" #include "rtp_rtcp.h"
#include "test_macros.h"
#include "test_util.h" // send side callback #include "test_util.h" // send side callback
#include "media_opt_test.h" #include "media_opt_test.h"
#include "../source/event.h" #include "../source/event.h"
@@ -21,8 +22,6 @@
#include <string.h> #include <string.h>
#include <stdio.h> #include <stdio.h>
#include <vector> #include <vector>
//#include <Windows.h>
#include <time.h> #include <time.h>
using namespace webrtc; using namespace webrtc;
@@ -74,15 +73,13 @@ _frameRate(30.0f),
_nackEnabled(false), _nackEnabled(false),
_fecEnabled(false), _fecEnabled(false),
_rttMS(0), _rttMS(0),
_renderDelayMs(0),
_bitRate(300.0f), _bitRate(300.0f),
_lossRate(0.0f), _lossRate(0.0f),
_renderDelayMs(0),
_frameCnt(0), _frameCnt(0),
_sumEncBytes(0), _sumEncBytes(0),
_numFramesDropped(0), _numFramesDropped(0),
_numberOfCores(4), _numberOfCores(4)
vcmMacrosTests(0),
vcmMacrosErrors(0)
{ {
_rtp = RtpRtcp::CreateRtpRtcp(1, false); _rtp = RtpRtcp::CreateRtpRtcp(1, false);
} }
@@ -160,7 +157,6 @@ MediaOptTest::Setup(int testType, CmdArgs& args)
// //
_renderDelayMs = 0; _renderDelayMs = 0;
WebRtc_UWord32 minPlayoutDelayMs = 0;
/* test settings end*/ /* test settings end*/
_lengthSourceFrame = 3*_width*_height/2; _lengthSourceFrame = 3*_width*_height/2;
@@ -171,10 +167,7 @@ MediaOptTest::Setup(int testType, CmdArgs& args)
void void
MediaOptTest::GeneralSetup() MediaOptTest::GeneralSetup()
{ {
WebRtc_UWord32 minPlayoutDelayMs = 0;
WebRtc_UWord8 deltaFECRate = 0;
WebRtc_UWord8 keyFECRate = 0;
WebRtc_UWord32 minPlayoutDelayMs = 0;
if ((_sourceFile = fopen(_inname.c_str(), "rb")) == NULL) if ((_sourceFile = fopen(_inname.c_str(), "rb")) == NULL)
{ {
@@ -240,7 +233,6 @@ MediaOptTest::GeneralSetup()
exit(1); exit(1);
} }
WebRtc_UWord8 i= 0;
if (_vcm->Codec(_sendCodecType, &sendCodec) != 0) if (_vcm->Codec(_sendCodecType, &sendCodec) != 0)
{ {
printf("Unknown codec\n"); printf("Unknown codec\n");
@@ -384,7 +376,6 @@ MediaOptTest::RTTest()
// constant settings (valid for entire run time) // constant settings (valid for entire run time)
_rttMS = 20; _rttMS = 20;
_renderDelayMs = 0; _renderDelayMs = 0;
WebRtc_UWord32 minPlayoutDelayMs = 0;
_outname = "../RTMOTest_out.yuv"; // same out name for all _outname = "../RTMOTest_out.yuv"; // same out name for all
_actualSourcename = "../RTMOTestSource.yuv"; // actual source after frame dropping _actualSourcename = "../RTMOTestSource.yuv"; // actual source after frame dropping

View File

@@ -13,7 +13,6 @@
#define WEBRTC_MODULES_VIDEO_CODING_TEST_MEDIA_OPT_TEST_H_ #define WEBRTC_MODULES_VIDEO_CODING_TEST_MEDIA_OPT_TEST_H_
#include "video_coding.h" #include "video_coding.h"
#include "test_macros.h"
#include "test_util.h" #include "test_util.h"
#include "video_source.h" #include "video_source.h"
@@ -104,8 +103,6 @@ private:
string _codecName; string _codecName;
webrtc::VideoCodecType _sendCodecType; webrtc::VideoCodecType _sendCodecType;
WebRtc_Word32 _numberOfCores; WebRtc_Word32 _numberOfCores;
int vcmMacrosTests;
int vcmMacrosErrors;
//for release test#2 //for release test#2
FILE* _fpinp; FILE* _fpinp;

View File

@@ -19,6 +19,7 @@
#include "rtp_rtcp.h" #include "rtp_rtcp.h"
#include "thread_wrapper.h" #include "thread_wrapper.h"
#include "../source/event.h" #include "../source/event.h"
#include "test_macros.h"
#include "test_util.h" // send side callback #include "test_util.h" // send side callback
#include "media_opt_test.h" #include "media_opt_test.h"
@@ -100,7 +101,6 @@ int MTRxTxTest(CmdArgs& args)
WebRtc_UWord16 width = args.width; WebRtc_UWord16 width = args.width;
WebRtc_UWord16 height = args.height; WebRtc_UWord16 height = args.height;
WebRtc_UWord32 lengthSourceFrame = 3*width*height/2;
float frameRate = args.frameRate; float frameRate = args.frameRate;
float bitRate = args.bitRate; float bitRate = args.bitRate;
@@ -114,8 +114,6 @@ int MTRxTxTest(CmdArgs& args)
float lossRate = 0.0*255; // no packet loss float lossRate = 0.0*255; // no packet loss
WebRtc_UWord32 renderDelayMs = 0; WebRtc_UWord32 renderDelayMs = 0;
WebRtc_UWord32 minPlayoutDelayMs = 0; WebRtc_UWord32 minPlayoutDelayMs = 0;
WebRtc_UWord8 deltaFECRate = 0;
WebRtc_UWord8 keyFECRate = 0;
/* TEST SET-UP */ /* TEST SET-UP */
@@ -242,7 +240,7 @@ int MTRxTxTest(CmdArgs& args)
ThreadWrapper* intSenderThread = ThreadWrapper::CreateThread(IntSenderThread, ThreadWrapper* intSenderThread = ThreadWrapper::CreateThread(IntSenderThread,
&mtSendState, kNormalPriority, "IntThread"); &mtSendState, kNormalPriority, "IntThread");
if (MainSenderThread != NULL) if (mainSenderThread != NULL)
{ {
unsigned int tid; unsigned int tid;
mainSenderThread->Start(tid); mainSenderThread->Start(tid);
@@ -253,7 +251,7 @@ int MTRxTxTest(CmdArgs& args)
return -1; return -1;
} }
if (IntSenderThread != NULL) if (intSenderThread != NULL)
{ {
unsigned int tid; unsigned int tid;
intSenderThread->Start(tid); intSenderThread->Start(tid);
@@ -320,6 +318,16 @@ int MTRxTxTest(CmdArgs& args)
; ;
} }
printf("\nVCM MT RX/TX Test: \n\n%i tests completed\n", vcmMacrosTests);
if (vcmMacrosErrors > 0)
{
printf("%i FAILED\n\n", vcmMacrosErrors);
}
else
{
printf("ALL PASSED\n\n");
}
delete &waitEvent; delete &waitEvent;
delete mainSenderThread; delete mainSenderThread;
delete intSenderThread; delete intSenderThread;

View File

@@ -13,6 +13,7 @@
#include "tick_time.h" #include "tick_time.h"
#include "common_types.h" #include "common_types.h"
#include "trace.h" #include "trace.h"
#include "test_macros.h"
#include "test_util.h" #include "test_util.h"
#include <assert.h> #include <assert.h>
#include <iostream> #include <iostream>
@@ -44,14 +45,14 @@ int NormalTest::RunTest(CmdArgs& args)
// Callback Implementation // Callback Implementation
////////////// //////////////
VCMNTEncodeCompleteCallback::VCMNTEncodeCompleteCallback(FILE* encodedFile, NormalTest& test): VCMNTEncodeCompleteCallback::VCMNTEncodeCompleteCallback(FILE* encodedFile,
_seqNo(0), NormalTest& test):
_layerPacketId(1), _encodedFile(encodedFile),
_encodedFile(encodedFile), _encodedBytes(0),
_encodedBytes(0), _skipCnt(0),
_skipCnt(0), _VCMReceiver(NULL),
_VCMReceiver(NULL), _seqNo(0),
_test(test) _test(test)
{ {
// //
} }
@@ -98,6 +99,9 @@ VCMNTEncodeCompleteCallback::SendData(
case kVideoCodecI420: case kVideoCodecI420:
rtpInfo.type.Video.codec = kRTPVideoI420; rtpInfo.type.Video.codec = kRTPVideoI420;
break; break;
default:
assert(false);
return -1;
} }
rtpInfo.header.payloadType = payloadType; rtpInfo.header.payloadType = payloadType;
rtpInfo.header.sequenceNumber = _seqNo++; rtpInfo.header.sequenceNumber = _seqNo++;
@@ -173,6 +177,8 @@ VCMNTDecodeCompleCallback::DecodedBytes()
NormalTest::NormalTest(VideoCodingModule* vcm) NormalTest::NormalTest(VideoCodingModule* vcm)
: :
_vcm(vcm), _vcm(vcm),
_sumEncBytes(0),
_timeStamp(0),
_totalEncodeTime(0), _totalEncodeTime(0),
_totalDecodeTime(0), _totalDecodeTime(0),
_decodeCompleteTime(0), _decodeCompleteTime(0),
@@ -180,11 +186,8 @@ _encodeCompleteTime(0),
_totalEncodePipeTime(0), _totalEncodePipeTime(0),
_totalDecodePipeTime(0), _totalDecodePipeTime(0),
_frameCnt(0), _frameCnt(0),
_timeStamp(0),
_encFrameCnt(0), _encFrameCnt(0),
_decFrameCnt(0), _decFrameCnt(0)
_sumEncBytes(0)
{ {
// //
} }
@@ -268,7 +271,9 @@ NormalTest::Perform(CmdArgs& args)
while (feof(_sourceFile)== 0) while (feof(_sourceFile)== 0)
{ {
#if !(defined(TICK_TIME_DEBUG) || defined(EVENT_DEBUG))
WebRtc_Word64 processStartTime = VCMTickTime::MillisecondTimestamp(); WebRtc_Word64 processStartTime = VCMTickTime::MillisecondTimestamp();
#endif
fread(tmpBuffer, 1, _lengthSourceFrame, _sourceFile); fread(tmpBuffer, 1, _lengthSourceFrame, _sourceFile);
_frameCnt++; _frameCnt++;
sourceFrame.CopyFrame(_lengthSourceFrame, tmpBuffer); sourceFrame.CopyFrame(_lengthSourceFrame, tmpBuffer);
@@ -299,7 +304,7 @@ NormalTest::Perform(CmdArgs& args)
} }
WebRtc_UWord32 framePeriod = static_cast<WebRtc_UWord32>(1000.0f/static_cast<float>(_sendCodec.maxFramerate) + 0.5f); WebRtc_UWord32 framePeriod = static_cast<WebRtc_UWord32>(1000.0f/static_cast<float>(_sendCodec.maxFramerate) + 0.5f);
#if defined(TICK_TIME_DEBUG) || defined(EVENT_DEBUG) #if defined(TICK_TIME_DEBUG) || defined(EVENT_DEBUG)
for (int i=0; i < framePeriod; i++) for (unsigned int i=0; i < framePeriod; i++)
{ {
VCMTickTime::IncrementDebugClock(); VCMTickTime::IncrementDebugClock();
} }
@@ -364,6 +369,16 @@ NormalTest::Print()
printf("PSNR: %f \n", psnr); printf("PSNR: %f \n", psnr);
( _log) << "PSNR: " << psnr << std::endl; ( _log) << "PSNR: " << psnr << std::endl;
(_log) << std::endl; (_log) << std::endl;
printf("\nVCM Normal Test: \n\n%i tests completed\n", vcmMacrosTests);
if (vcmMacrosErrors > 0)
{
printf("%i FAILED\n\n", vcmMacrosErrors);
}
else
{
printf("ALL PASSED\n\n");
}
} }
void void
NormalTest::Teardown() NormalTest::Teardown()

View File

@@ -12,7 +12,6 @@
#define WEBRTC_MODULES_VIDEO_CODING_TEST_NORMAL_TEST_H_ #define WEBRTC_MODULES_VIDEO_CODING_TEST_NORMAL_TEST_H_
#include "video_coding.h" #include "video_coding.h"
#include "test_macros.h"
#include "test_util.h" #include "test_util.h"
#include <map> #include <map>
@@ -54,19 +53,15 @@ private:
webrtc::FrameType _frameType; webrtc::FrameType _frameType;
WebRtc_UWord8* _payloadData; // max payload size?? WebRtc_UWord8* _payloadData; // max payload size??
WebRtc_UWord16 _seqNo; WebRtc_UWord16 _seqNo;
WebRtc_UWord8 _layerPacketId;
NormalTest& _test; NormalTest& _test;
// int _vcmMacrosTests;
// int _vcmMacrosErrors;
}; // end of VCMEncodeCompleteCallback }; // end of VCMEncodeCompleteCallback
class VCMNTDecodeCompleCallback: public webrtc::VCMReceiveCallback class VCMNTDecodeCompleCallback: public webrtc::VCMReceiveCallback
{ {
public: public:
VCMNTDecodeCompleCallback(std::string outname): // or should it get a name? VCMNTDecodeCompleCallback(std::string outname): // or should it get a name?
_outname(outname),
_decodedFile(NULL), _decodedFile(NULL),
_outname(outname),
_decodedBytes(0), _decodedBytes(0),
_currentWidth(0), _currentWidth(0),
_currentHeight(0) {} _currentHeight(0) {}

View File

@@ -10,6 +10,7 @@
#include "quality_modes_test.h" #include "quality_modes_test.h"
#include "../source/event.h" #include "../source/event.h"
#include "test_macros.h"
#include "vplib.h" #include "vplib.h"
#include <iostream> #include <iostream>
@@ -124,6 +125,16 @@ QualityModesTest::Print()
printf("SSIM: %f \n", ssim); printf("SSIM: %f \n", ssim);
} }
(_log) << std::endl; (_log) << std::endl;
printf("\nVCM Qualit Modes Test: \n\n%i tests completed\n", vcmMacrosTests);
if (vcmMacrosErrors > 0)
{
printf("%i FAILED\n\n", vcmMacrosErrors);
}
else
{
printf("ALL PASSED\n\n");
}
} }
void void
QualityModesTest::Teardown() QualityModesTest::Teardown()

View File

@@ -22,14 +22,14 @@ class QualityModesTest : public NormalTest
public: public:
QualityModesTest(webrtc::VideoCodingModule* vcm); QualityModesTest(webrtc::VideoCodingModule* vcm);
virtual ~QualityModesTest(); virtual ~QualityModesTest();
WebRtc_Word32 Perform(); WebRtc_Word32 Perform();
private: private:
void Setup(); void Setup();
void Print(); void Print();
void Teardown(); void Teardown();
void SsimComp(); void SsimComp();
webrtc::VideoProcessingModule* _vpm; webrtc::VideoProcessingModule* _vpm;
@@ -61,10 +61,10 @@ private:
FILE* _decodedFile; FILE* _decodedFile;
WebRtc_UWord32 _decodedBytes; WebRtc_UWord32 _decodedBytes;
// QualityModesTest& _test; // QualityModesTest& _test;
WebRtc_Word32 _origWidth; WebRtc_UWord32 _origWidth;
WebRtc_Word32 _origHeight; WebRtc_UWord32 _origHeight;
WebRtc_Word32 _decWidth; WebRtc_UWord32 _decWidth;
WebRtc_Word32 _decHeight; WebRtc_UWord32 _decHeight;
// VideoInterpolator* _interpolator; // VideoInterpolator* _interpolator;
WebRtc_UWord8* _decBuffer; WebRtc_UWord8* _decBuffer;
WebRtc_UWord32 _frameCnt; // debug WebRtc_UWord32 _frameCnt; // debug

View File

@@ -57,8 +57,8 @@ class SharedState
{ {
public: public:
SharedState(webrtc::VideoCodingModule& vcm, RTPPlayer& rtpPlayer) : SharedState(webrtc::VideoCodingModule& vcm, RTPPlayer& rtpPlayer) :
_rtpPlayer(rtpPlayer), _vcm(vcm),
_vcm(vcm) {} _rtpPlayer(rtpPlayer) {}
webrtc::VideoCodingModule& _vcm; webrtc::VideoCodingModule& _vcm;
RTPPlayer& _rtpPlayer; RTPPlayer& _rtpPlayer;
}; };
@@ -67,10 +67,10 @@ class SharedRTPState
{ {
public: public:
SharedRTPState(webrtc::VideoCodingModule& vcm, webrtc::RtpRtcp& rtp) : SharedRTPState(webrtc::VideoCodingModule& vcm, webrtc::RtpRtcp& rtp) :
_rtp(rtp), _vcm(vcm),
_vcm(vcm) {} _rtp(rtp) {}
webrtc::VideoCodingModule& _vcm; webrtc::VideoCodingModule& _vcm;
webrtc::RtpRtcp& _rtp; webrtc::RtpRtcp& _rtp;
}; };
int RtpPlay(CmdArgs& args); int RtpPlay(CmdArgs& args);

View File

@@ -65,9 +65,9 @@ int ReceiverTimingTests(CmdArgs& args)
VCMTiming timing; VCMTiming timing;
float clockInMs = 0.0; float clockInMs = 0.0;
WebRtc_UWord32 waitTime = 0; WebRtc_UWord32 waitTime = 0;
WebRtc_Word32 jitterDelayMs = 0; WebRtc_UWord32 jitterDelayMs = 0;
WebRtc_Word32 maxDecodeTimeMs = 0; WebRtc_UWord32 maxDecodeTimeMs = 0;
WebRtc_Word32 extraDelayMs = 0; WebRtc_UWord32 extraDelayMs = 0;
WebRtc_UWord32 timeStamp = 0; WebRtc_UWord32 timeStamp = 0;
timing.Reset(static_cast<WebRtc_Word64>(clockInMs + 0.5)); timing.Reset(static_cast<WebRtc_Word64>(clockInMs + 0.5));
@@ -222,6 +222,17 @@ int ReceiverTimingTests(CmdArgs& args)
MaskWord64ToUWord32(renderTimeMs)); MaskWord64ToUWord32(renderTimeMs));
} }
WEBRTC_TRACE(webrtc::kTraceDebug, webrtc::kTraceVideoCoding, -1, "End Stochastic test 1"); WEBRTC_TRACE(webrtc::kTraceDebug, webrtc::kTraceVideoCoding, -1, "End Stochastic test 1");
printf("\nVCM Timing Test: \n\n%i tests completed\n", vcmMacrosTests);
if (vcmMacrosErrors > 0)
{
printf("%i FAILED\n\n", vcmMacrosErrors);
}
else
{
printf("ALL PASSED\n\n");
}
Trace::ReturnTrace(); Trace::ReturnTrace();
return 0; return 0;
} }

View File

@@ -40,7 +40,6 @@ LostPackets::LostPackets()
: :
_critSect(*CriticalSectionWrapper::CreateCriticalSection()), _critSect(*CriticalSectionWrapper::CreateCriticalSection()),
_lossCount(0), _lossCount(0),
ListWrapper(),
_debugFile(NULL) _debugFile(NULL)
{ {
_debugFile = fopen("PacketLossDebug.txt", "w"); _debugFile = fopen("PacketLossDebug.txt", "w");

View File

@@ -50,8 +50,8 @@ public:
void Unlock() {_critSect.Leave();}; void Unlock() {_critSect.Leave();};
private: private:
webrtc::CriticalSectionWrapper& _critSect; webrtc::CriticalSectionWrapper& _critSect;
WebRtc_UWord32 _lossCount; WebRtc_UWord32 _lossCount;
FILE* _debugFile; FILE* _debugFile;
}; };
struct PayloadCodecTuple struct PayloadCodecTuple

View File

@@ -14,8 +14,8 @@
#include <cstdio> #include <cstdio>
#include <cstdlib> #include <cstdlib>
static int vcmMacrosTests = 0; extern int vcmMacrosTests;
static int vcmMacrosErrors = 0; extern int vcmMacrosErrors;
#define PRINT_ERR_MSG(msg) \ #define PRINT_ERR_MSG(msg) \
do { \ do { \

View File

@@ -9,6 +9,7 @@
*/ */
#include "test_util.h" #include "test_util.h"
#include "test_macros.h"
#include "rtp_dump.h" #include "rtp_dump.h"
#include <cmath> #include <cmath>
@@ -21,15 +22,14 @@ using namespace webrtc;
// passes the encoded frame directly to the encoder // passes the encoded frame directly to the encoder
// Packetization callback implmentation // Packetization callback implmentation
VCMEncodeCompleteCallback::VCMEncodeCompleteCallback(FILE* encodedFile): VCMEncodeCompleteCallback::VCMEncodeCompleteCallback(FILE* encodedFile):
_seqNo(0), _encodedFile(encodedFile),
_encodedFile(encodedFile), _encodedBytes(0),
_encodedBytes(0), _VCMReceiver(NULL),
_VCMReceiver(NULL), _seqNo(0),
_encodeComplete(false), _encodeComplete(false),
_width(0), _width(0),
_height(0), _height(0),
_codecType(kRTPVideoNoVideo), _codecType(kRTPVideoNoVideo)
_layerPacketId(1)
{ {
// //
} }
@@ -38,7 +38,8 @@ VCMEncodeCompleteCallback::~VCMEncodeCompleteCallback()
} }
void void
VCMEncodeCompleteCallback::RegisterTransportCallback(VCMPacketizationCallback* transport) VCMEncodeCompleteCallback::RegisterTransportCallback(
VCMPacketizationCallback* transport)
{ {
} }
@@ -68,6 +69,11 @@ VCMEncodeCompleteCallback::SendData(
rtpInfo.type.Video.height = (WebRtc_UWord16)_height; rtpInfo.type.Video.height = (WebRtc_UWord16)_height;
rtpInfo.type.Video.width = (WebRtc_UWord16)_width; rtpInfo.type.Video.width = (WebRtc_UWord16)_width;
break; break;
case webrtc::kRTPVideoVP8:
break;
default:
assert(false);
return -1;
} }
rtpInfo.header.payloadType = payloadType; rtpInfo.header.payloadType = payloadType;
@@ -121,9 +127,9 @@ VCMEncodeCompleteCallback::ResetByteCount()
_encodedBytes = 0; _encodedBytes = 0;
} }
/**********************************/ /***********************************/
/* VCMRTPEncodeCompleteCallback / /* VCMRTPEncodeCompleteCallback */
/********************************/ /***********************************/
// Encode Complete callback implementation // Encode Complete callback implementation
// passes the encoded frame via the RTP module to the decoder // passes the encoded frame via the RTP module to the decoder
// Packetization callback implmentation // Packetization callback implmentation
@@ -220,32 +226,32 @@ VCMDecodeCompleteCallback::PSNRLastFrame(const VideoFrame& sourceFrame, double
return 0; return 0;
} }
WebRtc_Word32 WebRtc_Word32
VCMDecodeCompleteCallback::DecodedBytes() VCMDecodeCompleteCallback::DecodedBytes()
{ {
return _decodedBytes; return _decodedBytes;
} }
RTPSendCompleteCallback::RTPSendCompleteCallback(RtpRtcp* rtp, const char* filename): RTPSendCompleteCallback::RTPSendCompleteCallback(RtpRtcp* rtp, const char* filename):
_rtp(rtp), _sendCount(0),
_sendCount(0), _rtp(rtp),
_lossPct(0), _lossPct(0),
_rtpDump(NULL) _rtpDump(NULL)
{ {
if (filename != NULL) if (filename != NULL)
{ {
_rtpDump = RtpDump::CreateRtpDump(); _rtpDump = RtpDump::CreateRtpDump();
_rtpDump->Start(filename); _rtpDump->Start(filename);
} }
} }
RTPSendCompleteCallback::~RTPSendCompleteCallback() RTPSendCompleteCallback::~RTPSendCompleteCallback()
{ {
if (_rtpDump != NULL) if (_rtpDump != NULL)
{ {
_rtpDump->Stop(); _rtpDump->Stop();
RtpDump::DestroyRtpDump(_rtpDump); RtpDump::DestroyRtpDump(_rtpDump);
} }
} }
int int
RTPSendCompleteCallback::SendPacket(int channel, const void *data, int len) RTPSendCompleteCallback::SendPacket(int channel, const void *data, int len)
{ {

View File

@@ -16,7 +16,6 @@
#include "trace.h" #include "trace.h"
#include "module_common_types.h" #include "module_common_types.h"
#include "tick_time.h" #include "tick_time.h"
#include "test_macros.h"
#include "test_util.h" #include "test_util.h"
#include <string.h> #include <string.h>
@@ -109,7 +108,6 @@ private:
WebRtc_Word32 _width; WebRtc_Word32 _width;
WebRtc_Word32 _height; WebRtc_Word32 _height;
webrtc::RTPVideoCodecTypes _codecType; webrtc::RTPVideoCodecTypes _codecType;
WebRtc_UWord8 _layerPacketId;
}; // end of VCMEncodeCompleteCallback }; // end of VCMEncodeCompleteCallback
@@ -118,7 +116,11 @@ class VCMRTPEncodeCompleteCallback: public webrtc::VCMPacketizationCallback
{ {
public: public:
VCMRTPEncodeCompleteCallback(webrtc::RtpRtcp* rtp) : VCMRTPEncodeCompleteCallback(webrtc::RtpRtcp* rtp) :
_seqNo(0), _encodedBytes(0), _RTPModule(rtp), _encodeComplete(false) {} _encodedBytes(0),
_seqNo(0),
_encodeComplete(false),
_RTPModule(rtp) {}
virtual ~VCMRTPEncodeCompleteCallback() {} virtual ~VCMRTPEncodeCompleteCallback() {}
// process encoded data received from the encoder, pass stream to the RTP module // process encoded data received from the encoder, pass stream to the RTP module
WebRtc_Word32 SendData(const webrtc::FrameType frameType, WebRtc_Word32 SendData(const webrtc::FrameType frameType,
@@ -201,11 +203,15 @@ class SendSharedState
public: public:
SendSharedState(webrtc::VideoCodingModule& vcm, webrtc::RtpRtcp& rtp, SendSharedState(webrtc::VideoCodingModule& vcm, webrtc::RtpRtcp& rtp,
CmdArgs args) : CmdArgs args) :
_rtp(rtp), _vcm(vcm), _args(args), _sourceFile(NULL), _frameCnt(0), _vcm(vcm),
_timestamp(0) {} _rtp(rtp),
_args(args),
_sourceFile(NULL),
_frameCnt(0),
_timestamp(0) {}
webrtc::VideoCodingModule& _vcm; webrtc::VideoCodingModule& _vcm;
webrtc::RtpRtcp& _rtp; webrtc::RtpRtcp& _rtp;
CmdArgs _args; CmdArgs _args;
FILE* _sourceFile; FILE* _sourceFile;
WebRtc_Word32 _frameCnt; WebRtc_Word32 _frameCnt;

View File

@@ -37,6 +37,9 @@ using namespace webrtc;
WebRtc_Word64 VCMTickTime::_timeNowDebug = 0; // current time in ms WebRtc_Word64 VCMTickTime::_timeNowDebug = 0; // current time in ms
#endif #endif
int vcmMacrosTests = 0;
int vcmMacrosErrors = 0;
int ParseArguments(int argc, char **argv, CmdArgs& args) int ParseArguments(int argc, char **argv, CmdArgs& args)
{ {
int i = 1; int i = 1;

View File

@@ -53,7 +53,7 @@ bool RtpReaderThread(void* obj)
bool DecodeThread(void* obj) bool DecodeThread(void* obj)
{ {
SharedState* state = static_cast<SharedState*>(obj); SharedState* state = static_cast<SharedState*>(obj);
WebRtc_Word32 ret = state->_vcm.Decode(10000); state->_vcm.Decode(10000);
while (state->_vcm.DecodeDualFrame(0) == 1); while (state->_vcm.DecodeDualFrame(0) == 1);
return true; return true;
} }

View File

@@ -27,10 +27,10 @@ VideoSource::VideoSource(std::string fileName, VideoSize size,
float frameRate, webrtc::VideoType type /*= webrtc::kI420*/) float frameRate, webrtc::VideoType type /*= webrtc::kI420*/)
: :
_fileName(fileName), _fileName(fileName),
_type(type),
_frameRate(frameRate),
_width(0), _width(0),
_height(0) _height(0),
_type(type),
_frameRate(frameRate)
{ {
assert(size != kUndefined && size != kNumberOfVideoSizes); assert(size != kUndefined && size != kNumberOfVideoSizes);
assert(type != webrtc::kUnknown); assert(type != webrtc::kUnknown);