Format /modules

git ls-files | grep -e  "\(\.h\|\.cc\)$" | grep -e  "^modules/" | xargs clang-format -i ; git cl format
after landing: add to .git-blame-ignore-revs

Bug: webrtc:15082
Change-Id: I2c3cd28740062794f8c10e39d8406aadb9e9a35a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/301620
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Auto-Submit: Jared Siskin <jtsiskin@meta.com>
Cr-Commit-Position: refs/heads/main@{#39901}
This commit is contained in:
Jared Siskin 2023-04-19 16:24:03 -07:00 committed by WebRTC LUCI CQ
parent 2080dacfb7
commit c018bae807
134 changed files with 422 additions and 441 deletions

View File

@ -103,11 +103,7 @@ TEST(AudioDecoderFactoryTest, MaxNrOfChannels) {
#ifdef WEBRTC_CODEC_ILBC
"ilbc",
#endif
"pcmu",
"pcma",
"l16",
"G722",
"G711",
"pcmu", "pcma", "l16", "G722", "G711",
};
for (auto codec : codecs) {

View File

@ -37,6 +37,6 @@ void WebRtcIlbcfix_AbsQuant(
input) */
int16_t* in, /* (i) vector to encode */
int16_t* weightDenum /* (i) denominator of synthesis filter */
);
);
#endif

View File

@ -32,6 +32,6 @@ void WebRtcIlbcfix_BwExpand(
expansion */
int16_t* coef, /* (i) the bandwidth expansion factor Q15 */
int16_t length /* (i) the length of lpc coefficient vectors */
);
);
#endif

View File

@ -32,6 +32,6 @@ void WebRtcIlbcfix_CbMemEnergy(
int16_t* energyShifts, /* (o) Shift value of the energy */
int scale, /* (i) The scaling of all energy values */
size_t base_size /* (i) Index to where energy values should be stored */
);
);
#endif

View File

@ -29,6 +29,6 @@ void WebRtcIlbcfix_CbMemEnergyAugmentation(
size_t base_size, /* (i) Index to where energy values should be stored */
int16_t* energyW16, /* (o) Energy in the CB vectors */
int16_t* energyShifts /* (o) Shift value of the energy */
);
);
#endif

View File

@ -31,6 +31,6 @@ void WebRtcIlbcfix_CbMemEnergyCalc(
int16_t* energyShifts, /* (o) Shift value of the energy */
int scale, /* (i) The scaling of all energy values */
size_t base_size /* (i) Index to where energy values should be stored */
);
);
#endif

View File

@ -35,6 +35,6 @@ void WebRtcIlbcfix_CbSearch(
size_t lTarget, /* (i) Length of vector */
int16_t* weightDenum, /* (i) weighting filter coefficients in Q12 */
size_t block /* (i) the subblock number */
);
);
#endif

View File

@ -33,6 +33,6 @@ int16_t WebRtcIlbcfix_Chebyshev(
/* (o) Result of C(x) */
int16_t x, /* (i) Value to the Chevyshev polynomial */
int16_t* f /* (i) The coefficients in the polynomial */
);
);
#endif

View File

@ -34,6 +34,6 @@ void WebRtcIlbcfix_CompCorr(int32_t* corr, /* (o) cross correlation */
size_t bLen, /* (i) length of buffer */
size_t sRange, /* (i) correlation search length */
int16_t scale /* (i) number of rightshifts to use */
);
);
#endif

View File

@ -36,6 +36,6 @@ void WebRtcIlbcfix_DecoderInterpolateLsp(
int16_t length, /* (i) length of lsf coefficient vector */
IlbcDecoder* iLBCdec_inst
/* (i) the decoder state structure */
);
);
#endif

View File

@ -39,6 +39,6 @@ void WebRtcIlbcfix_DoThePlc(
size_t inlag, /* (i) pitch lag */
IlbcDecoder* iLBCdec_inst
/* (i/o) decoder instance */
);
);
#endif

View File

@ -33,6 +33,6 @@ void WebRtcIlbcfix_EncodeImpl(
const int16_t* block, /* (i) speech vector to encode */
IlbcEncoder* iLBCenc_inst /* (i/o) the general encoder
state */
);
);
#endif

View File

@ -28,6 +28,6 @@
void WebRtcIlbcfix_EnhUpsample(
int32_t* useq1, /* (o) upsampled output sequence */
int16_t* seq1 /* (i) unupsampled sequence */
);
);
#endif

View File

@ -35,6 +35,6 @@ void WebRtcIlbcfix_Enhancer(
size_t* period, /* (i) pitch period array (pitch bward-in time) */
const size_t* plocs, /* (i) locations where period array values valid */
size_t periodl /* (i) dimension of period and plocs */
);
);
#endif

View File

@ -34,6 +34,6 @@ void WebRtcIlbcfix_FilteredCbVecs(
second CB section */
size_t lMem, /* (i) Length of codebook memory */
size_t samples /* (i) Number of samples to filter */
);
);
#endif

View File

@ -29,6 +29,6 @@ size_t WebRtcIlbcfix_FrameClassify(
IlbcEncoder* iLBCenc_inst,
/* (i/o) the encoder state structure */
int16_t* residualFIX /* (i) lpc residual signal */
);
);
#endif

View File

@ -31,6 +31,6 @@ int16_t WebRtcIlbcfix_GainDequant(
int16_t index, /* (i) quantization index */
int16_t maxIn, /* (i) maximum of unquantized gain (Q14) */
int16_t stage /* (i) The stage of the search */
);
);
#endif

View File

@ -31,6 +31,6 @@ WebRtcIlbcfix_GainQuant( /* (o) quantized gain value */
int16_t maxIn, /* (i) maximum of gain value Q14 */
int16_t stage, /* (i) The stage of the search */
int16_t* index /* (o) quantization index */
);
);
#endif

