Commit Graph

25 Commits

Author SHA1 Message Date
fa8d534e09 Delay Estimator: Adds unittests for robust validation.
In addition to unittests a cast losing constness was corrected.
The tests added are:
1. Adjusting allowed_offset when robust validation is disabled should have no impact.
2. For noise free signals there should be no difference between robust validation or not.
3. Robust validation acts faster during startup.

BUG=None
TESTED=modules_unittests, trybots
R=aluebs@webrtc.org, andrew@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/6789004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@5361 4adac7df-926f-26a2-2b94-8c16560cd09d
2014-01-10 07:42:07 +00:00
bccd53de57 Delay Estimator: Converts a constant into a configurable parameter.
The parameter is used in the robust validation scheme, which will be turned on in a separate CL.

* Setter and getter for allowed delay offset.
* Updated unittests.

BUG=None
TESTED=modules_unittests, trybots
R=aluebs@webrtc.org, andrew@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/6669004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@5351 4adac7df-926f-26a2-2b94-8c16560cd09d
2014-01-08 08:18:15 +00:00
a89d17d5b7 Delay Estimator: robust_validation should be stored over a reset
BUG=None
TESTED=modules_unittests, trybots
R=aluebs@webrtc.org, andrew@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/5959004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@5337 4adac7df-926f-26a2-2b94-8c16560cd09d
2014-01-02 07:07:04 +00:00
1e7d61270c Simplification of histogram normalization in delay estimator.
- Replaces a for loop with a single element update to save complexity. No regression in performance seen on set of recordings.
- Removes UpdatesMadeUponChange() and put code straight into ProcessBinarySpectrum().

BUG=None
TESTED=module_unittest, trybots, verified manually on set of recordings.
R=aluebs@webrtc.org, andrew@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/5929004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@5298 4adac7df-926f-26a2-2b94-8c16560cd09d
2013-12-16 13:37:28 +00:00
5c64508b03 Adds robust validation functionality to the delay estimator
Evaluated over a 51 recordings:
False positives went from 4.4% to 0.7%
Missed detections unchanged at 0.8%
No increase in complexity, but need to re-evaluate that.

TESTED=trybots, unittests, verified against Matlab implementation
BUG=None
R=aluebs@webrtc.org, andrew@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/5419004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@5296 4adac7df-926f-26a2-2b94-8c16560cd09d
2013-12-16 10:57:53 +00:00
bd41a84694 This CL adds an API to enable robust validation of delay estimates.
Added is
- a member variable for turning robust validation on and off.
- API to enable/disable feature.
- API to check if enabled.
- unit tests for these APIs.

Not added is
- the actual functionality (separate CL), hence turning feature on/off has no impact currently.
- calls in AEC and AEC, where the delay estimator is used. This is also done in a separate CL when we know if it should be turned on in both components.

TESTED=trybots, module_unittest
BUG=
R=aluebs@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/4609005

git-svn-id: http://webrtc.googlecode.com/svn/trunk@5191 4adac7df-926f-26a2-2b94-8c16560cd09d
2013-11-28 14:58:35 +00:00
d1a1c353ac Recommit CL5184
TBR=aluebs@webrtc.org
BUG=

Review URL: https://webrtc-codereview.appspot.com/4599004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@5187 4adac7df-926f-26a2-2b94-8c16560cd09d
2013-11-28 11:45:05 +00:00
82eb3a690e Revert 5184 "Small refactoring change in delay_estimator."
> Small refactoring change in delay_estimator.
> 
> This CL produce the bit exact output and is a preparing step for an upcoming robust validation scheme.
> 
> TESTED=trybots, module_unittest
> BUG=None
> R=aluebs@webrtc.org
> 
> Review URL: https://webrtc-codereview.appspot.com/4549004

TBR=bjornv@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/4589004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@5185 4adac7df-926f-26a2-2b94-8c16560cd09d
2013-11-28 09:44:47 +00:00
eea079a376 Small refactoring change in delay_estimator.
This CL produce the bit exact output and is a preparing step for an upcoming robust validation scheme.

TESTED=trybots, module_unittest
BUG=None
R=aluebs@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/4549004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@5184 4adac7df-926f-26a2-2b94-8c16560cd09d
2013-11-28 07:59:04 +00:00
31628aae7e Upgrade scoped_ptr to Chromium's latest version.
Analogous to the recent libjingle change: http://cl/54929753-p10.
This supports scoped_ptr<T[]> and scoped_ptr<C, FreeDeleter> rather
than scoped_array and scoped_ptr_malloc respectively.

