From 64e259746509e3869ec36d36de4aeb3ac866e2e6 Mon Sep 17 00:00:00 2001 From: Adrian Grange Date: Thu, 23 Jan 2014 09:26:19 -0800 Subject: [PATCH] Disable update of last_show_frame for existing frame When showing a previously decoded frame, i.e. when show_existing_frame=1, the update of the last_show_frame flag must be disabled. This is to ensure that the last_show_frame flag reflects the state of the flag for the immediately previously decoded frame rather then the value that was forced to ensure that a previously decoded frame would be displayed. This patch also adds a test vector to verify that the display_existing_frame flag works as expected. Code for generating the test vector can be found in this patch: https://gerrit.chromium.org/gerrit/#/c/68581/ (Bug originally reported by Alexander Voronov ). Change-Id: I731d288fba02088959f7fcc87707137fffc6acf5 --- test/test-data.sha1 | 2 ++ test/test.mk | 2 ++ test/test_vectors.cc | 1 + test/test_vectors.h | 4 ++-- vp9/decoder/vp9_onyxd_if.c | 3 ++- vp9/encoder/vp9_onyx_if.c | 3 ++- 6 files changed, 11 insertions(+), 4 deletions(-) diff --git a/test/test-data.sha1 b/test/test-data.sha1 index 6daf69e..a287731 100644 --- a/test/test-data.sha1 +++ b/test/test-data.sha1 @@ -574,3 +574,5 @@ d48c5db1b0f8e60521a7c749696b8067886033a3 vp90-2-09-aq2.webm 84c1599298aac78f2fc05ae2274575d10569dfa0 vp90-2-09-aq2.webm.md5 55fc55ed73d578ed60fad05692579873f8bad758 vp90-2-09-lf_deltas.webm 54638c38009198c38c8f3b25c182b709b6c1fd2e vp90-2-09-lf_deltas.webm.md5 +510d95f3beb3b51c572611fdaeeece12277dac30 vp90-2-10-show-existing-frame.webm +14d631096f4bfa2d71f7f739aec1448fb3c33bad vp90-2-10-show-existing-frame.webm.md5 diff --git a/test/test.mk b/test/test.mk index cb62615..a65decf 100644 --- a/test/test.mk +++ b/test/test.mk @@ -676,6 +676,8 @@ LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-09-lf_deltas.webm LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-09-lf_deltas.webm.md5 LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp91-2-04-yv444.webm LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp91-2-04-yv444.webm.md5 +LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-10-show-existing-frame.webm +LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-10-show-existing-frame.webm.md5 ifeq ($(CONFIG_DECODE_PERF_TESTS),yes) # BBB VP9 streams diff --git a/test/test_vectors.cc b/test/test_vectors.cc index 16298d0..3227f52 100644 --- a/test/test_vectors.cc +++ b/test/test_vectors.cc @@ -160,6 +160,7 @@ const char *kVP9TestVectors[kNumVp9TestVectors] = { "vp90-2-02-size-lf-1920x1080.webm", "vp90-2-09-aq2.webm", "vp90-2-09-lf_deltas.webm", + "vp90-2-10-show-existing-frame.webm", #if CONFIG_NON420 "vp91-2-04-yv444.webm" #endif diff --git a/test/test_vectors.h b/test/test_vectors.h index 5f62e99..eb592de 100644 --- a/test/test_vectors.h +++ b/test/test_vectors.h @@ -22,9 +22,9 @@ extern const char *kVP8TestVectors[kNumVp8TestVectors]; #if CONFIG_VP9_DECODER #if CONFIG_NON420 -const int kNumVp9TestVectors = 216; +const int kNumVp9TestVectors = 217; #else -const int kNumVp9TestVectors = 215; +const int kNumVp9TestVectors = 216; #endif extern const char *kVP9TestVectors[kNumVp9TestVectors]; diff --git a/vp9/decoder/vp9_onyxd_if.c b/vp9/decoder/vp9_onyxd_if.c index 75d52c2..c6e9205 100644 --- a/vp9/decoder/vp9_onyxd_if.c +++ b/vp9/decoder/vp9_onyxd_if.c @@ -390,7 +390,8 @@ int vp9_receive_compressed_data(VP9D_PTR ptr, vp9_clear_system_state(); - cm->last_show_frame = cm->show_frame; + if (!cm->show_existing_frame) + cm->last_show_frame = cm->show_frame; if (cm->show_frame) { if (!cm->show_existing_frame) { // current mip will be the prev_mip for the next frame diff --git a/vp9/encoder/vp9_onyx_if.c b/vp9/encoder/vp9_onyx_if.c index b3f8c7e..2d20f7e 100644 --- a/vp9/encoder/vp9_onyx_if.c +++ b/vp9/encoder/vp9_onyx_if.c @@ -3250,7 +3250,8 @@ static void encode_frame_to_data_rate(VP9_COMP *cpi, cm->last_height = cm->height; // reset to normal state now that we are done. - cm->last_show_frame = cm->show_frame; + if (!cm->show_existing_frame) + cm->last_show_frame = cm->show_frame; if (cm->show_frame) { // current mip will be the prev_mip for the next frame MODE_INFO *temp = cm->prev_mip; -- 2.7.4