View File

@ -36,6 +36,6 @@ void WebRtcIlbcfix_GetSyncSeq(
size_t hl, /* (i) 2*hl+1 is the number of sequences */
int16_t* surround /* (i/o) The contribution from this sequence
summed with earlier contributions */
);
);
#endif

View File

@ -22,6 +22,6 @@
#include "modules/audio_coding/codecs/ilbc/defines.h"
void WebRtcIlbcfix_IndexConvDec(int16_t* index /* (i/o) Codebook indexes */
);
);
#endif

View File

@ -26,6 +26,6 @@
*---------------------------------------------------------------*/
void WebRtcIlbcfix_IndexConvEnc(int16_t* index /* (i/o) Codebook indexes */
);
);
#endif

View File

@ -33,6 +33,6 @@ int WebRtcIlbcfix_InitDecode(/* (o) Number of decoded samples */
int16_t mode, /* (i) frame size mode */
int use_enhancer /* (i) 1 to use enhancer
0 to run without enhancer */
);
);
#endif

View File

@ -31,6 +31,6 @@ int WebRtcIlbcfix_InitEncode(/* (o) Number of bytes encoded */
IlbcEncoder*
iLBCenc_inst, /* (i/o) Encoder instance */
int16_t mode /* (i) frame size mode */
);
);
#endif

View File

@ -30,6 +30,6 @@ void WebRtcIlbcfix_InterpolateSamples(
int16_t* interpSamples, /* (o) The interpolated samples */
int16_t* CBmem, /* (i) The CB memory */
size_t lMem /* (i) Length of the CB memory */
);
);
#endif

View File

@ -37,6 +37,6 @@ void WebRtcIlbcfix_LpcEncode(
int16_t* data, /* (i) Speech to do LPC analysis on */
IlbcEncoder* iLBCenc_inst
/* (i/o) the encoder state structure */
);
);
#endif

View File

@ -32,6 +32,6 @@ void WebRtcIlbcfix_LspInterpolate2PolyDec(
int16_t coef, /* (i) weighting coefficient to use between
lsf1 and lsf2 Q14 */
int16_t length /* (i) length of coefficient vectors */
);
);
#endif

View File

@ -33,6 +33,6 @@ void WebRtcIlbcfix_LsfInterpolate2PloyEnc(
int16_t coef, /* (i) weighting coefficient to use between
lsf1 and lsf2 Q14 */
int16_t length /* (i) length of coefficient vectors */
);
);
#endif

View File

@ -29,6 +29,6 @@ void WebRtcIlbcfix_Lsf2Lsp(
int16_t* lsf, /* (i) lsf in Q13 values between 0 and pi */
int16_t* lsp, /* (o) lsp in Q15 values between -1 and 1 */
int16_t m /* (i) number of coefficients */
);
);
#endif

View File

@ -28,6 +28,6 @@
void WebRtcIlbcfix_Lsf2Poly(
int16_t* a, /* (o) predictor coefficients (order = 10) in Q12 */
int16_t* lsf /* (i) line spectral frequencies in Q13 */
);
);
#endif

View File

@ -30,6 +30,6 @@ void WebRtcIlbcfix_Lsp2Lsf(
int16_t* lsf, /* (o) Lsf vector 0...Pi in Q13
(ordered, so that lsf[i]<lsf[i+1]) */
int16_t m /* (i) Number of coefficients */
);
);
#endif

View File

@ -31,6 +31,6 @@ void WebRtcIlbcfix_MyCorr(int32_t* corr, /* (o) correlation of seq1 and seq2 */
size_t dim1, /* (i) dimension first seq1 */
const int16_t* seq2, /* (i) second sequence */
size_t dim2 /* (i) dimension seq2 */
);
);
#endif

View File

@ -32,6 +32,6 @@ void WebRtcIlbcfix_NearestNeighbor(
const size_t* array, /* (i) data array (Q2) */
size_t value, /* (i) value (Q2) */
size_t arlength /* (i) dimension of data array (==ENH_NBLOCKS_TOT) */
);
);
#endif

View File

@ -29,6 +29,6 @@ void WebRtcIlbcfix_PackBits(
uint16_t* bitstream, /* (o) The packetized bitstream */
iLBC_bits* enc_bits, /* (i) Encoded bits */
int16_t mode /* (i) Codec mode (20 or 30) */
);
);
#endif

View File

@ -27,6 +27,6 @@
void WebRtcIlbcfix_Poly2Lsf(int16_t* lsf, /* (o) lsf coefficients (Q13) */
int16_t* a /* (i) A coefficients (Q12) */
);
);
#endif

View File

@ -31,6 +31,6 @@ void WebRtcIlbcfix_Poly2Lsp(
int16_t* lsp, /* (i) LSP coefficients in Q15 */
int16_t* old_lsp /* (i) old LSP coefficients that are used if the new
coefficients turn out to be unstable */
);
);
#endif

View File

@ -39,6 +39,6 @@ void WebRtcIlbcfix_Refiner(
int16_t* surround, /* (i/o) The contribution from this sequence
summed with earlier contributions */
int16_t gain /* (i) Gain to use for this sequence */
);
);
#endif

View File

@ -43,6 +43,6 @@ void WebRtcIlbcfix_SimpleInterpolateLsf(
int16_t length, /* (i) should equate FILTERORDER */
IlbcEncoder* iLBCenc_inst
/* (i/o) the encoder state structure */
);
);
#endif

View File

