mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-09 23:34:20 +00:00
FlacAudioFormat: Use FLAC version 1.4.3
This commit is contained in:
parent
31e4779b46
commit
c4c7c86324
124 changed files with 3614 additions and 27846 deletions
|
|
@ -349,7 +349,9 @@ add_library( ${BINARY_NAME}
|
|||
"../../../../../modules/juce_audio_devices/juce_audio_devices.cpp"
|
||||
"../../../../../modules/juce_audio_devices/juce_audio_devices.mm"
|
||||
"../../../../../modules/juce_audio_devices/juce_audio_devices.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/include/private/all.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/deduplication/bitreader_read_rice_signed_block.c"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/deduplication/lpc_compute_autocorrelation_intrin.c"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/deduplication/lpc_compute_autocorrelation_intrin_neon.c"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/include/private/bitmath.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/include/private/bitreader.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/include/private/bitwriter.h"
|
||||
|
|
@ -361,11 +363,9 @@ add_library( ${BINARY_NAME}
|
|||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/include/private/lpc.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/include/private/md5.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/include/private/memory.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/include/private/metadata.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/include/private/stream_encoder.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/include/private/stream_encoder_framing.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/include/private/window.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/include/protected/all.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/include/protected/stream_decoder.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/include/protected/stream_encoder.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/bitmath.c"
|
||||
|
|
@ -377,6 +377,7 @@ add_library( ${BINARY_NAME}
|
|||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/float.c"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/format.c"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/lpc_flac.c"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/lpc_intrin_neon.c"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/md5.c"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/memory.c"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/stream_decoder.c"
|
||||
|
|
@ -392,8 +393,10 @@ add_library( ${BINARY_NAME}
|
|||
"../../../../../modules/juce_audio_formats/codecs/flac/export.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/Flac Licence.txt"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/format.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/JUCE_CHANGES.txt"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/metadata.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/ordinals.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/private.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/stream_decoder.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/stream_encoder.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/oggvorbis/libvorbis-1.3.7/lib/books/coupled/res_books_51.h"
|
||||
|
|
@ -2438,7 +2441,9 @@ set_source_files_properties(
|
|||
"../../../../../modules/juce_audio_devices/juce_audio_devices.cpp"
|
||||
"../../../../../modules/juce_audio_devices/juce_audio_devices.mm"
|
||||
"../../../../../modules/juce_audio_devices/juce_audio_devices.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/include/private/all.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/deduplication/bitreader_read_rice_signed_block.c"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/deduplication/lpc_compute_autocorrelation_intrin.c"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/deduplication/lpc_compute_autocorrelation_intrin_neon.c"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/include/private/bitmath.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/include/private/bitreader.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/include/private/bitwriter.h"
|
||||
|
|
@ -2450,11 +2455,9 @@ set_source_files_properties(
|
|||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/include/private/lpc.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/include/private/md5.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/include/private/memory.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/include/private/metadata.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/include/private/stream_encoder.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/include/private/stream_encoder_framing.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/include/private/window.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/include/protected/all.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/include/protected/stream_decoder.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/include/protected/stream_encoder.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/bitmath.c"
|
||||
|
|
@ -2466,6 +2469,7 @@ set_source_files_properties(
|
|||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/float.c"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/format.c"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/lpc_flac.c"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/lpc_intrin_neon.c"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/md5.c"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/memory.c"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/stream_decoder.c"
|
||||
|
|
@ -2481,8 +2485,10 @@ set_source_files_properties(
|
|||
"../../../../../modules/juce_audio_formats/codecs/flac/export.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/Flac Licence.txt"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/format.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/JUCE_CHANGES.txt"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/metadata.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/ordinals.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/private.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/stream_decoder.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/stream_encoder.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/oggvorbis/libvorbis-1.3.7/lib/books/coupled/res_books_51.h"
|
||||
|
|
|
|||
|
|
@ -542,6 +542,15 @@
|
|||
<ClCompile Include="..\..\..\..\modules\juce_audio_devices\juce_audio_devices.cpp">
|
||||
<ExcludedFromBuild>true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\deduplication\bitreader_read_rice_signed_block.c">
|
||||
<ExcludedFromBuild>true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\deduplication\lpc_compute_autocorrelation_intrin.c">
|
||||
<ExcludedFromBuild>true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\deduplication\lpc_compute_autocorrelation_intrin_neon.c">
|
||||
<ExcludedFromBuild>true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\bitmath.c">
|
||||
<ExcludedFromBuild>true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
|
|
@ -569,6 +578,9 @@
|
|||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\lpc_flac.c">
|
||||
<ExcludedFromBuild>true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\lpc_intrin_neon.c">
|
||||
<ExcludedFromBuild>true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\md5.c">
|
||||
<ExcludedFromBuild>true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
|
|
@ -2968,7 +2980,6 @@
|
|||
<ClInclude Include="..\..\..\..\modules\juce_audio_devices\sources\juce_AudioSourcePlayer.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_devices\sources\juce_AudioTransportSource.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_devices\juce_audio_devices.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\all.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\bitmath.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\bitreader.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\bitwriter.h"/>
|
||||
|
|
@ -2980,11 +2991,9 @@
|
|||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\lpc.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\md5.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\memory.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\metadata.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\stream_encoder.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\stream_encoder_framing.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\window.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\protected\all.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\protected\stream_decoder.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\protected\stream_encoder.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\all.h"/>
|
||||
|
|
@ -2997,6 +3006,7 @@
|
|||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\format.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\metadata.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\ordinals.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\private.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\stream_decoder.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\stream_encoder.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\oggvorbis\libvorbis-1.3.7\lib\books\coupled\res_books_51.h"/>
|
||||
|
|
@ -3929,6 +3939,7 @@
|
|||
<None Include="..\..\..\..\modules\juce_audio_devices\native\oboe\CMakeLists.txt"/>
|
||||
<None Include="..\..\..\..\modules\juce_audio_devices\native\oboe\README.md"/>
|
||||
<None Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\Flac Licence.txt"/>
|
||||
<None Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\JUCE_CHANGES.txt"/>
|
||||
<None Include="..\..\..\..\modules\juce_audio_formats\codecs\oggvorbis\libvorbis-1.3.7\README.md"/>
|
||||
<None Include="..\..\..\..\modules\juce_audio_formats\codecs\oggvorbis\Ogg Vorbis Licence.txt"/>
|
||||
<None Include="..\..\..\..\modules\juce_audio_processors\format_types\LV2_SDK\README.md"/>
|
||||
|
|
|
|||
|
|
@ -101,6 +101,9 @@
|
|||
<Filter Include="JUCE Modules\juce_audio_devices">
|
||||
<UniqueIdentifier>{9A5DB854-CFFB-5F88-C566-0E10F994DDB3}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="JUCE Modules\juce_audio_formats\codecs\flac\libFLAC\deduplication">
|
||||
<UniqueIdentifier>{2D16C77A-4E5B-B439-2856-90E03028DA07}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="JUCE Modules\juce_audio_formats\codecs\flac\libFLAC\include\private">
|
||||
<UniqueIdentifier>{38A5DDC7-416E-548F-39DA-887875FE6B20}</UniqueIdentifier>
|
||||
</Filter>
|
||||
|
|
@ -1132,6 +1135,15 @@
|
|||
<ClCompile Include="..\..\..\..\modules\juce_audio_devices\juce_audio_devices.mm">
|
||||
<Filter>JUCE Modules\juce_audio_devices</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\deduplication\bitreader_read_rice_signed_block.c">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC\deduplication</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\deduplication\lpc_compute_autocorrelation_intrin.c">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC\deduplication</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\deduplication\lpc_compute_autocorrelation_intrin_neon.c">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC\deduplication</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\bitmath.c">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC</Filter>
|
||||
</ClCompile>
|
||||
|
|
@ -1159,6 +1171,9 @@
|
|||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\lpc_flac.c">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\lpc_intrin_neon.c">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\md5.c">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC</Filter>
|
||||
</ClCompile>
|
||||
|
|
@ -4062,9 +4077,6 @@
|
|||
<ClInclude Include="..\..\..\..\modules\juce_audio_devices\juce_audio_devices.h">
|
||||
<Filter>JUCE Modules\juce_audio_devices</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\all.h">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC\include\private</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\bitmath.h">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC\include\private</Filter>
|
||||
</ClInclude>
|
||||
|
|
@ -4098,9 +4110,6 @@
|
|||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\memory.h">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC\include\private</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\metadata.h">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC\include\private</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\stream_encoder.h">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC\include\private</Filter>
|
||||
</ClInclude>
|
||||
|
|
@ -4110,9 +4119,6 @@
|
|||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\window.h">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC\include\private</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\protected\all.h">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC\include\protected</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\protected\stream_decoder.h">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC\include\protected</Filter>
|
||||
</ClInclude>
|
||||
|
|
@ -4149,6 +4155,9 @@
|
|||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\ordinals.h">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\private.h">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\stream_decoder.h">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac</Filter>
|
||||
</ClInclude>
|
||||
|
|
@ -6941,6 +6950,9 @@
|
|||
<None Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\Flac Licence.txt">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac</Filter>
|
||||
</None>
|
||||
<None Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\JUCE_CHANGES.txt">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac</Filter>
|
||||
</None>
|
||||
<None Include="..\..\..\..\modules\juce_audio_formats\codecs\oggvorbis\libvorbis-1.3.7\README.md">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\oggvorbis\libvorbis-1.3.7</Filter>
|
||||
</None>
|
||||
|
|
|
|||
|
|
@ -542,6 +542,15 @@
|
|||
<ClCompile Include="..\..\..\..\modules\juce_audio_devices\juce_audio_devices.cpp">
|
||||
<ExcludedFromBuild>true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\deduplication\bitreader_read_rice_signed_block.c">
|
||||
<ExcludedFromBuild>true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\deduplication\lpc_compute_autocorrelation_intrin.c">
|
||||
<ExcludedFromBuild>true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\deduplication\lpc_compute_autocorrelation_intrin_neon.c">
|
||||
<ExcludedFromBuild>true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\bitmath.c">
|
||||
<ExcludedFromBuild>true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
|
|
@ -569,6 +578,9 @@
|
|||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\lpc_flac.c">
|
||||
<ExcludedFromBuild>true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\lpc_intrin_neon.c">
|
||||
<ExcludedFromBuild>true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\md5.c">
|
||||
<ExcludedFromBuild>true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
|
|
@ -2968,7 +2980,6 @@
|
|||
<ClInclude Include="..\..\..\..\modules\juce_audio_devices\sources\juce_AudioSourcePlayer.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_devices\sources\juce_AudioTransportSource.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_devices\juce_audio_devices.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\all.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\bitmath.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\bitreader.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\bitwriter.h"/>
|
||||
|
|
@ -2980,11 +2991,9 @@
|
|||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\lpc.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\md5.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\memory.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\metadata.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\stream_encoder.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\stream_encoder_framing.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\window.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\protected\all.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\protected\stream_decoder.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\protected\stream_encoder.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\all.h"/>
|
||||
|
|
@ -2997,6 +3006,7 @@
|
|||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\format.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\metadata.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\ordinals.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\private.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\stream_decoder.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\stream_encoder.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\oggvorbis\libvorbis-1.3.7\lib\books\coupled\res_books_51.h"/>
|
||||
|
|
@ -3929,6 +3939,7 @@
|
|||
<None Include="..\..\..\..\modules\juce_audio_devices\native\oboe\CMakeLists.txt"/>
|
||||
<None Include="..\..\..\..\modules\juce_audio_devices\native\oboe\README.md"/>
|
||||
<None Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\Flac Licence.txt"/>
|
||||
<None Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\JUCE_CHANGES.txt"/>
|
||||
<None Include="..\..\..\..\modules\juce_audio_formats\codecs\oggvorbis\libvorbis-1.3.7\README.md"/>
|
||||
<None Include="..\..\..\..\modules\juce_audio_formats\codecs\oggvorbis\Ogg Vorbis Licence.txt"/>
|
||||
<None Include="..\..\..\..\modules\juce_audio_processors\format_types\LV2_SDK\README.md"/>
|
||||
|
|
|
|||
|
|
@ -101,6 +101,9 @@
|
|||
<Filter Include="JUCE Modules\juce_audio_devices">
|
||||
<UniqueIdentifier>{9A5DB854-CFFB-5F88-C566-0E10F994DDB3}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="JUCE Modules\juce_audio_formats\codecs\flac\libFLAC\deduplication">
|
||||
<UniqueIdentifier>{2D16C77A-4E5B-B439-2856-90E03028DA07}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="JUCE Modules\juce_audio_formats\codecs\flac\libFLAC\include\private">
|
||||
<UniqueIdentifier>{38A5DDC7-416E-548F-39DA-887875FE6B20}</UniqueIdentifier>
|
||||
</Filter>
|
||||
|
|
@ -1132,6 +1135,15 @@
|
|||
<ClCompile Include="..\..\..\..\modules\juce_audio_devices\juce_audio_devices.mm">
|
||||
<Filter>JUCE Modules\juce_audio_devices</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\deduplication\bitreader_read_rice_signed_block.c">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC\deduplication</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\deduplication\lpc_compute_autocorrelation_intrin.c">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC\deduplication</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\deduplication\lpc_compute_autocorrelation_intrin_neon.c">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC\deduplication</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\bitmath.c">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC</Filter>
|
||||
</ClCompile>
|
||||
|
|
@ -1159,6 +1171,9 @@
|
|||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\lpc_flac.c">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\lpc_intrin_neon.c">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\md5.c">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC</Filter>
|
||||
</ClCompile>
|
||||
|
|
@ -4062,9 +4077,6 @@
|
|||
<ClInclude Include="..\..\..\..\modules\juce_audio_devices\juce_audio_devices.h">
|
||||
<Filter>JUCE Modules\juce_audio_devices</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\all.h">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC\include\private</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\bitmath.h">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC\include\private</Filter>
|
||||
</ClInclude>
|
||||
|
|
@ -4098,9 +4110,6 @@
|
|||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\memory.h">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC\include\private</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\metadata.h">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC\include\private</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\stream_encoder.h">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC\include\private</Filter>
|
||||
</ClInclude>
|
||||
|
|
@ -4110,9 +4119,6 @@
|
|||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\window.h">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC\include\private</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\protected\all.h">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC\include\protected</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\protected\stream_decoder.h">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC\include\protected</Filter>
|
||||
</ClInclude>
|
||||
|
|
@ -4149,6 +4155,9 @@
|
|||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\ordinals.h">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\private.h">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\stream_decoder.h">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac</Filter>
|
||||
</ClInclude>
|
||||
|
|
@ -6941,6 +6950,9 @@
|
|||
<None Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\Flac Licence.txt">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac</Filter>
|
||||
</None>
|
||||
<None Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\JUCE_CHANGES.txt">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac</Filter>
|
||||
</None>
|
||||
<None Include="..\..\..\..\modules\juce_audio_formats\codecs\oggvorbis\libvorbis-1.3.7\README.md">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\oggvorbis\libvorbis-1.3.7</Filter>
|
||||
</None>
|
||||
|
|
|
|||
|
|
@ -542,6 +542,15 @@
|
|||
<ClCompile Include="..\..\..\..\modules\juce_audio_devices\juce_audio_devices.cpp">
|
||||
<ExcludedFromBuild>true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\deduplication\bitreader_read_rice_signed_block.c">
|
||||
<ExcludedFromBuild>true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\deduplication\lpc_compute_autocorrelation_intrin.c">
|
||||
<ExcludedFromBuild>true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\deduplication\lpc_compute_autocorrelation_intrin_neon.c">
|
||||
<ExcludedFromBuild>true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\bitmath.c">
|
||||
<ExcludedFromBuild>true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
|
|
@ -569,6 +578,9 @@
|
|||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\lpc_flac.c">
|
||||
<ExcludedFromBuild>true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\lpc_intrin_neon.c">
|
||||
<ExcludedFromBuild>true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\md5.c">
|
||||
<ExcludedFromBuild>true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
|
|
@ -2968,7 +2980,6 @@
|
|||
<ClInclude Include="..\..\..\..\modules\juce_audio_devices\sources\juce_AudioSourcePlayer.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_devices\sources\juce_AudioTransportSource.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_devices\juce_audio_devices.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\all.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\bitmath.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\bitreader.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\bitwriter.h"/>
|
||||
|
|
@ -2980,11 +2991,9 @@
|
|||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\lpc.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\md5.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\memory.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\metadata.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\stream_encoder.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\stream_encoder_framing.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\window.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\protected\all.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\protected\stream_decoder.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\protected\stream_encoder.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\all.h"/>
|
||||
|
|
@ -2997,6 +3006,7 @@
|
|||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\format.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\metadata.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\ordinals.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\private.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\stream_decoder.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\stream_encoder.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\oggvorbis\libvorbis-1.3.7\lib\books\coupled\res_books_51.h"/>
|
||||
|
|
@ -3929,6 +3939,7 @@
|
|||
<None Include="..\..\..\..\modules\juce_audio_devices\native\oboe\CMakeLists.txt"/>
|
||||
<None Include="..\..\..\..\modules\juce_audio_devices\native\oboe\README.md"/>
|
||||
<None Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\Flac Licence.txt"/>
|
||||
<None Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\JUCE_CHANGES.txt"/>
|
||||
<None Include="..\..\..\..\modules\juce_audio_formats\codecs\oggvorbis\libvorbis-1.3.7\README.md"/>
|
||||
<None Include="..\..\..\..\modules\juce_audio_formats\codecs\oggvorbis\Ogg Vorbis Licence.txt"/>
|
||||
<None Include="..\..\..\..\modules\juce_audio_processors\format_types\LV2_SDK\README.md"/>
|
||||
|
|
|
|||
|
|
@ -101,6 +101,9 @@
|
|||
<Filter Include="JUCE Modules\juce_audio_devices">
|
||||
<UniqueIdentifier>{9A5DB854-CFFB-5F88-C566-0E10F994DDB3}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="JUCE Modules\juce_audio_formats\codecs\flac\libFLAC\deduplication">
|
||||
<UniqueIdentifier>{2D16C77A-4E5B-B439-2856-90E03028DA07}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="JUCE Modules\juce_audio_formats\codecs\flac\libFLAC\include\private">
|
||||
<UniqueIdentifier>{38A5DDC7-416E-548F-39DA-887875FE6B20}</UniqueIdentifier>
|
||||
</Filter>
|
||||
|
|
@ -1132,6 +1135,15 @@
|
|||
<ClCompile Include="..\..\..\..\modules\juce_audio_devices\juce_audio_devices.mm">
|
||||
<Filter>JUCE Modules\juce_audio_devices</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\deduplication\bitreader_read_rice_signed_block.c">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC\deduplication</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\deduplication\lpc_compute_autocorrelation_intrin.c">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC\deduplication</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\deduplication\lpc_compute_autocorrelation_intrin_neon.c">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC\deduplication</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\bitmath.c">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC</Filter>
|
||||
</ClCompile>
|
||||
|
|
@ -1159,6 +1171,9 @@
|
|||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\lpc_flac.c">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\lpc_intrin_neon.c">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\md5.c">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC</Filter>
|
||||
</ClCompile>
|
||||
|
|
@ -4062,9 +4077,6 @@
|
|||
<ClInclude Include="..\..\..\..\modules\juce_audio_devices\juce_audio_devices.h">
|
||||
<Filter>JUCE Modules\juce_audio_devices</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\all.h">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC\include\private</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\bitmath.h">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC\include\private</Filter>
|
||||
</ClInclude>
|
||||
|
|
@ -4098,9 +4110,6 @@
|
|||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\memory.h">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC\include\private</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\metadata.h">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC\include\private</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\stream_encoder.h">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC\include\private</Filter>
|
||||
</ClInclude>
|
||||
|
|
@ -4110,9 +4119,6 @@
|
|||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\window.h">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC\include\private</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\protected\all.h">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC\include\protected</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\protected\stream_decoder.h">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC\include\protected</Filter>
|
||||
</ClInclude>
|
||||
|
|
@ -4149,6 +4155,9 @@
|
|||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\ordinals.h">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\private.h">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\stream_decoder.h">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac</Filter>
|
||||
</ClInclude>
|
||||
|
|
@ -6941,6 +6950,9 @@
|
|||
<None Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\Flac Licence.txt">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac</Filter>
|
||||
</None>
|
||||
<None Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\JUCE_CHANGES.txt">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac</Filter>
|
||||
</None>
|
||||
<None Include="..\..\..\..\modules\juce_audio_formats\codecs\oggvorbis\libvorbis-1.3.7\README.md">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\oggvorbis\libvorbis-1.3.7</Filter>
|
||||
</None>
|
||||
|
|
|
|||
|
|
@ -321,7 +321,9 @@ add_library( ${BINARY_NAME}
|
|||
"../../../../../modules/juce_audio_devices/juce_audio_devices.cpp"
|
||||
"../../../../../modules/juce_audio_devices/juce_audio_devices.mm"
|
||||
"../../../../../modules/juce_audio_devices/juce_audio_devices.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/include/private/all.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/deduplication/bitreader_read_rice_signed_block.c"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/deduplication/lpc_compute_autocorrelation_intrin.c"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/deduplication/lpc_compute_autocorrelation_intrin_neon.c"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/include/private/bitmath.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/include/private/bitreader.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/include/private/bitwriter.h"
|
||||
|
|
@ -333,11 +335,9 @@ add_library( ${BINARY_NAME}
|
|||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/include/private/lpc.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/include/private/md5.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/include/private/memory.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/include/private/metadata.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/include/private/stream_encoder.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/include/private/stream_encoder_framing.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/include/private/window.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/include/protected/all.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/include/protected/stream_decoder.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/include/protected/stream_encoder.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/bitmath.c"
|
||||
|
|
@ -349,6 +349,7 @@ add_library( ${BINARY_NAME}
|
|||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/float.c"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/format.c"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/lpc_flac.c"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/lpc_intrin_neon.c"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/md5.c"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/memory.c"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/stream_decoder.c"
|
||||
|
|
@ -364,8 +365,10 @@ add_library( ${BINARY_NAME}
|
|||
"../../../../../modules/juce_audio_formats/codecs/flac/export.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/Flac Licence.txt"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/format.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/JUCE_CHANGES.txt"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/metadata.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/ordinals.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/private.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/stream_decoder.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/stream_encoder.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/oggvorbis/libvorbis-1.3.7/lib/books/coupled/res_books_51.h"
|
||||
|
|
@ -2110,7 +2113,9 @@ set_source_files_properties(
|
|||
"../../../../../modules/juce_audio_devices/juce_audio_devices.cpp"
|
||||
"../../../../../modules/juce_audio_devices/juce_audio_devices.mm"
|
||||
"../../../../../modules/juce_audio_devices/juce_audio_devices.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/include/private/all.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/deduplication/bitreader_read_rice_signed_block.c"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/deduplication/lpc_compute_autocorrelation_intrin.c"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/deduplication/lpc_compute_autocorrelation_intrin_neon.c"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/include/private/bitmath.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/include/private/bitreader.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/include/private/bitwriter.h"
|
||||
|
|
@ -2122,11 +2127,9 @@ set_source_files_properties(
|
|||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/include/private/lpc.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/include/private/md5.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/include/private/memory.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/include/private/metadata.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/include/private/stream_encoder.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/include/private/stream_encoder_framing.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/include/private/window.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/include/protected/all.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/include/protected/stream_decoder.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/include/protected/stream_encoder.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/bitmath.c"
|
||||
|
|
@ -2138,6 +2141,7 @@ set_source_files_properties(
|
|||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/float.c"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/format.c"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/lpc_flac.c"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/lpc_intrin_neon.c"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/md5.c"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/memory.c"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/stream_decoder.c"
|
||||
|
|
@ -2153,8 +2157,10 @@ set_source_files_properties(
|
|||
"../../../../../modules/juce_audio_formats/codecs/flac/export.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/Flac Licence.txt"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/format.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/JUCE_CHANGES.txt"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/metadata.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/ordinals.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/private.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/stream_decoder.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/stream_encoder.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/oggvorbis/libvorbis-1.3.7/lib/books/coupled/res_books_51.h"
|
||||
|
|
|
|||
|
|
@ -523,6 +523,15 @@
|
|||
<ClCompile Include="..\..\..\..\modules\juce_audio_devices\juce_audio_devices.cpp">
|
||||
<ExcludedFromBuild>true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\deduplication\bitreader_read_rice_signed_block.c">
|
||||
<ExcludedFromBuild>true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\deduplication\lpc_compute_autocorrelation_intrin.c">
|
||||
<ExcludedFromBuild>true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\deduplication\lpc_compute_autocorrelation_intrin_neon.c">
|
||||
<ExcludedFromBuild>true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\bitmath.c">
|
||||
<ExcludedFromBuild>true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
|
|
@ -550,6 +559,9 @@
|
|||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\lpc_flac.c">
|
||||
<ExcludedFromBuild>true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\lpc_intrin_neon.c">
|
||||
<ExcludedFromBuild>true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\md5.c">
|
||||
<ExcludedFromBuild>true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
|
|
@ -2572,7 +2584,6 @@
|
|||
<ClInclude Include="..\..\..\..\modules\juce_audio_devices\sources\juce_AudioSourcePlayer.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_devices\sources\juce_AudioTransportSource.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_devices\juce_audio_devices.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\all.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\bitmath.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\bitreader.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\bitwriter.h"/>
|
||||
|
|
@ -2584,11 +2595,9 @@
|
|||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\lpc.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\md5.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\memory.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\metadata.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\stream_encoder.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\stream_encoder_framing.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\window.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\protected\all.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\protected\stream_decoder.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\protected\stream_encoder.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\all.h"/>
|
||||
|
|
@ -2601,6 +2610,7 @@
|
|||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\format.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\metadata.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\ordinals.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\private.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\stream_decoder.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\stream_encoder.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\oggvorbis\libvorbis-1.3.7\lib\books\coupled\res_books_51.h"/>
|
||||
|
|
@ -3380,6 +3390,7 @@
|
|||
<None Include="..\..\..\..\modules\juce_audio_devices\native\oboe\CMakeLists.txt"/>
|
||||
<None Include="..\..\..\..\modules\juce_audio_devices\native\oboe\README.md"/>
|
||||
<None Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\Flac Licence.txt"/>
|
||||
<None Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\JUCE_CHANGES.txt"/>
|
||||
<None Include="..\..\..\..\modules\juce_audio_formats\codecs\oggvorbis\libvorbis-1.3.7\README.md"/>
|
||||
<None Include="..\..\..\..\modules\juce_audio_formats\codecs\oggvorbis\Ogg Vorbis Licence.txt"/>
|
||||
<None Include="..\..\..\..\modules\juce_audio_processors\format_types\LV2_SDK\README.md"/>
|
||||
|
|
|
|||
|
|
@ -86,6 +86,9 @@
|
|||
<Filter Include="JUCE Modules\juce_audio_devices">
|
||||
<UniqueIdentifier>{9A5DB854-CFFB-5F88-C566-0E10F994DDB3}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="JUCE Modules\juce_audio_formats\codecs\flac\libFLAC\deduplication">
|
||||
<UniqueIdentifier>{2D16C77A-4E5B-B439-2856-90E03028DA07}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="JUCE Modules\juce_audio_formats\codecs\flac\libFLAC\include\private">
|
||||
<UniqueIdentifier>{38A5DDC7-416E-548F-39DA-887875FE6B20}</UniqueIdentifier>
|
||||
</Filter>
|
||||
|
|
@ -982,6 +985,15 @@
|
|||
<ClCompile Include="..\..\..\..\modules\juce_audio_devices\juce_audio_devices.mm">
|
||||
<Filter>JUCE Modules\juce_audio_devices</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\deduplication\bitreader_read_rice_signed_block.c">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC\deduplication</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\deduplication\lpc_compute_autocorrelation_intrin.c">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC\deduplication</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\deduplication\lpc_compute_autocorrelation_intrin_neon.c">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC\deduplication</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\bitmath.c">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC</Filter>
|
||||
</ClCompile>
|
||||
|
|
@ -1009,6 +1021,9 @@
|
|||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\lpc_flac.c">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\lpc_intrin_neon.c">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\md5.c">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC</Filter>
|
||||
</ClCompile>
|
||||
|
|
@ -3486,9 +3501,6 @@
|
|||
<ClInclude Include="..\..\..\..\modules\juce_audio_devices\juce_audio_devices.h">
|
||||
<Filter>JUCE Modules\juce_audio_devices</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\all.h">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC\include\private</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\bitmath.h">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC\include\private</Filter>
|
||||
</ClInclude>
|
||||
|
|
@ -3522,9 +3534,6 @@
|
|||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\memory.h">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC\include\private</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\metadata.h">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC\include\private</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\stream_encoder.h">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC\include\private</Filter>
|
||||
</ClInclude>
|
||||
|
|
@ -3534,9 +3543,6 @@
|
|||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\window.h">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC\include\private</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\protected\all.h">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC\include\protected</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\protected\stream_decoder.h">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC\include\protected</Filter>
|
||||
</ClInclude>
|
||||
|
|
@ -3573,6 +3579,9 @@
|
|||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\ordinals.h">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\private.h">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\stream_decoder.h">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac</Filter>
|
||||
</ClInclude>
|
||||
|
|
@ -5906,6 +5915,9 @@
|
|||
<None Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\Flac Licence.txt">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac</Filter>
|
||||
</None>
|
||||
<None Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\JUCE_CHANGES.txt">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac</Filter>
|
||||
</None>
|
||||
<None Include="..\..\..\..\modules\juce_audio_formats\codecs\oggvorbis\libvorbis-1.3.7\README.md">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\oggvorbis\libvorbis-1.3.7</Filter>
|
||||
</None>
|
||||
|
|
|
|||
|
|
@ -354,7 +354,9 @@ add_library( ${BINARY_NAME}
|
|||
"../../../../../modules/juce_audio_devices/juce_audio_devices.cpp"
|
||||
"../../../../../modules/juce_audio_devices/juce_audio_devices.mm"
|
||||
"../../../../../modules/juce_audio_devices/juce_audio_devices.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/include/private/all.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/deduplication/bitreader_read_rice_signed_block.c"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/deduplication/lpc_compute_autocorrelation_intrin.c"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/deduplication/lpc_compute_autocorrelation_intrin_neon.c"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/include/private/bitmath.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/include/private/bitreader.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/include/private/bitwriter.h"
|
||||
|
|
@ -366,11 +368,9 @@ add_library( ${BINARY_NAME}
|
|||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/include/private/lpc.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/include/private/md5.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/include/private/memory.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/include/private/metadata.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/include/private/stream_encoder.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/include/private/stream_encoder_framing.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/include/private/window.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/include/protected/all.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/include/protected/stream_decoder.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/include/protected/stream_encoder.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/bitmath.c"
|
||||
|
|
@ -382,6 +382,7 @@ add_library( ${BINARY_NAME}
|
|||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/float.c"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/format.c"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/lpc_flac.c"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/lpc_intrin_neon.c"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/md5.c"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/memory.c"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/stream_decoder.c"
|
||||
|
|
@ -397,8 +398,10 @@ add_library( ${BINARY_NAME}
|
|||
"../../../../../modules/juce_audio_formats/codecs/flac/export.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/Flac Licence.txt"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/format.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/JUCE_CHANGES.txt"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/metadata.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/ordinals.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/private.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/stream_decoder.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/stream_encoder.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/oggvorbis/libvorbis-1.3.7/lib/books/coupled/res_books_51.h"
|
||||
|
|
@ -2296,7 +2299,9 @@ set_source_files_properties(
|
|||
"../../../../../modules/juce_audio_devices/juce_audio_devices.cpp"
|
||||
"../../../../../modules/juce_audio_devices/juce_audio_devices.mm"
|
||||
"../../../../../modules/juce_audio_devices/juce_audio_devices.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/include/private/all.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/deduplication/bitreader_read_rice_signed_block.c"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/deduplication/lpc_compute_autocorrelation_intrin.c"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/deduplication/lpc_compute_autocorrelation_intrin_neon.c"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/include/private/bitmath.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/include/private/bitreader.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/include/private/bitwriter.h"
|
||||
|
|
@ -2308,11 +2313,9 @@ set_source_files_properties(
|
|||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/include/private/lpc.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/include/private/md5.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/include/private/memory.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/include/private/metadata.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/include/private/stream_encoder.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/include/private/stream_encoder_framing.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/include/private/window.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/include/protected/all.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/include/protected/stream_decoder.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/include/protected/stream_encoder.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/bitmath.c"
|
||||
|
|
@ -2324,6 +2327,7 @@ set_source_files_properties(
|
|||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/float.c"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/format.c"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/lpc_flac.c"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/lpc_intrin_neon.c"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/md5.c"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/memory.c"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/stream_decoder.c"
|
||||
|
|
@ -2339,8 +2343,10 @@ set_source_files_properties(
|
|||
"../../../../../modules/juce_audio_formats/codecs/flac/export.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/Flac Licence.txt"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/format.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/JUCE_CHANGES.txt"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/metadata.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/ordinals.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/private.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/stream_decoder.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/stream_encoder.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/oggvorbis/libvorbis-1.3.7/lib/books/coupled/res_books_51.h"
|
||||
|
|
|
|||
|
|
@ -531,6 +531,15 @@
|
|||
<ClCompile Include="..\..\..\..\modules\juce_audio_devices\juce_audio_devices.cpp">
|
||||
<ExcludedFromBuild>true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\deduplication\bitreader_read_rice_signed_block.c">
|
||||
<ExcludedFromBuild>true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\deduplication\lpc_compute_autocorrelation_intrin.c">
|
||||
<ExcludedFromBuild>true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\deduplication\lpc_compute_autocorrelation_intrin_neon.c">
|
||||
<ExcludedFromBuild>true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\bitmath.c">
|
||||
<ExcludedFromBuild>true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
|
|
@ -558,6 +567,9 @@
|
|||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\lpc_flac.c">
|
||||
<ExcludedFromBuild>true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\lpc_intrin_neon.c">
|
||||
<ExcludedFromBuild>true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\md5.c">
|
||||
<ExcludedFromBuild>true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
|
|
@ -2752,7 +2764,6 @@
|
|||
<ClInclude Include="..\..\..\..\modules\juce_audio_devices\sources\juce_AudioSourcePlayer.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_devices\sources\juce_AudioTransportSource.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_devices\juce_audio_devices.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\all.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\bitmath.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\bitreader.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\bitwriter.h"/>
|
||||
|
|
@ -2764,11 +2775,9 @@
|
|||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\lpc.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\md5.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\memory.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\metadata.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\stream_encoder.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\stream_encoder_framing.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\window.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\protected\all.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\protected\stream_decoder.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\protected\stream_encoder.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\all.h"/>
|
||||
|
|
@ -2781,6 +2790,7 @@
|
|||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\format.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\metadata.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\ordinals.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\private.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\stream_decoder.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\stream_encoder.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\oggvorbis\libvorbis-1.3.7\lib\books\coupled\res_books_51.h"/>
|
||||
|
|
@ -3646,6 +3656,7 @@
|
|||
<None Include="..\..\..\..\modules\juce_audio_devices\native\oboe\CMakeLists.txt"/>
|
||||
<None Include="..\..\..\..\modules\juce_audio_devices\native\oboe\README.md"/>
|
||||
<None Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\Flac Licence.txt"/>
|
||||
<None Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\JUCE_CHANGES.txt"/>
|
||||
<None Include="..\..\..\..\modules\juce_audio_formats\codecs\oggvorbis\libvorbis-1.3.7\README.md"/>
|
||||
<None Include="..\..\..\..\modules\juce_audio_formats\codecs\oggvorbis\Ogg Vorbis Licence.txt"/>
|
||||
<None Include="..\..\..\..\modules\juce_audio_processors\format_types\LV2_SDK\README.md"/>
|
||||
|
|
|
|||
|
|
@ -95,6 +95,9 @@
|
|||
<Filter Include="JUCE Modules\juce_audio_devices">
|
||||
<UniqueIdentifier>{9A5DB854-CFFB-5F88-C566-0E10F994DDB3}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="JUCE Modules\juce_audio_formats\codecs\flac\libFLAC\deduplication">
|
||||
<UniqueIdentifier>{2D16C77A-4E5B-B439-2856-90E03028DA07}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="JUCE Modules\juce_audio_formats\codecs\flac\libFLAC\include\private">
|
||||
<UniqueIdentifier>{38A5DDC7-416E-548F-39DA-887875FE6B20}</UniqueIdentifier>
|
||||
</Filter>
|
||||
|
|
@ -1057,6 +1060,15 @@
|
|||
<ClCompile Include="..\..\..\..\modules\juce_audio_devices\juce_audio_devices.mm">
|
||||
<Filter>JUCE Modules\juce_audio_devices</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\deduplication\bitreader_read_rice_signed_block.c">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC\deduplication</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\deduplication\lpc_compute_autocorrelation_intrin.c">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC\deduplication</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\deduplication\lpc_compute_autocorrelation_intrin_neon.c">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC\deduplication</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\bitmath.c">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC</Filter>
|
||||
</ClCompile>
|
||||
|
|
@ -1084,6 +1096,9 @@
|
|||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\lpc_flac.c">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\lpc_intrin_neon.c">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\md5.c">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC</Filter>
|
||||
</ClCompile>
|
||||
|
|
@ -3762,9 +3777,6 @@
|
|||
<ClInclude Include="..\..\..\..\modules\juce_audio_devices\juce_audio_devices.h">
|
||||
<Filter>JUCE Modules\juce_audio_devices</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\all.h">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC\include\private</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\bitmath.h">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC\include\private</Filter>
|
||||
</ClInclude>
|
||||
|
|
@ -3798,9 +3810,6 @@
|
|||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\memory.h">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC\include\private</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\metadata.h">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC\include\private</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\stream_encoder.h">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC\include\private</Filter>
|
||||
</ClInclude>
|
||||
|
|
@ -3810,9 +3819,6 @@
|
|||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\window.h">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC\include\private</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\protected\all.h">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC\include\protected</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\protected\stream_decoder.h">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC\include\protected</Filter>
|
||||
</ClInclude>
|
||||
|
|
@ -3849,6 +3855,9 @@
|
|||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\ordinals.h">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\private.h">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\stream_decoder.h">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac</Filter>
|
||||
</ClInclude>
|
||||
|
|
@ -6440,6 +6449,9 @@
|
|||
<None Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\Flac Licence.txt">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac</Filter>
|
||||
</None>
|
||||
<None Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\JUCE_CHANGES.txt">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac</Filter>
|
||||
</None>
|
||||
<None Include="..\..\..\..\modules\juce_audio_formats\codecs\oggvorbis\libvorbis-1.3.7\README.md">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\oggvorbis\libvorbis-1.3.7</Filter>
|
||||
</None>
|
||||
|
|
|
|||
|
|
@ -531,6 +531,15 @@
|
|||
<ClCompile Include="..\..\..\..\modules\juce_audio_devices\juce_audio_devices.cpp">
|
||||
<ExcludedFromBuild>true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\deduplication\bitreader_read_rice_signed_block.c">
|
||||
<ExcludedFromBuild>true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\deduplication\lpc_compute_autocorrelation_intrin.c">
|
||||
<ExcludedFromBuild>true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\deduplication\lpc_compute_autocorrelation_intrin_neon.c">
|
||||
<ExcludedFromBuild>true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\bitmath.c">
|
||||
<ExcludedFromBuild>true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
|
|
@ -558,6 +567,9 @@
|
|||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\lpc_flac.c">
|
||||
<ExcludedFromBuild>true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\lpc_intrin_neon.c">
|
||||
<ExcludedFromBuild>true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\md5.c">
|
||||
<ExcludedFromBuild>true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
|
|
@ -2752,7 +2764,6 @@
|
|||
<ClInclude Include="..\..\..\..\modules\juce_audio_devices\sources\juce_AudioSourcePlayer.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_devices\sources\juce_AudioTransportSource.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_devices\juce_audio_devices.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\all.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\bitmath.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\bitreader.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\bitwriter.h"/>
|
||||
|
|
@ -2764,11 +2775,9 @@
|
|||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\lpc.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\md5.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\memory.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\metadata.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\stream_encoder.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\stream_encoder_framing.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\window.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\protected\all.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\protected\stream_decoder.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\protected\stream_encoder.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\all.h"/>
|
||||
|
|
@ -2781,6 +2790,7 @@
|
|||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\format.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\metadata.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\ordinals.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\private.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\stream_decoder.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\stream_encoder.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\oggvorbis\libvorbis-1.3.7\lib\books\coupled\res_books_51.h"/>
|
||||
|
|
@ -3646,6 +3656,7 @@
|
|||
<None Include="..\..\..\..\modules\juce_audio_devices\native\oboe\CMakeLists.txt"/>
|
||||
<None Include="..\..\..\..\modules\juce_audio_devices\native\oboe\README.md"/>
|
||||
<None Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\Flac Licence.txt"/>
|
||||
<None Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\JUCE_CHANGES.txt"/>
|
||||
<None Include="..\..\..\..\modules\juce_audio_formats\codecs\oggvorbis\libvorbis-1.3.7\README.md"/>
|
||||
<None Include="..\..\..\..\modules\juce_audio_formats\codecs\oggvorbis\Ogg Vorbis Licence.txt"/>
|
||||
<None Include="..\..\..\..\modules\juce_audio_processors\format_types\LV2_SDK\README.md"/>
|
||||
|
|
|
|||
|
|
@ -95,6 +95,9 @@
|
|||
<Filter Include="JUCE Modules\juce_audio_devices">
|
||||
<UniqueIdentifier>{9A5DB854-CFFB-5F88-C566-0E10F994DDB3}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="JUCE Modules\juce_audio_formats\codecs\flac\libFLAC\deduplication">
|
||||
<UniqueIdentifier>{2D16C77A-4E5B-B439-2856-90E03028DA07}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="JUCE Modules\juce_audio_formats\codecs\flac\libFLAC\include\private">
|
||||
<UniqueIdentifier>{38A5DDC7-416E-548F-39DA-887875FE6B20}</UniqueIdentifier>
|
||||
</Filter>
|
||||
|
|
@ -1057,6 +1060,15 @@
|
|||
<ClCompile Include="..\..\..\..\modules\juce_audio_devices\juce_audio_devices.mm">
|
||||
<Filter>JUCE Modules\juce_audio_devices</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\deduplication\bitreader_read_rice_signed_block.c">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC\deduplication</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\deduplication\lpc_compute_autocorrelation_intrin.c">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC\deduplication</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\deduplication\lpc_compute_autocorrelation_intrin_neon.c">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC\deduplication</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\bitmath.c">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC</Filter>
|
||||
</ClCompile>
|
||||
|
|
@ -1084,6 +1096,9 @@
|
|||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\lpc_flac.c">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\lpc_intrin_neon.c">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\md5.c">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC</Filter>
|
||||
</ClCompile>
|
||||
|
|
@ -3762,9 +3777,6 @@
|
|||
<ClInclude Include="..\..\..\..\modules\juce_audio_devices\juce_audio_devices.h">
|
||||
<Filter>JUCE Modules\juce_audio_devices</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\all.h">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC\include\private</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\bitmath.h">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC\include\private</Filter>
|
||||
</ClInclude>
|
||||
|
|
@ -3798,9 +3810,6 @@
|
|||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\memory.h">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC\include\private</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\metadata.h">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC\include\private</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\stream_encoder.h">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC\include\private</Filter>
|
||||
</ClInclude>
|
||||
|
|
@ -3810,9 +3819,6 @@
|
|||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\window.h">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC\include\private</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\protected\all.h">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC\include\protected</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\protected\stream_decoder.h">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC\include\protected</Filter>
|
||||
</ClInclude>
|
||||
|
|
@ -3849,6 +3855,9 @@
|
|||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\ordinals.h">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\private.h">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\stream_decoder.h">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac</Filter>
|
||||
</ClInclude>
|
||||
|
|
@ -6440,6 +6449,9 @@
|
|||
<None Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\Flac Licence.txt">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac</Filter>
|
||||
</None>
|
||||
<None Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\JUCE_CHANGES.txt">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac</Filter>
|
||||
</None>
|
||||
<None Include="..\..\..\..\modules\juce_audio_formats\codecs\oggvorbis\libvorbis-1.3.7\README.md">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\oggvorbis\libvorbis-1.3.7</Filter>
|
||||
</None>
|
||||
|
|
|
|||
|
|
@ -531,6 +531,15 @@
|
|||
<ClCompile Include="..\..\..\..\modules\juce_audio_devices\juce_audio_devices.cpp">
|
||||
<ExcludedFromBuild>true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\deduplication\bitreader_read_rice_signed_block.c">
|
||||
<ExcludedFromBuild>true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\deduplication\lpc_compute_autocorrelation_intrin.c">
|
||||
<ExcludedFromBuild>true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\deduplication\lpc_compute_autocorrelation_intrin_neon.c">
|
||||
<ExcludedFromBuild>true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\bitmath.c">
|
||||
<ExcludedFromBuild>true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
|
|
@ -558,6 +567,9 @@
|
|||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\lpc_flac.c">
|
||||
<ExcludedFromBuild>true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\lpc_intrin_neon.c">
|
||||
<ExcludedFromBuild>true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\md5.c">
|
||||
<ExcludedFromBuild>true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
|
|
@ -2752,7 +2764,6 @@
|
|||
<ClInclude Include="..\..\..\..\modules\juce_audio_devices\sources\juce_AudioSourcePlayer.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_devices\sources\juce_AudioTransportSource.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_devices\juce_audio_devices.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\all.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\bitmath.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\bitreader.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\bitwriter.h"/>
|
||||
|
|
@ -2764,11 +2775,9 @@
|
|||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\lpc.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\md5.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\memory.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\metadata.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\stream_encoder.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\stream_encoder_framing.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\window.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\protected\all.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\protected\stream_decoder.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\protected\stream_encoder.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\all.h"/>
|
||||
|
|
@ -2781,6 +2790,7 @@
|
|||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\format.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\metadata.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\ordinals.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\private.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\stream_decoder.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\stream_encoder.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\oggvorbis\libvorbis-1.3.7\lib\books\coupled\res_books_51.h"/>
|
||||
|
|
@ -3646,6 +3656,7 @@
|
|||
<None Include="..\..\..\..\modules\juce_audio_devices\native\oboe\CMakeLists.txt"/>
|
||||
<None Include="..\..\..\..\modules\juce_audio_devices\native\oboe\README.md"/>
|
||||
<None Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\Flac Licence.txt"/>
|
||||
<None Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\JUCE_CHANGES.txt"/>
|
||||
<None Include="..\..\..\..\modules\juce_audio_formats\codecs\oggvorbis\libvorbis-1.3.7\README.md"/>
|
||||
<None Include="..\..\..\..\modules\juce_audio_formats\codecs\oggvorbis\Ogg Vorbis Licence.txt"/>
|
||||
<None Include="..\..\..\..\modules\juce_audio_processors\format_types\LV2_SDK\README.md"/>
|
||||
|
|
|
|||
|
|
@ -95,6 +95,9 @@
|
|||
<Filter Include="JUCE Modules\juce_audio_devices">
|
||||
<UniqueIdentifier>{9A5DB854-CFFB-5F88-C566-0E10F994DDB3}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="JUCE Modules\juce_audio_formats\codecs\flac\libFLAC\deduplication">
|
||||
<UniqueIdentifier>{2D16C77A-4E5B-B439-2856-90E03028DA07}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="JUCE Modules\juce_audio_formats\codecs\flac\libFLAC\include\private">
|
||||
<UniqueIdentifier>{38A5DDC7-416E-548F-39DA-887875FE6B20}</UniqueIdentifier>
|
||||
</Filter>
|
||||
|
|
@ -1057,6 +1060,15 @@
|
|||
<ClCompile Include="..\..\..\..\modules\juce_audio_devices\juce_audio_devices.mm">
|
||||
<Filter>JUCE Modules\juce_audio_devices</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\deduplication\bitreader_read_rice_signed_block.c">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC\deduplication</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\deduplication\lpc_compute_autocorrelation_intrin.c">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC\deduplication</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\deduplication\lpc_compute_autocorrelation_intrin_neon.c">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC\deduplication</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\bitmath.c">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC</Filter>
|
||||
</ClCompile>
|
||||
|
|
@ -1084,6 +1096,9 @@
|
|||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\lpc_flac.c">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\lpc_intrin_neon.c">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\md5.c">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC</Filter>
|
||||
</ClCompile>
|
||||
|
|
@ -3762,9 +3777,6 @@
|
|||
<ClInclude Include="..\..\..\..\modules\juce_audio_devices\juce_audio_devices.h">
|
||||
<Filter>JUCE Modules\juce_audio_devices</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\all.h">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC\include\private</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\bitmath.h">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC\include\private</Filter>
|
||||
</ClInclude>
|
||||
|
|
@ -3798,9 +3810,6 @@
|
|||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\memory.h">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC\include\private</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\metadata.h">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC\include\private</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\stream_encoder.h">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC\include\private</Filter>
|
||||
</ClInclude>
|
||||
|
|
@ -3810,9 +3819,6 @@
|
|||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\window.h">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC\include\private</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\protected\all.h">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC\include\protected</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\protected\stream_decoder.h">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC\include\protected</Filter>
|
||||
</ClInclude>
|
||||
|
|
@ -3849,6 +3855,9 @@
|
|||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\ordinals.h">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\private.h">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\stream_decoder.h">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac</Filter>
|
||||
</ClInclude>
|
||||
|
|
@ -6440,6 +6449,9 @@
|
|||
<None Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\Flac Licence.txt">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac</Filter>
|
||||
</None>
|
||||
<None Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\JUCE_CHANGES.txt">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac</Filter>
|
||||
</None>
|
||||
<None Include="..\..\..\..\modules\juce_audio_formats\codecs\oggvorbis\libvorbis-1.3.7\README.md">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\oggvorbis\libvorbis-1.3.7</Filter>
|
||||
</None>
|
||||
|
|
|
|||
|
|
@ -325,7 +325,9 @@ add_library( ${BINARY_NAME}
|
|||
"../../../../../modules/juce_audio_devices/juce_audio_devices.cpp"
|
||||
"../../../../../modules/juce_audio_devices/juce_audio_devices.mm"
|
||||
"../../../../../modules/juce_audio_devices/juce_audio_devices.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/include/private/all.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/deduplication/bitreader_read_rice_signed_block.c"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/deduplication/lpc_compute_autocorrelation_intrin.c"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/deduplication/lpc_compute_autocorrelation_intrin_neon.c"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/include/private/bitmath.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/include/private/bitreader.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/include/private/bitwriter.h"
|
||||
|
|
@ -337,11 +339,9 @@ add_library( ${BINARY_NAME}
|
|||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/include/private/lpc.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/include/private/md5.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/include/private/memory.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/include/private/metadata.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/include/private/stream_encoder.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/include/private/stream_encoder_framing.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/include/private/window.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/include/protected/all.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/include/protected/stream_decoder.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/include/protected/stream_encoder.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/bitmath.c"
|
||||
|
|
@ -353,6 +353,7 @@ add_library( ${BINARY_NAME}
|
|||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/float.c"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/format.c"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/lpc_flac.c"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/lpc_intrin_neon.c"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/md5.c"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/memory.c"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/stream_decoder.c"
|
||||
|
|
@ -368,8 +369,10 @@ add_library( ${BINARY_NAME}
|
|||
"../../../../../modules/juce_audio_formats/codecs/flac/export.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/Flac Licence.txt"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/format.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/JUCE_CHANGES.txt"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/metadata.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/ordinals.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/private.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/stream_decoder.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/stream_encoder.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/oggvorbis/libvorbis-1.3.7/lib/books/coupled/res_books_51.h"
|
||||
|
|
@ -2194,7 +2197,9 @@ set_source_files_properties(
|
|||
"../../../../../modules/juce_audio_devices/juce_audio_devices.cpp"
|
||||
"../../../../../modules/juce_audio_devices/juce_audio_devices.mm"
|
||||
"../../../../../modules/juce_audio_devices/juce_audio_devices.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/include/private/all.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/deduplication/bitreader_read_rice_signed_block.c"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/deduplication/lpc_compute_autocorrelation_intrin.c"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/deduplication/lpc_compute_autocorrelation_intrin_neon.c"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/include/private/bitmath.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/include/private/bitreader.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/include/private/bitwriter.h"
|
||||
|
|
@ -2206,11 +2211,9 @@ set_source_files_properties(
|
|||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/include/private/lpc.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/include/private/md5.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/include/private/memory.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/include/private/metadata.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/include/private/stream_encoder.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/include/private/stream_encoder_framing.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/include/private/window.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/include/protected/all.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/include/protected/stream_decoder.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/include/protected/stream_encoder.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/bitmath.c"
|
||||
|
|
@ -2222,6 +2225,7 @@ set_source_files_properties(
|
|||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/float.c"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/format.c"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/lpc_flac.c"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/lpc_intrin_neon.c"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/md5.c"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/memory.c"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/libFLAC/stream_decoder.c"
|
||||
|
|
@ -2237,8 +2241,10 @@ set_source_files_properties(
|
|||
"../../../../../modules/juce_audio_formats/codecs/flac/export.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/Flac Licence.txt"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/format.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/JUCE_CHANGES.txt"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/metadata.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/ordinals.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/private.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/stream_decoder.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/flac/stream_encoder.h"
|
||||
"../../../../../modules/juce_audio_formats/codecs/oggvorbis/libvorbis-1.3.7/lib/books/coupled/res_books_51.h"
|
||||
|
|
|
|||
|
|
@ -523,6 +523,15 @@
|
|||
<ClCompile Include="..\..\..\..\modules\juce_audio_devices\juce_audio_devices.cpp">
|
||||
<ExcludedFromBuild>true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\deduplication\bitreader_read_rice_signed_block.c">
|
||||
<ExcludedFromBuild>true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\deduplication\lpc_compute_autocorrelation_intrin.c">
|
||||
<ExcludedFromBuild>true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\deduplication\lpc_compute_autocorrelation_intrin_neon.c">
|
||||
<ExcludedFromBuild>true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\bitmath.c">
|
||||
<ExcludedFromBuild>true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
|
|
@ -550,6 +559,9 @@
|
|||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\lpc_flac.c">
|
||||
<ExcludedFromBuild>true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\lpc_intrin_neon.c">
|
||||
<ExcludedFromBuild>true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\md5.c">
|
||||
<ExcludedFromBuild>true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
|
|
@ -2663,7 +2675,6 @@
|
|||
<ClInclude Include="..\..\..\..\modules\juce_audio_devices\sources\juce_AudioSourcePlayer.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_devices\sources\juce_AudioTransportSource.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_devices\juce_audio_devices.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\all.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\bitmath.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\bitreader.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\bitwriter.h"/>
|
||||
|
|
@ -2675,11 +2686,9 @@
|
|||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\lpc.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\md5.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\memory.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\metadata.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\stream_encoder.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\stream_encoder_framing.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\window.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\protected\all.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\protected\stream_decoder.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\protected\stream_encoder.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\all.h"/>
|
||||
|
|
@ -2692,6 +2701,7 @@
|
|||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\format.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\metadata.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\ordinals.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\private.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\stream_decoder.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\stream_encoder.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\oggvorbis\libvorbis-1.3.7\lib\books\coupled\res_books_51.h"/>
|
||||
|
|
@ -3514,6 +3524,7 @@
|
|||
<None Include="..\..\..\..\modules\juce_audio_devices\native\oboe\CMakeLists.txt"/>
|
||||
<None Include="..\..\..\..\modules\juce_audio_devices\native\oboe\README.md"/>
|
||||
<None Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\Flac Licence.txt"/>
|
||||
<None Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\JUCE_CHANGES.txt"/>
|
||||
<None Include="..\..\..\..\modules\juce_audio_formats\codecs\oggvorbis\libvorbis-1.3.7\README.md"/>
|
||||
<None Include="..\..\..\..\modules\juce_audio_formats\codecs\oggvorbis\Ogg Vorbis Licence.txt"/>
|
||||
<None Include="..\..\..\..\modules\juce_audio_processors\format_types\LV2_SDK\README.md"/>
|
||||
|
|
|
|||
|
|
@ -86,6 +86,9 @@
|
|||
<Filter Include="JUCE Modules\juce_audio_devices">
|
||||
<UniqueIdentifier>{9A5DB854-CFFB-5F88-C566-0E10F994DDB3}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="JUCE Modules\juce_audio_formats\codecs\flac\libFLAC\deduplication">
|
||||
<UniqueIdentifier>{2D16C77A-4E5B-B439-2856-90E03028DA07}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="JUCE Modules\juce_audio_formats\codecs\flac\libFLAC\include\private">
|
||||
<UniqueIdentifier>{38A5DDC7-416E-548F-39DA-887875FE6B20}</UniqueIdentifier>
|
||||
</Filter>
|
||||
|
|
@ -1012,6 +1015,15 @@
|
|||
<ClCompile Include="..\..\..\..\modules\juce_audio_devices\juce_audio_devices.mm">
|
||||
<Filter>JUCE Modules\juce_audio_devices</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\deduplication\bitreader_read_rice_signed_block.c">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC\deduplication</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\deduplication\lpc_compute_autocorrelation_intrin.c">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC\deduplication</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\deduplication\lpc_compute_autocorrelation_intrin_neon.c">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC\deduplication</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\bitmath.c">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC</Filter>
|
||||
</ClCompile>
|
||||
|
|
@ -1039,6 +1051,9 @@
|
|||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\lpc_flac.c">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\lpc_intrin_neon.c">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\md5.c">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC</Filter>
|
||||
</ClCompile>
|
||||
|
|
@ -3627,9 +3642,6 @@
|
|||
<ClInclude Include="..\..\..\..\modules\juce_audio_devices\juce_audio_devices.h">
|
||||
<Filter>JUCE Modules\juce_audio_devices</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\all.h">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC\include\private</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\bitmath.h">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC\include\private</Filter>
|
||||
</ClInclude>
|
||||
|
|
@ -3663,9 +3675,6 @@
|
|||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\memory.h">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC\include\private</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\metadata.h">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC\include\private</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\stream_encoder.h">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC\include\private</Filter>
|
||||
</ClInclude>
|
||||
|
|
@ -3675,9 +3684,6 @@
|
|||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\window.h">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC\include\private</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\protected\all.h">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC\include\protected</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\protected\stream_decoder.h">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC\include\protected</Filter>
|
||||
</ClInclude>
|
||||
|
|
@ -3714,6 +3720,9 @@
|
|||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\ordinals.h">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\private.h">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\stream_decoder.h">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac</Filter>
|
||||
</ClInclude>
|
||||
|
|
@ -6176,6 +6185,9 @@
|
|||
<None Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\Flac Licence.txt">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac</Filter>
|
||||
</None>
|
||||
<None Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\JUCE_CHANGES.txt">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac</Filter>
|
||||
</None>
|
||||
<None Include="..\..\..\..\modules\juce_audio_formats\codecs\oggvorbis\libvorbis-1.3.7\README.md">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\oggvorbis\libvorbis-1.3.7</Filter>
|
||||
</None>
|
||||
|
|
|
|||
|
|
@ -539,6 +539,15 @@
|
|||
<ClCompile Include="..\..\..\..\modules\juce_audio_devices\juce_audio_devices.cpp">
|
||||
<ExcludedFromBuild>true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\deduplication\bitreader_read_rice_signed_block.c">
|
||||
<ExcludedFromBuild>true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\deduplication\lpc_compute_autocorrelation_intrin.c">
|
||||
<ExcludedFromBuild>true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\deduplication\lpc_compute_autocorrelation_intrin_neon.c">
|
||||
<ExcludedFromBuild>true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\bitmath.c">
|
||||
<ExcludedFromBuild>true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
|
|
@ -566,6 +575,9 @@
|
|||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\lpc_flac.c">
|
||||
<ExcludedFromBuild>true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\lpc_intrin_neon.c">
|
||||
<ExcludedFromBuild>true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\md5.c">
|
||||
<ExcludedFromBuild>true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
|
|
@ -2845,7 +2857,6 @@
|
|||
<ClInclude Include="..\..\..\..\modules\juce_audio_devices\sources\juce_AudioSourcePlayer.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_devices\sources\juce_AudioTransportSource.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_devices\juce_audio_devices.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\all.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\bitmath.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\bitreader.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\bitwriter.h"/>
|
||||
|
|
@ -2857,11 +2868,9 @@
|
|||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\lpc.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\md5.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\memory.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\metadata.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\stream_encoder.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\stream_encoder_framing.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\window.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\protected\all.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\protected\stream_decoder.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\protected\stream_encoder.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\all.h"/>
|
||||
|
|
@ -2874,6 +2883,7 @@
|
|||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\format.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\metadata.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\ordinals.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\private.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\stream_decoder.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\stream_encoder.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\oggvorbis\libvorbis-1.3.7\lib\books\coupled\res_books_51.h"/>
|
||||
|
|
@ -3777,6 +3787,7 @@
|
|||
<None Include="..\..\..\..\modules\juce_audio_devices\native\oboe\CMakeLists.txt"/>
|
||||
<None Include="..\..\..\..\modules\juce_audio_devices\native\oboe\README.md"/>
|
||||
<None Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\Flac Licence.txt"/>
|
||||
<None Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\JUCE_CHANGES.txt"/>
|
||||
<None Include="..\..\..\..\modules\juce_audio_formats\codecs\oggvorbis\libvorbis-1.3.7\README.md"/>
|
||||
<None Include="..\..\..\..\modules\juce_audio_formats\codecs\oggvorbis\Ogg Vorbis Licence.txt"/>
|
||||
<None Include="..\..\..\..\modules\juce_audio_processors\format_types\LV2_SDK\README.md"/>
|
||||
|
|
|
|||
|
|
@ -95,6 +95,9 @@
|
|||
<Filter Include="JUCE Modules\juce_audio_devices">
|
||||
<UniqueIdentifier>{9A5DB854-CFFB-5F88-C566-0E10F994DDB3}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="JUCE Modules\juce_audio_formats\codecs\flac\libFLAC\deduplication">
|
||||
<UniqueIdentifier>{2D16C77A-4E5B-B439-2856-90E03028DA07}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="JUCE Modules\juce_audio_formats\codecs\flac\libFLAC\include\private">
|
||||
<UniqueIdentifier>{38A5DDC7-416E-548F-39DA-887875FE6B20}</UniqueIdentifier>
|
||||
</Filter>
|
||||
|
|
@ -1078,6 +1081,15 @@
|
|||
<ClCompile Include="..\..\..\..\modules\juce_audio_devices\juce_audio_devices.mm">
|
||||
<Filter>JUCE Modules\juce_audio_devices</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\deduplication\bitreader_read_rice_signed_block.c">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC\deduplication</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\deduplication\lpc_compute_autocorrelation_intrin.c">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC\deduplication</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\deduplication\lpc_compute_autocorrelation_intrin_neon.c">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC\deduplication</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\bitmath.c">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC</Filter>
|
||||
</ClCompile>
|
||||
|
|
@ -1105,6 +1117,9 @@
|
|||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\lpc_flac.c">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\lpc_intrin_neon.c">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\md5.c">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC</Filter>
|
||||
</ClCompile>
|
||||
|
|
@ -3873,9 +3888,6 @@
|
|||
<ClInclude Include="..\..\..\..\modules\juce_audio_devices\juce_audio_devices.h">
|
||||
<Filter>JUCE Modules\juce_audio_devices</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\all.h">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC\include\private</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\bitmath.h">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC\include\private</Filter>
|
||||
</ClInclude>
|
||||
|
|
@ -3909,9 +3921,6 @@
|
|||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\memory.h">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC\include\private</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\metadata.h">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC\include\private</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\stream_encoder.h">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC\include\private</Filter>
|
||||
</ClInclude>
|
||||
|
|
@ -3921,9 +3930,6 @@
|
|||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\window.h">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC\include\private</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\protected\all.h">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC\include\protected</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\protected\stream_decoder.h">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC\include\protected</Filter>
|
||||
</ClInclude>
|
||||
|
|
@ -3960,6 +3966,9 @@
|
|||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\ordinals.h">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\private.h">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\stream_decoder.h">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac</Filter>
|
||||
</ClInclude>
|
||||
|
|
@ -6665,6 +6674,9 @@
|
|||
<None Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\Flac Licence.txt">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac</Filter>
|
||||
</None>
|
||||
<None Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\JUCE_CHANGES.txt">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac</Filter>
|
||||
</None>
|
||||
<None Include="..\..\..\..\modules\juce_audio_formats\codecs\oggvorbis\libvorbis-1.3.7\README.md">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\oggvorbis\libvorbis-1.3.7</Filter>
|
||||
</None>
|
||||
|
|
|
|||
|
|
@ -539,6 +539,15 @@
|
|||
<ClCompile Include="..\..\..\..\modules\juce_audio_devices\juce_audio_devices.cpp">
|
||||
<ExcludedFromBuild>true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\deduplication\bitreader_read_rice_signed_block.c">
|
||||
<ExcludedFromBuild>true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\deduplication\lpc_compute_autocorrelation_intrin.c">
|
||||
<ExcludedFromBuild>true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\deduplication\lpc_compute_autocorrelation_intrin_neon.c">
|
||||
<ExcludedFromBuild>true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\bitmath.c">
|
||||
<ExcludedFromBuild>true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
|
|
@ -566,6 +575,9 @@
|
|||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\lpc_flac.c">
|
||||
<ExcludedFromBuild>true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\lpc_intrin_neon.c">
|
||||
<ExcludedFromBuild>true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\md5.c">
|
||||
<ExcludedFromBuild>true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
|
|
@ -2845,7 +2857,6 @@
|
|||
<ClInclude Include="..\..\..\..\modules\juce_audio_devices\sources\juce_AudioSourcePlayer.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_devices\sources\juce_AudioTransportSource.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_devices\juce_audio_devices.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\all.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\bitmath.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\bitreader.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\bitwriter.h"/>
|
||||
|
|
@ -2857,11 +2868,9 @@
|
|||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\lpc.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\md5.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\memory.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\metadata.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\stream_encoder.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\stream_encoder_framing.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\window.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\protected\all.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\protected\stream_decoder.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\protected\stream_encoder.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\all.h"/>
|
||||
|
|
@ -2874,6 +2883,7 @@
|
|||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\format.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\metadata.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\ordinals.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\private.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\stream_decoder.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\stream_encoder.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\oggvorbis\libvorbis-1.3.7\lib\books\coupled\res_books_51.h"/>
|
||||
|
|
@ -3777,6 +3787,7 @@
|
|||
<None Include="..\..\..\..\modules\juce_audio_devices\native\oboe\CMakeLists.txt"/>
|
||||
<None Include="..\..\..\..\modules\juce_audio_devices\native\oboe\README.md"/>
|
||||
<None Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\Flac Licence.txt"/>
|
||||
<None Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\JUCE_CHANGES.txt"/>
|
||||
<None Include="..\..\..\..\modules\juce_audio_formats\codecs\oggvorbis\libvorbis-1.3.7\README.md"/>
|
||||
<None Include="..\..\..\..\modules\juce_audio_formats\codecs\oggvorbis\Ogg Vorbis Licence.txt"/>
|
||||
<None Include="..\..\..\..\modules\juce_audio_processors\format_types\LV2_SDK\README.md"/>
|
||||
|
|
|
|||
|
|
@ -95,6 +95,9 @@
|
|||
<Filter Include="JUCE Modules\juce_audio_devices">
|
||||
<UniqueIdentifier>{9A5DB854-CFFB-5F88-C566-0E10F994DDB3}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="JUCE Modules\juce_audio_formats\codecs\flac\libFLAC\deduplication">
|
||||
<UniqueIdentifier>{2D16C77A-4E5B-B439-2856-90E03028DA07}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="JUCE Modules\juce_audio_formats\codecs\flac\libFLAC\include\private">
|
||||
<UniqueIdentifier>{38A5DDC7-416E-548F-39DA-887875FE6B20}</UniqueIdentifier>
|
||||
</Filter>
|
||||
|
|
@ -1078,6 +1081,15 @@
|
|||
<ClCompile Include="..\..\..\..\modules\juce_audio_devices\juce_audio_devices.mm">
|
||||
<Filter>JUCE Modules\juce_audio_devices</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\deduplication\bitreader_read_rice_signed_block.c">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC\deduplication</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\deduplication\lpc_compute_autocorrelation_intrin.c">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC\deduplication</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\deduplication\lpc_compute_autocorrelation_intrin_neon.c">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC\deduplication</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\bitmath.c">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC</Filter>
|
||||
</ClCompile>
|
||||
|
|
@ -1105,6 +1117,9 @@
|
|||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\lpc_flac.c">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\lpc_intrin_neon.c">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\md5.c">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC</Filter>
|
||||
</ClCompile>
|
||||
|
|
@ -3873,9 +3888,6 @@
|
|||
<ClInclude Include="..\..\..\..\modules\juce_audio_devices\juce_audio_devices.h">
|
||||
<Filter>JUCE Modules\juce_audio_devices</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\all.h">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC\include\private</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\bitmath.h">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC\include\private</Filter>
|
||||
</ClInclude>
|
||||
|
|
@ -3909,9 +3921,6 @@
|
|||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\memory.h">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC\include\private</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\metadata.h">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC\include\private</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\stream_encoder.h">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC\include\private</Filter>
|
||||
</ClInclude>
|
||||
|
|
@ -3921,9 +3930,6 @@
|
|||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\window.h">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC\include\private</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\protected\all.h">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC\include\protected</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\protected\stream_decoder.h">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC\include\protected</Filter>
|
||||
</ClInclude>
|
||||
|
|
@ -3960,6 +3966,9 @@
|
|||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\ordinals.h">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\private.h">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\stream_decoder.h">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac</Filter>
|
||||
</ClInclude>
|
||||
|
|
@ -6665,6 +6674,9 @@
|
|||
<None Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\Flac Licence.txt">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac</Filter>
|
||||
</None>
|
||||
<None Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\JUCE_CHANGES.txt">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac</Filter>
|
||||
</None>
|
||||
<None Include="..\..\..\..\modules\juce_audio_formats\codecs\oggvorbis\libvorbis-1.3.7\README.md">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\oggvorbis\libvorbis-1.3.7</Filter>
|
||||
</None>
|
||||
|
|
|
|||
|
|
@ -539,6 +539,15 @@
|
|||
<ClCompile Include="..\..\..\..\modules\juce_audio_devices\juce_audio_devices.cpp">
|
||||
<ExcludedFromBuild>true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\deduplication\bitreader_read_rice_signed_block.c">
|
||||
<ExcludedFromBuild>true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\deduplication\lpc_compute_autocorrelation_intrin.c">
|
||||
<ExcludedFromBuild>true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\deduplication\lpc_compute_autocorrelation_intrin_neon.c">
|
||||
<ExcludedFromBuild>true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\bitmath.c">
|
||||
<ExcludedFromBuild>true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
|
|
@ -566,6 +575,9 @@
|
|||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\lpc_flac.c">
|
||||
<ExcludedFromBuild>true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\lpc_intrin_neon.c">
|
||||
<ExcludedFromBuild>true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\md5.c">
|
||||
<ExcludedFromBuild>true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
|
|
@ -2845,7 +2857,6 @@
|
|||
<ClInclude Include="..\..\..\..\modules\juce_audio_devices\sources\juce_AudioSourcePlayer.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_devices\sources\juce_AudioTransportSource.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_devices\juce_audio_devices.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\all.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\bitmath.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\bitreader.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\bitwriter.h"/>
|
||||
|
|
@ -2857,11 +2868,9 @@
|
|||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\lpc.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\md5.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\memory.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\metadata.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\stream_encoder.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\stream_encoder_framing.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\window.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\protected\all.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\protected\stream_decoder.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\protected\stream_encoder.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\all.h"/>
|
||||
|
|
@ -2874,6 +2883,7 @@
|
|||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\format.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\metadata.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\ordinals.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\private.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\stream_decoder.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\stream_encoder.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\oggvorbis\libvorbis-1.3.7\lib\books\coupled\res_books_51.h"/>
|
||||
|
|
@ -3777,6 +3787,7 @@
|
|||
<None Include="..\..\..\..\modules\juce_audio_devices\native\oboe\CMakeLists.txt"/>
|
||||
<None Include="..\..\..\..\modules\juce_audio_devices\native\oboe\README.md"/>
|
||||
<None Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\Flac Licence.txt"/>
|
||||
<None Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\JUCE_CHANGES.txt"/>
|
||||
<None Include="..\..\..\..\modules\juce_audio_formats\codecs\oggvorbis\libvorbis-1.3.7\README.md"/>
|
||||
<None Include="..\..\..\..\modules\juce_audio_formats\codecs\oggvorbis\Ogg Vorbis Licence.txt"/>
|
||||
<None Include="..\..\..\..\modules\juce_audio_processors\format_types\LV2_SDK\README.md"/>
|
||||
|
|
|
|||
|
|
@ -95,6 +95,9 @@
|
|||
<Filter Include="JUCE Modules\juce_audio_devices">
|
||||
<UniqueIdentifier>{9A5DB854-CFFB-5F88-C566-0E10F994DDB3}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="JUCE Modules\juce_audio_formats\codecs\flac\libFLAC\deduplication">
|
||||
<UniqueIdentifier>{2D16C77A-4E5B-B439-2856-90E03028DA07}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="JUCE Modules\juce_audio_formats\codecs\flac\libFLAC\include\private">
|
||||
<UniqueIdentifier>{38A5DDC7-416E-548F-39DA-887875FE6B20}</UniqueIdentifier>
|
||||
</Filter>
|
||||
|
|
@ -1078,6 +1081,15 @@
|
|||
<ClCompile Include="..\..\..\..\modules\juce_audio_devices\juce_audio_devices.mm">
|
||||
<Filter>JUCE Modules\juce_audio_devices</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\deduplication\bitreader_read_rice_signed_block.c">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC\deduplication</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\deduplication\lpc_compute_autocorrelation_intrin.c">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC\deduplication</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\deduplication\lpc_compute_autocorrelation_intrin_neon.c">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC\deduplication</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\bitmath.c">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC</Filter>
|
||||
</ClCompile>
|
||||
|
|
@ -1105,6 +1117,9 @@
|
|||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\lpc_flac.c">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\lpc_intrin_neon.c">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\md5.c">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC</Filter>
|
||||
</ClCompile>
|
||||
|
|
@ -3873,9 +3888,6 @@
|
|||
<ClInclude Include="..\..\..\..\modules\juce_audio_devices\juce_audio_devices.h">
|
||||
<Filter>JUCE Modules\juce_audio_devices</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\all.h">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC\include\private</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\bitmath.h">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC\include\private</Filter>
|
||||
</ClInclude>
|
||||
|
|
@ -3909,9 +3921,6 @@
|
|||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\memory.h">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC\include\private</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\metadata.h">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC\include\private</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\stream_encoder.h">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC\include\private</Filter>
|
||||
</ClInclude>
|
||||
|
|
@ -3921,9 +3930,6 @@
|
|||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\window.h">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC\include\private</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\protected\all.h">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC\include\protected</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\protected\stream_decoder.h">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC\include\protected</Filter>
|
||||
</ClInclude>
|
||||
|
|
@ -3960,6 +3966,9 @@
|
|||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\ordinals.h">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\private.h">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\stream_decoder.h">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac</Filter>
|
||||
</ClInclude>
|
||||
|
|
@ -6665,6 +6674,9 @@
|
|||
<None Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\Flac Licence.txt">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac</Filter>
|
||||
</None>
|
||||
<None Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\JUCE_CHANGES.txt">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac</Filter>
|
||||
</None>
|
||||
<None Include="..\..\..\..\modules\juce_audio_formats\codecs\oggvorbis\libvorbis-1.3.7\README.md">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\oggvorbis\libvorbis-1.3.7</Filter>
|
||||
</None>
|
||||
|
|
|
|||
|
|
@ -522,6 +522,15 @@
|
|||
<ClCompile Include="..\..\..\..\modules\juce_audio_devices\juce_audio_devices.cpp">
|
||||
<ExcludedFromBuild>true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\deduplication\bitreader_read_rice_signed_block.c">
|
||||
<ExcludedFromBuild>true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\deduplication\lpc_compute_autocorrelation_intrin.c">
|
||||
<ExcludedFromBuild>true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\deduplication\lpc_compute_autocorrelation_intrin_neon.c">
|
||||
<ExcludedFromBuild>true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\bitmath.c">
|
||||
<ExcludedFromBuild>true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
|
|
@ -549,6 +558,9 @@
|
|||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\lpc_flac.c">
|
||||
<ExcludedFromBuild>true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\lpc_intrin_neon.c">
|
||||
<ExcludedFromBuild>true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\md5.c">
|
||||
<ExcludedFromBuild>true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
|
|
@ -2639,7 +2651,6 @@
|
|||
<ClInclude Include="..\..\..\..\modules\juce_audio_devices\sources\juce_AudioSourcePlayer.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_devices\sources\juce_AudioTransportSource.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_devices\juce_audio_devices.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\all.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\bitmath.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\bitreader.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\bitwriter.h"/>
|
||||
|
|
@ -2651,11 +2662,9 @@
|
|||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\lpc.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\md5.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\memory.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\metadata.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\stream_encoder.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\stream_encoder_framing.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\window.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\protected\all.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\protected\stream_decoder.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\protected\stream_encoder.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\all.h"/>
|
||||
|
|
@ -2668,6 +2677,7 @@
|
|||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\format.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\metadata.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\ordinals.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\private.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\stream_decoder.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\stream_encoder.h"/>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\oggvorbis\libvorbis-1.3.7\lib\books\coupled\res_books_51.h"/>
|
||||
|
|
@ -3490,6 +3500,7 @@
|
|||
<None Include="..\..\..\..\modules\juce_audio_devices\native\oboe\CMakeLists.txt"/>
|
||||
<None Include="..\..\..\..\modules\juce_audio_devices\native\oboe\README.md"/>
|
||||
<None Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\Flac Licence.txt"/>
|
||||
<None Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\JUCE_CHANGES.txt"/>
|
||||
<None Include="..\..\..\..\modules\juce_audio_formats\codecs\oggvorbis\libvorbis-1.3.7\README.md"/>
|
||||
<None Include="..\..\..\..\modules\juce_audio_formats\codecs\oggvorbis\Ogg Vorbis Licence.txt"/>
|
||||
<None Include="..\..\..\..\modules\juce_audio_processors\format_types\LV2_SDK\README.md"/>
|
||||
|
|
|
|||
|
|
@ -80,6 +80,9 @@
|
|||
<Filter Include="JUCE Modules\juce_audio_devices">
|
||||
<UniqueIdentifier>{9A5DB854-CFFB-5F88-C566-0E10F994DDB3}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="JUCE Modules\juce_audio_formats\codecs\flac\libFLAC\deduplication">
|
||||
<UniqueIdentifier>{2D16C77A-4E5B-B439-2856-90E03028DA07}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="JUCE Modules\juce_audio_formats\codecs\flac\libFLAC\include\private">
|
||||
<UniqueIdentifier>{38A5DDC7-416E-548F-39DA-887875FE6B20}</UniqueIdentifier>
|
||||
</Filter>
|
||||
|
|
@ -1009,6 +1012,15 @@
|
|||
<ClCompile Include="..\..\..\..\modules\juce_audio_devices\juce_audio_devices.mm">
|
||||
<Filter>JUCE Modules\juce_audio_devices</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\deduplication\bitreader_read_rice_signed_block.c">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC\deduplication</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\deduplication\lpc_compute_autocorrelation_intrin.c">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC\deduplication</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\deduplication\lpc_compute_autocorrelation_intrin_neon.c">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC\deduplication</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\bitmath.c">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC</Filter>
|
||||
</ClCompile>
|
||||
|
|
@ -1036,6 +1048,9 @@
|
|||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\lpc_flac.c">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\lpc_intrin_neon.c">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\md5.c">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC</Filter>
|
||||
</ClCompile>
|
||||
|
|
@ -3594,9 +3609,6 @@
|
|||
<ClInclude Include="..\..\..\..\modules\juce_audio_devices\juce_audio_devices.h">
|
||||
<Filter>JUCE Modules\juce_audio_devices</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\all.h">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC\include\private</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\bitmath.h">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC\include\private</Filter>
|
||||
</ClInclude>
|
||||
|
|
@ -3630,9 +3642,6 @@
|
|||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\memory.h">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC\include\private</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\metadata.h">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC\include\private</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\stream_encoder.h">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC\include\private</Filter>
|
||||
</ClInclude>
|
||||
|
|
@ -3642,9 +3651,6 @@
|
|||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\private\window.h">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC\include\private</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\protected\all.h">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC\include\protected</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\libFLAC\include\protected\stream_decoder.h">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac\libFLAC\include\protected</Filter>
|
||||
</ClInclude>
|
||||
|
|
@ -3681,6 +3687,9 @@
|
|||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\ordinals.h">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\private.h">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\stream_decoder.h">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac</Filter>
|
||||
</ClInclude>
|
||||
|
|
@ -6143,6 +6152,9 @@
|
|||
<None Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\Flac Licence.txt">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac</Filter>
|
||||
</None>
|
||||
<None Include="..\..\..\..\modules\juce_audio_formats\codecs\flac\JUCE_CHANGES.txt">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\flac</Filter>
|
||||
</None>
|
||||
<None Include="..\..\..\..\modules\juce_audio_formats\codecs\oggvorbis\libvorbis-1.3.7\README.md">
|
||||
<Filter>JUCE Modules\juce_audio_formats\codecs\oggvorbis\libvorbis-1.3.7</Filter>
|
||||
</None>
|
||||
|
|
|
|||
|
|
@ -20,8 +20,8 @@ distribution, visit the Flac homepage: https://xiph.org/flac/
|
|||
=====================================================================
|
||||
|
||||
libFLAC - Free Lossless Audio Codec library
|
||||
Copyright (C) 2001-2009 Josh Coalson
|
||||
Copyright (C) 2011-2016 Xiph.Org Foundation
|
||||
Copyright (C) 2000-2009 Josh Coalson
|
||||
Copyright (C) 2011-2023 Xiph.Org Foundation
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
|
|
@ -34,7 +34,7 @@ notice, this list of conditions and the following disclaimer.
|
|||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
- Neither the name of the Xiph.org Foundation nor the names of its
|
||||
- Neither the name of the Xiph.Org Foundation nor the names of its
|
||||
contributors may be used to endorse or promote products derived from
|
||||
this software without specific prior written permission.
|
||||
|
||||
|
|
|
|||
55
modules/juce_audio_formats/codecs/flac/JUCE_CHANGES.txt
Normal file
55
modules/juce_audio_formats/codecs/flac/JUCE_CHANGES.txt
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
The files in this directory are from the FLAC 1.4.3 release downloaded in a tarball from
|
||||
https://github.com/xiph/flac/releases/tag/1.4.3
|
||||
|
||||
They have been modified as little as possible, so that when they are included by
|
||||
juce_FlacAudioFormat.cpp they compile without warnings and work correctly on the supported
|
||||
platforms.
|
||||
|
||||
Below I will refer to the contents of the tarball as RELEASE and to our repo as JUCE.
|
||||
|
||||
The steps carried out when including the 1.4.3 version
|
||||
* The contents of RELEASE/include/FLAC and RELEASE/include/share were copied to
|
||||
JUCE/[..]/codecs/flac
|
||||
* The contents of RELEASE/libFLAC were copied to JUCE/[..]/codecs/flac/libFLAC
|
||||
* The includes in all these files were retargeted, to be relative to the file that does the
|
||||
including, so that we don't have to rely on e.g. flac/libFLAC/include being among the include
|
||||
directories, like it is when building FLAC with the official makefiles. All this retargeting is
|
||||
done per-line with a Python script. All the rules used for the retargeting can be seen in the code
|
||||
excerpt at [1].
|
||||
* Then I will do a compile/test/modify loop, until it works and compiles without warnings. The
|
||||
changes made are mostly C to C++ conversions like adding explicit casts, or fixing warnings, like
|
||||
eliminating always true branches that refer to preprocessor defines.
|
||||
* Then I delete all library files, and only re-add those that are needed for successful compilation.
|
||||
This delete step is propagated back to older commits, so that unneeded files are never added to
|
||||
the GIT repo.
|
||||
|
||||
|
||||
[1]: Code excerpt used for retargeting includes in the copied files
|
||||
```
|
||||
def transform(path: Path, line: str) -> str:
|
||||
if path.match("libFLAC/*"):
|
||||
line = line.replace('#include "private', '#include "include/private')
|
||||
line = line.replace('#include "protected', '#include "include/protected')
|
||||
line = line.replace('#include "share/', '#include "../')
|
||||
line = line.replace('#include "FLAC/', '#include "../')
|
||||
|
||||
if path.match("libFLAC/include/private/*") or path.match(
|
||||
"libFLAC/include/public/*"
|
||||
):
|
||||
line = line.replace('#include "share/', '#include "../../../')
|
||||
line = line.replace('#include "FLAC/', '#include "../../../')
|
||||
|
||||
if path.match("*"):
|
||||
line = line.replace('#include "share/', '#include "')
|
||||
|
||||
if path.match("libFLAC/include/private/*"):
|
||||
line = line.replace('#include "private/', '#include "')
|
||||
|
||||
if path.match("libFLAC/include/protected/*"):
|
||||
line = line.replace('#include "private/', '#include "../private/')
|
||||
line = line.replace('#include "FLAC/', '#include "../../../')
|
||||
|
||||
line = line.replace('#include "include/private/macros.h"', "")
|
||||
|
||||
return line
|
||||
```
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
/* libFLAC - Free Lossless Audio Codec library
|
||||
* Copyright (C) 2000-2009 Josh Coalson
|
||||
* Copyright (C) 2011-2016 Xiph.Org Foundation
|
||||
* Copyright (C) 2011-2023 Xiph.Org Foundation
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
|
|
@ -56,7 +56,7 @@
|
|||
* level idea of the structure and how to find the information you
|
||||
* need. As a prerequisite you should have at least a basic
|
||||
* knowledge of the FLAC format, documented
|
||||
* <A HREF="../format.html">here</A>.
|
||||
* <A HREF="https://xiph.org/flac/format.html">here</A>.
|
||||
*
|
||||
* \section c_api FLAC C API
|
||||
*
|
||||
|
|
@ -68,7 +68,7 @@
|
|||
*
|
||||
* By writing a little code and linking against libFLAC, it is
|
||||
* relatively easy to add FLAC support to another program. The
|
||||
* library is licensed under <A HREF="../license.html">Xiph's BSD license</A>.
|
||||
* library is licensed under <A HREF="https://xiph.org/flac/license.html">Xiph's BSD license</A>.
|
||||
* Complete source code of libFLAC as well as the command-line
|
||||
* encoder and plugins is available and is a useful source of
|
||||
* examples.
|
||||
|
|
@ -101,7 +101,7 @@
|
|||
* example /usr/include/FLAC++/...).
|
||||
*
|
||||
* libFLAC++ is also licensed under
|
||||
* <A HREF="../license.html">Xiph's BSD license</A>.
|
||||
* <A HREF="https://xiph.org/flac/license.html">Xiph's BSD license</A>.
|
||||
*
|
||||
* \section getting_started Getting Started
|
||||
*
|
||||
|
|
@ -117,7 +117,7 @@
|
|||
* functions through the links in top bar across this page.
|
||||
*
|
||||
* If you prefer a more hands-on approach, you can jump right to some
|
||||
* <A HREF="../documentation_example_code.html">example code</A>.
|
||||
* <A HREF="https://xiph.org/flac/documentation_example_code.html">example code</A>.
|
||||
*
|
||||
* \section porting_guide Porting Guide
|
||||
*
|
||||
|
|
@ -361,6 +361,85 @@
|
|||
* \c FLAC__FRAME_HEADER_BLOCKING_STRATEGY_LEN
|
||||
*/
|
||||
|
||||
/** \defgroup porting_1_3_4_to_1_4_0 Porting from FLAC 1.3.4 to 1.4.0
|
||||
* \ingroup porting
|
||||
*
|
||||
* \brief
|
||||
* This module describes porting from FLAC 1.3.4 to FLAC 1.4.0.
|
||||
*
|
||||
* \section porting_1_3_4_to_1_4_0_summary Summary
|
||||
*
|
||||
* Between FLAC 1.3.4 and FLAC 1.4.0, there have four breaking changes
|
||||
* - the function get_client_data_from_decoder has been renamed to
|
||||
* FLAC__get_decoder_client_data
|
||||
* - some data types in the FLAC__Frame struct have changed
|
||||
* - all functions resizing metadata blocks now return the object
|
||||
* untouched if memory allocation fails, whereas previously the
|
||||
* handling varied and was more or less undefined
|
||||
* - all functions accepting a filename now take UTF-8 encoded filenames
|
||||
* on Windows instead of filenames in the current codepage
|
||||
*
|
||||
* Furthermore, there have been the following additions
|
||||
* - the functions FLAC__stream_encoder_set_limit_min_bitrate,
|
||||
* FLAC__stream_encoder_get_limit_min_bitrate,
|
||||
* FLAC::encoder::file::set_limit_min_bitrate() and
|
||||
* FLAC::encoder::file::get_limit_min_bitrate() have been added
|
||||
* - Added FLAC__STREAM_DECODER_ERROR_STATUS_BAD_METADATA to the
|
||||
* FLAC__StreamDecoderErrorStatus enum
|
||||
*
|
||||
* \section porting_1_3_4_to_1_4_0_breaking Breaking changes
|
||||
*
|
||||
* The function \b get_client_data_from_decoder was added in FLAC 1.3.3
|
||||
* but did not follow the API naming convention and was not properly
|
||||
* exported. The function is now renamed and properly integrated as
|
||||
* FLAC__stream_decoder_get_client_data
|
||||
*
|
||||
* To accomodate encoding and decoding 32-bit int PCM, some data types
|
||||
* in the \b FLAC__frame struct were changed. Specifically, warmup
|
||||
* in both the FLAC__Subframe_Fixed struc and the FLAC__Subframe_LPC
|
||||
* struct is changed from FLAC__int32 to FLAC__int64. Also, value
|
||||
* in the FLAC__Subframe_Constant is changed from FLAC__int32 to
|
||||
* FLAC__int64. Finally, in FLAC__Subframe_Verbatim struct data is
|
||||
* changes from a FLAC__int32 array to a union containing a FLAC__int32
|
||||
* array and a FLAC__int64 array. Also, a new member is added,
|
||||
* data_type, which clarifies whether the FLAC__int32 or FLAC__int64
|
||||
* array is in use.
|
||||
*
|
||||
* Furthermore, the following functions now return the object untouched
|
||||
* if memory allocation fails, whereas previously the handling varied
|
||||
* and was more or less undefined
|
||||
*
|
||||
* - FLAC__metadata_object_seektable_resize_points
|
||||
* - FLAC__metadata_object_vorbiscomment_resize_comments
|
||||
* - FLAC__metadata_object_cuesheet_track_resize_indices
|
||||
* - FLAC__metadata_object_cuesheet_resize_tracks
|
||||
*
|
||||
* The last breaking change is that all API functions taking a filename
|
||||
* as an argument now, on Windows, must be supplied with that filename
|
||||
* in the UTF-8 character encoding instead of using the current code
|
||||
* page. libFLAC internally translates these UTF-8 encoded filenames to
|
||||
* an appropriate representation to use with _wfopen. On all other
|
||||
* systems, filename is passed to fopen without any translation, as it
|
||||
* in libFLAC 1.3.4 and earlier.
|
||||
*
|
||||
* \section porting_1_3_4_to_1_4_0_additions Additions
|
||||
*
|
||||
* To aid in creating properly streamable FLAC files, a set of functions
|
||||
* was added to make it possible to enfore a minimum bitrate to files
|
||||
* created through libFLAC's stream_encoder.h interface. With this
|
||||
* function enabled the resulting FLAC files have a minimum bitrate of
|
||||
* 1bit/sample independent of the number of channels, i.e. 48kbit/s for
|
||||
* 48kHz. This can be beneficial for streaming, as very low bitrates for
|
||||
* silent sections compressed with 'constant' subframes can result in a
|
||||
* bitrate of 1kbit/s, creating problems with clients that aren't aware
|
||||
* of this possibility and buffer too much data.
|
||||
*
|
||||
* Finally, FLAC__STREAM_DECODER_ERROR_STATUS_BAD_METADATA was added to
|
||||
* the FLAC__StreamDecoderErrorStatus enum to signal that the decoder
|
||||
* encountered unreadable metadata.
|
||||
*
|
||||
*/
|
||||
|
||||
/** \defgroup flac FLAC C API
|
||||
*
|
||||
* The FLAC C API is the interface to libFLAC, a set of structures
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/* alloc - Convenience routines for safely allocating memory
|
||||
* Copyright (C) 2007-2009 Josh Coalson
|
||||
* Copyright (C) 2011-2016 Xiph.Org Foundation
|
||||
* Copyright (C) 2011-2023 Xiph.Org Foundation
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
|
|
@ -66,19 +66,58 @@
|
|||
# define SIZE_MAX SIZE_T_MAX
|
||||
#endif
|
||||
|
||||
#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
|
||||
extern int alloc_check_threshold, alloc_check_counter;
|
||||
|
||||
static inline int alloc_check() {
|
||||
if(alloc_check_threshold == INT32_MAX)
|
||||
return 0;
|
||||
else if(alloc_check_counter++ == alloc_check_threshold)
|
||||
return 1;
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/* avoid malloc()ing 0 bytes, see:
|
||||
* https://www.securecoding.cert.org/confluence/display/seccode/MEM04-A.+Do+not+make+assumptions+about+the+result+of+allocating+0+bytes?focusedCommentId=5407003
|
||||
*/
|
||||
|
||||
static inline void *safe_malloc_(size_t size)
|
||||
{
|
||||
#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
|
||||
/* Fail if requested */
|
||||
if(alloc_check())
|
||||
return NULL;
|
||||
#endif
|
||||
/* malloc(0) is undefined; FLAC src convention is to always allocate */
|
||||
if(!size)
|
||||
size++;
|
||||
return malloc(size);
|
||||
}
|
||||
|
||||
#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
|
||||
static inline void *malloc_(size_t size)
|
||||
{
|
||||
/* Fail if requested */
|
||||
if(alloc_check())
|
||||
return NULL;
|
||||
return malloc(size);
|
||||
}
|
||||
#else
|
||||
#define malloc_ malloc
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
static inline void *safe_calloc_(size_t nmemb, size_t size)
|
||||
{
|
||||
#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
|
||||
/* Fail if requested */
|
||||
if(alloc_check())
|
||||
return NULL;
|
||||
#endif
|
||||
if(!nmemb || !size)
|
||||
return malloc(1); /* malloc(0) is undefined; FLAC src convention is to always allocate */
|
||||
return calloc(nmemb, size);
|
||||
|
|
@ -130,7 +169,7 @@ static inline void *safe_malloc_mul_3op_(size_t size1, size_t size2, size_t size
|
|||
size1 *= size2;
|
||||
if(size1 > SIZE_MAX / size3)
|
||||
return 0;
|
||||
return malloc(size1*size3);
|
||||
return malloc_(size1*size3);
|
||||
}
|
||||
|
||||
/* size1*size2 + size3 */
|
||||
|
|
@ -153,28 +192,64 @@ static inline void *safe_malloc_muladd2_(size_t size1, size_t size2, size_t size
|
|||
return 0;
|
||||
if(size1 > SIZE_MAX / size2)
|
||||
return 0;
|
||||
return malloc(size1*size2);
|
||||
return malloc_(size1*size2);
|
||||
}
|
||||
|
||||
static inline void *safe_realloc_(void *ptr, size_t size)
|
||||
{
|
||||
void *oldptr = ptr;
|
||||
void *newptr = realloc(ptr, size);
|
||||
void *oldptr;
|
||||
void *newptr;
|
||||
#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
|
||||
/* Fail if requested */
|
||||
if(alloc_check() && size > 0) {
|
||||
free(ptr);
|
||||
return NULL;
|
||||
}
|
||||
#endif
|
||||
oldptr = ptr;
|
||||
newptr = realloc(ptr, size);
|
||||
if(size > 0 && newptr == 0)
|
||||
free(oldptr);
|
||||
return newptr;
|
||||
}
|
||||
static inline void *safe_realloc_add_2op_(void *ptr, size_t size1, size_t size2)
|
||||
|
||||
#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
|
||||
static inline void *realloc_(void *ptr, size_t size)
|
||||
{
|
||||
/* Fail if requested */
|
||||
if(alloc_check())
|
||||
return NULL;
|
||||
return realloc(ptr, size);
|
||||
}
|
||||
#else
|
||||
#define realloc_ realloc
|
||||
#endif
|
||||
|
||||
|
||||
static inline void *safe_realloc_nofree_add_2op_(void *ptr, size_t size1, size_t size2)
|
||||
{
|
||||
size2 += size1;
|
||||
if(size2 < size1)
|
||||
return 0;
|
||||
return realloc_(ptr, size2);
|
||||
}
|
||||
|
||||
static inline void *safe_realloc_add_3op_(void *ptr, size_t size1, size_t size2, size_t size3)
|
||||
{
|
||||
size2 += size1;
|
||||
if(size2 < size1) {
|
||||
free(ptr);
|
||||
return 0;
|
||||
}
|
||||
return realloc(ptr, size2);
|
||||
size3 += size2;
|
||||
if(size3 < size2) {
|
||||
free(ptr);
|
||||
return 0;
|
||||
}
|
||||
return safe_realloc_(ptr, size3);
|
||||
}
|
||||
|
||||
static inline void *safe_realloc_add_3op_(void *ptr, size_t size1, size_t size2, size_t size3)
|
||||
static inline void *safe_realloc_nofree_add_3op_(void *ptr, size_t size1, size_t size2, size_t size3)
|
||||
{
|
||||
size2 += size1;
|
||||
if(size2 < size1)
|
||||
|
|
@ -182,10 +257,10 @@ static inline void *safe_realloc_add_3op_(void *ptr, size_t size1, size_t size2,
|
|||
size3 += size2;
|
||||
if(size3 < size2)
|
||||
return 0;
|
||||
return realloc(ptr, size3);
|
||||
return realloc_(ptr, size3);
|
||||
}
|
||||
|
||||
static inline void *safe_realloc_add_4op_(void *ptr, size_t size1, size_t size2, size_t size3, size_t size4)
|
||||
static inline void *safe_realloc_nofree_add_4op_(void *ptr, size_t size1, size_t size2, size_t size3, size_t size4)
|
||||
{
|
||||
size2 += size1;
|
||||
if(size2 < size1)
|
||||
|
|
@ -196,16 +271,27 @@ static inline void *safe_realloc_add_4op_(void *ptr, size_t size1, size_t size2,
|
|||
size4 += size3;
|
||||
if(size4 < size3)
|
||||
return 0;
|
||||
return realloc(ptr, size4);
|
||||
return realloc_(ptr, size4);
|
||||
}
|
||||
|
||||
static inline void *safe_realloc_mul_2op_(void *ptr, size_t size1, size_t size2)
|
||||
{
|
||||
if(!size1 || !size2)
|
||||
return realloc(ptr, 0); /* preserve POSIX realloc(ptr, 0) semantics */
|
||||
if(size1 > SIZE_MAX / size2) {
|
||||
free(ptr);
|
||||
return 0;
|
||||
}
|
||||
return safe_realloc_(ptr, size1*size2);
|
||||
}
|
||||
|
||||
static inline void *safe_realloc_nofree_mul_2op_(void *ptr, size_t size1, size_t size2)
|
||||
{
|
||||
if(!size1 || !size2)
|
||||
return realloc(ptr, 0); /* preserve POSIX realloc(ptr, 0) semantics */
|
||||
if(size1 > SIZE_MAX / size2)
|
||||
return 0;
|
||||
return safe_realloc_(ptr, size1*size2);
|
||||
return realloc_(ptr, size1*size2);
|
||||
}
|
||||
|
||||
/* size1 * (size2 + size3) */
|
||||
|
|
@ -214,9 +300,22 @@ static inline void *safe_realloc_muladd2_(void *ptr, size_t size1, size_t size2,
|
|||
if(!size1 || (!size2 && !size3))
|
||||
return realloc(ptr, 0); /* preserve POSIX realloc(ptr, 0) semantics */
|
||||
size2 += size3;
|
||||
if(size2 < size3)
|
||||
if(size2 < size3) {
|
||||
free(ptr);
|
||||
return 0;
|
||||
}
|
||||
return safe_realloc_mul_2op_(ptr, size1, size2);
|
||||
}
|
||||
|
||||
/* size1 * (size2 + size3) */
|
||||
static inline void *safe_realloc_nofree_muladd2_(void *ptr, size_t size1, size_t size2, size_t size3)
|
||||
{
|
||||
if(!size1 || (!size2 && !size3))
|
||||
return realloc(ptr, 0); /* preserve POSIX realloc(ptr, 0) semantics */
|
||||
size2 += size3;
|
||||
if(size2 < size3)
|
||||
return 0;
|
||||
return safe_realloc_nofree_mul_2op_(ptr, size1, size2);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/* libFLAC - Free Lossless Audio Codec library
|
||||
* Copyright (C) 2001-2009 Josh Coalson
|
||||
* Copyright (C) 2011-2016 Xiph.Org Foundation
|
||||
* Copyright (C) 2011-2023 Xiph.Org Foundation
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
|
|
@ -34,16 +34,18 @@
|
|||
#define FLAC__ASSERT_H
|
||||
|
||||
/* we need this since some compilers (like MSVC) leave assert()s on release code (and we don't want to use their ASSERT) */
|
||||
#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
|
||||
#define FLAC__ASSERT(x) if(!(x)) __builtin_abort();
|
||||
#define FLAC__ASSERT_DECLARATION(x) x
|
||||
#else
|
||||
#ifndef NDEBUG
|
||||
// JUCE: removed as JUCE already includes standard headers and including
|
||||
// these in FlacNamespace will cause problems
|
||||
|
||||
//#include <assert.h>
|
||||
#include <assert.h>
|
||||
#define FLAC__ASSERT(x) assert(x)
|
||||
#define FLAC__ASSERT_DECLARATION(x) x
|
||||
#else
|
||||
#define FLAC__ASSERT(x)
|
||||
#define FLAC__ASSERT_DECLARATION(x)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/* libFLAC - Free Lossless Audio Codec library
|
||||
* Copyright (C) 2004-2009 Josh Coalson
|
||||
* Copyright (C) 2011-2016 Xiph.Org Foundation
|
||||
* Copyright (C) 2011-2023 Xiph.Org Foundation
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
|
|
@ -34,10 +34,7 @@
|
|||
#define FLAC__CALLBACK_H
|
||||
|
||||
#include "ordinals.h"
|
||||
|
||||
// JUCE: removed as JUCE already includes this and including stdlib
|
||||
// in FlacNamespace will cause problems
|
||||
//#include <stdlib.h> /* for size_t */
|
||||
#include <stdlib.h> /* for size_t */
|
||||
|
||||
/** \file include/FLAC/callback.h
|
||||
*
|
||||
|
|
@ -93,7 +90,9 @@ typedef void* FLAC__IOHandle;
|
|||
|
||||
/** Signature for the read callback.
|
||||
* The signature and semantics match POSIX fread() implementations
|
||||
* and can generally be used interchangeably.
|
||||
* and can generally be used interchangeably. Note that the global
|
||||
* variable errno from errno.h is read by some libFLAC functions to
|
||||
* detect read errors.
|
||||
*
|
||||
* \param ptr The address of the read buffer.
|
||||
* \param size The size of the records to be read.
|
||||
|
|
@ -169,14 +168,17 @@ typedef int (*FLAC__IOCallback_Close) (FLAC__IOHandle handle);
|
|||
*
|
||||
* If the seek requirement for an interface is optional, you can signify that
|
||||
* a data source is not seekable by setting the \a seek field to \c NULL.
|
||||
*
|
||||
* See the detailed documentation for callbacks in the
|
||||
* \link flac_callbacks callbacks \endlink module.
|
||||
*/
|
||||
typedef struct {
|
||||
FLAC__IOCallback_Read read;
|
||||
FLAC__IOCallback_Write write;
|
||||
FLAC__IOCallback_Seek seek;
|
||||
FLAC__IOCallback_Tell tell;
|
||||
FLAC__IOCallback_Eof eof;
|
||||
FLAC__IOCallback_Close close;
|
||||
FLAC__IOCallback_Read read; /**< See FLAC__IOCallbacks */
|
||||
FLAC__IOCallback_Write write; /**< See FLAC__IOCallbacks */
|
||||
FLAC__IOCallback_Seek seek; /**< See FLAC__IOCallbacks */
|
||||
FLAC__IOCallback_Tell tell; /**< See FLAC__IOCallbacks */
|
||||
FLAC__IOCallback_Eof eof; /**< See FLAC__IOCallbacks */
|
||||
FLAC__IOCallback_Close close; /**< See FLAC__IOCallbacks */
|
||||
} FLAC__IOCallbacks;
|
||||
|
||||
/* \} */
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/* libFLAC - Free Lossless Audio Codec library
|
||||
* Copyright (C) 2012-2016 Xiph.org Foundation
|
||||
* Copyright (C) 2012-2023 Xiph.Org Foundation
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
|
|
@ -39,8 +39,20 @@
|
|||
#ifndef FLAC__SHARE__COMPAT_H
|
||||
#define FLAC__SHARE__COMPAT_H
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdarg.h>
|
||||
|
||||
#if defined _WIN32 && !defined __CYGWIN__
|
||||
/* where MSVC puts unlink() */
|
||||
# include <io.h>
|
||||
#else
|
||||
# include <unistd.h>
|
||||
#endif
|
||||
|
||||
#if defined _MSC_VER || defined __BORLANDC__ || defined __MINGW32__
|
||||
#include <sys/types.h> /* for off_t */
|
||||
#define FLAC__off_t __int64 /* use this instead of off_t to fix the 2 GB limit */
|
||||
#define FLAC__OFF_T_MAX INT64_MAX
|
||||
#if !defined __MINGW32__
|
||||
#define fseeko _fseeki64
|
||||
#define ftello _ftelli64
|
||||
|
|
@ -52,6 +64,14 @@
|
|||
#endif
|
||||
#else
|
||||
#define FLAC__off_t off_t
|
||||
#define FLAC__OFF_T_MAX OFF_T_MAX
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#ifdef HAVE_INTTYPES_H
|
||||
#define __STDC_FORMAT_MACROS
|
||||
#include <inttypes.h>
|
||||
#endif
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
|
|
@ -85,15 +105,39 @@
|
|||
#define FLAC__STRNCASECMP strncasecmp
|
||||
#endif
|
||||
|
||||
#if defined _MSC_VER || defined __MINGW32__ || defined __EMX__
|
||||
#include <io.h> /* for _setmode(), chmod() */
|
||||
#include <fcntl.h> /* for _O_BINARY */
|
||||
#else
|
||||
#include <unistd.h> /* for chown(), unlink() */
|
||||
#endif
|
||||
|
||||
#if defined _MSC_VER || defined __BORLANDC__ || defined __MINGW32__
|
||||
#if defined __BORLANDC__
|
||||
#include <utime.h> /* for utime() */
|
||||
#else
|
||||
#include <sys/utime.h> /* for utime() */
|
||||
#endif
|
||||
#else
|
||||
#if defined(_POSIX_C_SOURCE) && (_POSIX_C_SOURCE >= 200809L)
|
||||
#include <fcntl.h>
|
||||
#else
|
||||
#include <sys/types.h> /* some flavors of BSD (like OS X) require this to get time_t */
|
||||
#include <utime.h> /* for utime() */
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined _MSC_VER
|
||||
# if _MSC_VER >= 1800
|
||||
# include <inttypes.h>
|
||||
# elif _MSC_VER >= 1600
|
||||
/* Visual Studio 2010 has decent C99 support */
|
||||
# include <stdint.h>
|
||||
# define PRIu64 "llu"
|
||||
# define PRId64 "lld"
|
||||
# define PRIx64 "llx"
|
||||
# else
|
||||
# include <limits.h>
|
||||
# ifndef UINT32_MAX
|
||||
# define UINT32_MAX _UI32_MAX
|
||||
# endif
|
||||
|
|
@ -101,6 +145,29 @@
|
|||
# define PRId64 "I64d"
|
||||
# define PRIx64 "I64x"
|
||||
# endif
|
||||
# if defined(_USING_V110_SDK71_) && !defined(_DLL)
|
||||
# pragma message("WARNING: This compile will NOT FUNCTION PROPERLY on Windows XP. See comments in include/share/compat.h for details")
|
||||
#define FLAC__USE_FILELENGTHI64
|
||||
/*
|
||||
*************************************************************************************
|
||||
* V110_SDK71, in MSVC 2017 also known as v141_xp, is a platform toolset that is supposed
|
||||
* to target Windows XP. It turns out however that certain functions provided silently fail
|
||||
* on Windows XP only, which makes debugging challenging. This only occurs when building with
|
||||
* /MT. This problem has been reported to Microsoft, but there hasn't been a fix for years. See
|
||||
* https://web.archive.org/web/20170327195018/https://connect.microsoft.com/VisualStudio/feedback/details/1557168/wstat64-returns-1-on-xp-always
|
||||
*
|
||||
* It is known that this problem affects the functions _wstat64 (used by flac_stat i.e.
|
||||
* stat64_utf8) and _fstat64 (i.e. flac_fstat) and therefore affects both libFLAC in
|
||||
* several places as well as the flac and metaflac command line tools
|
||||
*
|
||||
* As the extent of this problem is unknown and Microsoft seems unwilling to fix it,
|
||||
* users of libFLAC building with Visual Studio are encouraged to not use the /MT compile
|
||||
* switch when explicitly targeting Windows XP. When use of /MT is deemed necessary with
|
||||
* this toolset, be sure to check whether your application works properly on Windows XP.
|
||||
* It is also possible to build for Windows XP with MinGW instead.
|
||||
*************************************************************************************
|
||||
*/
|
||||
# endif
|
||||
#endif /* defined _MSC_VER */
|
||||
|
||||
#ifdef _WIN32
|
||||
|
|
@ -111,16 +178,15 @@
|
|||
#define flac_printf printf_utf8
|
||||
#define flac_fprintf fprintf_utf8
|
||||
#define flac_vfprintf vfprintf_utf8
|
||||
|
||||
#include "windows_unicode_filenames.h"
|
||||
#define flac_fopen flac_internal_fopen_utf8
|
||||
#define flac_chmod flac_internal_chmod_utf8
|
||||
#define flac_utime flac_internal_utime_utf8
|
||||
#define flac_unlink flac_internal_unlink_utf8
|
||||
#define flac_rename flac_internal_rename_utf8
|
||||
#define flac_stat flac_internal_stat64_utf8
|
||||
#endif
|
||||
|
||||
#define flac_fopen fopen_utf8
|
||||
#define flac_chmod chmod_utf8
|
||||
#define flac_utime utime_utf8
|
||||
#define flac_unlink unlink_utf8
|
||||
#define flac_rename rename_utf8
|
||||
#define flac_stat stat64_utf8
|
||||
|
||||
#else
|
||||
|
||||
#define flac_printf printf
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/* libFLAC - Free Lossless Audio Codec library
|
||||
* Copyright (C) 2012-2016 Xiph.org Foundation
|
||||
* Copyright (C) 2012-2023 Xiph.Org Foundation
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
|
|
@ -31,10 +31,10 @@
|
|||
|
||||
/* It is assumed that this header will be included after "config.h". */
|
||||
|
||||
#if HAVE_BSWAP32 /* GCC and Clang */
|
||||
#ifdef HAVE_BSWAP32 /* GCC and Clang */
|
||||
|
||||
/* GCC prior to 4.8 didn't provide bswap16 on x86_64 */
|
||||
#if ! HAVE_BSWAP16
|
||||
#ifndef HAVE_BSWAP16
|
||||
static inline unsigned short __builtin_bswap16(unsigned short a)
|
||||
{
|
||||
return (a<<8)|(a>>8);
|
||||
|
|
@ -55,9 +55,7 @@ static inline unsigned short __builtin_bswap16(unsigned short a)
|
|||
|
||||
#elif defined HAVE_BYTESWAP_H /* Linux */
|
||||
|
||||
// JUCE: removed as JUCE already includes standard headers and including
|
||||
// these in FlacNamespace will cause problems
|
||||
//#include <byteswap.h>
|
||||
#include <byteswap.h>
|
||||
|
||||
#define ENDSWAP_16(x) (bswap_16 (x))
|
||||
#define ENDSWAP_32(x) (bswap_32 (x))
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/* libFLAC - Free Lossless Audio Codec library
|
||||
* Copyright (C) 2000-2009 Josh Coalson
|
||||
* Copyright (C) 2011-2016 Xiph.Org Foundation
|
||||
* Copyright (C) 2011-2023 Xiph.Org Foundation
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
|
|
@ -49,22 +49,40 @@
|
|||
* This module contains \#defines and symbols for exporting function
|
||||
* calls, and providing version information and compiled-in features.
|
||||
*
|
||||
* If you are compiling with MSVC and will link to the static library
|
||||
* (libFLAC.lib) you should define FLAC__NO_DLL in your project to
|
||||
* make sure the symbols are exported properly.
|
||||
* If you are compiling for Windows (with Visual Studio or MinGW for
|
||||
* example) and will link to the static library (libFLAC++.lib) you
|
||||
* should define FLAC__NO_DLL in your project to make sure the symbols
|
||||
* are exported properly.
|
||||
*
|
||||
* \{
|
||||
*/
|
||||
|
||||
#if defined(FLAC__NO_DLL)
|
||||
#define FLAC_API
|
||||
/** This \#define is used internally in libFLAC and its headers to make
|
||||
* sure the correct symbols are exported when working with shared
|
||||
* libraries. On Windows, this \#define is set to __declspec(dllexport)
|
||||
* when compiling libFLAC into a library and to __declspec(dllimport)
|
||||
* when the headers are used to link to that DLL. On non-Windows systems
|
||||
* it is used to set symbol visibility.
|
||||
*
|
||||
* Because of this, the define FLAC__NO_DLL must be defined when linking
|
||||
* to libFLAC statically or linking will fail.
|
||||
*/
|
||||
/* This has grown quite complicated. FLAC__NO_DLL is used by MSVC sln
|
||||
* files and CMake, which build either static or shared. autotools can
|
||||
* build static, shared or **both**. Therefore, DLL_EXPORT, which is set
|
||||
* by libtool, must override FLAC__NO_DLL on building shared components
|
||||
*/
|
||||
#if defined(_WIN32)
|
||||
|
||||
#elif defined(_WIN32)
|
||||
#if defined(FLAC__NO_DLL) && !(defined(DLL_EXPORT))
|
||||
#define FLAC_API
|
||||
#else
|
||||
#ifdef FLAC_API_EXPORTS
|
||||
#define FLAC_API __declspec(dllexport)
|
||||
#else
|
||||
#define FLAC_API __declspec(dllimport)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#elif defined(FLAC__USE_VISIBILITY_ATTR)
|
||||
#define FLAC_API __attribute__ ((visibility ("default")))
|
||||
|
|
@ -77,9 +95,9 @@
|
|||
/** These \#defines will mirror the libtool-based library version number, see
|
||||
* http://www.gnu.org/software/libtool/manual/libtool.html#Libtool-versioning
|
||||
*/
|
||||
#define FLAC_API_VERSION_CURRENT 11
|
||||
#define FLAC_API_VERSION_CURRENT 13
|
||||
#define FLAC_API_VERSION_REVISION 0 /**< see above */
|
||||
#define FLAC_API_VERSION_AGE 3 /**< see above */
|
||||
#define FLAC_API_VERSION_AGE 1 /**< see above */
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/* libFLAC - Free Lossless Audio Codec library
|
||||
* Copyright (C) 2000-2009 Josh Coalson
|
||||
* Copyright (C) 2011-2016 Xiph.Org Foundation
|
||||
* Copyright (C) 2011-2023 Xiph.Org Foundation
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
|
|
@ -60,7 +60,7 @@ extern "C" {
|
|||
* structures used by the rest of the interfaces.
|
||||
*
|
||||
* First, you should be familiar with the
|
||||
* <A HREF="../format.html">FLAC format</A>. Many of the values here
|
||||
* <A HREF="https://xiph.org/flac/format.html">FLAC format</A>. Many of the values here
|
||||
* follow directly from the specification. As a user of libFLAC, the
|
||||
* interesting parts really are the structures that describe the frame
|
||||
* header and metadata blocks.
|
||||
|
|
@ -113,19 +113,16 @@ extern "C" {
|
|||
|
||||
/** The maximum sample resolution permitted by libFLAC.
|
||||
*
|
||||
* \warning
|
||||
* FLAC__MAX_BITS_PER_SAMPLE is the limit of the FLAC format. However,
|
||||
* the reference encoder/decoder is currently limited to 24 bits because
|
||||
* of prevalent 32-bit math, so make sure and use this value when
|
||||
* appropriate.
|
||||
* the reference encoder/decoder used to be limited to 24 bits. This
|
||||
* value was used to signal that limit.
|
||||
*/
|
||||
#define FLAC__REFERENCE_CODEC_MAX_BITS_PER_SAMPLE (24u)
|
||||
#define FLAC__REFERENCE_CODEC_MAX_BITS_PER_SAMPLE (32u)
|
||||
|
||||
/** The maximum sample rate permitted by the format. The value is
|
||||
* ((2 ^ 16) - 1) * 10; see <A HREF="../format.html">FLAC format</A>
|
||||
* as to why.
|
||||
* ((2 ^ 20) - 1)
|
||||
*/
|
||||
#define FLAC__MAX_SAMPLE_RATE (655350u)
|
||||
#define FLAC__MAX_SAMPLE_RATE (1048575u)
|
||||
|
||||
/** The maximum LPC order permitted by the format. */
|
||||
#define FLAC__MAX_LPC_ORDER (32u)
|
||||
|
|
@ -228,7 +225,7 @@ typedef struct {
|
|||
*/
|
||||
} FLAC__EntropyCodingMethod_PartitionedRiceContents;
|
||||
|
||||
/** Header for a Rice partitioned residual. (c.f. <A HREF="../format.html#partitioned_rice">format specification</A>)
|
||||
/** Header for a Rice partitioned residual. (c.f. <A HREF="https://xiph.org/flac/format.html#partitioned_rice">format specification</A>)
|
||||
*/
|
||||
typedef struct {
|
||||
|
||||
|
|
@ -250,7 +247,7 @@ extern FLAC_API const uint32_t FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE_ESCA
|
|||
extern FLAC_API const uint32_t FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE2_ESCAPE_PARAMETER;
|
||||
/**< == (1<<FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE2_PARAMETER_LEN)-1 */
|
||||
|
||||
/** Header for the entropy coding method. (c.f. <A HREF="../format.html#residual">format specification</A>)
|
||||
/** Header for the entropy coding method. (c.f. <A HREF="https://xiph.org/flac/format.html#residual">format specification</A>)
|
||||
*/
|
||||
typedef struct {
|
||||
FLAC__EntropyCodingMethodType type;
|
||||
|
|
@ -279,21 +276,31 @@ typedef enum {
|
|||
extern FLAC_API const char * const FLAC__SubframeTypeString[];
|
||||
|
||||
|
||||
/** CONSTANT subframe. (c.f. <A HREF="../format.html#subframe_constant">format specification</A>)
|
||||
/** CONSTANT subframe. (c.f. <A HREF="https://xiph.org/flac/format.html#subframe_constant">format specification</A>)
|
||||
*/
|
||||
typedef struct {
|
||||
FLAC__int32 value; /**< The constant signal value. */
|
||||
FLAC__int64 value; /**< The constant signal value. */
|
||||
} FLAC__Subframe_Constant;
|
||||
|
||||
/** An enumeration of the possible verbatim subframe data types. */
|
||||
typedef enum {
|
||||
FLAC__VERBATIM_SUBFRAME_DATA_TYPE_INT32, /**< verbatim subframe has 32-bit int */
|
||||
FLAC__VERBATIM_SUBFRAME_DATA_TYPE_INT64 /**< verbatim subframe has 64-bit int */
|
||||
} FLAC__VerbatimSubframeDataType;
|
||||
|
||||
/** VERBATIM subframe. (c.f. <A HREF="../format.html#subframe_verbatim">format specification</A>)
|
||||
|
||||
/** VERBATIM subframe. (c.f. <A HREF="https://xiph.org/flac/format.html#subframe_verbatim">format specification</A>)
|
||||
*/
|
||||
typedef struct {
|
||||
const FLAC__int32 *data; /**< A pointer to verbatim signal. */
|
||||
union {
|
||||
const FLAC__int32 *int32; /**< A FLAC__int32 pointer to verbatim signal. */
|
||||
const FLAC__int64 *int64; /**< A FLAC__int64 pointer to verbatim signal. */
|
||||
} data;
|
||||
FLAC__VerbatimSubframeDataType data_type;
|
||||
} FLAC__Subframe_Verbatim;
|
||||
|
||||
|
||||
/** FIXED subframe. (c.f. <A HREF="../format.html#subframe_fixed">format specification</A>)
|
||||
/** FIXED subframe. (c.f. <A HREF="https://xiph.org/flac/format.html#subframe_fixed">format specification</A>)
|
||||
*/
|
||||
typedef struct {
|
||||
FLAC__EntropyCodingMethod entropy_coding_method;
|
||||
|
|
@ -302,7 +309,7 @@ typedef struct {
|
|||
uint32_t order;
|
||||
/**< The polynomial order. */
|
||||
|
||||
FLAC__int32 warmup[FLAC__MAX_FIXED_ORDER];
|
||||
FLAC__int64 warmup[FLAC__MAX_FIXED_ORDER];
|
||||
/**< Warmup samples to prime the predictor, length == order. */
|
||||
|
||||
const FLAC__int32 *residual;
|
||||
|
|
@ -310,7 +317,7 @@ typedef struct {
|
|||
} FLAC__Subframe_Fixed;
|
||||
|
||||
|
||||
/** LPC subframe. (c.f. <A HREF="../format.html#subframe_lpc">format specification</A>)
|
||||
/** LPC subframe. (c.f. <A HREF="https://xiph.org/flac/format.html#subframe_lpc">format specification</A>)
|
||||
*/
|
||||
typedef struct {
|
||||
FLAC__EntropyCodingMethod entropy_coding_method;
|
||||
|
|
@ -328,7 +335,7 @@ typedef struct {
|
|||
FLAC__int32 qlp_coeff[FLAC__MAX_LPC_ORDER];
|
||||
/**< FIR filter coefficients. */
|
||||
|
||||
FLAC__int32 warmup[FLAC__MAX_LPC_ORDER];
|
||||
FLAC__int64 warmup[FLAC__MAX_LPC_ORDER];
|
||||
/**< Warmup samples to prime the predictor, length == order. */
|
||||
|
||||
const FLAC__int32 *residual;
|
||||
|
|
@ -339,7 +346,7 @@ extern FLAC_API const uint32_t FLAC__SUBFRAME_LPC_QLP_COEFF_PRECISION_LEN; /**<
|
|||
extern FLAC_API const uint32_t FLAC__SUBFRAME_LPC_QLP_SHIFT_LEN; /**< == 5 (bits) */
|
||||
|
||||
|
||||
/** FLAC subframe structure. (c.f. <A HREF="../format.html#subframe">format specification</A>)
|
||||
/** FLAC subframe structure. (c.f. <A HREF="https://xiph.org/flac/format.html#subframe">format specification</A>)
|
||||
*/
|
||||
typedef struct {
|
||||
FLAC__SubframeType type;
|
||||
|
|
@ -406,7 +413,7 @@ typedef enum {
|
|||
extern FLAC_API const char * const FLAC__FrameNumberTypeString[];
|
||||
|
||||
|
||||
/** FLAC frame header structure. (c.f. <A HREF="../format.html#frame_header">format specification</A>)
|
||||
/** FLAC frame header structure. (c.f. <A HREF="https://xiph.org/flac/format.html#frame_header">format specification</A>)
|
||||
*/
|
||||
typedef struct {
|
||||
uint32_t blocksize;
|
||||
|
|
@ -455,7 +462,7 @@ extern FLAC_API const uint32_t FLAC__FRAME_HEADER_ZERO_PAD_LEN; /**< == 1 (bit)
|
|||
extern FLAC_API const uint32_t FLAC__FRAME_HEADER_CRC_LEN; /**< == 8 (bits) */
|
||||
|
||||
|
||||
/** FLAC frame footer structure. (c.f. <A HREF="../format.html#frame_footer">format specification</A>)
|
||||
/** FLAC frame footer structure. (c.f. <A HREF="https://xiph.org/flac/format.html#frame_footer">format specification</A>)
|
||||
*/
|
||||
typedef struct {
|
||||
FLAC__uint16 crc;
|
||||
|
|
@ -468,7 +475,7 @@ typedef struct {
|
|||
extern FLAC_API const uint32_t FLAC__FRAME_FOOTER_CRC_LEN; /**< == 16 (bits) */
|
||||
|
||||
|
||||
/** FLAC frame structure. (c.f. <A HREF="../format.html#frame">format specification</A>)
|
||||
/** FLAC frame structure. (c.f. <A HREF="https://xiph.org/flac/format.html#frame">format specification</A>)
|
||||
*/
|
||||
typedef struct {
|
||||
FLAC__FrameHeader header;
|
||||
|
|
@ -489,25 +496,25 @@ typedef struct {
|
|||
typedef enum {
|
||||
|
||||
FLAC__METADATA_TYPE_STREAMINFO = 0,
|
||||
/**< <A HREF="../format.html#metadata_block_streaminfo">STREAMINFO</A> block */
|
||||
/**< <A HREF="https://xiph.org/flac/format.html#metadata_block_streaminfo">STREAMINFO</A> block */
|
||||
|
||||
FLAC__METADATA_TYPE_PADDING = 1,
|
||||
/**< <A HREF="../format.html#metadata_block_padding">PADDING</A> block */
|
||||
/**< <A HREF="https://xiph.org/flac/format.html#metadata_block_padding">PADDING</A> block */
|
||||
|
||||
FLAC__METADATA_TYPE_APPLICATION = 2,
|
||||
/**< <A HREF="../format.html#metadata_block_application">APPLICATION</A> block */
|
||||
/**< <A HREF="https://xiph.org/flac/format.html#metadata_block_application">APPLICATION</A> block */
|
||||
|
||||
FLAC__METADATA_TYPE_SEEKTABLE = 3,
|
||||
/**< <A HREF="../format.html#metadata_block_seektable">SEEKTABLE</A> block */
|
||||
/**< <A HREF="https://xiph.org/flac/format.html#metadata_block_seektable">SEEKTABLE</A> block */
|
||||
|
||||
FLAC__METADATA_TYPE_VORBIS_COMMENT = 4,
|
||||
/**< <A HREF="../format.html#metadata_block_vorbis_comment">VORBISCOMMENT</A> block (a.k.a. FLAC tags) */
|
||||
/**< <A HREF="https://xiph.org/flac/format.html#metadata_block_vorbis_comment">VORBISCOMMENT</A> block (a.k.a. FLAC tags) */
|
||||
|
||||
FLAC__METADATA_TYPE_CUESHEET = 5,
|
||||
/**< <A HREF="../format.html#metadata_block_cuesheet">CUESHEET</A> block */
|
||||
/**< <A HREF="https://xiph.org/flac/format.html#metadata_block_cuesheet">CUESHEET</A> block */
|
||||
|
||||
FLAC__METADATA_TYPE_PICTURE = 6,
|
||||
/**< <A HREF="../format.html#metadata_block_picture">PICTURE</A> block */
|
||||
/**< <A HREF="https://xiph.org/flac/format.html#metadata_block_picture">PICTURE</A> block */
|
||||
|
||||
FLAC__METADATA_TYPE_UNDEFINED = 7,
|
||||
/**< marker to denote beginning of undefined type range; this number will increase as new metadata types are added */
|
||||
|
|
@ -524,7 +531,7 @@ typedef enum {
|
|||
extern FLAC_API const char * const FLAC__MetadataTypeString[];
|
||||
|
||||
|
||||
/** FLAC STREAMINFO structure. (c.f. <A HREF="../format.html#metadata_block_streaminfo">format specification</A>)
|
||||
/** FLAC STREAMINFO structure. (c.f. <A HREF="https://xiph.org/flac/format.html#metadata_block_streaminfo">format specification</A>)
|
||||
*/
|
||||
typedef struct {
|
||||
uint32_t min_blocksize, max_blocksize;
|
||||
|
|
@ -549,7 +556,7 @@ extern FLAC_API const uint32_t FLAC__STREAM_METADATA_STREAMINFO_MD5SUM_LEN; /**<
|
|||
/** The total stream length of the STREAMINFO block in bytes. */
|
||||
#define FLAC__STREAM_METADATA_STREAMINFO_LENGTH (34u)
|
||||
|
||||
/** FLAC PADDING structure. (c.f. <A HREF="../format.html#metadata_block_padding">format specification</A>)
|
||||
/** FLAC PADDING structure. (c.f. <A HREF="https://xiph.org/flac/format.html#metadata_block_padding">format specification</A>)
|
||||
*/
|
||||
typedef struct {
|
||||
int dummy;
|
||||
|
|
@ -560,7 +567,7 @@ typedef struct {
|
|||
} FLAC__StreamMetadata_Padding;
|
||||
|
||||
|
||||
/** FLAC APPLICATION structure. (c.f. <A HREF="../format.html#metadata_block_application">format specification</A>)
|
||||
/** FLAC APPLICATION structure. (c.f. <A HREF="https://xiph.org/flac/format.html#metadata_block_application">format specification</A>)
|
||||
*/
|
||||
typedef struct {
|
||||
FLAC__byte id[4];
|
||||
|
|
@ -569,7 +576,7 @@ typedef struct {
|
|||
|
||||
extern FLAC_API const uint32_t FLAC__STREAM_METADATA_APPLICATION_ID_LEN; /**< == 32 (bits) */
|
||||
|
||||
/** SeekPoint structure used in SEEKTABLE blocks. (c.f. <A HREF="../format.html#seekpoint">format specification</A>)
|
||||
/** SeekPoint structure used in SEEKTABLE blocks. (c.f. <A HREF="https://xiph.org/flac/format.html#seekpoint">format specification</A>)
|
||||
*/
|
||||
typedef struct {
|
||||
FLAC__uint64 sample_number;
|
||||
|
|
@ -597,7 +604,7 @@ extern FLAC_API const uint32_t FLAC__STREAM_METADATA_SEEKPOINT_FRAME_SAMPLES_LEN
|
|||
extern FLAC_API const FLAC__uint64 FLAC__STREAM_METADATA_SEEKPOINT_PLACEHOLDER;
|
||||
|
||||
|
||||
/** FLAC SEEKTABLE structure. (c.f. <A HREF="../format.html#metadata_block_seektable">format specification</A>)
|
||||
/** FLAC SEEKTABLE structure. (c.f. <A HREF="https://xiph.org/flac/format.html#metadata_block_seektable">format specification</A>)
|
||||
*
|
||||
* \note From the format specification:
|
||||
* - The seek points must be sorted by ascending sample number.
|
||||
|
|
@ -615,7 +622,7 @@ typedef struct {
|
|||
} FLAC__StreamMetadata_SeekTable;
|
||||
|
||||
|
||||
/** Vorbis comment entry structure used in VORBIS_COMMENT blocks. (c.f. <A HREF="../format.html#metadata_block_vorbis_comment">format specification</A>)
|
||||
/** Vorbis comment entry structure used in VORBIS_COMMENT blocks. (c.f. <A HREF="https://xiph.org/flac/format.html#metadata_block_vorbis_comment">format specification</A>)
|
||||
*
|
||||
* For convenience, the APIs maintain a trailing NUL character at the end of
|
||||
* \a entry which is not counted toward \a length, i.e.
|
||||
|
|
@ -629,7 +636,7 @@ typedef struct {
|
|||
extern FLAC_API const uint32_t FLAC__STREAM_METADATA_VORBIS_COMMENT_ENTRY_LENGTH_LEN; /**< == 32 (bits) */
|
||||
|
||||
|
||||
/** FLAC VORBIS_COMMENT structure. (c.f. <A HREF="../format.html#metadata_block_vorbis_comment">format specification</A>)
|
||||
/** FLAC VORBIS_COMMENT structure. (c.f. <A HREF="https://xiph.org/flac/format.html#metadata_block_vorbis_comment">format specification</A>)
|
||||
*/
|
||||
typedef struct {
|
||||
FLAC__StreamMetadata_VorbisComment_Entry vendor_string;
|
||||
|
|
@ -641,7 +648,7 @@ extern FLAC_API const uint32_t FLAC__STREAM_METADATA_VORBIS_COMMENT_NUM_COMMENTS
|
|||
|
||||
|
||||
/** FLAC CUESHEET track index structure. (See the
|
||||
* <A HREF="../format.html#cuesheet_track_index">format specification</A> for
|
||||
* <A HREF="https://xiph.org/flac/format.html#cuesheet_track_index">format specification</A> for
|
||||
* the full description of each field.)
|
||||
*/
|
||||
typedef struct {
|
||||
|
|
@ -660,7 +667,7 @@ extern FLAC_API const uint32_t FLAC__STREAM_METADATA_CUESHEET_INDEX_RESERVED_LEN
|
|||
|
||||
|
||||
/** FLAC CUESHEET track structure. (See the
|
||||
* <A HREF="../format.html#cuesheet_track">format specification</A> for
|
||||
* <A HREF="https://xiph.org/flac/format.html#cuesheet_track">format specification</A> for
|
||||
* the full description of each field.)
|
||||
*/
|
||||
typedef struct {
|
||||
|
|
@ -697,7 +704,7 @@ extern FLAC_API const uint32_t FLAC__STREAM_METADATA_CUESHEET_TRACK_NUM_INDICES_
|
|||
|
||||
|
||||
/** FLAC CUESHEET structure. (See the
|
||||
* <A HREF="../format.html#metadata_block_cuesheet">format specification</A>
|
||||
* <A HREF="https://xiph.org/flac/format.html#metadata_block_cuesheet">format specification</A>
|
||||
* for the full description of each field.)
|
||||
*/
|
||||
typedef struct {
|
||||
|
|
@ -763,7 +770,7 @@ typedef enum {
|
|||
extern FLAC_API const char * const FLAC__StreamMetadata_Picture_TypeString[];
|
||||
|
||||
/** FLAC PICTURE structure. (See the
|
||||
* <A HREF="../format.html#metadata_block_picture">format specification</A>
|
||||
* <A HREF="https://xiph.org/flac/format.html#metadata_block_picture">format specification</A>
|
||||
* for the full description of each field.)
|
||||
*/
|
||||
typedef struct {
|
||||
|
|
@ -829,9 +836,9 @@ typedef struct {
|
|||
} FLAC__StreamMetadata_Unknown;
|
||||
|
||||
|
||||
/** FLAC metadata block structure. (c.f. <A HREF="../format.html#metadata_block">format specification</A>)
|
||||
/** FLAC metadata block structure. (c.f. <A HREF="https://xiph.org/flac/format.html#metadata_block">format specification</A>)
|
||||
*/
|
||||
typedef struct {
|
||||
typedef struct FLAC__StreamMetadata {
|
||||
FLAC__MetadataType type;
|
||||
/**< The type of the metadata block; used determine which member of the
|
||||
* \a data union to dereference. If type >= FLAC__METADATA_TYPE_UNDEFINED
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/* libFLAC - Free Lossless Audio Codec library
|
||||
* Copyright (C) 2001-2009 Josh Coalson
|
||||
* Copyright (C) 2011-2016 Xiph.Org Foundation
|
||||
* Copyright (C) 2011-2023 Xiph.Org Foundation
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/* libFLAC - Free Lossless Audio Codec library
|
||||
* Copyright (C) 2000-2009 Josh Coalson
|
||||
* Copyright (C) 2011-2018 Xiph.Org Foundation
|
||||
* Copyright (C) 2011-2023 Xiph.Org Foundation
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
|
|
@ -39,6 +39,8 @@
|
|||
#include "include/private/bitmath.h"
|
||||
#include "include/private/bitreader.h"
|
||||
#include "include/private/crc.h"
|
||||
#include "include/private/cpu.h"
|
||||
|
||||
#include "../assert.h"
|
||||
#include "../compat.h"
|
||||
#include "../endswap.h"
|
||||
|
|
@ -110,6 +112,9 @@ struct FLAC__BitReader {
|
|||
uint32_t read_crc16; /* the running frame CRC */
|
||||
uint32_t crc16_offset; /* the number of words in the current buffer that should not be CRC'd */
|
||||
uint32_t crc16_align; /* the number of bits in the current consumed word that should not be CRC'd */
|
||||
FLAC__bool read_limit_set; /* whether reads are limited */
|
||||
uint32_t read_limit; /* the remaining size of what can be read */
|
||||
uint32_t last_seen_framesync; /* the location of the last seen framesync, if it is in the buffer, in bits from front of buffer */
|
||||
FLAC__BitReaderReadCallback read_callback;
|
||||
void *client_data;
|
||||
};
|
||||
|
|
@ -154,9 +159,16 @@ static FLAC__bool bitreader_read_from_client_(FLAC__BitReader *br)
|
|||
uint32_t start, end;
|
||||
size_t bytes;
|
||||
FLAC__byte *target;
|
||||
#if WORDS_BIGENDIAN
|
||||
#else
|
||||
brword preswap_backup;
|
||||
#endif
|
||||
|
||||
/* first shift the unconsumed buffer data toward the front as much as possible */
|
||||
if(br->consumed_words > 0) {
|
||||
/* invalidate last seen framesync */
|
||||
br->last_seen_framesync = (uint32_t) -1;
|
||||
|
||||
crc16_update_block_(br); /* CRC consumed words */
|
||||
|
||||
start = br->consumed_words;
|
||||
|
|
@ -185,6 +197,7 @@ static FLAC__bool bitreader_read_from_client_(FLAC__BitReader *br)
|
|||
*/
|
||||
#if WORDS_BIGENDIAN
|
||||
#else
|
||||
preswap_backup = br->buffer[br->words];
|
||||
if(br->bytes)
|
||||
br->buffer[br->words] = SWAP_BE_WORD_TO_HOST(br->buffer[br->words]);
|
||||
#endif
|
||||
|
|
@ -197,8 +210,16 @@ static FLAC__bool bitreader_read_from_client_(FLAC__BitReader *br)
|
|||
*/
|
||||
|
||||
/* read in the data; note that the callback may return a smaller number of bytes */
|
||||
if(!br->read_callback(target, &bytes, br->client_data))
|
||||
if(!br->read_callback(target, &bytes, br->client_data)){
|
||||
/* Despite the read callback failing, the data in the target
|
||||
* might be used later, when the buffer is rewound. Therefore
|
||||
* we revert the swap that was just done */
|
||||
#if WORDS_BIGENDIAN
|
||||
#else
|
||||
br->buffer[br->words] = preswap_backup;
|
||||
#endif
|
||||
return false;
|
||||
}
|
||||
|
||||
/* after reading bytes 66 77 88 99 AA BB CC DD EE FF from the client:
|
||||
* bitstream : 11 22 33 44 55 66 77 88 99 AA BB CC DD EE FF
|
||||
|
|
@ -274,6 +295,9 @@ FLAC__bool FLAC__bitreader_init(FLAC__BitReader *br, FLAC__BitReaderReadCallback
|
|||
return false;
|
||||
br->read_callback = rcb;
|
||||
br->client_data = cd;
|
||||
br->read_limit_set = false;
|
||||
br->read_limit = (uint32_t) -1;
|
||||
br->last_seen_framesync = (uint32_t) -1;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
@ -290,42 +314,36 @@ void FLAC__bitreader_free(FLAC__BitReader *br)
|
|||
br->consumed_words = br->consumed_bits = 0;
|
||||
br->read_callback = 0;
|
||||
br->client_data = 0;
|
||||
br->read_limit_set = false;
|
||||
br->read_limit = (uint32_t) -1;
|
||||
br->last_seen_framesync = (uint32_t) -1;
|
||||
}
|
||||
|
||||
FLAC__bool FLAC__bitreader_clear(FLAC__BitReader *br)
|
||||
{
|
||||
br->words = br->bytes = 0;
|
||||
br->consumed_words = br->consumed_bits = 0;
|
||||
br->read_limit_set = false;
|
||||
br->read_limit = (uint32_t) -1;
|
||||
br->last_seen_framesync = (uint32_t) -1;
|
||||
return true;
|
||||
}
|
||||
|
||||
void FLAC__bitreader_dump(const FLAC__BitReader *br, FILE *out)
|
||||
void FLAC__bitreader_set_framesync_location(FLAC__BitReader *br)
|
||||
{
|
||||
uint32_t i, j;
|
||||
if(br == 0) {
|
||||
fprintf(out, "bitreader is NULL\n");
|
||||
br->last_seen_framesync = br->consumed_words * FLAC__BYTES_PER_WORD + br->consumed_bits / 8;
|
||||
}
|
||||
|
||||
FLAC__bool FLAC__bitreader_rewind_to_after_last_seen_framesync(FLAC__BitReader *br)
|
||||
{
|
||||
if(br->last_seen_framesync == (uint32_t)-1) {
|
||||
br->consumed_words = br->consumed_bits = 0;
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
fprintf(out, "bitreader: capacity=%u words=%u bytes=%u consumed: words=%u, bits=%u\n", br->capacity, br->words, br->bytes, br->consumed_words, br->consumed_bits);
|
||||
|
||||
for(i = 0; i < br->words; i++) {
|
||||
fprintf(out, "%08X: ", i);
|
||||
for(j = 0; j < FLAC__BITS_PER_WORD; j++)
|
||||
if(i < br->consumed_words || (i == br->consumed_words && j < br->consumed_bits))
|
||||
fprintf(out, ".");
|
||||
else
|
||||
fprintf(out, "%01d", br->buffer[i] & ((brword)1 << (FLAC__BITS_PER_WORD-j-1)) ? 1:0);
|
||||
fprintf(out, "\n");
|
||||
}
|
||||
if(br->bytes > 0) {
|
||||
fprintf(out, "%08X: ", i);
|
||||
for(j = 0; j < br->bytes*8; j++)
|
||||
if(i < br->consumed_words || (i == br->consumed_words && j < br->consumed_bits))
|
||||
fprintf(out, ".");
|
||||
else
|
||||
fprintf(out, "%01d", br->buffer[i] & ((brword)1 << (br->bytes*8-j-1)) ? 1:0);
|
||||
fprintf(out, "\n");
|
||||
}
|
||||
br->consumed_words = (br->last_seen_framesync + 1) / FLAC__BYTES_PER_WORD;
|
||||
br->consumed_bits = ((br->last_seen_framesync + 1) % FLAC__BYTES_PER_WORD) * 8;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -375,6 +393,28 @@ inline uint32_t FLAC__bitreader_get_input_bits_unconsumed(const FLAC__BitReader
|
|||
return (br->words-br->consumed_words)*FLAC__BITS_PER_WORD + br->bytes*8 - br->consumed_bits;
|
||||
}
|
||||
|
||||
void FLAC__bitreader_set_limit(FLAC__BitReader *br, uint32_t limit)
|
||||
{
|
||||
br->read_limit = limit;
|
||||
br->read_limit_set = true;
|
||||
}
|
||||
|
||||
void FLAC__bitreader_remove_limit(FLAC__BitReader *br)
|
||||
{
|
||||
br->read_limit_set = false;
|
||||
br->read_limit = (uint32_t) -1;
|
||||
}
|
||||
|
||||
uint32_t FLAC__bitreader_limit_remaining(FLAC__BitReader *br)
|
||||
{
|
||||
FLAC__ASSERT(br->read_limit_set);
|
||||
return br->read_limit;
|
||||
}
|
||||
void FLAC__bitreader_limit_invalidate(FLAC__BitReader *br)
|
||||
{
|
||||
br->read_limit = (uint32_t) -1;
|
||||
}
|
||||
|
||||
FLAC__bool FLAC__bitreader_read_raw_uint32(FLAC__BitReader *br, FLAC__uint32 *val, uint32_t bits)
|
||||
{
|
||||
FLAC__ASSERT(0 != br);
|
||||
|
|
@ -392,6 +432,15 @@ FLAC__bool FLAC__bitreader_read_raw_uint32(FLAC__BitReader *br, FLAC__uint32 *va
|
|||
return true;
|
||||
}
|
||||
|
||||
if(br->read_limit_set && br->read_limit < (uint32_t)-1){
|
||||
if(br->read_limit < bits) {
|
||||
br->read_limit = (uint32_t) -1;
|
||||
return false;
|
||||
}
|
||||
else
|
||||
br->read_limit -= bits;
|
||||
}
|
||||
|
||||
while((br->words-br->consumed_words)*FLAC__BITS_PER_WORD + br->bytes*8 - br->consumed_bits < bits) {
|
||||
if(!bitreader_read_from_client_(br))
|
||||
return false;
|
||||
|
|
@ -464,7 +513,7 @@ FLAC__bool FLAC__bitreader_read_raw_int32(FLAC__BitReader *br, FLAC__int32 *val,
|
|||
return false;
|
||||
/* sign-extend *val assuming it is currently bits wide. */
|
||||
/* From: https://graphics.stanford.edu/~seander/bithacks.html#FixedSignExtend */
|
||||
mask = bits >= 33 ? 0 : 1u << (bits - 1);
|
||||
mask = bits >= 33 ? 0 : 1lu << (bits - 1);
|
||||
*val = (uval ^ mask) - mask;
|
||||
return true;
|
||||
}
|
||||
|
|
@ -490,6 +539,19 @@ FLAC__bool FLAC__bitreader_read_raw_uint64(FLAC__BitReader *br, FLAC__uint64 *va
|
|||
return true;
|
||||
}
|
||||
|
||||
FLAC__bool FLAC__bitreader_read_raw_int64(FLAC__BitReader *br, FLAC__int64 *val, uint32_t bits)
|
||||
{
|
||||
FLAC__uint64 uval, mask;
|
||||
/* OPT: inline raw uint64 code here, or make into a macro if possible in the .h file */
|
||||
if (bits < 1 || ! FLAC__bitreader_read_raw_uint64(br, &uval, bits))
|
||||
return false;
|
||||
/* sign-extend *val assuming it is currently bits wide. */
|
||||
/* From: https://graphics.stanford.edu/~seander/bithacks.html#FixedSignExtend */
|
||||
mask = bits >= 65 ? 0 : 1llu << (bits - 1);
|
||||
*val = (uval ^ mask) - mask;
|
||||
return true;
|
||||
}
|
||||
|
||||
inline FLAC__bool FLAC__bitreader_read_uint32_little_endian(FLAC__BitReader *br, FLAC__uint32 *val)
|
||||
{
|
||||
FLAC__uint32 x8, x32 = 0;
|
||||
|
|
@ -558,6 +620,13 @@ FLAC__bool FLAC__bitreader_skip_byte_block_aligned_no_crc(FLAC__BitReader *br, u
|
|||
FLAC__ASSERT(0 != br->buffer);
|
||||
FLAC__ASSERT(FLAC__bitreader_is_consumed_byte_aligned(br));
|
||||
|
||||
if(br->read_limit_set && br->read_limit < (uint32_t)-1){
|
||||
if(br->read_limit < nvals*8){
|
||||
br->read_limit = (uint32_t) -1;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/* step 1: skip over partial head word to get word aligned */
|
||||
while(nvals && br->consumed_bits) { /* i.e. run until we read 'nvals' bytes or we hit the end of the head word */
|
||||
if(!FLAC__bitreader_read_raw_uint32(br, &x, 8))
|
||||
|
|
@ -566,11 +635,14 @@ FLAC__bool FLAC__bitreader_skip_byte_block_aligned_no_crc(FLAC__BitReader *br, u
|
|||
}
|
||||
if(0 == nvals)
|
||||
return true;
|
||||
|
||||
/* step 2: skip whole words in chunks */
|
||||
while(nvals >= FLAC__BYTES_PER_WORD) {
|
||||
if(br->consumed_words < br->words) {
|
||||
br->consumed_words++;
|
||||
nvals -= FLAC__BYTES_PER_WORD;
|
||||
if(br->read_limit_set)
|
||||
br->read_limit -= FLAC__BITS_PER_WORD;
|
||||
}
|
||||
else if(!bitreader_read_from_client_(br))
|
||||
return false;
|
||||
|
|
@ -593,6 +665,13 @@ FLAC__bool FLAC__bitreader_read_byte_block_aligned_no_crc(FLAC__BitReader *br, F
|
|||
FLAC__ASSERT(0 != br->buffer);
|
||||
FLAC__ASSERT(FLAC__bitreader_is_consumed_byte_aligned(br));
|
||||
|
||||
if(br->read_limit_set && br->read_limit < (uint32_t)-1){
|
||||
if(br->read_limit < nvals*8){
|
||||
br->read_limit = (uint32_t) -1;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/* step 1: read from partial head word to get word aligned */
|
||||
while(nvals && br->consumed_bits) { /* i.e. run until we read 'nvals' bytes or we hit the end of the head word */
|
||||
if(!FLAC__bitreader_read_raw_uint32(br, &x, 8))
|
||||
|
|
@ -626,6 +705,8 @@ FLAC__bool FLAC__bitreader_read_byte_block_aligned_no_crc(FLAC__BitReader *br, F
|
|||
#endif
|
||||
val += FLAC__BYTES_PER_WORD;
|
||||
nvals -= FLAC__BYTES_PER_WORD;
|
||||
if(br->read_limit_set)
|
||||
br->read_limit -= FLAC__BITS_PER_WORD;
|
||||
}
|
||||
else if(!bitreader_read_from_client_(br))
|
||||
return false;
|
||||
|
|
@ -720,6 +801,7 @@ FLAC__bool FLAC__bitreader_read_unary_unsigned(FLAC__BitReader *br, uint32_t *va
|
|||
}
|
||||
#endif
|
||||
|
||||
#if 0 /* unused */
|
||||
FLAC__bool FLAC__bitreader_read_rice_signed(FLAC__BitReader *br, int *val, uint32_t parameter)
|
||||
{
|
||||
FLAC__uint32 lsbs = 0, msbs = 0;
|
||||
|
|
@ -746,146 +828,17 @@ FLAC__bool FLAC__bitreader_read_rice_signed(FLAC__BitReader *br, int *val, uint3
|
|||
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* this is by far the most heavily used reader call. it ain't pretty but it's fast */
|
||||
FLAC__bool FLAC__bitreader_read_rice_signed_block(FLAC__BitReader *br, int vals[], uint32_t nvals, uint32_t parameter)
|
||||
{
|
||||
/* try and get br->consumed_words and br->consumed_bits into register;
|
||||
* must remember to flush them back to *br before calling other
|
||||
* bitreader functions that use them, and before returning */
|
||||
uint32_t cwords, words, lsbs, msbs, x, y;
|
||||
uint32_t ucbits; /* keep track of the number of unconsumed bits in word */
|
||||
brword b;
|
||||
int *val, *end;
|
||||
#include "deduplication/bitreader_read_rice_signed_block.c"
|
||||
|
||||
FLAC__ASSERT(0 != br);
|
||||
FLAC__ASSERT(0 != br->buffer);
|
||||
/* WATCHOUT: code does not work with <32bit words; we can make things much faster with this assertion */
|
||||
FLAC__ASSERT(FLAC__BITS_PER_WORD >= 32);
|
||||
FLAC__ASSERT(parameter < 32);
|
||||
/* the above two asserts also guarantee that the binary part never straddles more than 2 words, so we don't have to loop to read it */
|
||||
|
||||
val = vals;
|
||||
end = vals + nvals;
|
||||
|
||||
if(parameter == 0) {
|
||||
while(val < end) {
|
||||
/* read the unary MSBs and end bit */
|
||||
if(!FLAC__bitreader_read_unary_unsigned(br, &msbs))
|
||||
return false;
|
||||
|
||||
*val++ = (int)(msbs >> 1) ^ -(int)(msbs & 1);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
FLAC__ASSERT(parameter > 0);
|
||||
|
||||
cwords = br->consumed_words;
|
||||
words = br->words;
|
||||
|
||||
/* if we've not consumed up to a partial tail word... */
|
||||
if(cwords >= words) {
|
||||
x = 0;
|
||||
goto process_tail;
|
||||
}
|
||||
|
||||
ucbits = FLAC__BITS_PER_WORD - br->consumed_bits;
|
||||
b = br->buffer[cwords] << br->consumed_bits; /* keep unconsumed bits aligned to left */
|
||||
|
||||
while(val < end) {
|
||||
/* read the unary MSBs and end bit */
|
||||
x = y = COUNT_ZERO_MSBS2(b);
|
||||
if(x == FLAC__BITS_PER_WORD) {
|
||||
x = ucbits;
|
||||
do {
|
||||
/* didn't find stop bit yet, have to keep going... */
|
||||
cwords++;
|
||||
if (cwords >= words)
|
||||
goto incomplete_msbs;
|
||||
b = br->buffer[cwords];
|
||||
y = COUNT_ZERO_MSBS2(b);
|
||||
x += y;
|
||||
} while(y == FLAC__BITS_PER_WORD);
|
||||
}
|
||||
b <<= y;
|
||||
b <<= 1; /* account for stop bit */
|
||||
ucbits = (ucbits - x - 1) % FLAC__BITS_PER_WORD;
|
||||
msbs = x;
|
||||
|
||||
/* read the binary LSBs */
|
||||
x = (FLAC__uint32)(b >> (FLAC__BITS_PER_WORD - parameter)); /* parameter < 32, so we can cast to 32-bit uint32_t */
|
||||
if(parameter <= ucbits) {
|
||||
ucbits -= parameter;
|
||||
b <<= parameter;
|
||||
} else {
|
||||
/* there are still bits left to read, they will all be in the next word */
|
||||
cwords++;
|
||||
if (cwords >= words)
|
||||
goto incomplete_lsbs;
|
||||
b = br->buffer[cwords];
|
||||
ucbits += FLAC__BITS_PER_WORD - parameter;
|
||||
x |= (FLAC__uint32)(b >> ucbits);
|
||||
b <<= FLAC__BITS_PER_WORD - ucbits;
|
||||
}
|
||||
lsbs = x;
|
||||
|
||||
/* compose the value */
|
||||
x = (msbs << parameter) | lsbs;
|
||||
*val++ = (int)(x >> 1) ^ -(int)(x & 1);
|
||||
|
||||
continue;
|
||||
|
||||
/* at this point we've eaten up all the whole words */
|
||||
process_tail:
|
||||
do {
|
||||
if(0) {
|
||||
incomplete_msbs:
|
||||
br->consumed_bits = 0;
|
||||
br->consumed_words = cwords;
|
||||
}
|
||||
|
||||
/* read the unary MSBs and end bit */
|
||||
if(!FLAC__bitreader_read_unary_unsigned(br, &msbs))
|
||||
return false;
|
||||
msbs += x;
|
||||
x = ucbits = 0;
|
||||
|
||||
if(0) {
|
||||
incomplete_lsbs:
|
||||
br->consumed_bits = 0;
|
||||
br->consumed_words = cwords;
|
||||
}
|
||||
|
||||
/* read the binary LSBs */
|
||||
if(!FLAC__bitreader_read_raw_uint32(br, &lsbs, parameter - ucbits))
|
||||
return false;
|
||||
lsbs = x | lsbs;
|
||||
|
||||
/* compose the value */
|
||||
x = (msbs << parameter) | lsbs;
|
||||
*val++ = (int)(x >> 1) ^ -(int)(x & 1);
|
||||
x = 0;
|
||||
|
||||
cwords = br->consumed_words;
|
||||
words = br->words;
|
||||
ucbits = FLAC__BITS_PER_WORD - br->consumed_bits;
|
||||
b = cwords < br->capacity ? br->buffer[cwords] << br->consumed_bits : 0;
|
||||
} while(cwords >= words && val < end);
|
||||
}
|
||||
|
||||
if(ucbits == 0 && cwords < words) {
|
||||
/* don't leave the head word with no unconsumed bits */
|
||||
cwords++;
|
||||
ucbits = FLAC__BITS_PER_WORD;
|
||||
}
|
||||
|
||||
br->consumed_bits = FLAC__BITS_PER_WORD - ucbits;
|
||||
br->consumed_words = cwords;
|
||||
|
||||
return true;
|
||||
}
|
||||
#ifdef FLAC__BMI2_SUPPORTED
|
||||
FLAC__SSE_TARGET("bmi2")
|
||||
FLAC__bool FLAC__bitreader_read_rice_signed_block_bmi2(FLAC__BitReader *br, int vals[], uint32_t nvals, uint32_t parameter)
|
||||
#include "deduplication/bitreader_read_rice_signed_block.c"
|
||||
#endif
|
||||
|
||||
#if 0 /* UNUSED */
|
||||
FLAC__bool FLAC__bitreader_read_golomb_signed(FLAC__BitReader *br, int *val, uint32_t parameter)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/* libFLAC - Free Lossless Audio Codec library
|
||||
* Copyright (C) 2000-2009 Josh Coalson
|
||||
* Copyright (C) 2011-2016 Xiph.Org Foundation
|
||||
* Copyright (C) 2011-2023 Xiph.Org Foundation
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
|
|
@ -38,6 +38,9 @@
|
|||
#include <string.h>
|
||||
#include "include/private/bitwriter.h"
|
||||
#include "include/private/crc.h"
|
||||
#include "include/private/format.h"
|
||||
|
||||
#include "include/private/stream_encoder.h"
|
||||
#include "../assert.h"
|
||||
#include "../alloc.h"
|
||||
#include "../compat.h"
|
||||
|
|
@ -50,8 +53,11 @@
|
|||
#if (ENABLE_64_BIT_WORDS == 0)
|
||||
|
||||
typedef FLAC__uint32 bwword;
|
||||
typedef FLAC__uint64 FLAC__bwtemp;
|
||||
#define FLAC__BYTES_PER_WORD 4 /* sizeof bwword */
|
||||
#define FLAC__BITS_PER_WORD 32
|
||||
#define FLAC__TEMP_BITS 64
|
||||
#define FLAC__HALF_TEMP_BITS 32
|
||||
/* SWAP_BE_WORD_TO_HOST swaps bytes in a bwword (which is always big-endian) if necessary to match host byte order */
|
||||
#if WORDS_BIGENDIAN
|
||||
#define SWAP_BE_WORD_TO_HOST(x) (x)
|
||||
|
|
@ -62,8 +68,11 @@ typedef FLAC__uint32 bwword;
|
|||
#else
|
||||
|
||||
typedef FLAC__uint64 bwword;
|
||||
typedef FLAC__uint64 FLAC__bwtemp;
|
||||
#define FLAC__BYTES_PER_WORD 8 /* sizeof bwword */
|
||||
#define FLAC__BITS_PER_WORD 64
|
||||
#define FLAC__TEMP_BITS 64
|
||||
#define FLAC__HALF_TEMP_BITS 32
|
||||
/* SWAP_BE_WORD_TO_HOST swaps bytes in a bwword (which is always big-endian) if necessary to match host byte order */
|
||||
#if WORDS_BIGENDIAN
|
||||
#define SWAP_BE_WORD_TO_HOST(x) (x)
|
||||
|
|
@ -115,6 +124,13 @@ FLAC__bool bitwriter_grow_(FLAC__BitWriter *bw, uint32_t bits_to_add)
|
|||
if(bw->capacity >= new_capacity)
|
||||
return true;
|
||||
|
||||
if(new_capacity * sizeof(bwword) > (1u << FLAC__STREAM_METADATA_LENGTH_LEN))
|
||||
/* Requested new capacity is larger than the largest possible metadata block,
|
||||
* which is also larger than the largest sane framesize. That means something
|
||||
* went very wrong somewhere and previous checks failed.
|
||||
* To prevent chrashing, give up */
|
||||
return false;
|
||||
|
||||
/* round up capacity increase to the nearest FLAC__BITWRITER_DEFAULT_INCREMENT */
|
||||
if((new_capacity - bw->capacity) % FLAC__BITWRITER_DEFAULT_INCREMENT)
|
||||
new_capacity += FLAC__BITWRITER_DEFAULT_INCREMENT - ((new_capacity - bw->capacity) % FLAC__BITWRITER_DEFAULT_INCREMENT);
|
||||
|
|
@ -123,7 +139,7 @@ FLAC__bool bitwriter_grow_(FLAC__BitWriter *bw, uint32_t bits_to_add)
|
|||
FLAC__ASSERT(new_capacity > bw->capacity);
|
||||
FLAC__ASSERT(new_capacity >= bw->words + ((bw->bits + bits_to_add + FLAC__BITS_PER_WORD - 1) / FLAC__BITS_PER_WORD));
|
||||
|
||||
new_buffer = (bwword*) safe_realloc_mul_2op_(bw->buffer, sizeof(bwword), /*times*/new_capacity);
|
||||
new_buffer = (bwword*) safe_realloc_nofree_mul_2op_(bw->buffer, sizeof(bwword), /*times*/new_capacity);
|
||||
if(new_buffer == 0)
|
||||
return false;
|
||||
bw->buffer = new_buffer;
|
||||
|
|
@ -188,30 +204,6 @@ void FLAC__bitwriter_clear(FLAC__BitWriter *bw)
|
|||
bw->words = bw->bits = 0;
|
||||
}
|
||||
|
||||
void FLAC__bitwriter_dump(const FLAC__BitWriter *bw, FILE *out)
|
||||
{
|
||||
uint32_t i, j;
|
||||
if(bw == 0) {
|
||||
fprintf(out, "bitwriter is NULL\n");
|
||||
}
|
||||
else {
|
||||
fprintf(out, "bitwriter: capacity=%u words=%u bits=%u total_bits=%u\n", bw->capacity, bw->words, bw->bits, FLAC__TOTAL_BITS(bw));
|
||||
|
||||
for(i = 0; i < bw->words; i++) {
|
||||
fprintf(out, "%08X: ", i);
|
||||
for(j = 0; j < FLAC__BITS_PER_WORD; j++)
|
||||
fprintf(out, "%01d", bw->buffer[i] & ((bwword)1 << (FLAC__BITS_PER_WORD-j-1)) ? 1:0);
|
||||
fprintf(out, "\n");
|
||||
}
|
||||
if(bw->bits > 0) {
|
||||
fprintf(out, "%08X: ", i);
|
||||
for(j = 0; j < bw->bits; j++)
|
||||
fprintf(out, "%01d", bw->accum & ((bwword)1 << (bw->bits-j-1)) ? 1:0);
|
||||
fprintf(out, "\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
FLAC__bool FLAC__bitwriter_get_write_crc16(FLAC__BitWriter *bw, FLAC__uint16 *crc)
|
||||
{
|
||||
const FLAC__byte *buffer;
|
||||
|
|
@ -389,6 +381,15 @@ inline FLAC__bool FLAC__bitwriter_write_raw_uint64(FLAC__BitWriter *bw, FLAC__ui
|
|||
return FLAC__bitwriter_write_raw_uint32(bw, (FLAC__uint32)val, bits);
|
||||
}
|
||||
|
||||
inline FLAC__bool FLAC__bitwriter_write_raw_int64(FLAC__BitWriter *bw, FLAC__int64 val, uint32_t bits)
|
||||
{
|
||||
FLAC__uint64 uval = val;
|
||||
/* zero-out unused bits */
|
||||
if(bits < 64)
|
||||
uval &= (~(UINT64_MAX << bits));
|
||||
return FLAC__bitwriter_write_raw_uint64(bw, uval, bits);
|
||||
}
|
||||
|
||||
inline FLAC__bool FLAC__bitwriter_write_raw_uint32_little_endian(FLAC__BitWriter *bw, FLAC__uint32 val)
|
||||
{
|
||||
/* this doesn't need to be that fast as currently it is only used for vorbis comments */
|
||||
|
|
@ -432,6 +433,7 @@ FLAC__bool FLAC__bitwriter_write_unary_unsigned(FLAC__BitWriter *bw, uint32_t va
|
|||
FLAC__bitwriter_write_raw_uint32_nocheck(bw, 1, 1);
|
||||
}
|
||||
|
||||
#if 0 /* UNUSED */
|
||||
uint32_t FLAC__bitwriter_rice_bits(FLAC__int32 val, uint32_t parameter)
|
||||
{
|
||||
FLAC__uint32 uval;
|
||||
|
|
@ -446,7 +448,6 @@ uint32_t FLAC__bitwriter_rice_bits(FLAC__int32 val, uint32_t parameter)
|
|||
return 1 + parameter + (uval >> parameter);
|
||||
}
|
||||
|
||||
#if 0 /* UNUSED */
|
||||
uint32_t FLAC__bitwriter_golomb_bits_signed(int val, uint32_t parameter)
|
||||
{
|
||||
uint32_t bits, msbs, uval;
|
||||
|
|
@ -508,7 +509,6 @@ uint32_t FLAC__bitwriter_golomb_bits_unsigned(uint32_t uval, uint32_t parameter)
|
|||
}
|
||||
return bits;
|
||||
}
|
||||
#endif /* UNUSED */
|
||||
|
||||
FLAC__bool FLAC__bitwriter_write_rice_signed(FLAC__BitWriter *bw, FLAC__int32 val, uint32_t parameter)
|
||||
{
|
||||
|
|
@ -537,21 +537,77 @@ FLAC__bool FLAC__bitwriter_write_rice_signed(FLAC__BitWriter *bw, FLAC__int32 va
|
|||
FLAC__bitwriter_write_zeroes(bw, msbs) && /* write the unary MSBs */
|
||||
FLAC__bitwriter_write_raw_uint32(bw, pattern, interesting_bits); /* write the unary end bit and binary LSBs */
|
||||
}
|
||||
#endif /* UNUSED */
|
||||
|
||||
#if (ENABLE_64_BIT_WORDS == 0)
|
||||
|
||||
#define WIDE_ACCUM_TO_BW { \
|
||||
bw->accum = wide_accum >> FLAC__HALF_TEMP_BITS; \
|
||||
bw->buffer[bw->words++] = SWAP_BE_WORD_TO_HOST(bw->accum); \
|
||||
wide_accum <<= FLAC__HALF_TEMP_BITS; \
|
||||
bitpointer += FLAC__HALF_TEMP_BITS; \
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
#define WIDE_ACCUM_TO_BW { \
|
||||
FLAC__ASSERT(bw->bits % FLAC__HALF_TEMP_BITS == 0); \
|
||||
if(bw->bits == 0) { \
|
||||
bw->accum = wide_accum >> FLAC__HALF_TEMP_BITS; \
|
||||
wide_accum <<= FLAC__HALF_TEMP_BITS; \
|
||||
bw->bits = FLAC__HALF_TEMP_BITS; \
|
||||
} \
|
||||
else { \
|
||||
bw->accum <<= FLAC__HALF_TEMP_BITS; \
|
||||
bw->accum += wide_accum >> FLAC__HALF_TEMP_BITS; \
|
||||
bw->buffer[bw->words++] = SWAP_BE_WORD_TO_HOST(bw->accum); \
|
||||
wide_accum <<= FLAC__HALF_TEMP_BITS; \
|
||||
bw->bits = 0; \
|
||||
} \
|
||||
bitpointer += FLAC__HALF_TEMP_BITS; \
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
FLAC__bool FLAC__bitwriter_write_rice_signed_block(FLAC__BitWriter *bw, const FLAC__int32 *vals, uint32_t nvals, uint32_t parameter)
|
||||
{
|
||||
const FLAC__uint32 mask1 = (FLAC__uint32)0xffffffff << parameter; /* we val|=mask1 to set the stop bit above it... */
|
||||
const FLAC__uint32 mask2 = (FLAC__uint32)0xffffffff >> (31-parameter); /* ...then mask off the bits above the stop bit with val&=mask2 */
|
||||
FLAC__uint32 uval;
|
||||
uint32_t left;
|
||||
const uint32_t lsbits = 1 + parameter;
|
||||
uint32_t msbits, total_bits;
|
||||
FLAC__bwtemp wide_accum = 0;
|
||||
FLAC__uint32 bitpointer = FLAC__TEMP_BITS;
|
||||
|
||||
FLAC__ASSERT(0 != bw);
|
||||
FLAC__ASSERT(0 != bw->buffer);
|
||||
FLAC__ASSERT(parameter < 31);
|
||||
/* WATCHOUT: code does not work with <32bit words; we can make things much faster with this assertion */
|
||||
FLAC__ASSERT(FLAC__BITS_PER_WORD >= 32);
|
||||
#if (ENABLE_64_BIT_WORDS == 0)
|
||||
if(bw->bits > 0) {
|
||||
bitpointer -= bw->bits;
|
||||
wide_accum = (FLAC__bwtemp)(bw->accum) << bitpointer;
|
||||
bw->bits = 0;
|
||||
}
|
||||
#else
|
||||
if(bw->bits > 0 && bw->bits < FLAC__HALF_TEMP_BITS) {
|
||||
bitpointer -= bw->bits;
|
||||
wide_accum = bw->accum << bitpointer;
|
||||
bw->bits = 0;
|
||||
}
|
||||
else if(bw->bits > FLAC__HALF_TEMP_BITS) {
|
||||
bitpointer -= (bw->bits - FLAC__HALF_TEMP_BITS);
|
||||
wide_accum = bw->accum << bitpointer;
|
||||
bw->accum >>= (bw->bits - FLAC__HALF_TEMP_BITS);
|
||||
bw->bits = FLAC__HALF_TEMP_BITS;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Reserve one FLAC__TEMP_BITS per symbol, so checks for space are only necessary when very large symbols are encountered
|
||||
* this might be considered wasteful, but is only at most 8kB more than necessary for a blocksize of 4096 */
|
||||
if(bw->capacity * FLAC__BITS_PER_WORD <= bw->words * FLAC__BITS_PER_WORD + nvals * FLAC__TEMP_BITS + bw->bits && !bitwriter_grow_(bw, nvals * FLAC__TEMP_BITS))
|
||||
return false;
|
||||
|
||||
while(nvals) {
|
||||
/* fold signed to uint32_t; actual formula is: negative(v)? -2v-1 : 2v */
|
||||
|
|
@ -562,73 +618,87 @@ FLAC__bool FLAC__bitwriter_write_rice_signed_block(FLAC__BitWriter *bw, const FL
|
|||
msbits = uval >> parameter;
|
||||
total_bits = lsbits + msbits;
|
||||
|
||||
if(bw->bits && bw->bits + total_bits < FLAC__BITS_PER_WORD) { /* i.e. if the whole thing fits in the current bwword */
|
||||
/* ^^^ if bw->bits is 0 then we may have filled the buffer and have no free bwword to work in */
|
||||
bw->bits += total_bits;
|
||||
uval |= mask1; /* set stop bit */
|
||||
uval &= mask2; /* mask off unused top bits */
|
||||
bw->accum <<= total_bits;
|
||||
bw->accum |= uval;
|
||||
uval |= mask1; /* set stop bit */
|
||||
uval &= mask2; /* mask off unused top bits */
|
||||
|
||||
|
||||
if(total_bits <= bitpointer) {
|
||||
/* There is room enough to store the symbol whole at once */
|
||||
wide_accum |= (FLAC__bwtemp)(uval) << (bitpointer - total_bits);
|
||||
bitpointer -= total_bits;
|
||||
if(bitpointer <= FLAC__HALF_TEMP_BITS) {
|
||||
/* A word is finished, copy the upper 32 bits of the wide_accum */
|
||||
WIDE_ACCUM_TO_BW
|
||||
}
|
||||
}
|
||||
else {
|
||||
/* slightly pessimistic size check but faster than "<= bw->words + (bw->bits+msbits+lsbits+FLAC__BITS_PER_WORD-1)/FLAC__BITS_PER_WORD" */
|
||||
/* OPT: pessimism may cause flurry of false calls to grow_ which eat up all savings before it */
|
||||
if(bw->capacity <= bw->words + bw->bits + msbits + 1 /* lsbits always fit in 1 bwword */ && !bitwriter_grow_(bw, total_bits))
|
||||
return false;
|
||||
|
||||
if(msbits) {
|
||||
/* first part gets to word alignment */
|
||||
if(bw->bits) {
|
||||
left = FLAC__BITS_PER_WORD - bw->bits;
|
||||
if(msbits < left) {
|
||||
bw->accum <<= msbits;
|
||||
bw->bits += msbits;
|
||||
goto break1;
|
||||
}
|
||||
else {
|
||||
bw->accum <<= left;
|
||||
msbits -= left;
|
||||
bw->buffer[bw->words++] = SWAP_BE_WORD_TO_HOST(bw->accum);
|
||||
bw->bits = 0;
|
||||
}
|
||||
}
|
||||
/* do whole words */
|
||||
while(msbits >= FLAC__BITS_PER_WORD) {
|
||||
bw->buffer[bw->words++] = 0;
|
||||
msbits -= FLAC__BITS_PER_WORD;
|
||||
}
|
||||
/* do any leftovers */
|
||||
if(msbits > 0) {
|
||||
bw->accum = 0;
|
||||
bw->bits = msbits;
|
||||
}
|
||||
/* The symbol needs to be split. This code isn't used often */
|
||||
/* First check for space in the bitwriter */
|
||||
if(total_bits > FLAC__TEMP_BITS) {
|
||||
FLAC__uint32 oversize_in_bits = total_bits - FLAC__TEMP_BITS;
|
||||
FLAC__uint32 capacity_needed = bw->words * FLAC__BITS_PER_WORD + bw->bits + nvals * FLAC__TEMP_BITS + oversize_in_bits;
|
||||
if(bw->capacity * FLAC__BITS_PER_WORD <= capacity_needed && !bitwriter_grow_(bw, nvals * FLAC__TEMP_BITS + oversize_in_bits))
|
||||
return false;
|
||||
}
|
||||
break1:
|
||||
uval |= mask1; /* set stop bit */
|
||||
uval &= mask2; /* mask off unused top bits */
|
||||
|
||||
left = FLAC__BITS_PER_WORD - bw->bits;
|
||||
if(lsbits < left) {
|
||||
bw->accum <<= lsbits;
|
||||
bw->accum |= uval;
|
||||
bw->bits += lsbits;
|
||||
if(msbits > bitpointer) {
|
||||
/* We have a lot of 0 bits to write, first align with bitwriter word */
|
||||
msbits -= bitpointer - FLAC__HALF_TEMP_BITS;
|
||||
bitpointer = FLAC__HALF_TEMP_BITS;
|
||||
WIDE_ACCUM_TO_BW
|
||||
while(msbits > bitpointer) {
|
||||
/* As the accumulator is already zero, we only need to
|
||||
* assign zeroes to the bitbuffer */
|
||||
WIDE_ACCUM_TO_BW
|
||||
bitpointer -= FLAC__HALF_TEMP_BITS;
|
||||
msbits -= FLAC__HALF_TEMP_BITS;
|
||||
}
|
||||
/* The remaining bits are zero, and the accumulator already is zero,
|
||||
* so just subtract the number of bits from bitpointer. When storing,
|
||||
* we can also just store 0 */
|
||||
bitpointer -= msbits;
|
||||
if(bitpointer <= FLAC__HALF_TEMP_BITS)
|
||||
WIDE_ACCUM_TO_BW
|
||||
}
|
||||
else {
|
||||
/* if bw->bits == 0, left==FLAC__BITS_PER_WORD which will always
|
||||
* be > lsbits (because of previous assertions) so it would have
|
||||
* triggered the (lsbits<left) case above.
|
||||
*/
|
||||
FLAC__ASSERT(bw->bits);
|
||||
FLAC__ASSERT(left < FLAC__BITS_PER_WORD);
|
||||
bw->accum <<= left;
|
||||
bw->accum |= uval >> (bw->bits = lsbits - left);
|
||||
bw->buffer[bw->words++] = SWAP_BE_WORD_TO_HOST(bw->accum);
|
||||
bw->accum = uval; /* unused top bits can contain garbage */
|
||||
bitpointer -= msbits;
|
||||
if(bitpointer <= FLAC__HALF_TEMP_BITS)
|
||||
WIDE_ACCUM_TO_BW
|
||||
}
|
||||
/* The lsbs + stop bit always fit 32 bit, so this code mirrors the code above */
|
||||
wide_accum |= (FLAC__bwtemp)(uval) << (bitpointer - lsbits);
|
||||
bitpointer -= lsbits;
|
||||
if(bitpointer <= FLAC__HALF_TEMP_BITS) {
|
||||
/* A word is finished, copy the upper 32 bits of the wide_accum */
|
||||
WIDE_ACCUM_TO_BW
|
||||
}
|
||||
}
|
||||
vals++;
|
||||
nvals--;
|
||||
}
|
||||
/* Now fixup remainder of wide_accum */
|
||||
#if (ENABLE_64_BIT_WORDS == 0)
|
||||
if(bitpointer < FLAC__TEMP_BITS) {
|
||||
bw->accum = wide_accum >> bitpointer;
|
||||
bw->bits = FLAC__TEMP_BITS - bitpointer;
|
||||
}
|
||||
#else
|
||||
if(bitpointer < FLAC__TEMP_BITS) {
|
||||
if(bw->bits == 0) {
|
||||
bw->accum = wide_accum >> bitpointer;
|
||||
bw->bits = FLAC__TEMP_BITS - bitpointer;
|
||||
}
|
||||
else if (bw->bits == FLAC__HALF_TEMP_BITS) {
|
||||
bw->accum <<= FLAC__TEMP_BITS - bitpointer;
|
||||
bw->accum |= (wide_accum >> bitpointer);
|
||||
bw->bits = FLAC__HALF_TEMP_BITS + FLAC__TEMP_BITS - bitpointer;
|
||||
}
|
||||
else {
|
||||
FLAC__ASSERT(0);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -880,5 +950,6 @@ extern FLAC__bool FLAC__bitwriter_write_zeroes(FLAC__BitWriter *bw, uint32_t bit
|
|||
extern FLAC__bool FLAC__bitwriter_write_raw_uint32(FLAC__BitWriter *bw, FLAC__uint32 val, uint32_t bits);
|
||||
extern FLAC__bool FLAC__bitwriter_write_raw_int32(FLAC__BitWriter *bw, FLAC__int32 val, uint32_t bits);
|
||||
extern FLAC__bool FLAC__bitwriter_write_raw_uint64(FLAC__BitWriter *bw, FLAC__uint64 val, uint32_t bits);
|
||||
extern FLAC__bool FLAC__bitwriter_write_raw_int64(FLAC__BitWriter *bw, FLAC__int64 val, uint32_t bits);
|
||||
extern FLAC__bool FLAC__bitwriter_write_raw_uint32_little_endian(FLAC__BitWriter *bw, FLAC__uint32 val);
|
||||
extern FLAC__bool FLAC__bitwriter_write_byte_block(FLAC__BitWriter *bw, const FLAC__byte vals[], uint32_t nvals);
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/* libFLAC - Free Lossless Audio Codec library
|
||||
* Copyright (C) 2001-2009 Josh Coalson
|
||||
* Copyright (C) 2011-2016 Xiph.Org Foundation
|
||||
* Copyright (C) 2011-2023 Xiph.Org Foundation
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
|
|
@ -36,30 +36,28 @@
|
|||
|
||||
#include "include/private/cpu.h"
|
||||
#include "../compat.h"
|
||||
//#include <stdlib.h>
|
||||
//#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#if defined _MSC_VER
|
||||
//#include <intrin.h> /* for __cpuid() and _xgetbv() */
|
||||
#include <intrin.h> /* for __cpuid() and _xgetbv() */
|
||||
#elif defined __GNUC__ && defined HAVE_CPUID_H
|
||||
#include <cpuid.h> /* for __get_cpuid() and __get_cpuid_max() */
|
||||
#endif
|
||||
|
||||
#ifndef NDEBUG
|
||||
//#include <stdio.h>
|
||||
#include <stdio.h>
|
||||
#define dfprintf fprintf
|
||||
#else
|
||||
/* This is bad practice, it should be a static void empty function */
|
||||
#define dfprintf(file, format, ...)
|
||||
#endif
|
||||
|
||||
#if defined FLAC__CPU_PPC
|
||||
#if defined(__linux__) || (defined(__FreeBSD__) && (__FreeBSD__ >= 12))
|
||||
#if defined(HAVE_SYS_AUXV_H)
|
||||
#include <sys/auxv.h>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if (defined FLAC__CPU_IA32 || defined FLAC__CPU_X86_64) && (defined FLAC__HAS_NASM || FLAC__HAS_X86INTRIN) && !defined FLAC__NO_ASM
|
||||
#if (defined FLAC__CPU_IA32 || defined FLAC__CPU_X86_64) && FLAC__HAS_X86INTRIN && !defined FLAC__NO_ASM
|
||||
|
||||
/* these are flags in EDX of CPUID AX=00000001 */
|
||||
static const uint32_t FLAC__CPUINFO_X86_CPUID_CMOV = 0x00008000;
|
||||
|
|
@ -78,6 +76,7 @@ static const uint32_t FLAC__CPUINFO_X86_CPUID_FMA = 0x00001000;
|
|||
|
||||
/* these are flags in EBX of CPUID AX=00000007 */
|
||||
static const uint32_t FLAC__CPUINFO_X86_CPUID_AVX2 = 0x00000020;
|
||||
static const uint32_t FLAC__CPUINFO_X86_CPUID_BMI2 = 0x00000100;
|
||||
|
||||
#if FLAC__AVX_SUPPORTED
|
||||
static uint32_t
|
||||
|
|
@ -101,8 +100,6 @@ cpu_have_cpuid(void)
|
|||
#if defined FLAC__CPU_X86_64 || defined __i686__ || defined __SSE__ || (defined _M_IX86_FP && _M_IX86_FP > 0)
|
||||
/* target CPU does have CPUID instruction */
|
||||
return 1;
|
||||
#elif defined FLAC__HAS_NASM
|
||||
return FLAC__cpu_have_cpuid_asm_ia32();
|
||||
#elif defined __GNUC__ && defined HAVE_CPUID_H
|
||||
if (__get_cpuid_max(0, 0) != 0)
|
||||
return 1;
|
||||
|
|
@ -133,7 +130,7 @@ cpu_have_cpuid(void)
|
|||
}
|
||||
|
||||
static void
|
||||
cpuinfo_x86(FLAC__uint32 level, FLAC__uint32 *eax, FLAC__uint32 *ebx, FLAC__uint32 *ecx, FLAC__uint32 *edx)
|
||||
cpuinfo_x86([[maybe_unused]] FLAC__uint32 level, FLAC__uint32 *eax, FLAC__uint32 *ebx, FLAC__uint32 *ecx, FLAC__uint32 *edx)
|
||||
{
|
||||
#if defined _MSC_VER
|
||||
int cpuinfo[4];
|
||||
|
|
@ -155,11 +152,7 @@ cpuinfo_x86(FLAC__uint32 level, FLAC__uint32 *eax, FLAC__uint32 *ebx, FLAC__uint
|
|||
__cpuid_count(level, 0, *eax, *ebx, *ecx, *edx);
|
||||
return;
|
||||
}
|
||||
#elif defined FLAC__HAS_NASM && defined FLAC__CPU_IA32
|
||||
FLAC__cpu_info_asm_ia32(level, eax, ebx, ecx, edx);
|
||||
return;
|
||||
#endif
|
||||
ignoreUnused (level);
|
||||
*eax = *ebx = *ecx = *edx = 0;
|
||||
}
|
||||
|
||||
|
|
@ -168,10 +161,10 @@ cpuinfo_x86(FLAC__uint32 level, FLAC__uint32 *eax, FLAC__uint32 *ebx, FLAC__uint
|
|||
static void
|
||||
x86_cpu_info (FLAC__CPUInfo *info)
|
||||
{
|
||||
#if (defined FLAC__CPU_IA32 || defined FLAC__CPU_X86_64) && (defined FLAC__HAS_NASM || FLAC__HAS_X86INTRIN) && !defined FLAC__NO_ASM
|
||||
#if FLAC__AVX_SUPPORTED
|
||||
#if (defined FLAC__CPU_IA32 || defined FLAC__CPU_X86_64) && FLAC__HAS_X86INTRIN && !defined FLAC__NO_ASM
|
||||
#if FLAC__AVX_SUPPORTED
|
||||
FLAC__bool x86_osxsave = false;
|
||||
#endif
|
||||
#endif
|
||||
FLAC__bool os_avx = false;
|
||||
FLAC__uint32 flags_eax, flags_ebx, flags_ecx, flags_edx;
|
||||
|
||||
|
|
@ -192,13 +185,14 @@ x86_cpu_info (FLAC__CPUInfo *info)
|
|||
info->x86.sse41 = (flags_ecx & FLAC__CPUINFO_X86_CPUID_SSE41) ? true : false;
|
||||
info->x86.sse42 = (flags_ecx & FLAC__CPUINFO_X86_CPUID_SSE42) ? true : false;
|
||||
|
||||
#if FLAC__AVX_SUPPORTED
|
||||
#if (FLAC__AVX_SUPPORTED)
|
||||
x86_osxsave = (flags_ecx & FLAC__CPUINFO_X86_CPUID_OSXSAVE) ? true : false;
|
||||
info->x86.avx = (flags_ecx & FLAC__CPUINFO_X86_CPUID_AVX ) ? true : false;
|
||||
info->x86.fma = (flags_ecx & FLAC__CPUINFO_X86_CPUID_FMA ) ? true : false;
|
||||
cpuinfo_x86(7, &flags_eax, &flags_ebx, &flags_ecx, &flags_edx);
|
||||
info->x86.avx2 = (flags_ebx & FLAC__CPUINFO_X86_CPUID_AVX2 ) ? true : false;
|
||||
#endif
|
||||
info->x86.bmi2 = (flags_ebx & FLAC__CPUINFO_X86_CPUID_BMI2 ) ? true : false;
|
||||
#endif
|
||||
|
||||
#if defined FLAC__CPU_IA32
|
||||
dfprintf(stderr, "CPU info (IA-32):\n", "");
|
||||
|
|
@ -218,6 +212,7 @@ x86_cpu_info (FLAC__CPUInfo *info)
|
|||
dfprintf(stderr, " AVX ........ %c\n", info->x86.avx ? 'Y' : 'n');
|
||||
dfprintf(stderr, " FMA ........ %c\n", info->x86.fma ? 'Y' : 'n');
|
||||
dfprintf(stderr, " AVX2 ....... %c\n", info->x86.avx2 ? 'Y' : 'n');
|
||||
dfprintf(stderr, " BMI2 ....... %c\n", info->x86.bmi2 ? 'Y' : 'n');
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -228,7 +223,6 @@ x86_cpu_info (FLAC__CPUInfo *info)
|
|||
os_avx = true;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (os_avx) {
|
||||
dfprintf(stderr, " AVX OS sup . %c\n", info->x86.avx ? 'Y' : 'n');
|
||||
}
|
||||
|
|
@ -243,47 +237,6 @@ x86_cpu_info (FLAC__CPUInfo *info)
|
|||
#endif
|
||||
}
|
||||
|
||||
static void
|
||||
ppc_cpu_info (FLAC__CPUInfo *info)
|
||||
{
|
||||
#if defined FLAC__CPU_PPC
|
||||
#ifndef PPC_FEATURE2_ARCH_3_00
|
||||
#define PPC_FEATURE2_ARCH_3_00 0x00800000
|
||||
#endif
|
||||
|
||||
#ifndef PPC_FEATURE2_ARCH_2_07
|
||||
#define PPC_FEATURE2_ARCH_2_07 0x80000000
|
||||
#endif
|
||||
|
||||
#ifdef __linux__
|
||||
if (getauxval(AT_HWCAP2) & PPC_FEATURE2_ARCH_3_00) {
|
||||
info->ppc.arch_3_00 = true;
|
||||
} else if (getauxval(AT_HWCAP2) & PPC_FEATURE2_ARCH_2_07) {
|
||||
info->ppc.arch_2_07 = true;
|
||||
}
|
||||
#elif defined(__FreeBSD__) && (__FreeBSD__ >= 12)
|
||||
long hwcaps;
|
||||
/* elf_aux_info() appeared in FreeBSD 12.0 */
|
||||
elf_aux_info(AT_HWCAP2, &hwcaps, sizeof(hwcaps));
|
||||
if (hwcaps & PPC_FEATURE2_ARCH_3_00) {
|
||||
info->ppc.arch_3_00 = true;
|
||||
} else if (hwcaps & PPC_FEATURE2_ARCH_2_07) {
|
||||
info->ppc.arch_2_07 = true;
|
||||
}
|
||||
#elif defined(__APPLE__)
|
||||
/* no Mac OS X version supports CPU with Power AVI v2.07 or better */
|
||||
info->ppc.arch_2_07 = false;
|
||||
info->ppc.arch_3_00 = false;
|
||||
#else
|
||||
#error Unsupported platform! Please add support for reading ppc hwcaps.
|
||||
#endif
|
||||
|
||||
#else
|
||||
info->ppc.arch_2_07 = false;
|
||||
info->ppc.arch_3_00 = false;
|
||||
#endif
|
||||
}
|
||||
|
||||
void FLAC__cpu_info (FLAC__CPUInfo *info)
|
||||
{
|
||||
memset(info, 0, sizeof(*info));
|
||||
|
|
@ -292,8 +245,6 @@ void FLAC__cpu_info (FLAC__CPUInfo *info)
|
|||
info->type = FLAC__CPUINFO_TYPE_IA32;
|
||||
#elif defined FLAC__CPU_X86_64
|
||||
info->type = FLAC__CPUINFO_TYPE_X86_64;
|
||||
#elif defined FLAC__CPU_PPC
|
||||
info->type = FLAC__CPUINFO_TYPE_PPC;
|
||||
#else
|
||||
info->type = FLAC__CPUINFO_TYPE_UNKNOWN;
|
||||
#endif
|
||||
|
|
@ -303,9 +254,6 @@ void FLAC__cpu_info (FLAC__CPUInfo *info)
|
|||
case FLAC__CPUINFO_TYPE_X86_64:
|
||||
x86_cpu_info (info);
|
||||
break;
|
||||
case FLAC__CPUINFO_TYPE_PPC:
|
||||
ppc_cpu_info (info);
|
||||
break;
|
||||
default:
|
||||
info->use_asm = false;
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/* libFLAC - Free Lossless Audio Codec library
|
||||
* Copyright (C) 2000-2009 Josh Coalson
|
||||
* Copyright (C) 2011-2018 Xiph.Org Foundation
|
||||
* Copyright (C) 2011-2023 Xiph.Org Foundation
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/* libFLAC - Free Lossless Audio Codec library
|
||||
* Copyright (C) 2000-2009 Josh Coalson
|
||||
* Copyright (C) 2011-2016 Xiph.Org Foundation
|
||||
* Copyright (C) 2011-2023 Xiph.Org Foundation
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
|
|
@ -39,6 +39,7 @@
|
|||
#include "../compat.h"
|
||||
#include "include/private/bitmath.h"
|
||||
#include "include/private/fixed.h"
|
||||
|
||||
#include "../assert.h"
|
||||
|
||||
#ifdef local_abs
|
||||
|
|
@ -46,6 +47,11 @@
|
|||
#endif
|
||||
#define local_abs(x) ((uint32_t)((x)<0? -(x) : (x)))
|
||||
|
||||
#ifdef local_abs64
|
||||
#undef local_abs64
|
||||
#endif
|
||||
#define local_abs64(x) ((uint64_t)((x)<0? -(x) : (x)))
|
||||
|
||||
#ifdef FLAC__INTEGER_ONLY_LIBRARY
|
||||
/* rbps stands for residual bits per sample
|
||||
*
|
||||
|
|
@ -218,14 +224,23 @@ uint32_t FLAC__fixed_compute_best_predictor(const FLAC__int32 data[], uint32_t d
|
|||
uint32_t FLAC__fixed_compute_best_predictor(const FLAC__int32 data[], uint32_t data_len, FLAC__fixedpoint residual_bits_per_sample[FLAC__MAX_FIXED_ORDER+1])
|
||||
#endif
|
||||
{
|
||||
FLAC__uint32 total_error_0 = 0, total_error_1 = 0, total_error_2 = 0, total_error_3 = 0, total_error_4 = 0;
|
||||
uint32_t order;
|
||||
#if 0
|
||||
/* This code has been around a long time, and was written when compilers weren't able
|
||||
* to vectorize code. These days, compilers are better in optimizing the next block
|
||||
* which is also much more readable
|
||||
*/
|
||||
FLAC__int32 last_error_0 = data[-1];
|
||||
FLAC__int32 last_error_1 = data[-1] - data[-2];
|
||||
FLAC__int32 last_error_2 = last_error_1 - (data[-2] - data[-3]);
|
||||
FLAC__int32 last_error_3 = last_error_2 - (data[-2] - 2*data[-3] + data[-4]);
|
||||
FLAC__int32 error, save;
|
||||
FLAC__uint32 total_error_0 = 0, total_error_1 = 0, total_error_2 = 0, total_error_3 = 0, total_error_4 = 0;
|
||||
uint32_t i, order;
|
||||
|
||||
uint32_t i;
|
||||
/* total_error_* are 64-bits to avoid overflow when encoding
|
||||
* erratic signals when the bits-per-sample and blocksize are
|
||||
* large.
|
||||
*/
|
||||
for(i = 0; i < data_len; i++) {
|
||||
error = data[i] ; total_error_0 += local_abs(error); save = error;
|
||||
error -= last_error_0; total_error_1 += local_abs(error); last_error_0 = save; save = error;
|
||||
|
|
@ -233,14 +248,26 @@ uint32_t FLAC__fixed_compute_best_predictor(const FLAC__int32 data[], uint32_t d
|
|||
error -= last_error_2; total_error_3 += local_abs(error); last_error_2 = save; save = error;
|
||||
error -= last_error_3; total_error_4 += local_abs(error); last_error_3 = save;
|
||||
}
|
||||
#else
|
||||
int i;
|
||||
for(i = 0; i < (int)data_len; i++) {
|
||||
total_error_0 += local_abs(data[i]);
|
||||
total_error_1 += local_abs(data[i] - data[i-1]);
|
||||
total_error_2 += local_abs(data[i] - 2 * data[i-1] + data[i-2]);
|
||||
total_error_3 += local_abs(data[i] - 3 * data[i-1] + 3 * data[i-2] - data[i-3]);
|
||||
total_error_4 += local_abs(data[i] - 4 * data[i-1] + 6 * data[i-2] - 4 * data[i-3] + data[i-4]);
|
||||
}
|
||||
#endif
|
||||
|
||||
if(total_error_0 < flac_min(flac_min(flac_min(total_error_1, total_error_2), total_error_3), total_error_4))
|
||||
|
||||
/* prefer lower order */
|
||||
if(total_error_0 <= flac_min(flac_min(flac_min(total_error_1, total_error_2), total_error_3), total_error_4))
|
||||
order = 0;
|
||||
else if(total_error_1 < flac_min(flac_min(total_error_2, total_error_3), total_error_4))
|
||||
else if(total_error_1 <= flac_min(flac_min(total_error_2, total_error_3), total_error_4))
|
||||
order = 1;
|
||||
else if(total_error_2 < flac_min(total_error_3, total_error_4))
|
||||
else if(total_error_2 <= flac_min(total_error_3, total_error_4))
|
||||
order = 2;
|
||||
else if(total_error_3 < total_error_4)
|
||||
else if(total_error_3 <= total_error_4)
|
||||
order = 3;
|
||||
else
|
||||
order = 4;
|
||||
|
|
@ -276,33 +303,26 @@ uint32_t FLAC__fixed_compute_best_predictor_wide(const FLAC__int32 data[], uint3
|
|||
uint32_t FLAC__fixed_compute_best_predictor_wide(const FLAC__int32 data[], uint32_t data_len, FLAC__fixedpoint residual_bits_per_sample[FLAC__MAX_FIXED_ORDER+1])
|
||||
#endif
|
||||
{
|
||||
FLAC__int32 last_error_0 = data[-1];
|
||||
FLAC__int32 last_error_1 = data[-1] - data[-2];
|
||||
FLAC__int32 last_error_2 = last_error_1 - (data[-2] - data[-3]);
|
||||
FLAC__int32 last_error_3 = last_error_2 - (data[-2] - 2*data[-3] + data[-4]);
|
||||
FLAC__int32 error, save;
|
||||
/* total_error_* are 64-bits to avoid overflow when encoding
|
||||
* erratic signals when the bits-per-sample and blocksize are
|
||||
* large.
|
||||
*/
|
||||
FLAC__uint64 total_error_0 = 0, total_error_1 = 0, total_error_2 = 0, total_error_3 = 0, total_error_4 = 0;
|
||||
uint32_t i, order;
|
||||
uint32_t order;
|
||||
int i;
|
||||
|
||||
for(i = 0; i < data_len; i++) {
|
||||
error = data[i] ; total_error_0 += local_abs(error); save = error;
|
||||
error -= last_error_0; total_error_1 += local_abs(error); last_error_0 = save; save = error;
|
||||
error -= last_error_1; total_error_2 += local_abs(error); last_error_1 = save; save = error;
|
||||
error -= last_error_2; total_error_3 += local_abs(error); last_error_2 = save; save = error;
|
||||
error -= last_error_3; total_error_4 += local_abs(error); last_error_3 = save;
|
||||
for(i = 0; i < (int)data_len; i++) {
|
||||
total_error_0 += local_abs(data[i]);
|
||||
total_error_1 += local_abs(data[i] - data[i-1]);
|
||||
total_error_2 += local_abs(data[i] - 2 * data[i-1] + data[i-2]);
|
||||
total_error_3 += local_abs(data[i] - 3 * data[i-1] + 3 * data[i-2] - data[i-3]);
|
||||
total_error_4 += local_abs(data[i] - 4 * data[i-1] + 6 * data[i-2] - 4 * data[i-3] + data[i-4]);
|
||||
}
|
||||
|
||||
if(total_error_0 < flac_min(flac_min(flac_min(total_error_1, total_error_2), total_error_3), total_error_4))
|
||||
/* prefer lower order */
|
||||
if(total_error_0 <= flac_min(flac_min(flac_min(total_error_1, total_error_2), total_error_3), total_error_4))
|
||||
order = 0;
|
||||
else if(total_error_1 < flac_min(flac_min(total_error_2, total_error_3), total_error_4))
|
||||
else if(total_error_1 <= flac_min(flac_min(total_error_2, total_error_3), total_error_4))
|
||||
order = 1;
|
||||
else if(total_error_2 < flac_min(total_error_3, total_error_4))
|
||||
else if(total_error_2 <= flac_min(total_error_3, total_error_4))
|
||||
order = 2;
|
||||
else if(total_error_3 < total_error_4)
|
||||
else if(total_error_3 <= total_error_4)
|
||||
order = 3;
|
||||
else
|
||||
order = 4;
|
||||
|
|
@ -332,6 +352,121 @@ uint32_t FLAC__fixed_compute_best_predictor_wide(const FLAC__int32 data[], uint3
|
|||
return order;
|
||||
}
|
||||
|
||||
#ifndef FLAC__INTEGER_ONLY_LIBRARY
|
||||
#define CHECK_ORDER_IS_VALID(macro_order) \
|
||||
if(order_##macro_order##_is_valid && total_error_##macro_order < smallest_error) { \
|
||||
order = macro_order; \
|
||||
smallest_error = total_error_##macro_order ; \
|
||||
residual_bits_per_sample[ macro_order ] = (float)((total_error_0 > 0) ? log(M_LN2 * (double)total_error_0 / (double)data_len) / M_LN2 : 0.0); \
|
||||
} \
|
||||
else \
|
||||
residual_bits_per_sample[ macro_order ] = 34.0f;
|
||||
#else
|
||||
#define CHECK_ORDER_IS_VALID(macro_order) \
|
||||
if(order_##macro_order##_is_valid && total_error_##macro_order < smallest_error) { \
|
||||
order = macro_order; \
|
||||
smallest_error = total_error_##macro_order ; \
|
||||
residual_bits_per_sample[ macro_order ] = (total_error_##macro_order > 0) ? local__compute_rbps_wide_integerized(total_error_##macro_order, data_len) : 0; \
|
||||
} \
|
||||
else \
|
||||
residual_bits_per_sample[ macro_order ] = 34 * FLAC__FP_ONE;
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef FLAC__INTEGER_ONLY_LIBRARY
|
||||
uint32_t FLAC__fixed_compute_best_predictor_limit_residual(const FLAC__int32 data[], uint32_t data_len, float residual_bits_per_sample[FLAC__MAX_FIXED_ORDER+1])
|
||||
#else
|
||||
uint32_t FLAC__fixed_compute_best_predictor_limit_residual(const FLAC__int32 data[], uint32_t data_len, FLAC__fixedpoint residual_bits_per_sample[FLAC__MAX_FIXED_ORDER+1])
|
||||
#endif
|
||||
{
|
||||
FLAC__uint64 total_error_0 = 0, total_error_1 = 0, total_error_2 = 0, total_error_3 = 0, total_error_4 = 0, smallest_error = UINT64_MAX;
|
||||
FLAC__uint64 error_0, error_1, error_2, error_3, error_4;
|
||||
FLAC__bool order_0_is_valid = true, order_1_is_valid = true, order_2_is_valid = true, order_3_is_valid = true, order_4_is_valid = true;
|
||||
uint32_t order = 0;
|
||||
int i;
|
||||
|
||||
for(i = -4; i < (int)data_len; i++) {
|
||||
error_0 = local_abs64((FLAC__int64)data[i]);
|
||||
error_1 = (i > -4) ? local_abs64((FLAC__int64)data[i] - data[i-1]) : 0 ;
|
||||
error_2 = (i > -3) ? local_abs64((FLAC__int64)data[i] - 2 * (FLAC__int64)data[i-1] + data[i-2]) : 0;
|
||||
error_3 = (i > -2) ? local_abs64((FLAC__int64)data[i] - 3 * (FLAC__int64)data[i-1] + 3 * (FLAC__int64)data[i-2] - data[i-3]) : 0;
|
||||
error_4 = (i > -1) ? local_abs64((FLAC__int64)data[i] - 4 * (FLAC__int64)data[i-1] + 6 * (FLAC__int64)data[i-2] - 4 * (FLAC__int64)data[i-3] + data[i-4]) : 0;
|
||||
|
||||
total_error_0 += error_0;
|
||||
total_error_1 += error_1;
|
||||
total_error_2 += error_2;
|
||||
total_error_3 += error_3;
|
||||
total_error_4 += error_4;
|
||||
|
||||
/* residual must not be INT32_MIN because abs(INT32_MIN) is undefined */
|
||||
if(error_0 > INT32_MAX)
|
||||
order_0_is_valid = false;
|
||||
if(error_1 > INT32_MAX)
|
||||
order_1_is_valid = false;
|
||||
if(error_2 > INT32_MAX)
|
||||
order_2_is_valid = false;
|
||||
if(error_3 > INT32_MAX)
|
||||
order_3_is_valid = false;
|
||||
if(error_4 > INT32_MAX)
|
||||
order_4_is_valid = false;
|
||||
}
|
||||
|
||||
CHECK_ORDER_IS_VALID(0);
|
||||
CHECK_ORDER_IS_VALID(1);
|
||||
CHECK_ORDER_IS_VALID(2);
|
||||
CHECK_ORDER_IS_VALID(3);
|
||||
CHECK_ORDER_IS_VALID(4);
|
||||
|
||||
return order;
|
||||
}
|
||||
|
||||
#ifndef FLAC__INTEGER_ONLY_LIBRARY
|
||||
uint32_t FLAC__fixed_compute_best_predictor_limit_residual_33bit(const FLAC__int64 data[], uint32_t data_len, float residual_bits_per_sample[FLAC__MAX_FIXED_ORDER+1])
|
||||
#else
|
||||
uint32_t FLAC__fixed_compute_best_predictor_limit_residual_33bit(const FLAC__int64 data[], uint32_t data_len, FLAC__fixedpoint residual_bits_per_sample[FLAC__MAX_FIXED_ORDER+1])
|
||||
#endif
|
||||
{
|
||||
FLAC__uint64 total_error_0 = 0, total_error_1 = 0, total_error_2 = 0, total_error_3 = 0, total_error_4 = 0, smallest_error = UINT64_MAX;
|
||||
FLAC__uint64 error_0, error_1, error_2, error_3, error_4;
|
||||
FLAC__bool order_0_is_valid = true, order_1_is_valid = true, order_2_is_valid = true, order_3_is_valid = true, order_4_is_valid = true;
|
||||
uint32_t order = 0;
|
||||
int i;
|
||||
|
||||
for(i = -4; i < (int)data_len; i++) {
|
||||
error_0 = local_abs64(data[i]);
|
||||
error_1 = (i > -4) ? local_abs64(data[i] - data[i-1]) : 0 ;
|
||||
error_2 = (i > -3) ? local_abs64(data[i] - 2 * data[i-1] + data[i-2]) : 0;
|
||||
error_3 = (i > -2) ? local_abs64(data[i] - 3 * data[i-1] + 3 * data[i-2] - data[i-3]) : 0;
|
||||
error_4 = (i > -1) ? local_abs64(data[i] - 4 * data[i-1] + 6 * data[i-2] - 4 * data[i-3] + data[i-4]) : 0;
|
||||
|
||||
total_error_0 += error_0;
|
||||
total_error_1 += error_1;
|
||||
total_error_2 += error_2;
|
||||
total_error_3 += error_3;
|
||||
total_error_4 += error_4;
|
||||
|
||||
/* residual must not be INT32_MIN because abs(INT32_MIN) is undefined */
|
||||
if(error_0 > INT32_MAX)
|
||||
order_0_is_valid = false;
|
||||
if(error_1 > INT32_MAX)
|
||||
order_1_is_valid = false;
|
||||
if(error_2 > INT32_MAX)
|
||||
order_2_is_valid = false;
|
||||
if(error_3 > INT32_MAX)
|
||||
order_3_is_valid = false;
|
||||
if(error_4 > INT32_MAX)
|
||||
order_4_is_valid = false;
|
||||
}
|
||||
|
||||
CHECK_ORDER_IS_VALID(0);
|
||||
CHECK_ORDER_IS_VALID(1);
|
||||
CHECK_ORDER_IS_VALID(2);
|
||||
CHECK_ORDER_IS_VALID(3);
|
||||
CHECK_ORDER_IS_VALID(4);
|
||||
|
||||
return order;
|
||||
}
|
||||
|
||||
void FLAC__fixed_compute_residual(const FLAC__int32 data[], uint32_t data_len, uint32_t order, FLAC__int32 residual[])
|
||||
{
|
||||
const int idata_len = (int)data_len;
|
||||
|
|
@ -363,6 +498,76 @@ void FLAC__fixed_compute_residual(const FLAC__int32 data[], uint32_t data_len, u
|
|||
}
|
||||
}
|
||||
|
||||
void FLAC__fixed_compute_residual_wide(const FLAC__int32 data[], uint32_t data_len, uint32_t order, FLAC__int32 residual[])
|
||||
{
|
||||
const int idata_len = (int)data_len;
|
||||
int i;
|
||||
|
||||
switch(order) {
|
||||
case 0:
|
||||
FLAC__ASSERT(sizeof(residual[0]) == sizeof(data[0]));
|
||||
memcpy(residual, data, sizeof(residual[0])*data_len);
|
||||
break;
|
||||
case 1:
|
||||
for(i = 0; i < idata_len; i++)
|
||||
residual[i] = (FLAC__int64)data[i] - data[i-1];
|
||||
break;
|
||||
case 2:
|
||||
for(i = 0; i < idata_len; i++)
|
||||
residual[i] = (FLAC__int64)data[i] - 2*(FLAC__int64)data[i-1] + data[i-2];
|
||||
break;
|
||||
case 3:
|
||||
for(i = 0; i < idata_len; i++)
|
||||
residual[i] = (FLAC__int64)data[i] - 3*(FLAC__int64)data[i-1] + 3*(FLAC__int64)data[i-2] - data[i-3];
|
||||
break;
|
||||
case 4:
|
||||
for(i = 0; i < idata_len; i++)
|
||||
residual[i] = (FLAC__int64)data[i] - 4*(FLAC__int64)data[i-1] + 6*(FLAC__int64)data[i-2] - 4*(FLAC__int64)data[i-3] + data[i-4];
|
||||
break;
|
||||
default:
|
||||
FLAC__ASSERT(0);
|
||||
}
|
||||
}
|
||||
|
||||
void FLAC__fixed_compute_residual_wide_33bit(const FLAC__int64 data[], uint32_t data_len, uint32_t order, FLAC__int32 residual[])
|
||||
{
|
||||
const int idata_len = (int)data_len;
|
||||
int i;
|
||||
|
||||
switch(order) {
|
||||
case 0:
|
||||
for(i = 0; i < idata_len; i++)
|
||||
residual[i] = data[i];
|
||||
break;
|
||||
case 1:
|
||||
for(i = 0; i < idata_len; i++)
|
||||
residual[i] = data[i] - data[i-1];
|
||||
break;
|
||||
case 2:
|
||||
for(i = 0; i < idata_len; i++)
|
||||
residual[i] = data[i] - 2*data[i-1] + data[i-2];
|
||||
break;
|
||||
case 3:
|
||||
for(i = 0; i < idata_len; i++)
|
||||
residual[i] = data[i] - 3*data[i-1] + 3*data[i-2] - data[i-3];
|
||||
break;
|
||||
case 4:
|
||||
for(i = 0; i < idata_len; i++)
|
||||
residual[i] = data[i] - 4*data[i-1] + 6*data[i-2] - 4*data[i-3] + data[i-4];
|
||||
break;
|
||||
default:
|
||||
FLAC__ASSERT(0);
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION) && !defined(FUZZING_BUILD_MODE_FLAC_SANITIZE_SIGNED_INTEGER_OVERFLOW)
|
||||
/* The attribute below is to silence the undefined sanitizer of oss-fuzz.
|
||||
* Because fuzzing feeds bogus predictors and residual samples to the
|
||||
* decoder, having overflows in this section is unavoidable. Also,
|
||||
* because the calculated values are audio path only, there is no
|
||||
* potential for security problems */
|
||||
__attribute__((no_sanitize("signed-integer-overflow")))
|
||||
#endif
|
||||
void FLAC__fixed_restore_signal(const FLAC__int32 residual[], uint32_t data_len, uint32_t order, FLAC__int32 data[])
|
||||
{
|
||||
int i, idata_len = (int)data_len;
|
||||
|
|
@ -392,3 +597,71 @@ void FLAC__fixed_restore_signal(const FLAC__int32 residual[], uint32_t data_len,
|
|||
FLAC__ASSERT(0);
|
||||
}
|
||||
}
|
||||
|
||||
void FLAC__fixed_restore_signal_wide(const FLAC__int32 residual[], uint32_t data_len, uint32_t order, FLAC__int32 data[])
|
||||
{
|
||||
int i, idata_len = (int)data_len;
|
||||
|
||||
switch(order) {
|
||||
case 0:
|
||||
FLAC__ASSERT(sizeof(residual[0]) == sizeof(data[0]));
|
||||
memcpy(data, residual, sizeof(residual[0])*data_len);
|
||||
break;
|
||||
case 1:
|
||||
for(i = 0; i < idata_len; i++)
|
||||
data[i] = (FLAC__int64)residual[i] + (FLAC__int64)data[i-1];
|
||||
break;
|
||||
case 2:
|
||||
for(i = 0; i < idata_len; i++)
|
||||
data[i] = (FLAC__int64)residual[i] + 2*(FLAC__int64)data[i-1] - (FLAC__int64)data[i-2];
|
||||
break;
|
||||
case 3:
|
||||
for(i = 0; i < idata_len; i++)
|
||||
data[i] = (FLAC__int64)residual[i] + 3*(FLAC__int64)data[i-1] - 3*(FLAC__int64)data[i-2] + (FLAC__int64)data[i-3];
|
||||
break;
|
||||
case 4:
|
||||
for(i = 0; i < idata_len; i++)
|
||||
data[i] = (FLAC__int64)residual[i] + 4*(FLAC__int64)data[i-1] - 6*(FLAC__int64)data[i-2] + 4*(FLAC__int64)data[i-3] - (FLAC__int64)data[i-4];
|
||||
break;
|
||||
default:
|
||||
FLAC__ASSERT(0);
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION) && !defined(FUZZING_BUILD_MODE_FLAC_SANITIZE_SIGNED_INTEGER_OVERFLOW)
|
||||
/* The attribute below is to silence the undefined sanitizer of oss-fuzz.
|
||||
* Because fuzzing feeds bogus predictors and residual samples to the
|
||||
* decoder, having overflows in this section is unavoidable. Also,
|
||||
* because the calculated values are audio path only, there is no
|
||||
* potential for security problems */
|
||||
__attribute__((no_sanitize("signed-integer-overflow")))
|
||||
#endif
|
||||
void FLAC__fixed_restore_signal_wide_33bit(const FLAC__int32 residual[], uint32_t data_len, uint32_t order, FLAC__int64 data[])
|
||||
{
|
||||
int i, idata_len = (int)data_len;
|
||||
|
||||
switch(order) {
|
||||
case 0:
|
||||
for(i = 0; i < idata_len; i++)
|
||||
data[i] = residual[i];
|
||||
break;
|
||||
case 1:
|
||||
for(i = 0; i < idata_len; i++)
|
||||
data[i] = (FLAC__int64)residual[i] + data[i-1];
|
||||
break;
|
||||
case 2:
|
||||
for(i = 0; i < idata_len; i++)
|
||||
data[i] = (FLAC__int64)residual[i] + 2*data[i-1] - data[i-2];
|
||||
break;
|
||||
case 3:
|
||||
for(i = 0; i < idata_len; i++)
|
||||
data[i] = (FLAC__int64)residual[i] + 3*data[i-1] - 3*data[i-2] + data[i-3];
|
||||
break;
|
||||
case 4:
|
||||
for(i = 0; i < idata_len; i++)
|
||||
data[i] = (FLAC__int64)residual[i] + 4*data[i-1] - 6*data[i-2] + 4*data[i-3] - data[i-4];
|
||||
break;
|
||||
default:
|
||||
FLAC__ASSERT(0);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/* libFLAC - Free Lossless Audio Codec library
|
||||
* Copyright (C) 2004-2009 Josh Coalson
|
||||
* Copyright (C) 2011-2016 Xiph.Org Foundation
|
||||
* Copyright (C) 2011-2023 Xiph.Org Foundation
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/* libFLAC - Free Lossless Audio Codec library
|
||||
* Copyright (C) 2000-2009 Josh Coalson
|
||||
* Copyright (C) 2011-2016 Xiph.Org Foundation
|
||||
* Copyright (C) 2011-2023 Xiph.Org Foundation
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
|
|
@ -43,10 +43,20 @@
|
|||
#include "../compat.h"
|
||||
#include "include/private/format.h"
|
||||
|
||||
|
||||
#if (defined GIT_COMMIT_HASH && defined GIT_COMMIT_DATE)
|
||||
# ifdef GIT_COMMIT_TAG
|
||||
FLAC_API const char *FLAC__VERSION_STRING = GIT_COMMIT_TAG;
|
||||
FLAC_API const char *FLAC__VENDOR_STRING = "reference libFLAC " GIT_COMMIT_TAG " " GIT_COMMIT_DATE;
|
||||
# else
|
||||
FLAC_API const char *FLAC__VERSION_STRING = "git-" GIT_COMMIT_HASH " " GIT_COMMIT_DATE;
|
||||
FLAC_API const char *FLAC__VENDOR_STRING = "reference libFLAC git-" GIT_COMMIT_HASH " " GIT_COMMIT_DATE;
|
||||
# endif
|
||||
#else
|
||||
/* PACKAGE_VERSION should come from configure */
|
||||
FLAC_API const char *FLAC__VERSION_STRING = PACKAGE_VERSION;
|
||||
|
||||
FLAC_API const char *FLAC__VENDOR_STRING = "reference libFLAC " PACKAGE_VERSION " 20220220";
|
||||
FLAC_API const char *FLAC__VENDOR_STRING = "reference libFLAC " PACKAGE_VERSION " 20230623";
|
||||
#endif
|
||||
|
||||
FLAC_API const FLAC__byte FLAC__STREAM_SYNC_STRING[4] = { 'f','L','a','C' };
|
||||
FLAC_API const uint32_t FLAC__STREAM_SYNC = 0x664C6143;
|
||||
|
|
@ -198,7 +208,7 @@ FLAC_API const char * const FLAC__StreamMetadata_Picture_TypeString[] = {
|
|||
|
||||
FLAC_API FLAC__bool FLAC__format_sample_rate_is_valid(uint32_t sample_rate)
|
||||
{
|
||||
if(sample_rate == 0 || sample_rate > FLAC__MAX_SAMPLE_RATE) {
|
||||
if(sample_rate > FLAC__MAX_SAMPLE_RATE) {
|
||||
return false;
|
||||
}
|
||||
else
|
||||
|
|
@ -217,12 +227,10 @@ FLAC_API FLAC__bool FLAC__format_blocksize_is_subset(uint32_t blocksize, uint32_
|
|||
|
||||
FLAC_API FLAC__bool FLAC__format_sample_rate_is_subset(uint32_t sample_rate)
|
||||
{
|
||||
if(
|
||||
!FLAC__format_sample_rate_is_valid(sample_rate) ||
|
||||
(
|
||||
sample_rate >= (1u << 16) &&
|
||||
!(sample_rate % 1000 == 0 || sample_rate % 10 == 0)
|
||||
)
|
||||
if( // sample rate is not subset if
|
||||
!FLAC__format_sample_rate_is_valid(sample_rate) || // sample rate is invalid or
|
||||
sample_rate >= ((1u << 16) * 10) || // sample rate is larger then or equal to 655360 or
|
||||
(sample_rate >= (1u << 16) && sample_rate % 10 != 0) //sample rate is >= 65536 and not divisible by 10
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
|
|
@ -239,6 +247,9 @@ FLAC_API FLAC__bool FLAC__format_seektable_is_legal(const FLAC__StreamMetadata_S
|
|||
|
||||
FLAC__ASSERT(0 != seek_table);
|
||||
|
||||
if((FLAC__uint64)(seek_table->num_points) * FLAC__STREAM_METADATA_SEEKPOINT_LENGTH >= (1u << FLAC__STREAM_METADATA_LENGTH_LEN))
|
||||
return false;
|
||||
|
||||
for(i = 0; i < seek_table->num_points; i++) {
|
||||
if(got_prev) {
|
||||
if(
|
||||
|
|
@ -514,6 +525,7 @@ FLAC_API FLAC__bool FLAC__format_picture_is_legal(const FLAC__StreamMetadata_Pic
|
|||
/*
|
||||
* These routines are private to libFLAC
|
||||
*/
|
||||
#if 0 /* UNUSED */
|
||||
uint32_t FLAC__format_get_max_rice_partition_order(uint32_t blocksize, uint32_t predictor_order)
|
||||
{
|
||||
return
|
||||
|
|
@ -523,6 +535,7 @@ uint32_t FLAC__format_get_max_rice_partition_order(uint32_t blocksize, uint32_t
|
|||
predictor_order
|
||||
);
|
||||
}
|
||||
#endif
|
||||
|
||||
uint32_t FLAC__format_get_max_rice_partition_order_from_blocksize(uint32_t blocksize)
|
||||
{
|
||||
|
|
@ -569,13 +582,16 @@ void FLAC__format_entropy_coding_method_partitioned_rice_contents_clear(FLAC__En
|
|||
FLAC__format_entropy_coding_method_partitioned_rice_contents_init(object);
|
||||
}
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
// silence three MSVC warnings 'result of 32-bit shift implicitly converted to 64 bits (was 64-bit shift intended?)'
|
||||
#pragma warning ( disable : 4334 )
|
||||
#endif
|
||||
|
||||
FLAC__bool FLAC__format_entropy_coding_method_partitioned_rice_contents_ensure_size(FLAC__EntropyCodingMethod_PartitionedRiceContents *object, uint32_t max_partition_order)
|
||||
{
|
||||
FLAC__ASSERT(0 != object);
|
||||
|
||||
FLAC__ASSERT(object->capacity_by_order > 0 || (0 == object->parameters && 0 == object->raw_bits));
|
||||
|
||||
if(object->capacity_by_order < max_partition_order) {
|
||||
if(object->capacity_by_order < max_partition_order || object->parameters == NULL || object->raw_bits == NULL) {
|
||||
if(0 == (object->parameters = (uint32_t*) safe_realloc_(object->parameters, sizeof(uint32_t)*(1 << max_partition_order))))
|
||||
return false;
|
||||
if(0 == (object->raw_bits = (uint32_t*) safe_realloc_(object->raw_bits, sizeof(uint32_t)*(1 << max_partition_order))))
|
||||
|
|
@ -586,3 +602,7 @@ FLAC__bool FLAC__format_entropy_coding_method_partitioned_rice_contents_ensure_s
|
|||
|
||||
return true;
|
||||
}
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
#pragma warning ( default : 4334 )
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -1,50 +0,0 @@
|
|||
/* libFLAC - Free Lossless Audio Codec library
|
||||
* Copyright (C) 2000-2009 Josh Coalson
|
||||
* Copyright (C) 2011-2016 Xiph.Org Foundation
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* - Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* - Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* - Neither the name of the Xiph.org Foundation nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef FLAC__PRIVATE__ALL_H
|
||||
#define FLAC__PRIVATE__ALL_H
|
||||
|
||||
#include "bitmath.h"
|
||||
#include "bitreader.h"
|
||||
#include "bitwriter.h"
|
||||
#include "cpu.h"
|
||||
#include "crc.h"
|
||||
#include "fixed.h"
|
||||
#include "float.h"
|
||||
#include "format.h"
|
||||
#include "lpc.h"
|
||||
#include "md5.h"
|
||||
#include "memory.h"
|
||||
#include "metadata.h"
|
||||
#include "stream_encoder_framing.h"
|
||||
|
||||
#endif
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
/* libFLAC - Free Lossless Audio Codec library
|
||||
* Copyright (C) 2001-2009 Josh Coalson
|
||||
* Copyright (C) 2011-2016 Xiph.Org Foundation
|
||||
* Copyright (C) 2011-2023 Xiph.Org Foundation
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/* libFLAC - Free Lossless Audio Codec library
|
||||
* Copyright (C) 2000-2009 Josh Coalson
|
||||
* Copyright (C) 2011-2016 Xiph.Org Foundation
|
||||
* Copyright (C) 2011-2023 Xiph.Org Foundation
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
|
|
@ -53,7 +53,8 @@ void FLAC__bitreader_delete(FLAC__BitReader *br);
|
|||
FLAC__bool FLAC__bitreader_init(FLAC__BitReader *br, FLAC__BitReaderReadCallback rcb, void *cd);
|
||||
void FLAC__bitreader_free(FLAC__BitReader *br); /* does not 'free(br)' */
|
||||
FLAC__bool FLAC__bitreader_clear(FLAC__BitReader *br);
|
||||
void FLAC__bitreader_dump(const FLAC__BitReader *br, FILE *out);
|
||||
void FLAC__bitreader_set_framesync_location(FLAC__BitReader *br);
|
||||
FLAC__bool FLAC__bitreader_rewind_to_after_last_seen_framesync(FLAC__BitReader *br);
|
||||
|
||||
/*
|
||||
* CRC functions
|
||||
|
|
@ -67,6 +68,10 @@ FLAC__uint16 FLAC__bitreader_get_read_crc16(FLAC__BitReader *br);
|
|||
FLAC__bool FLAC__bitreader_is_consumed_byte_aligned(const FLAC__BitReader *br);
|
||||
uint32_t FLAC__bitreader_bits_left_for_byte_alignment(const FLAC__BitReader *br);
|
||||
uint32_t FLAC__bitreader_get_input_bits_unconsumed(const FLAC__BitReader *br);
|
||||
void FLAC__bitreader_set_limit(FLAC__BitReader *br, uint32_t limit);
|
||||
void FLAC__bitreader_remove_limit(FLAC__BitReader *br);
|
||||
uint32_t FLAC__bitreader_limit_remaining(FLAC__BitReader *br);
|
||||
void FLAC__bitreader_limit_invalidate(FLAC__BitReader *br);
|
||||
|
||||
/*
|
||||
* read functions
|
||||
|
|
@ -75,6 +80,7 @@ uint32_t FLAC__bitreader_get_input_bits_unconsumed(const FLAC__BitReader *br);
|
|||
FLAC__bool FLAC__bitreader_read_raw_uint32(FLAC__BitReader *br, FLAC__uint32 *val, uint32_t bits);
|
||||
FLAC__bool FLAC__bitreader_read_raw_int32(FLAC__BitReader *br, FLAC__int32 *val, uint32_t bits);
|
||||
FLAC__bool FLAC__bitreader_read_raw_uint64(FLAC__BitReader *br, FLAC__uint64 *val, uint32_t bits);
|
||||
FLAC__bool FLAC__bitreader_read_raw_int64(FLAC__BitReader *br, FLAC__int64 *val, uint32_t bits);
|
||||
FLAC__bool FLAC__bitreader_read_uint32_little_endian(FLAC__BitReader *br, FLAC__uint32 *val); /*only for bits=32*/
|
||||
FLAC__bool FLAC__bitreader_skip_bits_no_crc(FLAC__BitReader *br, uint32_t bits); /* WATCHOUT: does not CRC the skipped data! */ /*@@@@ add to unit tests */
|
||||
FLAC__bool FLAC__bitreader_skip_byte_block_aligned_no_crc(FLAC__BitReader *br, uint32_t nvals); /* WATCHOUT: does not CRC the read data! */
|
||||
|
|
@ -82,6 +88,10 @@ FLAC__bool FLAC__bitreader_read_byte_block_aligned_no_crc(FLAC__BitReader *br, F
|
|||
FLAC__bool FLAC__bitreader_read_unary_unsigned(FLAC__BitReader *br, uint32_t *val);
|
||||
FLAC__bool FLAC__bitreader_read_rice_signed(FLAC__BitReader *br, int *val, uint32_t parameter);
|
||||
FLAC__bool FLAC__bitreader_read_rice_signed_block(FLAC__BitReader *br, int vals[], uint32_t nvals, uint32_t parameter);
|
||||
#ifdef FLAC__BMI2_SUPPORTED
|
||||
FLAC__bool FLAC__bitreader_read_rice_signed_block_bmi2(FLAC__BitReader *br, int vals[], uint32_t nvals, uint32_t parameter);
|
||||
#endif
|
||||
|
||||
#if 0 /* UNUSED */
|
||||
FLAC__bool FLAC__bitreader_read_golomb_signed(FLAC__BitReader *br, int *val, uint32_t parameter);
|
||||
FLAC__bool FLAC__bitreader_read_golomb_unsigned(FLAC__BitReader *br, uint32_t *val, uint32_t parameter);
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/* libFLAC - Free Lossless Audio Codec library
|
||||
* Copyright (C) 2000-2009 Josh Coalson
|
||||
* Copyright (C) 2011-2016 Xiph.Org Foundation
|
||||
* Copyright (C) 2011-2023 Xiph.Org Foundation
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
|
|
@ -50,7 +50,6 @@ void FLAC__bitwriter_delete(FLAC__BitWriter *bw);
|
|||
FLAC__bool FLAC__bitwriter_init(FLAC__BitWriter *bw);
|
||||
void FLAC__bitwriter_free(FLAC__BitWriter *bw); /* does not 'free(buffer)' */
|
||||
void FLAC__bitwriter_clear(FLAC__BitWriter *bw);
|
||||
void FLAC__bitwriter_dump(const FLAC__BitWriter *bw, FILE *out);
|
||||
|
||||
/*
|
||||
* CRC functions
|
||||
|
|
@ -83,15 +82,16 @@ FLAC__bool FLAC__bitwriter_write_zeroes(FLAC__BitWriter *bw, uint32_t bits);
|
|||
FLAC__bool FLAC__bitwriter_write_raw_uint32(FLAC__BitWriter *bw, FLAC__uint32 val, uint32_t bits);
|
||||
FLAC__bool FLAC__bitwriter_write_raw_int32(FLAC__BitWriter *bw, FLAC__int32 val, uint32_t bits);
|
||||
FLAC__bool FLAC__bitwriter_write_raw_uint64(FLAC__BitWriter *bw, FLAC__uint64 val, uint32_t bits);
|
||||
FLAC__bool FLAC__bitwriter_write_raw_int64(FLAC__BitWriter *bw, FLAC__int64 val, uint32_t bits);
|
||||
FLAC__bool FLAC__bitwriter_write_raw_uint32_little_endian(FLAC__BitWriter *bw, FLAC__uint32 val); /*only for bits=32*/
|
||||
FLAC__bool FLAC__bitwriter_write_byte_block(FLAC__BitWriter *bw, const FLAC__byte vals[], uint32_t nvals);
|
||||
FLAC__bool FLAC__bitwriter_write_unary_unsigned(FLAC__BitWriter *bw, uint32_t val);
|
||||
uint32_t FLAC__bitwriter_rice_bits(FLAC__int32 val, uint32_t parameter);
|
||||
#if 0 /* UNUSED */
|
||||
uint32_t FLAC__bitwriter_rice_bits(FLAC__int32 val, uint32_t parameter);
|
||||
uint32_t FLAC__bitwriter_golomb_bits_signed(int val, uint32_t parameter);
|
||||
uint32_t FLAC__bitwriter_golomb_bits_unsigned(uint32_t val, uint32_t parameter);
|
||||
#endif
|
||||
FLAC__bool FLAC__bitwriter_write_rice_signed(FLAC__BitWriter *bw, FLAC__int32 val, uint32_t parameter);
|
||||
#endif
|
||||
FLAC__bool FLAC__bitwriter_write_rice_signed_block(FLAC__BitWriter *bw, const FLAC__int32 *vals, uint32_t nvals, uint32_t parameter);
|
||||
#if 0 /* UNUSED */
|
||||
FLAC__bool FLAC__bitwriter_write_golomb_signed(FLAC__BitWriter *bw, int val, uint32_t parameter);
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/* libFLAC - Free Lossless Audio Codec library
|
||||
* Copyright (C) 2001-2009 Josh Coalson
|
||||
* Copyright (C) 2011-2016 Xiph.Org Foundation
|
||||
* Copyright (C) 2011-2023 Xiph.Org Foundation
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
|
|
@ -66,7 +66,6 @@
|
|||
typedef enum {
|
||||
FLAC__CPUINFO_TYPE_IA32,
|
||||
FLAC__CPUINFO_TYPE_X86_64,
|
||||
FLAC__CPUINFO_TYPE_PPC,
|
||||
FLAC__CPUINFO_TYPE_UNKNOWN
|
||||
} FLAC__CPUInfo_Type;
|
||||
|
||||
|
|
@ -85,18 +84,13 @@ typedef struct {
|
|||
FLAC__bool avx;
|
||||
FLAC__bool avx2;
|
||||
FLAC__bool fma;
|
||||
FLAC__bool bmi2;
|
||||
} FLAC__CPUInfo_x86;
|
||||
|
||||
typedef struct {
|
||||
FLAC__bool arch_3_00;
|
||||
FLAC__bool arch_2_07;
|
||||
} FLAC__CPUInfo_ppc;
|
||||
|
||||
typedef struct {
|
||||
FLAC__bool use_asm;
|
||||
FLAC__CPUInfo_Type type;
|
||||
FLAC__CPUInfo_x86 x86;
|
||||
FLAC__CPUInfo_ppc ppc;
|
||||
} FLAC__CPUInfo;
|
||||
|
||||
void FLAC__cpu_info(FLAC__CPUInfo *info);
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/* libFLAC - Free Lossless Audio Codec library
|
||||
* Copyright (C) 2000-2009 Josh Coalson
|
||||
* Copyright (C) 2011-2018 Xiph.Org Foundation
|
||||
* Copyright (C) 2011-2023 Xiph.Org Foundation
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/* libFLAC - Free Lossless Audio Codec library
|
||||
* Copyright (C) 2000-2009 Josh Coalson
|
||||
* Copyright (C) 2011-2016 Xiph.Org Foundation
|
||||
* Copyright (C) 2011-2023 Xiph.Org Foundation
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
|
|
@ -56,24 +56,30 @@
|
|||
#ifndef FLAC__INTEGER_ONLY_LIBRARY
|
||||
uint32_t FLAC__fixed_compute_best_predictor(const FLAC__int32 data[], uint32_t data_len, float residual_bits_per_sample[FLAC__MAX_FIXED_ORDER+1]);
|
||||
uint32_t FLAC__fixed_compute_best_predictor_wide(const FLAC__int32 data[], uint32_t data_len, float residual_bits_per_sample[FLAC__MAX_FIXED_ORDER+1]);
|
||||
uint32_t FLAC__fixed_compute_best_predictor_limit_residual(const FLAC__int32 data[], uint32_t data_len, float residual_bits_per_sample[FLAC__MAX_FIXED_ORDER+1]);
|
||||
uint32_t FLAC__fixed_compute_best_predictor_limit_residual_33bit(const FLAC__int64 data[], uint32_t data_len, float residual_bits_per_sample[FLAC__MAX_FIXED_ORDER+1]);
|
||||
# ifndef FLAC__NO_ASM
|
||||
# if (defined FLAC__CPU_IA32 || defined FLAC__CPU_X86_64) && FLAC__HAS_X86INTRIN
|
||||
# ifdef FLAC__SSE2_SUPPORTED
|
||||
uint32_t FLAC__fixed_compute_best_predictor_intrin_sse2(const FLAC__int32 data[], uint32_t data_len, float residual_bits_per_sample[FLAC__MAX_FIXED_ORDER + 1]);
|
||||
uint32_t FLAC__fixed_compute_best_predictor_wide_intrin_sse2(const FLAC__int32 data[], uint32_t data_len, float residual_bits_per_sample[FLAC__MAX_FIXED_ORDER + 1]);
|
||||
# endif
|
||||
# ifdef FLAC__SSSE3_SUPPORTED
|
||||
uint32_t FLAC__fixed_compute_best_predictor_intrin_ssse3(const FLAC__int32 data[], uint32_t data_len, float residual_bits_per_sample[FLAC__MAX_FIXED_ORDER+1]);
|
||||
uint32_t FLAC__fixed_compute_best_predictor_wide_intrin_ssse3(const FLAC__int32 data[], uint32_t data_len, float residual_bits_per_sample[FLAC__MAX_FIXED_ORDER + 1]);
|
||||
# endif
|
||||
# endif
|
||||
# if defined FLAC__CPU_IA32 && defined FLAC__HAS_NASM
|
||||
uint32_t FLAC__fixed_compute_best_predictor_asm_ia32_mmx_cmov(const FLAC__int32 data[], uint32_t data_len, float residual_bits_per_sample[FLAC__MAX_FIXED_ORDER+1]);
|
||||
# ifdef FLAC__SSE4_2_SUPPORTED
|
||||
uint32_t FLAC__fixed_compute_best_predictor_limit_residual_intrin_sse42(const FLAC__int32 data[], uint32_t data_len, float residual_bits_per_sample[FLAC__MAX_FIXED_ORDER+1]);
|
||||
# endif
|
||||
# ifdef FLAC__AVX2_SUPPORTED
|
||||
uint32_t FLAC__fixed_compute_best_predictor_wide_intrin_avx2(const FLAC__int32 data[], uint32_t data_len, float residual_bits_per_sample[FLAC__MAX_FIXED_ORDER+1]);
|
||||
uint32_t FLAC__fixed_compute_best_predictor_limit_residual_intrin_avx2(const FLAC__int32 data[], uint32_t data_len, float residual_bits_per_sample[FLAC__MAX_FIXED_ORDER+1]);
|
||||
# endif
|
||||
# endif
|
||||
# endif
|
||||
#else
|
||||
uint32_t FLAC__fixed_compute_best_predictor(const FLAC__int32 data[], uint32_t data_len, FLAC__fixedpoint residual_bits_per_sample[FLAC__MAX_FIXED_ORDER+1]);
|
||||
uint32_t FLAC__fixed_compute_best_predictor_wide(const FLAC__int32 data[], uint32_t data_len, FLAC__fixedpoint residual_bits_per_sample[FLAC__MAX_FIXED_ORDER+1]);
|
||||
uint32_t FLAC__fixed_compute_best_predictor_limit_residual(const FLAC__int32 data[], uint32_t data_len, FLAC__fixedpoint residual_bits_per_sample[FLAC__MAX_FIXED_ORDER+1]);
|
||||
uint32_t FLAC__fixed_compute_best_predictor_limit_residual_33bit(const FLAC__int64 data[], uint32_t data_len, FLAC__fixedpoint residual_bits_per_sample[FLAC__MAX_FIXED_ORDER+1]);
|
||||
#endif
|
||||
|
||||
/*
|
||||
|
|
@ -88,6 +94,8 @@ uint32_t FLAC__fixed_compute_best_predictor_wide(const FLAC__int32 data[], uint3
|
|||
* OUT residual[0,data_len-1] residual signal
|
||||
*/
|
||||
void FLAC__fixed_compute_residual(const FLAC__int32 data[], uint32_t data_len, uint32_t order, FLAC__int32 residual[]);
|
||||
void FLAC__fixed_compute_residual_wide(const FLAC__int32 data[], uint32_t data_len, uint32_t order, FLAC__int32 residual[]);
|
||||
void FLAC__fixed_compute_residual_wide_33bit(const FLAC__int64 data[], uint32_t data_len, uint32_t order, FLAC__int32 residual[]);
|
||||
|
||||
/*
|
||||
* FLAC__fixed_restore_signal()
|
||||
|
|
@ -103,5 +111,7 @@ void FLAC__fixed_compute_residual(const FLAC__int32 data[], uint32_t data_len, u
|
|||
* OUT data[0,data_len-1] original signal
|
||||
*/
|
||||
void FLAC__fixed_restore_signal(const FLAC__int32 residual[], uint32_t data_len, uint32_t order, FLAC__int32 data[]);
|
||||
void FLAC__fixed_restore_signal_wide(const FLAC__int32 residual[], uint32_t data_len, uint32_t order, FLAC__int32 data[]);
|
||||
void FLAC__fixed_restore_signal_wide_33bit(const FLAC__int32 residual[], uint32_t data_len, uint32_t order, FLAC__int64 data[]);
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/* libFLAC - Free Lossless Audio Codec library
|
||||
* Copyright (C) 2004-2009 Josh Coalson
|
||||
* Copyright (C) 2011-2016 Xiph.Org Foundation
|
||||
* Copyright (C) 2011-2023 Xiph.Org Foundation
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/* libFLAC - Free Lossless Audio Codec library
|
||||
* Copyright (C) 2000-2009 Josh Coalson
|
||||
* Copyright (C) 2011-2016 Xiph.Org Foundation
|
||||
* Copyright (C) 2011-2023 Xiph.Org Foundation
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
|
|
@ -35,7 +35,9 @@
|
|||
|
||||
#include "../../../format.h"
|
||||
|
||||
#if 0 /* UNUSED */
|
||||
uint32_t FLAC__format_get_max_rice_partition_order(uint32_t blocksize, uint32_t predictor_order);
|
||||
#endif
|
||||
uint32_t FLAC__format_get_max_rice_partition_order_from_blocksize(uint32_t blocksize);
|
||||
uint32_t FLAC__format_get_max_rice_partition_order_from_blocksize_limited_max_and_predictor_order(uint32_t limit, uint32_t blocksize, uint32_t predictor_order);
|
||||
void FLAC__format_entropy_coding_method_partitioned_rice_contents_init(FLAC__EntropyCodingMethod_PartitionedRiceContents *object);
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/* libFLAC - Free Lossless Audio Codec library
|
||||
* Copyright (C) 2000-2009 Josh Coalson
|
||||
* Copyright (C) 2011-2016 Xiph.Org Foundation
|
||||
* Copyright (C) 2011-2023 Xiph.Org Foundation
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
|
|
@ -55,6 +55,9 @@
|
|||
* IN data_len
|
||||
*/
|
||||
void FLAC__lpc_window_data(const FLAC__int32 in[], const FLAC__real window[], FLAC__real out[], uint32_t data_len);
|
||||
void FLAC__lpc_window_data_wide(const FLAC__int64 in[], const FLAC__real window[], FLAC__real out[], uint32_t data_len);
|
||||
void FLAC__lpc_window_data_partial(const FLAC__int32 in[], const FLAC__real window[], FLAC__real out[], uint32_t data_len, uint32_t part_size, uint32_t data_shift);
|
||||
void FLAC__lpc_window_data_partial_wide(const FLAC__int64 in[], const FLAC__real window[], FLAC__real out[], uint32_t data_len, uint32_t part_size, uint32_t data_shift);
|
||||
|
||||
/*
|
||||
* FLAC__lpc_compute_autocorrelation()
|
||||
|
|
@ -68,44 +71,28 @@ void FLAC__lpc_window_data(const FLAC__int32 in[], const FLAC__real window[], FL
|
|||
* IN 0 < lag <= data_len
|
||||
* OUT autoc[0,lag-1]
|
||||
*/
|
||||
void FLAC__lpc_compute_autocorrelation(const FLAC__real data[], uint32_t data_len, uint32_t lag, FLAC__real autoc[]);
|
||||
void FLAC__lpc_compute_autocorrelation(const FLAC__real data[], uint32_t data_len, uint32_t lag, double autoc[]);
|
||||
#ifndef FLAC__NO_ASM
|
||||
# ifdef FLAC__CPU_IA32
|
||||
# ifdef FLAC__HAS_NASM
|
||||
void FLAC__lpc_compute_autocorrelation_asm_ia32(const FLAC__real data[], uint32_t data_len, uint32_t lag, FLAC__real autoc[]);
|
||||
void FLAC__lpc_compute_autocorrelation_asm_ia32_sse_lag_4_old(const FLAC__real data[], uint32_t data_len, uint32_t lag, FLAC__real autoc[]);
|
||||
void FLAC__lpc_compute_autocorrelation_asm_ia32_sse_lag_8_old(const FLAC__real data[], uint32_t data_len, uint32_t lag, FLAC__real autoc[]);
|
||||
void FLAC__lpc_compute_autocorrelation_asm_ia32_sse_lag_12_old(const FLAC__real data[], uint32_t data_len, uint32_t lag, FLAC__real autoc[]);
|
||||
void FLAC__lpc_compute_autocorrelation_asm_ia32_sse_lag_16_old(const FLAC__real data[], uint32_t data_len, uint32_t lag, FLAC__real autoc[]);
|
||||
# endif
|
||||
# endif
|
||||
# if (defined FLAC__CPU_IA32 || defined FLAC__CPU_X86_64) && FLAC__HAS_X86INTRIN
|
||||
# ifdef FLAC__SSE_SUPPORTED
|
||||
void FLAC__lpc_compute_autocorrelation_intrin_sse_lag_4_old(const FLAC__real data[], uint32_t data_len, uint32_t lag, FLAC__real autoc[]);
|
||||
void FLAC__lpc_compute_autocorrelation_intrin_sse_lag_8_old(const FLAC__real data[], uint32_t data_len, uint32_t lag, FLAC__real autoc[]);
|
||||
void FLAC__lpc_compute_autocorrelation_intrin_sse_lag_12_old(const FLAC__real data[], uint32_t data_len, uint32_t lag, FLAC__real autoc[]);
|
||||
void FLAC__lpc_compute_autocorrelation_intrin_sse_lag_16_old(const FLAC__real data[], uint32_t data_len, uint32_t lag, FLAC__real autoc[]);
|
||||
void FLAC__lpc_compute_autocorrelation_intrin_sse_lag_4_new(const FLAC__real data[], uint32_t data_len, uint32_t lag, FLAC__real autoc[]);
|
||||
void FLAC__lpc_compute_autocorrelation_intrin_sse_lag_8_new(const FLAC__real data[], uint32_t data_len, uint32_t lag, FLAC__real autoc[]);
|
||||
void FLAC__lpc_compute_autocorrelation_intrin_sse_lag_12_new(const FLAC__real data[], uint32_t data_len, uint32_t lag, FLAC__real autoc[]);
|
||||
void FLAC__lpc_compute_autocorrelation_intrin_sse_lag_16_new(const FLAC__real data[], uint32_t data_len, uint32_t lag, FLAC__real autoc[]);
|
||||
# ifdef FLAC__SSE2_SUPPORTED
|
||||
void FLAC__lpc_compute_autocorrelation_intrin_sse2_lag_8(const FLAC__real data[], uint32_t data_len, uint32_t lag, double autoc[]);
|
||||
void FLAC__lpc_compute_autocorrelation_intrin_sse2_lag_10(const FLAC__real data[], uint32_t data_len, uint32_t lag, double autoc[]);
|
||||
void FLAC__lpc_compute_autocorrelation_intrin_sse2_lag_14(const FLAC__real data[], uint32_t data_len, uint32_t lag, double autoc[]);
|
||||
# endif
|
||||
# endif
|
||||
#if defined(FLAC__CPU_PPC64) && defined(FLAC__USE_VSX)
|
||||
#ifdef FLAC__HAS_TARGET_POWER9
|
||||
void FLAC__lpc_compute_autocorrelation_intrin_power9_vsx_lag_4(const FLAC__real data[], uint32_t data_len, uint32_t lag, FLAC__real autoc[]);
|
||||
void FLAC__lpc_compute_autocorrelation_intrin_power9_vsx_lag_8(const FLAC__real data[], uint32_t data_len, uint32_t lag, FLAC__real autoc[]);
|
||||
void FLAC__lpc_compute_autocorrelation_intrin_power9_vsx_lag_12(const FLAC__real data[], uint32_t data_len, uint32_t lag, FLAC__real autoc[]);
|
||||
void FLAC__lpc_compute_autocorrelation_intrin_power9_vsx_lag_16(const FLAC__real data[], uint32_t data_len, uint32_t lag, FLAC__real autoc[]);
|
||||
#endif
|
||||
#ifdef FLAC__HAS_TARGET_POWER8
|
||||
void FLAC__lpc_compute_autocorrelation_intrin_power8_vsx_lag_4(const FLAC__real data[], uint32_t data_len, uint32_t lag, FLAC__real autoc[]);
|
||||
void FLAC__lpc_compute_autocorrelation_intrin_power8_vsx_lag_8(const FLAC__real data[], uint32_t data_len, uint32_t lag, FLAC__real autoc[]);
|
||||
void FLAC__lpc_compute_autocorrelation_intrin_power8_vsx_lag_12(const FLAC__real data[], uint32_t data_len, uint32_t lag, FLAC__real autoc[]);
|
||||
void FLAC__lpc_compute_autocorrelation_intrin_power8_vsx_lag_16(const FLAC__real data[], uint32_t data_len, uint32_t lag, FLAC__real autoc[]);
|
||||
#endif
|
||||
#endif
|
||||
# if defined FLAC__CPU_X86_64 && FLAC__HAS_X86INTRIN
|
||||
# ifdef FLAC__FMA_SUPPORTED
|
||||
void FLAC__lpc_compute_autocorrelation_intrin_fma_lag_8(const FLAC__real data[], uint32_t data_len, uint32_t lag, double autoc[]);
|
||||
void FLAC__lpc_compute_autocorrelation_intrin_fma_lag_12(const FLAC__real data[], uint32_t data_len, uint32_t lag, double autoc[]);
|
||||
void FLAC__lpc_compute_autocorrelation_intrin_fma_lag_16(const FLAC__real data[], uint32_t data_len, uint32_t lag, double autoc[]);
|
||||
# endif
|
||||
# endif
|
||||
#if defined FLAC__CPU_ARM64 && FLAC__HAS_NEONINTRIN && FLAC__HAS_A64NEONINTRIN
|
||||
void FLAC__lpc_compute_autocorrelation_intrin_neon_lag_8(const FLAC__real data[], uint32_t data_len, uint32_t lag, double autoc[]);
|
||||
void FLAC__lpc_compute_autocorrelation_intrin_neon_lag_10(const FLAC__real data[], uint32_t data_len, uint32_t lag, double autoc[]);
|
||||
void FLAC__lpc_compute_autocorrelation_intrin_neon_lag_14(const FLAC__real data[], uint32_t data_len, uint32_t lag, double autoc[]);
|
||||
#endif
|
||||
#endif /* FLAC__NO_ASM */
|
||||
|
||||
/*
|
||||
* FLAC__lpc_compute_lp_coefficients()
|
||||
|
|
@ -128,7 +115,7 @@ void FLAC__lpc_compute_autocorrelation_intrin_power8_vsx_lag_16(const FLAC__real
|
|||
* in lp_coeff[8][0,8], the LP coefficients for order 8 will be
|
||||
* in lp_coeff[7][0,7], etc.
|
||||
*/
|
||||
void FLAC__lpc_compute_lp_coefficients(const FLAC__real autoc[], uint32_t *max_order, FLAC__real lp_coeff[][FLAC__MAX_LPC_ORDER], double error[]);
|
||||
void FLAC__lpc_compute_lp_coefficients(const double autoc[], uint32_t *max_order, FLAC__real lp_coeff[][FLAC__MAX_LPC_ORDER], double error[]);
|
||||
|
||||
/*
|
||||
* FLAC__lpc_quantize_coefficients()
|
||||
|
|
@ -167,14 +154,14 @@ int FLAC__lpc_quantize_coefficients(const FLAC__real lp_coeff[], uint32_t order,
|
|||
*/
|
||||
void FLAC__lpc_compute_residual_from_qlp_coefficients(const FLAC__int32 *data, uint32_t data_len, const FLAC__int32 qlp_coeff[], uint32_t order, int lp_quantization, FLAC__int32 residual[]);
|
||||
void FLAC__lpc_compute_residual_from_qlp_coefficients_wide(const FLAC__int32 *data, uint32_t data_len, const FLAC__int32 qlp_coeff[], uint32_t order, int lp_quantization, FLAC__int32 residual[]);
|
||||
FLAC__bool FLAC__lpc_compute_residual_from_qlp_coefficients_limit_residual(const FLAC__int32 *data, uint32_t data_len, const FLAC__int32 qlp_coeff[], uint32_t order, int lp_quantization, FLAC__int32 residual[]);
|
||||
FLAC__bool FLAC__lpc_compute_residual_from_qlp_coefficients_limit_residual_33bit(const FLAC__int64 *data, uint32_t data_len, const FLAC__int32 qlp_coeff[], uint32_t order, int lp_quantization, FLAC__int32 residual[]);
|
||||
#ifndef FLAC__NO_ASM
|
||||
# ifdef FLAC__CPU_IA32
|
||||
# ifdef FLAC__HAS_NASM
|
||||
void FLAC__lpc_compute_residual_from_qlp_coefficients_asm_ia32(const FLAC__int32 *data, uint32_t data_len, const FLAC__int32 qlp_coeff[], uint32_t order, int lp_quantization, FLAC__int32 residual[]);
|
||||
void FLAC__lpc_compute_residual_from_qlp_coefficients_asm_ia32_mmx(const FLAC__int32 *data, uint32_t data_len, const FLAC__int32 qlp_coeff[], uint32_t order, int lp_quantization, FLAC__int32 residual[]);
|
||||
void FLAC__lpc_compute_residual_from_qlp_coefficients_wide_asm_ia32(const FLAC__int32 *data, uint32_t data_len, const FLAC__int32 qlp_coeff[], uint32_t order, int lp_quantization, FLAC__int32 residual[]);
|
||||
# endif
|
||||
# endif
|
||||
# ifdef FLAC__CPU_ARM64
|
||||
void FLAC__lpc_compute_residual_from_qlp_coefficients_intrin_neon(const FLAC__int32 *data, uint32_t data_len, const FLAC__int32 qlp_coeff[], uint32_t order, int lp_quantization, FLAC__int32 residual[]);
|
||||
void FLAC__lpc_compute_residual_from_qlp_coefficients_wide_intrin_neon(const FLAC__int32 *data, uint32_t data_len, const FLAC__int32 qlp_coeff[], uint32_t order, int lp_quantization, FLAC__int32 residual[]);
|
||||
# endif
|
||||
|
||||
# if (defined FLAC__CPU_IA32 || defined FLAC__CPU_X86_64) && FLAC__HAS_X86INTRIN
|
||||
# ifdef FLAC__SSE2_SUPPORTED
|
||||
void FLAC__lpc_compute_residual_from_qlp_coefficients_16_intrin_sse2(const FLAC__int32 *data, uint32_t data_len, const FLAC__int32 qlp_coeff[], uint32_t order, int lp_quantization, FLAC__int32 residual[]);
|
||||
|
|
@ -194,6 +181,9 @@ void FLAC__lpc_compute_residual_from_qlp_coefficients_wide_intrin_avx2(const FLA
|
|||
|
||||
#endif /* !defined FLAC__INTEGER_ONLY_LIBRARY */
|
||||
|
||||
uint32_t FLAC__lpc_max_prediction_before_shift_bps(uint32_t subframe_bps, const FLAC__int32 qlp_coeff[], uint32_t order);
|
||||
uint32_t FLAC__lpc_max_residual_bps(uint32_t subframe_bps, const FLAC__int32 qlp_coeff[], uint32_t order, int lp_quantization);
|
||||
|
||||
/*
|
||||
* FLAC__lpc_restore_signal()
|
||||
* --------------------------------------------------------------------
|
||||
|
|
@ -211,22 +201,7 @@ void FLAC__lpc_compute_residual_from_qlp_coefficients_wide_intrin_avx2(const FLA
|
|||
*/
|
||||
void FLAC__lpc_restore_signal(const FLAC__int32 residual[], uint32_t data_len, const FLAC__int32 qlp_coeff[], uint32_t order, int lp_quantization, FLAC__int32 data[]);
|
||||
void FLAC__lpc_restore_signal_wide(const FLAC__int32 residual[], uint32_t data_len, const FLAC__int32 qlp_coeff[], uint32_t order, int lp_quantization, FLAC__int32 data[]);
|
||||
#ifndef FLAC__NO_ASM
|
||||
# ifdef FLAC__CPU_IA32
|
||||
# ifdef FLAC__HAS_NASM
|
||||
void FLAC__lpc_restore_signal_asm_ia32(const FLAC__int32 residual[], uint32_t data_len, const FLAC__int32 qlp_coeff[], uint32_t order, int lp_quantization, FLAC__int32 data[]);
|
||||
void FLAC__lpc_restore_signal_asm_ia32_mmx(const FLAC__int32 residual[], uint32_t data_len, const FLAC__int32 qlp_coeff[], uint32_t order, int lp_quantization, FLAC__int32 data[]);
|
||||
void FLAC__lpc_restore_signal_wide_asm_ia32(const FLAC__int32 residual[], uint32_t data_len, const FLAC__int32 qlp_coeff[], uint32_t order, int lp_quantization, FLAC__int32 data[]);
|
||||
# endif /* FLAC__HAS_NASM */
|
||||
# endif /* FLAC__CPU_IA32 */
|
||||
# if (defined FLAC__CPU_IA32 || defined FLAC__CPU_X86_64) && FLAC__HAS_X86INTRIN
|
||||
# ifdef FLAC__SSE4_1_SUPPORTED
|
||||
void FLAC__lpc_restore_signal_intrin_sse41(const FLAC__int32 residual[], uint32_t data_len, const FLAC__int32 qlp_coeff[], uint32_t order, int lp_quantization, FLAC__int32 data[]);
|
||||
void FLAC__lpc_restore_signal_16_intrin_sse41(const FLAC__int32 residual[], uint32_t data_len, const FLAC__int32 qlp_coeff[], uint32_t order, int lp_quantization, FLAC__int32 data[]);
|
||||
void FLAC__lpc_restore_signal_wide_intrin_sse41(const FLAC__int32 residual[], uint32_t data_len, const FLAC__int32 qlp_coeff[], uint32_t order, int lp_quantization, FLAC__int32 data[]);
|
||||
# endif
|
||||
# endif
|
||||
#endif /* FLAC__NO_ASM */
|
||||
void FLAC__lpc_restore_signal_wide_33bit(const FLAC__int32 residual[], uint32_t data_len, const FLAC__int32 qlp_coeff[], uint32_t order, int lp_quantization, FLAC__int64 data[]);
|
||||
|
||||
#ifndef FLAC__INTEGER_ONLY_LIBRARY
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/* libFLAC - Free Lossless Audio Codec library
|
||||
* Copyright (C) 2001-2009 Josh Coalson
|
||||
* Copyright (C) 2011-2016 Xiph.Org Foundation
|
||||
* Copyright (C) 2011-2023 Xiph.Org Foundation
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
|
|
@ -48,8 +48,8 @@
|
|||
void *FLAC__memory_alloc_aligned(size_t bytes, void **aligned_address);
|
||||
FLAC__bool FLAC__memory_alloc_aligned_int32_array(size_t elements, FLAC__int32 **unaligned_pointer, FLAC__int32 **aligned_pointer);
|
||||
FLAC__bool FLAC__memory_alloc_aligned_uint32_array(size_t elements, FLAC__uint32 **unaligned_pointer, FLAC__uint32 **aligned_pointer);
|
||||
FLAC__bool FLAC__memory_alloc_aligned_int64_array(size_t elements, FLAC__int64 **unaligned_pointer, FLAC__int64 **aligned_pointer);
|
||||
FLAC__bool FLAC__memory_alloc_aligned_uint64_array(size_t elements, FLAC__uint64 **unaligned_pointer, FLAC__uint64 **aligned_pointer);
|
||||
FLAC__bool FLAC__memory_alloc_aligned_unsigned_array(size_t elements, uint32_t **unaligned_pointer, uint32_t **aligned_pointer);
|
||||
#ifndef FLAC__INTEGER_ONLY_LIBRARY
|
||||
FLAC__bool FLAC__memory_alloc_aligned_real_array(size_t elements, FLAC__real **unaligned_pointer, FLAC__real **aligned_pointer);
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -1,46 +0,0 @@
|
|||
/* libFLAC - Free Lossless Audio Codec library
|
||||
* Copyright (C) 2002-2009 Josh Coalson
|
||||
* Copyright (C) 2011-2016 Xiph.Org Foundation
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* - Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* - Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* - Neither the name of the Xiph.org Foundation nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef FLAC__PRIVATE__METADATA_H
|
||||
#define FLAC__PRIVATE__METADATA_H
|
||||
|
||||
#include "../../../metadata.h"
|
||||
|
||||
/* WATCHOUT: all malloc()ed data in the block is free()ed; this may not
|
||||
* be a consistent state (e.g. PICTURE) or equivalent to the initial
|
||||
* state after FLAC__metadata_object_new()
|
||||
*/
|
||||
void FLAC__metadata_object_delete_data(FLAC__StreamMetadata *object);
|
||||
|
||||
void FLAC__metadata_object_cuesheet_track_delete_data(FLAC__StreamMetadata_CueSheet_Track *object);
|
||||
|
||||
#endif
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
/* libFLAC - Free Lossless Audio Codec library
|
||||
* Copyright (C) 2000-2009 Josh Coalson
|
||||
* Copyright (C) 2011-2016 Xiph.Org Foundation
|
||||
* Copyright (C) 2011-2023 Xiph.Org Foundation
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/* libFLAC - Free Lossless Audio Codec library
|
||||
* Copyright (C) 2000-2009 Josh Coalson
|
||||
* Copyright (C) 2011-2016 Xiph.Org Foundation
|
||||
* Copyright (C) 2011-2023 Xiph.Org Foundation
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
|
|
@ -36,7 +36,7 @@
|
|||
#include "../../../format.h"
|
||||
#include "bitwriter.h"
|
||||
|
||||
FLAC__bool FLAC__add_metadata_block(const FLAC__StreamMetadata *metadata, FLAC__BitWriter *bw);
|
||||
FLAC__bool FLAC__add_metadata_block(const FLAC__StreamMetadata *metadata, FLAC__BitWriter *bw, FLAC__bool update_vendor_string);
|
||||
FLAC__bool FLAC__frame_add_header(const FLAC__FrameHeader *header, FLAC__BitWriter *bw);
|
||||
FLAC__bool FLAC__subframe_add_constant(const FLAC__Subframe_Constant *subframe, uint32_t subframe_bps, uint32_t wasted_bits, FLAC__BitWriter *bw);
|
||||
FLAC__bool FLAC__subframe_add_fixed(const FLAC__Subframe_Fixed *subframe, uint32_t residual_samples, uint32_t subframe_bps, uint32_t wasted_bits, FLAC__BitWriter *bw);
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/* libFLAC - Free Lossless Audio Codec library
|
||||
* Copyright (C) 2006-2009 Josh Coalson
|
||||
* Copyright (C) 2011-2016 Xiph.Org Foundation
|
||||
* Copyright (C) 2011-2023 Xiph.Org Foundation
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
|
|
|
|||
|
|
@ -1,39 +0,0 @@
|
|||
/* libFLAC - Free Lossless Audio Codec library
|
||||
* Copyright (C) 2001-2009 Josh Coalson
|
||||
* Copyright (C) 2011-2016 Xiph.Org Foundation
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* - Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* - Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* - Neither the name of the Xiph.org Foundation nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef FLAC__PROTECTED__ALL_H
|
||||
#define FLAC__PROTECTED__ALL_H
|
||||
|
||||
#include "stream_decoder.h"
|
||||
#include "stream_encoder.h"
|
||||
|
||||
#endif
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
/* libFLAC - Free Lossless Audio Codec library
|
||||
* Copyright (C) 2000-2009 Josh Coalson
|
||||
* Copyright (C) 2011-2016 Xiph.Org Foundation
|
||||
* Copyright (C) 2011-2023 Xiph.Org Foundation
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
|
|
@ -53,13 +53,8 @@ typedef struct FLAC__StreamDecoderProtected {
|
|||
} FLAC__StreamDecoderProtected;
|
||||
|
||||
/*
|
||||
* return the number of input bytes consumed
|
||||
* Return the number of input bytes consumed
|
||||
*/
|
||||
uint32_t FLAC__stream_decoder_get_input_bytes_unconsumed(const FLAC__StreamDecoder *decoder);
|
||||
|
||||
/*
|
||||
* return client_data from decoder
|
||||
*/
|
||||
FLAC_API void *get_client_data_from_decoder(FLAC__StreamDecoder *decoder);
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/* libFLAC - Free Lossless Audio Codec library
|
||||
* Copyright (C) 2001-2009 Josh Coalson
|
||||
* Copyright (C) 2011-2016 Xiph.Org Foundation
|
||||
* Copyright (C) 2011-2023 Xiph.Org Foundation
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
|
|
@ -61,6 +61,7 @@ typedef enum {
|
|||
FLAC__APODIZATION_TUKEY,
|
||||
FLAC__APODIZATION_PARTIAL_TUKEY,
|
||||
FLAC__APODIZATION_PUNCHOUT_TUKEY,
|
||||
FLAC__APODIZATION_SUBDIVIDE_TUKEY,
|
||||
FLAC__APODIZATION_WELCH
|
||||
} FLAC__ApodizationFunction;
|
||||
|
||||
|
|
@ -78,6 +79,10 @@ typedef struct {
|
|||
FLAC__real start;
|
||||
FLAC__real end;
|
||||
} multiple_tukey;
|
||||
struct {
|
||||
FLAC__real p;
|
||||
FLAC__int32 parts;
|
||||
} subdivide_tukey;
|
||||
} parameters;
|
||||
} FLAC__ApodizationSpecification;
|
||||
|
||||
|
|
@ -107,6 +112,7 @@ typedef struct FLAC__StreamEncoderProtected {
|
|||
uint32_t max_residual_partition_order;
|
||||
uint32_t rice_parameter_search_dist;
|
||||
FLAC__uint64 total_samples_estimate;
|
||||
FLAC__bool limit_min_bitrate;
|
||||
FLAC__StreamMetadata **metadata;
|
||||
uint32_t num_metadata_blocks;
|
||||
FLAC__uint64 streaminfo_offset, seektable_offset, audio_offset;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/* libFLAC - Free Lossless Audio Codec library
|
||||
* Copyright (C) 2000-2009 Josh Coalson
|
||||
* Copyright (C) 2011-2016 Xiph.Org Foundation
|
||||
* Copyright (C) 2011-2023 Xiph.Org Foundation
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
|
|
@ -35,12 +35,15 @@
|
|||
#endif
|
||||
|
||||
#include <math.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "../assert.h"
|
||||
#include "../format.h"
|
||||
#include "../compat.h"
|
||||
#include "include/private/bitmath.h"
|
||||
#include "include/private/lpc.h"
|
||||
|
||||
|
||||
#if !defined(NDEBUG) || defined FLAC__OVERFLOW_DETECT || defined FLAC__OVERFLOW_DETECT_VERBOSE
|
||||
#include <stdio.h>
|
||||
#endif
|
||||
|
|
@ -69,11 +72,46 @@ void FLAC__lpc_window_data(const FLAC__int32 in[], const FLAC__real window[], FL
|
|||
out[i] = in[i] * window[i];
|
||||
}
|
||||
|
||||
void FLAC__lpc_compute_autocorrelation(const FLAC__real data[], uint32_t data_len, uint32_t lag, FLAC__real autoc[])
|
||||
void FLAC__lpc_window_data_wide(const FLAC__int64 in[], const FLAC__real window[], FLAC__real out[], uint32_t data_len)
|
||||
{
|
||||
uint32_t i;
|
||||
for(i = 0; i < data_len; i++)
|
||||
out[i] = in[i] * window[i];
|
||||
}
|
||||
|
||||
void FLAC__lpc_window_data_partial(const FLAC__int32 in[], const FLAC__real window[], FLAC__real out[], uint32_t data_len, uint32_t part_size, uint32_t data_shift)
|
||||
{
|
||||
uint32_t i, j;
|
||||
if((part_size + data_shift) < data_len){
|
||||
for(i = 0; i < part_size; i++)
|
||||
out[i] = in[data_shift+i] * window[i];
|
||||
i = flac_min(i,data_len - part_size - data_shift);
|
||||
for(j = data_len - part_size; j < data_len; i++, j++)
|
||||
out[i] = in[data_shift+i] * window[j];
|
||||
if(i < data_len)
|
||||
out[i] = 0.0f;
|
||||
}
|
||||
}
|
||||
|
||||
void FLAC__lpc_window_data_partial_wide(const FLAC__int64 in[], const FLAC__real window[], FLAC__real out[], uint32_t data_len, uint32_t part_size, uint32_t data_shift)
|
||||
{
|
||||
uint32_t i, j;
|
||||
if((part_size + data_shift) < data_len){
|
||||
for(i = 0; i < part_size; i++)
|
||||
out[i] = in[data_shift+i] * window[i];
|
||||
i = flac_min(i,data_len - part_size - data_shift);
|
||||
for(j = data_len - part_size; j < data_len; i++, j++)
|
||||
out[i] = in[data_shift+i] * window[j];
|
||||
if(i < data_len)
|
||||
out[i] = 0.0f;
|
||||
}
|
||||
}
|
||||
|
||||
void FLAC__lpc_compute_autocorrelation(const FLAC__real data[], uint32_t data_len, uint32_t lag, double autoc[])
|
||||
{
|
||||
/* a readable, but slower, version */
|
||||
#if 0
|
||||
FLAC__real d;
|
||||
double d;
|
||||
uint32_t i;
|
||||
|
||||
FLAC__ASSERT(lag > 0);
|
||||
|
|
@ -88,37 +126,54 @@ void FLAC__lpc_compute_autocorrelation(const FLAC__real data[], uint32_t data_le
|
|||
*/
|
||||
while(lag--) {
|
||||
for(i = lag, d = 0.0; i < data_len; i++)
|
||||
d += data[i] * data[i - lag];
|
||||
d += data[i] * (double)data[i - lag];
|
||||
autoc[lag] = d;
|
||||
}
|
||||
#endif
|
||||
if (data_len < FLAC__MAX_LPC_ORDER || lag > 16) {
|
||||
/*
|
||||
* this version tends to run faster because of better data locality
|
||||
* ('data_len' is usually much larger than 'lag')
|
||||
*/
|
||||
double d;
|
||||
uint32_t sample, coeff;
|
||||
const uint32_t limit = data_len - lag;
|
||||
|
||||
/*
|
||||
* this version tends to run faster because of better data locality
|
||||
* ('data_len' is usually much larger than 'lag')
|
||||
*/
|
||||
FLAC__real d;
|
||||
uint32_t sample, coeff;
|
||||
const uint32_t limit = data_len - lag;
|
||||
FLAC__ASSERT(lag > 0);
|
||||
FLAC__ASSERT(lag <= data_len);
|
||||
|
||||
FLAC__ASSERT(lag > 0);
|
||||
FLAC__ASSERT(lag <= data_len);
|
||||
|
||||
for(coeff = 0; coeff < lag; coeff++)
|
||||
autoc[coeff] = 0.0;
|
||||
for(sample = 0; sample <= limit; sample++) {
|
||||
d = data[sample];
|
||||
for(coeff = 0; coeff < lag; coeff++)
|
||||
autoc[coeff] += d * data[sample+coeff];
|
||||
autoc[coeff] = 0.0;
|
||||
for(sample = 0; sample <= limit; sample++) {
|
||||
d = data[sample];
|
||||
for(coeff = 0; coeff < lag; coeff++)
|
||||
autoc[coeff] += d * data[sample+coeff];
|
||||
}
|
||||
for(; sample < data_len; sample++) {
|
||||
d = data[sample];
|
||||
for(coeff = 0; coeff < data_len - sample; coeff++)
|
||||
autoc[coeff] += d * data[sample+coeff];
|
||||
}
|
||||
}
|
||||
for(; sample < data_len; sample++) {
|
||||
d = data[sample];
|
||||
for(coeff = 0; coeff < data_len - sample; coeff++)
|
||||
autoc[coeff] += d * data[sample+coeff];
|
||||
else if(lag <= 8) {
|
||||
#undef MAX_LAG
|
||||
#define MAX_LAG 8
|
||||
#include "deduplication/lpc_compute_autocorrelation_intrin.c"
|
||||
}
|
||||
else if(lag <= 12) {
|
||||
#undef MAX_LAG
|
||||
#define MAX_LAG 12
|
||||
#include "deduplication/lpc_compute_autocorrelation_intrin.c"
|
||||
}
|
||||
else if(lag <= 16) {
|
||||
#undef MAX_LAG
|
||||
#define MAX_LAG 16
|
||||
#include "deduplication/lpc_compute_autocorrelation_intrin.c"
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void FLAC__lpc_compute_lp_coefficients(const FLAC__real autoc[], uint32_t *max_order, FLAC__real lp_coeff[][FLAC__MAX_LPC_ORDER], double error[])
|
||||
void FLAC__lpc_compute_lp_coefficients(const double autoc[], uint32_t *max_order, FLAC__real lp_coeff[][FLAC__MAX_LPC_ORDER], double error[])
|
||||
{
|
||||
uint32_t i, j;
|
||||
double r, err, lpc[FLAC__MAX_LPC_ORDER];
|
||||
|
|
@ -544,10 +599,6 @@ void FLAC__lpc_compute_residual_from_qlp_coefficients_wide(const FLAC__int32 * f
|
|||
history = data;
|
||||
for(j = 0; j < order; j++)
|
||||
sum += (FLAC__int64)qlp_coeff[j] * (FLAC__int64)(*(--history));
|
||||
if(FLAC__bitmath_silog2(sum >> lp_quantization) > 32) {
|
||||
fprintf(stderr,"FLAC__lpc_compute_residual_from_qlp_coefficients_wide: OVERFLOW, i=%u, sum=%" PRId64 "\n", i, (sum >> lp_quantization));
|
||||
break;
|
||||
}
|
||||
if(FLAC__bitmath_silog2((FLAC__int64)(*data) - (sum >> lp_quantization)) > 32) {
|
||||
fprintf(stderr,"FLAC__lpc_compute_residual_from_qlp_coefficients_wide: OVERFLOW, i=%u, data=%d, sum=%" PRId64 ", residual=%" PRId64 "\n", i, *data, (int64_t)(sum >> lp_quantization), ((FLAC__int64)(*data) - (sum >> lp_quantization)));
|
||||
break;
|
||||
|
|
@ -586,7 +637,7 @@ void FLAC__lpc_compute_residual_from_qlp_coefficients_wide(const FLAC__int32 * f
|
|||
sum += qlp_coeff[2] * (FLAC__int64)data[i-3];
|
||||
sum += qlp_coeff[1] * (FLAC__int64)data[i-2];
|
||||
sum += qlp_coeff[0] * (FLAC__int64)data[i-1];
|
||||
residual[i] = data[i] - (FLAC__int32)(sum >> lp_quantization);
|
||||
residual[i] = data[i] - (sum >> lp_quantization);
|
||||
}
|
||||
}
|
||||
else { /* order == 11 */
|
||||
|
|
@ -603,7 +654,7 @@ void FLAC__lpc_compute_residual_from_qlp_coefficients_wide(const FLAC__int32 * f
|
|||
sum += qlp_coeff[2] * (FLAC__int64)data[i-3];
|
||||
sum += qlp_coeff[1] * (FLAC__int64)data[i-2];
|
||||
sum += qlp_coeff[0] * (FLAC__int64)data[i-1];
|
||||
residual[i] = data[i] - (FLAC__int32)(sum >> lp_quantization);
|
||||
residual[i] = data[i] - (sum >> lp_quantization);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -621,7 +672,7 @@ void FLAC__lpc_compute_residual_from_qlp_coefficients_wide(const FLAC__int32 * f
|
|||
sum += qlp_coeff[2] * (FLAC__int64)data[i-3];
|
||||
sum += qlp_coeff[1] * (FLAC__int64)data[i-2];
|
||||
sum += qlp_coeff[0] * (FLAC__int64)data[i-1];
|
||||
residual[i] = data[i] - (FLAC__int32)(sum >> lp_quantization);
|
||||
residual[i] = data[i] - (sum >> lp_quantization);
|
||||
}
|
||||
}
|
||||
else { /* order == 9 */
|
||||
|
|
@ -636,7 +687,7 @@ void FLAC__lpc_compute_residual_from_qlp_coefficients_wide(const FLAC__int32 * f
|
|||
sum += qlp_coeff[2] * (FLAC__int64)data[i-3];
|
||||
sum += qlp_coeff[1] * (FLAC__int64)data[i-2];
|
||||
sum += qlp_coeff[0] * (FLAC__int64)data[i-1];
|
||||
residual[i] = data[i] - (FLAC__int32)(sum >> lp_quantization);
|
||||
residual[i] = data[i] - (sum >> lp_quantization);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -654,7 +705,7 @@ void FLAC__lpc_compute_residual_from_qlp_coefficients_wide(const FLAC__int32 * f
|
|||
sum += qlp_coeff[2] * (FLAC__int64)data[i-3];
|
||||
sum += qlp_coeff[1] * (FLAC__int64)data[i-2];
|
||||
sum += qlp_coeff[0] * (FLAC__int64)data[i-1];
|
||||
residual[i] = data[i] - (FLAC__int32)(sum >> lp_quantization);
|
||||
residual[i] = data[i] - (sum >> lp_quantization);
|
||||
}
|
||||
}
|
||||
else { /* order == 7 */
|
||||
|
|
@ -667,7 +718,7 @@ void FLAC__lpc_compute_residual_from_qlp_coefficients_wide(const FLAC__int32 * f
|
|||
sum += qlp_coeff[2] * (FLAC__int64)data[i-3];
|
||||
sum += qlp_coeff[1] * (FLAC__int64)data[i-2];
|
||||
sum += qlp_coeff[0] * (FLAC__int64)data[i-1];
|
||||
residual[i] = data[i] - (FLAC__int32)(sum >> lp_quantization);
|
||||
residual[i] = data[i] - (sum >> lp_quantization);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -681,7 +732,7 @@ void FLAC__lpc_compute_residual_from_qlp_coefficients_wide(const FLAC__int32 * f
|
|||
sum += qlp_coeff[2] * (FLAC__int64)data[i-3];
|
||||
sum += qlp_coeff[1] * (FLAC__int64)data[i-2];
|
||||
sum += qlp_coeff[0] * (FLAC__int64)data[i-1];
|
||||
residual[i] = data[i] - (FLAC__int32)(sum >> lp_quantization);
|
||||
residual[i] = data[i] - (sum >> lp_quantization);
|
||||
}
|
||||
}
|
||||
else { /* order == 5 */
|
||||
|
|
@ -692,7 +743,7 @@ void FLAC__lpc_compute_residual_from_qlp_coefficients_wide(const FLAC__int32 * f
|
|||
sum += qlp_coeff[2] * (FLAC__int64)data[i-3];
|
||||
sum += qlp_coeff[1] * (FLAC__int64)data[i-2];
|
||||
sum += qlp_coeff[0] * (FLAC__int64)data[i-1];
|
||||
residual[i] = data[i] - (FLAC__int32)(sum >> lp_quantization);
|
||||
residual[i] = data[i] - (sum >> lp_quantization);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -706,7 +757,7 @@ void FLAC__lpc_compute_residual_from_qlp_coefficients_wide(const FLAC__int32 * f
|
|||
sum += qlp_coeff[2] * (FLAC__int64)data[i-3];
|
||||
sum += qlp_coeff[1] * (FLAC__int64)data[i-2];
|
||||
sum += qlp_coeff[0] * (FLAC__int64)data[i-1];
|
||||
residual[i] = data[i] - (FLAC__int32)(sum >> lp_quantization);
|
||||
residual[i] = data[i] - (sum >> lp_quantization);
|
||||
}
|
||||
}
|
||||
else { /* order == 3 */
|
||||
|
|
@ -715,7 +766,7 @@ void FLAC__lpc_compute_residual_from_qlp_coefficients_wide(const FLAC__int32 * f
|
|||
sum += qlp_coeff[2] * (FLAC__int64)data[i-3];
|
||||
sum += qlp_coeff[1] * (FLAC__int64)data[i-2];
|
||||
sum += qlp_coeff[0] * (FLAC__int64)data[i-1];
|
||||
residual[i] = data[i] - (FLAC__int32)(sum >> lp_quantization);
|
||||
residual[i] = data[i] - (sum >> lp_quantization);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -725,12 +776,12 @@ void FLAC__lpc_compute_residual_from_qlp_coefficients_wide(const FLAC__int32 * f
|
|||
sum = 0;
|
||||
sum += qlp_coeff[1] * (FLAC__int64)data[i-2];
|
||||
sum += qlp_coeff[0] * (FLAC__int64)data[i-1];
|
||||
residual[i] = data[i] - (FLAC__int32)(sum >> lp_quantization);
|
||||
residual[i] = data[i] - (sum >> lp_quantization);
|
||||
}
|
||||
}
|
||||
else { /* order == 1 */
|
||||
for(i = 0; i < (int)data_len; i++)
|
||||
residual[i] = data[i] - (FLAC__int32)((qlp_coeff[0] * (FLAC__int64)data[i-1]) >> lp_quantization);
|
||||
residual[i] = data[i] - ((qlp_coeff[0] * (FLAC__int64)data[i-1]) >> lp_quantization);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -772,14 +823,155 @@ void FLAC__lpc_compute_residual_from_qlp_coefficients_wide(const FLAC__int32 * f
|
|||
sum += qlp_coeff[ 1] * (FLAC__int64)data[i- 2];
|
||||
sum += qlp_coeff[ 0] * (FLAC__int64)data[i- 1];
|
||||
}
|
||||
residual[i] = data[i] - (FLAC__int32)(sum >> lp_quantization);
|
||||
residual[i] = data[i] - (sum >> lp_quantization);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
FLAC__bool FLAC__lpc_compute_residual_from_qlp_coefficients_limit_residual(const FLAC__int32 * flac_restrict data, uint32_t data_len, const FLAC__int32 * flac_restrict qlp_coeff, uint32_t order, int lp_quantization, FLAC__int32 * flac_restrict residual)
|
||||
{
|
||||
int i;
|
||||
FLAC__int64 sum, residual_to_check;
|
||||
|
||||
FLAC__ASSERT(order > 0);
|
||||
FLAC__ASSERT(order <= 32);
|
||||
|
||||
for(i = 0; i < (int)data_len; i++) {
|
||||
sum = 0;
|
||||
switch(order) {
|
||||
case 32: sum += qlp_coeff[31] * (FLAC__int64)data[i-32]; /* Falls through. */
|
||||
case 31: sum += qlp_coeff[30] * (FLAC__int64)data[i-31]; /* Falls through. */
|
||||
case 30: sum += qlp_coeff[29] * (FLAC__int64)data[i-30]; /* Falls through. */
|
||||
case 29: sum += qlp_coeff[28] * (FLAC__int64)data[i-29]; /* Falls through. */
|
||||
case 28: sum += qlp_coeff[27] * (FLAC__int64)data[i-28]; /* Falls through. */
|
||||
case 27: sum += qlp_coeff[26] * (FLAC__int64)data[i-27]; /* Falls through. */
|
||||
case 26: sum += qlp_coeff[25] * (FLAC__int64)data[i-26]; /* Falls through. */
|
||||
case 25: sum += qlp_coeff[24] * (FLAC__int64)data[i-25]; /* Falls through. */
|
||||
case 24: sum += qlp_coeff[23] * (FLAC__int64)data[i-24]; /* Falls through. */
|
||||
case 23: sum += qlp_coeff[22] * (FLAC__int64)data[i-23]; /* Falls through. */
|
||||
case 22: sum += qlp_coeff[21] * (FLAC__int64)data[i-22]; /* Falls through. */
|
||||
case 21: sum += qlp_coeff[20] * (FLAC__int64)data[i-21]; /* Falls through. */
|
||||
case 20: sum += qlp_coeff[19] * (FLAC__int64)data[i-20]; /* Falls through. */
|
||||
case 19: sum += qlp_coeff[18] * (FLAC__int64)data[i-19]; /* Falls through. */
|
||||
case 18: sum += qlp_coeff[17] * (FLAC__int64)data[i-18]; /* Falls through. */
|
||||
case 17: sum += qlp_coeff[16] * (FLAC__int64)data[i-17]; /* Falls through. */
|
||||
case 16: sum += qlp_coeff[15] * (FLAC__int64)data[i-16]; /* Falls through. */
|
||||
case 15: sum += qlp_coeff[14] * (FLAC__int64)data[i-15]; /* Falls through. */
|
||||
case 14: sum += qlp_coeff[13] * (FLAC__int64)data[i-14]; /* Falls through. */
|
||||
case 13: sum += qlp_coeff[12] * (FLAC__int64)data[i-13]; /* Falls through. */
|
||||
case 12: sum += qlp_coeff[11] * (FLAC__int64)data[i-12]; /* Falls through. */
|
||||
case 11: sum += qlp_coeff[10] * (FLAC__int64)data[i-11]; /* Falls through. */
|
||||
case 10: sum += qlp_coeff[ 9] * (FLAC__int64)data[i-10]; /* Falls through. */
|
||||
case 9: sum += qlp_coeff[ 8] * (FLAC__int64)data[i- 9]; /* Falls through. */
|
||||
case 8: sum += qlp_coeff[ 7] * (FLAC__int64)data[i- 8]; /* Falls through. */
|
||||
case 7: sum += qlp_coeff[ 6] * (FLAC__int64)data[i- 7]; /* Falls through. */
|
||||
case 6: sum += qlp_coeff[ 5] * (FLAC__int64)data[i- 6]; /* Falls through. */
|
||||
case 5: sum += qlp_coeff[ 4] * (FLAC__int64)data[i- 5]; /* Falls through. */
|
||||
case 4: sum += qlp_coeff[ 3] * (FLAC__int64)data[i- 4]; /* Falls through. */
|
||||
case 3: sum += qlp_coeff[ 2] * (FLAC__int64)data[i- 3]; /* Falls through. */
|
||||
case 2: sum += qlp_coeff[ 1] * (FLAC__int64)data[i- 2]; /* Falls through. */
|
||||
case 1: sum += qlp_coeff[ 0] * (FLAC__int64)data[i- 1];
|
||||
}
|
||||
residual_to_check = data[i] - (sum >> lp_quantization);
|
||||
/* residual must not be INT32_MIN because abs(INT32_MIN) is undefined */
|
||||
if(residual_to_check <= INT32_MIN || residual_to_check > INT32_MAX)
|
||||
return false;
|
||||
else
|
||||
residual[i] = residual_to_check;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
FLAC__bool FLAC__lpc_compute_residual_from_qlp_coefficients_limit_residual_33bit(const FLAC__int64 * flac_restrict data, uint32_t data_len, const FLAC__int32 * flac_restrict qlp_coeff, uint32_t order, int lp_quantization, FLAC__int32 * flac_restrict residual)
|
||||
{
|
||||
int i;
|
||||
FLAC__int64 sum, residual_to_check;
|
||||
|
||||
FLAC__ASSERT(order > 0);
|
||||
FLAC__ASSERT(order <= 32);
|
||||
|
||||
for(i = 0; i < (int)data_len; i++) {
|
||||
sum = 0;
|
||||
switch(order) {
|
||||
case 32: sum += qlp_coeff[31] * data[i-32]; /* Falls through. */
|
||||
case 31: sum += qlp_coeff[30] * data[i-31]; /* Falls through. */
|
||||
case 30: sum += qlp_coeff[29] * data[i-30]; /* Falls through. */
|
||||
case 29: sum += qlp_coeff[28] * data[i-29]; /* Falls through. */
|
||||
case 28: sum += qlp_coeff[27] * data[i-28]; /* Falls through. */
|
||||
case 27: sum += qlp_coeff[26] * data[i-27]; /* Falls through. */
|
||||
case 26: sum += qlp_coeff[25] * data[i-26]; /* Falls through. */
|
||||
case 25: sum += qlp_coeff[24] * data[i-25]; /* Falls through. */
|
||||
case 24: sum += qlp_coeff[23] * data[i-24]; /* Falls through. */
|
||||
case 23: sum += qlp_coeff[22] * data[i-23]; /* Falls through. */
|
||||
case 22: sum += qlp_coeff[21] * data[i-22]; /* Falls through. */
|
||||
case 21: sum += qlp_coeff[20] * data[i-21]; /* Falls through. */
|
||||
case 20: sum += qlp_coeff[19] * data[i-20]; /* Falls through. */
|
||||
case 19: sum += qlp_coeff[18] * data[i-19]; /* Falls through. */
|
||||
case 18: sum += qlp_coeff[17] * data[i-18]; /* Falls through. */
|
||||
case 17: sum += qlp_coeff[16] * data[i-17]; /* Falls through. */
|
||||
case 16: sum += qlp_coeff[15] * data[i-16]; /* Falls through. */
|
||||
case 15: sum += qlp_coeff[14] * data[i-15]; /* Falls through. */
|
||||
case 14: sum += qlp_coeff[13] * data[i-14]; /* Falls through. */
|
||||
case 13: sum += qlp_coeff[12] * data[i-13]; /* Falls through. */
|
||||
case 12: sum += qlp_coeff[11] * data[i-12]; /* Falls through. */
|
||||
case 11: sum += qlp_coeff[10] * data[i-11]; /* Falls through. */
|
||||
case 10: sum += qlp_coeff[ 9] * data[i-10]; /* Falls through. */
|
||||
case 9: sum += qlp_coeff[ 8] * data[i- 9]; /* Falls through. */
|
||||
case 8: sum += qlp_coeff[ 7] * data[i- 8]; /* Falls through. */
|
||||
case 7: sum += qlp_coeff[ 6] * data[i- 7]; /* Falls through. */
|
||||
case 6: sum += qlp_coeff[ 5] * data[i- 6]; /* Falls through. */
|
||||
case 5: sum += qlp_coeff[ 4] * data[i- 5]; /* Falls through. */
|
||||
case 4: sum += qlp_coeff[ 3] * data[i- 4]; /* Falls through. */
|
||||
case 3: sum += qlp_coeff[ 2] * data[i- 3]; /* Falls through. */
|
||||
case 2: sum += qlp_coeff[ 1] * data[i- 2]; /* Falls through. */
|
||||
case 1: sum += qlp_coeff[ 0] * data[i- 1];
|
||||
}
|
||||
residual_to_check = data[i] - (sum >> lp_quantization);
|
||||
/* residual must not be INT32_MIN because abs(INT32_MIN) is undefined */
|
||||
if(residual_to_check <= INT32_MIN || residual_to_check > INT32_MAX)
|
||||
return false;
|
||||
else
|
||||
residual[i] = residual_to_check;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
#endif /* !defined FLAC__INTEGER_ONLY_LIBRARY */
|
||||
|
||||
uint32_t FLAC__lpc_max_prediction_before_shift_bps(uint32_t subframe_bps, const FLAC__int32 * flac_restrict qlp_coeff, uint32_t order)
|
||||
{
|
||||
/* This used to be subframe_bps + qlp_coeff_precision + FLAC__bitmath_ilog2(order)
|
||||
* but that treats both the samples as well as the predictor as unknown. The
|
||||
* predictor is known however, so taking the log2 of the sum of the absolute values
|
||||
* of all coefficients is a more accurate representation of the predictor */
|
||||
FLAC__int32 abs_sum_of_qlp_coeff = 0;
|
||||
uint32_t i;
|
||||
for(i = 0; i < order; i++)
|
||||
abs_sum_of_qlp_coeff += abs(qlp_coeff[i]);
|
||||
if(abs_sum_of_qlp_coeff == 0)
|
||||
abs_sum_of_qlp_coeff = 1;
|
||||
return subframe_bps + FLAC__bitmath_silog2(abs_sum_of_qlp_coeff);
|
||||
}
|
||||
|
||||
|
||||
uint32_t FLAC__lpc_max_residual_bps(uint32_t subframe_bps, const FLAC__int32 * flac_restrict qlp_coeff, uint32_t order, int lp_quantization)
|
||||
{
|
||||
FLAC__int32 predictor_sum_bps = FLAC__lpc_max_prediction_before_shift_bps(subframe_bps, qlp_coeff, order) - lp_quantization;
|
||||
if((int)subframe_bps > predictor_sum_bps)
|
||||
return subframe_bps + 1;
|
||||
else
|
||||
return predictor_sum_bps + 1;
|
||||
}
|
||||
|
||||
#if defined(FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION) && !defined(FUZZING_BUILD_MODE_FLAC_SANITIZE_SIGNED_INTEGER_OVERFLOW)
|
||||
/* The attribute below is to silence the undefined sanitizer of oss-fuzz.
|
||||
* Because fuzzing feeds bogus predictors and residual samples to the
|
||||
* decoder, having overflows in this section is unavoidable. Also,
|
||||
* because the calculated values are audio path only, there is no
|
||||
* potential for security problems */
|
||||
__attribute__((no_sanitize("signed-integer-overflow")))
|
||||
#endif
|
||||
void FLAC__lpc_restore_signal(const FLAC__int32 * flac_restrict residual, uint32_t data_len, const FLAC__int32 * flac_restrict qlp_coeff, uint32_t order, int lp_quantization, FLAC__int32 * flac_restrict data)
|
||||
#if defined(FLAC__OVERFLOW_DETECT) || !defined(FLAC__LPC_UNROLLED_FILTER_LOOPS)
|
||||
{
|
||||
|
|
@ -803,8 +995,10 @@ void FLAC__lpc_restore_signal(const FLAC__int32 * flac_restrict residual, uint32
|
|||
for(j = 0; j < order; j++) {
|
||||
sum += qlp_coeff[j] * (*(--history));
|
||||
sumo += (FLAC__int64)qlp_coeff[j] * (FLAC__int64)(*history);
|
||||
#ifdef FLAC__OVERFLOW_DETECT
|
||||
if(sumo > 2147483647ll || sumo < -2147483648ll)
|
||||
fprintf(stderr,"FLAC__lpc_restore_signal: OVERFLOW, i=%u, j=%u, c=%d, d=%d, sumo=%" PRId64 "\n",i,j,qlp_coeff[j],*history,sumo);
|
||||
#endif
|
||||
}
|
||||
*(data++) = *(r++) + (sum >> lp_quantization);
|
||||
}
|
||||
|
|
@ -1061,15 +1255,13 @@ void FLAC__lpc_restore_signal_wide(const FLAC__int32 * flac_restrict residual, u
|
|||
history = data;
|
||||
for(j = 0; j < order; j++)
|
||||
sum += (FLAC__int64)qlp_coeff[j] * (FLAC__int64)(*(--history));
|
||||
if(FLAC__bitmath_silog2(sum >> lp_quantization) > 32) {
|
||||
fprintf(stderr,"FLAC__lpc_restore_signal_wide: OVERFLOW, i=%u, sum=%" PRId64 "\n", i, (sum >> lp_quantization));
|
||||
break;
|
||||
}
|
||||
#ifdef FLAC__OVERFLOW_DETECT
|
||||
if(FLAC__bitmath_silog2((FLAC__int64)(*r) + (sum >> lp_quantization)) > 32) {
|
||||
fprintf(stderr,"FLAC__lpc_restore_signal_wide: OVERFLOW, i=%u, residual=%d, sum=%" PRId64 ", data=%" PRId64 "\n", i, *r, (sum >> lp_quantization), ((FLAC__int64)(*r) + (sum >> lp_quantization)));
|
||||
break;
|
||||
}
|
||||
*(data++) = *(r++) + (FLAC__int32)(sum >> lp_quantization);
|
||||
#endif
|
||||
*(data++) = (FLAC__int32)(*(r++) + (sum >> lp_quantization));
|
||||
}
|
||||
}
|
||||
#else /* fully unrolled version for normal use */
|
||||
|
|
@ -1247,7 +1439,7 @@ void FLAC__lpc_restore_signal_wide(const FLAC__int32 * flac_restrict residual, u
|
|||
}
|
||||
else { /* order == 1 */
|
||||
for(i = 0; i < (int)data_len; i++)
|
||||
data[i] = residual[i] + (FLAC__int32)((qlp_coeff[0] * (FLAC__int64)data[i-1]) >> lp_quantization);
|
||||
data[i] = (FLAC__int32)(residual[i] + ((qlp_coeff[0] * (FLAC__int64)data[i-1]) >> lp_quantization));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1295,6 +1487,87 @@ void FLAC__lpc_restore_signal_wide(const FLAC__int32 * flac_restrict residual, u
|
|||
}
|
||||
#endif
|
||||
|
||||
#if defined(FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION) && !defined(FUZZING_BUILD_MODE_FLAC_SANITIZE_SIGNED_INTEGER_OVERFLOW)
|
||||
/* The attribute below is to silence the undefined sanitizer of oss-fuzz.
|
||||
* Because fuzzing feeds bogus predictors and residual samples to the
|
||||
* decoder, having overflows in this section is unavoidable. Also,
|
||||
* because the calculated values are audio path only, there is no
|
||||
* potential for security problems */
|
||||
__attribute__((no_sanitize("signed-integer-overflow")))
|
||||
#endif
|
||||
void FLAC__lpc_restore_signal_wide_33bit(const FLAC__int32 * flac_restrict residual, uint32_t data_len, const FLAC__int32 * flac_restrict qlp_coeff, uint32_t order, int lp_quantization, FLAC__int64 * flac_restrict data)
|
||||
#if defined(FLAC__OVERFLOW_DETECT) || !defined(FLAC__LPC_UNROLLED_FILTER_LOOPS)
|
||||
{
|
||||
uint32_t i, j;
|
||||
FLAC__int64 sum;
|
||||
const FLAC__int32 *r = residual;
|
||||
const FLAC__int64 *history;
|
||||
|
||||
FLAC__ASSERT(order > 0);
|
||||
|
||||
for(i = 0; i < data_len; i++) {
|
||||
sum = 0;
|
||||
history = data;
|
||||
for(j = 0; j < order; j++)
|
||||
sum += (FLAC__int64)qlp_coeff[j] * (FLAC__int64)(*(--history));
|
||||
#ifdef FLAC__OVERFLOW_DETECT
|
||||
if(FLAC__bitmath_silog2((FLAC__int64)(*r) + (sum >> lp_quantization)) > 33) {
|
||||
fprintf(stderr,"FLAC__lpc_restore_signal_33bit: OVERFLOW, i=%u, residual=%d, sum=%" PRId64 ", data=%" PRId64 "\n", i, *r, (sum >> lp_quantization), ((FLAC__int64)(*r) + (sum >> lp_quantization)));
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
*(data++) = (FLAC__int64)(*(r++)) + (sum >> lp_quantization);
|
||||
}
|
||||
}
|
||||
#else /* unrolled version for normal use */
|
||||
{
|
||||
int i;
|
||||
FLAC__int64 sum;
|
||||
|
||||
FLAC__ASSERT(order > 0);
|
||||
FLAC__ASSERT(order <= 32);
|
||||
|
||||
for(i = 0; i < (int)data_len; i++) {
|
||||
sum = 0;
|
||||
switch(order) {
|
||||
case 32: sum += qlp_coeff[31] * data[i-32]; /* Falls through. */
|
||||
case 31: sum += qlp_coeff[30] * data[i-31]; /* Falls through. */
|
||||
case 30: sum += qlp_coeff[29] * data[i-30]; /* Falls through. */
|
||||
case 29: sum += qlp_coeff[28] * data[i-29]; /* Falls through. */
|
||||
case 28: sum += qlp_coeff[27] * data[i-28]; /* Falls through. */
|
||||
case 27: sum += qlp_coeff[26] * data[i-27]; /* Falls through. */
|
||||
case 26: sum += qlp_coeff[25] * data[i-26]; /* Falls through. */
|
||||
case 25: sum += qlp_coeff[24] * data[i-25]; /* Falls through. */
|
||||
case 24: sum += qlp_coeff[23] * data[i-24]; /* Falls through. */
|
||||
case 23: sum += qlp_coeff[22] * data[i-23]; /* Falls through. */
|
||||
case 22: sum += qlp_coeff[21] * data[i-22]; /* Falls through. */
|
||||
case 21: sum += qlp_coeff[20] * data[i-21]; /* Falls through. */
|
||||
case 20: sum += qlp_coeff[19] * data[i-20]; /* Falls through. */
|
||||
case 19: sum += qlp_coeff[18] * data[i-19]; /* Falls through. */
|
||||
case 18: sum += qlp_coeff[17] * data[i-18]; /* Falls through. */
|
||||
case 17: sum += qlp_coeff[16] * data[i-17]; /* Falls through. */
|
||||
case 16: sum += qlp_coeff[15] * data[i-16]; /* Falls through. */
|
||||
case 15: sum += qlp_coeff[14] * data[i-15]; /* Falls through. */
|
||||
case 14: sum += qlp_coeff[13] * data[i-14]; /* Falls through. */
|
||||
case 13: sum += qlp_coeff[12] * data[i-13]; /* Falls through. */
|
||||
case 12: sum += qlp_coeff[11] * data[i-12]; /* Falls through. */
|
||||
case 11: sum += qlp_coeff[10] * data[i-11]; /* Falls through. */
|
||||
case 10: sum += qlp_coeff[ 9] * data[i-10]; /* Falls through. */
|
||||
case 9: sum += qlp_coeff[ 8] * data[i- 9]; /* Falls through. */
|
||||
case 8: sum += qlp_coeff[ 7] * data[i- 8]; /* Falls through. */
|
||||
case 7: sum += qlp_coeff[ 6] * data[i- 7]; /* Falls through. */
|
||||
case 6: sum += qlp_coeff[ 5] * data[i- 6]; /* Falls through. */
|
||||
case 5: sum += qlp_coeff[ 4] * data[i- 5]; /* Falls through. */
|
||||
case 4: sum += qlp_coeff[ 3] * data[i- 4]; /* Falls through. */
|
||||
case 3: sum += qlp_coeff[ 2] * data[i- 3]; /* Falls through. */
|
||||
case 2: sum += qlp_coeff[ 1] * data[i- 2]; /* Falls through. */
|
||||
case 1: sum += qlp_coeff[ 0] * data[i- 1];
|
||||
}
|
||||
data[i] = residual[i] + (sum >> lp_quantization);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
#pragma warning ( default : 4028 )
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -139,7 +139,7 @@ static void FLAC__MD5Transform(FLAC__uint32 buf[4], FLAC__uint32 const in[16])
|
|||
//@@@@@@ OPT: use bswap/intrinsics
|
||||
static void byteSwap(FLAC__uint32 *buf, uint32_t words)
|
||||
{
|
||||
FLAC__uint32 x;
|
||||
register FLAC__uint32 x;
|
||||
do {
|
||||
x = *buf;
|
||||
x = ((x << 8) & 0xff00ff00) | ((x >> 8) & 0x00ff00ff);
|
||||
|
|
@ -148,7 +148,7 @@ static void byteSwap(FLAC__uint32 *buf, uint32_t words)
|
|||
}
|
||||
static void byteSwapX16(FLAC__uint32 *buf)
|
||||
{
|
||||
FLAC__uint32 x;
|
||||
register FLAC__uint32 x;
|
||||
|
||||
x = *buf; x = ((x << 8) & 0xff00ff00) | ((x >> 8) & 0x00ff00ff); *buf++ = (x >> 16) | (x << 16);
|
||||
x = *buf; x = ((x << 8) & 0xff00ff00) | ((x >> 8) & 0x00ff00ff); *buf++ = (x >> 16) | (x << 16);
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/* libFLAC - Free Lossless Audio Codec library
|
||||
* Copyright (C) 2001-2009 Josh Coalson
|
||||
* Copyright (C) 2011-2016 Xiph.Org Foundation
|
||||
* Copyright (C) 2011-2023 Xiph.Org Foundation
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
|
|
@ -34,9 +34,9 @@
|
|||
# include <config.h>
|
||||
#endif
|
||||
|
||||
//#ifdef HAVE_STDINT_H
|
||||
//#include <stdint.h>
|
||||
//#endif
|
||||
#ifdef HAVE_STDINT_H
|
||||
#include <stdint.h>
|
||||
#endif
|
||||
|
||||
#include "include/private/memory.h"
|
||||
#include "../assert.h"
|
||||
|
|
@ -118,6 +118,35 @@ FLAC__bool FLAC__memory_alloc_aligned_uint32_array(size_t elements, FLAC__uint32
|
|||
}
|
||||
}
|
||||
|
||||
FLAC__bool FLAC__memory_alloc_aligned_int64_array(size_t elements, FLAC__int64 **unaligned_pointer, FLAC__int64 **aligned_pointer)
|
||||
{
|
||||
FLAC__int64 *pu; /* unaligned pointer */
|
||||
union { /* union needed to comply with C99 pointer aliasing rules */
|
||||
FLAC__int64 *pa; /* aligned pointer */
|
||||
void *pv; /* aligned pointer alias */
|
||||
} u;
|
||||
|
||||
FLAC__ASSERT(elements > 0);
|
||||
FLAC__ASSERT(0 != unaligned_pointer);
|
||||
FLAC__ASSERT(0 != aligned_pointer);
|
||||
FLAC__ASSERT(unaligned_pointer != aligned_pointer);
|
||||
|
||||
if(elements > SIZE_MAX / sizeof(*pu)) /* overflow check */
|
||||
return false;
|
||||
|
||||
pu = (FLAC__int64*) FLAC__memory_alloc_aligned(sizeof(*pu) * elements, &u.pv);
|
||||
if(0 == pu) {
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
if(*unaligned_pointer != 0)
|
||||
free(*unaligned_pointer);
|
||||
*unaligned_pointer = pu;
|
||||
*aligned_pointer = u.pa;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
FLAC__bool FLAC__memory_alloc_aligned_uint64_array(size_t elements, FLAC__uint64 **unaligned_pointer, FLAC__uint64 **aligned_pointer)
|
||||
{
|
||||
FLAC__uint64 *pu; /* unaligned pointer */
|
||||
|
|
@ -147,35 +176,6 @@ FLAC__bool FLAC__memory_alloc_aligned_uint64_array(size_t elements, FLAC__uint64
|
|||
}
|
||||
}
|
||||
|
||||
FLAC__bool FLAC__memory_alloc_aligned_unsigned_array(size_t elements, uint32_t **unaligned_pointer, uint32_t **aligned_pointer)
|
||||
{
|
||||
uint32_t *pu; /* unaligned pointer */
|
||||
union { /* union needed to comply with C99 pointer aliasing rules */
|
||||
uint32_t *pa; /* aligned pointer */
|
||||
void *pv; /* aligned pointer alias */
|
||||
} u;
|
||||
|
||||
FLAC__ASSERT(elements > 0);
|
||||
FLAC__ASSERT(0 != unaligned_pointer);
|
||||
FLAC__ASSERT(0 != aligned_pointer);
|
||||
FLAC__ASSERT(unaligned_pointer != aligned_pointer);
|
||||
|
||||
if(elements > SIZE_MAX / sizeof(*pu)) /* overflow check */
|
||||
return false;
|
||||
|
||||
pu = (uint32_t*) FLAC__memory_alloc_aligned(sizeof(*pu) * elements, &u.pv);
|
||||
if(0 == pu) {
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
if(*unaligned_pointer != 0)
|
||||
free(*unaligned_pointer);
|
||||
*unaligned_pointer = pu;
|
||||
*aligned_pointer = u.pa;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
#ifndef FLAC__INTEGER_ONLY_LIBRARY
|
||||
|
||||
FLAC__bool FLAC__memory_alloc_aligned_real_array(size_t elements, FLAC__real **unaligned_pointer, FLAC__real **aligned_pointer)
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
|
@ -1,6 +1,6 @@
|
|||
/* libFLAC - Free Lossless Audio Codec library
|
||||
* Copyright (C) 2000-2009 Josh Coalson
|
||||
* Copyright (C) 2011-2016 Xiph.Org Foundation
|
||||
* Copyright (C) 2011-2023 Xiph.Org Foundation
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
|
|
@ -44,10 +44,13 @@
|
|||
static FLAC__bool add_entropy_coding_method_(FLAC__BitWriter *bw, const FLAC__EntropyCodingMethod *method);
|
||||
static FLAC__bool add_residual_partitioned_rice_(FLAC__BitWriter *bw, const FLAC__int32 residual[], const uint32_t residual_samples, const uint32_t predictor_order, const uint32_t rice_parameters[], const uint32_t raw_bits[], const uint32_t partition_order, const FLAC__bool is_extended);
|
||||
|
||||
FLAC__bool FLAC__add_metadata_block(const FLAC__StreamMetadata *metadata, FLAC__BitWriter *bw)
|
||||
FLAC__bool FLAC__add_metadata_block(const FLAC__StreamMetadata *metadata, FLAC__BitWriter *bw, FLAC__bool update_vendor_string)
|
||||
{
|
||||
uint32_t i, j;
|
||||
uint32_t i, j, metadata_length;
|
||||
const uint32_t vendor_string_length = (uint32_t)strlen(FLAC__VENDOR_STRING);
|
||||
const uint32_t start_bits = FLAC__bitwriter_get_input_bits_unconsumed(bw);
|
||||
|
||||
FLAC__ASSERT(FLAC__bitwriter_is_byte_aligned(bw));
|
||||
|
||||
if(!FLAC__bitwriter_write_raw_uint32(bw, metadata->is_last, FLAC__STREAM_METADATA_IS_LAST_LEN))
|
||||
return false;
|
||||
|
|
@ -58,17 +61,17 @@ FLAC__bool FLAC__add_metadata_block(const FLAC__StreamMetadata *metadata, FLAC__
|
|||
/*
|
||||
* First, for VORBIS_COMMENTs, adjust the length to reflect our vendor string
|
||||
*/
|
||||
i = metadata->length;
|
||||
if(metadata->type == FLAC__METADATA_TYPE_VORBIS_COMMENT) {
|
||||
metadata_length = metadata->length;
|
||||
if(metadata->type == FLAC__METADATA_TYPE_VORBIS_COMMENT && update_vendor_string) {
|
||||
FLAC__ASSERT(metadata->data.vorbis_comment.vendor_string.length == 0 || 0 != metadata->data.vorbis_comment.vendor_string.entry);
|
||||
i -= metadata->data.vorbis_comment.vendor_string.length;
|
||||
i += vendor_string_length;
|
||||
metadata_length -= metadata->data.vorbis_comment.vendor_string.length;
|
||||
metadata_length += vendor_string_length;
|
||||
}
|
||||
FLAC__ASSERT(i < (1u << FLAC__STREAM_METADATA_LENGTH_LEN));
|
||||
FLAC__ASSERT(metadata_length < (1u << FLAC__STREAM_METADATA_LENGTH_LEN));
|
||||
/* double protection */
|
||||
if(i >= (1u << FLAC__STREAM_METADATA_LENGTH_LEN))
|
||||
if(metadata_length >= (1u << FLAC__STREAM_METADATA_LENGTH_LEN))
|
||||
return false;
|
||||
if(!FLAC__bitwriter_write_raw_uint32(bw, i, FLAC__STREAM_METADATA_LENGTH_LEN))
|
||||
if(!FLAC__bitwriter_write_raw_uint32(bw, metadata_length, FLAC__STREAM_METADATA_LENGTH_LEN))
|
||||
return false;
|
||||
|
||||
switch(metadata->type) {
|
||||
|
|
@ -96,9 +99,13 @@ FLAC__bool FLAC__add_metadata_block(const FLAC__StreamMetadata *metadata, FLAC__
|
|||
FLAC__ASSERT(metadata->data.stream_info.bits_per_sample <= (1u << FLAC__STREAM_METADATA_STREAMINFO_BITS_PER_SAMPLE_LEN));
|
||||
if(!FLAC__bitwriter_write_raw_uint32(bw, metadata->data.stream_info.bits_per_sample-1, FLAC__STREAM_METADATA_STREAMINFO_BITS_PER_SAMPLE_LEN))
|
||||
return false;
|
||||
FLAC__ASSERT(metadata->data.stream_info.total_samples < (FLAC__U64L(1) << FLAC__STREAM_METADATA_STREAMINFO_TOTAL_SAMPLES_LEN));
|
||||
if(!FLAC__bitwriter_write_raw_uint64(bw, metadata->data.stream_info.total_samples, FLAC__STREAM_METADATA_STREAMINFO_TOTAL_SAMPLES_LEN))
|
||||
return false;
|
||||
if(metadata->data.stream_info.total_samples >= (FLAC__U64L(1) << FLAC__STREAM_METADATA_STREAMINFO_TOTAL_SAMPLES_LEN)){
|
||||
if(!FLAC__bitwriter_write_raw_uint64(bw, 0, FLAC__STREAM_METADATA_STREAMINFO_TOTAL_SAMPLES_LEN))
|
||||
return false;
|
||||
}else{
|
||||
if(!FLAC__bitwriter_write_raw_uint64(bw, metadata->data.stream_info.total_samples, FLAC__STREAM_METADATA_STREAMINFO_TOTAL_SAMPLES_LEN))
|
||||
return false;
|
||||
}
|
||||
if(!FLAC__bitwriter_write_byte_block(bw, metadata->data.stream_info.md5sum, 16))
|
||||
return false;
|
||||
break;
|
||||
|
|
@ -123,10 +130,18 @@ FLAC__bool FLAC__add_metadata_block(const FLAC__StreamMetadata *metadata, FLAC__
|
|||
}
|
||||
break;
|
||||
case FLAC__METADATA_TYPE_VORBIS_COMMENT:
|
||||
if(!FLAC__bitwriter_write_raw_uint32_little_endian(bw, vendor_string_length))
|
||||
return false;
|
||||
if(!FLAC__bitwriter_write_byte_block(bw, (const FLAC__byte*)FLAC__VENDOR_STRING, vendor_string_length))
|
||||
return false;
|
||||
if(update_vendor_string) {
|
||||
if(!FLAC__bitwriter_write_raw_uint32_little_endian(bw, vendor_string_length))
|
||||
return false;
|
||||
if(!FLAC__bitwriter_write_byte_block(bw, (const FLAC__byte*)FLAC__VENDOR_STRING, vendor_string_length))
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
if(!FLAC__bitwriter_write_raw_uint32_little_endian(bw, metadata->data.vorbis_comment.vendor_string.length))
|
||||
return false;
|
||||
if(!FLAC__bitwriter_write_byte_block(bw, metadata->data.vorbis_comment.vendor_string.entry, metadata->data.vorbis_comment.vendor_string.length))
|
||||
return false;
|
||||
}
|
||||
if(!FLAC__bitwriter_write_raw_uint32_little_endian(bw, metadata->data.vorbis_comment.num_comments))
|
||||
return false;
|
||||
for(i = 0; i < metadata->data.vorbis_comment.num_comments; i++) {
|
||||
|
|
@ -213,6 +228,16 @@ FLAC__bool FLAC__add_metadata_block(const FLAC__StreamMetadata *metadata, FLAC__
|
|||
break;
|
||||
}
|
||||
|
||||
/* Now check whether metadata block length was correct */
|
||||
{
|
||||
uint32_t length_in_bits = FLAC__bitwriter_get_input_bits_unconsumed(bw);
|
||||
if(length_in_bits < start_bits)
|
||||
return false;
|
||||
length_in_bits -= start_bits;
|
||||
if(length_in_bits % 8 != 0 || length_in_bits != (metadata_length*8+32))
|
||||
return false;
|
||||
}
|
||||
|
||||
FLAC__ASSERT(FLAC__bitwriter_is_byte_aligned(bw));
|
||||
return true;
|
||||
}
|
||||
|
|
@ -278,7 +303,7 @@ FLAC__bool FLAC__frame_add_header(const FLAC__FrameHeader *header, FLAC__BitWrit
|
|||
default:
|
||||
if(header->sample_rate <= 255000 && header->sample_rate % 1000 == 0)
|
||||
sample_rate_hint = u = 12;
|
||||
else if(header->sample_rate % 10 == 0)
|
||||
else if(header->sample_rate <= 655350 && header->sample_rate % 10 == 0)
|
||||
sample_rate_hint = u = 14;
|
||||
else if(header->sample_rate <= 0xffff)
|
||||
sample_rate_hint = u = 13;
|
||||
|
|
@ -319,6 +344,7 @@ FLAC__bool FLAC__frame_add_header(const FLAC__FrameHeader *header, FLAC__BitWrit
|
|||
case 16: u = 4; break;
|
||||
case 20: u = 5; break;
|
||||
case 24: u = 6; break;
|
||||
case 32: u = 7; break;
|
||||
default: u = 0; break;
|
||||
}
|
||||
if(!FLAC__bitwriter_write_raw_uint32(bw, u, FLAC__FRAME_HEADER_BITS_PER_SAMPLE_LEN))
|
||||
|
|
@ -371,7 +397,7 @@ FLAC__bool FLAC__subframe_add_constant(const FLAC__Subframe_Constant *subframe,
|
|||
ok =
|
||||
FLAC__bitwriter_write_raw_uint32(bw, FLAC__SUBFRAME_TYPE_CONSTANT_BYTE_ALIGNED_MASK | (wasted_bits? 1:0), FLAC__SUBFRAME_ZERO_PAD_LEN + FLAC__SUBFRAME_TYPE_LEN + FLAC__SUBFRAME_WASTED_BITS_FLAG_LEN) &&
|
||||
(wasted_bits? FLAC__bitwriter_write_unary_unsigned(bw, wasted_bits-1) : true) &&
|
||||
FLAC__bitwriter_write_raw_int32(bw, subframe->value, subframe_bps)
|
||||
FLAC__bitwriter_write_raw_int64(bw, subframe->value, subframe_bps)
|
||||
;
|
||||
|
||||
return ok;
|
||||
|
|
@ -388,7 +414,7 @@ FLAC__bool FLAC__subframe_add_fixed(const FLAC__Subframe_Fixed *subframe, uint32
|
|||
return false;
|
||||
|
||||
for(i = 0; i < subframe->order; i++)
|
||||
if(!FLAC__bitwriter_write_raw_int32(bw, subframe->warmup[i], subframe_bps))
|
||||
if(!FLAC__bitwriter_write_raw_int64(bw, subframe->warmup[i], subframe_bps))
|
||||
return false;
|
||||
|
||||
if(!add_entropy_coding_method_(bw, &subframe->entropy_coding_method))
|
||||
|
|
@ -426,7 +452,7 @@ FLAC__bool FLAC__subframe_add_lpc(const FLAC__Subframe_LPC *subframe, uint32_t r
|
|||
return false;
|
||||
|
||||
for(i = 0; i < subframe->order; i++)
|
||||
if(!FLAC__bitwriter_write_raw_int32(bw, subframe->warmup[i], subframe_bps))
|
||||
if(!FLAC__bitwriter_write_raw_int64(bw, subframe->warmup[i], subframe_bps))
|
||||
return false;
|
||||
|
||||
if(!FLAC__bitwriter_write_raw_uint32(bw, subframe->qlp_coeff_precision-1, FLAC__SUBFRAME_LPC_QLP_COEFF_PRECISION_LEN))
|
||||
|
|
@ -464,7 +490,6 @@ FLAC__bool FLAC__subframe_add_lpc(const FLAC__Subframe_LPC *subframe, uint32_t r
|
|||
FLAC__bool FLAC__subframe_add_verbatim(const FLAC__Subframe_Verbatim *subframe, uint32_t samples, uint32_t subframe_bps, uint32_t wasted_bits, FLAC__BitWriter *bw)
|
||||
{
|
||||
uint32_t i;
|
||||
const FLAC__int32 *signal = subframe->data;
|
||||
|
||||
if(!FLAC__bitwriter_write_raw_uint32(bw, FLAC__SUBFRAME_TYPE_VERBATIM_BYTE_ALIGNED_MASK | (wasted_bits? 1:0), FLAC__SUBFRAME_ZERO_PAD_LEN + FLAC__SUBFRAME_TYPE_LEN + FLAC__SUBFRAME_WASTED_BITS_FLAG_LEN))
|
||||
return false;
|
||||
|
|
@ -472,9 +497,24 @@ FLAC__bool FLAC__subframe_add_verbatim(const FLAC__Subframe_Verbatim *subframe,
|
|||
if(!FLAC__bitwriter_write_unary_unsigned(bw, wasted_bits-1))
|
||||
return false;
|
||||
|
||||
for(i = 0; i < samples; i++)
|
||||
if(!FLAC__bitwriter_write_raw_int32(bw, signal[i], subframe_bps))
|
||||
return false;
|
||||
if(subframe->data_type == FLAC__VERBATIM_SUBFRAME_DATA_TYPE_INT32) {
|
||||
const FLAC__int32 *signal = subframe->data.int32;
|
||||
|
||||
FLAC__ASSERT(subframe_bps < 33);
|
||||
|
||||
for(i = 0; i < samples; i++)
|
||||
if(!FLAC__bitwriter_write_raw_int32(bw, signal[i], subframe_bps))
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
const FLAC__int64 *signal = subframe->data.int64;
|
||||
|
||||
FLAC__ASSERT(subframe_bps == 33);
|
||||
|
||||
for(i = 0; i < samples; i++)
|
||||
if(!FLAC__bitwriter_write_raw_int64(bw, (FLAC__int64)signal[i], subframe_bps))
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/* libFLAC - Free Lossless Audio Codec library
|
||||
* Copyright (C) 2006-2009 Josh Coalson
|
||||
* Copyright (C) 2011-2016 Xiph.Org Foundation
|
||||
* Copyright (C) 2011-2023 Xiph.Org Foundation
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
|
|
@ -42,6 +42,10 @@
|
|||
|
||||
#ifndef FLAC__INTEGER_ONLY_LIBRARY
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
// silence 25 MSVC warnings 'conversion from 'double' to 'float', possible loss of data'
|
||||
#pragma warning ( disable : 4244 )
|
||||
#endif
|
||||
|
||||
void FLAC__window_bartlett(FLAC__real *window, const FLAC__int32 L)
|
||||
{
|
||||
|
|
@ -118,9 +122,15 @@ void FLAC__window_gauss(FLAC__real *window, const FLAC__int32 L, const FLAC__rea
|
|||
const double N2 = (double)N / 2.;
|
||||
FLAC__int32 n;
|
||||
|
||||
for (n = 0; n <= N; n++) {
|
||||
const double k = ((double)n - N2) / (stddev * N2);
|
||||
window[n] = (FLAC__real)exp(-0.5f * k * k);
|
||||
if(!(stddev > 0.0f && stddev <= 0.5f))
|
||||
/* stddev is not between 0 and 0.5, might be NaN.
|
||||
* Default to 0.5 */
|
||||
FLAC__window_gauss(window, L, 0.25f);
|
||||
else {
|
||||
for (n = 0; n <= N; n++) {
|
||||
const double k = ((double)n - N2) / (stddev * N2);
|
||||
window[n] = (FLAC__real)exp(-0.5f * k * k);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -192,6 +202,10 @@ void FLAC__window_tukey(FLAC__real *window, const FLAC__int32 L, const FLAC__rea
|
|||
FLAC__window_rectangle(window, L);
|
||||
else if (p >= 1.0)
|
||||
FLAC__window_hann(window, L);
|
||||
else if (!(p > 0.0f && p < 1.0f))
|
||||
/* p is not between 0 and 1, probably NaN.
|
||||
* Default to 0.5 */
|
||||
FLAC__window_tukey(window, L, 0.5f);
|
||||
else {
|
||||
const FLAC__int32 Np = (FLAC__int32)(p / 2.0f * L) - 1;
|
||||
FLAC__int32 n;
|
||||
|
|
@ -218,6 +232,10 @@ void FLAC__window_partial_tukey(FLAC__real *window, const FLAC__int32 L, const F
|
|||
FLAC__window_partial_tukey(window, L, 0.05f, start, end);
|
||||
else if (p >= 1.0f)
|
||||
FLAC__window_partial_tukey(window, L, 0.95f, start, end);
|
||||
else if (!(p > 0.0f && p < 1.0f))
|
||||
/* p is not between 0 and 1, probably NaN.
|
||||
* Default to 0.5 */
|
||||
FLAC__window_partial_tukey(window, L, 0.5f, start, end);
|
||||
else {
|
||||
|
||||
Np = (FLAC__int32)(p / 2.0f * N);
|
||||
|
|
@ -245,6 +263,10 @@ void FLAC__window_punchout_tukey(FLAC__real *window, const FLAC__int32 L, const
|
|||
FLAC__window_punchout_tukey(window, L, 0.05f, start, end);
|
||||
else if (p >= 1.0f)
|
||||
FLAC__window_punchout_tukey(window, L, 0.95f, start, end);
|
||||
else if (!(p > 0.0f && p < 1.0f))
|
||||
/* p is not between 0 and 1, probably NaN.
|
||||
* Default to 0.5 */
|
||||
FLAC__window_punchout_tukey(window, L, 0.5f, start, end);
|
||||
else {
|
||||
|
||||
Ns = (FLAC__int32)(p / 2.0f * start_n);
|
||||
|
|
@ -279,4 +301,8 @@ void FLAC__window_welch(FLAC__real *window, const FLAC__int32 L)
|
|||
}
|
||||
}
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
#pragma warning ( default : 4244 )
|
||||
#endif
|
||||
|
||||
#endif /* !defined FLAC__INTEGER_ONLY_LIBRARY */
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/* libFLAC - Free Lossless Audio Codec library
|
||||
* Copyright (C) 2001-2009 Josh Coalson
|
||||
* Copyright (C) 2011-2016 Xiph.Org Foundation
|
||||
* Copyright (C) 2011-2023 Xiph.Org Foundation
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
|
|
@ -33,6 +33,7 @@
|
|||
#ifndef FLAC__METADATA_H
|
||||
#define FLAC__METADATA_H
|
||||
|
||||
#include <sys/types.h> /* for off_t */
|
||||
#include "export.h"
|
||||
#include "callback.h"
|
||||
#include "format.h"
|
||||
|
|
@ -133,6 +134,11 @@ extern "C" {
|
|||
* STREAMINFO, VORBIS_COMMENT, CUESHEET, and PICTURE blocks, requiring
|
||||
* only a filename.
|
||||
*
|
||||
* On Windows, filename must be a UTF-8 encoded filename, which libFLAC
|
||||
* internally translates to an appropriate representation to use with
|
||||
* _wfopen. On all other systems, filename is passed to fopen without
|
||||
* any translation.
|
||||
*
|
||||
* They try to skip any ID3v2 tag at the head of the file.
|
||||
*
|
||||
* \{
|
||||
|
|
@ -386,6 +392,11 @@ FLAC_API FLAC__Metadata_SimpleIteratorStatus FLAC__metadata_simple_iterator_stat
|
|||
/** Initialize the iterator to point to the first metadata block in the
|
||||
* given FLAC file.
|
||||
*
|
||||
* On Windows, filename must be a UTF-8 encoded filename, which libFLAC
|
||||
* internally translates to an appropriate representation to use with
|
||||
* _wfopen. On all other systems, filename is passed to fopen without
|
||||
* any translation.
|
||||
*
|
||||
* \param iterator A pointer to an existing iterator.
|
||||
* \param filename The path to the FLAC file.
|
||||
* \param read_only If \c true, the FLAC file will be opened
|
||||
|
|
@ -499,7 +510,7 @@ FLAC_API FLAC__MetadataType FLAC__metadata_simple_iterator_get_block_type(const
|
|||
* \retval uint32_t
|
||||
* The length of the metadata block at the current iterator position.
|
||||
* The is same length as that in the
|
||||
* <a href="http://xiph.org/flac/format.html#metadata_block_header">metadata block header</a>,
|
||||
* <a href="http://xiph.org/flhttps://xiph.org/flac/format.html#metadata_block_header">metadata block header</a>,
|
||||
* i.e. the length of the metadata body that follows the header.
|
||||
*/
|
||||
FLAC_API uint32_t FLAC__metadata_simple_iterator_get_block_length(const FLAC__Metadata_SimpleIterator *iterator);
|
||||
|
|
@ -818,6 +829,11 @@ FLAC_API void FLAC__metadata_chain_delete(FLAC__Metadata_Chain *chain);
|
|||
FLAC_API FLAC__Metadata_ChainStatus FLAC__metadata_chain_status(FLAC__Metadata_Chain *chain);
|
||||
|
||||
/** Read all metadata from a FLAC file into the chain.
|
||||
*
|
||||
* On Windows, filename must be a UTF-8 encoded filename, which libFLAC
|
||||
* internally translates to an appropriate representation to use with
|
||||
* _wfopen. On all other systems, filename is passed to fopen without
|
||||
* any translation.
|
||||
*
|
||||
* \param chain A pointer to an existing chain.
|
||||
* \param filename The path to the FLAC file to read.
|
||||
|
|
@ -832,6 +848,11 @@ FLAC_API FLAC__Metadata_ChainStatus FLAC__metadata_chain_status(FLAC__Metadata_C
|
|||
FLAC_API FLAC__bool FLAC__metadata_chain_read(FLAC__Metadata_Chain *chain, const char *filename);
|
||||
|
||||
/** Read all metadata from an Ogg FLAC file into the chain.
|
||||
*
|
||||
* On Windows, filename must be a UTF-8 encoded filename, which libFLAC
|
||||
* internally translates to an appropriate representation to use with
|
||||
* _wfopen. On all other systems, filename is passed to fopen without
|
||||
* any translation.
|
||||
*
|
||||
* \note Ogg FLAC metadata data writing is not supported yet and
|
||||
* FLAC__metadata_chain_write() will fail.
|
||||
|
|
@ -1377,7 +1398,8 @@ FLAC_API FLAC__bool FLAC__metadata_object_application_set_data(FLAC__StreamMetad
|
|||
/** Resize the seekpoint array.
|
||||
*
|
||||
* If the size shrinks, elements will truncated; if it grows, new placeholder
|
||||
* points will be added to the end.
|
||||
* points will be added to the end. If this function returns false, the
|
||||
* object is left untouched.
|
||||
*
|
||||
* \param object A pointer to an existing SEEKTABLE object.
|
||||
* \param new_num_points The desired length of the array; may be \c 0.
|
||||
|
|
@ -1590,7 +1612,8 @@ FLAC_API FLAC__bool FLAC__metadata_object_vorbiscomment_set_vendor_string(FLAC__
|
|||
/** Resize the comment array.
|
||||
*
|
||||
* If the size shrinks, elements will truncated; if it grows, new empty
|
||||
* fields will be added to the end.
|
||||
* fields will be added to the end. If this function returns false, the
|
||||
* object is left untouched.
|
||||
*
|
||||
* \param object A pointer to an existing VORBIS_COMMENT object.
|
||||
* \param new_num_comments The desired length of the array; may be \c 0.
|
||||
|
|
@ -1870,7 +1893,8 @@ FLAC_API void FLAC__metadata_object_cuesheet_track_delete(FLAC__StreamMetadata_C
|
|||
/** Resize a track's index point array.
|
||||
*
|
||||
* If the size shrinks, elements will truncated; if it grows, new blank
|
||||
* indices will be added to the end.
|
||||
* indices will be added to the end. If this function returns false, the
|
||||
* track object is left untouched.
|
||||
*
|
||||
* \param object A pointer to an existing CUESHEET object.
|
||||
* \param track_num The index of the track to modify. NOTE: this is not
|
||||
|
|
@ -1956,7 +1980,8 @@ FLAC_API FLAC__bool FLAC__metadata_object_cuesheet_track_delete_index(FLAC__Stre
|
|||
/** Resize the track array.
|
||||
*
|
||||
* If the size shrinks, elements will truncated; if it grows, new blank
|
||||
* tracks will be added to the end.
|
||||
* tracks will be added to the end. If this function returns false, the
|
||||
* object is left untouched.
|
||||
*
|
||||
* \param object A pointer to an existing CUESHEET object.
|
||||
* \param new_num_tracks The desired length of the array; may be \c 0.
|
||||
|
|
@ -2172,6 +2197,34 @@ FLAC_API FLAC__bool FLAC__metadata_object_picture_set_data(FLAC__StreamMetadata
|
|||
*/
|
||||
FLAC_API FLAC__bool FLAC__metadata_object_picture_is_legal(const FLAC__StreamMetadata *object, const char **violation);
|
||||
|
||||
|
||||
/** Get the raw (binary) representation of a FLAC__StreamMetadata objeect.
|
||||
* After use, free() the returned buffer. The length of the buffer is
|
||||
* the length of the input metadata object plus 4 bytes for the header.
|
||||
*
|
||||
* \param object A pointer to metadata block to be converted.
|
||||
* \assert
|
||||
* \code object != NULL \endcode
|
||||
* \retval FLAC__byte*
|
||||
* \c NULL if there was an error, else a pointer to a buffer holding
|
||||
* the requested data.
|
||||
*/
|
||||
FLAC_API FLAC__byte * FLAC__metadata_object_get_raw(const FLAC__StreamMetadata *object);
|
||||
|
||||
|
||||
/** Turn a raw (binary) representation into a FLAC__StreamMetadata objeect.
|
||||
* The returned object must be deleted with FLAC__metadata_object_delete()
|
||||
* after use.
|
||||
*
|
||||
* \param buffer A pointer to a buffer containing a binary representation
|
||||
* to be converted to a FLAC__StreamMetadata object
|
||||
* \param length The length of the supplied buffer
|
||||
* \retval FLAC__StreamMetadata*
|
||||
* \c NULL if there was an error, else a pointer to a FLAC__StreamMetadata
|
||||
* holding the requested data.
|
||||
*/
|
||||
|
||||
FLAC_API FLAC__StreamMetadata * FLAC__metadata_object_set_raw(FLAC__byte *buffer, FLAC__uint32 length);
|
||||
/* \} */
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/* libFLAC - Free Lossless Audio Codec library
|
||||
* Copyright (C) 2000-2009 Josh Coalson
|
||||
* Copyright (C) 2011-2016 Xiph.Org Foundation
|
||||
* Copyright (C) 2011-2023 Xiph.Org Foundation
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
|
|
@ -33,26 +33,10 @@
|
|||
#ifndef FLAC__ORDINALS_H
|
||||
#define FLAC__ORDINALS_H
|
||||
|
||||
#if defined(_MSC_VER) && _MSC_VER < 1600
|
||||
/* This of course assumes C99 headers */
|
||||
|
||||
/* Microsoft Visual Studio earlier than the 2010 version did not provide
|
||||
* the 1999 ISO C Standard header file <stdint.h>.
|
||||
*/
|
||||
|
||||
typedef signed __int8 FLAC__int8;
|
||||
typedef signed __int16 FLAC__int16;
|
||||
typedef signed __int32 FLAC__int32;
|
||||
typedef signed __int64 FLAC__int64;
|
||||
typedef unsigned __int8 FLAC__uint8;
|
||||
typedef unsigned __int16 FLAC__uint16;
|
||||
typedef unsigned __int32 FLAC__uint32;
|
||||
typedef unsigned __int64 FLAC__uint64;
|
||||
|
||||
#else
|
||||
|
||||
/* For MSVC 2010 and everything else which provides <stdint.h>. */
|
||||
|
||||
//#include <stdint.h>
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
typedef int8_t FLAC__int8;
|
||||
typedef uint8_t FLAC__uint8;
|
||||
|
|
@ -64,22 +48,8 @@ typedef uint16_t FLAC__uint16;
|
|||
typedef uint32_t FLAC__uint32;
|
||||
typedef uint64_t FLAC__uint64;
|
||||
|
||||
#endif
|
||||
|
||||
typedef int FLAC__bool;
|
||||
|
||||
typedef FLAC__uint8 FLAC__byte;
|
||||
|
||||
|
||||
#ifdef true
|
||||
#undef true
|
||||
#endif
|
||||
#ifdef false
|
||||
#undef false
|
||||
#endif
|
||||
#ifndef __cplusplus
|
||||
#define true 1
|
||||
#define false 0
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/* libFLAC - Free Lossless Audio Codec library
|
||||
* Copyright (C) 2000-2009 Josh Coalson
|
||||
* Copyright (C) 2011-2016 Xiph.Org Foundation
|
||||
* Copyright (C) 2011-2023 Xiph.Org Foundation
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
|
|
@ -33,6 +33,7 @@
|
|||
#ifndef FLAC__STREAM_DECODER_H
|
||||
#define FLAC__STREAM_DECODER_H
|
||||
|
||||
#include <stdio.h> /* for FILE */
|
||||
#include "export.h"
|
||||
#include "format.h"
|
||||
|
||||
|
|
@ -421,7 +422,11 @@ extern FLAC_API const char * const FLAC__StreamDecoderWriteStatusString[];
|
|||
* could be because the decoder encountered a valid frame made by a future
|
||||
* version of the encoder which it cannot parse, or because of a false
|
||||
* sync making it appear as though an encountered frame was generated by
|
||||
* a future encoder.
|
||||
* a future encoder. \c FLAC__STREAM_DECODER_ERROR_STATUS_BAD_METADATA is
|
||||
* caused by finding data that doesn't fit a metadata block (too large
|
||||
* or too small) or finding inconsistencies in the metadata, for example
|
||||
* a PICTURE block with an image that exceeds the size of the metadata
|
||||
* block.
|
||||
*/
|
||||
typedef enum {
|
||||
|
||||
|
|
@ -434,9 +439,12 @@ typedef enum {
|
|||
FLAC__STREAM_DECODER_ERROR_STATUS_FRAME_CRC_MISMATCH,
|
||||
/**< The frame's data did not match the CRC in the footer. */
|
||||
|
||||
FLAC__STREAM_DECODER_ERROR_STATUS_UNPARSEABLE_STREAM
|
||||
FLAC__STREAM_DECODER_ERROR_STATUS_UNPARSEABLE_STREAM,
|
||||
/**< The decoder encountered reserved fields in use in the stream. */
|
||||
|
||||
FLAC__STREAM_DECODER_ERROR_STATUS_BAD_METADATA
|
||||
/**< The decoder encountered a corrupted metadata block. */
|
||||
|
||||
} FLAC__StreamDecoderErrorStatus;
|
||||
|
||||
/** Maps a FLAC__StreamDecoderErrorStatus to a C string.
|
||||
|
|
@ -673,7 +681,7 @@ typedef FLAC__bool (*FLAC__StreamDecoderEofCallback)(const FLAC__StreamDecoder *
|
|||
* samples of length \a frame->header.blocksize.
|
||||
* Channels will be ordered according to the FLAC
|
||||
* specification; see the documentation for the
|
||||
* <A HREF="../format.html#frame_header">frame header</A>.
|
||||
* <A HREF="https://xiph.org/flac/format.html#frame_header">frame header</A>.
|
||||
* \param client_data The callee's client data set through
|
||||
* FLAC__stream_decoder_init_*().
|
||||
* \retval FLAC__StreamDecoderWriteStatus
|
||||
|
|
@ -1005,6 +1013,16 @@ FLAC_API uint32_t FLAC__stream_decoder_get_blocksize(const FLAC__StreamDecoder *
|
|||
*/
|
||||
FLAC_API FLAC__bool FLAC__stream_decoder_get_decode_position(const FLAC__StreamDecoder *decoder, FLAC__uint64 *position);
|
||||
|
||||
/** Return client_data from decoder.
|
||||
* The data pointed to by the pointer should not be modified.
|
||||
*
|
||||
* \param decoder A decoder instance.
|
||||
* \retval const void *
|
||||
* The callee's client data set through FLAC__stream_decoder_init_*().
|
||||
* Do not modify the contents.
|
||||
*/
|
||||
FLAC_API const void *FLAC__stream_decoder_get_client_data(FLAC__StreamDecoder *decoder);
|
||||
|
||||
/** Initialize the decoder instance to decode native FLAC streams.
|
||||
*
|
||||
* This flavor of initialization sets up the decoder to decode from a
|
||||
|
|
@ -1262,11 +1280,15 @@ FLAC_API FLAC__StreamDecoderInitStatus FLAC__stream_decoder_init_ogg_FILE(
|
|||
/** Initialize the decoder instance to decode native FLAC files.
|
||||
*
|
||||
* This flavor of initialization sets up the decoder to decode from a plain
|
||||
* native FLAC file. If POSIX fopen() semantics are not sufficient, (for
|
||||
* example, with Unicode filenames on Windows), you must use
|
||||
* FLAC__stream_decoder_init_FILE(), or FLAC__stream_decoder_init_stream()
|
||||
* native FLAC file. If POSIX fopen() semantics are not sufficient, you must
|
||||
* use FLAC__stream_decoder_init_FILE(), or FLAC__stream_decoder_init_stream()
|
||||
* and provide callbacks for the I/O.
|
||||
*
|
||||
* On Windows, filename must be a UTF-8 encoded filename, which libFLAC
|
||||
* internally translates to an appropriate representation to use with
|
||||
* _wfopen. On all other systems, filename is passed to fopen without
|
||||
* any translation.
|
||||
*
|
||||
* This function should be called after FLAC__stream_decoder_new() and
|
||||
* FLAC__stream_decoder_set_*() but before any of the
|
||||
* FLAC__stream_decoder_process_*() functions. Will set and return the
|
||||
|
|
@ -1304,11 +1326,15 @@ FLAC_API FLAC__StreamDecoderInitStatus FLAC__stream_decoder_init_file(
|
|||
/** Initialize the decoder instance to decode Ogg FLAC files.
|
||||
*
|
||||
* This flavor of initialization sets up the decoder to decode from a plain
|
||||
* Ogg FLAC file. If POSIX fopen() semantics are not sufficient, (for
|
||||
* example, with Unicode filenames on Windows), you must use
|
||||
* Ogg FLAC file. If POSIX fopen() semantics are not sufficient, you must use
|
||||
* FLAC__stream_decoder_init_ogg_FILE(), or FLAC__stream_decoder_init_ogg_stream()
|
||||
* and provide callbacks for the I/O.
|
||||
*
|
||||
* On Windows, filename must be a UTF-8 encoded filename, which libFLAC
|
||||
* internally translates to an appropriate representation to use with
|
||||
* _wfopen. On all other systems, filename is passed to fopen without
|
||||
* any translation.
|
||||
*
|
||||
* This function should be called after FLAC__stream_decoder_new() and
|
||||
* FLAC__stream_decoder_set_*() but before any of the
|
||||
* FLAC__stream_decoder_process_*() functions. Will set and return the
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/* libFLAC - Free Lossless Audio Codec library
|
||||
* Copyright (C) 2000-2009 Josh Coalson
|
||||
* Copyright (C) 2011-2016 Xiph.Org Foundation
|
||||
* Copyright (C) 2011-2023 Xiph.Org Foundation
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
|
|
@ -33,6 +33,7 @@
|
|||
#ifndef FLAC__STREAM_ENCODER_H
|
||||
#define FLAC__STREAM_ENCODER_H
|
||||
|
||||
#include <stdio.h> /* for FILE */
|
||||
#include "export.h"
|
||||
#include "format.h"
|
||||
#include "stream_decoder.h"
|
||||
|
|
@ -128,8 +129,8 @@ extern "C" {
|
|||
* Unlike the decoders, the stream encoder has many options that can
|
||||
* affect the speed and compression ratio. When setting these parameters
|
||||
* you should have some basic knowledge of the format (see the
|
||||
* <A HREF="../documentation_format_overview.html">user-level documentation</A>
|
||||
* or the <A HREF="../format.html">formal description</A>). The
|
||||
* <A HREF="https://xiph.org/flac/documentation_format_overview.html">user-level documentation</A>
|
||||
* or the <A HREF="https://xiph.org/flac/format.html">formal description</A>). The
|
||||
* FLAC__stream_encoder_set_*() functions themselves do not validate the
|
||||
* values as many are interdependent. The FLAC__stream_encoder_init_*()
|
||||
* functions will do this, so make sure to pay attention to the state
|
||||
|
|
@ -310,8 +311,7 @@ typedef enum {
|
|||
|
||||
FLAC__STREAM_ENCODER_INIT_STATUS_INVALID_BITS_PER_SAMPLE,
|
||||
/**< The encoder has an invalid setting for bits-per-sample.
|
||||
* FLAC supports 4-32 bps but the reference encoder currently supports
|
||||
* only up to 24 bps.
|
||||
* FLAC supports 4-32 bps.
|
||||
*/
|
||||
|
||||
FLAC__STREAM_ENCODER_INIT_STATUS_INVALID_SAMPLE_RATE,
|
||||
|
|
@ -330,7 +330,7 @@ typedef enum {
|
|||
/**< The specified block size is less than the maximum LPC order. */
|
||||
|
||||
FLAC__STREAM_ENCODER_INIT_STATUS_NOT_STREAMABLE,
|
||||
/**< The encoder is bound to the <A HREF="../format.html#subset">Subset</A> but other settings violate it. */
|
||||
/**< The encoder is bound to the <A HREF="https://xiph.org/flac/format.html#subset">Subset</A> but other settings violate it. */
|
||||
|
||||
FLAC__STREAM_ENCODER_INIT_STATUS_INVALID_METADATA,
|
||||
/**< The metadata input to the encoder is invalid, in one of the following ways:
|
||||
|
|
@ -742,7 +742,7 @@ FLAC_API FLAC__bool FLAC__stream_encoder_set_ogg_serial_number(FLAC__StreamEncod
|
|||
*/
|
||||
FLAC_API FLAC__bool FLAC__stream_encoder_set_verify(FLAC__StreamEncoder *encoder, FLAC__bool value);
|
||||
|
||||
/** Set the <A HREF="../format.html#subset">Subset</A> flag. If \c true,
|
||||
/** Set the <A HREF="https://xiph.org/flac/format.html#subset">Subset</A> flag. If \c true,
|
||||
* the encoder will comply with the Subset and will check the
|
||||
* settings during FLAC__stream_encoder_init_*() to see if all settings
|
||||
* comply. If \c false, the settings may take advantage of the full
|
||||
|
|
@ -842,15 +842,15 @@ FLAC_API FLAC__bool FLAC__stream_encoder_set_sample_rate(FLAC__StreamEncoder *en
|
|||
* <td>max residual partition order</td>
|
||||
* <td>rice parameter search dist</td>
|
||||
* </tr>
|
||||
* <tr> <td><b>0</b></td> <td>false</td> <td>false</td> <td>tukey(0.5)<td> <td>0</td> <td>0</td> <td>false</td> <td>false</td> <td>false</td> <td>0</td> <td>3</td> <td>0</td> </tr>
|
||||
* <tr> <td><b>1</b></td> <td>true</td> <td>true</td> <td>tukey(0.5)<td> <td>0</td> <td>0</td> <td>false</td> <td>false</td> <td>false</td> <td>0</td> <td>3</td> <td>0</td> </tr>
|
||||
* <tr> <td><b>2</b></td> <td>true</td> <td>false</td> <td>tukey(0.5)<td> <td>0</td> <td>0</td> <td>false</td> <td>false</td> <td>false</td> <td>0</td> <td>3</td> <td>0</td> </tr>
|
||||
* <tr> <td><b>3</b></td> <td>false</td> <td>false</td> <td>tukey(0.5)<td> <td>6</td> <td>0</td> <td>false</td> <td>false</td> <td>false</td> <td>0</td> <td>4</td> <td>0</td> </tr>
|
||||
* <tr> <td><b>4</b></td> <td>true</td> <td>true</td> <td>tukey(0.5)<td> <td>8</td> <td>0</td> <td>false</td> <td>false</td> <td>false</td> <td>0</td> <td>4</td> <td>0</td> </tr>
|
||||
* <tr> <td><b>5</b></td> <td>true</td> <td>false</td> <td>tukey(0.5)<td> <td>8</td> <td>0</td> <td>false</td> <td>false</td> <td>false</td> <td>0</td> <td>5</td> <td>0</td> </tr>
|
||||
* <tr> <td><b>6</b></td> <td>true</td> <td>false</td> <td>tukey(0.5);partial_tukey(2)<td> <td>8</td> <td>0</td> <td>false</td> <td>false</td> <td>false</td> <td>0</td> <td>6</td> <td>0</td> </tr>
|
||||
* <tr> <td><b>7</b></td> <td>true</td> <td>false</td> <td>tukey(0.5);partial_tukey(2)<td> <td>12</td> <td>0</td> <td>false</td> <td>false</td> <td>false</td> <td>0</td> <td>6</td> <td>0</td> </tr>
|
||||
* <tr> <td><b>8</b></td> <td>true</td> <td>false</td> <td>tukey(0.5);partial_tukey(2);punchout_tukey(3)</td> <td>12</td> <td>0</td> <td>false</td> <td>false</td> <td>false</td> <td>0</td> <td>6</td> <td>0</td> </tr>
|
||||
* <tr> <td><b>0</b></td> <td>false</td> <td>false</td> <td>tukey(0.5)</td> <td>0</td> <td>0</td> <td>false</td> <td>false</td> <td>false</td> <td>0</td> <td>3</td> <td>0</td> </tr>
|
||||
* <tr> <td><b>1</b></td> <td>true</td> <td>true</td> <td>tukey(0.5)</td> <td>0</td> <td>0</td> <td>false</td> <td>false</td> <td>false</td> <td>0</td> <td>3</td> <td>0</td> </tr>
|
||||
* <tr> <td><b>2</b></td> <td>true</td> <td>false</td> <td>tukey(0.5)</td> <td>0</td> <td>0</td> <td>false</td> <td>false</td> <td>false</td> <td>0</td> <td>3</td> <td>0</td> </tr>
|
||||
* <tr> <td><b>3</b></td> <td>false</td> <td>false</td> <td>tukey(0.5)</td> <td>6</td> <td>0</td> <td>false</td> <td>false</td> <td>false</td> <td>0</td> <td>4</td> <td>0</td> </tr>
|
||||
* <tr> <td><b>4</b></td> <td>true</td> <td>true</td> <td>tukey(0.5)</td> <td>8</td> <td>0</td> <td>false</td> <td>false</td> <td>false</td> <td>0</td> <td>4</td> <td>0</td> </tr>
|
||||
* <tr> <td><b>5</b></td> <td>true</td> <td>false</td> <td>tukey(0.5)</td> <td>8</td> <td>0</td> <td>false</td> <td>false</td> <td>false</td> <td>0</td> <td>5</td> <td>0</td> </tr>
|
||||
* <tr> <td><b>6</b></td> <td>true</td> <td>false</td> <td>subdivide_tukey(2)</td> <td>8</td> <td>0</td> <td>false</td> <td>false</td> <td>false</td> <td>0</td> <td>6</td> <td>0</td> </tr>
|
||||
* <tr> <td><b>7</b></td> <td>true</td> <td>false</td> <td>subdivide_tukey(2)</td> <td>12</td> <td>0</td> <td>false</td> <td>false</td> <td>false</td> <td>0</td> <td>6</td> <td>0</td> </tr>
|
||||
* <tr> <td><b>8</b></td> <td>true</td> <td>false</td> <td>subdivide_tukey(3)</td> <td>12</td> <td>0</td> <td>false</td> <td>false</td> <td>false</td> <td>0</td> <td>6</td> <td>0</td> </tr>
|
||||
* </table>
|
||||
*
|
||||
* \default \c 5
|
||||
|
|
@ -920,7 +920,7 @@ FLAC_API FLAC__bool FLAC__stream_encoder_set_loose_mid_side_stereo(FLAC__StreamE
|
|||
* \c blackman, \c blackman_harris_4term_92db, \c connes, \c flattop,
|
||||
* \c gauss(STDDEV), \c hamming, \c hann, \c kaiser_bessel, \c nuttall,
|
||||
* \c rectangle, \c triangle, \c tukey(P), \c partial_tukey(n[/ov[/P]]),
|
||||
* \c punchout_tukey(n[/ov[/P]]), \c welch.
|
||||
* \c punchout_tukey(n[/ov[/P]]), \c subdivide_tukey(n[/P]), \c welch.
|
||||
*
|
||||
* For \c gauss(STDDEV), STDDEV specifies the standard deviation
|
||||
* (0<STDDEV<=0.5).
|
||||
|
|
@ -947,6 +947,20 @@ FLAC_API FLAC__bool FLAC__stream_encoder_set_loose_mid_side_stereo(FLAC__StreamE
|
|||
* and partial_tukey(3/0.3/0.5) are all valid. ov should be smaller than 1
|
||||
* and can be negative.
|
||||
*
|
||||
* subdivide_tukey(n) is a more efficient reimplementation of
|
||||
* partial_tukey and punchout_tukey taken together, recycling as much data
|
||||
* as possible. It combines all possible non-redundant partial_tukey(n)
|
||||
* and punchout_tukey(n) up to the n specified. Specifying
|
||||
* subdivide_tukey(3) is equivalent to specifying tukey, partial_tukey(2),
|
||||
* partial_tukey(3) and punchout_tukey(3), specifying subdivide_tukey(5)
|
||||
* equivalently adds partial_tukey(4), punchout_tukey(4), partial_tukey(5)
|
||||
* and punchout_tukey(5). To be able to reuse data as much as possible,
|
||||
* the tukey taper is taken equal for all windows, and the P specified is
|
||||
* applied for the smallest used window. In other words,
|
||||
* subdivide_tukey(2/0.5) results in a taper equal to that of tukey(0.25)
|
||||
* and subdivide_tukey(5) in a taper equal to that of tukey(0.1). The
|
||||
* default P for subdivide_tukey when none is specified is 0.5.
|
||||
*
|
||||
* Example specifications are \c "blackman" or
|
||||
* \c "hann;triangle;tukey(0.5);tukey(0.25);tukey(0.125)"
|
||||
*
|
||||
|
|
@ -962,6 +976,8 @@ FLAC_API FLAC__bool FLAC__stream_encoder_set_loose_mid_side_stereo(FLAC__StreamE
|
|||
* floating point array in which to store the window. Also note that the
|
||||
* values of P, STDDEV and ov are locale-specific, so if the comma
|
||||
* separator specified by the locale is a comma, a comma should be used.
|
||||
* A locale-independent way is to specify using scientific notation,
|
||||
* e.g. 5e-1 instad of 0.5 or 0,5.
|
||||
*
|
||||
* \default \c "tukey(0.5)"
|
||||
* \param encoder An encoder instance to set.
|
||||
|
|
@ -990,10 +1006,6 @@ FLAC_API FLAC__bool FLAC__stream_encoder_set_max_lpc_order(FLAC__StreamEncoder *
|
|||
* coefficients, or \c 0 to let the encoder select it based on the
|
||||
* blocksize.
|
||||
*
|
||||
* \note
|
||||
* In the current implementation, qlp_coeff_precision + bits_per_sample must
|
||||
* be less than 32.
|
||||
*
|
||||
* \default \c 0
|
||||
* \param encoder An encoder instance to set.
|
||||
* \param value See above.
|
||||
|
|
@ -1201,6 +1213,24 @@ FLAC_API FLAC__bool FLAC__stream_encoder_set_total_samples_estimate(FLAC__Stream
|
|||
*/
|
||||
FLAC_API FLAC__bool FLAC__stream_encoder_set_metadata(FLAC__StreamEncoder *encoder, FLAC__StreamMetadata **metadata, uint32_t num_blocks);
|
||||
|
||||
/** Set to \c true to make the encoder not output frames which contain
|
||||
* only constant subframes. This is beneficial for streaming
|
||||
* applications: very small frames can cause problems with buffering
|
||||
* as bitrates can drop as low 1kbit/s for CDDA audio encoded within
|
||||
* subset. The minimum bitrate for a FLAC file encoded with this
|
||||
* function used is raised to 1bit/sample (i.e. 48kbit/s for 48kHz
|
||||
* material).
|
||||
*
|
||||
* \default \c false
|
||||
* \param encoder An encoder instance to set.
|
||||
* \param value Flag value (see above).
|
||||
* \assert
|
||||
* \code encoder != NULL \endcode
|
||||
* \retval FLAC__bool
|
||||
* \c false if the encoder is already initialized, else \c true.
|
||||
*/
|
||||
FLAC_API FLAC__bool FLAC__stream_encoder_set_limit_min_bitrate(FLAC__StreamEncoder *encoder, FLAC__bool value);
|
||||
|
||||
/** Get the current encoder state.
|
||||
*
|
||||
* \param encoder An encoder instance to query.
|
||||
|
|
@ -1265,7 +1295,7 @@ FLAC_API void FLAC__stream_encoder_get_verify_decoder_error_stats(const FLAC__St
|
|||
*/
|
||||
FLAC_API FLAC__bool FLAC__stream_encoder_get_verify(const FLAC__StreamEncoder *encoder);
|
||||
|
||||
/** Get the <A HREF="../format.html#subset>Subset</A> flag.
|
||||
/** Get the <A HREF="https://xiph.org/flac/format.html#subset">Subset</A> flag.
|
||||
*
|
||||
* \param encoder An encoder instance to query.
|
||||
* \assert
|
||||
|
|
@ -1428,6 +1458,16 @@ FLAC_API uint32_t FLAC__stream_encoder_get_rice_parameter_search_dist(const FLAC
|
|||
*/
|
||||
FLAC_API FLAC__uint64 FLAC__stream_encoder_get_total_samples_estimate(const FLAC__StreamEncoder *encoder);
|
||||
|
||||
/** Get the "limit_min_bitrate" flag.
|
||||
*
|
||||
* \param encoder An encoder instance to query.
|
||||
* \assert
|
||||
* \code encoder != NULL \endcode
|
||||
* \retval FLAC__bool
|
||||
* See FLAC__stream_encoder_set_limit_min_bitrate().
|
||||
*/
|
||||
FLAC_API FLAC__bool FLAC__stream_encoder_get_limit_min_bitrate(const FLAC__StreamEncoder *encoder);
|
||||
|
||||
/** Initialize the encoder instance to encode native FLAC streams.
|
||||
*
|
||||
* This flavor of initialization sets up the encoder to encode to a
|
||||
|
|
@ -1632,11 +1672,15 @@ FLAC_API FLAC__StreamEncoderInitStatus FLAC__stream_encoder_init_ogg_FILE(FLAC__
|
|||
/** Initialize the encoder instance to encode native FLAC files.
|
||||
*
|
||||
* This flavor of initialization sets up the encoder to encode to a plain
|
||||
* FLAC file. If POSIX fopen() semantics are not sufficient (for example,
|
||||
* with Unicode filenames on Windows), you must use
|
||||
* FLAC file. If POSIX fopen() semantics are not sufficient you must use
|
||||
* FLAC__stream_encoder_init_FILE(), or FLAC__stream_encoder_init_stream()
|
||||
* and provide callbacks for the I/O.
|
||||
*
|
||||
* On Windows, filename must be a UTF-8 encoded filename, which libFLAC
|
||||
* internally translates to an appropriate representation to use with
|
||||
* _wfopen. On all other systems, filename is passed to fopen without
|
||||
* any translation.
|
||||
*
|
||||
* This function should be called after FLAC__stream_encoder_new() and
|
||||
* FLAC__stream_encoder_set_*() but before FLAC__stream_encoder_process()
|
||||
* or FLAC__stream_encoder_process_interleaved().
|
||||
|
|
@ -1664,11 +1708,15 @@ FLAC_API FLAC__StreamEncoderInitStatus FLAC__stream_encoder_init_file(FLAC__Stre
|
|||
/** Initialize the encoder instance to encode Ogg FLAC files.
|
||||
*
|
||||
* This flavor of initialization sets up the encoder to encode to a plain
|
||||
* Ogg FLAC file. If POSIX fopen() semantics are not sufficient (for example,
|
||||
* with Unicode filenames on Windows), you must use
|
||||
* Ogg FLAC file. If POSIX fopen() semantics are not sufficient, you must use
|
||||
* FLAC__stream_encoder_init_ogg_FILE(), or FLAC__stream_encoder_init_ogg_stream()
|
||||
* and provide callbacks for the I/O.
|
||||
*
|
||||
* On Windows, filename must be a UTF-8 encoded filename, which libFLAC
|
||||
* internally translates to an appropriate representation to use with
|
||||
* _wfopen. On all other systems, filename is passed to fopen without
|
||||
* any translation.
|
||||
*
|
||||
* This function should be called after FLAC__stream_encoder_new() and
|
||||
* FLAC__stream_encoder_set_*() but before FLAC__stream_encoder_process()
|
||||
* or FLAC__stream_encoder_process_interleaved().
|
||||
|
|
@ -1733,7 +1781,7 @@ FLAC_API FLAC__bool FLAC__stream_encoder_finish(FLAC__StreamEncoder *encoder);
|
|||
*
|
||||
* For applications where channel order is important, channels must
|
||||
* follow the order as described in the
|
||||
* <A HREF="../format.html#frame_header">frame header</A>.
|
||||
* <A HREF="https://xiph.org/flac/format.html#frame_header">frame header</A>.
|
||||
*
|
||||
* \param encoder An initialized encoder instance in the OK state.
|
||||
* \param buffer An array of pointers to each channel's signal.
|
||||
|
|
@ -1762,7 +1810,7 @@ FLAC_API FLAC__bool FLAC__stream_encoder_process(FLAC__StreamEncoder *encoder, c
|
|||
*
|
||||
* For applications where channel order is important, channels must
|
||||
* follow the order as described in the
|
||||
* <A HREF="../format.html#frame_header">frame header</A>.
|
||||
* <A HREF="https://xiph.org/flac/format.html#frame_header">frame header</A>.
|
||||
*
|
||||
* \param encoder An initialized encoder instance in the OK state.
|
||||
* \param buffer An array of channel-interleaved data (see above).
|
||||
|
|
|
|||
|
|
@ -1,454 +0,0 @@
|
|||
/* libFLAC - Free Lossless Audio Codec library
|
||||
* Copyright (C) 2000-2009 Josh Coalson
|
||||
* Copyright (C) 2011-2023 Xiph.Org Foundation
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* - Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* - Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* - Neither the name of the Xiph.org Foundation nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef FLAC__ALL_H
|
||||
#define FLAC__ALL_H
|
||||
|
||||
#ifndef FLAC__HAS_OGG
|
||||
#define FLAC__HAS_OGG 0
|
||||
#endif
|
||||
|
||||
#include "export.h"
|
||||
|
||||
#include "assert.h"
|
||||
#include "callback.h"
|
||||
#include "format.h"
|
||||
#include "metadata.h"
|
||||
#include "ordinals.h"
|
||||
#include "stream_decoder.h"
|
||||
#include "stream_encoder.h"
|
||||
|
||||
/** \mainpage
|
||||
*
|
||||
* \section intro Introduction
|
||||
*
|
||||
* This is the documentation for the FLAC C and C++ APIs. It is
|
||||
* highly interconnected; this introduction should give you a top
|
||||
* level idea of the structure and how to find the information you
|
||||
* need. As a prerequisite you should have at least a basic
|
||||
* knowledge of the FLAC format, documented
|
||||
* <A HREF="https://xiph.org/flac/format.html">here</A>.
|
||||
*
|
||||
* \section c_api FLAC C API
|
||||
*
|
||||
* The FLAC C API is the interface to libFLAC, a set of structures
|
||||
* describing the components of FLAC streams, and functions for
|
||||
* encoding and decoding streams, as well as manipulating FLAC
|
||||
* metadata in files. The public include files will be installed
|
||||
* in your include area (for example /usr/include/FLAC/...).
|
||||
*
|
||||
* By writing a little code and linking against libFLAC, it is
|
||||
* relatively easy to add FLAC support to another program. The
|
||||
* library is licensed under <A HREF="https://xiph.org/flac/license.html">Xiph's BSD license</A>.
|
||||
* Complete source code of libFLAC as well as the command-line
|
||||
* encoder and plugins is available and is a useful source of
|
||||
* examples.
|
||||
*
|
||||
* Aside from encoders and decoders, libFLAC provides a powerful
|
||||
* metadata interface for manipulating metadata in FLAC files. It
|
||||
* allows the user to add, delete, and modify FLAC metadata blocks
|
||||
* and it can automatically take advantage of PADDING blocks to avoid
|
||||
* rewriting the entire FLAC file when changing the size of the
|
||||
* metadata.
|
||||
*
|
||||
* libFLAC usually only requires the standard C library and C math
|
||||
* library. In particular, threading is not used so there is no
|
||||
* dependency on a thread library. However, libFLAC does not use
|
||||
* global variables and should be thread-safe.
|
||||
*
|
||||
* libFLAC also supports encoding to and decoding from Ogg FLAC.
|
||||
* However the metadata editing interfaces currently have limited
|
||||
* read-only support for Ogg FLAC files.
|
||||
*
|
||||
* \section cpp_api FLAC C++ API
|
||||
*
|
||||
* The FLAC C++ API is a set of classes that encapsulate the
|
||||
* structures and functions in libFLAC. They provide slightly more
|
||||
* functionality with respect to metadata but are otherwise
|
||||
* equivalent. For the most part, they share the same usage as
|
||||
* their counterparts in libFLAC, and the FLAC C API documentation
|
||||
* can be used as a supplement. The public include files
|
||||
* for the C++ API will be installed in your include area (for
|
||||
* example /usr/include/FLAC++/...).
|
||||
*
|
||||
* libFLAC++ is also licensed under
|
||||
* <A HREF="https://xiph.org/flac/license.html">Xiph's BSD license</A>.
|
||||
*
|
||||
* \section getting_started Getting Started
|
||||
*
|
||||
* A good starting point for learning the API is to browse through
|
||||
* the <A HREF="modules.html">modules</A>. Modules are logical
|
||||
* groupings of related functions or classes, which correspond roughly
|
||||
* to header files or sections of header files. Each module includes a
|
||||
* detailed description of the general usage of its functions or
|
||||
* classes.
|
||||
*
|
||||
* From there you can go on to look at the documentation of
|
||||
* individual functions. You can see different views of the individual
|
||||
* functions through the links in top bar across this page.
|
||||
*
|
||||
* If you prefer a more hands-on approach, you can jump right to some
|
||||
* <A HREF="https://xiph.org/flac/documentation_example_code.html">example code</A>.
|
||||
*
|
||||
* \section porting_guide Porting Guide
|
||||
*
|
||||
* Starting with FLAC 1.1.3 a \link porting Porting Guide \endlink
|
||||
* has been introduced which gives detailed instructions on how to
|
||||
* port your code to newer versions of FLAC.
|
||||
*
|
||||
* \section embedded_developers Embedded Developers
|
||||
*
|
||||
* libFLAC has grown larger over time as more functionality has been
|
||||
* included, but much of it may be unnecessary for a particular embedded
|
||||
* implementation. Unused parts may be pruned by some simple editing of
|
||||
* src/libFLAC/Makefile.am. In general, the decoders, encoders, and
|
||||
* metadata interface are all independent from each other.
|
||||
*
|
||||
* It is easiest to just describe the dependencies:
|
||||
*
|
||||
* - All modules depend on the \link flac_format Format \endlink module.
|
||||
* - The decoders and encoders depend on the bitbuffer.
|
||||
* - The decoder is independent of the encoder. The encoder uses the
|
||||
* decoder because of the verify feature, but this can be removed if
|
||||
* not needed.
|
||||
* - Parts of the metadata interface require the stream decoder (but not
|
||||
* the encoder).
|
||||
* - Ogg support is selectable through the compile time macro
|
||||
* \c FLAC__HAS_OGG.
|
||||
*
|
||||
* For example, if your application only requires the stream decoder, no
|
||||
* encoder, and no metadata interface, you can remove the stream encoder
|
||||
* and the metadata interface, which will greatly reduce the size of the
|
||||
* library.
|
||||
*
|
||||
* Also, there are several places in the libFLAC code with comments marked
|
||||
* with "OPT:" where a \#define can be changed to enable code that might be
|
||||
* faster on a specific platform. Experimenting with these can yield faster
|
||||
* binaries.
|
||||
*/
|
||||
|
||||
/** \defgroup porting Porting Guide for New Versions
|
||||
*
|
||||
* This module describes differences in the library interfaces from
|
||||
* version to version. It assists in the porting of code that uses
|
||||
* the libraries to newer versions of FLAC.
|
||||
*
|
||||
* One simple facility for making porting easier that has been added
|
||||
* in FLAC 1.1.3 is a set of \#defines in \c export.h of each
|
||||
* library's includes (e.g. \c include/FLAC/export.h). The
|
||||
* \#defines mirror the libraries'
|
||||
* <A HREF="http://www.gnu.org/software/libtool/manual/libtool.html#Libtool-versioning">libtool version numbers</A>,
|
||||
* e.g. in libFLAC there are \c FLAC_API_VERSION_CURRENT,
|
||||
* \c FLAC_API_VERSION_REVISION, and \c FLAC_API_VERSION_AGE.
|
||||
* These can be used to support multiple versions of an API during the
|
||||
* transition phase, e.g.
|
||||
*
|
||||
* \code
|
||||
* #if !defined(FLAC_API_VERSION_CURRENT) || FLAC_API_VERSION_CURRENT <= 7
|
||||
* legacy code
|
||||
* #else
|
||||
* new code
|
||||
* #endif
|
||||
* \endcode
|
||||
*
|
||||
* The source will work for multiple versions and the legacy code can
|
||||
* easily be removed when the transition is complete.
|
||||
*
|
||||
* Another available symbol is FLAC_API_SUPPORTS_OGG_FLAC (defined in
|
||||
* include/FLAC/export.h), which can be used to determine whether or not
|
||||
* the library has been compiled with support for Ogg FLAC. This is
|
||||
* simpler than trying to call an Ogg init function and catching the
|
||||
* error.
|
||||
*/
|
||||
|
||||
/** \defgroup porting_1_1_2_to_1_1_3 Porting from FLAC 1.1.2 to 1.1.3
|
||||
* \ingroup porting
|
||||
*
|
||||
* \brief
|
||||
* This module describes porting from FLAC 1.1.2 to FLAC 1.1.3.
|
||||
*
|
||||
* The main change between the APIs in 1.1.2 and 1.1.3 is that they have
|
||||
* been simplified. First, libOggFLAC has been merged into libFLAC and
|
||||
* libOggFLAC++ has been merged into libFLAC++. Second, both the three
|
||||
* decoding layers and three encoding layers have been merged into a
|
||||
* single stream decoder and stream encoder. That is, the functionality
|
||||
* of FLAC__SeekableStreamDecoder and FLAC__FileDecoder has been merged
|
||||
* into FLAC__StreamDecoder, and FLAC__SeekableStreamEncoder and
|
||||
* FLAC__FileEncoder into FLAC__StreamEncoder. Only the
|
||||
* FLAC__StreamDecoder and FLAC__StreamEncoder remain. What this means
|
||||
* is there is now a single API that can be used to encode or decode
|
||||
* streams to/from native FLAC or Ogg FLAC and the single API can work
|
||||
* on both seekable and non-seekable streams.
|
||||
*
|
||||
* Instead of creating an encoder or decoder of a certain layer, now the
|
||||
* client will always create a FLAC__StreamEncoder or
|
||||
* FLAC__StreamDecoder. The old layers are now differentiated by the
|
||||
* initialization function. For example, for the decoder,
|
||||
* FLAC__stream_decoder_init() has been replaced by
|
||||
* FLAC__stream_decoder_init_stream(). This init function takes
|
||||
* callbacks for the I/O, and the seeking callbacks are optional. This
|
||||
* allows the client to use the same object for seekable and
|
||||
* non-seekable streams. For decoding a FLAC file directly, the client
|
||||
* can use FLAC__stream_decoder_init_file() and pass just a filename
|
||||
* and fewer callbacks; most of the other callbacks are supplied
|
||||
* internally. For situations where fopen()ing by filename is not
|
||||
* possible (e.g. Unicode filenames on Windows) the client can instead
|
||||
* open the file itself and supply the FILE* to
|
||||
* FLAC__stream_decoder_init_FILE(). The init functions now returns a
|
||||
* FLAC__StreamDecoderInitStatus instead of FLAC__StreamDecoderState.
|
||||
* Since the callbacks and client data are now passed to the init
|
||||
* function, the FLAC__stream_decoder_set_*_callback() functions and
|
||||
* FLAC__stream_decoder_set_client_data() are no longer needed. The
|
||||
* rest of the calls to the decoder are the same as before.
|
||||
*
|
||||
* There are counterpart init functions for Ogg FLAC, e.g.
|
||||
* FLAC__stream_decoder_init_ogg_stream(). All the rest of the calls
|
||||
* and callbacks are the same as for native FLAC.
|
||||
*
|
||||
* As an example, in FLAC 1.1.2 a seekable stream decoder would have
|
||||
* been set up like so:
|
||||
*
|
||||
* \code
|
||||
* FLAC__SeekableStreamDecoder *decoder = FLAC__seekable_stream_decoder_new();
|
||||
* if(decoder == NULL) do_something;
|
||||
* FLAC__seekable_stream_decoder_set_md5_checking(decoder, true);
|
||||
* [... other settings ...]
|
||||
* FLAC__seekable_stream_decoder_set_read_callback(decoder, my_read_callback);
|
||||
* FLAC__seekable_stream_decoder_set_seek_callback(decoder, my_seek_callback);
|
||||
* FLAC__seekable_stream_decoder_set_tell_callback(decoder, my_tell_callback);
|
||||
* FLAC__seekable_stream_decoder_set_length_callback(decoder, my_length_callback);
|
||||
* FLAC__seekable_stream_decoder_set_eof_callback(decoder, my_eof_callback);
|
||||
* FLAC__seekable_stream_decoder_set_write_callback(decoder, my_write_callback);
|
||||
* FLAC__seekable_stream_decoder_set_metadata_callback(decoder, my_metadata_callback);
|
||||
* FLAC__seekable_stream_decoder_set_error_callback(decoder, my_error_callback);
|
||||
* FLAC__seekable_stream_decoder_set_client_data(decoder, my_client_data);
|
||||
* if(FLAC__seekable_stream_decoder_init(decoder) != FLAC__SEEKABLE_STREAM_DECODER_OK) do_something;
|
||||
* \endcode
|
||||
*
|
||||
* In FLAC 1.1.3 it is like this:
|
||||
*
|
||||
* \code
|
||||
* FLAC__StreamDecoder *decoder = FLAC__stream_decoder_new();
|
||||
* if(decoder == NULL) do_something;
|
||||
* FLAC__stream_decoder_set_md5_checking(decoder, true);
|
||||
* [... other settings ...]
|
||||
* if(FLAC__stream_decoder_init_stream(
|
||||
* decoder,
|
||||
* my_read_callback,
|
||||
* my_seek_callback, // or NULL
|
||||
* my_tell_callback, // or NULL
|
||||
* my_length_callback, // or NULL
|
||||
* my_eof_callback, // or NULL
|
||||
* my_write_callback,
|
||||
* my_metadata_callback, // or NULL
|
||||
* my_error_callback,
|
||||
* my_client_data
|
||||
* ) != FLAC__STREAM_DECODER_INIT_STATUS_OK) do_something;
|
||||
* \endcode
|
||||
*
|
||||
* or you could do;
|
||||
*
|
||||
* \code
|
||||
* [...]
|
||||
* FILE *file = fopen("somefile.flac","rb");
|
||||
* if(file == NULL) do_somthing;
|
||||
* if(FLAC__stream_decoder_init_FILE(
|
||||
* decoder,
|
||||
* file,
|
||||
* my_write_callback,
|
||||
* my_metadata_callback, // or NULL
|
||||
* my_error_callback,
|
||||
* my_client_data
|
||||
* ) != FLAC__STREAM_DECODER_INIT_STATUS_OK) do_something;
|
||||
* \endcode
|
||||
*
|
||||
* or just:
|
||||
*
|
||||
* \code
|
||||
* [...]
|
||||
* if(FLAC__stream_decoder_init_file(
|
||||
* decoder,
|
||||
* "somefile.flac",
|
||||
* my_write_callback,
|
||||
* my_metadata_callback, // or NULL
|
||||
* my_error_callback,
|
||||
* my_client_data
|
||||
* ) != FLAC__STREAM_DECODER_INIT_STATUS_OK) do_something;
|
||||
* \endcode
|
||||
*
|
||||
* Another small change to the decoder is in how it handles unparseable
|
||||
* streams. Before, when the decoder found an unparseable stream
|
||||
* (reserved for when the decoder encounters a stream from a future
|
||||
* encoder that it can't parse), it changed the state to
|
||||
* \c FLAC__STREAM_DECODER_UNPARSEABLE_STREAM. Now the decoder instead
|
||||
* drops sync and calls the error callback with a new error code
|
||||
* \c FLAC__STREAM_DECODER_ERROR_STATUS_UNPARSEABLE_STREAM. This is
|
||||
* more robust. If your error callback does not discriminate on the the
|
||||
* error state, your code does not need to be changed.
|
||||
*
|
||||
* The encoder now has a new setting:
|
||||
* FLAC__stream_encoder_set_apodization(). This is for setting the
|
||||
* method used to window the data before LPC analysis. You only need to
|
||||
* add a call to this function if the default is not suitable. There
|
||||
* are also two new convenience functions that may be useful:
|
||||
* FLAC__metadata_object_cuesheet_calculate_cddb_id() and
|
||||
* FLAC__metadata_get_cuesheet().
|
||||
*
|
||||
* The \a bytes parameter to FLAC__StreamDecoderReadCallback,
|
||||
* FLAC__StreamEncoderReadCallback, and FLAC__StreamEncoderWriteCallback
|
||||
* is now \c size_t instead of \c uint32_t.
|
||||
*/
|
||||
|
||||
/** \defgroup porting_1_1_3_to_1_1_4 Porting from FLAC 1.1.3 to 1.1.4
|
||||
* \ingroup porting
|
||||
*
|
||||
* \brief
|
||||
* This module describes porting from FLAC 1.1.3 to FLAC 1.1.4.
|
||||
*
|
||||
* There were no changes to any of the interfaces from 1.1.3 to 1.1.4.
|
||||
* There was a slight change in the implementation of
|
||||
* FLAC__stream_encoder_set_metadata(); the function now makes a copy
|
||||
* of the \a metadata array of pointers so the client no longer needs
|
||||
* to maintain it after the call. The objects themselves that are
|
||||
* pointed to by the array are still not copied though and must be
|
||||
* maintained until the call to FLAC__stream_encoder_finish().
|
||||
*/
|
||||
|
||||
/** \defgroup porting_1_1_4_to_1_2_0 Porting from FLAC 1.1.4 to 1.2.0
|
||||
* \ingroup porting
|
||||
*
|
||||
* \brief
|
||||
* This module describes porting from FLAC 1.1.4 to FLAC 1.2.0.
|
||||
*
|
||||
* There were only very minor changes to the interfaces from 1.1.4 to 1.2.0.
|
||||
* In libFLAC, \c FLAC__format_sample_rate_is_subset() was added.
|
||||
* In libFLAC++, \c FLAC::Decoder::Stream::get_decode_position() was added.
|
||||
*
|
||||
* Finally, value of the constant \c FLAC__FRAME_HEADER_RESERVED_LEN
|
||||
* has changed to reflect the conversion of one of the reserved bits
|
||||
* into active use. It used to be \c 2 and now is \c 1. However the
|
||||
* FLAC frame header length has not changed, so to skip the proper
|
||||
* number of bits, use \c FLAC__FRAME_HEADER_RESERVED_LEN +
|
||||
* \c FLAC__FRAME_HEADER_BLOCKING_STRATEGY_LEN
|
||||
*/
|
||||
|
||||
/** \defgroup porting_1_3_4_to_1_4_0 Porting from FLAC 1.3.4 to 1.4.0
|
||||
* \ingroup porting
|
||||
*
|
||||
* \brief
|
||||
* This module describes porting from FLAC 1.3.4 to FLAC 1.4.0.
|
||||
*
|
||||
* \section porting_1_3_4_to_1_4_0_summary Summary
|
||||
*
|
||||
* Between FLAC 1.3.4 and FLAC 1.4.0, there have four breaking changes
|
||||
* - the function get_client_data_from_decoder has been renamed to
|
||||
* FLAC__get_decoder_client_data
|
||||
* - some data types in the FLAC__Frame struct have changed
|
||||
* - all functions resizing metadata blocks now return the object
|
||||
* untouched if memory allocation fails, whereas previously the
|
||||
* handling varied and was more or less undefined
|
||||
* - all functions accepting a filename now take UTF-8 encoded filenames
|
||||
* on Windows instead of filenames in the current codepage
|
||||
*
|
||||
* Furthermore, there have been the following additions
|
||||
* - the functions FLAC__stream_encoder_set_limit_min_bitrate,
|
||||
* FLAC__stream_encoder_get_limit_min_bitrate,
|
||||
* FLAC::encoder::file::set_limit_min_bitrate() and
|
||||
* FLAC::encoder::file::get_limit_min_bitrate() have been added
|
||||
* - Added FLAC__STREAM_DECODER_ERROR_STATUS_BAD_METADATA to the
|
||||
* FLAC__StreamDecoderErrorStatus enum
|
||||
*
|
||||
* \section porting_1_3_4_to_1_4_0_breaking Breaking changes
|
||||
*
|
||||
* The function \b get_client_data_from_decoder was added in FLAC 1.3.3
|
||||
* but did not follow the API naming convention and was not properly
|
||||
* exported. The function is now renamed and properly integrated as
|
||||
* FLAC__stream_decoder_get_client_data
|
||||
*
|
||||
* To accomodate encoding and decoding 32-bit int PCM, some data types
|
||||
* in the \b FLAC__frame struct were changed. Specifically, warmup
|
||||
* in both the FLAC__Subframe_Fixed struc and the FLAC__Subframe_LPC
|
||||
* struct is changed from FLAC__int32 to FLAC__int64. Also, value
|
||||
* in the FLAC__Subframe_Constant is changed from FLAC__int32 to
|
||||
* FLAC__int64. Finally, in FLAC__Subframe_Verbatim struct data is
|
||||
* changes from a FLAC__int32 array to a union containing a FLAC__int32
|
||||
* array and a FLAC__int64 array. Also, a new member is added,
|
||||
* data_type, which clarifies whether the FLAC__int32 or FLAC__int64
|
||||
* array is in use.
|
||||
*
|
||||
* Furthermore, the following functions now return the object untouched
|
||||
* if memory allocation fails, whereas previously the handling varied
|
||||
* and was more or less undefined
|
||||
*
|
||||
* - FLAC__metadata_object_seektable_resize_points
|
||||
* - FLAC__metadata_object_vorbiscomment_resize_comments
|
||||
* - FLAC__metadata_object_cuesheet_track_resize_indices
|
||||
* - FLAC__metadata_object_cuesheet_resize_tracks
|
||||
*
|
||||
* The last breaking change is that all API functions taking a filename
|
||||
* as an argument now, on Windows, must be supplied with that filename
|
||||
* in the UTF-8 character encoding instead of using the current code
|
||||
* page. libFLAC internally translates these UTF-8 encoded filenames to
|
||||
* an appropriate representation to use with _wfopen. On all other
|
||||
* systems, filename is passed to fopen without any translation, as it
|
||||
* in libFLAC 1.3.4 and earlier.
|
||||
*
|
||||
* \section porting_1_3_4_to_1_4_0_additions Additions
|
||||
*
|
||||
* To aid in creating properly streamable FLAC files, a set of functions
|
||||
* was added to make it possible to enfore a minimum bitrate to files
|
||||
* created through libFLAC's stream_encoder.h interface. With this
|
||||
* function enabled the resulting FLAC files have a minimum bitrate of
|
||||
* 1bit/sample independent of the number of channels, i.e. 48kbit/s for
|
||||
* 48kHz. This can be beneficial for streaming, as very low bitrates for
|
||||
* silent sections compressed with 'constant' subframes can result in a
|
||||
* bitrate of 1kbit/s, creating problems with clients that aren't aware
|
||||
* of this possibility and buffer too much data.
|
||||
*
|
||||
* Finally, FLAC__STREAM_DECODER_ERROR_STATUS_BAD_METADATA was added to
|
||||
* the FLAC__StreamDecoderErrorStatus enum to signal that the decoder
|
||||
* encountered unreadable metadata.
|
||||
*
|
||||
*/
|
||||
|
||||
/** \defgroup flac FLAC C API
|
||||
*
|
||||
* The FLAC C API is the interface to libFLAC, a set of structures
|
||||
* describing the components of FLAC streams, and functions for
|
||||
* encoding and decoding streams, as well as manipulating FLAC
|
||||
* metadata in files.
|
||||
*
|
||||
* You should start with the format components as all other modules
|
||||
* are dependent on it.
|
||||
*/
|
||||
|
||||
#endif
|
||||
|
|
@ -1,321 +0,0 @@
|
|||
/* alloc - Convenience routines for safely allocating memory
|
||||
* Copyright (C) 2007-2009 Josh Coalson
|
||||
* Copyright (C) 2011-2023 Xiph.Org Foundation
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* - Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* - Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* - Neither the name of the Xiph.org Foundation nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef FLAC__SHARE__ALLOC_H
|
||||
#define FLAC__SHARE__ALLOC_H
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
/* WATCHOUT: for c++ you may have to #define __STDC_LIMIT_MACROS 1 real early
|
||||
* before #including this file, otherwise SIZE_MAX might not be defined
|
||||
*/
|
||||
|
||||
// JUCE: removed as JUCE already includes standard headers and including
|
||||
// these in FlacNamespace will cause problems
|
||||
|
||||
//#include <limits.h> /* for SIZE_MAX */
|
||||
//#if HAVE_STDINT_H
|
||||
//#include <stdint.h> /* for SIZE_MAX in case limits.h didn't get it */
|
||||
//#endif
|
||||
//#include <stdlib.h> /* for size_t, malloc(), etc */
|
||||
#include "compat.h"
|
||||
|
||||
#ifndef SIZE_MAX
|
||||
# ifndef SIZE_T_MAX
|
||||
# ifdef _MSC_VER
|
||||
# ifdef _WIN64
|
||||
# define SIZE_T_MAX FLAC__U64L(0xffffffffffffffff)
|
||||
# else
|
||||
# define SIZE_T_MAX 0xffffffff
|
||||
# endif
|
||||
# else
|
||||
# error
|
||||
# endif
|
||||
# endif
|
||||
# define SIZE_MAX SIZE_T_MAX
|
||||
#endif
|
||||
|
||||
#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
|
||||
extern int alloc_check_threshold, alloc_check_counter;
|
||||
|
||||
static inline int alloc_check() {
|
||||
if(alloc_check_threshold == INT32_MAX)
|
||||
return 0;
|
||||
else if(alloc_check_counter++ == alloc_check_threshold)
|
||||
return 1;
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/* avoid malloc()ing 0 bytes, see:
|
||||
* https://www.securecoding.cert.org/confluence/display/seccode/MEM04-A.+Do+not+make+assumptions+about+the+result+of+allocating+0+bytes?focusedCommentId=5407003
|
||||
*/
|
||||
|
||||
static inline void *safe_malloc_(size_t size)
|
||||
{
|
||||
#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
|
||||
/* Fail if requested */
|
||||
if(alloc_check())
|
||||
return NULL;
|
||||
#endif
|
||||
/* malloc(0) is undefined; FLAC src convention is to always allocate */
|
||||
if(!size)
|
||||
size++;
|
||||
return malloc(size);
|
||||
}
|
||||
|
||||
#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
|
||||
static inline void *malloc_(size_t size)
|
||||
{
|
||||
/* Fail if requested */
|
||||
if(alloc_check())
|
||||
return NULL;
|
||||
return malloc(size);
|
||||
}
|
||||
#else
|
||||
#define malloc_ malloc
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
static inline void *safe_calloc_(size_t nmemb, size_t size)
|
||||
{
|
||||
#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
|
||||
/* Fail if requested */
|
||||
if(alloc_check())
|
||||
return NULL;
|
||||
#endif
|
||||
if(!nmemb || !size)
|
||||
return malloc(1); /* malloc(0) is undefined; FLAC src convention is to always allocate */
|
||||
return calloc(nmemb, size);
|
||||
}
|
||||
|
||||
/*@@@@ there's probably a better way to prevent overflows when allocating untrusted sums but this works for now */
|
||||
|
||||
static inline void *safe_malloc_add_2op_(size_t size1, size_t size2)
|
||||
{
|
||||
size2 += size1;
|
||||
if(size2 < size1)
|
||||
return 0;
|
||||
return safe_malloc_(size2);
|
||||
}
|
||||
|
||||
static inline void *safe_malloc_add_3op_(size_t size1, size_t size2, size_t size3)
|
||||
{
|
||||
size2 += size1;
|
||||
if(size2 < size1)
|
||||
return 0;
|
||||
size3 += size2;
|
||||
if(size3 < size2)
|
||||
return 0;
|
||||
return safe_malloc_(size3);
|
||||
}
|
||||
|
||||
static inline void *safe_malloc_add_4op_(size_t size1, size_t size2, size_t size3, size_t size4)
|
||||
{
|
||||
size2 += size1;
|
||||
if(size2 < size1)
|
||||
return 0;
|
||||
size3 += size2;
|
||||
if(size3 < size2)
|
||||
return 0;
|
||||
size4 += size3;
|
||||
if(size4 < size3)
|
||||
return 0;
|
||||
return safe_malloc_(size4);
|
||||
}
|
||||
|
||||
void *safe_malloc_mul_2op_(size_t size1, size_t size2) ;
|
||||
|
||||
static inline void *safe_malloc_mul_3op_(size_t size1, size_t size2, size_t size3)
|
||||
{
|
||||
if(!size1 || !size2 || !size3)
|
||||
return malloc(1); /* malloc(0) is undefined; FLAC src convention is to always allocate */
|
||||
if(size1 > SIZE_MAX / size2)
|
||||
return 0;
|
||||
size1 *= size2;
|
||||
if(size1 > SIZE_MAX / size3)
|
||||
return 0;
|
||||
return malloc_(size1*size3);
|
||||
}
|
||||
|
||||
/* size1*size2 + size3 */
|
||||
static inline void *safe_malloc_mul2add_(size_t size1, size_t size2, size_t size3)
|
||||
{
|
||||
if(!size1 || !size2)
|
||||
return safe_malloc_(size3);
|
||||
if(size1 > SIZE_MAX / size2)
|
||||
return 0;
|
||||
return safe_malloc_add_2op_(size1*size2, size3);
|
||||
}
|
||||
|
||||
/* size1 * (size2 + size3) */
|
||||
static inline void *safe_malloc_muladd2_(size_t size1, size_t size2, size_t size3)
|
||||
{
|
||||
if(!size1 || (!size2 && !size3))
|
||||
return malloc(1); /* malloc(0) is undefined; FLAC src convention is to always allocate */
|
||||
size2 += size3;
|
||||
if(size2 < size3)
|
||||
return 0;
|
||||
if(size1 > SIZE_MAX / size2)
|
||||
return 0;
|
||||
return malloc_(size1*size2);
|
||||
}
|
||||
|
||||
static inline void *safe_realloc_(void *ptr, size_t size)
|
||||
{
|
||||
void *oldptr;
|
||||
void *newptr;
|
||||
#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
|
||||
/* Fail if requested */
|
||||
if(alloc_check() && size > 0) {
|
||||
free(ptr);
|
||||
return NULL;
|
||||
}
|
||||
#endif
|
||||
oldptr = ptr;
|
||||
newptr = realloc(ptr, size);
|
||||
if(size > 0 && newptr == 0)
|
||||
free(oldptr);
|
||||
return newptr;
|
||||
}
|
||||
|
||||
#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
|
||||
static inline void *realloc_(void *ptr, size_t size)
|
||||
{
|
||||
/* Fail if requested */
|
||||
if(alloc_check())
|
||||
return NULL;
|
||||
return realloc(ptr, size);
|
||||
}
|
||||
#else
|
||||
#define realloc_ realloc
|
||||
#endif
|
||||
|
||||
|
||||
static inline void *safe_realloc_nofree_add_2op_(void *ptr, size_t size1, size_t size2)
|
||||
{
|
||||
size2 += size1;
|
||||
if(size2 < size1)
|
||||
return 0;
|
||||
return realloc_(ptr, size2);
|
||||
}
|
||||
|
||||
static inline void *safe_realloc_add_3op_(void *ptr, size_t size1, size_t size2, size_t size3)
|
||||
{
|
||||
size2 += size1;
|
||||
if(size2 < size1) {
|
||||
free(ptr);
|
||||
return 0;
|
||||
}
|
||||
size3 += size2;
|
||||
if(size3 < size2) {
|
||||
free(ptr);
|
||||
return 0;
|
||||
}
|
||||
return safe_realloc_(ptr, size3);
|
||||
}
|
||||
|
||||
static inline void *safe_realloc_nofree_add_3op_(void *ptr, size_t size1, size_t size2, size_t size3)
|
||||
{
|
||||
size2 += size1;
|
||||
if(size2 < size1)
|
||||
return 0;
|
||||
size3 += size2;
|
||||
if(size3 < size2)
|
||||
return 0;
|
||||
return realloc_(ptr, size3);
|
||||
}
|
||||
|
||||
static inline void *safe_realloc_nofree_add_4op_(void *ptr, size_t size1, size_t size2, size_t size3, size_t size4)
|
||||
{
|
||||
size2 += size1;
|
||||
if(size2 < size1)
|
||||
return 0;
|
||||
size3 += size2;
|
||||
if(size3 < size2)
|
||||
return 0;
|
||||
size4 += size3;
|
||||
if(size4 < size3)
|
||||
return 0;
|
||||
return realloc_(ptr, size4);
|
||||
}
|
||||
|
||||
static inline void *safe_realloc_mul_2op_(void *ptr, size_t size1, size_t size2)
|
||||
{
|
||||
if(!size1 || !size2)
|
||||
return realloc(ptr, 0); /* preserve POSIX realloc(ptr, 0) semantics */
|
||||
if(size1 > SIZE_MAX / size2) {
|
||||
free(ptr);
|
||||
return 0;
|
||||
}
|
||||
return safe_realloc_(ptr, size1*size2);
|
||||
}
|
||||
|
||||
static inline void *safe_realloc_nofree_mul_2op_(void *ptr, size_t size1, size_t size2)
|
||||
{
|
||||
if(!size1 || !size2)
|
||||
return realloc(ptr, 0); /* preserve POSIX realloc(ptr, 0) semantics */
|
||||
if(size1 > SIZE_MAX / size2)
|
||||
return 0;
|
||||
return realloc_(ptr, size1*size2);
|
||||
}
|
||||
|
||||
/* size1 * (size2 + size3) */
|
||||
static inline void *safe_realloc_muladd2_(void *ptr, size_t size1, size_t size2, size_t size3)
|
||||
{
|
||||
if(!size1 || (!size2 && !size3))
|
||||
return realloc(ptr, 0); /* preserve POSIX realloc(ptr, 0) semantics */
|
||||
size2 += size3;
|
||||
if(size2 < size3) {
|
||||
free(ptr);
|
||||
return 0;
|
||||
}
|
||||
return safe_realloc_mul_2op_(ptr, size1, size2);
|
||||
}
|
||||
|
||||
/* size1 * (size2 + size3) */
|
||||
static inline void *safe_realloc_nofree_muladd2_(void *ptr, size_t size1, size_t size2, size_t size3)
|
||||
{
|
||||
if(!size1 || (!size2 && !size3))
|
||||
return realloc(ptr, 0); /* preserve POSIX realloc(ptr, 0) semantics */
|
||||
size2 += size3;
|
||||
if(size2 < size3)
|
||||
return 0;
|
||||
return safe_realloc_nofree_mul_2op_(ptr, size1, size2);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
@ -1,51 +0,0 @@
|
|||
/* libFLAC - Free Lossless Audio Codec library
|
||||
* Copyright (C) 2001-2009 Josh Coalson
|
||||
* Copyright (C) 2011-2023 Xiph.Org Foundation
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* - Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* - Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* - Neither the name of the Xiph.org Foundation nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef FLAC__ASSERT_H
|
||||
#define FLAC__ASSERT_H
|
||||
|
||||
/* we need this since some compilers (like MSVC) leave assert()s on release code (and we don't want to use their ASSERT) */
|
||||
#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
|
||||
#define FLAC__ASSERT(x) if(!(x)) __builtin_abort();
|
||||
#define FLAC__ASSERT_DECLARATION(x) x
|
||||
#else
|
||||
#ifndef NDEBUG
|
||||
#include <assert.h>
|
||||
#define FLAC__ASSERT(x) assert(x)
|
||||
#define FLAC__ASSERT_DECLARATION(x) x
|
||||
#else
|
||||
#define FLAC__ASSERT(x)
|
||||
#define FLAC__ASSERT_DECLARATION(x)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
@ -1,190 +0,0 @@
|
|||
/* libFLAC - Free Lossless Audio Codec library
|
||||
* Copyright (C) 2004-2009 Josh Coalson
|
||||
* Copyright (C) 2011-2023 Xiph.Org Foundation
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* - Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* - Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* - Neither the name of the Xiph.org Foundation nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef FLAC__CALLBACK_H
|
||||
#define FLAC__CALLBACK_H
|
||||
|
||||
#include "ordinals.h"
|
||||
#include <stdlib.h> /* for size_t */
|
||||
|
||||
/** \file include/FLAC/callback.h
|
||||
*
|
||||
* \brief
|
||||
* This module defines the structures for describing I/O callbacks
|
||||
* to the other FLAC interfaces.
|
||||
*
|
||||
* See the detailed documentation for callbacks in the
|
||||
* \link flac_callbacks callbacks \endlink module.
|
||||
*/
|
||||
|
||||
/** \defgroup flac_callbacks FLAC/callback.h: I/O callback structures
|
||||
* \ingroup flac
|
||||
*
|
||||
* \brief
|
||||
* This module defines the structures for describing I/O callbacks
|
||||
* to the other FLAC interfaces.
|
||||
*
|
||||
* The purpose of the I/O callback functions is to create a common way
|
||||
* for the metadata interfaces to handle I/O.
|
||||
*
|
||||
* Originally the metadata interfaces required filenames as the way of
|
||||
* specifying FLAC files to operate on. This is problematic in some
|
||||
* environments so there is an additional option to specify a set of
|
||||
* callbacks for doing I/O on the FLAC file, instead of the filename.
|
||||
*
|
||||
* In addition to the callbacks, a FLAC__IOHandle type is defined as an
|
||||
* opaque structure for a data source.
|
||||
*
|
||||
* The callback function prototypes are similar (but not identical) to the
|
||||
* stdio functions fread, fwrite, fseek, ftell, feof, and fclose. If you use
|
||||
* stdio streams to implement the callbacks, you can pass fread, fwrite, and
|
||||
* fclose anywhere a FLAC__IOCallback_Read, FLAC__IOCallback_Write, or
|
||||
* FLAC__IOCallback_Close is required, and a FILE* anywhere a FLAC__IOHandle
|
||||
* is required. \warning You generally CANNOT directly use fseek or ftell
|
||||
* for FLAC__IOCallback_Seek or FLAC__IOCallback_Tell since on most systems
|
||||
* these use 32-bit offsets and FLAC requires 64-bit offsets to deal with
|
||||
* large files. You will have to find an equivalent function (e.g. ftello),
|
||||
* or write a wrapper. The same is true for feof() since this is usually
|
||||
* implemented as a macro, not as a function whose address can be taken.
|
||||
*
|
||||
* \{
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/** This is the opaque handle type used by the callbacks. Typically
|
||||
* this is a \c FILE* or address of a file descriptor.
|
||||
*/
|
||||
typedef void* FLAC__IOHandle;
|
||||
|
||||
/** Signature for the read callback.
|
||||
* The signature and semantics match POSIX fread() implementations
|
||||
* and can generally be used interchangeably. Note that the global
|
||||
* variable errno from errno.h is read by some libFLAC functions to
|
||||
* detect read errors.
|
||||
*
|
||||
* \param ptr The address of the read buffer.
|
||||
* \param size The size of the records to be read.
|
||||
* \param nmemb The number of records to be read.
|
||||
* \param handle The handle to the data source.
|
||||
* \retval size_t
|
||||
* The number of records read.
|
||||
*/
|
||||
typedef size_t (*FLAC__IOCallback_Read) (void *ptr, size_t size, size_t nmemb, FLAC__IOHandle handle);
|
||||
|
||||
/** Signature for the write callback.
|
||||
* The signature and semantics match POSIX fwrite() implementations
|
||||
* and can generally be used interchangeably.
|
||||
*
|
||||
* \param ptr The address of the write buffer.
|
||||
* \param size The size of the records to be written.
|
||||
* \param nmemb The number of records to be written.
|
||||
* \param handle The handle to the data source.
|
||||
* \retval size_t
|
||||
* The number of records written.
|
||||
*/
|
||||
typedef size_t (*FLAC__IOCallback_Write) (const void *ptr, size_t size, size_t nmemb, FLAC__IOHandle handle);
|
||||
|
||||
/** Signature for the seek callback.
|
||||
* The signature and semantics mostly match POSIX fseek() WITH ONE IMPORTANT
|
||||
* EXCEPTION: the offset is a 64-bit type whereas fseek() is generally 'long'
|
||||
* and 32-bits wide.
|
||||
*
|
||||
* \param handle The handle to the data source.
|
||||
* \param offset The new position, relative to \a whence
|
||||
* \param whence \c SEEK_SET, \c SEEK_CUR, or \c SEEK_END
|
||||
* \retval int
|
||||
* \c 0 on success, \c -1 on error.
|
||||
*/
|
||||
typedef int (*FLAC__IOCallback_Seek) (FLAC__IOHandle handle, FLAC__int64 offset, int whence);
|
||||
|
||||
/** Signature for the tell callback.
|
||||
* The signature and semantics mostly match POSIX ftell() WITH ONE IMPORTANT
|
||||
* EXCEPTION: the offset is a 64-bit type whereas ftell() is generally 'long'
|
||||
* and 32-bits wide.
|
||||
*
|
||||
* \param handle The handle to the data source.
|
||||
* \retval FLAC__int64
|
||||
* The current position on success, \c -1 on error.
|
||||
*/
|
||||
typedef FLAC__int64 (*FLAC__IOCallback_Tell) (FLAC__IOHandle handle);
|
||||
|
||||
/** Signature for the EOF callback.
|
||||
* The signature and semantics mostly match POSIX feof() but WATCHOUT:
|
||||
* on many systems, feof() is a macro, so in this case a wrapper function
|
||||
* must be provided instead.
|
||||
*
|
||||
* \param handle The handle to the data source.
|
||||
* \retval int
|
||||
* \c 0 if not at end of file, nonzero if at end of file.
|
||||
*/
|
||||
typedef int (*FLAC__IOCallback_Eof) (FLAC__IOHandle handle);
|
||||
|
||||
/** Signature for the close callback.
|
||||
* The signature and semantics match POSIX fclose() implementations
|
||||
* and can generally be used interchangeably.
|
||||
*
|
||||
* \param handle The handle to the data source.
|
||||
* \retval int
|
||||
* \c 0 on success, \c EOF on error.
|
||||
*/
|
||||
typedef int (*FLAC__IOCallback_Close) (FLAC__IOHandle handle);
|
||||
|
||||
/** A structure for holding a set of callbacks.
|
||||
* Each FLAC interface that requires a FLAC__IOCallbacks structure will
|
||||
* describe which of the callbacks are required. The ones that are not
|
||||
* required may be set to NULL.
|
||||
*
|
||||
* If the seek requirement for an interface is optional, you can signify that
|
||||
* a data source is not seekable by setting the \a seek field to \c NULL.
|
||||
*
|
||||
* See the detailed documentation for callbacks in the
|
||||
* \link flac_callbacks callbacks \endlink module.
|
||||
*/
|
||||
typedef struct {
|
||||
FLAC__IOCallback_Read read; /**< See FLAC__IOCallbacks */
|
||||
FLAC__IOCallback_Write write; /**< See FLAC__IOCallbacks */
|
||||
FLAC__IOCallback_Seek seek; /**< See FLAC__IOCallbacks */
|
||||
FLAC__IOCallback_Tell tell; /**< See FLAC__IOCallbacks */
|
||||
FLAC__IOCallback_Eof eof; /**< See FLAC__IOCallbacks */
|
||||
FLAC__IOCallback_Close close; /**< See FLAC__IOCallbacks */
|
||||
} FLAC__IOCallbacks;
|
||||
|
||||
/* \} */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
@ -1,243 +0,0 @@
|
|||
/* libFLAC - Free Lossless Audio Codec library
|
||||
* Copyright (C) 2012-2023 Xiph.Org Foundation
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* - Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* - Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* - Neither the name of the Xiph.org Foundation nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/* This is the preferred location of all CPP hackery to make $random_compiler
|
||||
* work like something approaching a C99 (or maybe more accurately GNU99)
|
||||
* compiler.
|
||||
*
|
||||
* It is assumed that this header will be included after "config.h".
|
||||
*/
|
||||
|
||||
#ifndef FLAC__SHARE__COMPAT_H
|
||||
#define FLAC__SHARE__COMPAT_H
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdarg.h>
|
||||
|
||||
#if defined _WIN32 && !defined __CYGWIN__
|
||||
/* where MSVC puts unlink() */
|
||||
# include <io.h>
|
||||
#else
|
||||
# include <unistd.h>
|
||||
#endif
|
||||
|
||||
#if defined _MSC_VER || defined __BORLANDC__ || defined __MINGW32__
|
||||
#include <sys/types.h> /* for off_t */
|
||||
#define FLAC__off_t __int64 /* use this instead of off_t to fix the 2 GB limit */
|
||||
#define FLAC__OFF_T_MAX INT64_MAX
|
||||
#if !defined __MINGW32__
|
||||
#define fseeko _fseeki64
|
||||
#define ftello _ftelli64
|
||||
#else /* MinGW */
|
||||
#if !defined(HAVE_FSEEKO)
|
||||
#define fseeko fseeko64
|
||||
#define ftello ftello64
|
||||
#endif
|
||||
#endif
|
||||
#else
|
||||
#define FLAC__off_t off_t
|
||||
#define FLAC__OFF_T_MAX OFF_T_MAX
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#ifdef HAVE_INTTYPES_H
|
||||
#define __STDC_FORMAT_MACROS
|
||||
#include <inttypes.h>
|
||||
#endif
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
#define strtoll _strtoi64
|
||||
#define strtoull _strtoui64
|
||||
#endif
|
||||
|
||||
#if defined(_MSC_VER) && !defined(__cplusplus)
|
||||
#define inline __inline
|
||||
#endif
|
||||
|
||||
#if defined __INTEL_COMPILER || (defined _MSC_VER && defined _WIN64)
|
||||
/* MSVS generates VERY slow 32-bit code with __restrict */
|
||||
#define flac_restrict __restrict
|
||||
#elif defined __GNUC__
|
||||
#define flac_restrict __restrict__
|
||||
#else
|
||||
#define flac_restrict
|
||||
#endif
|
||||
|
||||
#define FLAC__U64L(x) x##ULL
|
||||
|
||||
#if defined _MSC_VER || defined __MINGW32__
|
||||
#define FLAC__STRCASECMP _stricmp
|
||||
#define FLAC__STRNCASECMP _strnicmp
|
||||
#elif defined __BORLANDC__
|
||||
#define FLAC__STRCASECMP stricmp
|
||||
#define FLAC__STRNCASECMP strnicmp
|
||||
#else
|
||||
#define FLAC__STRCASECMP strcasecmp
|
||||
#define FLAC__STRNCASECMP strncasecmp
|
||||
#endif
|
||||
|
||||
#if defined _MSC_VER || defined __MINGW32__ || defined __EMX__
|
||||
#include <io.h> /* for _setmode(), chmod() */
|
||||
#include <fcntl.h> /* for _O_BINARY */
|
||||
#else
|
||||
#include <unistd.h> /* for chown(), unlink() */
|
||||
#endif
|
||||
|
||||
#if defined _MSC_VER || defined __BORLANDC__ || defined __MINGW32__
|
||||
#if defined __BORLANDC__
|
||||
#include <utime.h> /* for utime() */
|
||||
#else
|
||||
#include <sys/utime.h> /* for utime() */
|
||||
#endif
|
||||
#else
|
||||
#if defined(_POSIX_C_SOURCE) && (_POSIX_C_SOURCE >= 200809L)
|
||||
#include <fcntl.h>
|
||||
#else
|
||||
#include <sys/types.h> /* some flavors of BSD (like OS X) require this to get time_t */
|
||||
#include <utime.h> /* for utime() */
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined _MSC_VER
|
||||
# if _MSC_VER >= 1800
|
||||
# include <inttypes.h>
|
||||
# elif _MSC_VER >= 1600
|
||||
/* Visual Studio 2010 has decent C99 support */
|
||||
# include <stdint.h>
|
||||
# define PRIu64 "llu"
|
||||
# define PRId64 "lld"
|
||||
# define PRIx64 "llx"
|
||||
# else
|
||||
# include <limits.h>
|
||||
# ifndef UINT32_MAX
|
||||
# define UINT32_MAX _UI32_MAX
|
||||
# endif
|
||||
# define PRIu64 "I64u"
|
||||
# define PRId64 "I64d"
|
||||
# define PRIx64 "I64x"
|
||||
# endif
|
||||
# if defined(_USING_V110_SDK71_) && !defined(_DLL)
|
||||
# pragma message("WARNING: This compile will NOT FUNCTION PROPERLY on Windows XP. See comments in include/share/compat.h for details")
|
||||
#define FLAC__USE_FILELENGTHI64
|
||||
/*
|
||||
*************************************************************************************
|
||||
* V110_SDK71, in MSVC 2017 also known as v141_xp, is a platform toolset that is supposed
|
||||
* to target Windows XP. It turns out however that certain functions provided silently fail
|
||||
* on Windows XP only, which makes debugging challenging. This only occurs when building with
|
||||
* /MT. This problem has been reported to Microsoft, but there hasn't been a fix for years. See
|
||||
* https://web.archive.org/web/20170327195018/https://connect.microsoft.com/VisualStudio/feedback/details/1557168/wstat64-returns-1-on-xp-always
|
||||
*
|
||||
* It is known that this problem affects the functions _wstat64 (used by flac_stat i.e.
|
||||
* stat64_utf8) and _fstat64 (i.e. flac_fstat) and therefore affects both libFLAC in
|
||||
* several places as well as the flac and metaflac command line tools
|
||||
*
|
||||
* As the extent of this problem is unknown and Microsoft seems unwilling to fix it,
|
||||
* users of libFLAC building with Visual Studio are encouraged to not use the /MT compile
|
||||
* switch when explicitly targeting Windows XP. When use of /MT is deemed necessary with
|
||||
* this toolset, be sure to check whether your application works properly on Windows XP.
|
||||
* It is also possible to build for Windows XP with MinGW instead.
|
||||
*************************************************************************************
|
||||
*/
|
||||
# endif
|
||||
#endif /* defined _MSC_VER */
|
||||
|
||||
#ifdef _WIN32
|
||||
/* All char* strings are in UTF-8 format. Added to support Unicode files on Windows */
|
||||
|
||||
#if 0
|
||||
#include "win_utf8_io.h"
|
||||
#define flac_printf printf_utf8
|
||||
#define flac_fprintf fprintf_utf8
|
||||
#define flac_vfprintf vfprintf_utf8
|
||||
#endif
|
||||
|
||||
#define flac_fopen fopen_utf8
|
||||
#define flac_chmod chmod_utf8
|
||||
#define flac_utime utime_utf8
|
||||
#define flac_unlink unlink_utf8
|
||||
#define flac_rename rename_utf8
|
||||
#define flac_stat stat64_utf8
|
||||
|
||||
#else
|
||||
|
||||
#define flac_printf printf
|
||||
#define flac_fprintf fprintf
|
||||
#define flac_vfprintf vfprintf
|
||||
|
||||
#define flac_fopen fopen
|
||||
#define flac_chmod chmod
|
||||
#define flac_unlink unlink
|
||||
#define flac_rename rename
|
||||
#define flac_stat stat
|
||||
|
||||
#if defined(_POSIX_C_SOURCE) && (_POSIX_C_SOURCE >= 200809L)
|
||||
#define flac_utime(a, b) utimensat (AT_FDCWD, a, *b, 0)
|
||||
#else
|
||||
#define flac_utime utime
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef _WIN32
|
||||
#define flac_stat_s __stat64 /* stat struct */
|
||||
#define flac_fstat _fstat64
|
||||
#else
|
||||
#define flac_stat_s stat /* stat struct */
|
||||
#define flac_fstat fstat
|
||||
#endif
|
||||
|
||||
#ifdef ANDROID
|
||||
#include <limits.h>
|
||||
#endif
|
||||
|
||||
#ifndef M_LN2
|
||||
#define M_LN2 0.69314718055994530942
|
||||
#endif
|
||||
#ifndef M_PI
|
||||
#define M_PI 3.14159265358979323846
|
||||
#endif
|
||||
|
||||
/* FLAC needs to compile and work correctly on systems with a normal ISO C99
|
||||
* snprintf as well as Microsoft Visual Studio which has an non-standards
|
||||
* conformant snprint_s function.
|
||||
*
|
||||
* This function wraps the MS version to behave more like the ISO version.
|
||||
*/
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
int flac_snprintf(char *str, size_t size, const char *fmt, ...);
|
||||
int flac_vsnprintf(char *str, size_t size, const char *fmt, va_list va);
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* FLAC__SHARE__COMPAT_H */
|
||||
|
|
@ -1,84 +0,0 @@
|
|||
/* libFLAC - Free Lossless Audio Codec library
|
||||
* Copyright (C) 2012-2023 Xiph.Org Foundation
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* - Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* - Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* - Neither the name of the Xiph.org Foundation nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/* It is assumed that this header will be included after "config.h". */
|
||||
|
||||
#ifdef HAVE_BSWAP32 /* GCC and Clang */
|
||||
|
||||
/* GCC prior to 4.8 didn't provide bswap16 on x86_64 */
|
||||
#ifndef HAVE_BSWAP16
|
||||
static inline unsigned short __builtin_bswap16(unsigned short a)
|
||||
{
|
||||
return (a<<8)|(a>>8);
|
||||
}
|
||||
#endif
|
||||
|
||||
#define ENDSWAP_16(x) (__builtin_bswap16 (x))
|
||||
#define ENDSWAP_32(x) (__builtin_bswap32 (x))
|
||||
#define ENDSWAP_64(x) (__builtin_bswap64 (x))
|
||||
|
||||
#elif defined _MSC_VER /* Windows */
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#define ENDSWAP_16(x) (_byteswap_ushort (x))
|
||||
#define ENDSWAP_32(x) (_byteswap_ulong (x))
|
||||
#define ENDSWAP_64(x) (_byteswap_uint64 (x))
|
||||
|
||||
#elif defined HAVE_BYTESWAP_H /* Linux */
|
||||
|
||||
#include <byteswap.h>
|
||||
|
||||
#define ENDSWAP_16(x) (bswap_16 (x))
|
||||
#define ENDSWAP_32(x) (bswap_32 (x))
|
||||
#define ENDSWAP_64(x) (bswap_64 (x))
|
||||
|
||||
#else
|
||||
|
||||
#define ENDSWAP_16(x) ((((x) >> 8) & 0xFF) | (((x) & 0xFF) << 8))
|
||||
#define ENDSWAP_32(x) ((((x) >> 24) & 0xFF) | (((x) >> 8) & 0xFF00) | (((x) & 0xFF00) << 8) | (((x) & 0xFF) << 24))
|
||||
#define ENDSWAP_64(x) ((ENDSWAP_32(((x) >> 32) & 0xFFFFFFFF)) | (ENDSWAP_32((x) & 0xFFFFFFFF) << 32))
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
/* Host to little-endian byte swapping (for MD5 calculation) */
|
||||
#if CPU_IS_BIG_ENDIAN
|
||||
|
||||
#define H2LE_16(x) ENDSWAP_16 (x)
|
||||
#define H2LE_32(x) ENDSWAP_32 (x)
|
||||
|
||||
#else
|
||||
|
||||
#define H2LE_16(x) (x)
|
||||
#define H2LE_32(x) (x)
|
||||
|
||||
#endif
|
||||
|
|
@ -1,115 +0,0 @@
|
|||
/* libFLAC - Free Lossless Audio Codec library
|
||||
* Copyright (C) 2000-2009 Josh Coalson
|
||||
* Copyright (C) 2011-2023 Xiph.Org Foundation
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* - Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* - Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* - Neither the name of the Xiph.org Foundation nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef FLAC__EXPORT_H
|
||||
#define FLAC__EXPORT_H
|
||||
|
||||
/** \file include/FLAC/export.h
|
||||
*
|
||||
* \brief
|
||||
* This module contains \#defines and symbols for exporting function
|
||||
* calls, and providing version information and compiled-in features.
|
||||
*
|
||||
* See the \link flac_export export \endlink module.
|
||||
*/
|
||||
|
||||
/** \defgroup flac_export FLAC/export.h: export symbols
|
||||
* \ingroup flac
|
||||
*
|
||||
* \brief
|
||||
* This module contains \#defines and symbols for exporting function
|
||||
* calls, and providing version information and compiled-in features.
|
||||
*
|
||||
* If you are compiling for Windows (with Visual Studio or MinGW for
|
||||
* example) and will link to the static library (libFLAC++.lib) you
|
||||
* should define FLAC__NO_DLL in your project to make sure the symbols
|
||||
* are exported properly.
|
||||
*
|
||||
* \{
|
||||
*/
|
||||
|
||||
/** This \#define is used internally in libFLAC and its headers to make
|
||||
* sure the correct symbols are exported when working with shared
|
||||
* libraries. On Windows, this \#define is set to __declspec(dllexport)
|
||||
* when compiling libFLAC into a library and to __declspec(dllimport)
|
||||
* when the headers are used to link to that DLL. On non-Windows systems
|
||||
* it is used to set symbol visibility.
|
||||
*
|
||||
* Because of this, the define FLAC__NO_DLL must be defined when linking
|
||||
* to libFLAC statically or linking will fail.
|
||||
*/
|
||||
/* This has grown quite complicated. FLAC__NO_DLL is used by MSVC sln
|
||||
* files and CMake, which build either static or shared. autotools can
|
||||
* build static, shared or **both**. Therefore, DLL_EXPORT, which is set
|
||||
* by libtool, must override FLAC__NO_DLL on building shared components
|
||||
*/
|
||||
#if defined(_WIN32)
|
||||
|
||||
#if defined(FLAC__NO_DLL) && !(defined(DLL_EXPORT))
|
||||
#define FLAC_API
|
||||
#else
|
||||
#ifdef FLAC_API_EXPORTS
|
||||
#define FLAC_API __declspec(dllexport)
|
||||
#else
|
||||
#define FLAC_API __declspec(dllimport)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#elif defined(FLAC__USE_VISIBILITY_ATTR)
|
||||
#define FLAC_API __attribute__ ((visibility ("default")))
|
||||
|
||||
#else
|
||||
#define FLAC_API
|
||||
|
||||
#endif
|
||||
|
||||
/** These \#defines will mirror the libtool-based library version number, see
|
||||
* http://www.gnu.org/software/libtool/manual/libtool.html#Libtool-versioning
|
||||
*/
|
||||
#define FLAC_API_VERSION_CURRENT 13
|
||||
#define FLAC_API_VERSION_REVISION 0 /**< see above */
|
||||
#define FLAC_API_VERSION_AGE 1 /**< see above */
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/** \c 1 if the library has been compiled with support for Ogg FLAC, else \c 0. */
|
||||
extern FLAC_API int FLAC_API_SUPPORTS_OGG_FLAC;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
/* \} */
|
||||
|
||||
#endif
|
||||
File diff suppressed because it is too large
Load diff
|
|
@ -1,73 +0,0 @@
|
|||
/* libFLAC - Free Lossless Audio Codec library
|
||||
* Copyright (C) 2001-2009 Josh Coalson
|
||||
* Copyright (C) 2011-2023 Xiph.Org Foundation
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* - Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* - Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* - Neither the name of the Xiph.org Foundation nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include "include/private/bitmath.h"
|
||||
|
||||
/* An example of what FLAC__bitmath_silog2() computes:
|
||||
*
|
||||
* silog2(-10) = 5
|
||||
* silog2(- 9) = 5
|
||||
* silog2(- 8) = 4
|
||||
* silog2(- 7) = 4
|
||||
* silog2(- 6) = 4
|
||||
* silog2(- 5) = 4
|
||||
* silog2(- 4) = 3
|
||||
* silog2(- 3) = 3
|
||||
* silog2(- 2) = 2
|
||||
* silog2(- 1) = 2
|
||||
* silog2( 0) = 0
|
||||
* silog2( 1) = 2
|
||||
* silog2( 2) = 3
|
||||
* silog2( 3) = 3
|
||||
* silog2( 4) = 4
|
||||
* silog2( 5) = 4
|
||||
* silog2( 6) = 4
|
||||
* silog2( 7) = 4
|
||||
* silog2( 8) = 5
|
||||
* silog2( 9) = 5
|
||||
* silog2( 10) = 5
|
||||
*/
|
||||
uint32_t FLAC__bitmath_silog2(FLAC__int64 v)
|
||||
{
|
||||
if(v == 0)
|
||||
return 0;
|
||||
|
||||
if(v == -1)
|
||||
return 2;
|
||||
|
||||
v = (v < 0) ? (-(v+1)) : v;
|
||||
return FLAC__bitmath_ilog2_wide(v)+2;
|
||||
}
|
||||
File diff suppressed because it is too large
Load diff
|
|
@ -1,955 +0,0 @@
|
|||
/* libFLAC - Free Lossless Audio Codec library
|
||||
* Copyright (C) 2000-2009 Josh Coalson
|
||||
* Copyright (C) 2011-2023 Xiph.Org Foundation
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* - Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* - Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* - Neither the name of the Xiph.org Foundation nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "include/private/bitwriter.h"
|
||||
#include "include/private/crc.h"
|
||||
#include "include/private/format.h"
|
||||
|
||||
#include "include/private/stream_encoder.h"
|
||||
#include "../assert.h"
|
||||
#include "../alloc.h"
|
||||
#include "../compat.h"
|
||||
#include "../endswap.h"
|
||||
|
||||
/* Things should be fastest when this matches the machine word size */
|
||||
/* WATCHOUT: if you change this you must also change the following #defines down to SWAP_BE_WORD_TO_HOST below to match */
|
||||
/* WATCHOUT: there are a few places where the code will not work unless bwword is >= 32 bits wide */
|
||||
|
||||
#if (ENABLE_64_BIT_WORDS == 0)
|
||||
|
||||
typedef FLAC__uint32 bwword;
|
||||
typedef FLAC__uint64 FLAC__bwtemp;
|
||||
#define FLAC__BYTES_PER_WORD 4 /* sizeof bwword */
|
||||
#define FLAC__BITS_PER_WORD 32
|
||||
#define FLAC__TEMP_BITS 64
|
||||
#define FLAC__HALF_TEMP_BITS 32
|
||||
/* SWAP_BE_WORD_TO_HOST swaps bytes in a bwword (which is always big-endian) if necessary to match host byte order */
|
||||
#if WORDS_BIGENDIAN
|
||||
#define SWAP_BE_WORD_TO_HOST(x) (x)
|
||||
#else
|
||||
#define SWAP_BE_WORD_TO_HOST(x) ENDSWAP_32(x)
|
||||
#endif
|
||||
|
||||
#else
|
||||
|
||||
typedef FLAC__uint64 bwword;
|
||||
typedef FLAC__uint64 FLAC__bwtemp;
|
||||
#define FLAC__BYTES_PER_WORD 8 /* sizeof bwword */
|
||||
#define FLAC__BITS_PER_WORD 64
|
||||
#define FLAC__TEMP_BITS 64
|
||||
#define FLAC__HALF_TEMP_BITS 32
|
||||
/* SWAP_BE_WORD_TO_HOST swaps bytes in a bwword (which is always big-endian) if necessary to match host byte order */
|
||||
#if WORDS_BIGENDIAN
|
||||
#define SWAP_BE_WORD_TO_HOST(x) (x)
|
||||
#else
|
||||
#define SWAP_BE_WORD_TO_HOST(x) ENDSWAP_64(x)
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
/*
|
||||
* The default capacity here doesn't matter too much. The buffer always grows
|
||||
* to hold whatever is written to it. Usually the encoder will stop adding at
|
||||
* a frame or metadata block, then write that out and clear the buffer for the
|
||||
* next one.
|
||||
*/
|
||||
static const uint32_t FLAC__BITWRITER_DEFAULT_CAPACITY = 32768u / sizeof(bwword); /* size in words */
|
||||
/* When growing, increment 4K at a time */
|
||||
static const uint32_t FLAC__BITWRITER_DEFAULT_INCREMENT = 4096u / sizeof(bwword); /* size in words */
|
||||
|
||||
#define FLAC__WORDS_TO_BITS(words) ((words) * FLAC__BITS_PER_WORD)
|
||||
#define FLAC__TOTAL_BITS(bw) (FLAC__WORDS_TO_BITS((bw)->words) + (bw)->bits)
|
||||
|
||||
struct FLAC__BitWriter {
|
||||
bwword *buffer;
|
||||
bwword accum; /* accumulator; bits are right-justified; when full, accum is appended to buffer */
|
||||
uint32_t capacity; /* capacity of buffer in words */
|
||||
uint32_t words; /* # of complete words in buffer */
|
||||
uint32_t bits; /* # of used bits in accum */
|
||||
};
|
||||
|
||||
/* * WATCHOUT: The current implementation only grows the buffer. */
|
||||
#ifndef __SUNPRO_C
|
||||
static
|
||||
#endif
|
||||
FLAC__bool bitwriter_grow_(FLAC__BitWriter *bw, uint32_t bits_to_add)
|
||||
{
|
||||
uint32_t new_capacity;
|
||||
bwword *new_buffer;
|
||||
|
||||
FLAC__ASSERT(0 != bw);
|
||||
FLAC__ASSERT(0 != bw->buffer);
|
||||
|
||||
/* calculate total words needed to store 'bits_to_add' additional bits */
|
||||
new_capacity = bw->words + ((bw->bits + bits_to_add + FLAC__BITS_PER_WORD - 1) / FLAC__BITS_PER_WORD);
|
||||
|
||||
/* it's possible (due to pessimism in the growth estimation that
|
||||
* leads to this call) that we don't actually need to grow
|
||||
*/
|
||||
if(bw->capacity >= new_capacity)
|
||||
return true;
|
||||
|
||||
if(new_capacity * sizeof(bwword) > (1u << FLAC__STREAM_METADATA_LENGTH_LEN))
|
||||
/* Requested new capacity is larger than the largest possible metadata block,
|
||||
* which is also larger than the largest sane framesize. That means something
|
||||
* went very wrong somewhere and previous checks failed.
|
||||
* To prevent chrashing, give up */
|
||||
return false;
|
||||
|
||||
/* round up capacity increase to the nearest FLAC__BITWRITER_DEFAULT_INCREMENT */
|
||||
if((new_capacity - bw->capacity) % FLAC__BITWRITER_DEFAULT_INCREMENT)
|
||||
new_capacity += FLAC__BITWRITER_DEFAULT_INCREMENT - ((new_capacity - bw->capacity) % FLAC__BITWRITER_DEFAULT_INCREMENT);
|
||||
/* make sure we got everything right */
|
||||
FLAC__ASSERT(0 == (new_capacity - bw->capacity) % FLAC__BITWRITER_DEFAULT_INCREMENT);
|
||||
FLAC__ASSERT(new_capacity > bw->capacity);
|
||||
FLAC__ASSERT(new_capacity >= bw->words + ((bw->bits + bits_to_add + FLAC__BITS_PER_WORD - 1) / FLAC__BITS_PER_WORD));
|
||||
|
||||
new_buffer = (bwword*) safe_realloc_nofree_mul_2op_(bw->buffer, sizeof(bwword), /*times*/new_capacity);
|
||||
if(new_buffer == 0)
|
||||
return false;
|
||||
bw->buffer = new_buffer;
|
||||
bw->capacity = new_capacity;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
* Class constructor/destructor
|
||||
*
|
||||
***********************************************************************/
|
||||
|
||||
FLAC__BitWriter *FLAC__bitwriter_new(void)
|
||||
{
|
||||
FLAC__BitWriter *bw = (FLAC__BitWriter*) calloc(1, sizeof(FLAC__BitWriter));
|
||||
/* note that calloc() sets all members to 0 for us */
|
||||
return bw;
|
||||
}
|
||||
|
||||
void FLAC__bitwriter_delete(FLAC__BitWriter *bw)
|
||||
{
|
||||
FLAC__ASSERT(0 != bw);
|
||||
|
||||
FLAC__bitwriter_free(bw);
|
||||
free(bw);
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
* Public class methods
|
||||
*
|
||||
***********************************************************************/
|
||||
|
||||
FLAC__bool FLAC__bitwriter_init(FLAC__BitWriter *bw)
|
||||
{
|
||||
FLAC__ASSERT(0 != bw);
|
||||
|
||||
bw->words = bw->bits = 0;
|
||||
bw->capacity = FLAC__BITWRITER_DEFAULT_CAPACITY;
|
||||
bw->buffer = (bwword*) malloc(sizeof(bwword) * bw->capacity);
|
||||
if(bw->buffer == 0)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void FLAC__bitwriter_free(FLAC__BitWriter *bw)
|
||||
{
|
||||
FLAC__ASSERT(0 != bw);
|
||||
|
||||
if(0 != bw->buffer)
|
||||
free(bw->buffer);
|
||||
bw->buffer = 0;
|
||||
bw->capacity = 0;
|
||||
bw->words = bw->bits = 0;
|
||||
}
|
||||
|
||||
void FLAC__bitwriter_clear(FLAC__BitWriter *bw)
|
||||
{
|
||||
bw->words = bw->bits = 0;
|
||||
}
|
||||
|
||||
FLAC__bool FLAC__bitwriter_get_write_crc16(FLAC__BitWriter *bw, FLAC__uint16 *crc)
|
||||
{
|
||||
const FLAC__byte *buffer;
|
||||
size_t bytes;
|
||||
|
||||
FLAC__ASSERT((bw->bits & 7) == 0); /* assert that we're byte-aligned */
|
||||
|
||||
if(!FLAC__bitwriter_get_buffer(bw, &buffer, &bytes))
|
||||
return false;
|
||||
|
||||
*crc = (FLAC__uint16)FLAC__crc16(buffer, bytes);
|
||||
FLAC__bitwriter_release_buffer(bw);
|
||||
return true;
|
||||
}
|
||||
|
||||
FLAC__bool FLAC__bitwriter_get_write_crc8(FLAC__BitWriter *bw, FLAC__byte *crc)
|
||||
{
|
||||
const FLAC__byte *buffer;
|
||||
size_t bytes;
|
||||
|
||||
FLAC__ASSERT((bw->bits & 7) == 0); /* assert that we're byte-aligned */
|
||||
|
||||
if(!FLAC__bitwriter_get_buffer(bw, &buffer, &bytes))
|
||||
return false;
|
||||
|
||||
*crc = FLAC__crc8(buffer, bytes);
|
||||
FLAC__bitwriter_release_buffer(bw);
|
||||
return true;
|
||||
}
|
||||
|
||||
FLAC__bool FLAC__bitwriter_is_byte_aligned(const FLAC__BitWriter *bw)
|
||||
{
|
||||
return ((bw->bits & 7) == 0);
|
||||
}
|
||||
|
||||
uint32_t FLAC__bitwriter_get_input_bits_unconsumed(const FLAC__BitWriter *bw)
|
||||
{
|
||||
return FLAC__TOTAL_BITS(bw);
|
||||
}
|
||||
|
||||
FLAC__bool FLAC__bitwriter_get_buffer(FLAC__BitWriter *bw, const FLAC__byte **buffer, size_t *bytes)
|
||||
{
|
||||
FLAC__ASSERT((bw->bits & 7) == 0);
|
||||
/* double protection */
|
||||
if(bw->bits & 7)
|
||||
return false;
|
||||
/* if we have bits in the accumulator we have to flush those to the buffer first */
|
||||
if(bw->bits) {
|
||||
FLAC__ASSERT(bw->words <= bw->capacity);
|
||||
if(bw->words == bw->capacity && !bitwriter_grow_(bw, FLAC__BITS_PER_WORD))
|
||||
return false;
|
||||
/* append bits as complete word to buffer, but don't change bw->accum or bw->bits */
|
||||
bw->buffer[bw->words] = SWAP_BE_WORD_TO_HOST(bw->accum << (FLAC__BITS_PER_WORD-bw->bits));
|
||||
}
|
||||
/* now we can just return what we have */
|
||||
*buffer = (FLAC__byte*)bw->buffer;
|
||||
*bytes = (FLAC__BYTES_PER_WORD * bw->words) + (bw->bits >> 3);
|
||||
return true;
|
||||
}
|
||||
|
||||
void FLAC__bitwriter_release_buffer(FLAC__BitWriter *bw)
|
||||
{
|
||||
/* nothing to do. in the future, strict checking of a 'writer-is-in-
|
||||
* get-mode' flag could be added everywhere and then cleared here
|
||||
*/
|
||||
(void)bw;
|
||||
}
|
||||
|
||||
inline FLAC__bool FLAC__bitwriter_write_zeroes(FLAC__BitWriter *bw, uint32_t bits)
|
||||
{
|
||||
uint32_t n;
|
||||
|
||||
FLAC__ASSERT(0 != bw);
|
||||
FLAC__ASSERT(0 != bw->buffer);
|
||||
|
||||
if(bits == 0)
|
||||
return true;
|
||||
/* slightly pessimistic size check but faster than "<= bw->words + (bw->bits+bits+FLAC__BITS_PER_WORD-1)/FLAC__BITS_PER_WORD" */
|
||||
if(bw->capacity <= bw->words + bits && !bitwriter_grow_(bw, bits))
|
||||
return false;
|
||||
/* first part gets to word alignment */
|
||||
if(bw->bits) {
|
||||
n = flac_min(FLAC__BITS_PER_WORD - bw->bits, bits);
|
||||
bw->accum <<= n;
|
||||
bits -= n;
|
||||
bw->bits += n;
|
||||
if(bw->bits == FLAC__BITS_PER_WORD) {
|
||||
bw->buffer[bw->words++] = SWAP_BE_WORD_TO_HOST(bw->accum);
|
||||
bw->bits = 0;
|
||||
}
|
||||
else
|
||||
return true;
|
||||
}
|
||||
/* do whole words */
|
||||
while(bits >= FLAC__BITS_PER_WORD) {
|
||||
bw->buffer[bw->words++] = 0;
|
||||
bits -= FLAC__BITS_PER_WORD;
|
||||
}
|
||||
/* do any leftovers */
|
||||
if(bits > 0) {
|
||||
bw->accum = 0;
|
||||
bw->bits = bits;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
static inline FLAC__bool FLAC__bitwriter_write_raw_uint32_nocheck(FLAC__BitWriter *bw, FLAC__uint32 val, uint32_t bits)
|
||||
{
|
||||
uint32_t left;
|
||||
|
||||
/* WATCHOUT: code does not work with <32bit words; we can make things much faster with this assertion */
|
||||
FLAC__ASSERT(FLAC__BITS_PER_WORD >= 32);
|
||||
|
||||
if(bw == 0 || bw->buffer == 0)
|
||||
return false;
|
||||
|
||||
if (bits > 32)
|
||||
return false;
|
||||
|
||||
if(bits == 0)
|
||||
return true;
|
||||
|
||||
FLAC__ASSERT((bits == 32) || (val>>bits == 0));
|
||||
|
||||
/* slightly pessimistic size check but faster than "<= bw->words + (bw->bits+bits+FLAC__BITS_PER_WORD-1)/FLAC__BITS_PER_WORD" */
|
||||
if(bw->capacity <= bw->words + bits && !bitwriter_grow_(bw, bits))
|
||||
return false;
|
||||
|
||||
left = FLAC__BITS_PER_WORD - bw->bits;
|
||||
if(bits < left) {
|
||||
bw->accum <<= bits;
|
||||
bw->accum |= val;
|
||||
bw->bits += bits;
|
||||
}
|
||||
else if(bw->bits) { /* WATCHOUT: if bw->bits == 0, left==FLAC__BITS_PER_WORD and bw->accum<<=left is a NOP instead of setting to 0 */
|
||||
bw->accum <<= left;
|
||||
bw->accum |= val >> (bw->bits = bits - left);
|
||||
bw->buffer[bw->words++] = SWAP_BE_WORD_TO_HOST(bw->accum);
|
||||
bw->accum = val; /* unused top bits can contain garbage */
|
||||
}
|
||||
else { /* at this point bits == FLAC__BITS_PER_WORD == 32 and bw->bits == 0 */
|
||||
bw->buffer[bw->words++] = SWAP_BE_WORD_TO_HOST((bwword)val);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
inline FLAC__bool FLAC__bitwriter_write_raw_uint32(FLAC__BitWriter *bw, FLAC__uint32 val, uint32_t bits)
|
||||
{
|
||||
/* check that unused bits are unset */
|
||||
if((bits < 32) && (val>>bits != 0))
|
||||
return false;
|
||||
|
||||
return FLAC__bitwriter_write_raw_uint32_nocheck(bw, val, bits);
|
||||
}
|
||||
|
||||
inline FLAC__bool FLAC__bitwriter_write_raw_int32(FLAC__BitWriter *bw, FLAC__int32 val, uint32_t bits)
|
||||
{
|
||||
/* zero-out unused bits */
|
||||
if(bits < 32)
|
||||
val &= (~(0xffffffff << bits));
|
||||
|
||||
return FLAC__bitwriter_write_raw_uint32_nocheck(bw, (FLAC__uint32)val, bits);
|
||||
}
|
||||
|
||||
inline FLAC__bool FLAC__bitwriter_write_raw_uint64(FLAC__BitWriter *bw, FLAC__uint64 val, uint32_t bits)
|
||||
{
|
||||
/* this could be a little faster but it's not used for much */
|
||||
if(bits > 32) {
|
||||
return
|
||||
FLAC__bitwriter_write_raw_uint32(bw, (FLAC__uint32)(val>>32), bits-32) &&
|
||||
FLAC__bitwriter_write_raw_uint32_nocheck(bw, (FLAC__uint32)val, 32);
|
||||
}
|
||||
else
|
||||
return FLAC__bitwriter_write_raw_uint32(bw, (FLAC__uint32)val, bits);
|
||||
}
|
||||
|
||||
inline FLAC__bool FLAC__bitwriter_write_raw_int64(FLAC__BitWriter *bw, FLAC__int64 val, uint32_t bits)
|
||||
{
|
||||
FLAC__uint64 uval = val;
|
||||
/* zero-out unused bits */
|
||||
if(bits < 64)
|
||||
uval &= (~(UINT64_MAX << bits));
|
||||
return FLAC__bitwriter_write_raw_uint64(bw, uval, bits);
|
||||
}
|
||||
|
||||
inline FLAC__bool FLAC__bitwriter_write_raw_uint32_little_endian(FLAC__BitWriter *bw, FLAC__uint32 val)
|
||||
{
|
||||
/* this doesn't need to be that fast as currently it is only used for vorbis comments */
|
||||
|
||||
if(!FLAC__bitwriter_write_raw_uint32_nocheck(bw, val & 0xff, 8))
|
||||
return false;
|
||||
if(!FLAC__bitwriter_write_raw_uint32_nocheck(bw, (val>>8) & 0xff, 8))
|
||||
return false;
|
||||
if(!FLAC__bitwriter_write_raw_uint32_nocheck(bw, (val>>16) & 0xff, 8))
|
||||
return false;
|
||||
if(!FLAC__bitwriter_write_raw_uint32_nocheck(bw, val>>24, 8))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
inline FLAC__bool FLAC__bitwriter_write_byte_block(FLAC__BitWriter *bw, const FLAC__byte vals[], uint32_t nvals)
|
||||
{
|
||||
uint32_t i;
|
||||
|
||||
/* grow capacity upfront to prevent constant reallocation during writes */
|
||||
if(bw->capacity <= bw->words + nvals / (FLAC__BITS_PER_WORD / 8) + 1 && !bitwriter_grow_(bw, nvals * 8))
|
||||
return false;
|
||||
|
||||
/* this could be faster but currently we don't need it to be since it's only used for writing metadata */
|
||||
for(i = 0; i < nvals; i++) {
|
||||
if(!FLAC__bitwriter_write_raw_uint32_nocheck(bw, (FLAC__uint32)(vals[i]), 8))
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
FLAC__bool FLAC__bitwriter_write_unary_unsigned(FLAC__BitWriter *bw, uint32_t val)
|
||||
{
|
||||
if(val < 32)
|
||||
return FLAC__bitwriter_write_raw_uint32_nocheck(bw, 1, ++val);
|
||||
else
|
||||
return
|
||||
FLAC__bitwriter_write_zeroes(bw, val) &&
|
||||
FLAC__bitwriter_write_raw_uint32_nocheck(bw, 1, 1);
|
||||
}
|
||||
|
||||
#if 0 /* UNUSED */
|
||||
uint32_t FLAC__bitwriter_rice_bits(FLAC__int32 val, uint32_t parameter)
|
||||
{
|
||||
FLAC__uint32 uval;
|
||||
|
||||
FLAC__ASSERT(parameter < 32);
|
||||
|
||||
/* fold signed to uint32_t; actual formula is: negative(v)? -2v-1 : 2v */
|
||||
uval = val;
|
||||
uval <<= 1;
|
||||
uval ^= (val>>31);
|
||||
|
||||
return 1 + parameter + (uval >> parameter);
|
||||
}
|
||||
|
||||
uint32_t FLAC__bitwriter_golomb_bits_signed(int val, uint32_t parameter)
|
||||
{
|
||||
uint32_t bits, msbs, uval;
|
||||
uint32_t k;
|
||||
|
||||
FLAC__ASSERT(parameter > 0);
|
||||
|
||||
/* fold signed to uint32_t */
|
||||
if(val < 0)
|
||||
uval = (uint32_t)(((-(++val)) << 1) + 1);
|
||||
else
|
||||
uval = (uint32_t)(val << 1);
|
||||
|
||||
k = FLAC__bitmath_ilog2(parameter);
|
||||
if(parameter == 1u<<k) {
|
||||
FLAC__ASSERT(k <= 30);
|
||||
|
||||
msbs = uval >> k;
|
||||
bits = 1 + k + msbs;
|
||||
}
|
||||
else {
|
||||
uint32_t q, r, d;
|
||||
|
||||
d = (1 << (k+1)) - parameter;
|
||||
q = uval / parameter;
|
||||
r = uval - (q * parameter);
|
||||
|
||||
bits = 1 + q + k;
|
||||
if(r >= d)
|
||||
bits++;
|
||||
}
|
||||
return bits;
|
||||
}
|
||||
|
||||
uint32_t FLAC__bitwriter_golomb_bits_unsigned(uint32_t uval, uint32_t parameter)
|
||||
{
|
||||
uint32_t bits, msbs;
|
||||
uint32_t k;
|
||||
|
||||
FLAC__ASSERT(parameter > 0);
|
||||
|
||||
k = FLAC__bitmath_ilog2(parameter);
|
||||
if(parameter == 1u<<k) {
|
||||
FLAC__ASSERT(k <= 30);
|
||||
|
||||
msbs = uval >> k;
|
||||
bits = 1 + k + msbs;
|
||||
}
|
||||
else {
|
||||
uint32_t q, r, d;
|
||||
|
||||
d = (1 << (k+1)) - parameter;
|
||||
q = uval / parameter;
|
||||
r = uval - (q * parameter);
|
||||
|
||||
bits = 1 + q + k;
|
||||
if(r >= d)
|
||||
bits++;
|
||||
}
|
||||
return bits;
|
||||
}
|
||||
|
||||
FLAC__bool FLAC__bitwriter_write_rice_signed(FLAC__BitWriter *bw, FLAC__int32 val, uint32_t parameter)
|
||||
{
|
||||
uint32_t total_bits, interesting_bits, msbs;
|
||||
FLAC__uint32 uval, pattern;
|
||||
|
||||
FLAC__ASSERT(0 != bw);
|
||||
FLAC__ASSERT(0 != bw->buffer);
|
||||
FLAC__ASSERT(parameter < 32);
|
||||
|
||||
/* fold signed to uint32_t; actual formula is: negative(v)? -2v-1 : 2v */
|
||||
uval = val;
|
||||
uval <<= 1;
|
||||
uval ^= (val>>31);
|
||||
|
||||
msbs = uval >> parameter;
|
||||
interesting_bits = 1 + parameter;
|
||||
total_bits = interesting_bits + msbs;
|
||||
pattern = 1 << parameter; /* the unary end bit */
|
||||
pattern |= (uval & ((1<<parameter)-1)); /* the binary LSBs */
|
||||
|
||||
if(total_bits <= 32)
|
||||
return FLAC__bitwriter_write_raw_uint32(bw, pattern, total_bits);
|
||||
else
|
||||
return
|
||||
FLAC__bitwriter_write_zeroes(bw, msbs) && /* write the unary MSBs */
|
||||
FLAC__bitwriter_write_raw_uint32(bw, pattern, interesting_bits); /* write the unary end bit and binary LSBs */
|
||||
}
|
||||
#endif /* UNUSED */
|
||||
|
||||
#if (ENABLE_64_BIT_WORDS == 0)
|
||||
|
||||
#define WIDE_ACCUM_TO_BW { \
|
||||
bw->accum = wide_accum >> FLAC__HALF_TEMP_BITS; \
|
||||
bw->buffer[bw->words++] = SWAP_BE_WORD_TO_HOST(bw->accum); \
|
||||
wide_accum <<= FLAC__HALF_TEMP_BITS; \
|
||||
bitpointer += FLAC__HALF_TEMP_BITS; \
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
#define WIDE_ACCUM_TO_BW { \
|
||||
FLAC__ASSERT(bw->bits % FLAC__HALF_TEMP_BITS == 0); \
|
||||
if(bw->bits == 0) { \
|
||||
bw->accum = wide_accum >> FLAC__HALF_TEMP_BITS; \
|
||||
wide_accum <<= FLAC__HALF_TEMP_BITS; \
|
||||
bw->bits = FLAC__HALF_TEMP_BITS; \
|
||||
} \
|
||||
else { \
|
||||
bw->accum <<= FLAC__HALF_TEMP_BITS; \
|
||||
bw->accum += wide_accum >> FLAC__HALF_TEMP_BITS; \
|
||||
bw->buffer[bw->words++] = SWAP_BE_WORD_TO_HOST(bw->accum); \
|
||||
wide_accum <<= FLAC__HALF_TEMP_BITS; \
|
||||
bw->bits = 0; \
|
||||
} \
|
||||
bitpointer += FLAC__HALF_TEMP_BITS; \
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
FLAC__bool FLAC__bitwriter_write_rice_signed_block(FLAC__BitWriter *bw, const FLAC__int32 *vals, uint32_t nvals, uint32_t parameter)
|
||||
{
|
||||
const FLAC__uint32 mask1 = (FLAC__uint32)0xffffffff << parameter; /* we val|=mask1 to set the stop bit above it... */
|
||||
const FLAC__uint32 mask2 = (FLAC__uint32)0xffffffff >> (31-parameter); /* ...then mask off the bits above the stop bit with val&=mask2 */
|
||||
FLAC__uint32 uval;
|
||||
const uint32_t lsbits = 1 + parameter;
|
||||
uint32_t msbits, total_bits;
|
||||
FLAC__bwtemp wide_accum = 0;
|
||||
FLAC__uint32 bitpointer = FLAC__TEMP_BITS;
|
||||
|
||||
FLAC__ASSERT(0 != bw);
|
||||
FLAC__ASSERT(0 != bw->buffer);
|
||||
FLAC__ASSERT(parameter < 31);
|
||||
/* WATCHOUT: code does not work with <32bit words; we can make things much faster with this assertion */
|
||||
FLAC__ASSERT(FLAC__BITS_PER_WORD >= 32);
|
||||
#if (ENABLE_64_BIT_WORDS == 0)
|
||||
if(bw->bits > 0) {
|
||||
bitpointer -= bw->bits;
|
||||
wide_accum = (FLAC__bwtemp)(bw->accum) << bitpointer;
|
||||
bw->bits = 0;
|
||||
}
|
||||
#else
|
||||
if(bw->bits > 0 && bw->bits < FLAC__HALF_TEMP_BITS) {
|
||||
bitpointer -= bw->bits;
|
||||
wide_accum = bw->accum << bitpointer;
|
||||
bw->bits = 0;
|
||||
}
|
||||
else if(bw->bits > FLAC__HALF_TEMP_BITS) {
|
||||
bitpointer -= (bw->bits - FLAC__HALF_TEMP_BITS);
|
||||
wide_accum = bw->accum << bitpointer;
|
||||
bw->accum >>= (bw->bits - FLAC__HALF_TEMP_BITS);
|
||||
bw->bits = FLAC__HALF_TEMP_BITS;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Reserve one FLAC__TEMP_BITS per symbol, so checks for space are only necessary when very large symbols are encountered
|
||||
* this might be considered wasteful, but is only at most 8kB more than necessary for a blocksize of 4096 */
|
||||
if(bw->capacity * FLAC__BITS_PER_WORD <= bw->words * FLAC__BITS_PER_WORD + nvals * FLAC__TEMP_BITS + bw->bits && !bitwriter_grow_(bw, nvals * FLAC__TEMP_BITS))
|
||||
return false;
|
||||
|
||||
while(nvals) {
|
||||
/* fold signed to uint32_t; actual formula is: negative(v)? -2v-1 : 2v */
|
||||
uval = *vals;
|
||||
uval <<= 1;
|
||||
uval ^= (*vals>>31);
|
||||
|
||||
msbits = uval >> parameter;
|
||||
total_bits = lsbits + msbits;
|
||||
|
||||
uval |= mask1; /* set stop bit */
|
||||
uval &= mask2; /* mask off unused top bits */
|
||||
|
||||
|
||||
if(total_bits <= bitpointer) {
|
||||
/* There is room enough to store the symbol whole at once */
|
||||
wide_accum |= (FLAC__bwtemp)(uval) << (bitpointer - total_bits);
|
||||
bitpointer -= total_bits;
|
||||
if(bitpointer <= FLAC__HALF_TEMP_BITS) {
|
||||
/* A word is finished, copy the upper 32 bits of the wide_accum */
|
||||
WIDE_ACCUM_TO_BW
|
||||
}
|
||||
}
|
||||
else {
|
||||
/* The symbol needs to be split. This code isn't used often */
|
||||
/* First check for space in the bitwriter */
|
||||
if(total_bits > FLAC__TEMP_BITS) {
|
||||
FLAC__uint32 oversize_in_bits = total_bits - FLAC__TEMP_BITS;
|
||||
FLAC__uint32 capacity_needed = bw->words * FLAC__BITS_PER_WORD + bw->bits + nvals * FLAC__TEMP_BITS + oversize_in_bits;
|
||||
if(bw->capacity * FLAC__BITS_PER_WORD <= capacity_needed && !bitwriter_grow_(bw, nvals * FLAC__TEMP_BITS + oversize_in_bits))
|
||||
return false;
|
||||
}
|
||||
if(msbits > bitpointer) {
|
||||
/* We have a lot of 0 bits to write, first align with bitwriter word */
|
||||
msbits -= bitpointer - FLAC__HALF_TEMP_BITS;
|
||||
bitpointer = FLAC__HALF_TEMP_BITS;
|
||||
WIDE_ACCUM_TO_BW
|
||||
while(msbits > bitpointer) {
|
||||
/* As the accumulator is already zero, we only need to
|
||||
* assign zeroes to the bitbuffer */
|
||||
WIDE_ACCUM_TO_BW
|
||||
bitpointer -= FLAC__HALF_TEMP_BITS;
|
||||
msbits -= FLAC__HALF_TEMP_BITS;
|
||||
}
|
||||
/* The remaining bits are zero, and the accumulator already is zero,
|
||||
* so just subtract the number of bits from bitpointer. When storing,
|
||||
* we can also just store 0 */
|
||||
bitpointer -= msbits;
|
||||
if(bitpointer <= FLAC__HALF_TEMP_BITS)
|
||||
WIDE_ACCUM_TO_BW
|
||||
}
|
||||
else {
|
||||
bitpointer -= msbits;
|
||||
if(bitpointer <= FLAC__HALF_TEMP_BITS)
|
||||
WIDE_ACCUM_TO_BW
|
||||
}
|
||||
/* The lsbs + stop bit always fit 32 bit, so this code mirrors the code above */
|
||||
wide_accum |= (FLAC__bwtemp)(uval) << (bitpointer - lsbits);
|
||||
bitpointer -= lsbits;
|
||||
if(bitpointer <= FLAC__HALF_TEMP_BITS) {
|
||||
/* A word is finished, copy the upper 32 bits of the wide_accum */
|
||||
WIDE_ACCUM_TO_BW
|
||||
}
|
||||
}
|
||||
vals++;
|
||||
nvals--;
|
||||
}
|
||||
/* Now fixup remainder of wide_accum */
|
||||
#if (ENABLE_64_BIT_WORDS == 0)
|
||||
if(bitpointer < FLAC__TEMP_BITS) {
|
||||
bw->accum = wide_accum >> bitpointer;
|
||||
bw->bits = FLAC__TEMP_BITS - bitpointer;
|
||||
}
|
||||
#else
|
||||
if(bitpointer < FLAC__TEMP_BITS) {
|
||||
if(bw->bits == 0) {
|
||||
bw->accum = wide_accum >> bitpointer;
|
||||
bw->bits = FLAC__TEMP_BITS - bitpointer;
|
||||
}
|
||||
else if (bw->bits == FLAC__HALF_TEMP_BITS) {
|
||||
bw->accum <<= FLAC__TEMP_BITS - bitpointer;
|
||||
bw->accum |= (wide_accum >> bitpointer);
|
||||
bw->bits = FLAC__HALF_TEMP_BITS + FLAC__TEMP_BITS - bitpointer;
|
||||
}
|
||||
else {
|
||||
FLAC__ASSERT(0);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
#if 0 /* UNUSED */
|
||||
FLAC__bool FLAC__bitwriter_write_golomb_signed(FLAC__BitWriter *bw, int val, uint32_t parameter)
|
||||
{
|
||||
uint32_t total_bits, msbs, uval;
|
||||
uint32_t k;
|
||||
|
||||
FLAC__ASSERT(0 != bw);
|
||||
FLAC__ASSERT(0 != bw->buffer);
|
||||
FLAC__ASSERT(parameter > 0);
|
||||
|
||||
/* fold signed to uint32_t */
|
||||
if(val < 0)
|
||||
uval = (uint32_t)(((-(++val)) << 1) + 1);
|
||||
else
|
||||
uval = (uint32_t)(val << 1);
|
||||
|
||||
k = FLAC__bitmath_ilog2(parameter);
|
||||
if(parameter == 1u<<k) {
|
||||
uint32_t pattern;
|
||||
|
||||
FLAC__ASSERT(k <= 30);
|
||||
|
||||
msbs = uval >> k;
|
||||
total_bits = 1 + k + msbs;
|
||||
pattern = 1 << k; /* the unary end bit */
|
||||
pattern |= (uval & ((1u<<k)-1)); /* the binary LSBs */
|
||||
|
||||
if(total_bits <= 32) {
|
||||
if(!FLAC__bitwriter_write_raw_uint32(bw, pattern, total_bits))
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
/* write the unary MSBs */
|
||||
if(!FLAC__bitwriter_write_zeroes(bw, msbs))
|
||||
return false;
|
||||
/* write the unary end bit and binary LSBs */
|
||||
if(!FLAC__bitwriter_write_raw_uint32(bw, pattern, k+1))
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else {
|
||||
uint32_t q, r, d;
|
||||
|
||||
d = (1 << (k+1)) - parameter;
|
||||
q = uval / parameter;
|
||||
r = uval - (q * parameter);
|
||||
/* write the unary MSBs */
|
||||
if(!FLAC__bitwriter_write_zeroes(bw, q))
|
||||
return false;
|
||||
/* write the unary end bit */
|
||||
if(!FLAC__bitwriter_write_raw_uint32(bw, 1, 1))
|
||||
return false;
|
||||
/* write the binary LSBs */
|
||||
if(r >= d) {
|
||||
if(!FLAC__bitwriter_write_raw_uint32(bw, r+d, k+1))
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
if(!FLAC__bitwriter_write_raw_uint32(bw, r, k))
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
FLAC__bool FLAC__bitwriter_write_golomb_unsigned(FLAC__BitWriter *bw, uint32_t uval, uint32_t parameter)
|
||||
{
|
||||
uint32_t total_bits, msbs;
|
||||
uint32_t k;
|
||||
|
||||
FLAC__ASSERT(0 != bw);
|
||||
FLAC__ASSERT(0 != bw->buffer);
|
||||
FLAC__ASSERT(parameter > 0);
|
||||
|
||||
k = FLAC__bitmath_ilog2(parameter);
|
||||
if(parameter == 1u<<k) {
|
||||
uint32_t pattern;
|
||||
|
||||
FLAC__ASSERT(k <= 30);
|
||||
|
||||
msbs = uval >> k;
|
||||
total_bits = 1 + k + msbs;
|
||||
pattern = 1 << k; /* the unary end bit */
|
||||
pattern |= (uval & ((1u<<k)-1)); /* the binary LSBs */
|
||||
|
||||
if(total_bits <= 32) {
|
||||
if(!FLAC__bitwriter_write_raw_uint32(bw, pattern, total_bits))
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
/* write the unary MSBs */
|
||||
if(!FLAC__bitwriter_write_zeroes(bw, msbs))
|
||||
return false;
|
||||
/* write the unary end bit and binary LSBs */
|
||||
if(!FLAC__bitwriter_write_raw_uint32(bw, pattern, k+1))
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else {
|
||||
uint32_t q, r, d;
|
||||
|
||||
d = (1 << (k+1)) - parameter;
|
||||
q = uval / parameter;
|
||||
r = uval - (q * parameter);
|
||||
/* write the unary MSBs */
|
||||
if(!FLAC__bitwriter_write_zeroes(bw, q))
|
||||
return false;
|
||||
/* write the unary end bit */
|
||||
if(!FLAC__bitwriter_write_raw_uint32(bw, 1, 1))
|
||||
return false;
|
||||
/* write the binary LSBs */
|
||||
if(r >= d) {
|
||||
if(!FLAC__bitwriter_write_raw_uint32(bw, r+d, k+1))
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
if(!FLAC__bitwriter_write_raw_uint32(bw, r, k))
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
#endif /* UNUSED */
|
||||
|
||||
FLAC__bool FLAC__bitwriter_write_utf8_uint32(FLAC__BitWriter *bw, FLAC__uint32 val)
|
||||
{
|
||||
FLAC__bool ok = 1;
|
||||
|
||||
FLAC__ASSERT(0 != bw);
|
||||
FLAC__ASSERT(0 != bw->buffer);
|
||||
|
||||
if((val & 0x80000000) != 0) /* this version only handles 31 bits */
|
||||
return false;
|
||||
|
||||
if(val < 0x80) {
|
||||
return FLAC__bitwriter_write_raw_uint32_nocheck(bw, val, 8);
|
||||
}
|
||||
else if(val < 0x800) {
|
||||
ok &= FLAC__bitwriter_write_raw_uint32_nocheck(bw, 0xC0 | (val>>6), 8);
|
||||
ok &= FLAC__bitwriter_write_raw_uint32_nocheck(bw, 0x80 | (val&0x3F), 8);
|
||||
}
|
||||
else if(val < 0x10000) {
|
||||
ok &= FLAC__bitwriter_write_raw_uint32_nocheck(bw, 0xE0 | (val>>12), 8);
|
||||
ok &= FLAC__bitwriter_write_raw_uint32_nocheck(bw, 0x80 | ((val>>6)&0x3F), 8);
|
||||
ok &= FLAC__bitwriter_write_raw_uint32_nocheck(bw, 0x80 | (val&0x3F), 8);
|
||||
}
|
||||
else if(val < 0x200000) {
|
||||
ok &= FLAC__bitwriter_write_raw_uint32_nocheck(bw, 0xF0 | (val>>18), 8);
|
||||
ok &= FLAC__bitwriter_write_raw_uint32_nocheck(bw, 0x80 | ((val>>12)&0x3F), 8);
|
||||
ok &= FLAC__bitwriter_write_raw_uint32_nocheck(bw, 0x80 | ((val>>6)&0x3F), 8);
|
||||
ok &= FLAC__bitwriter_write_raw_uint32_nocheck(bw, 0x80 | (val&0x3F), 8);
|
||||
}
|
||||
else if(val < 0x4000000) {
|
||||
ok &= FLAC__bitwriter_write_raw_uint32_nocheck(bw, 0xF8 | (val>>24), 8);
|
||||
ok &= FLAC__bitwriter_write_raw_uint32_nocheck(bw, 0x80 | ((val>>18)&0x3F), 8);
|
||||
ok &= FLAC__bitwriter_write_raw_uint32_nocheck(bw, 0x80 | ((val>>12)&0x3F), 8);
|
||||
ok &= FLAC__bitwriter_write_raw_uint32_nocheck(bw, 0x80 | ((val>>6)&0x3F), 8);
|
||||
ok &= FLAC__bitwriter_write_raw_uint32_nocheck(bw, 0x80 | (val&0x3F), 8);
|
||||
}
|
||||
else {
|
||||
ok &= FLAC__bitwriter_write_raw_uint32_nocheck(bw, 0xFC | (val>>30), 8);
|
||||
ok &= FLAC__bitwriter_write_raw_uint32_nocheck(bw, 0x80 | ((val>>24)&0x3F), 8);
|
||||
ok &= FLAC__bitwriter_write_raw_uint32_nocheck(bw, 0x80 | ((val>>18)&0x3F), 8);
|
||||
ok &= FLAC__bitwriter_write_raw_uint32_nocheck(bw, 0x80 | ((val>>12)&0x3F), 8);
|
||||
ok &= FLAC__bitwriter_write_raw_uint32_nocheck(bw, 0x80 | ((val>>6)&0x3F), 8);
|
||||
ok &= FLAC__bitwriter_write_raw_uint32_nocheck(bw, 0x80 | (val&0x3F), 8);
|
||||
}
|
||||
|
||||
return ok;
|
||||
}
|
||||
|
||||
FLAC__bool FLAC__bitwriter_write_utf8_uint64(FLAC__BitWriter *bw, FLAC__uint64 val)
|
||||
{
|
||||
FLAC__bool ok = 1;
|
||||
|
||||
FLAC__ASSERT(0 != bw);
|
||||
FLAC__ASSERT(0 != bw->buffer);
|
||||
|
||||
if((val & FLAC__U64L(0xFFFFFFF000000000)) != 0) /* this version only handles 36 bits */
|
||||
return false;
|
||||
|
||||
if(val < 0x80) {
|
||||
return FLAC__bitwriter_write_raw_uint32_nocheck(bw, (FLAC__uint32)val, 8);
|
||||
}
|
||||
else if(val < 0x800) {
|
||||
ok &= FLAC__bitwriter_write_raw_uint32_nocheck(bw, 0xC0 | (FLAC__uint32)(val>>6), 8);
|
||||
ok &= FLAC__bitwriter_write_raw_uint32_nocheck(bw, 0x80 | (FLAC__uint32)(val&0x3F), 8);
|
||||
}
|
||||
else if(val < 0x10000) {
|
||||
ok &= FLAC__bitwriter_write_raw_uint32_nocheck(bw, 0xE0 | (FLAC__uint32)(val>>12), 8);
|
||||
ok &= FLAC__bitwriter_write_raw_uint32_nocheck(bw, 0x80 | (FLAC__uint32)((val>>6)&0x3F), 8);
|
||||
ok &= FLAC__bitwriter_write_raw_uint32_nocheck(bw, 0x80 | (FLAC__uint32)(val&0x3F), 8);
|
||||
}
|
||||
else if(val < 0x200000) {
|
||||
ok &= FLAC__bitwriter_write_raw_uint32_nocheck(bw, 0xF0 | (FLAC__uint32)(val>>18), 8);
|
||||
ok &= FLAC__bitwriter_write_raw_uint32_nocheck(bw, 0x80 | (FLAC__uint32)((val>>12)&0x3F), 8);
|
||||
ok &= FLAC__bitwriter_write_raw_uint32_nocheck(bw, 0x80 | (FLAC__uint32)((val>>6)&0x3F), 8);
|
||||
ok &= FLAC__bitwriter_write_raw_uint32_nocheck(bw, 0x80 | (FLAC__uint32)(val&0x3F), 8);
|
||||
}
|
||||
else if(val < 0x4000000) {
|
||||
ok &= FLAC__bitwriter_write_raw_uint32_nocheck(bw, 0xF8 | (FLAC__uint32)(val>>24), 8);
|
||||
ok &= FLAC__bitwriter_write_raw_uint32_nocheck(bw, 0x80 | (FLAC__uint32)((val>>18)&0x3F), 8);
|
||||
ok &= FLAC__bitwriter_write_raw_uint32_nocheck(bw, 0x80 | (FLAC__uint32)((val>>12)&0x3F), 8);
|
||||
ok &= FLAC__bitwriter_write_raw_uint32_nocheck(bw, 0x80 | (FLAC__uint32)((val>>6)&0x3F), 8);
|
||||
ok &= FLAC__bitwriter_write_raw_uint32_nocheck(bw, 0x80 | (FLAC__uint32)(val&0x3F), 8);
|
||||
}
|
||||
else if(val < 0x80000000) {
|
||||
ok &= FLAC__bitwriter_write_raw_uint32_nocheck(bw, 0xFC | (FLAC__uint32)(val>>30), 8);
|
||||
ok &= FLAC__bitwriter_write_raw_uint32_nocheck(bw, 0x80 | (FLAC__uint32)((val>>24)&0x3F), 8);
|
||||
ok &= FLAC__bitwriter_write_raw_uint32_nocheck(bw, 0x80 | (FLAC__uint32)((val>>18)&0x3F), 8);
|
||||
ok &= FLAC__bitwriter_write_raw_uint32_nocheck(bw, 0x80 | (FLAC__uint32)((val>>12)&0x3F), 8);
|
||||
ok &= FLAC__bitwriter_write_raw_uint32_nocheck(bw, 0x80 | (FLAC__uint32)((val>>6)&0x3F), 8);
|
||||
ok &= FLAC__bitwriter_write_raw_uint32_nocheck(bw, 0x80 | (FLAC__uint32)(val&0x3F), 8);
|
||||
}
|
||||
else {
|
||||
ok &= FLAC__bitwriter_write_raw_uint32_nocheck(bw, 0xFE, 8);
|
||||
ok &= FLAC__bitwriter_write_raw_uint32_nocheck(bw, 0x80 | (FLAC__uint32)((val>>30)&0x3F), 8);
|
||||
ok &= FLAC__bitwriter_write_raw_uint32_nocheck(bw, 0x80 | (FLAC__uint32)((val>>24)&0x3F), 8);
|
||||
ok &= FLAC__bitwriter_write_raw_uint32_nocheck(bw, 0x80 | (FLAC__uint32)((val>>18)&0x3F), 8);
|
||||
ok &= FLAC__bitwriter_write_raw_uint32_nocheck(bw, 0x80 | (FLAC__uint32)((val>>12)&0x3F), 8);
|
||||
ok &= FLAC__bitwriter_write_raw_uint32_nocheck(bw, 0x80 | (FLAC__uint32)((val>>6)&0x3F), 8);
|
||||
ok &= FLAC__bitwriter_write_raw_uint32_nocheck(bw, 0x80 | (FLAC__uint32)(val&0x3F), 8);
|
||||
}
|
||||
|
||||
return ok;
|
||||
}
|
||||
|
||||
FLAC__bool FLAC__bitwriter_zero_pad_to_byte_boundary(FLAC__BitWriter *bw)
|
||||
{
|
||||
/* 0-pad to byte boundary */
|
||||
if(bw->bits & 7u)
|
||||
return FLAC__bitwriter_write_zeroes(bw, 8 - (bw->bits & 7u));
|
||||
else
|
||||
return true;
|
||||
}
|
||||
|
||||
/* These functions are declared inline in this file but are also callable as
|
||||
* externs from elsewhere.
|
||||
* According to the C99 spec, section 6.7.4, simply providing a function
|
||||
* prototype in a header file without 'inline' and making the function inline
|
||||
* in this file should be sufficient.
|
||||
* Unfortunately, the Microsoft VS compiler doesn't pick them up externally. To
|
||||
* fix that we add extern declarations here.
|
||||
*/
|
||||
extern FLAC__bool FLAC__bitwriter_write_zeroes(FLAC__BitWriter *bw, uint32_t bits);
|
||||
extern FLAC__bool FLAC__bitwriter_write_raw_uint32(FLAC__BitWriter *bw, FLAC__uint32 val, uint32_t bits);
|
||||
extern FLAC__bool FLAC__bitwriter_write_raw_int32(FLAC__BitWriter *bw, FLAC__int32 val, uint32_t bits);
|
||||
extern FLAC__bool FLAC__bitwriter_write_raw_uint64(FLAC__BitWriter *bw, FLAC__uint64 val, uint32_t bits);
|
||||
extern FLAC__bool FLAC__bitwriter_write_raw_int64(FLAC__BitWriter *bw, FLAC__int64 val, uint32_t bits);
|
||||
extern FLAC__bool FLAC__bitwriter_write_raw_uint32_little_endian(FLAC__BitWriter *bw, FLAC__uint32 val);
|
||||
extern FLAC__bool FLAC__bitwriter_write_byte_block(FLAC__BitWriter *bw, const FLAC__byte vals[], uint32_t nvals);
|
||||
|
|
@ -1,261 +0,0 @@
|
|||
/* libFLAC - Free Lossless Audio Codec library
|
||||
* Copyright (C) 2001-2009 Josh Coalson
|
||||
* Copyright (C) 2011-2023 Xiph.Org Foundation
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* - Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* - Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* - Neither the name of the Xiph.org Foundation nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include "include/private/cpu.h"
|
||||
#include "../compat.h"
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#if defined _MSC_VER
|
||||
#include <intrin.h> /* for __cpuid() and _xgetbv() */
|
||||
#elif defined __GNUC__ && defined HAVE_CPUID_H
|
||||
#include <cpuid.h> /* for __get_cpuid() and __get_cpuid_max() */
|
||||
#endif
|
||||
|
||||
#ifndef NDEBUG
|
||||
#include <stdio.h>
|
||||
#define dfprintf fprintf
|
||||
#else
|
||||
/* This is bad practice, it should be a static void empty function */
|
||||
#define dfprintf(file, format, ...)
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_SYS_AUXV_H)
|
||||
#include <sys/auxv.h>
|
||||
#endif
|
||||
|
||||
#if (defined FLAC__CPU_IA32 || defined FLAC__CPU_X86_64) && FLAC__HAS_X86INTRIN && !defined FLAC__NO_ASM
|
||||
|
||||
/* these are flags in EDX of CPUID AX=00000001 */
|
||||
static const uint32_t FLAC__CPUINFO_X86_CPUID_CMOV = 0x00008000;
|
||||
static const uint32_t FLAC__CPUINFO_X86_CPUID_MMX = 0x00800000;
|
||||
static const uint32_t FLAC__CPUINFO_X86_CPUID_SSE = 0x02000000;
|
||||
static const uint32_t FLAC__CPUINFO_X86_CPUID_SSE2 = 0x04000000;
|
||||
|
||||
/* these are flags in ECX of CPUID AX=00000001 */
|
||||
static const uint32_t FLAC__CPUINFO_X86_CPUID_SSE3 = 0x00000001;
|
||||
static const uint32_t FLAC__CPUINFO_X86_CPUID_SSSE3 = 0x00000200;
|
||||
static const uint32_t FLAC__CPUINFO_X86_CPUID_SSE41 = 0x00080000;
|
||||
static const uint32_t FLAC__CPUINFO_X86_CPUID_SSE42 = 0x00100000;
|
||||
static const uint32_t FLAC__CPUINFO_X86_CPUID_OSXSAVE = 0x08000000;
|
||||
static const uint32_t FLAC__CPUINFO_X86_CPUID_AVX = 0x10000000;
|
||||
static const uint32_t FLAC__CPUINFO_X86_CPUID_FMA = 0x00001000;
|
||||
|
||||
/* these are flags in EBX of CPUID AX=00000007 */
|
||||
static const uint32_t FLAC__CPUINFO_X86_CPUID_AVX2 = 0x00000020;
|
||||
static const uint32_t FLAC__CPUINFO_X86_CPUID_BMI2 = 0x00000100;
|
||||
|
||||
#if FLAC__AVX_SUPPORTED
|
||||
static uint32_t
|
||||
cpu_xgetbv_x86(void)
|
||||
{
|
||||
#if (defined _MSC_VER || defined __INTEL_COMPILER) && FLAC__AVX_SUPPORTED
|
||||
return (uint32_t)_xgetbv(0);
|
||||
#elif defined __GNUC__
|
||||
uint32_t lo, hi;
|
||||
__asm__ volatile (".byte 0x0f, 0x01, 0xd0" : "=a"(lo), "=d"(hi) : "c" (0));
|
||||
return lo;
|
||||
#else
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
static uint32_t
|
||||
cpu_have_cpuid(void)
|
||||
{
|
||||
#if defined FLAC__CPU_X86_64 || defined __i686__ || defined __SSE__ || (defined _M_IX86_FP && _M_IX86_FP > 0)
|
||||
/* target CPU does have CPUID instruction */
|
||||
return 1;
|
||||
#elif defined __GNUC__ && defined HAVE_CPUID_H
|
||||
if (__get_cpuid_max(0, 0) != 0)
|
||||
return 1;
|
||||
else
|
||||
return 0;
|
||||
#elif defined _MSC_VER
|
||||
FLAC__uint32 flags1, flags2;
|
||||
__asm {
|
||||
pushfd
|
||||
pushfd
|
||||
pop eax
|
||||
mov flags1, eax
|
||||
xor eax, 0x200000
|
||||
push eax
|
||||
popfd
|
||||
pushfd
|
||||
pop eax
|
||||
mov flags2, eax
|
||||
popfd
|
||||
}
|
||||
if (((flags1^flags2) & 0x200000) != 0)
|
||||
return 1;
|
||||
else
|
||||
return 0;
|
||||
#else
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
static void
|
||||
cpuinfo_x86([[maybe_unused]] FLAC__uint32 level, FLAC__uint32 *eax, FLAC__uint32 *ebx, FLAC__uint32 *ecx, FLAC__uint32 *edx)
|
||||
{
|
||||
#if defined _MSC_VER
|
||||
int cpuinfo[4];
|
||||
int ext = level & 0x80000000;
|
||||
__cpuid(cpuinfo, ext);
|
||||
if ((uint32_t)cpuinfo[0] >= level) {
|
||||
#if FLAC__AVX_SUPPORTED
|
||||
__cpuidex(cpuinfo, level, 0); /* for AVX2 detection */
|
||||
#else
|
||||
__cpuid(cpuinfo, level); /* some old compilers don't support __cpuidex */
|
||||
#endif
|
||||
*eax = cpuinfo[0]; *ebx = cpuinfo[1]; *ecx = cpuinfo[2]; *edx = cpuinfo[3];
|
||||
return;
|
||||
}
|
||||
#elif defined __GNUC__ && defined HAVE_CPUID_H
|
||||
FLAC__uint32 ext = level & 0x80000000;
|
||||
__cpuid(ext, *eax, *ebx, *ecx, *edx);
|
||||
if (*eax >= level) {
|
||||
__cpuid_count(level, 0, *eax, *ebx, *ecx, *edx);
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
*eax = *ebx = *ecx = *edx = 0;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
static void
|
||||
x86_cpu_info (FLAC__CPUInfo *info)
|
||||
{
|
||||
#if (defined FLAC__CPU_IA32 || defined FLAC__CPU_X86_64) && FLAC__HAS_X86INTRIN && !defined FLAC__NO_ASM
|
||||
#if FLAC__AVX_SUPPORTED
|
||||
FLAC__bool x86_osxsave = false;
|
||||
#endif
|
||||
FLAC__bool os_avx = false;
|
||||
FLAC__uint32 flags_eax, flags_ebx, flags_ecx, flags_edx;
|
||||
|
||||
info->use_asm = true; /* we assume a minimum of 80386 */
|
||||
if (!cpu_have_cpuid())
|
||||
return;
|
||||
|
||||
cpuinfo_x86(0, &flags_eax, &flags_ebx, &flags_ecx, &flags_edx);
|
||||
info->x86.intel = (flags_ebx == 0x756E6547 && flags_edx == 0x49656E69 && flags_ecx == 0x6C65746E) ? true : false; /* GenuineIntel */
|
||||
cpuinfo_x86(1, &flags_eax, &flags_ebx, &flags_ecx, &flags_edx);
|
||||
|
||||
info->x86.cmov = (flags_edx & FLAC__CPUINFO_X86_CPUID_CMOV ) ? true : false;
|
||||
info->x86.mmx = (flags_edx & FLAC__CPUINFO_X86_CPUID_MMX ) ? true : false;
|
||||
info->x86.sse = (flags_edx & FLAC__CPUINFO_X86_CPUID_SSE ) ? true : false;
|
||||
info->x86.sse2 = (flags_edx & FLAC__CPUINFO_X86_CPUID_SSE2 ) ? true : false;
|
||||
info->x86.sse3 = (flags_ecx & FLAC__CPUINFO_X86_CPUID_SSE3 ) ? true : false;
|
||||
info->x86.ssse3 = (flags_ecx & FLAC__CPUINFO_X86_CPUID_SSSE3) ? true : false;
|
||||
info->x86.sse41 = (flags_ecx & FLAC__CPUINFO_X86_CPUID_SSE41) ? true : false;
|
||||
info->x86.sse42 = (flags_ecx & FLAC__CPUINFO_X86_CPUID_SSE42) ? true : false;
|
||||
|
||||
#if (FLAC__AVX_SUPPORTED)
|
||||
x86_osxsave = (flags_ecx & FLAC__CPUINFO_X86_CPUID_OSXSAVE) ? true : false;
|
||||
info->x86.avx = (flags_ecx & FLAC__CPUINFO_X86_CPUID_AVX ) ? true : false;
|
||||
info->x86.fma = (flags_ecx & FLAC__CPUINFO_X86_CPUID_FMA ) ? true : false;
|
||||
cpuinfo_x86(7, &flags_eax, &flags_ebx, &flags_ecx, &flags_edx);
|
||||
info->x86.avx2 = (flags_ebx & FLAC__CPUINFO_X86_CPUID_AVX2 ) ? true : false;
|
||||
info->x86.bmi2 = (flags_ebx & FLAC__CPUINFO_X86_CPUID_BMI2 ) ? true : false;
|
||||
#endif
|
||||
|
||||
#if defined FLAC__CPU_IA32
|
||||
dfprintf(stderr, "CPU info (IA-32):\n", "");
|
||||
#else
|
||||
dfprintf(stderr, "CPU info (x86-64):\n", "");
|
||||
#endif
|
||||
dfprintf(stderr, " CMOV ....... %c\n", info->x86.cmov ? 'Y' : 'n');
|
||||
dfprintf(stderr, " MMX ........ %c\n", info->x86.mmx ? 'Y' : 'n');
|
||||
dfprintf(stderr, " SSE ........ %c\n", info->x86.sse ? 'Y' : 'n');
|
||||
dfprintf(stderr, " SSE2 ....... %c\n", info->x86.sse2 ? 'Y' : 'n');
|
||||
dfprintf(stderr, " SSE3 ....... %c\n", info->x86.sse3 ? 'Y' : 'n');
|
||||
dfprintf(stderr, " SSSE3 ...... %c\n", info->x86.ssse3 ? 'Y' : 'n');
|
||||
dfprintf(stderr, " SSE41 ...... %c\n", info->x86.sse41 ? 'Y' : 'n');
|
||||
dfprintf(stderr, " SSE42 ...... %c\n", info->x86.sse42 ? 'Y' : 'n');
|
||||
|
||||
if (FLAC__AVX_SUPPORTED) {
|
||||
dfprintf(stderr, " AVX ........ %c\n", info->x86.avx ? 'Y' : 'n');
|
||||
dfprintf(stderr, " FMA ........ %c\n", info->x86.fma ? 'Y' : 'n');
|
||||
dfprintf(stderr, " AVX2 ....... %c\n", info->x86.avx2 ? 'Y' : 'n');
|
||||
dfprintf(stderr, " BMI2 ....... %c\n", info->x86.bmi2 ? 'Y' : 'n');
|
||||
}
|
||||
|
||||
/*
|
||||
* now have to check for OS support of AVX instructions
|
||||
*/
|
||||
#if FLAC__AVX_SUPPORTED
|
||||
if (info->x86.avx && x86_osxsave && (cpu_xgetbv_x86() & 0x6) == 0x6) {
|
||||
os_avx = true;
|
||||
}
|
||||
#endif
|
||||
if (os_avx) {
|
||||
dfprintf(stderr, " AVX OS sup . %c\n", info->x86.avx ? 'Y' : 'n');
|
||||
}
|
||||
if (!os_avx) {
|
||||
/* no OS AVX support */
|
||||
info->x86.avx = false;
|
||||
info->x86.avx2 = false;
|
||||
info->x86.fma = false;
|
||||
}
|
||||
#else
|
||||
info->use_asm = false;
|
||||
#endif
|
||||
}
|
||||
|
||||
void FLAC__cpu_info (FLAC__CPUInfo *info)
|
||||
{
|
||||
memset(info, 0, sizeof(*info));
|
||||
|
||||
#ifdef FLAC__CPU_IA32
|
||||
info->type = FLAC__CPUINFO_TYPE_IA32;
|
||||
#elif defined FLAC__CPU_X86_64
|
||||
info->type = FLAC__CPUINFO_TYPE_X86_64;
|
||||
#else
|
||||
info->type = FLAC__CPUINFO_TYPE_UNKNOWN;
|
||||
#endif
|
||||
|
||||
switch (info->type) {
|
||||
case FLAC__CPUINFO_TYPE_IA32: /* fallthrough */
|
||||
case FLAC__CPUINFO_TYPE_X86_64:
|
||||
x86_cpu_info (info);
|
||||
break;
|
||||
default:
|
||||
info->use_asm = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,436 +0,0 @@
|
|||
/* libFLAC - Free Lossless Audio Codec library
|
||||
* Copyright (C) 2000-2009 Josh Coalson
|
||||
* Copyright (C) 2011-2023 Xiph.Org Foundation
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* - Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* - Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* - Neither the name of the Xiph.org Foundation nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include "include/private/crc.h"
|
||||
|
||||
/* CRC-8, poly = x^8 + x^2 + x^1 + x^0, init = 0 */
|
||||
|
||||
FLAC__uint8 const FLAC__crc8_table[256] = {
|
||||
0x00, 0x07, 0x0E, 0x09, 0x1C, 0x1B, 0x12, 0x15,
|
||||
0x38, 0x3F, 0x36, 0x31, 0x24, 0x23, 0x2A, 0x2D,
|
||||
0x70, 0x77, 0x7E, 0x79, 0x6C, 0x6B, 0x62, 0x65,
|
||||
0x48, 0x4F, 0x46, 0x41, 0x54, 0x53, 0x5A, 0x5D,
|
||||
0xE0, 0xE7, 0xEE, 0xE9, 0xFC, 0xFB, 0xF2, 0xF5,
|
||||
0xD8, 0xDF, 0xD6, 0xD1, 0xC4, 0xC3, 0xCA, 0xCD,
|
||||
0x90, 0x97, 0x9E, 0x99, 0x8C, 0x8B, 0x82, 0x85,
|
||||
0xA8, 0xAF, 0xA6, 0xA1, 0xB4, 0xB3, 0xBA, 0xBD,
|
||||
0xC7, 0xC0, 0xC9, 0xCE, 0xDB, 0xDC, 0xD5, 0xD2,
|
||||
0xFF, 0xF8, 0xF1, 0xF6, 0xE3, 0xE4, 0xED, 0xEA,
|
||||
0xB7, 0xB0, 0xB9, 0xBE, 0xAB, 0xAC, 0xA5, 0xA2,
|
||||
0x8F, 0x88, 0x81, 0x86, 0x93, 0x94, 0x9D, 0x9A,
|
||||
0x27, 0x20, 0x29, 0x2E, 0x3B, 0x3C, 0x35, 0x32,
|
||||
0x1F, 0x18, 0x11, 0x16, 0x03, 0x04, 0x0D, 0x0A,
|
||||
0x57, 0x50, 0x59, 0x5E, 0x4B, 0x4C, 0x45, 0x42,
|
||||
0x6F, 0x68, 0x61, 0x66, 0x73, 0x74, 0x7D, 0x7A,
|
||||
0x89, 0x8E, 0x87, 0x80, 0x95, 0x92, 0x9B, 0x9C,
|
||||
0xB1, 0xB6, 0xBF, 0xB8, 0xAD, 0xAA, 0xA3, 0xA4,
|
||||
0xF9, 0xFE, 0xF7, 0xF0, 0xE5, 0xE2, 0xEB, 0xEC,
|
||||
0xC1, 0xC6, 0xCF, 0xC8, 0xDD, 0xDA, 0xD3, 0xD4,
|
||||
0x69, 0x6E, 0x67, 0x60, 0x75, 0x72, 0x7B, 0x7C,
|
||||
0x51, 0x56, 0x5F, 0x58, 0x4D, 0x4A, 0x43, 0x44,
|
||||
0x19, 0x1E, 0x17, 0x10, 0x05, 0x02, 0x0B, 0x0C,
|
||||
0x21, 0x26, 0x2F, 0x28, 0x3D, 0x3A, 0x33, 0x34,
|
||||
0x4E, 0x49, 0x40, 0x47, 0x52, 0x55, 0x5C, 0x5B,
|
||||
0x76, 0x71, 0x78, 0x7F, 0x6A, 0x6D, 0x64, 0x63,
|
||||
0x3E, 0x39, 0x30, 0x37, 0x22, 0x25, 0x2C, 0x2B,
|
||||
0x06, 0x01, 0x08, 0x0F, 0x1A, 0x1D, 0x14, 0x13,
|
||||
0xAE, 0xA9, 0xA0, 0xA7, 0xB2, 0xB5, 0xBC, 0xBB,
|
||||
0x96, 0x91, 0x98, 0x9F, 0x8A, 0x8D, 0x84, 0x83,
|
||||
0xDE, 0xD9, 0xD0, 0xD7, 0xC2, 0xC5, 0xCC, 0xCB,
|
||||
0xE6, 0xE1, 0xE8, 0xEF, 0xFA, 0xFD, 0xF4, 0xF3
|
||||
};
|
||||
|
||||
/* CRC-16, poly = x^16 + x^15 + x^2 + x^0, init = 0 */
|
||||
|
||||
FLAC__uint16 const FLAC__crc16_table[8][256] = {
|
||||
{ 0x0000, 0x8005, 0x800f, 0x000a, 0x801b, 0x001e, 0x0014, 0x8011,
|
||||
0x8033, 0x0036, 0x003c, 0x8039, 0x0028, 0x802d, 0x8027, 0x0022,
|
||||
0x8063, 0x0066, 0x006c, 0x8069, 0x0078, 0x807d, 0x8077, 0x0072,
|
||||
0x0050, 0x8055, 0x805f, 0x005a, 0x804b, 0x004e, 0x0044, 0x8041,
|
||||
0x80c3, 0x00c6, 0x00cc, 0x80c9, 0x00d8, 0x80dd, 0x80d7, 0x00d2,
|
||||
0x00f0, 0x80f5, 0x80ff, 0x00fa, 0x80eb, 0x00ee, 0x00e4, 0x80e1,
|
||||
0x00a0, 0x80a5, 0x80af, 0x00aa, 0x80bb, 0x00be, 0x00b4, 0x80b1,
|
||||
0x8093, 0x0096, 0x009c, 0x8099, 0x0088, 0x808d, 0x8087, 0x0082,
|
||||
0x8183, 0x0186, 0x018c, 0x8189, 0x0198, 0x819d, 0x8197, 0x0192,
|
||||
0x01b0, 0x81b5, 0x81bf, 0x01ba, 0x81ab, 0x01ae, 0x01a4, 0x81a1,
|
||||
0x01e0, 0x81e5, 0x81ef, 0x01ea, 0x81fb, 0x01fe, 0x01f4, 0x81f1,
|
||||
0x81d3, 0x01d6, 0x01dc, 0x81d9, 0x01c8, 0x81cd, 0x81c7, 0x01c2,
|
||||
0x0140, 0x8145, 0x814f, 0x014a, 0x815b, 0x015e, 0x0154, 0x8151,
|
||||
0x8173, 0x0176, 0x017c, 0x8179, 0x0168, 0x816d, 0x8167, 0x0162,
|
||||
0x8123, 0x0126, 0x012c, 0x8129, 0x0138, 0x813d, 0x8137, 0x0132,
|
||||
0x0110, 0x8115, 0x811f, 0x011a, 0x810b, 0x010e, 0x0104, 0x8101,
|
||||
0x8303, 0x0306, 0x030c, 0x8309, 0x0318, 0x831d, 0x8317, 0x0312,
|
||||
0x0330, 0x8335, 0x833f, 0x033a, 0x832b, 0x032e, 0x0324, 0x8321,
|
||||
0x0360, 0x8365, 0x836f, 0x036a, 0x837b, 0x037e, 0x0374, 0x8371,
|
||||
0x8353, 0x0356, 0x035c, 0x8359, 0x0348, 0x834d, 0x8347, 0x0342,
|
||||
0x03c0, 0x83c5, 0x83cf, 0x03ca, 0x83db, 0x03de, 0x03d4, 0x83d1,
|
||||
0x83f3, 0x03f6, 0x03fc, 0x83f9, 0x03e8, 0x83ed, 0x83e7, 0x03e2,
|
||||
0x83a3, 0x03a6, 0x03ac, 0x83a9, 0x03b8, 0x83bd, 0x83b7, 0x03b2,
|
||||
0x0390, 0x8395, 0x839f, 0x039a, 0x838b, 0x038e, 0x0384, 0x8381,
|
||||
0x0280, 0x8285, 0x828f, 0x028a, 0x829b, 0x029e, 0x0294, 0x8291,
|
||||
0x82b3, 0x02b6, 0x02bc, 0x82b9, 0x02a8, 0x82ad, 0x82a7, 0x02a2,
|
||||
0x82e3, 0x02e6, 0x02ec, 0x82e9, 0x02f8, 0x82fd, 0x82f7, 0x02f2,
|
||||
0x02d0, 0x82d5, 0x82df, 0x02da, 0x82cb, 0x02ce, 0x02c4, 0x82c1,
|
||||
0x8243, 0x0246, 0x024c, 0x8249, 0x0258, 0x825d, 0x8257, 0x0252,
|
||||
0x0270, 0x8275, 0x827f, 0x027a, 0x826b, 0x026e, 0x0264, 0x8261,
|
||||
0x0220, 0x8225, 0x822f, 0x022a, 0x823b, 0x023e, 0x0234, 0x8231,
|
||||
0x8213, 0x0216, 0x021c, 0x8219, 0x0208, 0x820d, 0x8207, 0x0202 },
|
||||
|
||||
{ 0x0000, 0x8603, 0x8c03, 0x0a00, 0x9803, 0x1e00, 0x1400, 0x9203,
|
||||
0xb003, 0x3600, 0x3c00, 0xba03, 0x2800, 0xae03, 0xa403, 0x2200,
|
||||
0xe003, 0x6600, 0x6c00, 0xea03, 0x7800, 0xfe03, 0xf403, 0x7200,
|
||||
0x5000, 0xd603, 0xdc03, 0x5a00, 0xc803, 0x4e00, 0x4400, 0xc203,
|
||||
0x4003, 0xc600, 0xcc00, 0x4a03, 0xd800, 0x5e03, 0x5403, 0xd200,
|
||||
0xf000, 0x7603, 0x7c03, 0xfa00, 0x6803, 0xee00, 0xe400, 0x6203,
|
||||
0xa000, 0x2603, 0x2c03, 0xaa00, 0x3803, 0xbe00, 0xb400, 0x3203,
|
||||
0x1003, 0x9600, 0x9c00, 0x1a03, 0x8800, 0x0e03, 0x0403, 0x8200,
|
||||
0x8006, 0x0605, 0x0c05, 0x8a06, 0x1805, 0x9e06, 0x9406, 0x1205,
|
||||
0x3005, 0xb606, 0xbc06, 0x3a05, 0xa806, 0x2e05, 0x2405, 0xa206,
|
||||
0x6005, 0xe606, 0xec06, 0x6a05, 0xf806, 0x7e05, 0x7405, 0xf206,
|
||||
0xd006, 0x5605, 0x5c05, 0xda06, 0x4805, 0xce06, 0xc406, 0x4205,
|
||||
0xc005, 0x4606, 0x4c06, 0xca05, 0x5806, 0xde05, 0xd405, 0x5206,
|
||||
0x7006, 0xf605, 0xfc05, 0x7a06, 0xe805, 0x6e06, 0x6406, 0xe205,
|
||||
0x2006, 0xa605, 0xac05, 0x2a06, 0xb805, 0x3e06, 0x3406, 0xb205,
|
||||
0x9005, 0x1606, 0x1c06, 0x9a05, 0x0806, 0x8e05, 0x8405, 0x0206,
|
||||
0x8009, 0x060a, 0x0c0a, 0x8a09, 0x180a, 0x9e09, 0x9409, 0x120a,
|
||||
0x300a, 0xb609, 0xbc09, 0x3a0a, 0xa809, 0x2e0a, 0x240a, 0xa209,
|
||||
0x600a, 0xe609, 0xec09, 0x6a0a, 0xf809, 0x7e0a, 0x740a, 0xf209,
|
||||
0xd009, 0x560a, 0x5c0a, 0xda09, 0x480a, 0xce09, 0xc409, 0x420a,
|
||||
0xc00a, 0x4609, 0x4c09, 0xca0a, 0x5809, 0xde0a, 0xd40a, 0x5209,
|
||||
0x7009, 0xf60a, 0xfc0a, 0x7a09, 0xe80a, 0x6e09, 0x6409, 0xe20a,
|
||||
0x2009, 0xa60a, 0xac0a, 0x2a09, 0xb80a, 0x3e09, 0x3409, 0xb20a,
|
||||
0x900a, 0x1609, 0x1c09, 0x9a0a, 0x0809, 0x8e0a, 0x840a, 0x0209,
|
||||
0x000f, 0x860c, 0x8c0c, 0x0a0f, 0x980c, 0x1e0f, 0x140f, 0x920c,
|
||||
0xb00c, 0x360f, 0x3c0f, 0xba0c, 0x280f, 0xae0c, 0xa40c, 0x220f,
|
||||
0xe00c, 0x660f, 0x6c0f, 0xea0c, 0x780f, 0xfe0c, 0xf40c, 0x720f,
|
||||
0x500f, 0xd60c, 0xdc0c, 0x5a0f, 0xc80c, 0x4e0f, 0x440f, 0xc20c,
|
||||
0x400c, 0xc60f, 0xcc0f, 0x4a0c, 0xd80f, 0x5e0c, 0x540c, 0xd20f,
|
||||
0xf00f, 0x760c, 0x7c0c, 0xfa0f, 0x680c, 0xee0f, 0xe40f, 0x620c,
|
||||
0xa00f, 0x260c, 0x2c0c, 0xaa0f, 0x380c, 0xbe0f, 0xb40f, 0x320c,
|
||||
0x100c, 0x960f, 0x9c0f, 0x1a0c, 0x880f, 0x0e0c, 0x040c, 0x820f },
|
||||
|
||||
{ 0x0000, 0x8017, 0x802b, 0x003c, 0x8053, 0x0044, 0x0078, 0x806f,
|
||||
0x80a3, 0x00b4, 0x0088, 0x809f, 0x00f0, 0x80e7, 0x80db, 0x00cc,
|
||||
0x8143, 0x0154, 0x0168, 0x817f, 0x0110, 0x8107, 0x813b, 0x012c,
|
||||
0x01e0, 0x81f7, 0x81cb, 0x01dc, 0x81b3, 0x01a4, 0x0198, 0x818f,
|
||||
0x8283, 0x0294, 0x02a8, 0x82bf, 0x02d0, 0x82c7, 0x82fb, 0x02ec,
|
||||
0x0220, 0x8237, 0x820b, 0x021c, 0x8273, 0x0264, 0x0258, 0x824f,
|
||||
0x03c0, 0x83d7, 0x83eb, 0x03fc, 0x8393, 0x0384, 0x03b8, 0x83af,
|
||||
0x8363, 0x0374, 0x0348, 0x835f, 0x0330, 0x8327, 0x831b, 0x030c,
|
||||
0x8503, 0x0514, 0x0528, 0x853f, 0x0550, 0x8547, 0x857b, 0x056c,
|
||||
0x05a0, 0x85b7, 0x858b, 0x059c, 0x85f3, 0x05e4, 0x05d8, 0x85cf,
|
||||
0x0440, 0x8457, 0x846b, 0x047c, 0x8413, 0x0404, 0x0438, 0x842f,
|
||||
0x84e3, 0x04f4, 0x04c8, 0x84df, 0x04b0, 0x84a7, 0x849b, 0x048c,
|
||||
0x0780, 0x8797, 0x87ab, 0x07bc, 0x87d3, 0x07c4, 0x07f8, 0x87ef,
|
||||
0x8723, 0x0734, 0x0708, 0x871f, 0x0770, 0x8767, 0x875b, 0x074c,
|
||||
0x86c3, 0x06d4, 0x06e8, 0x86ff, 0x0690, 0x8687, 0x86bb, 0x06ac,
|
||||
0x0660, 0x8677, 0x864b, 0x065c, 0x8633, 0x0624, 0x0618, 0x860f,
|
||||
0x8a03, 0x0a14, 0x0a28, 0x8a3f, 0x0a50, 0x8a47, 0x8a7b, 0x0a6c,
|
||||
0x0aa0, 0x8ab7, 0x8a8b, 0x0a9c, 0x8af3, 0x0ae4, 0x0ad8, 0x8acf,
|
||||
0x0b40, 0x8b57, 0x8b6b, 0x0b7c, 0x8b13, 0x0b04, 0x0b38, 0x8b2f,
|
||||
0x8be3, 0x0bf4, 0x0bc8, 0x8bdf, 0x0bb0, 0x8ba7, 0x8b9b, 0x0b8c,
|
||||
0x0880, 0x8897, 0x88ab, 0x08bc, 0x88d3, 0x08c4, 0x08f8, 0x88ef,
|
||||
0x8823, 0x0834, 0x0808, 0x881f, 0x0870, 0x8867, 0x885b, 0x084c,
|
||||
0x89c3, 0x09d4, 0x09e8, 0x89ff, 0x0990, 0x8987, 0x89bb, 0x09ac,
|
||||
0x0960, 0x8977, 0x894b, 0x095c, 0x8933, 0x0924, 0x0918, 0x890f,
|
||||
0x0f00, 0x8f17, 0x8f2b, 0x0f3c, 0x8f53, 0x0f44, 0x0f78, 0x8f6f,
|
||||
0x8fa3, 0x0fb4, 0x0f88, 0x8f9f, 0x0ff0, 0x8fe7, 0x8fdb, 0x0fcc,
|
||||
0x8e43, 0x0e54, 0x0e68, 0x8e7f, 0x0e10, 0x8e07, 0x8e3b, 0x0e2c,
|
||||
0x0ee0, 0x8ef7, 0x8ecb, 0x0edc, 0x8eb3, 0x0ea4, 0x0e98, 0x8e8f,
|
||||
0x8d83, 0x0d94, 0x0da8, 0x8dbf, 0x0dd0, 0x8dc7, 0x8dfb, 0x0dec,
|
||||
0x0d20, 0x8d37, 0x8d0b, 0x0d1c, 0x8d73, 0x0d64, 0x0d58, 0x8d4f,
|
||||
0x0cc0, 0x8cd7, 0x8ceb, 0x0cfc, 0x8c93, 0x0c84, 0x0cb8, 0x8caf,
|
||||
0x8c63, 0x0c74, 0x0c48, 0x8c5f, 0x0c30, 0x8c27, 0x8c1b, 0x0c0c },
|
||||
|
||||
{ 0x0000, 0x9403, 0xa803, 0x3c00, 0xd003, 0x4400, 0x7800, 0xec03,
|
||||
0x2003, 0xb400, 0x8800, 0x1c03, 0xf000, 0x6403, 0x5803, 0xcc00,
|
||||
0x4006, 0xd405, 0xe805, 0x7c06, 0x9005, 0x0406, 0x3806, 0xac05,
|
||||
0x6005, 0xf406, 0xc806, 0x5c05, 0xb006, 0x2405, 0x1805, 0x8c06,
|
||||
0x800c, 0x140f, 0x280f, 0xbc0c, 0x500f, 0xc40c, 0xf80c, 0x6c0f,
|
||||
0xa00f, 0x340c, 0x080c, 0x9c0f, 0x700c, 0xe40f, 0xd80f, 0x4c0c,
|
||||
0xc00a, 0x5409, 0x6809, 0xfc0a, 0x1009, 0x840a, 0xb80a, 0x2c09,
|
||||
0xe009, 0x740a, 0x480a, 0xdc09, 0x300a, 0xa409, 0x9809, 0x0c0a,
|
||||
0x801d, 0x141e, 0x281e, 0xbc1d, 0x501e, 0xc41d, 0xf81d, 0x6c1e,
|
||||
0xa01e, 0x341d, 0x081d, 0x9c1e, 0x701d, 0xe41e, 0xd81e, 0x4c1d,
|
||||
0xc01b, 0x5418, 0x6818, 0xfc1b, 0x1018, 0x841b, 0xb81b, 0x2c18,
|
||||
0xe018, 0x741b, 0x481b, 0xdc18, 0x301b, 0xa418, 0x9818, 0x0c1b,
|
||||
0x0011, 0x9412, 0xa812, 0x3c11, 0xd012, 0x4411, 0x7811, 0xec12,
|
||||
0x2012, 0xb411, 0x8811, 0x1c12, 0xf011, 0x6412, 0x5812, 0xcc11,
|
||||
0x4017, 0xd414, 0xe814, 0x7c17, 0x9014, 0x0417, 0x3817, 0xac14,
|
||||
0x6014, 0xf417, 0xc817, 0x5c14, 0xb017, 0x2414, 0x1814, 0x8c17,
|
||||
0x803f, 0x143c, 0x283c, 0xbc3f, 0x503c, 0xc43f, 0xf83f, 0x6c3c,
|
||||
0xa03c, 0x343f, 0x083f, 0x9c3c, 0x703f, 0xe43c, 0xd83c, 0x4c3f,
|
||||
0xc039, 0x543a, 0x683a, 0xfc39, 0x103a, 0x8439, 0xb839, 0x2c3a,
|
||||
0xe03a, 0x7439, 0x4839, 0xdc3a, 0x3039, 0xa43a, 0x983a, 0x0c39,
|
||||
0x0033, 0x9430, 0xa830, 0x3c33, 0xd030, 0x4433, 0x7833, 0xec30,
|
||||
0x2030, 0xb433, 0x8833, 0x1c30, 0xf033, 0x6430, 0x5830, 0xcc33,
|
||||
0x4035, 0xd436, 0xe836, 0x7c35, 0x9036, 0x0435, 0x3835, 0xac36,
|
||||
0x6036, 0xf435, 0xc835, 0x5c36, 0xb035, 0x2436, 0x1836, 0x8c35,
|
||||
0x0022, 0x9421, 0xa821, 0x3c22, 0xd021, 0x4422, 0x7822, 0xec21,
|
||||
0x2021, 0xb422, 0x8822, 0x1c21, 0xf022, 0x6421, 0x5821, 0xcc22,
|
||||
0x4024, 0xd427, 0xe827, 0x7c24, 0x9027, 0x0424, 0x3824, 0xac27,
|
||||
0x6027, 0xf424, 0xc824, 0x5c27, 0xb024, 0x2427, 0x1827, 0x8c24,
|
||||
0x802e, 0x142d, 0x282d, 0xbc2e, 0x502d, 0xc42e, 0xf82e, 0x6c2d,
|
||||
0xa02d, 0x342e, 0x082e, 0x9c2d, 0x702e, 0xe42d, 0xd82d, 0x4c2e,
|
||||
0xc028, 0x542b, 0x682b, 0xfc28, 0x102b, 0x8428, 0xb828, 0x2c2b,
|
||||
0xe02b, 0x7428, 0x4828, 0xdc2b, 0x3028, 0xa42b, 0x982b, 0x0c28 },
|
||||
|
||||
{ 0x0000, 0x807b, 0x80f3, 0x0088, 0x81e3, 0x0198, 0x0110, 0x816b,
|
||||
0x83c3, 0x03b8, 0x0330, 0x834b, 0x0220, 0x825b, 0x82d3, 0x02a8,
|
||||
0x8783, 0x07f8, 0x0770, 0x870b, 0x0660, 0x861b, 0x8693, 0x06e8,
|
||||
0x0440, 0x843b, 0x84b3, 0x04c8, 0x85a3, 0x05d8, 0x0550, 0x852b,
|
||||
0x8f03, 0x0f78, 0x0ff0, 0x8f8b, 0x0ee0, 0x8e9b, 0x8e13, 0x0e68,
|
||||
0x0cc0, 0x8cbb, 0x8c33, 0x0c48, 0x8d23, 0x0d58, 0x0dd0, 0x8dab,
|
||||
0x0880, 0x88fb, 0x8873, 0x0808, 0x8963, 0x0918, 0x0990, 0x89eb,
|
||||
0x8b43, 0x0b38, 0x0bb0, 0x8bcb, 0x0aa0, 0x8adb, 0x8a53, 0x0a28,
|
||||
0x9e03, 0x1e78, 0x1ef0, 0x9e8b, 0x1fe0, 0x9f9b, 0x9f13, 0x1f68,
|
||||
0x1dc0, 0x9dbb, 0x9d33, 0x1d48, 0x9c23, 0x1c58, 0x1cd0, 0x9cab,
|
||||
0x1980, 0x99fb, 0x9973, 0x1908, 0x9863, 0x1818, 0x1890, 0x98eb,
|
||||
0x9a43, 0x1a38, 0x1ab0, 0x9acb, 0x1ba0, 0x9bdb, 0x9b53, 0x1b28,
|
||||
0x1100, 0x917b, 0x91f3, 0x1188, 0x90e3, 0x1098, 0x1010, 0x906b,
|
||||
0x92c3, 0x12b8, 0x1230, 0x924b, 0x1320, 0x935b, 0x93d3, 0x13a8,
|
||||
0x9683, 0x16f8, 0x1670, 0x960b, 0x1760, 0x971b, 0x9793, 0x17e8,
|
||||
0x1540, 0x953b, 0x95b3, 0x15c8, 0x94a3, 0x14d8, 0x1450, 0x942b,
|
||||
0xbc03, 0x3c78, 0x3cf0, 0xbc8b, 0x3de0, 0xbd9b, 0xbd13, 0x3d68,
|
||||
0x3fc0, 0xbfbb, 0xbf33, 0x3f48, 0xbe23, 0x3e58, 0x3ed0, 0xbeab,
|
||||
0x3b80, 0xbbfb, 0xbb73, 0x3b08, 0xba63, 0x3a18, 0x3a90, 0xbaeb,
|
||||
0xb843, 0x3838, 0x38b0, 0xb8cb, 0x39a0, 0xb9db, 0xb953, 0x3928,
|
||||
0x3300, 0xb37b, 0xb3f3, 0x3388, 0xb2e3, 0x3298, 0x3210, 0xb26b,
|
||||
0xb0c3, 0x30b8, 0x3030, 0xb04b, 0x3120, 0xb15b, 0xb1d3, 0x31a8,
|
||||
0xb483, 0x34f8, 0x3470, 0xb40b, 0x3560, 0xb51b, 0xb593, 0x35e8,
|
||||
0x3740, 0xb73b, 0xb7b3, 0x37c8, 0xb6a3, 0x36d8, 0x3650, 0xb62b,
|
||||
0x2200, 0xa27b, 0xa2f3, 0x2288, 0xa3e3, 0x2398, 0x2310, 0xa36b,
|
||||
0xa1c3, 0x21b8, 0x2130, 0xa14b, 0x2020, 0xa05b, 0xa0d3, 0x20a8,
|
||||
0xa583, 0x25f8, 0x2570, 0xa50b, 0x2460, 0xa41b, 0xa493, 0x24e8,
|
||||
0x2640, 0xa63b, 0xa6b3, 0x26c8, 0xa7a3, 0x27d8, 0x2750, 0xa72b,
|
||||
0xad03, 0x2d78, 0x2df0, 0xad8b, 0x2ce0, 0xac9b, 0xac13, 0x2c68,
|
||||
0x2ec0, 0xaebb, 0xae33, 0x2e48, 0xaf23, 0x2f58, 0x2fd0, 0xafab,
|
||||
0x2a80, 0xaafb, 0xaa73, 0x2a08, 0xab63, 0x2b18, 0x2b90, 0xabeb,
|
||||
0xa943, 0x2938, 0x29b0, 0xa9cb, 0x28a0, 0xa8db, 0xa853, 0x2828 },
|
||||
|
||||
{ 0x0000, 0xf803, 0x7003, 0x8800, 0xe006, 0x1805, 0x9005, 0x6806,
|
||||
0x4009, 0xb80a, 0x300a, 0xc809, 0xa00f, 0x580c, 0xd00c, 0x280f,
|
||||
0x8012, 0x7811, 0xf011, 0x0812, 0x6014, 0x9817, 0x1017, 0xe814,
|
||||
0xc01b, 0x3818, 0xb018, 0x481b, 0x201d, 0xd81e, 0x501e, 0xa81d,
|
||||
0x8021, 0x7822, 0xf022, 0x0821, 0x6027, 0x9824, 0x1024, 0xe827,
|
||||
0xc028, 0x382b, 0xb02b, 0x4828, 0x202e, 0xd82d, 0x502d, 0xa82e,
|
||||
0x0033, 0xf830, 0x7030, 0x8833, 0xe035, 0x1836, 0x9036, 0x6835,
|
||||
0x403a, 0xb839, 0x3039, 0xc83a, 0xa03c, 0x583f, 0xd03f, 0x283c,
|
||||
0x8047, 0x7844, 0xf044, 0x0847, 0x6041, 0x9842, 0x1042, 0xe841,
|
||||
0xc04e, 0x384d, 0xb04d, 0x484e, 0x2048, 0xd84b, 0x504b, 0xa848,
|
||||
0x0055, 0xf856, 0x7056, 0x8855, 0xe053, 0x1850, 0x9050, 0x6853,
|
||||
0x405c, 0xb85f, 0x305f, 0xc85c, 0xa05a, 0x5859, 0xd059, 0x285a,
|
||||
0x0066, 0xf865, 0x7065, 0x8866, 0xe060, 0x1863, 0x9063, 0x6860,
|
||||
0x406f, 0xb86c, 0x306c, 0xc86f, 0xa069, 0x586a, 0xd06a, 0x2869,
|
||||
0x8074, 0x7877, 0xf077, 0x0874, 0x6072, 0x9871, 0x1071, 0xe872,
|
||||
0xc07d, 0x387e, 0xb07e, 0x487d, 0x207b, 0xd878, 0x5078, 0xa87b,
|
||||
0x808b, 0x7888, 0xf088, 0x088b, 0x608d, 0x988e, 0x108e, 0xe88d,
|
||||
0xc082, 0x3881, 0xb081, 0x4882, 0x2084, 0xd887, 0x5087, 0xa884,
|
||||
0x0099, 0xf89a, 0x709a, 0x8899, 0xe09f, 0x189c, 0x909c, 0x689f,
|
||||
0x4090, 0xb893, 0x3093, 0xc890, 0xa096, 0x5895, 0xd095, 0x2896,
|
||||
0x00aa, 0xf8a9, 0x70a9, 0x88aa, 0xe0ac, 0x18af, 0x90af, 0x68ac,
|
||||
0x40a3, 0xb8a0, 0x30a0, 0xc8a3, 0xa0a5, 0x58a6, 0xd0a6, 0x28a5,
|
||||
0x80b8, 0x78bb, 0xf0bb, 0x08b8, 0x60be, 0x98bd, 0x10bd, 0xe8be,
|
||||
0xc0b1, 0x38b2, 0xb0b2, 0x48b1, 0x20b7, 0xd8b4, 0x50b4, 0xa8b7,
|
||||
0x00cc, 0xf8cf, 0x70cf, 0x88cc, 0xe0ca, 0x18c9, 0x90c9, 0x68ca,
|
||||
0x40c5, 0xb8c6, 0x30c6, 0xc8c5, 0xa0c3, 0x58c0, 0xd0c0, 0x28c3,
|
||||
0x80de, 0x78dd, 0xf0dd, 0x08de, 0x60d8, 0x98db, 0x10db, 0xe8d8,
|
||||
0xc0d7, 0x38d4, 0xb0d4, 0x48d7, 0x20d1, 0xd8d2, 0x50d2, 0xa8d1,
|
||||
0x80ed, 0x78ee, 0xf0ee, 0x08ed, 0x60eb, 0x98e8, 0x10e8, 0xe8eb,
|
||||
0xc0e4, 0x38e7, 0xb0e7, 0x48e4, 0x20e2, 0xd8e1, 0x50e1, 0xa8e2,
|
||||
0x00ff, 0xf8fc, 0x70fc, 0x88ff, 0xe0f9, 0x18fa, 0x90fa, 0x68f9,
|
||||
0x40f6, 0xb8f5, 0x30f5, 0xc8f6, 0xa0f0, 0x58f3, 0xd0f3, 0x28f0 },
|
||||
|
||||
{ 0x0000, 0x8113, 0x8223, 0x0330, 0x8443, 0x0550, 0x0660, 0x8773,
|
||||
0x8883, 0x0990, 0x0aa0, 0x8bb3, 0x0cc0, 0x8dd3, 0x8ee3, 0x0ff0,
|
||||
0x9103, 0x1010, 0x1320, 0x9233, 0x1540, 0x9453, 0x9763, 0x1670,
|
||||
0x1980, 0x9893, 0x9ba3, 0x1ab0, 0x9dc3, 0x1cd0, 0x1fe0, 0x9ef3,
|
||||
0xa203, 0x2310, 0x2020, 0xa133, 0x2640, 0xa753, 0xa463, 0x2570,
|
||||
0x2a80, 0xab93, 0xa8a3, 0x29b0, 0xaec3, 0x2fd0, 0x2ce0, 0xadf3,
|
||||
0x3300, 0xb213, 0xb123, 0x3030, 0xb743, 0x3650, 0x3560, 0xb473,
|
||||
0xbb83, 0x3a90, 0x39a0, 0xb8b3, 0x3fc0, 0xbed3, 0xbde3, 0x3cf0,
|
||||
0xc403, 0x4510, 0x4620, 0xc733, 0x4040, 0xc153, 0xc263, 0x4370,
|
||||
0x4c80, 0xcd93, 0xcea3, 0x4fb0, 0xc8c3, 0x49d0, 0x4ae0, 0xcbf3,
|
||||
0x5500, 0xd413, 0xd723, 0x5630, 0xd143, 0x5050, 0x5360, 0xd273,
|
||||
0xdd83, 0x5c90, 0x5fa0, 0xdeb3, 0x59c0, 0xd8d3, 0xdbe3, 0x5af0,
|
||||
0x6600, 0xe713, 0xe423, 0x6530, 0xe243, 0x6350, 0x6060, 0xe173,
|
||||
0xee83, 0x6f90, 0x6ca0, 0xedb3, 0x6ac0, 0xebd3, 0xe8e3, 0x69f0,
|
||||
0xf703, 0x7610, 0x7520, 0xf433, 0x7340, 0xf253, 0xf163, 0x7070,
|
||||
0x7f80, 0xfe93, 0xfda3, 0x7cb0, 0xfbc3, 0x7ad0, 0x79e0, 0xf8f3,
|
||||
0x0803, 0x8910, 0x8a20, 0x0b33, 0x8c40, 0x0d53, 0x0e63, 0x8f70,
|
||||
0x8080, 0x0193, 0x02a3, 0x83b0, 0x04c3, 0x85d0, 0x86e0, 0x07f3,
|
||||
0x9900, 0x1813, 0x1b23, 0x9a30, 0x1d43, 0x9c50, 0x9f60, 0x1e73,
|
||||
0x1183, 0x9090, 0x93a0, 0x12b3, 0x95c0, 0x14d3, 0x17e3, 0x96f0,
|
||||
0xaa00, 0x2b13, 0x2823, 0xa930, 0x2e43, 0xaf50, 0xac60, 0x2d73,
|
||||
0x2283, 0xa390, 0xa0a0, 0x21b3, 0xa6c0, 0x27d3, 0x24e3, 0xa5f0,
|
||||
0x3b03, 0xba10, 0xb920, 0x3833, 0xbf40, 0x3e53, 0x3d63, 0xbc70,
|
||||
0xb380, 0x3293, 0x31a3, 0xb0b0, 0x37c3, 0xb6d0, 0xb5e0, 0x34f3,
|
||||
0xcc00, 0x4d13, 0x4e23, 0xcf30, 0x4843, 0xc950, 0xca60, 0x4b73,
|
||||
0x4483, 0xc590, 0xc6a0, 0x47b3, 0xc0c0, 0x41d3, 0x42e3, 0xc3f0,
|
||||
0x5d03, 0xdc10, 0xdf20, 0x5e33, 0xd940, 0x5853, 0x5b63, 0xda70,
|
||||
0xd580, 0x5493, 0x57a3, 0xd6b0, 0x51c3, 0xd0d0, 0xd3e0, 0x52f3,
|
||||
0x6e03, 0xef10, 0xec20, 0x6d33, 0xea40, 0x6b53, 0x6863, 0xe970,
|
||||
0xe680, 0x6793, 0x64a3, 0xe5b0, 0x62c3, 0xe3d0, 0xe0e0, 0x61f3,
|
||||
0xff00, 0x7e13, 0x7d23, 0xfc30, 0x7b43, 0xfa50, 0xf960, 0x7873,
|
||||
0x7783, 0xf690, 0xf5a0, 0x74b3, 0xf3c0, 0x72d3, 0x71e3, 0xf0f0 },
|
||||
|
||||
{ 0x0000, 0x1006, 0x200c, 0x300a, 0x4018, 0x501e, 0x6014, 0x7012,
|
||||
0x8030, 0x9036, 0xa03c, 0xb03a, 0xc028, 0xd02e, 0xe024, 0xf022,
|
||||
0x8065, 0x9063, 0xa069, 0xb06f, 0xc07d, 0xd07b, 0xe071, 0xf077,
|
||||
0x0055, 0x1053, 0x2059, 0x305f, 0x404d, 0x504b, 0x6041, 0x7047,
|
||||
0x80cf, 0x90c9, 0xa0c3, 0xb0c5, 0xc0d7, 0xd0d1, 0xe0db, 0xf0dd,
|
||||
0x00ff, 0x10f9, 0x20f3, 0x30f5, 0x40e7, 0x50e1, 0x60eb, 0x70ed,
|
||||
0x00aa, 0x10ac, 0x20a6, 0x30a0, 0x40b2, 0x50b4, 0x60be, 0x70b8,
|
||||
0x809a, 0x909c, 0xa096, 0xb090, 0xc082, 0xd084, 0xe08e, 0xf088,
|
||||
0x819b, 0x919d, 0xa197, 0xb191, 0xc183, 0xd185, 0xe18f, 0xf189,
|
||||
0x01ab, 0x11ad, 0x21a7, 0x31a1, 0x41b3, 0x51b5, 0x61bf, 0x71b9,
|
||||
0x01fe, 0x11f8, 0x21f2, 0x31f4, 0x41e6, 0x51e0, 0x61ea, 0x71ec,
|
||||
0x81ce, 0x91c8, 0xa1c2, 0xb1c4, 0xc1d6, 0xd1d0, 0xe1da, 0xf1dc,
|
||||
0x0154, 0x1152, 0x2158, 0x315e, 0x414c, 0x514a, 0x6140, 0x7146,
|
||||
0x8164, 0x9162, 0xa168, 0xb16e, 0xc17c, 0xd17a, 0xe170, 0xf176,
|
||||
0x8131, 0x9137, 0xa13d, 0xb13b, 0xc129, 0xd12f, 0xe125, 0xf123,
|
||||
0x0101, 0x1107, 0x210d, 0x310b, 0x4119, 0x511f, 0x6115, 0x7113,
|
||||
0x8333, 0x9335, 0xa33f, 0xb339, 0xc32b, 0xd32d, 0xe327, 0xf321,
|
||||
0x0303, 0x1305, 0x230f, 0x3309, 0x431b, 0x531d, 0x6317, 0x7311,
|
||||
0x0356, 0x1350, 0x235a, 0x335c, 0x434e, 0x5348, 0x6342, 0x7344,
|
||||
0x8366, 0x9360, 0xa36a, 0xb36c, 0xc37e, 0xd378, 0xe372, 0xf374,
|
||||
0x03fc, 0x13fa, 0x23f0, 0x33f6, 0x43e4, 0x53e2, 0x63e8, 0x73ee,
|
||||
0x83cc, 0x93ca, 0xa3c0, 0xb3c6, 0xc3d4, 0xd3d2, 0xe3d8, 0xf3de,
|
||||
0x8399, 0x939f, 0xa395, 0xb393, 0xc381, 0xd387, 0xe38d, 0xf38b,
|
||||
0x03a9, 0x13af, 0x23a5, 0x33a3, 0x43b1, 0x53b7, 0x63bd, 0x73bb,
|
||||
0x02a8, 0x12ae, 0x22a4, 0x32a2, 0x42b0, 0x52b6, 0x62bc, 0x72ba,
|
||||
0x8298, 0x929e, 0xa294, 0xb292, 0xc280, 0xd286, 0xe28c, 0xf28a,
|
||||
0x82cd, 0x92cb, 0xa2c1, 0xb2c7, 0xc2d5, 0xd2d3, 0xe2d9, 0xf2df,
|
||||
0x02fd, 0x12fb, 0x22f1, 0x32f7, 0x42e5, 0x52e3, 0x62e9, 0x72ef,
|
||||
0x8267, 0x9261, 0xa26b, 0xb26d, 0xc27f, 0xd279, 0xe273, 0xf275,
|
||||
0x0257, 0x1251, 0x225b, 0x325d, 0x424f, 0x5249, 0x6243, 0x7245,
|
||||
0x0202, 0x1204, 0x220e, 0x3208, 0x421a, 0x521c, 0x6216, 0x7210,
|
||||
0x8232, 0x9234, 0xa23e, 0xb238, 0xc22a, 0xd22c, 0xe226, 0xf220 }
|
||||
};
|
||||
|
||||
#if 0
|
||||
void FLAC__crc16_init_table(void)
|
||||
{
|
||||
int i, j;
|
||||
FLAC__uint16 polynomial, crc;
|
||||
polynomial = 0x8005;
|
||||
|
||||
for(i = 0; i <= 0xFF; i++){
|
||||
crc = i << 8;
|
||||
|
||||
for(j = 0; j < 8; j++)
|
||||
crc = (crc << 1) ^ (crc & (1 << 15) ? polynomial : 0);
|
||||
|
||||
FLAC__crc16_table[0][i] = crc;
|
||||
}
|
||||
|
||||
for(i = 0; i <= 0xFF; i++)
|
||||
for(j = 1; j < 8; j++)
|
||||
FLAC__crc16_table[j][i] = FLAC__crc16_table[0][FLAC__crc16_table[j - 1][i] >> 8] ^ (FLAC__crc16_table[j - 1][i] << 8);
|
||||
}
|
||||
#endif
|
||||
|
||||
FLAC__uint8 FLAC__crc8(const FLAC__byte *data, uint32_t len)
|
||||
{
|
||||
FLAC__uint8 crc = 0;
|
||||
|
||||
while(len--)
|
||||
crc = FLAC__crc8_table[crc ^ *data++];
|
||||
|
||||
return crc;
|
||||
}
|
||||
|
||||
FLAC__uint16 FLAC__crc16(const FLAC__byte *data, uint32_t len)
|
||||
{
|
||||
FLAC__uint16 crc = 0;
|
||||
|
||||
while(len >= 8){
|
||||
crc ^= data[0] << 8 | data[1];
|
||||
|
||||
crc = FLAC__crc16_table[7][crc >> 8] ^ FLAC__crc16_table[6][crc & 0xFF] ^
|
||||
FLAC__crc16_table[5][data[2] ] ^ FLAC__crc16_table[4][data[3] ] ^
|
||||
FLAC__crc16_table[3][data[4] ] ^ FLAC__crc16_table[2][data[5] ] ^
|
||||
FLAC__crc16_table[1][data[6] ] ^ FLAC__crc16_table[0][data[7] ];
|
||||
|
||||
data += 8;
|
||||
len -= 8;
|
||||
}
|
||||
|
||||
while(len--)
|
||||
crc = (crc<<8) ^ FLAC__crc16_table[0][(crc>>8) ^ *data++];
|
||||
|
||||
return crc;
|
||||
}
|
||||
|
||||
FLAC__uint16 FLAC__crc16_update_words32(const FLAC__uint32 *words, uint32_t len, FLAC__uint16 crc)
|
||||
{
|
||||
while (len >= 2) {
|
||||
crc ^= words[0] >> 16;
|
||||
|
||||
crc = FLAC__crc16_table[7][crc >> 8 ] ^ FLAC__crc16_table[6][crc & 0xFF ] ^
|
||||
FLAC__crc16_table[5][(words[0] >> 8) & 0xFF] ^ FLAC__crc16_table[4][ words[0] & 0xFF] ^
|
||||
FLAC__crc16_table[3][ words[1] >> 24 ] ^ FLAC__crc16_table[2][(words[1] >> 16) & 0xFF] ^
|
||||
FLAC__crc16_table[1][(words[1] >> 8) & 0xFF] ^ FLAC__crc16_table[0][ words[1] & 0xFF];
|
||||
|
||||
words += 2;
|
||||
len -= 2;
|
||||
}
|
||||
|
||||
if (len) {
|
||||
crc ^= words[0] >> 16;
|
||||
|
||||
crc = FLAC__crc16_table[3][crc >> 8 ] ^ FLAC__crc16_table[2][crc & 0xFF ] ^
|
||||
FLAC__crc16_table[1][(words[0] >> 8) & 0xFF] ^ FLAC__crc16_table[0][words[0] & 0xFF];
|
||||
}
|
||||
|
||||
return crc;
|
||||
}
|
||||
|
||||
FLAC__uint16 FLAC__crc16_update_words64(const FLAC__uint64 *words, uint32_t len, FLAC__uint16 crc)
|
||||
{
|
||||
while (len--) {
|
||||
crc ^= words[0] >> 48;
|
||||
|
||||
crc = FLAC__crc16_table[7][crc >> 8 ] ^ FLAC__crc16_table[6][crc & 0xFF ] ^
|
||||
FLAC__crc16_table[5][(words[0] >> 40) & 0xFF] ^ FLAC__crc16_table[4][(words[0] >> 32) & 0xFF] ^
|
||||
FLAC__crc16_table[3][(words[0] >> 24) & 0xFF] ^ FLAC__crc16_table[2][(words[0] >> 16) & 0xFF] ^
|
||||
FLAC__crc16_table[1][(words[0] >> 8) & 0xFF] ^ FLAC__crc16_table[0][ words[0] & 0xFF];
|
||||
|
||||
words++;
|
||||
}
|
||||
|
||||
return crc;
|
||||
}
|
||||
|
|
@ -1,667 +0,0 @@
|
|||
/* libFLAC - Free Lossless Audio Codec library
|
||||
* Copyright (C) 2000-2009 Josh Coalson
|
||||
* Copyright (C) 2011-2023 Xiph.Org Foundation
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* - Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* - Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* - Neither the name of the Xiph.org Foundation nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <math.h>
|
||||
#include <string.h>
|
||||
#include "../compat.h"
|
||||
#include "include/private/bitmath.h"
|
||||
#include "include/private/fixed.h"
|
||||
|
||||
#include "../assert.h"
|
||||
|
||||
#ifdef local_abs
|
||||
#undef local_abs
|
||||
#endif
|
||||
#define local_abs(x) ((uint32_t)((x)<0? -(x) : (x)))
|
||||
|
||||
#ifdef local_abs64
|
||||
#undef local_abs64
|
||||
#endif
|
||||
#define local_abs64(x) ((uint64_t)((x)<0? -(x) : (x)))
|
||||
|
||||
#ifdef FLAC__INTEGER_ONLY_LIBRARY
|
||||
/* rbps stands for residual bits per sample
|
||||
*
|
||||
* (ln(2) * err)
|
||||
* rbps = log (-----------)
|
||||
* 2 ( n )
|
||||
*/
|
||||
static FLAC__fixedpoint local__compute_rbps_integerized(FLAC__uint32 err, FLAC__uint32 n)
|
||||
{
|
||||
FLAC__uint32 rbps;
|
||||
uint32_t bits; /* the number of bits required to represent a number */
|
||||
int fracbits; /* the number of bits of rbps that comprise the fractional part */
|
||||
|
||||
FLAC__ASSERT(sizeof(rbps) == sizeof(FLAC__fixedpoint));
|
||||
FLAC__ASSERT(err > 0);
|
||||
FLAC__ASSERT(n > 0);
|
||||
|
||||
FLAC__ASSERT(n <= FLAC__MAX_BLOCK_SIZE);
|
||||
if(err <= n)
|
||||
return 0;
|
||||
/*
|
||||
* The above two things tell us 1) n fits in 16 bits; 2) err/n > 1.
|
||||
* These allow us later to know we won't lose too much precision in the
|
||||
* fixed-point division (err<<fracbits)/n.
|
||||
*/
|
||||
|
||||
fracbits = (8*sizeof(err)) - (FLAC__bitmath_ilog2(err)+1);
|
||||
|
||||
err <<= fracbits;
|
||||
err /= n;
|
||||
/* err now holds err/n with fracbits fractional bits */
|
||||
|
||||
/*
|
||||
* Whittle err down to 16 bits max. 16 significant bits is enough for
|
||||
* our purposes.
|
||||
*/
|
||||
FLAC__ASSERT(err > 0);
|
||||
bits = FLAC__bitmath_ilog2(err)+1;
|
||||
if(bits > 16) {
|
||||
err >>= (bits-16);
|
||||
fracbits -= (bits-16);
|
||||
}
|
||||
rbps = (FLAC__uint32)err;
|
||||
|
||||
/* Multiply by fixed-point version of ln(2), with 16 fractional bits */
|
||||
rbps *= FLAC__FP_LN2;
|
||||
fracbits += 16;
|
||||
FLAC__ASSERT(fracbits >= 0);
|
||||
|
||||
/* FLAC__fixedpoint_log2 requires fracbits%4 to be 0 */
|
||||
{
|
||||
const int f = fracbits & 3;
|
||||
if(f) {
|
||||
rbps >>= f;
|
||||
fracbits -= f;
|
||||
}
|
||||
}
|
||||
|
||||
rbps = FLAC__fixedpoint_log2(rbps, fracbits, (uint32_t)(-1));
|
||||
|
||||
if(rbps == 0)
|
||||
return 0;
|
||||
|
||||
/*
|
||||
* The return value must have 16 fractional bits. Since the whole part
|
||||
* of the base-2 log of a 32 bit number must fit in 5 bits, and fracbits
|
||||
* must be >= -3, these assertion allows us to be able to shift rbps
|
||||
* left if necessary to get 16 fracbits without losing any bits of the
|
||||
* whole part of rbps.
|
||||
*
|
||||
* There is a slight chance due to accumulated error that the whole part
|
||||
* will require 6 bits, so we use 6 in the assertion. Really though as
|
||||
* long as it fits in 13 bits (32 - (16 - (-3))) we are fine.
|
||||
*/
|
||||
FLAC__ASSERT((int)FLAC__bitmath_ilog2(rbps)+1 <= fracbits + 6);
|
||||
FLAC__ASSERT(fracbits >= -3);
|
||||
|
||||
/* now shift the decimal point into place */
|
||||
if(fracbits < 16)
|
||||
return rbps << (16-fracbits);
|
||||
else if(fracbits > 16)
|
||||
return rbps >> (fracbits-16);
|
||||
else
|
||||
return rbps;
|
||||
}
|
||||
|
||||
static FLAC__fixedpoint local__compute_rbps_wide_integerized(FLAC__uint64 err, FLAC__uint32 n)
|
||||
{
|
||||
FLAC__uint32 rbps;
|
||||
uint32_t bits; /* the number of bits required to represent a number */
|
||||
int fracbits; /* the number of bits of rbps that comprise the fractional part */
|
||||
|
||||
FLAC__ASSERT(sizeof(rbps) == sizeof(FLAC__fixedpoint));
|
||||
FLAC__ASSERT(err > 0);
|
||||
FLAC__ASSERT(n > 0);
|
||||
|
||||
FLAC__ASSERT(n <= FLAC__MAX_BLOCK_SIZE);
|
||||
if(err <= n)
|
||||
return 0;
|
||||
/*
|
||||
* The above two things tell us 1) n fits in 16 bits; 2) err/n > 1.
|
||||
* These allow us later to know we won't lose too much precision in the
|
||||
* fixed-point division (err<<fracbits)/n.
|
||||
*/
|
||||
|
||||
fracbits = (8*sizeof(err)) - (FLAC__bitmath_ilog2_wide(err)+1);
|
||||
|
||||
err <<= fracbits;
|
||||
err /= n;
|
||||
/* err now holds err/n with fracbits fractional bits */
|
||||
|
||||
/*
|
||||
* Whittle err down to 16 bits max. 16 significant bits is enough for
|
||||
* our purposes.
|
||||
*/
|
||||
FLAC__ASSERT(err > 0);
|
||||
bits = FLAC__bitmath_ilog2_wide(err)+1;
|
||||
if(bits > 16) {
|
||||
err >>= (bits-16);
|
||||
fracbits -= (bits-16);
|
||||
}
|
||||
rbps = (FLAC__uint32)err;
|
||||
|
||||
/* Multiply by fixed-point version of ln(2), with 16 fractional bits */
|
||||
rbps *= FLAC__FP_LN2;
|
||||
fracbits += 16;
|
||||
FLAC__ASSERT(fracbits >= 0);
|
||||
|
||||
/* FLAC__fixedpoint_log2 requires fracbits%4 to be 0 */
|
||||
{
|
||||
const int f = fracbits & 3;
|
||||
if(f) {
|
||||
rbps >>= f;
|
||||
fracbits -= f;
|
||||
}
|
||||
}
|
||||
|
||||
rbps = FLAC__fixedpoint_log2(rbps, fracbits, (uint32_t)(-1));
|
||||
|
||||
if(rbps == 0)
|
||||
return 0;
|
||||
|
||||
/*
|
||||
* The return value must have 16 fractional bits. Since the whole part
|
||||
* of the base-2 log of a 32 bit number must fit in 5 bits, and fracbits
|
||||
* must be >= -3, these assertion allows us to be able to shift rbps
|
||||
* left if necessary to get 16 fracbits without losing any bits of the
|
||||
* whole part of rbps.
|
||||
*
|
||||
* There is a slight chance due to accumulated error that the whole part
|
||||
* will require 6 bits, so we use 6 in the assertion. Really though as
|
||||
* long as it fits in 13 bits (32 - (16 - (-3))) we are fine.
|
||||
*/
|
||||
FLAC__ASSERT((int)FLAC__bitmath_ilog2(rbps)+1 <= fracbits + 6);
|
||||
FLAC__ASSERT(fracbits >= -3);
|
||||
|
||||
/* now shift the decimal point into place */
|
||||
if(fracbits < 16)
|
||||
return rbps << (16-fracbits);
|
||||
else if(fracbits > 16)
|
||||
return rbps >> (fracbits-16);
|
||||
else
|
||||
return rbps;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef FLAC__INTEGER_ONLY_LIBRARY
|
||||
uint32_t FLAC__fixed_compute_best_predictor(const FLAC__int32 data[], uint32_t data_len, float residual_bits_per_sample[FLAC__MAX_FIXED_ORDER+1])
|
||||
#else
|
||||
uint32_t FLAC__fixed_compute_best_predictor(const FLAC__int32 data[], uint32_t data_len, FLAC__fixedpoint residual_bits_per_sample[FLAC__MAX_FIXED_ORDER+1])
|
||||
#endif
|
||||
{
|
||||
FLAC__uint32 total_error_0 = 0, total_error_1 = 0, total_error_2 = 0, total_error_3 = 0, total_error_4 = 0;
|
||||
uint32_t order;
|
||||
#if 0
|
||||
/* This code has been around a long time, and was written when compilers weren't able
|
||||
* to vectorize code. These days, compilers are better in optimizing the next block
|
||||
* which is also much more readable
|
||||
*/
|
||||
FLAC__int32 last_error_0 = data[-1];
|
||||
FLAC__int32 last_error_1 = data[-1] - data[-2];
|
||||
FLAC__int32 last_error_2 = last_error_1 - (data[-2] - data[-3]);
|
||||
FLAC__int32 last_error_3 = last_error_2 - (data[-2] - 2*data[-3] + data[-4]);
|
||||
FLAC__int32 error, save;
|
||||
uint32_t i;
|
||||
/* total_error_* are 64-bits to avoid overflow when encoding
|
||||
* erratic signals when the bits-per-sample and blocksize are
|
||||
* large.
|
||||
*/
|
||||
for(i = 0; i < data_len; i++) {
|
||||
error = data[i] ; total_error_0 += local_abs(error); save = error;
|
||||
error -= last_error_0; total_error_1 += local_abs(error); last_error_0 = save; save = error;
|
||||
error -= last_error_1; total_error_2 += local_abs(error); last_error_1 = save; save = error;
|
||||
error -= last_error_2; total_error_3 += local_abs(error); last_error_2 = save; save = error;
|
||||
error -= last_error_3; total_error_4 += local_abs(error); last_error_3 = save;
|
||||
}
|
||||
#else
|
||||
int i;
|
||||
for(i = 0; i < (int)data_len; i++) {
|
||||
total_error_0 += local_abs(data[i]);
|
||||
total_error_1 += local_abs(data[i] - data[i-1]);
|
||||
total_error_2 += local_abs(data[i] - 2 * data[i-1] + data[i-2]);
|
||||
total_error_3 += local_abs(data[i] - 3 * data[i-1] + 3 * data[i-2] - data[i-3]);
|
||||
total_error_4 += local_abs(data[i] - 4 * data[i-1] + 6 * data[i-2] - 4 * data[i-3] + data[i-4]);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
/* prefer lower order */
|
||||
if(total_error_0 <= flac_min(flac_min(flac_min(total_error_1, total_error_2), total_error_3), total_error_4))
|
||||
order = 0;
|
||||
else if(total_error_1 <= flac_min(flac_min(total_error_2, total_error_3), total_error_4))
|
||||
order = 1;
|
||||
else if(total_error_2 <= flac_min(total_error_3, total_error_4))
|
||||
order = 2;
|
||||
else if(total_error_3 <= total_error_4)
|
||||
order = 3;
|
||||
else
|
||||
order = 4;
|
||||
|
||||
/* Estimate the expected number of bits per residual signal sample. */
|
||||
/* 'total_error*' is linearly related to the variance of the residual */
|
||||
/* signal, so we use it directly to compute E(|x|) */
|
||||
FLAC__ASSERT(data_len > 0 || total_error_0 == 0);
|
||||
FLAC__ASSERT(data_len > 0 || total_error_1 == 0);
|
||||
FLAC__ASSERT(data_len > 0 || total_error_2 == 0);
|
||||
FLAC__ASSERT(data_len > 0 || total_error_3 == 0);
|
||||
FLAC__ASSERT(data_len > 0 || total_error_4 == 0);
|
||||
#ifndef FLAC__INTEGER_ONLY_LIBRARY
|
||||
residual_bits_per_sample[0] = (float)((total_error_0 > 0) ? log(M_LN2 * (double)total_error_0 / (double)data_len) / M_LN2 : 0.0);
|
||||
residual_bits_per_sample[1] = (float)((total_error_1 > 0) ? log(M_LN2 * (double)total_error_1 / (double)data_len) / M_LN2 : 0.0);
|
||||
residual_bits_per_sample[2] = (float)((total_error_2 > 0) ? log(M_LN2 * (double)total_error_2 / (double)data_len) / M_LN2 : 0.0);
|
||||
residual_bits_per_sample[3] = (float)((total_error_3 > 0) ? log(M_LN2 * (double)total_error_3 / (double)data_len) / M_LN2 : 0.0);
|
||||
residual_bits_per_sample[4] = (float)((total_error_4 > 0) ? log(M_LN2 * (double)total_error_4 / (double)data_len) / M_LN2 : 0.0);
|
||||
#else
|
||||
residual_bits_per_sample[0] = (total_error_0 > 0) ? local__compute_rbps_integerized(total_error_0, data_len) : 0;
|
||||
residual_bits_per_sample[1] = (total_error_1 > 0) ? local__compute_rbps_integerized(total_error_1, data_len) : 0;
|
||||
residual_bits_per_sample[2] = (total_error_2 > 0) ? local__compute_rbps_integerized(total_error_2, data_len) : 0;
|
||||
residual_bits_per_sample[3] = (total_error_3 > 0) ? local__compute_rbps_integerized(total_error_3, data_len) : 0;
|
||||
residual_bits_per_sample[4] = (total_error_4 > 0) ? local__compute_rbps_integerized(total_error_4, data_len) : 0;
|
||||
#endif
|
||||
|
||||
return order;
|
||||
}
|
||||
|
||||
#ifndef FLAC__INTEGER_ONLY_LIBRARY
|
||||
uint32_t FLAC__fixed_compute_best_predictor_wide(const FLAC__int32 data[], uint32_t data_len, float residual_bits_per_sample[FLAC__MAX_FIXED_ORDER+1])
|
||||
#else
|
||||
uint32_t FLAC__fixed_compute_best_predictor_wide(const FLAC__int32 data[], uint32_t data_len, FLAC__fixedpoint residual_bits_per_sample[FLAC__MAX_FIXED_ORDER+1])
|
||||
#endif
|
||||
{
|
||||
FLAC__uint64 total_error_0 = 0, total_error_1 = 0, total_error_2 = 0, total_error_3 = 0, total_error_4 = 0;
|
||||
uint32_t order;
|
||||
int i;
|
||||
|
||||
for(i = 0; i < (int)data_len; i++) {
|
||||
total_error_0 += local_abs(data[i]);
|
||||
total_error_1 += local_abs(data[i] - data[i-1]);
|
||||
total_error_2 += local_abs(data[i] - 2 * data[i-1] + data[i-2]);
|
||||
total_error_3 += local_abs(data[i] - 3 * data[i-1] + 3 * data[i-2] - data[i-3]);
|
||||
total_error_4 += local_abs(data[i] - 4 * data[i-1] + 6 * data[i-2] - 4 * data[i-3] + data[i-4]);
|
||||
}
|
||||
|
||||
/* prefer lower order */
|
||||
if(total_error_0 <= flac_min(flac_min(flac_min(total_error_1, total_error_2), total_error_3), total_error_4))
|
||||
order = 0;
|
||||
else if(total_error_1 <= flac_min(flac_min(total_error_2, total_error_3), total_error_4))
|
||||
order = 1;
|
||||
else if(total_error_2 <= flac_min(total_error_3, total_error_4))
|
||||
order = 2;
|
||||
else if(total_error_3 <= total_error_4)
|
||||
order = 3;
|
||||
else
|
||||
order = 4;
|
||||
|
||||
/* Estimate the expected number of bits per residual signal sample. */
|
||||
/* 'total_error*' is linearly related to the variance of the residual */
|
||||
/* signal, so we use it directly to compute E(|x|) */
|
||||
FLAC__ASSERT(data_len > 0 || total_error_0 == 0);
|
||||
FLAC__ASSERT(data_len > 0 || total_error_1 == 0);
|
||||
FLAC__ASSERT(data_len > 0 || total_error_2 == 0);
|
||||
FLAC__ASSERT(data_len > 0 || total_error_3 == 0);
|
||||
FLAC__ASSERT(data_len > 0 || total_error_4 == 0);
|
||||
#ifndef FLAC__INTEGER_ONLY_LIBRARY
|
||||
residual_bits_per_sample[0] = (float)((total_error_0 > 0) ? log(M_LN2 * (double)total_error_0 / (double)data_len) / M_LN2 : 0.0);
|
||||
residual_bits_per_sample[1] = (float)((total_error_1 > 0) ? log(M_LN2 * (double)total_error_1 / (double)data_len) / M_LN2 : 0.0);
|
||||
residual_bits_per_sample[2] = (float)((total_error_2 > 0) ? log(M_LN2 * (double)total_error_2 / (double)data_len) / M_LN2 : 0.0);
|
||||
residual_bits_per_sample[3] = (float)((total_error_3 > 0) ? log(M_LN2 * (double)total_error_3 / (double)data_len) / M_LN2 : 0.0);
|
||||
residual_bits_per_sample[4] = (float)((total_error_4 > 0) ? log(M_LN2 * (double)total_error_4 / (double)data_len) / M_LN2 : 0.0);
|
||||
#else
|
||||
residual_bits_per_sample[0] = (total_error_0 > 0) ? local__compute_rbps_wide_integerized(total_error_0, data_len) : 0;
|
||||
residual_bits_per_sample[1] = (total_error_1 > 0) ? local__compute_rbps_wide_integerized(total_error_1, data_len) : 0;
|
||||
residual_bits_per_sample[2] = (total_error_2 > 0) ? local__compute_rbps_wide_integerized(total_error_2, data_len) : 0;
|
||||
residual_bits_per_sample[3] = (total_error_3 > 0) ? local__compute_rbps_wide_integerized(total_error_3, data_len) : 0;
|
||||
residual_bits_per_sample[4] = (total_error_4 > 0) ? local__compute_rbps_wide_integerized(total_error_4, data_len) : 0;
|
||||
#endif
|
||||
|
||||
return order;
|
||||
}
|
||||
|
||||
#ifndef FLAC__INTEGER_ONLY_LIBRARY
|
||||
#define CHECK_ORDER_IS_VALID(macro_order) \
|
||||
if(order_##macro_order##_is_valid && total_error_##macro_order < smallest_error) { \
|
||||
order = macro_order; \
|
||||
smallest_error = total_error_##macro_order ; \
|
||||
residual_bits_per_sample[ macro_order ] = (float)((total_error_0 > 0) ? log(M_LN2 * (double)total_error_0 / (double)data_len) / M_LN2 : 0.0); \
|
||||
} \
|
||||
else \
|
||||
residual_bits_per_sample[ macro_order ] = 34.0f;
|
||||
#else
|
||||
#define CHECK_ORDER_IS_VALID(macro_order) \
|
||||
if(order_##macro_order##_is_valid && total_error_##macro_order < smallest_error) { \
|
||||
order = macro_order; \
|
||||
smallest_error = total_error_##macro_order ; \
|
||||
residual_bits_per_sample[ macro_order ] = (total_error_##macro_order > 0) ? local__compute_rbps_wide_integerized(total_error_##macro_order, data_len) : 0; \
|
||||
} \
|
||||
else \
|
||||
residual_bits_per_sample[ macro_order ] = 34 * FLAC__FP_ONE;
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef FLAC__INTEGER_ONLY_LIBRARY
|
||||
uint32_t FLAC__fixed_compute_best_predictor_limit_residual(const FLAC__int32 data[], uint32_t data_len, float residual_bits_per_sample[FLAC__MAX_FIXED_ORDER+1])
|
||||
#else
|
||||
uint32_t FLAC__fixed_compute_best_predictor_limit_residual(const FLAC__int32 data[], uint32_t data_len, FLAC__fixedpoint residual_bits_per_sample[FLAC__MAX_FIXED_ORDER+1])
|
||||
#endif
|
||||
{
|
||||
FLAC__uint64 total_error_0 = 0, total_error_1 = 0, total_error_2 = 0, total_error_3 = 0, total_error_4 = 0, smallest_error = UINT64_MAX;
|
||||
FLAC__uint64 error_0, error_1, error_2, error_3, error_4;
|
||||
FLAC__bool order_0_is_valid = true, order_1_is_valid = true, order_2_is_valid = true, order_3_is_valid = true, order_4_is_valid = true;
|
||||
uint32_t order = 0;
|
||||
int i;
|
||||
|
||||
for(i = -4; i < (int)data_len; i++) {
|
||||
error_0 = local_abs64((FLAC__int64)data[i]);
|
||||
error_1 = (i > -4) ? local_abs64((FLAC__int64)data[i] - data[i-1]) : 0 ;
|
||||
error_2 = (i > -3) ? local_abs64((FLAC__int64)data[i] - 2 * (FLAC__int64)data[i-1] + data[i-2]) : 0;
|
||||
error_3 = (i > -2) ? local_abs64((FLAC__int64)data[i] - 3 * (FLAC__int64)data[i-1] + 3 * (FLAC__int64)data[i-2] - data[i-3]) : 0;
|
||||
error_4 = (i > -1) ? local_abs64((FLAC__int64)data[i] - 4 * (FLAC__int64)data[i-1] + 6 * (FLAC__int64)data[i-2] - 4 * (FLAC__int64)data[i-3] + data[i-4]) : 0;
|
||||
|
||||
total_error_0 += error_0;
|
||||
total_error_1 += error_1;
|
||||
total_error_2 += error_2;
|
||||
total_error_3 += error_3;
|
||||
total_error_4 += error_4;
|
||||
|
||||
/* residual must not be INT32_MIN because abs(INT32_MIN) is undefined */
|
||||
if(error_0 > INT32_MAX)
|
||||
order_0_is_valid = false;
|
||||
if(error_1 > INT32_MAX)
|
||||
order_1_is_valid = false;
|
||||
if(error_2 > INT32_MAX)
|
||||
order_2_is_valid = false;
|
||||
if(error_3 > INT32_MAX)
|
||||
order_3_is_valid = false;
|
||||
if(error_4 > INT32_MAX)
|
||||
order_4_is_valid = false;
|
||||
}
|
||||
|
||||
CHECK_ORDER_IS_VALID(0);
|
||||
CHECK_ORDER_IS_VALID(1);
|
||||
CHECK_ORDER_IS_VALID(2);
|
||||
CHECK_ORDER_IS_VALID(3);
|
||||
CHECK_ORDER_IS_VALID(4);
|
||||
|
||||
return order;
|
||||
}
|
||||
|
||||
#ifndef FLAC__INTEGER_ONLY_LIBRARY
|
||||
uint32_t FLAC__fixed_compute_best_predictor_limit_residual_33bit(const FLAC__int64 data[], uint32_t data_len, float residual_bits_per_sample[FLAC__MAX_FIXED_ORDER+1])
|
||||
#else
|
||||
uint32_t FLAC__fixed_compute_best_predictor_limit_residual_33bit(const FLAC__int64 data[], uint32_t data_len, FLAC__fixedpoint residual_bits_per_sample[FLAC__MAX_FIXED_ORDER+1])
|
||||
#endif
|
||||
{
|
||||
FLAC__uint64 total_error_0 = 0, total_error_1 = 0, total_error_2 = 0, total_error_3 = 0, total_error_4 = 0, smallest_error = UINT64_MAX;
|
||||
FLAC__uint64 error_0, error_1, error_2, error_3, error_4;
|
||||
FLAC__bool order_0_is_valid = true, order_1_is_valid = true, order_2_is_valid = true, order_3_is_valid = true, order_4_is_valid = true;
|
||||
uint32_t order = 0;
|
||||
int i;
|
||||
|
||||
for(i = -4; i < (int)data_len; i++) {
|
||||
error_0 = local_abs64(data[i]);
|
||||
error_1 = (i > -4) ? local_abs64(data[i] - data[i-1]) : 0 ;
|
||||
error_2 = (i > -3) ? local_abs64(data[i] - 2 * data[i-1] + data[i-2]) : 0;
|
||||
error_3 = (i > -2) ? local_abs64(data[i] - 3 * data[i-1] + 3 * data[i-2] - data[i-3]) : 0;
|
||||
error_4 = (i > -1) ? local_abs64(data[i] - 4 * data[i-1] + 6 * data[i-2] - 4 * data[i-3] + data[i-4]) : 0;
|
||||
|
||||
total_error_0 += error_0;
|
||||
total_error_1 += error_1;
|
||||
total_error_2 += error_2;
|
||||
total_error_3 += error_3;
|
||||
total_error_4 += error_4;
|
||||
|
||||
/* residual must not be INT32_MIN because abs(INT32_MIN) is undefined */
|
||||
if(error_0 > INT32_MAX)
|
||||
order_0_is_valid = false;
|
||||
if(error_1 > INT32_MAX)
|
||||
order_1_is_valid = false;
|
||||
if(error_2 > INT32_MAX)
|
||||
order_2_is_valid = false;
|
||||
if(error_3 > INT32_MAX)
|
||||
order_3_is_valid = false;
|
||||
if(error_4 > INT32_MAX)
|
||||
order_4_is_valid = false;
|
||||
}
|
||||
|
||||
CHECK_ORDER_IS_VALID(0);
|
||||
CHECK_ORDER_IS_VALID(1);
|
||||
CHECK_ORDER_IS_VALID(2);
|
||||
CHECK_ORDER_IS_VALID(3);
|
||||
CHECK_ORDER_IS_VALID(4);
|
||||
|
||||
return order;
|
||||
}
|
||||
|
||||
void FLAC__fixed_compute_residual(const FLAC__int32 data[], uint32_t data_len, uint32_t order, FLAC__int32 residual[])
|
||||
{
|
||||
const int idata_len = (int)data_len;
|
||||
int i;
|
||||
|
||||
switch(order) {
|
||||
case 0:
|
||||
FLAC__ASSERT(sizeof(residual[0]) == sizeof(data[0]));
|
||||
memcpy(residual, data, sizeof(residual[0])*data_len);
|
||||
break;
|
||||
case 1:
|
||||
for(i = 0; i < idata_len; i++)
|
||||
residual[i] = data[i] - data[i-1];
|
||||
break;
|
||||
case 2:
|
||||
for(i = 0; i < idata_len; i++)
|
||||
residual[i] = data[i] - 2*data[i-1] + data[i-2];
|
||||
break;
|
||||
case 3:
|
||||
for(i = 0; i < idata_len; i++)
|
||||
residual[i] = data[i] - 3*data[i-1] + 3*data[i-2] - data[i-3];
|
||||
break;
|
||||
case 4:
|
||||
for(i = 0; i < idata_len; i++)
|
||||
residual[i] = data[i] - 4*data[i-1] + 6*data[i-2] - 4*data[i-3] + data[i-4];
|
||||
break;
|
||||
default:
|
||||
FLAC__ASSERT(0);
|
||||
}
|
||||
}
|
||||
|
||||
void FLAC__fixed_compute_residual_wide(const FLAC__int32 data[], uint32_t data_len, uint32_t order, FLAC__int32 residual[])
|
||||
{
|
||||
const int idata_len = (int)data_len;
|
||||
int i;
|
||||
|
||||
switch(order) {
|
||||
case 0:
|
||||
FLAC__ASSERT(sizeof(residual[0]) == sizeof(data[0]));
|
||||
memcpy(residual, data, sizeof(residual[0])*data_len);
|
||||
break;
|
||||
case 1:
|
||||
for(i = 0; i < idata_len; i++)
|
||||
residual[i] = (FLAC__int64)data[i] - data[i-1];
|
||||
break;
|
||||
case 2:
|
||||
for(i = 0; i < idata_len; i++)
|
||||
residual[i] = (FLAC__int64)data[i] - 2*(FLAC__int64)data[i-1] + data[i-2];
|
||||
break;
|
||||
case 3:
|
||||
for(i = 0; i < idata_len; i++)
|
||||
residual[i] = (FLAC__int64)data[i] - 3*(FLAC__int64)data[i-1] + 3*(FLAC__int64)data[i-2] - data[i-3];
|
||||
break;
|
||||
case 4:
|
||||
for(i = 0; i < idata_len; i++)
|
||||
residual[i] = (FLAC__int64)data[i] - 4*(FLAC__int64)data[i-1] + 6*(FLAC__int64)data[i-2] - 4*(FLAC__int64)data[i-3] + data[i-4];
|
||||
break;
|
||||
default:
|
||||
FLAC__ASSERT(0);
|
||||
}
|
||||
}
|
||||
|
||||
void FLAC__fixed_compute_residual_wide_33bit(const FLAC__int64 data[], uint32_t data_len, uint32_t order, FLAC__int32 residual[])
|
||||
{
|
||||
const int idata_len = (int)data_len;
|
||||
int i;
|
||||
|
||||
switch(order) {
|
||||
case 0:
|
||||
for(i = 0; i < idata_len; i++)
|
||||
residual[i] = data[i];
|
||||
break;
|
||||
case 1:
|
||||
for(i = 0; i < idata_len; i++)
|
||||
residual[i] = data[i] - data[i-1];
|
||||
break;
|
||||
case 2:
|
||||
for(i = 0; i < idata_len; i++)
|
||||
residual[i] = data[i] - 2*data[i-1] + data[i-2];
|
||||
break;
|
||||
case 3:
|
||||
for(i = 0; i < idata_len; i++)
|
||||
residual[i] = data[i] - 3*data[i-1] + 3*data[i-2] - data[i-3];
|
||||
break;
|
||||
case 4:
|
||||
for(i = 0; i < idata_len; i++)
|
||||
residual[i] = data[i] - 4*data[i-1] + 6*data[i-2] - 4*data[i-3] + data[i-4];
|
||||
break;
|
||||
default:
|
||||
FLAC__ASSERT(0);
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION) && !defined(FUZZING_BUILD_MODE_FLAC_SANITIZE_SIGNED_INTEGER_OVERFLOW)
|
||||
/* The attribute below is to silence the undefined sanitizer of oss-fuzz.
|
||||
* Because fuzzing feeds bogus predictors and residual samples to the
|
||||
* decoder, having overflows in this section is unavoidable. Also,
|
||||
* because the calculated values are audio path only, there is no
|
||||
* potential for security problems */
|
||||
__attribute__((no_sanitize("signed-integer-overflow")))
|
||||
#endif
|
||||
void FLAC__fixed_restore_signal(const FLAC__int32 residual[], uint32_t data_len, uint32_t order, FLAC__int32 data[])
|
||||
{
|
||||
int i, idata_len = (int)data_len;
|
||||
|
||||
switch(order) {
|
||||
case 0:
|
||||
FLAC__ASSERT(sizeof(residual[0]) == sizeof(data[0]));
|
||||
memcpy(data, residual, sizeof(residual[0])*data_len);
|
||||
break;
|
||||
case 1:
|
||||
for(i = 0; i < idata_len; i++)
|
||||
data[i] = residual[i] + data[i-1];
|
||||
break;
|
||||
case 2:
|
||||
for(i = 0; i < idata_len; i++)
|
||||
data[i] = residual[i] + 2*data[i-1] - data[i-2];
|
||||
break;
|
||||
case 3:
|
||||
for(i = 0; i < idata_len; i++)
|
||||
data[i] = residual[i] + 3*data[i-1] - 3*data[i-2] + data[i-3];
|
||||
break;
|
||||
case 4:
|
||||
for(i = 0; i < idata_len; i++)
|
||||
data[i] = residual[i] + 4*data[i-1] - 6*data[i-2] + 4*data[i-3] - data[i-4];
|
||||
break;
|
||||
default:
|
||||
FLAC__ASSERT(0);
|
||||
}
|
||||
}
|
||||
|
||||
void FLAC__fixed_restore_signal_wide(const FLAC__int32 residual[], uint32_t data_len, uint32_t order, FLAC__int32 data[])
|
||||
{
|
||||
int i, idata_len = (int)data_len;
|
||||
|
||||
switch(order) {
|
||||
case 0:
|
||||
FLAC__ASSERT(sizeof(residual[0]) == sizeof(data[0]));
|
||||
memcpy(data, residual, sizeof(residual[0])*data_len);
|
||||
break;
|
||||
case 1:
|
||||
for(i = 0; i < idata_len; i++)
|
||||
data[i] = (FLAC__int64)residual[i] + (FLAC__int64)data[i-1];
|
||||
break;
|
||||
case 2:
|
||||
for(i = 0; i < idata_len; i++)
|
||||
data[i] = (FLAC__int64)residual[i] + 2*(FLAC__int64)data[i-1] - (FLAC__int64)data[i-2];
|
||||
break;
|
||||
case 3:
|
||||
for(i = 0; i < idata_len; i++)
|
||||
data[i] = (FLAC__int64)residual[i] + 3*(FLAC__int64)data[i-1] - 3*(FLAC__int64)data[i-2] + (FLAC__int64)data[i-3];
|
||||
break;
|
||||
case 4:
|
||||
for(i = 0; i < idata_len; i++)
|
||||
data[i] = (FLAC__int64)residual[i] + 4*(FLAC__int64)data[i-1] - 6*(FLAC__int64)data[i-2] + 4*(FLAC__int64)data[i-3] - (FLAC__int64)data[i-4];
|
||||
break;
|
||||
default:
|
||||
FLAC__ASSERT(0);
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION) && !defined(FUZZING_BUILD_MODE_FLAC_SANITIZE_SIGNED_INTEGER_OVERFLOW)
|
||||
/* The attribute below is to silence the undefined sanitizer of oss-fuzz.
|
||||
* Because fuzzing feeds bogus predictors and residual samples to the
|
||||
* decoder, having overflows in this section is unavoidable. Also,
|
||||
* because the calculated values are audio path only, there is no
|
||||
* potential for security problems */
|
||||
__attribute__((no_sanitize("signed-integer-overflow")))
|
||||
#endif
|
||||
void FLAC__fixed_restore_signal_wide_33bit(const FLAC__int32 residual[], uint32_t data_len, uint32_t order, FLAC__int64 data[])
|
||||
{
|
||||
int i, idata_len = (int)data_len;
|
||||
|
||||
switch(order) {
|
||||
case 0:
|
||||
for(i = 0; i < idata_len; i++)
|
||||
data[i] = residual[i];
|
||||
break;
|
||||
case 1:
|
||||
for(i = 0; i < idata_len; i++)
|
||||
data[i] = (FLAC__int64)residual[i] + data[i-1];
|
||||
break;
|
||||
case 2:
|
||||
for(i = 0; i < idata_len; i++)
|
||||
data[i] = (FLAC__int64)residual[i] + 2*data[i-1] - data[i-2];
|
||||
break;
|
||||
case 3:
|
||||
for(i = 0; i < idata_len; i++)
|
||||
data[i] = (FLAC__int64)residual[i] + 3*data[i-1] - 3*data[i-2] + data[i-3];
|
||||
break;
|
||||
case 4:
|
||||
for(i = 0; i < idata_len; i++)
|
||||
data[i] = (FLAC__int64)residual[i] + 4*data[i-1] - 6*data[i-2] + 4*data[i-3] - data[i-4];
|
||||
break;
|
||||
default:
|
||||
FLAC__ASSERT(0);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,302 +0,0 @@
|
|||
/* libFLAC - Free Lossless Audio Codec library
|
||||
* Copyright (C) 2004-2009 Josh Coalson
|
||||
* Copyright (C) 2011-2023 Xiph.Org Foundation
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* - Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* - Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* - Neither the name of the Xiph.org Foundation nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include "../assert.h"
|
||||
#include "../compat.h"
|
||||
#include "include/private/float.h"
|
||||
|
||||
#ifdef FLAC__INTEGER_ONLY_LIBRARY
|
||||
|
||||
const FLAC__fixedpoint FLAC__FP_ZERO = 0;
|
||||
const FLAC__fixedpoint FLAC__FP_ONE_HALF = 0x00008000;
|
||||
const FLAC__fixedpoint FLAC__FP_ONE = 0x00010000;
|
||||
const FLAC__fixedpoint FLAC__FP_LN2 = 45426;
|
||||
const FLAC__fixedpoint FLAC__FP_E = 178145;
|
||||
|
||||
/* Lookup tables for Knuth's logarithm algorithm */
|
||||
#define LOG2_LOOKUP_PRECISION 16
|
||||
static const FLAC__uint32 log2_lookup[][LOG2_LOOKUP_PRECISION] = {
|
||||
{
|
||||
/*
|
||||
* 0 fraction bits
|
||||
*/
|
||||
/* undefined */ 0x00000000,
|
||||
/* lg(2/1) = */ 0x00000001,
|
||||
/* lg(4/3) = */ 0x00000000,
|
||||
/* lg(8/7) = */ 0x00000000,
|
||||
/* lg(16/15) = */ 0x00000000,
|
||||
/* lg(32/31) = */ 0x00000000,
|
||||
/* lg(64/63) = */ 0x00000000,
|
||||
/* lg(128/127) = */ 0x00000000,
|
||||
/* lg(256/255) = */ 0x00000000,
|
||||
/* lg(512/511) = */ 0x00000000,
|
||||
/* lg(1024/1023) = */ 0x00000000,
|
||||
/* lg(2048/2047) = */ 0x00000000,
|
||||
/* lg(4096/4095) = */ 0x00000000,
|
||||
/* lg(8192/8191) = */ 0x00000000,
|
||||
/* lg(16384/16383) = */ 0x00000000,
|
||||
/* lg(32768/32767) = */ 0x00000000
|
||||
},
|
||||
{
|
||||
/*
|
||||
* 4 fraction bits
|
||||
*/
|
||||
/* undefined */ 0x00000000,
|
||||
/* lg(2/1) = */ 0x00000010,
|
||||
/* lg(4/3) = */ 0x00000007,
|
||||
/* lg(8/7) = */ 0x00000003,
|
||||
/* lg(16/15) = */ 0x00000001,
|
||||
/* lg(32/31) = */ 0x00000001,
|
||||
/* lg(64/63) = */ 0x00000000,
|
||||
/* lg(128/127) = */ 0x00000000,
|
||||
/* lg(256/255) = */ 0x00000000,
|
||||
/* lg(512/511) = */ 0x00000000,
|
||||
/* lg(1024/1023) = */ 0x00000000,
|
||||
/* lg(2048/2047) = */ 0x00000000,
|
||||
/* lg(4096/4095) = */ 0x00000000,
|
||||
/* lg(8192/8191) = */ 0x00000000,
|
||||
/* lg(16384/16383) = */ 0x00000000,
|
||||
/* lg(32768/32767) = */ 0x00000000
|
||||
},
|
||||
{
|
||||
/*
|
||||
* 8 fraction bits
|
||||
*/
|
||||
/* undefined */ 0x00000000,
|
||||
/* lg(2/1) = */ 0x00000100,
|
||||
/* lg(4/3) = */ 0x0000006a,
|
||||
/* lg(8/7) = */ 0x00000031,
|
||||
/* lg(16/15) = */ 0x00000018,
|
||||
/* lg(32/31) = */ 0x0000000c,
|
||||
/* lg(64/63) = */ 0x00000006,
|
||||
/* lg(128/127) = */ 0x00000003,
|
||||
/* lg(256/255) = */ 0x00000001,
|
||||
/* lg(512/511) = */ 0x00000001,
|
||||
/* lg(1024/1023) = */ 0x00000000,
|
||||
/* lg(2048/2047) = */ 0x00000000,
|
||||
/* lg(4096/4095) = */ 0x00000000,
|
||||
/* lg(8192/8191) = */ 0x00000000,
|
||||
/* lg(16384/16383) = */ 0x00000000,
|
||||
/* lg(32768/32767) = */ 0x00000000
|
||||
},
|
||||
{
|
||||
/*
|
||||
* 12 fraction bits
|
||||
*/
|
||||
/* undefined */ 0x00000000,
|
||||
/* lg(2/1) = */ 0x00001000,
|
||||
/* lg(4/3) = */ 0x000006a4,
|
||||
/* lg(8/7) = */ 0x00000315,
|
||||
/* lg(16/15) = */ 0x0000017d,
|
||||
/* lg(32/31) = */ 0x000000bc,
|
||||
/* lg(64/63) = */ 0x0000005d,
|
||||
/* lg(128/127) = */ 0x0000002e,
|
||||
/* lg(256/255) = */ 0x00000017,
|
||||
/* lg(512/511) = */ 0x0000000c,
|
||||
/* lg(1024/1023) = */ 0x00000006,
|
||||
/* lg(2048/2047) = */ 0x00000003,
|
||||
/* lg(4096/4095) = */ 0x00000001,
|
||||
/* lg(8192/8191) = */ 0x00000001,
|
||||
/* lg(16384/16383) = */ 0x00000000,
|
||||
/* lg(32768/32767) = */ 0x00000000
|
||||
},
|
||||
{
|
||||
/*
|
||||
* 16 fraction bits
|
||||
*/
|
||||
/* undefined */ 0x00000000,
|
||||
/* lg(2/1) = */ 0x00010000,
|
||||
/* lg(4/3) = */ 0x00006a40,
|
||||
/* lg(8/7) = */ 0x00003151,
|
||||
/* lg(16/15) = */ 0x000017d6,
|
||||
/* lg(32/31) = */ 0x00000bba,
|
||||
/* lg(64/63) = */ 0x000005d1,
|
||||
/* lg(128/127) = */ 0x000002e6,
|
||||
/* lg(256/255) = */ 0x00000172,
|
||||
/* lg(512/511) = */ 0x000000b9,
|
||||
/* lg(1024/1023) = */ 0x0000005c,
|
||||
/* lg(2048/2047) = */ 0x0000002e,
|
||||
/* lg(4096/4095) = */ 0x00000017,
|
||||
/* lg(8192/8191) = */ 0x0000000c,
|
||||
/* lg(16384/16383) = */ 0x00000006,
|
||||
/* lg(32768/32767) = */ 0x00000003
|
||||
},
|
||||
{
|
||||
/*
|
||||
* 20 fraction bits
|
||||
*/
|
||||
/* undefined */ 0x00000000,
|
||||
/* lg(2/1) = */ 0x00100000,
|
||||
/* lg(4/3) = */ 0x0006a3fe,
|
||||
/* lg(8/7) = */ 0x00031513,
|
||||
/* lg(16/15) = */ 0x00017d60,
|
||||
/* lg(32/31) = */ 0x0000bb9d,
|
||||
/* lg(64/63) = */ 0x00005d10,
|
||||
/* lg(128/127) = */ 0x00002e59,
|
||||
/* lg(256/255) = */ 0x00001721,
|
||||
/* lg(512/511) = */ 0x00000b8e,
|
||||
/* lg(1024/1023) = */ 0x000005c6,
|
||||
/* lg(2048/2047) = */ 0x000002e3,
|
||||
/* lg(4096/4095) = */ 0x00000171,
|
||||
/* lg(8192/8191) = */ 0x000000b9,
|
||||
/* lg(16384/16383) = */ 0x0000005c,
|
||||
/* lg(32768/32767) = */ 0x0000002e
|
||||
},
|
||||
{
|
||||
/*
|
||||
* 24 fraction bits
|
||||
*/
|
||||
/* undefined */ 0x00000000,
|
||||
/* lg(2/1) = */ 0x01000000,
|
||||
/* lg(4/3) = */ 0x006a3fe6,
|
||||
/* lg(8/7) = */ 0x00315130,
|
||||
/* lg(16/15) = */ 0x0017d605,
|
||||
/* lg(32/31) = */ 0x000bb9ca,
|
||||
/* lg(64/63) = */ 0x0005d0fc,
|
||||
/* lg(128/127) = */ 0x0002e58f,
|
||||
/* lg(256/255) = */ 0x0001720e,
|
||||
/* lg(512/511) = */ 0x0000b8d8,
|
||||
/* lg(1024/1023) = */ 0x00005c61,
|
||||
/* lg(2048/2047) = */ 0x00002e2d,
|
||||
/* lg(4096/4095) = */ 0x00001716,
|
||||
/* lg(8192/8191) = */ 0x00000b8b,
|
||||
/* lg(16384/16383) = */ 0x000005c5,
|
||||
/* lg(32768/32767) = */ 0x000002e3
|
||||
},
|
||||
{
|
||||
/*
|
||||
* 28 fraction bits
|
||||
*/
|
||||
/* undefined */ 0x00000000,
|
||||
/* lg(2/1) = */ 0x10000000,
|
||||
/* lg(4/3) = */ 0x06a3fe5c,
|
||||
/* lg(8/7) = */ 0x03151301,
|
||||
/* lg(16/15) = */ 0x017d6049,
|
||||
/* lg(32/31) = */ 0x00bb9ca6,
|
||||
/* lg(64/63) = */ 0x005d0fba,
|
||||
/* lg(128/127) = */ 0x002e58f7,
|
||||
/* lg(256/255) = */ 0x001720da,
|
||||
/* lg(512/511) = */ 0x000b8d87,
|
||||
/* lg(1024/1023) = */ 0x0005c60b,
|
||||
/* lg(2048/2047) = */ 0x0002e2d7,
|
||||
/* lg(4096/4095) = */ 0x00017160,
|
||||
/* lg(8192/8191) = */ 0x0000b8ad,
|
||||
/* lg(16384/16383) = */ 0x00005c56,
|
||||
/* lg(32768/32767) = */ 0x00002e2b
|
||||
}
|
||||
};
|
||||
|
||||
#if 0
|
||||
static const FLAC__uint64 log2_lookup_wide[] = {
|
||||
{
|
||||
/*
|
||||
* 32 fraction bits
|
||||
*/
|
||||
/* undefined */ 0x00000000,
|
||||
/* lg(2/1) = */ FLAC__U64L(0x100000000),
|
||||
/* lg(4/3) = */ FLAC__U64L(0x6a3fe5c6),
|
||||
/* lg(8/7) = */ FLAC__U64L(0x31513015),
|
||||
/* lg(16/15) = */ FLAC__U64L(0x17d60497),
|
||||
/* lg(32/31) = */ FLAC__U64L(0x0bb9ca65),
|
||||
/* lg(64/63) = */ FLAC__U64L(0x05d0fba2),
|
||||
/* lg(128/127) = */ FLAC__U64L(0x02e58f74),
|
||||
/* lg(256/255) = */ FLAC__U64L(0x01720d9c),
|
||||
/* lg(512/511) = */ FLAC__U64L(0x00b8d875),
|
||||
/* lg(1024/1023) = */ FLAC__U64L(0x005c60aa),
|
||||
/* lg(2048/2047) = */ FLAC__U64L(0x002e2d72),
|
||||
/* lg(4096/4095) = */ FLAC__U64L(0x00171600),
|
||||
/* lg(8192/8191) = */ FLAC__U64L(0x000b8ad2),
|
||||
/* lg(16384/16383) = */ FLAC__U64L(0x0005c55d),
|
||||
/* lg(32768/32767) = */ FLAC__U64L(0x0002e2ac)
|
||||
},
|
||||
{
|
||||
/*
|
||||
* 48 fraction bits
|
||||
*/
|
||||
/* undefined */ 0x00000000,
|
||||
/* lg(2/1) = */ FLAC__U64L(0x1000000000000),
|
||||
/* lg(4/3) = */ FLAC__U64L(0x6a3fe5c60429),
|
||||
/* lg(8/7) = */ FLAC__U64L(0x315130157f7a),
|
||||
/* lg(16/15) = */ FLAC__U64L(0x17d60496cfbb),
|
||||
/* lg(32/31) = */ FLAC__U64L(0xbb9ca64ecac),
|
||||
/* lg(64/63) = */ FLAC__U64L(0x5d0fba187cd),
|
||||
/* lg(128/127) = */ FLAC__U64L(0x2e58f7441ee),
|
||||
/* lg(256/255) = */ FLAC__U64L(0x1720d9c06a8),
|
||||
/* lg(512/511) = */ FLAC__U64L(0xb8d8752173),
|
||||
/* lg(1024/1023) = */ FLAC__U64L(0x5c60aa252e),
|
||||
/* lg(2048/2047) = */ FLAC__U64L(0x2e2d71b0d8),
|
||||
/* lg(4096/4095) = */ FLAC__U64L(0x1716001719),
|
||||
/* lg(8192/8191) = */ FLAC__U64L(0xb8ad1de1b),
|
||||
/* lg(16384/16383) = */ FLAC__U64L(0x5c55d640d),
|
||||
/* lg(32768/32767) = */ FLAC__U64L(0x2e2abcf52)
|
||||
}
|
||||
};
|
||||
#endif
|
||||
|
||||
FLAC__uint32 FLAC__fixedpoint_log2(FLAC__uint32 x, uint32_t fracbits, uint32_t precision)
|
||||
{
|
||||
const FLAC__uint32 ONE = (1u << fracbits);
|
||||
const FLAC__uint32 *table = log2_lookup[fracbits >> 2];
|
||||
|
||||
FLAC__ASSERT(fracbits < 32);
|
||||
FLAC__ASSERT((fracbits & 0x3) == 0);
|
||||
|
||||
if(x < ONE)
|
||||
return 0;
|
||||
|
||||
if(precision > LOG2_LOOKUP_PRECISION)
|
||||
precision = LOG2_LOOKUP_PRECISION;
|
||||
|
||||
/* Knuth's algorithm for computing logarithms, optimized for base-2 with lookup tables */
|
||||
{
|
||||
FLAC__uint32 y = 0;
|
||||
FLAC__uint32 z = x >> 1, k = 1;
|
||||
while (x > ONE && k < precision) {
|
||||
if (x - z >= ONE) {
|
||||
x -= z;
|
||||
z = x >> k;
|
||||
y += table[k];
|
||||
}
|
||||
else {
|
||||
z >>= 1;
|
||||
k++;
|
||||
}
|
||||
}
|
||||
return y;
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* defined FLAC__INTEGER_ONLY_LIBRARY */
|
||||
|
|
@ -1,608 +0,0 @@
|
|||
/* libFLAC - Free Lossless Audio Codec library
|
||||
* Copyright (C) 2000-2009 Josh Coalson
|
||||
* Copyright (C) 2011-2023 Xiph.Org Foundation
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* - Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* - Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* - Neither the name of the Xiph.org Foundation nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h> /* for qsort() */
|
||||
#include <string.h> /* for memset() */
|
||||
#include "../assert.h"
|
||||
#include "../format.h"
|
||||
#include "../alloc.h"
|
||||
#include "../compat.h"
|
||||
#include "include/private/format.h"
|
||||
|
||||
|
||||
#if (defined GIT_COMMIT_HASH && defined GIT_COMMIT_DATE)
|
||||
# ifdef GIT_COMMIT_TAG
|
||||
FLAC_API const char *FLAC__VERSION_STRING = GIT_COMMIT_TAG;
|
||||
FLAC_API const char *FLAC__VENDOR_STRING = "reference libFLAC " GIT_COMMIT_TAG " " GIT_COMMIT_DATE;
|
||||
# else
|
||||
FLAC_API const char *FLAC__VERSION_STRING = "git-" GIT_COMMIT_HASH " " GIT_COMMIT_DATE;
|
||||
FLAC_API const char *FLAC__VENDOR_STRING = "reference libFLAC git-" GIT_COMMIT_HASH " " GIT_COMMIT_DATE;
|
||||
# endif
|
||||
#else
|
||||
/* PACKAGE_VERSION should come from configure */
|
||||
FLAC_API const char *FLAC__VERSION_STRING = PACKAGE_VERSION;
|
||||
FLAC_API const char *FLAC__VENDOR_STRING = "reference libFLAC " PACKAGE_VERSION " 20230623";
|
||||
#endif
|
||||
|
||||
FLAC_API const FLAC__byte FLAC__STREAM_SYNC_STRING[4] = { 'f','L','a','C' };
|
||||
FLAC_API const uint32_t FLAC__STREAM_SYNC = 0x664C6143;
|
||||
FLAC_API const uint32_t FLAC__STREAM_SYNC_LEN = 32; /* bits */
|
||||
|
||||
FLAC_API const uint32_t FLAC__STREAM_METADATA_STREAMINFO_MIN_BLOCK_SIZE_LEN = 16; /* bits */
|
||||
FLAC_API const uint32_t FLAC__STREAM_METADATA_STREAMINFO_MAX_BLOCK_SIZE_LEN = 16; /* bits */
|
||||
FLAC_API const uint32_t FLAC__STREAM_METADATA_STREAMINFO_MIN_FRAME_SIZE_LEN = 24; /* bits */
|
||||
FLAC_API const uint32_t FLAC__STREAM_METADATA_STREAMINFO_MAX_FRAME_SIZE_LEN = 24; /* bits */
|
||||
FLAC_API const uint32_t FLAC__STREAM_METADATA_STREAMINFO_SAMPLE_RATE_LEN = 20; /* bits */
|
||||
FLAC_API const uint32_t FLAC__STREAM_METADATA_STREAMINFO_CHANNELS_LEN = 3; /* bits */
|
||||
FLAC_API const uint32_t FLAC__STREAM_METADATA_STREAMINFO_BITS_PER_SAMPLE_LEN = 5; /* bits */
|
||||
FLAC_API const uint32_t FLAC__STREAM_METADATA_STREAMINFO_TOTAL_SAMPLES_LEN = 36; /* bits */
|
||||
FLAC_API const uint32_t FLAC__STREAM_METADATA_STREAMINFO_MD5SUM_LEN = 128; /* bits */
|
||||
|
||||
FLAC_API const uint32_t FLAC__STREAM_METADATA_APPLICATION_ID_LEN = 32; /* bits */
|
||||
|
||||
FLAC_API const uint32_t FLAC__STREAM_METADATA_SEEKPOINT_SAMPLE_NUMBER_LEN = 64; /* bits */
|
||||
FLAC_API const uint32_t FLAC__STREAM_METADATA_SEEKPOINT_STREAM_OFFSET_LEN = 64; /* bits */
|
||||
FLAC_API const uint32_t FLAC__STREAM_METADATA_SEEKPOINT_FRAME_SAMPLES_LEN = 16; /* bits */
|
||||
|
||||
FLAC_API const FLAC__uint64 FLAC__STREAM_METADATA_SEEKPOINT_PLACEHOLDER = FLAC__U64L(0xffffffffffffffff);
|
||||
|
||||
FLAC_API const uint32_t FLAC__STREAM_METADATA_VORBIS_COMMENT_ENTRY_LENGTH_LEN = 32; /* bits */
|
||||
FLAC_API const uint32_t FLAC__STREAM_METADATA_VORBIS_COMMENT_NUM_COMMENTS_LEN = 32; /* bits */
|
||||
|
||||
FLAC_API const uint32_t FLAC__STREAM_METADATA_CUESHEET_INDEX_OFFSET_LEN = 64; /* bits */
|
||||
FLAC_API const uint32_t FLAC__STREAM_METADATA_CUESHEET_INDEX_NUMBER_LEN = 8; /* bits */
|
||||
FLAC_API const uint32_t FLAC__STREAM_METADATA_CUESHEET_INDEX_RESERVED_LEN = 3*8; /* bits */
|
||||
|
||||
FLAC_API const uint32_t FLAC__STREAM_METADATA_CUESHEET_TRACK_OFFSET_LEN = 64; /* bits */
|
||||
FLAC_API const uint32_t FLAC__STREAM_METADATA_CUESHEET_TRACK_NUMBER_LEN = 8; /* bits */
|
||||
FLAC_API const uint32_t FLAC__STREAM_METADATA_CUESHEET_TRACK_ISRC_LEN = 12*8; /* bits */
|
||||
FLAC_API const uint32_t FLAC__STREAM_METADATA_CUESHEET_TRACK_TYPE_LEN = 1; /* bit */
|
||||
FLAC_API const uint32_t FLAC__STREAM_METADATA_CUESHEET_TRACK_PRE_EMPHASIS_LEN = 1; /* bit */
|
||||
FLAC_API const uint32_t FLAC__STREAM_METADATA_CUESHEET_TRACK_RESERVED_LEN = 6+13*8; /* bits */
|
||||
FLAC_API const uint32_t FLAC__STREAM_METADATA_CUESHEET_TRACK_NUM_INDICES_LEN = 8; /* bits */
|
||||
|
||||
FLAC_API const uint32_t FLAC__STREAM_METADATA_CUESHEET_MEDIA_CATALOG_NUMBER_LEN = 128*8; /* bits */
|
||||
FLAC_API const uint32_t FLAC__STREAM_METADATA_CUESHEET_LEAD_IN_LEN = 64; /* bits */
|
||||
FLAC_API const uint32_t FLAC__STREAM_METADATA_CUESHEET_IS_CD_LEN = 1; /* bit */
|
||||
FLAC_API const uint32_t FLAC__STREAM_METADATA_CUESHEET_RESERVED_LEN = 7+258*8; /* bits */
|
||||
FLAC_API const uint32_t FLAC__STREAM_METADATA_CUESHEET_NUM_TRACKS_LEN = 8; /* bits */
|
||||
|
||||
FLAC_API const uint32_t FLAC__STREAM_METADATA_PICTURE_TYPE_LEN = 32; /* bits */
|
||||
FLAC_API const uint32_t FLAC__STREAM_METADATA_PICTURE_MIME_TYPE_LENGTH_LEN = 32; /* bits */
|
||||
FLAC_API const uint32_t FLAC__STREAM_METADATA_PICTURE_DESCRIPTION_LENGTH_LEN = 32; /* bits */
|
||||
FLAC_API const uint32_t FLAC__STREAM_METADATA_PICTURE_WIDTH_LEN = 32; /* bits */
|
||||
FLAC_API const uint32_t FLAC__STREAM_METADATA_PICTURE_HEIGHT_LEN = 32; /* bits */
|
||||
FLAC_API const uint32_t FLAC__STREAM_METADATA_PICTURE_DEPTH_LEN = 32; /* bits */
|
||||
FLAC_API const uint32_t FLAC__STREAM_METADATA_PICTURE_COLORS_LEN = 32; /* bits */
|
||||
FLAC_API const uint32_t FLAC__STREAM_METADATA_PICTURE_DATA_LENGTH_LEN = 32; /* bits */
|
||||
|
||||
FLAC_API const uint32_t FLAC__STREAM_METADATA_IS_LAST_LEN = 1; /* bits */
|
||||
FLAC_API const uint32_t FLAC__STREAM_METADATA_TYPE_LEN = 7; /* bits */
|
||||
FLAC_API const uint32_t FLAC__STREAM_METADATA_LENGTH_LEN = 24; /* bits */
|
||||
|
||||
FLAC_API const uint32_t FLAC__FRAME_HEADER_SYNC = 0x3ffe;
|
||||
FLAC_API const uint32_t FLAC__FRAME_HEADER_SYNC_LEN = 14; /* bits */
|
||||
FLAC_API const uint32_t FLAC__FRAME_HEADER_RESERVED_LEN = 1; /* bits */
|
||||
FLAC_API const uint32_t FLAC__FRAME_HEADER_BLOCKING_STRATEGY_LEN = 1; /* bits */
|
||||
FLAC_API const uint32_t FLAC__FRAME_HEADER_BLOCK_SIZE_LEN = 4; /* bits */
|
||||
FLAC_API const uint32_t FLAC__FRAME_HEADER_SAMPLE_RATE_LEN = 4; /* bits */
|
||||
FLAC_API const uint32_t FLAC__FRAME_HEADER_CHANNEL_ASSIGNMENT_LEN = 4; /* bits */
|
||||
FLAC_API const uint32_t FLAC__FRAME_HEADER_BITS_PER_SAMPLE_LEN = 3; /* bits */
|
||||
FLAC_API const uint32_t FLAC__FRAME_HEADER_ZERO_PAD_LEN = 1; /* bits */
|
||||
FLAC_API const uint32_t FLAC__FRAME_HEADER_CRC_LEN = 8; /* bits */
|
||||
|
||||
FLAC_API const uint32_t FLAC__FRAME_FOOTER_CRC_LEN = 16; /* bits */
|
||||
|
||||
FLAC_API const uint32_t FLAC__ENTROPY_CODING_METHOD_TYPE_LEN = 2; /* bits */
|
||||
FLAC_API const uint32_t FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE_ORDER_LEN = 4; /* bits */
|
||||
FLAC_API const uint32_t FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE_PARAMETER_LEN = 4; /* bits */
|
||||
FLAC_API const uint32_t FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE2_PARAMETER_LEN = 5; /* bits */
|
||||
FLAC_API const uint32_t FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE_RAW_LEN = 5; /* bits */
|
||||
|
||||
FLAC_API const uint32_t FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE_ESCAPE_PARAMETER = 15; /* == (1<<FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE_PARAMETER_LEN)-1 */
|
||||
FLAC_API const uint32_t FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE2_ESCAPE_PARAMETER = 31; /* == (1<<FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE2_PARAMETER_LEN)-1 */
|
||||
|
||||
FLAC_API const char * const FLAC__EntropyCodingMethodTypeString[] = {
|
||||
"PARTITIONED_RICE",
|
||||
"PARTITIONED_RICE2"
|
||||
};
|
||||
|
||||
FLAC_API const uint32_t FLAC__SUBFRAME_LPC_QLP_COEFF_PRECISION_LEN = 4; /* bits */
|
||||
FLAC_API const uint32_t FLAC__SUBFRAME_LPC_QLP_SHIFT_LEN = 5; /* bits */
|
||||
|
||||
FLAC_API const uint32_t FLAC__SUBFRAME_ZERO_PAD_LEN = 1; /* bits */
|
||||
FLAC_API const uint32_t FLAC__SUBFRAME_TYPE_LEN = 6; /* bits */
|
||||
FLAC_API const uint32_t FLAC__SUBFRAME_WASTED_BITS_FLAG_LEN = 1; /* bits */
|
||||
|
||||
FLAC_API const uint32_t FLAC__SUBFRAME_TYPE_CONSTANT_BYTE_ALIGNED_MASK = 0x00;
|
||||
FLAC_API const uint32_t FLAC__SUBFRAME_TYPE_VERBATIM_BYTE_ALIGNED_MASK = 0x02;
|
||||
FLAC_API const uint32_t FLAC__SUBFRAME_TYPE_FIXED_BYTE_ALIGNED_MASK = 0x10;
|
||||
FLAC_API const uint32_t FLAC__SUBFRAME_TYPE_LPC_BYTE_ALIGNED_MASK = 0x40;
|
||||
|
||||
FLAC_API const char * const FLAC__SubframeTypeString[] = {
|
||||
"CONSTANT",
|
||||
"VERBATIM",
|
||||
"FIXED",
|
||||
"LPC"
|
||||
};
|
||||
|
||||
FLAC_API const char * const FLAC__ChannelAssignmentString[] = {
|
||||
"INDEPENDENT",
|
||||
"LEFT_SIDE",
|
||||
"RIGHT_SIDE",
|
||||
"MID_SIDE"
|
||||
};
|
||||
|
||||
FLAC_API const char * const FLAC__FrameNumberTypeString[] = {
|
||||
"FRAME_NUMBER_TYPE_FRAME_NUMBER",
|
||||
"FRAME_NUMBER_TYPE_SAMPLE_NUMBER"
|
||||
};
|
||||
|
||||
FLAC_API const char * const FLAC__MetadataTypeString[] = {
|
||||
"STREAMINFO",
|
||||
"PADDING",
|
||||
"APPLICATION",
|
||||
"SEEKTABLE",
|
||||
"VORBIS_COMMENT",
|
||||
"CUESHEET",
|
||||
"PICTURE"
|
||||
};
|
||||
|
||||
FLAC_API const char * const FLAC__StreamMetadata_Picture_TypeString[] = {
|
||||
"Other",
|
||||
"32x32 pixels 'file icon' (PNG only)",
|
||||
"Other file icon",
|
||||
"Cover (front)",
|
||||
"Cover (back)",
|
||||
"Leaflet page",
|
||||
"Media (e.g. label side of CD)",
|
||||
"Lead artist/lead performer/soloist",
|
||||
"Artist/performer",
|
||||
"Conductor",
|
||||
"Band/Orchestra",
|
||||
"Composer",
|
||||
"Lyricist/text writer",
|
||||
"Recording Location",
|
||||
"During recording",
|
||||
"During performance",
|
||||
"Movie/video screen capture",
|
||||
"A bright coloured fish",
|
||||
"Illustration",
|
||||
"Band/artist logotype",
|
||||
"Publisher/Studio logotype"
|
||||
};
|
||||
|
||||
FLAC_API FLAC__bool FLAC__format_sample_rate_is_valid(uint32_t sample_rate)
|
||||
{
|
||||
if(sample_rate > FLAC__MAX_SAMPLE_RATE) {
|
||||
return false;
|
||||
}
|
||||
else
|
||||
return true;
|
||||
}
|
||||
|
||||
FLAC_API FLAC__bool FLAC__format_blocksize_is_subset(uint32_t blocksize, uint32_t sample_rate)
|
||||
{
|
||||
if(blocksize > 16384)
|
||||
return false;
|
||||
else if(sample_rate <= 48000 && blocksize > 4608)
|
||||
return false;
|
||||
else
|
||||
return true;
|
||||
}
|
||||
|
||||
FLAC_API FLAC__bool FLAC__format_sample_rate_is_subset(uint32_t sample_rate)
|
||||
{
|
||||
if( // sample rate is not subset if
|
||||
!FLAC__format_sample_rate_is_valid(sample_rate) || // sample rate is invalid or
|
||||
sample_rate >= ((1u << 16) * 10) || // sample rate is larger then or equal to 655360 or
|
||||
(sample_rate >= (1u << 16) && sample_rate % 10 != 0) //sample rate is >= 65536 and not divisible by 10
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
else
|
||||
return true;
|
||||
}
|
||||
|
||||
/* @@@@ add to unit tests; it is already indirectly tested by the metadata_object tests */
|
||||
FLAC_API FLAC__bool FLAC__format_seektable_is_legal(const FLAC__StreamMetadata_SeekTable *seek_table)
|
||||
{
|
||||
uint32_t i;
|
||||
FLAC__uint64 prev_sample_number = 0;
|
||||
FLAC__bool got_prev = false;
|
||||
|
||||
FLAC__ASSERT(0 != seek_table);
|
||||
|
||||
if((FLAC__uint64)(seek_table->num_points) * FLAC__STREAM_METADATA_SEEKPOINT_LENGTH >= (1u << FLAC__STREAM_METADATA_LENGTH_LEN))
|
||||
return false;
|
||||
|
||||
for(i = 0; i < seek_table->num_points; i++) {
|
||||
if(got_prev) {
|
||||
if(
|
||||
seek_table->points[i].sample_number != FLAC__STREAM_METADATA_SEEKPOINT_PLACEHOLDER &&
|
||||
seek_table->points[i].sample_number <= prev_sample_number
|
||||
)
|
||||
return false;
|
||||
}
|
||||
prev_sample_number = seek_table->points[i].sample_number;
|
||||
got_prev = true;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/* used as the sort predicate for qsort() */
|
||||
static int seekpoint_compare_(const FLAC__StreamMetadata_SeekPoint *l, const FLAC__StreamMetadata_SeekPoint *r)
|
||||
{
|
||||
/* we don't just 'return l->sample_number - r->sample_number' since the result (FLAC__int64) might overflow an 'int' */
|
||||
if(l->sample_number == r->sample_number)
|
||||
return 0;
|
||||
else if(l->sample_number < r->sample_number)
|
||||
return -1;
|
||||
else
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* @@@@ add to unit tests; it is already indirectly tested by the metadata_object tests */
|
||||
FLAC_API uint32_t FLAC__format_seektable_sort(FLAC__StreamMetadata_SeekTable *seek_table)
|
||||
{
|
||||
uint32_t i, j;
|
||||
FLAC__bool first;
|
||||
|
||||
FLAC__ASSERT(0 != seek_table);
|
||||
|
||||
if (seek_table->num_points == 0)
|
||||
return 0;
|
||||
|
||||
/* sort the seekpoints */
|
||||
qsort(seek_table->points, seek_table->num_points, sizeof(FLAC__StreamMetadata_SeekPoint), (int (*)(const void *, const void *))seekpoint_compare_);
|
||||
|
||||
/* uniquify the seekpoints */
|
||||
first = true;
|
||||
for(i = j = 0; i < seek_table->num_points; i++) {
|
||||
if(seek_table->points[i].sample_number != FLAC__STREAM_METADATA_SEEKPOINT_PLACEHOLDER) {
|
||||
if(!first) {
|
||||
if(seek_table->points[i].sample_number == seek_table->points[j-1].sample_number)
|
||||
continue;
|
||||
}
|
||||
}
|
||||
first = false;
|
||||
seek_table->points[j++] = seek_table->points[i];
|
||||
}
|
||||
|
||||
for(i = j; i < seek_table->num_points; i++) {
|
||||
seek_table->points[i].sample_number = FLAC__STREAM_METADATA_SEEKPOINT_PLACEHOLDER;
|
||||
seek_table->points[i].stream_offset = 0;
|
||||
seek_table->points[i].frame_samples = 0;
|
||||
}
|
||||
|
||||
return j;
|
||||
}
|
||||
|
||||
/*
|
||||
* also disallows non-shortest-form encodings, c.f.
|
||||
* http://www.unicode.org/versions/corrigendum1.html
|
||||
* and a more clear explanation at the end of this section:
|
||||
* http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
|
||||
*/
|
||||
static uint32_t utf8len_(const FLAC__byte *utf8)
|
||||
{
|
||||
FLAC__ASSERT(0 != utf8);
|
||||
if ((utf8[0] & 0x80) == 0) {
|
||||
return 1;
|
||||
}
|
||||
else if ((utf8[0] & 0xE0) == 0xC0 && (utf8[1] & 0xC0) == 0x80) {
|
||||
if ((utf8[0] & 0xFE) == 0xC0) /* overlong sequence check */
|
||||
return 0;
|
||||
return 2;
|
||||
}
|
||||
else if ((utf8[0] & 0xF0) == 0xE0 && (utf8[1] & 0xC0) == 0x80 && (utf8[2] & 0xC0) == 0x80) {
|
||||
if (utf8[0] == 0xE0 && (utf8[1] & 0xE0) == 0x80) /* overlong sequence check */
|
||||
return 0;
|
||||
/* illegal surrogates check (U+D800...U+DFFF and U+FFFE...U+FFFF) */
|
||||
if (utf8[0] == 0xED && (utf8[1] & 0xE0) == 0xA0) /* D800-DFFF */
|
||||
return 0;
|
||||
if (utf8[0] == 0xEF && utf8[1] == 0xBF && (utf8[2] & 0xFE) == 0xBE) /* FFFE-FFFF */
|
||||
return 0;
|
||||
return 3;
|
||||
}
|
||||
else if ((utf8[0] & 0xF8) == 0xF0 && (utf8[1] & 0xC0) == 0x80 && (utf8[2] & 0xC0) == 0x80 && (utf8[3] & 0xC0) == 0x80) {
|
||||
if (utf8[0] == 0xF0 && (utf8[1] & 0xF0) == 0x80) /* overlong sequence check */
|
||||
return 0;
|
||||
return 4;
|
||||
}
|
||||
else if ((utf8[0] & 0xFC) == 0xF8 && (utf8[1] & 0xC0) == 0x80 && (utf8[2] & 0xC0) == 0x80 && (utf8[3] & 0xC0) == 0x80 && (utf8[4] & 0xC0) == 0x80) {
|
||||
if (utf8[0] == 0xF8 && (utf8[1] & 0xF8) == 0x80) /* overlong sequence check */
|
||||
return 0;
|
||||
return 5;
|
||||
}
|
||||
else if ((utf8[0] & 0xFE) == 0xFC && (utf8[1] & 0xC0) == 0x80 && (utf8[2] & 0xC0) == 0x80 && (utf8[3] & 0xC0) == 0x80 && (utf8[4] & 0xC0) == 0x80 && (utf8[5] & 0xC0) == 0x80) {
|
||||
if (utf8[0] == 0xFC && (utf8[1] & 0xFC) == 0x80) /* overlong sequence check */
|
||||
return 0;
|
||||
return 6;
|
||||
}
|
||||
else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
FLAC_API FLAC__bool FLAC__format_vorbiscomment_entry_name_is_legal(const char *name)
|
||||
{
|
||||
char c;
|
||||
for(c = *name; c; c = *(++name))
|
||||
if(c < 0x20 || c == 0x3d || c > 0x7d)
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
FLAC_API FLAC__bool FLAC__format_vorbiscomment_entry_value_is_legal(const FLAC__byte *value, uint32_t length)
|
||||
{
|
||||
if(length == (uint32_t)(-1)) {
|
||||
while(*value) {
|
||||
uint32_t n = utf8len_(value);
|
||||
if(n == 0)
|
||||
return false;
|
||||
value += n;
|
||||
}
|
||||
}
|
||||
else {
|
||||
const FLAC__byte *end = value + length;
|
||||
while(value < end) {
|
||||
uint32_t n = utf8len_(value);
|
||||
if(n == 0)
|
||||
return false;
|
||||
value += n;
|
||||
}
|
||||
if(value != end)
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
FLAC_API FLAC__bool FLAC__format_vorbiscomment_entry_is_legal(const FLAC__byte *entry, uint32_t length)
|
||||
{
|
||||
const FLAC__byte *s, *end;
|
||||
|
||||
for(s = entry, end = s + length; s < end && *s != '='; s++) {
|
||||
if(*s < 0x20 || *s > 0x7D)
|
||||
return false;
|
||||
}
|
||||
if(s == end)
|
||||
return false;
|
||||
|
||||
s++; /* skip '=' */
|
||||
|
||||
while(s < end) {
|
||||
uint32_t n = utf8len_(s);
|
||||
if(n == 0)
|
||||
return false;
|
||||
s += n;
|
||||
}
|
||||
if(s != end)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/* @@@@ add to unit tests; it is already indirectly tested by the metadata_object tests */
|
||||
FLAC_API FLAC__bool FLAC__format_cuesheet_is_legal(const FLAC__StreamMetadata_CueSheet *cue_sheet, FLAC__bool check_cd_da_subset, const char **violation)
|
||||
{
|
||||
uint32_t i, j;
|
||||
|
||||
if(check_cd_da_subset) {
|
||||
if(cue_sheet->lead_in < 2 * 44100) {
|
||||
if(violation) *violation = "CD-DA cue sheet must have a lead-in length of at least 2 seconds";
|
||||
return false;
|
||||
}
|
||||
if(cue_sheet->lead_in % 588 != 0) {
|
||||
if(violation) *violation = "CD-DA cue sheet lead-in length must be evenly divisible by 588 samples";
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if(cue_sheet->num_tracks == 0) {
|
||||
if(violation) *violation = "cue sheet must have at least one track (the lead-out)";
|
||||
return false;
|
||||
}
|
||||
|
||||
if(check_cd_da_subset && cue_sheet->tracks[cue_sheet->num_tracks-1].number != 170) {
|
||||
if(violation) *violation = "CD-DA cue sheet must have a lead-out track number 170 (0xAA)";
|
||||
return false;
|
||||
}
|
||||
|
||||
for(i = 0; i < cue_sheet->num_tracks; i++) {
|
||||
if(cue_sheet->tracks[i].number == 0) {
|
||||
if(violation) *violation = "cue sheet may not have a track number 0";
|
||||
return false;
|
||||
}
|
||||
|
||||
if(check_cd_da_subset) {
|
||||
if(!((cue_sheet->tracks[i].number >= 1 && cue_sheet->tracks[i].number <= 99) || cue_sheet->tracks[i].number == 170)) {
|
||||
if(violation) *violation = "CD-DA cue sheet track number must be 1-99 or 170";
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if(check_cd_da_subset && cue_sheet->tracks[i].offset % 588 != 0) {
|
||||
if(violation) {
|
||||
if(i == cue_sheet->num_tracks-1) /* the lead-out track... */
|
||||
*violation = "CD-DA cue sheet lead-out offset must be evenly divisible by 588 samples";
|
||||
else
|
||||
*violation = "CD-DA cue sheet track offset must be evenly divisible by 588 samples";
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
if(i < cue_sheet->num_tracks - 1) {
|
||||
if(cue_sheet->tracks[i].num_indices == 0) {
|
||||
if(violation) *violation = "cue sheet track must have at least one index point";
|
||||
return false;
|
||||
}
|
||||
|
||||
if(cue_sheet->tracks[i].indices[0].number > 1) {
|
||||
if(violation) *violation = "cue sheet track's first index number must be 0 or 1";
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
for(j = 0; j < cue_sheet->tracks[i].num_indices; j++) {
|
||||
if(check_cd_da_subset && cue_sheet->tracks[i].indices[j].offset % 588 != 0) {
|
||||
if(violation) *violation = "CD-DA cue sheet track index offset must be evenly divisible by 588 samples";
|
||||
return false;
|
||||
}
|
||||
|
||||
if(j > 0) {
|
||||
if(cue_sheet->tracks[i].indices[j].number != cue_sheet->tracks[i].indices[j-1].number + 1) {
|
||||
if(violation) *violation = "cue sheet track index numbers must increase by 1";
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/* @@@@ add to unit tests; it is already indirectly tested by the metadata_object tests */
|
||||
FLAC_API FLAC__bool FLAC__format_picture_is_legal(const FLAC__StreamMetadata_Picture *picture, const char **violation)
|
||||
{
|
||||
char *p;
|
||||
FLAC__byte *b;
|
||||
|
||||
for(p = picture->mime_type; *p; p++) {
|
||||
if(*p < 0x20 || *p > 0x7e) {
|
||||
if(violation) *violation = "MIME type string must contain only printable ASCII characters (0x20-0x7e)";
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
for(b = picture->description; *b; ) {
|
||||
uint32_t n = utf8len_(b);
|
||||
if(n == 0) {
|
||||
if(violation) *violation = "description string must be valid UTF-8";
|
||||
return false;
|
||||
}
|
||||
b += n;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/*
|
||||
* These routines are private to libFLAC
|
||||
*/
|
||||
#if 0 /* UNUSED */
|
||||
uint32_t FLAC__format_get_max_rice_partition_order(uint32_t blocksize, uint32_t predictor_order)
|
||||
{
|
||||
return
|
||||
FLAC__format_get_max_rice_partition_order_from_blocksize_limited_max_and_predictor_order(
|
||||
FLAC__format_get_max_rice_partition_order_from_blocksize(blocksize),
|
||||
blocksize,
|
||||
predictor_order
|
||||
);
|
||||
}
|
||||
#endif
|
||||
|
||||
uint32_t FLAC__format_get_max_rice_partition_order_from_blocksize(uint32_t blocksize)
|
||||
{
|
||||
uint32_t max_rice_partition_order = 0;
|
||||
while(!(blocksize & 1)) {
|
||||
max_rice_partition_order++;
|
||||
blocksize >>= 1;
|
||||
}
|
||||
return flac_min(FLAC__MAX_RICE_PARTITION_ORDER, max_rice_partition_order);
|
||||
}
|
||||
|
||||
uint32_t FLAC__format_get_max_rice_partition_order_from_blocksize_limited_max_and_predictor_order(uint32_t limit, uint32_t blocksize, uint32_t predictor_order)
|
||||
{
|
||||
uint32_t max_rice_partition_order = limit;
|
||||
|
||||
while(max_rice_partition_order > 0 && (blocksize >> max_rice_partition_order) <= predictor_order)
|
||||
max_rice_partition_order--;
|
||||
|
||||
FLAC__ASSERT(
|
||||
(max_rice_partition_order == 0 && blocksize >= predictor_order) ||
|
||||
(max_rice_partition_order > 0 && blocksize >> max_rice_partition_order > predictor_order)
|
||||
);
|
||||
|
||||
return max_rice_partition_order;
|
||||
}
|
||||
|
||||
void FLAC__format_entropy_coding_method_partitioned_rice_contents_init(FLAC__EntropyCodingMethod_PartitionedRiceContents *object)
|
||||
{
|
||||
FLAC__ASSERT(0 != object);
|
||||
|
||||
object->parameters = 0;
|
||||
object->raw_bits = 0;
|
||||
object->capacity_by_order = 0;
|
||||
}
|
||||
|
||||
void FLAC__format_entropy_coding_method_partitioned_rice_contents_clear(FLAC__EntropyCodingMethod_PartitionedRiceContents *object)
|
||||
{
|
||||
FLAC__ASSERT(0 != object);
|
||||
|
||||
if(0 != object->parameters)
|
||||
free(object->parameters);
|
||||
if(0 != object->raw_bits)
|
||||
free(object->raw_bits);
|
||||
FLAC__format_entropy_coding_method_partitioned_rice_contents_init(object);
|
||||
}
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
// silence three MSVC warnings 'result of 32-bit shift implicitly converted to 64 bits (was 64-bit shift intended?)'
|
||||
#pragma warning ( disable : 4334 )
|
||||
#endif
|
||||
|
||||
FLAC__bool FLAC__format_entropy_coding_method_partitioned_rice_contents_ensure_size(FLAC__EntropyCodingMethod_PartitionedRiceContents *object, uint32_t max_partition_order)
|
||||
{
|
||||
FLAC__ASSERT(0 != object);
|
||||
|
||||
if(object->capacity_by_order < max_partition_order || object->parameters == NULL || object->raw_bits == NULL) {
|
||||
if(0 == (object->parameters = (uint32_t*) safe_realloc_(object->parameters, sizeof(uint32_t)*(1 << max_partition_order))))
|
||||
return false;
|
||||
if(0 == (object->raw_bits = (uint32_t*) safe_realloc_(object->raw_bits, sizeof(uint32_t)*(1 << max_partition_order))))
|
||||
return false;
|
||||
memset(object->raw_bits, 0, sizeof(uint32_t)*(1 << max_partition_order));
|
||||
object->capacity_by_order = max_partition_order;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
#pragma warning ( default : 4334 )
|
||||
#endif
|
||||
|
|
@ -1,210 +0,0 @@
|
|||
/* libFLAC - Free Lossless Audio Codec library
|
||||
* Copyright (C) 2001-2009 Josh Coalson
|
||||
* Copyright (C) 2011-2023 Xiph.Org Foundation
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* - Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* - Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* - Neither the name of the Xiph.org Foundation nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef FLAC__PRIVATE__BITMATH_H
|
||||
#define FLAC__PRIVATE__BITMATH_H
|
||||
|
||||
#include "../../../ordinals.h"
|
||||
#include "../../../assert.h"
|
||||
|
||||
#include "../../../compat.h"
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
#include <intrin.h> /* for _BitScanReverse* */
|
||||
#endif
|
||||
|
||||
/* Will never be emitted for MSVC, GCC, Intel compilers */
|
||||
static inline uint32_t FLAC__clz_soft_uint32(FLAC__uint32 word)
|
||||
{
|
||||
static const uint8_t byte_to_unary_table[] = {
|
||||
8, 7, 6, 6, 5, 5, 5, 5, 4, 4, 4, 4, 4, 4, 4, 4,
|
||||
3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
|
||||
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
|
||||
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
};
|
||||
|
||||
return word > 0xffffff ? byte_to_unary_table[word >> 24] :
|
||||
word > 0xffff ? byte_to_unary_table[word >> 16] + 8 :
|
||||
word > 0xff ? byte_to_unary_table[word >> 8] + 16 :
|
||||
byte_to_unary_table[word] + 24;
|
||||
}
|
||||
|
||||
static inline uint32_t FLAC__clz_uint32(FLAC__uint32 v)
|
||||
{
|
||||
/* Never used with input 0 */
|
||||
FLAC__ASSERT(v > 0);
|
||||
#if defined(__INTEL_COMPILER)
|
||||
return _bit_scan_reverse(v) ^ 31U;
|
||||
#elif defined(__GNUC__) && (__GNUC__ >= 4 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
|
||||
/* This will translate either to (bsr ^ 31U), clz , ctlz, cntlz, lzcnt depending on
|
||||
* -march= setting or to a software routine in exotic machines. */
|
||||
return __builtin_clz(v);
|
||||
#elif defined(_MSC_VER)
|
||||
{
|
||||
uint32_t idx;
|
||||
_BitScanReverse((unsigned long*) &idx, v);
|
||||
return idx ^ 31U;
|
||||
}
|
||||
#else
|
||||
return FLAC__clz_soft_uint32(v);
|
||||
#endif
|
||||
}
|
||||
|
||||
/* Used when 64-bit bsr/clz is unavailable; can use 32-bit bsr/clz when possible */
|
||||
static inline uint32_t FLAC__clz_soft_uint64(FLAC__uint64 word)
|
||||
{
|
||||
return (FLAC__uint32)(word>>32) ? FLAC__clz_uint32((FLAC__uint32)(word>>32)) :
|
||||
FLAC__clz_uint32((FLAC__uint32)word) + 32;
|
||||
}
|
||||
|
||||
static inline uint32_t FLAC__clz_uint64(FLAC__uint64 v)
|
||||
{
|
||||
/* Never used with input 0 */
|
||||
FLAC__ASSERT(v > 0);
|
||||
#if defined(__GNUC__) && (__GNUC__ >= 4 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
|
||||
return __builtin_clzll(v);
|
||||
#elif (defined(__INTEL_COMPILER) || defined(_MSC_VER)) && (defined(_M_IA64) || defined(_M_X64))
|
||||
{
|
||||
uint32_t idx;
|
||||
_BitScanReverse64((unsigned long*) &idx, v);
|
||||
return idx ^ 63U;
|
||||
}
|
||||
#else
|
||||
return FLAC__clz_soft_uint64(v);
|
||||
#endif
|
||||
}
|
||||
|
||||
/* These two functions work with input 0 */
|
||||
static inline uint32_t FLAC__clz2_uint32(FLAC__uint32 v)
|
||||
{
|
||||
if (!v)
|
||||
return 32;
|
||||
return FLAC__clz_uint32(v);
|
||||
}
|
||||
|
||||
static inline uint32_t FLAC__clz2_uint64(FLAC__uint64 v)
|
||||
{
|
||||
if (!v)
|
||||
return 64;
|
||||
return FLAC__clz_uint64(v);
|
||||
}
|
||||
|
||||
/* An example of what FLAC__bitmath_ilog2() computes:
|
||||
*
|
||||
* ilog2( 0) = assertion failure
|
||||
* ilog2( 1) = 0
|
||||
* ilog2( 2) = 1
|
||||
* ilog2( 3) = 1
|
||||
* ilog2( 4) = 2
|
||||
* ilog2( 5) = 2
|
||||
* ilog2( 6) = 2
|
||||
* ilog2( 7) = 2
|
||||
* ilog2( 8) = 3
|
||||
* ilog2( 9) = 3
|
||||
* ilog2(10) = 3
|
||||
* ilog2(11) = 3
|
||||
* ilog2(12) = 3
|
||||
* ilog2(13) = 3
|
||||
* ilog2(14) = 3
|
||||
* ilog2(15) = 3
|
||||
* ilog2(16) = 4
|
||||
* ilog2(17) = 4
|
||||
* ilog2(18) = 4
|
||||
*/
|
||||
|
||||
static inline uint32_t FLAC__bitmath_ilog2(FLAC__uint32 v)
|
||||
{
|
||||
FLAC__ASSERT(v > 0);
|
||||
#if defined(__INTEL_COMPILER)
|
||||
return _bit_scan_reverse(v);
|
||||
#elif defined(_MSC_VER)
|
||||
{
|
||||
uint32_t idx;
|
||||
_BitScanReverse((unsigned long*) &idx, v);
|
||||
return idx;
|
||||
}
|
||||
#else
|
||||
return FLAC__clz_uint32(v) ^ 31U;
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline uint32_t FLAC__bitmath_ilog2_wide(FLAC__uint64 v)
|
||||
{
|
||||
FLAC__ASSERT(v > 0);
|
||||
#if defined(__GNUC__) && (__GNUC__ >= 4 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
|
||||
return __builtin_clzll(v) ^ 63U;
|
||||
/* Sorry, only supported in x64/Itanium.. and both have fast FPU which makes integer-only encoder pointless */
|
||||
#elif (defined(__INTEL_COMPILER) || defined(_MSC_VER)) && (defined(_M_IA64) || defined(_M_X64))
|
||||
{
|
||||
uint32_t idx;
|
||||
_BitScanReverse64((unsigned long*) &idx, v);
|
||||
return idx;
|
||||
}
|
||||
#else
|
||||
/* Brain-damaged compilers will use the fastest possible way that is,
|
||||
de Bruijn sequences (http://supertech.csail.mit.edu/papers/debruijn.pdf)
|
||||
(C) Timothy B. Terriberry (tterribe@xiph.org) 2001-2009 CC0 (Public domain).
|
||||
*/
|
||||
{
|
||||
static const uint8_t DEBRUIJN_IDX64[64]={
|
||||
0, 1, 2, 7, 3,13, 8,19, 4,25,14,28, 9,34,20,40,
|
||||
5,17,26,38,15,46,29,48,10,31,35,54,21,50,41,57,
|
||||
63, 6,12,18,24,27,33,39,16,37,45,47,30,53,49,56,
|
||||
62,11,23,32,36,44,52,55,61,22,43,51,60,42,59,58
|
||||
};
|
||||
v|= v>>1;
|
||||
v|= v>>2;
|
||||
v|= v>>4;
|
||||
v|= v>>8;
|
||||
v|= v>>16;
|
||||
v|= v>>32;
|
||||
v= (v>>1)+1;
|
||||
return DEBRUIJN_IDX64[v*FLAC__U64L(0x218A392CD3D5DBF)>>58&0x3F];
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
uint32_t FLAC__bitmath_silog2(FLAC__int64 v);
|
||||
|
||||
#endif
|
||||
|
|
@ -1,101 +0,0 @@
|
|||
/* libFLAC - Free Lossless Audio Codec library
|
||||
* Copyright (C) 2000-2009 Josh Coalson
|
||||
* Copyright (C) 2011-2023 Xiph.Org Foundation
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* - Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* - Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* - Neither the name of the Xiph.org Foundation nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef FLAC__PRIVATE__BITREADER_H
|
||||
#define FLAC__PRIVATE__BITREADER_H
|
||||
|
||||
#include <stdio.h> /* for FILE */
|
||||
#include "../../../ordinals.h"
|
||||
#include "cpu.h"
|
||||
|
||||
/*
|
||||
* opaque structure definition
|
||||
*/
|
||||
struct FLAC__BitReader;
|
||||
typedef struct FLAC__BitReader FLAC__BitReader;
|
||||
|
||||
typedef FLAC__bool (*FLAC__BitReaderReadCallback)(FLAC__byte buffer[], size_t *bytes, void *client_data);
|
||||
|
||||
/*
|
||||
* construction, deletion, initialization, etc functions
|
||||
*/
|
||||
FLAC__BitReader *FLAC__bitreader_new(void);
|
||||
void FLAC__bitreader_delete(FLAC__BitReader *br);
|
||||
FLAC__bool FLAC__bitreader_init(FLAC__BitReader *br, FLAC__BitReaderReadCallback rcb, void *cd);
|
||||
void FLAC__bitreader_free(FLAC__BitReader *br); /* does not 'free(br)' */
|
||||
FLAC__bool FLAC__bitreader_clear(FLAC__BitReader *br);
|
||||
void FLAC__bitreader_set_framesync_location(FLAC__BitReader *br);
|
||||
FLAC__bool FLAC__bitreader_rewind_to_after_last_seen_framesync(FLAC__BitReader *br);
|
||||
|
||||
/*
|
||||
* CRC functions
|
||||
*/
|
||||
void FLAC__bitreader_reset_read_crc16(FLAC__BitReader *br, FLAC__uint16 seed);
|
||||
FLAC__uint16 FLAC__bitreader_get_read_crc16(FLAC__BitReader *br);
|
||||
|
||||
/*
|
||||
* info functions
|
||||
*/
|
||||
FLAC__bool FLAC__bitreader_is_consumed_byte_aligned(const FLAC__BitReader *br);
|
||||
uint32_t FLAC__bitreader_bits_left_for_byte_alignment(const FLAC__BitReader *br);
|
||||
uint32_t FLAC__bitreader_get_input_bits_unconsumed(const FLAC__BitReader *br);
|
||||
void FLAC__bitreader_set_limit(FLAC__BitReader *br, uint32_t limit);
|
||||
void FLAC__bitreader_remove_limit(FLAC__BitReader *br);
|
||||
uint32_t FLAC__bitreader_limit_remaining(FLAC__BitReader *br);
|
||||
void FLAC__bitreader_limit_invalidate(FLAC__BitReader *br);
|
||||
|
||||
/*
|
||||
* read functions
|
||||
*/
|
||||
|
||||
FLAC__bool FLAC__bitreader_read_raw_uint32(FLAC__BitReader *br, FLAC__uint32 *val, uint32_t bits);
|
||||
FLAC__bool FLAC__bitreader_read_raw_int32(FLAC__BitReader *br, FLAC__int32 *val, uint32_t bits);
|
||||
FLAC__bool FLAC__bitreader_read_raw_uint64(FLAC__BitReader *br, FLAC__uint64 *val, uint32_t bits);
|
||||
FLAC__bool FLAC__bitreader_read_raw_int64(FLAC__BitReader *br, FLAC__int64 *val, uint32_t bits);
|
||||
FLAC__bool FLAC__bitreader_read_uint32_little_endian(FLAC__BitReader *br, FLAC__uint32 *val); /*only for bits=32*/
|
||||
FLAC__bool FLAC__bitreader_skip_bits_no_crc(FLAC__BitReader *br, uint32_t bits); /* WATCHOUT: does not CRC the skipped data! */ /*@@@@ add to unit tests */
|
||||
FLAC__bool FLAC__bitreader_skip_byte_block_aligned_no_crc(FLAC__BitReader *br, uint32_t nvals); /* WATCHOUT: does not CRC the read data! */
|
||||
FLAC__bool FLAC__bitreader_read_byte_block_aligned_no_crc(FLAC__BitReader *br, FLAC__byte *val, uint32_t nvals); /* WATCHOUT: does not CRC the read data! */
|
||||
FLAC__bool FLAC__bitreader_read_unary_unsigned(FLAC__BitReader *br, uint32_t *val);
|
||||
FLAC__bool FLAC__bitreader_read_rice_signed(FLAC__BitReader *br, int *val, uint32_t parameter);
|
||||
FLAC__bool FLAC__bitreader_read_rice_signed_block(FLAC__BitReader *br, int vals[], uint32_t nvals, uint32_t parameter);
|
||||
#ifdef FLAC__BMI2_SUPPORTED
|
||||
FLAC__bool FLAC__bitreader_read_rice_signed_block_bmi2(FLAC__BitReader *br, int vals[], uint32_t nvals, uint32_t parameter);
|
||||
#endif
|
||||
|
||||
#if 0 /* UNUSED */
|
||||
FLAC__bool FLAC__bitreader_read_golomb_signed(FLAC__BitReader *br, int *val, uint32_t parameter);
|
||||
FLAC__bool FLAC__bitreader_read_golomb_unsigned(FLAC__BitReader *br, uint32_t *val, uint32_t parameter);
|
||||
#endif
|
||||
FLAC__bool FLAC__bitreader_read_utf8_uint32(FLAC__BitReader *br, FLAC__uint32 *val, FLAC__byte *raw, uint32_t *rawlen);
|
||||
FLAC__bool FLAC__bitreader_read_utf8_uint64(FLAC__BitReader *br, FLAC__uint64 *val, FLAC__byte *raw, uint32_t *rawlen);
|
||||
#endif
|
||||
|
|
@ -1,104 +0,0 @@
|
|||
/* libFLAC - Free Lossless Audio Codec library
|
||||
* Copyright (C) 2000-2009 Josh Coalson
|
||||
* Copyright (C) 2011-2023 Xiph.Org Foundation
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* - Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* - Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* - Neither the name of the Xiph.org Foundation nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef FLAC__PRIVATE__BITWRITER_H
|
||||
#define FLAC__PRIVATE__BITWRITER_H
|
||||
|
||||
#include <stdio.h> /* for FILE */
|
||||
#include "../../../ordinals.h"
|
||||
|
||||
/*
|
||||
* opaque structure definition
|
||||
*/
|
||||
struct FLAC__BitWriter;
|
||||
typedef struct FLAC__BitWriter FLAC__BitWriter;
|
||||
|
||||
/*
|
||||
* construction, deletion, initialization, etc functions
|
||||
*/
|
||||
FLAC__BitWriter *FLAC__bitwriter_new(void);
|
||||
void FLAC__bitwriter_delete(FLAC__BitWriter *bw);
|
||||
FLAC__bool FLAC__bitwriter_init(FLAC__BitWriter *bw);
|
||||
void FLAC__bitwriter_free(FLAC__BitWriter *bw); /* does not 'free(buffer)' */
|
||||
void FLAC__bitwriter_clear(FLAC__BitWriter *bw);
|
||||
|
||||
/*
|
||||
* CRC functions
|
||||
*
|
||||
* non-const *bw because they have to cal FLAC__bitwriter_get_buffer()
|
||||
*/
|
||||
FLAC__bool FLAC__bitwriter_get_write_crc16(FLAC__BitWriter *bw, FLAC__uint16 *crc);
|
||||
FLAC__bool FLAC__bitwriter_get_write_crc8(FLAC__BitWriter *bw, FLAC__byte *crc);
|
||||
|
||||
/*
|
||||
* info functions
|
||||
*/
|
||||
FLAC__bool FLAC__bitwriter_is_byte_aligned(const FLAC__BitWriter *bw);
|
||||
uint32_t FLAC__bitwriter_get_input_bits_unconsumed(const FLAC__BitWriter *bw); /* can be called anytime, returns total # of bits unconsumed */
|
||||
|
||||
/*
|
||||
* direct buffer access
|
||||
*
|
||||
* there may be no calls on the bitwriter between get and release.
|
||||
* the bitwriter continues to own the returned buffer.
|
||||
* before get, bitwriter MUST be byte aligned: check with FLAC__bitwriter_is_byte_aligned()
|
||||
*/
|
||||
FLAC__bool FLAC__bitwriter_get_buffer(FLAC__BitWriter *bw, const FLAC__byte **buffer, size_t *bytes);
|
||||
void FLAC__bitwriter_release_buffer(FLAC__BitWriter *bw);
|
||||
|
||||
/*
|
||||
* write functions
|
||||
*/
|
||||
FLAC__bool FLAC__bitwriter_write_zeroes(FLAC__BitWriter *bw, uint32_t bits);
|
||||
FLAC__bool FLAC__bitwriter_write_raw_uint32(FLAC__BitWriter *bw, FLAC__uint32 val, uint32_t bits);
|
||||
FLAC__bool FLAC__bitwriter_write_raw_int32(FLAC__BitWriter *bw, FLAC__int32 val, uint32_t bits);
|
||||
FLAC__bool FLAC__bitwriter_write_raw_uint64(FLAC__BitWriter *bw, FLAC__uint64 val, uint32_t bits);
|
||||
FLAC__bool FLAC__bitwriter_write_raw_int64(FLAC__BitWriter *bw, FLAC__int64 val, uint32_t bits);
|
||||
FLAC__bool FLAC__bitwriter_write_raw_uint32_little_endian(FLAC__BitWriter *bw, FLAC__uint32 val); /*only for bits=32*/
|
||||
FLAC__bool FLAC__bitwriter_write_byte_block(FLAC__BitWriter *bw, const FLAC__byte vals[], uint32_t nvals);
|
||||
FLAC__bool FLAC__bitwriter_write_unary_unsigned(FLAC__BitWriter *bw, uint32_t val);
|
||||
#if 0 /* UNUSED */
|
||||
uint32_t FLAC__bitwriter_rice_bits(FLAC__int32 val, uint32_t parameter);
|
||||
uint32_t FLAC__bitwriter_golomb_bits_signed(int val, uint32_t parameter);
|
||||
uint32_t FLAC__bitwriter_golomb_bits_unsigned(uint32_t val, uint32_t parameter);
|
||||
FLAC__bool FLAC__bitwriter_write_rice_signed(FLAC__BitWriter *bw, FLAC__int32 val, uint32_t parameter);
|
||||
#endif
|
||||
FLAC__bool FLAC__bitwriter_write_rice_signed_block(FLAC__BitWriter *bw, const FLAC__int32 *vals, uint32_t nvals, uint32_t parameter);
|
||||
#if 0 /* UNUSED */
|
||||
FLAC__bool FLAC__bitwriter_write_golomb_signed(FLAC__BitWriter *bw, int val, uint32_t parameter);
|
||||
FLAC__bool FLAC__bitwriter_write_golomb_unsigned(FLAC__BitWriter *bw, uint32_t val, uint32_t parameter);
|
||||
#endif
|
||||
FLAC__bool FLAC__bitwriter_write_utf8_uint32(FLAC__BitWriter *bw, FLAC__uint32 val);
|
||||
FLAC__bool FLAC__bitwriter_write_utf8_uint64(FLAC__BitWriter *bw, FLAC__uint64 val);
|
||||
FLAC__bool FLAC__bitwriter_zero_pad_to_byte_boundary(FLAC__BitWriter *bw);
|
||||
|
||||
#endif
|
||||
|
|
@ -1,102 +0,0 @@
|
|||
/* libFLAC - Free Lossless Audio Codec library
|
||||
* Copyright (C) 2001-2009 Josh Coalson
|
||||
* Copyright (C) 2011-2023 Xiph.Org Foundation
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* - Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* - Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* - Neither the name of the Xiph.org Foundation nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef FLAC__PRIVATE__CPU_H
|
||||
#define FLAC__PRIVATE__CPU_H
|
||||
|
||||
#include "../../../ordinals.h"
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#ifndef FLAC__CPU_X86_64
|
||||
|
||||
#if defined(__amd64__) || defined(__amd64) || defined(__x86_64__) || defined(__x86_64) || defined(_M_X64) || defined(_M_AMD64)
|
||||
#define FLAC__CPU_X86_64
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#ifndef FLAC__CPU_IA32
|
||||
|
||||
#if defined(__i386__) || defined(__i486__) || defined(__i586__) || defined(__i686__) ||defined( __i386) || defined(_M_IX86)
|
||||
#define FLAC__CPU_IA32
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#ifndef __has_attribute
|
||||
#define __has_attribute(x) 0
|
||||
#endif
|
||||
|
||||
#ifndef FLAC__AVX_SUPPORTED
|
||||
#define FLAC__AVX_SUPPORTED 0
|
||||
#endif
|
||||
|
||||
typedef enum {
|
||||
FLAC__CPUINFO_TYPE_IA32,
|
||||
FLAC__CPUINFO_TYPE_X86_64,
|
||||
FLAC__CPUINFO_TYPE_UNKNOWN
|
||||
} FLAC__CPUInfo_Type;
|
||||
|
||||
typedef struct {
|
||||
FLAC__bool intel;
|
||||
|
||||
FLAC__bool cmov;
|
||||
FLAC__bool mmx;
|
||||
FLAC__bool sse;
|
||||
FLAC__bool sse2;
|
||||
|
||||
FLAC__bool sse3;
|
||||
FLAC__bool ssse3;
|
||||
FLAC__bool sse41;
|
||||
FLAC__bool sse42;
|
||||
FLAC__bool avx;
|
||||
FLAC__bool avx2;
|
||||
FLAC__bool fma;
|
||||
FLAC__bool bmi2;
|
||||
} FLAC__CPUInfo_x86;
|
||||
|
||||
typedef struct {
|
||||
FLAC__bool use_asm;
|
||||
FLAC__CPUInfo_Type type;
|
||||
FLAC__CPUInfo_x86 x86;
|
||||
} FLAC__CPUInfo;
|
||||
|
||||
void FLAC__cpu_info(FLAC__CPUInfo *info);
|
||||
|
||||
FLAC__uint32 FLAC__cpu_have_cpuid_asm_ia32(void);
|
||||
|
||||
void FLAC__cpu_info_asm_ia32(FLAC__uint32 level, FLAC__uint32 *eax, FLAC__uint32 *ebx, FLAC__uint32 *ecx, FLAC__uint32 *edx);
|
||||
|
||||
#endif
|
||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue