| 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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 int distortion; | 56 int distortion; |
| 57 unsigned int sse; | 57 unsigned int sse; |
| 58 cpi->find_fractional_mv_step( | 58 cpi->find_fractional_mv_step( |
| 59 x, dst_mv, ref_mv, cpi->common.allow_high_precision_mv, x->errorperbit, | 59 x, dst_mv, ref_mv, cpi->common.allow_high_precision_mv, x->errorperbit, |
| 60 &v_fn_ptr, 0, mv_sf->subpel_iters_per_step, | 60 &v_fn_ptr, 0, mv_sf->subpel_iters_per_step, |
| 61 cond_sad_list(cpi, sad_list), | 61 cond_sad_list(cpi, sad_list), |
| 62 NULL, NULL, | 62 NULL, NULL, |
| 63 &distortion, &sse, NULL, 0, 0); | 63 &distortion, &sse, NULL, 0, 0); |
| 64 } | 64 } |
| 65 | 65 |
| 66 xd->mi[0]->mbmi.mode = NEWMV; | 66 xd->mi[0].src_mi->mbmi.mode = NEWMV; |
| 67 xd->mi[0]->mbmi.mv[0].as_mv = *dst_mv; | 67 xd->mi[0].src_mi->mbmi.mv[0].as_mv = *dst_mv; |
| 68 | 68 |
| 69 vp9_build_inter_predictors_sby(xd, mb_row, mb_col, BLOCK_16X16); | 69 vp9_build_inter_predictors_sby(xd, mb_row, mb_col, BLOCK_16X16); |
| 70 | 70 |
| 71 /* restore UMV window */ | 71 /* restore UMV window */ |
| 72 x->mv_col_min = tmp_col_min; | 72 x->mv_col_min = tmp_col_min; |
| 73 x->mv_col_max = tmp_col_max; | 73 x->mv_col_max = tmp_col_max; |
| 74 x->mv_row_min = tmp_row_min; | 74 x->mv_row_min = tmp_row_min; |
| 75 x->mv_row_max = tmp_row_max; | 75 x->mv_row_max = tmp_row_max; |
| 76 | 76 |
| 77 return vp9_sad16x16(x->plane[0].src.buf, x->plane[0].src.stride, | 77 return vp9_sad16x16(x->plane[0].src.buf, x->plane[0].src.stride, |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 MACROBLOCK *const x = &cpi->mb; | 134 MACROBLOCK *const x = &cpi->mb; |
| 135 MACROBLOCKD *const xd = &x->e_mbd; | 135 MACROBLOCKD *const xd = &x->e_mbd; |
| 136 PREDICTION_MODE best_mode = -1, mode; | 136 PREDICTION_MODE best_mode = -1, mode; |
| 137 unsigned int best_err = INT_MAX; | 137 unsigned int best_err = INT_MAX; |
| 138 | 138 |
| 139 // calculate SATD for each intra prediction mode; | 139 // calculate SATD for each intra prediction mode; |
| 140 // we're intentionally not doing 4x4, we just want a rough estimate | 140 // we're intentionally not doing 4x4, we just want a rough estimate |
| 141 for (mode = DC_PRED; mode <= TM_PRED; mode++) { | 141 for (mode = DC_PRED; mode <= TM_PRED; mode++) { |
| 142 unsigned int err; | 142 unsigned int err; |
| 143 | 143 |
| 144 xd->mi[0]->mbmi.mode = mode; | 144 xd->mi[0].src_mi->mbmi.mode = mode; |
| 145 vp9_predict_intra_block(xd, 0, 2, TX_16X16, mode, | 145 vp9_predict_intra_block(xd, 0, 2, TX_16X16, mode, |
| 146 x->plane[0].src.buf, x->plane[0].src.stride, | 146 x->plane[0].src.buf, x->plane[0].src.stride, |
| 147 xd->plane[0].dst.buf, xd->plane[0].dst.stride, | 147 xd->plane[0].dst.buf, xd->plane[0].dst.stride, |
| 148 0, 0, 0); | 148 0, 0, 0); |
| 149 err = vp9_sad16x16(x->plane[0].src.buf, x->plane[0].src.stride, | 149 err = vp9_sad16x16(x->plane[0].src.buf, x->plane[0].src.stride, |
| 150 xd->plane[0].dst.buf, xd->plane[0].dst.stride); | 150 xd->plane[0].dst.buf, xd->plane[0].dst.stride); |
| 151 | 151 |
| 152 // find best | 152 // find best |
| 153 if (err < best_err) { | 153 if (err < best_err) { |
| 154 best_err = err; | 154 best_err = err; |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 240 | 240 |
| 241 vp9_zero(mi_local); | 241 vp9_zero(mi_local); |
| 242 // Set up limit values for motion vectors to prevent them extending outside | 242 // Set up limit values for motion vectors to prevent them extending outside |
| 243 // the UMV borders. | 243 // the UMV borders. |
| 244 x->mv_row_min = -BORDER_MV_PIXELS_B16; | 244 x->mv_row_min = -BORDER_MV_PIXELS_B16; |
| 245 x->mv_row_max = (cm->mb_rows - 1) * 8 + BORDER_MV_PIXELS_B16; | 245 x->mv_row_max = (cm->mb_rows - 1) * 8 + BORDER_MV_PIXELS_B16; |
| 246 xd->up_available = 0; | 246 xd->up_available = 0; |
| 247 xd->plane[0].dst.stride = buf->y_stride; | 247 xd->plane[0].dst.stride = buf->y_stride; |
| 248 xd->plane[0].pre[0].stride = buf->y_stride; | 248 xd->plane[0].pre[0].stride = buf->y_stride; |
| 249 xd->plane[1].dst.stride = buf->uv_stride; | 249 xd->plane[1].dst.stride = buf->uv_stride; |
| 250 xd->mi[0] = &mi_local; | 250 xd->mi[0].src_mi = &mi_local; |
| 251 mi_local.mbmi.sb_type = BLOCK_16X16; | 251 mi_local.mbmi.sb_type = BLOCK_16X16; |
| 252 mi_local.mbmi.ref_frame[0] = LAST_FRAME; | 252 mi_local.mbmi.ref_frame[0] = LAST_FRAME; |
| 253 mi_local.mbmi.ref_frame[1] = NONE; | 253 mi_local.mbmi.ref_frame[1] = NONE; |
| 254 | 254 |
| 255 for (mb_row = 0; mb_row < cm->mb_rows; mb_row++) { | 255 for (mb_row = 0; mb_row < cm->mb_rows; mb_row++) { |
| 256 MV gld_left_mv = gld_top_mv; | 256 MV gld_left_mv = gld_top_mv; |
| 257 int mb_y_in_offset = mb_y_offset; | 257 int mb_y_in_offset = mb_y_offset; |
| 258 int arf_y_in_offset = arf_y_offset; | 258 int arf_y_in_offset = arf_y_offset; |
| 259 int gld_y_in_offset = gld_y_offset; | 259 int gld_y_in_offset = gld_y_offset; |
| 260 | 260 |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 403 assert(q_cur != NULL); | 403 assert(q_cur != NULL); |
| 404 | 404 |
| 405 update_mbgraph_frame_stats(cpi, frame_stats, &q_cur->img, | 405 update_mbgraph_frame_stats(cpi, frame_stats, &q_cur->img, |
| 406 golden_ref, cpi->Source); | 406 golden_ref, cpi->Source); |
| 407 } | 407 } |
| 408 | 408 |
| 409 vp9_clear_system_state(); | 409 vp9_clear_system_state(); |
| 410 | 410 |
| 411 separate_arf_mbs(cpi); | 411 separate_arf_mbs(cpi); |
| 412 } | 412 } |
| OLD | NEW |