Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(803)

Unified Diff: webrtc/common_video/libyuv/libyuv_unittest.cc

Issue 2765243002: Delete RawVideoType enum, use the VideoType enum instead. (Closed)
Patch Set: Define constant webrtc::kI420, for backwards compatibility. Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/common_video/libyuv/include/webrtc_libyuv.h ('k') | webrtc/common_video/libyuv/webrtc_libyuv.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/common_video/libyuv/libyuv_unittest.cc
diff --git a/webrtc/common_video/libyuv/libyuv_unittest.cc b/webrtc/common_video/libyuv/libyuv_unittest.cc
index 8f421f3038d17c0f8ebad2ebc23ae241a58eaff6..c60085c360483b3ff44fd5bd37d7b52d905898fa 100644
--- a/webrtc/common_video/libyuv/libyuv_unittest.cc
+++ b/webrtc/common_video/libyuv/libyuv_unittest.cc
@@ -53,7 +53,7 @@ TestLibYuv::TestLibYuv()
height_(288),
size_y_(width_ * height_),
size_uv_(((width_ + 1) / 2) * ((height_ + 1) / 2)),
- frame_length_(CalcBufferSize(kI420, 352, 288)) {}
+ frame_length_(CalcBufferSize(VideoType::kI420, 352, 288)) {}
void TestLibYuv::SetUp() {
const std::string input_file_name = webrtc::test::ResourcePath("foreman_cif",
@@ -94,10 +94,11 @@ TEST_F(TestLibYuv, ConvertTest) {
printf("\nConvert #%d I420 <-> I420 \n", j);
std::unique_ptr<uint8_t[]> out_i420_buffer(new uint8_t[frame_length_]);
- EXPECT_EQ(0, ConvertFromI420(*orig_frame_, kI420, 0, out_i420_buffer.get()));
- EXPECT_EQ(0, ConvertToI420(kI420, out_i420_buffer.get(), 0, 0, width_,
- height_, 0, kVideoRotation_0,
- res_i420_buffer.get()));
+ EXPECT_EQ(0, ConvertFromI420(*orig_frame_, VideoType::kI420, 0,
+ out_i420_buffer.get()));
+ EXPECT_EQ(0,
+ ConvertToI420(VideoType::kI420, out_i420_buffer.get(), 0, 0, width_,
+ height_, 0, kVideoRotation_0, res_i420_buffer.get()));
if (PrintVideoFrame(*res_i420_buffer, output_file) < 0) {
return;
@@ -114,11 +115,12 @@ TEST_F(TestLibYuv, ConvertTest) {
Calc16ByteAlignedStride(width_, &stride_y, &stride_uv);
res_i420_buffer =
I420Buffer::Create(width_, height_, stride_y, stride_uv, stride_uv);
- EXPECT_EQ(0, ConvertFromI420(*orig_frame_, kRGB24, 0, res_rgb_buffer2.get()));
+ EXPECT_EQ(0, ConvertFromI420(*orig_frame_, VideoType::kRGB24, 0,
+ res_rgb_buffer2.get()));
- EXPECT_EQ(0, ConvertToI420(kRGB24, res_rgb_buffer2.get(), 0, 0, width_,
- height_, 0, kVideoRotation_0,
- res_i420_buffer.get()));
+ EXPECT_EQ(
+ 0, ConvertToI420(VideoType::kRGB24, res_rgb_buffer2.get(), 0, 0, width_,
+ height_, 0, kVideoRotation_0, res_i420_buffer.get()));
if (PrintVideoFrame(*res_i420_buffer, output_file) < 0) {
return;
@@ -131,10 +133,11 @@ TEST_F(TestLibYuv, ConvertTest) {
printf("\nConvert #%d I420 <-> UYVY\n", j);
std::unique_ptr<uint8_t[]> out_uyvy_buffer(new uint8_t[width_ * height_ * 2]);
- EXPECT_EQ(0, ConvertFromI420(*orig_frame_, kUYVY, 0, out_uyvy_buffer.get()));
- EXPECT_EQ(0, ConvertToI420(kUYVY, out_uyvy_buffer.get(), 0, 0, width_,
- height_, 0, kVideoRotation_0,
- res_i420_buffer.get()));
+ EXPECT_EQ(0, ConvertFromI420(*orig_frame_, VideoType::kUYVY, 0,
+ out_uyvy_buffer.get()));
+ EXPECT_EQ(0,
+ ConvertToI420(VideoType::kUYVY, out_uyvy_buffer.get(), 0, 0, width_,
+ height_, 0, kVideoRotation_0, res_i420_buffer.get()));
psnr = I420PSNR(*orig_frame_->video_frame_buffer(), *res_i420_buffer);
EXPECT_EQ(48.0, psnr);
if (PrintVideoFrame(*res_i420_buffer, output_file) < 0) {
@@ -144,11 +147,12 @@ TEST_F(TestLibYuv, ConvertTest) {
printf("\nConvert #%d I420 <-> YUY2\n", j);
std::unique_ptr<uint8_t[]> out_yuy2_buffer(new uint8_t[width_ * height_ * 2]);
- EXPECT_EQ(0, ConvertFromI420(*orig_frame_, kYUY2, 0, out_yuy2_buffer.get()));
+ EXPECT_EQ(0, ConvertFromI420(*orig_frame_, VideoType::kYUY2, 0,
+ out_yuy2_buffer.get()));
- EXPECT_EQ(0, ConvertToI420(kYUY2, out_yuy2_buffer.get(), 0, 0, width_,
- height_, 0,
- kVideoRotation_0, res_i420_buffer.get()));
+ EXPECT_EQ(0,
+ ConvertToI420(VideoType::kYUY2, out_yuy2_buffer.get(), 0, 0, width_,
+ height_, 0, kVideoRotation_0, res_i420_buffer.get()));
if (PrintVideoFrame(*res_i420_buffer, output_file) < 0) {
return;
@@ -160,12 +164,12 @@ TEST_F(TestLibYuv, ConvertTest) {
printf("\nConvert #%d I420 <-> RGB565\n", j);
std::unique_ptr<uint8_t[]> out_rgb565_buffer(
new uint8_t[width_ * height_ * 2]);
- EXPECT_EQ(0,
- ConvertFromI420(*orig_frame_, kRGB565, 0, out_rgb565_buffer.get()));
+ EXPECT_EQ(0, ConvertFromI420(*orig_frame_, VideoType::kRGB565, 0,
+ out_rgb565_buffer.get()));
- EXPECT_EQ(0, ConvertToI420(kRGB565, out_rgb565_buffer.get(), 0, 0, width_,
- height_, 0,
- kVideoRotation_0, res_i420_buffer.get()));
+ EXPECT_EQ(0, ConvertToI420(VideoType::kRGB565, out_rgb565_buffer.get(), 0, 0,
+ width_, height_, 0, kVideoRotation_0,
+ res_i420_buffer.get()));
if (PrintVideoFrame(*res_i420_buffer, output_file) < 0) {
return;
}
@@ -180,11 +184,11 @@ TEST_F(TestLibYuv, ConvertTest) {
printf("\nConvert #%d I420 <-> ARGB8888\n", j);
std::unique_ptr<uint8_t[]> out_argb8888_buffer(
new uint8_t[width_ * height_ * 4]);
- EXPECT_EQ(0,
- ConvertFromI420(*orig_frame_, kARGB, 0, out_argb8888_buffer.get()));
+ EXPECT_EQ(0, ConvertFromI420(*orig_frame_, VideoType::kARGB, 0,
+ out_argb8888_buffer.get()));
- EXPECT_EQ(0, ConvertToI420(kARGB, out_argb8888_buffer.get(), 0, 0, width_,
- height_, 0, kVideoRotation_0,
+ EXPECT_EQ(0, ConvertToI420(VideoType::kARGB, out_argb8888_buffer.get(), 0, 0,
+ width_, height_, 0, kVideoRotation_0,
res_i420_buffer.get()));
if (PrintVideoFrame(*res_i420_buffer, output_file) < 0) {
@@ -215,11 +219,11 @@ TEST_F(TestLibYuv, ConvertAlignedFrame) {
rtc::scoped_refptr<I420Buffer> res_i420_buffer =
I420Buffer::Create(width_, height_, stride_y, stride_uv, stride_uv);
std::unique_ptr<uint8_t[]> out_i420_buffer(new uint8_t[frame_length_]);
- EXPECT_EQ(0, ConvertFromI420(*orig_frame_, kI420, 0,
+ EXPECT_EQ(0, ConvertFromI420(*orig_frame_, VideoType::kI420, 0,
out_i420_buffer.get()));
- EXPECT_EQ(0, ConvertToI420(kI420, out_i420_buffer.get(), 0, 0, width_,
- height_, 0, kVideoRotation_0,
- res_i420_buffer.get()));
+ EXPECT_EQ(0,
+ ConvertToI420(VideoType::kI420, out_i420_buffer.get(), 0, 0, width_,
+ height_, 0, kVideoRotation_0, res_i420_buffer.get()));
if (PrintVideoFrame(*res_i420_buffer, output_file) < 0) {
return;
@@ -242,17 +246,17 @@ TEST_F(TestLibYuv, RotateTest) {
Calc16ByteAlignedStride(rotated_width, &stride_y, &stride_uv);
rtc::scoped_refptr<I420Buffer> rotated_res_i420_buffer = I420Buffer::Create(
rotated_width, rotated_height, stride_y, stride_uv, stride_uv);
- EXPECT_EQ(0, ConvertToI420(kI420, orig_buffer, 0, 0, width_, height_,
- 0, kVideoRotation_90,
- rotated_res_i420_buffer.get()));
- EXPECT_EQ(0, ConvertToI420(kI420, orig_buffer, 0, 0, width_, height_,
- 0, kVideoRotation_270,
- rotated_res_i420_buffer.get()));
+ EXPECT_EQ(
+ 0, ConvertToI420(VideoType::kI420, orig_buffer, 0, 0, width_, height_, 0,
+ kVideoRotation_90, rotated_res_i420_buffer.get()));
+ EXPECT_EQ(
+ 0, ConvertToI420(VideoType::kI420, orig_buffer, 0, 0, width_, height_, 0,
+ kVideoRotation_270, rotated_res_i420_buffer.get()));
rotated_res_i420_buffer = I420Buffer::Create(
width_, height_, width_, (width_ + 1) / 2, (width_ + 1) / 2);
- EXPECT_EQ(0, ConvertToI420(kI420, orig_buffer, 0, 0, width_, height_,
- 0, kVideoRotation_180,
- rotated_res_i420_buffer.get()));
+ EXPECT_EQ(
+ 0, ConvertToI420(VideoType::kI420, orig_buffer, 0, 0, width_, height_, 0,
+ kVideoRotation_180, rotated_res_i420_buffer.get()));
}
static uint8_t Average(int a, int b, int c, int d) {
« no previous file with comments | « webrtc/common_video/libyuv/include/webrtc_libyuv.h ('k') | webrtc/common_video/libyuv/webrtc_libyuv.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698