Implement Opus bandwidth adjustment behind a FieldTrial

Bug: webrtc:8522
Change-Id: I3a32ebfecd27ff74b507c2cee9e16aab17153442
Reviewed-on: https://webrtc-review.googlesource.com/22210
Commit-Queue: Alejandro Luebs <aluebs@webrtc.org>
Reviewed-by: Henrik Lundin <henrik.lundin@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20799}
This commit is contained in:
Alex Luebs
2017-11-20 11:13:56 -08:00
committed by Commit Bot
parent 64eaa99cfc
commit eeb2765f6c
9 changed files with 368 additions and 3 deletions

View File

@ -43,6 +43,13 @@ class AudioEncoderOpusImpl final : public AudioEncoder {
static rtc::Optional<int> GetNewComplexity(
const AudioEncoderOpusConfig& config);
// Returns OPUS_AUTO if the the current bitrate is above wideband threshold.
// Returns empty if it is below, but bandwidth coincides with the desired one.
// Otherwise returns the desired bandwidth.
static rtc::Optional<int> GetNewBandwidth(
const AudioEncoderOpusConfig& config,
OpusEncInst* inst);
using AudioNetworkAdaptorCreator =
std::function<std::unique_ptr<AudioNetworkAdaptor>(const std::string&,
RtcEventLog*)>;
@ -148,6 +155,8 @@ class AudioEncoderOpusImpl final : public AudioEncoder {
AudioEncoderOpusConfig config_;
const int payload_type_;
const bool send_side_bwe_with_overhead_;
const bool adjust_bandwidth_;
bool bitrate_changed_;
float packet_loss_rate_;
std::vector<int16_t> input_buffer_;
OpusEncInst* inst_;