summaryrefslogtreecommitdiff
path: root/vp9/decoder/vp9_decodeframe.c
diff options
context:
space:
mode:
Diffstat (limited to 'vp9/decoder/vp9_decodeframe.c')
-rw-r--r--vp9/decoder/vp9_decodeframe.c38
1 files changed, 27 insertions, 11 deletions
diff --git a/vp9/decoder/vp9_decodeframe.c b/vp9/decoder/vp9_decodeframe.c
index 56b05cee1..79f0835a7 100644
--- a/vp9/decoder/vp9_decodeframe.c
+++ b/vp9/decoder/vp9_decodeframe.c
@@ -266,7 +266,7 @@ static void inverse_transform_block(MACROBLOCKD* xd, int plane, int block,
vp9_idct32x32_add(dqcoeff, dst, stride, eob);
break;
default:
- assert(!"Invalid transform size");
+ assert(0 && "Invalid transform size");
}
if (eob == 1) {
@@ -348,23 +348,27 @@ static void reconstruct_inter_block(int plane, int block,
static void set_offsets(VP9_COMMON *const cm, MACROBLOCKD *const xd,
const TileInfo *const tile,
BLOCK_SIZE bsize, int mi_row, int mi_col) {
- const int bh = num_8x8_blocks_high_lookup[bsize];
const int bw = num_8x8_blocks_wide_lookup[bsize];
+ const int bh = num_8x8_blocks_high_lookup[bsize];
+ const int x_mis = MIN(bw, cm->mi_cols - mi_col);
+ const int y_mis = MIN(bh, cm->mi_rows - mi_row);
const int offset = mi_row * cm->mode_info_stride + mi_col;
const int tile_offset = tile->mi_row_start * cm->mode_info_stride +
tile->mi_col_start;
+ int x, y;
xd->mi_8x8 = cm->mi_grid_visible + offset;
xd->prev_mi_8x8 = cm->prev_mi_grid_visible + offset;
-
- // we are using the mode info context stream here
- xd->mi_8x8[0] = xd->mi_stream + offset - tile_offset;
- xd->mi_8x8[0]->mbmi.sb_type = bsize;
-
// Special case: if prev_mi is NULL, the previous mode info context
// cannot be used.
xd->last_mi = cm->prev_mi ? xd->prev_mi_8x8[0] : NULL;
+ xd->mi_8x8[0] = xd->mi_stream + offset - tile_offset;
+ xd->mi_8x8[0]->mbmi.sb_type = bsize;
+ for (y = 0; y < y_mis; ++y)
+ for (x = !y; x < x_mis; ++x)
+ xd->mi_8x8[y * cm->mode_info_stride + x] = xd->mi_8x8[0];
+
set_skip_context(xd, xd->above_context, xd->left_context, mi_row, mi_col);
// Distance of Mb to the various image edges. These are specified to 8th pel
@@ -507,7 +511,7 @@ static void decode_modes_sb(VP9_COMMON *const cm, MACROBLOCKD *const xd,
decode_modes_sb(cm, xd, tile, mi_row + hbs, mi_col + hbs, r, subsize);
break;
default:
- assert(!"Invalid partition type");
+ assert(0 && "Invalid partition type");
}
}
@@ -703,9 +707,21 @@ static void apply_frame_size(VP9D_COMP *pbi, int width, int height) {
vp9_update_frame_size(cm);
}
- vp9_realloc_frame_buffer(get_frame_new_buffer(cm), cm->width, cm->height,
- cm->subsampling_x, cm->subsampling_y,
- VP9BORDERINPIXELS);
+ if (cm->fb_list != NULL) {
+ vpx_codec_frame_buffer_t *const ext_fb = &cm->fb_list[cm->new_fb_idx];
+ if (vp9_realloc_frame_buffer(get_frame_new_buffer(cm),
+ cm->width, cm->height,
+ cm->subsampling_x, cm->subsampling_y,
+ VP9BORDERINPIXELS, ext_fb,
+ cm->realloc_fb_cb, cm->user_priv)) {
+ vpx_internal_error(&cm->error, VPX_CODEC_MEM_ERROR,
+ "Failed to allocate external frame buffer");
+ }
+ } else {
+ vp9_realloc_frame_buffer(get_frame_new_buffer(cm), cm->width, cm->height,
+ cm->subsampling_x, cm->subsampling_y,
+ VP9BORDERINPIXELS, NULL, NULL, NULL);
+ }
}
static void setup_frame_size(VP9D_COMP *pbi,