OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2013 The WebM project authors. All Rights Reserved. | 2 * Copyright (c) 2013 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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 sf->scale_value_x = unscaled_value; | 72 sf->scale_value_x = unscaled_value; |
73 sf->scale_value_y = unscaled_value; | 73 sf->scale_value_y = unscaled_value; |
74 } | 74 } |
75 | 75 |
76 // TODO(agrange): Investigate the best choice of functions to use here | 76 // TODO(agrange): Investigate the best choice of functions to use here |
77 // for EIGHTTAP_SMOOTH. Since it is not interpolating, need to choose what | 77 // for EIGHTTAP_SMOOTH. Since it is not interpolating, need to choose what |
78 // to do at full-pel offsets. The current selection, where the filter is | 78 // to do at full-pel offsets. The current selection, where the filter is |
79 // applied in one direction only, and not at all for 0,0, seems to give the | 79 // applied in one direction only, and not at all for 0,0, seems to give the |
80 // best quality, but it may be worth trying an additional mode that does | 80 // best quality, but it may be worth trying an additional mode that does |
81 // do the filtering on full-pel. | 81 // do the filtering on full-pel. |
| 82 |
82 if (sf->x_step_q4 == 16) { | 83 if (sf->x_step_q4 == 16) { |
83 if (sf->y_step_q4 == 16) { | 84 if (sf->y_step_q4 == 16) { |
84 // No scaling in either direction. | 85 // No scaling in either direction. |
85 sf->predict[0][0][0] = vpx_convolve_copy; | 86 sf->predict[0][0][0] = vpx_convolve_copy; |
86 sf->predict[0][0][1] = vpx_convolve_avg; | 87 sf->predict[0][0][1] = vpx_convolve_avg; |
87 sf->predict[0][1][0] = vpx_convolve8_vert; | 88 sf->predict[0][1][0] = vpx_convolve8_vert; |
88 sf->predict[0][1][1] = vpx_convolve8_avg_vert; | 89 sf->predict[0][1][1] = vpx_convolve8_avg_vert; |
89 sf->predict[1][0][0] = vpx_convolve8_horiz; | 90 sf->predict[1][0][0] = vpx_convolve8_horiz; |
90 sf->predict[1][0][1] = vpx_convolve8_avg_horiz; | 91 sf->predict[1][0][1] = vpx_convolve8_avg_horiz; |
91 } else { | 92 } else { |
92 // No scaling in x direction. Must always scale in the y direction. | 93 // No scaling in x direction. Must always scale in the y direction. |
93 sf->predict[0][0][0] = vpx_convolve8_vert; | 94 sf->predict[0][0][0] = vpx_scaled_vert; |
94 sf->predict[0][0][1] = vpx_convolve8_avg_vert; | 95 sf->predict[0][0][1] = vpx_scaled_avg_vert; |
95 sf->predict[0][1][0] = vpx_convolve8_vert; | 96 sf->predict[0][1][0] = vpx_scaled_vert; |
96 sf->predict[0][1][1] = vpx_convolve8_avg_vert; | 97 sf->predict[0][1][1] = vpx_scaled_avg_vert; |
97 sf->predict[1][0][0] = vpx_convolve8; | 98 sf->predict[1][0][0] = vpx_scaled_2d; |
98 sf->predict[1][0][1] = vpx_convolve8_avg; | 99 sf->predict[1][0][1] = vpx_scaled_avg_2d; |
99 } | 100 } |
100 } else { | 101 } else { |
101 if (sf->y_step_q4 == 16) { | 102 if (sf->y_step_q4 == 16) { |
102 // No scaling in the y direction. Must always scale in the x direction. | 103 // No scaling in the y direction. Must always scale in the x direction. |
103 sf->predict[0][0][0] = vpx_convolve8_horiz; | 104 sf->predict[0][0][0] = vpx_scaled_horiz; |
104 sf->predict[0][0][1] = vpx_convolve8_avg_horiz; | 105 sf->predict[0][0][1] = vpx_scaled_avg_horiz; |
105 sf->predict[0][1][0] = vpx_convolve8; | 106 sf->predict[0][1][0] = vpx_scaled_2d; |
106 sf->predict[0][1][1] = vpx_convolve8_avg; | 107 sf->predict[0][1][1] = vpx_scaled_avg_2d; |
107 sf->predict[1][0][0] = vpx_convolve8_horiz; | 108 sf->predict[1][0][0] = vpx_scaled_horiz; |
108 sf->predict[1][0][1] = vpx_convolve8_avg_horiz; | 109 sf->predict[1][0][1] = vpx_scaled_avg_horiz; |
109 } else { | 110 } else { |
110 // Must always scale in both directions. | 111 // Must always scale in both directions. |
111 sf->predict[0][0][0] = vpx_convolve8; | 112 sf->predict[0][0][0] = vpx_scaled_2d; |
112 sf->predict[0][0][1] = vpx_convolve8_avg; | 113 sf->predict[0][0][1] = vpx_scaled_avg_2d; |
113 sf->predict[0][1][0] = vpx_convolve8; | 114 sf->predict[0][1][0] = vpx_scaled_2d; |
114 sf->predict[0][1][1] = vpx_convolve8_avg; | 115 sf->predict[0][1][1] = vpx_scaled_avg_2d; |
115 sf->predict[1][0][0] = vpx_convolve8; | 116 sf->predict[1][0][0] = vpx_scaled_2d; |
116 sf->predict[1][0][1] = vpx_convolve8_avg; | 117 sf->predict[1][0][1] = vpx_scaled_avg_2d; |
117 } | 118 } |
118 } | 119 } |
| 120 |
119 // 2D subpel motion always gets filtered in both directions | 121 // 2D subpel motion always gets filtered in both directions |
120 sf->predict[1][1][0] = vpx_convolve8; | 122 |
121 sf->predict[1][1][1] = vpx_convolve8_avg; | 123 if ((sf->x_step_q4 != 16) || (sf->y_step_q4 != 16)) { |
| 124 sf->predict[1][1][0] = vpx_scaled_2d; |
| 125 sf->predict[1][1][1] = vpx_scaled_avg_2d; |
| 126 } else { |
| 127 sf->predict[1][1][0] = vpx_convolve8; |
| 128 sf->predict[1][1][1] = vpx_convolve8_avg; |
| 129 } |
| 130 |
122 #if CONFIG_VP9_HIGHBITDEPTH | 131 #if CONFIG_VP9_HIGHBITDEPTH |
123 if (use_highbd) { | 132 if (use_highbd) { |
124 if (sf->x_step_q4 == 16) { | 133 if (sf->x_step_q4 == 16) { |
125 if (sf->y_step_q4 == 16) { | 134 if (sf->y_step_q4 == 16) { |
126 // No scaling in either direction. | 135 // No scaling in either direction. |
127 sf->highbd_predict[0][0][0] = vpx_highbd_convolve_copy; | 136 sf->highbd_predict[0][0][0] = vpx_highbd_convolve_copy; |
128 sf->highbd_predict[0][0][1] = vpx_highbd_convolve_avg; | 137 sf->highbd_predict[0][0][1] = vpx_highbd_convolve_avg; |
129 sf->highbd_predict[0][1][0] = vpx_highbd_convolve8_vert; | 138 sf->highbd_predict[0][1][0] = vpx_highbd_convolve8_vert; |
130 sf->highbd_predict[0][1][1] = vpx_highbd_convolve8_avg_vert; | 139 sf->highbd_predict[0][1][1] = vpx_highbd_convolve8_avg_vert; |
131 sf->highbd_predict[1][0][0] = vpx_highbd_convolve8_horiz; | 140 sf->highbd_predict[1][0][0] = vpx_highbd_convolve8_horiz; |
(...skipping 25 matching lines...) Expand all Loading... |
157 sf->highbd_predict[1][0][0] = vpx_highbd_convolve8; | 166 sf->highbd_predict[1][0][0] = vpx_highbd_convolve8; |
158 sf->highbd_predict[1][0][1] = vpx_highbd_convolve8_avg; | 167 sf->highbd_predict[1][0][1] = vpx_highbd_convolve8_avg; |
159 } | 168 } |
160 } | 169 } |
161 // 2D subpel motion always gets filtered in both directions. | 170 // 2D subpel motion always gets filtered in both directions. |
162 sf->highbd_predict[1][1][0] = vpx_highbd_convolve8; | 171 sf->highbd_predict[1][1][0] = vpx_highbd_convolve8; |
163 sf->highbd_predict[1][1][1] = vpx_highbd_convolve8_avg; | 172 sf->highbd_predict[1][1][1] = vpx_highbd_convolve8_avg; |
164 } | 173 } |
165 #endif | 174 #endif |
166 } | 175 } |
OLD | NEW |