summaryrefslogtreecommitdiff
path: root/vp9/decoder
diff options
context:
space:
mode:
Diffstat (limited to 'vp9/decoder')
-rw-r--r--vp9/decoder/vp9_decodeframe.c2
-rw-r--r--vp9/decoder/vp9_decodemv.c10
-rw-r--r--vp9/decoder/vp9_decoder.c46
3 files changed, 28 insertions, 30 deletions
diff --git a/vp9/decoder/vp9_decodeframe.c b/vp9/decoder/vp9_decodeframe.c
index d63912932..3199b98aa 100644
--- a/vp9/decoder/vp9_decodeframe.c
+++ b/vp9/decoder/vp9_decodeframe.c
@@ -589,7 +589,7 @@ static void dec_build_inter_predictors(VPxWorker *const worker, MACROBLOCKD *xd,
// Co-ordinate of containing block to pixel precision.
int x_start = (-xd->mb_to_left_edge >> (3 + pd->subsampling_x));
int y_start = (-xd->mb_to_top_edge >> (3 + pd->subsampling_y));
-#if CONFIG_BETTER_HW_COMPATIBILITY
+#if 0 // CONFIG_BETTER_HW_COMPATIBILITY
assert(xd->mi[0]->sb_type != BLOCK_4X8 &&
xd->mi[0]->sb_type != BLOCK_8X4);
assert(mv_q4.row == mv->row * (1 << (1 - pd->subsampling_y)) &&
diff --git a/vp9/decoder/vp9_decodemv.c b/vp9/decoder/vp9_decodemv.c
index ffc6839ad..6869036bc 100644
--- a/vp9/decoder/vp9_decodemv.c
+++ b/vp9/decoder/vp9_decodemv.c
@@ -902,10 +902,10 @@ void vp9_read_mode_info(VP9Decoder *const pbi, MACROBLOCKD *xd,
frame_mvs += cm->mi_cols;
}
}
-#if CONFIG_BETTER_HW_COMPATIBILITY && CONFIG_VP9_HIGHBITDEPTH
- if ((xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) &&
- (xd->above_mi == NULL || xd->left_mi == NULL) &&
- !is_inter_block(mi) && need_top_left[mi->uv_mode])
- assert(0);
+#if 0 // CONFIG_BETTER_HW_COMPATIBILITY && CONFIG_VP9_HIGHBITDEPTH
+ if ((xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) &&
+ (xd->above_mi == NULL || xd->left_mi == NULL) &&
+ !is_inter_block(mi) && need_top_left[mi->uv_mode])
+ assert(0);
#endif // CONFIG_BETTER_HW_COMPATIBILITY && CONFIG_VP9_HIGHBITDEPTH
}
diff --git a/vp9/decoder/vp9_decoder.c b/vp9/decoder/vp9_decoder.c
index 935c04f3a..9ed980081 100644
--- a/vp9/decoder/vp9_decoder.c
+++ b/vp9/decoder/vp9_decoder.c
@@ -187,47 +187,45 @@ vpx_codec_err_t vp9_copy_reference_dec(VP9Decoder *pbi,
vpx_codec_err_t vp9_set_reference_dec(VP9_COMMON *cm,
VP9_REFFRAME ref_frame_flag,
YV12_BUFFER_CONFIG *sd) {
- RefBuffer *ref_buf = NULL;
- RefCntBuffer *const frame_bufs = cm->buffer_pool->frame_bufs;
+ int idx;
+ YV12_BUFFER_CONFIG *ref_buf = NULL;
// TODO(jkoleszar): The decoder doesn't have any real knowledge of what the
// encoder is using the frame buffers for. This is just a stub to keep the
// vpxenc --test-decode functionality working, and will be replaced in a
// later commit that adds VP9-specific controls for this functionality.
+ // (Yunqing) The set_reference control depends on the following setting in
+ // encoder.
+ // cpi->lst_fb_idx = 0;
+ // cpi->gld_fb_idx = 1;
+ // cpi->alt_fb_idx = 2;
if (ref_frame_flag == VP9_LAST_FLAG) {
- ref_buf = &cm->frame_refs[0];
+ idx = cm->ref_frame_map[0];
} else if (ref_frame_flag == VP9_GOLD_FLAG) {
- ref_buf = &cm->frame_refs[1];
+ idx = cm->ref_frame_map[1];
} else if (ref_frame_flag == VP9_ALT_FLAG) {
- ref_buf = &cm->frame_refs[2];
+ idx = cm->ref_frame_map[2];
} else {
vpx_internal_error(&cm->error, VPX_CODEC_ERROR,
"Invalid reference frame");
return cm->error.error_code;
}
- if (!equal_dimensions(ref_buf->buf, sd)) {
+ if (idx < 0 || idx >= FRAME_BUFFERS) {
vpx_internal_error(&cm->error, VPX_CODEC_ERROR,
- "Incorrect buffer dimensions");
- } else {
- int *ref_fb_ptr = &ref_buf->idx;
-
- // Find an empty frame buffer.
- const int free_fb = get_free_fb(cm);
- if (cm->new_fb_idx == INVALID_IDX) {
- vpx_internal_error(&cm->error, VPX_CODEC_MEM_ERROR,
- "Unable to find free frame buffer");
- return cm->error.error_code;
- }
+ "Invalid reference frame map");
+ return cm->error.error_code;
+ }
- // Decrease ref_count since it will be increased again in
- // ref_cnt_fb() below.
- --frame_bufs[free_fb].ref_count;
+ // Get the destination reference buffer.
+ ref_buf = &cm->buffer_pool->frame_bufs[idx].buf;
- // Manage the reference counters and copy image.
- ref_cnt_fb(frame_bufs, ref_fb_ptr, free_fb);
- ref_buf->buf = &frame_bufs[*ref_fb_ptr].buf;
- vp8_yv12_copy_frame(sd, ref_buf->buf);
+ if (!equal_dimensions(ref_buf, sd)) {
+ vpx_internal_error(&cm->error, VPX_CODEC_ERROR,
+ "Incorrect buffer dimensions");
+ } else {
+ // Overwrite the reference frame buffer.
+ vp8_yv12_copy_frame(sd, ref_buf);
}
return cm->error.error_code;