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

Side by Side Diff: source/libvpx/test/dct16x16_test.cc

Issue 1302353004: libvpx: Pull from upstream (Closed) Base URL: https://chromium.googlesource.com/chromium/deps/libvpx.git@master
Patch Set: Created 5 years, 3 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
« no previous file with comments | « source/libvpx/test/datarate_test.cc ('k') | source/libvpx/test/dct32x32_test.cc » ('j') | 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 (c) 2012 The WebM project authors. All Rights Reserved. 2 * Copyright (c) 2012 The WebM 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 259 matching lines...) Expand 10 before | Expand all | Expand 10 after
270 typedef std::tr1::tuple<IdctFunc, IdctFunc, int, vpx_bit_depth_t> 270 typedef std::tr1::tuple<IdctFunc, IdctFunc, int, vpx_bit_depth_t>
271 Idct16x16Param; 271 Idct16x16Param;
272 272
273 void fdct16x16_ref(const int16_t *in, tran_low_t *out, int stride, 273 void fdct16x16_ref(const int16_t *in, tran_low_t *out, int stride,
274 int /*tx_type*/) { 274 int /*tx_type*/) {
275 vpx_fdct16x16_c(in, out, stride); 275 vpx_fdct16x16_c(in, out, stride);
276 } 276 }
277 277
278 void idct16x16_ref(const tran_low_t *in, uint8_t *dest, int stride, 278 void idct16x16_ref(const tran_low_t *in, uint8_t *dest, int stride,
279 int /*tx_type*/) { 279 int /*tx_type*/) {
280 vp9_idct16x16_256_add_c(in, dest, stride); 280 vpx_idct16x16_256_add_c(in, dest, stride);
281 } 281 }
282 282
283 void fht16x16_ref(const int16_t *in, tran_low_t *out, int stride, 283 void fht16x16_ref(const int16_t *in, tran_low_t *out, int stride,
284 int tx_type) { 284 int tx_type) {
285 vp9_fht16x16_c(in, out, stride, tx_type); 285 vp9_fht16x16_c(in, out, stride, tx_type);
286 } 286 }
287 287
288 void iht16x16_ref(const tran_low_t *in, uint8_t *dest, int stride, 288 void iht16x16_ref(const tran_low_t *in, uint8_t *dest, int stride,
289 int tx_type) { 289 int tx_type) {
290 vp9_iht16x16_256_add_c(in, dest, stride, tx_type); 290 vp9_iht16x16_256_add_c(in, dest, stride, tx_type);
291 } 291 }
292 292
293 #if CONFIG_VP9_HIGHBITDEPTH 293 #if CONFIG_VP9_HIGHBITDEPTH
294 void idct16x16_10(const tran_low_t *in, uint8_t *out, int stride) { 294 void idct16x16_10(const tran_low_t *in, uint8_t *out, int stride) {
295 vp9_highbd_idct16x16_256_add_c(in, out, stride, 10); 295 vpx_highbd_idct16x16_256_add_c(in, out, stride, 10);
296 } 296 }
297 297
298 void idct16x16_12(const tran_low_t *in, uint8_t *out, int stride) { 298 void idct16x16_12(const tran_low_t *in, uint8_t *out, int stride) {
299 vp9_highbd_idct16x16_256_add_c(in, out, stride, 12); 299 vpx_highbd_idct16x16_256_add_c(in, out, stride, 12);
300 } 300 }
301 301
302 void idct16x16_10_ref(const tran_low_t *in, uint8_t *out, int stride, 302 void idct16x16_10_ref(const tran_low_t *in, uint8_t *out, int stride,
303 int tx_type) { 303 int tx_type) {
304 idct16x16_10(in, out, stride); 304 idct16x16_10(in, out, stride);
305 } 305 }
306 306
307 void idct16x16_12_ref(const tran_low_t *in, uint8_t *out, int stride, 307 void idct16x16_12_ref(const tran_low_t *in, uint8_t *out, int stride,
308 int tx_type) { 308 int tx_type) {
309 idct16x16_12(in, out, stride); 309 idct16x16_12(in, out, stride);
310 } 310 }
311 311
312 void iht16x16_10(const tran_low_t *in, uint8_t *out, int stride, int tx_type) { 312 void iht16x16_10(const tran_low_t *in, uint8_t *out, int stride, int tx_type) {
313 vp9_highbd_iht16x16_256_add_c(in, out, stride, tx_type, 10); 313 vp9_highbd_iht16x16_256_add_c(in, out, stride, tx_type, 10);
314 } 314 }
315 315
316 void iht16x16_12(const tran_low_t *in, uint8_t *out, int stride, int tx_type) { 316 void iht16x16_12(const tran_low_t *in, uint8_t *out, int stride, int tx_type) {
317 vp9_highbd_iht16x16_256_add_c(in, out, stride, tx_type, 12); 317 vp9_highbd_iht16x16_256_add_c(in, out, stride, tx_type, 12);
318 } 318 }
319 319
320 void idct16x16_10_add_10_c(const tran_low_t *in, uint8_t *out, int stride) { 320 void idct16x16_10_add_10_c(const tran_low_t *in, uint8_t *out, int stride) {
321 vp9_highbd_idct16x16_10_add_c(in, out, stride, 10); 321 vpx_highbd_idct16x16_10_add_c(in, out, stride, 10);
322 } 322 }
323 323
324 void idct16x16_10_add_12_c(const tran_low_t *in, uint8_t *out, int stride) { 324 void idct16x16_10_add_12_c(const tran_low_t *in, uint8_t *out, int stride) {
325 vp9_highbd_idct16x16_10_add_c(in, out, stride, 12); 325 vpx_highbd_idct16x16_10_add_c(in, out, stride, 12);
326 } 326 }
327 327
328 #if HAVE_SSE2 328 #if HAVE_SSE2
329 void idct16x16_256_add_10_sse2(const tran_low_t *in, uint8_t *out, int stride) { 329 void idct16x16_256_add_10_sse2(const tran_low_t *in, uint8_t *out, int stride) {
330 vp9_highbd_idct16x16_256_add_sse2(in, out, stride, 10); 330 vpx_highbd_idct16x16_256_add_sse2(in, out, stride, 10);
331 } 331 }
332 332
333 void idct16x16_256_add_12_sse2(const tran_low_t *in, uint8_t *out, int stride) { 333 void idct16x16_256_add_12_sse2(const tran_low_t *in, uint8_t *out, int stride) {
334 vp9_highbd_idct16x16_256_add_sse2(in, out, stride, 12); 334 vpx_highbd_idct16x16_256_add_sse2(in, out, stride, 12);
335 } 335 }
336 336
337 void idct16x16_10_add_10_sse2(const tran_low_t *in, uint8_t *out, int stride) { 337 void idct16x16_10_add_10_sse2(const tran_low_t *in, uint8_t *out, int stride) {
338 vp9_highbd_idct16x16_10_add_sse2(in, out, stride, 10); 338 vpx_highbd_idct16x16_10_add_sse2(in, out, stride, 10);
339 } 339 }
340 340
341 void idct16x16_10_add_12_sse2(const tran_low_t *in, uint8_t *out, int stride) { 341 void idct16x16_10_add_12_sse2(const tran_low_t *in, uint8_t *out, int stride) {
342 vp9_highbd_idct16x16_10_add_sse2(in, out, stride, 12); 342 vpx_highbd_idct16x16_10_add_sse2(in, out, stride, 12);
343 } 343 }
344 #endif // HAVE_SSE2 344 #endif // HAVE_SSE2
345 #endif // CONFIG_VP9_HIGHBITDEPTH 345 #endif // CONFIG_VP9_HIGHBITDEPTH
346 346
347 class Trans16x16TestBase { 347 class Trans16x16TestBase {
348 public: 348 public:
349 virtual ~Trans16x16TestBase() {} 349 virtual ~Trans16x16TestBase() {}
350 350
351 protected: 351 protected:
352 virtual void RunFwdTxfm(int16_t *in, tran_low_t *out, int stride) = 0; 352 virtual void RunFwdTxfm(int16_t *in, tran_low_t *out, int stride) = 0;
(...skipping 464 matching lines...) Expand 10 before | Expand all | Expand 10 after
817 } 817 }
818 818
819 using std::tr1::make_tuple; 819 using std::tr1::make_tuple;
820 820
821 #if CONFIG_VP9_HIGHBITDEPTH 821 #if CONFIG_VP9_HIGHBITDEPTH
822 INSTANTIATE_TEST_CASE_P( 822 INSTANTIATE_TEST_CASE_P(
823 C, Trans16x16DCT, 823 C, Trans16x16DCT,
824 ::testing::Values( 824 ::testing::Values(
825 make_tuple(&vpx_highbd_fdct16x16_c, &idct16x16_10, 0, VPX_BITS_10), 825 make_tuple(&vpx_highbd_fdct16x16_c, &idct16x16_10, 0, VPX_BITS_10),
826 make_tuple(&vpx_highbd_fdct16x16_c, &idct16x16_12, 0, VPX_BITS_12), 826 make_tuple(&vpx_highbd_fdct16x16_c, &idct16x16_12, 0, VPX_BITS_12),
827 make_tuple(&vpx_fdct16x16_c, &vp9_idct16x16_256_add_c, 0, VPX_BITS_8))); 827 make_tuple(&vpx_fdct16x16_c, &vpx_idct16x16_256_add_c, 0, VPX_BITS_8)));
828 #else 828 #else
829 INSTANTIATE_TEST_CASE_P( 829 INSTANTIATE_TEST_CASE_P(
830 C, Trans16x16DCT, 830 C, Trans16x16DCT,
831 ::testing::Values( 831 ::testing::Values(
832 make_tuple(&vpx_fdct16x16_c, &vp9_idct16x16_256_add_c, 0, VPX_BITS_8))); 832 make_tuple(&vpx_fdct16x16_c, &vpx_idct16x16_256_add_c, 0, VPX_BITS_8)));
833 #endif // CONFIG_VP9_HIGHBITDEPTH 833 #endif // CONFIG_VP9_HIGHBITDEPTH
834 834
835 #if CONFIG_VP9_HIGHBITDEPTH 835 #if CONFIG_VP9_HIGHBITDEPTH
836 INSTANTIATE_TEST_CASE_P( 836 INSTANTIATE_TEST_CASE_P(
837 C, Trans16x16HT, 837 C, Trans16x16HT,
838 ::testing::Values( 838 ::testing::Values(
839 make_tuple(&vp9_highbd_fht16x16_c, &iht16x16_10, 0, VPX_BITS_10), 839 make_tuple(&vp9_highbd_fht16x16_c, &iht16x16_10, 0, VPX_BITS_10),
840 make_tuple(&vp9_highbd_fht16x16_c, &iht16x16_10, 1, VPX_BITS_10), 840 make_tuple(&vp9_highbd_fht16x16_c, &iht16x16_10, 1, VPX_BITS_10),
841 make_tuple(&vp9_highbd_fht16x16_c, &iht16x16_10, 2, VPX_BITS_10), 841 make_tuple(&vp9_highbd_fht16x16_c, &iht16x16_10, 2, VPX_BITS_10),
842 make_tuple(&vp9_highbd_fht16x16_c, &iht16x16_10, 3, VPX_BITS_10), 842 make_tuple(&vp9_highbd_fht16x16_c, &iht16x16_10, 3, VPX_BITS_10),
(...skipping 13 matching lines...) Expand all
856 make_tuple(&vp9_fht16x16_c, &vp9_iht16x16_256_add_c, 1, VPX_BITS_8), 856 make_tuple(&vp9_fht16x16_c, &vp9_iht16x16_256_add_c, 1, VPX_BITS_8),
857 make_tuple(&vp9_fht16x16_c, &vp9_iht16x16_256_add_c, 2, VPX_BITS_8), 857 make_tuple(&vp9_fht16x16_c, &vp9_iht16x16_256_add_c, 2, VPX_BITS_8),
858 make_tuple(&vp9_fht16x16_c, &vp9_iht16x16_256_add_c, 3, VPX_BITS_8))); 858 make_tuple(&vp9_fht16x16_c, &vp9_iht16x16_256_add_c, 3, VPX_BITS_8)));
859 #endif // CONFIG_VP9_HIGHBITDEPTH 859 #endif // CONFIG_VP9_HIGHBITDEPTH
860 860
861 #if HAVE_NEON_ASM && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE 861 #if HAVE_NEON_ASM && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
862 INSTANTIATE_TEST_CASE_P( 862 INSTANTIATE_TEST_CASE_P(
863 NEON, Trans16x16DCT, 863 NEON, Trans16x16DCT,
864 ::testing::Values( 864 ::testing::Values(
865 make_tuple(&vpx_fdct16x16_c, 865 make_tuple(&vpx_fdct16x16_c,
866 &vp9_idct16x16_256_add_neon, 0, VPX_BITS_8))); 866 &vpx_idct16x16_256_add_neon, 0, VPX_BITS_8)));
867 #endif 867 #endif
868 868
869 #if HAVE_SSE2 && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE 869 #if HAVE_SSE2 && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
870 INSTANTIATE_TEST_CASE_P( 870 INSTANTIATE_TEST_CASE_P(
871 SSE2, Trans16x16DCT, 871 SSE2, Trans16x16DCT,
872 ::testing::Values( 872 ::testing::Values(
873 make_tuple(&vpx_fdct16x16_sse2, 873 make_tuple(&vpx_fdct16x16_sse2,
874 &vp9_idct16x16_256_add_sse2, 0, VPX_BITS_8))); 874 &vpx_idct16x16_256_add_sse2, 0, VPX_BITS_8)));
875 INSTANTIATE_TEST_CASE_P( 875 INSTANTIATE_TEST_CASE_P(
876 SSE2, Trans16x16HT, 876 SSE2, Trans16x16HT,
877 ::testing::Values( 877 ::testing::Values(
878 make_tuple(&vp9_fht16x16_sse2, &vp9_iht16x16_256_add_sse2, 0, 878 make_tuple(&vp9_fht16x16_sse2, &vp9_iht16x16_256_add_sse2, 0,
879 VPX_BITS_8), 879 VPX_BITS_8),
880 make_tuple(&vp9_fht16x16_sse2, &vp9_iht16x16_256_add_sse2, 1, 880 make_tuple(&vp9_fht16x16_sse2, &vp9_iht16x16_256_add_sse2, 1,
881 VPX_BITS_8), 881 VPX_BITS_8),
882 make_tuple(&vp9_fht16x16_sse2, &vp9_iht16x16_256_add_sse2, 2, 882 make_tuple(&vp9_fht16x16_sse2, &vp9_iht16x16_256_add_sse2, 2,
883 VPX_BITS_8), 883 VPX_BITS_8),
884 make_tuple(&vp9_fht16x16_sse2, &vp9_iht16x16_256_add_sse2, 3, 884 make_tuple(&vp9_fht16x16_sse2, &vp9_iht16x16_256_add_sse2, 3,
885 VPX_BITS_8))); 885 VPX_BITS_8)));
886 #endif // HAVE_SSE2 && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE 886 #endif // HAVE_SSE2 && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
887 887
888 #if HAVE_SSE2 && CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE 888 #if HAVE_SSE2 && CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
889 INSTANTIATE_TEST_CASE_P( 889 INSTANTIATE_TEST_CASE_P(
890 SSE2, Trans16x16DCT, 890 SSE2, Trans16x16DCT,
891 ::testing::Values( 891 ::testing::Values(
892 make_tuple(&vpx_highbd_fdct16x16_sse2, 892 make_tuple(&vpx_highbd_fdct16x16_sse2,
893 &idct16x16_10, 0, VPX_BITS_10), 893 &idct16x16_10, 0, VPX_BITS_10),
894 make_tuple(&vpx_highbd_fdct16x16_c, 894 make_tuple(&vpx_highbd_fdct16x16_c,
895 &idct16x16_256_add_10_sse2, 0, VPX_BITS_10), 895 &idct16x16_256_add_10_sse2, 0, VPX_BITS_10),
896 make_tuple(&vpx_highbd_fdct16x16_sse2, 896 make_tuple(&vpx_highbd_fdct16x16_sse2,
897 &idct16x16_12, 0, VPX_BITS_12), 897 &idct16x16_12, 0, VPX_BITS_12),
898 make_tuple(&vpx_highbd_fdct16x16_c, 898 make_tuple(&vpx_highbd_fdct16x16_c,
899 &idct16x16_256_add_12_sse2, 0, VPX_BITS_12), 899 &idct16x16_256_add_12_sse2, 0, VPX_BITS_12),
900 make_tuple(&vpx_fdct16x16_sse2, 900 make_tuple(&vpx_fdct16x16_sse2,
901 &vp9_idct16x16_256_add_c, 0, VPX_BITS_8))); 901 &vpx_idct16x16_256_add_c, 0, VPX_BITS_8)));
902 INSTANTIATE_TEST_CASE_P( 902 INSTANTIATE_TEST_CASE_P(
903 SSE2, Trans16x16HT, 903 SSE2, Trans16x16HT,
904 ::testing::Values( 904 ::testing::Values(
905 make_tuple(&vp9_fht16x16_sse2, &vp9_iht16x16_256_add_c, 0, VPX_BITS_8), 905 make_tuple(&vp9_fht16x16_sse2, &vp9_iht16x16_256_add_c, 0, VPX_BITS_8),
906 make_tuple(&vp9_fht16x16_sse2, &vp9_iht16x16_256_add_c, 1, VPX_BITS_8), 906 make_tuple(&vp9_fht16x16_sse2, &vp9_iht16x16_256_add_c, 1, VPX_BITS_8),
907 make_tuple(&vp9_fht16x16_sse2, &vp9_iht16x16_256_add_c, 2, VPX_BITS_8), 907 make_tuple(&vp9_fht16x16_sse2, &vp9_iht16x16_256_add_c, 2, VPX_BITS_8),
908 make_tuple(&vp9_fht16x16_sse2, &vp9_iht16x16_256_add_c, 3, 908 make_tuple(&vp9_fht16x16_sse2, &vp9_iht16x16_256_add_c, 3,
909 VPX_BITS_8))); 909 VPX_BITS_8)));
910 // Optimizations take effect at a threshold of 3155, so we use a value close to 910 // Optimizations take effect at a threshold of 3155, so we use a value close to
911 // that to test both branches. 911 // that to test both branches.
912 INSTANTIATE_TEST_CASE_P( 912 INSTANTIATE_TEST_CASE_P(
913 SSE2, InvTrans16x16DCT, 913 SSE2, InvTrans16x16DCT,
914 ::testing::Values( 914 ::testing::Values(
915 make_tuple(&idct16x16_10_add_10_c, 915 make_tuple(&idct16x16_10_add_10_c,
916 &idct16x16_10_add_10_sse2, 3167, VPX_BITS_10), 916 &idct16x16_10_add_10_sse2, 3167, VPX_BITS_10),
917 make_tuple(&idct16x16_10, 917 make_tuple(&idct16x16_10,
918 &idct16x16_256_add_10_sse2, 3167, VPX_BITS_10), 918 &idct16x16_256_add_10_sse2, 3167, VPX_BITS_10),
919 make_tuple(&idct16x16_10_add_12_c, 919 make_tuple(&idct16x16_10_add_12_c,
920 &idct16x16_10_add_12_sse2, 3167, VPX_BITS_12), 920 &idct16x16_10_add_12_sse2, 3167, VPX_BITS_12),
921 make_tuple(&idct16x16_12, 921 make_tuple(&idct16x16_12,
922 &idct16x16_256_add_12_sse2, 3167, VPX_BITS_12))); 922 &idct16x16_256_add_12_sse2, 3167, VPX_BITS_12)));
923 #endif // HAVE_SSE2 && CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE 923 #endif // HAVE_SSE2 && CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
924 924
925 #if HAVE_MSA && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE 925 #if HAVE_MSA && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
926 INSTANTIATE_TEST_CASE_P( 926 INSTANTIATE_TEST_CASE_P(
927 MSA, Trans16x16DCT, 927 MSA, Trans16x16DCT,
928 ::testing::Values( 928 ::testing::Values(
929 make_tuple(&vpx_fdct16x16_msa, 929 make_tuple(&vpx_fdct16x16_msa,
930 &vp9_idct16x16_256_add_msa, 0, VPX_BITS_8))); 930 &vpx_idct16x16_256_add_msa, 0, VPX_BITS_8)));
931 INSTANTIATE_TEST_CASE_P( 931 INSTANTIATE_TEST_CASE_P(
932 MSA, Trans16x16HT, 932 MSA, Trans16x16HT,
933 ::testing::Values( 933 ::testing::Values(
934 make_tuple(&vp9_fht16x16_msa, &vp9_iht16x16_256_add_msa, 0, VPX_BITS_8), 934 make_tuple(&vp9_fht16x16_msa, &vp9_iht16x16_256_add_msa, 0, VPX_BITS_8),
935 make_tuple(&vp9_fht16x16_msa, &vp9_iht16x16_256_add_msa, 1, VPX_BITS_8), 935 make_tuple(&vp9_fht16x16_msa, &vp9_iht16x16_256_add_msa, 1, VPX_BITS_8),
936 make_tuple(&vp9_fht16x16_msa, &vp9_iht16x16_256_add_msa, 2, VPX_BITS_8), 936 make_tuple(&vp9_fht16x16_msa, &vp9_iht16x16_256_add_msa, 2, VPX_BITS_8),
937 make_tuple(&vp9_fht16x16_msa, &vp9_iht16x16_256_add_msa, 3, 937 make_tuple(&vp9_fht16x16_msa, &vp9_iht16x16_256_add_msa, 3,
938 VPX_BITS_8))); 938 VPX_BITS_8)));
939 #endif // HAVE_MSA && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE 939 #endif // HAVE_MSA && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
940 } // namespace 940 } // namespace
OLDNEW
« no previous file with comments | « source/libvpx/test/datarate_test.cc ('k') | source/libvpx/test/dct32x32_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698