av1: add a few controls to wrapper

this will speed up realtime encoding.

Change-Id: I39d42f3c195d2f520f04f7357e72b0903905ea81
Bug: None
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/176383
Reviewed-by: Marco Paniconi <marpan@webrtc.org>
Commit-Queue: Jerome Jiang <jianj@google.com>
Cr-Commit-Position: refs/heads/master@{#31431}
This commit is contained in:
Jerome Jiang
2020-06-03 12:38:02 -07:00
committed by Commit Bot
parent f84ab8e2dd
commit 1220c39953

View File

@ -254,6 +254,24 @@ int LibaomAv1Encoder::InitEncode(const VideoCodec* codec_settings,
<< " on control AV1E_SET_MAX_INTRA_BITRATE_PCT.";
return WEBRTC_VIDEO_CODEC_ERROR;
}
ret = aom_codec_control(&ctx_, AV1E_SET_COEFF_COST_UPD_FREQ, 2);
if (ret != AOM_CODEC_OK) {
RTC_LOG(LS_WARNING) << "LibaomAv1Encoder::EncodeInit returned " << ret
<< " on control AV1E_SET_COEFF_COST_UPD_FREQ.";
return WEBRTC_VIDEO_CODEC_ERROR;
}
ret = aom_codec_control(&ctx_, AV1E_SET_MODE_COST_UPD_FREQ, 2);
if (ret != AOM_CODEC_OK) {
RTC_LOG(LS_WARNING) << "LibaomAv1Encoder::EncodeInit returned " << ret
<< " on control AV1E_SET_MODE_COST_UPD_FREQ.";
return WEBRTC_VIDEO_CODEC_ERROR;
}
ret = aom_codec_control(&ctx_, AV1E_SET_MV_COST_UPD_FREQ, 3);
if (ret != AOM_CODEC_OK) {
RTC_LOG(LS_WARNING) << "LibaomAv1Encoder::EncodeInit returned " << ret
<< " on control AV1E_SET_MV_COST_UPD_FREQ.";
return WEBRTC_VIDEO_CODEC_ERROR;
}
return WEBRTC_VIDEO_CODEC_OK;
}