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 9fad44f91d398facbb0ef80844b65487112fa860..9f92b8bb15cf19f4ef6e9d8623aeb907ba3c3fd5 100644 |
--- a/webrtc/common_video/libyuv/libyuv_unittest.cc |
+++ b/webrtc/common_video/libyuv/libyuv_unittest.cc |
@@ -11,8 +11,9 @@ |
#include <math.h> |
#include <string.h> |
+#include <memory> |
+ |
#include "testing/gtest/include/gtest/gtest.h" |
-#include "webrtc/base/scoped_ptr.h" |
#include "webrtc/common_video/libyuv/include/webrtc_libyuv.h" |
#include "webrtc/system_wrappers/include/tick_util.h" |
#include "webrtc/test/testsupport/fileutils.h" |
@@ -83,7 +84,7 @@ class TestLibYuv : public ::testing::Test { |
FILE* source_file_; |
VideoFrame orig_frame_; |
- rtc::scoped_ptr<uint8_t[]> orig_buffer_; |
+ std::unique_ptr<uint8_t[]> orig_buffer_; |
const int width_; |
const int height_; |
const int size_y_; |
@@ -147,7 +148,7 @@ TEST_F(TestLibYuv, ConvertTest) { |
(width_ + 1) / 2, |
(width_ + 1) / 2); |
printf("\nConvert #%d I420 <-> I420 \n", j); |
- rtc::scoped_ptr<uint8_t[]> out_i420_buffer(new uint8_t[frame_length_]); |
+ 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_, |
@@ -161,7 +162,7 @@ TEST_F(TestLibYuv, ConvertTest) { |
j++; |
printf("\nConvert #%d I420 <-> RGB24\n", j); |
- rtc::scoped_ptr<uint8_t[]> res_rgb_buffer2(new uint8_t[width_ * height_ * 3]); |
+ std::unique_ptr<uint8_t[]> res_rgb_buffer2(new uint8_t[width_ * height_ * 3]); |
// Align the stride values for the output frame. |
int stride_y = 0; |
int stride_uv = 0; |
@@ -183,7 +184,7 @@ TEST_F(TestLibYuv, ConvertTest) { |
j++; |
printf("\nConvert #%d I420 <-> UYVY\n", j); |
- rtc::scoped_ptr<uint8_t[]> out_uyvy_buffer(new uint8_t[width_ * height_ * 2]); |
+ 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_frame)); |
@@ -195,8 +196,8 @@ TEST_F(TestLibYuv, ConvertTest) { |
j++; |
printf("\nConvert #%d I420 <-> YV12\n", j); |
- rtc::scoped_ptr<uint8_t[]> outYV120Buffer(new uint8_t[frame_length_]); |
- rtc::scoped_ptr<uint8_t[]> res_i420_buffer(new uint8_t[frame_length_]); |
+ std::unique_ptr<uint8_t[]> outYV120Buffer(new uint8_t[frame_length_]); |
+ std::unique_ptr<uint8_t[]> res_i420_buffer(new uint8_t[frame_length_]); |
VideoFrame yv12_frame; |
EXPECT_EQ(0, ConvertFromI420(orig_frame_, kYV12, 0, outYV120Buffer.get())); |
yv12_frame.CreateFrame(outYV120Buffer.get(), |
@@ -218,7 +219,7 @@ TEST_F(TestLibYuv, ConvertTest) { |
j++; |
printf("\nConvert #%d I420 <-> YUY2\n", j); |
- rtc::scoped_ptr<uint8_t[]> out_yuy2_buffer(new uint8_t[width_ * height_ * 2]); |
+ 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, ConvertToI420(kYUY2, out_yuy2_buffer.get(), 0, 0, width_, |
@@ -231,7 +232,7 @@ TEST_F(TestLibYuv, ConvertTest) { |
psnr = I420PSNR(&orig_frame_, &res_i420_frame); |
EXPECT_EQ(48.0, psnr); |
printf("\nConvert #%d I420 <-> RGB565\n", j); |
- rtc::scoped_ptr<uint8_t[]> out_rgb565_buffer( |
+ 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())); |
@@ -251,7 +252,7 @@ TEST_F(TestLibYuv, ConvertTest) { |
EXPECT_GT(ceil(psnr), 40); |
printf("\nConvert #%d I420 <-> ARGB8888\n", j); |
- rtc::scoped_ptr<uint8_t[]> out_argb8888_buffer( |
+ 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())); |
@@ -285,7 +286,7 @@ TEST_F(TestLibYuv, ConvertAlignedFrame) { |
Calc16ByteAlignedStride(width_, &stride_y, &stride_uv); |
res_i420_frame.CreateEmptyFrame(width_, height_, |
stride_y, stride_uv, stride_uv); |
- rtc::scoped_ptr<uint8_t[]> out_i420_buffer(new uint8_t[frame_length_]); |
+ 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_, |