ref: 8458c8c45036d651612160eb7baf49bcefc471d2
parent: cdc933ca0043b7944a4a45edb85d4c142f63fc56
parent: 047b0b01bbe8668c02438532520ea3c92b87f2f3
author: Yaowu Xu <[email protected]>
date: Thu Jan 2 04:27:28 EST 2014
Merge "Fix show existing frame"
--- a/vp9/common/vp9_onyxc_int.h
+++ b/vp9/common/vp9_onyxc_int.h
@@ -132,6 +132,7 @@
int show_frame;
int last_show_frame;
+ int show_existing_frame;
// Flag signaling that the frame is encoded using only INTRA modes.
int intra_only;
--- a/vp9/decoder/vp9_decodeframe.c
+++ b/vp9/decoder/vp9_decodeframe.c
@@ -1132,7 +1132,8 @@
cm->version = vp9_rb_read_bit(rb);
RESERVED;
- if (vp9_rb_read_bit(rb)) {
+ cm->show_existing_frame = vp9_rb_read_bit(rb);
+ if (cm->show_existing_frame) {
// show an existing frame directly
int frame_to_show = cm->ref_frame_map[vp9_rb_read_literal(rb, 3)];
ref_cnt_fb(cm->fb_idx_ref_cnt, &cm->new_fb_idx, frame_to_show);
--- a/vp9/decoder/vp9_onyxd_if.c
+++ b/vp9/decoder/vp9_onyxd_if.c
@@ -389,23 +389,25 @@
cm->last_show_frame = cm->show_frame;
if (cm->show_frame) {
- // current mip will be the prev_mip for the next frame
- MODE_INFO *temp = cm->prev_mip;
- MODE_INFO **temp2 = cm->prev_mi_grid_base;
- cm->prev_mip = cm->mip;
- cm->mip = temp;
- cm->prev_mi_grid_base = cm->mi_grid_base;
- cm->mi_grid_base = temp2;
+ if (!cm->show_existing_frame) {
+ // current mip will be the prev_mip for the next frame
+ MODE_INFO *temp = cm->prev_mip;
+ MODE_INFO **temp2 = cm->prev_mi_grid_base;
+ cm->prev_mip = cm->mip;
+ cm->mip = temp;
+ cm->prev_mi_grid_base = cm->mi_grid_base;
+ cm->mi_grid_base = temp2;
- // 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->mi_grid_visible = cm->mi_grid_base + cm->mode_info_stride + 1;
- cm->prev_mi_grid_visible = cm->prev_mi_grid_base + cm->mode_info_stride + 1;
+ // 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->mi_grid_visible = cm->mi_grid_base + cm->mode_info_stride + 1;
+ cm->prev_mi_grid_visible = cm->prev_mi_grid_base +
+ cm->mode_info_stride + 1;
- pbi->mb.mi_8x8 = cm->mi_grid_visible;
- pbi->mb.mi_8x8[0] = cm->mi;
-
+ pbi->mb.mi_8x8 = cm->mi_grid_visible;
+ pbi->mb.mi_8x8[0] = cm->mi;
+ }
cm->current_video_frame++;
}