Makes it possible to disable automatic resizing.

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

git-svn-id: http://webrtc.googlecode.com/svn/trunk@2589 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
henrike@webrtc.org 2012-08-10 02:44:30 +00:00
parent 340f0cd5b7
commit 3c286747ce
4 changed files with 8 additions and 1 deletions

View File

@ -515,6 +515,7 @@ struct VideoCodecVP8
unsigned char numberOfTemporalLayers;
bool denoisingOn;
bool errorConcealmentOn;
bool automaticResizeOn;
};
// Unknown specific

View File

@ -236,7 +236,8 @@ int VP8Encoder::InitEncode(const VideoCodec* inst,
config_->rc_dropframe_thresh = 30;
config_->rc_end_usage = VPX_CBR;
config_->g_pass = VPX_RC_ONE_PASS;
config_->rc_resize_allowed = 0;
config_->rc_resize_allowed = inst->codecSpecific.VP8.automaticResizeOn ?
1 : 0;
config_->rc_min_quantizer = 8;
config_->rc_max_quantizer = 56;
config_->rc_undershoot_pct = 100;

View File

@ -175,6 +175,7 @@ VCMCodecDataBase::Codec(WebRtc_UWord8 listId, VideoCodec *settings)
settings->codecSpecific.VP8.numberOfTemporalLayers = 1;
settings->codecSpecific.VP8.denoisingOn = true;
settings->codecSpecific.VP8.errorConcealmentOn = false;
settings->codecSpecific.VP8.automaticResizeOn = true;
break;
}
#endif

View File

@ -455,6 +455,7 @@ void ViEAutoTest::ViECodecAPITest() {
for (int i = 0; i < number_of_codecs; i++) {
EXPECT_EQ(0, codec->GetCodec(i, video_codec));
if (video_codec.codecType == webrtc::kVideoCodecVP8) {
video_codec.codecSpecific.VP8.automaticResizeOn = true;
EXPECT_EQ(0, codec->SetSendCodec(video_channel, video_codec));
break;
}
@ -462,10 +463,12 @@ void ViEAutoTest::ViECodecAPITest() {
memset(&video_codec, 0, sizeof(video_codec));
EXPECT_EQ(0, codec->GetSendCodec(video_channel, video_codec));
EXPECT_EQ(webrtc::kVideoCodecVP8, video_codec.codecType);
EXPECT_TRUE(video_codec.codecSpecific.VP8.automaticResizeOn);
for (int i = 0; i < number_of_codecs; i++) {
EXPECT_EQ(0, codec->GetCodec(i, video_codec));
if (video_codec.codecType == webrtc::kVideoCodecI420) {
video_codec.codecSpecific.VP8.automaticResizeOn = false;
EXPECT_EQ(0, codec->SetSendCodec(video_channel, video_codec));
break;
}
@ -473,6 +476,7 @@ void ViEAutoTest::ViECodecAPITest() {
memset(&video_codec, 0, sizeof(video_codec));
EXPECT_EQ(0, codec->GetSendCodec(video_channel, video_codec));
EXPECT_EQ(webrtc::kVideoCodecI420, video_codec.codecType);
EXPECT_FALSE(video_codec.codecSpecific.VP8.automaticResizeOn);
EXPECT_EQ(0, base->DeleteChannel(video_channel));