opusenc: Encode exactly the amount of samples we got as input and put correct timesta...
authorSebastian Dröge <sebastian@centricular.com>
Fri, 30 Oct 2015 18:57:37 +0000 (20:57 +0200)
committerSebastian Dröge <sebastian@centricular.com>
Tue, 3 Nov 2015 18:35:41 +0000 (20:35 +0200)
commit4df2ffaad608b632302e04d9be2fdd90ea6e1e31
tree9314ac3393b48be31b96a024add3f31017780775
parent6ffb90e0375de1a31ff2f1bd6dc8a353fce976ff
opusenc: Encode exactly the amount of samples we got as input and put correct timestamps on it

The first frame has lookahead less samples, the last frame might have some
padding or we might have to encode another frame of silence to get all our
input into the encoded data.

This is because of a) the lookahead at the beginning of the encoding, which
shifts all data by that amount of samples and b) the padding needed to fill
the very last frame completely.

Ideally we would use LPC to calculate something better than silence for the
padding to make the encoding as smooth as possible.

With this we get exactly the same amount of samples again in an
opusenc ! opusdec pipeline.

https://bugzilla.gnome.org/show_bug.cgi?id=757153
ext/opus/gstopusenc.c
ext/opus/gstopusenc.h