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

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

Issue 2021843002: Delete unused code in webrtc_libyuv.cc. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Copy Calc16ByteAlignedStride. Created 4 years, 7 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 e45b5334704adce58a9b5d368a6e14b0b9e93345..ab36559ba557d54912ea5f5544acf0e264bd7b32 100644
--- a/webrtc/common_video/libyuv/libyuv_unittest.cc
+++ b/webrtc/common_video/libyuv/libyuv_unittest.cc
@@ -20,6 +20,14 @@
namespace webrtc {
+namespace {
+void Calc16ByteAlignedStride(int width, int* stride_y, int* stride_uv) {
+ *stride_y = 16 * ((width + 15) / 16);
+ *stride_uv = 16 * ((width + 31) / 32);
+}
+
+} // Anonymous namespace
+
class TestLibYuv : public ::testing::Test {
protected:
TestLibYuv();
@@ -139,29 +147,6 @@ TEST_F(TestLibYuv, ConvertTest) {
}
j++;
- printf("\nConvert #%d I420 <-> YV12\n", j);
- 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(),
- outYV120Buffer.get() + size_y_,
- outYV120Buffer.get() + size_y_ + size_uv_,
- width_, height_,
- width_, (width_ + 1) / 2, (width_ + 1) / 2,
- kVideoRotation_0);
- EXPECT_EQ(0, ConvertFromYV12(yv12_frame, kI420, 0, res_i420_buffer.get()));
- if (fwrite(res_i420_buffer.get(), 1, frame_length_, output_file) !=
- frame_length_) {
- return;
- }
-
- ConvertToI420(kI420, res_i420_buffer.get(), 0, 0, width_, height_, 0,
- kVideoRotation_0, &res_i420_frame);
- psnr = I420PSNR(&orig_frame_, &res_i420_frame);
- EXPECT_EQ(48.0, psnr);
- j++;
-
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()));
@@ -269,28 +254,4 @@ TEST_F(TestLibYuv, RotateTest) {
0, kVideoRotation_180, &rotated_res_i420_frame));
}
-TEST_F(TestLibYuv, alignment) {
- int value = 0x3FF; // 1023
- EXPECT_EQ(0x400, AlignInt(value, 128)); // Low 7 bits are zero.
- EXPECT_EQ(0x400, AlignInt(value, 64)); // Low 6 bits are zero.
- EXPECT_EQ(0x400, AlignInt(value, 32)); // Low 5 bits are zero.
-}
-
-TEST_F(TestLibYuv, StrideAlignment) {
- int stride_y = 0;
- int stride_uv = 0;
- int width = 52;
- Calc16ByteAlignedStride(width, &stride_y, &stride_uv);
- EXPECT_EQ(64, stride_y);
- EXPECT_EQ(32, stride_uv);
- width = 128;
- Calc16ByteAlignedStride(width, &stride_y, &stride_uv);
- EXPECT_EQ(128, stride_y);
- EXPECT_EQ(64, stride_uv);
- width = 127;
- Calc16ByteAlignedStride(width, &stride_y, &stride_uv);
- EXPECT_EQ(128, stride_y);
- EXPECT_EQ(64, stride_uv);
-}
-
} // namespace webrtc
« 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