| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2014 The WebM project authors. All Rights Reserved. | 2 * Copyright (c) 2014 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 1040 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1051 {GOLDEN_FRAME, NEWMV} | 1051 {GOLDEN_FRAME, NEWMV} |
| 1052 }; | 1052 }; |
| 1053 | 1053 |
| 1054 // TODO(jingning) placeholder for inter-frame non-RD mode decision. | 1054 // TODO(jingning) placeholder for inter-frame non-RD mode decision. |
| 1055 // this needs various further optimizations. to be continued.. | 1055 // this needs various further optimizations. to be continued.. |
| 1056 void vp9_pick_inter_mode(VP9_COMP *cpi, MACROBLOCK *x, | 1056 void vp9_pick_inter_mode(VP9_COMP *cpi, MACROBLOCK *x, |
| 1057 TileDataEnc *tile_data, | 1057 TileDataEnc *tile_data, |
| 1058 int mi_row, int mi_col, RD_COST *rd_cost, | 1058 int mi_row, int mi_col, RD_COST *rd_cost, |
| 1059 BLOCK_SIZE bsize, PICK_MODE_CONTEXT *ctx) { | 1059 BLOCK_SIZE bsize, PICK_MODE_CONTEXT *ctx) { |
| 1060 VP9_COMMON *const cm = &cpi->common; | 1060 VP9_COMMON *const cm = &cpi->common; |
| 1061 SPEED_FEATURES *const sf = &cpi->sf; |
| 1061 TileInfo *const tile_info = &tile_data->tile_info; | 1062 TileInfo *const tile_info = &tile_data->tile_info; |
| 1062 MACROBLOCKD *const xd = &x->e_mbd; | 1063 MACROBLOCKD *const xd = &x->e_mbd; |
| 1063 MB_MODE_INFO *const mbmi = &xd->mi[0]->mbmi; | 1064 MB_MODE_INFO *const mbmi = &xd->mi[0]->mbmi; |
| 1064 struct macroblockd_plane *const pd = &xd->plane[0]; | 1065 struct macroblockd_plane *const pd = &xd->plane[0]; |
| 1065 PREDICTION_MODE best_mode = ZEROMV; | 1066 PREDICTION_MODE best_mode = ZEROMV; |
| 1066 MV_REFERENCE_FRAME ref_frame, best_ref_frame = LAST_FRAME; | 1067 MV_REFERENCE_FRAME ref_frame, best_ref_frame = LAST_FRAME; |
| 1067 MV_REFERENCE_FRAME usable_ref_frame; | 1068 MV_REFERENCE_FRAME usable_ref_frame; |
| 1068 TX_SIZE best_tx_size = TX_SIZES; | 1069 TX_SIZE best_tx_size = TX_SIZES; |
| 1069 INTERP_FILTER best_pred_filter = EIGHTTAP; | 1070 INTERP_FILTER best_pred_filter = EIGHTTAP; |
| 1070 int_mv frame_mv[MB_MODE_COUNT][MAX_REF_FRAMES]; | 1071 int_mv frame_mv[MB_MODE_COUNT][MAX_REF_FRAMES]; |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1210 if (!(cpi->sf.inter_mode_mask[bsize] & (1 << this_mode))) | 1211 if (!(cpi->sf.inter_mode_mask[bsize] & (1 << this_mode))) |
| 1211 continue; | 1212 continue; |
| 1212 | 1213 |
| 1213 ref_frame = ref_mode_set[idx].ref_frame; | 1214 ref_frame = ref_mode_set[idx].ref_frame; |
| 1214 if (!(cpi->ref_frame_flags & flag_list[ref_frame])) | 1215 if (!(cpi->ref_frame_flags & flag_list[ref_frame])) |
| 1215 continue; | 1216 continue; |
| 1216 if (const_motion[ref_frame] && this_mode == NEARMV) | 1217 if (const_motion[ref_frame] && this_mode == NEARMV) |
| 1217 continue; | 1218 continue; |
| 1218 | 1219 |
| 1219 i = (ref_frame == LAST_FRAME) ? GOLDEN_FRAME : LAST_FRAME; | 1220 i = (ref_frame == LAST_FRAME) ? GOLDEN_FRAME : LAST_FRAME; |
| 1220 if (cpi->ref_frame_flags & flag_list[i]) | 1221 if ((cpi->ref_frame_flags & flag_list[i]) && sf->reference_masking) |
| 1221 if (x->pred_mv_sad[ref_frame] > (x->pred_mv_sad[i] << 1)) | 1222 if (x->pred_mv_sad[ref_frame] > (x->pred_mv_sad[i] << 1)) |
| 1222 ref_frame_skip_mask |= (1 << ref_frame); | 1223 ref_frame_skip_mask |= (1 << ref_frame); |
| 1223 if (ref_frame_skip_mask & (1 << ref_frame)) | 1224 if (ref_frame_skip_mask & (1 << ref_frame)) |
| 1224 continue; | 1225 continue; |
| 1225 | 1226 |
| 1226 // Select prediction reference frames. | 1227 // Select prediction reference frames. |
| 1227 for (i = 0; i < MAX_MB_PLANE; i++) | 1228 for (i = 0; i < MAX_MB_PLANE; i++) |
| 1228 xd->plane[i].pre[0] = yv12_mb[ref_frame][i]; | 1229 xd->plane[i].pre[0] = yv12_mb[ref_frame][i]; |
| 1229 | 1230 |
| 1230 mbmi->ref_frame[0] = ref_frame; | 1231 mbmi->ref_frame[0] = ref_frame; |
| (...skipping 644 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1875 xd->mi[0]->bmi[block + 2] = bsi[best_ref_frame][block]; | 1876 xd->mi[0]->bmi[block + 2] = bsi[best_ref_frame][block]; |
| 1876 } | 1877 } |
| 1877 } | 1878 } |
| 1878 mbmi->mode = xd->mi[0]->bmi[3].as_mode; | 1879 mbmi->mode = xd->mi[0]->bmi[3].as_mode; |
| 1879 ctx->mic = *(xd->mi[0]); | 1880 ctx->mic = *(xd->mi[0]); |
| 1880 ctx->skip_txfm[0] = 0; | 1881 ctx->skip_txfm[0] = 0; |
| 1881 ctx->skip = 0; | 1882 ctx->skip = 0; |
| 1882 // Dummy assignment for speed -5. No effect in speed -6. | 1883 // Dummy assignment for speed -5. No effect in speed -6. |
| 1883 rd_cost->rdcost = best_rd; | 1884 rd_cost->rdcost = best_rd; |
| 1884 } | 1885 } |
| OLD | NEW |