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 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 return -1; | 197 return -1; |
198 } | 198 } |
199 #else | 199 #else |
200 (void) bit_depth; | 200 (void) bit_depth; |
201 q = vp9_dc_quant(qindex, 0, VPX_BITS_8) / 4.0; | 201 q = vp9_dc_quant(qindex, 0, VPX_BITS_8) / 4.0; |
202 #endif // CONFIG_VP9_HIGHBITDEPTH | 202 #endif // CONFIG_VP9_HIGHBITDEPTH |
203 // TODO(debargha): Adjust the function below. | 203 // TODO(debargha): Adjust the function below. |
204 return MAX((int)(pow(q, RD_THRESH_POW) * 5.12), 8); | 204 return MAX((int)(pow(q, RD_THRESH_POW) * 5.12), 8); |
205 } | 205 } |
206 | 206 |
207 void vp9_initialize_me_consts(VP9_COMP *cpi, int qindex) { | 207 void vp9_initialize_me_consts(VP9_COMP *cpi, MACROBLOCK *x, int qindex) { |
208 #if CONFIG_VP9_HIGHBITDEPTH | 208 #if CONFIG_VP9_HIGHBITDEPTH |
209 switch (cpi->common.bit_depth) { | 209 switch (cpi->common.bit_depth) { |
210 case VPX_BITS_8: | 210 case VPX_BITS_8: |
211 cpi->td.mb.sadperbit16 = sad_per_bit16lut_8[qindex]; | 211 x->sadperbit16 = sad_per_bit16lut_8[qindex]; |
212 cpi->td.mb.sadperbit4 = sad_per_bit4lut_8[qindex]; | 212 x->sadperbit4 = sad_per_bit4lut_8[qindex]; |
213 break; | 213 break; |
214 case VPX_BITS_10: | 214 case VPX_BITS_10: |
215 cpi->td.mb.sadperbit16 = sad_per_bit16lut_10[qindex]; | 215 x->sadperbit16 = sad_per_bit16lut_10[qindex]; |
216 cpi->td.mb.sadperbit4 = sad_per_bit4lut_10[qindex]; | 216 x->sadperbit4 = sad_per_bit4lut_10[qindex]; |
217 break; | 217 break; |
218 case VPX_BITS_12: | 218 case VPX_BITS_12: |
219 cpi->td.mb.sadperbit16 = sad_per_bit16lut_12[qindex]; | 219 x->sadperbit16 = sad_per_bit16lut_12[qindex]; |
220 cpi->td.mb.sadperbit4 = sad_per_bit4lut_12[qindex]; | 220 x->sadperbit4 = sad_per_bit4lut_12[qindex]; |
221 break; | 221 break; |
222 default: | 222 default: |
223 assert(0 && "bit_depth should be VPX_BITS_8, VPX_BITS_10 or VPX_BITS_12"); | 223 assert(0 && "bit_depth should be VPX_BITS_8, VPX_BITS_10 or VPX_BITS_12"); |
224 } | 224 } |
225 #else | 225 #else |
226 cpi->td.mb.sadperbit16 = sad_per_bit16lut_8[qindex]; | 226 (void)cpi; |
227 cpi->td.mb.sadperbit4 = sad_per_bit4lut_8[qindex]; | 227 x->sadperbit16 = sad_per_bit16lut_8[qindex]; |
| 228 x->sadperbit4 = sad_per_bit4lut_8[qindex]; |
228 #endif // CONFIG_VP9_HIGHBITDEPTH | 229 #endif // CONFIG_VP9_HIGHBITDEPTH |
229 } | 230 } |
230 | 231 |
231 static void set_block_thresholds(const VP9_COMMON *cm, RD_OPT *rd) { | 232 static void set_block_thresholds(const VP9_COMMON *cm, RD_OPT *rd) { |
232 int i, bsize, segment_id; | 233 int i, bsize, segment_id; |
233 | 234 |
234 for (segment_id = 0; segment_id < MAX_SEGMENTS; ++segment_id) { | 235 for (segment_id = 0; segment_id < MAX_SEGMENTS; ++segment_id) { |
235 const int qindex = | 236 const int qindex = |
236 clamp(vp9_get_qindex(&cm->seg, segment_id, cm->base_qindex) + | 237 clamp(vp9_get_qindex(&cm->seg, segment_id, cm->base_qindex) + |
237 cm->y_dc_delta_q, 0, MAXQ); | 238 cm->y_dc_delta_q, 0, MAXQ); |
(...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
648 return ROUND_POWER_OF_TWO(5 * q, 2); | 649 return ROUND_POWER_OF_TWO(5 * q, 2); |
649 default: | 650 default: |
650 assert(0 && "bit_depth should be VPX_BITS_8, VPX_BITS_10 or VPX_BITS_12"); | 651 assert(0 && "bit_depth should be VPX_BITS_8, VPX_BITS_10 or VPX_BITS_12"); |
651 return -1; | 652 return -1; |
652 } | 653 } |
653 #else | 654 #else |
654 return 20 * q; | 655 return 20 * q; |
655 #endif // CONFIG_VP9_HIGHBITDEPTH | 656 #endif // CONFIG_VP9_HIGHBITDEPTH |
656 } | 657 } |
657 | 658 |
OLD | NEW |