summaryrefslogtreecommitdiff
path: root/vp9/encoder
diff options
context:
space:
mode:
authorMinghai Shang <minghai@google.com>2015-01-13 15:39:04 -0800
committerMinghai Shang <minghai@google.com>2015-01-13 15:44:22 -0800
commita14415d171d83e8427b9fd457e64d8d27c05c462 (patch)
tree049583cb227cb4aee3bca10ac0e39020077bf786 /vp9/encoder
parent6f6fbf9175a7969574c7c4b1b855cc6df6641f20 (diff)
downloadlibvpx-a14415d171d83e8427b9fd457e64d8d27c05c462.tar
libvpx-a14415d171d83e8427b9fd457e64d8d27c05c462.tar.gz
libvpx-a14415d171d83e8427b9fd457e64d8d27c05c462.tar.bz2
libvpx-a14415d171d83e8427b9fd457e64d8d27c05c462.zip
[twopass temporal svc] Fix decoding error on seek.
Don't put small empty frame in front of a key frame. We will put key frame flag in webm container if there's a visible key frame. But there will be decoding error when we seek to here if we put the small empty frame, which will be inter frame, in front of it. Change-Id: Id50c2c1fd31da0405ff6faa7375cc2f49c55402d
Diffstat (limited to 'vp9/encoder')
-rw-r--r--vp9/encoder/vp9_svc_layercontext.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/vp9/encoder/vp9_svc_layercontext.c b/vp9/encoder/vp9_svc_layercontext.c
index 31e93be65..ef6174ec6 100644
--- a/vp9/encoder/vp9_svc_layercontext.c
+++ b/vp9/encoder/vp9_svc_layercontext.c
@@ -279,6 +279,7 @@ static void get_layer_resolution(const int width_org, const int height_org,
int vp9_svc_start_frame(VP9_COMP *const cpi) {
int width = 0, height = 0;
LAYER_CONTEXT *lc;
+ struct lookahead_entry *buf;
int count = 1 << (cpi->svc.number_temporal_layers - 1);
cpi->svc.spatial_layer_id = cpi->svc.spatial_layer_to_encode;
@@ -339,8 +340,11 @@ int vp9_svc_start_frame(VP9_COMP *const cpi) {
// since its previous frame could be changed during decoding time. The idea is
// we put a empty invisible frame in front of them, then we will not use
// prev_mi when encoding these frames.
+
+ buf = vp9_lookahead_peek(cpi->lookahead, 0);
if (cpi->oxcf.error_resilient_mode == 0 && cpi->oxcf.pass == 2 &&
- cpi->svc.encode_empty_frame_state == NEED_TO_ENCODE) {
+ cpi->svc.encode_empty_frame_state == NEED_TO_ENCODE &&
+ lc->rc.frames_to_key != 0 && !(buf->flags & VPX_EFLAG_FORCE_KF)) {
if ((cpi->svc.number_temporal_layers > 1 &&
cpi->svc.temporal_layer_id < cpi->svc.number_temporal_layers - 1) ||
(cpi->svc.number_spatial_layers > 1 &&