- Add Chromium's template-based COMPILE_ASSERT. We didn't have this
previously in order to support the macro in C. Instead, move the
existing macro to compile_assert_c.h.
- Additionally copy the move.h and template_util.h depedencies and add
the WARN_UNUSED_RESULT macro.
- Leave scoped_array and scoped_ptr_malloc for now, but mark as
deprecated.
- Remove scoped_ptr foo(NULL) use. The default constructor handles it.
- Remove the now redundant COMPILE_ASSERT from peerconnection_jni.cc.
- Add a CHECK_ARRAY_SIZE macro to rtp_format_vp8_unittest.cc to remove
some repeated code.

TESTED=trybots
R=pbos@webrtc.org, tommi@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/2449005

git-svn-id: http://webrtc.googlecode.com/svn/trunk@5015 4adac7df-926f-26a2-2b94-8c16560cd09d
2013-10-22 12:50:00 +00:00
12dc1a38ca Switch C++-style C headers with their C equivalents.
The C++ headers define the C functions within the std:: namespace, but
we mainly don't use the std:: namespace for C functions. Therefore we
should include the C headers.

BUG=1833
R=tommi@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/1917004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@4486 4adac7df-926f-26a2-2b94-8c16560cd09d
2013-08-05 16:22:53 +00:00
7fad4b8c9f Include files from webrtc/.. paths in audio_processing/
BUG=1662
R=andrew@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/1559004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@4116 4adac7df-926f-26a2-2b94-8c16560cd09d
2013-05-28 08:11:59 +00:00
04ecd49ec5 Truncated delay quality to avoid negative return values
This forces the output of last_delay_quality to the interval [0, 1] in Q14.

BUG=none
TESTED=audioproc_unittest, trybot

Review URL: https://webrtc-codereview.appspot.com/1211004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@3675 4adac7df-926f-26a2-2b94-8c16560cd09d
2013-03-18 14:15:12 +00:00
91f325586d Refactor WebRtc_CreateBuffer to return the instance.
Review URL: https://webrtc-codereview.appspot.com/1140005

git-svn-id: http://webrtc.googlecode.com/svn/trunk@3574 4adac7df-926f-26a2-2b94-8c16560cd09d
2013-02-27 00:35:06 +00:00
9ae1354e25 Refactor ring_buffer interface, add a feature and a test.
* Add a RingBuffer typedef.
* Add the ability to force a memcpy by passing a null ptr. In some cases,
  we know we want a memcpy. This allows us to skip a potential
  intermediate memcpy.
* Add a stress test.

Review URL: https://webrtc-codereview.appspot.com/1111004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@3567 4adac7df-926f-26a2-2b94-8c16560cd09d
2013-02-25 17:07:35 +00:00
7ded92b71e Re-committing r3428
TBR=ajm
BUG=None

Review URL: https://webrtc-codereview.appspot.com/1066008

git-svn-id: http://webrtc.googlecode.com/svn/trunk@3436 4adac7df-926f-26a2-2b94-8c16560cd09d
2013-01-30 16:16:59 +00:00
e12b1b562c Revert 3428
> Delay estimator wrapper API changes. This should finalize the changes to delay estimator making it work for multi-probe.
> 
> The changes are summarized here:
> 
> delay_estimator.*
> -----------------
> Replaced assert() with correct error check. This is consistent with previous versions of the delay_estimator, i.e., to check for valid parameters where they are actually used and not high up in a wrapper layer.
> 
> delay_estimator_internal.h
> --------------------------
> Pulled out the far-end part of DelayEstimator struct and put it in DelayEstimatorFarend. The only common parameter is spectrum_size, which we store in both and thereby avoiding having a Farend pointer in DelayEstimator.
> 
> delay_estimator_wrapper.*
> -------------------------
> Added and updated descriptions. From Free(), Create(), Init() the far-end parts have been put in separate Farend versions. Same goes for the Process() which now has an AddFarSpectrum() version.
> The flow of calls should be something like (in pseudo-code)
> 
> far* = CreateFarend(history_size)
> near* = Create(far, lookahead)
> InitFarend(far)
> Init(near)
> while call ongoing
>   AddFarSpectrum(far, far_spectrum)
>   Process(near, near_spectrum)
> end while
> Free(near)
> FreeFarend(far)
> 
> delay_estimator_unittest.cc
> ---------------------------
> Added farend support setting up calls as mentioned above.
> 
> aecm_core.*
> -----------
> Cleaned up some lint warnings.
> Added delay_estimator_farend pointer. Called Create(), Init() and Free() in above mentioned order.
> If AddFarSpectrumFix() was not successfully done, we end and return -1. This is what we would have done for Process().
> 
> aec_core.*
> ----------
> Cleaned up some lint warnings.
> Added delay_estimator_farend pointer. Calls in proper order. Since we only use the delay estimator for logging there is no error handling. We only call Process() if AddFarSpectrum() was successful though.
> 
> TEST=audioproc_unittest, trybots
> BUG=None
> 
> Review URL: https://webrtc-codereview.appspot.com/1076006

