From fc31a43e3652df4c8e03bfff89858c4858d79b89 Mon Sep 17 00:00:00 2001 From: brandtr Date: Tue, 2 May 2017 02:21:17 -0700 Subject: [PATCH] Delete dead code VP8EncoderImpl::UpdateCodecFrameSize. BUG=webrtc:7349 Review-Url: https://codereview.webrtc.org/2855473006 Cr-Commit-Position: refs/heads/master@{#17969} --- .../video_coding/codecs/vp8/vp8_impl.cc | 32 +------------------ .../video_coding/codecs/vp8/vp8_impl.h | 3 -- 2 files changed, 1 insertion(+), 34 deletions(-) diff --git a/webrtc/modules/video_coding/codecs/vp8/vp8_impl.cc b/webrtc/modules/video_coding/codecs/vp8/vp8_impl.cc index a3495ee53a..4e30986e82 100644 --- a/webrtc/modules/video_coding/codecs/vp8/vp8_impl.cc +++ b/webrtc/modules/video_coding/codecs/vp8/vp8_impl.cc @@ -648,9 +648,7 @@ int VP8EncoderImpl::Encode(const VideoFrame& frame, rtc::scoped_refptr input_image = frame.video_frame_buffer(); // Since we are extracting raw pointers from |input_image| to - // |raw_images_[0]|, the resolution of these frames must match. Note that - // |input_image| might be scaled from |frame|. In that case, the resolution of - // |raw_images_[0]| should have been updated in UpdateCodecFrameSize. + // |raw_images_[0]|, the resolution of these frames must match. RTC_DCHECK_EQ(input_image->width(), raw_images_[0].d_w); RTC_DCHECK_EQ(input_image->height(), raw_images_[0].d_h); @@ -769,34 +767,6 @@ int VP8EncoderImpl::Encode(const VideoFrame& frame, return GetEncodedPartitions(frame); } -// TODO(pbos): Make sure this works for properly for >1 encoders. -int VP8EncoderImpl::UpdateCodecFrameSize(int width, int height) { - codec_.width = width; - codec_.height = height; - if (codec_.numberOfSimulcastStreams <= 1) { - // For now scaling is only used for single-layer streams. - codec_.simulcastStream[0].width = width; - codec_.simulcastStream[0].height = height; - } - // Update the cpu_speed setting for resolution change. - vpx_codec_control(&(encoders_[0]), VP8E_SET_CPUUSED, - SetCpuSpeed(codec_.width, codec_.height)); - raw_images_[0].w = codec_.width; - raw_images_[0].h = codec_.height; - raw_images_[0].d_w = codec_.width; - raw_images_[0].d_h = codec_.height; - vpx_img_set_rect(&raw_images_[0], 0, 0, codec_.width, codec_.height); - - // Update encoder context for new frame size. - // Change of frame size will automatically trigger a key frame. - configurations_[0].g_w = codec_.width; - configurations_[0].g_h = codec_.height; - if (vpx_codec_enc_config_set(&encoders_[0], &configurations_[0])) { - return WEBRTC_VIDEO_CODEC_ERROR; - } - return WEBRTC_VIDEO_CODEC_OK; -} - void VP8EncoderImpl::PopulateCodecSpecific( CodecSpecificInfo* codec_specific, const vpx_codec_cx_pkt_t& pkt, diff --git a/webrtc/modules/video_coding/codecs/vp8/vp8_impl.h b/webrtc/modules/video_coding/codecs/vp8/vp8_impl.h index 858cf57b15..c333436026 100644 --- a/webrtc/modules/video_coding/codecs/vp8/vp8_impl.h +++ b/webrtc/modules/video_coding/codecs/vp8/vp8_impl.h @@ -75,9 +75,6 @@ class VP8EncoderImpl : public VP8Encoder { // Call encoder initialize function and set control settings. int InitAndSetControlSettings(); - // Update frame size for codec. - int UpdateCodecFrameSize(int width, int height); - void PopulateCodecSpecific(CodecSpecificInfo* codec_specific, const vpx_codec_cx_pkt& pkt, int stream_idx,