GNOME Bugzilla – Bug 705977
audio decoders: output planar audio for better performance
Last modified: 2018-07-23 13:24:07 UTC
With the upgrade of libav, support for S16 and planar conversions were removed internally and gst-libav now receives the raw planar F32 samples. For AAC, gst-libav converts the planar F32 samples to interleaved and then audioconvert converts the F32 samples to S16. This is a lot less efficient than the tight single conversion loop that was previously used. We should: - let the audio decoder render planar samples directly into the output buffer - make gst-libav output planar formats - add support for planar formats in audioconvert and possibly other elements that could be used in a typical playbin pipeline
Created attachment 372936 [details] [review] gstaudiodecoder: do not aggregate output if buffers are planar
Created attachment 372937 [details] [review] gstaudiodecoder: take into account GstAudioMeta::samples on the output buffers
Created attachment 372938 [details] [review] avauddec: add support for decoding in non-interleaved layout This removes the internal interleave loop and always negotiates the native output layout of the libav decoder. Users can use audioconvert to interleave if necessary. Special care has been taken to leave the encoder unaffected by the changes in avcodecmap, since GstAudioEncoder doesn't support the non-interleaved layout yet.
(in gst-plugins-base) commit 0ce20cef4fcc5e5e5723479bf8e980d92ece09f5 Author: George Kiagiadakis <george.kiagiadakis@collabora.com> Date: Wed Feb 14 13:55:06 2018 +0200 gstaudiodecoder: take into account GstAudioMeta::samples on the output buffers This is useful if the output buffers are planar and have extra padding on each plane, in which case size/bpf does not represent the number of valid samples. https://bugzilla.gnome.org/show_bug.cgi?id=705977 commit 2d38d2f1d3822f37c73cf446d1394b60792250a9 Author: George Kiagiadakis <george.kiagiadakis@collabora.com> Date: Wed Feb 14 13:11:37 2018 +0200 gstaudiodecoder: do not aggregate output if buffers are planar Aggregation will break the layout, as it concatenates buffers, and fixing it here would be much more inefficient than configuring the actual decoder implementation to output larger buffers. https://bugzilla.gnome.org/show_bug.cgi?id=705977
(in gst-libav) commit 4596249496386772535eddfda94b2e543169a564 Author: George Kiagiadakis <george.kiagiadakis@collabora.com> Date: Mon Jul 23 16:16:10 2018 +0300 avauddec: add support for decoding in non-interleaved layout This removes the internal interleave loop and always negotiates the native output layout of the libav decoder. Users can use audioconvert to interleave if necessary. Special care has been taken to leave the encoder unaffected by the changes in avcodecmap, since GstAudioEncoder doesn't support the non-interleaved layout yet. https://bugzilla.gnome.org/show_bug.cgi?id=705977