diff options
author | Jingning Han <jingning@google.com> | 2014-12-10 09:25:05 -0800 |
---|---|---|
committer | Gerrit Code Review <gerrit@gerrit.golo.chromium.org> | 2014-12-10 09:25:05 -0800 |
commit | 6fc289b9c04aee27b66a0cad084ea5d0733e9170 (patch) | |
tree | b34b101b3aa61a9022a470b44b980aad14765737 /vp9 | |
parent | 8bd88a3c83fb2fa4c8f31a93797611e5f530eb93 (diff) | |
parent | e728678c5061b01ab3484d676c42d562fe70c32b (diff) | |
download | libvpx-6fc289b9c04aee27b66a0cad084ea5d0733e9170.tar libvpx-6fc289b9c04aee27b66a0cad084ea5d0733e9170.tar.gz libvpx-6fc289b9c04aee27b66a0cad084ea5d0733e9170.tar.bz2 libvpx-6fc289b9c04aee27b66a0cad084ea5d0733e9170.zip |
Merge "Refactor update_state_rt"
Diffstat (limited to 'vp9')
-rw-r--r-- | vp9/encoder/vp9_encodeframe.c | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/vp9/encoder/vp9_encodeframe.c b/vp9/encoder/vp9_encodeframe.c index 3d8cdb3b4..83da55195 100644 --- a/vp9/encoder/vp9_encodeframe.c +++ b/vp9/encoder/vp9_encodeframe.c @@ -1356,11 +1356,8 @@ static void update_state_rt(VP9_COMP *cpi, ThreadData *td, const int bh = num_8x8_blocks_high_lookup[mi->mbmi.sb_type]; const int x_mis = MIN(bw, cm->mi_cols - mi_col); const int y_mis = MIN(bh, cm->mi_rows - mi_row); - MV_REF *const frame_mvs = - cm->cur_frame->mvs + mi_row * cm->mi_cols + mi_col; - int w, h; - *(xd->mi[0].src_mi) = ctx->mic; + xd->mi[0] = ctx->mic; xd->mi[0].src_mi = &xd->mi[0]; if (seg->enabled && cpi->oxcf.aq_mode) { @@ -1381,21 +1378,26 @@ static void update_state_rt(VP9_COMP *cpi, ThreadData *td, if (is_inter_block(mbmi)) { vp9_update_mv_count(td); - if (cm->interp_filter == SWITCHABLE) { const int pred_ctx = vp9_get_pred_context_switchable_interp(xd); ++td->counts->switchable_interp[pred_ctx][mbmi->interp_filter]; } } - for (h = 0; h < y_mis; ++h) { - MV_REF *const frame_mv = frame_mvs + h * cm->mi_cols; - for (w = 0; w < x_mis; ++w) { - MV_REF *const mv = frame_mv + w; - mv->ref_frame[0] = mi->src_mi->mbmi.ref_frame[0]; - mv->ref_frame[1] = mi->src_mi->mbmi.ref_frame[1]; - mv->mv[0].as_int = mi->src_mi->mbmi.mv[0].as_int; - mv->mv[1].as_int = mi->src_mi->mbmi.mv[1].as_int; + if (cm->use_prev_frame_mvs) { + MV_REF *const frame_mvs = + cm->cur_frame->mvs + mi_row * cm->mi_cols + mi_col; + int w, h; + + for (h = 0; h < y_mis; ++h) { + MV_REF *const frame_mv = frame_mvs + h * cm->mi_cols; + for (w = 0; w < x_mis; ++w) { + MV_REF *const mv = frame_mv + w; + mv->ref_frame[0] = mi->src_mi->mbmi.ref_frame[0]; + mv->ref_frame[1] = mi->src_mi->mbmi.ref_frame[1]; + mv->mv[0].as_int = mi->src_mi->mbmi.mv[0].as_int; + mv->mv[1].as_int = mi->src_mi->mbmi.mv[1].as_int; + } } } |