Repository navigation
Make it possible to limit minimum bitrate - #264
Merged
Merged
Conversation
ktmf01
force-pushed
the
minimum-bitrate
branch
from
December 1, 2021 20:34
f6055fc to
bec5d19
Compare
This was referenced Dec 1, 2021
ktmf01
marked this pull request as ready for review
January 19, 2022 20:42
Quite a lot of decoders have trouble streaming or seeking in a file with frames that only consist of constant subframes because of the large difference between the largest and smallest subframe. To remedy this, this commit makes it possible to disable the use of constant subframes for the last subframe in case all others are constant with a new API function. This means the minimum bitrate for a FLAC file encoded with this function used is raised to 1bit/sample (i.e. 48kbit/s for 48kHz material). This commit also adds tests to the test suite
netbsd-srcmastr
pushed a commit
to NetBSD/pkgsrc
that referenced
this pull request
Sep 11, 2022
## FLAC 1.4.0 As there have been changes to the library interfaces, the libFLAC version number is incremented to 12, the libFLAC++ version number is incremented to 10. As some changes were breaking, the version age numbers (see [libtool versioning](https://www.gnu.org/software/libtool/manual/libtool.html#Libtool-versioning)) have been reset to 0. For more details on the changes to the API, see the [porting guide](https://xiph.org/flac/api/group__porting__1__3__4__to__1__4__0.html). The XMMS plugin and 'common' plugin code (used only by the XMMS plugin) are deprecated, they will be removed in a future release. * General: * It is now possible to limit the minimum bitrate of a FLAC file generated by libFLAC and with the `flac` tool to 1 bit/sample. This function can be used to aid live streaming, for example for internet radio * Encoding files with sample rates up to 1'048'575Hz is now possible. (Con Kolivas) * Compression of preset -3 through -8 was slightly improved at the cost of a small decrease in encoding speed by increasing the precision with which autocorrelation was calculated (Martijn van Beurden) * Encoding speed of preset -0, -1 and -2 was slightly improved * Compression of presets -1 and -4 was slighly improved on certain material by changing the adaptive mid-side heuristics * Speedups specifically targeting 64-bit ARMv8 devices using NEON were integrated (Ronen Gvili, Martijn van Beurden) * Speedups for x86_64 CPUs having the FMA instruction set extention are added * Encoding and decoding of 32-bit PCM is now possible * (Ogg) FLAC format: * The FLAC format document is being rewritten by the IETF CELLAR working group. The latest draft can be found on [https://datatracker.ietf.org/doc/draft-ietf-cellar-flac/](https://datatracker.ietf.org/doc/draft-ietf-cellar-flac/) * The FLAC format document specifies no bounds for the residual. In other to match current decoder implementations, it is proposed to bound the residual to the range provided by a 32-bit int signed two's complement. This limit must be checked by FLAC encoders as to keep FLAC decoders free from the complexity of being to decode a residual exceeding a 32-bit int. * There is now a set of files available to test whether a FLAC decoder implements the format correctly. This FLAC decoder testbench can be found at [https://github.com/ietf-wg-cellar/flac-test-files](https://github.com/ietf-wg-cellar/flac-test-files). Also, results of testing hard- and software can be found here at [https://wiki.hydrogenaud.io/index.php?title=FLAC_decoder_testbench](https://wiki.hydrogenaud.io/index.php?title=FLAC_decoder_testbench). * flac: * The option --limit-min-bitrate was added to aid streaming, see [github #264](xiph/flac#264) * The option --keep-foreign-metadata-if-present is added. This option works the same as --keep-foreign-metadata, but does return a warning instead of an error if no foreign metadata was found to store or restore * The warning returned by the foreign metadata handling is now clearer in case a user tries to restore foreign metadata of the wrong type, for example decoding a FLAC file containing AIFF foreign metadata to a WAV file * A problem when using the analyse function causing the first frame to have a wrong size and offset was fixed * Fix bug where channel mask of a file is unintentionally reused when several files are processed with one command * The order of compression-related commands is no longer important, i.e. -8ep gives the same result as -ep8. Previously, a compression level (like -8) would override a more specific setting (like -e or -p). This is no longer the case * flac now checks the block-align property of WAV files to ensure non-standard WAV files (for which flac has no handling) are not mangled * metaflac: * (none) * build system: * MSVC and Makefile.lite build system files have been removed. Building with MSVC (Visual Studio) can be done by using CMake * Various CMake improvements, especially for creating MSVC build files (Martijn van Beurden, martinRenou, CookiePLMonster, David Callu, Tyler Dunn, Cameron Cawley) * Various fixes for MinGW (Martijn van Beurden, Cameron Cawley) * Removed obsolete autotools macro's to silence warnings * Fixes for FreeBSD PowerPC (pkubaj) * Fixed some compiler warnings (Martijn van Beurden, Tyler Dunn) * Fix building with uclibc (Fabrice Fontaine) * testing/validation: * Addition of new encoder fuzzer, adding fuzzing for 8, 24 and 32-bit inputs * Addition of new decoder fuzzer, adding coverage of seeking code * Addition of metadata fuzzer, adding coverage of metadata APIs * Various improvements to fuzzers to improve code coverage, fuzzing speed and stability * Many changes to test suite to improve cross-platform compatibility (Rosen Penev) * Windows CI now also builds the whole test suite * Clang-format file added (Rosen Penev) * Add warning on using v141_xp platform toolset with /MT (Martijn van Beurden, Paul Sanders) * libraries: * Various seeking fixes (Martijn van Beurden, Robert Kausch) * Various bugs fixed found by fuzzing * On decoding, it is now checked whether residuals can be contained by a 32-bit int, preventing integer overflow * Add check that samples supplied to libFLAC actually fall within the bps set * Add checks when parsing metadata blocks to not allocate excessive amounts of memory and not overread * Undocumented Windows-only utf8 functions are no longer exported to the DLL interface * Removed all assembler and intrinsics code from the decoder to improve fuzzing, as they provided only a small speed benefit * The bitwriter buffer is limited in size to 2^24 bytes, so it cannot write excessively large files. This is a backup in case another bug in this area creeps (back) in. * The metadata iterations should now never return a vorbiscomment entry with NULL as an entry, now always at least an empty string is returned * documentation: * Removed html documentation and generate man pages from markdown * Interface changes: * libFLAC: * Addition of FLAC__stream_encoder_set_limit_min_bitrate() and FLAC__stream_encoder_get_limit_min_bitrate(), see [github #264](xiph/flac#264) * get_client_data_from_decoder is renamed FLAC__get_decoder_client_data(), see [github #124](xiph/flac#124) * All API functions taking a filename as an argument now take UTF-8 filenames on Windows, and no longer accept filenames using the current codepage * FLAC__Frame struct has changed: warmup samples are now stored in FLAC__int64 instead of FLAC__int32 types, and verbatim samples can now be stored in either FLAC__int32 or FLAC__int64 depending on whether samples fix the former or latter * The FLAC__StreamMetadata struct now has a tag, so it can be forward declared * libFLAC++: * Addition of ::set_limit_min_bitrate() and ::get_limit_min_bitrate(), see [github #264](xiph/flac#264) * All API functions taking a filename as an argument now take UTF-8 filenames on Windows, and no longer accept filenames using the current codepage * The ::FLAC__Frame struct has changed, see the libFLAC interface change.
nabijaczleweli
pushed a commit
to nabijaczleweli/flac-bound
that referenced
this pull request
Nov 5, 2024
add FLAC__stream_encoder_set_limit_min_bitrate This allows one to limit the compression of digital silence to prevent streaming connection loss. See see xiph/flac#264.
msk
pushed a commit
to msk/pkgsrc
that referenced
this pull request
May 11, 2026
## FLAC 1.4.0 As there have been changes to the library interfaces, the libFLAC version number is incremented to 12, the libFLAC++ version number is incremented to 10. As some changes were breaking, the version age numbers (see [libtool versioning](https://www.gnu.org/software/libtool/manual/libtool.html#Libtool-versioning)) have been reset to 0. For more details on the changes to the API, see the [porting guide](https://xiph.org/flac/api/group__porting__1__3__4__to__1__4__0.html). The XMMS plugin and 'common' plugin code (used only by the XMMS plugin) are deprecated, they will be removed in a future release. * General: * It is now possible to limit the minimum bitrate of a FLAC file generated by libFLAC and with the `flac` tool to 1 bit/sample. This function can be used to aid live streaming, for example for internet radio * Encoding files with sample rates up to 1'048'575Hz is now possible. (Con Kolivas) * Compression of preset -3 through -8 was slightly improved at the cost of a small decrease in encoding speed by increasing the precision with which autocorrelation was calculated (Martijn van Beurden) * Encoding speed of preset -0, -1 and -2 was slightly improved * Compression of presets -1 and -4 was slighly improved on certain material by changing the adaptive mid-side heuristics * Speedups specifically targeting 64-bit ARMv8 devices using NEON were integrated (Ronen Gvili, Martijn van Beurden) * Speedups for x86_64 CPUs having the FMA instruction set extention are added * Encoding and decoding of 32-bit PCM is now possible * (Ogg) FLAC format: * The FLAC format document is being rewritten by the IETF CELLAR working group. The latest draft can be found on [https://datatracker.ietf.org/doc/draft-ietf-cellar-flac/](https://datatracker.ietf.org/doc/draft-ietf-cellar-flac/) * The FLAC format document specifies no bounds for the residual. In other to match current decoder implementations, it is proposed to bound the residual to the range provided by a 32-bit int signed two's complement. This limit must be checked by FLAC encoders as to keep FLAC decoders free from the complexity of being to decode a residual exceeding a 32-bit int. * There is now a set of files available to test whether a FLAC decoder implements the format correctly. This FLAC decoder testbench can be found at [https://github.com/ietf-wg-cellar/flac-test-files](https://github.com/ietf-wg-cellar/flac-test-files). Also, results of testing hard- and software can be found here at [https://wiki.hydrogenaud.io/index.php?title=FLAC_decoder_testbench](https://wiki.hydrogenaud.io/index.php?title=FLAC_decoder_testbench). * flac: * The option --limit-min-bitrate was added to aid streaming, see [github #264](xiph/flac#264) * The option --keep-foreign-metadata-if-present is added. This option works the same as --keep-foreign-metadata, but does return a warning instead of an error if no foreign metadata was found to store or restore * The warning returned by the foreign metadata handling is now clearer in case a user tries to restore foreign metadata of the wrong type, for example decoding a FLAC file containing AIFF foreign metadata to a WAV file * A problem when using the analyse function causing the first frame to have a wrong size and offset was fixed * Fix bug where channel mask of a file is unintentionally reused when several files are processed with one command * The order of compression-related commands is no longer important, i.e. -8ep gives the same result as -ep8. Previously, a compression level (like -8) would override a more specific setting (like -e or -p). This is no longer the case * flac now checks the block-align property of WAV files to ensure non-standard WAV files (for which flac has no handling) are not mangled * metaflac: * (none) * build system: * MSVC and Makefile.lite build system files have been removed. Building with MSVC (Visual Studio) can be done by using CMake * Various CMake improvements, especially for creating MSVC build files (Martijn van Beurden, martinRenou, CookiePLMonster, David Callu, Tyler Dunn, Cameron Cawley) * Various fixes for MinGW (Martijn van Beurden, Cameron Cawley) * Removed obsolete autotools macro's to silence warnings * Fixes for FreeBSD PowerPC (pkubaj) * Fixed some compiler warnings (Martijn van Beurden, Tyler Dunn) * Fix building with uclibc (Fabrice Fontaine) * testing/validation: * Addition of new encoder fuzzer, adding fuzzing for 8, 24 and 32-bit inputs * Addition of new decoder fuzzer, adding coverage of seeking code * Addition of metadata fuzzer, adding coverage of metadata APIs * Various improvements to fuzzers to improve code coverage, fuzzing speed and stability * Many changes to test suite to improve cross-platform compatibility (Rosen Penev) * Windows CI now also builds the whole test suite * Clang-format file added (Rosen Penev) * Add warning on using v141_xp platform toolset with /MT (Martijn van Beurden, Paul Sanders) * libraries: * Various seeking fixes (Martijn van Beurden, Robert Kausch) * Various bugs fixed found by fuzzing * On decoding, it is now checked whether residuals can be contained by a 32-bit int, preventing integer overflow * Add check that samples supplied to libFLAC actually fall within the bps set * Add checks when parsing metadata blocks to not allocate excessive amounts of memory and not overread * Undocumented Windows-only utf8 functions are no longer exported to the DLL interface * Removed all assembler and intrinsics code from the decoder to improve fuzzing, as they provided only a small speed benefit * The bitwriter buffer is limited in size to 2^24 bytes, so it cannot write excessively large files. This is a backup in case another bug in this area creeps (back) in. * The metadata iterations should now never return a vorbiscomment entry with NULL as an entry, now always at least an empty string is returned * documentation: * Removed html documentation and generate man pages from markdown * Interface changes: * libFLAC: * Addition of FLAC__stream_encoder_set_limit_min_bitrate() and FLAC__stream_encoder_get_limit_min_bitrate(), see [github #264](xiph/flac#264) * get_client_data_from_decoder is renamed FLAC__get_decoder_client_data(), see [github NetBSD#124](xiph/flac#124) * All API functions taking a filename as an argument now take UTF-8 filenames on Windows, and no longer accept filenames using the current codepage * FLAC__Frame struct has changed: warmup samples are now stored in FLAC__int64 instead of FLAC__int32 types, and verbatim samples can now be stored in either FLAC__int32 or FLAC__int64 depending on whether samples fix the former or latter * The FLAC__StreamMetadata struct now has a tag, so it can be forward declared * libFLAC++: * Addition of ::set_limit_min_bitrate() and ::get_limit_min_bitrate(), see [github #264](xiph/flac#264) * All API functions taking a filename as an argument now take UTF-8 filenames on Windows, and no longer accept filenames using the current codepage * The ::FLAC__Frame struct has changed, see the libFLAC interface change.
jperkin
pushed a commit
to TritonDataCenter/pkgsrc
that referenced
this pull request
May 14, 2026
## FLAC 1.4.0 As there have been changes to the library interfaces, the libFLAC version number is incremented to 12, the libFLAC++ version number is incremented to 10. As some changes were breaking, the version age numbers (see [libtool versioning](https://www.gnu.org/software/libtool/manual/libtool.html#Libtool-versioning)) have been reset to 0. For more details on the changes to the API, see the [porting guide](https://xiph.org/flac/api/group__porting__1__3__4__to__1__4__0.html). The XMMS plugin and 'common' plugin code (used only by the XMMS plugin) are deprecated, they will be removed in a future release. * General: * It is now possible to limit the minimum bitrate of a FLAC file generated by libFLAC and with the `flac` tool to 1 bit/sample. This function can be used to aid live streaming, for example for internet radio * Encoding files with sample rates up to 1'048'575Hz is now possible. (Con Kolivas) * Compression of preset -3 through -8 was slightly improved at the cost of a small decrease in encoding speed by increasing the precision with which autocorrelation was calculated (Martijn van Beurden) * Encoding speed of preset -0, -1 and -2 was slightly improved * Compression of presets -1 and -4 was slighly improved on certain material by changing the adaptive mid-side heuristics * Speedups specifically targeting 64-bit ARMv8 devices using NEON were integrated (Ronen Gvili, Martijn van Beurden) * Speedups for x86_64 CPUs having the FMA instruction set extention are added * Encoding and decoding of 32-bit PCM is now possible * (Ogg) FLAC format: * The FLAC format document is being rewritten by the IETF CELLAR working group. The latest draft can be found on [https://datatracker.ietf.org/doc/draft-ietf-cellar-flac/](https://datatracker.ietf.org/doc/draft-ietf-cellar-flac/) * The FLAC format document specifies no bounds for the residual. In other to match current decoder implementations, it is proposed to bound the residual to the range provided by a 32-bit int signed two's complement. This limit must be checked by FLAC encoders as to keep FLAC decoders free from the complexity of being to decode a residual exceeding a 32-bit int. * There is now a set of files available to test whether a FLAC decoder implements the format correctly. This FLAC decoder testbench can be found at [https://github.com/ietf-wg-cellar/flac-test-files](https://github.com/ietf-wg-cellar/flac-test-files). Also, results of testing hard- and software can be found here at [https://wiki.hydrogenaud.io/index.php?title=FLAC_decoder_testbench](https://wiki.hydrogenaud.io/index.php?title=FLAC_decoder_testbench). * flac: * The option --limit-min-bitrate was added to aid streaming, see [github #264](xiph/flac#264) * The option --keep-foreign-metadata-if-present is added. This option works the same as --keep-foreign-metadata, but does return a warning instead of an error if no foreign metadata was found to store or restore * The warning returned by the foreign metadata handling is now clearer in case a user tries to restore foreign metadata of the wrong type, for example decoding a FLAC file containing AIFF foreign metadata to a WAV file * A problem when using the analyse function causing the first frame to have a wrong size and offset was fixed * Fix bug where channel mask of a file is unintentionally reused when several files are processed with one command * The order of compression-related commands is no longer important, i.e. -8ep gives the same result as -ep8. Previously, a compression level (like -8) would override a more specific setting (like -e or -p). This is no longer the case * flac now checks the block-align property of WAV files to ensure non-standard WAV files (for which flac has no handling) are not mangled * metaflac: * (none) * build system: * MSVC and Makefile.lite build system files have been removed. Building with MSVC (Visual Studio) can be done by using CMake * Various CMake improvements, especially for creating MSVC build files (Martijn van Beurden, martinRenou, CookiePLMonster, David Callu, Tyler Dunn, Cameron Cawley) * Various fixes for MinGW (Martijn van Beurden, Cameron Cawley) * Removed obsolete autotools macro's to silence warnings * Fixes for FreeBSD PowerPC (pkubaj) * Fixed some compiler warnings (Martijn van Beurden, Tyler Dunn) * Fix building with uclibc (Fabrice Fontaine) * testing/validation: * Addition of new encoder fuzzer, adding fuzzing for 8, 24 and 32-bit inputs * Addition of new decoder fuzzer, adding coverage of seeking code * Addition of metadata fuzzer, adding coverage of metadata APIs * Various improvements to fuzzers to improve code coverage, fuzzing speed and stability * Many changes to test suite to improve cross-platform compatibility (Rosen Penev) * Windows CI now also builds the whole test suite * Clang-format file added (Rosen Penev) * Add warning on using v141_xp platform toolset with /MT (Martijn van Beurden, Paul Sanders) * libraries: * Various seeking fixes (Martijn van Beurden, Robert Kausch) * Various bugs fixed found by fuzzing * On decoding, it is now checked whether residuals can be contained by a 32-bit int, preventing integer overflow * Add check that samples supplied to libFLAC actually fall within the bps set * Add checks when parsing metadata blocks to not allocate excessive amounts of memory and not overread * Undocumented Windows-only utf8 functions are no longer exported to the DLL interface * Removed all assembler and intrinsics code from the decoder to improve fuzzing, as they provided only a small speed benefit * The bitwriter buffer is limited in size to 2^24 bytes, so it cannot write excessively large files. This is a backup in case another bug in this area creeps (back) in. * The metadata iterations should now never return a vorbiscomment entry with NULL as an entry, now always at least an empty string is returned * documentation: * Removed html documentation and generate man pages from markdown * Interface changes: * libFLAC: * Addition of FLAC__stream_encoder_set_limit_min_bitrate() and FLAC__stream_encoder_get_limit_min_bitrate(), see [github #264](xiph/flac#264) * get_client_data_from_decoder is renamed FLAC__get_decoder_client_data(), see [github #124](xiph/flac#124) * All API functions taking a filename as an argument now take UTF-8 filenames on Windows, and no longer accept filenames using the current codepage * FLAC__Frame struct has changed: warmup samples are now stored in FLAC__int64 instead of FLAC__int32 types, and verbatim samples can now be stored in either FLAC__int32 or FLAC__int64 depending on whether samples fix the former or latter * The FLAC__StreamMetadata struct now has a tag, so it can be forward declared * libFLAC++: * Addition of ::set_limit_min_bitrate() and ::get_limit_min_bitrate(), see [github #264](xiph/flac#264) * All API functions taking a filename as an argument now take UTF-8 filenames on Windows, and no longer accept filenames using the current codepage * The ::FLAC__Frame struct has changed, see the libFLAC interface change.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Quite a lot of decoders have trouble streaming or seeking in a file with frames that only consist of constant subframes because of the large difference between the largest and smallest subframe. To remedy this, this commit disables the use of constant subframes for the last subframe in case all others are constant.
This fixes #90 and fixes #262