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

Side by Side Diff: unit_test/convert_test.cc

Issue 2620183002: ConvertToARGB: Allows rotation on ARGB input (Closed)
Patch Set: Created 3 years, 11 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 unified diff | Download patch
« source/convert_to_argb.cc ('K') | « source/convert_to_argb.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2011 The LibYuv Project Authors. All rights reserved. 2 * Copyright 2011 The LibYuv Project Authors. All rights reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 1867 matching lines...) Expand 10 before | Expand all | Expand 10 after
1878 TESTQPLANARTOEI(FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, FMT_B, SUB_B, BPP_B, \ 1878 TESTQPLANARTOEI(FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, FMT_B, SUB_B, BPP_B, \
1879 benchmark_width_, _Invert, -, 0, FMT_C, BPP_C, 0) \ 1879 benchmark_width_, _Invert, -, 0, FMT_C, BPP_C, 0) \
1880 TESTQPLANARTOEI(FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, FMT_B, SUB_B, BPP_B, \ 1880 TESTQPLANARTOEI(FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, FMT_B, SUB_B, BPP_B, \
1881 benchmark_width_, _Opt, +, 0, FMT_C, BPP_C, 0) \ 1881 benchmark_width_, _Opt, +, 0, FMT_C, BPP_C, 0) \
1882 TESTQPLANARTOEI(FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, FMT_B, SUB_B, BPP_B, \ 1882 TESTQPLANARTOEI(FMT_PLANAR, SUBSAMP_X, SUBSAMP_Y, FMT_B, SUB_B, BPP_B, \
1883 benchmark_width_, _Premult, +, 0, FMT_C, BPP_C, 1) 1883 benchmark_width_, _Premult, +, 0, FMT_C, BPP_C, 1)
1884 1884
1885 TESTQPLANARTOE(I420Alpha, 2, 2, ARGB, 1, 4, ABGR, 4) 1885 TESTQPLANARTOE(I420Alpha, 2, 2, ARGB, 1, 4, ABGR, 4)
1886 TESTQPLANARTOE(I420Alpha, 2, 2, ABGR, 1, 4, ARGB, 4) 1886 TESTQPLANARTOE(I420Alpha, 2, 2, ABGR, 1, 4, ARGB, 4)
1887 1887
1888 TEST_F(LibYUVConvertTest, RotateWithARGBSource) {
1889 // 2x2 frames
1890 uint32_t src[4];
1891 uint32_t dst[4];
1892 // some random input
1893 src[0] = 0x11000000;
1894 src[1] = 0x00450000;
1895 src[2] = 0x00009f00;
1896 src[3] = 0x000000ff;
1897 // zeros on destination
1898 dst[0] = 0x00000000;
1899 dst[1] = 0x00000000;
1900 dst[2] = 0x00000000;
1901 dst[3] = 0x00000000;
1902
1903 int r = ConvertToARGB(
1904 reinterpret_cast<uint8_t*>(src),
1905 16, // input size
1906 reinterpret_cast<uint8_t*>(dst),
1907 8, // destination stride
1908 0, // crop_x
1909 0, // crop_y
1910 2, // width
1911 2, // height
1912 2, // crop width
1913 2, // crop height
1914 kRotate90, FOURCC_ARGB);
1915
1916 EXPECT_EQ(r, 0);
1917 // 90 degrees rotation, no conversion
1918 EXPECT_EQ(dst[0], src[2]);
1919 EXPECT_EQ(dst[1], src[0]);
1920 EXPECT_EQ(dst[2], src[3]);
1921 EXPECT_EQ(dst[3], src[1]);
1922 }
1923
1888 } // namespace libyuv 1924 } // namespace libyuv
OLDNEW
« source/convert_to_argb.cc ('K') | « source/convert_to_argb.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698