ref: b8e027989f166cbfc23821bcffbb80ba1427ab6f
parent: 9bf73f46f9ce98be0f62d5f858be3e2100ddae5d
author: John Koleszar <jkoleszar@google.com>
date: Mon Jan 14 09:44:39 EST 2013
Remove buffer-to-buffer copy logic This is the first in a series of commits to add additional reference frames to the codec. Each frame will be able to update any of the available references, but copying between references is not supported. Change-Id: I5945b5ce6cc3582c495102b4e7eed4f08c44d5a1
--- a/vp9/common/vp9_alloccommon.c
+++ b/vp9/common/vp9_alloccommon.c
@@ -204,9 +204,6 @@
/* Initialise reference frame sign bias structure to defaults */
vpx_memset(oci->ref_frame_sign_bias, 0, sizeof(oci->ref_frame_sign_bias));
- /* Default disable buffer to buffer copying */
- oci->copy_buffer_to_gf = 0;
- oci->copy_buffer_to_arf = 0;
oci->kf_ymode_probs_update = 0;
}
--- a/vp9/common/vp9_onyxc_int.h
+++ b/vp9/common/vp9_onyxc_int.h
@@ -206,9 +206,6 @@
int refresh_golden_frame; /* Two state 0 = NO, 1 = YES */
int refresh_alt_ref_frame; /* Two state 0 = NO, 1 = YES */
- int copy_buffer_to_gf; /* 0 none, 1 Last to GF, 2 ARF to GF */
- int copy_buffer_to_arf; /* 0 none, 1 Last to ARF, 2 GF to ARF */
-
int refresh_entropy_probs; /* Two state 0 = NO, 1 = YES */
int ref_frame_sign_bias[MAX_REF_FRAMES]; /* Two state 0, 1 */
--- a/vp9/decoder/vp9_decodframe.c
+++ b/vp9/decoder/vp9_decodframe.c
@@ -1290,8 +1290,6 @@
/* All buffers are implicitly updated on key frames. */
pc->refresh_golden_frame = 1;
pc->refresh_alt_ref_frame = 1;
- pc->copy_buffer_to_gf = 0;
- pc->copy_buffer_to_arf = 0;
/* Note that Golden and Altref modes cannot be used on a key frame so
* ref_frame_sign_bias[] is undefined and meaningless
@@ -1655,17 +1653,6 @@
} else {
vpx_memcpy(&pc->fc, &pc->lfc, sizeof(pc->fc));
}
-
- /* Buffer to buffer copy flags. */
- pc->copy_buffer_to_gf = 0;
-
- if (!pc->refresh_golden_frame)
- pc->copy_buffer_to_gf = vp9_read_literal(&header_bc, 2);
-
- pc->copy_buffer_to_arf = 0;
-
- if (!pc->refresh_alt_ref_frame)
- pc->copy_buffer_to_arf = vp9_read_literal(&header_bc, 2);
pc->ref_frame_sign_bias[GOLDEN_FRAME] = vp9_read_bit(&header_bc);
pc->ref_frame_sign_bias[ALTREF_FRAME] = vp9_read_bit(&header_bc);
--- a/vp9/decoder/vp9_onyxd_if.c
+++ b/vp9/decoder/vp9_onyxd_if.c
@@ -259,36 +259,8 @@
int err = 0;
/* The alternate reference frame or golden frame can be updated
- * using the new, last, or golden/alt ref frame. If it
- * is updated using the newly decoded frame it is a refresh.
- * An update using the last or golden/alt ref frame is a copy.
+ * using the new frame.
*/
- if (cm->copy_buffer_to_arf) {
- int new_fb = 0;
-
- if (cm->copy_buffer_to_arf == 1)
- new_fb = cm->lst_fb_idx;
- else if (cm->copy_buffer_to_arf == 2)
- new_fb = cm->gld_fb_idx;
- else
- err = -1;
-
- ref_cnt_fb(cm->fb_idx_ref_cnt, &cm->alt_fb_idx, new_fb);
- }
-
- if (cm->copy_buffer_to_gf) {
- int new_fb = 0;
-
- if (cm->copy_buffer_to_gf == 1)
- new_fb = cm->lst_fb_idx;
- else if (cm->copy_buffer_to_gf == 2)
- new_fb = cm->alt_fb_idx;
- else
- err = -1;
-
- ref_cnt_fb(cm->fb_idx_ref_cnt, &cm->gld_fb_idx, new_fb);
- }
-
if (cm->refresh_golden_frame)
ref_cnt_fb(cm->fb_idx_ref_cnt, &cm->gld_fb_idx, cm->new_fb_idx);
--- a/vp9/encoder/vp9_bitstream.c
+++ b/vp9/encoder/vp9_bitstream.c
@@ -1776,19 +1776,6 @@
vp9_write_bit(&header_bc, pc->refresh_golden_frame);
vp9_write_bit(&header_bc, pc->refresh_alt_ref_frame);
- // For inter frames the current default behavior is that when
- // cm->refresh_golden_frame is set we copy the old GF over to
- // the ARF buffer. This is purely an encoder decision at present.
- if (pc->refresh_golden_frame)
- pc->copy_buffer_to_arf = 2;
-
- // If not being updated from current frame should either GF or ARF be updated from another buffer
- if (!pc->refresh_golden_frame)
- vp9_write_literal(&header_bc, pc->copy_buffer_to_gf, 2);
-
- if (!pc->refresh_alt_ref_frame)
- vp9_write_literal(&header_bc, pc->copy_buffer_to_arf, 2);
-
// 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]);
--- a/vp9/encoder/vp9_onyx_if.c
+++ b/vp9/encoder/vp9_onyx_if.c
@@ -2578,51 +2578,15 @@
cm->alt_fb_idx = cm->gld_fb_idx = cm->new_fb_idx;
} else { /* For non key frames */
if (cm->refresh_alt_ref_frame) {
- assert(!cm->copy_buffer_to_arf);
-
cm->yv12_fb[cm->new_fb_idx].flags |= VP9_ALT_FLAG;
cm->yv12_fb[cm->alt_fb_idx].flags &= ~VP9_ALT_FLAG;
cm->alt_fb_idx = cm->new_fb_idx;
- } else if (cm->copy_buffer_to_arf) {
- assert(!(cm->copy_buffer_to_arf & ~0x3));
-
- if (cm->copy_buffer_to_arf == 1) {
- if (cm->alt_fb_idx != cm->lst_fb_idx) {
- yv12_fb[cm->lst_fb_idx].flags |= VP9_ALT_FLAG;
- yv12_fb[cm->alt_fb_idx].flags &= ~VP9_ALT_FLAG;
- cm->alt_fb_idx = cm->lst_fb_idx;
- }
- } else { /* if (cm->copy_buffer_to_arf == 2) */
- if (cm->alt_fb_idx != cm->gld_fb_idx) {
- yv12_fb[cm->gld_fb_idx].flags |= VP9_ALT_FLAG;
- yv12_fb[cm->alt_fb_idx].flags &= ~VP9_ALT_FLAG;
- cm->alt_fb_idx = cm->gld_fb_idx;
- }
- }
}
if (cm->refresh_golden_frame) {
- assert(!cm->copy_buffer_to_gf);
-
cm->yv12_fb[cm->new_fb_idx].flags |= VP9_GOLD_FLAG;
cm->yv12_fb[cm->gld_fb_idx].flags &= ~VP9_GOLD_FLAG;
cm->gld_fb_idx = cm->new_fb_idx;
- } else if (cm->copy_buffer_to_gf) {
- assert(!(cm->copy_buffer_to_arf & ~0x3));
-
- if (cm->copy_buffer_to_gf == 1) {
- if (cm->gld_fb_idx != cm->lst_fb_idx) {
- yv12_fb[cm->lst_fb_idx].flags |= VP9_GOLD_FLAG;
- yv12_fb[cm->gld_fb_idx].flags &= ~VP9_GOLD_FLAG;
- cm->gld_fb_idx = cm->lst_fb_idx;
- }
- } else { /* if (cm->copy_buffer_to_gf == 2) */
- if (cm->alt_fb_idx != cm->gld_fb_idx) {
- yv12_fb[cm->alt_fb_idx].flags |= VP9_GOLD_FLAG;
- yv12_fb[cm->gld_fb_idx].flags &= ~VP9_GOLD_FLAG;
- cm->gld_fb_idx = cm->alt_fb_idx;
- }
- }
}
}
@@ -2786,10 +2750,6 @@
cpi->output_frame_rate);
}
- // Default turn off buffer to buffer copying
- cm->copy_buffer_to_gf = 0;
- cm->copy_buffer_to_arf = 0;
-
// Clear zbin over-quant value and mode boost values.
cpi->zbin_over_quant = 0;
cpi->zbin_mode_boost = 0;
@@ -3810,7 +3770,6 @@
return cm->frame_type == KEY_FRAME || cm->refresh_last_frame
|| cm->refresh_golden_frame || cm->refresh_alt_ref_frame
- || cm->copy_buffer_to_gf || cm->copy_buffer_to_arf
|| cm->refresh_entropy_probs
|| xd->mode_ref_lf_delta_update
|| xd->update_mb_segmentation_map || xd->update_mb_segmentation_data;
--
⑨