@ -32,6 +32,6 @@ void WebRtcIlbcfix_SimpleLpcAnalysis(
int16_t* data, /* (i) new block of speech */
IlbcEncoder* iLBCenc_inst
/* (i/o) the encoder state structure */
);
);
#endif

View File

@ -29,6 +29,6 @@ void WebRtcIlbcfix_SimpleLsfDeQ(
int16_t* lsfdeq, /* (o) dequantized lsf coefficients */
int16_t* index, /* (i) quantization index */
int16_t lpc_n /* (i) number of LPCs */
);
);
#endif

View File

@ -32,6 +32,6 @@ void WebRtcIlbcfix_SimpleLsfQ(
int16_t* lsf, /* (i) the lsf coefficient vector to be
quantized (dimension FILTERORDER) Q13 */
int16_t lpc_n /* (i) number of lsf sets to quantize */
);
);
#endif

View File

@ -30,6 +30,6 @@ void WebRtcIlbcfix_Smooth(int16_t* odata, /* (o) smoothed output */
this block */
int16_t* surround /* (i) The approximation from the
surrounding sequences */
);
);
#endif

View File

@ -31,6 +31,6 @@ void WebRtcIlbcfix_SortSq(
int16_t x, /* (i) the value to quantize */
const int16_t* cb, /* (i) the quantization codebook */
int16_t cb_size /* (i) the size of the quantization codebook */
);
);
#endif

View File

@ -33,6 +33,6 @@ void WebRtcIlbcfix_SplitVq(
int16_t* CB, /* (i) the quantizer codebook in Q13 */
int16_t* dim, /* (i) the dimension of X and qX */
int16_t* cbsize /* (i) the number of vectors in the codebook */
);
);
#endif

View File

@ -33,6 +33,6 @@ void WebRtcIlbcfix_StateConstruct(
int16_t* syntDenum, /* (i) synthesis filter denumerator */
int16_t* Out_fix, /* (o) the decoded state vector */
size_t len /* (i) length of a state vector */
);
);
#endif

View File

@ -36,6 +36,6 @@ void WebRtcIlbcfix_StateSearch(
int16_t* residual, /* (i) target residual vector */
int16_t* syntDenum, /* (i) lpc synthesis filter */
int16_t* weightDenum /* (i) weighting filter denuminator */
);
);
#endif

View File

@ -30,6 +30,6 @@ void WebRtcIlbcfix_SwapBytes(
const uint16_t* input, /* (i) the sequence to swap */
size_t wordLength, /* (i) number or uint16_t to swap */
uint16_t* output /* (o) the swapped sequence */
);
);
#endif

View File

@ -34,6 +34,6 @@ WebRtcIlbcfix_UnpackBits(/* (o) "Empty" frame indicator */
iLBC_bits*
enc_bits, /* (o) Paramerers from bitstream */
int16_t mode /* (i) Codec mode (20 or 30) */
);
);
#endif

View File

@ -31,6 +31,6 @@ void WebRtcIlbcfix_Vq3(
int16_t* CB, /* (i) the vector quantization codebook (Q13) */
int16_t* X, /* (i) the vector to quantize (Q13) */
int16_t n_cb /* (i) the number of vectors in the codebook */
);
);
#endif

View File

@ -31,6 +31,6 @@ void WebRtcIlbcfix_Vq4(
int16_t* CB, /* (i) the vector quantization codebook (Q13) */
int16_t* X, /* (i) the vector to quantize (Q13) */
int16_t n_cb /* (i) the number of vectors in the codebook */
);
);
#endif

View File

@ -30,6 +30,6 @@ void WebRtcIlbcfix_Window32W32(int32_t* z, /* Output */
int32_t* x, /* Input (same domain as Output)*/
const int32_t* y, /* Q31 Window */
size_t N /* length to process */
);
);
#endif

View File

@ -34,6 +34,6 @@ size_t WebRtcIlbcfix_XcorrCoef(
size_t searchLen, /* (i) the search lenght */
size_t offset, /* (i) samples offset between arrays */
int16_t step /* (i) +1 or -1 */
);
);
#endif

View File

@ -11,7 +11,6 @@
#include "modules/audio_coding/codecs/opus/opus_interface.h"
#include <cstdlib>
#include <numeric>
#include "api/array_view.h"

View File

