summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarco Paniconi <marpan@google.com>2018-01-24 23:56:48 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2018-01-24 23:56:48 +0000
commitd069f4c29d6958944ad145faeac8e57f8de9f353 (patch)
treec64953cf1c296e3db3b17eacb88ad6f5909a2ea3
parentcee96c7d85076e8f41195fa353e46f7af29b14dc (diff)
parent43caed4e42a67344936d64b942d65b938a4341c9 (diff)
downloadlibvpx-d069f4c29d6958944ad145faeac8e57f8de9f353.tar
libvpx-d069f4c29d6958944ad145faeac8e57f8de9f353.tar.gz
libvpx-d069f4c29d6958944ad145faeac8e57f8de9f353.tar.bz2
libvpx-d069f4c29d6958944ad145faeac8e57f8de9f353.zip
Merge "vp9: Fix to vp9_svc sample encoder for bypass mode."
-rw-r--r--examples/vp9_spatial_svc_encoder.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/examples/vp9_spatial_svc_encoder.c b/examples/vp9_spatial_svc_encoder.c
index 4b6629abb..85014a0cc 100644
--- a/examples/vp9_spatial_svc_encoder.c
+++ b/examples/vp9_spatial_svc_encoder.c
@@ -574,8 +574,8 @@ void set_frame_flags_bypass_mode(int sl, int tl, int num_spatial_layers,
} else {
if (is_key_frame) {
ref_frame_config->frame_flags[sl] =
- VP8_EFLAG_NO_REF_LAST | VP8_EFLAG_NO_REF_ARF |
- VP8_EFLAG_NO_UPD_GF | VP8_EFLAG_NO_UPD_ARF;
+ VP8_EFLAG_NO_REF_GF | VP8_EFLAG_NO_REF_ARF |
+ VP8_EFLAG_NO_UPD_LAST | VP8_EFLAG_NO_UPD_ARF;
} else {
ref_frame_config->frame_flags[sl] =
VP8_EFLAG_NO_REF_ARF | VP8_EFLAG_NO_UPD_GF | VP8_EFLAG_NO_UPD_ARF;
@@ -593,10 +593,16 @@ void set_frame_flags_bypass_mode(int sl, int tl, int num_spatial_layers,
}
if (tl == 0) {
ref_frame_config->lst_fb_idx[sl] = sl;
- if (sl)
- ref_frame_config->gld_fb_idx[sl] = sl - 1;
- else
+ if (sl) {
+ if (is_key_frame) {
+ ref_frame_config->lst_fb_idx[sl] = sl - 1;
+ ref_frame_config->gld_fb_idx[sl] = sl;
+ } else {
+ ref_frame_config->gld_fb_idx[sl] = sl - 1;
+ }
+ } else {
ref_frame_config->gld_fb_idx[sl] = 0;
+ }
ref_frame_config->alt_fb_idx[sl] = 0;
} else if (tl == 1) {
ref_frame_config->lst_fb_idx[sl] = sl;
@@ -739,6 +745,8 @@ int main(int argc, const char **argv) {
// the encode for the whole superframe. The encoder will internally loop
// over all the spatial layers for the current superframe.
vpx_codec_control(&codec, VP9E_SET_SVC_LAYER_ID, &layer_id);
+ // TODO(jianj): Fix the parameter passing for "is_key_frame" in
+ // set_frame_flags_bypass_model() for case of periodic key frames.
set_frame_flags_bypass_mode(sl, layer_id.temporal_layer_id,
svc_ctx.spatial_layers, frame_cnt == 0,
&ref_frame_config);