Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1351)

Unified Diff: webrtc/modules/audio_coding/audio_network_adaptor/fec_controller_rplr_based.h

Issue 2688613003: Introduce ThresholdCurve (avoids code duplication between PLR/RPLR-based FecController) (Closed)
Patch Set: . Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webrtc/modules/audio_coding/audio_network_adaptor/fec_controller_rplr_based.h
diff --git a/webrtc/modules/audio_coding/audio_network_adaptor/fec_controller_rplr_based.h b/webrtc/modules/audio_coding/audio_network_adaptor/fec_controller_rplr_based.h
index e03ccacf28185bb10433bb36c78b28fc98cca0d4..849f43cc0b363fefc873660e19a1e2282e3a2173 100644
--- a/webrtc/modules/audio_coding/audio_network_adaptor/fec_controller_rplr_based.h
+++ b/webrtc/modules/audio_coding/audio_network_adaptor/fec_controller_rplr_based.h
@@ -15,35 +15,13 @@
#include "webrtc/base/constructormagic.h"
#include "webrtc/modules/audio_coding/audio_network_adaptor/controller.h"
+#include "webrtc/modules/audio_coding/audio_network_adaptor/util/threshold_curve.h"
namespace webrtc {
class FecControllerRplrBased final : public Controller {
public:
struct Config {
- struct Threshold {
- // Threshold defines a curve in the bandwidth/packet-loss domain. The
- // curve is characterized by the two conjunction points: A and B.
- //
- // recoverable
- // packet ^ |
- // loss | A |
- // | \ A: (low_bandwidth_bps,
- // | \ low_bandwidth_recoverable_packet_loss)
- // | \ B: (high_bandwidth_bps,
- // | \ high_bandwidth_recoverable_packet_loss)
- // | B \________
- // |---------------> bandwidth
- Threshold(int low_bandwidth_bps,
- float low_bandwidth_recoverable_packet_loss,
- int high_bandwidth_bps,
- float high_bandwidth_recoverable_packet_loss);
- int low_bandwidth_bps;
- float low_bandwidth_recoverable_packet_loss;
- int high_bandwidth_bps;
- float high_bandwidth_recoverable_packet_loss;
- };
-
// |fec_enabling_threshold| defines a curve, above which FEC should be
// enabled. |fec_disabling_threshold| defines a curve, under which FEC
// should be disabled. See below
@@ -56,11 +34,11 @@ class FecControllerRplrBased final : public Controller {
// | OFF \_________ fec_disabling_threshold
// |-----------------> bandwidth
Config(bool initial_fec_enabled,
- const Threshold& fec_enabling_threshold,
- const Threshold& fec_disabling_threshold);
+ const ThresholdCurve& fec_enabling_threshold,
+ const ThresholdCurve& fec_disabling_threshold);
bool initial_fec_enabled;
- Threshold fec_enabling_threshold;
- Threshold fec_disabling_threshold;
+ ThresholdCurve fec_enabling_threshold;
+ ThresholdCurve fec_disabling_threshold;
};
explicit FecControllerRplrBased(const Config& config);
@@ -72,18 +50,6 @@ class FecControllerRplrBased final : public Controller {
void MakeDecision(AudioNetworkAdaptor::EncoderRuntimeConfig* config) override;
private:
- // Characterize Threshold with:
- // recoverable_packet_loss = slope * bandwidth + offset.
- struct ThresholdInfo {
- explicit ThresholdInfo(const Config::Threshold& threshold);
- float slope;
- float offset;
- };
-
- float GetPacketLossThreshold(int bandwidth_bps,
- const Config::Threshold& threshold,
- const ThresholdInfo& threshold_info) const;
-
bool FecEnablingDecision() const;
bool FecDisablingDecision() const;
@@ -92,9 +58,6 @@ class FecControllerRplrBased final : public Controller {
rtc::Optional<int> uplink_bandwidth_bps_;
rtc::Optional<float> uplink_recoverable_packet_loss_;
- const ThresholdInfo fec_enabling_threshold_info_;
- const ThresholdInfo fec_disabling_threshold_info_;
-
RTC_DISALLOW_COPY_AND_ASSIGN(FecControllerRplrBased);
};

Powered by Google App Engine
This is Rietveld 408576698