OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2010 The WebM project authors. All Rights Reserved. | 2 * Copyright (c) 2010 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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 static const int cospi_31_64 = 804; | 74 static const int cospi_31_64 = 804; |
75 | 75 |
76 // 16384 * sqrt(2) * sin(kPi/9) * 2 / 3 | 76 // 16384 * sqrt(2) * sin(kPi/9) * 2 / 3 |
77 static const int sinpi_1_9 = 5283; | 77 static const int sinpi_1_9 = 5283; |
78 static const int sinpi_2_9 = 9929; | 78 static const int sinpi_2_9 = 9929; |
79 static const int sinpi_3_9 = 13377; | 79 static const int sinpi_3_9 = 13377; |
80 static const int sinpi_4_9 = 15212; | 80 static const int sinpi_4_9 = 15212; |
81 | 81 |
82 static INLINE int dct_const_round_shift(int input) { | 82 static INLINE int dct_const_round_shift(int input) { |
83 int rv = ROUND_POWER_OF_TWO(input, DCT_CONST_BITS); | 83 int rv = ROUND_POWER_OF_TWO(input, DCT_CONST_BITS); |
| 84 #if CONFIG_COEFFICIENT_RANGE_CHECKING |
| 85 // For valid VP9 input streams, intermediate stage coefficients should always |
| 86 // stay within the range of a signed 16 bit integer. Coefficients can go out |
| 87 // of this range for invalid/corrupt VP9 streams. However, strictly checking |
| 88 // this range for every intermediate coefficient can burdensome for a decoder, |
| 89 // therefore the following assertion is only enabled when configured with |
| 90 // --enable-coefficient-range-checking. |
| 91 assert(INT16_MIN <= rv); |
| 92 assert(rv <= INT16_MAX); |
| 93 #endif |
84 return (int16_t)rv; | 94 return (int16_t)rv; |
85 } | 95 } |
86 | 96 |
87 typedef void (*transform_1d)(const int16_t*, int16_t*); | 97 typedef void (*transform_1d)(const int16_t*, int16_t*); |
88 | 98 |
89 typedef struct { | 99 typedef struct { |
90 transform_1d cols, rows; // vertical and horizontal | 100 transform_1d cols, rows; // vertical and horizontal |
91 } transform_2d; | 101 } transform_2d; |
92 | 102 |
93 void vp9_iwht4x4_add(const int16_t *input, uint8_t *dest, int stride, int eob); | 103 void vp9_iwht4x4_add(const int16_t *input, uint8_t *dest, int stride, int eob); |
(...skipping 11 matching lines...) Expand all Loading... |
105 int stride, int eob); | 115 int stride, int eob); |
106 void vp9_iht16x16_add(TX_TYPE tx_type, const int16_t *input, uint8_t *dest, | 116 void vp9_iht16x16_add(TX_TYPE tx_type, const int16_t *input, uint8_t *dest, |
107 int stride, int eob); | 117 int stride, int eob); |
108 | 118 |
109 | 119 |
110 #ifdef __cplusplus | 120 #ifdef __cplusplus |
111 } // extern "C" | 121 } // extern "C" |
112 #endif | 122 #endif |
113 | 123 |
114 #endif // VP9_COMMON_VP9_IDCT_H_ | 124 #endif // VP9_COMMON_VP9_IDCT_H_ |
OLD | NEW |