summaryrefslogtreecommitdiff
path: root/vp8/encoder/onyx_if.c
diff options
context:
space:
mode:
authorJohn Koleszar <jkoleszar@google.com>2011-02-04 05:16:15 -0800
committerCode Review <code-review@webmproject.org>2011-02-04 05:16:15 -0800
commitc0a9cbebe175ad7d0f47dc86b3826d31de4da823 (patch)
treede61c92fdd9dd7d8c7f652a62d4ad93b96c59774 /vp8/encoder/onyx_if.c
parentbf5f585b0d81d574ac6df53b387611760078aaa2 (diff)
parente5904f2d5ec70ea5497aaab494b8bcee5dbea47f (diff)
downloadlibvpx-c0a9cbebe175ad7d0f47dc86b3826d31de4da823.tar
libvpx-c0a9cbebe175ad7d0f47dc86b3826d31de4da823.tar.gz
libvpx-c0a9cbebe175ad7d0f47dc86b3826d31de4da823.tar.bz2
libvpx-c0a9cbebe175ad7d0f47dc86b3826d31de4da823.zip
Merge "Delay auto key frame insertion in realtime configuration"
Diffstat (limited to 'vp8/encoder/onyx_if.c')
-rw-r--r--vp8/encoder/onyx_if.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/vp8/encoder/onyx_if.c b/vp8/encoder/onyx_if.c
index 6a3f7f6ff..df1a6f57e 100644
--- a/vp8/encoder/onyx_if.c
+++ b/vp8/encoder/onyx_if.c
@@ -3614,6 +3614,17 @@ static void encode_frame_to_data_rate
// Test code for segmentation of gf/arf (0,0)
//segmentation_test_function((VP8_PTR) cpi);
+#if CONFIG_REALTIME_ONLY
+ if(cpi->oxcf.auto_key && cm->frame_type != KEY_FRAME)
+ {
+ if(cpi->force_next_frame_intra)
+ {
+ cm->frame_type = KEY_FRAME; /* delayed intra frame */
+ }
+ }
+ cpi->force_next_frame_intra = 0;
+#endif
+
// For an alt ref frame in 2 pass we skip the call to the second pass function that sets the target bandwidth
#if !(CONFIG_REALTIME_ONLY)
@@ -4124,6 +4135,14 @@ static void encode_frame_to_data_rate
// (assuming that we didn't)!
if (cpi->pass != 2 && cpi->oxcf.auto_key && cm->frame_type != KEY_FRAME)
{
+
+#if CONFIG_REALTIME_ONLY
+ {
+ /* we don't do re-encoding in realtime mode
+ * if key frame is decided than we force it on next frame */
+ cpi->force_next_frame_intra = decide_key_frame(cpi);
+ }
+#else
if (decide_key_frame(cpi))
{
vp8_calc_auto_iframe_target_size(cpi);
@@ -4162,6 +4181,7 @@ static void encode_frame_to_data_rate
resize_key_frame(cpi);
continue;
}
+#endif
}
vp8_clear_system_state();