opus icon indicating copy to clipboard operation
opus copied to clipboard

Sending refresh DTX packets every 400 ms independently of the encoded…

Open jvicentep opened this issue 4 years ago • 4 comments

… frame size.

This pull request makes sure that refresh DTX packets are sent every 400 ms. When encoding with frame sizes different from 20 ms and using Silk (for example by forcing a low bitrate) the distance between refresh DTX packets was different from 400 ms. Specifically, for frames length equal to 60 ms, the packets were at 1.2 seconds distance.

As an example, the attached image compares a DTX region before and after the change proposed in this pull request. We can see that the upper image did not receive a refresh DTX packet for 1.2 second and, therefore, kept a high level of comfort noise for longer time. The bottom spectrogram was created with the proposed changes.

example_DTX_packet_duration

jvicentep avatar Feb 12 '21 13:02 jvicentep

Just curious, does that fix or improve a particular behaviour. I was wondering whether 400 ms is still appropriate for longer packets or if we might want to make the delay larger -- on the assumption that bandwidth is tight. Just asking.

jmvalin avatar Feb 15 '21 23:02 jmvalin

This change makes the Opus behavior a bit more consistent and fits better with the RFC specifications (https://tools.ietf.org/html/rfc6716#section-2.1.9).

This bug is not always happening and it depends on the configuration for Opus. For example, if the floating point code is disabled, this bug is not present. So, this change also makes the code more consistent over different Opus configurations.

Quality wise, I do not think this change has a large impact except for some corner cases like the one that I showed in the figure.

jvicentep avatar Feb 16 '21 08:02 jvicentep

Merged in https://gitlab.xiph.org/xiph/opus/-/commit/16286a25fdd865c66a837a73b65fbaa7b25bf484

felicialim avatar Feb 19 '21 22:02 felicialim

this has been merged and can be closed @mark4o

xnorpx avatar Jul 06 '22 17:07 xnorpx