Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(72)

Unified Diff: source/libvpx/vp9/decoder/vp9_onyxd_if.c

Issue 148913004: libvpx: Pull from upstream (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/deps/third_party/libvpx/
Patch Set: Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « source/libvpx/vp9/decoder/vp9_onyxd.h ('k') | source/libvpx/vp9/decoder/vp9_onyxd_int.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: source/libvpx/vp9/decoder/vp9_onyxd_if.c
===================================================================
--- source/libvpx/vp9/decoder/vp9_onyxd_if.c (revision 247498)
+++ source/libvpx/vp9/decoder/vp9_onyxd_if.c (working copy)
@@ -219,7 +219,7 @@
YV12_BUFFER_CONFIG *sd) {
VP9D_COMP *pbi = (VP9D_COMP *) ptr;
VP9_COMMON *cm = &pbi->common;
- int *ref_fb_ptr = NULL;
+ RefBuffer *ref_buf = NULL;
/* TODO(jkoleszar): The decoder doesn't have any real knowledge of what the
* encoder is using the frame buffers for. This is just a stub to keep the
@@ -227,21 +227,23 @@
* later commit that adds VP9-specific controls for this functionality.
*/
if (ref_frame_flag == VP9_LAST_FLAG) {
- ref_fb_ptr = &pbi->common.active_ref_idx[0];
+ ref_buf = &cm->frame_refs[0];
} else if (ref_frame_flag == VP9_GOLD_FLAG) {
- ref_fb_ptr = &pbi->common.active_ref_idx[1];
+ ref_buf = &cm->frame_refs[1];
} else if (ref_frame_flag == VP9_ALT_FLAG) {
- ref_fb_ptr = &pbi->common.active_ref_idx[2];
+ ref_buf = &cm->frame_refs[2];
} else {
vpx_internal_error(&pbi->common.error, VPX_CODEC_ERROR,
"Invalid reference frame");
return pbi->common.error.error_code;
}
- if (!equal_dimensions(&cm->yv12_fb[*ref_fb_ptr], sd)) {
+ if (!equal_dimensions(ref_buf->buf, sd)) {
vpx_internal_error(&pbi->common.error, VPX_CODEC_ERROR,
"Incorrect buffer dimensions");
} else {
+ int *ref_fb_ptr = &ref_buf->idx;
+
// Find an empty frame buffer.
const int free_fb = get_free_fb(cm);
// Decrease fb_idx_ref_cnt since it will be increased again in
@@ -250,7 +252,8 @@
// Manage the reference counters and copy image.
ref_cnt_fb(cm->fb_idx_ref_cnt, ref_fb_ptr, free_fb);
- vp8_yv12_copy_frame(sd, &cm->yv12_fb[*ref_fb_ptr]);
+ ref_buf->buf = &cm->yv12_fb[*ref_fb_ptr];
+ vp8_yv12_copy_frame(sd, ref_buf->buf);
}
return pbi->common.error.error_code;
@@ -285,7 +288,7 @@
// Invalidate these references until the next frame starts.
for (ref_index = 0; ref_index < 3; ref_index++)
- cm->active_ref_idx[ref_index] = INT_MAX;
+ cm->frame_refs[ref_index].idx = INT_MAX;
}
int vp9_receive_compressed_data(VP9D_PTR ptr,
@@ -317,8 +320,8 @@
* at this point, but if it becomes so, [0] may not always be the correct
* thing to do here.
*/
- if (cm->active_ref_idx[0] != INT_MAX)
- get_frame_ref_buffer(cm, 0)->corrupted = 1;
+ if (cm->frame_refs[0].idx != INT_MAX)
+ cm->frame_refs[0].buf->corrupted = 1;
}
cm->new_fb_idx = get_free_fb(cm);
@@ -334,8 +337,8 @@
* at this point, but if it becomes so, [0] may not always be the correct
* thing to do here.
*/
- if (cm->active_ref_idx[0] != INT_MAX)
- get_frame_ref_buffer(cm, 0)->corrupted = 1;
+ if (cm->frame_refs[0].idx != INT_MAX)
+ cm->frame_refs[0].buf->corrupted = 1;
if (cm->fb_idx_ref_cnt[cm->new_fb_idx] > 0)
cm->fb_idx_ref_cnt[cm->new_fb_idx]--;
@@ -389,23 +392,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++;
}
« no previous file with comments | « source/libvpx/vp9/decoder/vp9_onyxd.h ('k') | source/libvpx/vp9/decoder/vp9_onyxd_int.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698