diff options
author | Adrian Grange <agrange@google.com> | 2014-06-09 15:22:17 -0700 |
---|---|---|
committer | Adrian Grange <agrange@google.com> | 2014-07-08 16:24:03 -0700 |
commit | 7c43fb67ae5f8cd3ca39756281f63cc9e29bdb55 (patch) | |
tree | 79b0beab6a3f80f85075d5ec47e6e7faeba71369 /vp9/decoder/vp9_decoder.c | |
parent | c0061cc24f254d648737986ce14ac1a4bcb45874 (diff) | |
download | libvpx-7c43fb67ae5f8cd3ca39756281f63cc9e29bdb55.tar libvpx-7c43fb67ae5f8cd3ca39756281f63cc9e29bdb55.tar.gz libvpx-7c43fb67ae5f8cd3ca39756281f63cc9e29bdb55.tar.bz2 libvpx-7c43fb67ae5f8cd3ca39756281f63cc9e29bdb55.zip |
Fix decoder handling of intra-only frames
This patch fixes bug 633:
https://code.google.com/p/webm/issues/detail?id=633
The first decoded frame does not have to be a keyframe,
it could be an inter-frame that is coded intra-only.
This patch fixes the handling of intra-only frames.
A test vector has also been added that encodes 3
intra-only frames at the start of the clip. The
test vector was generated using the code in the
following patch:
https://gerrit.chromium.org/gerrit/#/c/70680/
Change-Id: Ib40b1dbf91aae2bc047e23c626eaef09d1860147
Diffstat (limited to 'vp9/decoder/vp9_decoder.c')
-rw-r--r-- | vp9/decoder/vp9_decoder.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/vp9/decoder/vp9_decoder.c b/vp9/decoder/vp9_decoder.c index d154e9d81..6f1f21fc8 100644 --- a/vp9/decoder/vp9_decoder.c +++ b/vp9/decoder/vp9_decoder.c @@ -267,7 +267,10 @@ int vp9_receive_compressed_data(VP9Decoder *pbi, vp9_decode_frame(pbi, source, source + size, psource); - swap_frame_buffers(pbi); + if (!cm->show_existing_frame) + swap_frame_buffers(pbi); + else + cm->frame_to_show = get_frame_new_buffer(cm); vp9_clear_system_state(); @@ -291,6 +294,7 @@ int vp9_receive_compressed_data(VP9Decoder *pbi, int vp9_get_raw_frame(VP9Decoder *pbi, YV12_BUFFER_CONFIG *sd, vp9_ppflags_t *flags) { + VP9_COMMON *const cm = &pbi->common; int ret = -1; #if !CONFIG_VP9_POSTPROC (void)*flags; @@ -300,15 +304,20 @@ int vp9_get_raw_frame(VP9Decoder *pbi, YV12_BUFFER_CONFIG *sd, return ret; /* no raw frame to show!!! */ - if (pbi->common.show_frame == 0) + if (!cm->show_frame) return ret; pbi->ready_for_new_data = 1; #if CONFIG_VP9_POSTPROC - ret = vp9_post_proc_frame(&pbi->common, sd, flags); + if (!cm->show_existing_frame) { + ret = vp9_post_proc_frame(cm, sd, flags); + } else { + *sd = *cm->frame_to_show; + ret = 0; + } #else - *sd = *pbi->common.frame_to_show; + *sd = *cm->frame_to_show; ret = 0; #endif /*!CONFIG_POSTPROC*/ vp9_clear_system_state(); |