summaryrefslogtreecommitdiff
path: root/vp9/encoder
diff options
context:
space:
mode:
authorDmitry Kovalev <dkovalev@google.com>2014-08-20 12:10:14 -0700
committerGerrit Code Review <gerrit@gerrit.golo.chromium.org>2014-08-20 12:10:14 -0700
commitc8e933ef4be6c8cbe28734c62e7765bbbb76d4da (patch)
tree243b9db54b3f4532b5b1de1ca91fa1beb886a7b0 /vp9/encoder
parenta19035e8bbcd65f86e36541ca6e353c4881b8e54 (diff)
parenta8cd30cb5d3a54a17f5c7de61b2842dbc40a0c03 (diff)
downloadlibvpx-c8e933ef4be6c8cbe28734c62e7765bbbb76d4da.tar
libvpx-c8e933ef4be6c8cbe28734c62e7765bbbb76d4da.tar.gz
libvpx-c8e933ef4be6c8cbe28734c62e7765bbbb76d4da.tar.bz2
libvpx-c8e933ef4be6c8cbe28734c62e7765bbbb76d4da.zip
Merge "Removing gold_is_last, alt_is_last, gold_is_alt flags."
Diffstat (limited to 'vp9/encoder')
-rw-r--r--vp9/encoder/vp9_encoder.c46
-rw-r--r--vp9/encoder/vp9_encoder.h4
2 files changed, 16 insertions, 34 deletions
diff --git a/vp9/encoder/vp9_encoder.c b/vp9/encoder/vp9_encoder.c
index ee0b99cf7..d27620cc2 100644
--- a/vp9/encoder/vp9_encoder.c
+++ b/vp9/encoder/vp9_encoder.c
@@ -715,11 +715,6 @@ VP9_COMP *vp9_create_compressor(VP9EncoderConfig *oxcf) {
vp9_rc_init(&cpi->oxcf, oxcf->pass, &cpi->rc);
cm->current_video_frame = 0;
-
- cpi->gold_is_last = 0;
- cpi->alt_is_last = 0;
- cpi->gold_is_alt = 0;
-
cpi->skippable_frame = 0;
// Create the encoder segmentation map and set all entries to 0
@@ -1900,36 +1895,27 @@ static void encode_with_recode_loop(VP9_COMP *cpi,
} while (loop);
}
-static void get_ref_frame_flags(VP9_COMP *cpi) {
- if (cpi->refresh_last_frame & cpi->refresh_golden_frame)
- cpi->gold_is_last = 1;
- else if (cpi->refresh_last_frame ^ cpi->refresh_golden_frame)
- cpi->gold_is_last = 0;
-
- if (cpi->refresh_last_frame & cpi->refresh_alt_ref_frame)
- cpi->alt_is_last = 1;
- else if (cpi->refresh_last_frame ^ cpi->refresh_alt_ref_frame)
- cpi->alt_is_last = 0;
+static int get_ref_frame_flags(const VP9_COMP *cpi) {
+ const int *const map = cpi->common.ref_frame_map;
+ const int gold_is_last = map[cpi->gld_fb_idx] == map[cpi->lst_fb_idx];
+ const int alt_is_last = map[cpi->alt_fb_idx] == map[cpi->lst_fb_idx];
+ const int gold_is_alt = map[cpi->gld_fb_idx] == map[cpi->alt_fb_idx];
+ int flags = VP9_ALT_FLAG | VP9_GOLD_FLAG | VP9_LAST_FLAG;
- if (cpi->refresh_alt_ref_frame & cpi->refresh_golden_frame)
- cpi->gold_is_alt = 1;
- else if (cpi->refresh_alt_ref_frame ^ cpi->refresh_golden_frame)
- cpi->gold_is_alt = 0;
-
- cpi->ref_frame_flags = VP9_ALT_FLAG | VP9_GOLD_FLAG | VP9_LAST_FLAG;
-
- if (cpi->gold_is_last)
- cpi->ref_frame_flags &= ~VP9_GOLD_FLAG;
+ if (gold_is_last)
+ flags &= ~VP9_GOLD_FLAG;
if (cpi->rc.frames_till_gf_update_due == INT_MAX &&
!is_spatial_svc(cpi))
- cpi->ref_frame_flags &= ~VP9_GOLD_FLAG;
+ flags &= ~VP9_GOLD_FLAG;
+
+ if (alt_is_last)
+ flags &= ~VP9_ALT_FLAG;
- if (cpi->alt_is_last)
- cpi->ref_frame_flags &= ~VP9_ALT_FLAG;
+ if (gold_is_alt)
+ flags &= ~VP9_ALT_FLAG;
- if (cpi->gold_is_alt)
- cpi->ref_frame_flags &= ~VP9_ALT_FLAG;
+ return flags;
}
static void set_ext_overrides(VP9_COMP *cpi) {
@@ -2236,7 +2222,7 @@ static void encode_frame_to_data_rate(VP9_COMP *cpi,
else
cpi->frame_flags &= ~FRAMEFLAGS_ALTREF;
- get_ref_frame_flags(cpi);
+ cpi->ref_frame_flags = get_ref_frame_flags(cpi);
cm->last_frame_type = cm->frame_type;
vp9_rc_postencode_update(cpi, *size);
diff --git a/vp9/encoder/vp9_encoder.h b/vp9/encoder/vp9_encoder.h
index 7226a786d..82be0f4b6 100644
--- a/vp9/encoder/vp9_encoder.h
+++ b/vp9/encoder/vp9_encoder.h
@@ -244,10 +244,6 @@ typedef struct VP9_COMP {
YV12_BUFFER_CONFIG *unscaled_last_source;
YV12_BUFFER_CONFIG scaled_last_source;
- int gold_is_last; // gold same as last frame ( short circuit gold searches)
- int alt_is_last; // Alt same as last ( short circuit altref search)
- int gold_is_alt; // don't do both alt and gold search ( just do gold).
-
int skippable_frame;
int scaled_ref_idx[3];