diff --git a/src/modules/video_coding/codecs/vp8/main/interface/vp8.h b/src/modules/video_coding/codecs/vp8/main/interface/vp8.h index c274e4c69..89cf06750 100644 --- a/src/modules/video_coding/codecs/vp8/main/interface/vp8.h +++ b/src/modules/video_coding/codecs/vp8/main/interface/vp8.h @@ -229,6 +229,7 @@ class VP8Decoder : public VideoDecoder { vpx_ref_frame_t* ref_frame_; int propagation_cnt_; bool latest_keyframe_complete_; + bool mfqe_enabled_; }; // end of VP8Decoder class } // namespace webrtc diff --git a/src/modules/video_coding/codecs/vp8/main/source/vp8.cc b/src/modules/video_coding/codecs/vp8/main/source/vp8.cc index 9a0141762..a477237b1 100644 --- a/src/modules/video_coding/codecs/vp8/main/source/vp8.cc +++ b/src/modules/video_coding/codecs/vp8/main/source/vp8.cc @@ -535,7 +535,8 @@ VP8Decoder::VP8Decoder() image_format_(VPX_IMG_FMT_NONE), ref_frame_(NULL), propagation_cnt_(-1), - latest_keyframe_complete_(false) { + latest_keyframe_complete_(false), + mfqe_enabled_(false) { } VP8Decoder::~VP8Decoder() { @@ -550,6 +551,7 @@ int VP8Decoder::Reset() { InitDecode(&codec_, 1); propagation_cnt_ = -1; latest_keyframe_complete_ = false; + mfqe_enabled_ = false; return WEBRTC_VIDEO_CODEC_OK; } @@ -623,6 +625,19 @@ int VP8Decoder::Decode(const EncodedImage& input_image, } #endif +#if WEBRTC_LIBVPX_VERSION >= 971 + if (!mfqe_enabled_ && codec_specific_info && + codec_specific_info->codecSpecific.VP8.temporalIdx > 0) { + // Enable MFQE if we are receiving layers. + // temporalIdx is set in the jitter buffer according to what the RTP + // header says. + mfqe_enabled_ = true; + vp8_postproc_cfg_t ppcfg; + ppcfg.post_proc_flag = VP8_MFQE; + vpx_codec_control(decoder_, VP8_SET_POSTPROC, &ppcfg); + } +#endif + // Restrict error propagation using key frame requests. Disabled when // the feedback mode is enabled (RPS). // Reset on a key frame refresh.