summaryrefslogtreecommitdiff
path: root/vp8/decoder
diff options
context:
space:
mode:
authorPaul Wilkins <paulwilkins@google.com>2012-01-27 18:29:07 +0000
committerPaul Wilkins <paulwilkins@google.com>2012-01-31 12:51:57 +0000
commitfe96afa705075fbf5426ba9932dbb88362594551 (patch)
tree03f135c710f51b31f8fba9780d03a75af0173081 /vp8/decoder
parenta127c940c00a752c764889b9dcd9d83862a8d4f1 (diff)
downloadlibvpx-fe96afa705075fbf5426ba9932dbb88362594551.tar
libvpx-fe96afa705075fbf5426ba9932dbb88362594551.tar.gz
libvpx-fe96afa705075fbf5426ba9932dbb88362594551.tar.bz2
libvpx-fe96afa705075fbf5426ba9932dbb88362594551.zip
Moved some segmentation data structures.
Moved some segmentation data structures into VP8_COMMON Change-Id: I59c6e2edf7a0176e35319936eea450027aeb3b39
Diffstat (limited to 'vp8/decoder')
-rw-r--r--vp8/decoder/decodemv.c17
-rw-r--r--vp8/decoder/decodframe.c17
-rw-r--r--vp8/decoder/onyxd_if.c4
-rw-r--r--vp8/decoder/onyxd_int.h1
4 files changed, 20 insertions, 19 deletions
diff --git a/vp8/decoder/decodemv.c b/vp8/decoder/decodemv.c
index b33d15f88..5e7d5c099 100644
--- a/vp8/decoder/decodemv.c
+++ b/vp8/decoder/decodemv.c
@@ -83,12 +83,12 @@ static void vp8_kfread_modes(VP8D_COMP *pbi,
MB_PREDICTION_MODE y_mode;
// Read the Macroblock segmentation map if it is being updated explicitly
- // this frame (reset to 0 above by default).
+ // this frame (reset to 0 by default).
m->mbmi.segment_id = 0;
if (pbi->mb.update_mb_segmentation_map)
{
vp8_read_mb_segid(bc, &m->mbmi, &pbi->mb);
- pbi->segmentation_map[map_index] = m->mbmi.segment_id;
+ pbi->common.last_frame_seg_map[map_index] = m->mbmi.segment_id;
}
//#if CONFIG_SEGFEATURES
@@ -435,6 +435,7 @@ static void read_mb_modes_mv(VP8D_COMP *pbi, MODE_INFO *mi, MB_MODE_INFO *mbmi,
#endif
int mb_row, int mb_col)
{
+ VP8_COMMON *const cm = & pbi->common;
vp8_reader *const bc = & pbi->bc;
MV_CONTEXT *const mvc = pbi->common.fc.mvc;
const int mis = pbi->common.mode_info_stride;
@@ -473,7 +474,7 @@ static void read_mb_modes_mv(VP8D_COMP *pbi, MODE_INFO *mi, MB_MODE_INFO *mbmi,
if (xd->update_mb_segmentation_map)
{
// Is temporal coding of the segment id for this mb enabled.
- if (xd->temporal_update)
+ if (cm->temporal_update)
{
// Work out a context for decoding seg_id_predicted.
pred_context = 0;
@@ -481,21 +482,21 @@ static void read_mb_modes_mv(VP8D_COMP *pbi, MODE_INFO *mi, MB_MODE_INFO *mbmi,
pred_context += (mi-1)->mbmi.seg_id_predicted;
if (mb_row != 0)
pred_context +=
- (mi-pbi->common.mode_info_stride)->mbmi.seg_id_predicted;
+ (mi-cm->mode_info_stride)->mbmi.seg_id_predicted;
mbmi->seg_id_predicted =
vp8_read(bc,
- xd->mb_segment_pred_probs[pred_context]);
+ cm->segment_pred_probs[pred_context]);
if ( mbmi->seg_id_predicted )
{
- mbmi->segment_id = pbi->segmentation_map[index];
+ mbmi->segment_id = cm->last_frame_seg_map[index];
}
// If the segment id was not predicted decode it explicitly
else
{
vp8_read_mb_segid(bc, &mi->mbmi, xd);
- pbi->segmentation_map[index] = mbmi->segment_id;
+ cm->last_frame_seg_map[index] = mbmi->segment_id;
}
}
@@ -503,7 +504,7 @@ static void read_mb_modes_mv(VP8D_COMP *pbi, MODE_INFO *mi, MB_MODE_INFO *mbmi,
else
{
vp8_read_mb_segid(bc, &mi->mbmi, xd);
- pbi->segmentation_map[index] = mbmi->segment_id;
+ cm->last_frame_seg_map[index] = mbmi->segment_id;
}
index++;
}
diff --git a/vp8/decoder/decodframe.c b/vp8/decoder/decodframe.c
index 6e8284f46..64a5557c0 100644
--- a/vp8/decoder/decodframe.c
+++ b/vp8/decoder/decodframe.c
@@ -1063,7 +1063,7 @@ int vp8_decode_frame(VP8D_COMP *pbi)
// If so what method will be used.
if ( xd->update_mb_segmentation_map )
- xd->temporal_update = (unsigned char)vp8_read_bit(bc);
+ pc->temporal_update = (unsigned char)vp8_read_bit(bc);
// Is the segment data being updated
xd->update_mb_segmentation_data = (unsigned char)vp8_read_bit(bc);
@@ -1114,8 +1114,8 @@ int vp8_decode_frame(VP8D_COMP *pbi)
// Which macro block level features are enabled
vpx_memset(xd->mb_segment_tree_probs, 255,
sizeof(xd->mb_segment_tree_probs));
- vpx_memset(xd->mb_segment_pred_probs, 255,
- sizeof(xd->mb_segment_pred_probs));
+ vpx_memset(pc->segment_pred_probs, 255,
+ sizeof(pc->segment_pred_probs));
// Read the probs used to decode the segment id for each macro
// block.
@@ -1130,16 +1130,16 @@ int vp8_decode_frame(VP8D_COMP *pbi)
// If predictive coding of segment map is enabled read the
// prediction probabilities.
- if ( xd->temporal_update )
+ if ( pc->temporal_update )
{
// Read the prediction probs needed to decode the segment id
// when predictive coding enabled
- for (i = 0; i < SEGMENT_PREDICTION_PROBS; i++)
+ for (i = 0; i < PREDICTION_PROBS; i++)
{
// If not explicitly set value is defaulted to 255 by
// memset above
if (vp8_read_bit(bc))
- xd->mb_segment_pred_probs[i] =
+ pc->segment_pred_probs[i] =
(vp8_prob)vp8_read_literal(bc, 8);
}
}
@@ -1352,8 +1352,9 @@ int vp8_decode_frame(VP8D_COMP *pbi)
vpx_memcpy(&xd->dst, &pc->yv12_fb[pc->new_fb_idx], sizeof(YV12_BUFFER_CONFIG));
// Create the encoder segmentation map and set all entries to 0
- if (!pbi->segmentation_map)
- CHECK_MEM_ERROR(pbi->segmentation_map, vpx_calloc((pc->mb_rows * pc->mb_cols), 1));
+ if (!pc->last_frame_seg_map)
+ CHECK_MEM_ERROR(pc->last_frame_seg_map,
+ vpx_calloc((pc->mb_rows * pc->mb_cols), 1));
/* set up frame new frame for intra coded blocks */
#if CONFIG_MULTITHREAD
diff --git a/vp8/decoder/onyxd_if.c b/vp8/decoder/onyxd_if.c
index ed7baac3e..391e579d8 100644
--- a/vp8/decoder/onyxd_if.c
+++ b/vp8/decoder/onyxd_if.c
@@ -202,8 +202,8 @@ void vp8dx_remove_decompressor(VP8D_PTR ptr)
return;
// Delete sementation map
- if (pbi->segmentation_map != 0)
- vpx_free(pbi->segmentation_map);
+ if (pbi->common.last_frame_seg_map != 0)
+ vpx_free(pbi->common.last_frame_seg_map);
#if CONFIG_MULTITHREAD
if (pbi->b_multithreaded_rd)
diff --git a/vp8/decoder/onyxd_int.h b/vp8/decoder/onyxd_int.h
index cf686380a..21d223e5d 100644
--- a/vp8/decoder/onyxd_int.h
+++ b/vp8/decoder/onyxd_int.h
@@ -89,7 +89,6 @@ typedef struct VP8Decompressor
const unsigned char *partitions[MAX_PARTITIONS];
unsigned int partition_sizes[MAX_PARTITIONS];
unsigned int num_partitions;
- unsigned char *segmentation_map;
#if CONFIG_MULTITHREAD
/* variable for threading */