OLD | NEW |
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 22 matching lines...) Expand all Loading... |
33 #ifdef _MSC_VER | 33 #ifdef _MSC_VER |
34 static int round(double x) { | 34 static int round(double x) { |
35 if (x < 0) | 35 if (x < 0) |
36 return static_cast<int>(ceil(x - 0.5)); | 36 return static_cast<int>(ceil(x - 0.5)); |
37 else | 37 else |
38 return static_cast<int>(floor(x + 0.5)); | 38 return static_cast<int>(floor(x + 0.5)); |
39 } | 39 } |
40 #endif | 40 #endif |
41 | 41 |
42 const int kNumCoeffs = 256; | 42 const int kNumCoeffs = 256; |
43 const double PI = 3.1415926535898; | |
44 void reference2_16x16_idct_2d(double *input, double *output) { | |
45 double x; | |
46 for (int l = 0; l < 16; ++l) { | |
47 for (int k = 0; k < 16; ++k) { | |
48 double s = 0; | |
49 for (int i = 0; i < 16; ++i) { | |
50 for (int j = 0; j < 16; ++j) { | |
51 x = cos(PI * j * (l + 0.5) / 16.0) * | |
52 cos(PI * i * (k + 0.5) / 16.0) * | |
53 input[i * 16 + j] / 256; | |
54 if (i != 0) | |
55 x *= sqrt(2.0); | |
56 if (j != 0) | |
57 x *= sqrt(2.0); | |
58 s += x; | |
59 } | |
60 } | |
61 output[k*16+l] = s; | |
62 } | |
63 } | |
64 } | |
65 | |
66 | |
67 const double C1 = 0.995184726672197; | 43 const double C1 = 0.995184726672197; |
68 const double C2 = 0.98078528040323; | 44 const double C2 = 0.98078528040323; |
69 const double C3 = 0.956940335732209; | 45 const double C3 = 0.956940335732209; |
70 const double C4 = 0.923879532511287; | 46 const double C4 = 0.923879532511287; |
71 const double C5 = 0.881921264348355; | 47 const double C5 = 0.881921264348355; |
72 const double C6 = 0.831469612302545; | 48 const double C6 = 0.831469612302545; |
73 const double C7 = 0.773010453362737; | 49 const double C7 = 0.773010453362737; |
74 const double C8 = 0.707106781186548; | 50 const double C8 = 0.707106781186548; |
75 const double C9 = 0.634393284163646; | 51 const double C9 = 0.634393284163646; |
76 const double C10 = 0.555570233019602; | 52 const double C10 = 0.555570233019602; |
(...skipping 854 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
931 INSTANTIATE_TEST_CASE_P( | 907 INSTANTIATE_TEST_CASE_P( |
932 MSA, Trans16x16HT, | 908 MSA, Trans16x16HT, |
933 ::testing::Values( | 909 ::testing::Values( |
934 make_tuple(&vp9_fht16x16_msa, &vp9_iht16x16_256_add_msa, 0, VPX_BITS_8), | 910 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), | 911 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), | 912 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, | 913 make_tuple(&vp9_fht16x16_msa, &vp9_iht16x16_256_add_msa, 3, |
938 VPX_BITS_8))); | 914 VPX_BITS_8))); |
939 #endif // HAVE_MSA && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE | 915 #endif // HAVE_MSA && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE |
940 } // namespace | 916 } // namespace |
OLD | NEW |