summaryrefslogtreecommitdiff
path: root/vp9/common/vp9_onyxc_int.h
diff options
context:
space:
mode:
authorhkuang <hkuang@google.com>2014-07-17 14:25:41 -0700
committerhkuang <hkuang@google.com>2014-07-28 10:44:02 -0700
commit7eca086707f3e0f631a5be8952f594f4c387ca74 (patch)
tree6470e272684332419ea88514dd7a16c8328ffcd4 /vp9/common/vp9_onyxc_int.h
parent4c08120ca016242701fee62f83f826d48a9bb315 (diff)
downloadlibvpx-7eca086707f3e0f631a5be8952f594f4c387ca74.tar
libvpx-7eca086707f3e0f631a5be8952f594f4c387ca74.tar.gz
libvpx-7eca086707f3e0f631a5be8952f594f4c387ca74.tar.bz2
libvpx-7eca086707f3e0f631a5be8952f594f4c387ca74.zip
Add segmentation map array for current and last frame segmentation.
The original implementation only allocates one segmentation map and this works fine for serial decode. But for frame parallel decode, each thread need to have its own segmentation map and the last frame segmentation map should be provided from last frame decoding thread. After finishing decoding a frame, thread need to serve the old segmentation map that associate with the previous decoded frame. The thread also need to use another segmentation map for decoding the current frame. Change-Id: I442ddff36b5de9cb8a7eb59e225744c78f4492d8
Diffstat (limited to 'vp9/common/vp9_onyxc_int.h')
-rw-r--r--vp9/common/vp9_onyxc_int.h13
1 files changed, 10 insertions, 3 deletions
diff --git a/vp9/common/vp9_onyxc_int.h b/vp9/common/vp9_onyxc_int.h
index f31e137b0..13c500147 100644
--- a/vp9/common/vp9_onyxc_int.h
+++ b/vp9/common/vp9_onyxc_int.h
@@ -44,6 +44,8 @@ extern "C" {
#define FRAME_CONTEXTS_LOG2 2
#define FRAME_CONTEXTS (1 << FRAME_CONTEXTS_LOG2)
+#define NUM_PING_PONG_BUFFERS 2
+
extern const struct {
PARTITION_CONTEXT above;
PARTITION_CONTEXT left;
@@ -163,8 +165,8 @@ typedef struct VP9Common {
int mi_idx;
int prev_mi_idx;
- MODE_INFO *mip_array[2];
- MODE_INFO **mi_grid_base_array[2];
+ MODE_INFO *mip_array[NUM_PING_PONG_BUFFERS];
+ MODE_INFO **mi_grid_base_array[NUM_PING_PONG_BUFFERS];
MODE_INFO *mip; /* Base of allocated array */
MODE_INFO *mi; /* Corresponds to upper left visible macroblock */
@@ -177,7 +179,12 @@ typedef struct VP9Common {
MODE_INFO **prev_mi_grid_visible;
// Persistent mb segment id map used in prediction.
- unsigned char *last_frame_seg_map;
+ int seg_map_idx;
+ int prev_seg_map_idx;
+
+ uint8_t *seg_map_array[NUM_PING_PONG_BUFFERS];
+ uint8_t *last_frame_seg_map;
+ uint8_t *current_frame_seg_map;
INTERP_FILTER interp_filter;