ref: ef73bbf77808085a1be54bdf07b61c850249b5a2
parent: eba342af878240a47b4d5e97657724d47f303e5b
author: Ronald S. Bultje <[email protected]>
date: Mon Sep 7 06:14:18 EDT 2015
vp10: remove duplicate frame_parallel_decode field. Keep the one in VP10_COMMON in favour of the one in VP10_DECODER. Change-Id: Ia81983ccc95d83829dc815e28d9b1143e16e27b1
--- a/vp10/common/onyxc_int.h
+++ b/vp10/common/onyxc_int.h
@@ -233,8 +233,6 @@
struct loopfilter lf;
struct segmentation seg;
- // TODO(hkuang): Remove this as it is the same as frame_parallel_decode
- // in pbi.
int frame_parallel_decode; // frame-based threading.
// Context probabilities for reference frame prediction
--- a/vp10/decoder/decodeframe.c
+++ b/vp10/decoder/decodeframe.c
@@ -527,6 +527,7 @@
struct buf_2d *dst_buf, const MV* mv,
RefCntBuffer *ref_frame_buf,
int is_scaled, int ref) {
+ VP10_COMMON *const cm = &pbi->common;
struct macroblockd_plane *const pd = &xd->plane[plane];
uint8_t *const dst = dst_buf->buf + dst_buf->stride * y + x;
MV32 scaled_mv;
@@ -623,7 +624,7 @@
// Wait until reference block is ready. Pad 7 more pixels as last 7
// pixels of each superblock row can be changed by next superblock row.
- if (pbi->frame_parallel_decode)
+ if (cm->frame_parallel_decode)
vp10_frameworker_wait(pbi->frame_worker_owner, ref_frame_buf,
VPXMAX(0, (y1 + 7)) << (plane == 0 ? 0 : 1));
@@ -650,7 +651,7 @@
} else {
// Wait until reference block is ready. Pad 7 more pixels as last 7
// pixels of each superblock row can be changed by next superblock row.
- if (pbi->frame_parallel_decode) {
+ if (cm->frame_parallel_decode) {
const int y1 = (y0_16 + (h - 1) * ys) >> SUBPEL_BITS;
vp10_frameworker_wait(pbi->frame_worker_owner, ref_frame_buf,
VPXMAX(0, (y1 + 7)) << (plane == 0 ? 0 : 1));
@@ -1509,7 +1510,7 @@
// After loopfiltering, the last 7 row pixels in each superblock row may
// still be changed by the longest loopfilter of the next superblock
// row.
- if (pbi->frame_parallel_decode)
+ if (cm->frame_parallel_decode)
vp10_frameworker_broadcast(pbi->cur_buf,
mi_row << MI_BLOCK_SIZE_LOG2);
}
@@ -1527,7 +1528,7 @@
// Get last tile data.
tile_data = pbi->tile_data + tile_cols * tile_rows - 1;
- if (pbi->frame_parallel_decode)
+ if (cm->frame_parallel_decode)
vp10_frameworker_broadcast(pbi->cur_buf, INT_MAX);
return vpx_reader_find_end(&tile_data->bit_reader);
}
@@ -1817,7 +1818,7 @@
cm->lf.filter_level = 0;
cm->show_frame = 1;
- if (pbi->frame_parallel_decode) {
+ if (cm->frame_parallel_decode) {
for (i = 0; i < REF_FRAMES; ++i)
cm->next_ref_frame_map[i] = cm->ref_frame_map[i];
}
@@ -2186,7 +2187,7 @@
// If encoded in frame parallel mode, frame context is ready after decoding
// the frame header.
- if (pbi->frame_parallel_decode && cm->frame_parallel_decoding_mode) {
+ if (cm->frame_parallel_decode && cm->frame_parallel_decoding_mode) {
VPxWorker *const worker = pbi->frame_worker_owner;
FrameWorkerData *const frame_worker_data = worker->data1;
if (cm->refresh_frame_context) {
--- a/vp10/decoder/decoder.c
+++ b/vp10/decoder/decoder.c
@@ -258,7 +258,7 @@
pbi->hold_ref_buf = 0;
cm->frame_to_show = get_frame_new_buffer(cm);
- if (!pbi->frame_parallel_decode || !cm->show_frame) {
+ if (!cm->frame_parallel_decode || !cm->show_frame) {
lock_buffer_pool(pool);
--frame_bufs[cm->new_fb_idx].ref_count;
unlock_buffer_pool(pool);
@@ -297,7 +297,7 @@
// Check if the previous frame was a frame without any references to it.
// Release frame buffer if not decoding in frame parallel mode.
- if (!pbi->frame_parallel_decode && cm->new_fb_idx >= 0
+ if (!cm->frame_parallel_decode && cm->new_fb_idx >= 0
&& frame_bufs[cm->new_fb_idx].ref_count == 0)
pool->release_fb_cb(pool->cb_priv,
&frame_bufs[cm->new_fb_idx].raw_frame_buffer);
@@ -310,7 +310,7 @@
cm->cur_frame = &pool->frame_bufs[cm->new_fb_idx];
pbi->hold_ref_buf = 0;
- if (pbi->frame_parallel_decode) {
+ if (cm->frame_parallel_decode) {
VPxWorker *const worker = pbi->frame_worker_owner;
vp10_frameworker_lock_stats(worker);
frame_bufs[cm->new_fb_idx].frame_worker_owner = worker;
@@ -379,12 +379,12 @@
if (!cm->show_existing_frame) {
cm->last_show_frame = cm->show_frame;
cm->prev_frame = cm->cur_frame;
- if (cm->seg.enabled && !pbi->frame_parallel_decode)
+ if (cm->seg.enabled && !cm->frame_parallel_decode)
vp10_swap_current_and_last_seg_map(cm);
}
// Update progress in frame parallel decode.
- if (pbi->frame_parallel_decode) {
+ if (cm->frame_parallel_decode) {
// Need to lock the mutex here as another thread may
// be accessing this buffer.
VPxWorker *const worker = pbi->frame_worker_owner;
--- a/vp10/decoder/decoder.h
+++ b/vp10/decoder/decoder.h
@@ -55,8 +55,6 @@
int refresh_frame_flags;
- int frame_parallel_decode; // frame-based threading.
-
// TODO(hkuang): Combine this with cur_buf in macroblockd as they are
// the same.
RefCntBuffer *cur_buf; // Current decoding frame buffer.
--- a/vp10/vp10_dx_iface.c
+++ b/vp10/vp10_dx_iface.c
@@ -332,7 +332,7 @@
&data);
frame_worker_data->data_end = data;
- if (frame_worker_data->pbi->frame_parallel_decode) {
+ if (frame_worker_data->pbi->common.frame_parallel_decode) {
// In frame parallel decoding, a worker thread must successfully decode all
// the compressed data.
if (frame_worker_data->result != 0 ||
@@ -433,7 +433,6 @@
(ctx->frame_parallel_decode == 0) ? ctx->cfg.threads : 0;
frame_worker_data->pbi->inv_tile_order = ctx->invert_tile_order;
- frame_worker_data->pbi->frame_parallel_decode = ctx->frame_parallel_decode;
frame_worker_data->pbi->common.frame_parallel_decode =
ctx->frame_parallel_decode;
worker->hook = (VPxWorkerHook)frame_worker_hook;