summaryrefslogtreecommitdiff
path: root/vp9/encoder/vp9_encoder.h
diff options
context:
space:
mode:
authorMinghai Shang <minghai@google.com>2014-07-14 11:24:17 -0700
committerMinghai Shang <minghai@google.com>2014-07-14 11:24:17 -0700
commite899859c48adf4f093fbd4fec74051ac9e108248 (patch)
tree4fe634205c3674d6acac9d0922ca5f53f2d98486 /vp9/encoder/vp9_encoder.h
parent6ce515b9ff9000740bc47bb2dfa1b80df6ec2fc9 (diff)
downloadlibvpx-e899859c48adf4f093fbd4fec74051ac9e108248.tar
libvpx-e899859c48adf4f093fbd4fec74051ac9e108248.tar.gz
libvpx-e899859c48adf4f093fbd4fec74051ac9e108248.tar.bz2
libvpx-e899859c48adf4f093fbd4fec74051ac9e108248.zip
[spatial svc]Implement alt reference frames
All changes are for spatial svc only. 1. Enable encoding hidden frames in each layer and use alt reference idex to reference the hidden frame in each layer 2. Use golden reference idx for spatial reference 3. For those layers that don't have hidden frames (caused by lack of frame buffers), reference a hidden frame in lower layers 4. Add "auto-alt-refs" in svc options Change-Id: Idf27d1fd2fb5f3ffd9e86d2119235e3dad36c178
Diffstat (limited to 'vp9/encoder/vp9_encoder.h')
-rw-r--r--vp9/encoder/vp9_encoder.h12
1 files changed, 8 insertions, 4 deletions
diff --git a/vp9/encoder/vp9_encoder.h b/vp9/encoder/vp9_encoder.h
index 9f8b37f2d..35a3358ee 100644
--- a/vp9/encoder/vp9_encoder.h
+++ b/vp9/encoder/vp9_encoder.h
@@ -195,6 +195,7 @@ typedef struct VP9EncoderConfig {
int ts_number_layers; // Number of temporal layers.
// Bitrate allocation for spatial layers.
int ss_target_bitrate[VPX_SS_MAX_LAYERS];
+ int ss_play_alternate[VPX_SS_MAX_LAYERS];
// Bitrate allocation (CBR mode) and framerate factor, for temporal layers.
int ts_target_bitrate[VPX_TS_MAX_LAYERS];
int ts_rate_decimator[VPX_TS_MAX_LAYERS];
@@ -229,10 +230,6 @@ typedef struct VP9EncoderConfig {
vp8e_tuning tuning;
} VP9EncoderConfig;
-static INLINE int is_altref_enabled(const VP9EncoderConfig *cfg) {
- return cfg->mode != REALTIME && cfg->play_alternate && cfg->lag_in_frames > 0;
-}
-
static INLINE int is_lossless_requested(const VP9EncoderConfig *cfg) {
return cfg->best_allowed_q == 0 && cfg->worst_allowed_q == 0;
}
@@ -535,6 +532,13 @@ YV12_BUFFER_CONFIG *vp9_scale_if_required(VP9_COMMON *cm,
void vp9_apply_encoding_flags(VP9_COMP *cpi, vpx_enc_frame_flags_t flags);
+static INLINE int is_altref_enabled(const VP9_COMP *const cpi) {
+ return cpi->oxcf.mode != REALTIME && cpi->oxcf.lag_in_frames > 0 &&
+ (cpi->oxcf.play_alternate &&
+ (!(cpi->use_svc && cpi->svc.number_temporal_layers == 1) ||
+ cpi->oxcf.ss_play_alternate[cpi->svc.spatial_layer_id]));
+}
+
static INLINE void set_ref_ptrs(VP9_COMMON *cm, MACROBLOCKD *xd,
MV_REFERENCE_FRAME ref0,
MV_REFERENCE_FRAME ref1) {