Extend number of reference buffers to 8.

The number of reference buffers is extended to 8 and
a reference sign-bias added for the LAST_FRAME.

Whilst the number of reference buffers used by an
individual frame remains unchanged at 3, these may
now be selected from 8 possible buffers.

Change-Id: I2d247b9c1c2b3a339d6c9fac125e81ba373f75a7
This commit is contained in:
Adrian Grange 2013-05-02 16:41:19 -07:00
parent 1e26cdc178
commit d7eea782f2
4 changed files with 11 additions and 12 deletions

View File

@ -771,8 +771,7 @@ void vp9_setup_past_independence(VP9_COMMON *cm, MACROBLOCKD *xd) {
vp9_update_mode_info_border(cm, cm->prev_mip);
vp9_update_mode_info_in_image(cm, cm->prev_mi);
cm->ref_frame_sign_bias[GOLDEN_FRAME] = 0;
cm->ref_frame_sign_bias[ALTREF_FRAME] = 0;
vpx_memset(cm->ref_frame_sign_bias, 0, sizeof(cm->ref_frame_sign_bias));
cm->frame_context_idx = 0;
}

View File

@ -32,13 +32,9 @@
void vp9_initialize_common(void);
#if CONFIG_MULTIPLE_ARF
// Define the number of candidate reference buffers.
#define NUM_REF_FRAMES 8
#define NUM_REF_FRAMES_LG2 3
#else
#define NUM_REF_FRAMES 3
#define NUM_REF_FRAMES_LG2 2
#endif
#define ALLOWED_REFS_PER_FRAME 3

View File

@ -1278,8 +1278,11 @@ int vp9_decode_frame(VP9D_COMP *pbi, const uint8_t **p_data_end) {
vp9_setup_scale_factors_for_frame(sf, fb, pc->width, pc->height);
}
pc->ref_frame_sign_bias[GOLDEN_FRAME] = vp9_read_bit(&header_bc);
pc->ref_frame_sign_bias[ALTREF_FRAME] = vp9_read_bit(&header_bc);
// Read the sign bias for each reference frame buffer.
for (i = 0; i < ALLOWED_REFS_PER_FRAME; ++i) {
pc->ref_frame_sign_bias[i + 1] = vp9_read_bit(&header_bc);
}
xd->allow_high_precision_mv = vp9_read_bit(&header_bc);
pc->mcomp_filter_type = read_mcomp_filter_type(&header_bc);

View File

@ -1985,9 +1985,10 @@ void vp9_pack_bitstream(VP9_COMP *cpi, uint8_t *dest, unsigned long *size) {
vp9_write_literal(&header_bc, cpi->gld_fb_idx, NUM_REF_FRAMES_LG2);
vp9_write_literal(&header_bc, cpi->alt_fb_idx, NUM_REF_FRAMES_LG2);
// Indicate reference frame sign bias for Golden and ARF frames (always 0 for last frame buffer)
vp9_write_bit(&header_bc, pc->ref_frame_sign_bias[GOLDEN_FRAME]);
vp9_write_bit(&header_bc, pc->ref_frame_sign_bias[ALTREF_FRAME]);
// Indicate the sign bias for each reference frame buffer.
for (i = 0; i < ALLOWED_REFS_PER_FRAME; ++i) {
vp9_write_bit(&header_bc, pc->ref_frame_sign_bias[LAST_FRAME + i]);
}
// Signal whether to allow high MV precision
vp9_write_bit(&header_bc, (xd->allow_high_precision_mv) ? 1 : 0);