From 103876f3796f4a7aeedc49dddb923cb1c4bee285 Mon Sep 17 00:00:00 2001 From: Jerome Jiang Date: Mon, 25 Jan 2021 16:42:51 -0800 Subject: [PATCH] av1: turn off a few tools that are not used for rtc Explicitly turn off obmc, warped motion, global motion and ref frame mv. Bug: chromium:1095763, chromium:1170346 Change-Id: I19bc4fceef4cd5e35ea6699e6af883af244f8954 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/203900 Reviewed-by: Marco Paniconi Reviewed-by: Marco Paniconi Commit-Queue: Jerome Jiang Cr-Commit-Position: refs/heads/master@{#33075} --- .../codecs/av1/libaom_av1_encoder.cc | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/modules/video_coding/codecs/av1/libaom_av1_encoder.cc b/modules/video_coding/codecs/av1/libaom_av1_encoder.cc index ab6ac7c929..2d24450b8a 100644 --- a/modules/video_coding/codecs/av1/libaom_av1_encoder.cc +++ b/modules/video_coding/codecs/av1/libaom_av1_encoder.cc @@ -316,6 +316,34 @@ int LibaomAv1Encoder::InitEncode(const VideoCodec* codec_settings, return WEBRTC_VIDEO_CODEC_ERROR; } + ret = aom_codec_control(&ctx_, AV1E_SET_ENABLE_OBMC, 0); + if (ret != AOM_CODEC_OK) { + RTC_LOG(LS_WARNING) << "LibaomAv1Encoder::EncodeInit returned " << ret + << " on control AV1E_SET_ENABLE_OBMC."; + return WEBRTC_VIDEO_CODEC_ERROR; + } + + ret = aom_codec_control(&ctx_, AV1E_SET_ENABLE_WARPED_MOTION, 0); + if (ret != AOM_CODEC_OK) { + RTC_LOG(LS_WARNING) << "LibaomAv1Encoder::EncodeInit returned " << ret + << " on control AV1E_SET_ENABLE_WARPED_MOTION."; + return WEBRTC_VIDEO_CODEC_ERROR; + } + + ret = aom_codec_control(&ctx_, AV1E_SET_ENABLE_GLOBAL_MOTION, 0); + if (ret != AOM_CODEC_OK) { + RTC_LOG(LS_WARNING) << "LibaomAv1Encoder::EncodeInit returned " << ret + << " on control AV1E_SET_ENABLE_GLOBAL_MOTION."; + return WEBRTC_VIDEO_CODEC_ERROR; + } + + ret = aom_codec_control(&ctx_, AV1E_SET_ENABLE_REF_FRAME_MVS, 0); + if (ret != AOM_CODEC_OK) { + RTC_LOG(LS_WARNING) << "LibaomAv1Encoder::EncodeInit returned " << ret + << " on control AV1E_SET_ENABLE_REF_FRAME_MVS."; + return WEBRTC_VIDEO_CODEC_ERROR; + } + return WEBRTC_VIDEO_CODEC_OK; }