@ -37,7 +37,7 @@ namespace {
static const size_t kMaxNumSamples = 48 * 10 * 2; // 10 ms @ 48 kHz stereo.
static const size_t kRedLastHeaderLength =
1; // 1 byte RED header for the last element.
}
} // namespace
class AudioEncoderCopyRedTest : public ::testing::Test {
protected:

View File

@ -10,7 +10,6 @@
#include "modules/audio_coding/neteq/accelerate.h"
#include "api/array_view.h"
#include "modules/audio_coding/neteq/audio_multi_vector.h"

View File

@ -10,7 +10,6 @@
#include "modules/audio_coding/neteq/audio_multi_vector.h"
#include <algorithm>
#include "rtc_base/checks.h"

View File

@ -10,7 +10,6 @@
#include "modules/audio_coding/neteq/audio_vector.h"
#include <algorithm>
#include <memory>

View File

@ -35,7 +35,7 @@ void BufferLevelFilter::Update(size_t buffer_size_samples,
// `level_factor_` and `filtered_current_level_` are in Q8.
// `buffer_size_samples` is in Q0.
const int64_t filtered_current_level =
(level_factor_ * int64_t{filtered_current_level_} >> 8) +
(level_factor_* int64_t{filtered_current_level_} >> 8) +
(256 - level_factor_) * rtc::dchecked_cast<int64_t>(buffer_size_samples);
// Account for time-scale operations (accelerate and pre-emptive expand) and

View File

@ -10,7 +10,6 @@
#include "modules/audio_coding/neteq/comfort_noise.h"
#include <cstdint>
#include <memory>

View File

@ -11,7 +11,6 @@
#ifndef MODULES_AUDIO_CODING_NETEQ_EXPAND_H_
#define MODULES_AUDIO_CODING_NETEQ_EXPAND_H_
#include <memory>
#include "modules/audio_coding/neteq/audio_vector.h"

View File

@ -160,7 +160,6 @@ TEST_F(NetEqDecodingTestFaxMode, TestFrameWaitingTimeStatistics) {
EXPECT_EQ(-1, stats.max_waiting_time_ms);
}
TEST_F(NetEqDecodingTest, LongCngWithNegativeClockDrift) {
// Apply a clock drift of -25 ms / s (sender faster than receiver).
const double kDriftFactor = 1000.0 / (1000.0 + 25.0);

View File

@ -12,7 +12,6 @@
#include "modules/audio_coding/neteq/red_payload_splitter.h"
#include <memory>
#include <utility> // pair

View File

@ -313,8 +313,7 @@ NetEqLifetimeStatistics NetEqTest::LifetimeStats() const {
}
NetEqTest::DecoderMap NetEqTest::StandardDecoderMap() {
DecoderMap codecs = {
{0, SdpAudioFormat("pcmu", 8000, 1)},
DecoderMap codecs = {{0, SdpAudioFormat("pcmu", 8000, 1)},
{8, SdpAudioFormat("pcma", 8000, 1)},
#ifdef WEBRTC_CODEC_ILBC
{102, SdpAudioFormat("ilbc", 8000, 1)},
@ -335,8 +334,7 @@ NetEqTest::DecoderMap NetEqTest::StandardDecoderMap() {
{13, SdpAudioFormat("cn", 8000, 1)},
{98, SdpAudioFormat("cn", 16000, 1)},
{99, SdpAudioFormat("cn", 32000, 1)},
{100, SdpAudioFormat("cn", 48000, 1)}
};
{100, SdpAudioFormat("cn", 48000, 1)}};
return codecs;
}

View File

@ -80,8 +80,7 @@ std::unique_ptr<Packet> RtpFileSource::NextPacket() {
}
RtpFileSource::RtpFileSource(absl::optional<uint32_t> ssrc_filter)
: PacketSource(),
ssrc_filter_(ssrc_filter) {}
: PacketSource(), ssrc_filter_(ssrc_filter) {}
bool RtpFileSource::OpenFile(absl::string_view file_name) {
rtp_reader_.reset(RtpFileReader::Create(RtpFileReader::kRtpDump, file_name));

View File

@ -10,7 +10,6 @@
#include "modules/audio_coding/neteq/tools/rtp_generator.h"
namespace webrtc {
namespace test {

View File

@ -10,7 +10,6 @@
#include "modules/audio_device/linux/audio_device_alsa_linux.h"
#include "modules/audio_device/audio_device_config.h"
#include "rtc_base/logging.h"
#include "rtc_base/system/arch.h"

View File

@ -29,12 +29,11 @@
#include "modules/audio_device/win/audio_device_core_win.h"
// clang-format on
#include <string.h>
#include <comdef.h>
#include <dmo.h>
#include <functiondiscoverykeys_devpkey.h>
#include <mmsystem.h>
#include <string.h>
#include <strsafe.h>
#include <uuids.h>
#include <windows.h>
@ -3256,8 +3255,9 @@ DWORD AudioDeviceWindowsCore::DoCaptureThread() {
QueryPerformanceCounter(&t1);
// Get the current recording and playout delay.
uint32_t sndCardRecDelay = (uint32_t)(
((((UINT64)t1.QuadPart * _perfCounterFactor) - recTime) / 10000) +
uint32_t sndCardRecDelay =
(uint32_t)(((((UINT64)t1.QuadPart * _perfCounterFactor) - recTime) /
10000) +
(10 * syncBufIndex) / _recBlockSize - 10);
uint32_t sndCardPlayDelay = static_cast<uint32_t>(_sndCardPlayDelay);

View File

@ -13,12 +13,9 @@
#if (_MSC_VER >= 1400) // only include for VS 2005 and higher
#include "rtc_base/win32.h"
#include "modules/audio_device/audio_device_generic.h"
#include <wmcodecdsp.h> // CLSID_CWMAudioAEC
// (must be before audioclient.h)
//(must be before audioclient.h)
#include <audioclient.h> // WASAPI
#include <audiopolicy.h>
#include <avrt.h> // Avrt
@ -27,8 +24,10 @@
#include <mmdeviceapi.h> // MMDevice
#include "api/scoped_refptr.h"
#include "modules/audio_device/audio_device_generic.h"
#include "rtc_base/synchronization/mutex.h"
#include "rtc_base/win/scoped_com_initializer.h"
#include "rtc_base/win32.h"
// Use Multimedia Class Scheduler Service (MMCSS) to boost the thread priority
#pragma comment(lib, "avrt.lib")

View File

@ -9,6 +9,7 @@
*/
#include "modules/audio_device/win/core_audio_utility_win.h"
#include "rtc_base/arraysize.h"
#include "rtc_base/logging.h"
#include "rtc_base/win/scoped_com_initializer.h"

View File

@ -8,10 +8,9 @@
* be found in the AUTHORS file in the root of the source tree.
*/
#include "modules/audio_processing/aec3/adaptive_fir_filter.h"
#include <immintrin.h>
#include "modules/audio_processing/aec3/adaptive_fir_filter.h"
#include "rtc_base/checks.h"
namespace webrtc {

View File

@ -8,10 +8,10 @@
* be found in the AUTHORS file in the root of the source tree.
*/
#include "modules/audio_processing/aec3/adaptive_fir_filter_erl.h"
#include <immintrin.h>
#include "modules/audio_processing/aec3/adaptive_fir_filter_erl.h"
namespace webrtc {
namespace aec3 {

View File

@ -14,11 +14,7 @@
namespace webrtc {
struct EchoPathVariability {
enum class DelayAdjustment {
kNone,
kBufferFlush,
kNewDetectedDelay
};
enum class DelayAdjustment { kNone, kBufferFlush, kNewDetectedDelay };
EchoPathVariability(bool gain_change,
DelayAdjustment delay_change,

View File

@ -8,11 +8,10 @@
* be found in the AUTHORS file in the root of the source tree.
*/
#include "modules/audio_processing/aec3/fft_data.h"
#include <immintrin.h>
#include "api/array_view.h"
#include "modules/audio_processing/aec3/fft_data.h"
namespace webrtc {

View File

@ -453,18 +453,21 @@ TEST(MultiChannelContentDetectorMetrics, ReportsMetrics) {
"PersistentMultichannelContentEverDetected"));
EXPECT_METRIC_EQ(
1, metrics::NumEvents("WebRTC.Audio.EchoCanceller."
"PersistentMultichannelContentEverDetected", 1));
"PersistentMultichannelContentEverDetected",
1));
// Check periodic metric.
EXPECT_METRIC_EQ(
2, metrics::NumSamples("WebRTC.Audio.EchoCanceller."
"ProcessingPersistentMultichannelContent"));
EXPECT_METRIC_EQ(
1, metrics::NumEvents("WebRTC.Audio.EchoCanceller."
"ProcessingPersistentMultichannelContent", 0));
EXPECT_METRIC_EQ(
1, metrics::NumEvents("WebRTC.Audio.EchoCanceller."
"ProcessingPersistentMultichannelContent", 1));
EXPECT_METRIC_EQ(1,
metrics::NumEvents("WebRTC.Audio.EchoCanceller."
"ProcessingPersistentMultichannelContent",
0));
EXPECT_METRIC_EQ(1,
metrics::NumEvents("WebRTC.Audio.EchoCanceller."
"ProcessingPersistentMultichannelContent",
1));
}
} // namespace webrtc

View File

@ -49,7 +49,6 @@ class ReverbModel {
float reverb_decay);
private:
std::array<float, kFftLengthBy2Plus1> reverb_;
};

View File

@ -8,12 +8,11 @@
* be found in the AUTHORS file in the root of the source tree.
*/
#include "modules/audio_processing/aec3/vector_math.h"
#include <immintrin.h>
#include <math.h>
#include "api/array_view.h"
#include "modules/audio_processing/aec3/vector_math.h"
#include "rtc_base/checks.h"
namespace webrtc {

View File

@ -123,7 +123,6 @@ const int16_t WebRtcAecm_kSinTable[] = {
-2667, -2531, -2395, -2258, -2120, -1981, -1842, -1703, -1563, -1422, -1281,
-1140, -998, -856, -713, -571, -428, -285, -142};
// Moves the pointer to the next entry and inserts `far_spectrum` and
// corresponding Q-domain in its buffer.
//

View File

@ -185,8 +185,9 @@ static void WindowAndFFT(AecmCore* aecm,
int16_t scaled_time_signal = time_signal[i] * (1 << time_signal_scaling);
fft[i] = (int16_t)((scaled_time_signal * WebRtcAecm_kSqrtHanning[i]) >> 14);
scaled_time_signal = time_signal[i + PART_LEN] * (1 << time_signal_scaling);
fft[PART_LEN + i] = (int16_t)(
(scaled_time_signal * WebRtcAecm_kSqrtHanning[PART_LEN - i]) >> 14);
fft[PART_LEN + i] = (int16_t)((scaled_time_signal *
WebRtcAecm_kSqrtHanning[PART_LEN - i]) >>
14);
}
// Do forward FFT, then take only the first PART_LEN complex samples,
@ -644,18 +645,18 @@ int RTC_NO_SANITIZE("signed-integer-overflow") // bugs.webrtc.org/8200
}
// multiply with Wiener coefficients
efw[i].real = (int16_t)(
WEBRTC_SPL_MUL_16_16_RSFT_WITH_ROUND(dfw[i].real, hnl[i], 14));
efw[i].imag = (int16_t)(
WEBRTC_SPL_MUL_16_16_RSFT_WITH_ROUND(dfw[i].imag, hnl[i], 14));
efw[i].real = (int16_t)(WEBRTC_SPL_MUL_16_16_RSFT_WITH_ROUND(dfw[i].real,
hnl[i], 14));
efw[i].imag = (int16_t)(WEBRTC_SPL_MUL_16_16_RSFT_WITH_ROUND(dfw[i].imag,
hnl[i], 14));
}
} else {
// multiply with Wiener coefficients
for (i = 0; i < PART_LEN1; i++) {
efw[i].real = (int16_t)(
WEBRTC_SPL_MUL_16_16_RSFT_WITH_ROUND(dfw[i].real, hnl[i], 14));
efw[i].imag = (int16_t)(
WEBRTC_SPL_MUL_16_16_RSFT_WITH_ROUND(dfw[i].imag, hnl[i], 14));
efw[i].real = (int16_t)(WEBRTC_SPL_MUL_16_16_RSFT_WITH_ROUND(dfw[i].real,
hnl[i], 14));
efw[i].imag = (int16_t)(WEBRTC_SPL_MUL_16_16_RSFT_WITH_ROUND(dfw[i].imag,
hnl[i], 14));
}
}

View File

@ -569,8 +569,8 @@ static void InverseFFTAndWindow(AecmCore* aecm,
[paecm_buf] "+r"(paecm_buf), [i] "=&r"(i),
[pp_kSqrtHanning] "+r"(pp_kSqrtHanning),
[p_kSqrtHanning] "+r"(p_kSqrtHanning)
: [out_aecm] "r"(out_aecm),
[WebRtcAecm_kSqrtHanning] "r"(WebRtcAecm_kSqrtHanning)
: [out_aecm] "r"(out_aecm), [WebRtcAecm_kSqrtHanning] "r"(
WebRtcAecm_kSqrtHanning)
: "hi", "lo", "memory");
// Copy the current block to the old position
@ -1334,10 +1334,10 @@ int WebRtcAecm_ProcessBlock(AecmCore* aecm,
} else {
// multiply with Wiener coefficients
for (i = 0; i < PART_LEN1; i++) {
efw[i].real = (int16_t)(
WEBRTC_SPL_MUL_16_16_RSFT_WITH_ROUND(dfw[i].real, hnl[i], 14));
efw[i].imag = (int16_t)(
WEBRTC_SPL_MUL_16_16_RSFT_WITH_ROUND(dfw[i].imag, hnl[i], 14));
efw[i].real = (int16_t)(WEBRTC_SPL_MUL_16_16_RSFT_WITH_ROUND(dfw[i].real,
hnl[i], 14));
efw[i].imag = (int16_t)(WEBRTC_SPL_MUL_16_16_RSFT_WITH_ROUND(dfw[i].imag,
hnl[i], 14));
}
}
@ -1424,8 +1424,8 @@ static void ComfortNoise(AecmCore* aecm,
"srav %[tmp32], %[tmp32], %[minTrackShift] \n\t"
"subu %[tnoise], %[tnoise], %[tmp32] \n\t"
: [tmp32] "=&r"(tmp32), [tnoise] "+r"(tnoise)
:
[outLShift32] "r"(outLShift32), [minTrackShift] "r"(minTrackShift));
: [outLShift32] "r"(outLShift32), [minTrackShift] "r"(
minTrackShift));
}
} else {
// Reset "too high" counter
@ -1497,8 +1497,8 @@ static void ComfortNoise(AecmCore* aecm,
"srav %[tmp32], %[tmp32], %[minTrackShift] \n\t"
"subu %[tnoise1], %[tnoise1], %[tmp32] \n\t"
: [tmp32] "=&r"(tmp32), [tnoise1] "+r"(tnoise1)
:
[outLShift32] "r"(outLShift32), [minTrackShift] "r"(minTrackShift));
: [outLShift32] "r"(outLShift32), [minTrackShift] "r"(
minTrackShift));
}
} else {
// Reset "too high" counter

View File

@ -11,7 +11,6 @@
#ifndef MODULES_AUDIO_PROCESSING_AGC_LEGACY_ANALOG_AGC_H_
#define MODULES_AUDIO_PROCESSING_AGC_LEGACY_ANALOG_AGC_H_
#include "modules/audio_processing/agc/legacy/digital_agc.h"
#include "modules/audio_processing/agc/legacy/gain_control.h"

View File

@ -8,10 +8,11 @@
* be found in the AUTHORS file in the root of the source tree.
*/
#include "modules/audio_processing/agc2/rnn_vad/rnn_fc.h"
#include <algorithm>
#include <numeric>
#include "modules/audio_processing/agc2/rnn_vad/rnn_fc.h"
#include "rtc_base/checks.h"
#include "rtc_base/numerics/safe_conversions.h"
#include "third_party/rnnoise/src/rnn_activations.h"

View File

@ -8,11 +8,10 @@
* be found in the AUTHORS file in the root of the source tree.
*/
#include "modules/audio_processing/agc2/rnn_vad/vector_math.h"
#include <immintrin.h>
#include "api/array_view.h"
#include "modules/audio_processing/agc2/rnn_vad/vector_math.h"
#include "rtc_base/checks.h"
#include "rtc_base/numerics/safe_conversions.h"

View File

@ -255,7 +255,6 @@ int GainControlImpl::ProcessCaptureAudio(AudioBuffer* audio,
return AudioProcessing::kNoError;
}
// TODO(ajm): ensure this is called under kAdaptiveAnalog.
int GainControlImpl::set_stream_analog_level(int level) {
data_dumper_->DumpRaw("gain_control_set_stream_analog_level", 1, &level);
@ -287,7 +286,6 @@ int GainControlImpl::set_mode(Mode mode) {
return AudioProcessing::kNoError;
}
int GainControlImpl::set_analog_level_limits(int minimum, int maximum) {
if (minimum < 0 || maximum > 65535 || maximum < minimum) {
return AudioProcessing::kBadParameterError;
@ -302,7 +300,6 @@ int GainControlImpl::set_analog_level_limits(int minimum, int maximum) {
return AudioProcessing::kNoError;
}
int GainControlImpl::set_target_level_dbfs(int level) {
if (level > 31 || level < 0) {
return AudioProcessing::kBadParameterError;

View File

@ -13,6 +13,7 @@
#include <math.h>
#include <stdlib.h>
#include <string.h>
#include <algorithm>
#include "modules/audio_processing/ns/fast_math.h"

View File

@ -11,6 +11,7 @@
#include "modules/audio_processing/ns/prior_signal_model_estimator.h"
#include <math.h>
#include <algorithm>
#include "modules/audio_processing/ns/fast_math.h"

View File

@ -12,6 +12,7 @@
#define MODULES_AUDIO_PROCESSING_NS_QUANTILE_NOISE_ESTIMATOR_H_
#include <math.h>
#include <array>
#include "api/array_view.h"

View File

@ -11,6 +11,7 @@
#include "modules/audio_processing/ns/speech_probability_estimator.h"
#include <math.h>
#include <algorithm>
#include "modules/audio_processing/ns/fast_math.h"

View File

@ -13,6 +13,7 @@
#include <math.h>
#include <stdlib.h>
#include <string.h>
#include <algorithm>
#include "modules/audio_processing/ns/fast_math.h"

View File

@ -9,9 +9,8 @@
*/
#include <iostream>
#include <vector>
#include <memory>
#include <vector>
#include "absl/flags/flag.h"
#include "absl/flags/parse.h"

View File

@ -968,9 +968,7 @@ TEST(GoogCcScenario, FallbackToLossBasedBweWithoutPacketFeedback) {
EXPECT_GE(client->target_rate().kbps(), 500);
// Update the network to create high loss ratio
net->UpdateConfig([](NetworkSimulationConfig* c) {
c->loss_rate = 0.15;
});
net->UpdateConfig([](NetworkSimulationConfig* c) { c->loss_rate = 0.15; });
s.RunFor(TimeDelta::Seconds(20));
// Bandwidth decreases thanks to loss based bwe v0.

View File

@ -17,7 +17,6 @@
#include <utility>
#include <vector>
namespace webrtc {
namespace pcc {

View File

@ -85,7 +85,6 @@ bool InFlightBytesTracker::NetworkRouteComparator::operator()(
TransportFeedbackAdapter::TransportFeedbackAdapter() = default;
void TransportFeedbackAdapter::AddPacket(const RtpPacketSendInfo& packet_info,
size_t overhead_bytes,
Timestamp creation_time) {
@ -213,13 +212,13 @@ TransportFeedbackAdapter::ProcessTransportFeedbackInner(
size_t failed_lookups = 0;
size_t ignored = 0;
feedback.ForAllPackets([&](uint16_t sequence_number,
TimeDelta delta_since_base) {
feedback.ForAllPackets(
[&](uint16_t sequence_number, TimeDelta delta_since_base) {
int64_t seq_num = seq_num_unwrapper_.Unwrap(sequence_number);
if (seq_num > last_ack_seq_num_) {
// Starts at history_.begin() if last_ack_seq_num_ < 0, since any valid
// sequence number is >= 0.
// Starts at history_.begin() if last_ack_seq_num_ < 0, since any
// valid sequence number is >= 0.
for (auto it = history_.upper_bound(last_ack_seq_num_);
it != history_.upper_bound(seq_num); ++it) {
in_flight_.RemoveInFlightPacketBytes(it->second);
@ -244,9 +243,10 @@ TransportFeedbackAdapter::ProcessTransportFeedbackInner(
PacketFeedback packet_feedback = it->second;
if (delta_since_base.IsFinite()) {
packet_feedback.receive_time =
current_offset_ + delta_since_base.RoundDownTo(TimeDelta::Millis(1));
// Note: Lost packets are not removed from history because they might be
// reported as received by a later feedback.
current_offset_ +
delta_since_base.RoundDownTo(TimeDelta::Millis(1));
// Note: Lost packets are not removed from history because they might
// be reported as received by a later feedback.
history_.erase(it);
}
if (packet_feedback.network_route == network_route_) {

View File

@ -8,6 +8,7 @@
* be found in the AUTHORS file in the root of the source tree.
*/
#include "modules/congestion_controller/rtp/transport_feedback_demuxer.h"
#include "absl/algorithm/container.h"
#include "modules/rtp_rtcp/source/rtcp_packet/transport_feedback.h"

View File

@ -44,8 +44,8 @@ void RunTest(const TestData& test) {
auto dest_frame = CreateTestFrame(test.dest_frame_rect, 0);
auto src_frame = CreateTestFrame(test.src_frame_rect, 0xff);
dest_frame->CopyIntersectingPixelsFrom(
*src_frame, test.horizontal_scale, test.vertical_scale);
dest_frame->CopyIntersectingPixelsFrom(*src_frame, test.horizontal_scale,
test.vertical_scale);
// Translate the expected overlap rect to be relative to the dest frame/rect.
DesktopVector dest_frame_origin = test.dest_frame_rect.top_left();
@ -105,6 +105,7 @@ TEST(DesktopFrameTest, FrameDataSwitchesBetweenNonBlackAndBlack) {
}
TEST(DesktopFrameTest, CopyIntersectingPixelsMatchingRects) {
// clang-format off
const TestData tests[] = {
{"0 origin",
DesktopRect::MakeXYWH(0, 0, 2, 2),
@ -118,6 +119,7 @@ TEST(DesktopFrameTest, CopyIntersectingPixelsMatchingRects) {
1.0, 1.0,
DesktopRect::MakeXYWH(-1, -1, 2, 2)}
};
// clang-format on
RunTests(tests, arraysize(tests));
}
@ -125,6 +127,7 @@ TEST(DesktopFrameTest, CopyIntersectingPixelsMatchingRects) {
TEST(DesktopFrameTest, CopyIntersectingPixelsMatchingRectsScaled) {
// The scale factors shouldn't affect matching rects (they're only applied
// to any difference between the origins)
// clang-format off
const TestData tests[] = {
{"0 origin 2x",
DesktopRect::MakeXYWH(0, 0, 2, 2),
@ -150,11 +153,13 @@ TEST(DesktopFrameTest, CopyIntersectingPixelsMatchingRectsScaled) {
0.5, 0.5,
DesktopRect::MakeXYWH(-1, -1, 2, 2)}
};
// clang-format on
RunTests(tests, arraysize(tests));
}
TEST(DesktopFrameTest, CopyIntersectingPixelsFullyContainedRects) {
// clang-format off
const TestData tests[] = {
{"0 origin top left",
DesktopRect::MakeXYWH(0, 0, 2, 2),
@ -174,11 +179,13 @@ TEST(DesktopFrameTest, CopyIntersectingPixelsFullyContainedRects) {
1.0, 1.0,
DesktopRect::MakeXYWH(-1, 0, 1, 1)}
};
// clang-format on
RunTests(tests, arraysize(tests));
}
TEST(DesktopFrameTest, CopyIntersectingPixelsFullyContainedRectsScaled) {
// clang-format off
const TestData tests[] = {
{"0 origin top left 2x",
DesktopRect::MakeXYWH(0, 0, 2, 2),
@ -222,12 +229,14 @@ TEST(DesktopFrameTest, CopyIntersectingPixelsFullyContainedRectsScaled) {
0.5, 0.5,
DesktopRect::MakeXYWH(-1, -1, 1, 1)}
};
// clang-format on
RunTests(tests, arraysize(tests));
}
TEST(DesktopFrameTest, CopyIntersectingPixelsPartiallyContainedRects) {
// clang-format off
const TestData tests[] = {
{"Top left",
DesktopRect::MakeXYWH(0, 0, 2, 2),
@ -253,11 +262,13 @@ TEST(DesktopFrameTest, CopyIntersectingPixelsPartiallyContainedRects) {
1.0, 1.0,
DesktopRect::MakeXYWH(0, 1, 1, 1)}
};
// clang-format on
RunTests(tests, arraysize(tests));
}
TEST(DesktopFrameTest, CopyIntersectingPixelsPartiallyContainedRectsScaled) {
// clang-format off
const TestData tests[] = {
{"Top left 2x",
DesktopRect::MakeXYWH(0, 0, 2, 2),
@ -283,12 +294,14 @@ TEST(DesktopFrameTest, CopyIntersectingPixelsPartiallyContainedRectsScaled) {
0.5, 0.5,
DesktopRect::MakeXYWH(0, 1, 1, 1)}
};
// clang-format on
RunTests(tests, arraysize(tests));
}
TEST(DesktopFrameTest, CopyIntersectingPixelsUncontainedRects) {
// clang-format off
const TestData tests[] = {
{"Left",
DesktopRect::MakeXYWH(0, 0, 2, 2),
@ -315,11 +328,13 @@ TEST(DesktopFrameTest, CopyIntersectingPixelsUncontainedRects) {
1.0, 1.0,
DesktopRect::MakeXYWH(0, 0, 0, 0)}
};
// clang-format on
RunTests(tests, arraysize(tests));
}
TEST(DesktopFrameTest, CopyIntersectingPixelsUncontainedRectsScaled) {
// clang-format off
const TestData tests[] = {
{"Left 2x",
DesktopRect::MakeXYWH(0, 0, 2, 2),
@ -346,6 +361,7 @@ TEST(DesktopFrameTest, CopyIntersectingPixelsUncontainedRectsScaled) {
0.5, 0.5,
DesktopRect::MakeXYWH(0, 0, 0, 0)}
};
// clang-format on
RunTests(tests, arraysize(tests));
}

View File

@ -9,6 +9,7 @@
*/
#include "modules/desktop_capture/full_screen_application_handler.h"
#include "rtc_base/logging.h"
namespace webrtc {

View File

@ -9,6 +9,7 @@
*/
#include "modules/desktop_capture/full_screen_window_detector.h"
#include "modules/desktop_capture/full_screen_application_handler.h"
#include "rtc_base/time_utils.h"

View File

@ -24,12 +24,12 @@ namespace {
using xdg_portal::kScreenCastInterfaceName;
using xdg_portal::PrepareSignalHandle;
using xdg_portal::RequestResponse;
using xdg_portal::RequestResponseFromPortalResponse;
using xdg_portal::RequestSessionProxy;
using xdg_portal::SetupRequestResponseSignal;
using xdg_portal::SetupSessionRequestHandlers;
using xdg_portal::StartSessionRequest;
using xdg_portal::TearDownSession;
using xdg_portal::RequestResponseFromPortalResponse;
} // namespace

View File

@ -449,8 +449,8 @@ bool SharedScreenCastStreamPrivate::StartScreenCastStream(
PipeWireThreadLoopLock thread_loop_lock(pw_main_loop_);
if (fd >= 0) {
pw_core_ = pw_context_connect_fd(
pw_context_, fcntl(fd, F_DUPFD_CLOEXEC), nullptr, 0);
pw_core_ = pw_context_connect_fd(pw_context_, fcntl(fd, F_DUPFD_CLOEXEC),
nullptr, 0);
} else {
pw_core_ = pw_context_connect(pw_context_, nullptr, 0);
}

View File

@ -10,10 +10,10 @@
#include "modules/desktop_capture/linux/x11/x_error_trap.h"
#include <atomic>
#include <stddef.h>
#include <atomic>
#include "rtc_base/checks.h"
namespace webrtc {

View File

@ -12,6 +12,7 @@
#define MODULES_DESKTOP_CAPTURE_MAC_FULL_SCREEN_MAC_APPLICATION_HANDLER_H_
#include <memory>
#include "modules/desktop_capture/full_screen_application_handler.h"
namespace webrtc {

View File

@ -36,8 +36,7 @@ class DisplayStreamManager;
// A class to perform video frame capturing for mac.
class ScreenCapturerMac final : public DesktopCapturer {
public:
ScreenCapturerMac(
rtc::scoped_refptr<DesktopConfigurationMonitor> desktop_config_monitor,
ScreenCapturerMac(rtc::scoped_refptr<DesktopConfigurationMonitor> desktop_config_monitor,
bool detect_updated_region,
bool allow_iosurface);
~ScreenCapturerMac() override;

Some files were not shown because too many files have changed in this diff Show More