VP8: Making key frame interval a tunnable parameter

Review URL: https://webrtc-codereview.appspot.com/1070006

git-svn-id: http://webrtc.googlecode.com/svn/trunk@3444 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
mikhal@webrtc.org
2013-01-31 16:37:13 +00:00
parent 6e3968f62a
commit e07c661a29
6 changed files with 43 additions and 35 deletions

View File

@@ -8,22 +8,22 @@
* be found in the AUTHORS file in the root of the source tree.
*/
#include "gtest/gtest.h"
#include <math.h>
#include "modules/video_coding/codecs/interface/video_codec_interface.h"
#include "modules/video_coding/codecs/test/packet_manipulator.h"
#include "modules/video_coding/codecs/test/videoprocessor.h"
#include "modules/video_coding/codecs/vp8/include/vp8.h"
#include "modules/video_coding/codecs/vp8/include/vp8_common_types.h"
#include "modules/video_coding/main/interface/video_coding.h"
#include "testsupport/fileutils.h"
#include "testsupport/frame_reader.h"
#include "testsupport/frame_writer.h"
#include "testsupport/metrics/video_metrics.h"
#include "testsupport/packet_reader.h"
#include "typedefs.h"
#include "gtest/gtest.h"
#include "webrtc/modules/video_coding/codecs/interface/video_codec_interface.h"
#include "webrtc/modules/video_coding/codecs/test/packet_manipulator.h"
#include "webrtc/modules/video_coding/codecs/test/videoprocessor.h"
#include "webrtc/modules/video_coding/codecs/vp8/include/vp8.h"
#include "webrtc/modules/video_coding/codecs/vp8/include/vp8_common_types.h"
#include "webrtc/modules/video_coding/main/interface/video_coding.h"
#include "webrtc/test/testsupport/fileutils.h"
#include "webrtc/test/testsupport/frame_reader.h"
#include "webrtc/test/testsupport/frame_writer.h"
#include "webrtc/test/testsupport/metrics/video_metrics.h"
#include "webrtc/test/testsupport/packet_reader.h"
#include "webrtc/typedefs.h"
namespace webrtc {
@@ -32,6 +32,7 @@ namespace webrtc {
const int kMaxNumRateUpdates = 3;
const int kPercTargetvsActualMismatch = 20;
const int kBaseKeyFrameInterval = 3000;
// Codec and network settings.
struct CodecConfigPars {
@@ -182,6 +183,8 @@ class VideoProcessorIntegrationTest: public testing::Test {
frame_dropper_on_;
config_.codec_settings->codecSpecific.VP8.automaticResizeOn =
spatial_resize_on_;
config_.codec_settings->codecSpecific.VP8.keyFrameInterval =
kBaseKeyFrameInterval;
frame_reader_ =
new webrtc::test::FrameReaderImpl(config_.input_filename,

View File

@@ -11,23 +11,24 @@
*
*/
#include "modules/video_coding/codecs/vp8/vp8_impl.h"
#include "webrtc/modules/video_coding/codecs/vp8/vp8_impl.h"
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <vector>
#include "vpx/vpx_encoder.h"
#include "vpx/vpx_decoder.h"
#include "vpx/vp8cx.h"
#include "vpx/vp8dx.h"
#include "common_video/libyuv/include/webrtc_libyuv.h"
#include "module_common_types.h"
#include "modules/video_coding/codecs/vp8/reference_picture_selection.h"
#include "modules/video_coding/codecs/vp8/temporal_layers.h"
#include "system_wrappers/interface/tick_util.h"
#include "system_wrappers/interface/trace_event.h"
#include "webrtc/common_video/libyuv/include/webrtc_libyuv.h"
#include "webrtc/modules/interface/module_common_types.h"
#include "webrtc/modules/video_coding/codecs/vp8/reference_picture_selection.h"
#include "webrtc/modules/video_coding/codecs/vp8/temporal_layers.h"
#include "webrtc/system_wrappers/interface/tick_util.h"
#include "webrtc/system_wrappers/interface/trace_event.h"
enum { kVp8ErrorPropagationTh = 30 };
@@ -251,9 +252,11 @@ int VP8EncoderImpl::InitEncode(const VideoCodec* inst,
// Disable periodic key frames if we get feedback from the decoder
// through SLI and RPSI.
config_->kf_mode = VPX_KF_DISABLED;
} else {
} else if (inst->codecSpecific.VP8.keyFrameInterval > 0) {
config_->kf_mode = VPX_KF_AUTO;
config_->kf_max_dist = 3000;
config_->kf_max_dist = inst->codecSpecific.VP8.keyFrameInterval;
} else {
config_->kf_mode = VPX_KF_DISABLED;
}
switch (inst->codecSpecific.VP8.complexity) {
case kComplexityHigh:

View File

@@ -8,19 +8,19 @@
* be found in the AUTHORS file in the root of the source tree.
*/
#include "modules/video_coding/main/source/codec_database.h"
#include "webrtc/modules/video_coding/main/source/codec_database.h"
#include <assert.h>
#include "engine_configurations.h"
#include "webrtc/engine_configurations.h"
#ifdef VIDEOCODEC_I420
#include "modules/video_coding/codecs/i420/main/interface/i420.h"
#include "webrtc/modules/video_coding/codecs/i420/main/interface/i420.h"
#endif
#ifdef VIDEOCODEC_VP8
#include "modules/video_coding/codecs/vp8/include/vp8.h"
#include "webrtc/modules/video_coding/codecs/vp8/include/vp8.h"
#endif
#include "modules/video_coding/main/source/internal_defines.h"
#include "system_wrappers/interface/trace.h"
#include "webrtc/modules/video_coding/main/source/internal_defines.h"
#include "webrtc/system_wrappers/interface/trace.h"
namespace webrtc {
@@ -98,6 +98,7 @@ bool VCMCodecDataBase::Codec(int list_id,
settings->codecSpecific.VP8.errorConcealmentOn = false;
settings->codecSpecific.VP8.automaticResizeOn = false;
settings->codecSpecific.VP8.frameDroppingOn = true;
settings->codecSpecific.VP8.keyFrameInterval = 3000;
return true;
}
#endif