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 #ifdef WEBRTC_CODEC_ILBC
"ilbc", "ilbc",
#endif #endif
"pcmu", "pcmu", "pcma", "l16", "G722", "G711",
"pcma",
"l16",
"G722",
"G711",
}; };
for (auto codec : codecs) { for (auto codec : codecs) {

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -33,6 +33,6 @@ int16_t WebRtcIlbcfix_Chebyshev(
/* (o) Result of C(x) */ /* (o) Result of C(x) */
int16_t x, /* (i) Value to the Chevyshev polynomial */ int16_t x, /* (i) Value to the Chevyshev polynomial */
int16_t* f /* (i) The coefficients in the polynomial */ int16_t* f /* (i) The coefficients in the polynomial */
); );
#endif #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 bLen, /* (i) length of buffer */
size_t sRange, /* (i) correlation search length */ size_t sRange, /* (i) correlation search length */
int16_t scale /* (i) number of rightshifts to use */ int16_t scale /* (i) number of rightshifts to use */
); );
#endif #endif

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -30,6 +30,6 @@ void WebRtcIlbcfix_Lsp2Lsf(
int16_t* lsf, /* (o) Lsf vector 0...Pi in Q13 int16_t* lsf, /* (o) Lsf vector 0...Pi in Q13
(ordered, so that lsf[i]<lsf[i+1]) */ (ordered, so that lsf[i]<lsf[i+1]) */
int16_t m /* (i) Number of coefficients */ int16_t m /* (i) Number of coefficients */
); );
#endif #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 */ size_t dim1, /* (i) dimension first seq1 */
const int16_t* seq2, /* (i) second sequence */ const int16_t* seq2, /* (i) second sequence */
size_t dim2 /* (i) dimension seq2 */ size_t dim2 /* (i) dimension seq2 */
); );
#endif #endif

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -11,7 +11,6 @@
#include "modules/audio_coding/codecs/opus/opus_interface.h" #include "modules/audio_coding/codecs/opus/opus_interface.h"
#include <cstdlib> #include <cstdlib>
#include <numeric> #include <numeric>
#include "api/array_view.h" #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 kMaxNumSamples = 48 * 10 * 2; // 10 ms @ 48 kHz stereo.
static const size_t kRedLastHeaderLength = static const size_t kRedLastHeaderLength =
1; // 1 byte RED header for the last element. 1; // 1 byte RED header for the last element.
} } // namespace
class AudioEncoderCopyRedTest : public ::testing::Test { class AudioEncoderCopyRedTest : public ::testing::Test {
protected: protected:

View file

@ -10,7 +10,6 @@
#include "modules/audio_coding/neteq/accelerate.h" #include "modules/audio_coding/neteq/accelerate.h"
#include "api/array_view.h" #include "api/array_view.h"
#include "modules/audio_coding/neteq/audio_multi_vector.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 "modules/audio_coding/neteq/audio_multi_vector.h"
#include <algorithm> #include <algorithm>
#include "rtc_base/checks.h" #include "rtc_base/checks.h"

View file

@ -10,7 +10,6 @@
#include "modules/audio_coding/neteq/audio_vector.h" #include "modules/audio_coding/neteq/audio_vector.h"
#include <algorithm> #include <algorithm>
#include <memory> #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. // `level_factor_` and `filtered_current_level_` are in Q8.
// `buffer_size_samples` is in Q0. // `buffer_size_samples` is in Q0.
const int64_t filtered_current_level = 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); (256 - level_factor_) * rtc::dchecked_cast<int64_t>(buffer_size_samples);
// Account for time-scale operations (accelerate and pre-emptive expand) and // 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 "modules/audio_coding/neteq/comfort_noise.h"
#include <cstdint> #include <cstdint>
#include <memory> #include <memory>

View file

@ -11,7 +11,6 @@
#ifndef MODULES_AUDIO_CODING_NETEQ_EXPAND_H_ #ifndef MODULES_AUDIO_CODING_NETEQ_EXPAND_H_
#define MODULES_AUDIO_CODING_NETEQ_EXPAND_H_ #define MODULES_AUDIO_CODING_NETEQ_EXPAND_H_
#include <memory> #include <memory>
#include "modules/audio_coding/neteq/audio_vector.h" #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); EXPECT_EQ(-1, stats.max_waiting_time_ms);
} }
TEST_F(NetEqDecodingTest, LongCngWithNegativeClockDrift) { TEST_F(NetEqDecodingTest, LongCngWithNegativeClockDrift) {
// Apply a clock drift of -25 ms / s (sender faster than receiver). // Apply a clock drift of -25 ms / s (sender faster than receiver).
const double kDriftFactor = 1000.0 / (1000.0 + 25.0); 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 "modules/audio_coding/neteq/red_payload_splitter.h"
#include <memory> #include <memory>
#include <utility> // pair #include <utility> // pair

View file

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

View file

@ -80,8 +80,7 @@ std::unique_ptr<Packet> RtpFileSource::NextPacket() {
} }
RtpFileSource::RtpFileSource(absl::optional<uint32_t> ssrc_filter) RtpFileSource::RtpFileSource(absl::optional<uint32_t> ssrc_filter)
: PacketSource(), : PacketSource(), ssrc_filter_(ssrc_filter) {}
ssrc_filter_(ssrc_filter) {}
bool RtpFileSource::OpenFile(absl::string_view file_name) { bool RtpFileSource::OpenFile(absl::string_view file_name) {
rtp_reader_.reset(RtpFileReader::Create(RtpFileReader::kRtpDump, 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" #include "modules/audio_coding/neteq/tools/rtp_generator.h"
namespace webrtc { namespace webrtc {
namespace test { namespace test {

View file

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

View file

@ -29,12 +29,11 @@
#include "modules/audio_device/win/audio_device_core_win.h" #include "modules/audio_device/win/audio_device_core_win.h"
// clang-format on // clang-format on
#include <string.h>
#include <comdef.h> #include <comdef.h>
#include <dmo.h> #include <dmo.h>
#include <functiondiscoverykeys_devpkey.h> #include <functiondiscoverykeys_devpkey.h>
#include <mmsystem.h> #include <mmsystem.h>
#include <string.h>
#include <strsafe.h> #include <strsafe.h>
#include <uuids.h> #include <uuids.h>
#include <windows.h> #include <windows.h>
@ -3256,8 +3255,9 @@ DWORD AudioDeviceWindowsCore::DoCaptureThread() {
QueryPerformanceCounter(&t1); QueryPerformanceCounter(&t1);
// Get the current recording and playout delay. // Get the current recording and playout delay.
uint32_t sndCardRecDelay = (uint32_t)( uint32_t sndCardRecDelay =
((((UINT64)t1.QuadPart * _perfCounterFactor) - recTime) / 10000) + (uint32_t)(((((UINT64)t1.QuadPart * _perfCounterFactor) - recTime) /
10000) +
(10 * syncBufIndex) / _recBlockSize - 10); (10 * syncBufIndex) / _recBlockSize - 10);
uint32_t sndCardPlayDelay = static_cast<uint32_t>(_sndCardPlayDelay); 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 #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 #include <wmcodecdsp.h> // CLSID_CWMAudioAEC
// (must be before audioclient.h) //(must be before audioclient.h)
#include <audioclient.h> // WASAPI #include <audioclient.h> // WASAPI
#include <audiopolicy.h> #include <audiopolicy.h>
#include <avrt.h> // Avrt #include <avrt.h> // Avrt
@ -27,8 +24,10 @@
#include <mmdeviceapi.h> // MMDevice #include <mmdeviceapi.h> // MMDevice
#include "api/scoped_refptr.h" #include "api/scoped_refptr.h"
#include "modules/audio_device/audio_device_generic.h"
#include "rtc_base/synchronization/mutex.h" #include "rtc_base/synchronization/mutex.h"
#include "rtc_base/win/scoped_com_initializer.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 // Use Multimedia Class Scheduler Service (MMCSS) to boost the thread priority
#pragma comment(lib, "avrt.lib") #pragma comment(lib, "avrt.lib")

View file

@ -9,6 +9,7 @@
*/ */
#include "modules/audio_device/win/core_audio_utility_win.h" #include "modules/audio_device/win/core_audio_utility_win.h"
#include "rtc_base/arraysize.h" #include "rtc_base/arraysize.h"
#include "rtc_base/logging.h" #include "rtc_base/logging.h"
#include "rtc_base/win/scoped_com_initializer.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. * 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 <immintrin.h>
#include "modules/audio_processing/aec3/adaptive_fir_filter.h"
#include "rtc_base/checks.h" #include "rtc_base/checks.h"
namespace webrtc { namespace webrtc {

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -123,7 +123,6 @@ const int16_t WebRtcAecm_kSinTable[] = {
-2667, -2531, -2395, -2258, -2120, -1981, -1842, -1703, -1563, -1422, -1281, -2667, -2531, -2395, -2258, -2120, -1981, -1842, -1703, -1563, -1422, -1281,
-1140, -998, -856, -713, -571, -428, -285, -142}; -1140, -998, -856, -713, -571, -428, -285, -142};
// Moves the pointer to the next entry and inserts `far_spectrum` and // Moves the pointer to the next entry and inserts `far_spectrum` and
// corresponding Q-domain in its buffer. // 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); int16_t scaled_time_signal = time_signal[i] * (1 << time_signal_scaling);
fft[i] = (int16_t)((scaled_time_signal * WebRtcAecm_kSqrtHanning[i]) >> 14); fft[i] = (int16_t)((scaled_time_signal * WebRtcAecm_kSqrtHanning[i]) >> 14);
scaled_time_signal = time_signal[i + PART_LEN] * (1 << time_signal_scaling); scaled_time_signal = time_signal[i + PART_LEN] * (1 << time_signal_scaling);
fft[PART_LEN + i] = (int16_t)( fft[PART_LEN + i] = (int16_t)((scaled_time_signal *
(scaled_time_signal * WebRtcAecm_kSqrtHanning[PART_LEN - i]) >> 14); WebRtcAecm_kSqrtHanning[PART_LEN - i]) >>
14);
} }
// Do forward FFT, then take only the first PART_LEN complex samples, // 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 // multiply with Wiener coefficients
efw[i].real = (int16_t)( efw[i].real = (int16_t)(WEBRTC_SPL_MUL_16_16_RSFT_WITH_ROUND(dfw[i].real,
WEBRTC_SPL_MUL_16_16_RSFT_WITH_ROUND(dfw[i].real, hnl[i], 14)); hnl[i], 14));
efw[i].imag = (int16_t)( efw[i].imag = (int16_t)(WEBRTC_SPL_MUL_16_16_RSFT_WITH_ROUND(dfw[i].imag,
WEBRTC_SPL_MUL_16_16_RSFT_WITH_ROUND(dfw[i].imag, hnl[i], 14)); hnl[i], 14));
} }
} else { } else {
// multiply with Wiener coefficients // multiply with Wiener coefficients
for (i = 0; i < PART_LEN1; i++) { for (i = 0; i < PART_LEN1; i++) {
efw[i].real = (int16_t)( efw[i].real = (int16_t)(WEBRTC_SPL_MUL_16_16_RSFT_WITH_ROUND(dfw[i].real,
WEBRTC_SPL_MUL_16_16_RSFT_WITH_ROUND(dfw[i].real, hnl[i], 14)); hnl[i], 14));
efw[i].imag = (int16_t)( efw[i].imag = (int16_t)(WEBRTC_SPL_MUL_16_16_RSFT_WITH_ROUND(dfw[i].imag,
WEBRTC_SPL_MUL_16_16_RSFT_WITH_ROUND(dfw[i].imag, hnl[i], 14)); hnl[i], 14));
} }
} }

View file

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

View file

@ -11,7 +11,6 @@
#ifndef MODULES_AUDIO_PROCESSING_AGC_LEGACY_ANALOG_AGC_H_ #ifndef MODULES_AUDIO_PROCESSING_AGC_LEGACY_ANALOG_AGC_H_
#define 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/digital_agc.h"
#include "modules/audio_processing/agc/legacy/gain_control.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. * 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 <algorithm>
#include <numeric> #include <numeric>
#include "modules/audio_processing/agc2/rnn_vad/rnn_fc.h"
#include "rtc_base/checks.h" #include "rtc_base/checks.h"
#include "rtc_base/numerics/safe_conversions.h" #include "rtc_base/numerics/safe_conversions.h"
#include "third_party/rnnoise/src/rnn_activations.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. * 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 <immintrin.h>
#include "api/array_view.h" #include "api/array_view.h"
#include "modules/audio_processing/agc2/rnn_vad/vector_math.h"
#include "rtc_base/checks.h" #include "rtc_base/checks.h"
#include "rtc_base/numerics/safe_conversions.h" #include "rtc_base/numerics/safe_conversions.h"

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -85,7 +85,6 @@ bool InFlightBytesTracker::NetworkRouteComparator::operator()(
TransportFeedbackAdapter::TransportFeedbackAdapter() = default; TransportFeedbackAdapter::TransportFeedbackAdapter() = default;
void TransportFeedbackAdapter::AddPacket(const RtpPacketSendInfo& packet_info, void TransportFeedbackAdapter::AddPacket(const RtpPacketSendInfo& packet_info,
size_t overhead_bytes, size_t overhead_bytes,
Timestamp creation_time) { Timestamp creation_time) {
@ -213,13 +212,13 @@ TransportFeedbackAdapter::ProcessTransportFeedbackInner(
size_t failed_lookups = 0; size_t failed_lookups = 0;
size_t ignored = 0; size_t ignored = 0;
feedback.ForAllPackets([&](uint16_t sequence_number, feedback.ForAllPackets(
TimeDelta delta_since_base) { [&](uint16_t sequence_number, TimeDelta delta_since_base) {
int64_t seq_num = seq_num_unwrapper_.Unwrap(sequence_number); int64_t seq_num = seq_num_unwrapper_.Unwrap(sequence_number);
if (seq_num > last_ack_seq_num_) { if (seq_num > last_ack_seq_num_) {
// Starts at history_.begin() if last_ack_seq_num_ < 0, since any valid // Starts at history_.begin() if last_ack_seq_num_ < 0, since any
// sequence number is >= 0. // valid sequence number is >= 0.
for (auto it = history_.upper_bound(last_ack_seq_num_); for (auto it = history_.upper_bound(last_ack_seq_num_);
it != history_.upper_bound(seq_num); ++it) { it != history_.upper_bound(seq_num); ++it) {
in_flight_.RemoveInFlightPacketBytes(it->second); in_flight_.RemoveInFlightPacketBytes(it->second);
@ -244,9 +243,10 @@ TransportFeedbackAdapter::ProcessTransportFeedbackInner(
PacketFeedback packet_feedback = it->second; PacketFeedback packet_feedback = it->second;
if (delta_since_base.IsFinite()) { if (delta_since_base.IsFinite()) {
packet_feedback.receive_time = packet_feedback.receive_time =
current_offset_ + delta_since_base.RoundDownTo(TimeDelta::Millis(1)); current_offset_ +
// Note: Lost packets are not removed from history because they might be delta_since_base.RoundDownTo(TimeDelta::Millis(1));
// reported as received by a later feedback. // Note: Lost packets are not removed from history because they might
// be reported as received by a later feedback.
history_.erase(it); history_.erase(it);
} }
if (packet_feedback.network_route == network_route_) { 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. * be found in the AUTHORS file in the root of the source tree.
*/ */
#include "modules/congestion_controller/rtp/transport_feedback_demuxer.h" #include "modules/congestion_controller/rtp/transport_feedback_demuxer.h"
#include "absl/algorithm/container.h" #include "absl/algorithm/container.h"
#include "modules/rtp_rtcp/source/rtcp_packet/transport_feedback.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 dest_frame = CreateTestFrame(test.dest_frame_rect, 0);
auto src_frame = CreateTestFrame(test.src_frame_rect, 0xff); auto src_frame = CreateTestFrame(test.src_frame_rect, 0xff);
dest_frame->CopyIntersectingPixelsFrom( dest_frame->CopyIntersectingPixelsFrom(*src_frame, test.horizontal_scale,
*src_frame, test.horizontal_scale, test.vertical_scale); test.vertical_scale);
// Translate the expected overlap rect to be relative to the dest frame/rect. // Translate the expected overlap rect to be relative to the dest frame/rect.
DesktopVector dest_frame_origin = test.dest_frame_rect.top_left(); DesktopVector dest_frame_origin = test.dest_frame_rect.top_left();
@ -105,6 +105,7 @@ TEST(DesktopFrameTest, FrameDataSwitchesBetweenNonBlackAndBlack) {
} }
TEST(DesktopFrameTest, CopyIntersectingPixelsMatchingRects) { TEST(DesktopFrameTest, CopyIntersectingPixelsMatchingRects) {
// clang-format off
const TestData tests[] = { const TestData tests[] = {
{"0 origin", {"0 origin",
DesktopRect::MakeXYWH(0, 0, 2, 2), DesktopRect::MakeXYWH(0, 0, 2, 2),
@ -118,6 +119,7 @@ TEST(DesktopFrameTest, CopyIntersectingPixelsMatchingRects) {
1.0, 1.0, 1.0, 1.0,
DesktopRect::MakeXYWH(-1, -1, 2, 2)} DesktopRect::MakeXYWH(-1, -1, 2, 2)}
}; };
// clang-format on
RunTests(tests, arraysize(tests)); RunTests(tests, arraysize(tests));
} }
@ -125,6 +127,7 @@ TEST(DesktopFrameTest, CopyIntersectingPixelsMatchingRects) {
TEST(DesktopFrameTest, CopyIntersectingPixelsMatchingRectsScaled) { TEST(DesktopFrameTest, CopyIntersectingPixelsMatchingRectsScaled) {
// The scale factors shouldn't affect matching rects (they're only applied // The scale factors shouldn't affect matching rects (they're only applied
// to any difference between the origins) // to any difference between the origins)
// clang-format off
const TestData tests[] = { const TestData tests[] = {
{"0 origin 2x", {"0 origin 2x",
DesktopRect::MakeXYWH(0, 0, 2, 2), DesktopRect::MakeXYWH(0, 0, 2, 2),
@ -150,11 +153,13 @@ TEST(DesktopFrameTest, CopyIntersectingPixelsMatchingRectsScaled) {
0.5, 0.5, 0.5, 0.5,
DesktopRect::MakeXYWH(-1, -1, 2, 2)} DesktopRect::MakeXYWH(-1, -1, 2, 2)}
}; };
// clang-format on
RunTests(tests, arraysize(tests)); RunTests(tests, arraysize(tests));
} }
TEST(DesktopFrameTest, CopyIntersectingPixelsFullyContainedRects) { TEST(DesktopFrameTest, CopyIntersectingPixelsFullyContainedRects) {
// clang-format off
const TestData tests[] = { const TestData tests[] = {
{"0 origin top left", {"0 origin top left",
DesktopRect::MakeXYWH(0, 0, 2, 2), DesktopRect::MakeXYWH(0, 0, 2, 2),
@ -174,11 +179,13 @@ TEST(DesktopFrameTest, CopyIntersectingPixelsFullyContainedRects) {
1.0, 1.0, 1.0, 1.0,
DesktopRect::MakeXYWH(-1, 0, 1, 1)} DesktopRect::MakeXYWH(-1, 0, 1, 1)}
}; };
// clang-format on
RunTests(tests, arraysize(tests)); RunTests(tests, arraysize(tests));
} }
TEST(DesktopFrameTest, CopyIntersectingPixelsFullyContainedRectsScaled) { TEST(DesktopFrameTest, CopyIntersectingPixelsFullyContainedRectsScaled) {
// clang-format off
const TestData tests[] = { const TestData tests[] = {
{"0 origin top left 2x", {"0 origin top left 2x",
DesktopRect::MakeXYWH(0, 0, 2, 2), DesktopRect::MakeXYWH(0, 0, 2, 2),
@ -222,12 +229,14 @@ TEST(DesktopFrameTest, CopyIntersectingPixelsFullyContainedRectsScaled) {
0.5, 0.5, 0.5, 0.5,
DesktopRect::MakeXYWH(-1, -1, 1, 1)} DesktopRect::MakeXYWH(-1, -1, 1, 1)}
}; };
// clang-format on
RunTests(tests, arraysize(tests)); RunTests(tests, arraysize(tests));
} }
TEST(DesktopFrameTest, CopyIntersectingPixelsPartiallyContainedRects) { TEST(DesktopFrameTest, CopyIntersectingPixelsPartiallyContainedRects) {
// clang-format off
const TestData tests[] = { const TestData tests[] = {
{"Top left", {"Top left",
DesktopRect::MakeXYWH(0, 0, 2, 2), DesktopRect::MakeXYWH(0, 0, 2, 2),
@ -253,11 +262,13 @@ TEST(DesktopFrameTest, CopyIntersectingPixelsPartiallyContainedRects) {
1.0, 1.0, 1.0, 1.0,
DesktopRect::MakeXYWH(0, 1, 1, 1)} DesktopRect::MakeXYWH(0, 1, 1, 1)}
}; };
// clang-format on
RunTests(tests, arraysize(tests)); RunTests(tests, arraysize(tests));
} }
TEST(DesktopFrameTest, CopyIntersectingPixelsPartiallyContainedRectsScaled) { TEST(DesktopFrameTest, CopyIntersectingPixelsPartiallyContainedRectsScaled) {
// clang-format off
const TestData tests[] = { const TestData tests[] = {
{"Top left 2x", {"Top left 2x",
DesktopRect::MakeXYWH(0, 0, 2, 2), DesktopRect::MakeXYWH(0, 0, 2, 2),
@ -283,12 +294,14 @@ TEST(DesktopFrameTest, CopyIntersectingPixelsPartiallyContainedRectsScaled) {
0.5, 0.5, 0.5, 0.5,
DesktopRect::MakeXYWH(0, 1, 1, 1)} DesktopRect::MakeXYWH(0, 1, 1, 1)}
}; };
// clang-format on
RunTests(tests, arraysize(tests)); RunTests(tests, arraysize(tests));
} }
TEST(DesktopFrameTest, CopyIntersectingPixelsUncontainedRects) { TEST(DesktopFrameTest, CopyIntersectingPixelsUncontainedRects) {
// clang-format off
const TestData tests[] = { const TestData tests[] = {
{"Left", {"Left",
DesktopRect::MakeXYWH(0, 0, 2, 2), DesktopRect::MakeXYWH(0, 0, 2, 2),
@ -315,11 +328,13 @@ TEST(DesktopFrameTest, CopyIntersectingPixelsUncontainedRects) {
1.0, 1.0, 1.0, 1.0,
DesktopRect::MakeXYWH(0, 0, 0, 0)} DesktopRect::MakeXYWH(0, 0, 0, 0)}
}; };
// clang-format on
RunTests(tests, arraysize(tests)); RunTests(tests, arraysize(tests));
} }
TEST(DesktopFrameTest, CopyIntersectingPixelsUncontainedRectsScaled) { TEST(DesktopFrameTest, CopyIntersectingPixelsUncontainedRectsScaled) {
// clang-format off
const TestData tests[] = { const TestData tests[] = {
{"Left 2x", {"Left 2x",
DesktopRect::MakeXYWH(0, 0, 2, 2), DesktopRect::MakeXYWH(0, 0, 2, 2),
@ -346,6 +361,7 @@ TEST(DesktopFrameTest, CopyIntersectingPixelsUncontainedRectsScaled) {
0.5, 0.5, 0.5, 0.5,
DesktopRect::MakeXYWH(0, 0, 0, 0)} DesktopRect::MakeXYWH(0, 0, 0, 0)}
}; };
// clang-format on
RunTests(tests, arraysize(tests)); RunTests(tests, arraysize(tests));
} }

View file

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

View file

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

View file

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

View file

@ -449,8 +449,8 @@ bool SharedScreenCastStreamPrivate::StartScreenCastStream(
PipeWireThreadLoopLock thread_loop_lock(pw_main_loop_); PipeWireThreadLoopLock thread_loop_lock(pw_main_loop_);
if (fd >= 0) { if (fd >= 0) {
pw_core_ = pw_context_connect_fd( pw_core_ = pw_context_connect_fd(pw_context_, fcntl(fd, F_DUPFD_CLOEXEC),
pw_context_, fcntl(fd, F_DUPFD_CLOEXEC), nullptr, 0); nullptr, 0);
} else { } else {
pw_core_ = pw_context_connect(pw_context_, nullptr, 0); 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 "modules/desktop_capture/linux/x11/x_error_trap.h"
#include <atomic>
#include <stddef.h> #include <stddef.h>
#include <atomic>
#include "rtc_base/checks.h" #include "rtc_base/checks.h"
namespace webrtc { namespace webrtc {

View file

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

View file

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

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