diff --git a/src/common_types.h b/src/common_types.h index 681a1d29f..ff84e6f6c 100644 --- a/src/common_types.h +++ b/src/common_types.h @@ -515,6 +515,7 @@ struct VideoCodecVP8 unsigned char numberOfTemporalLayers; bool denoisingOn; bool errorConcealmentOn; + bool automaticResizeOn; }; // Unknown specific diff --git a/src/modules/video_coding/codecs/vp8/vp8.cc b/src/modules/video_coding/codecs/vp8/vp8.cc index 7d8a4a0dd..eecf90931 100644 --- a/src/modules/video_coding/codecs/vp8/vp8.cc +++ b/src/modules/video_coding/codecs/vp8/vp8.cc @@ -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; diff --git a/src/modules/video_coding/main/source/codec_database.cc b/src/modules/video_coding/main/source/codec_database.cc index e4105931c..f46c8c45d 100644 --- a/src/modules/video_coding/main/source/codec_database.cc +++ b/src/modules/video_coding/main/source/codec_database.cc @@ -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 diff --git a/src/video_engine/test/auto_test/source/vie_autotest_codec.cc b/src/video_engine/test/auto_test/source/vie_autotest_codec.cc index 302944437..d4a1870dc 100644 --- a/src/video_engine/test/auto_test/source/vie_autotest_codec.cc +++ b/src/video_engine/test/auto_test/source/vie_autotest_codec.cc @@ -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));