Richard Fuchs
244d41e025
MT#56782 pass codec format to selection function
...
Makes it possible to select the codec parameters based on the input
format.
Change-Id: I6e468b74bdfdbdb7c0283987bdf8a525fbfb446e
2 years ago
Richard Fuchs
f40e3c0653
MT#56782 pass format to format answer
...
Make it possible to make our fmtp= answer string based on the input
audio format.
Change-Id: I042561c3d4e7056624e1fd9ad2a20d6ddf116da2
2 years ago
Richard Fuchs
a5f73d72de
MT#55447 fix passing wrong pointer to callback
...
`evs_parse_format_cb` expects `union codec_format_options` as `data`
pointer, not `struct rtp_codec_format`
Change-Id: Ia0ac2acad352331d3a056f67b94afcc4dcab2a80
2 years ago
Richard Fuchs
adad19fb4f
MT#55447 SIMD implementation for float conversion
...
Benchmarks vs the native C implementation:
C: 123.790894 s
AVX2: 1.567766 s
AVX512: 0.897813 s
Change-Id: Ieeeb7ce3bb2d59dbd3a057ce07e0b35c9f9c73e9
2 years ago
Richard Fuchs
be7e810469
MT#55283 fix typo
...
Output samples as signed ints.
Change-Id: If7c5b08eeb95850aa96cfb3df3fef4802fe18060
2 years ago
Richard Fuchs
4009d58f3c
MT#55283 don't crash on packet underflows
...
If the expected buffer to hold a packet was determined incorrectly, log
a warning instead of throwing an assertion.
closes #1591
Change-Id: I4169378a27b27fed51e453e6d2da8014259c659e
2 years ago
Richard Fuchs
38b0351d03
MT#55283 add minimum_ptime codec attribute
...
Prevent a wrongly advertised (too small) a=ptime from producing too
small buffers to hold encoded packets by flagging codecs with a fixed or
minimum frame size as such.
This is relevant to libavcodec only as the code determines the expected
frame size from the clock rate and the ptime.
closes #1591
Change-Id: I9f5c56d45f2aad56951b19d846ddbfa4b7bd7e7d
2 years ago
Richard Fuchs
edeb41d6f1
MT#56008 decoder-selected clock rates and channels
...
Change-Id: Iff944a945c1365c895887cfe1d48cbff43e18880
2 years ago
Richard Fuchs
47ba87b61f
MT#56008 allow Opus single-channel encoding
...
Change-Id: I4a4ed845bb1740ab7b6dee4611e156cfdf97ecf4
2 years ago
Richard Fuchs
256533630f
MT#56008 extend encoder format selection
...
This makes it possible to also select things like number of channels.
Change-Id: Ib79ec5ff9b6bbbc4029524fd2bda952c4502bfb4
2 years ago
Richard Fuchs
40a1741fc1
MT#54294 mandate "const" codec_def_t
...
This type is used as const everywhere except internally, so make it part
of the typedef for brevity.
Change-Id: Ic4afe037b392239a991d5380c6708903011da29e
2 years ago
Richard Fuchs
8737d194b1
MT#56008 support encoder-selected clock rate for EVS
...
Change-Id: I391b5f42713fe8e9cfe9db9a7ee149ec4da56f8e
2 years ago
Richard Fuchs
ee941cd564
MT#56008 add EVS mode clamping function
...
Change-Id: I0514bc58f90198ceca0809217fbaaf16feb47922
2 years ago
Richard Fuchs
0448e12e0d
MT#56008 use hashed string lookup in codeclib.c
...
Change-Id: I627ac72aa994dea4b52bd3b8b9e8d587bb4c0127
2 years ago
Richard Fuchs
52dd8320a5
MT#56008 support different Opus "applications"
...
Also change the default Opus application to "VoIP"
Change-Id: Ied52380989f0abf4ee54246cf657edc4ca50232f
2 years ago
Richard Fuchs
bb2316db1a
MT#56008 use libopus directly
...
Instead of going through ffmpeg to en/decode Opus, use libopus directly,
which allows us to benefit from additional features that aren't
available when going through ffmpeg.
Change-Id: I017c276cfa9755cefe95c8da26691446b718d4c8
2 years ago
Richard Fuchs
9c54e97a88
MT#56008 support encoded-selected clock rates
...
Some codecs (e.g. Opus) can natively encode audio with various clock
rates without producing an output that is locked to that clock rate and
without requiring resampling the input. Add an appropriate callback
function and adapt tests.
Change-Id: Id788c4d4c05e20f93cce7e910f9f265b381cbe34
2 years ago
Richard Fuchs
e7b9ab2825
MT#56008 fix G.722 ptime/multiplier confusion
...
G.722 uses 4 bits per sample, not 8. This error was negated by the ptime
incorrectly being adjusted by the clock rate multiplier.
Change-Id: I125c897ee9cbdac29278be9b6451d82b48ff94c2
2 years ago
Richard Fuchs
0114728f47
MT#56008 support variable clock rate factors
...
This makes it possible to have codecs running at variable clock rates
that differ from their RTP clock rates.
Change-Id: Ia2f5effb82eefe8c3028573ba0a6697da28473b1
2 years ago
Richard Fuchs
f976f21d49
MT#56008 switch to fractional clock rate factor
...
Instead of just having an integer multiplier, support a fractional
factor. This allows us to have the RTP clock rate run faster than the
audio clock rate, and not just slower by an integer factor.
Change-Id: I7681cf369c43d8424ca2d2ebeffe932595d271ec
2 years ago
Richard Fuchs
dc1a44f3ec
MT#55447 add support for EVS
...
Change-Id: I54993cefbb3d30a4dc87b13507dd0d61739baaa0
2 years ago
Richard Fuchs
114a2b6b66
MT#55447 support parsing and matching AMR a=fmtp
...
Change-Id: I691d76f2bf71b845e4f31ad0c068e54aeb1ac882
3 years ago
Richard Fuchs
f82e0aebda
MT#55447 introduce proper a=fmtp parsing
...
Parsing out the a=fmtp string has been left up to the codec init
function until now, with the values that resulted from the parsing being
stored only within the codec. Convert this to an explicit method to
parse the a=fmtp string, and introduce a dedicated struct to store the
resulting values.
Functionally this change is a no-op.
Change-Id: Ia84e26d632ed5209b4439fd82c1e4e38850fd024
3 years ago
Richard Fuchs
a65954bbbb
MT#55447 refactor encoder callback struct
...
Use a single dedicated struct to hold data used as callback from decoder
to encoder.
Change-Id: I747cd495bc98a33629d0acd77909023f8f0e89ff
3 years ago
Richard Fuchs
0558cfbc05
TT#178400 collect and report RTP sequencing metrics
...
Change-Id: I037b1dff876eece1d3c8d4eda715587f294c1cd6
3 years ago
Richard Fuchs
206ea9efd5
TT#14008 update for ffmpeg 5.1+
...
Starting with release 5.1, ffmpeg obsoletes the `channels` and
`channel_layout` fields, replacing them with a unified `ch_layout`
struct of type AVChannelLayout. Add wrapper defines into the
compile-time build-test headers fix_frame_channel_layout*.h to
accommodate both new and old versions.
Change-Id: I3d43b85dc3140155a61b1cf2269cda166ad88e9a
3 years ago
Richard Fuchs
e683b813e5
TT#14008 fix possible AMR decoder mem leak
...
closes #1512
Change-Id: I7cd5605adbcc340b5e73d7d3daf5f8f70d8b6931
3 years ago
Richard Fuchs
08701819da
TT#185100 support setting opus encoding complexity
...
Change-Id: I8c1b9c93df2f2de5d8e4e282f3e728d8163aa4b5
3 years ago
Richard Fuchs
343bde8a0e
TT#185100 update int type to bool
...
Change-Id: I7b2169d66c24fa75e1dfae8b53b8d7e0e5c23c98
3 years ago
Richard Fuchs
626defa4b5
TT#14008 eliminate compiler warning
...
AVCodec * has been decorated with "const" in newer versions of ffmpeg.
Change-Id: I999f1aba761a5687067a603d76b93b07e5ec91a3
3 years ago
Richard Fuchs
97e8c1d990
TT#109800 fix mismatched CN generator format
...
Upsample output of DTX CN generator to match the format of the parent
codec.
Change-Id: Ic2de29a6b711a5258af25e8ec98decaf218d2ada
3 years ago
Richard Fuchs
1bc15de746
TT#14008 prevent possible NULL dereference
...
closes #1434
Change-Id: I21fa86b0410f86cd6d77951cff75c5eb03da38e9
3 years ago
Richard Fuchs
3582b623a9
TT#136957 DTMF delay support
...
Change-Id: I62dce272a1acc0a9a3b6b8c37df68a18357dbee4
3 years ago
Richard Fuchs
9da5a46fcb
TT#136956 support DTMF-security=random
...
Change-Id: I4100c1511be743901d302491238872990f213118
3 years ago
Richard Fuchs
320642ddf2
TT#136956 support DTMF-security=tone
...
Change-Id: Ide898f68d788f39674b8fdb4f4edb0aa14e0884b
3 years ago
Richard Fuchs
a1a0b03ab9
TT#136956 refactor DTMF frequency generator code
...
Change-Id: Ibcecc6dd04971e575747e3609f01858435351d92
3 years ago
Richard Fuchs
3a63929ca1
TT#91151 ignore Opus format for comparison purposes
...
This is a stub until a proper format comparison can be added, for at
least Opus and AMR
Change-Id: Ib25f79b492f227c78dd59a4d00220d17b15a40c7
4 years ago
Richard Fuchs
413798e43f
TT#132251 implement media silencing
...
Change-Id: I0902bd72e2733b96ff75bcf52856a58c51a750f6
4 years ago
Richard Fuchs
6e160da497
TT#14008 move avpkt alloc to encoder_new
...
If encoder_config errors out for some reason, avpkt may end up
uninitialised. Make sure there is an avpkt when flushing/closing the
encoder. Also make the encoder input more resilient against
half-initialised encoders for the same reason.
closes #1312
Change-Id: I44ebcf6e35f1c383aa5c8202b5d9bbf968b0d5f1
4 years ago
Richard Fuchs
1d387b98ef
TT#112700 rework codec offer/answer routine
...
Complete overhaul of the codec handling code:
*) obsolete flags `asymmetric codecs`, `symmetric codecs`, `reorder
codecs`
*) support proper codec offer/answer
*) split codec manipulation (strip/offer/accept/etc) into separate
functions for clarity and better code maintenance
*) fully update codec handlers in both directions after an answer
*) explicit allocation and handling of codecs and payload types in a
codec_store object
*) improve codec matchup logic during answer
*) more explicit handling of supplemental codecs (CN/DTMF)
*) remove now obsolete hacks for handling certain use cases
Change-Id: I996705ba8fe339524c2f70e6bb0fd854f9a1f4fb
4 years ago
Nathanaël Semhoun
c76b0b7ef6
Fix G729 packet duration
...
Without this correction, timestamp is not incremented in case of transcoding
4 years ago
Richard Fuchs
b110072ae4
TT#14008 deprecate av_init_packet
...
Recent ffmpeg versions have removed AVPacket from the public ABI,
therefore deprecating av_init_packet on statically allocated objects.
The replacement is av_packet_alloc()/av_packet_free().
Change-Id: I5f93fbd19e43413c3328e143cc9147fbdf12d910
4 years ago
Richard Fuchs
b734fc080e
TT#14008 fix integer handling (overflow/sign) issues
...
Warned-by: coverity
Change-Id: Ia473075046253b2ffcf65344f65469772e6df993
4 years ago
Richard Fuchs
c7431aa846
TT#122401 disable sample filter for CN resampler
...
Change-Id: I42085cc7952d86f2da1efa2d29ea85321b001da4
4 years ago
Richard Fuchs
d4fbec39d1
TT#122401 return ptime from decoded packets for DTX
...
Change-Id: I382b842406fbee73ec752f6f4f0832736222ef52
4 years ago
Richard Fuchs
64670ffb61
TT#122401 add option to bypass AMR SID
...
Change-Id: I0504d452737573f388941dcca507e3adfd5744c6
4 years ago
Richard Fuchs
ec68dfeb31
TT#122401 add configurable CN method
...
Change-Id: I2aa9901b2a9dcf64563a84d77fa40d23b6c25525
4 years ago
Richard Fuchs
7e24a7e4c8
TT#122401 add CN DTX method
...
Change-Id: I03c977e10f9bdad284dbafb048b2a19d798957e5
4 years ago
Richard Fuchs
dc38a0e88e
TT#122401 support multiple DTX method per codec
...
Change-Id: I775d56e675255b3dca4227779d1146d8c8806f06
4 years ago
Richard Fuchs
11988524ab
TT#122401 add generic silence DTX generator
...
Change-Id: I673c1115b6678842d7d49febea3c4ecbb67f534a
4 years ago
Richard Fuchs
5d5098efde
TT#122401 keep track of decoder's output format
...
Change-Id: Ib55ba9787b07885cfc9544f93749710ce8cafc91
4 years ago
Richard Fuchs
da06ed217b
TT#122401 add ptime to DTX trigger
...
Change-Id: I96aabff398cbe296243d8bdf7499468c6da96352
4 years ago
Richard Fuchs
7c3982ea11
TT#122401 rename "lost packet" functions to DTX
...
Change-Id: Ie39ff68eb0be8bf77f1b6c213df837c08fc869b7
4 years ago
Richard Fuchs
b1409e58e1
TT#122401 correct ptime handling for negative values
...
Change-Id: I3ca96971ec20aa02deb80d2d9613bbaa33c3ae05
4 years ago
Guillem Jover
adbd071c14
TT#111150 Do not use old-style declarations
...
Change-Id: I08a702ebfbcc5d3ac1dca284abdaa3f6567b9272
Warned-by: gcc -Wold-style-declaration
4 years ago
Guillem Jover
07695d2abb
TT#111150 Use modern <stdint.h> uint<bits>_t types
...
The u_int<bits>_t are BSD legacy types, while the new ones are specified
by C99 and SUSv3.
Change-Id: Ia748cabc33a7e5adc2c7a6049ad1e55be0c788a8
4 years ago
Richard Fuchs
d5d0a3a994
TT#111150 convert str.len to size_t
...
This makes the type in line with string(3) functions and eliminates some
compiler warnings.
Also update the related bencode data type.
Change-Id: I7ef4024f4b5a0f737b3dbe03bcd078032395bce6
4 years ago
Guillem Jover
648e74fd39
TT#108003 Handle unsigned wrap around in amr_encoder_mode_change()
...
We only do 1 decrements/increments so the check for the upper-bound will
always catch any downward wrap-around or an upward out-of-bound.
Change-Id: Ibdb9a69e1a55f34ffca56721c310efc505b86f99
Warned-by: coverity
4 years ago
Richard Fuchs
a6a18233de
TT#102450 fix some timestamping issues
...
Make sure G.722 rate multiplies is applied in the right places
Don't trust encoders to return proper timestamps, but instead track them
explicitly based on frame duration
Change-Id: Ia9fa96cf662da97159fa170c3a3f37516889e1bd
4 years ago
Richard Fuchs
25d90cea0d
TT#98901 keep track of head PTS in packetiser
...
Change-Id: I3439318037da535701f84b070b107ae19ca3e261
4 years ago
Richard Fuchs
ade5c47b02
TT#98901 wire up codeclib debug output
...
Change-Id: I5daf59fe8218c2ff25d4baac79ba802f101d6279
4 years ago
Richard Fuchs
30733ec5cd
TT#97301 support granular log levels
...
Change-Id: Ife458bd2449f61113a3e6db1708821570d92dc23
4 years ago
Richard Fuchs
c5667e3bf7
TT#100200 add CN decoder
...
Change-Id: Ic4ff122745569e3892f1a95fedb36ce9d2495349
4 years ago
Richard Fuchs
bae79d3fef
TT#98901 handle AMR SID DTX
...
Change-Id: I418c43e0cef2a70143010235988523f195a3bf5a
5 years ago
Richard Fuchs
c3ebbc4b43
TT#98901 add decoder_packet_lost() and callbacks
...
Change-Id: I782b79ac02238ae7bc52bf05ced4318aa14d6164
5 years ago
Richard Fuchs
ee74914b22
TT#92250 ignore format parameters for DTMF codec
...
closes #1098
Change-Id: I180667a7c5fa9da8a95d99826cb3fc4006598976
5 years ago
Richard Fuchs
2ce7b6476e
TT#92250 better handle supplemental codecs
...
Change-Id: Id6bac3892642d6ae58c71a1781b5d282c48a3a1c
5 years ago
Richard Fuchs
0222936981
TT#91003 handle NO_DATA frames from AMR encoder
...
Change-Id: I437ae1a8b2ee440a12caccf8cfae486b90aa00c3
5 years ago
Richard Fuchs
c89208bf68
TT#91003 skip empty keys in key=value list
...
Change-Id: I148295796d23a3a48d5fe06bce690c96a2137f4c
5 years ago
Richard Fuchs
cd5cd8483b
TT#91003 add `mode-change-interval` AMR option
...
Change-Id: I08d54cf5c17c1d1d66218cdb9c06aa5ac9bb6837
5 years ago
Richard Fuchs
1020bcb80d
TT#91003 honour AMR mode change restrictions
...
Change-Id: I632f27c7068f3b7f6f3648992fcc6e5b5d65a29a
5 years ago
Richard Fuchs
ed9de316c7
TT#91003 support sending CMR
...
Change-Id: Ief485087b36ce61c80f9d004e77113b31298b250
5 years ago
Richard Fuchs
c239035057
TT#91003 abstractise ffmpeg av_opt setting
...
Change-Id: I9de54c7c64b771bafccc8e4ffd638c4cbd1314d5
5 years ago
Richard Fuchs
0918ea2c84
TT#91003 abstractise fmtp key-value parsing
...
Change-Id: Icf5a0d68e1c3d669c395e36c3a0a57b15301e30a
5 years ago
Richard Fuchs
48d4dc3f7b
TT#91003 support passing extra codec options
...
Change-Id: I8e994f69d4ffc21ab5ab6e8c269e266cb1635b79
5 years ago
Richard Fuchs
6fc9459016
TT#91003 handle AMR CMR
...
Change-Id: I9fdb58359c25b3fcedf25872c98ac8ff582fa488
5 years ago
Richard Fuchs
23b1aaea10
TT#91003 support AMR mode-set option
...
Change-Id: I9926e940d7e77d869b2ebdd975417745d42ec1fd
5 years ago
Richard Fuchs
f48929fe68
TT#91003 fix AMR fmtp parsing
...
Change-Id: I0259292f7150a639b79dae4ce11c54ff5a5d6ee8
5 years ago
Richard Fuchs
829e9cb3a1
TT#91003 use preferred AMR codecs
...
Change-Id: Ib5146cec9fbd0e86a72306ad13c519ab05d3d92b
5 years ago
Richard Fuchs
055ac56cc0
TT#91003 use separate encoder and decoder names
...
Change-Id: Ibfb3f7dccf7cb0057784545100c9e5cf961f2378
5 years ago
Stefan Mititelu
8ba5d162dd
Fix Valgrind "still reachable" for a few others
...
log, ice, media_player, jitter_buffer,
statistics, codeclib, call_interfaces
5 years ago
Richard Fuchs
35899ec27b
TT#78900 move codec_get_type into global context
...
Change-Id: I12868ecca93ff6e3ffe7129c42aec415ad5f58ec
5 years ago
Richard Fuchs
d872802ba2
TT#76711 T.38 <> audio gateway
...
Change-Id: I4552e07eee632fa730745410b08c3bf70ab67ab2
5 years ago
Richard Fuchs
51147da508
explicitly advertise annexb=no for G.729
...
closes #936
Change-Id: I087b0e82d49317906273bc5b7e2c488750702680
5 years ago
Guillem Jover
137c5df644
TT#71950 Fix typos
...
Change-Id: I79991a30bd8459485ea76dad541bda27daf9bfea
5 years ago
Richard Fuchs
7a28b972c0
TT#69700 don't compensate for TS gaps with a 1-second delay
...
fixes #861
Change-Id: Id7bf8ab28e92e6e509e47a65304058d77f4b261f
6 years ago
Richard Fuchs
228d822a71
TT#68100 set iLBC encoder and decoder options
...
required to distinguish between 20-ms and 30-ms modes, both for encoding
and decoding
add support for the iLBC mode= format parameter and dynamic mode
switching
closes #854
Change-Id: Icb6f0ec80df86d27681c689c168b24f163a2db06
6 years ago
Richard Fuchs
c8338a4372
TT#64050 add `G729a` as an incorrect alternative to `G729`
...
Workaround for a bug in certain phones
Change-Id: I3203ce9d1992146c38b826dd96a962e6673915c7
6 years ago
Richard Fuchs
7ad9906178
TT#59650 fix DTMF related core dump when repacketising
...
Change-Id: I77b84c4b47ee41702b076a8a2f3259dc853654f1
6 years ago
Richard Fuchs
910c03fa62
TT#58660 PCM to RFC DTMF transcoding
...
Change-Id: Iea6a11c0caad1f5e7dcca966101e2969d3516b6f
6 years ago
Richard Fuchs
c0781e5193
TT#58659 RFC DTMF to PCM transcoding
...
Change-Id: I32fa876940131e3a18f611e2a518f7acd1327665
6 years ago
Richard Fuchs
ca30ecaa3d
correctly set frame_duration option for Opus
...
closes #779
Change-Id: I134734319b60d38b60f0e9e7779a5e5e433a79d8
6 years ago
Richard Fuchs
db507468de
TT#59100 support case insensitive codec names
...
closes #775
Change-Id: Id54309bf0920e731ad42fb09b078580090f6f82e
6 years ago
Richard Fuchs
5308208ee4
further rate limiting for log messages from libav
...
Change-Id: If19d736df87286559d4d3c0dfdda0a81d6c4d5cc
6 years ago
Richard Fuchs
ac825cc47a
TT#56553 fix double G.722 sample rate issues
...
Fixes missing RTP TS rescaling
Fixes double clock rate adjustment
Fixes sequencer not releasing packets after seq reset
Fixes #748
Change-Id: Ic6021ab6fd781cd291c0aba3e03633f565908c29
6 years ago
Richard Fuchs
e1e6fd4297
TT#50652 add explicit libav error reporting
...
Change-Id: Ib4bc3e89e54a1d4478dd32f7947dadeb262c18ec
6 years ago
Richard Fuchs
c7051fcffb
TT#50652 use hash table for AVCodec ID lookup
...
Change-Id: I716a7640ceed6dd3ba459688e9f89d2ef8f76f16
6 years ago
Richard Fuchs
7cc530905a
TT#50652 add support for 8-bit unsigned PCM
...
Change-Id: I8a75c81ee90c2593a24367f86107863cfd5f680f
6 years ago
Richard Fuchs
92b08d899c
TT#50652 add media playback capability
...
Change-Id: I935812639e4f42cd89c4ecf02f5ae1a9a8243a65
6 years ago
Richard Fuchs
e3ec97f858
TT#50652 add -Wstrict-prototypes everywhere
...
Change-Id: Ic5b5fcb892a8f70196478f8622d956bdea373422
6 years ago