Hello again, After some time, I succeeded in splitting "flush" and "restart" functions. A quick measurement gives me ~25% speed improvement, which is quite a lot. Of course this optimization is specific for this use case (many short signals). Is this interesting for the project? I would gladly contribute it... If yes, how should I share it? As a patch against current git? Other small details: - I commented out by default the vorbis comment; if this is important to be kept, I would like an option (e.g. I could save ~100MB out of ~1.1GB compressed data). - I allowed ".._set_total_samples_estimate" in initialized state (intended to be used between flush and restart), in order to generate a proper streaminfo header; it seems to be otherwise harmless even if misused. Regards, Gabriel
Gabriel Corneanu wrote:> Is this interesting for the project?I would theoretically accept a patch that allows direct access to the functionality you seek, as long as it doesn't change the existing API.> If yes, how should I share it? As a patch against current git?Probably easiest as as PR against: https://github.com/xiph/flac/> > Other small details: > - I commented out by default the vorbis comment; if this is important > to be kept, I would like an option (e.g. I could save ~100MB out of > ~1.1GB compressed data).I'm pretty sure this default vorbis comment is part of the official specfication of FLAC and hence should probably not even be made optional. You can probably avoid it by using the library directly instead of using the flac command line program. Erik -- ---------------------------------------------------------------------- Erik de Castro Lopo http://www.mega-nerd.com/
Hi, On Sat, Feb 3, 2018 at 10:10 AM, Erik de Castro Lopo <mle+la at mega-nerd.com> wrote:> Gabriel Corneanu wrote: > >> Is this interesting for the project? > > I would theoretically accept a patch that allows direct access to the > functionality you seek, as long as it doesn't change the existing API. > >> If yes, how should I share it? As a patch against current git? > > Probably easiest as as PR against: > > https://github.com/xiph/flac/I create a PR. The existing API should not have been changed, all tests are passed.>> >> Other small details: >> - I commented out by default the vorbis comment; if this is important >> to be kept, I would like an option (e.g. I could save ~100MB out of >> ~1.1GB compressed data). > > I'm pretty sure this default vorbis comment is part of the official > specfication of FLAC and hence should probably not even be made optional.Here https://xiph.org/flac/format.html#format_overview only the streaminfo is mandatory.> You can probably avoid it by using the library directly instead of using > the flac command line program.It is the other way around :) . I could NOT avoid generating the comment with the library. Even after my change, the command line tool is still generating it (I don't really mind). My proposal is to not generate it by default (with libFLAC) for a non-ogg target.> ErikGabriel