ref: e3167b8c238a96c1c38a9bed95a24787700b2522
parent: 0defc2ddb3518f5395acf446fc0861dd1a4b5050
parent: 9662531d77d6a47e7d7cdc6b0c5d9f3388507c8f
author: Scott LaVarnway <[email protected]>
date: Tue Apr 23 06:22:13 EDT 2013
Merge "Eliminated prev_mip memsets/memcpys" into experimental
--- a/vp9/common/vp9_alloccommon.c
+++ b/vp9/common/vp9_alloccommon.c
@@ -137,9 +137,6 @@
return 1;
}
- vp9_update_mode_info_border(oci, oci->mip);
- vp9_update_mode_info_in_image(oci, oci->mi);
-
return 0;
}
--- a/vp9/common/vp9_entropymode.c
+++ b/vp9/common/vp9_entropymode.c
@@ -718,6 +718,9 @@
vp9_update_mode_info_border(cm, cm->mip);
vp9_update_mode_info_in_image(cm, cm->mi);
+ vp9_update_mode_info_border(cm, cm->prev_mip);
+ vp9_update_mode_info_in_image(cm, cm->prev_mi);
+
cm->ref_frame_sign_bias[GOLDEN_FRAME] = 0;
cm->ref_frame_sign_bias[ALTREF_FRAME] = 0;
--- a/vp9/common/vp9_onyxc_int.h
+++ b/vp9/common/vp9_onyxc_int.h
@@ -196,6 +196,7 @@
FRAME_TYPE frame_type;
int show_frame;
+ int last_show_frame;
int frame_flags;
int MBs;
--- a/vp9/decoder/vp9_decodemv.c
+++ b/vp9/decoder/vp9_decodemv.c
@@ -601,7 +601,8 @@
const int use_prev_in_find_mv_refs = cm->width == cm->last_width &&
cm->height == cm->last_height &&
- !cm->error_resilient_mode;
+ !cm->error_resilient_mode &&
+ cm->last_show_frame;
int mb_to_left_edge, mb_to_right_edge, mb_to_top_edge, mb_to_bottom_edge;
--- a/vp9/decoder/vp9_decodframe.c
+++ b/vp9/decoder/vp9_decodframe.c
@@ -1078,10 +1078,12 @@
memset(cm->mip, 0,
(cm->mb_cols + 1) * (cm->mb_rows + 1) * sizeof(MODE_INFO));
vp9_update_mode_info_border(cm, cm->mip);
+ vp9_update_mode_info_border(cm, cm->prev_mip);
cm->mi = cm->mip + cm->mode_info_stride + 1;
cm->prev_mi = cm->prev_mip + cm->mode_info_stride + 1;
vp9_update_mode_info_in_image(cm, cm->mi);
+ vp9_update_mode_info_in_image(cm, cm->prev_mi);
}
static void setup_segmentation(VP9_COMMON *pc, MACROBLOCKD *xd, vp9_reader *r) {
--- a/vp9/decoder/vp9_onyxd_if.c
+++ b/vp9/decoder/vp9_onyxd_if.c
@@ -365,19 +365,22 @@
vp9_clear_system_state();
+ cm->last_show_frame = cm->show_frame;
if (cm->show_frame) {
- vpx_memcpy(cm->prev_mip, cm->mip,
- (cm->mb_cols + 1) * (cm->mb_rows + 1)* sizeof(MODE_INFO));
- } else {
- vpx_memset(cm->prev_mip, 0,
- (cm->mb_cols + 1) * (cm->mb_rows + 1)* sizeof(MODE_INFO));
+ // current mip will be the prev_mip for the next frame
+ MODE_INFO *temp = cm->prev_mip;
+ cm->prev_mip = cm->mip;
+ cm->mip = temp;
+
+ // update the upper left visible macroblock ptrs
+ cm->mi = cm->mip + cm->mode_info_stride + 1;
+ cm->prev_mi = cm->prev_mip + cm->mode_info_stride + 1;
+
+ cm->current_video_frame++;
}
/*vp9_print_modes_and_motion_vectors(cm->mi, cm->mb_rows,cm->mb_cols,
cm->current_video_frame);*/
-
- if (cm->show_frame)
- cm->current_video_frame++;
pbi->ready_for_new_data = 0;
pbi->last_time_stamp = time_stamp;