webrtc/modules/audio_coding/neteq
Jakob Ivarsson 53e41a2bc6 Ignore old, duplicate and overlapping packets in packet arrival history.
This should mostly be a noop, but in a follow up cl we will insert all
packets after splitting, which will allow for adapting the delay to FEC
(both RED and codec inband) that is useful for decoding (i.e. not
already covered by primary packets).

A slight behavior change is that reordered packets are no longer
included in max delay calculation.

Implementation details:
- A map ordered by RTP timestamp is used to store the arrivals.
- When inserting new packets, we check if the timestamp is too old, already exists or if the packet is fully covered by another packet (based on timestamp and packet duration).
- Separate deques are used to keep track of "min" and "max" arrivals (as defined by ordering operators). The queues maintain a strictly increasing/decreasing order so that min/max is always at begin().

Bug: webrtc:13322
Change-Id: I8b6cf5afff77b4adc3c29745b95627e955715b5a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/337184
Reviewed-by: Henrik Lundin <henrik.lundin@webrtc.org>
Commit-Queue: Jakob Ivarsson‎ <jakobi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41656}
2024-02-01 15:05:19 +00:00
..
g3doc Reland "Migrate WebRTC documentation to new renderer" 2023-01-31 09:30:04 +00:00
mock Ignore old, duplicate and overlapping packets in packet arrival history. 2024-02-01 15:05:19 +00:00
test Reland "Unify access to SDP codec parameters" 2024-01-03 12:03:11 +00:00
tools Add Opus FEC options to rtp_encode tool 2023-08-31 06:11:46 +00:00
accelerate.cc Format /modules 2023-04-20 02:02:45 +00:00
accelerate.h Remove RTC_DISALLOW_COPY_AND_ASSIGN from modules/ 2022-01-24 11:50:20 +00:00
audio_decoder_unittest.cc Reland "[ACM] iSAC audio codec removed" 2022-11-17 12:52:35 +00:00
audio_multi_vector.cc Format /modules 2023-04-20 02:02:45 +00:00
audio_multi_vector.h Remove RTC_DISALLOW_COPY_AND_ASSIGN from modules/ 2022-01-24 11:50:20 +00:00
audio_multi_vector_unittest.cc Fix crash when appending empty array to AudioMultiVector. 2022-09-26 14:58:55 +00:00
audio_vector.cc Format /modules 2023-04-20 02:02:45 +00:00
audio_vector.h Remove RTC_DISALLOW_COPY_AND_ASSIGN from modules/ 2022-01-24 11:50:20 +00:00
audio_vector_unittest.cc Use backticks not vertical bars to denote variables in comments for /modules/audio_coding 2021-08-02 10:45:40 +00:00
background_noise.cc Remove post-decode VAD 2024-02-01 12:37:23 +00:00
background_noise.h Remove post-decode VAD 2024-02-01 12:37:23 +00:00
background_noise_unittest.cc
buffer_level_filter.cc Format /modules 2023-04-20 02:02:45 +00:00
buffer_level_filter.h Remove RTC_DISALLOW_COPY_AND_ASSIGN from modules/ 2022-01-24 11:50:20 +00:00
buffer_level_filter_unittest.cc Use backticks not vertical bars to denote variables in comments for /modules/audio_coding 2021-08-02 10:45:40 +00:00
comfort_noise.cc Format /modules 2023-04-20 02:02:45 +00:00
comfort_noise.h Remove RTC_DISALLOW_COPY_AND_ASSIGN from modules/ 2022-01-24 11:50:20 +00:00
comfort_noise_unittest.cc Use backticks not vertical bars to denote variables in comments for /modules/audio_coding 2021-08-02 10:45:40 +00:00
cross_correlation.cc Implement a Neon optimized function to find the argmax element in an array. 2021-01-21 13:42:34 +00:00
cross_correlation.h Use backticks not vertical bars to denote variables in comments for /modules/audio_coding 2021-08-02 10:45:40 +00:00
decision_logic.cc Ignore old, duplicate and overlapping packets in packet arrival history. 2024-02-01 15:05:19 +00:00
decision_logic.h Default enable NetEq experiments. 2023-11-10 09:09:22 +00:00
decision_logic_unittest.cc Ignore old, duplicate and overlapping packets in packet arrival history. 2024-02-01 15:05:19 +00:00
decoder_database.cc Adopt absl::string_view in modules/audio_coding/ 2022-07-20 13:34:23 +00:00
decoder_database.h Adopt absl::string_view in modules/audio_coding/ 2022-07-20 13:34:23 +00:00
decoder_database_unittest.cc Move rtc::make_ref_counted to api/ 2022-06-15 09:47:38 +00:00
default_neteq_factory.cc Clean up the NetEqFactory API. 2019-11-29 14:04:44 +00:00
default_neteq_factory.h Clean up the NetEqFactory API. 2019-11-29 14:04:44 +00:00
delay_manager.cc Implement RTCInboundRTPStreamStats.JitterBufferMinimumDelay 2022-07-20 09:14:03 +00:00
delay_manager.h Implement RTCInboundRTPStreamStats.JitterBufferMinimumDelay 2022-07-20 09:14:03 +00:00
delay_manager_unittest.cc Use packet arrival history in delay manager. 2022-05-25 20:03:31 +00:00
dsp_helper.cc Prepare to rename RTC_NOTREACHED to RTC_DCHECK_NOTREACHED 2021-11-15 21:44:59 +00:00
dsp_helper.h Remove RTC_DISALLOW_COPY_AND_ASSIGN from modules/ 2022-01-24 11:50:20 +00:00
dsp_helper_unittest.cc Use backticks not vertical bars to denote variables in comments for /modules/audio_coding 2021-08-02 10:45:40 +00:00
dtmf_buffer.cc Use backticks not vertical bars to denote variables in comments for /modules/audio_coding 2021-08-02 10:45:40 +00:00
dtmf_buffer.h Remove RTC_DISALLOW_COPY_AND_ASSIGN from modules/ 2022-01-24 11:50:20 +00:00
dtmf_buffer_unittest.cc Use backticks not vertical bars to denote variables in comments for /modules/audio_coding 2021-08-02 10:45:40 +00:00
dtmf_tone_generator.cc Prepare to rename RTC_NOTREACHED to RTC_DCHECK_NOTREACHED 2021-11-15 21:44:59 +00:00
dtmf_tone_generator.h Remove RTC_DISALLOW_COPY_AND_ASSIGN from modules/ 2022-01-24 11:50:20 +00:00
dtmf_tone_generator_unittest.cc Remove simple stringstream usages. 2018-09-06 12:53:19 +00:00
expand.cc Use backticks not vertical bars to denote variables in comments for /modules/audio_coding 2021-08-02 10:45:40 +00:00
expand.h Format /modules 2023-04-20 02:02:45 +00:00
expand_uma_logger.cc Adopt absl::string_view in modules/audio_coding/ 2022-07-20 13:34:23 +00:00
expand_uma_logger.h Adopt absl::string_view in modules/audio_coding/ 2022-07-20 13:34:23 +00:00
expand_unittest.cc Fix -Wunused-but-set-variable. 2021-10-28 12:53:49 +00:00
histogram.cc Format /modules 2023-04-20 02:02:45 +00:00
histogram.h Improve adaptation to reordered packets in delay manager. 2021-09-08 16:41:27 +00:00
histogram_unittest.cc Remove inter-arrival delay mode from DelayManager. 2020-01-08 13:20:36 +00:00
merge.cc Prepare to rename RTC_NOTREACHED to RTC_DCHECK_NOTREACHED 2021-11-15 21:44:59 +00:00
merge.h Remove RTC_DISALLOW_COPY_AND_ASSIGN from modules/ 2022-01-24 11:50:20 +00:00
merge_unittest.cc Fixing a buffer overflow in Merge::Downsample 2019-11-25 12:16:30 +00:00
nack_tracker.cc Remove decoded timestamp extrapolation from NackTracker. 2023-03-28 12:33:42 +00:00
nack_tracker.h Remove decoded timestamp extrapolation from NackTracker. 2023-03-28 12:33:42 +00:00
nack_tracker_unittest.cc Remove decoded timestamp extrapolation from NackTracker. 2023-03-28 12:33:42 +00:00
neteq_decoder_plc_unittest.cc Revert "Unifying the handling of the events in NetEqInput." 2023-03-29 08:01:46 +00:00
neteq_impl.cc Remove post-decode VAD 2024-02-01 12:37:23 +00:00
neteq_impl.h Remove post-decode VAD 2024-02-01 12:37:23 +00:00
neteq_impl_unittest.cc Refactor NetEq insert packet list. 2023-11-29 09:53:21 +00:00
neteq_network_stats_unittest.cc Default enable NetEq experiments. 2023-11-10 09:09:22 +00:00
neteq_stereo_unittest.cc NetEq: Fix bug in PLC for multi-channel audio 2019-12-02 17:44:58 +00:00
neteq_unittest.cc Default enable NetEq experiments. 2023-11-10 09:09:22 +00:00
neteq_unittest.proto Delete unused NetEq stats currentPacketLossRate, currentDiscardRate and addedSamples 2020-09-21 12:19:16 +00:00
normal.cc LSC: Apply clang-tidy's modernize-use-bool-literals 2022-01-24 20:42:01 +00:00
normal.h Remove RTC_DISALLOW_COPY_AND_ASSIGN from modules/ 2022-01-24 11:50:20 +00:00
normal_unittest.cc Use backticks not vertical bars to denote variables in comments for /modules/audio_coding 2021-08-02 10:45:40 +00:00
packet.cc Reland "Reland "Add plumbing of RtpPacketInfos to each AudioFrame as input for SourceTracker."" 2019-07-24 16:47:13 +00:00
packet.h Make packet info optional and only set for primary packets in NetEq. 2023-06-07 18:17:03 +00:00
packet_arrival_history.cc Ignore old, duplicate and overlapping packets in packet arrival history. 2024-02-01 15:05:19 +00:00
packet_arrival_history.h Ignore old, duplicate and overlapping packets in packet arrival history. 2024-02-01 15:05:19 +00:00
packet_arrival_history_unittest.cc Ignore old, duplicate and overlapping packets in packet arrival history. 2024-02-01 15:05:19 +00:00
packet_buffer.cc Refactor NetEq insert packet list. 2023-11-29 09:53:21 +00:00
packet_buffer.h Refactor NetEq insert packet list. 2023-11-29 09:53:21 +00:00
packet_buffer_unittest.cc Refactor NetEq insert packet list. 2023-11-29 09:53:21 +00:00
preemptive_expand.cc Use backticks not vertical bars to denote variables in comments for /modules/audio_coding 2021-08-02 10:45:40 +00:00
preemptive_expand.h Remove RTC_DISALLOW_COPY_AND_ASSIGN from modules/ 2022-01-24 11:50:20 +00:00
random_vector.cc Reformat the WebRTC code base 2018-06-19 14:00:39 +00:00
random_vector.h Remove RTC_DISALLOW_COPY_AND_ASSIGN from modules/ 2022-01-24 11:50:20 +00:00
random_vector_unittest.cc
red_payload_splitter.cc Make packet info optional and only set for primary packets in NetEq. 2023-06-07 18:17:03 +00:00
red_payload_splitter.h Remove RTC_DISALLOW_COPY_AND_ASSIGN from modules/ 2022-01-24 11:50:20 +00:00
red_payload_splitter_unittest.cc Format /modules 2023-04-20 02:02:45 +00:00
reorder_optimizer.cc Improve adaptation to reordered packets in delay manager. 2021-09-08 16:41:27 +00:00
reorder_optimizer.h Improve adaptation to reordered packets in delay manager. 2021-09-08 16:41:27 +00:00
reorder_optimizer_unittest.cc Improve adaptation to reordered packets in delay manager. 2021-09-08 16:41:27 +00:00
statistics_calculator.cc Add delayed packet outage event metric. 2023-04-26 13:40:17 +00:00
statistics_calculator.h Adopt absl::string_view in modules/audio_coding/ 2022-07-20 13:34:23 +00:00
statistics_calculator_unittest.cc Rename discarded_primary_packets to packets_discarded. 2022-05-31 13:24:24 +00:00
sync_buffer.cc Prepare to rename RTC_NOTREACHED to RTC_DCHECK_NOTREACHED 2021-11-15 21:44:59 +00:00
sync_buffer.h Remove RTC_DISALLOW_COPY_AND_ASSIGN from modules/ 2022-01-24 11:50:20 +00:00
sync_buffer_unittest.cc Use backticks not vertical bars to denote variables in comments for /modules/audio_coding 2021-08-02 10:45:40 +00:00
time_stretch.cc Use backticks not vertical bars to denote variables in comments for /modules/audio_coding 2021-08-02 10:45:40 +00:00
time_stretch.h Remove RTC_DISALLOW_COPY_AND_ASSIGN from modules/ 2022-01-24 11:50:20 +00:00
time_stretch_unittest.cc Format almost everything. 2019-07-08 13:45:15 +00:00
timestamp_scaler.cc Use backticks not vertical bars to denote variables in comments for /modules/audio_coding 2021-08-02 10:45:40 +00:00
timestamp_scaler.h Remove RTC_DISALLOW_COPY_AND_ASSIGN from modules/ 2022-01-24 11:50:20 +00:00
timestamp_scaler_unittest.cc Update modules/ to not use implicit conversion from scoped_refptr<T> to T*. 2022-04-21 14:23:24 +00:00
underrun_optimizer.cc Reland "Remove legacy delay manger field trial and update default config." 2021-11-09 14:49:56 +00:00
underrun_optimizer.h Refactor delay manager. 2021-09-07 13:45:47 +00:00
underrun_optimizer_unittest.cc Refactor delay manager. 2021-09-07 13:45:47 +00:00