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) { |