728d9037c0
Reformat existing code. There should be no functional effects.
...
This includes changes like:
* Attempt to break lines at better positions
* Use "override" in more places, don't use "virtual" with it
* Use {} where the body is more than one line
* Make declaration and definition arg names match
* Eliminate unused code
* EXPECT_EQ(expected, actual) (but use (actual, expected) for e.g. _GT)
* Correct #include order
* Use anonymous namespaces in preference to "static" for file-scoping
* Eliminate unnecessary casts
* Update reference code in comments of ARM assembly sources to match actual current C code
* Fix indenting to be more style-guide compliant
* Use arraysize() in more places
* Use bool instead of int for "boolean" values (0/1)
* Shorten and simplify code
* Spaces around operators
* 80 column limit
* Use const more consistently
* Space goes after '*' in type name, not before
* Remove unnecessary return values
* Use "(var == const)", not "(const == var)"
* Spelling
* Prefer true, typed constants to "enum hack" constants
* Avoid "virtual" on non-overridden functions
* ASSERT(x == y) -> ASSERT_EQ(y, x)
BUG=none
R=andrew@webrtc.org , asapersson@webrtc.org , henrika@webrtc.org , juberti@webrtc.org , kjellander@webrtc.org , kwiberg@webrtc.org
Review URL: https://codereview.webrtc.org/1172163004
Cr-Commit-Position: refs/heads/master@{#9420}
2015-06-11 21:31:48 +00:00
bc46bf22e7
common_audio: Explicit cast in WebRtcSpl_NormW16 on ARM
...
We currently hit asserts in AECM where the output of WebRtcSpl_NormW16() on armv7 is incorrect.
I've verified that it outputs -17 for negative values. Internally that means that clz returns 0 after a two's complement operation on a int16_t.
There is a mismatch between the int16_t input and otherwise 32 bit assumptions. Explicitly casting to int32_t makes the two's complement do the correct thing.
The CL also extends the unit tests by running through a larger set of values.
BUG=4486
TESTED=locally on Android Nexus 7 and trybots
R=aluebs@webrtc.org , kwiberg@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/49549004
Cr-Commit-Position: refs/heads/master@{#8897}
2015-03-30 21:38:36 +00:00
88a4298234
common_audio: Made input vector const in WebRtcSpl_LevinsonDurbin()
...
In addition, expanded the unit test to verify both unstable and stable filters.
BUG=3353, 1132
TESTED=locally on Mac and trybots
R=kwiberg@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/35599004
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8038 4adac7df-926f-26a2-2b94-8c16560cd09d
2015-01-12 05:53:43 +00:00
f567095f62
common_audio: Removed macro WEBRTC_SPL_RSHIFT_W32
...
Replaces the trivial macro WEBRTC_SPL_RSHIFT_W32 with >> at various places in common_audio and removes it.
BUG=3348,3353
TESTED=locally on linux and trybots
R=kwiberg@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/26989004
git-svn-id: http://webrtc.googlecode.com/svn/trunk@7558 4adac7df-926f-26a2-2b94-8c16560cd09d
2014-10-29 10:29:16 +00:00
67ca26e087
common_audio: Removed trivial macro WEBRTC_SPL_UMUL_16_16
...
The macro made a cast to uint16_t before a plain multiplication. At the few places where it was used the variables were already uint16_t.
Affected components:
* isac/fix
BUG=3348,3353
TESTED=locally on linux and trybots
R=henrik.lundin@webrtc.org , kwiberg@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/29869004
git-svn-id: http://webrtc.googlecode.com/svn/trunk@7543 4adac7df-926f-26a2-2b94-8c16560cd09d
2014-10-28 13:03:10 +00:00
fab5439112
common_audio: Removed version API from signal_processing
...
The Signal Processing version API is not used anymore.
BUG=3353
R=kwiberg@webrtc.org , tina.legrand@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/31679004
git-svn-id: http://webrtc.googlecode.com/svn/trunk@7451 4adac7df-926f-26a2-2b94-8c16560cd09d
2014-10-15 04:38:42 +00:00
bc1a4578e0
common_audio: Removed macro WEBRTC_SPL_RSHIFT_W16
...
Replaced the trivial right shift macro at remaining 4 places and removed from signal_processing.
Affected components:
* vad
* aecm
BUG=3348,3353
TESTED=locally on linux and trybots
R=kwiberg@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/25849004
git-svn-id: http://webrtc.googlecode.com/svn/trunk@7434 4adac7df-926f-26a2-2b94-8c16560cd09d
2014-10-13 14:00:43 +00:00
3ea35fdb1b
common_audio: Removed macro WEBRTC_SPL_LSHIFT_W16
...
The macro was a trivial << operation and where used has been replaced by <<. Affected components are
* ilbc
* isacfix
BUG=3348,3353
TESTED=locally on linux and trybots
R=henrik.lundin@webrtc.org , kwiberg@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/22919005
git-svn-id: http://webrtc.googlecode.com/svn/trunk@7404 4adac7df-926f-26a2-2b94-8c16560cd09d
2014-10-09 08:47:02 +00:00
7c15510f38
common_audio refactoring: Removed macro WEBRTC_SPL_LSHIFT_U32
...
The macro is a trivial shift operator including a cast before shift. There is no guard against negative shifts. Replaced with << at place and added casts when necessary.
Affects both fixed and float point versions of iSAC
BUG=3348,3353
TESTED=locally on linux and trybots
R=kwiberg@webrtc.org , tina.legrand@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/27369004
git-svn-id: http://webrtc.googlecode.com/svn/trunk@7320 4adac7df-926f-26a2-2b94-8c16560cd09d
2014-09-29 09:40:38 +00:00
3cbd6c26c8
Fix MSVC warnings about value truncations, webrtc/common_audio/ edition.
...
This changes some method signatures to better reflect how callers are actually
using them. This also has the tendency to make signatures more consistent about
e.g. using int (instead of int16_t) for lengths of things like vectors, and
using int16_t (instead of int) for e.g. counts of bits in a value.
This also removes a couple of functions that were only called in unittests.
BUG=3353,chromium:81439
TEST=none
R=andrew@webrtc.org , bjornv@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/23389004
git-svn-id: http://webrtc.googlecode.com/svn/trunk@7060 4adac7df-926f-26a2-2b94-8c16560cd09d
2014-09-04 13:21:44 +00:00
df9fef6638
common_audio: Removed macro WEBRTC_SPL_DIV
...
The macro has no built-in divide by zero check. The only thing that is done is casting to int32_t.
In addition a bug was discovered where it was supposed to do a division with rounding, but instead did a division with truncation + addition by 2. This is corrected in this CL.
BUG=3348,3353
TESTED=locally on Linux
R=kwiberg@webrtc.org , tina.legrand@webrtc.org , turaj@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/19129004
git-svn-id: http://webrtc.googlecode.com/svn/trunk@6998 4adac7df-926f-26a2-2b94-8c16560cd09d
2014-08-28 12:57:32 +00:00
4f71e22bf9
Refactoring common_audio/signal_processing: Remove macro WEBRTC_SPL_UDIV
...
This macro is a direct use of the division operator without checking for division by zero. Hence, it is dangerous to use.
This CL replaces the macro with '/' at place.
BUG=3348,3353
TESTED=locally on linux and trybots
R=kwiberg@webrtc.org , tina.legrand@webrtc.org , turaj@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/14169004
git-svn-id: http://webrtc.googlecode.com/svn/trunk@6976 4adac7df-926f-26a2-2b94-8c16560cd09d
2014-08-26 10:25:10 +00:00
926707b167
Refactoring common_audio: Replace trivial multiplication macro
...
This multiplication macro literally use the '*' operator, so there is no need for it.
BUG=3348,3353
TESTED=locally on linux and trybots
R=kwiberg@webrtc.org , tina.legrand@webrtc.org , turaj@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/22109004
git-svn-id: http://webrtc.googlecode.com/svn/trunk@6964 4adac7df-926f-26a2-2b94-8c16560cd09d
2014-08-25 11:42:42 +00:00
d32c4389ac
Re-landing r6961
...
common_audio/signal_processing: Remove macro WEBRTC_SPL_MEMCPY_W8
This macro is nothing but memcpy() and further used at one single place in webrtc, so it makes no sense to keep it. Replaced the operation where it is used.
BUG=3348,3353
TESTED=locally on linux
TBR=aluebs@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/18259004
git-svn-id: http://webrtc.googlecode.com/svn/trunk@6963 4adac7df-926f-26a2-2b94-8c16560cd09d
2014-08-25 11:19:05 +00:00
4a616be12b
Revert 6961 "common_audio/signal_processing: Remove macro WEBRTC..."
...
> common_audio/signal_processing: Remove macro WEBRTC_SPL_MEMCPY_W8
>
> This macro is nothing but memcpy() and further used at one single place in webrtc, so it makes no sense to keep it. Replaced the operation where it is used.
>
> BUG=3348,3353
> TESTED=locally on linux and trybots
> R=kwiberg@webrtc.org , tina.legrand@webrtc.org
>
> Review URL: https://webrtc-codereview.appspot.com/16359004
TBR=bjornv@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/22499004
git-svn-id: http://webrtc.googlecode.com/svn/trunk@6962 4adac7df-926f-26a2-2b94-8c16560cd09d
2014-08-25 10:32:22 +00:00
4f01017e2d
common_audio/signal_processing: Remove macro WEBRTC_SPL_MEMCPY_W8
...
This macro is nothing but memcpy() and further used at one single place in webrtc, so it makes no sense to keep it. Replaced the operation where it is used.
BUG=3348,3353
TESTED=locally on linux and trybots
R=kwiberg@webrtc.org , tina.legrand@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/16359004
git-svn-id: http://webrtc.googlecode.com/svn/trunk@6961 4adac7df-926f-26a2-2b94-8c16560cd09d
2014-08-25 10:23:22 +00:00
6e71d17bc9
Refactoring common_audio/signal_processing: Replaces trivial macros
...
The macros WEBRTC_SPL_ADD_SAT_W16 and WEBRTC_SPL_ADD_SAT_W32 make direct use of the corresponding functions WebRtcSpl_AddSatW16() and WebRtcSpl_AddSatW32().
This CL replaces these macros in the code.
BUG=3348,3353
TESTED=locally on linux and trybots
R=kwiberg@webrtc.org , tina.legrand@webrtc.org , turaj@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/21199004
git-svn-id: http://webrtc.googlecode.com/svn/trunk@6960 4adac7df-926f-26a2-2b94-8c16560cd09d
2014-08-25 07:44:52 +00:00
b5ab52d010
common_audio/signal_processing: Remove unused macros WEBRTC_SPL_GET_BYTE and WEBRTC_SPL_SET_BYTE
...
These two macros are not used anywhere in webrtc. Previously used in old neteq (I think).
BUG=3348,3353
TESTED=manually on linux and trybots
R=tina.legrand@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/18149004
git-svn-id: http://webrtc.googlecode.com/svn/trunk@6916 4adac7df-926f-26a2-2b94-8c16560cd09d
2014-08-18 12:01:02 +00:00
1e3ef4b999
common_audio/signal_processing: Remove macro WEBRTC_SPL_UMUL_32_16_RSFT16
...
Macros should in general be avoided. WEBRTC_SPL_UMUL_32_16_RSFT16 is only used in iSAC fixed point as part of multiplying with LSB and MSB. A better approach is to have one function for that complete operation in iSAC.
This CL removes the macro and replace the operation locally.
BUG=3148, 3353
TESTED=locally on Linux and trybots
R=tina.legrand@webrtc.org , turaj@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/16349004
git-svn-id: http://webrtc.googlecode.com/svn/trunk@6907 4adac7df-926f-26a2-2b94-8c16560cd09d
2014-08-15 05:17:20 +00:00
8434dbe284
common_audio/signal_processing: Remove macro WEBRTC_SPL_SUB_SAT_W32
...
This macro is literally using the function WebRtcSpl_SubSatW32(), hence there is no need for a macro.
BUG=3348, 3353
TESTED=locally on Linux and trybots
R=tina.legrand@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/14149004
git-svn-id: http://webrtc.googlecode.com/svn/trunk@6899 4adac7df-926f-26a2-2b94-8c16560cd09d
2014-08-14 07:26:28 +00:00
0a3cbb3906
common_audio/signal_processing: Removes macro WEBRTC_SPL_MUL_32_32_RSFT32
...
The macro is only used at four places in iSAC fixed point and the macro have been replaced at those places.
In addition, it is used in a unit test, but throws a warning treated as error (issue3674).
The macro has both MIPS and armv7 optimizations. Removing them impacts only MIPS platforms without DSP ASE. This may cause a very small increase in complexity when using iSAC fix.
The armv7 optimizations are not used anywhere, since specific ones are used inline in iSAC fix.
BUG=3348,3353,3674
TESTED=locally and trybots
R=ljubomir.papuga@gmail.com , tina.legrand@webrtc.org , turaj@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/16299004
git-svn-id: http://webrtc.googlecode.com/svn/trunk@6871 4adac7df-926f-26a2-2b94-8c16560cd09d
2014-08-12 10:54:50 +00:00
cf8f33a6d6
Removes mismatching signs in signal_processing_unittests
...
Negative inputs was used in WebRtcSpl_NormU32() causing warnings.
BUG=3674
TESTED=locally and trybots
R=tina.legrand@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/17089004
git-svn-id: http://webrtc.googlecode.com/svn/trunk@6870 4adac7df-926f-26a2-2b94-8c16560cd09d
2014-08-12 10:27:21 +00:00
6ac22e6b47
Remove more dependencies on openssl, add dependency on boringssl. Continues on r6798
...
R=andrew@webrtc.org , fbarchard@chromium.org , kjellander@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/14029004
git-svn-id: http://webrtc.googlecode.com/svn/trunk@6867 4adac7df-926f-26a2-2b94-8c16560cd09d
2014-08-11 21:06:30 +00:00
c0ba4392f1
common_audio: Removes macro WEBRTC_SPL_SHIFT_W16
...
We should avoid macros in general (see style guide). This shift macro is not a severe one, since there is a check for negativity.
BUG=3348,3353
TESTED=trybots and manually
R=kwiberg@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/15799004
git-svn-id: http://webrtc.googlecode.com/svn/trunk@6591 4adac7df-926f-26a2-2b94-8c16560cd09d
2014-07-03 13:38:53 +00:00
721f970cba
common_audio: Removes macro WEBRTC_SPL_LSHIFT_U16
...
We should avoid macros in general (see style guide) and the shift ones are particular dangerous since they assume that the user apply a non-negative shift.
Related CL: https://webrtc-codereview.appspot.com/16669004
BUG=3348,3353
TESTED=trybots and manually on linux
R=turaj@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/19719004
git-svn-id: http://webrtc.googlecode.com/svn/trunk@6444 4adac7df-926f-26a2-2b94-8c16560cd09d
2014-06-16 10:30:14 +00:00
18026abd82
common_audio/signal_processing: Removes macro WEBRTC_SPL_RSHIFT_U16
...
This macro is only used at a few places and implies a cast to uint16_t before right shifting. All places already use uint16_t. Further, the amount of shifts applied in the macro has no sanity check for negativity, makes the macro dangerous to use.
BUG=3348,3353
TESTED=trybots and manually
R=kwiberg@webrtc.org , tina.legrand@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/16669004
git-svn-id: http://webrtc.googlecode.com/svn/trunk@6393 4adac7df-926f-26a2-2b94-8c16560cd09d
2014-06-11 06:53:20 +00:00
782978cfcb
common_audio/signal_processing: Moves WEBRTC_SPL_UMUL_16_16_RSFT16 to iSAC fix
...
This macro is only used by the fixed point version of iSAC. Replacing the (five) locations in arith_routines_logist.c, where it is used, with the actual operation.
BUG=3348,3353
TESTED=trybots and manually
R=kwiberg@webrtc.org , tina.legrand@webrtc.org , turaj@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/14659004
git-svn-id: http://webrtc.googlecode.com/svn/trunk@6392 4adac7df-926f-26a2-2b94-8c16560cd09d
2014-06-11 06:39:03 +00:00
edbe886a0b
common_audio/signal_processing: Removed macro WEBRTC_SPL_MUL_16_16_RSFT_WITH_FIXROUND
...
This macro was only used at two places in fixed point iSAC, where it has been replaced with the operation.
BUG=3348,3353
TESTED=trybots
R=tina.legrand@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/15669004
git-svn-id: http://webrtc.googlecode.com/svn/trunk@6336 4adac7df-926f-26a2-2b94-8c16560cd09d
2014-06-05 08:42:53 +00:00
a3b5673879
common_audio/signal_processing: Removes macro WEBRTC_SPL_UMUL_RSFT16
...
This macro was only used on two lines in iSACfix and I replaced those with the operations the macro performed.
BUG=3348
TESTED=trybots, manual unittests
R=tina.legrand@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/14529004
git-svn-id: http://webrtc.googlecode.com/svn/trunk@6184 4adac7df-926f-26a2-2b94-8c16560cd09d
2014-05-16 12:11:20 +00:00
1b21a57902
common_audio/signal_processing: Removed macro WEBRTC_SPL_SUB_SAT_W16
...
Macro was only mapping a function used in one place.
BUG=3348
TESTED=trybots, unittests
R=tina.legrand@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/17499004
git-svn-id: http://webrtc.googlecode.com/svn/trunk@6180 4adac7df-926f-26a2-2b94-8c16560cd09d
2014-05-16 06:40:31 +00:00
d83d607271
common_audio/signal_processing: Removed macro WEBRTC_SPL_MAX_SEED_USED
...
* Moved the macro to randomization_functions and made it static const.
* Made WebRtc_IncreaseSeed() static, since it is not used outside this function.
* Style guide changes.
BUG=3348,3353
TESTED=trybots, common_audio_unittests, modules_unittests, modules_tests
R=tina.legrand@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/21459004
git-svn-id: http://webrtc.googlecode.com/svn/trunk@6179 4adac7df-926f-26a2-2b94-8c16560cd09d
2014-05-16 06:38:47 +00:00
1aae6bf735
common_audio: Removes unused macros
...
* WEBRTC_SPL_MUL_32_32_RSFT32BI
* WEBRTC_SPL_IS_NEG
BUG=3348
TESTED=trybots, common_audio_unittests
R=tina.legrand@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/18449004
git-svn-id: http://webrtc.googlecode.com/svn/trunk@6169 4adac7df-926f-26a2-2b94-8c16560cd09d
2014-05-15 07:22:53 +00:00
8bf755d5c5
MIPS optimizations for the functions WebRtcSpl_SqrtFloor, WebRtcSpl_CrossCorrelation, WebRtcSpl_ScaleAndAddVectorsWithRound and the inline functions from signal_processing spl_inl.h file.
...
R=andrew@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/1791004
Patch from Ljubomir Papuga <lpapuga@mips.com >.
git-svn-id: http://webrtc.googlecode.com/svn/trunk@4779 4adac7df-926f-26a2-2b94-8c16560cd09d
2013-09-18 17:40:46 +00:00
aa30bb7ef5
Include files from webrtc/.. paths in common_audio/
...
BUG=1662
R=tina.legrand@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/1535005
git-svn-id: http://webrtc.googlecode.com/svn/trunk@4107 4adac7df-926f-26a2-2b94-8c16560cd09d
2013-05-27 09:49:58 +00:00
b09130763b
WebRtc_Word32 -> int32_t in common_audio/
...
BUG=314
Review URL: https://webrtc-codereview.appspot.com/1299004
git-svn-id: http://webrtc.googlecode.com/svn/trunk@3803 4adac7df-926f-26a2-2b94-8c16560cd09d
2013-04-09 16:40:28 +00:00
53a8be20f1
Wraparound distortion in Opus
...
This CL solves the wraparound distortion in Opus.
In the Opus decoder-wrapper we are downsampling the signal from 48 kHz to 32 kHz. This is done in two steps, using the following functions from the signal processing library:
WebRtcSpl_Resample48khzTo32khz() and WebRtcSpl_VectorBitShiftW32ToW16
The latter does not have a saturation check, and the signal can suffer from wraparound. I've added saturation control to the function.
BUG=issue1089
Review URL: https://webrtc-codereview.appspot.com/967004
git-svn-id: http://webrtc.googlecode.com/svn/trunk@3103 4adac7df-926f-26a2-2b94-8c16560cd09d
2012-11-15 08:34:38 +00:00
14b43beb7c
Move src/ -> webrtc/
...
TBR=niklas.enbom@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/915006
git-svn-id: http://webrtc.googlecode.com/svn/trunk@2963 4adac7df-926f-26a2-2b94-8c16560cd09d
2012-10-22 18:19:23 +00:00