gecko/media/libvorbis/lib/vorbis_res0.c
Chris Double f2b6a8b7fe Bug 448834. Move Ogg libraries from modules/ to media/. r+sr=roc
--HG--
rename : modules/libfishsound/AUTHORS => media/libfishsound/AUTHORS
rename : modules/libfishsound/COPYING => media/libfishsound/COPYING
rename : modules/libfishsound/ChangeLog => media/libfishsound/ChangeLog
rename : modules/libfishsound/Makefile.in => media/libfishsound/Makefile.in
rename : modules/libfishsound/README => media/libfishsound/README
rename : modules/libfishsound/README_MOZILLA => media/libfishsound/README_MOZILLA
rename : modules/libfishsound/include/Makefile.in => media/libfishsound/include/Makefile.in
rename : modules/libfishsound/include/fishsound/Makefile.in => media/libfishsound/include/fishsound/Makefile.in
rename : modules/libfishsound/include/fishsound/comments.h => media/libfishsound/include/fishsound/comments.h
rename : modules/libfishsound/include/fishsound/config.h => media/libfishsound/include/fishsound/config.h
rename : modules/libfishsound/include/fishsound/constants.h => media/libfishsound/include/fishsound/constants.h
rename : modules/libfishsound/include/fishsound/decode.h => media/libfishsound/include/fishsound/decode.h
rename : modules/libfishsound/include/fishsound/deprecated.h => media/libfishsound/include/fishsound/deprecated.h
rename : modules/libfishsound/include/fishsound/encode.h => media/libfishsound/include/fishsound/encode.h
rename : modules/libfishsound/include/fishsound/fishsound.h => media/libfishsound/include/fishsound/fishsound.h
rename : modules/libfishsound/src/Makefile.in => media/libfishsound/src/Makefile.in
rename : modules/libfishsound/src/libfishsound/Makefile.in => media/libfishsound/src/libfishsound/Makefile.in
rename : modules/libfishsound/src/libfishsound/config.h => media/libfishsound/src/libfishsound/config.h
rename : modules/libfishsound/src/libfishsound/convert.h => media/libfishsound/src/libfishsound/convert.h
rename : modules/libfishsound/src/libfishsound/convert_c.h => media/libfishsound/src/libfishsound/convert_c.h
rename : modules/libfishsound/src/libfishsound/convert_oil.h => media/libfishsound/src/libfishsound/convert_oil.h
rename : modules/libfishsound/src/libfishsound/fishsound.c => media/libfishsound/src/libfishsound/fishsound.c
rename : modules/libfishsound/src/libfishsound/fishsound_comments.c => media/libfishsound/src/libfishsound/fishsound_comments.c
rename : modules/libfishsound/src/libfishsound/fishsound_decode.c => media/libfishsound/src/libfishsound/fishsound_decode.c
rename : modules/libfishsound/src/libfishsound/fishsound_encode.c => media/libfishsound/src/libfishsound/fishsound_encode.c
rename : modules/libfishsound/src/libfishsound/fishsound_flac.c => media/libfishsound/src/libfishsound/fishsound_flac.c
rename : modules/libfishsound/src/libfishsound/fishsound_speex.c => media/libfishsound/src/libfishsound/fishsound_speex.c
rename : modules/libfishsound/src/libfishsound/fishsound_vorbis.c => media/libfishsound/src/libfishsound/fishsound_vorbis.c
rename : modules/libfishsound/src/libfishsound/fs_compat.h => media/libfishsound/src/libfishsound/fs_compat.h
rename : modules/libfishsound/src/libfishsound/fs_vector.c => media/libfishsound/src/libfishsound/fs_vector.c
rename : modules/libfishsound/src/libfishsound/fs_vector.h => media/libfishsound/src/libfishsound/fs_vector.h
rename : modules/libfishsound/src/libfishsound/private.h => media/libfishsound/src/libfishsound/private.h
rename : modules/libfishsound/update.sh => media/libfishsound/update.sh
rename : modules/libogg/AUTHORS => media/libogg/AUTHORS
rename : modules/libogg/CHANGES => media/libogg/CHANGES
rename : modules/libogg/COPYING => media/libogg/COPYING
rename : modules/libogg/Makefile.in => media/libogg/Makefile.in
rename : modules/libogg/README => media/libogg/README
rename : modules/libogg/README_MOZILLA => media/libogg/README_MOZILLA
rename : modules/libogg/include/Makefile.in => media/libogg/include/Makefile.in
rename : modules/libogg/include/ogg/Makefile.in => media/libogg/include/ogg/Makefile.in
rename : modules/libogg/include/ogg/config_types.h => media/libogg/include/ogg/config_types.h
rename : modules/libogg/include/ogg/ogg.h => media/libogg/include/ogg/ogg.h
rename : modules/libogg/include/ogg/os_types.h => media/libogg/include/ogg/os_types.h
rename : modules/libogg/src/Makefile.in => media/libogg/src/Makefile.in
rename : modules/libogg/src/bitwise.c => media/libogg/src/bitwise.c
rename : modules/libogg/src/framing.c => media/libogg/src/framing.c
rename : modules/libogg/src/ogg_bitwise.c => media/libogg/src/ogg_bitwise.c
rename : modules/libogg/src/ogg_framing.c => media/libogg/src/ogg_framing.c
rename : modules/libogg/update.sh => media/libogg/update.sh
rename : modules/liboggplay/Makefile.in => media/liboggplay/Makefile.in
rename : modules/liboggplay/README => media/liboggplay/README
rename : modules/liboggplay/README_MOZILLA => media/liboggplay/README_MOZILLA
rename : modules/liboggplay/include/Makefile.in => media/liboggplay/include/Makefile.in
rename : modules/liboggplay/include/oggplay/Makefile.in => media/liboggplay/include/oggplay/Makefile.in
rename : modules/liboggplay/include/oggplay/config_win32.h => media/liboggplay/include/oggplay/config_win32.h
rename : modules/liboggplay/include/oggplay/oggplay.h => media/liboggplay/include/oggplay/oggplay.h
rename : modules/liboggplay/include/oggplay/oggplay_callback_info.h => media/liboggplay/include/oggplay/oggplay_callback_info.h
rename : modules/liboggplay/include/oggplay/oggplay_enums.h => media/liboggplay/include/oggplay/oggplay_enums.h
rename : modules/liboggplay/include/oggplay/oggplay_query.h => media/liboggplay/include/oggplay/oggplay_query.h
rename : modules/liboggplay/include/oggplay/oggplay_reader.h => media/liboggplay/include/oggplay/oggplay_reader.h
rename : modules/liboggplay/include/oggplay/oggplay_seek.h => media/liboggplay/include/oggplay/oggplay_seek.h
rename : modules/liboggplay/include/oggplay/oggplay_tools.h => media/liboggplay/include/oggplay/oggplay_tools.h
rename : modules/liboggplay/src/Makefile.in => media/liboggplay/src/Makefile.in
rename : modules/liboggplay/src/liboggplay/Makefile.in => media/liboggplay/src/liboggplay/Makefile.in
rename : modules/liboggplay/src/liboggplay/config.h => media/liboggplay/src/liboggplay/config.h
rename : modules/liboggplay/src/liboggplay/oggplay.c => media/liboggplay/src/liboggplay/oggplay.c
rename : modules/liboggplay/src/liboggplay/oggplay_buffer.c => media/liboggplay/src/liboggplay/oggplay_buffer.c
rename : modules/liboggplay/src/liboggplay/oggplay_buffer.h => media/liboggplay/src/liboggplay/oggplay_buffer.h
rename : modules/liboggplay/src/liboggplay/oggplay_callback.c => media/liboggplay/src/liboggplay/oggplay_callback.c
rename : modules/liboggplay/src/liboggplay/oggplay_callback.h => media/liboggplay/src/liboggplay/oggplay_callback.h
rename : modules/liboggplay/src/liboggplay/oggplay_callback_info.c => media/liboggplay/src/liboggplay/oggplay_callback_info.c
rename : modules/liboggplay/src/liboggplay/oggplay_data.c => media/liboggplay/src/liboggplay/oggplay_data.c
rename : modules/liboggplay/src/liboggplay/oggplay_data.h => media/liboggplay/src/liboggplay/oggplay_data.h
rename : modules/liboggplay/src/liboggplay/oggplay_file_reader.c => media/liboggplay/src/liboggplay/oggplay_file_reader.c
rename : modules/liboggplay/src/liboggplay/oggplay_file_reader.h => media/liboggplay/src/liboggplay/oggplay_file_reader.h
rename : modules/liboggplay/src/liboggplay/oggplay_private.h => media/liboggplay/src/liboggplay/oggplay_private.h
rename : modules/liboggplay/src/liboggplay/oggplay_query.c => media/liboggplay/src/liboggplay/oggplay_query.c
rename : modules/liboggplay/src/liboggplay/oggplay_seek.c => media/liboggplay/src/liboggplay/oggplay_seek.c
rename : modules/liboggplay/src/liboggplay/oggplay_tcp_reader.c => media/liboggplay/src/liboggplay/oggplay_tcp_reader.c
rename : modules/liboggplay/src/liboggplay/oggplay_tcp_reader.h => media/liboggplay/src/liboggplay/oggplay_tcp_reader.h
rename : modules/liboggplay/src/liboggplay/oggplay_tools.c => media/liboggplay/src/liboggplay/oggplay_tools.c
rename : modules/liboggplay/src/liboggplay/oggplay_yuv2rgb.c => media/liboggplay/src/liboggplay/oggplay_yuv2rgb.c
rename : modules/liboggplay/src/liboggplay/std_semaphore.h => media/liboggplay/src/liboggplay/std_semaphore.h
rename : modules/liboggplay/update.sh => media/liboggplay/update.sh
rename : modules/liboggplay_audio/Makefile.in => media/liboggplay_audio/Makefile.in
rename : modules/liboggplay_audio/README_MOZILLA => media/liboggplay_audio/README_MOZILLA
rename : modules/liboggplay_audio/sydney_audio.h => media/liboggplay_audio/sydney_audio.h
rename : modules/liboggplay_audio/sydney_audio_alsa.c => media/liboggplay_audio/sydney_audio_alsa.c
rename : modules/liboggplay_audio/sydney_audio_mac.c => media/liboggplay_audio/sydney_audio_mac.c
rename : modules/liboggplay_audio/sydney_audio_oss.c => media/liboggplay_audio/sydney_audio_oss.c
rename : modules/liboggplay_audio/sydney_audio_waveapi.c => media/liboggplay_audio/sydney_audio_waveapi.c
rename : modules/liboggplay_audio/update.sh => media/liboggplay_audio/update.sh
rename : modules/liboggz/AUTHORS => media/liboggz/AUTHORS
rename : modules/liboggz/COPYING => media/liboggz/COPYING
rename : modules/liboggz/ChangeLog => media/liboggz/ChangeLog
rename : modules/liboggz/Makefile.in => media/liboggz/Makefile.in
rename : modules/liboggz/README => media/liboggz/README
rename : modules/liboggz/README_MOZILLA => media/liboggz/README_MOZILLA
rename : modules/liboggz/include/Makefile.in => media/liboggz/include/Makefile.in
rename : modules/liboggz/include/oggz/Makefile.in => media/liboggz/include/oggz/Makefile.in
rename : modules/liboggz/include/oggz/config.h => media/liboggz/include/oggz/config.h
rename : modules/liboggz/include/oggz/config_win32.h => media/liboggz/include/oggz/config_win32.h
rename : modules/liboggz/include/oggz/oggz.h => media/liboggz/include/oggz/oggz.h
rename : modules/liboggz/include/oggz/oggz_comments.h => media/liboggz/include/oggz/oggz_comments.h
rename : modules/liboggz/include/oggz/oggz_constants.h => media/liboggz/include/oggz/oggz_constants.h
rename : modules/liboggz/include/oggz/oggz_deprecated.h => media/liboggz/include/oggz/oggz_deprecated.h
rename : modules/liboggz/include/oggz/oggz_io.h => media/liboggz/include/oggz/oggz_io.h
rename : modules/liboggz/include/oggz/oggz_off_t.h => media/liboggz/include/oggz/oggz_off_t.h
rename : modules/liboggz/include/oggz/oggz_off_t_generated.h => media/liboggz/include/oggz/oggz_off_t_generated.h
rename : modules/liboggz/include/oggz/oggz_read.h => media/liboggz/include/oggz/oggz_read.h
rename : modules/liboggz/include/oggz/oggz_seek.h => media/liboggz/include/oggz/oggz_seek.h
rename : modules/liboggz/include/oggz/oggz_stream.h => media/liboggz/include/oggz/oggz_stream.h
rename : modules/liboggz/include/oggz/oggz_table.h => media/liboggz/include/oggz/oggz_table.h
rename : modules/liboggz/include/oggz/oggz_write.h => media/liboggz/include/oggz/oggz_write.h
rename : modules/liboggz/src/Makefile.in => media/liboggz/src/Makefile.in
rename : modules/liboggz/src/liboggz/Makefile.in => media/liboggz/src/liboggz/Makefile.in
rename : modules/liboggz/src/liboggz/metric_internal.c => media/liboggz/src/liboggz/metric_internal.c
rename : modules/liboggz/src/liboggz/oggz.c => media/liboggz/src/liboggz/oggz.c
rename : modules/liboggz/src/liboggz/oggz_auto.c => media/liboggz/src/liboggz/oggz_auto.c
rename : modules/liboggz/src/liboggz/oggz_auto.h => media/liboggz/src/liboggz/oggz_auto.h
rename : modules/liboggz/src/liboggz/oggz_byteorder.h => media/liboggz/src/liboggz/oggz_byteorder.h
rename : modules/liboggz/src/liboggz/oggz_comments.c => media/liboggz/src/liboggz/oggz_comments.c
rename : modules/liboggz/src/liboggz/oggz_compat.h => media/liboggz/src/liboggz/oggz_compat.h
rename : modules/liboggz/src/liboggz/oggz_dlist.c => media/liboggz/src/liboggz/oggz_dlist.c
rename : modules/liboggz/src/liboggz/oggz_dlist.h => media/liboggz/src/liboggz/oggz_dlist.h
rename : modules/liboggz/src/liboggz/oggz_io.c => media/liboggz/src/liboggz/oggz_io.c
rename : modules/liboggz/src/liboggz/oggz_macros.h => media/liboggz/src/liboggz/oggz_macros.h
rename : modules/liboggz/src/liboggz/oggz_private.h => media/liboggz/src/liboggz/oggz_private.h
rename : modules/liboggz/src/liboggz/oggz_read.c => media/liboggz/src/liboggz/oggz_read.c
rename : modules/liboggz/src/liboggz/oggz_seek.c => media/liboggz/src/liboggz/oggz_seek.c
rename : modules/liboggz/src/liboggz/oggz_stream.c => media/liboggz/src/liboggz/oggz_stream.c
rename : modules/liboggz/src/liboggz/oggz_stream.h => media/liboggz/src/liboggz/oggz_stream.h
rename : modules/liboggz/src/liboggz/oggz_stream_private.h => media/liboggz/src/liboggz/oggz_stream_private.h
rename : modules/liboggz/src/liboggz/oggz_table.c => media/liboggz/src/liboggz/oggz_table.c
rename : modules/liboggz/src/liboggz/oggz_vector.c => media/liboggz/src/liboggz/oggz_vector.c
rename : modules/liboggz/src/liboggz/oggz_vector.h => media/liboggz/src/liboggz/oggz_vector.h
rename : modules/liboggz/src/liboggz/oggz_write.c => media/liboggz/src/liboggz/oggz_write.c
rename : modules/liboggz/update.sh => media/liboggz/update.sh
rename : modules/libtheora/AUTHORS => media/libtheora/AUTHORS
rename : modules/libtheora/CHANGES => media/libtheora/CHANGES
rename : modules/libtheora/COPYING => media/libtheora/COPYING
rename : modules/libtheora/LICENSE => media/libtheora/LICENSE
rename : modules/libtheora/Makefile.in => media/libtheora/Makefile.in
rename : modules/libtheora/README => media/libtheora/README
rename : modules/libtheora/README_MOZILLA => media/libtheora/README_MOZILLA
rename : modules/libtheora/changeset_r15144.diff => media/libtheora/changeset_r15144.diff
rename : modules/libtheora/include/Makefile.in => media/libtheora/include/Makefile.in
rename : modules/libtheora/include/theora/Makefile.in => media/libtheora/include/theora/Makefile.in
rename : modules/libtheora/include/theora/codec.h => media/libtheora/include/theora/codec.h
rename : modules/libtheora/include/theora/config.h => media/libtheora/include/theora/config.h
rename : modules/libtheora/include/theora/theora.h => media/libtheora/include/theora/theora.h
rename : modules/libtheora/include/theora/theoradec.h => media/libtheora/include/theora/theoradec.h
rename : modules/libtheora/lib/Makefile.in => media/libtheora/lib/Makefile.in
rename : modules/libtheora/lib/config.h => media/libtheora/lib/config.h
rename : modules/libtheora/lib/cpu.c => media/libtheora/lib/cpu.c
rename : modules/libtheora/lib/cpu.h => media/libtheora/lib/cpu.h
rename : modules/libtheora/lib/dec/apiwrapper.c => media/libtheora/lib/dec/apiwrapper.c
rename : modules/libtheora/lib/dec/apiwrapper.h => media/libtheora/lib/dec/apiwrapper.h
rename : modules/libtheora/lib/dec/bitwise.c => media/libtheora/lib/dec/bitwise.c
rename : modules/libtheora/lib/dec/bitwise.h => media/libtheora/lib/dec/bitwise.h
rename : modules/libtheora/lib/dec/dct.h => media/libtheora/lib/dec/dct.h
rename : modules/libtheora/lib/dec/decapiwrapper.c => media/libtheora/lib/dec/decapiwrapper.c
rename : modules/libtheora/lib/dec/decinfo.c => media/libtheora/lib/dec/decinfo.c
rename : modules/libtheora/lib/dec/decint.h => media/libtheora/lib/dec/decint.h
rename : modules/libtheora/lib/dec/decode.c => media/libtheora/lib/dec/decode.c
rename : modules/libtheora/lib/dec/dequant.c => media/libtheora/lib/dec/dequant.c
rename : modules/libtheora/lib/dec/dequant.h => media/libtheora/lib/dec/dequant.h
rename : modules/libtheora/lib/dec/enquant.h => media/libtheora/lib/dec/enquant.h
rename : modules/libtheora/lib/dec/fragment.c => media/libtheora/lib/dec/fragment.c
rename : modules/libtheora/lib/dec/huffdec.c => media/libtheora/lib/dec/huffdec.c
rename : modules/libtheora/lib/dec/huffdec.h => media/libtheora/lib/dec/huffdec.h
rename : modules/libtheora/lib/dec/huffman.h => media/libtheora/lib/dec/huffman.h
rename : modules/libtheora/lib/dec/idct.c => media/libtheora/lib/dec/idct.c
rename : modules/libtheora/lib/dec/idct.h => media/libtheora/lib/dec/idct.h
rename : modules/libtheora/lib/dec/info.c => media/libtheora/lib/dec/info.c
rename : modules/libtheora/lib/dec/internal.c => media/libtheora/lib/dec/internal.c
rename : modules/libtheora/lib/dec/ocintrin.h => media/libtheora/lib/dec/ocintrin.h
rename : modules/libtheora/lib/dec/quant.c => media/libtheora/lib/dec/quant.c
rename : modules/libtheora/lib/dec/quant.h => media/libtheora/lib/dec/quant.h
rename : modules/libtheora/lib/dec/state.c => media/libtheora/lib/dec/state.c
rename : modules/libtheora/lib/dec/x86/mmxfrag.c => media/libtheora/lib/dec/x86/mmxfrag.c
rename : modules/libtheora/lib/dec/x86/mmxidct.c => media/libtheora/lib/dec/x86/mmxidct.c
rename : modules/libtheora/lib/dec/x86/mmxstate.c => media/libtheora/lib/dec/x86/mmxstate.c
rename : modules/libtheora/lib/dec/x86/x86int.h => media/libtheora/lib/dec/x86/x86int.h
rename : modules/libtheora/lib/dec/x86/x86state.c => media/libtheora/lib/dec/x86/x86state.c
rename : modules/libtheora/lib/internal.h => media/libtheora/lib/internal.h
rename : modules/libtheora/update.sh => media/libtheora/update.sh
rename : modules/libvorbis/AUTHORS => media/libvorbis/AUTHORS
rename : modules/libvorbis/COPYING => media/libvorbis/COPYING
rename : modules/libvorbis/Makefile.in => media/libvorbis/Makefile.in
rename : modules/libvorbis/README => media/libvorbis/README
rename : modules/libvorbis/README_MOZILLA => media/libvorbis/README_MOZILLA
rename : modules/libvorbis/include/Makefile.in => media/libvorbis/include/Makefile.in
rename : modules/libvorbis/include/vorbis/Makefile.in => media/libvorbis/include/vorbis/Makefile.in
rename : modules/libvorbis/include/vorbis/codec.h => media/libvorbis/include/vorbis/codec.h
rename : modules/libvorbis/lib/Makefile.in => media/libvorbis/lib/Makefile.in
rename : modules/libvorbis/lib/backends.h => media/libvorbis/lib/backends.h
rename : modules/libvorbis/lib/bitrate.h => media/libvorbis/lib/bitrate.h
rename : modules/libvorbis/lib/codebook.h => media/libvorbis/lib/codebook.h
rename : modules/libvorbis/lib/codec_internal.h => media/libvorbis/lib/codec_internal.h
rename : modules/libvorbis/lib/envelope.h => media/libvorbis/lib/envelope.h
rename : modules/libvorbis/lib/highlevel.h => media/libvorbis/lib/highlevel.h
rename : modules/libvorbis/lib/lookup.h => media/libvorbis/lib/lookup.h
rename : modules/libvorbis/lib/lookup_data.h => media/libvorbis/lib/lookup_data.h
rename : modules/libvorbis/lib/lpc.h => media/libvorbis/lib/lpc.h
rename : modules/libvorbis/lib/lsp.h => media/libvorbis/lib/lsp.h
rename : modules/libvorbis/lib/masking.h => media/libvorbis/lib/masking.h
rename : modules/libvorbis/lib/mdct.h => media/libvorbis/lib/mdct.h
rename : modules/libvorbis/lib/misc.h => media/libvorbis/lib/misc.h
rename : modules/libvorbis/lib/os.h => media/libvorbis/lib/os.h
rename : modules/libvorbis/lib/psy.h => media/libvorbis/lib/psy.h
rename : modules/libvorbis/lib/registry.h => media/libvorbis/lib/registry.h
rename : modules/libvorbis/lib/scales.h => media/libvorbis/lib/scales.h
rename : modules/libvorbis/lib/smallft.h => media/libvorbis/lib/smallft.h
rename : modules/libvorbis/lib/vorbis_analysis.c => media/libvorbis/lib/vorbis_analysis.c
rename : modules/libvorbis/lib/vorbis_bitrate.c => media/libvorbis/lib/vorbis_bitrate.c
rename : modules/libvorbis/lib/vorbis_block.c => media/libvorbis/lib/vorbis_block.c
rename : modules/libvorbis/lib/vorbis_codebook.c => media/libvorbis/lib/vorbis_codebook.c
rename : modules/libvorbis/lib/vorbis_envelope.c => media/libvorbis/lib/vorbis_envelope.c
rename : modules/libvorbis/lib/vorbis_floor0.c => media/libvorbis/lib/vorbis_floor0.c
rename : modules/libvorbis/lib/vorbis_floor1.c => media/libvorbis/lib/vorbis_floor1.c
rename : modules/libvorbis/lib/vorbis_info.c => media/libvorbis/lib/vorbis_info.c
rename : modules/libvorbis/lib/vorbis_lookup.c => media/libvorbis/lib/vorbis_lookup.c
rename : modules/libvorbis/lib/vorbis_lpc.c => media/libvorbis/lib/vorbis_lpc.c
rename : modules/libvorbis/lib/vorbis_lsp.c => media/libvorbis/lib/vorbis_lsp.c
rename : modules/libvorbis/lib/vorbis_mapping0.c => media/libvorbis/lib/vorbis_mapping0.c
rename : modules/libvorbis/lib/vorbis_mdct.c => media/libvorbis/lib/vorbis_mdct.c
rename : modules/libvorbis/lib/vorbis_psy.c => media/libvorbis/lib/vorbis_psy.c
rename : modules/libvorbis/lib/vorbis_registry.c => media/libvorbis/lib/vorbis_registry.c
rename : modules/libvorbis/lib/vorbis_res0.c => media/libvorbis/lib/vorbis_res0.c
rename : modules/libvorbis/lib/vorbis_sharedbook.c => media/libvorbis/lib/vorbis_sharedbook.c
rename : modules/libvorbis/lib/vorbis_smallft.c => media/libvorbis/lib/vorbis_smallft.c
rename : modules/libvorbis/lib/vorbis_synthesis.c => media/libvorbis/lib/vorbis_synthesis.c
rename : modules/libvorbis/lib/vorbis_window.c => media/libvorbis/lib/vorbis_window.c
rename : modules/libvorbis/lib/window.h => media/libvorbis/lib/window.h
rename : modules/libvorbis/todo.txt => media/libvorbis/todo.txt
rename : modules/libvorbis/update.sh => media/libvorbis/update.sh
2008-08-06 12:47:37 +12:00

