Cleanup of webrtc::VideoFrame.

Delete EqualsFrame method, used only by tests. Delete one of the
CreateFrame methods. Drop return value for CreateEmptyFrame, CreateFrame
and CopyFrame.

BUG=webrtc:5426

Review URL: https://codereview.webrtc.org/1679323002

Cr-Commit-Position: refs/heads/master@{#11783}
This commit is contained in:
nisse
2016-02-26 06:40:39 -08:00
committed by Commit bot
parent c63f79a0a5
commit 208019637b
24 changed files with 216 additions and 200 deletions

View File

@ -14,6 +14,7 @@
#include "webrtc/modules/video_processing/include/video_processing.h"
#include "webrtc/modules/video_processing/test/video_processing_unittest.h"
#include "webrtc/modules/video_processing/video_denoiser.h"
#include "webrtc/test/frame_utils.h"
namespace webrtc {
@ -148,7 +149,7 @@ TEST_F(VideoProcessingTest, Denoiser) {
denoiser_sse_neon.DenoiseFrame(video_frame_, &denoised_frame_sse_neon);
// Denoising results should be the same for C and SSE/NEON denoiser.
ASSERT_EQ(true, denoised_frame_c.EqualsFrame(denoised_frame_sse_neon));
ASSERT_TRUE(test::FramesEqual(denoised_frame_c, denoised_frame_sse_neon));
}
ASSERT_NE(0, feof(source_file_)) << "Error reading source file";
}

View File

@ -69,8 +69,8 @@ void VideoProcessingTest::SetUp() {
vp_ = VideoProcessing::Create();
ASSERT_TRUE(vp_ != NULL);
ASSERT_EQ(0, video_frame_.CreateEmptyFrame(width_, height_, width_,
half_width_, half_width_));
video_frame_.CreateEmptyFrame(width_, height_, width_,
half_width_, half_width_);
// Clear video frame so DrMemory/Valgrind will allow reads of the buffer.
memset(video_frame_.buffer(kYPlane), 0, video_frame_.allocated_size(kYPlane));
memset(video_frame_.buffer(kUPlane), 0, video_frame_.allocated_size(kUPlane));
@ -142,7 +142,7 @@ TEST_F(VideoProcessingTest, IdenticalResultsAfterReset) {
0, kVideoRotation_0, &video_frame_));
vp_->GetFrameStats(video_frame_, &stats);
EXPECT_GT(stats.num_pixels, 0u);
ASSERT_EQ(0, video_frame2.CopyFrame(video_frame_));
video_frame2.CopyFrame(video_frame_);
ASSERT_EQ(0, vp_->Deflickering(&video_frame_, &stats));
// Retrieve frame stats again in case Deflickering() has zeroed them.

View File

@ -70,7 +70,7 @@ void VideoDenoiser::DenoiseFrame(const VideoFrame& frame,
height_ = frame.height();
denoised_frame->CreateFrame(frame.buffer(kYPlane), frame.buffer(kUPlane),
frame.buffer(kVPlane), width_, height_,
stride_y, stride_u, stride_v);
stride_y, stride_u, stride_v, kVideoRotation_0);
// Setting time parameters to the output frame.
denoised_frame->set_timestamp(frame.timestamp());
denoised_frame->set_render_time_ms(frame.render_time_ms());