From c239a1b67c9c5ff25a04ba89eca45245b1e615a2 Mon Sep 17 00:00:00 2001 From: Paul Wilkins Date: Fri, 20 Aug 2010 12:27:26 +0100 Subject: Improved Force Key Frame Behaviour These changes improve the behaviour of the code with forced key frames sent in by a calling application. The sizing of the frames is still suboptimal for two pass in particular but the behaviour is much better than it was. Change-Id: I35fae610c67688ccc69d11f385e87dfc884e65a1 --- vp8/encoder/onyx_if.c | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) (limited to 'vp8/encoder/onyx_if.c') diff --git a/vp8/encoder/onyx_if.c b/vp8/encoder/onyx_if.c index 99c434f52..fe83ae976 100644 --- a/vp8/encoder/onyx_if.c +++ b/vp8/encoder/onyx_if.c @@ -2818,23 +2818,17 @@ static int pick_frame_size(VP8_COMP *cpi) cm->frame_type = KEY_FRAME; } - // Auto key frames (Only two pass will enter here) - else if (cm->frame_type == KEY_FRAME) - { - vp8_calc_auto_iframe_target_size(cpi); - } - // Forced key frames (by interval or an external signal) - else if ((cm->frame_flags & FRAMEFLAGS_KEY) || - (cpi->oxcf.auto_key && (cpi->frames_since_key % cpi->key_frame_frequency == 0))) + // Special case for forced key frames + // The frame sizing here is still far from ideal for 2 pass. + else if (cm->frame_flags & FRAMEFLAGS_KEY) { - // Key frame from VFW/auto-keyframe/first frame cm->frame_type = KEY_FRAME; - resize_key_frame(cpi); - - // Compute target frame size - if (cpi->pass != 2) - vp8_calc_iframe_target_size(cpi); + vp8_calc_iframe_target_size(cpi); + } + else if (cm->frame_type == KEY_FRAME) + { + vp8_calc_auto_iframe_target_size(cpi); } else { -- cgit v1.2.3