920 lines
23 KiB
C

/********************************************************************
* *
* THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
* *
* THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2007 *
* by the Xiph.Org Foundation http://www.xiph.org/ *
* *
********************************************************************
function: residue backend 0, 1 and 2 implementation
last mod: $Id: res0.c 13293 2007-07-24 00:09:47Z xiphmont $
********************************************************************/
/* Slow, slow, slow, simpleminded and did I mention it was slow? The
encode/decode loops are coded for clarity and performance is not
yet even a nagging little idea lurking in the shadows. Oh and BTW,
it's slow. */
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <ogg/ogg.h>
#include "vorbis/codec.h"
#include "codec_internal.h"
#include "registry.h"
#include "codebook.h"
#include "misc.h"
#include "os.h"
#if defined(TRAIN_RES) || defined (TRAIN_RESAUX)
#include <stdio.h>
#endif
typedef struct {
vorbis_info_residue0 *info;
int parts;
int stages;
codebook *fullbooks;
codebook *phrasebook;
codebook ***partbooks;
int partvals;
int **decodemap;
long postbits;
long phrasebits;
long frames;
#if defined(TRAIN_RES) || defined(TRAIN_RESAUX)
int train_seq;
long *training_data[8][64];
float training_max[8][64];
float training_min[8][64];
float tmin;
float tmax;
#endif
} vorbis_look_residue0;
void res0_free_info(vorbis_info_residue *i){
vorbis_info_residue0 *info=(vorbis_info_residue0 *)i;
if(info){
memset(info,0,sizeof(*info));
_ogg_free(info);
}
}
void res0_free_look(vorbis_look_residue *i){
int j;
if(i){
vorbis_look_residue0 *look=(vorbis_look_residue0 *)i;
#ifdef TRAIN_RES
{
int j,k,l;
for(j=0;j<look->parts;j++){
/*fprintf(stderr,"partition %d: ",j);*/
for(k=0;k<8;k++)
if(look->training_data[k][j]){
char buffer[80];
FILE *of;
codebook *statebook=look->partbooks[j][k];
/* long and short into the same bucket by current convention */
sprintf(buffer,"res_part%d_pass%d.vqd",j,k);
of=fopen(buffer,"a");
for(l=0;l<statebook->entries;l++)
fprintf(of,"%d:%ld\n",l,look->training_data[k][j][l]);
fclose(of);
/*fprintf(stderr,"%d(%.2f|%.2f) ",k,
look->training_min[k][j],look->training_max[k][j]);*/
_ogg_free(look->training_data[k][j]);
look->training_data[k][j]=NULL;
}
/*fprintf(stderr,"\n");*/
}
}
fprintf(stderr,"min/max residue: %g::%g\n",look->tmin,look->tmax);
/*fprintf(stderr,"residue bit usage %f:%f (%f total)\n",
(float)look->phrasebits/look->frames,
(float)look->postbits/look->frames,
(float)(look->postbits+look->phrasebits)/look->frames);*/
#endif
/*vorbis_info_residue0 *info=look->info;
fprintf(stderr,
"%ld frames encoded in %ld phrasebits and %ld residue bits "
"(%g/frame) \n",look->frames,look->phrasebits,
look->resbitsflat,
(look->phrasebits+look->resbitsflat)/(float)look->frames);
for(j=0;j<look->parts;j++){
long acc=0;
fprintf(stderr,"\t[%d] == ",j);
for(k=0;k<look->stages;k++)
if((info->secondstages[j]>>k)&1){
fprintf(stderr,"%ld,",look->resbits[j][k]);
acc+=look->resbits[j][k];
}
fprintf(stderr,":: (%ld vals) %1.2fbits/sample\n",look->resvals[j],
acc?(float)acc/(look->resvals[j]*info->grouping):0);
}
fprintf(stderr,"\n");*/
for(j=0;j<look->parts;j++)
if(look->partbooks[j])_ogg_free(look->partbooks[j]);
_ogg_free(look->partbooks);
for(j=0;j<look->partvals;j++)
_ogg_free(look->decodemap[j]);
_ogg_free(look->decodemap);
memset(look,0,sizeof(*look));
_ogg_free(look);
}
}
static int ilog(unsigned int v){
int ret=0;
while(v){
ret++;
v>>=1;
}
return(ret);
}
static int icount(unsigned int v){
int ret=0;
while(v){
ret+=v&1;
v>>=1;
}
return(ret);
}
void res0_pack(vorbis_info_residue *vr,oggpack_buffer *opb){
vorbis_info_residue0 *info=(vorbis_info_residue0 *)vr;
int j,acc=0;
oggpack_write(opb,info->begin,24);
oggpack_write(opb,info->end,24);
oggpack_write(opb,info->grouping-1,24); /* residue vectors to group and
code with a partitioned book */
oggpack_write(opb,info->partitions-1,6); /* possible partition choices */
oggpack_write(opb,info->groupbook,8); /* group huffman book */
/* secondstages is a bitmask; as encoding progresses pass by pass, a
bitmask of one indicates this partition class has bits to write
this pass */
for(j=0;j<info->partitions;j++){
if(ilog(info->secondstages[j])>3){
/* yes, this is a minor hack due to not thinking ahead */
oggpack_write(opb,info->secondstages[j],3);
oggpack_write(opb,1,1);
oggpack_write(opb,info->secondstages[j]>>3,5);
}else
oggpack_write(opb,info->secondstages[j],4); /* trailing zero */
acc+=icount(info->secondstages[j]);
}
for(j=0;j<acc;j++)
oggpack_write(opb,info->booklist[j],8);
}
/* vorbis_info is for range checking */
vorbis_info_residue *res0_unpack(vorbis_info *vi,oggpack_buffer *opb){
int j,acc=0;
vorbis_info_residue0 *info=_ogg_calloc(1,sizeof(*info));
codec_setup_info *ci=vi->codec_setup;
info->begin=oggpack_read(opb,24);
info->end=oggpack_read(opb,24);
info->grouping=oggpack_read(opb,24)+1;
info->partitions=oggpack_read(opb,6)+1;
info->groupbook=oggpack_read(opb,8);
for(j=0;j<info->partitions;j++){
int cascade=oggpack_read(opb,3);
if(oggpack_read(opb,1))
cascade|=(oggpack_read(opb,5)<<3);
info->secondstages[j]=cascade;
acc+=icount(cascade);
}
for(j=0;j<acc;j++)
info->booklist[j]=oggpack_read(opb,8);
if(info->groupbook>=ci->books)goto errout;
for(j=0;j<acc;j++)
if(info->booklist[j]>=ci->books)goto errout;
return(info);
errout:
res0_free_info(info);
return(NULL);
}
vorbis_look_residue *res0_look(vorbis_dsp_state *vd,
vorbis_info_residue *vr){
vorbis_info_residue0 *info=(vorbis_info_residue0 *)vr;
vorbis_look_residue0 *look=_ogg_calloc(1,sizeof(*look));
codec_setup_info *ci=vd->vi->codec_setup;
int j,k,acc=0;
int dim;
int maxstage=0;
look->info=info;
look->parts=info->partitions;
look->fullbooks=ci->fullbooks;
look->phrasebook=ci->fullbooks+info->groupbook;
dim=look->phrasebook->dim;
look->partbooks=_ogg_calloc(look->parts,sizeof(*look->partbooks));
for(j=0;j<look->parts;j++){
int stages=ilog(info->secondstages[j]);
if(stages){
if(stages>maxstage)maxstage=stages;
look->partbooks[j]=_ogg_calloc(stages,sizeof(*look->partbooks[j]));
for(k=0;k<stages;k++)
if(info->secondstages[j]&(1<<k)){
look->partbooks[j][k]=ci->fullbooks+info->booklist[acc++];
#ifdef TRAIN_RES
look->training_data[k][j]=_ogg_calloc(look->partbooks[j][k]->entries,
sizeof(***look->training_data));
#endif
}
}
}
look->partvals=rint(pow((float)look->parts,(float)dim));
look->stages=maxstage;
look->decodemap=_ogg_malloc(look->partvals*sizeof(*look->decodemap));
for(j=0;j<look->partvals;j++){
long val=j;
long mult=look->partvals/look->parts;
look->decodemap[j]=_ogg_malloc(dim*sizeof(*look->decodemap[j]));
for(k=0;k<dim;k++){
long deco=val/mult;
val-=deco*mult;
mult/=look->parts;
look->decodemap[j][k]=deco;
}
}
#if defined(TRAIN_RES) || defined (TRAIN_RESAUX)
{
static int train_seq=0;
look->train_seq=train_seq++;
}
#endif
return(look);
}
/* break an abstraction and copy some code for performance purposes */
static int local_book_besterror(codebook *book,float *a){
int dim=book->dim,i,k,o;
int best=0;
encode_aux_threshmatch *tt=book->c->thresh_tree;
/* find the quant val of each scalar */
for(k=0,o=dim;k<dim;++k){
float val=a[--o];
i=tt->threshvals>>1;
if(val<tt->quantthresh[i]){
if(val<tt->quantthresh[i-1]){
for(--i;i>0;--i)
if(val>=tt->quantthresh[i-1])
break;
}
}else{
for(++i;i<tt->threshvals-1;++i)
if(val<tt->quantthresh[i])break;
}
best=(best*tt->quantvals)+tt->quantmap[i];
}
/* regular lattices are easy :-) */
if(book->c->lengthlist[best]<=0){
const static_codebook *c=book->c;
int i,j;
float bestf=0.f;
float *e=book->valuelist;
best=-1;
for(i=0;i<book->entries;i++){
if(c->lengthlist[i]>0){
float this=0.f;
for(j=0;j<dim;j++){
float val=(e[j]-a[j]);
this+=val*val;
}
if(best==-1 || this<bestf){
bestf=this;
best=i;
}
}
e+=dim;
}
}
if(best>-1){
float *ptr=book->valuelist+best*dim;
for(i=0;i<dim;i++)
*a++ -= *ptr++;
}
return(best);
}
static int _encodepart(oggpack_buffer *opb,float *vec, int n,
codebook *book,long *acc){
int i,bits=0;
int dim=book->dim;
int step=n/dim;
for(i=0;i<step;i++){
int entry=local_book_besterror(book,vec+i*dim);
#ifdef TRAIN_RES
if(entry>0)
acc[entry]++;
#endif
bits+=vorbis_book_encode(book,entry,opb);
}
return(bits);
}
static long **_01class(vorbis_block *vb,vorbis_look_residue *vl,
float **in,int ch){
long i,j,k;
vorbis_look_residue0 *look=(vorbis_look_residue0 *)vl;
vorbis_info_residue0 *info=look->info;
vorbis_info *vi=vb->vd->vi;
codec_setup_info *ci=vi->codec_setup;
/* move all this setup out later */
int samples_per_partition=info->grouping;
int possible_partitions=info->partitions;
int n=info->end-info->begin;
int partvals=n/samples_per_partition;
long **partword=_vorbis_block_alloc(vb,ch*sizeof(*partword));
float scale=100./samples_per_partition;
/* we find the partition type for each partition of each
channel. We'll go back and do the interleaved encoding in a
bit. For now, clarity */
for(i=0;i<ch;i++){
partword[i]=_vorbis_block_alloc(vb,n/samples_per_partition*sizeof(*partword[i]));
memset(partword[i],0,n/samples_per_partition*sizeof(*partword[i]));
}
for(i=0;i<partvals;i++){
int offset=i*samples_per_partition+info->begin;
for(j=0;j<ch;j++){
float max=0.;
float ent=0.;
for(k=0;k<samples_per_partition;k++){
if(fabs(in[j][offset+k])>max)max=fabs(in[j][offset+k]);
ent+=fabs(rint(in[j][offset+k]));
}
ent*=scale;
for(k=0;k<possible_partitions-1;k++)
if(max<=info->classmetric1[k] &&
(info->classmetric2[k]<0 || (int)ent<info->classmetric2[k]))
break;
partword[j][i]=k;
}
}
#ifdef TRAIN_RESAUX
{
FILE *of;
char buffer[80];
for(i=0;i<ch;i++){
sprintf(buffer,"resaux_%d.vqd",look->train_seq);
of=fopen(buffer,"a");
for(j=0;j<partvals;j++)
fprintf(of,"%ld, ",partword[i][j]);
fprintf(of,"\n");
fclose(of);
}
}
#endif
look->frames++;
return(partword);
}
/* designed for stereo or other modes where the partition size is an
integer multiple of the number of channels encoded in the current
submap */
static long **_2class(vorbis_block *vb,vorbis_look_residue *vl,float **in,
int ch){
long i,j,k,l;
vorbis_look_residue0 *look=(vorbis_look_residue0 *)vl;
vorbis_info_residue0 *info=look->info;
/* move all this setup out later */
int samples_per_partition=info->grouping;
int possible_partitions=info->partitions;
int n=info->end-info->begin;
int partvals=n/samples_per_partition;
long **partword=_vorbis_block_alloc(vb,sizeof(*partword));
#if defined(TRAIN_RES) || defined (TRAIN_RESAUX)
FILE *of;
char buffer[80];
#endif
partword[0]=_vorbis_block_alloc(vb,n*ch/samples_per_partition*sizeof(*partword[0]));
memset(partword[0],0,n*ch/samples_per_partition*sizeof(*partword[0]));
for(i=0,l=info->begin/ch;i<partvals;i++){
float magmax=0.f;
float angmax=0.f;
for(j=0;j<samples_per_partition;j+=ch){
if(fabs(in[0][l])>magmax)magmax=fabs(in[0][l]);
for(k=1;k<ch;k++)
if(fabs(in[k][l])>angmax)angmax=fabs(in[k][l]);
l++;
}
for(j=0;j<possible_partitions-1;j++)
if(magmax<=info->classmetric1[j] &&
angmax<=info->classmetric2[j])
break;
partword[0][i]=j;
}
#ifdef TRAIN_RESAUX
sprintf(buffer,"resaux_%d.vqd",look->train_seq);
of=fopen(buffer,"a");
for(i=0;i<partvals;i++)
fprintf(of,"%ld, ",partword[0][i]);
fprintf(of,"\n");
fclose(of);
#endif
look->frames++;
return(partword);
}
static int _01forward(oggpack_buffer *opb,
vorbis_block *vb,vorbis_look_residue *vl,
float **in,int ch,
long **partword,
int (*encode)(oggpack_buffer *,float *,int,
codebook *,long *)){
long i,j,k,s;
vorbis_look_residue0 *look=(vorbis_look_residue0 *)vl;
vorbis_info_residue0 *info=look->info;
vorbis_dsp_state *vd=vb->vd;
/* move all this setup out later */
int samples_per_partition=info->grouping;
int possible_partitions=info->partitions;
int partitions_per_word=look->phrasebook->dim;
int n=info->end-info->begin;
int partvals=n/samples_per_partition;
long resbits[128];
long resvals[128];
#ifdef TRAIN_RES
for(i=0;i<ch;i++)
for(j=info->begin;j<end;j++){
if(in[i][j]>look->tmax)look->tmax=in[i][j];
if(in[i][j]<look->tmin)look->tmin=in[i][j];
}
#endif
memset(resbits,0,sizeof(resbits));
memset(resvals,0,sizeof(resvals));
/* we code the partition words for each channel, then the residual
words for a partition per channel until we've written all the
residual words for that partition word. Then write the next
partition channel words... */
for(s=0;s<look->stages;s++){
for(i=0;i<partvals;){
/* first we encode a partition codeword for each channel */
if(s==0){
for(j=0;j<ch;j++){
long val=partword[j][i];
for(k=1;k<partitions_per_word;k++){
val*=possible_partitions;
if(i+k<partvals)
val+=partword[j][i+k];
}
/* training hack */
if(val<look->phrasebook->entries)
look->phrasebits+=vorbis_book_encode(look->phrasebook,val,opb);
#if 0 /*def TRAIN_RES*/
else
fprintf(stderr,"!");
#endif
}
}
/* now we encode interleaved residual values for the partitions */
for(k=0;k<partitions_per_word && i<partvals;k++,i++){
long offset=i*samples_per_partition+info->begin;
for(j=0;j<ch;j++){
if(s==0)resvals[partword[j][i]]+=samples_per_partition;
if(info->secondstages[partword[j][i]]&(1<<s)){
codebook *statebook=look->partbooks[partword[j][i]][s];
if(statebook){
int ret;
long *accumulator=NULL;
#ifdef TRAIN_RES
accumulator=look->training_data[s][partword[j][i]];
{
int l;
float *samples=in[j]+offset;
for(l=0;l<samples_per_partition;l++){
if(samples[l]<look->training_min[s][partword[j][i]])
look->training_min[s][partword[j][i]]=samples[l];
if(samples[l]>look->training_max[s][partword[j][i]])
look->training_max[s][partword[j][i]]=samples[l];
}
}
#endif
ret=encode(opb,in[j]+offset,samples_per_partition,
statebook,accumulator);
look->postbits+=ret;
resbits[partword[j][i]]+=ret;
}
}
}
}
}
}
/*{
long total=0;
long totalbits=0;
fprintf(stderr,"%d :: ",vb->mode);
for(k=0;k<possible_partitions;k++){
fprintf(stderr,"%ld/%1.2g, ",resvals[k],(float)resbits[k]/resvals[k]);
total+=resvals[k];
totalbits+=resbits[k];
}
fprintf(stderr,":: %ld:%1.2g\n",total,(double)totalbits/total);
}*/
return(0);
}
/* a truncated packet here just means 'stop working'; it's not an error */
static int _01inverse(vorbis_block *vb,vorbis_look_residue *vl,
float **in,int ch,
long (*decodepart)(codebook *, float *,
oggpack_buffer *,int)){
long i,j,k,l,s;
vorbis_look_residue0 *look=(vorbis_look_residue0 *)vl;
vorbis_info_residue0 *info=look->info;
/* move all this setup out later */
int samples_per_partition=info->grouping;
int partitions_per_word=look->phrasebook->dim;
int max=vb->pcmend>>1;
int end=(info->end<max?info->end:max);
int n=end-info->begin;
if(n>0){
int partvals=n/samples_per_partition;
int partwords=(partvals+partitions_per_word-1)/partitions_per_word;
int ***partword=alloca(ch*sizeof(*partword));
for(j=0;j<ch;j++)
partword[j]=_vorbis_block_alloc(vb,partwords*sizeof(*partword[j]));
for(s=0;s<look->stages;s++){
/* each loop decodes on partition codeword containing
partitions_per_word partitions */
for(i=0,l=0;i<partvals;l++){
if(s==0){
/* fetch the partition word for each channel */
for(j=0;j<ch;j++){
int temp=vorbis_book_decode(look->phrasebook,&vb->opb);
if(temp==-1)goto eopbreak;
partword[j][l]=look->decodemap[temp];
if(partword[j][l]==NULL)goto errout;
}
}
/* now we decode residual values for the partitions */
for(k=0;k<partitions_per_word && i<partvals;k++,i++)
for(j=0;j<ch;j++){
long offset=info->begin+i*samples_per_partition;
if(info->secondstages[partword[j][l][k]]&(1<<s)){
codebook *stagebook=look->partbooks[partword[j][l][k]][s];
if(stagebook){
if(decodepart(stagebook,in[j]+offset,&vb->opb,
samples_per_partition)==-1)goto eopbreak;
}
}
}
}
}
}
errout:
eopbreak:
return(0);
}
#if 0
/* residue 0 and 1 are just slight variants of one another. 0 is
interleaved, 1 is not */
long **res0_class(vorbis_block *vb,vorbis_look_residue *vl,
float **in,int *nonzero,int ch){
/* we encode only the nonzero parts of a bundle */
int i,used=0;
for(i=0;i<ch;i++)
if(nonzero[i])
in[used++]=in[i];
if(used)
/*return(_01class(vb,vl,in,used,_interleaved_testhack));*/
return(_01class(vb,vl,in,used));
else
return(0);
}
int res0_forward(vorbis_block *vb,vorbis_look_residue *vl,
float **in,float **out,int *nonzero,int ch,
long **partword){
/* we encode only the nonzero parts of a bundle */
int i,j,used=0,n=vb->pcmend/2;
for(i=0;i<ch;i++)
if(nonzero[i]){
if(out)
for(j=0;j<n;j++)
out[i][j]+=in[i][j];
in[used++]=in[i];
}
if(used){
int ret=_01forward(vb,vl,in,used,partword,
_interleaved_encodepart);
if(out){
used=0;
for(i=0;i<ch;i++)
if(nonzero[i]){
for(j=0;j<n;j++)
out[i][j]-=in[used][j];
used++;
}
}
return(ret);
}else{
return(0);
}
}
#endif
int res0_inverse(vorbis_block *vb,vorbis_look_residue *vl,
float **in,int *nonzero,int ch){
int i,used=0;
for(i=0;i<ch;i++)
if(nonzero[i])
in[used++]=in[i];
if(used)
return(_01inverse(vb,vl,in,used,vorbis_book_decodevs_add));
else
return(0);
}
int res1_forward(oggpack_buffer *opb,vorbis_block *vb,vorbis_look_residue *vl,
float **in,float **out,int *nonzero,int ch,
long **partword){
int i,j,used=0,n=vb->pcmend/2;
for(i=0;i<ch;i++)
if(nonzero[i]){
if(out)
for(j=0;j<n;j++)
out[i][j]+=in[i][j];
in[used++]=in[i];
}
if(used){
int ret=_01forward(opb,vb,vl,in,used,partword,_encodepart);
if(out){
used=0;
for(i=0;i<ch;i++)
if(nonzero[i]){
for(j=0;j<n;j++)
out[i][j]-=in[used][j];
used++;
}
}
return(ret);
}else{
return(0);
}
}
long **res1_class(vorbis_block *vb,vorbis_look_residue *vl,
float **in,int *nonzero,int ch){
int i,used=0;
for(i=0;i<ch;i++)
if(nonzero[i])
in[used++]=in[i];
if(used)
return(_01class(vb,vl,in,used));
else
return(0);
}
int res1_inverse(vorbis_block *vb,vorbis_look_residue *vl,
float **in,int *nonzero,int ch){
int i,used=0;
for(i=0;i<ch;i++)
if(nonzero[i])
in[used++]=in[i];
if(used)
return(_01inverse(vb,vl,in,used,vorbis_book_decodev_add));
else
return(0);
}
long **res2_class(vorbis_block *vb,vorbis_look_residue *vl,
float **in,int *nonzero,int ch){
int i,used=0;
for(i=0;i<ch;i++)
if(nonzero[i])used++;
if(used)
return(_2class(vb,vl,in,ch));
else
return(0);
}
/* res2 is slightly more different; all the channels are interleaved
into a single vector and encoded. */
int res2_forward(oggpack_buffer *opb,
vorbis_block *vb,vorbis_look_residue *vl,
float **in,float **out,int *nonzero,int ch,
long **partword){
long i,j,k,n=vb->pcmend/2,used=0;
/* don't duplicate the code; use a working vector hack for now and
reshape ourselves into a single channel res1 */
/* ugly; reallocs for each coupling pass :-( */
float *work=_vorbis_block_alloc(vb,ch*n*sizeof(*work));
for(i=0;i<ch;i++){
float *pcm=in[i];
if(nonzero[i])used++;
for(j=0,k=i;j<n;j++,k+=ch)
work[k]=pcm[j];
}
if(used){
int ret=_01forward(opb,vb,vl,&work,1,partword,_encodepart);
/* update the sofar vector */
if(out){
for(i=0;i<ch;i++){
float *pcm=in[i];
float *sofar=out[i];
for(j=0,k=i;j<n;j++,k+=ch)
sofar[j]+=pcm[j]-work[k];
}
}
return(ret);
}else{
return(0);
}
}
/* duplicate code here as speed is somewhat more important */
int res2_inverse(vorbis_block *vb,vorbis_look_residue *vl,
float **in,int *nonzero,int ch){
long i,k,l,s;
vorbis_look_residue0 *look=(vorbis_look_residue0 *)vl;
vorbis_info_residue0 *info=look->info;
/* move all this setup out later */
int samples_per_partition=info->grouping;
int partitions_per_word=look->phrasebook->dim;
int max=(vb->pcmend*ch)>>1;
int end=(info->end<max?info->end:max);
int n=end-info->begin;
if(n>0){
int partvals=n/samples_per_partition;
int partwords=(partvals+partitions_per_word-1)/partitions_per_word;
int **partword=_vorbis_block_alloc(vb,partwords*sizeof(*partword));
for(i=0;i<ch;i++)if(nonzero[i])break;
if(i==ch)return(0); /* no nonzero vectors */
for(s=0;s<look->stages;s++){
for(i=0,l=0;i<partvals;l++){
if(s==0){
/* fetch the partition word */
int temp=vorbis_book_decode(look->phrasebook,&vb->opb);
if(temp==-1)goto eopbreak;
partword[l]=look->decodemap[temp];
if(partword[l]==NULL)goto errout;
}
/* now we decode residual values for the partitions */
for(k=0;k<partitions_per_word && i<partvals;k++,i++)
if(info->secondstages[partword[l][k]]&(1<<s)){
codebook *stagebook=look->partbooks[partword[l][k]][s];
if(stagebook){
if(vorbis_book_decodevv_add(stagebook,in,
i*samples_per_partition+info->begin,ch,
&vb->opb,samples_per_partition)==-1)
goto eopbreak;
}
}
}
}
}
errout:
eopbreak:
return(0);
}
vorbis_func_residue residue0_exportbundle={
NULL,
&res0_unpack,
&res0_look,
&res0_free_info,
&res0_free_look,
NULL,
NULL,
&res0_inverse
};
vorbis_func_residue residue1_exportbundle={
&res0_pack,
&res0_unpack,
&res0_look,
&res0_free_info,
&res0_free_look,
&res1_class,
&res1_forward,
&res1_inverse
};
vorbis_func_residue residue2_exportbundle={
&res0_pack,
&res0_unpack,
&res0_look,
&res0_free_info,
&res0_free_look,
&res2_class,
&res2_forward,
&res2_inverse
};