Removing old scheme for dumping internal AGC diagnostic data
Bug: webrtc:5298 Change-Id: I878b370ae86805d2dd6c0d8c1c61d3ee9d8a6c1b Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/159020 Reviewed-by: Alessio Bazzica <alessiob@webrtc.org> Commit-Queue: Per Åhgren <peah@webrtc.org> Cr-Commit-Position: refs/heads/master@{#29730}
This commit is contained in:
@ -161,29 +161,6 @@ float ComputeClippedRatio(const float* const* audio,
|
|||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
// Facility for dumping debug audio files. All methods are no-ops in the
|
|
||||||
// default case where WEBRTC_AGC_DEBUG_DUMP is undefined.
|
|
||||||
class DebugFile {
|
|
||||||
#ifdef WEBRTC_AGC_DEBUG_DUMP
|
|
||||||
public:
|
|
||||||
explicit DebugFile(const char* filename) : file_(fopen(filename, "wb")) {
|
|
||||||
RTC_DCHECK(file_);
|
|
||||||
}
|
|
||||||
~DebugFile() { fclose(file_); }
|
|
||||||
void Write(const int16_t* data, size_t length_samples) {
|
|
||||||
fwrite(data, 1, length_samples * sizeof(int16_t), file_);
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
|
||||||
FILE* file_;
|
|
||||||
#else
|
|
||||||
public:
|
|
||||||
explicit DebugFile(const char* filename) {}
|
|
||||||
~DebugFile() {}
|
|
||||||
void Write(const int16_t* data, size_t length_samples) {}
|
|
||||||
#endif // WEBRTC_AGC_DEBUG_DUMP
|
|
||||||
};
|
|
||||||
|
|
||||||
AgcManagerDirect::AgcManagerDirect(GainControl* gctrl,
|
AgcManagerDirect::AgcManagerDirect(GainControl* gctrl,
|
||||||
VolumeCallbacks* volume_callbacks,
|
VolumeCallbacks* volume_callbacks,
|
||||||
int startup_min_level,
|
int startup_min_level,
|
||||||
@ -240,9 +217,7 @@ AgcManagerDirect::AgcManagerDirect(Agc* agc,
|
|||||||
use_agc2_level_estimation_(use_agc2_level_estimation),
|
use_agc2_level_estimation_(use_agc2_level_estimation),
|
||||||
disable_digital_adaptive_(disable_digital_adaptive),
|
disable_digital_adaptive_(disable_digital_adaptive),
|
||||||
startup_min_level_(ClampLevel(startup_min_level, min_mic_level_)),
|
startup_min_level_(ClampLevel(startup_min_level, min_mic_level_)),
|
||||||
clipped_level_min_(clipped_level_min),
|
clipped_level_min_(clipped_level_min) {
|
||||||
file_preproc_(new DebugFile("agc_preproc.pcm")),
|
|
||||||
file_postproc_(new DebugFile("agc_postproc.pcm")) {
|
|
||||||
instance_counter_++;
|
instance_counter_++;
|
||||||
if (use_agc2_level_estimation_) {
|
if (use_agc2_level_estimation_) {
|
||||||
RTC_DCHECK(!agc);
|
RTC_DCHECK(!agc);
|
||||||
@ -348,8 +323,6 @@ void AgcManagerDirect::Process(const float* audio,
|
|||||||
UpdateCompressor();
|
UpdateCompressor();
|
||||||
}
|
}
|
||||||
|
|
||||||
file_postproc_->Write(audio_fix, safe_length);
|
|
||||||
|
|
||||||
data_dumper_->DumpRaw("experimental_gain_control_compression_gain_db", 1,
|
data_dumper_->DumpRaw("experimental_gain_control_compression_gain_db", 1,
|
||||||
&compression_);
|
&compression_);
|
||||||
}
|
}
|
||||||
|
@ -21,7 +21,6 @@
|
|||||||
namespace webrtc {
|
namespace webrtc {
|
||||||
|
|
||||||
class AudioFrame;
|
class AudioFrame;
|
||||||
class DebugFile;
|
|
||||||
class GainControl;
|
class GainControl;
|
||||||
|
|
||||||
// Callbacks that need to be injected into AgcManagerDirect to read and control
|
// Callbacks that need to be injected into AgcManagerDirect to read and control
|
||||||
@ -134,9 +133,6 @@ class AgcManagerDirect final {
|
|||||||
const int clipped_level_min_;
|
const int clipped_level_min_;
|
||||||
int calls_since_last_gain_log_ = 0;
|
int calls_since_last_gain_log_ = 0;
|
||||||
|
|
||||||
std::unique_ptr<DebugFile> file_preproc_;
|
|
||||||
std::unique_ptr<DebugFile> file_postproc_;
|
|
||||||
|
|
||||||
RTC_DISALLOW_COPY_AND_ASSIGN(AgcManagerDirect);
|
RTC_DISALLOW_COPY_AND_ASSIGN(AgcManagerDirect);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user