From d2bf696ee02893204e1f505384ea385ac49eb9a3 Mon Sep 17 00:00:00 2001 From: James Zern Date: Thu, 24 Oct 2013 16:31:07 +0200 Subject: [PATCH] vp9: pass entropy context directly to set_skip_context this will allow for separate storage to be used in tile decoding Change-Id: I025595d83118bdc82a545dae69bc6602e8d2a6e3 --- vp9/common/vp9_onyxc_int.h | 11 +++++++---- vp9/decoder/vp9_decodframe.c | 2 +- vp9/encoder/vp9_encodeframe.c | 2 +- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/vp9/common/vp9_onyxc_int.h b/vp9/common/vp9_onyxc_int.h index 129028b..04964b3 100644 --- a/vp9/common/vp9_onyxc_int.h +++ b/vp9/common/vp9_onyxc_int.h @@ -248,15 +248,18 @@ static int mi_cols_aligned_to_sb(int n_mis) { return ALIGN_POWER_OF_TWO(n_mis, MI_BLOCK_SIZE_LOG2); } -static INLINE void set_skip_context(VP9_COMMON *cm, MACROBLOCKD *xd, - int mi_row, int mi_col) { +static INLINE void set_skip_context( + MACROBLOCKD *xd, + ENTROPY_CONTEXT *above_context[MAX_MB_PLANE], + ENTROPY_CONTEXT left_context[MAX_MB_PLANE][16], + int mi_row, int mi_col) { const int above_idx = mi_col * 2; const int left_idx = (mi_row * 2) & 15; int i; for (i = 0; i < MAX_MB_PLANE; i++) { struct macroblockd_plane *const pd = &xd->plane[i]; - pd->above_context = cm->above_context[i] + (above_idx >> pd->subsampling_x); - pd->left_context = cm->left_context[i] + (left_idx >> pd->subsampling_y); + pd->above_context = above_context[i] + (above_idx >> pd->subsampling_x); + pd->left_context = left_context[i] + (left_idx >> pd->subsampling_y); } } diff --git a/vp9/decoder/vp9_decodframe.c b/vp9/decoder/vp9_decodframe.c index 9ad0820..d50a1c2 100644 --- a/vp9/decoder/vp9_decodframe.c +++ b/vp9/decoder/vp9_decodframe.c @@ -328,7 +328,7 @@ static void set_offsets(VP9D_COMP *pbi, BLOCK_SIZE bsize, // cannot be used. xd->last_mi = cm->prev_mi ? xd->prev_mi_8x8[0] : NULL; - set_skip_context(cm, xd, mi_row, mi_col); + set_skip_context(xd, cm->above_context, cm->left_context, mi_row, mi_col); // Distance of Mb to the various image edges. These are specified to 8th pel // as they are always compared to values that are in 1/8th pel units diff --git a/vp9/encoder/vp9_encodeframe.c b/vp9/encoder/vp9_encodeframe.c index 3e96e08..e793d10 100644 --- a/vp9/encoder/vp9_encodeframe.c +++ b/vp9/encoder/vp9_encodeframe.c @@ -499,7 +499,7 @@ static void set_offsets(VP9_COMP *cpi, int mi_row, int mi_col, const int idx_map = mb_row * cm->mb_cols + mb_col; const struct segmentation *const seg = &cm->seg; - set_skip_context(cm, xd, mi_row, mi_col); + set_skip_context(xd, cm->above_context, cm->left_context, mi_row, mi_col); // Activity map pointer x->mb_activity_ptr = &cpi->mb_activity_map[idx_map]; -- 2.7.4