TBR=bjornv@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/1062008

git-svn-id: http://webrtc.googlecode.com/svn/trunk@3429 4adac7df-926f-26a2-2b94-8c16560cd09d
2013-01-29 21:30:26 +00:00
61ec7daa57 Delay estimator wrapper API changes. This should finalize the changes to delay estimator making it work for multi-probe.
The changes are summarized here:

delay_estimator.*
-----------------
Replaced assert() with correct error check. This is consistent with previous versions of the delay_estimator, i.e., to check for valid parameters where they are actually used and not high up in a wrapper layer.

delay_estimator_internal.h
--------------------------
Pulled out the far-end part of DelayEstimator struct and put it in DelayEstimatorFarend. The only common parameter is spectrum_size, which we store in both and thereby avoiding having a Farend pointer in DelayEstimator.

delay_estimator_wrapper.*
-------------------------
Added and updated descriptions. From Free(), Create(), Init() the far-end parts have been put in separate Farend versions. Same goes for the Process() which now has an AddFarSpectrum() version.
The flow of calls should be something like (in pseudo-code)

far* = CreateFarend(history_size)
near* = Create(far, lookahead)
InitFarend(far)
Init(near)
while call ongoing
  AddFarSpectrum(far, far_spectrum)
  Process(near, near_spectrum)
end while
Free(near)
FreeFarend(far)

delay_estimator_unittest.cc
---------------------------
Added farend support setting up calls as mentioned above.

aecm_core.*
-----------
Cleaned up some lint warnings.
Added delay_estimator_farend pointer. Called Create(), Init() and Free() in above mentioned order.
If AddFarSpectrumFix() was not successfully done, we end and return -1. This is what we would have done for Process().

aec_core.*
----------
Cleaned up some lint warnings.
Added delay_estimator_farend pointer. Calls in proper order. Since we only use the delay estimator for logging there is no error handling. We only call Process() if AddFarSpectrum() was successful though.

TEST=audioproc_unittest, trybots
BUG=None

Review URL: https://webrtc-codereview.appspot.com/1076006

git-svn-id: http://webrtc.googlecode.com/svn/trunk@3428 4adac7df-926f-26a2-2b94-8c16560cd09d
2013-01-29 18:55:59 +00:00
8526459a2e Added tests for multiple near-end support.
TEST=trybots, audioproc_unittest
BUG=None

Review URL: https://webrtc-codereview.appspot.com/1063007

git-svn-id: http://webrtc.googlecode.com/svn/trunk@3417 4adac7df-926f-26a2-2b94-8c16560cd09d
2013-01-25 22:33:17 +00:00
57f3a11958 Short CL: only name change.
From |handle| to |self| for consistency.

BUG=None

Review URL: https://webrtc-codereview.appspot.com/1072005

git-svn-id: http://webrtc.googlecode.com/svn/trunk@3416 4adac7df-926f-26a2-2b94-8c16560cd09d
2013-01-25 22:02:15 +00:00
94c213af1a Separated far-end handling in BinaryDelayEstimator.
This CL is one step in a larger change of the DelayEstimator where we will open up for multiple near-end signals.

This particular CL separates the low level far-end parts without affecting the usage externally. This is a first step towards separating the far-end and near-end parts giving the user the control.

BUG=None
TEST=audioproc_unittests, trybots

Review URL: https://webrtc-codereview.appspot.com/1068005

git-svn-id: http://webrtc.googlecode.com/svn/trunk@3415 4adac7df-926f-26a2-2b94-8c16560cd09d
2013-01-25 15:53:41 +00:00
bb599b7089 This CL includes part of changes in a larger one. The final goal is to allow multiple delay estimators using the same reference (far-end) to save computational complexity.
BUG=None

Review URL: https://webrtc-codereview.appspot.com/1024010

git-svn-id: http://webrtc.googlecode.com/svn/trunk@3391 4adac7df-926f-26a2-2b94-8c16560cd09d
2013-01-18 23:16:46 +00:00
a2d8b75f29 An API to get the internal estimation quality in the delay estimator has been added. Unit tests have been updated. There is no impact to other parts in WebRTC.
BUG=None

Review URL: https://webrtc-codereview.appspot.com/1036004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@3390 4adac7df-926f-26a2-2b94-8c16560cd09d
2013-01-18 21:54:15 +00:00
f3adba499e Add Android include path so that header files can follow google style
BUG=1011
TEST=bot
Review URL: https://webrtc-codereview.appspot.com/930018

git-svn-id: http://webrtc.googlecode.com/svn/trunk@3107 4adac7df-926f-26a2-2b94-8c16560cd09d
2012-11-15 18:17:40 +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