diff options
Diffstat (limited to 'vp8/decoder/decodframe.c')
-rw-r--r-- | vp8/decoder/decodframe.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/vp8/decoder/decodframe.c b/vp8/decoder/decodframe.c index a585f774c..90de58ed6 100644 --- a/vp8/decoder/decodframe.c +++ b/vp8/decoder/decodframe.c @@ -583,7 +583,6 @@ int vp8_decode_frame(VP8D_COMP *pbi) const unsigned char *data = (const unsigned char *)pbi->Source; const unsigned char *const data_end = data + pbi->source_sz; ptrdiff_t first_partition_length_in_bytes; - int mb_row; int i, j, k, l; const int *const mb_feature_data_bits = vp8_mb_feature_data_bits; @@ -670,7 +669,6 @@ int vp8_decode_frame(VP8D_COMP *pbi) /* Is segmentation enabled */ xd->segmentation_enabled = (unsigned char)vp8_read_bit(bc); - if (xd->segmentation_enabled) { /* Signal whether or not the segmentation map is being explicitly updated this frame. */ @@ -706,9 +704,12 @@ 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)); - +#if CONFIG_SEGMENTATION /* Read the probs used to decode the segment id for each macro block. */ + for (i = 0; i < MB_FEATURE_TREE_PROBS+3; i++) +#else for (i = 0; i < MB_FEATURE_TREE_PROBS; i++) +#endif { /* If not explicitly set value is defaulted to 255 by memset above */ if (vp8_read_bit(bc)) @@ -830,7 +831,6 @@ int vp8_decode_frame(VP8D_COMP *pbi) fclose(z); } - { /* read coef probability tree */ @@ -853,6 +853,11 @@ int vp8_decode_frame(VP8D_COMP *pbi) vpx_memcpy(&xd->pre, &pc->yv12_fb[pc->lst_fb_idx], sizeof(YV12_BUFFER_CONFIG)); vpx_memcpy(&xd->dst, &pc->yv12_fb[pc->new_fb_idx], sizeof(YV12_BUFFER_CONFIG)); +#if CONFIG_SEGMENTATION + // Create the encoder segmentation map and set all entries to 0 + CHECK_MEM_ERROR(pbi->segmentation_map, vpx_calloc((pc->mb_rows * pc->mb_cols), 1)); +#endif + /* set up frame new frame for intra coded blocks */ #if CONFIG_MULTITHREAD if (!(pbi->b_multithreaded_rd) || pc->multi_token_partition == ONE_PARTITION || !(pc->filter_level)) |