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 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
209 } | 209 } |
210 } | 210 } |
211 #endif // CONFIG_VP9_HIGHBITDEPTH | 211 #endif // CONFIG_VP9_HIGHBITDEPTH |
212 | 212 |
213 static int temporal_filter_find_matching_mb_c(VP9_COMP *cpi, | 213 static int temporal_filter_find_matching_mb_c(VP9_COMP *cpi, |
214 uint8_t *arf_frame_buf, | 214 uint8_t *arf_frame_buf, |
215 uint8_t *frame_ptr_buf, | 215 uint8_t *frame_ptr_buf, |
216 int stride) { | 216 int stride) { |
217 MACROBLOCK *const x = &cpi->td.mb; | 217 MACROBLOCK *const x = &cpi->td.mb; |
218 MACROBLOCKD *const xd = &x->e_mbd; | 218 MACROBLOCKD *const xd = &x->e_mbd; |
219 const MV_SPEED_FEATURES *const mv_sf = &cpi->sf.mv; | 219 MV_SPEED_FEATURES *const mv_sf = &cpi->sf.mv; |
| 220 const SEARCH_METHODS old_search_method = mv_sf->search_method; |
220 int step_param; | 221 int step_param; |
221 int sadpb = x->sadperbit16; | 222 int sadpb = x->sadperbit16; |
222 int bestsme = INT_MAX; | 223 int bestsme = INT_MAX; |
223 int distortion; | 224 int distortion; |
224 unsigned int sse; | 225 unsigned int sse; |
225 int cost_list[5]; | 226 int cost_list[5]; |
226 | 227 |
227 MV best_ref_mv1 = {0, 0}; | 228 MV best_ref_mv1 = {0, 0}; |
228 MV best_ref_mv1_full; /* full-pixel value of best_ref_mv1 */ | 229 MV best_ref_mv1_full; /* full-pixel value of best_ref_mv1 */ |
229 MV *ref_mv = &x->e_mbd.mi[0]->bmi[0].as_mv[0].as_mv; | 230 MV *ref_mv = &x->e_mbd.mi[0]->bmi[0].as_mv[0].as_mv; |
230 | 231 |
231 // Save input state | 232 // Save input state |
232 struct buf_2d src = x->plane[0].src; | 233 struct buf_2d src = x->plane[0].src; |
233 struct buf_2d pre = xd->plane[0].pre[0]; | 234 struct buf_2d pre = xd->plane[0].pre[0]; |
234 | 235 |
235 best_ref_mv1_full.col = best_ref_mv1.col >> 3; | 236 best_ref_mv1_full.col = best_ref_mv1.col >> 3; |
236 best_ref_mv1_full.row = best_ref_mv1.row >> 3; | 237 best_ref_mv1_full.row = best_ref_mv1.row >> 3; |
237 | 238 |
238 // Setup frame pointers | 239 // Setup frame pointers |
239 x->plane[0].src.buf = arf_frame_buf; | 240 x->plane[0].src.buf = arf_frame_buf; |
240 x->plane[0].src.stride = stride; | 241 x->plane[0].src.stride = stride; |
241 xd->plane[0].pre[0].buf = frame_ptr_buf; | 242 xd->plane[0].pre[0].buf = frame_ptr_buf; |
242 xd->plane[0].pre[0].stride = stride; | 243 xd->plane[0].pre[0].stride = stride; |
243 | 244 |
244 step_param = mv_sf->reduce_first_step_size; | 245 step_param = mv_sf->reduce_first_step_size; |
245 step_param = VPXMIN(step_param, MAX_MVSEARCH_STEPS - 2); | 246 step_param = VPXMIN(step_param, MAX_MVSEARCH_STEPS - 2); |
246 | 247 |
247 // Ignore mv costing by sending NULL pointer instead of cost arrays | 248 mv_sf->search_method = HEX; |
248 vp9_hex_search(x, &best_ref_mv1_full, step_param, sadpb, 1, | 249 vp9_full_pixel_search(cpi, x, BLOCK_16X16, &best_ref_mv1_full, step_param, |
249 cond_cost_list(cpi, cost_list), | 250 sadpb, cond_cost_list(cpi, cost_list), &best_ref_mv1, |
250 &cpi->fn_ptr[BLOCK_16X16], 0, &best_ref_mv1, ref_mv); | 251 ref_mv, 0, 0); |
| 252 mv_sf->search_method = old_search_method; |
251 | 253 |
252 // Ignore mv costing by sending NULL pointer instead of cost array | 254 // Ignore mv costing by sending NULL pointer instead of cost array |
253 bestsme = cpi->find_fractional_mv_step(x, ref_mv, | 255 bestsme = cpi->find_fractional_mv_step(x, ref_mv, |
254 &best_ref_mv1, | 256 &best_ref_mv1, |
255 cpi->common.allow_high_precision_mv, | 257 cpi->common.allow_high_precision_mv, |
256 x->errorperbit, | 258 x->errorperbit, |
257 &cpi->fn_ptr[BLOCK_16X16], | 259 &cpi->fn_ptr[BLOCK_16X16], |
258 0, mv_sf->subpel_iters_per_step, | 260 0, mv_sf->subpel_iters_per_step, |
259 cond_cost_list(cpi, cost_list), | 261 cond_cost_list(cpi, cost_list), |
260 NULL, NULL, | 262 NULL, NULL, |
(...skipping 479 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
740 frames[0]->y_crop_height, | 742 frames[0]->y_crop_height, |
741 frames[0]->y_crop_width, | 743 frames[0]->y_crop_width, |
742 frames[0]->y_crop_height); | 744 frames[0]->y_crop_height); |
743 #endif // CONFIG_VP9_HIGHBITDEPTH | 745 #endif // CONFIG_VP9_HIGHBITDEPTH |
744 } | 746 } |
745 } | 747 } |
746 | 748 |
747 temporal_filter_iterate_c(cpi, frames, frames_to_blur, | 749 temporal_filter_iterate_c(cpi, frames, frames_to_blur, |
748 frames_to_blur_backward, strength, &sf); | 750 frames_to_blur_backward, strength, &sf); |
749 } | 751 } |
OLD | NEW |