After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 705977 - audio decoders: output planar audio for better performance
audio decoders: output planar audio for better performance
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-libav
git master
Other Linux
: Normal enhancement
: 1.15.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on: 705986 796740
Blocks:
 
 
Reported: 2013-08-14 10:26 UTC by Wim Taymans
Modified: 2018-07-23 13:24 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gstaudiodecoder: do not aggregate output if buffers are planar (1.79 KB, patch)
2018-07-03 13:26 UTC, George Kiagiadakis
none Details | Review
gstaudiodecoder: take into account GstAudioMeta::samples on the output buffers (3.36 KB, patch)
2018-07-03 13:27 UTC, George Kiagiadakis
none Details | Review
avauddec: add support for decoding in non-interleaved layout (15.30 KB, patch)
2018-07-03 13:49 UTC, George Kiagiadakis
none Details | Review

Description Wim Taymans 2013-08-14 10:26:27 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
Comment 1 George Kiagiadakis 2018-07-03 13:26:57 UTC
Created attachment 372936 [details] [review]
gstaudiodecoder: do not aggregate output if buffers are planar
Comment 2 George Kiagiadakis 2018-07-03 13:27:33 UTC
Created attachment 372937 [details] [review]
gstaudiodecoder: take into account GstAudioMeta::samples on the output buffers
Comment 3 George Kiagiadakis 2018-07-03 13:49:34 UTC
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.
Comment 4 George Kiagiadakis 2018-07-23 13:21:06 UTC
(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
Comment 5 George Kiagiadakis 2018-07-23 13:24:07 UTC
(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