vpm: removing unnecessary memcpy

TEST=trybots

BUG=1128

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

git-svn-id: http://webrtc.googlecode.com/svn/trunk@3284 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
mikhal@webrtc.org
2012-12-13 18:25:36 +00:00
parent 7acb65a870
commit 4493db5a3e
4 changed files with 31 additions and 19 deletions

View File

@ -213,20 +213,31 @@ TEST_F(VideoProcessingModuleTest, FrameStats)
TEST_F(VideoProcessingModuleTest, PreprocessorLogic)
{
// Disable temporal sampling
// Disable temporal sampling.
int resolution = 100;
_vpm->EnableTemporalDecimation(false);
ASSERT_EQ(VPM_OK, _vpm->SetMaxFrameRate(30));
ASSERT_EQ(VPM_OK, _vpm->SetTargetResolution(100, 100, 15));
EXPECT_EQ(VPM_OK, _vpm->SetMaxFrameRate(30));
EXPECT_EQ(VPM_OK, _vpm->SetTargetResolution(resolution, resolution, 15));
// Revert
_vpm->EnableTemporalDecimation(true);
ASSERT_EQ(VPM_OK, _vpm->SetTargetResolution(100, 100, 30));
// Disable spatial sampling
EXPECT_EQ(VPM_OK, _vpm->SetTargetResolution(resolution, resolution, 30));
// Disable spatial sampling.
_vpm->SetInputFrameResampleMode(kNoRescaling);
ASSERT_EQ(VPM_OK, _vpm->SetTargetResolution(100, 100, 30));
I420VideoFrame *outFrame = NULL;
ASSERT_EQ(VPM_OK, _vpm->PreprocessFrame(_videoFrame, &outFrame));
// No rescaling=> output frame = NULL
ASSERT_TRUE(outFrame == NULL);
EXPECT_EQ(VPM_OK, _vpm->SetTargetResolution(resolution, resolution, 30));
I420VideoFrame* outFrame = NULL;
// Set rescaling => output frame != NULL.
_vpm->SetInputFrameResampleMode(kFastRescaling);
EXPECT_EQ(VPM_OK, _vpm->SetTargetResolution(resolution, resolution, 30));
EXPECT_EQ(VPM_OK, _vpm->PreprocessFrame(_videoFrame, &outFrame));
EXPECT_FALSE(outFrame == NULL);
if (outFrame) {
EXPECT_EQ(resolution, outFrame->width());
EXPECT_EQ(resolution, outFrame->height());
}
// No rescaling=> output frame = NULL.
_vpm->SetInputFrameResampleMode(kNoRescaling);
EXPECT_EQ(VPM_OK, _vpm->PreprocessFrame(_videoFrame, &outFrame));
EXPECT_TRUE(outFrame == NULL);
}
TEST_F(VideoProcessingModuleTest, Resampler)