parent
dd54d748a8
commit
ce2f0f7d6e
|
|
@ -2,19 +2,19 @@ LOCAL_PATH := $(call my-dir)
|
||||||
include $(CLEAR_VARS)
|
include $(CLEAR_VARS)
|
||||||
|
|
||||||
LOCAL_SRC_FILES = \
|
LOCAL_SRC_FILES = \
|
||||||
Tremolo/bitwise.c \
|
Tremolo/bitwise.c \
|
||||||
Tremolo/codebook.c \
|
Tremolo/codebook.c \
|
||||||
Tremolo/dsp.c \
|
Tremolo/dsp.c \
|
||||||
Tremolo/floor0.c \
|
Tremolo/floor0.c \
|
||||||
Tremolo/floor1.c \
|
Tremolo/floor1.c \
|
||||||
Tremolo/floor_lookup.c \
|
Tremolo/floor_lookup.c \
|
||||||
Tremolo/framing.c \
|
Tremolo/framing.c \
|
||||||
Tremolo/mapping0.c \
|
Tremolo/info.c \
|
||||||
Tremolo/mdct.c \
|
Tremolo/mapping0.c \
|
||||||
Tremolo/misc.c \
|
Tremolo/mdct.c \
|
||||||
Tremolo/res012.c \
|
Tremolo/misc.c \
|
||||||
Tremolo/treminfo.c \
|
Tremolo/res012.c \
|
||||||
Tremolo/vorbisfile.c
|
Tremolo/vorbisfile.c
|
||||||
|
|
||||||
# Disable arm optimization which will cause the issue https://github.com/cocos2d/cocos2d-x/issues/17148
|
# Disable arm optimization which will cause the issue https://github.com/cocos2d/cocos2d-x/issues/17148
|
||||||
# ifeq ($(TARGET_ARCH),arm)
|
# ifeq ($(TARGET_ARCH),arm)
|
||||||
|
|
|
||||||
|
|
@ -1,8 +0,0 @@
|
||||||
This version of Tremolo is derived from Tremolo library version
|
|
||||||
0.07. It has been patched against publicly known vulnerabilities
|
|
||||||
with sample files available here:
|
|
||||||
|
|
||||||
http://static.dataspill.org/releases/ogg/examples/
|
|
||||||
|
|
||||||
When syncing with svn, please ensure that these defects are not
|
|
||||||
reintroduced.
|
|
||||||
|
|
@ -1,3 +1,7 @@
|
||||||
|
UPDATE: 2018-11-07
|
||||||
|
URL: http://wss.co.uk/pinknoise/tremolo/Tremolo008.zip
|
||||||
|
Version: 0.08
|
||||||
|
|
||||||
URL: http://wss.co.uk/pinknoise/tremolo/Tremolo007.zip
|
URL: http://wss.co.uk/pinknoise/tremolo/Tremolo007.zip
|
||||||
Version: 0.07
|
Version: 0.07
|
||||||
BugComponent: 99142
|
BugComponent: 99142
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,47 @@
|
||||||
|
Tremolo changelog:
|
||||||
|
|
||||||
|
*** 20100110: 0.8 ***
|
||||||
|
|
||||||
|
First "post Google" version. Shift fixes in mdctARM.s and
|
||||||
|
mdctLARM.s. Many thanks to Gloria Wang for finding the example
|
||||||
|
file that showed this up. Thanks to everyone else at Google for
|
||||||
|
making the BSD rerelease possible!
|
||||||
|
|
||||||
|
Also, some (mainly error handling) fixes in codebook.c imported
|
||||||
|
from the trunk version of Tremor.
|
||||||
|
|
||||||
|
*** 20071129: 0.7 ***
|
||||||
|
|
||||||
|
Bugs in mdct.c, mdctARM.s, mdctLARM.s that caused 'chirping'
|
||||||
|
and 'popping' fixed. Many thanks to Dan Silsby for spotting
|
||||||
|
the problem, narrowing it down to the code concerned and
|
||||||
|
testing potential fixes.
|
||||||
|
|
||||||
|
|
||||||
|
*** 20070807: 0.6 ***
|
||||||
|
|
||||||
|
Initial optimisation port from low memory branch of Tremor,
|
||||||
|
v1.0.2
|
||||||
|
|
||||||
|
--------------------------------------------------------------------
|
||||||
|
Original Tremor changelog follows:
|
||||||
|
|
||||||
|
*** 20020517: 1.0.2 ***
|
||||||
|
|
||||||
|
Playback bugfix to floor1; mode mistakenly used for sizing instead
|
||||||
|
of blockflag
|
||||||
|
|
||||||
|
*** 20020515: 1.0.1 ***
|
||||||
|
|
||||||
|
Added complete API documentation to source tarball. No code
|
||||||
|
changes.
|
||||||
|
|
||||||
|
*** 20020412: 1.0.1 ***
|
||||||
|
|
||||||
|
Fixed a clipping bug that affected ARM processors; negative
|
||||||
|
overflows were being properly clipped, but then clobbered to
|
||||||
|
positive by the positive overflow chec (asm_arm.h:CLIP_TO_15)
|
||||||
|
|
||||||
|
*** 20020403: 1.0.0 ***
|
||||||
|
|
||||||
|
Initial version
|
||||||
|
|
@ -0,0 +1,35 @@
|
||||||
|
Previous versions of this software have been released under the
|
||||||
|
terms of the GNU GPL. Thanks to a grant from Google, this version
|
||||||
|
is released is under the same BSD style license as the original
|
||||||
|
Theora software was.
|
||||||
|
|
||||||
|
|
||||||
|
Copyright (C) 2002-2009 Xiph.org Foundation
|
||||||
|
Changes Copyright (C) 2009-2010 Robin Watts for Pinknoise Productions Ltd
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
@ -0,0 +1,105 @@
|
||||||
|
# Tremolo Makefile for Windows CE port
|
||||||
|
# Uses the VLC toolchain
|
||||||
|
# $URL$
|
||||||
|
# $Id$
|
||||||
|
|
||||||
|
wince_gcc_root = /usr/local/wince/cross-tools
|
||||||
|
srcdir = .
|
||||||
|
VPATH = $(srcdir)
|
||||||
|
|
||||||
|
CC = arm-wince-pe-gcc
|
||||||
|
CXX = arm-wince-pe-g++
|
||||||
|
LD = arm-wince-pe-g++
|
||||||
|
AR = arm-wince-pe-ar cru
|
||||||
|
RANLIB = arm-wince-pe-ranlib
|
||||||
|
STRIP = arm-wince-pe-strip
|
||||||
|
WINDRES= arm-wince-pe-windres
|
||||||
|
MKDIR = mkdir -p
|
||||||
|
RM = rm -f
|
||||||
|
RM_REC = rm -rf
|
||||||
|
ECHO = echo -n
|
||||||
|
CAT = cat
|
||||||
|
AS = arm-wince-pe-as
|
||||||
|
|
||||||
|
DEFINES :=
|
||||||
|
|
||||||
|
CFLAGS := -O2 -march=armv4 -mtune=xscale -I$(srcdir) -I$(wince_gcc_root)/include -D__cdecl= -D_WIN32_WCE=300 -D_ARM_ASSEM_ -static
|
||||||
|
|
||||||
|
CXXFLAGS := $(CFLAGS)
|
||||||
|
|
||||||
|
LDFLAGS := -Llibs/lib -L$(wince_gcc_root)/lib
|
||||||
|
LIBS := --entry WinMainCRTStartup
|
||||||
|
|
||||||
|
OBJS :=
|
||||||
|
MODULE_DIRS += .
|
||||||
|
|
||||||
|
LIBOBJS := bitwise.o bitwiseARM.o codebook.o dpen.o dsp.o floor0.o \
|
||||||
|
floor1.o floor1ARM.o floor_lookup.o framing.o info.o mapping0.o \
|
||||||
|
mdct.o mdctARM.o misc.o res012.o vorbisfile.o speed.o
|
||||||
|
EXEOBJS := testtremor.o
|
||||||
|
|
||||||
|
LIBOBJS_C := bitwise.oc codebook.oc dsp.oc floor0.oc floor1.oc \
|
||||||
|
floor_lookup.oc framing.oc info.oc mapping0.oc mdct.oc misc.oc \
|
||||||
|
res012.oc vorbisfile.oc speed.o
|
||||||
|
EXEOBJS_C := testtremor.oc
|
||||||
|
|
||||||
|
LIBOBJS_L := bitwise.ol bitwiseARM.o codebook.ol dpen.o dsp.ol floor0.ol \
|
||||||
|
floor1.ol floor1LARM.o floor_lookup.ol framing.ol info.ol mapping0.ol \
|
||||||
|
mdct.ol mdctLARM.o misc.ol res012.ol vorbisfile.ol speed.o
|
||||||
|
EXEOBJS_L := testtremor.ol
|
||||||
|
|
||||||
|
LIBOBJS_LC := bitwise.olc codebook.olc dsp.olc floor0.olc floor1.olc \
|
||||||
|
floor_lookup.olc framing.olc info.olc mapping0.olc mdct.olc misc.olc \
|
||||||
|
res012.olc vorbisfile.olc speed.o
|
||||||
|
EXEOBJS_LC := testtremor.olc
|
||||||
|
|
||||||
|
# Rules
|
||||||
|
.SUFFIXES: .oc .ol .olc
|
||||||
|
|
||||||
|
.c.oc:
|
||||||
|
$(CC) $(CFLAGS) -c $(<) -o $*.oc -DONLY_C
|
||||||
|
|
||||||
|
.c.ol:
|
||||||
|
$(CC) $(CFLAGS) -c $(<) -o $*.ol -D_LOW_ACCURACY_
|
||||||
|
|
||||||
|
.c.olc:
|
||||||
|
$(CC) $(CFLAGS) -c $(<) -o $*.olc -D_LOW_ACCURACY_ -DONLY_C
|
||||||
|
|
||||||
|
all: libTremolo006.lib bittest.exe testtremor.exe testtremorC.exe testtremorL.exe testtremorLC.exe annotate.exe
|
||||||
|
cp libTremolo006.lib /cygdrive/c/cvs/scummvm/trunk/backends/platform/wince/libs/lib/
|
||||||
|
cp ivorbisfile.h /cygdrive/c/cvs/scummvm/trunk/backends/platform/wince/libs/include/tremolo006/tremor/
|
||||||
|
cp config_types.h /cygdrive/c/cvs/scummvm/trunk/backends/platform/wince/libs/include/tremolo006/
|
||||||
|
cp ivorbiscodec.h /cygdrive/c/cvs/scummvm/trunk/backends/platform/wince/libs/include/tremolo006/
|
||||||
|
cp ogg.h /cygdrive/c/cvs/scummvm/trunk/backends/platform/wince/libs/include/tremolo006/
|
||||||
|
cp os_types.h /cygdrive/c/cvs/scummvm/trunk/backends/platform/wince/libs/include/tremolo006/
|
||||||
|
|
||||||
|
libTremolo006.lib: $(LIBOBJS)
|
||||||
|
arm-wince-pe-ar cru $@ $^
|
||||||
|
arm-wince-pe-ranlib $@
|
||||||
|
|
||||||
|
bitwiseTEST.o: bitwise.c
|
||||||
|
$(CC) $(CFLAGS) -c -o bitwiseTEST.o bitwise.c -D_V_BIT_TEST
|
||||||
|
|
||||||
|
bittest.exe: bitwiseTEST.o bitwiseARM.o dpen.o
|
||||||
|
$(LD) $^ $(LDFLAGS) $(LIBS) -o $@ -Wl,-Map,bittest.exe.map -Wl,--stack,65536
|
||||||
|
|
||||||
|
testtremor.exe: testtremor.o profile.o $(LIBOBJS)
|
||||||
|
$(LD) $^ $(LDFLAGS) $(LIBS) -o $@ -Wl,-Map,testtremor.exe.map -Wl,--stack,65536 -debug
|
||||||
|
|
||||||
|
testtremorC.exe: testtremor.oc profile.o $(LIBOBJS_C)
|
||||||
|
$(LD) $^ $(LDFLAGS) $(LIBS) -o $@ -Wl,-Map,testtremorC.exe.map -Wl,--stack,65536
|
||||||
|
|
||||||
|
testtremorL.exe: testtremor.ol profile.o $(LIBOBJS_L)
|
||||||
|
$(LD) $^ $(LDFLAGS) $(LIBS) -o $@ -Wl,-Map,testtremorL.exe.map -Wl,--stack,65536
|
||||||
|
|
||||||
|
testtremorLC.exe: testtremor.olc profile.o $(LIBOBJS_LC)
|
||||||
|
$(LD) $^ $(LDFLAGS) $(LIBS) -o $@ -Wl,-Map,testtremorLC.exe.map -Wl,--stack,65536
|
||||||
|
|
||||||
|
annotate.exe: annotate.c
|
||||||
|
gcc $^ -o $@
|
||||||
|
|
||||||
|
clean:
|
||||||
|
rm `find . -name \*.o`
|
||||||
|
rm `find . -name \*.ol`
|
||||||
|
rm `find . -name \*.oc`
|
||||||
|
rm `find . -name \*.olc`
|
||||||
|
|
@ -0,0 +1,496 @@
|
||||||
|
Profile by Address
|
||||||
|
00000000 ( 42.09%: 2139) Address 0
|
||||||
|
00011008 ( 0.00%: 0) WinMainCRTStartup
|
||||||
|
00011078 ( 0.00%: 0) _cinit
|
||||||
|
000110d8 ( 0.00%: 0) exit
|
||||||
|
000111b8 ( 0.00%: 0) _exit
|
||||||
|
000111c4 ( 0.00%: 0) _cexit
|
||||||
|
000111d4 ( 0.00%: 0) _c_exit
|
||||||
|
000111e4 ( 0.00%: 0) Output
|
||||||
|
000112b0 ( 0.00%: 0) main2
|
||||||
|
000115d4 ( 0.00%: 0) WinMain
|
||||||
|
00011610 ( 0.00%: 0) speedtest
|
||||||
|
000117d4 ( 0.00%: 0) Profile_dump
|
||||||
|
00011984 ( 0.65%: 33) Profile_init
|
||||||
|
00011a60 ( 0.00%: 0) oggpack_eop
|
||||||
|
00011a74 ( 0.00%: 0) oggpack_bytes
|
||||||
|
00011aa4 ( 1.10%: 56) oggpack_bits
|
||||||
|
00011ae0 ( 2.48%: 126) oggpack_look
|
||||||
|
00011c04 ( 0.02%: 1) oggpack_adv
|
||||||
|
00011c8c ( 0.00%: 0) oggpack_readinit
|
||||||
|
00011cc4 ( 0.04%: 2) oggpack_read
|
||||||
|
00011e58 ( 0.00%: 0) _ilog
|
||||||
|
00012728 ( 0.02%: 1) _book_maptype1_quantvals
|
||||||
|
000127a8 ( 0.00%: 0) vorbis_book_clear
|
||||||
|
000127e8 ( 0.33%: 17) vorbis_book_unpack
|
||||||
|
00013008 ( 0.00%: 0) vorbis_book_decode
|
||||||
|
00013020 ( 0.00%: 0) vorbis_book_decodevs_add
|
||||||
|
000130c8 ( 0.00%: 0) vorbis_book_decodev_add
|
||||||
|
00013160 ( 0.00%: 0) vorbis_book_decodev_set
|
||||||
|
00013238 ( 2.77%: 141) decode_packed_entry_number_REALSTART
|
||||||
|
00013264 ( 9.41%: 478) decode_packed_entry_number
|
||||||
|
0001341c ( 5.51%: 280) decode_map
|
||||||
|
000135bc ( 5.31%: 270) vorbis_book_decodevv_add
|
||||||
|
0001364c ( 3.31%: 168) _checksum
|
||||||
|
000136ac ( 0.00%: 0) vorbis_dsp_restart
|
||||||
|
00013714 ( 0.00%: 0) vorbis_dsp_create
|
||||||
|
000137c8 ( 0.02%: 1) vorbis_dsp_destroy
|
||||||
|
00013918 ( 0.06%: 3) vorbis_dsp_pcmout
|
||||||
|
00013a44 ( 0.00%: 0) vorbis_dsp_read
|
||||||
|
00013a84 ( 0.00%: 0) vorbis_packet_blocksize
|
||||||
|
00013b04 ( 0.04%: 2) vorbis_dsp_synthesis
|
||||||
|
00013f04 ( 0.00%: 0) floor0_free_info
|
||||||
|
00013f10 ( 0.00%: 0) floor0_info_unpack
|
||||||
|
00014020 ( 0.00%: 0) floor0_memosize
|
||||||
|
0001402c ( 0.00%: 0) floor0_inverse1
|
||||||
|
00014188 ( 0.00%: 0) vorbis_lsp_to_curve
|
||||||
|
000147ec ( 0.00%: 0) floor0_inverse2
|
||||||
|
00014880 ( 0.00%: 0) floor1_free_info
|
||||||
|
00014938 ( 0.12%: 6) floor1_info_unpack
|
||||||
|
00014fc8 ( 0.12%: 6) render_point
|
||||||
|
00015014 ( 0.00%: 0) floor1_memosize
|
||||||
|
0001501c ( 0.85%: 43) floor1_inverse1
|
||||||
|
00015308 ( 1.20%: 61) floor1_inverse2
|
||||||
|
000154c4 ( 0.91%: 46) render_lineARM
|
||||||
|
00015698 ( 1.40%: 71) ogg_buffer_dup
|
||||||
|
00015b70 ( 0.04%: 2) ogg_page_version
|
||||||
|
00015bb0 ( 0.00%: 0) ogg_page_continued
|
||||||
|
00015bf0 ( 0.00%: 0) ogg_page_bos
|
||||||
|
00015c30 ( 0.04%: 2) ogg_page_eos
|
||||||
|
00015c70 ( 0.08%: 4) ogg_page_granulepos
|
||||||
|
00015d38 ( 0.06%: 3) ogg_page_serialno
|
||||||
|
00015d78 ( 0.00%: 0) ogg_page_pageno
|
||||||
|
00015db8 ( 0.00%: 0) ogg_page_packets
|
||||||
|
00015e1c ( 0.00%: 0) ogg_sync_create
|
||||||
|
00015e70 ( 0.00%: 0) ogg_sync_reset
|
||||||
|
00015ea0 ( 0.02%: 1) ogg_sync_destroy
|
||||||
|
00015ef8 ( 0.22%: 11) ogg_sync_bufferin
|
||||||
|
00015fb4 ( 0.16%: 8) ogg_sync_wrote
|
||||||
|
00016010 ( 0.02%: 1) ogg_page_release
|
||||||
|
00016050 ( 0.33%: 17) ogg_sync_pageseek
|
||||||
|
00016304 ( 0.00%: 0) ogg_sync_pageout
|
||||||
|
0001634c ( 0.00%: 0) ogg_stream_create
|
||||||
|
00016370 ( 0.04%: 2) ogg_stream_destroy
|
||||||
|
00016410 ( 0.08%: 4) ogg_stream_pagein
|
||||||
|
000164f8 ( 0.00%: 0) ogg_stream_reset
|
||||||
|
0001656c ( 0.00%: 0) ogg_stream_reset_serialno
|
||||||
|
00016588 ( 0.12%: 6) ogg_packet_release
|
||||||
|
00016a8c ( 0.00%: 0) ogg_stream_packetout
|
||||||
|
00016a94 ( 0.00%: 0) ogg_stream_packetpeek
|
||||||
|
00016a9c ( 0.00%: 0) ogg_page_dup
|
||||||
|
00016b0c ( 0.00%: 0) vorbis_comment_init
|
||||||
|
00016b80 ( 0.00%: 0) vorbis_comment_query
|
||||||
|
00016c54 ( 0.00%: 0) vorbis_comment_query_count
|
||||||
|
00016d04 ( 0.00%: 0) vorbis_comment_clear
|
||||||
|
00016d90 ( 0.00%: 0) vorbis_info_blocksize
|
||||||
|
00016da4 ( 0.00%: 0) vorbis_info_init
|
||||||
|
00016dec ( 0.00%: 0) vorbis_info_clear
|
||||||
|
00016f9c ( 0.00%: 0) vorbis_dsp_headerin
|
||||||
|
000175b8 ( 0.00%: 0) mapping_clear_info
|
||||||
|
00017634 ( 0.00%: 0) mapping_info_unpack
|
||||||
|
00017888 ( 0.77%: 39) mapping_inverse
|
||||||
|
00017d28 ( 0.00%: 0) mdct_unroll_lap
|
||||||
|
00017fa4 ( 0.00%: 0) mdct_backward
|
||||||
|
00018200 ( 0.10%: 5) mdct_unroll_prelap
|
||||||
|
000182a0 ( 0.08%: 4) mdct_unroll_postlap
|
||||||
|
00018364 ( 2.74%: 139) mdct_unroll_part2
|
||||||
|
000183bc ( 1.79%: 91) mdct_unroll_part3
|
||||||
|
00018414 ( 0.67%: 34) mdct_shift_right
|
||||||
|
00018470 ( 12.20%: 620) mdct_backwardARM
|
||||||
|
00018dc0 ( 0.00%: 0) _VDBG_dump
|
||||||
|
00018e24 ( 0.00%: 0) _VDBG_malloc
|
||||||
|
00018f70 ( 0.00%: 0) _VDBG_free
|
||||||
|
00018f98 ( 0.00%: 0) res_clear_info
|
||||||
|
00018fe8 ( 0.00%: 0) res_unpack
|
||||||
|
000191fc ( 1.77%: 90) res_inverse
|
||||||
|
0001a6f8 ( 0.00%: 0) ov_clear
|
||||||
|
0001a89c ( 0.00%: 0) ov_test_callbacks
|
||||||
|
0001a8dc ( 0.00%: 0) ov_test
|
||||||
|
0001a928 ( 0.00%: 0) ov_streams
|
||||||
|
0001a930 ( 0.00%: 0) ov_seekable
|
||||||
|
0001a938 ( 0.00%: 0) ov_time_total
|
||||||
|
0001a9fc ( 0.00%: 0) ov_bitrate
|
||||||
|
0001ab84 ( 0.00%: 0) ov_bitrate_instant
|
||||||
|
0001ac00 ( 0.00%: 0) ov_serialnumber
|
||||||
|
0001ac78 ( 0.00%: 0) ov_raw_total
|
||||||
|
0001ad28 ( 0.00%: 0) ov_pcm_total
|
||||||
|
0001adcc ( 0.00%: 0) ov_raw_seek
|
||||||
|
0001b6bc ( 0.00%: 0) ov_test_open
|
||||||
|
0001b6d4 ( 0.00%: 0) ov_open_callbacks
|
||||||
|
0001b72c ( 0.00%: 0) ov_open
|
||||||
|
0001b778 ( 0.00%: 0) ov_pcm_seek_page
|
||||||
|
0001c020 ( 0.00%: 0) ov_pcm_seek
|
||||||
|
0001c444 ( 0.00%: 0) ov_time_seek
|
||||||
|
0001c5c4 ( 0.00%: 0) ov_time_seek_page
|
||||||
|
0001c744 ( 0.00%: 0) ov_raw_tell
|
||||||
|
0001c768 ( 0.00%: 0) ov_pcm_tell
|
||||||
|
0001c78c ( 0.00%: 0) ov_time_tell
|
||||||
|
0001c8a8 ( 0.00%: 0) ov_info
|
||||||
|
0001c8ec ( 0.02%: 1) ov_comment
|
||||||
|
0001c930 ( 0.02%: 1) ov_read
|
||||||
|
0001ca10 ( 0.00%: 0) stmiaTest
|
||||||
|
0001ca74 ( 0.00%: 0) strTest
|
||||||
|
0001caf4 ( 0.00%: 0) smullTest
|
||||||
|
0001cb38 ( 0.00%: 0) __udivdi3
|
||||||
|
0001d0a8 ( 0.00%: 0) __aeabi_drsub
|
||||||
|
0001d0b0 ( 0.00%: 0) __aeabi_dsub
|
||||||
|
0001d0b0 ( 0.00%: 0) __subdf3
|
||||||
|
0001d0b4 ( 0.00%: 0) __adddf3
|
||||||
|
0001d0b4 ( 0.00%: 0) __aeabi_dadd
|
||||||
|
0001d394 ( 0.00%: 0) __aeabi_ui2d
|
||||||
|
0001d394 ( 0.00%: 0) __floatunsidf
|
||||||
|
0001d3b8 ( 0.00%: 0) __floatsidf
|
||||||
|
0001d3b8 ( 0.00%: 0) __aeabi_i2d
|
||||||
|
0001d3e0 ( 0.00%: 0) __extendsfdf2
|
||||||
|
0001d3e0 ( 0.00%: 0) __aeabi_f2d
|
||||||
|
0001d420 ( 0.00%: 0) __aeabi_ul2d
|
||||||
|
0001d420 ( 0.00%: 0) __floatundidf
|
||||||
|
0001d434 ( 0.00%: 0) __floatdidf
|
||||||
|
0001d434 ( 0.00%: 0) __aeabi_l2d
|
||||||
|
0001d494 ( 0.00%: 0) __aeabi_dmul
|
||||||
|
0001d494 ( 0.00%: 0) __muldf3
|
||||||
|
0001d7bc ( 0.00%: 0) __aeabi_ddiv
|
||||||
|
0001d7bc ( 0.00%: 0) __divdf3
|
||||||
|
0001d9c0 ( 0.06%: 3) __modsi3
|
||||||
|
0001daa4 ( 0.28%: 14) __divsi3
|
||||||
|
0001dbcc ( 0.00%: 0) __aeabi_idivmod
|
||||||
|
0001dbe4 ( 0.14%: 7) __udivsi3
|
||||||
|
0001dcdc ( 0.00%: 0) __aeabi_uidivmod
|
||||||
|
0001dcf4 ( 0.00%: 0) __divdi3
|
||||||
|
0001e2b0 ( 0.00%: 0) __umodsi3
|
||||||
|
0001e37c ( 0.00%: 0) __aeabi_ldiv0
|
||||||
|
0001e37c ( 0.00%: 0) __div0
|
||||||
|
0001e37c ( 0.00%: 0) __aeabi_idiv0
|
||||||
|
0001e380 ( 0.00%: 0) _XcptFilter
|
||||||
|
0001e38c ( 0.00%: 0) __C_specific_handler
|
||||||
|
0001e398 ( 0.00%: 0) LocalFree
|
||||||
|
0001e3a4 ( 0.00%: 0) vsprintf
|
||||||
|
0001e3b0 ( 0.00%: 0) OutputDebugStringW
|
||||||
|
0001e3bc ( 0.39%: 20) fopen
|
||||||
|
0001e3c8 ( 0.00%: 0) fwrite
|
||||||
|
0001e3d4 ( 0.00%: 0) fread
|
||||||
|
0001e3e0 ( 0.00%: 0) GetThreadTimes
|
||||||
|
0001e3ec ( 0.00%: 0) Sleep
|
||||||
|
0001e3f8 ( 0.04%: 2) fputc
|
||||||
|
0001e404 ( 0.00%: 0) fclose
|
||||||
|
0001e410 ( 0.00%: 0) memset
|
||||||
|
0001e41c ( 0.00%: 0) GetThreadContext
|
||||||
|
0001e428 ( 0.00%: 0) malloc
|
||||||
|
0001e434 ( 0.00%: 0) CreateThread
|
||||||
|
0001e440 ( 0.00%: 0) SetThreadPriority
|
||||||
|
0001e44c ( 0.00%: 0) free
|
||||||
|
0001e458 ( 0.00%: 0) calloc
|
||||||
|
0001e464 ( 0.00%: 0) realloc
|
||||||
|
0001e470 ( 0.00%: 0) memchr
|
||||||
|
0001e47c ( 0.00%: 0) toupper
|
||||||
|
0001e488 ( 0.00%: 0) strlen
|
||||||
|
0001e494 ( 0.00%: 0) strcpy
|
||||||
|
0001e4a0 ( 0.00%: 0) memcmp
|
||||||
|
0001e4ac ( 0.00%: 0) _getstdfilex
|
||||||
|
0001e4b8 ( 0.00%: 0) fprintf
|
||||||
|
0001e4c4 ( 0.00%: 0) fseek
|
||||||
|
0001e4d0 ( 0.00%: 0) memcpy
|
||||||
|
0001e4dc ( 0.00%: 0) ftell
|
||||||
|
0001f018 ( 0.00%: 0) crc_lookup
|
||||||
|
0001f418 ( 0.00%: 0) start_time
|
||||||
|
00028764 ( 0.00%: 0) FLOOR_fromdB_LOOKUP
|
||||||
|
00028b88 ( 0.00%: 0) sincos_lookup0
|
||||||
|
00029b90 ( 0.00%: 0) sincos_lookup1
|
||||||
|
0002ada4 ( 0.00%: 0) __clz_tab
|
||||||
|
0002d014 ( 0.00%: 0) global_bytes
|
||||||
|
0002d030 ( 0.00%: 0) __onexitbegin
|
||||||
|
0002d034 ( 0.00%: 0) __onexitend
|
||||||
|
0002d038 ( 0.00%: 0) _exitflag
|
||||||
|
0002d03c ( 0.00%: 0) pcmout
|
||||||
|
0002e03c ( 0.00%: 0) ref
|
||||||
|
0002f03c ( 0.00%: 0) text
|
||||||
|
0003003c ( 0.00%: 0) speedblock
|
||||||
|
00039000 ( 0.00%: 0) __IMPORT_DESCRIPTOR_COREDLL
|
||||||
|
00039014 ( 0.00%: 0) __NULL_IMPORT_DESCRIPTOR
|
||||||
|
000390b8 ( 0.00%: 0) __imp__XcptFilter
|
||||||
|
000390bc ( 0.00%: 0) __imp___C_specific_handler
|
||||||
|
000390c0 ( 0.00%: 0) __imp_LocalFree
|
||||||
|
000390c4 ( 0.00%: 0) __imp_vsprintf
|
||||||
|
000390c8 ( 0.00%: 0) __imp_OutputDebugStringW
|
||||||
|
000390cc ( 0.00%: 0) __imp_fopen
|
||||||
|
000390d0 ( 0.00%: 0) __imp_fwrite
|
||||||
|
000390d4 ( 0.00%: 0) __imp_fread
|
||||||
|
000390d8 ( 0.00%: 0) __imp_GetThreadTimes
|
||||||
|
000390dc ( 0.00%: 0) __imp_Sleep
|
||||||
|
000390e0 ( 0.00%: 0) __imp_fputc
|
||||||
|
000390e4 ( 0.00%: 0) __imp_fclose
|
||||||
|
000390e8 ( 0.00%: 0) __imp_memset
|
||||||
|
000390ec ( 0.00%: 0) __imp_GetThreadContext
|
||||||
|
000390f0 ( 0.00%: 0) __imp_malloc
|
||||||
|
000390f4 ( 0.00%: 0) __imp_CreateThread
|
||||||
|
000390f8 ( 0.00%: 0) __imp_SetThreadPriority
|
||||||
|
000390fc ( 0.00%: 0) __imp_free
|
||||||
|
00039100 ( 0.00%: 0) __imp_calloc
|
||||||
|
00039104 ( 0.00%: 0) __imp_realloc
|
||||||
|
00039108 ( 0.00%: 0) __imp_memchr
|
||||||
|
0003910c ( 0.00%: 0) __imp_toupper
|
||||||
|
00039110 ( 0.00%: 0) __imp_strlen
|
||||||
|
00039114 ( 0.00%: 0) __imp_strcpy
|
||||||
|
00039118 ( 0.00%: 0) __imp_memcmp
|
||||||
|
0003911c ( 0.00%: 0) __imp__getstdfilex
|
||||||
|
00039120 ( 0.00%: 0) __imp_fprintf
|
||||||
|
00039124 ( 0.00%: 0) __imp_fseek
|
||||||
|
00039128 ( 0.00%: 0) __imp_memcpy
|
||||||
|
0003912c ( 0.00%: 0) __imp_ftell
|
||||||
|
0003a000 ( 0.00%: 0) __xc_a
|
||||||
|
0003a004 ( 0.00%: 0) __xc_z
|
||||||
|
0003a008 ( 0.00%: 0) __xi_a
|
||||||
|
0003a00c ( 0.00%: 0) __xi_z
|
||||||
|
0003a010 ( 0.00%: 0) __xp_a
|
||||||
|
0003a014 ( 0.00%: 0) __xp_z
|
||||||
|
0003a018 ( 0.00%: 0) __xt_a
|
||||||
|
0003a01c ( 0.00%: 0) __xt_z
|
||||||
|
|
||||||
|
|
||||||
|
Profile by Time
|
||||||
|
00000000 ( 42.09%: 2139) Address 0
|
||||||
|
00018470 ( 12.20%: 620) mdct_backwardARM
|
||||||
|
00013264 ( 9.41%: 478) decode_packed_entry_number
|
||||||
|
0001341c ( 5.51%: 280) decode_map
|
||||||
|
000135bc ( 5.31%: 270) vorbis_book_decodevv_add
|
||||||
|
0001364c ( 3.31%: 168) _checksum
|
||||||
|
00013238 ( 2.77%: 141) decode_packed_entry_number_REALSTART
|
||||||
|
00018364 ( 2.74%: 139) mdct_unroll_part2
|
||||||
|
00011ae0 ( 2.48%: 126) oggpack_look
|
||||||
|
000183bc ( 1.79%: 91) mdct_unroll_part3
|
||||||
|
000191fc ( 1.77%: 90) res_inverse
|
||||||
|
00015698 ( 1.40%: 71) ogg_buffer_dup
|
||||||
|
00015308 ( 1.20%: 61) floor1_inverse2
|
||||||
|
00011aa4 ( 1.10%: 56) oggpack_bits
|
||||||
|
000154c4 ( 0.91%: 46) render_lineARM
|
||||||
|
0001501c ( 0.85%: 43) floor1_inverse1
|
||||||
|
00017888 ( 0.77%: 39) mapping_inverse
|
||||||
|
00018414 ( 0.67%: 34) mdct_shift_right
|
||||||
|
00011984 ( 0.65%: 33) Profile_init
|
||||||
|
0001e3bc ( 0.39%: 20) fopen
|
||||||
|
000127e8 ( 0.33%: 17) vorbis_book_unpack
|
||||||
|
00016050 ( 0.33%: 17) ogg_sync_pageseek
|
||||||
|
0001daa4 ( 0.28%: 14) __divsi3
|
||||||
|
00015ef8 ( 0.22%: 11) ogg_sync_bufferin
|
||||||
|
00015fb4 ( 0.16%: 8) ogg_sync_wrote
|
||||||
|
0001dbe4 ( 0.14%: 7) __udivsi3
|
||||||
|
00014fc8 ( 0.12%: 6) render_point
|
||||||
|
00014938 ( 0.12%: 6) floor1_info_unpack
|
||||||
|
00016588 ( 0.12%: 6) ogg_packet_release
|
||||||
|
00018200 ( 0.10%: 5) mdct_unroll_prelap
|
||||||
|
000182a0 ( 0.08%: 4) mdct_unroll_postlap
|
||||||
|
00015c70 ( 0.08%: 4) ogg_page_granulepos
|
||||||
|
00016410 ( 0.08%: 4) ogg_stream_pagein
|
||||||
|
00015d38 ( 0.06%: 3) ogg_page_serialno
|
||||||
|
0001d9c0 ( 0.06%: 3) __modsi3
|
||||||
|
00013918 ( 0.06%: 3) vorbis_dsp_pcmout
|
||||||
|
00015c30 ( 0.04%: 2) ogg_page_eos
|
||||||
|
00011cc4 ( 0.04%: 2) oggpack_read
|
||||||
|
00015b70 ( 0.04%: 2) ogg_page_version
|
||||||
|
00013b04 ( 0.04%: 2) vorbis_dsp_synthesis
|
||||||
|
0001e3f8 ( 0.04%: 2) fputc
|
||||||
|
00016370 ( 0.04%: 2) ogg_stream_destroy
|
||||||
|
00016010 ( 0.02%: 1) ogg_page_release
|
||||||
|
00015ea0 ( 0.02%: 1) ogg_sync_destroy
|
||||||
|
00011c04 ( 0.02%: 1) oggpack_adv
|
||||||
|
0001c8ec ( 0.02%: 1) ov_comment
|
||||||
|
0001c930 ( 0.02%: 1) ov_read
|
||||||
|
000137c8 ( 0.02%: 1) vorbis_dsp_destroy
|
||||||
|
00012728 ( 0.02%: 1) _book_maptype1_quantvals
|
||||||
|
00015bb0 ( 0.00%: 0) ogg_page_continued
|
||||||
|
00015bf0 ( 0.00%: 0) ogg_page_bos
|
||||||
|
0003a018 ( 0.00%: 0) __xt_a
|
||||||
|
00015d78 ( 0.00%: 0) ogg_page_pageno
|
||||||
|
00015db8 ( 0.00%: 0) ogg_page_packets
|
||||||
|
00015e1c ( 0.00%: 0) ogg_sync_create
|
||||||
|
00015e70 ( 0.00%: 0) ogg_sync_reset
|
||||||
|
00011c8c ( 0.00%: 0) oggpack_readinit
|
||||||
|
00011a74 ( 0.00%: 0) oggpack_bytes
|
||||||
|
00016304 ( 0.00%: 0) ogg_sync_pageout
|
||||||
|
0001634c ( 0.00%: 0) ogg_stream_create
|
||||||
|
0003a01c ( 0.00%: 0) __xt_z
|
||||||
|
000164f8 ( 0.00%: 0) ogg_stream_reset
|
||||||
|
0001656c ( 0.00%: 0) ogg_stream_reset_serialno
|
||||||
|
00011a60 ( 0.00%: 0) oggpack_eop
|
||||||
|
00016a8c ( 0.00%: 0) ogg_stream_packetout
|
||||||
|
00016a94 ( 0.00%: 0) ogg_stream_packetpeek
|
||||||
|
00016a9c ( 0.00%: 0) ogg_page_dup
|
||||||
|
00016b0c ( 0.00%: 0) vorbis_comment_init
|
||||||
|
00016b80 ( 0.00%: 0) vorbis_comment_query
|
||||||
|
00016c54 ( 0.00%: 0) vorbis_comment_query_count
|
||||||
|
00016d04 ( 0.00%: 0) vorbis_comment_clear
|
||||||
|
00016d90 ( 0.00%: 0) vorbis_info_blocksize
|
||||||
|
00016da4 ( 0.00%: 0) vorbis_info_init
|
||||||
|
00016dec ( 0.00%: 0) vorbis_info_clear
|
||||||
|
00016f9c ( 0.00%: 0) vorbis_dsp_headerin
|
||||||
|
000175b8 ( 0.00%: 0) mapping_clear_info
|
||||||
|
00017634 ( 0.00%: 0) mapping_info_unpack
|
||||||
|
000117d4 ( 0.00%: 0) Profile_dump
|
||||||
|
00017d28 ( 0.00%: 0) mdct_unroll_lap
|
||||||
|
00017fa4 ( 0.00%: 0) mdct_backward
|
||||||
|
00011610 ( 0.00%: 0) speedtest
|
||||||
|
000115d4 ( 0.00%: 0) WinMain
|
||||||
|
000112b0 ( 0.00%: 0) main2
|
||||||
|
000111e4 ( 0.00%: 0) Output
|
||||||
|
000111d4 ( 0.00%: 0) _c_exit
|
||||||
|
000111c4 ( 0.00%: 0) _cexit
|
||||||
|
00018dc0 ( 0.00%: 0) _VDBG_dump
|
||||||
|
00018e24 ( 0.00%: 0) _VDBG_malloc
|
||||||
|
00018f70 ( 0.00%: 0) _VDBG_free
|
||||||
|
00018f98 ( 0.00%: 0) res_clear_info
|
||||||
|
00018fe8 ( 0.00%: 0) res_unpack
|
||||||
|
000111b8 ( 0.00%: 0) _exit
|
||||||
|
0001a6f8 ( 0.00%: 0) ov_clear
|
||||||
|
0001a89c ( 0.00%: 0) ov_test_callbacks
|
||||||
|
0001a8dc ( 0.00%: 0) ov_test
|
||||||
|
0001a928 ( 0.00%: 0) ov_streams
|
||||||
|
0001a930 ( 0.00%: 0) ov_seekable
|
||||||
|
0001a938 ( 0.00%: 0) ov_time_total
|
||||||
|
0001a9fc ( 0.00%: 0) ov_bitrate
|
||||||
|
0001ab84 ( 0.00%: 0) ov_bitrate_instant
|
||||||
|
0001ac00 ( 0.00%: 0) ov_serialnumber
|
||||||
|
0001ac78 ( 0.00%: 0) ov_raw_total
|
||||||
|
0001ad28 ( 0.00%: 0) ov_pcm_total
|
||||||
|
0001adcc ( 0.00%: 0) ov_raw_seek
|
||||||
|
0001b6bc ( 0.00%: 0) ov_test_open
|
||||||
|
0001b6d4 ( 0.00%: 0) ov_open_callbacks
|
||||||
|
0001b72c ( 0.00%: 0) ov_open
|
||||||
|
0001b778 ( 0.00%: 0) ov_pcm_seek_page
|
||||||
|
0001c020 ( 0.00%: 0) ov_pcm_seek
|
||||||
|
0001c444 ( 0.00%: 0) ov_time_seek
|
||||||
|
0001c5c4 ( 0.00%: 0) ov_time_seek_page
|
||||||
|
0001c744 ( 0.00%: 0) ov_raw_tell
|
||||||
|
0001c768 ( 0.00%: 0) ov_pcm_tell
|
||||||
|
0001c78c ( 0.00%: 0) ov_time_tell
|
||||||
|
0001c8a8 ( 0.00%: 0) ov_info
|
||||||
|
0001ca10 ( 0.00%: 0) stmiaTest
|
||||||
|
0001ca74 ( 0.00%: 0) strTest
|
||||||
|
0001caf4 ( 0.00%: 0) smullTest
|
||||||
|
0001cb38 ( 0.00%: 0) __udivdi3
|
||||||
|
0001d0a8 ( 0.00%: 0) __aeabi_drsub
|
||||||
|
0001d0b0 ( 0.00%: 0) __aeabi_dsub
|
||||||
|
0001d0b0 ( 0.00%: 0) __subdf3
|
||||||
|
0001d0b4 ( 0.00%: 0) __adddf3
|
||||||
|
0001d0b4 ( 0.00%: 0) __aeabi_dadd
|
||||||
|
0001d394 ( 0.00%: 0) __aeabi_ui2d
|
||||||
|
0001d394 ( 0.00%: 0) __floatunsidf
|
||||||
|
0001d3b8 ( 0.00%: 0) __floatsidf
|
||||||
|
0001d3b8 ( 0.00%: 0) __aeabi_i2d
|
||||||
|
0001d3e0 ( 0.00%: 0) __extendsfdf2
|
||||||
|
0001d3e0 ( 0.00%: 0) __aeabi_f2d
|
||||||
|
0001d420 ( 0.00%: 0) __aeabi_ul2d
|
||||||
|
0001d420 ( 0.00%: 0) __floatundidf
|
||||||
|
0001d434 ( 0.00%: 0) __floatdidf
|
||||||
|
0001d434 ( 0.00%: 0) __aeabi_l2d
|
||||||
|
0001d494 ( 0.00%: 0) __aeabi_dmul
|
||||||
|
0001d494 ( 0.00%: 0) __muldf3
|
||||||
|
0001d7bc ( 0.00%: 0) __aeabi_ddiv
|
||||||
|
0001d7bc ( 0.00%: 0) __divdf3
|
||||||
|
000110d8 ( 0.00%: 0) exit
|
||||||
|
0001dbcc ( 0.00%: 0) __aeabi_idivmod
|
||||||
|
00011078 ( 0.00%: 0) _cinit
|
||||||
|
0001dcdc ( 0.00%: 0) __aeabi_uidivmod
|
||||||
|
0001dcf4 ( 0.00%: 0) __divdi3
|
||||||
|
0001e2b0 ( 0.00%: 0) __umodsi3
|
||||||
|
0001e37c ( 0.00%: 0) __aeabi_ldiv0
|
||||||
|
0001e37c ( 0.00%: 0) __div0
|
||||||
|
0001e37c ( 0.00%: 0) __aeabi_idiv0
|
||||||
|
0001e380 ( 0.00%: 0) _XcptFilter
|
||||||
|
0001e38c ( 0.00%: 0) __C_specific_handler
|
||||||
|
0001e398 ( 0.00%: 0) LocalFree
|
||||||
|
0001e3a4 ( 0.00%: 0) vsprintf
|
||||||
|
0001e3b0 ( 0.00%: 0) OutputDebugStringW
|
||||||
|
00011008 ( 0.00%: 0) WinMainCRTStartup
|
||||||
|
0001e3c8 ( 0.00%: 0) fwrite
|
||||||
|
0001e3d4 ( 0.00%: 0) fread
|
||||||
|
0001e3e0 ( 0.00%: 0) GetThreadTimes
|
||||||
|
0001e3ec ( 0.00%: 0) Sleep
|
||||||
|
0001e404 ( 0.00%: 0) fclose
|
||||||
|
0001e410 ( 0.00%: 0) memset
|
||||||
|
0001e41c ( 0.00%: 0) GetThreadContext
|
||||||
|
0001e428 ( 0.00%: 0) malloc
|
||||||
|
0001e434 ( 0.00%: 0) CreateThread
|
||||||
|
0001e440 ( 0.00%: 0) SetThreadPriority
|
||||||
|
0001e44c ( 0.00%: 0) free
|
||||||
|
0001e458 ( 0.00%: 0) calloc
|
||||||
|
0001e464 ( 0.00%: 0) realloc
|
||||||
|
0001e470 ( 0.00%: 0) memchr
|
||||||
|
0001e47c ( 0.00%: 0) toupper
|
||||||
|
0001e488 ( 0.00%: 0) strlen
|
||||||
|
0001e494 ( 0.00%: 0) strcpy
|
||||||
|
0001e4a0 ( 0.00%: 0) memcmp
|
||||||
|
0001e4ac ( 0.00%: 0) _getstdfilex
|
||||||
|
0001e4b8 ( 0.00%: 0) fprintf
|
||||||
|
0001e4c4 ( 0.00%: 0) fseek
|
||||||
|
0001e4d0 ( 0.00%: 0) memcpy
|
||||||
|
0001e4dc ( 0.00%: 0) ftell
|
||||||
|
0001f018 ( 0.00%: 0) crc_lookup
|
||||||
|
0001f418 ( 0.00%: 0) start_time
|
||||||
|
00028764 ( 0.00%: 0) FLOOR_fromdB_LOOKUP
|
||||||
|
00028b88 ( 0.00%: 0) sincos_lookup0
|
||||||
|
00029b90 ( 0.00%: 0) sincos_lookup1
|
||||||
|
0002ada4 ( 0.00%: 0) __clz_tab
|
||||||
|
0002d014 ( 0.00%: 0) global_bytes
|
||||||
|
0002d030 ( 0.00%: 0) __onexitbegin
|
||||||
|
0002d034 ( 0.00%: 0) __onexitend
|
||||||
|
0002d038 ( 0.00%: 0) _exitflag
|
||||||
|
0002d03c ( 0.00%: 0) pcmout
|
||||||
|
0002e03c ( 0.00%: 0) ref
|
||||||
|
0002f03c ( 0.00%: 0) text
|
||||||
|
0003003c ( 0.00%: 0) speedblock
|
||||||
|
00039000 ( 0.00%: 0) __IMPORT_DESCRIPTOR_COREDLL
|
||||||
|
00039014 ( 0.00%: 0) __NULL_IMPORT_DESCRIPTOR
|
||||||
|
000390b8 ( 0.00%: 0) __imp__XcptFilter
|
||||||
|
000390bc ( 0.00%: 0) __imp___C_specific_handler
|
||||||
|
000390c0 ( 0.00%: 0) __imp_LocalFree
|
||||||
|
000390c4 ( 0.00%: 0) __imp_vsprintf
|
||||||
|
000390c8 ( 0.00%: 0) __imp_OutputDebugStringW
|
||||||
|
000390cc ( 0.00%: 0) __imp_fopen
|
||||||
|
000390d0 ( 0.00%: 0) __imp_fwrite
|
||||||
|
000390d4 ( 0.00%: 0) __imp_fread
|
||||||
|
000390d8 ( 0.00%: 0) __imp_GetThreadTimes
|
||||||
|
000390dc ( 0.00%: 0) __imp_Sleep
|
||||||
|
000390e0 ( 0.00%: 0) __imp_fputc
|
||||||
|
000390e4 ( 0.00%: 0) __imp_fclose
|
||||||
|
000390e8 ( 0.00%: 0) __imp_memset
|
||||||
|
000390ec ( 0.00%: 0) __imp_GetThreadContext
|
||||||
|
000390f0 ( 0.00%: 0) __imp_malloc
|
||||||
|
000390f4 ( 0.00%: 0) __imp_CreateThread
|
||||||
|
000390f8 ( 0.00%: 0) __imp_SetThreadPriority
|
||||||
|
000390fc ( 0.00%: 0) __imp_free
|
||||||
|
00039100 ( 0.00%: 0) __imp_calloc
|
||||||
|
00039104 ( 0.00%: 0) __imp_realloc
|
||||||
|
00039108 ( 0.00%: 0) __imp_memchr
|
||||||
|
0003910c ( 0.00%: 0) __imp_toupper
|
||||||
|
00039110 ( 0.00%: 0) __imp_strlen
|
||||||
|
00039114 ( 0.00%: 0) __imp_strcpy
|
||||||
|
00039118 ( 0.00%: 0) __imp_memcmp
|
||||||
|
0003911c ( 0.00%: 0) __imp__getstdfilex
|
||||||
|
00039120 ( 0.00%: 0) __imp_fprintf
|
||||||
|
00039124 ( 0.00%: 0) __imp_fseek
|
||||||
|
00039128 ( 0.00%: 0) __imp_memcpy
|
||||||
|
0003912c ( 0.00%: 0) __imp_ftell
|
||||||
|
0003a000 ( 0.00%: 0) __xc_a
|
||||||
|
0003a004 ( 0.00%: 0) __xc_z
|
||||||
|
0003a008 ( 0.00%: 0) __xi_a
|
||||||
|
0003a00c ( 0.00%: 0) __xi_z
|
||||||
|
0003a010 ( 0.00%: 0) __xp_a
|
||||||
|
0003a014 ( 0.00%: 0) __xp_z
|
||||||
|
00013160 ( 0.00%: 0) vorbis_book_decodev_set
|
||||||
|
000136ac ( 0.00%: 0) vorbis_dsp_restart
|
||||||
|
000130c8 ( 0.00%: 0) vorbis_book_decodev_add
|
||||||
|
00013714 ( 0.00%: 0) vorbis_dsp_create
|
||||||
|
00013a44 ( 0.00%: 0) vorbis_dsp_read
|
||||||
|
00013a84 ( 0.00%: 0) vorbis_packet_blocksize
|
||||||
|
00013f04 ( 0.00%: 0) floor0_free_info
|
||||||
|
00013f10 ( 0.00%: 0) floor0_info_unpack
|
||||||
|
00014020 ( 0.00%: 0) floor0_memosize
|
||||||
|
0001402c ( 0.00%: 0) floor0_inverse1
|
||||||
|
00014188 ( 0.00%: 0) vorbis_lsp_to_curve
|
||||||
|
000147ec ( 0.00%: 0) floor0_inverse2
|
||||||
|
00014880 ( 0.00%: 0) floor1_free_info
|
||||||
|
00013020 ( 0.00%: 0) vorbis_book_decodevs_add
|
||||||
|
00013008 ( 0.00%: 0) vorbis_book_decode
|
||||||
|
00015014 ( 0.00%: 0) floor1_memosize
|
||||||
|
000127a8 ( 0.00%: 0) vorbis_book_clear
|
||||||
|
00011e58 ( 0.00%: 0) _ilog
|
||||||
|
|
@ -0,0 +1,64 @@
|
||||||
|
This README covers the Tremolo library, version 0.08.
|
||||||
|
|
||||||
|
Tremolo is a modified version of the Ogg Vorbis 'Tremor' integer
|
||||||
|
playback codec, branching from 1.0.2 of the low memory branch of
|
||||||
|
that source from svn.
|
||||||
|
|
||||||
|
Previous versions of Tremolo have been released under the GNU GPL
|
||||||
|
but thanks to a grant from Google, this version is back to being
|
||||||
|
released under the same license as vanilla Tremor.
|
||||||
|
|
||||||
|
Robin Watts
|
||||||
|
|
||||||
|
tremolo@wss.co.uk
|
||||||
|
|
||||||
|
----------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
This README covers the Ogg Vorbis 'Tremor' integer playback codec
|
||||||
|
source as of date 2002 09 02, version 1.0.0.
|
||||||
|
|
||||||
|
******
|
||||||
|
|
||||||
|
The C source in this package will build on any ANSI C compiler and
|
||||||
|
function completely and properly on any platform. The included build
|
||||||
|
system assumes GNU build system and make tools (m4, automake,
|
||||||
|
autoconf, libtool and gmake). GCC is not required, although GCC is
|
||||||
|
the most tested compiler. To build using GNU tools, type in the
|
||||||
|
source directory:
|
||||||
|
|
||||||
|
./autogen.sh
|
||||||
|
make
|
||||||
|
|
||||||
|
Currently, the source implements playback in pure C on all platforms
|
||||||
|
except ARM, where a [currently] small amount of assembly (see
|
||||||
|
asm_arm.h) is used to implement 64 bit math operations and fast LSP
|
||||||
|
computation. If building on ARM without the benefit of GNU build
|
||||||
|
system tools, be sure that '_ARM_ASSEM_' is #defined by the build
|
||||||
|
system if this assembly is desired, else the resulting library will
|
||||||
|
use whatever 64 bit math builtins the compiler implements.
|
||||||
|
|
||||||
|
No math library is required by this source. No floating point
|
||||||
|
operations are used at any point in either setup or decode. This
|
||||||
|
decoder library will properly decode any past, current or future
|
||||||
|
Vorbis I file or stream.
|
||||||
|
|
||||||
|
********
|
||||||
|
|
||||||
|
The build system produces a static and [when supported by the OS]
|
||||||
|
dynamic library named 'libvorbisidec'. This library exposes an API
|
||||||
|
nearly identical to the BSD reference library's 'libvorbisfile',
|
||||||
|
including all the features familiar to users of vorbisfile. This API
|
||||||
|
is similar enough that the proper header file to include is named
|
||||||
|
'ivorbisfile.h' [included in the source build directory]. Lower level
|
||||||
|
libvorbis-style headers and structures are in 'ivorbiscodec.h'
|
||||||
|
[included in the source build directory]. A simple example program,
|
||||||
|
ivorbisfile_example.c, can be built with 'make example'.
|
||||||
|
|
||||||
|
********
|
||||||
|
|
||||||
|
Detailed Tremor API Documentation begins at doc/index.html
|
||||||
|
|
||||||
|
Monty
|
||||||
|
xiph.org
|
||||||
|
|
@ -0,0 +1,2 @@
|
||||||
|
Add explicit 64 bit integer support rather than relying on compiler
|
||||||
|
Roll in optional use of bounded heap memory manager
|
||||||
|
|
@ -0,0 +1,300 @@
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
char *name;
|
||||||
|
int offset;
|
||||||
|
int count;
|
||||||
|
float percent;
|
||||||
|
}
|
||||||
|
Profile_Entry;
|
||||||
|
|
||||||
|
static const char *profile_filename;
|
||||||
|
static const char *map_filename;
|
||||||
|
static int granularity;
|
||||||
|
static int *profile;
|
||||||
|
static int profile_len;
|
||||||
|
static Profile_Entry *functionTable;
|
||||||
|
static int numFunctions;
|
||||||
|
static int maxFunctions;
|
||||||
|
|
||||||
|
static void read_args(int argc, const char *argv[])
|
||||||
|
{
|
||||||
|
if (argc < 3)
|
||||||
|
{
|
||||||
|
fprintf(stderr, "annotate <profile file> <map file>\n");
|
||||||
|
fclose(stderr);
|
||||||
|
exit(EXIT_FAILURE);
|
||||||
|
}
|
||||||
|
profile_filename = argv[1];
|
||||||
|
map_filename = argv[2];
|
||||||
|
}
|
||||||
|
|
||||||
|
static void read_profile()
|
||||||
|
{
|
||||||
|
FILE *in = fopen(profile_filename, "rb");
|
||||||
|
|
||||||
|
if (in == NULL)
|
||||||
|
{
|
||||||
|
fprintf(stderr, "Failed to open profile file '%s'\n",
|
||||||
|
profile_filename);
|
||||||
|
fclose(stderr);
|
||||||
|
exit(EXIT_FAILURE);
|
||||||
|
}
|
||||||
|
|
||||||
|
fseek(in, 0, SEEK_END);
|
||||||
|
profile_len = (int)ftell(in)-8;
|
||||||
|
fseek(in, 0, SEEK_SET);
|
||||||
|
|
||||||
|
if ((fgetc(in) != 'P') ||
|
||||||
|
(fgetc(in) != 'R') ||
|
||||||
|
(fgetc(in) != '0') ||
|
||||||
|
(fgetc(in) != 'F'))
|
||||||
|
{
|
||||||
|
fclose(in);
|
||||||
|
fprintf(stderr, "'%s' is not a profile file\n",
|
||||||
|
profile_filename);
|
||||||
|
fclose(stderr);
|
||||||
|
exit(EXIT_FAILURE);
|
||||||
|
}
|
||||||
|
|
||||||
|
fread(&granularity, 4, 1, in);
|
||||||
|
profile = malloc(profile_len);
|
||||||
|
if (profile == NULL)
|
||||||
|
{
|
||||||
|
fclose(in);
|
||||||
|
fprintf(stderr, "Out of memory reading profile\n");
|
||||||
|
fclose(stderr);
|
||||||
|
exit(EXIT_FAILURE);
|
||||||
|
}
|
||||||
|
|
||||||
|
fread(profile, 4, profile_len>>2, in);
|
||||||
|
fclose(in);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void addFn(const char *text, int offset)
|
||||||
|
{
|
||||||
|
if (numFunctions == maxFunctions)
|
||||||
|
{
|
||||||
|
int newSize = maxFunctions*2;
|
||||||
|
|
||||||
|
if (newSize == 0)
|
||||||
|
newSize = 128;
|
||||||
|
|
||||||
|
functionTable = realloc(functionTable,
|
||||||
|
newSize*sizeof(Profile_Entry));
|
||||||
|
if (functionTable == NULL)
|
||||||
|
{
|
||||||
|
fprintf(stderr, "Out of memory reading mapfile\n");
|
||||||
|
fflush(stderr);
|
||||||
|
exit(EXIT_FAILURE);
|
||||||
|
}
|
||||||
|
maxFunctions = newSize;
|
||||||
|
}
|
||||||
|
|
||||||
|
functionTable[numFunctions].name = malloc(strlen(text)+1);
|
||||||
|
strcpy(functionTable[numFunctions].name, text);
|
||||||
|
functionTable[numFunctions].offset = offset;
|
||||||
|
functionTable[numFunctions].count = 0;
|
||||||
|
functionTable[numFunctions].percent = 0.0;
|
||||||
|
//fprintf(stdout, "%s %x\n", functionTable[numFunctions].name,
|
||||||
|
// functionTable[numFunctions].offset);
|
||||||
|
numFunctions++;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void read_map()
|
||||||
|
{
|
||||||
|
FILE *in = fopen(map_filename, "rb");
|
||||||
|
char text[2048];
|
||||||
|
|
||||||
|
if (in == NULL)
|
||||||
|
{
|
||||||
|
fprintf(stderr, "Failed to open map file '%s'\n",
|
||||||
|
map_filename);
|
||||||
|
fclose(stderr);
|
||||||
|
exit(EXIT_FAILURE);
|
||||||
|
}
|
||||||
|
|
||||||
|
functionTable = NULL;
|
||||||
|
numFunctions = 0;
|
||||||
|
maxFunctions = 0;
|
||||||
|
|
||||||
|
addFn("Address 0", 0);
|
||||||
|
|
||||||
|
while (!feof(in))
|
||||||
|
{
|
||||||
|
int offset;
|
||||||
|
char c;
|
||||||
|
char *t;
|
||||||
|
|
||||||
|
/* Skip over any whitespace */
|
||||||
|
do
|
||||||
|
{
|
||||||
|
c = fgetc(in);
|
||||||
|
}
|
||||||
|
while (((c == 32) || (c == 9)) && (!feof(in)));
|
||||||
|
ungetc(c, in);
|
||||||
|
|
||||||
|
/* Try to read an offset */
|
||||||
|
if (fscanf(in, "0x%x", &offset) != 1)
|
||||||
|
{
|
||||||
|
goto over;
|
||||||
|
}
|
||||||
|
/* Skip over any whitespace */
|
||||||
|
do
|
||||||
|
{
|
||||||
|
c = fgetc(in);
|
||||||
|
}
|
||||||
|
while ((c == 32) && (!feof(in)));
|
||||||
|
ungetc(c, in);
|
||||||
|
|
||||||
|
/* Names never start with . or (*/
|
||||||
|
if ((c != '_') &&
|
||||||
|
((c < 'a') || (c > 'z')) &&
|
||||||
|
((c < 'A') || (c > 'Z')))
|
||||||
|
goto over;
|
||||||
|
|
||||||
|
/* Read the name */
|
||||||
|
t = text;
|
||||||
|
do
|
||||||
|
{
|
||||||
|
c = fgetc(in);
|
||||||
|
*t++ = c;
|
||||||
|
}
|
||||||
|
while (c > 32);
|
||||||
|
t[-1] = 0;
|
||||||
|
|
||||||
|
/* Now there should be nothing left on this line */
|
||||||
|
if ((c != 10) && (c != 13))
|
||||||
|
goto over;
|
||||||
|
|
||||||
|
/* And put the return back */
|
||||||
|
ungetc(c, in);
|
||||||
|
|
||||||
|
if (t != text)
|
||||||
|
{
|
||||||
|
addFn(text, offset);
|
||||||
|
}
|
||||||
|
|
||||||
|
over:
|
||||||
|
/* Skip to the end of the line */
|
||||||
|
do
|
||||||
|
{
|
||||||
|
c = fgetc(in);
|
||||||
|
}
|
||||||
|
while ((c >= 32) && (!feof(in)));
|
||||||
|
|
||||||
|
/* Skip over any newlines */
|
||||||
|
while (((c == 10) || (c == 13)) && (!feof(in)))
|
||||||
|
{
|
||||||
|
c = fgetc(in);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* And put the first non whitespace/non return char back */
|
||||||
|
ungetc(c, in);
|
||||||
|
}
|
||||||
|
|
||||||
|
fclose(in);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void show_profile()
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
|
||||||
|
for (i=0; i < numFunctions; i++)
|
||||||
|
{
|
||||||
|
fprintf(stdout, "%08x (%6.2f%%: %6d) %s\n",
|
||||||
|
functionTable[i].offset,
|
||||||
|
functionTable[i].percent,
|
||||||
|
functionTable[i].count,
|
||||||
|
functionTable[i].name);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
int byAddress(const void *_e1, const void *_e2)
|
||||||
|
{
|
||||||
|
const Profile_Entry *e1 = (const Profile_Entry *)_e1;
|
||||||
|
const Profile_Entry *e2 = (const Profile_Entry *)_e2;
|
||||||
|
|
||||||
|
return e1->offset - e2->offset;
|
||||||
|
}
|
||||||
|
|
||||||
|
int byTime(const void *_e1, const void *_e2)
|
||||||
|
{
|
||||||
|
const Profile_Entry *e1 = (const Profile_Entry *)_e1;
|
||||||
|
const Profile_Entry *e2 = (const Profile_Entry *)_e2;
|
||||||
|
|
||||||
|
return e2->count - e1->count;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void process_profile()
|
||||||
|
{
|
||||||
|
int next;
|
||||||
|
int fn;
|
||||||
|
int idx;
|
||||||
|
int max;
|
||||||
|
int total;
|
||||||
|
|
||||||
|
/* Sort into address order */
|
||||||
|
qsort(functionTable,
|
||||||
|
numFunctions,
|
||||||
|
sizeof(Profile_Entry),
|
||||||
|
byAddress);
|
||||||
|
|
||||||
|
/* Run through the profile adding it to the appropriate function */
|
||||||
|
fn = -1; /* Which function are we looking at */
|
||||||
|
next = -1; /* At what address should we move to the next function */
|
||||||
|
idx = 0; /* Where are we in the profile */
|
||||||
|
max = profile_len>>2;
|
||||||
|
total = 0;
|
||||||
|
for (idx = 0; idx < max; idx++)
|
||||||
|
{
|
||||||
|
while ((idx<<(granularity+2)) >= next)
|
||||||
|
{
|
||||||
|
/* Move to the next function */
|
||||||
|
fn++;
|
||||||
|
//fprintf(stdout, "Will be on fn %s until we pass %x\n",
|
||||||
|
// functionTable[fn].name, functionTable[fn+1].offset);
|
||||||
|
next = 0x7FFFFFFF;
|
||||||
|
if (fn+1 < numFunctions)
|
||||||
|
{
|
||||||
|
next = functionTable[fn+1].offset;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//fprintf(stdout, "fn=%d count=%d idx=%d next=%x\n",
|
||||||
|
// fn, functionTable[fn].count, idx, next);
|
||||||
|
functionTable[fn].count += profile[idx];
|
||||||
|
total += profile[idx];
|
||||||
|
}
|
||||||
|
|
||||||
|
for (fn = 0; fn < numFunctions; fn++)
|
||||||
|
{
|
||||||
|
functionTable[fn].percent = 100.0*functionTable[fn].count/total;
|
||||||
|
}
|
||||||
|
|
||||||
|
fprintf(stdout, "Profile by Address\n");
|
||||||
|
show_profile();
|
||||||
|
|
||||||
|
/* Sort into time order */
|
||||||
|
qsort(functionTable,
|
||||||
|
numFunctions,
|
||||||
|
sizeof(Profile_Entry),
|
||||||
|
byTime);
|
||||||
|
|
||||||
|
fprintf(stdout, "\n\n");
|
||||||
|
fprintf(stdout, "Profile by Time\n");
|
||||||
|
show_profile();
|
||||||
|
}
|
||||||
|
|
||||||
|
int main(int argc, const char *argv[])
|
||||||
|
{
|
||||||
|
read_args(argc, argv);
|
||||||
|
|
||||||
|
read_profile();
|
||||||
|
read_map();
|
||||||
|
|
||||||
|
process_profile();
|
||||||
|
|
||||||
|
return EXIT_SUCCESS;
|
||||||
|
}
|
||||||
|
|
@ -1,39 +1,19 @@
|
||||||
/************************************************************************
|
/********************************************************************
|
||||||
* Copyright (C) 2002-2009, Xiph.org Foundation
|
* *
|
||||||
* Copyright (C) 2010, Robin Watts for Pinknoise Productions Ltd
|
* THIS FILE IS PART OF THE OggVorbis 'TREMOR' CODEC SOURCE CODE. *
|
||||||
* All rights reserved.
|
* *
|
||||||
*
|
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
|
||||||
* modification, are permitted provided that the following conditions
|
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
|
||||||
* are met:
|
* *
|
||||||
*
|
* THE OggVorbis 'TREMOR' SOURCE CODE IS (C) COPYRIGHT 1994-2002 *
|
||||||
* * Redistributions of source code must retain the above copyright
|
* BY THE Xiph.Org FOUNDATION http://www.xiph.org/ *
|
||||||
* 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 names of the Xiph.org Foundation nor Pinknoise
|
|
||||||
* Productions Ltd 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 COPYRIGHT
|
|
||||||
* OWNER 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.
|
|
||||||
************************************************************************
|
|
||||||
|
|
||||||
function: arm7 and later wide math functions
|
function: arm7 and later wide math functions
|
||||||
|
|
||||||
************************************************************************/
|
********************************************************************/
|
||||||
|
|
||||||
#ifdef _ARM_ASSEM_
|
#ifdef _ARM_ASSEM_
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,486 @@
|
||||||
|
Profile by Address
|
||||||
|
00000000 ( 40.06%: 2115) Address 0
|
||||||
|
00011008 ( 0.00%: 0) WinMainCRTStartup
|
||||||
|
00011078 ( 0.00%: 0) _cinit
|
||||||
|
000110d8 ( 0.00%: 0) exit
|
||||||
|
000111b8 ( 0.00%: 0) _exit
|
||||||
|
000111c4 ( 0.00%: 0) _cexit
|
||||||
|
000111d4 ( 0.00%: 0) _c_exit
|
||||||
|
000111e4 ( 0.00%: 0) Output
|
||||||
|
000112b0 ( 0.00%: 0) main2
|
||||||
|
000115c8 ( 0.00%: 0) WinMain
|
||||||
|
00011604 ( 0.00%: 0) speedtest
|
||||||
|
000117c8 ( 0.00%: 0) Profile_dump
|
||||||
|
00011978 ( 0.42%: 22) Profile_init
|
||||||
|
00011a54 ( 0.00%: 0) oggpack_eop
|
||||||
|
00011a68 ( 0.00%: 0) oggpack_bytes
|
||||||
|
00011a98 ( 1.84%: 97) oggpack_bits
|
||||||
|
00011ad4 ( 1.55%: 82) oggpack_look
|
||||||
|
00011bf8 ( 0.97%: 51) oggpack_adv
|
||||||
|
00011c80 ( 0.00%: 0) oggpack_readinit
|
||||||
|
00011cb8 ( 0.02%: 1) oggpack_read
|
||||||
|
00011e4c ( 0.02%: 1) _ilog
|
||||||
|
0001271c ( 0.02%: 1) _book_maptype1_quantvals
|
||||||
|
0001279c ( 0.00%: 0) vorbis_book_clear
|
||||||
|
000127d0 ( 1.08%: 57) vorbis_book_unpack
|
||||||
|
00012fd8 ( 0.00%: 0) vorbis_book_decode
|
||||||
|
00012ff0 ( 7.61%: 402) decode_map
|
||||||
|
00013230 ( 0.00%: 0) vorbis_book_decodevs_add
|
||||||
|
000132f8 ( 0.00%: 0) vorbis_book_decodev_add
|
||||||
|
000133b0 ( 0.32%: 17) vorbis_book_decodev_set
|
||||||
|
000134a4 ( 4.30%: 227) vorbis_book_decodevv_add
|
||||||
|
00013578 ( 0.00%: 0) vorbis_dsp_restart
|
||||||
|
000135e0 ( 0.00%: 0) vorbis_dsp_create
|
||||||
|
00013694 ( 0.04%: 2) vorbis_dsp_destroy
|
||||||
|
000137e4 ( 0.04%: 2) vorbis_dsp_pcmout
|
||||||
|
00013910 ( 0.00%: 0) vorbis_dsp_read
|
||||||
|
00013950 ( 0.00%: 0) vorbis_packet_blocksize
|
||||||
|
000139d0 ( 0.02%: 1) vorbis_dsp_synthesis
|
||||||
|
00013dd0 ( 0.00%: 0) floor0_free_info
|
||||||
|
00013ddc ( 0.00%: 0) floor0_info_unpack
|
||||||
|
00013eec ( 0.00%: 0) floor0_memosize
|
||||||
|
00013ef8 ( 0.00%: 0) floor0_inverse1
|
||||||
|
00014054 ( 0.00%: 0) vorbis_lsp_to_curve
|
||||||
|
000146b8 ( 0.00%: 0) floor0_inverse2
|
||||||
|
0001474c ( 0.04%: 2) floor1_free_info
|
||||||
|
00014804 ( 0.04%: 2) floor1_info_unpack
|
||||||
|
00014e94 ( 0.00%: 0) floor1_memosize
|
||||||
|
00014e9c ( 0.49%: 26) floor1_inverse1
|
||||||
|
000151b8 ( 4.89%: 258) floor1_inverse2
|
||||||
|
00015588 ( 1.19%: 63) ogg_buffer_dup
|
||||||
|
00015a60 ( 0.08%: 4) ogg_page_version
|
||||||
|
00015aa0 ( 0.02%: 1) ogg_page_continued
|
||||||
|
00015ae0 ( 0.02%: 1) ogg_page_bos
|
||||||
|
00015b20 ( 0.00%: 0) ogg_page_eos
|
||||||
|
00015b60 ( 0.11%: 6) ogg_page_granulepos
|
||||||
|
00015c28 ( 0.15%: 8) ogg_page_serialno
|
||||||
|
00015c68 ( 0.00%: 0) ogg_page_pageno
|
||||||
|
00015ca8 ( 0.00%: 0) ogg_page_packets
|
||||||
|
00015d0c ( 0.00%: 0) ogg_sync_create
|
||||||
|
00015d60 ( 0.00%: 0) ogg_sync_reset
|
||||||
|
00015d90 ( 0.11%: 6) ogg_sync_destroy
|
||||||
|
00015de8 ( 0.13%: 7) ogg_sync_bufferin
|
||||||
|
00015ea4 ( 0.08%: 4) ogg_sync_wrote
|
||||||
|
00015f00 ( 0.11%: 6) ogg_page_release
|
||||||
|
00015f40 ( 2.90%: 153) ogg_sync_pageseek
|
||||||
|
00016260 ( 0.00%: 0) ogg_sync_pageout
|
||||||
|
000162a8 ( 0.00%: 0) ogg_stream_create
|
||||||
|
000162cc ( 0.08%: 4) ogg_stream_destroy
|
||||||
|
0001636c ( 0.21%: 11) ogg_stream_pagein
|
||||||
|
00016454 ( 0.06%: 3) ogg_stream_reset
|
||||||
|
000164c8 ( 0.00%: 0) ogg_stream_reset_serialno
|
||||||
|
000164e4 ( 0.40%: 21) ogg_packet_release
|
||||||
|
000169e8 ( 0.00%: 0) ogg_stream_packetout
|
||||||
|
000169f0 ( 0.00%: 0) ogg_stream_packetpeek
|
||||||
|
000169f8 ( 0.00%: 0) ogg_page_dup
|
||||||
|
00016a68 ( 0.00%: 0) vorbis_comment_init
|
||||||
|
00016adc ( 0.00%: 0) vorbis_comment_query
|
||||||
|
00016bb0 ( 0.00%: 0) vorbis_comment_query_count
|
||||||
|
00016c60 ( 0.00%: 0) vorbis_comment_clear
|
||||||
|
00016cec ( 0.00%: 0) vorbis_info_blocksize
|
||||||
|
00016d00 ( 0.00%: 0) vorbis_info_init
|
||||||
|
00016d48 ( 0.00%: 0) vorbis_info_clear
|
||||||
|
00016ef8 ( 0.00%: 0) vorbis_dsp_headerin
|
||||||
|
00017514 ( 0.00%: 0) mapping_clear_info
|
||||||
|
00017590 ( 0.02%: 1) mapping_info_unpack
|
||||||
|
000177e4 ( 1.59%: 84) mapping_inverse
|
||||||
|
00017c84 ( 0.04%: 2) mdct_unroll_lap
|
||||||
|
00017f00 ( 0.02%: 1) mdct_backward
|
||||||
|
00018244 ( 0.00%: 0) _VDBG_dump
|
||||||
|
000182a8 ( 0.00%: 0) _VDBG_malloc
|
||||||
|
000183f4 ( 0.00%: 0) _VDBG_free
|
||||||
|
0001841c ( 0.00%: 0) res_clear_info
|
||||||
|
0001846c ( 0.00%: 0) res_unpack
|
||||||
|
00018680 ( 1.86%: 98) res_inverse
|
||||||
|
00019b7c ( 0.00%: 0) ov_clear
|
||||||
|
00019d20 ( 0.00%: 0) ov_test_callbacks
|
||||||
|
00019d60 ( 0.00%: 0) ov_test
|
||||||
|
00019dac ( 0.00%: 0) ov_streams
|
||||||
|
00019db4 ( 0.00%: 0) ov_seekable
|
||||||
|
00019dbc ( 0.00%: 0) ov_time_total
|
||||||
|
00019e80 ( 0.00%: 0) ov_bitrate
|
||||||
|
0001a008 ( 0.00%: 0) ov_bitrate_instant
|
||||||
|
0001a084 ( 0.00%: 0) ov_serialnumber
|
||||||
|
0001a0fc ( 0.00%: 0) ov_raw_total
|
||||||
|
0001a1ac ( 0.00%: 0) ov_pcm_total
|
||||||
|
0001a250 ( 0.00%: 0) ov_raw_seek
|
||||||
|
0001ab40 ( 0.00%: 0) ov_test_open
|
||||||
|
0001ab58 ( 0.00%: 0) ov_open_callbacks
|
||||||
|
0001abb0 ( 0.00%: 0) ov_open
|
||||||
|
0001abfc ( 0.00%: 0) ov_pcm_seek_page
|
||||||
|
0001b4a4 ( 0.00%: 0) ov_pcm_seek
|
||||||
|
0001b8c8 ( 0.00%: 0) ov_time_seek
|
||||||
|
0001ba48 ( 0.00%: 0) ov_time_seek_page
|
||||||
|
0001bbc8 ( 0.00%: 0) ov_raw_tell
|
||||||
|
0001bbec ( 0.00%: 0) ov_pcm_tell
|
||||||
|
0001bc10 ( 0.00%: 0) ov_time_tell
|
||||||
|
0001bd2c ( 0.00%: 0) ov_info
|
||||||
|
0001bd70 ( 0.00%: 0) ov_comment
|
||||||
|
0001bdb4 ( 0.09%: 5) ov_read
|
||||||
|
0001be94 ( 0.00%: 0) mdct_unroll_prelap
|
||||||
|
0001bf34 ( 0.06%: 3) mdct_unroll_postlap
|
||||||
|
0001bff8 ( 3.43%: 181) mdct_unroll_part2
|
||||||
|
0001c050 ( 1.21%: 64) mdct_unroll_part3
|
||||||
|
0001c0a8 ( 0.85%: 45) mdct_shift_right
|
||||||
|
0001c104 ( 14.45%: 763) mdct_backwardARM
|
||||||
|
0001c998 ( 6.04%: 319) decode_packed_entry_number
|
||||||
|
0001cb58 ( 0.00%: 0) stmiaTest
|
||||||
|
0001cbbc ( 0.00%: 0) strTest
|
||||||
|
0001cc3c ( 0.00%: 0) smullTest
|
||||||
|
0001cc80 ( 0.00%: 0) __udivdi3
|
||||||
|
0001d1f0 ( 0.00%: 0) __aeabi_drsub
|
||||||
|
0001d1f8 ( 0.00%: 0) __aeabi_dsub
|
||||||
|
0001d1f8 ( 0.00%: 0) __subdf3
|
||||||
|
0001d1fc ( 0.00%: 0) __adddf3
|
||||||
|
0001d1fc ( 0.00%: 0) __aeabi_dadd
|
||||||
|
0001d4dc ( 0.00%: 0) __aeabi_ui2d
|
||||||
|
0001d4dc ( 0.00%: 0) __floatunsidf
|
||||||
|
0001d500 ( 0.00%: 0) __floatsidf
|
||||||
|
0001d500 ( 0.00%: 0) __aeabi_i2d
|
||||||
|
0001d528 ( 0.00%: 0) __extendsfdf2
|
||||||
|
0001d528 ( 0.00%: 0) __aeabi_f2d
|
||||||
|
0001d568 ( 0.00%: 0) __aeabi_ul2d
|
||||||
|
0001d568 ( 0.00%: 0) __floatundidf
|
||||||
|
0001d57c ( 0.00%: 0) __floatdidf
|
||||||
|
0001d57c ( 0.00%: 0) __aeabi_l2d
|
||||||
|
0001d5dc ( 0.00%: 0) __aeabi_dmul
|
||||||
|
0001d5dc ( 0.00%: 0) __muldf3
|
||||||
|
0001d904 ( 0.00%: 0) __aeabi_ddiv
|
||||||
|
0001d904 ( 0.00%: 0) __divdf3
|
||||||
|
0001db08 ( 0.00%: 0) __modsi3
|
||||||
|
0001dbec ( 0.30%: 16) __divsi3
|
||||||
|
0001dd14 ( 0.00%: 0) __aeabi_idivmod
|
||||||
|
0001dd2c ( 0.04%: 2) __udivsi3
|
||||||
|
0001de24 ( 0.00%: 0) __aeabi_uidivmod
|
||||||
|
0001de3c ( 0.00%: 0) __divdi3
|
||||||
|
0001e3f8 ( 0.00%: 0) __umodsi3
|
||||||
|
0001e4c4 ( 0.00%: 0) __aeabi_ldiv0
|
||||||
|
0001e4c4 ( 0.00%: 0) __div0
|
||||||
|
0001e4c4 ( 0.00%: 0) __aeabi_idiv0
|
||||||
|
0001e4c8 ( 0.00%: 0) _XcptFilter
|
||||||
|
0001e4d4 ( 0.00%: 0) __C_specific_handler
|
||||||
|
0001e4e0 ( 0.00%: 0) LocalFree
|
||||||
|
0001e4ec ( 0.00%: 0) vsprintf
|
||||||
|
0001e4f8 ( 0.57%: 30) OutputDebugStringW
|
||||||
|
0001e504 ( 0.00%: 0) fopen
|
||||||
|
0001e510 ( 0.00%: 0) fwrite
|
||||||
|
0001e51c ( 0.00%: 0) fread
|
||||||
|
0001e528 ( 0.00%: 0) GetThreadTimes
|
||||||
|
0001e534 ( 0.00%: 0) Sleep
|
||||||
|
0001e540 ( 0.04%: 2) fputc
|
||||||
|
0001e54c ( 0.00%: 0) fclose
|
||||||
|
0001e558 ( 0.00%: 0) memset
|
||||||
|
0001e564 ( 0.00%: 0) GetThreadContext
|
||||||
|
0001e570 ( 0.00%: 0) malloc
|
||||||
|
0001e57c ( 0.00%: 0) CreateThread
|
||||||
|
0001e588 ( 0.00%: 0) SetThreadPriority
|
||||||
|
0001e594 ( 0.00%: 0) free
|
||||||
|
0001e5a0 ( 0.00%: 0) calloc
|
||||||
|
0001e5ac ( 0.00%: 0) realloc
|
||||||
|
0001e5b8 ( 0.00%: 0) memchr
|
||||||
|
0001e5c4 ( 0.00%: 0) toupper
|
||||||
|
0001e5d0 ( 0.00%: 0) strlen
|
||||||
|
0001e5dc ( 0.00%: 0) strcpy
|
||||||
|
0001e5e8 ( 0.00%: 0) memcmp
|
||||||
|
0001e5f4 ( 0.00%: 0) _getstdfilex
|
||||||
|
0001e600 ( 0.00%: 0) fprintf
|
||||||
|
0001e60c ( 0.00%: 0) fseek
|
||||||
|
0001e618 ( 0.00%: 0) memcpy
|
||||||
|
0001e624 ( 0.00%: 0) ftell
|
||||||
|
0001f418 ( 0.00%: 0) start_time
|
||||||
|
00028764 ( 0.00%: 0) FLOOR_fromdB_LOOKUP
|
||||||
|
00028b88 ( 0.00%: 0) sincos_lookup0
|
||||||
|
00029b90 ( 0.00%: 0) sincos_lookup1
|
||||||
|
0002ada4 ( 0.00%: 0) __clz_tab
|
||||||
|
0002d014 ( 0.00%: 0) global_bytes
|
||||||
|
0002d030 ( 0.00%: 0) __onexitbegin
|
||||||
|
0002d034 ( 0.00%: 0) __onexitend
|
||||||
|
0002d038 ( 0.00%: 0) _exitflag
|
||||||
|
0002d03c ( 0.00%: 0) pcmout
|
||||||
|
0002e03c ( 0.00%: 0) ref
|
||||||
|
0002f03c ( 0.00%: 0) text
|
||||||
|
0003003c ( 0.00%: 0) speedblock
|
||||||
|
00039000 ( 0.00%: 0) __IMPORT_DESCRIPTOR_COREDLL
|
||||||
|
00039014 ( 0.00%: 0) __NULL_IMPORT_DESCRIPTOR
|
||||||
|
000390b8 ( 0.00%: 0) __imp__XcptFilter
|
||||||
|
000390bc ( 0.00%: 0) __imp___C_specific_handler
|
||||||
|
000390c0 ( 0.00%: 0) __imp_LocalFree
|
||||||
|
000390c4 ( 0.00%: 0) __imp_vsprintf
|
||||||
|
000390c8 ( 0.00%: 0) __imp_OutputDebugStringW
|
||||||
|
000390cc ( 0.00%: 0) __imp_fopen
|
||||||
|
000390d0 ( 0.00%: 0) __imp_fwrite
|
||||||
|
000390d4 ( 0.00%: 0) __imp_fread
|
||||||
|
000390d8 ( 0.00%: 0) __imp_GetThreadTimes
|
||||||
|
000390dc ( 0.00%: 0) __imp_Sleep
|
||||||
|
000390e0 ( 0.00%: 0) __imp_fputc
|
||||||
|
000390e4 ( 0.00%: 0) __imp_fclose
|
||||||
|
000390e8 ( 0.00%: 0) __imp_memset
|
||||||
|
000390ec ( 0.00%: 0) __imp_GetThreadContext
|
||||||
|
000390f0 ( 0.00%: 0) __imp_malloc
|
||||||
|
000390f4 ( 0.00%: 0) __imp_CreateThread
|
||||||
|
000390f8 ( 0.00%: 0) __imp_SetThreadPriority
|
||||||
|
000390fc ( 0.00%: 0) __imp_free
|
||||||
|
00039100 ( 0.00%: 0) __imp_calloc
|
||||||
|
00039104 ( 0.00%: 0) __imp_realloc
|
||||||
|
00039108 ( 0.00%: 0) __imp_memchr
|
||||||
|
0003910c ( 0.00%: 0) __imp_toupper
|
||||||
|
00039110 ( 0.00%: 0) __imp_strlen
|
||||||
|
00039114 ( 0.00%: 0) __imp_strcpy
|
||||||
|
00039118 ( 0.00%: 0) __imp_memcmp
|
||||||
|
0003911c ( 0.00%: 0) __imp__getstdfilex
|
||||||
|
00039120 ( 0.00%: 0) __imp_fprintf
|
||||||
|
00039124 ( 0.00%: 0) __imp_fseek
|
||||||
|
00039128 ( 0.00%: 0) __imp_memcpy
|
||||||
|
0003912c ( 0.00%: 0) __imp_ftell
|
||||||
|
0003a000 ( 0.00%: 0) __xc_a
|
||||||
|
0003a004 ( 0.00%: 0) __xc_z
|
||||||
|
0003a008 ( 0.00%: 0) __xi_a
|
||||||
|
0003a00c ( 0.00%: 0) __xi_z
|
||||||
|
0003a010 ( 0.00%: 0) __xp_a
|
||||||
|
0003a014 ( 0.00%: 0) __xp_z
|
||||||
|
0003a018 ( 0.00%: 0) __xt_a
|
||||||
|
0003a01c ( 0.00%: 0) __xt_z
|
||||||
|
|
||||||
|
|
||||||
|
Profile by Time
|
||||||
|
00000000 ( 40.06%: 2115) Address 0
|
||||||
|
0001c104 ( 14.45%: 763) mdct_backwardARM
|
||||||
|
00012ff0 ( 7.61%: 402) decode_map
|
||||||
|
0001c998 ( 6.04%: 319) decode_packed_entry_number
|
||||||
|
000151b8 ( 4.89%: 258) floor1_inverse2
|
||||||
|
000134a4 ( 4.30%: 227) vorbis_book_decodevv_add
|
||||||
|
0001bff8 ( 3.43%: 181) mdct_unroll_part2
|
||||||
|
00015f40 ( 2.90%: 153) ogg_sync_pageseek
|
||||||
|
00018680 ( 1.86%: 98) res_inverse
|
||||||
|
00011a98 ( 1.84%: 97) oggpack_bits
|
||||||
|
000177e4 ( 1.59%: 84) mapping_inverse
|
||||||
|
00011ad4 ( 1.55%: 82) oggpack_look
|
||||||
|
0001c050 ( 1.21%: 64) mdct_unroll_part3
|
||||||
|
00015588 ( 1.19%: 63) ogg_buffer_dup
|
||||||
|
000127d0 ( 1.08%: 57) vorbis_book_unpack
|
||||||
|
00011bf8 ( 0.97%: 51) oggpack_adv
|
||||||
|
0001c0a8 ( 0.85%: 45) mdct_shift_right
|
||||||
|
0001e4f8 ( 0.57%: 30) OutputDebugStringW
|
||||||
|
00014e9c ( 0.49%: 26) floor1_inverse1
|
||||||
|
00011978 ( 0.42%: 22) Profile_init
|
||||||
|
000164e4 ( 0.40%: 21) ogg_packet_release
|
||||||
|
000133b0 ( 0.32%: 17) vorbis_book_decodev_set
|
||||||
|
0001dbec ( 0.30%: 16) __divsi3
|
||||||
|
0001636c ( 0.21%: 11) ogg_stream_pagein
|
||||||
|
00015c28 ( 0.15%: 8) ogg_page_serialno
|
||||||
|
00015de8 ( 0.13%: 7) ogg_sync_bufferin
|
||||||
|
00015d90 ( 0.11%: 6) ogg_sync_destroy
|
||||||
|
00015f00 ( 0.11%: 6) ogg_page_release
|
||||||
|
00015b60 ( 0.11%: 6) ogg_page_granulepos
|
||||||
|
0001bdb4 ( 0.09%: 5) ov_read
|
||||||
|
000162cc ( 0.08%: 4) ogg_stream_destroy
|
||||||
|
00015ea4 ( 0.08%: 4) ogg_sync_wrote
|
||||||
|
00015a60 ( 0.08%: 4) ogg_page_version
|
||||||
|
0001bf34 ( 0.06%: 3) mdct_unroll_postlap
|
||||||
|
00016454 ( 0.06%: 3) ogg_stream_reset
|
||||||
|
0001e540 ( 0.04%: 2) fputc
|
||||||
|
00014804 ( 0.04%: 2) floor1_info_unpack
|
||||||
|
0001474c ( 0.04%: 2) floor1_free_info
|
||||||
|
0001dd2c ( 0.04%: 2) __udivsi3
|
||||||
|
00017c84 ( 0.04%: 2) mdct_unroll_lap
|
||||||
|
00013694 ( 0.04%: 2) vorbis_dsp_destroy
|
||||||
|
000137e4 ( 0.04%: 2) vorbis_dsp_pcmout
|
||||||
|
00011cb8 ( 0.02%: 1) oggpack_read
|
||||||
|
00017f00 ( 0.02%: 1) mdct_backward
|
||||||
|
000139d0 ( 0.02%: 1) vorbis_dsp_synthesis
|
||||||
|
00011e4c ( 0.02%: 1) _ilog
|
||||||
|
0001271c ( 0.02%: 1) _book_maptype1_quantvals
|
||||||
|
00017590 ( 0.02%: 1) mapping_info_unpack
|
||||||
|
00015ae0 ( 0.02%: 1) ogg_page_bos
|
||||||
|
00015aa0 ( 0.02%: 1) ogg_page_continued
|
||||||
|
00018244 ( 0.00%: 0) _VDBG_dump
|
||||||
|
000182a8 ( 0.00%: 0) _VDBG_malloc
|
||||||
|
000183f4 ( 0.00%: 0) _VDBG_free
|
||||||
|
0001841c ( 0.00%: 0) res_clear_info
|
||||||
|
0001846c ( 0.00%: 0) res_unpack
|
||||||
|
00019b7c ( 0.00%: 0) ov_clear
|
||||||
|
00019d20 ( 0.00%: 0) ov_test_callbacks
|
||||||
|
00019d60 ( 0.00%: 0) ov_test
|
||||||
|
00019dac ( 0.00%: 0) ov_streams
|
||||||
|
00019db4 ( 0.00%: 0) ov_seekable
|
||||||
|
00019dbc ( 0.00%: 0) ov_time_total
|
||||||
|
00019e80 ( 0.00%: 0) ov_bitrate
|
||||||
|
0001a008 ( 0.00%: 0) ov_bitrate_instant
|
||||||
|
0001a084 ( 0.00%: 0) ov_serialnumber
|
||||||
|
0001a0fc ( 0.00%: 0) ov_raw_total
|
||||||
|
0001a1ac ( 0.00%: 0) ov_pcm_total
|
||||||
|
0001a250 ( 0.00%: 0) ov_raw_seek
|
||||||
|
0001ab40 ( 0.00%: 0) ov_test_open
|
||||||
|
0001ab58 ( 0.00%: 0) ov_open_callbacks
|
||||||
|
0001abb0 ( 0.00%: 0) ov_open
|
||||||
|
0001abfc ( 0.00%: 0) ov_pcm_seek_page
|
||||||
|
0001b4a4 ( 0.00%: 0) ov_pcm_seek
|
||||||
|
0001b8c8 ( 0.00%: 0) ov_time_seek
|
||||||
|
0001ba48 ( 0.00%: 0) ov_time_seek_page
|
||||||
|
0001bbc8 ( 0.00%: 0) ov_raw_tell
|
||||||
|
0001bbec ( 0.00%: 0) ov_pcm_tell
|
||||||
|
0001bc10 ( 0.00%: 0) ov_time_tell
|
||||||
|
0001bd2c ( 0.00%: 0) ov_info
|
||||||
|
0001bd70 ( 0.00%: 0) ov_comment
|
||||||
|
0001be94 ( 0.00%: 0) mdct_unroll_prelap
|
||||||
|
0001cb58 ( 0.00%: 0) stmiaTest
|
||||||
|
0001cbbc ( 0.00%: 0) strTest
|
||||||
|
0001cc3c ( 0.00%: 0) smullTest
|
||||||
|
0001cc80 ( 0.00%: 0) __udivdi3
|
||||||
|
0001d1f0 ( 0.00%: 0) __aeabi_drsub
|
||||||
|
0001d1f8 ( 0.00%: 0) __aeabi_dsub
|
||||||
|
0001d1f8 ( 0.00%: 0) __subdf3
|
||||||
|
0001d1fc ( 0.00%: 0) __adddf3
|
||||||
|
0001d1fc ( 0.00%: 0) __aeabi_dadd
|
||||||
|
0001d4dc ( 0.00%: 0) __aeabi_ui2d
|
||||||
|
0001d4dc ( 0.00%: 0) __floatunsidf
|
||||||
|
0001d500 ( 0.00%: 0) __floatsidf
|
||||||
|
0001d500 ( 0.00%: 0) __aeabi_i2d
|
||||||
|
0001d528 ( 0.00%: 0) __extendsfdf2
|
||||||
|
0001d528 ( 0.00%: 0) __aeabi_f2d
|
||||||
|
0001d568 ( 0.00%: 0) __aeabi_ul2d
|
||||||
|
0001d568 ( 0.00%: 0) __floatundidf
|
||||||
|
0001d57c ( 0.00%: 0) __floatdidf
|
||||||
|
0001d57c ( 0.00%: 0) __aeabi_l2d
|
||||||
|
0001d5dc ( 0.00%: 0) __aeabi_dmul
|
||||||
|
0001d5dc ( 0.00%: 0) __muldf3
|
||||||
|
0001d904 ( 0.00%: 0) __aeabi_ddiv
|
||||||
|
0001d904 ( 0.00%: 0) __divdf3
|
||||||
|
0001db08 ( 0.00%: 0) __modsi3
|
||||||
|
0001dd14 ( 0.00%: 0) __aeabi_idivmod
|
||||||
|
0001de24 ( 0.00%: 0) __aeabi_uidivmod
|
||||||
|
0001de3c ( 0.00%: 0) __divdi3
|
||||||
|
0001e3f8 ( 0.00%: 0) __umodsi3
|
||||||
|
0001e4c4 ( 0.00%: 0) __aeabi_ldiv0
|
||||||
|
0001e4c4 ( 0.00%: 0) __div0
|
||||||
|
0001e4c4 ( 0.00%: 0) __aeabi_idiv0
|
||||||
|
0001e4c8 ( 0.00%: 0) _XcptFilter
|
||||||
|
0001e4d4 ( 0.00%: 0) __C_specific_handler
|
||||||
|
0001e4e0 ( 0.00%: 0) LocalFree
|
||||||
|
0001e4ec ( 0.00%: 0) vsprintf
|
||||||
|
0001e504 ( 0.00%: 0) fopen
|
||||||
|
0001e510 ( 0.00%: 0) fwrite
|
||||||
|
0001e51c ( 0.00%: 0) fread
|
||||||
|
0001e528 ( 0.00%: 0) GetThreadTimes
|
||||||
|
0001e534 ( 0.00%: 0) Sleep
|
||||||
|
0001e54c ( 0.00%: 0) fclose
|
||||||
|
0001e558 ( 0.00%: 0) memset
|
||||||
|
0001e564 ( 0.00%: 0) GetThreadContext
|
||||||
|
0001e570 ( 0.00%: 0) malloc
|
||||||
|
0001e57c ( 0.00%: 0) CreateThread
|
||||||
|
0001e588 ( 0.00%: 0) SetThreadPriority
|
||||||
|
0001e594 ( 0.00%: 0) free
|
||||||
|
0001e5a0 ( 0.00%: 0) calloc
|
||||||
|
0001e5ac ( 0.00%: 0) realloc
|
||||||
|
0001e5b8 ( 0.00%: 0) memchr
|
||||||
|
0001e5c4 ( 0.00%: 0) toupper
|
||||||
|
0001e5d0 ( 0.00%: 0) strlen
|
||||||
|
0001e5dc ( 0.00%: 0) strcpy
|
||||||
|
0001e5e8 ( 0.00%: 0) memcmp
|
||||||
|
0001e5f4 ( 0.00%: 0) _getstdfilex
|
||||||
|
0001e600 ( 0.00%: 0) fprintf
|
||||||
|
0001e60c ( 0.00%: 0) fseek
|
||||||
|
0001e618 ( 0.00%: 0) memcpy
|
||||||
|
0001e624 ( 0.00%: 0) ftell
|
||||||
|
0001f418 ( 0.00%: 0) start_time
|
||||||
|
00028764 ( 0.00%: 0) FLOOR_fromdB_LOOKUP
|
||||||
|
00028b88 ( 0.00%: 0) sincos_lookup0
|
||||||
|
00029b90 ( 0.00%: 0) sincos_lookup1
|
||||||
|
0002ada4 ( 0.00%: 0) __clz_tab
|
||||||
|
0002d014 ( 0.00%: 0) global_bytes
|
||||||
|
0002d030 ( 0.00%: 0) __onexitbegin
|
||||||
|
0002d034 ( 0.00%: 0) __onexitend
|
||||||
|
0002d038 ( 0.00%: 0) _exitflag
|
||||||
|
0002d03c ( 0.00%: 0) pcmout
|
||||||
|
0002e03c ( 0.00%: 0) ref
|
||||||
|
0002f03c ( 0.00%: 0) text
|
||||||
|
0003003c ( 0.00%: 0) speedblock
|
||||||
|
00039000 ( 0.00%: 0) __IMPORT_DESCRIPTOR_COREDLL
|
||||||
|
00039014 ( 0.00%: 0) __NULL_IMPORT_DESCRIPTOR
|
||||||
|
000390b8 ( 0.00%: 0) __imp__XcptFilter
|
||||||
|
000390bc ( 0.00%: 0) __imp___C_specific_handler
|
||||||
|
000390c0 ( 0.00%: 0) __imp_LocalFree
|
||||||
|
000390c4 ( 0.00%: 0) __imp_vsprintf
|
||||||
|
000390c8 ( 0.00%: 0) __imp_OutputDebugStringW
|
||||||
|
000390cc ( 0.00%: 0) __imp_fopen
|
||||||
|
000390d0 ( 0.00%: 0) __imp_fwrite
|
||||||
|
000390d4 ( 0.00%: 0) __imp_fread
|
||||||
|
000390d8 ( 0.00%: 0) __imp_GetThreadTimes
|
||||||
|
000390dc ( 0.00%: 0) __imp_Sleep
|
||||||
|
000390e0 ( 0.00%: 0) __imp_fputc
|
||||||
|
000390e4 ( 0.00%: 0) __imp_fclose
|
||||||
|
000390e8 ( 0.00%: 0) __imp_memset
|
||||||
|
000390ec ( 0.00%: 0) __imp_GetThreadContext
|
||||||
|
000390f0 ( 0.00%: 0) __imp_malloc
|
||||||
|
000390f4 ( 0.00%: 0) __imp_CreateThread
|
||||||
|
000390f8 ( 0.00%: 0) __imp_SetThreadPriority
|
||||||
|
000390fc ( 0.00%: 0) __imp_free
|
||||||
|
00039100 ( 0.00%: 0) __imp_calloc
|
||||||
|
00039104 ( 0.00%: 0) __imp_realloc
|
||||||
|
00039108 ( 0.00%: 0) __imp_memchr
|
||||||
|
0003910c ( 0.00%: 0) __imp_toupper
|
||||||
|
00039110 ( 0.00%: 0) __imp_strlen
|
||||||
|
00039114 ( 0.00%: 0) __imp_strcpy
|
||||||
|
00039118 ( 0.00%: 0) __imp_memcmp
|
||||||
|
0003911c ( 0.00%: 0) __imp__getstdfilex
|
||||||
|
00039120 ( 0.00%: 0) __imp_fprintf
|
||||||
|
00039124 ( 0.00%: 0) __imp_fseek
|
||||||
|
00039128 ( 0.00%: 0) __imp_memcpy
|
||||||
|
0003912c ( 0.00%: 0) __imp_ftell
|
||||||
|
0003a000 ( 0.00%: 0) __xc_a
|
||||||
|
0003a004 ( 0.00%: 0) __xc_z
|
||||||
|
0003a008 ( 0.00%: 0) __xi_a
|
||||||
|
0003a00c ( 0.00%: 0) __xi_z
|
||||||
|
0003a010 ( 0.00%: 0) __xp_a
|
||||||
|
0003a014 ( 0.00%: 0) __xp_z
|
||||||
|
0003a018 ( 0.00%: 0) __xt_a
|
||||||
|
0003a01c ( 0.00%: 0) __xt_z
|
||||||
|
00011008 ( 0.00%: 0) WinMainCRTStartup
|
||||||
|
00011078 ( 0.00%: 0) _cinit
|
||||||
|
000110d8 ( 0.00%: 0) exit
|
||||||
|
000111b8 ( 0.00%: 0) _exit
|
||||||
|
000111c4 ( 0.00%: 0) _cexit
|
||||||
|
000111d4 ( 0.00%: 0) _c_exit
|
||||||
|
000111e4 ( 0.00%: 0) Output
|
||||||
|
000112b0 ( 0.00%: 0) main2
|
||||||
|
000115c8 ( 0.00%: 0) WinMain
|
||||||
|
00011604 ( 0.00%: 0) speedtest
|
||||||
|
000117c8 ( 0.00%: 0) Profile_dump
|
||||||
|
00011a54 ( 0.00%: 0) oggpack_eop
|
||||||
|
00011a68 ( 0.00%: 0) oggpack_bytes
|
||||||
|
00011c80 ( 0.00%: 0) oggpack_readinit
|
||||||
|
0001279c ( 0.00%: 0) vorbis_book_clear
|
||||||
|
00012fd8 ( 0.00%: 0) vorbis_book_decode
|
||||||
|
00013230 ( 0.00%: 0) vorbis_book_decodevs_add
|
||||||
|
000132f8 ( 0.00%: 0) vorbis_book_decodev_add
|
||||||
|
00013578 ( 0.00%: 0) vorbis_dsp_restart
|
||||||
|
000135e0 ( 0.00%: 0) vorbis_dsp_create
|
||||||
|
00013910 ( 0.00%: 0) vorbis_dsp_read
|
||||||
|
00013950 ( 0.00%: 0) vorbis_packet_blocksize
|
||||||
|
00013dd0 ( 0.00%: 0) floor0_free_info
|
||||||
|
00013ddc ( 0.00%: 0) floor0_info_unpack
|
||||||
|
00013eec ( 0.00%: 0) floor0_memosize
|
||||||
|
00013ef8 ( 0.00%: 0) floor0_inverse1
|
||||||
|
00014054 ( 0.00%: 0) vorbis_lsp_to_curve
|
||||||
|
000146b8 ( 0.00%: 0) floor0_inverse2
|
||||||
|
00014e94 ( 0.00%: 0) floor1_memosize
|
||||||
|
00015b20 ( 0.00%: 0) ogg_page_eos
|
||||||
|
00015c68 ( 0.00%: 0) ogg_page_pageno
|
||||||
|
00015ca8 ( 0.00%: 0) ogg_page_packets
|
||||||
|
00015d0c ( 0.00%: 0) ogg_sync_create
|
||||||
|
00015d60 ( 0.00%: 0) ogg_sync_reset
|
||||||
|
00016260 ( 0.00%: 0) ogg_sync_pageout
|
||||||
|
000162a8 ( 0.00%: 0) ogg_stream_create
|
||||||
|
000164c8 ( 0.00%: 0) ogg_stream_reset_serialno
|
||||||
|
000169e8 ( 0.00%: 0) ogg_stream_packetout
|
||||||
|
000169f0 ( 0.00%: 0) ogg_stream_packetpeek
|
||||||
|
000169f8 ( 0.00%: 0) ogg_page_dup
|
||||||
|
00016a68 ( 0.00%: 0) vorbis_comment_init
|
||||||
|
00016adc ( 0.00%: 0) vorbis_comment_query
|
||||||
|
00016bb0 ( 0.00%: 0) vorbis_comment_query_count
|
||||||
|
00016c60 ( 0.00%: 0) vorbis_comment_clear
|
||||||
|
00016cec ( 0.00%: 0) vorbis_info_blocksize
|
||||||
|
00016d00 ( 0.00%: 0) vorbis_info_init
|
||||||
|
00016d48 ( 0.00%: 0) vorbis_info_clear
|
||||||
|
00016ef8 ( 0.00%: 0) vorbis_dsp_headerin
|
||||||
|
00017514 ( 0.00%: 0) mapping_clear_info
|
||||||
|
|
@ -1,39 +1,19 @@
|
||||||
/************************************************************************
|
/********************************************************************
|
||||||
* Copyright (C) 2002-2009, Xiph.org Foundation
|
* *
|
||||||
* Copyright (C) 2010, Robin Watts for Pinknoise Productions Ltd
|
* THIS FILE IS PART OF THE OggVorbis 'TREMOR' CODEC SOURCE CODE. *
|
||||||
* All rights reserved.
|
* *
|
||||||
*
|
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
|
||||||
* modification, are permitted provided that the following conditions
|
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
|
||||||
* are met:
|
* *
|
||||||
*
|
* THE OggVorbis 'TREMOR' SOURCE CODE IS (C) COPYRIGHT 1994-2003 *
|
||||||
* * Redistributions of source code must retain the above copyright
|
* BY THE Xiph.Org FOUNDATION http://www.xiph.org/ *
|
||||||
* 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 names of the Xiph.org Foundation nor Pinknoise
|
|
||||||
* Productions Ltd 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 COPYRIGHT
|
|
||||||
* OWNER 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.
|
|
||||||
************************************************************************
|
|
||||||
|
|
||||||
function: packing variable sized words into an octet stream
|
function: packing variable sized words into an octet stream
|
||||||
|
|
||||||
************************************************************************/
|
********************************************************************/
|
||||||
|
|
||||||
/* We're 'LSb' endian; if we write a word but read individual bits,
|
/* We're 'LSb' endian; if we write a word but read individual bits,
|
||||||
then we'll read the lsb first */
|
then we'll read the lsb first */
|
||||||
|
|
@ -163,7 +143,7 @@ static void _span(oggpack_buffer *b){
|
||||||
b->headend-=b->headbit>>3;
|
b->headend-=b->headbit>>3;
|
||||||
b->headbit&=0x7;
|
b->headbit&=0x7;
|
||||||
|
|
||||||
if(b->head && b->head->next){
|
if(b->head->next){
|
||||||
b->count+=b->head->length;
|
b->count+=b->head->length;
|
||||||
b->head=b->head->next;
|
b->head=b->head->next;
|
||||||
|
|
||||||
|
|
@ -187,13 +167,8 @@ void oggpack_readinit(oggpack_buffer *b,ogg_reference *r){
|
||||||
|
|
||||||
b->tail=b->head=r;
|
b->tail=b->head=r;
|
||||||
b->count=0;
|
b->count=0;
|
||||||
if (b->head && r->length) {
|
b->headptr=b->head->buffer->data+b->head->begin;
|
||||||
b->headptr=b->head->buffer->data+b->head->begin;
|
b->headend=b->head->length;
|
||||||
b->headend=b->head->length;
|
|
||||||
} else {
|
|
||||||
b->headptr=0;
|
|
||||||
b->headend=0;
|
|
||||||
}
|
|
||||||
_span(b);
|
_span(b);
|
||||||
|
|
||||||
//fprintf(stderr,
|
//fprintf(stderr,
|
||||||
|
|
@ -214,11 +189,9 @@ void oggpack_readinit(oggpack_buffer *b,ogg_reference *r){
|
||||||
/* Read in bits without advancing the bitptr; bits <= 32 */
|
/* Read in bits without advancing the bitptr; bits <= 32 */
|
||||||
long oggpack_look(oggpack_buffer *b,int bits){
|
long oggpack_look(oggpack_buffer *b,int bits){
|
||||||
unsigned long m=mask[bits];
|
unsigned long m=mask[bits];
|
||||||
unsigned long ret = 0;
|
unsigned long ret;
|
||||||
int BITS = bits;
|
int BITS = bits;
|
||||||
|
|
||||||
if (!b->headptr) return 0;
|
|
||||||
|
|
||||||
bits+=b->headbit;
|
bits+=b->headbit;
|
||||||
|
|
||||||
if(bits >= b->headend<<3){
|
if(bits >= b->headend<<3){
|
||||||
|
|
@ -226,8 +199,7 @@ long oggpack_look(oggpack_buffer *b,int bits){
|
||||||
unsigned char *ptr=b->headptr;
|
unsigned char *ptr=b->headptr;
|
||||||
ogg_reference *head=b->head;
|
ogg_reference *head=b->head;
|
||||||
|
|
||||||
if(end<0)return 0;
|
if(end<0)return -1;
|
||||||
if (!head || !end)return 0;
|
|
||||||
|
|
||||||
if(bits){
|
if(bits){
|
||||||
_lookspan();
|
_lookspan();
|
||||||
|
|
|
||||||
|
|
@ -1,38 +1,4 @@
|
||||||
@ Tremolo library
|
.text
|
||||||
@-----------------------------------------------------------------------
|
|
||||||
@ Copyright (C) 2002-2009, Xiph.org Foundation
|
|
||||||
@ Copyright (C) 2010, Robin Watts for Pinknoise Productions Ltd
|
|
||||||
@ All rights reserved.
|
|
||||||
|
|
||||||
@ 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 names of the Xiph.org Foundation nor Pinknoise
|
|
||||||
@ Productions Ltd 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 COPYRIGHT
|
|
||||||
@ OWNER 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.
|
|
||||||
@ ----------------------------------------------------------------------
|
|
||||||
|
|
||||||
.text
|
|
||||||
|
|
||||||
.global oggpack_look
|
.global oggpack_look
|
||||||
.global oggpack_adv
|
.global oggpack_adv
|
||||||
|
|
@ -125,8 +91,7 @@ look_really_slow:
|
||||||
LDMFD r13!,{r5,r6,r10,r11,PC}
|
LDMFD r13!,{r5,r6,r10,r11,PC}
|
||||||
|
|
||||||
look_out_of_data:
|
look_out_of_data:
|
||||||
@MVN r0,#0 ; return -1
|
MVN r0,#0 @ return -1
|
||||||
MOV r0,#0
|
|
||||||
LDMFD r13!,{r5,r6,r10,r11,PC}
|
LDMFD r13!,{r5,r6,r10,r11,PC}
|
||||||
|
|
||||||
look_overrun:
|
look_overrun:
|
||||||
|
|
@ -169,7 +134,7 @@ oggpack_adv:
|
||||||
ADDLE r12,r12,#32
|
ADDLE r12,r12,#32
|
||||||
ADDLE r3,r3,#4
|
ADDLE r3,r3,#4
|
||||||
STMIA r0,{r2,r3,r12}
|
STMIA r0,{r2,r3,r12}
|
||||||
BX LR
|
MOV PC,R14
|
||||||
adv_slow:
|
adv_slow:
|
||||||
STMFD r13!,{r10,r14}
|
STMFD r13!,{r10,r14}
|
||||||
|
|
||||||
|
|
@ -203,8 +168,6 @@ adv_slow_loop:
|
||||||
|
|
||||||
LDMFD r13!,{r10,PC}
|
LDMFD r13!,{r10,PC}
|
||||||
adv_end:
|
adv_end:
|
||||||
MOV r2, #0
|
|
||||||
MOV r12,#0
|
|
||||||
STMIA r0,{r2,r3,r12}
|
STMIA r0,{r2,r3,r12}
|
||||||
|
|
||||||
LDMFD r13!,{r10,PC}
|
LDMFD r13!,{r10,PC}
|
||||||
|
|
@ -227,7 +190,7 @@ oggpack_readinit:
|
||||||
RSB r3,r3,#32 @ r3 = BitsInWord
|
RSB r3,r3,#32 @ r3 = BitsInWord
|
||||||
STMIA r0,{r1,r2,r3}
|
STMIA r0,{r1,r2,r3}
|
||||||
STR r12,[r0,#20]
|
STR r12,[r0,#20]
|
||||||
BX LR
|
MOV PC,R14
|
||||||
|
|
||||||
oggpack_read:
|
oggpack_read:
|
||||||
@ r0 = oggpack_buffer *b
|
@ r0 = oggpack_buffer *b
|
||||||
|
|
@ -365,8 +328,7 @@ read_out_of_data:
|
||||||
RSBS r3,r3,#32 @ r3 = bitsLeftInWord
|
RSBS r3,r3,#32 @ r3 = bitsLeftInWord
|
||||||
MVN r1,#0 @ r1 = -1 = bitsLeftInSegment
|
MVN r1,#0 @ r1 = -1 = bitsLeftInSegment
|
||||||
STMIA r0,{r1,r2,r3}
|
STMIA r0,{r1,r2,r3}
|
||||||
@MVN r0,#0 ; return -1
|
MVN r0,#0 @ return -1
|
||||||
MOV r0,#0
|
|
||||||
LDMFD r13!,{r5,r6,r10,r11,PC}
|
LDMFD r13!,{r5,r6,r10,r11,PC}
|
||||||
|
|
||||||
read_overrun:
|
read_overrun:
|
||||||
|
|
@ -395,5 +357,3 @@ read_overrun_next_segment:
|
||||||
ADD r6,r10,r10,LSR #3 @ r6 = pointer to data
|
ADD r6,r10,r10,LSR #3 @ r6 = pointer to data
|
||||||
MOV r10,#0
|
MOV r10,#0
|
||||||
B read_slow_loop
|
B read_slow_loop
|
||||||
|
|
||||||
@ END
|
|
||||||
|
|
|
||||||
|
|
@ -1,52 +1,30 @@
|
||||||
/************************************************************************
|
/********************************************************************
|
||||||
* Copyright (C) 2002-2009, Xiph.org Foundation
|
* *
|
||||||
* Copyright (C) 2010, Robin Watts for Pinknoise Productions Ltd
|
* THIS FILE IS PART OF THE OggVorbis 'TREMOR' CODEC SOURCE CODE. *
|
||||||
* All rights reserved.
|
* *
|
||||||
*
|
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
|
||||||
* modification, are permitted provided that the following conditions
|
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
|
||||||
* are met:
|
* *
|
||||||
*
|
* THE OggVorbis 'TREMOR' SOURCE CODE IS (C) COPYRIGHT 1994-2002 *
|
||||||
* * Redistributions of source code must retain the above copyright
|
* BY THE Xiph.Org FOUNDATION http://www.xiph.org/ *
|
||||||
* 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 names of the Xiph.org Foundation nor Pinknoise
|
|
||||||
* Productions Ltd 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 COPYRIGHT
|
|
||||||
* OWNER 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.
|
|
||||||
************************************************************************
|
|
||||||
|
|
||||||
function: basic codebook pack/unpack/code/decode operations
|
function: basic codebook pack/unpack/code/decode operations
|
||||||
|
|
||||||
************************************************************************/
|
********************************************************************/
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
// #include <log/log.h>
|
|
||||||
#include "ogg.h"
|
#include "ogg.h"
|
||||||
#include "ivorbiscodec.h"
|
#include "ivorbiscodec.h"
|
||||||
#include "codebook.h"
|
#include "codebook.h"
|
||||||
#include "misc.h"
|
#include "misc.h"
|
||||||
#include "os.h"
|
#include "os.h"
|
||||||
|
|
||||||
#define MARKER_SIZE 33
|
|
||||||
|
|
||||||
/**** pack/unpack helpers ******************************************/
|
/**** pack/unpack helpers ******************************************/
|
||||||
int _ilog(unsigned int v){
|
int _ilog(unsigned int v){
|
||||||
|
|
@ -147,7 +125,7 @@ static int _make_words(char *l,long n,ogg_uint32_t *r,long quantvals,
|
||||||
codebook *b, oggpack_buffer *opb,int maptype){
|
codebook *b, oggpack_buffer *opb,int maptype){
|
||||||
long i,j,count=0;
|
long i,j,count=0;
|
||||||
long top=0;
|
long top=0;
|
||||||
ogg_uint32_t marker[MARKER_SIZE];
|
ogg_uint32_t marker[33];
|
||||||
|
|
||||||
if (n<1)
|
if (n<1)
|
||||||
return 1;
|
return 1;
|
||||||
|
|
@ -160,10 +138,6 @@ static int _make_words(char *l,long n,ogg_uint32_t *r,long quantvals,
|
||||||
for(i=0;i<n;i++){
|
for(i=0;i<n;i++){
|
||||||
long length=l[i];
|
long length=l[i];
|
||||||
if(length){
|
if(length){
|
||||||
if (length < 0 || length >= MARKER_SIZE) {
|
|
||||||
//cjh ALOGE("b/23881715");
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
ogg_uint32_t entry=marker[length];
|
ogg_uint32_t entry=marker[length];
|
||||||
long chase=0;
|
long chase=0;
|
||||||
if(count && !entry)return -1; /* overpopulated tree! */
|
if(count && !entry)return -1; /* overpopulated tree! */
|
||||||
|
|
@ -206,7 +180,7 @@ static int _make_words(char *l,long n,ogg_uint32_t *r,long quantvals,
|
||||||
/* prune the tree; the implicit invariant says all the longer
|
/* prune the tree; the implicit invariant says all the longer
|
||||||
markers were dangling from our just-taken node. Dangle them
|
markers were dangling from our just-taken node. Dangle them
|
||||||
from our *new* node. */
|
from our *new* node. */
|
||||||
for(j=length+1;j<MARKER_SIZE;j++)
|
for(j=length+1;j<33;j++)
|
||||||
if((marker[j]>>1) == entry){
|
if((marker[j]>>1) == entry){
|
||||||
entry=marker[j];
|
entry=marker[j];
|
||||||
marker[j]=marker[j-1]<<1;
|
marker[j]=marker[j-1]<<1;
|
||||||
|
|
@ -216,20 +190,6 @@ static int _make_words(char *l,long n,ogg_uint32_t *r,long quantvals,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// following sanity check copied from libvorbis
|
|
||||||
/* sanity check the huffman tree; an underpopulated tree must be
|
|
||||||
rejected. The only exception is the one-node pseudo-nil tree,
|
|
||||||
which appears to be underpopulated because the tree doesn't
|
|
||||||
really exist; there's only one possible 'codeword' or zero bits,
|
|
||||||
but the above tree-gen code doesn't mark that. */
|
|
||||||
if(b->used_entries != 1){
|
|
||||||
for(i=1;i<MARKER_SIZE;i++)
|
|
||||||
if(marker[i] & (0xffffffffUL>>(32-i))){
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -259,14 +219,13 @@ static int _make_decode_table(codebook *s,char *lengthlist,long quantvals,
|
||||||
if (s->used_entries > INT_MAX/2 ||
|
if (s->used_entries > INT_MAX/2 ||
|
||||||
s->used_entries*2 > INT_MAX/((long) sizeof(*work)) - 1) return 1;
|
s->used_entries*2 > INT_MAX/((long) sizeof(*work)) - 1) return 1;
|
||||||
/* Overallocate as above */
|
/* Overallocate as above */
|
||||||
work=calloc((s->entries*2+1),sizeof(*work));
|
work=alloca((s->entries*2+1)*sizeof(*work));
|
||||||
if (!work) return 1;
|
if(_make_words(lengthlist,s->entries,work,quantvals,s,opb,maptype))return 1;
|
||||||
if(_make_words(lengthlist,s->entries,work,quantvals,s,opb,maptype)) goto error_out;
|
if (s->used_entries > INT_MAX/(s->dec_leafw+1)) return 1;
|
||||||
if (s->used_entries > INT_MAX/(s->dec_leafw+1)) goto error_out;
|
if (s->dec_nodeb && s->used_entries * (s->dec_leafw+1) > INT_MAX/s->dec_nodeb) return 1;
|
||||||
if (s->dec_nodeb && s->used_entries * (s->dec_leafw+1) > INT_MAX/s->dec_nodeb) goto error_out;
|
|
||||||
s->dec_table=_ogg_malloc((s->used_entries*(s->dec_leafw+1)-2)*
|
s->dec_table=_ogg_malloc((s->used_entries*(s->dec_leafw+1)-2)*
|
||||||
s->dec_nodeb);
|
s->dec_nodeb);
|
||||||
if (!s->dec_table) goto error_out;
|
if (!s->dec_table) return 1;
|
||||||
|
|
||||||
if(s->dec_leafw==1){
|
if(s->dec_leafw==1){
|
||||||
switch(s->dec_nodeb){
|
switch(s->dec_nodeb){
|
||||||
|
|
@ -350,11 +309,7 @@ static int _make_decode_table(codebook *s,char *lengthlist,long quantvals,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
free(work);
|
|
||||||
return 0;
|
return 0;
|
||||||
error_out:
|
|
||||||
free(work);
|
|
||||||
return 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* most of the time, entries%dimensions == 0, but we need to be
|
/* most of the time, entries%dimensions == 0, but we need to be
|
||||||
|
|
@ -428,7 +383,7 @@ int vorbis_book_unpack(oggpack_buffer *opb,codebook *s){
|
||||||
switch((int)oggpack_read(opb,1)){
|
switch((int)oggpack_read(opb,1)){
|
||||||
case 0:
|
case 0:
|
||||||
/* unordered */
|
/* unordered */
|
||||||
lengthlist=(char *)calloc(s->entries, sizeof(*lengthlist));
|
lengthlist=(char *)alloca(sizeof(*lengthlist)*s->entries);
|
||||||
if(!lengthlist) goto _eofout;
|
if(!lengthlist) goto _eofout;
|
||||||
|
|
||||||
/* allocated but unused entries? */
|
/* allocated but unused entries? */
|
||||||
|
|
@ -463,7 +418,7 @@ int vorbis_book_unpack(oggpack_buffer *opb,codebook *s){
|
||||||
long length=oggpack_read(opb,5)+1;
|
long length=oggpack_read(opb,5)+1;
|
||||||
|
|
||||||
s->used_entries=s->entries;
|
s->used_entries=s->entries;
|
||||||
lengthlist=(char *)calloc(s->entries, sizeof(*lengthlist));
|
lengthlist=(char *)alloca(sizeof(*lengthlist)*s->entries);
|
||||||
if (!lengthlist) goto _eofout;
|
if (!lengthlist) goto _eofout;
|
||||||
|
|
||||||
for(i=0;i<s->entries;){
|
for(i=0;i<s->entries;){
|
||||||
|
|
@ -527,12 +482,13 @@ int vorbis_book_unpack(oggpack_buffer *opb,codebook *s){
|
||||||
/* use dec_type 1: vector of packed values */
|
/* use dec_type 1: vector of packed values */
|
||||||
|
|
||||||
/* need quantized values before */
|
/* need quantized values before */
|
||||||
s->q_val=calloc(sizeof(ogg_uint16_t), quantvals);
|
s->q_val=alloca(sizeof(ogg_uint16_t)*quantvals);
|
||||||
if (!s->q_val) goto _eofout;
|
if (!s->q_val) goto _eofout;
|
||||||
for(i=0;i<quantvals;i++)
|
for(i=0;i<quantvals;i++)
|
||||||
((ogg_uint16_t *)s->q_val)[i]=(ogg_uint16_t)oggpack_read(opb,s->q_bits);
|
((ogg_uint16_t *)s->q_val)[i]=(ogg_uint16_t)oggpack_read(opb,s->q_bits);
|
||||||
|
|
||||||
if(oggpack_eop(opb)){
|
if(oggpack_eop(opb)){
|
||||||
|
s->q_val=0; /* cleanup must not free alloca memory */
|
||||||
goto _eofout;
|
goto _eofout;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -542,11 +498,12 @@ int vorbis_book_unpack(oggpack_buffer *opb,codebook *s){
|
||||||
s->dec_leafw=_determine_leaf_words(s->dec_nodeb,
|
s->dec_leafw=_determine_leaf_words(s->dec_nodeb,
|
||||||
(s->q_bits*s->dim+8)/8);
|
(s->q_bits*s->dim+8)/8);
|
||||||
if(_make_decode_table(s,lengthlist,quantvals,opb,maptype)){
|
if(_make_decode_table(s,lengthlist,quantvals,opb,maptype)){
|
||||||
|
s->q_val=0; /* cleanup must not free alloca memory */
|
||||||
goto _errout;
|
goto _errout;
|
||||||
}
|
}
|
||||||
|
|
||||||
free(s->q_val);
|
s->q_val=0; /* about to go out of scope; _make_decode_table
|
||||||
s->q_val=0;
|
was using it */
|
||||||
|
|
||||||
}else{
|
}else{
|
||||||
/* use dec_type 2: packed vector of column offsets */
|
/* use dec_type 2: packed vector of column offsets */
|
||||||
|
|
@ -631,13 +588,10 @@ int vorbis_book_unpack(oggpack_buffer *opb,codebook *s){
|
||||||
|
|
||||||
if(oggpack_eop(opb))goto _eofout;
|
if(oggpack_eop(opb))goto _eofout;
|
||||||
|
|
||||||
free(lengthlist);
|
|
||||||
return 0;
|
return 0;
|
||||||
_errout:
|
_errout:
|
||||||
_eofout:
|
_eofout:
|
||||||
vorbis_book_clear(s);
|
vorbis_book_clear(s);
|
||||||
free(lengthlist);
|
|
||||||
free(s->q_val);
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -786,7 +740,7 @@ static int decode_map(codebook *s, oggpack_buffer *b, ogg_int32_t *v, int point)
|
||||||
}
|
}
|
||||||
case 3:{
|
case 3:{
|
||||||
/* offset into array */
|
/* offset into array */
|
||||||
void *ptr=((char *)s->q_val)+entry*s->q_pack;
|
void *ptr=s->q_val+entry*s->q_pack;
|
||||||
|
|
||||||
if(s->q_bits<=8){
|
if(s->q_bits<=8){
|
||||||
for(i=0;i<s->dim;i++)
|
for(i=0;i<s->dim;i++)
|
||||||
|
|
|
||||||
|
|
@ -1,39 +1,19 @@
|
||||||
/************************************************************************
|
/********************************************************************
|
||||||
* Copyright (C) 2002-2009, Xiph.org Foundation
|
* *
|
||||||
* Copyright (C) 2010, Robin Watts for Pinknoise Productions Ltd
|
* THIS FILE IS PART OF THE OggVorbis 'TREMOR' CODEC SOURCE CODE. *
|
||||||
* All rights reserved.
|
* *
|
||||||
*
|
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
|
||||||
* modification, are permitted provided that the following conditions
|
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
|
||||||
* are met:
|
* *
|
||||||
*
|
* THE OggVorbis 'TREMOR' SOURCE CODE IS (C) COPYRIGHT 1994-2002 *
|
||||||
* * Redistributions of source code must retain the above copyright
|
* BY THE Xiph.Org FOUNDATION http://www.xiph.org/ *
|
||||||
* 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 names of the Xiph.org Foundation nor Pinknoise
|
|
||||||
* Productions Ltd 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 COPYRIGHT
|
|
||||||
* OWNER 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.
|
|
||||||
************************************************************************
|
|
||||||
|
|
||||||
function: basic shared codebook operations
|
function: basic shared codebook operations
|
||||||
|
|
||||||
************************************************************************/
|
********************************************************************/
|
||||||
|
|
||||||
#ifndef _V_CODEBOOK_H_
|
#ifndef _V_CODEBOOK_H_
|
||||||
#define _V_CODEBOOK_H_
|
#define _V_CODEBOOK_H_
|
||||||
|
|
|
||||||
|
|
@ -1,39 +1,19 @@
|
||||||
/************************************************************************
|
/********************************************************************
|
||||||
* Copyright (C) 2002-2009, Xiph.org Foundation
|
* *
|
||||||
* Copyright (C) 2010, Robin Watts for Pinknoise Productions Ltd
|
* THIS FILE IS PART OF THE OggVorbis 'TREMOR' CODEC SOURCE CODE. *
|
||||||
* All rights reserved.
|
* *
|
||||||
*
|
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
|
||||||
* modification, are permitted provided that the following conditions
|
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
|
||||||
* are met:
|
* *
|
||||||
*
|
* THE OggVorbis 'TREMOR' SOURCE CODE IS (C) COPYRIGHT 1994-2003 *
|
||||||
* * Redistributions of source code must retain the above copyright
|
* BY THE Xiph.Org FOUNDATION http://www.xiph.org/ *
|
||||||
* 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 names of the Xiph.org Foundation nor Pinknoise
|
|
||||||
* Productions Ltd 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 COPYRIGHT
|
|
||||||
* OWNER 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.
|
|
||||||
************************************************************************
|
|
||||||
|
|
||||||
function: libvorbis codec headers
|
function: libvorbis codec headers
|
||||||
|
|
||||||
************************************************************************/
|
********************************************************************/
|
||||||
|
|
||||||
#ifndef _V_CODECI_H_
|
#ifndef _V_CODECI_H_
|
||||||
#define _V_CODECI_H_
|
#define _V_CODECI_H_
|
||||||
|
|
@ -110,19 +90,19 @@ typedef struct{
|
||||||
char class_subs; /* 0,1,2,3 (bits: 1<<n poss) */
|
char class_subs; /* 0,1,2,3 (bits: 1<<n poss) */
|
||||||
unsigned char class_book; /* subs ^ dim entries */
|
unsigned char class_book; /* subs ^ dim entries */
|
||||||
unsigned char class_subbook[8]; /* [VIF_CLASS][subs] */
|
unsigned char class_subbook[8]; /* [VIF_CLASS][subs] */
|
||||||
} floor1class;
|
} floor1class;
|
||||||
|
|
||||||
typedef struct{
|
typedef struct{
|
||||||
floor1class *klass; /* [VIF_CLASS] */
|
floor1class *class; /* [VIF_CLASS] */
|
||||||
ogg_uint8_t *partitionclass; /* [VIF_PARTS]; 0 to 15 */
|
char *partitionclass; /* [VIF_PARTS]; 0 to 15 */
|
||||||
ogg_uint16_t *postlist; /* [VIF_POSIT+2]; first two implicit */
|
ogg_uint16_t *postlist; /* [VIF_POSIT+2]; first two implicit */
|
||||||
ogg_uint8_t *forward_index; /* [VIF_POSIT+2]; */
|
char *forward_index; /* [VIF_POSIT+2]; */
|
||||||
ogg_uint8_t *hineighbor; /* [VIF_POSIT]; */
|
char *hineighbor; /* [VIF_POSIT]; */
|
||||||
ogg_uint8_t *loneighbor; /* [VIF_POSIT]; */
|
char *loneighbor; /* [VIF_POSIT]; */
|
||||||
|
|
||||||
int partitions; /* 0 to 31 */
|
int partitions; /* 0 to 31 */
|
||||||
int posts;
|
int posts;
|
||||||
int mult; /* 1 2 3 or 4 */
|
int mult; /* 1 2 3 or 4 */
|
||||||
|
|
||||||
} vorbis_info_floor1;
|
} vorbis_info_floor1;
|
||||||
|
|
||||||
|
|
@ -168,8 +148,8 @@ typedef struct submap{
|
||||||
} submap;
|
} submap;
|
||||||
|
|
||||||
typedef struct vorbis_info_mapping{
|
typedef struct vorbis_info_mapping{
|
||||||
int submaps;
|
int submaps;
|
||||||
|
|
||||||
unsigned char *chmuxlist;
|
unsigned char *chmuxlist;
|
||||||
submap *submaplist;
|
submap *submaplist;
|
||||||
|
|
||||||
|
|
@ -185,7 +165,7 @@ extern int mapping_inverse(struct vorbis_dsp_state *,vorbis_info_mapping *);
|
||||||
/* codec_setup_info contains all the setup information specific to the
|
/* codec_setup_info contains all the setup information specific to the
|
||||||
specific compression/decompression mode in progress (eg,
|
specific compression/decompression mode in progress (eg,
|
||||||
psychoacoustic settings, channel setup, options, codebook
|
psychoacoustic settings, channel setup, options, codebook
|
||||||
etc).
|
etc).
|
||||||
*********************************************************************/
|
*********************************************************************/
|
||||||
|
|
||||||
typedef struct codec_setup_info {
|
typedef struct codec_setup_info {
|
||||||
|
|
@ -215,8 +195,6 @@ typedef struct codec_setup_info {
|
||||||
|
|
||||||
} codec_setup_info;
|
} codec_setup_info;
|
||||||
|
|
||||||
extern int vorbis_dsp_init(vorbis_dsp_state *v, vorbis_info *vi);
|
|
||||||
extern void vorbis_dsp_clear(vorbis_dsp_state *v);
|
|
||||||
extern vorbis_dsp_state *vorbis_dsp_create(vorbis_info *vi);
|
extern vorbis_dsp_state *vorbis_dsp_create(vorbis_info *vi);
|
||||||
extern void vorbis_dsp_destroy(vorbis_dsp_state *v);
|
extern void vorbis_dsp_destroy(vorbis_dsp_state *v);
|
||||||
extern int vorbis_dsp_headerin(vorbis_info *vi,vorbis_comment *vc,
|
extern int vorbis_dsp_headerin(vorbis_info *vi,vorbis_comment *vc,
|
||||||
|
|
|
||||||
|
|
@ -1,39 +1,19 @@
|
||||||
/************************************************************************
|
/********************************************************************
|
||||||
* Copyright (C) 2002-2009, Xiph.org Foundation
|
* *
|
||||||
* Copyright (C) 2010, Robin Watts for Pinknoise Productions Ltd
|
* THIS FILE IS PART OF THE OggVorbis 'TREMOR' CODEC SOURCE CODE. *
|
||||||
* All rights reserved.
|
* *
|
||||||
*
|
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
|
||||||
* modification, are permitted provided that the following conditions
|
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
|
||||||
* are met:
|
* *
|
||||||
*
|
* THE OggVorbis 'TREMOR' SOURCE CODE IS (C) COPYRIGHT 1994-2002 *
|
||||||
* * Redistributions of source code must retain the above copyright
|
* BY THE Xiph.Org FOUNDATION http://www.xiph.org/ *
|
||||||
* 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 names of the Xiph.org Foundation nor Pinknoise
|
|
||||||
* Productions Ltd 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 COPYRIGHT
|
|
||||||
* OWNER 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.
|
|
||||||
************************************************************************
|
|
||||||
|
|
||||||
function: #ifdef jail to whip a few platforms into the UNIX ideal.
|
function: #ifdef jail to whip a few platforms into the UNIX ideal.
|
||||||
|
|
||||||
************************************************************************/
|
********************************************************************/
|
||||||
#ifndef _OS_CVTYPES_H
|
#ifndef _OS_CVTYPES_H
|
||||||
#define _OS_CVTYPES_H
|
#define _OS_CVTYPES_H
|
||||||
|
|
||||||
|
|
@ -42,6 +22,5 @@ typedef int ogg_int32_t;
|
||||||
typedef unsigned int ogg_uint32_t;
|
typedef unsigned int ogg_uint32_t;
|
||||||
typedef short ogg_int16_t;
|
typedef short ogg_int16_t;
|
||||||
typedef unsigned short ogg_uint16_t;
|
typedef unsigned short ogg_uint16_t;
|
||||||
typedef unsigned char ogg_uint8_t;
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -1,38 +1,4 @@
|
||||||
@ Tremolo library
|
.text
|
||||||
@-----------------------------------------------------------------------
|
|
||||||
@ Copyright (C) 2002-2009, Xiph.org Foundation
|
|
||||||
@ Copyright (C) 2010, Robin Watts for Pinknoise Productions Ltd
|
|
||||||
@ All rights reserved.
|
|
||||||
|
|
||||||
@ 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 names of the Xiph.org Foundation nor Pinknoise
|
|
||||||
@ Productions Ltd 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 COPYRIGHT
|
|
||||||
@ OWNER 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.
|
|
||||||
@ ----------------------------------------------------------------------
|
|
||||||
|
|
||||||
.text
|
|
||||||
|
|
||||||
.global decode_packed_entry_number
|
.global decode_packed_entry_number
|
||||||
.global decode_packed_entry_number_REALSTART
|
.global decode_packed_entry_number_REALSTART
|
||||||
|
|
@ -40,12 +6,6 @@
|
||||||
.global vorbis_book_decodevv_add
|
.global vorbis_book_decodevv_add
|
||||||
.global _checksum
|
.global _checksum
|
||||||
|
|
||||||
.extern oggpack_adv
|
|
||||||
.extern oggpack_look
|
|
||||||
.extern oggpack_eop
|
|
||||||
.extern crc_lookup
|
|
||||||
.hidden crc_lookup
|
|
||||||
|
|
||||||
decode_packed_entry_number_REALSTART:
|
decode_packed_entry_number_REALSTART:
|
||||||
dpen_nobits:
|
dpen_nobits:
|
||||||
MOV r0,r5 @ r0 = b
|
MOV r0,r5 @ r0 = b
|
||||||
|
|
@ -140,7 +100,7 @@ m1_loop:
|
||||||
LDRNEB r14,[r6, r7] @ r14= t[chase]
|
LDRNEB r14,[r6, r7] @ r14= t[chase]
|
||||||
MOVEQ r14,#128
|
MOVEQ r14,#128
|
||||||
ADC r12,r8, r6 @ r12= chase+bit+1+t
|
ADC r12,r8, r6 @ r12= chase+bit+1+t
|
||||||
LDRB r14,[r12,r14,LSR #7] @ r14= t[chase+bit+1+(!bit || t[chase]0x0x80)]
|
LDRB r14,[r12,r14,LSR #7] @ r14= t[chase+bit+1+(!bit || t[chase]&0x80)]
|
||||||
BIC r10,r10,#0x80 @ r3 = next &= ~0x80
|
BIC r10,r10,#0x80 @ r3 = next &= ~0x80
|
||||||
@ stall Xscale
|
@ stall Xscale
|
||||||
ORR r0, r14,r10,LSL #8 @ r7 = chase = (next<<8) | r14
|
ORR r0, r14,r10,LSL #8 @ r7 = chase = (next<<8) | r14
|
||||||
|
|
@ -198,8 +158,8 @@ m3_loop:
|
||||||
CMP r8, r7 @ if bit==0 (chase+bit==chase) sets C
|
CMP r8, r7 @ if bit==0 (chase+bit==chase) sets C
|
||||||
LDRNEH r14,[r6, r7] @ r14= t[chase]
|
LDRNEH r14,[r6, r7] @ r14= t[chase]
|
||||||
MOVEQ r14,#0x8000
|
MOVEQ r14,#0x8000
|
||||||
ADC r12,r8, r14,LSR #15 @ r12= 1+((chase+bit)<<1)+(!bit || t[chase]0x0x8000)
|
ADC r12,r8, r14,LSR #15 @ r12= 1+((chase+bit)<<1)+(!bit || t[chase]&0x8000)
|
||||||
ADC r12,r12,r14,LSR #15 @ r12= t + (1+chase+bit+(!bit || t[chase]0x0x8000))<<1
|
ADC r12,r12,r14,LSR #15 @ r12= t + (1+chase+bit+(!bit || t[chase]&0x8000))<<1
|
||||||
LDRH r14,[r6, r12] @ r14= t[chase+bit+1
|
LDRH r14,[r6, r12] @ r14= t[chase+bit+1
|
||||||
BIC r10,r10,#0x8000 @ r3 = next &= ~0x8000
|
BIC r10,r10,#0x8000 @ r3 = next &= ~0x8000
|
||||||
@ stall Xscale
|
@ stall Xscale
|
||||||
|
|
@ -213,7 +173,7 @@ meth4:
|
||||||
m4_loop:
|
m4_loop:
|
||||||
MOVS r0, r0, LSR #1 @ r0 = lok>>1 C = bottom bit
|
MOVS r0, r0, LSR #1 @ r0 = lok>>1 C = bottom bit
|
||||||
ADC r2, r7, r7 @ r8 = chase*2+C
|
ADC r2, r7, r7 @ r8 = chase*2+C
|
||||||
LDR r7, [r6, r2, LSL #2]
|
LDR r7, [r6, r2, LSL#2]
|
||||||
ADDS r1, r1, #1 @ r1 = i-read++ (i-read<0 => i<read)
|
ADDS r1, r1, #1 @ r1 = i-read++ (i-read<0 => i<read)
|
||||||
@ stall Xscale
|
@ stall Xscale
|
||||||
CMPLT r7, #0x80000000
|
CMPLT r7, #0x80000000
|
||||||
|
|
@ -405,9 +365,9 @@ vorbis_book_decodevv_add:
|
||||||
STMFD r13!,{r4-r11,R14}
|
STMFD r13!,{r4-r11,R14}
|
||||||
LDR r7, [r0, #13*4] @ r7 = used_entries
|
LDR r7, [r0, #13*4] @ r7 = used_entries
|
||||||
MOV r9, r0 @ r9 = book
|
MOV r9, r0 @ r9 = book
|
||||||
MOV r10,r1 @ r10= 0xa[chptr] chptr=0
|
MOV r10,r1 @ r10= &a[chptr] chptr=0
|
||||||
MOV r6, r3 @ r6 = ch
|
MOV r6, r3 @ r6 = ch
|
||||||
ADD r8, r10,r3, LSL #2 @ r8 = 0xa[ch]
|
ADD r8, r10,r3, LSL #2 @ r8 = &a[ch]
|
||||||
MOV r11,r2 @ r11= offset
|
MOV r11,r2 @ r11= offset
|
||||||
CMP r7, #0 @ if (used_entries <= 0)
|
CMP r7, #0 @ if (used_entries <= 0)
|
||||||
BLE vbdvva_exit @ exit
|
BLE vbdvva_exit @ exit
|
||||||
|
|
@ -415,9 +375,9 @@ vorbis_book_decodevv_add:
|
||||||
vbdvva_loop1:
|
vbdvva_loop1:
|
||||||
@ r5 = n
|
@ r5 = n
|
||||||
@ r6 = ch
|
@ r6 = ch
|
||||||
@ r8 = 0xa[ch]
|
@ r8 = &a[ch]
|
||||||
@ r9 = book
|
@ r9 = book
|
||||||
@ r10= 0xa[chptr]
|
@ r10= &a[chptr]
|
||||||
@ r11= offset
|
@ r11= offset
|
||||||
MOV r0, r9 @ r0 = book
|
MOV r0, r9 @ r0 = book
|
||||||
LDR r1, [r13,# 9*4] @ r1 = b
|
LDR r1, [r13,# 9*4] @ r1 = b
|
||||||
|
|
@ -434,7 +394,7 @@ vbdvva_loop2:
|
||||||
LDR r12,[r1], #4 @ r1 = v[j++]
|
LDR r12,[r1], #4 @ r1 = v[j++]
|
||||||
CMP r10,r8 @ if (chptr == ch)
|
CMP r10,r8 @ if (chptr == ch)
|
||||||
SUBEQ r10,r10,r6, LSL #2 @ chptr = 0
|
SUBEQ r10,r10,r6, LSL #2 @ chptr = 0
|
||||||
LDR r14,[r2, r11,LSL #2]! @ r2 = 0xa[chptr++][i] r14=[r12]
|
LDR r14,[r2, r11,LSL #2]! @ r2 = &a[chptr++][i] r14=[r12]
|
||||||
ADDEQ r11,r11,#1 @ i++
|
ADDEQ r11,r11,#1 @ i++
|
||||||
SUBEQ r5, r5, #1 @ n--
|
SUBEQ r5, r5, #1 @ n--
|
||||||
SUBS r0, r0, #1 @ r0--
|
SUBS r0, r0, #1 @ r0--
|
||||||
|
|
@ -455,9 +415,7 @@ _checksum:
|
||||||
@ r1 = bytes
|
@ r1 = bytes
|
||||||
STMFD r13!,{r5-r6,r14}
|
STMFD r13!,{r5-r6,r14}
|
||||||
|
|
||||||
ADR r6,.Lcrc_lookup
|
LDR r5,=crc_lookup
|
||||||
LDR r5,[r6]
|
|
||||||
ADD r5,r6
|
|
||||||
MOV r14,#0 @ r14= crc_reg = 0
|
MOV r14,#0 @ r14= crc_reg = 0
|
||||||
MOVS r12,r0
|
MOVS r12,r0
|
||||||
BEQ _cs_end
|
BEQ _cs_end
|
||||||
|
|
@ -489,8 +447,3 @@ _cs_no_bytes:
|
||||||
_cs_end:
|
_cs_end:
|
||||||
MOV r0,r14
|
MOV r0,r14
|
||||||
LDMFD r13!,{r5-r6,PC}
|
LDMFD r13!,{r5-r6,PC}
|
||||||
|
|
||||||
.Lcrc_lookup:
|
|
||||||
.WORD crc_lookup-.Lcrc_lookup
|
|
||||||
|
|
||||||
@ END
|
|
||||||
|
|
|
||||||
|
|
@ -1,41 +1,21 @@
|
||||||
/************************************************************************
|
/********************************************************************
|
||||||
* Copyright (C) 2002-2009, Xiph.org Foundation
|
* *
|
||||||
* Copyright (C) 2010, Robin Watts for Pinknoise Productions Ltd
|
* THIS FILE IS PART OF THE OggVorbis 'TREMOR' CODEC SOURCE CODE. *
|
||||||
* All rights reserved.
|
* *
|
||||||
*
|
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
|
||||||
* modification, are permitted provided that the following conditions
|
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
|
||||||
* are met:
|
* *
|
||||||
*
|
* THE OggVorbis 'TREMOR' SOURCE CODE IS (C) COPYRIGHT 1994-2003 *
|
||||||
* * Redistributions of source code must retain the above copyright
|
* BY THE Xiph.Org FOUNDATION http://www.xiph.org/ *
|
||||||
* 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 names of the Xiph.org Foundation nor Pinknoise
|
|
||||||
* Productions Ltd 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 COPYRIGHT
|
|
||||||
* OWNER 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.
|
|
||||||
************************************************************************
|
|
||||||
|
|
||||||
function: PCM data vector blocking, windowing and dis/reassembly
|
function: PCM data vector blocking, windowing and dis/reassembly
|
||||||
|
|
||||||
************************************************************************/
|
********************************************************************/
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include "ogg.h"
|
#include "ogg.h"
|
||||||
#include "mdct.h"
|
#include "mdct.h"
|
||||||
#include "ivorbiscodec.h"
|
#include "ivorbiscodec.h"
|
||||||
|
|
@ -48,11 +28,11 @@ int vorbis_dsp_restart(vorbis_dsp_state *v){
|
||||||
{
|
{
|
||||||
vorbis_info *vi=v->vi;
|
vorbis_info *vi=v->vi;
|
||||||
codec_setup_info *ci;
|
codec_setup_info *ci;
|
||||||
|
|
||||||
if(!vi)return -1;
|
if(!vi)return -1;
|
||||||
ci=vi->codec_setup;
|
ci=vi->codec_setup;
|
||||||
if(!ci)return -1;
|
if(!ci)return -1;
|
||||||
|
|
||||||
v->out_end=-1;
|
v->out_end=-1;
|
||||||
v->out_begin=-1;
|
v->out_begin=-1;
|
||||||
|
|
||||||
|
|
@ -63,13 +43,14 @@ int vorbis_dsp_restart(vorbis_dsp_state *v){
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int vorbis_dsp_init(vorbis_dsp_state *v,vorbis_info *vi){
|
vorbis_dsp_state *vorbis_dsp_create(vorbis_info *vi){
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
vorbis_dsp_state *v=_ogg_calloc(1,sizeof(*v));
|
||||||
codec_setup_info *ci=(codec_setup_info *)vi->codec_setup;
|
codec_setup_info *ci=(codec_setup_info *)vi->codec_setup;
|
||||||
|
|
||||||
v->vi=vi;
|
v->vi=vi;
|
||||||
|
|
||||||
v->work=(ogg_int32_t **)_ogg_malloc(vi->channels*sizeof(*v->work));
|
v->work=(ogg_int32_t **)_ogg_malloc(vi->channels*sizeof(*v->work));
|
||||||
v->mdctright=(ogg_int32_t **)_ogg_malloc(vi->channels*sizeof(*v->mdctright));
|
v->mdctright=(ogg_int32_t **)_ogg_malloc(vi->channels*sizeof(*v->mdctright));
|
||||||
for(i=0;i<vi->channels;i++){
|
for(i=0;i<vi->channels;i++){
|
||||||
|
|
@ -83,16 +64,10 @@ int vorbis_dsp_init(vorbis_dsp_state *v,vorbis_info *vi){
|
||||||
v->W=0; /* current window size */
|
v->W=0; /* current window size */
|
||||||
|
|
||||||
vorbis_dsp_restart(v);
|
vorbis_dsp_restart(v);
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
vorbis_dsp_state *vorbis_dsp_create(vorbis_info *vi){
|
|
||||||
vorbis_dsp_state *v=_ogg_calloc(1,sizeof(*v));
|
|
||||||
vorbis_dsp_init(v,vi);
|
|
||||||
return v;
|
return v;
|
||||||
}
|
}
|
||||||
|
|
||||||
void vorbis_dsp_clear(vorbis_dsp_state *v){
|
void vorbis_dsp_destroy(vorbis_dsp_state *v){
|
||||||
int i;
|
int i;
|
||||||
if(v){
|
if(v){
|
||||||
vorbis_info *vi=v->vi;
|
vorbis_info *vi=v->vi;
|
||||||
|
|
@ -107,12 +82,9 @@ void vorbis_dsp_clear(vorbis_dsp_state *v){
|
||||||
if(v->mdctright[i])_ogg_free(v->mdctright[i]);
|
if(v->mdctright[i])_ogg_free(v->mdctright[i]);
|
||||||
_ogg_free(v->mdctright);
|
_ogg_free(v->mdctright);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void vorbis_dsp_destroy(vorbis_dsp_state *v){
|
_ogg_free(v);
|
||||||
vorbis_dsp_clear(v);
|
}
|
||||||
_ogg_free(v);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static LOOKUP_T *_vorbis_window(int left){
|
static LOOKUP_T *_vorbis_window(int left){
|
||||||
|
|
@ -174,7 +146,7 @@ long vorbis_packet_blocksize(vorbis_info *vi,ogg_packet *op){
|
||||||
int mode;
|
int mode;
|
||||||
int modebits=0;
|
int modebits=0;
|
||||||
int v=ci->modes;
|
int v=ci->modes;
|
||||||
|
|
||||||
oggpack_readinit(&opb,op->packet);
|
oggpack_readinit(&opb,op->packet);
|
||||||
|
|
||||||
/* Check the packet type */
|
/* Check the packet type */
|
||||||
|
|
@ -227,14 +199,14 @@ int vorbis_dsp_synthesis(vorbis_dsp_state *vd,ogg_packet *op,int decodep){
|
||||||
vd->W=ci->mode_param[mode].blockflag;
|
vd->W=ci->mode_param[mode].blockflag;
|
||||||
for(i=0;i<vi->channels;i++)
|
for(i=0;i<vi->channels;i++)
|
||||||
mdct_shift_right(ci->blocksizes[vd->lW],vd->work[i],vd->mdctright[i]);
|
mdct_shift_right(ci->blocksizes[vd->lW],vd->work[i],vd->mdctright[i]);
|
||||||
|
|
||||||
if(vd->W){
|
if(vd->W){
|
||||||
int temp;
|
int temp;
|
||||||
oggpack_read(&vd->opb,1);
|
oggpack_read(&vd->opb,1);
|
||||||
temp=oggpack_read(&vd->opb,1);
|
temp=oggpack_read(&vd->opb,1);
|
||||||
if(temp==-1) return OV_EBADPACKET;
|
if(temp==-1) return OV_EBADPACKET;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* packet decode and portions of synthesis that rely on only this block */
|
/* packet decode and portions of synthesis that rely on only this block */
|
||||||
if(decodep){
|
if(decodep){
|
||||||
mapping_inverse(vd,ci->map_param+ci->mode_param[mode].mapping);
|
mapping_inverse(vd,ci->map_param+ci->mode_param[mode].mapping);
|
||||||
|
|
@ -250,36 +222,36 @@ int vorbis_dsp_synthesis(vorbis_dsp_state *vd,ogg_packet *op,int decodep){
|
||||||
|
|
||||||
/* track the frame number... This is for convenience, but also
|
/* track the frame number... This is for convenience, but also
|
||||||
making sure our last packet doesn't end with added padding.
|
making sure our last packet doesn't end with added padding.
|
||||||
|
|
||||||
This is not foolproof! It will be confused if we begin
|
This is not foolproof! It will be confused if we begin
|
||||||
decoding at the last page after a seek or hole. In that case,
|
decoding at the last page after a seek or hole. In that case,
|
||||||
we don't have a starting point to judge where the last frame
|
we don't have a starting point to judge where the last frame
|
||||||
is. For this reason, vorbisfile will always try to make sure
|
is. For this reason, vorbisfile will always try to make sure
|
||||||
it reads the last two marked pages in proper sequence */
|
it reads the last two marked pages in proper sequence */
|
||||||
|
|
||||||
/* if we're out of sequence, dump granpos tracking until we sync back up */
|
/* if we're out of sequence, dump granpos tracking until we sync back up */
|
||||||
if(vd->sequence==-1 || vd->sequence+1 != op->packetno-3){
|
if(vd->sequence==-1 || vd->sequence+1 != op->packetno-3){
|
||||||
/* out of sequence; lose count */
|
/* out of sequence; lose count */
|
||||||
vd->granulepos=-1;
|
vd->granulepos=-1;
|
||||||
vd->sample_count=-1;
|
vd->sample_count=-1;
|
||||||
}
|
}
|
||||||
|
|
||||||
vd->sequence=op->packetno;
|
vd->sequence=op->packetno;
|
||||||
vd->sequence=vd->sequence-3;
|
vd->sequence=vd->sequence-3;
|
||||||
|
|
||||||
if(vd->sample_count==-1){
|
if(vd->sample_count==-1){
|
||||||
vd->sample_count=0;
|
vd->sample_count=0;
|
||||||
}else{
|
}else{
|
||||||
vd->sample_count+=
|
vd->sample_count+=
|
||||||
ci->blocksizes[vd->lW]/4+ci->blocksizes[vd->W]/4;
|
ci->blocksizes[vd->lW]/4+ci->blocksizes[vd->W]/4;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(vd->granulepos==-1){
|
if(vd->granulepos==-1){
|
||||||
if(op->granulepos!=-1){ /* only set if we have a
|
if(op->granulepos!=-1){ /* only set if we have a
|
||||||
position to set to */
|
position to set to */
|
||||||
|
|
||||||
vd->granulepos=op->granulepos;
|
vd->granulepos=op->granulepos;
|
||||||
|
|
||||||
/* is this a short page? */
|
/* is this a short page? */
|
||||||
if(vd->sample_count>vd->granulepos){
|
if(vd->sample_count>vd->granulepos){
|
||||||
/* corner case; if this is both the first and last audio page,
|
/* corner case; if this is both the first and last audio page,
|
||||||
|
|
@ -290,26 +262,26 @@ int vorbis_dsp_synthesis(vorbis_dsp_state *vd,ogg_packet *op,int decodep){
|
||||||
have to in a short single-page stream) */
|
have to in a short single-page stream) */
|
||||||
/* granulepos could be -1 due to a seek, but that would result
|
/* granulepos could be -1 due to a seek, but that would result
|
||||||
in a long coun t, not short count */
|
in a long coun t, not short count */
|
||||||
|
|
||||||
vd->out_end-=(int)(vd->sample_count-vd->granulepos);
|
vd->out_end-=vd->sample_count-vd->granulepos;
|
||||||
}else{
|
}else{
|
||||||
/* trim the beginning */
|
/* trim the beginning */
|
||||||
vd->out_begin+=(int)(vd->sample_count-vd->granulepos);
|
vd->out_begin+=vd->sample_count-vd->granulepos;
|
||||||
if(vd->out_begin>vd->out_end)
|
if(vd->out_begin>vd->out_end)
|
||||||
vd->out_begin=vd->out_end;
|
vd->out_begin=vd->out_end;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
vd->granulepos+=
|
vd->granulepos+=
|
||||||
ci->blocksizes[vd->lW]/4+ci->blocksizes[vd->W]/4;
|
ci->blocksizes[vd->lW]/4+ci->blocksizes[vd->W]/4;
|
||||||
if(op->granulepos!=-1 && vd->granulepos!=op->granulepos){
|
if(op->granulepos!=-1 && vd->granulepos!=op->granulepos){
|
||||||
|
|
||||||
if(vd->granulepos>op->granulepos){
|
if(vd->granulepos>op->granulepos){
|
||||||
long extra=(long)(vd->granulepos-op->granulepos);
|
long extra=vd->granulepos-op->granulepos;
|
||||||
|
|
||||||
if(extra)
|
if(extra)
|
||||||
if(op->e_o_s){
|
if(op->e_o_s){
|
||||||
/* partial last frame. Strip the extra samples off */
|
/* partial last frame. Strip the extra samples off */
|
||||||
|
|
|
||||||
|
|
@ -1,39 +1,19 @@
|
||||||
/************************************************************************
|
/********************************************************************
|
||||||
* Copyright (C) 2002-2009, Xiph.org Foundation
|
* *
|
||||||
* Copyright (C) 2010, Robin Watts for Pinknoise Productions Ltd
|
* THIS FILE IS PART OF THE OggVorbis 'TREMOR' CODEC SOURCE CODE. *
|
||||||
* All rights reserved.
|
* *
|
||||||
*
|
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
|
||||||
* modification, are permitted provided that the following conditions
|
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
|
||||||
* are met:
|
* *
|
||||||
*
|
* THE OggVorbis 'TREMOR' SOURCE CODE IS (C) COPYRIGHT 1994-2003 *
|
||||||
* * Redistributions of source code must retain the above copyright
|
* BY THE Xiph.Org FOUNDATION http://www.xiph.org/ *
|
||||||
* 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 names of the Xiph.org Foundation nor Pinknoise
|
|
||||||
* Productions Ltd 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 COPYRIGHT
|
|
||||||
* OWNER 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.
|
|
||||||
************************************************************************
|
|
||||||
|
|
||||||
function: floor backend 0 implementation
|
function: floor backend 0 implementation
|
||||||
|
|
||||||
************************************************************************/
|
********************************************************************/
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
@ -53,12 +33,12 @@ extern const ogg_int32_t FLOOR_fromdB_LOOKUP[];
|
||||||
#include "lsp_lookup.h"
|
#include "lsp_lookup.h"
|
||||||
|
|
||||||
/* interpolated 1./sqrt(p) where .5 <= a < 1. (.100000... to .111111...) in
|
/* interpolated 1./sqrt(p) where .5 <= a < 1. (.100000... to .111111...) in
|
||||||
16.16 format
|
16.16 format
|
||||||
returns in m.8 format */
|
returns in m.8 format */
|
||||||
|
|
||||||
static long ADJUST_SQRT2[2]={8192,5792};
|
static long ADJUST_SQRT2[2]={8192,5792};
|
||||||
static inline ogg_int32_t vorbis_invsqlook_i(long a,long e){
|
static inline ogg_int32_t vorbis_invsqlook_i(long a,long e){
|
||||||
long i=(a&0x7fff)>>(INVSQ_LOOKUP_I_SHIFT-1);
|
long i=(a&0x7fff)>>(INVSQ_LOOKUP_I_SHIFT-1);
|
||||||
long d=a&INVSQ_LOOKUP_I_MASK; /* 0.10 */
|
long d=a&INVSQ_LOOKUP_I_MASK; /* 0.10 */
|
||||||
long val=INVSQ_LOOKUP_I[i]- /* 1.16 */
|
long val=INVSQ_LOOKUP_I[i]- /* 1.16 */
|
||||||
((INVSQ_LOOKUP_IDel[i]*d)>>INVSQ_LOOKUP_I_SHIFT); /* result 1.16 */
|
((INVSQ_LOOKUP_IDel[i]*d)>>INVSQ_LOOKUP_I_SHIFT); /* result 1.16 */
|
||||||
|
|
@ -72,13 +52,13 @@ static inline ogg_int32_t vorbis_invsqlook_i(long a,long e){
|
||||||
#ifdef _LOW_ACCURACY_
|
#ifdef _LOW_ACCURACY_
|
||||||
static inline ogg_int32_t vorbis_fromdBlook_i(long a){
|
static inline ogg_int32_t vorbis_fromdBlook_i(long a){
|
||||||
if(a>0) return 0x7fffffff;
|
if(a>0) return 0x7fffffff;
|
||||||
if(a<(int)(((unsigned)-140)<<12)) return 0;
|
if(a<(-140<<12)) return 0;
|
||||||
return FLOOR_fromdB_LOOKUP[((a+140)*467)>>20]<<9;
|
return FLOOR_fromdB_LOOKUP[((a+140)*467)>>20]<<9;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
static inline ogg_int32_t vorbis_fromdBlook_i(long a){
|
static inline ogg_int32_t vorbis_fromdBlook_i(long a){
|
||||||
if(a>0) return 0x7fffffff;
|
if(a>0) return 0x7fffffff;
|
||||||
if(a<(int)(((unsigned)-140)<<12)) return 0;
|
if(a<(-140<<12)) return 0;
|
||||||
return FLOOR_fromdB_LOOKUP[((a+(140<<12))*467)>>20];
|
return FLOOR_fromdB_LOOKUP[((a+(140<<12))*467)>>20];
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -115,13 +95,13 @@ static const ogg_uint16_t barklook[54]={
|
||||||
/* used in init only; interpolate the long way */
|
/* used in init only; interpolate the long way */
|
||||||
static inline ogg_int32_t toBARK(int n){
|
static inline ogg_int32_t toBARK(int n){
|
||||||
int i;
|
int i;
|
||||||
for(i=0;i<54;i++)
|
for(i=0;i<54;i++)
|
||||||
if(n>=barklook[i] && n<barklook[i+1])break;
|
if(n>=barklook[i] && n<barklook[i+1])break;
|
||||||
|
|
||||||
if(i==54){
|
if(i==54){
|
||||||
return 54<<14;
|
return 54<<14;
|
||||||
}else{
|
}else{
|
||||||
return (i<<14)+(((n-barklook[i])*
|
return (i<<14)+(((n-barklook[i])*
|
||||||
((1UL<<31)/(barklook[i+1]-barklook[i])))>>17);
|
((1UL<<31)/(barklook[i+1]-barklook[i])))>>17);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -209,22 +189,22 @@ void vorbis_lsp_to_curve(ogg_int32_t *curve,int n,int ln,
|
||||||
|
|
||||||
pi=((pi*pi)>>16);
|
pi=((pi*pi)>>16);
|
||||||
qi=((qi*qi)>>16);
|
qi=((qi*qi)>>16);
|
||||||
|
|
||||||
if(m&1){
|
if(m&1){
|
||||||
qexp= qexp*2-28*((m+1)>>1)+m;
|
qexp= qexp*2-28*((m+1)>>1)+m;
|
||||||
pi*=(1<<14)-((wi*wi)>>14);
|
pi*=(1<<14)-((wi*wi)>>14);
|
||||||
qi+=pi>>14;
|
qi+=pi>>14;
|
||||||
}else{
|
}else{
|
||||||
qexp= qexp*2-13*m;
|
qexp= qexp*2-13*m;
|
||||||
|
|
||||||
pi*=(1<<14)-wi;
|
pi*=(1<<14)-wi;
|
||||||
qi*=(1<<14)+wi;
|
qi*=(1<<14)+wi;
|
||||||
|
|
||||||
qi=(qi+pi)>>14;
|
qi=(qi+pi)>>14;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(qi&0xffff0000){ /* checks for 1.xxxxxxxxxxxxxxxx */
|
if(qi&0xffff0000){ /* checks for 1.xxxxxxxxxxxxxxxx */
|
||||||
qi>>=1; qexp++;
|
qi>>=1; qexp++;
|
||||||
}else
|
}else
|
||||||
lsp_norm_asm(&qi,&qexp);
|
lsp_norm_asm(&qi,&qexp);
|
||||||
|
|
||||||
|
|
@ -237,7 +217,7 @@ void vorbis_lsp_to_curve(ogg_int32_t *curve,int n,int ln,
|
||||||
if(!(shift=MLOOP_1[(pi|qi)>>25]))
|
if(!(shift=MLOOP_1[(pi|qi)>>25]))
|
||||||
if(!(shift=MLOOP_2[(pi|qi)>>19]))
|
if(!(shift=MLOOP_2[(pi|qi)>>19]))
|
||||||
shift=MLOOP_3[(pi|qi)>>16];
|
shift=MLOOP_3[(pi|qi)>>16];
|
||||||
|
|
||||||
qi=(qi>>shift)*labs(ilsp[j-1]-wi);
|
qi=(qi>>shift)*labs(ilsp[j-1]-wi);
|
||||||
pi=(pi>>shift)*labs(ilsp[j]-wi);
|
pi=(pi>>shift)*labs(ilsp[j]-wi);
|
||||||
qexp+=shift;
|
qexp+=shift;
|
||||||
|
|
@ -245,7 +225,7 @@ void vorbis_lsp_to_curve(ogg_int32_t *curve,int n,int ln,
|
||||||
if(!(shift=MLOOP_1[(pi|qi)>>25]))
|
if(!(shift=MLOOP_1[(pi|qi)>>25]))
|
||||||
if(!(shift=MLOOP_2[(pi|qi)>>19]))
|
if(!(shift=MLOOP_2[(pi|qi)>>19]))
|
||||||
shift=MLOOP_3[(pi|qi)>>16];
|
shift=MLOOP_3[(pi|qi)>>16];
|
||||||
|
|
||||||
/* pi,qi normalized collectively, both tracked using qexp */
|
/* pi,qi normalized collectively, both tracked using qexp */
|
||||||
|
|
||||||
if(m&1){
|
if(m&1){
|
||||||
|
|
@ -258,7 +238,7 @@ void vorbis_lsp_to_curve(ogg_int32_t *curve,int n,int ln,
|
||||||
if(!(shift=MLOOP_1[(pi|qi)>>25]))
|
if(!(shift=MLOOP_1[(pi|qi)>>25]))
|
||||||
if(!(shift=MLOOP_2[(pi|qi)>>19]))
|
if(!(shift=MLOOP_2[(pi|qi)>>19]))
|
||||||
shift=MLOOP_3[(pi|qi)>>16];
|
shift=MLOOP_3[(pi|qi)>>16];
|
||||||
|
|
||||||
pi>>=shift;
|
pi>>=shift;
|
||||||
qi>>=shift;
|
qi>>=shift;
|
||||||
qexp+=shift-14*((m+1)>>1);
|
qexp+=shift-14*((m+1)>>1);
|
||||||
|
|
@ -275,7 +255,7 @@ void vorbis_lsp_to_curve(ogg_int32_t *curve,int n,int ln,
|
||||||
|
|
||||||
/* p*=p(1-w), q*=q(1+w), let normalization drift because it isn't
|
/* p*=p(1-w), q*=q(1+w), let normalization drift because it isn't
|
||||||
worth tracking step by step */
|
worth tracking step by step */
|
||||||
|
|
||||||
pi>>=shift;
|
pi>>=shift;
|
||||||
qi>>=shift;
|
qi>>=shift;
|
||||||
qexp+=shift-7*m;
|
qexp+=shift-7*m;
|
||||||
|
|
@ -283,39 +263,39 @@ void vorbis_lsp_to_curve(ogg_int32_t *curve,int n,int ln,
|
||||||
pi=((pi*pi)>>16);
|
pi=((pi*pi)>>16);
|
||||||
qi=((qi*qi)>>16);
|
qi=((qi*qi)>>16);
|
||||||
qexp=qexp*2+m;
|
qexp=qexp*2+m;
|
||||||
|
|
||||||
pi*=(1<<14)-wi;
|
pi*=(1<<14)-wi;
|
||||||
qi*=(1<<14)+wi;
|
qi*=(1<<14)+wi;
|
||||||
qi=(qi+pi)>>14;
|
qi=(qi+pi)>>14;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* we've let the normalization drift because it wasn't important;
|
/* we've let the normalization drift because it wasn't important;
|
||||||
however, for the lookup, things must be normalized again. We
|
however, for the lookup, things must be normalized again. We
|
||||||
need at most one right shift or a number of left shifts */
|
need at most one right shift or a number of left shifts */
|
||||||
|
|
||||||
if(qi&0xffff0000){ /* checks for 1.xxxxxxxxxxxxxxxx */
|
if(qi&0xffff0000){ /* checks for 1.xxxxxxxxxxxxxxxx */
|
||||||
qi>>=1; qexp++;
|
qi>>=1; qexp++;
|
||||||
}else
|
}else
|
||||||
while(qi && !(qi&0x8000)){ /* checks for 0.0xxxxxxxxxxxxxxx or less*/
|
while(qi && !(qi&0x8000)){ /* checks for 0.0xxxxxxxxxxxxxxx or less*/
|
||||||
qi<<=1; qexp--;
|
qi<<=1; qexp--;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
amp=vorbis_fromdBlook_i(ampi* /* n.4 */
|
amp=vorbis_fromdBlook_i(ampi* /* n.4 */
|
||||||
vorbis_invsqlook_i(qi,qexp)-
|
vorbis_invsqlook_i(qi,qexp)-
|
||||||
/* m.8, m+n<=8 */
|
/* m.8, m+n<=8 */
|
||||||
ampoffseti); /* 8.12[0] */
|
ampoffseti); /* 8.12[0] */
|
||||||
|
|
||||||
#ifdef _LOW_ACCURACY_
|
#ifdef _LOW_ACCURACY_
|
||||||
amp>>=9;
|
amp>>=9;
|
||||||
#endif
|
#endif
|
||||||
curve[i]= MULT31_SHIFT15(curve[i],amp);
|
curve[i]= MULT31_SHIFT15(curve[i],amp);
|
||||||
|
|
||||||
while(++i<n){
|
while(++i<n){
|
||||||
|
|
||||||
/* line plot to get new f */
|
/* line plot to get new f */
|
||||||
ferr+=fdy;
|
ferr+=fdy;
|
||||||
if(ferr>=fdx){
|
if(ferr>=fdx){
|
||||||
|
|
@ -323,7 +303,7 @@ void vorbis_lsp_to_curve(ogg_int32_t *curve,int n,int ln,
|
||||||
f++;
|
f++;
|
||||||
}
|
}
|
||||||
f+=fbase;
|
f+=fbase;
|
||||||
|
|
||||||
if(f>=nextf)break;
|
if(f>=nextf)break;
|
||||||
|
|
||||||
curve[i]= MULT31_SHIFT15(curve[i],amp);
|
curve[i]= MULT31_SHIFT15(curve[i],amp);
|
||||||
|
|
@ -333,7 +313,7 @@ void vorbis_lsp_to_curve(ogg_int32_t *curve,int n,int ln,
|
||||||
map++;
|
map++;
|
||||||
|
|
||||||
if(map+1<ln){
|
if(map+1<ln){
|
||||||
|
|
||||||
#ifdef _LOW_ACCURACY_
|
#ifdef _LOW_ACCURACY_
|
||||||
nextbark=((tBnyq1<<11)/ln*(map+1))>>12;
|
nextbark=((tBnyq1<<11)/ln*(map+1))>>12;
|
||||||
#else
|
#else
|
||||||
|
|
@ -343,14 +323,14 @@ void vorbis_lsp_to_curve(ogg_int32_t *curve,int n,int ln,
|
||||||
(((nextbark&0x3fff)*
|
(((nextbark&0x3fff)*
|
||||||
(barklook[(nextbark>>14)+1]-barklook[nextbark>>14]))>>14);
|
(barklook[(nextbark>>14)+1]-barklook[nextbark>>14]))>>14);
|
||||||
if(f<=nextf)break;
|
if(f<=nextf)break;
|
||||||
|
|
||||||
}else{
|
}else{
|
||||||
nextf=9999999;
|
nextf=9999999;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(map>=ln){
|
if(map>=ln){
|
||||||
map=ln-1; /* guard against the approximation */
|
map=ln-1; /* guard against the approximation */
|
||||||
nextf=9999999;
|
nextf=9999999;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -374,13 +354,13 @@ vorbis_info_floor *floor0_info_unpack (vorbis_info *vi,oggpack_buffer *opb){
|
||||||
info->ampbits=oggpack_read(opb,6);
|
info->ampbits=oggpack_read(opb,6);
|
||||||
info->ampdB=oggpack_read(opb,8);
|
info->ampdB=oggpack_read(opb,8);
|
||||||
info->numbooks=oggpack_read(opb,4)+1;
|
info->numbooks=oggpack_read(opb,4)+1;
|
||||||
|
|
||||||
if(info->order<1)goto err_out;
|
if(info->order<1)goto err_out;
|
||||||
if(info->rate<1)goto err_out;
|
if(info->rate<1)goto err_out;
|
||||||
if(info->barkmap<1)goto err_out;
|
if(info->barkmap<1)goto err_out;
|
||||||
|
|
||||||
for(j=0;j<info->numbooks;j++){
|
for(j=0;j<info->numbooks;j++){
|
||||||
info->books[j]=(char)oggpack_read(opb,8);
|
info->books[j]=oggpack_read(opb,8);
|
||||||
if(info->books[j]>=ci->books)goto err_out;
|
if(info->books[j]>=ci->books)goto err_out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -401,25 +381,25 @@ ogg_int32_t *floor0_inverse1(vorbis_dsp_state *vd,vorbis_info_floor *i,
|
||||||
ogg_int32_t *lsp){
|
ogg_int32_t *lsp){
|
||||||
vorbis_info_floor0 *info=(vorbis_info_floor0 *)i;
|
vorbis_info_floor0 *info=(vorbis_info_floor0 *)i;
|
||||||
int j,k;
|
int j,k;
|
||||||
|
|
||||||
int ampraw=oggpack_read(&vd->opb,info->ampbits);
|
int ampraw=oggpack_read(&vd->opb,info->ampbits);
|
||||||
if(ampraw>0){ /* also handles the -1 out of data case */
|
if(ampraw>0){ /* also handles the -1 out of data case */
|
||||||
long maxval=(1<<info->ampbits)-1;
|
long maxval=(1<<info->ampbits)-1;
|
||||||
int amp=((ampraw*info->ampdB)<<4)/maxval;
|
int amp=((ampraw*info->ampdB)<<4)/maxval;
|
||||||
int booknum=oggpack_read(&vd->opb,_ilog(info->numbooks));
|
int booknum=oggpack_read(&vd->opb,_ilog(info->numbooks));
|
||||||
|
|
||||||
if(booknum!=-1 && booknum<info->numbooks){ /* be paranoid */
|
if(booknum!=-1 && booknum<info->numbooks){ /* be paranoid */
|
||||||
codec_setup_info *ci=(codec_setup_info *)vd->vi->codec_setup;
|
codec_setup_info *ci=(codec_setup_info *)vd->vi->codec_setup;
|
||||||
codebook *b=ci->book_param+info->books[booknum];
|
codebook *b=ci->book_param+info->books[booknum];
|
||||||
ogg_int32_t last=0;
|
ogg_int32_t last=0;
|
||||||
|
|
||||||
for(j=0;j<info->order;j+=b->dim)
|
for(j=0;j<info->order;j+=b->dim)
|
||||||
if(vorbis_book_decodev_set(b,lsp+j,&vd->opb,b->dim,-24)==-1)goto eop;
|
if(vorbis_book_decodev_set(b,lsp+j,&vd->opb,b->dim,-24)==-1)goto eop;
|
||||||
for(j=0;j<info->order;){
|
for(j=0;j<info->order;){
|
||||||
for(k=0;k<b->dim;k++,j++)lsp[j]+=last;
|
for(k=0;k<b->dim;k++,j++)lsp[j]+=last;
|
||||||
last=lsp[j-1];
|
last=lsp[j-1];
|
||||||
}
|
}
|
||||||
|
|
||||||
lsp[info->order]=amp;
|
lsp[info->order]=amp;
|
||||||
return(lsp);
|
return(lsp);
|
||||||
}
|
}
|
||||||
|
|
@ -432,7 +412,7 @@ int floor0_inverse2(vorbis_dsp_state *vd,vorbis_info_floor *i,
|
||||||
ogg_int32_t *lsp,ogg_int32_t *out){
|
ogg_int32_t *lsp,ogg_int32_t *out){
|
||||||
vorbis_info_floor0 *info=(vorbis_info_floor0 *)i;
|
vorbis_info_floor0 *info=(vorbis_info_floor0 *)i;
|
||||||
codec_setup_info *ci=(codec_setup_info *)vd->vi->codec_setup;
|
codec_setup_info *ci=(codec_setup_info *)vd->vi->codec_setup;
|
||||||
|
|
||||||
if(lsp){
|
if(lsp){
|
||||||
ogg_int32_t amp=lsp[info->order];
|
ogg_int32_t amp=lsp[info->order];
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,39 +1,19 @@
|
||||||
/************************************************************************
|
/********************************************************************
|
||||||
* Copyright (C) 2002-2009, Xiph.org Foundation
|
* *
|
||||||
* Copyright (C) 2010, Robin Watts for Pinknoise Productions Ltd
|
* THIS FILE IS PART OF THE OggVorbis 'TREMOR' CODEC SOURCE CODE. *
|
||||||
* All rights reserved.
|
* *
|
||||||
*
|
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
|
||||||
* modification, are permitted provided that the following conditions
|
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
|
||||||
* are met:
|
* *
|
||||||
*
|
* THE OggVorbis 'TREMOR' SOURCE CODE IS (C) COPYRIGHT 1994-2003 *
|
||||||
* * Redistributions of source code must retain the above copyright
|
* BY THE Xiph.Org FOUNDATION http://www.xiph.org/ *
|
||||||
* 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 names of the Xiph.org Foundation nor Pinknoise
|
|
||||||
* Productions Ltd 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 COPYRIGHT
|
|
||||||
* OWNER 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.
|
|
||||||
************************************************************************
|
|
||||||
|
|
||||||
function: floor backend 1 implementation
|
function: floor backend 1 implementation
|
||||||
|
|
||||||
************************************************************************/
|
********************************************************************/
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
@ -53,7 +33,7 @@ extern const ogg_int32_t FLOOR_fromdB_LOOKUP[];
|
||||||
void floor1_free_info(vorbis_info_floor *i){
|
void floor1_free_info(vorbis_info_floor *i){
|
||||||
vorbis_info_floor1 *info=(vorbis_info_floor1 *)i;
|
vorbis_info_floor1 *info=(vorbis_info_floor1 *)i;
|
||||||
if(info){
|
if(info){
|
||||||
if(info->klass)_ogg_free(info->klass);
|
if(info->class)_ogg_free(info->class);
|
||||||
if(info->partitionclass)_ogg_free(info->partitionclass);
|
if(info->partitionclass)_ogg_free(info->partitionclass);
|
||||||
if(info->postlist)_ogg_free(info->postlist);
|
if(info->postlist)_ogg_free(info->postlist);
|
||||||
if(info->forward_index)_ogg_free(info->forward_index);
|
if(info->forward_index)_ogg_free(info->forward_index);
|
||||||
|
|
@ -73,9 +53,9 @@ static int ilog(unsigned int v){
|
||||||
return(ret);
|
return(ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void floor1_mergesort(ogg_uint8_t *index,ogg_uint16_t *vals,ogg_uint16_t n){
|
static void mergesort(char *index,ogg_uint16_t *vals,ogg_uint16_t n){
|
||||||
ogg_uint16_t i,j;
|
ogg_uint16_t i,j;
|
||||||
ogg_uint8_t *temp,*A=index,*B=_ogg_malloc(n*sizeof(*B));
|
char *temp,*A=index,*B=_ogg_malloc(n*sizeof(*B));
|
||||||
|
|
||||||
for(i=1;i<n;i<<=1){
|
for(i=1;i<n;i<<=1){
|
||||||
for(j=0;j+i<n;){
|
for(j=0;j+i<n;){
|
||||||
|
|
@ -112,28 +92,28 @@ vorbis_info_floor *floor1_info_unpack (vorbis_info *vi,oggpack_buffer *opb){
|
||||||
/* read partitions */
|
/* read partitions */
|
||||||
info->partitions=oggpack_read(opb,5); /* only 0 to 31 legal */
|
info->partitions=oggpack_read(opb,5); /* only 0 to 31 legal */
|
||||||
info->partitionclass=
|
info->partitionclass=
|
||||||
(ogg_uint8_t *)_ogg_malloc(info->partitions*sizeof(*info->partitionclass));
|
(char *)_ogg_malloc(info->partitions*sizeof(*info->partitionclass));
|
||||||
for(j=0;j<info->partitions;j++){
|
for(j=0;j<info->partitions;j++){
|
||||||
info->partitionclass[j]=(char)oggpack_read(opb,4); /* only 0 to 15 legal */
|
info->partitionclass[j]=oggpack_read(opb,4); /* only 0 to 15 legal */
|
||||||
if(maxclass<info->partitionclass[j])maxclass=info->partitionclass[j];
|
if(maxclass<info->partitionclass[j])maxclass=info->partitionclass[j];
|
||||||
}
|
}
|
||||||
|
|
||||||
/* read partition classes */
|
/* read partition classes */
|
||||||
info->klass=
|
info->class=
|
||||||
(floor1class *)_ogg_malloc((maxclass+1)*sizeof(*info->klass));
|
(floor1class *)_ogg_malloc((maxclass+1)*sizeof(*info->class));
|
||||||
for(j=0;j<maxclass+1;j++){
|
for(j=0;j<maxclass+1;j++){
|
||||||
info->klass[j].class_dim=(char)oggpack_read(opb,3)+1; /* 1 to 8 */
|
info->class[j].class_dim=oggpack_read(opb,3)+1; /* 1 to 8 */
|
||||||
info->klass[j].class_subs=(char)oggpack_read(opb,2); /* 0,1,2,3 bits */
|
info->class[j].class_subs=oggpack_read(opb,2); /* 0,1,2,3 bits */
|
||||||
if(oggpack_eop(opb)<0) goto err_out;
|
if(oggpack_eop(opb)<0) goto err_out;
|
||||||
if(info->klass[j].class_subs)
|
if(info->class[j].class_subs)
|
||||||
info->klass[j].class_book=(unsigned char)oggpack_read(opb,8);
|
info->class[j].class_book=oggpack_read(opb,8);
|
||||||
else
|
else
|
||||||
info->klass[j].class_book=0;
|
info->class[j].class_book=0;
|
||||||
if(info->klass[j].class_book>=ci->books)goto err_out;
|
if(info->class[j].class_book>=ci->books)goto err_out;
|
||||||
for(k=0;k<(1<<info->klass[j].class_subs);k++){
|
for(k=0;k<(1<<info->class[j].class_subs);k++){
|
||||||
info->klass[j].class_subbook[k]=(unsigned char)(oggpack_read(opb,8)-1);
|
info->class[j].class_subbook[k]=oggpack_read(opb,8)-1;
|
||||||
if(info->klass[j].class_subbook[k]>=ci->books &&
|
if(info->class[j].class_subbook[k]>=ci->books &&
|
||||||
info->klass[j].class_subbook[k]!=0xff)goto err_out;
|
info->class[j].class_subbook[k]!=0xff)goto err_out;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -142,21 +122,21 @@ vorbis_info_floor *floor1_info_unpack (vorbis_info *vi,oggpack_buffer *opb){
|
||||||
rangebits=oggpack_read(opb,4);
|
rangebits=oggpack_read(opb,4);
|
||||||
|
|
||||||
for(j=0,k=0;j<info->partitions;j++)
|
for(j=0,k=0;j<info->partitions;j++)
|
||||||
count+=info->klass[info->partitionclass[j]].class_dim;
|
count+=info->class[info->partitionclass[j]].class_dim;
|
||||||
info->postlist=
|
info->postlist=
|
||||||
(ogg_uint16_t *)_ogg_malloc((count+2)*sizeof(*info->postlist));
|
(ogg_uint16_t *)_ogg_malloc((count+2)*sizeof(*info->postlist));
|
||||||
info->forward_index=
|
info->forward_index=
|
||||||
(ogg_uint8_t *)_ogg_malloc((count+2)*sizeof(*info->forward_index));
|
(char *)_ogg_malloc((count+2)*sizeof(*info->forward_index));
|
||||||
info->loneighbor=
|
info->loneighbor=
|
||||||
(ogg_uint8_t *)_ogg_malloc(count*sizeof(*info->loneighbor));
|
(char *)_ogg_malloc(count*sizeof(*info->loneighbor));
|
||||||
info->hineighbor=
|
info->hineighbor=
|
||||||
(ogg_uint8_t *)_ogg_malloc(count*sizeof(*info->hineighbor));
|
(char *)_ogg_malloc(count*sizeof(*info->hineighbor));
|
||||||
|
|
||||||
count=0;
|
count=0;
|
||||||
for(j=0,k=0;j<info->partitions;j++){
|
for(j=0,k=0;j<info->partitions;j++){
|
||||||
count+=info->klass[info->partitionclass[j]].class_dim;
|
count+=info->class[info->partitionclass[j]].class_dim;
|
||||||
for(;k<count;k++){
|
for(;k<count;k++){
|
||||||
int t=info->postlist[k+2]=(ogg_uint16_t)oggpack_read(opb,rangebits);
|
int t=info->postlist[k+2]=oggpack_read(opb,rangebits);
|
||||||
if(t>=(1<<rangebits))goto err_out;
|
if(t>=(1<<rangebits))goto err_out;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -167,7 +147,7 @@ vorbis_info_floor *floor1_info_unpack (vorbis_info *vi,oggpack_buffer *opb){
|
||||||
|
|
||||||
/* also store a sorted position index */
|
/* also store a sorted position index */
|
||||||
for(j=0;j<info->posts;j++)info->forward_index[j]=j;
|
for(j=0;j<info->posts;j++)info->forward_index[j]=j;
|
||||||
floor1_mergesort(info->forward_index,info->postlist,info->posts);
|
mergesort(info->forward_index,info->postlist,info->posts);
|
||||||
|
|
||||||
/* discover our neighbors for decode where we don't use fit flags
|
/* discover our neighbors for decode where we don't use fit flags
|
||||||
(that would push the neighbors outward) */
|
(that would push the neighbors outward) */
|
||||||
|
|
@ -218,10 +198,6 @@ int render_point(int x0,int x1,int y0,int y1,int x){
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef ONLY_C
|
|
||||||
void render_lineARM(int n, ogg_int32_t *d,const ogg_int32_t *floor, int base, int err, int adx, int ady);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static void render_line(int n,int x0,int x1,int y0,int y1,ogg_int32_t *d){
|
static void render_line(int n,int x0,int x1,int y0,int y1,ogg_int32_t *d){
|
||||||
int dy;
|
int dy;
|
||||||
int adx;
|
int adx;
|
||||||
|
|
@ -232,9 +208,8 @@ static void render_line(int n,int x0,int x1,int y0,int y1,ogg_int32_t *d){
|
||||||
|
|
||||||
if(n>x1)n=x1;
|
if(n>x1)n=x1;
|
||||||
n -= x0;
|
n -= x0;
|
||||||
if (n <= 0 || y0 < 0 || y0 > 255 || y1 < 0 || y1 > 255) {
|
if (n <= 0)
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
dy=y1-y0;
|
dy=y1-y0;
|
||||||
adx=x1-x0;
|
adx=x1-x0;
|
||||||
ady=abs(dy);
|
ady=abs(dy);
|
||||||
|
|
@ -304,20 +279,20 @@ ogg_int32_t *floor1_inverse1(vorbis_dsp_state *vd,vorbis_info_floor *in,
|
||||||
/* partition by partition */
|
/* partition by partition */
|
||||||
for(i=0,j=2;i<info->partitions;i++){
|
for(i=0,j=2;i<info->partitions;i++){
|
||||||
int classv=info->partitionclass[i];
|
int classv=info->partitionclass[i];
|
||||||
int cdim=info->klass[classv].class_dim;
|
int cdim=info->class[classv].class_dim;
|
||||||
int csubbits=info->klass[classv].class_subs;
|
int csubbits=info->class[classv].class_subs;
|
||||||
int csub=1<<csubbits;
|
int csub=1<<csubbits;
|
||||||
int cval=0;
|
int cval=0;
|
||||||
|
|
||||||
/* decode the partition's first stage cascade value */
|
/* decode the partition's first stage cascade value */
|
||||||
if(csubbits){
|
if(csubbits){
|
||||||
cval=vorbis_book_decode(books+info->klass[classv].class_book,&vd->opb);
|
cval=vorbis_book_decode(books+info->class[classv].class_book,&vd->opb);
|
||||||
|
|
||||||
if(cval==-1)goto eop;
|
if(cval==-1)goto eop;
|
||||||
}
|
}
|
||||||
|
|
||||||
for(k=0;k<cdim;k++){
|
for(k=0;k<cdim;k++){
|
||||||
int book=info->klass[classv].class_subbook[cval&(csub-1)];
|
int book=info->class[classv].class_subbook[cval&(csub-1)];
|
||||||
cval>>=csubbits;
|
cval>>=csubbits;
|
||||||
if(book!=0xff){
|
if(book!=0xff){
|
||||||
if((fit_value[j+k]=vorbis_book_decode(books+book,&vd->opb))==-1)
|
if((fit_value[j+k]=vorbis_book_decode(books+book,&vd->opb))==-1)
|
||||||
|
|
|
||||||
|
|
@ -1,41 +1,7 @@
|
||||||
@ Tremolo library
|
.text
|
||||||
@-----------------------------------------------------------------------
|
|
||||||
@ Copyright (C) 2002-2009, Xiph.org Foundation
|
|
||||||
@ Copyright (C) 2010, Robin Watts for Pinknoise Productions Ltd
|
|
||||||
@ All rights reserved.
|
|
||||||
|
|
||||||
@ 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 names of the Xiph.org Foundation nor Pinknoise
|
|
||||||
@ Productions Ltd 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 COPYRIGHT
|
|
||||||
@ OWNER 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.
|
|
||||||
@ ----------------------------------------------------------------------
|
|
||||||
|
|
||||||
.text
|
|
||||||
|
|
||||||
.global render_lineARM
|
.global render_lineARM
|
||||||
|
|
||||||
render_lineARM:
|
render_lineARM:
|
||||||
@ r0 = n
|
@ r0 = n
|
||||||
@ r1 = d
|
@ r1 = d
|
||||||
|
|
@ -63,5 +29,3 @@ rl_loop:
|
||||||
BGT rl_loop
|
BGT rl_loop
|
||||||
|
|
||||||
LDMFD r13!,{r4-r6,r11,PC}
|
LDMFD r13!,{r4-r6,r11,PC}
|
||||||
|
|
||||||
@ END
|
|
||||||
|
|
|
||||||
|
|
@ -1,38 +1,4 @@
|
||||||
@ Tremolo library
|
.text
|
||||||
@-----------------------------------------------------------------------
|
|
||||||
@ Copyright (C) 2002-2009, Xiph.org Foundation
|
|
||||||
@ Copyright (C) 2010, Robin Watts for Pinknoise Productions Ltd
|
|
||||||
@ All rights reserved.
|
|
||||||
|
|
||||||
@ 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 names of the Xiph.org Foundation nor Pinknoise
|
|
||||||
@ Productions Ltd 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 COPYRIGHT
|
|
||||||
@ OWNER 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.
|
|
||||||
@ ----------------------------------------------------------------------
|
|
||||||
|
|
||||||
.text
|
|
||||||
|
|
||||||
.global render_lineARM
|
.global render_lineARM
|
||||||
|
|
||||||
|
|
@ -62,5 +28,3 @@ rl_loop:
|
||||||
BGT rl_loop
|
BGT rl_loop
|
||||||
|
|
||||||
LDMFD r13!,{r4-r6,r11,PC}
|
LDMFD r13!,{r4-r6,r11,PC}
|
||||||
|
|
||||||
@ END
|
|
||||||
|
|
|
||||||
|
|
@ -1,39 +1,19 @@
|
||||||
/************************************************************************
|
/********************************************************************
|
||||||
* Copyright (C) 2002-2009, Xiph.org Foundation
|
* *
|
||||||
* Copyright (C) 2010, Robin Watts for Pinknoise Productions Ltd
|
* THIS FILE IS PART OF THE OggVorbis 'TREMOR' CODEC SOURCE CODE. *
|
||||||
* All rights reserved.
|
* *
|
||||||
*
|
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
|
||||||
* modification, are permitted provided that the following conditions
|
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
|
||||||
* are met:
|
* *
|
||||||
*
|
* THE OggVorbis 'TREMOR' SOURCE CODE IS (C) COPYRIGHT 1994-2003 *
|
||||||
* * Redistributions of source code must retain the above copyright
|
* BY THE Xiph.Org FOUNDATION http://www.xiph.org/ *
|
||||||
* 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 names of the Xiph.org Foundation nor Pinknoise
|
|
||||||
* Productions Ltd 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 COPYRIGHT
|
|
||||||
* OWNER 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.
|
|
||||||
************************************************************************
|
|
||||||
|
|
||||||
function: floor dB lookup
|
function: floor dB lookup
|
||||||
|
|
||||||
************************************************************************/
|
********************************************************************/
|
||||||
|
|
||||||
#include "os.h"
|
#include "os.h"
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,35 +1,15 @@
|
||||||
/************************************************************************
|
/********************************************************************
|
||||||
* Copyright (C) 2002-2009, Xiph.org Foundation
|
* *
|
||||||
* Copyright (C) 2010, Robin Watts for Pinknoise Productions Ltd
|
* THIS FILE IS PART OF THE OggVorbis 'TREMOR' CODEC SOURCE CODE. *
|
||||||
* All rights reserved.
|
* *
|
||||||
*
|
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
|
||||||
* modification, are permitted provided that the following conditions
|
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
|
||||||
* are met:
|
* *
|
||||||
*
|
* THE OggVorbis 'TREMOR' SOURCE CODE IS (C) COPYRIGHT 1994-2003 *
|
||||||
* * Redistributions of source code must retain the above copyright
|
* BY THE Xiph.Org FOUNDATION http://www.xiph.org/ *
|
||||||
* 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 names of the Xiph.org Foundation nor Pinknoise
|
|
||||||
* Productions Ltd 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 COPYRIGHT
|
|
||||||
* OWNER 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.
|
|
||||||
************************************************************************
|
|
||||||
|
|
||||||
function: decode Ogg streams back into raw packets
|
function: decode Ogg streams back into raw packets
|
||||||
|
|
||||||
|
|
@ -37,7 +17,7 @@
|
||||||
Ross Williams (ross@guest.adelaide.edu.au). See docs/framing.html
|
Ross Williams (ross@guest.adelaide.edu.au). See docs/framing.html
|
||||||
for details.
|
for details.
|
||||||
|
|
||||||
************************************************************************/
|
********************************************************************/
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
@ -577,11 +557,6 @@ ogg_uint32_t crc_lookup[256]={
|
||||||
0xafb010b1,0xab710d06,0xa6322bdf,0xa2f33668,
|
0xafb010b1,0xab710d06,0xa6322bdf,0xa2f33668,
|
||||||
0xbcb4666d,0xb8757bda,0xb5365d03,0xb1f740b4};
|
0xbcb4666d,0xb8757bda,0xb5365d03,0xb1f740b4};
|
||||||
|
|
||||||
void ogg_sync_init(ogg_sync_state *oy){
|
|
||||||
memset(oy,0,sizeof(*oy));
|
|
||||||
oy->bufferpool=ogg_buffer_create();
|
|
||||||
}
|
|
||||||
|
|
||||||
ogg_sync_state *ogg_sync_create(void){
|
ogg_sync_state *ogg_sync_create(void){
|
||||||
ogg_sync_state *oy=_ogg_calloc(1,sizeof(*oy));
|
ogg_sync_state *oy=_ogg_calloc(1,sizeof(*oy));
|
||||||
memset(oy,0,sizeof(*oy));
|
memset(oy,0,sizeof(*oy));
|
||||||
|
|
@ -589,15 +564,6 @@ ogg_sync_state *ogg_sync_create(void){
|
||||||
return oy;
|
return oy;
|
||||||
}
|
}
|
||||||
|
|
||||||
int ogg_sync_clear(ogg_sync_state *oy){
|
|
||||||
if(oy){
|
|
||||||
ogg_sync_reset(oy);
|
|
||||||
ogg_buffer_destroy(oy->bufferpool);
|
|
||||||
memset(oy,0,sizeof(*oy));
|
|
||||||
}
|
|
||||||
return OGG_SUCCESS;
|
|
||||||
}
|
|
||||||
|
|
||||||
int ogg_sync_destroy(ogg_sync_state *oy){
|
int ogg_sync_destroy(ogg_sync_state *oy){
|
||||||
if(oy){
|
if(oy){
|
||||||
ogg_sync_reset(oy);
|
ogg_sync_reset(oy);
|
||||||
|
|
@ -661,9 +627,7 @@ int ogg_sync_wrote(ogg_sync_state *oy, long bytes){
|
||||||
return OGG_SUCCESS;
|
return OGG_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef ONLY_C
|
#ifdef ONLY_C
|
||||||
ogg_uint32_t _checksum(ogg_reference *or, int bytes);
|
|
||||||
#else
|
|
||||||
static ogg_uint32_t _checksum(ogg_reference *or, int bytes){
|
static ogg_uint32_t _checksum(ogg_reference *or, int bytes){
|
||||||
ogg_uint32_t crc_reg=0;
|
ogg_uint32_t crc_reg=0;
|
||||||
int j,post;
|
int j,post;
|
||||||
|
|
@ -849,12 +813,6 @@ int ogg_sync_reset(ogg_sync_state *oy){
|
||||||
return OGG_SUCCESS;
|
return OGG_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ogg_stream_init(ogg_stream_state *os, int serialno){
|
|
||||||
memset(os, 0, sizeof(*os));
|
|
||||||
os->serialno=serialno;
|
|
||||||
os->pageno=-1;
|
|
||||||
}
|
|
||||||
|
|
||||||
ogg_stream_state *ogg_stream_create(int serialno){
|
ogg_stream_state *ogg_stream_create(int serialno){
|
||||||
ogg_stream_state *os=_ogg_calloc(1,sizeof(*os));
|
ogg_stream_state *os=_ogg_calloc(1,sizeof(*os));
|
||||||
os->serialno=serialno;
|
os->serialno=serialno;
|
||||||
|
|
@ -862,15 +820,6 @@ ogg_stream_state *ogg_stream_create(int serialno){
|
||||||
return os;
|
return os;
|
||||||
}
|
}
|
||||||
|
|
||||||
int ogg_stream_clear(ogg_stream_state *os){
|
|
||||||
if(os){
|
|
||||||
ogg_buffer_release(os->header_tail);
|
|
||||||
ogg_buffer_release(os->body_tail);
|
|
||||||
memset(os,0,sizeof(*os));
|
|
||||||
}
|
|
||||||
return OGG_SUCCESS;
|
|
||||||
}
|
|
||||||
|
|
||||||
int ogg_stream_destroy(ogg_stream_state *os){
|
int ogg_stream_destroy(ogg_stream_state *os){
|
||||||
if(os){
|
if(os){
|
||||||
ogg_buffer_release(os->header_tail);
|
ogg_buffer_release(os->header_tail);
|
||||||
|
|
@ -999,11 +948,11 @@ int ogg_stream_pagein(ogg_stream_state *os, ogg_page *og){
|
||||||
|
|
||||||
/* check the serial number */
|
/* check the serial number */
|
||||||
if(serialno!=os->serialno){
|
if(serialno!=os->serialno){
|
||||||
//ogg_page_release(og);
|
ogg_page_release(og);
|
||||||
return OGG_ESERIAL;
|
return OGG_ESERIAL;
|
||||||
}
|
}
|
||||||
if(version>0){
|
if(version>0){
|
||||||
//ogg_page_release(og);
|
ogg_page_release(og);
|
||||||
return OGG_EVERSION;
|
return OGG_EVERSION;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
117
sources/tremolo/Tremolo/treminfo.c → sources/tremolo/Tremolo/info.c
Normal file → Executable file
117
sources/tremolo/Tremolo/treminfo.c → sources/tremolo/Tremolo/info.c
Normal file → Executable file
|
|
@ -1,39 +1,19 @@
|
||||||
/************************************************************************
|
/********************************************************************
|
||||||
* Copyright (C) 2002-2009, Xiph.org Foundation
|
* *
|
||||||
* Copyright (C) 2010, Robin Watts for Pinknoise Productions Ltd
|
* THIS FILE IS PART OF THE OggVorbis 'TREMOR' CODEC SOURCE CODE. *
|
||||||
* All rights reserved.
|
* *
|
||||||
*
|
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
|
||||||
* modification, are permitted provided that the following conditions
|
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
|
||||||
* are met:
|
* *
|
||||||
*
|
* THE OggVorbis 'TREMOR' SOURCE CODE IS (C) COPYRIGHT 1994-2003 *
|
||||||
* * Redistributions of source code must retain the above copyright
|
* BY THE Xiph.Org FOUNDATION http://www.xiph.org/ *
|
||||||
* 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 names of the Xiph.org Foundation nor Pinknoise
|
|
||||||
* Productions Ltd 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 COPYRIGHT
|
|
||||||
* OWNER 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.
|
|
||||||
************************************************************************
|
|
||||||
|
|
||||||
function: maintain the info structure, info <-> header packets
|
function: maintain the info structure, info <-> header packets
|
||||||
|
|
||||||
************************************************************************/
|
********************************************************************/
|
||||||
|
|
||||||
/* general handling of the header and the vorbis_info structure (and
|
/* general handling of the header and the vorbis_info structure (and
|
||||||
substructures) */
|
substructures) */
|
||||||
|
|
@ -51,7 +31,7 @@
|
||||||
/* helpers */
|
/* helpers */
|
||||||
static void _v_readstring(oggpack_buffer *o,char *buf,int bytes){
|
static void _v_readstring(oggpack_buffer *o,char *buf,int bytes){
|
||||||
while(bytes--){
|
while(bytes--){
|
||||||
*buf++=(char)oggpack_read(o,8);
|
*buf++=oggpack_read(o,8);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -79,7 +59,7 @@ char *vorbis_comment_query(vorbis_comment *vc, char *tag, int count){
|
||||||
|
|
||||||
strcpy(fulltag, tag);
|
strcpy(fulltag, tag);
|
||||||
strcat(fulltag, "=");
|
strcat(fulltag, "=");
|
||||||
|
|
||||||
for(i=0;i<vc->comments;i++){
|
for(i=0;i<vc->comments;i++){
|
||||||
if(!tagcompare(vc->user_comments[i], fulltag, taglen)){
|
if(!tagcompare(vc->user_comments[i], fulltag, taglen)){
|
||||||
if(count == found)
|
if(count == found)
|
||||||
|
|
@ -167,7 +147,7 @@ void vorbis_info_clear(vorbis_info *vi){
|
||||||
vorbis_book_clear(ci->book_param+i);
|
vorbis_book_clear(ci->book_param+i);
|
||||||
_ogg_free(ci->book_param);
|
_ogg_free(ci->book_param);
|
||||||
}
|
}
|
||||||
|
|
||||||
_ogg_free(ci);
|
_ogg_free(ci);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -176,7 +156,7 @@ void vorbis_info_clear(vorbis_info *vi){
|
||||||
|
|
||||||
/* Header packing/unpacking ********************************************/
|
/* Header packing/unpacking ********************************************/
|
||||||
|
|
||||||
int _vorbis_unpack_info(vorbis_info *vi,oggpack_buffer *opb){
|
static int _vorbis_unpack_info(vorbis_info *vi,oggpack_buffer *opb){
|
||||||
codec_setup_info *ci=(codec_setup_info *)vi->codec_setup;
|
codec_setup_info *ci=(codec_setup_info *)vi->codec_setup;
|
||||||
if(!ci)return(OV_EFAULT);
|
if(!ci)return(OV_EFAULT);
|
||||||
|
|
||||||
|
|
@ -192,7 +172,7 @@ int _vorbis_unpack_info(vorbis_info *vi,oggpack_buffer *opb){
|
||||||
|
|
||||||
ci->blocksizes[0]=1<<oggpack_read(opb,4);
|
ci->blocksizes[0]=1<<oggpack_read(opb,4);
|
||||||
ci->blocksizes[1]=1<<oggpack_read(opb,4);
|
ci->blocksizes[1]=1<<oggpack_read(opb,4);
|
||||||
|
|
||||||
#ifdef LIMIT_TO_64kHz
|
#ifdef LIMIT_TO_64kHz
|
||||||
if(vi->rate>=64000 || ci->blocksizes[1]>4096)goto err_out;
|
if(vi->rate>=64000 || ci->blocksizes[1]>4096)goto err_out;
|
||||||
#else
|
#else
|
||||||
|
|
@ -201,10 +181,10 @@ int _vorbis_unpack_info(vorbis_info *vi,oggpack_buffer *opb){
|
||||||
|
|
||||||
if(vi->rate<1)goto err_out;
|
if(vi->rate<1)goto err_out;
|
||||||
if(vi->channels<1)goto err_out;
|
if(vi->channels<1)goto err_out;
|
||||||
if(ci->blocksizes[0]<64)goto err_out;
|
if(ci->blocksizes[0]<64)goto err_out;
|
||||||
if(ci->blocksizes[1]<ci->blocksizes[0])goto err_out;
|
if(ci->blocksizes[1]<ci->blocksizes[0])goto err_out;
|
||||||
if(ci->blocksizes[1]>8192)goto err_out;
|
if(ci->blocksizes[1]>8192)goto err_out;
|
||||||
|
|
||||||
if(oggpack_read(opb,1)!=1)goto err_out; /* EOP check */
|
if(oggpack_read(opb,1)!=1)goto err_out; /* EOP check */
|
||||||
|
|
||||||
return(0);
|
return(0);
|
||||||
|
|
@ -213,31 +193,24 @@ int _vorbis_unpack_info(vorbis_info *vi,oggpack_buffer *opb){
|
||||||
return(OV_EBADHEADER);
|
return(OV_EBADHEADER);
|
||||||
}
|
}
|
||||||
|
|
||||||
int _vorbis_unpack_comment(vorbis_comment *vc,oggpack_buffer *opb){
|
static int _vorbis_unpack_comment(vorbis_comment *vc,oggpack_buffer *opb){
|
||||||
int i;
|
int i;
|
||||||
int vendorlen=oggpack_read(opb,32);
|
int vendorlen=oggpack_read(opb,32);
|
||||||
if(vendorlen<0)goto err_out;
|
if(vendorlen<0)goto err_out;
|
||||||
vc->vendor=(char *)_ogg_calloc(vendorlen+1,1);
|
vc->vendor=(char *)_ogg_calloc(vendorlen+1,1);
|
||||||
if(!vc->vendor)goto err_out;
|
|
||||||
_v_readstring(opb,vc->vendor,vendorlen);
|
_v_readstring(opb,vc->vendor,vendorlen);
|
||||||
vc->comments=oggpack_read(opb,32);
|
vc->comments=oggpack_read(opb,32);
|
||||||
if(vc->comments<0)goto err_out;
|
if(vc->comments<0)goto err_out;
|
||||||
vc->user_comments=(char **)_ogg_calloc(vc->comments+1,sizeof(*vc->user_comments));
|
vc->user_comments=(char **)_ogg_calloc(vc->comments+1,sizeof(*vc->user_comments));
|
||||||
if (!vc->user_comments){
|
|
||||||
vc->comments=0;
|
|
||||||
goto err_out;
|
|
||||||
}
|
|
||||||
vc->comment_lengths=(int *)_ogg_calloc(vc->comments+1, sizeof(*vc->comment_lengths));
|
vc->comment_lengths=(int *)_ogg_calloc(vc->comments+1, sizeof(*vc->comment_lengths));
|
||||||
if (!vc->comment_lengths)goto err_out;
|
|
||||||
|
|
||||||
for(i=0;i<vc->comments;i++){
|
for(i=0;i<vc->comments;i++){
|
||||||
int len=oggpack_read(opb,32);
|
int len=oggpack_read(opb,32);
|
||||||
if(len<0)goto err_out;
|
if(len<0)goto err_out;
|
||||||
vc->comment_lengths[i]=len;
|
vc->comment_lengths[i]=len;
|
||||||
vc->user_comments[i]=(char *)_ogg_calloc(len+1,1);
|
vc->user_comments[i]=(char *)_ogg_calloc(len+1,1);
|
||||||
if(!vc->user_comments[i])goto err_out;
|
|
||||||
_v_readstring(opb,vc->user_comments[i],len);
|
_v_readstring(opb,vc->user_comments[i],len);
|
||||||
}
|
}
|
||||||
if(oggpack_read(opb,1)!=1)goto err_out; /* EOP check */
|
if(oggpack_read(opb,1)!=1)goto err_out; /* EOP check */
|
||||||
|
|
||||||
return(0);
|
return(0);
|
||||||
|
|
@ -248,7 +221,7 @@ int _vorbis_unpack_comment(vorbis_comment *vc,oggpack_buffer *opb){
|
||||||
|
|
||||||
/* all of the real encoding details are here. The modes, books,
|
/* all of the real encoding details are here. The modes, books,
|
||||||
everything */
|
everything */
|
||||||
int _vorbis_unpack_books(vorbis_info *vi,oggpack_buffer *opb){
|
static int _vorbis_unpack_books(vorbis_info *vi,oggpack_buffer *opb){
|
||||||
codec_setup_info *ci=(codec_setup_info *)vi->codec_setup;
|
codec_setup_info *ci=(codec_setup_info *)vi->codec_setup;
|
||||||
int i;
|
int i;
|
||||||
if(!ci)return(OV_EFAULT);
|
if(!ci)return(OV_EFAULT);
|
||||||
|
|
@ -256,10 +229,6 @@ int _vorbis_unpack_books(vorbis_info *vi,oggpack_buffer *opb){
|
||||||
/* codebooks */
|
/* codebooks */
|
||||||
ci->books=oggpack_read(opb,8)+1;
|
ci->books=oggpack_read(opb,8)+1;
|
||||||
ci->book_param=(codebook *)_ogg_calloc(ci->books,sizeof(*ci->book_param));
|
ci->book_param=(codebook *)_ogg_calloc(ci->books,sizeof(*ci->book_param));
|
||||||
if(!ci->book_param){
|
|
||||||
ci->books=0;
|
|
||||||
goto err_out;
|
|
||||||
}
|
|
||||||
for(i=0;i<ci->books;i++)
|
for(i=0;i<ci->books;i++)
|
||||||
if(vorbis_book_unpack(opb,ci->book_param+i))goto err_out;
|
if(vorbis_book_unpack(opb,ci->book_param+i))goto err_out;
|
||||||
|
|
||||||
|
|
@ -270,14 +239,10 @@ int _vorbis_unpack_books(vorbis_info *vi,oggpack_buffer *opb){
|
||||||
|
|
||||||
/* floor backend settings */
|
/* floor backend settings */
|
||||||
ci->floors=oggpack_read(opb,6)+1;
|
ci->floors=oggpack_read(opb,6)+1;
|
||||||
ci->floor_param=_ogg_calloc(ci->floors, sizeof(*ci->floor_param));
|
ci->floor_param=_ogg_malloc(sizeof(*ci->floor_param)*ci->floors);
|
||||||
ci->floor_type=_ogg_calloc(ci->floors, sizeof(*ci->floor_type));
|
ci->floor_type=_ogg_malloc(sizeof(*ci->floor_type)*ci->floors);
|
||||||
if(!ci->floor_param || !ci->floor_type){
|
|
||||||
ci->floors=0;
|
|
||||||
goto err_out;
|
|
||||||
}
|
|
||||||
for(i=0;i<ci->floors;i++){
|
for(i=0;i<ci->floors;i++){
|
||||||
ci->floor_type[i]=(char)oggpack_read(opb,16);
|
ci->floor_type[i]=oggpack_read(opb,16);
|
||||||
if(ci->floor_type[i]<0 || ci->floor_type[i]>=VI_FLOORB)goto err_out;
|
if(ci->floor_type[i]<0 || ci->floor_type[i]>=VI_FLOORB)goto err_out;
|
||||||
if(ci->floor_type[i])
|
if(ci->floor_type[i])
|
||||||
ci->floor_param[i]=floor1_info_unpack(vi,opb);
|
ci->floor_param[i]=floor1_info_unpack(vi,opb);
|
||||||
|
|
@ -288,42 +253,30 @@ int _vorbis_unpack_books(vorbis_info *vi,oggpack_buffer *opb){
|
||||||
|
|
||||||
/* residue backend settings */
|
/* residue backend settings */
|
||||||
ci->residues=oggpack_read(opb,6)+1;
|
ci->residues=oggpack_read(opb,6)+1;
|
||||||
ci->residue_param=_ogg_calloc(ci->residues, sizeof(*ci->residue_param));
|
ci->residue_param=_ogg_malloc(sizeof(*ci->residue_param)*ci->residues);
|
||||||
if (!ci->residue_param){
|
|
||||||
ci->residues=0;
|
|
||||||
goto err_out;
|
|
||||||
}
|
|
||||||
for(i=0;i<ci->residues;i++)
|
for(i=0;i<ci->residues;i++)
|
||||||
if(res_unpack(ci->residue_param+i,vi,opb))goto err_out;
|
if(res_unpack(ci->residue_param+i,vi,opb))goto err_out;
|
||||||
|
|
||||||
/* map backend settings */
|
/* map backend settings */
|
||||||
ci->maps=oggpack_read(opb,6)+1;
|
ci->maps=oggpack_read(opb,6)+1;
|
||||||
ci->map_param=_ogg_calloc(ci->maps, sizeof(*ci->map_param));
|
ci->map_param=_ogg_malloc(sizeof(*ci->map_param)*ci->maps);
|
||||||
if (!ci->map_param){
|
|
||||||
ci->maps=0;
|
|
||||||
goto err_out;
|
|
||||||
}
|
|
||||||
for(i=0;i<ci->maps;i++){
|
for(i=0;i<ci->maps;i++){
|
||||||
if(oggpack_read(opb,16)!=0)goto err_out;
|
if(oggpack_read(opb,16)!=0)goto err_out;
|
||||||
if(mapping_info_unpack(ci->map_param+i,vi,opb))goto err_out;
|
if(mapping_info_unpack(ci->map_param+i,vi,opb))goto err_out;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* mode settings */
|
/* mode settings */
|
||||||
ci->modes=oggpack_read(opb,6)+1;
|
ci->modes=oggpack_read(opb,6)+1;
|
||||||
ci->mode_param=
|
ci->mode_param=
|
||||||
(vorbis_info_mode *)_ogg_calloc(ci->modes, sizeof(*ci->mode_param));
|
(vorbis_info_mode *)_ogg_malloc(ci->modes*sizeof(*ci->mode_param));
|
||||||
if (!ci->mode_param){
|
|
||||||
ci->modes=0;
|
|
||||||
goto err_out;
|
|
||||||
}
|
|
||||||
for(i=0;i<ci->modes;i++){
|
for(i=0;i<ci->modes;i++){
|
||||||
ci->mode_param[i].blockflag=(unsigned char)oggpack_read(opb,1);
|
ci->mode_param[i].blockflag=oggpack_read(opb,1);
|
||||||
if(oggpack_read(opb,16))goto err_out;
|
if(oggpack_read(opb,16))goto err_out;
|
||||||
if(oggpack_read(opb,16))goto err_out;
|
if(oggpack_read(opb,16))goto err_out;
|
||||||
ci->mode_param[i].mapping=(unsigned char)oggpack_read(opb,8);
|
ci->mode_param[i].mapping=oggpack_read(opb,8);
|
||||||
if(ci->mode_param[i].mapping>=ci->maps)goto err_out;
|
if(ci->mode_param[i].mapping>=ci->maps)goto err_out;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(oggpack_read(opb,1)!=1)goto err_out; /* top level EOP check */
|
if(oggpack_read(opb,1)!=1)goto err_out; /* top level EOP check */
|
||||||
|
|
||||||
return(0);
|
return(0);
|
||||||
|
|
@ -339,7 +292,7 @@ int _vorbis_unpack_books(vorbis_info *vi,oggpack_buffer *opb){
|
||||||
|
|
||||||
int vorbis_dsp_headerin(vorbis_info *vi,vorbis_comment *vc,ogg_packet *op){
|
int vorbis_dsp_headerin(vorbis_info *vi,vorbis_comment *vc,ogg_packet *op){
|
||||||
oggpack_buffer opb;
|
oggpack_buffer opb;
|
||||||
|
|
||||||
if(op){
|
if(op){
|
||||||
oggpack_readinit(&opb,op->packet);
|
oggpack_readinit(&opb,op->packet);
|
||||||
|
|
||||||
|
|
@ -1,39 +1,19 @@
|
||||||
/************************************************************************
|
/********************************************************************
|
||||||
* Copyright (C) 2002-2009, Xiph.org Foundation
|
* *
|
||||||
* Copyright (C) 2010, Robin Watts for Pinknoise Productions Ltd
|
* THIS FILE IS PART OF THE OggVorbis 'TREMOR' CODEC SOURCE CODE. *
|
||||||
* All rights reserved.
|
* *
|
||||||
*
|
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
|
||||||
* modification, are permitted provided that the following conditions
|
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
|
||||||
* are met:
|
* *
|
||||||
*
|
* THE OggVorbis 'TREMOR' SOURCE CODE IS (C) COPYRIGHT 1994-2002 *
|
||||||
* * Redistributions of source code must retain the above copyright
|
* BY THE Xiph.Org FOUNDATION http://www.xiph.org/ *
|
||||||
* 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 names of the Xiph.org Foundation nor Pinknoise
|
|
||||||
* Productions Ltd 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 COPYRIGHT
|
|
||||||
* OWNER 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.
|
|
||||||
************************************************************************
|
|
||||||
|
|
||||||
function: libvorbis codec headers
|
function: libvorbis codec headers
|
||||||
|
|
||||||
************************************************************************/
|
********************************************************************/
|
||||||
|
|
||||||
#ifndef _vorbis_codec_h_
|
#ifndef _vorbis_codec_h_
|
||||||
#define _vorbis_codec_h_
|
#define _vorbis_codec_h_
|
||||||
|
|
@ -55,14 +35,14 @@ typedef struct vorbis_info{
|
||||||
|
|
||||||
/* The below bitrate declarations are *hints*.
|
/* The below bitrate declarations are *hints*.
|
||||||
Combinations of the three values carry the following implications:
|
Combinations of the three values carry the following implications:
|
||||||
|
|
||||||
all three set to the same value:
|
all three set to the same value:
|
||||||
implies a fixed rate bitstream
|
implies a fixed rate bitstream
|
||||||
only nominal set:
|
only nominal set:
|
||||||
implies a VBR stream that averages the nominal bitrate. No hard
|
implies a VBR stream that averages the nominal bitrate. No hard
|
||||||
upper/lower limit
|
upper/lower limit
|
||||||
upper and or lower set:
|
upper and or lower set:
|
||||||
implies a VBR bitstream that obeys the bitrate limits. nominal
|
implies a VBR bitstream that obeys the bitrate limits. nominal
|
||||||
may also be set to give a nominal rate.
|
may also be set to give a nominal rate.
|
||||||
none set:
|
none set:
|
||||||
the coder does not care to speculate.
|
the coder does not care to speculate.
|
||||||
|
|
@ -91,8 +71,8 @@ extern void vorbis_info_init(vorbis_info *vi);
|
||||||
extern void vorbis_info_clear(vorbis_info *vi);
|
extern void vorbis_info_clear(vorbis_info *vi);
|
||||||
extern int vorbis_info_blocksize(vorbis_info *vi,int zo);
|
extern int vorbis_info_blocksize(vorbis_info *vi,int zo);
|
||||||
extern void vorbis_comment_init(vorbis_comment *vc);
|
extern void vorbis_comment_init(vorbis_comment *vc);
|
||||||
extern void vorbis_comment_add(vorbis_comment *vc, char *comment);
|
extern void vorbis_comment_add(vorbis_comment *vc, char *comment);
|
||||||
extern void vorbis_comment_add_tag(vorbis_comment *vc,
|
extern void vorbis_comment_add_tag(vorbis_comment *vc,
|
||||||
char *tag, char *contents);
|
char *tag, char *contents);
|
||||||
extern char *vorbis_comment_query(vorbis_comment *vc, char *tag, int count);
|
extern char *vorbis_comment_query(vorbis_comment *vc, char *tag, int count);
|
||||||
extern int vorbis_comment_query_count(vorbis_comment *vc, char *tag);
|
extern int vorbis_comment_query_count(vorbis_comment *vc, char *tag);
|
||||||
|
|
@ -100,7 +80,7 @@ extern void vorbis_comment_clear(vorbis_comment *vc);
|
||||||
|
|
||||||
/* Vorbis ERRORS and return codes ***********************************/
|
/* Vorbis ERRORS and return codes ***********************************/
|
||||||
|
|
||||||
#define OV_FALSE -1
|
#define OV_FALSE -1
|
||||||
#define OV_EOF -2
|
#define OV_EOF -2
|
||||||
#define OV_HOLE -3
|
#define OV_HOLE -3
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,39 +1,19 @@
|
||||||
/************************************************************************
|
/********************************************************************
|
||||||
* Copyright (C) 2002-2009, Xiph.org Foundation
|
* *
|
||||||
* Copyright (C) 2010, Robin Watts for Pinknoise Productions Ltd
|
* THIS FILE IS PART OF THE OggVorbis 'TREMOR' CODEC SOURCE CODE. *
|
||||||
* All rights reserved.
|
* *
|
||||||
*
|
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
|
||||||
* modification, are permitted provided that the following conditions
|
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
|
||||||
* are met:
|
* *
|
||||||
*
|
* THE OggVorbis 'TREMOR' SOURCE CODE IS (C) COPYRIGHT 1994-2003 *
|
||||||
* * Redistributions of source code must retain the above copyright
|
* BY THE Xiph.Org FOUNDATION http://www.xiph.org/ *
|
||||||
* 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 names of the Xiph.org Foundation nor Pinknoise
|
|
||||||
* Productions Ltd 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 COPYRIGHT
|
|
||||||
* OWNER 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.
|
|
||||||
************************************************************************
|
|
||||||
|
|
||||||
function: stdio-based convenience library for opening/seeking/decoding
|
function: stdio-based convenience library for opening/seeking/decoding
|
||||||
|
|
||||||
************************************************************************/
|
********************************************************************/
|
||||||
|
|
||||||
#ifndef _OV_FILE_H_
|
#ifndef _OV_FILE_H_
|
||||||
#define _OV_FILE_H_
|
#define _OV_FILE_H_
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,86 @@
|
||||||
|
/********************************************************************
|
||||||
|
* *
|
||||||
|
* THIS FILE IS PART OF THE OggVorbis 'TREMOR' 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 'TREMOR' SOURCE CODE IS (C) COPYRIGHT 1994-2002 *
|
||||||
|
* BY THE Xiph.Org FOUNDATION http://www.xiph.org/ *
|
||||||
|
* *
|
||||||
|
********************************************************************
|
||||||
|
|
||||||
|
function: simple example decoder using vorbisidec
|
||||||
|
|
||||||
|
********************************************************************/
|
||||||
|
|
||||||
|
/* Takes a vorbis bitstream from stdin and writes raw stereo PCM to
|
||||||
|
stdout using vorbisfile. Using vorbisfile is much simpler than
|
||||||
|
dealing with libvorbis. */
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include "ivorbiscodec.h"
|
||||||
|
#include "ivorbisfile.h"
|
||||||
|
|
||||||
|
#ifdef _WIN32 /* We need the following two to set stdin/stdout to binary */
|
||||||
|
#include <io.h>
|
||||||
|
#include <fcntl.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
char pcmout[4096]; /* take 4k out of the data segment, not the stack */
|
||||||
|
|
||||||
|
int main(){
|
||||||
|
OggVorbis_File vf;
|
||||||
|
int eof=0;
|
||||||
|
int current_section;
|
||||||
|
|
||||||
|
#ifdef _WIN32 /* We need to set stdin/stdout to binary mode. Damn windows. */
|
||||||
|
/* Beware the evil ifdef. We avoid these where we can, but this one we
|
||||||
|
cannot. Don't add any more, you'll probably go to hell if you do. */
|
||||||
|
_setmode( _fileno( stdin ), _O_BINARY );
|
||||||
|
_setmode( _fileno( stdout ), _O_BINARY );
|
||||||
|
#endif
|
||||||
|
|
||||||
|
if(ov_open(stdin, &vf, NULL, 0) < 0) {
|
||||||
|
fprintf(stderr,"Input does not appear to be an Ogg bitstream.\n");
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Throw the comments plus a few lines about the bitstream we're
|
||||||
|
decoding */
|
||||||
|
{
|
||||||
|
char **ptr=ov_comment(&vf,-1)->user_comments;
|
||||||
|
vorbis_info *vi=ov_info(&vf,-1);
|
||||||
|
while(*ptr){
|
||||||
|
fprintf(stderr,"%s\n",*ptr);
|
||||||
|
++ptr;
|
||||||
|
}
|
||||||
|
fprintf(stderr,"\nBitstream is %d channel, %ldHz\n",vi->channels,vi->rate);
|
||||||
|
fprintf(stderr,"\nDecoded length: %ld samples\n",
|
||||||
|
(long)ov_pcm_total(&vf,-1));
|
||||||
|
fprintf(stderr,"Encoded by: %s\n\n",ov_comment(&vf,-1)->vendor);
|
||||||
|
}
|
||||||
|
|
||||||
|
while(!eof){
|
||||||
|
long ret=ov_read(&vf,pcmout,sizeof(pcmout),¤t_section);
|
||||||
|
if (ret == 0) {
|
||||||
|
/* EOF */
|
||||||
|
eof=1;
|
||||||
|
} else if (ret < 0) {
|
||||||
|
/* error in the stream. Not a problem, just reporting it in
|
||||||
|
case we (the app) cares. In this case, we don't. */
|
||||||
|
} else {
|
||||||
|
/* we don't bother dealing with sample rate changes, etc, but
|
||||||
|
you'll have to*/
|
||||||
|
fwrite(pcmout,1,ret,stdout);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* cleanup */
|
||||||
|
ov_clear(&vf);
|
||||||
|
|
||||||
|
fprintf(stderr,"Done.\n");
|
||||||
|
return(0);
|
||||||
|
}
|
||||||
|
|
@ -1,39 +1,19 @@
|
||||||
/************************************************************************
|
/********************************************************************
|
||||||
* Copyright (C) 2002-2009, Xiph.org Foundation
|
* *
|
||||||
* Copyright (C) 2010, Robin Watts for Pinknoise Productions Ltd
|
* THIS FILE IS PART OF THE OggVorbis 'TREMOR' CODEC SOURCE CODE. *
|
||||||
* All rights reserved.
|
* *
|
||||||
*
|
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
|
||||||
* modification, are permitted provided that the following conditions
|
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
|
||||||
* are met:
|
* *
|
||||||
*
|
* THE OggVorbis 'TREMOR' SOURCE CODE IS (C) COPYRIGHT 1994-2002 *
|
||||||
* * Redistributions of source code must retain the above copyright
|
* BY THE Xiph.Org FOUNDATION http://www.xiph.org/ *
|
||||||
* 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 names of the Xiph.org Foundation nor Pinknoise
|
|
||||||
* Productions Ltd 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 COPYRIGHT
|
|
||||||
* OWNER 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.
|
|
||||||
************************************************************************
|
|
||||||
|
|
||||||
function: lookup data
|
function: lookup data
|
||||||
|
|
||||||
************************************************************************/
|
********************************************************************/
|
||||||
|
|
||||||
#ifndef _V_LOOKUP_DATA_H_
|
#ifndef _V_LOOKUP_DATA_H_
|
||||||
#define _V_LOOKUP_DATA_H_
|
#define _V_LOOKUP_DATA_H_
|
||||||
|
|
|
||||||
|
|
@ -1,39 +1,19 @@
|
||||||
/************************************************************************
|
/********************************************************************
|
||||||
* Copyright (C) 2002-2009, Xiph.org Foundation
|
* *
|
||||||
* Copyright (C) 2010, Robin Watts for Pinknoise Productions Ltd
|
* THIS FILE IS PART OF THE OggVorbis 'TREMOR' CODEC SOURCE CODE. *
|
||||||
* All rights reserved.
|
* *
|
||||||
*
|
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
|
||||||
* modification, are permitted provided that the following conditions
|
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
|
||||||
* are met:
|
* *
|
||||||
*
|
* THE OggVorbis 'TREMOR' SOURCE CODE IS (C) COPYRIGHT 1994-2003 *
|
||||||
* * Redistributions of source code must retain the above copyright
|
* BY THE Xiph.Org FOUNDATION http://www.xiph.org/ *
|
||||||
* 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 names of the Xiph.org Foundation nor Pinknoise
|
|
||||||
* Productions Ltd 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 COPYRIGHT
|
|
||||||
* OWNER 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.
|
|
||||||
************************************************************************
|
|
||||||
|
|
||||||
function: channel mapping 0 implementation
|
function: channel mapping 0 implementation
|
||||||
|
|
||||||
************************************************************************/
|
********************************************************************/
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
@ -84,8 +64,8 @@ int mapping_info_unpack(vorbis_info_mapping *info,vorbis_info *vi,
|
||||||
_ogg_malloc(info->coupling_steps*sizeof(*info->coupling));
|
_ogg_malloc(info->coupling_steps*sizeof(*info->coupling));
|
||||||
|
|
||||||
for(i=0;i<info->coupling_steps;i++){
|
for(i=0;i<info->coupling_steps;i++){
|
||||||
int testM=info->coupling[i].mag=(unsigned char)(oggpack_read(opb,ilog(vi->channels)));
|
int testM=info->coupling[i].mag=oggpack_read(opb,ilog(vi->channels));
|
||||||
int testA=info->coupling[i].ang=(unsigned char)(oggpack_read(opb,ilog(vi->channels)));
|
int testA=info->coupling[i].ang=oggpack_read(opb,ilog(vi->channels));
|
||||||
|
|
||||||
if(testM<0 ||
|
if(testM<0 ||
|
||||||
testA<0 ||
|
testA<0 ||
|
||||||
|
|
@ -101,7 +81,7 @@ int mapping_info_unpack(vorbis_info_mapping *info,vorbis_info *vi,
|
||||||
if(info->submaps>1){
|
if(info->submaps>1){
|
||||||
info->chmuxlist=_ogg_malloc(sizeof(*info->chmuxlist)*vi->channels);
|
info->chmuxlist=_ogg_malloc(sizeof(*info->chmuxlist)*vi->channels);
|
||||||
for(i=0;i<vi->channels;i++){
|
for(i=0;i<vi->channels;i++){
|
||||||
info->chmuxlist[i]=(unsigned char)(oggpack_read(opb,4));
|
info->chmuxlist[i]=oggpack_read(opb,4);
|
||||||
if(info->chmuxlist[i]>=info->submaps)goto err_out;
|
if(info->chmuxlist[i]>=info->submaps)goto err_out;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -109,9 +89,9 @@ int mapping_info_unpack(vorbis_info_mapping *info,vorbis_info *vi,
|
||||||
info->submaplist=_ogg_malloc(sizeof(*info->submaplist)*info->submaps);
|
info->submaplist=_ogg_malloc(sizeof(*info->submaplist)*info->submaps);
|
||||||
for(i=0;i<info->submaps;i++){
|
for(i=0;i<info->submaps;i++){
|
||||||
int temp=oggpack_read(opb,8);
|
int temp=oggpack_read(opb,8);
|
||||||
info->submaplist[i].floor=(char)oggpack_read(opb,8);
|
info->submaplist[i].floor=oggpack_read(opb,8);
|
||||||
if(info->submaplist[i].floor>=ci->floors)goto err_out;
|
if(info->submaplist[i].floor>=ci->floors)goto err_out;
|
||||||
info->submaplist[i].residue=(char)oggpack_read(opb,8);
|
info->submaplist[i].residue=oggpack_read(opb,8);
|
||||||
if(info->submaplist[i].residue>=ci->residues)goto err_out;
|
if(info->submaplist[i].residue>=ci->residues)goto err_out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,35 +1,15 @@
|
||||||
/************************************************************************
|
/********************************************************************
|
||||||
* Copyright (C) 2002-2009, Xiph.org Foundation
|
* *
|
||||||
* Copyright (C) 2010, Robin Watts for Pinknoise Productions Ltd
|
* THIS FILE IS PART OF THE OggVorbis 'TREMOR' CODEC SOURCE CODE. *
|
||||||
* All rights reserved.
|
* *
|
||||||
*
|
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
|
||||||
* modification, are permitted provided that the following conditions
|
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
|
||||||
* are met:
|
* *
|
||||||
*
|
* THE OggVorbis 'TREMOR' SOURCE CODE IS (C) COPYRIGHT 1994-2003 *
|
||||||
* * Redistributions of source code must retain the above copyright
|
* BY THE Xiph.Org FOUNDATION http://www.xiph.org/ *
|
||||||
* 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 names of the Xiph.org Foundation nor Pinknoise
|
|
||||||
* Productions Ltd 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 COPYRIGHT
|
|
||||||
* OWNER 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.
|
|
||||||
************************************************************************
|
|
||||||
|
|
||||||
function: normalized modified discrete cosine transform
|
function: normalized modified discrete cosine transform
|
||||||
power of two length transform only [64 <= n ]
|
power of two length transform only [64 <= n ]
|
||||||
|
|
@ -50,7 +30,7 @@
|
||||||
happen to like the properties of y=sin(.5PI*sin^2(x)), but others may
|
happen to like the properties of y=sin(.5PI*sin^2(x)), but others may
|
||||||
vehemently disagree.
|
vehemently disagree.
|
||||||
|
|
||||||
************************************************************************/
|
********************************************************************/
|
||||||
|
|
||||||
#include "ivorbiscodec.h"
|
#include "ivorbiscodec.h"
|
||||||
#include "os.h"
|
#include "os.h"
|
||||||
|
|
@ -426,7 +406,7 @@ void mdct_backward(int n, DATA_TYPE *in){
|
||||||
mdct_step8(in,n,step>>2);
|
mdct_step8(in,n,step>>2);
|
||||||
#else
|
#else
|
||||||
step = mdct_backwardARM(n, in);
|
step = mdct_backwardARM(n, in);
|
||||||
if (step <= 1)
|
if (step < 1)
|
||||||
mdct_step8(in,n,step);
|
mdct_step8(in,n,step);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,39 +1,19 @@
|
||||||
/************************************************************************
|
/********************************************************************
|
||||||
* Copyright (C) 2002-2009, Xiph.org Foundation
|
* *
|
||||||
* Copyright (C) 2010, Robin Watts for Pinknoise Productions Ltd
|
* THIS FILE IS PART OF THE OggVorbis 'TREMOR' CODEC SOURCE CODE. *
|
||||||
* All rights reserved.
|
* *
|
||||||
*
|
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
|
||||||
* modification, are permitted provided that the following conditions
|
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
|
||||||
* are met:
|
* *
|
||||||
*
|
* THE OggVorbis 'TREMOR' SOURCE CODE IS (C) COPYRIGHT 1994-2003 *
|
||||||
* * Redistributions of source code must retain the above copyright
|
* BY THE Xiph.Org FOUNDATION http://www.xiph.org/ *
|
||||||
* 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 names of the Xiph.org Foundation nor Pinknoise
|
|
||||||
* Productions Ltd 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 COPYRIGHT
|
|
||||||
* OWNER 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.
|
|
||||||
************************************************************************
|
|
||||||
|
|
||||||
function: modified discrete cosine transform prototypes
|
function: modified discrete cosine transform prototypes
|
||||||
|
|
||||||
************************************************************************/
|
********************************************************************/
|
||||||
|
|
||||||
#ifndef _OGG_mdct_H_
|
#ifndef _OGG_mdct_H_
|
||||||
#define _OGG_mdct_H_
|
#define _OGG_mdct_H_
|
||||||
|
|
|
||||||
|
|
@ -1,38 +1,4 @@
|
||||||
@ Tremolo library
|
.text
|
||||||
@-----------------------------------------------------------------------
|
|
||||||
@ Copyright (C) 2002-2009, Xiph.org Foundation
|
|
||||||
@ Copyright (C) 2010, Robin Watts for Pinknoise Productions Ltd
|
|
||||||
@ All rights reserved.
|
|
||||||
|
|
||||||
@ 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 names of the Xiph.org Foundation nor Pinknoise
|
|
||||||
@ Productions Ltd 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 COPYRIGHT
|
|
||||||
@ OWNER 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.
|
|
||||||
@ ----------------------------------------------------------------------
|
|
||||||
|
|
||||||
.text
|
|
||||||
|
|
||||||
@ full accuracy version
|
@ full accuracy version
|
||||||
|
|
||||||
|
|
@ -43,11 +9,6 @@
|
||||||
.global mdct_unroll_part3
|
.global mdct_unroll_part3
|
||||||
.global mdct_unroll_postlap
|
.global mdct_unroll_postlap
|
||||||
|
|
||||||
.extern sincos_lookup0
|
|
||||||
.extern sincos_lookup1
|
|
||||||
.hidden sincos_lookup0
|
|
||||||
.hidden sincos_lookup1
|
|
||||||
|
|
||||||
mdct_unroll_prelap:
|
mdct_unroll_prelap:
|
||||||
@ r0 = out
|
@ r0 = out
|
||||||
@ r1 = post
|
@ r1 = post
|
||||||
|
|
@ -312,9 +273,7 @@ find_shift_loop:
|
||||||
ADD r4, r1, r0, LSL #1 @ r4 = aX = in+(n>>1)
|
ADD r4, r1, r0, LSL #1 @ r4 = aX = in+(n>>1)
|
||||||
ADD r14,r1, r0 @ r14= in+(n>>2)
|
ADD r14,r1, r0 @ r14= in+(n>>2)
|
||||||
SUB r4, r4, #3*4 @ r4 = aX = in+n2-3
|
SUB r4, r4, #3*4 @ r4 = aX = in+n2-3
|
||||||
ADRL r7, .Lsincos_lookup
|
LDR r5, =sincos_lookup0 @ r5 = T=sincos_lookup0
|
||||||
LDR r5, [r7] @ r5 = T=sincos_lookup0
|
|
||||||
ADD r5, r7
|
|
||||||
|
|
||||||
presymmetry_loop1:
|
presymmetry_loop1:
|
||||||
LDR r7, [r4,#8] @ r6 = s2 = aX[2]
|
LDR r7, [r4,#8] @ r6 = s2 = aX[2]
|
||||||
|
|
@ -322,7 +281,7 @@ presymmetry_loop1:
|
||||||
LDR r6, [r4] @ r6 = s0 = aX[0]
|
LDR r6, [r4] @ r6 = s0 = aX[0]
|
||||||
LDR r10,[r5],r2,LSL #2 @ r10= T[0] T += step
|
LDR r10,[r5],r2,LSL #2 @ r10= T[0] T += step
|
||||||
|
|
||||||
@ XPROD31(s0, s2, T[0], T[1], 0xaX[0], &ax[2])
|
@ XPROD31(s0, s2, T[0], T[1], &aX[0], &ax[2])
|
||||||
SMULL r8, r9, r7, r11 @ (r8, r9) = s2*T[1]
|
SMULL r8, r9, r7, r11 @ (r8, r9) = s2*T[1]
|
||||||
@ stall
|
@ stall
|
||||||
@ stall ?
|
@ stall ?
|
||||||
|
|
@ -346,7 +305,7 @@ presymmetry_loop2:
|
||||||
LDR r7,[r4,#8] @ r6 = s2 = aX[2]
|
LDR r7,[r4,#8] @ r6 = s2 = aX[2]
|
||||||
LDR r11,[r5],-r2,LSL #2 @ r11= T[0] T -= step
|
LDR r11,[r5],-r2,LSL #2 @ r11= T[0] T -= step
|
||||||
|
|
||||||
@ XPROD31(s0, s2, T[1], T[0], 0xaX[0], &ax[2])
|
@ XPROD31(s0, s2, T[1], T[0], &aX[0], &ax[2])
|
||||||
SMULL r8, r9, r6, r10 @ (r8, r9) = s0*T[1]
|
SMULL r8, r9, r6, r10 @ (r8, r9) = s0*T[1]
|
||||||
@ stall
|
@ stall
|
||||||
@ stall ?
|
@ stall ?
|
||||||
|
|
@ -369,9 +328,7 @@ presymmetry_loop2:
|
||||||
@ r2 = step
|
@ r2 = step
|
||||||
@ r3 = shift
|
@ r3 = shift
|
||||||
STMFD r13!,{r3}
|
STMFD r13!,{r3}
|
||||||
ADRL r4, .Lsincos_lookup
|
LDR r5, =sincos_lookup0 @ r5 = T=sincos_lookup0
|
||||||
LDR r5, [r4] @ r5 = T=sincos_lookup0
|
|
||||||
ADD r5, r4
|
|
||||||
ADD r4, r1, r0, LSL #1 @ r4 = aX = in+(n>>1)
|
ADD r4, r1, r0, LSL #1 @ r4 = aX = in+(n>>1)
|
||||||
SUB r4, r4, #4*4 @ r4 = aX = in+(n>>1)-4
|
SUB r4, r4, #4*4 @ r4 = aX = in+(n>>1)-4
|
||||||
LDR r11,[r5,#4] @ r11= T[1]
|
LDR r11,[r5,#4] @ r11= T[1]
|
||||||
|
|
@ -381,7 +338,7 @@ presymmetry_loop3:
|
||||||
LDR r9,[r1,#8-16] @ r9 = ro2 = bX[2]
|
LDR r9,[r1,#8-16] @ r9 = ro2 = bX[2]
|
||||||
LDR r6,[r4] @ r6 = ri0 = aX[0]
|
LDR r6,[r4] @ r6 = ri0 = aX[0]
|
||||||
|
|
||||||
@ XNPROD31( ro2, ro0, T[1], T[0], 0xaX[0], &aX[2] )
|
@ XNPROD31( ro2, ro0, T[1], T[0], &aX[0], &aX[2] )
|
||||||
@ aX[0] = (ro2*T[1] - ro0*T[0])>>31 aX[2] = (ro0*T[1] + ro2*T[0])>>31
|
@ aX[0] = (ro2*T[1] - ro0*T[0])>>31 aX[2] = (ro0*T[1] + ro2*T[0])>>31
|
||||||
SMULL r14,r12,r8, r11 @ (r14,r12) = ro0*T[1]
|
SMULL r14,r12,r8, r11 @ (r14,r12) = ro0*T[1]
|
||||||
RSB r8,r8,#0 @ r8 = -ro0
|
RSB r8,r8,#0 @ r8 = -ro0
|
||||||
|
|
@ -398,7 +355,7 @@ presymmetry_loop3:
|
||||||
MOV r3, r3, LSL #1
|
MOV r3, r3, LSL #1
|
||||||
STR r3, [r4],#-16
|
STR r3, [r4],#-16
|
||||||
|
|
||||||
@ XNPROD31( ri2, ri0, T[0], T[1], 0xbX[0], &bX[2] )
|
@ XNPROD31( ri2, ri0, T[0], T[1], &bX[0], &bX[2] )
|
||||||
@ bX[0] = (ri2*T[0] - ri0*T[1])>>31 bX[2] = (ri0*T[0] + ri2*T[1])>>31
|
@ bX[0] = (ri2*T[0] - ri0*T[1])>>31 bX[2] = (ri0*T[0] + ri2*T[1])>>31
|
||||||
SMULL r14,r12,r6, r10 @ (r14,r12) = ri0*T[0]
|
SMULL r14,r12,r6, r10 @ (r14,r12) = ri0*T[0]
|
||||||
RSB r6,r6,#0 @ r6 = -ri0
|
RSB r6,r6,#0 @ r6 = -ri0
|
||||||
|
|
@ -428,10 +385,8 @@ presymmetry_loop3:
|
||||||
@ r2 = i
|
@ r2 = i
|
||||||
@ r3 = shift
|
@ r3 = shift
|
||||||
STMFD r13!,{r0-r1}
|
STMFD r13!,{r0-r1}
|
||||||
ADRL r4, .Lsincos_lookup
|
|
||||||
LDR r5, [r4]
|
|
||||||
ADD r5, r4
|
|
||||||
RSBS r4,r3,#6 @ r4 = stages = 7-shift then --stages
|
RSBS r4,r3,#6 @ r4 = stages = 7-shift then --stages
|
||||||
|
LDR r5,=sincos_lookup0
|
||||||
BLE no_generics
|
BLE no_generics
|
||||||
MOV r14,#4 @ r14= 4 (i=0)
|
MOV r14,#4 @ r14= 4 (i=0)
|
||||||
MOV r6, r14,LSL r3 @ r6 = (4<<i)<<shift
|
MOV r6, r14,LSL r3 @ r6 = (4<<i)<<shift
|
||||||
|
|
@ -993,7 +948,7 @@ mdct_bufferflies_loop3:
|
||||||
LDMFD r13,{r0-r3}
|
LDMFD r13,{r0-r3}
|
||||||
|
|
||||||
mdct_bitreverseARM:
|
mdct_bitreverseARM:
|
||||||
@ r0 = points = n
|
@ r0 = points
|
||||||
@ r1 = in
|
@ r1 = in
|
||||||
@ r2 = step
|
@ r2 = step
|
||||||
@ r3 = shift
|
@ r3 = shift
|
||||||
|
|
@ -1030,10 +985,8 @@ brev_lp:
|
||||||
@ r3 = shift
|
@ r3 = shift
|
||||||
|
|
||||||
CMP r2, #4 @ r5 = T = (step>=4) ?
|
CMP r2, #4 @ r5 = T = (step>=4) ?
|
||||||
ADR r7, .Lsincos_lookup @ sincos_lookup0 +
|
LDRGE r5, =sincos_lookup0 @ sincos_lookup0 +
|
||||||
ADDLT r7, #4 @ sincos_lookup1
|
LDRLT r5, =sincos_lookup1 @ sincos_lookup0 +
|
||||||
LDR r5, [r7]
|
|
||||||
ADD r5, r7
|
|
||||||
ADD r7, r1, r0, LSL #1 @ r7 = w1 = x + (n>>1)
|
ADD r7, r1, r0, LSL #1 @ r7 = w1 = x + (n>>1)
|
||||||
ADDGE r5, r5, r2, LSL #1 @ (step>>1)
|
ADDGE r5, r5, r2, LSL #1 @ (step>>1)
|
||||||
ADD r8, r5, #1024*4 @ r8 = Ttop
|
ADD r8, r5, #1024*4 @ r8 = Ttop
|
||||||
|
|
@ -1124,10 +1077,8 @@ step7_loop2:
|
||||||
|
|
||||||
@ step > 1 (default case)
|
@ step > 1 (default case)
|
||||||
CMP r2, #4 @ r5 = T = (step>=4) ?
|
CMP r2, #4 @ r5 = T = (step>=4) ?
|
||||||
ADR r7, .Lsincos_lookup @ sincos_lookup0 +
|
LDRGE r5, =sincos_lookup0 @ sincos_lookup0 +
|
||||||
ADDLT r7, #4 @ sincos_lookup1
|
LDRLT r5, =sincos_lookup1 @ sincos_lookup1
|
||||||
LDR r5, [r7]
|
|
||||||
ADD r5, r7
|
|
||||||
ADD r7, r1, r0, LSL #1 @ r7 = iX = x + (n>>1)
|
ADD r7, r1, r0, LSL #1 @ r7 = iX = x + (n>>1)
|
||||||
ADDGE r5, r5, r2, LSL #1 @ (step>>1)
|
ADDGE r5, r5, r2, LSL #1 @ (step>>1)
|
||||||
mdct_step8_default:
|
mdct_step8_default:
|
||||||
|
|
@ -1226,9 +1177,3 @@ bitrev:
|
||||||
.byte 47
|
.byte 47
|
||||||
.byte 31
|
.byte 31
|
||||||
.byte 63
|
.byte 63
|
||||||
|
|
||||||
.Lsincos_lookup:
|
|
||||||
.word sincos_lookup0-.Lsincos_lookup
|
|
||||||
.word sincos_lookup1-(.Lsincos_lookup+4)
|
|
||||||
|
|
||||||
@ END
|
|
||||||
|
|
|
||||||
|
|
@ -1,38 +1,4 @@
|
||||||
@ Tremolo library
|
.text
|
||||||
@-----------------------------------------------------------------------
|
|
||||||
@ Copyright (C) 2002-2009, Xiph.org Foundation
|
|
||||||
@ Copyright (C) 2010, Robin Watts for Pinknoise Productions Ltd
|
|
||||||
@ All rights reserved.
|
|
||||||
|
|
||||||
@ 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 names of the Xiph.org Foundation nor Pinknoise
|
|
||||||
@ Productions Ltd 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 COPYRIGHT
|
|
||||||
@ OWNER 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.
|
|
||||||
@ ----------------------------------------------------------------------
|
|
||||||
|
|
||||||
.text
|
|
||||||
|
|
||||||
@ low accuracy version
|
@ low accuracy version
|
||||||
|
|
||||||
|
|
@ -43,9 +9,6 @@
|
||||||
.global mdct_unroll_part3
|
.global mdct_unroll_part3
|
||||||
.global mdct_unroll_postlap
|
.global mdct_unroll_postlap
|
||||||
|
|
||||||
.extern sincos_lookup0
|
|
||||||
.extern sincos_lookup1
|
|
||||||
|
|
||||||
mdct_unroll_prelap:
|
mdct_unroll_prelap:
|
||||||
@ r0 = out
|
@ r0 = out
|
||||||
@ r1 = post
|
@ r1 = post
|
||||||
|
|
@ -323,7 +286,7 @@ presymmetry_loop1:
|
||||||
MOV r6, r6, ASR #8
|
MOV r6, r6, ASR #8
|
||||||
MOV r7, r7, ASR #8
|
MOV r7, r7, ASR #8
|
||||||
|
|
||||||
@ XPROD31(s0, s2, T[0], T[1], 0xaX[0], &ax[2])
|
@ XPROD31(s0, s2, T[0], T[1], &aX[0], &ax[2])
|
||||||
MUL r9, r6, r10 @ r9 = s0*T[0]
|
MUL r9, r6, r10 @ r9 = s0*T[0]
|
||||||
RSB r6, r6, #0
|
RSB r6, r6, #0
|
||||||
MLA r9, r7, r11,r9 @ r9 += s2*T[1]
|
MLA r9, r7, r11,r9 @ r9 += s2*T[1]
|
||||||
|
|
@ -343,7 +306,7 @@ presymmetry_loop2:
|
||||||
MOV r6, r6, ASR #8
|
MOV r6, r6, ASR #8
|
||||||
MOV r7, r7, ASR #8
|
MOV r7, r7, ASR #8
|
||||||
|
|
||||||
@ XPROD31(s0, s2, T[1], T[0], 0xaX[0], &ax[2])
|
@ XPROD31(s0, s2, T[1], T[0], &aX[0], &ax[2])
|
||||||
MUL r9, r6, r10 @ r9 = s0*T[1]
|
MUL r9, r6, r10 @ r9 = s0*T[1]
|
||||||
RSB r6, r6, #0
|
RSB r6, r6, #0
|
||||||
MLA r9, r7, r11,r9 @ r9 += s2*T[0]
|
MLA r9, r7, r11,r9 @ r9 += s2*T[0]
|
||||||
|
|
@ -374,7 +337,7 @@ presymmetry_loop3:
|
||||||
MOV r9, r9, ASR #8
|
MOV r9, r9, ASR #8
|
||||||
MOV r6, r6, ASR #8
|
MOV r6, r6, ASR #8
|
||||||
|
|
||||||
@ XNPROD31( ro2, ro0, T[1], T[0], 0xaX[0], &aX[2] )
|
@ XNPROD31( ro2, ro0, T[1], T[0], &aX[0], &aX[2] )
|
||||||
@ aX[0] = (ro2*T[1] - ro0*T[0])>>31 aX[2] = (ro0*T[1] + ro2*T[0])>>31
|
@ aX[0] = (ro2*T[1] - ro0*T[0])>>31 aX[2] = (ro0*T[1] + ro2*T[0])>>31
|
||||||
MUL r12,r8, r11 @ r12 = ro0*T[1]
|
MUL r12,r8, r11 @ r12 = ro0*T[1]
|
||||||
MOV r7, r7, ASR #8
|
MOV r7, r7, ASR #8
|
||||||
|
|
@ -387,7 +350,7 @@ presymmetry_loop3:
|
||||||
STR r12,[r4,#16+8]
|
STR r12,[r4,#16+8]
|
||||||
STR r3, [r4,#16]
|
STR r3, [r4,#16]
|
||||||
|
|
||||||
@ XNPROD31( ri2, ri0, T[0], T[1], 0xbX[0], &bX[2] )
|
@ XNPROD31( ri2, ri0, T[0], T[1], &bX[0], &bX[2] )
|
||||||
@ bX[0] = (ri2*T[0] - ri0*T[1])>>31 bX[2] = (ri0*T[0] + ri2*T[1])>>31
|
@ bX[0] = (ri2*T[0] - ri0*T[1])>>31 bX[2] = (ri0*T[0] + ri2*T[1])>>31
|
||||||
MUL r12,r6, r10 @ r12 = ri0*T[0]
|
MUL r12,r6, r10 @ r12 = ri0*T[0]
|
||||||
RSB r6, r6, #0 @ r6 = -ri0
|
RSB r6, r6, #0 @ r6 = -ri0
|
||||||
|
|
@ -987,7 +950,6 @@ mdct_bitreverseARM:
|
||||||
MOV r4, #0 @ r4 = bit = 0
|
MOV r4, #0 @ r4 = bit = 0
|
||||||
ADD r5, r1, r0, LSL #1 @ r5 = w = x + (n>>1)
|
ADD r5, r1, r0, LSL #1 @ r5 = w = x + (n>>1)
|
||||||
ADR r6, bitrev
|
ADR r6, bitrev
|
||||||
SUB r3, r3, #2 @ r3 = shift -= 2
|
|
||||||
SUB r5, r5, #8
|
SUB r5, r5, #8
|
||||||
brev_lp:
|
brev_lp:
|
||||||
LDRB r7, [r6, r4, LSR #6]
|
LDRB r7, [r6, r4, LSR #6]
|
||||||
|
|
@ -996,7 +958,8 @@ brev_lp:
|
||||||
ADD r4, r4, #1 @ bit++
|
ADD r4, r4, #1 @ bit++
|
||||||
@ stall XScale
|
@ stall XScale
|
||||||
ORR r7, r7, r8, LSL #6 @ r7 = bitrev[bit]
|
ORR r7, r7, r8, LSL #6 @ r7 = bitrev[bit]
|
||||||
ADD r9, r1, r7, LSR r3 @ r9 = xx = x + (b>>shift)
|
MOV r7, r7, LSR r3
|
||||||
|
ADD r9, r1, r7, LSL #2 @ r9 = xx = x + (b>>shift)
|
||||||
CMP r5, r9 @ if (w > xx)
|
CMP r5, r9 @ if (w > xx)
|
||||||
LDR r10,[r5],#-8 @ r10 = w[0] w -= 2
|
LDR r10,[r5],#-8 @ r10 = w[0] w -= 2
|
||||||
LDRGT r11,[r5,#12] @ r11 = w[1]
|
LDRGT r11,[r5,#12] @ r11 = w[1]
|
||||||
|
|
@ -1013,7 +976,7 @@ brev_lp:
|
||||||
@ r0 = points
|
@ r0 = points
|
||||||
@ r1 = in
|
@ r1 = in
|
||||||
@ r2 = step
|
@ r2 = step
|
||||||
@ r3 = shift-2
|
@ r3 = shift
|
||||||
|
|
||||||
CMP r2, #4 @ r5 = T = (step>=4) ?
|
CMP r2, #4 @ r5 = T = (step>=4) ?
|
||||||
LDRGE r5, =sincos_lookup0 @ sincos_lookup0 +
|
LDRGE r5, =sincos_lookup0 @ sincos_lookup0 +
|
||||||
|
|
@ -1202,5 +1165,3 @@ bitrev:
|
||||||
.byte 47
|
.byte 47
|
||||||
.byte 31
|
.byte 31
|
||||||
.byte 63
|
.byte 63
|
||||||
|
|
||||||
@ END
|
|
||||||
|
|
|
||||||
|
|
@ -1,39 +1,19 @@
|
||||||
/************************************************************************
|
/********************************************************************
|
||||||
* Copyright (C) 2002-2009, Xiph.org Foundation
|
* *
|
||||||
* Copyright (C) 2010, Robin Watts for Pinknoise Productions Ltd
|
* THIS FILE IS PART OF THE OggVorbis 'TREMOR' CODEC SOURCE CODE. *
|
||||||
* All rights reserved.
|
* *
|
||||||
*
|
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
|
||||||
* modification, are permitted provided that the following conditions
|
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
|
||||||
* are met:
|
* *
|
||||||
*
|
* THE OggVorbis 'TREMOR' SOURCE CODE IS (C) COPYRIGHT 1994-2002 *
|
||||||
* * Redistributions of source code must retain the above copyright
|
* BY THE Xiph.Org FOUNDATION http://www.xiph.org/ *
|
||||||
* 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 names of the Xiph.org Foundation nor Pinknoise
|
|
||||||
* Productions Ltd 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 COPYRIGHT
|
|
||||||
* OWNER 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.
|
|
||||||
************************************************************************
|
|
||||||
|
|
||||||
function: sin,cos lookup tables
|
function: sin,cos lookup tables
|
||||||
|
|
||||||
************************************************************************/
|
********************************************************************/
|
||||||
|
|
||||||
#include "os_types.h"
|
#include "os_types.h"
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,35 +1,14 @@
|
||||||
/************************************************************************
|
/********************************************************************
|
||||||
* Copyright (C) 2002-2009, Xiph.org Foundation
|
* *
|
||||||
* Copyright (C) 2010, Robin Watts for Pinknoise Productions Ltd
|
* THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
|
||||||
* All rights reserved.
|
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
|
||||||
*
|
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
|
||||||
* modification, are permitted provided that the following conditions
|
* *
|
||||||
* are met:
|
* THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2002 *
|
||||||
*
|
* by the XIPHOPHORUS Company http://www.xiph.org/ *
|
||||||
* * 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 names of the Xiph.org Foundation nor Pinknoise
|
|
||||||
* Productions Ltd 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 COPYRIGHT
|
|
||||||
* OWNER 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.
|
|
||||||
************************************************************************/
|
|
||||||
|
|
||||||
#define HEAD_ALIGN 64
|
#define HEAD_ALIGN 64
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
@ -37,7 +16,7 @@
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#define MISC_C
|
#define MISC_C
|
||||||
#include "misc.h"
|
#include "misc.h"
|
||||||
//#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
|
|
||||||
static void **pointers=NULL;
|
static void **pointers=NULL;
|
||||||
static long *insertlist=NULL; /* We can't embed this in the pointer list;
|
static long *insertlist=NULL; /* We can't embed this in the pointer list;
|
||||||
|
|
@ -136,7 +115,7 @@ static void *_insert(void *ptr,long bytes,char *file,long line){
|
||||||
|
|
||||||
global_bytes+=(bytes-HEAD_ALIGN);
|
global_bytes+=(bytes-HEAD_ALIGN);
|
||||||
|
|
||||||
return(void *)(((char *)ptr)+HEAD_ALIGN);
|
return(ptr+HEAD_ALIGN);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void _ripremove(void *ptr){
|
static void _ripremove(void *ptr){
|
||||||
|
|
@ -209,7 +188,7 @@ void _VDBG_dump(void){
|
||||||
extern void *_VDBG_malloc(void *ptr,long bytes,char *file,long line){
|
extern void *_VDBG_malloc(void *ptr,long bytes,char *file,long line){
|
||||||
bytes+=HEAD_ALIGN;
|
bytes+=HEAD_ALIGN;
|
||||||
if(ptr){
|
if(ptr){
|
||||||
ptr=(void *)(((char *)ptr)-HEAD_ALIGN);
|
ptr-=HEAD_ALIGN;
|
||||||
_ripremove(ptr);
|
_ripremove(ptr);
|
||||||
ptr=realloc(ptr,bytes);
|
ptr=realloc(ptr,bytes);
|
||||||
}else{
|
}else{
|
||||||
|
|
@ -219,9 +198,9 @@ extern void *_VDBG_malloc(void *ptr,long bytes,char *file,long line){
|
||||||
return _insert(ptr,bytes,file,line);
|
return _insert(ptr,bytes,file,line);
|
||||||
}
|
}
|
||||||
|
|
||||||
extern void _VDBG_free(void *ptr){
|
extern void _VDBG_free(void *ptr,char *file,long line){
|
||||||
if(ptr){
|
if(ptr){
|
||||||
ptr=(void *)(((char *)ptr)-HEAD_ALIGN);
|
ptr-=HEAD_ALIGN;
|
||||||
_ripremove(ptr);
|
_ripremove(ptr);
|
||||||
free(ptr);
|
free(ptr);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,39 +1,19 @@
|
||||||
/************************************************************************
|
/********************************************************************
|
||||||
* Copyright (C) 2002-2009, Xiph.org Foundation
|
* *
|
||||||
* Copyright (C) 2010, Robin Watts for Pinknoise Productions Ltd
|
* THIS FILE IS PART OF THE OggVorbis 'TREMOR' CODEC SOURCE CODE. *
|
||||||
* All rights reserved.
|
* *
|
||||||
*
|
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
|
||||||
* modification, are permitted provided that the following conditions
|
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
|
||||||
* are met:
|
* *
|
||||||
*
|
* THE OggVorbis 'TREMOR' SOURCE CODE IS (C) COPYRIGHT 1994-2003 *
|
||||||
* * Redistributions of source code must retain the above copyright
|
* BY THE Xiph.Org FOUNDATION http://www.xiph.org/ *
|
||||||
* 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 names of the Xiph.org Foundation nor Pinknoise
|
|
||||||
* Productions Ltd 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 COPYRIGHT
|
|
||||||
* OWNER 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.
|
|
||||||
************************************************************************
|
|
||||||
|
|
||||||
function: miscellaneous math and prototypes
|
function: miscellaneous math and prototypes
|
||||||
|
|
||||||
************************************************************************/
|
********************************************************************/
|
||||||
|
|
||||||
#ifndef _V_RANDOM_H_
|
#ifndef _V_RANDOM_H_
|
||||||
#define _V_RANDOM_H_
|
#define _V_RANDOM_H_
|
||||||
|
|
@ -44,8 +24,8 @@
|
||||||
|
|
||||||
|
|
||||||
#ifdef _VDBG_GRAPHFILE
|
#ifdef _VDBG_GRAPHFILE
|
||||||
extern void *_VDBG_malloc(void *ptr,long bytes,char *file,long line);
|
extern void *_VDBG_malloc(void *ptr,long bytes,char *file,long line);
|
||||||
extern void _VDBG_free(void *ptr);
|
extern void _VDBG_free(void *ptr,char *file,long line);
|
||||||
|
|
||||||
#undef _ogg_malloc
|
#undef _ogg_malloc
|
||||||
#undef _ogg_calloc
|
#undef _ogg_calloc
|
||||||
|
|
@ -55,14 +35,14 @@ extern void _VDBG_free(void *ptr);
|
||||||
#define _ogg_malloc(x) _VDBG_malloc(NULL,(x),__FILE__,__LINE__)
|
#define _ogg_malloc(x) _VDBG_malloc(NULL,(x),__FILE__,__LINE__)
|
||||||
#define _ogg_calloc(x,y) _VDBG_malloc(NULL,(x)*(y),__FILE__,__LINE__)
|
#define _ogg_calloc(x,y) _VDBG_malloc(NULL,(x)*(y),__FILE__,__LINE__)
|
||||||
#define _ogg_realloc(x,y) _VDBG_malloc((x),(y),__FILE__,__LINE__)
|
#define _ogg_realloc(x,y) _VDBG_malloc((x),(y),__FILE__,__LINE__)
|
||||||
#define _ogg_free(x) _VDBG_free((x))
|
#define _ogg_free(x) _VDBG_free((x),__FILE__,__LINE__)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "asm_arm.h"
|
#include "asm_arm.h"
|
||||||
|
|
||||||
#ifndef _V_WIDE_MATH
|
#ifndef _V_WIDE_MATH
|
||||||
#define _V_WIDE_MATH
|
#define _V_WIDE_MATH
|
||||||
|
|
||||||
#ifndef _LOW_ACCURACY_
|
#ifndef _LOW_ACCURACY_
|
||||||
/* 64 bit multiply */
|
/* 64 bit multiply */
|
||||||
|
|
||||||
|
|
@ -77,7 +57,7 @@ union magic {
|
||||||
} halves;
|
} halves;
|
||||||
ogg_int64_t whole;
|
ogg_int64_t whole;
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if BYTE_ORDER==BIG_ENDIAN
|
#if BYTE_ORDER==BIG_ENDIAN
|
||||||
union magic {
|
union magic {
|
||||||
|
|
@ -116,7 +96,7 @@ static inline ogg_int32_t MULT31_SHIFT15(ogg_int32_t x, ogg_int32_t y) {
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* For MULT32 and MULT31: The second argument is always a lookup table
|
* For MULT32 and MULT31: The second argument is always a lookup table
|
||||||
* value already preshifted from 31 to 8 bits. We therefore take the
|
* value already preshifted from 31 to 8 bits. We therefore take the
|
||||||
* opportunity to save on text space and use unsigned char for those
|
* opportunity to save on text space and use unsigned char for those
|
||||||
* tables in this case.
|
* tables in this case.
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -1,39 +1,19 @@
|
||||||
/************************************************************************
|
/********************************************************************
|
||||||
* Copyright (C) 2002-2009, Xiph.org Foundation
|
* *
|
||||||
* Copyright (C) 2010, Robin Watts for Pinknoise Productions Ltd
|
* THIS FILE IS PART OF THE OggVorbis 'TREMOR' CODEC SOURCE CODE. *
|
||||||
* All rights reserved.
|
* *
|
||||||
*
|
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
|
||||||
* modification, are permitted provided that the following conditions
|
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
|
||||||
* are met:
|
* *
|
||||||
*
|
* THE OggVorbis 'TREMOR' SOURCE CODE IS (C) COPYRIGHT 1994-2003 *
|
||||||
* * Redistributions of source code must retain the above copyright
|
* BY THE Xiph.Org FOUNDATION http://www.xiph.org/ *
|
||||||
* 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 names of the Xiph.org Foundation nor Pinknoise
|
|
||||||
* Productions Ltd 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 COPYRIGHT
|
|
||||||
* OWNER 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.
|
|
||||||
************************************************************************
|
|
||||||
|
|
||||||
function: subsumed libogg includes
|
function: subsumed libogg includes
|
||||||
|
|
||||||
************************************************************************/
|
********************************************************************/
|
||||||
#ifndef _OGG_H
|
#ifndef _OGG_H
|
||||||
#define _OGG_H
|
#define _OGG_H
|
||||||
|
|
||||||
|
|
@ -177,14 +157,9 @@ extern long oggpack_bytes(oggpack_buffer *b);
|
||||||
extern long oggpack_bits(oggpack_buffer *b);
|
extern long oggpack_bits(oggpack_buffer *b);
|
||||||
extern int oggpack_eop(oggpack_buffer *b);
|
extern int oggpack_eop(oggpack_buffer *b);
|
||||||
|
|
||||||
// Quick hack
|
|
||||||
#define oggpack_bytesleft(B) (((B)->bitsLeftInSegment+7)/8)
|
|
||||||
|
|
||||||
/* Ogg BITSTREAM PRIMITIVES: decoding **************************/
|
/* Ogg BITSTREAM PRIMITIVES: decoding **************************/
|
||||||
|
|
||||||
extern void ogg_sync_init(ogg_sync_state *oy);
|
|
||||||
extern ogg_sync_state *ogg_sync_create(void);
|
extern ogg_sync_state *ogg_sync_create(void);
|
||||||
extern int ogg_sync_clear(ogg_sync_state *oy);
|
|
||||||
extern int ogg_sync_destroy(ogg_sync_state *oy);
|
extern int ogg_sync_destroy(ogg_sync_state *oy);
|
||||||
extern int ogg_sync_reset(ogg_sync_state *oy);
|
extern int ogg_sync_reset(ogg_sync_state *oy);
|
||||||
|
|
||||||
|
|
@ -198,10 +173,8 @@ extern int ogg_stream_packetpeek(ogg_stream_state *os,ogg_packet *op);
|
||||||
|
|
||||||
/* Ogg BITSTREAM PRIMITIVES: general ***************************/
|
/* Ogg BITSTREAM PRIMITIVES: general ***************************/
|
||||||
|
|
||||||
extern void ogg_stream_init(ogg_stream_state *os, int serialno);
|
|
||||||
extern ogg_stream_state *ogg_stream_create(int serialno);
|
extern ogg_stream_state *ogg_stream_create(int serialno);
|
||||||
extern int ogg_stream_destroy(ogg_stream_state *os);
|
extern int ogg_stream_destroy(ogg_stream_state *os);
|
||||||
extern int ogg_stream_clear(ogg_stream_state *os);
|
|
||||||
extern int ogg_stream_reset(ogg_stream_state *os);
|
extern int ogg_stream_reset(ogg_stream_state *os);
|
||||||
extern int ogg_stream_reset_serialno(ogg_stream_state *os,int serialno);
|
extern int ogg_stream_reset_serialno(ogg_stream_state *os,int serialno);
|
||||||
extern int ogg_stream_eos(ogg_stream_state *os);
|
extern int ogg_stream_eos(ogg_stream_state *os);
|
||||||
|
|
|
||||||
|
|
@ -1,41 +1,21 @@
|
||||||
#ifndef _OS_H
|
#ifndef _OS_H
|
||||||
#define _OS_H
|
#define _OS_H
|
||||||
/************************************************************************
|
/********************************************************************
|
||||||
* Copyright (C) 2002-2009, Xiph.org Foundation
|
* *
|
||||||
* Copyright (C) 2010, Robin Watts for Pinknoise Productions Ltd
|
* THIS FILE IS PART OF THE OggVorbis 'TREMOR' CODEC SOURCE CODE. *
|
||||||
* All rights reserved.
|
* *
|
||||||
*
|
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
|
||||||
* modification, are permitted provided that the following conditions
|
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
|
||||||
* are met:
|
* *
|
||||||
*
|
* THE OggVorbis 'TREMOR' SOURCE CODE IS (C) COPYRIGHT 1994-2002 *
|
||||||
* * Redistributions of source code must retain the above copyright
|
* BY THE Xiph.Org FOUNDATION http://www.xiph.org/ *
|
||||||
* 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 names of the Xiph.org Foundation nor Pinknoise
|
|
||||||
* Productions Ltd 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 COPYRIGHT
|
|
||||||
* OWNER 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.
|
|
||||||
************************************************************************
|
|
||||||
|
|
||||||
function: #ifdef jail to whip a few platforms into the UNIX ideal.
|
function: #ifdef jail to whip a few platforms into the UNIX ideal.
|
||||||
|
|
||||||
************************************************************************/
|
********************************************************************/
|
||||||
|
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include "os_types.h"
|
#include "os_types.h"
|
||||||
|
|
|
||||||
|
|
@ -1,39 +1,19 @@
|
||||||
/************************************************************************
|
/********************************************************************
|
||||||
* Copyright (C) 2002-2009, Xiph.org Foundation
|
* *
|
||||||
* Copyright (C) 2010, Robin Watts for Pinknoise Productions Ltd
|
* THIS FILE IS PART OF THE OggVorbis 'TREMOR' CODEC SOURCE CODE. *
|
||||||
* All rights reserved.
|
* *
|
||||||
*
|
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
|
||||||
* modification, are permitted provided that the following conditions
|
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
|
||||||
* are met:
|
* *
|
||||||
*
|
* THE OggVorbis 'TREMOR' SOURCE CODE IS (C) COPYRIGHT 1994-2002 *
|
||||||
* * Redistributions of source code must retain the above copyright
|
* BY THE Xiph.Org FOUNDATION http://www.xiph.org/ *
|
||||||
* 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 names of the Xiph.org Foundation nor Pinknoise
|
|
||||||
* Productions Ltd 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 COPYRIGHT
|
|
||||||
* OWNER 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.
|
|
||||||
************************************************************************
|
|
||||||
|
|
||||||
function: #ifdef jail to whip a few platforms into the UNIX ideal.
|
function: #ifdef jail to whip a few platforms into the UNIX ideal.
|
||||||
|
|
||||||
************************************************************************/
|
********************************************************************/
|
||||||
#ifndef _OS_TYPES_H
|
#ifndef _OS_TYPES_H
|
||||||
#define _OS_TYPES_H
|
#define _OS_TYPES_H
|
||||||
|
|
||||||
|
|
@ -58,9 +38,7 @@
|
||||||
typedef short ogg_int16_t;
|
typedef short ogg_int16_t;
|
||||||
typedef int ogg_int32_t;
|
typedef int ogg_int32_t;
|
||||||
typedef unsigned int ogg_uint32_t;
|
typedef unsigned int ogg_uint32_t;
|
||||||
typedef __int64 ogg_int64_t;
|
typedef long long ogg_int64_t;
|
||||||
|
|
||||||
#define inline
|
|
||||||
|
|
||||||
#elif defined(_WIN32)
|
#elif defined(_WIN32)
|
||||||
|
|
||||||
|
|
@ -117,7 +95,6 @@
|
||||||
|
|
||||||
# include <sys/types.h>
|
# include <sys/types.h>
|
||||||
# include "config_types.h"
|
# include "config_types.h"
|
||||||
# include <endian.h>
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,110 @@
|
||||||
|
/*
|
||||||
|
* Dead simple processor sampling profiling code.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include "windows.h"
|
||||||
|
|
||||||
|
static int *Profile_table = NULL;
|
||||||
|
static int Profile_table_size = 0;
|
||||||
|
static int Profile_table_granularity = 0;
|
||||||
|
static DWORD (*ProfileFn)(void *);
|
||||||
|
static void *ProfileArgs;
|
||||||
|
static volatile HANDLE threadToProfile = NULL;
|
||||||
|
static volatile HANDLE thread = NULL;
|
||||||
|
static volatile int die = 0;
|
||||||
|
static volatile int taskDone = 0;
|
||||||
|
|
||||||
|
void Profile_dump()
|
||||||
|
{
|
||||||
|
FILE *file;
|
||||||
|
|
||||||
|
die = 1;
|
||||||
|
while (die)
|
||||||
|
{
|
||||||
|
Sleep(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
file = fopen("profile", "wb");
|
||||||
|
if(file == NULL)
|
||||||
|
{
|
||||||
|
Output("Failed to open profile output");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
Output("Dumping profile...");
|
||||||
|
|
||||||
|
fputc('P', file);
|
||||||
|
fputc('R', file);
|
||||||
|
fputc('0', file);
|
||||||
|
fputc('F', file);
|
||||||
|
|
||||||
|
fwrite(&Profile_table_granularity, 4, 1, file);
|
||||||
|
fwrite(Profile_table, 4, Profile_table_size>>2, file);
|
||||||
|
fclose(file);
|
||||||
|
}
|
||||||
|
|
||||||
|
static DWORD ticker(LPVOID dummy)
|
||||||
|
{
|
||||||
|
CONTEXT context;
|
||||||
|
int offset;
|
||||||
|
|
||||||
|
memset(&context, 0, sizeof(CONTEXT));
|
||||||
|
{
|
||||||
|
while (!die)
|
||||||
|
{
|
||||||
|
Sleep(10);
|
||||||
|
context.ContextFlags = CONTEXT_FULL;
|
||||||
|
if (GetThreadContext(thread, &context))
|
||||||
|
{
|
||||||
|
offset = context.Pc & ~0xF0000000;
|
||||||
|
|
||||||
|
offset >>= Profile_table_granularity+2;
|
||||||
|
if (offset >= (Profile_table_size>>2))
|
||||||
|
{
|
||||||
|
offset = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
offset = 0;
|
||||||
|
}
|
||||||
|
Profile_table[offset]++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
die = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Profile_init(int size,
|
||||||
|
int granularity)
|
||||||
|
{
|
||||||
|
HANDLE myThread;
|
||||||
|
|
||||||
|
Profile_table_granularity = granularity;
|
||||||
|
Profile_table_size = (size+(1<<granularity)-1)>>granularity;
|
||||||
|
Profile_table = (int *)malloc(Profile_table_size);
|
||||||
|
if (Profile_table == NULL)
|
||||||
|
{
|
||||||
|
Output("Failed to get memory for Profile table\n");
|
||||||
|
exit(EXIT_FAILURE);
|
||||||
|
}
|
||||||
|
memset(Profile_table, 0, Profile_table_size);
|
||||||
|
|
||||||
|
thread = (HANDLE)GetCurrentThreadId();
|
||||||
|
|
||||||
|
Output("Commencing profiling");
|
||||||
|
myThread = CreateThread(NULL, /* Security Attributes */
|
||||||
|
0,
|
||||||
|
&ticker,
|
||||||
|
NULL,
|
||||||
|
0,
|
||||||
|
NULL);
|
||||||
|
if (myThread == NULL)
|
||||||
|
{
|
||||||
|
Output("Profiler failed to start");
|
||||||
|
exit(EXIT_FAILURE);
|
||||||
|
}
|
||||||
|
|
||||||
|
SetThreadPriority(myThread, THREAD_PRIORITY_ABOVE_NORMAL);
|
||||||
|
}
|
||||||
|
|
@ -1,39 +1,19 @@
|
||||||
/************************************************************************
|
/********************************************************************
|
||||||
* Copyright (C) 2002-2009, Xiph.org Foundation
|
* *
|
||||||
* Copyright (C) 2010, Robin Watts for Pinknoise Productions Ltd
|
* THIS FILE IS PART OF THE OggVorbis 'TREMOR' CODEC SOURCE CODE. *
|
||||||
* All rights reserved.
|
* *
|
||||||
*
|
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
|
||||||
* modification, are permitted provided that the following conditions
|
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
|
||||||
* are met:
|
* *
|
||||||
*
|
* THE OggVorbis 'TREMOR' SOURCE CODE IS (C) COPYRIGHT 1994-2003 *
|
||||||
* * Redistributions of source code must retain the above copyright
|
* BY THE Xiph.Org FOUNDATION http://www.xiph.org/ *
|
||||||
* 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 names of the Xiph.org Foundation nor Pinknoise
|
|
||||||
* Productions Ltd 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 COPYRIGHT
|
|
||||||
* OWNER 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.
|
|
||||||
************************************************************************
|
|
||||||
|
|
||||||
function: residue backend 0, 1 and 2 implementation
|
function: residue backend 0, 1 and 2 implementation
|
||||||
|
|
||||||
************************************************************************/
|
********************************************************************/
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
@ -56,7 +36,7 @@ void res_clear_info(vorbis_info_residue *info){
|
||||||
|
|
||||||
/* vorbis_info is for range checking */
|
/* vorbis_info is for range checking */
|
||||||
int res_unpack(vorbis_info_residue *info,
|
int res_unpack(vorbis_info_residue *info,
|
||||||
vorbis_info *vi,oggpack_buffer *opb){
|
vorbis_info *vi,oggpack_buffer *opb){
|
||||||
int j,k;
|
int j,k;
|
||||||
codec_setup_info *ci=(codec_setup_info *)vi->codec_setup;
|
codec_setup_info *ci=(codec_setup_info *)vi->codec_setup;
|
||||||
memset(info,0,sizeof(*info));
|
memset(info,0,sizeof(*info));
|
||||||
|
|
@ -66,8 +46,8 @@ int res_unpack(vorbis_info_residue *info,
|
||||||
info->begin=oggpack_read(opb,24);
|
info->begin=oggpack_read(opb,24);
|
||||||
info->end=oggpack_read(opb,24);
|
info->end=oggpack_read(opb,24);
|
||||||
info->grouping=oggpack_read(opb,24)+1;
|
info->grouping=oggpack_read(opb,24)+1;
|
||||||
info->partitions=(char)(oggpack_read(opb,6)+1);
|
info->partitions=oggpack_read(opb,6)+1;
|
||||||
info->groupbook=(unsigned char)oggpack_read(opb,8);
|
info->groupbook=oggpack_read(opb,8);
|
||||||
if(info->groupbook>=ci->books)goto errout;
|
if(info->groupbook>=ci->books)goto errout;
|
||||||
|
|
||||||
info->stagemasks=_ogg_malloc(info->partitions*sizeof(*info->stagemasks));
|
info->stagemasks=_ogg_malloc(info->partitions*sizeof(*info->stagemasks));
|
||||||
|
|
@ -83,12 +63,12 @@ int res_unpack(vorbis_info_residue *info,
|
||||||
for(j=0;j<info->partitions;j++){
|
for(j=0;j<info->partitions;j++){
|
||||||
for(k=0;k<8;k++){
|
for(k=0;k<8;k++){
|
||||||
if((info->stagemasks[j]>>k)&1){
|
if((info->stagemasks[j]>>k)&1){
|
||||||
unsigned char book=(unsigned char)oggpack_read(opb,8);
|
unsigned char book=oggpack_read(opb,8);
|
||||||
if(book>=ci->books)goto errout;
|
if(book>=ci->books)goto errout;
|
||||||
info->stagebooks[j*8+k]=book;
|
info->stagebooks[j*8+k]=book;
|
||||||
if(k+1>info->stages)info->stages=k+1;
|
if(k+1>info->stages)info->stages=k+1;
|
||||||
}else
|
}else
|
||||||
info->stagebooks[j*8+k]=0xff;
|
info->stagebooks[j*8+k]=0xff;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -101,8 +81,8 @@ int res_unpack(vorbis_info_residue *info,
|
||||||
}
|
}
|
||||||
|
|
||||||
int res_inverse(vorbis_dsp_state *vd,vorbis_info_residue *info,
|
int res_inverse(vorbis_dsp_state *vd,vorbis_info_residue *info,
|
||||||
ogg_int32_t **in,int *nonzero,int ch){
|
ogg_int32_t **in,int *nonzero,int ch){
|
||||||
|
|
||||||
int i,j,k,s,used=0;
|
int i,j,k,s,used=0;
|
||||||
codec_setup_info *ci=(codec_setup_info *)vd->vi->codec_setup;
|
codec_setup_info *ci=(codec_setup_info *)vd->vi->codec_setup;
|
||||||
codebook *phrasebook=ci->book_param+info->groupbook;
|
codebook *phrasebook=ci->book_param+info->groupbook;
|
||||||
|
|
@ -114,134 +94,132 @@ int res_inverse(vorbis_dsp_state *vd,vorbis_info_residue *info,
|
||||||
int max=pcmend>>1;
|
int max=pcmend>>1;
|
||||||
int end=(info->end<max?info->end:max);
|
int end=(info->end<max?info->end:max);
|
||||||
int n=end-info->begin;
|
int n=end-info->begin;
|
||||||
|
|
||||||
if(n>0){
|
if(n>0){
|
||||||
int partvals=n/samples_per_partition;
|
int partvals=n/samples_per_partition;
|
||||||
int partwords=(partvals+partitions_per_word-1)/partitions_per_word;
|
int partwords=(partvals+partitions_per_word-1)/partitions_per_word;
|
||||||
|
|
||||||
for(i=0;i<ch;i++)
|
for(i=0;i<ch;i++)
|
||||||
if(nonzero[i])
|
if(nonzero[i])
|
||||||
in[used++]=in[i];
|
in[used++]=in[i];
|
||||||
ch=used;
|
ch=used;
|
||||||
|
|
||||||
if(used){
|
if(used){
|
||||||
|
|
||||||
char **partword=(char **)alloca(ch*sizeof(*partword));
|
char **partword=(char **)alloca(ch*sizeof(*partword));
|
||||||
for(j=0;j<ch;j++)
|
for(j=0;j<ch;j++)
|
||||||
partword[j]=(char *)alloca(partwords*partitions_per_word*
|
partword[j]=(char *)alloca(partwords*partitions_per_word*
|
||||||
sizeof(*partword[j]));
|
sizeof(*partword[j]));
|
||||||
|
|
||||||
for(s=0;s<info->stages;s++){
|
for(s=0;s<info->stages;s++){
|
||||||
|
|
||||||
for(i=0;i<partvals;){
|
for(i=0;i<partvals;){
|
||||||
if(s==0){
|
if(s==0){
|
||||||
/* fetch the partition word for each channel */
|
/* fetch the partition word for each channel */
|
||||||
|
|
||||||
partword[0][i+partitions_per_word-1]=1;
|
partword[0][i+partitions_per_word-1]=1;
|
||||||
for(k=partitions_per_word-2;k>=0;k--)
|
for(k=partitions_per_word-2;k>=0;k--)
|
||||||
partword[0][i+k]=partword[0][i+k+1]*info->partitions;
|
partword[0][i+k]=partword[0][i+k+1]*info->partitions;
|
||||||
|
|
||||||
for(j=1;j<ch;j++)
|
for(j=1;j<ch;j++)
|
||||||
for(k=partitions_per_word-1;k>=0;k--)
|
for(k=partitions_per_word-1;k>=0;k--)
|
||||||
partword[j][i+k]=partword[j-1][i+k];
|
partword[j][i+k]=partword[j-1][i+k];
|
||||||
|
|
||||||
for(j=0;j<ch;j++){
|
for(j=0;j<ch;j++){
|
||||||
int temp=vorbis_book_decode(phrasebook,&vd->opb);
|
int temp=vorbis_book_decode(phrasebook,&vd->opb);
|
||||||
if(temp==-1)goto eopbreak;
|
if(temp==-1)goto eopbreak;
|
||||||
|
|
||||||
/* this can be done quickly in assembly due to the quotient
|
/* this can be done quickly in assembly due to the quotient
|
||||||
always being at most six bits */
|
always being at most six bits */
|
||||||
for(k=0;k<partitions_per_word;k++){
|
for(k=0;k<partitions_per_word;k++){
|
||||||
ogg_uint32_t div=partword[j][i+k];
|
ogg_uint32_t div=partword[j][i+k];
|
||||||
partword[j][i+k]=temp/div;
|
partword[j][i+k]=temp/div;
|
||||||
temp-=partword[j][i+k]*div;
|
temp-=partword[j][i+k]*div;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* now we decode residual values for the partitions */
|
/* now we decode residual values for the partitions */
|
||||||
for(k=0;k<partitions_per_word && i<partvals;k++,i++)
|
for(k=0;k<partitions_per_word && i<partvals;k++,i++)
|
||||||
for(j=0;j<ch;j++){
|
for(j=0;j<ch;j++){
|
||||||
long offset=info->begin+i*samples_per_partition;
|
long offset=info->begin+i*samples_per_partition;
|
||||||
int idx = (int)partword[j][i];
|
if(info->stagemasks[(int)partword[j][i]]&(1<<s)){
|
||||||
if(idx < info->partitions && info->stagemasks[idx]&(1<<s)){
|
codebook *stagebook=ci->book_param+
|
||||||
codebook *stagebook=ci->book_param+
|
info->stagebooks[(partword[j][i]<<3)+s];
|
||||||
info->stagebooks[(partword[j][i]<<3)+s];
|
if(info->type){
|
||||||
if(info->type){
|
if(vorbis_book_decodev_add(stagebook,in[j]+offset,&vd->opb,
|
||||||
if(vorbis_book_decodev_add(stagebook,in[j]+offset,&vd->opb,
|
samples_per_partition,-8)==-1)
|
||||||
samples_per_partition,-8)==-1)
|
goto eopbreak;
|
||||||
goto eopbreak;
|
}else{
|
||||||
}else{
|
if(vorbis_book_decodevs_add(stagebook,in[j]+offset,&vd->opb,
|
||||||
if(vorbis_book_decodevs_add(stagebook,in[j]+offset,&vd->opb,
|
samples_per_partition,-8)==-1)
|
||||||
samples_per_partition,-8)==-1)
|
goto eopbreak;
|
||||||
goto eopbreak;
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
int max=(pcmend*ch)>>1;
|
int max=(pcmend*ch)>>1;
|
||||||
int end=(info->end<max?info->end:max);
|
int end=(info->end<max?info->end:max);
|
||||||
int n=end-info->begin;
|
int n=end-info->begin;
|
||||||
|
|
||||||
if(n>0){
|
if(n>0){
|
||||||
int partvals=n/samples_per_partition;
|
int partvals=n/samples_per_partition;
|
||||||
int partwords=(partvals+partitions_per_word-1)/partitions_per_word;
|
int partwords=(partvals+partitions_per_word-1)/partitions_per_word;
|
||||||
|
|
||||||
char *partword=
|
char *partword=
|
||||||
(char *)alloca(partwords*partitions_per_word*sizeof(*partword));
|
(char *)alloca(partwords*partitions_per_word*sizeof(*partword));
|
||||||
int beginoff=info->begin/ch;
|
int beginoff=info->begin/ch;
|
||||||
|
|
||||||
for(i=0;i<ch;i++)if(nonzero[i])break;
|
for(i=0;i<ch;i++)if(nonzero[i])break;
|
||||||
if(i==ch)return(0); /* no nonzero vectors */
|
if(i==ch)return(0); /* no nonzero vectors */
|
||||||
|
|
||||||
samples_per_partition/=ch;
|
samples_per_partition/=ch;
|
||||||
|
|
||||||
for(s=0;s<info->stages;s++){
|
for(s=0;s<info->stages;s++){
|
||||||
for(i=0;i<partvals;){
|
for(i=0;i<partvals;){
|
||||||
|
|
||||||
if(s==0){
|
if(s==0){
|
||||||
int temp;
|
int temp;
|
||||||
partword[i+partitions_per_word-1]=1;
|
partword[i+partitions_per_word-1]=1;
|
||||||
for(k=partitions_per_word-2;k>=0;k--)
|
for(k=partitions_per_word-2;k>=0;k--)
|
||||||
partword[i+k]=partword[i+k+1]*info->partitions;
|
partword[i+k]=partword[i+k+1]*info->partitions;
|
||||||
|
|
||||||
/* fetch the partition word */
|
/* fetch the partition word */
|
||||||
temp=vorbis_book_decode(phrasebook,&vd->opb);
|
temp=vorbis_book_decode(phrasebook,&vd->opb);
|
||||||
if(temp==-1)goto eopbreak;
|
if(temp==-1)goto eopbreak;
|
||||||
|
|
||||||
/* this can be done quickly in assembly due to the quotient
|
/* this can be done quickly in assembly due to the quotient
|
||||||
always being at most six bits */
|
always being at most six bits */
|
||||||
for(k=0;k<partitions_per_word;k++){
|
for(k=0;k<partitions_per_word;k++){
|
||||||
ogg_uint32_t div=partword[i+k];
|
ogg_uint32_t div=partword[i+k];
|
||||||
partword[i+k]=temp/div;
|
partword[i+k]=temp/div;
|
||||||
temp-=partword[i+k]*div;
|
temp-=partword[i+k]*div;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* now we decode residual values for the partitions */
|
/* now we decode residual values for the partitions */
|
||||||
for(k=0;k<partitions_per_word && i<partvals;k++,i++){
|
for(k=0;k<partitions_per_word && i<partvals;k++,i++)
|
||||||
if(partword[i] >= 0 && partword[i] < info->partitions &&
|
if(info->stagemasks[(int)partword[i]]&(1<<s)){
|
||||||
(info->stagemasks[(int)partword[i]] & (1 << s))){
|
codebook *stagebook=ci->book_param+
|
||||||
codebook *stagebook=ci->book_param+
|
info->stagebooks[(partword[i]<<3)+s];
|
||||||
info->stagebooks[(partword[i]<<3)+s];
|
if(vorbis_book_decodevv_add(stagebook,in,
|
||||||
if(vorbis_book_decodevv_add(stagebook,in,
|
i*samples_per_partition+beginoff,ch,
|
||||||
i*samples_per_partition+beginoff,ch,
|
&vd->opb,
|
||||||
&vd->opb,
|
samples_per_partition,-8)==-1)
|
||||||
samples_per_partition,-8)==-1)
|
goto eopbreak;
|
||||||
goto eopbreak;
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
errout:
|
||||||
eopbreak:
|
eopbreak:
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,120 @@
|
||||||
|
.text
|
||||||
|
|
||||||
|
.global stmiaTest
|
||||||
|
.global strTest
|
||||||
|
.global smullTest
|
||||||
|
|
||||||
|
stmiaTest:
|
||||||
|
STMFD r13!,{r4-r12,r14}
|
||||||
|
|
||||||
|
@ r0 = start
|
||||||
|
@ r1 = size
|
||||||
|
@ r2 = loops
|
||||||
|
stmiaTestLoop2:
|
||||||
|
MOV r3,r0
|
||||||
|
MOV r4,r1
|
||||||
|
stmiaTestLoop:
|
||||||
|
STMIA r3!,{r6,r7,r8,r9,r10,r11,r12,r14}
|
||||||
|
MOV r6,#0
|
||||||
|
MOV r6,#0
|
||||||
|
MOV r6,#0
|
||||||
|
MOV r6,#0
|
||||||
|
|
||||||
|
MOV r6,#0
|
||||||
|
MOV r6,#0
|
||||||
|
MOV r6,#0
|
||||||
|
MOV r6,#0
|
||||||
|
|
||||||
|
MOV r6,#0
|
||||||
|
MOV r6,#0
|
||||||
|
MOV r6,#0
|
||||||
|
MOV r6,#0
|
||||||
|
|
||||||
|
MOV r6,#0
|
||||||
|
MOV r6,#0
|
||||||
|
MOV r6,#0
|
||||||
|
MOV r6,#0
|
||||||
|
|
||||||
|
SUBS r4,r4,#8*4
|
||||||
|
BGT stmiaTestLoop
|
||||||
|
|
||||||
|
SUBS r2,r2,#1
|
||||||
|
BGT stmiaTestLoop2
|
||||||
|
|
||||||
|
|
||||||
|
LDMFD r13!,{r4-r12,PC}
|
||||||
|
|
||||||
|
strTest:
|
||||||
|
STMFD r13!,{r4-r12,r14}
|
||||||
|
|
||||||
|
@ r0 = start
|
||||||
|
@ r1 = size
|
||||||
|
@ r2 = loops
|
||||||
|
strTestLoop2:
|
||||||
|
MOV r3,r0
|
||||||
|
MOV r4,r1
|
||||||
|
strTestLoop:
|
||||||
|
STR r6,[r3],#4
|
||||||
|
STR r7,[r3],#4
|
||||||
|
STR r8,[r3],#4
|
||||||
|
STR r9,[r3],#4
|
||||||
|
STR r10,[r3],#4
|
||||||
|
STR r11,[r3],#4
|
||||||
|
STR r12,[r3],#4
|
||||||
|
STR r14,[r3],#4
|
||||||
|
@STMIA r3!,{r6,r7,r8,r9,r10,r11,r12,r14}
|
||||||
|
MOV r6,#0
|
||||||
|
MOV r6,#0
|
||||||
|
MOV r6,#0
|
||||||
|
MOV r6,#0
|
||||||
|
|
||||||
|
MOV r6,#0
|
||||||
|
MOV r6,#0
|
||||||
|
MOV r6,#0
|
||||||
|
MOV r6,#0
|
||||||
|
|
||||||
|
MOV r6,#0
|
||||||
|
MOV r6,#0
|
||||||
|
MOV r6,#0
|
||||||
|
MOV r6,#0
|
||||||
|
|
||||||
|
MOV r6,#0
|
||||||
|
MOV r6,#0
|
||||||
|
MOV r6,#0
|
||||||
|
MOV r6,#0
|
||||||
|
|
||||||
|
SUBS r4,r4,#8*4
|
||||||
|
BGT strTestLoop
|
||||||
|
|
||||||
|
SUBS r2,r2,#1
|
||||||
|
BGT strTestLoop2
|
||||||
|
|
||||||
|
LDMFD r13!,{r4-r12,PC}
|
||||||
|
|
||||||
|
smullTest:
|
||||||
|
STMFD r13!,{r4-r12,r14}
|
||||||
|
|
||||||
|
@ r0 = start
|
||||||
|
@ r1 = size
|
||||||
|
@ r2 = loops
|
||||||
|
smullTestLoop2:
|
||||||
|
MVN r7,#0xAA000000
|
||||||
|
MVN r8,#0xAA000000
|
||||||
|
MOV r3,r0
|
||||||
|
MOV r4,r1
|
||||||
|
smullTestLoop:
|
||||||
|
SMULL r14,r12,r7,r8
|
||||||
|
MOV r6,#0
|
||||||
|
SMLAL r14,r12,r7,r8
|
||||||
|
MOV r6,#0
|
||||||
|
SMULL r14,r11,r7,r8
|
||||||
|
MOV r6,#0
|
||||||
|
SMLAL r14,r11,r7,r8
|
||||||
|
|
||||||
|
SUBS r4,r4,#8*4
|
||||||
|
BGT smullTestLoop
|
||||||
|
|
||||||
|
SUBS r2,r2,#1
|
||||||
|
BGT smullTestLoop2
|
||||||
|
|
||||||
|
LDMFD r13!,{r4-r12,PC}
|
||||||
|
|
@ -0,0 +1,423 @@
|
||||||
|
/********************************************************************
|
||||||
|
* *
|
||||||
|
* THIS FILE IS PART OF THE OggVorbis 'TREMOR' 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 'TREMOR' SOURCE CODE IS (C) COPYRIGHT 1994-2002 *
|
||||||
|
* BY THE Xiph.Org FOUNDATION http://www.xiph.org/ *
|
||||||
|
* *
|
||||||
|
********************************************************************
|
||||||
|
|
||||||
|
function: simple example decoder using vorbisidec
|
||||||
|
|
||||||
|
********************************************************************/
|
||||||
|
|
||||||
|
/* Takes a vorbis bitstream from stdin and writes raw stereo PCM to
|
||||||
|
stdout using vorbisfile. Using vorbisfile is much simpler than
|
||||||
|
dealing with libvorbis. */
|
||||||
|
|
||||||
|
#include <stdarg.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include "ivorbiscodec.h"
|
||||||
|
#include "ivorbisfile.h"
|
||||||
|
#include "time.h"
|
||||||
|
#include "windows.h"
|
||||||
|
|
||||||
|
#define PROFILE
|
||||||
|
|
||||||
|
#ifdef _WIN32 /* We need the following two to set stdin/stdout to binary */
|
||||||
|
#include <io.h>
|
||||||
|
#include <fcntl.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
char pcmout[4096]; /* take 4k out of the data segment, not the stack */
|
||||||
|
char ref[4096]; /* take 4k out of the data segment, not the stack */
|
||||||
|
char text[4096];
|
||||||
|
|
||||||
|
void Output(const char *fmt, ...)
|
||||||
|
{
|
||||||
|
#ifdef _WIN32_WCE
|
||||||
|
va_list ap;
|
||||||
|
char *t = text;
|
||||||
|
WCHAR uni[4096];
|
||||||
|
WCHAR *u = uni;
|
||||||
|
|
||||||
|
va_start(ap,fmt);
|
||||||
|
vsprintf(text, fmt, ap);
|
||||||
|
va_end(ap);
|
||||||
|
|
||||||
|
while (*t != 0)
|
||||||
|
{
|
||||||
|
*u++ = (WCHAR)(*t++);
|
||||||
|
}
|
||||||
|
*u++ = 0;
|
||||||
|
OutputDebugString(uni);
|
||||||
|
#else
|
||||||
|
vfprintf(stderr, fmt, ap);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
FILE *in;
|
||||||
|
FILE *out;
|
||||||
|
FILE *refin;
|
||||||
|
FILE *refout;
|
||||||
|
int max_samples;
|
||||||
|
} TestParams;
|
||||||
|
|
||||||
|
static DWORD run_test(void *tp)
|
||||||
|
{
|
||||||
|
TestParams *params = (TestParams *)tp;
|
||||||
|
FILE *in = params->in;
|
||||||
|
FILE *out = params->out;
|
||||||
|
FILE *refin = params->refin;
|
||||||
|
FILE *refout = params->refout;
|
||||||
|
int max_samples = params->max_samples;
|
||||||
|
OggVorbis_File vf;
|
||||||
|
int eof=0;
|
||||||
|
int current_section;
|
||||||
|
int maxdiff = 0;
|
||||||
|
int countdiffs = 0;
|
||||||
|
int samples = 0;
|
||||||
|
|
||||||
|
if(ov_open(in, &vf, NULL, 0) < 0) {
|
||||||
|
Output("Input does not appear to be an Ogg bitstream.\n");
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Throw the comments plus a few lines about the bitstream we're
|
||||||
|
decoding */
|
||||||
|
{
|
||||||
|
char **ptr=ov_comment(&vf,-1)->user_comments;
|
||||||
|
vorbis_info *vi=ov_info(&vf,-1);
|
||||||
|
if (out != NULL)
|
||||||
|
{
|
||||||
|
while(*ptr){
|
||||||
|
Output("%s\n",*ptr);
|
||||||
|
++ptr;
|
||||||
|
}
|
||||||
|
Output("\nBitstream is %d channel, %ldHz\n",vi->channels,vi->rate);
|
||||||
|
Output("\nDecoded length: %ld samples\n",
|
||||||
|
(long)ov_pcm_total(&vf,-1));
|
||||||
|
Output("Encoded by: %s\n\n",ov_comment(&vf,-1)->vendor);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
while((!eof) && (max_samples > 0)){
|
||||||
|
long ret=ov_read(&vf,pcmout,sizeof(pcmout),¤t_section);
|
||||||
|
if (ret == 0) {
|
||||||
|
/* EOF */
|
||||||
|
eof=1;
|
||||||
|
} else if (ret < 0) {
|
||||||
|
/* error in the stream. Not a problem, just reporting it in
|
||||||
|
case we (the app) cares. In this case, we don't. */
|
||||||
|
} else {
|
||||||
|
/* we don't bother dealing with sample rate changes, etc, but
|
||||||
|
you'll have to*/
|
||||||
|
if (out != NULL)
|
||||||
|
{
|
||||||
|
fwrite(pcmout,1,ret,out);
|
||||||
|
}
|
||||||
|
max_samples -= ret>>1;
|
||||||
|
if (refout != NULL)
|
||||||
|
{
|
||||||
|
fwrite(pcmout,1,ret,refout);
|
||||||
|
samples += ret>>1;
|
||||||
|
Output("%d", samples);
|
||||||
|
}
|
||||||
|
if (refin != NULL)
|
||||||
|
{
|
||||||
|
int i, diff;
|
||||||
|
|
||||||
|
fread(ref,1,ret,refin);
|
||||||
|
for (i=0; i<(ret>>1);i++)
|
||||||
|
{
|
||||||
|
diff = ((short *)pcmout)[i] - ((short *)ref)[i];
|
||||||
|
if (diff != 0)
|
||||||
|
{
|
||||||
|
if (diff < 0)
|
||||||
|
diff = -diff;
|
||||||
|
if (diff > maxdiff)
|
||||||
|
maxdiff = diff;
|
||||||
|
countdiffs++;
|
||||||
|
if (countdiffs < 50)
|
||||||
|
{
|
||||||
|
Output("samples differ: %x vs %x\n",
|
||||||
|
((unsigned short *)pcmout)[i],
|
||||||
|
((unsigned short *)ref)[i]);
|
||||||
|
}
|
||||||
|
else if ((countdiffs % 100) == 0)
|
||||||
|
{
|
||||||
|
Output("%d differences, maximum = %d\n",
|
||||||
|
countdiffs, maxdiff);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* cleanup */
|
||||||
|
ov_clear(&vf);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int filetimetoms(FILETIME *time)
|
||||||
|
{
|
||||||
|
unsigned long long l;
|
||||||
|
|
||||||
|
l = ((unsigned long long)time->dwLowDateTime) + (((unsigned long long)time->dwHighDateTime)<<32);
|
||||||
|
|
||||||
|
return (int)(l/10000);
|
||||||
|
}
|
||||||
|
|
||||||
|
char speedblock[32768];
|
||||||
|
void speedtest()
|
||||||
|
{
|
||||||
|
int readtime;
|
||||||
|
FILETIME userStartTime, userStopTime;
|
||||||
|
FILETIME kernelStartTime, kernelStopTime;
|
||||||
|
FILETIME exitStartTime, exitStopTime;
|
||||||
|
FILETIME creationStartTime, creationStopTime;
|
||||||
|
|
||||||
|
Output("Speed test: STMIA speed\n");
|
||||||
|
|
||||||
|
GetThreadTimes(GetCurrentThread(),
|
||||||
|
&creationStartTime,
|
||||||
|
&exitStartTime,
|
||||||
|
&kernelStartTime,
|
||||||
|
&userStartTime);
|
||||||
|
stmiaTest(speedblock, 32768, 65536);
|
||||||
|
GetThreadTimes(GetCurrentThread(),
|
||||||
|
&creationStopTime,
|
||||||
|
&exitStopTime,
|
||||||
|
&kernelStopTime,
|
||||||
|
&userStopTime);
|
||||||
|
readtime = filetimetoms(&userStopTime)-filetimetoms(&userStartTime);
|
||||||
|
Output("Speed test complete: Timing=%g\n",
|
||||||
|
((double)readtime)/1000);
|
||||||
|
|
||||||
|
Output("Speed test: STR speed\n");
|
||||||
|
|
||||||
|
GetThreadTimes(GetCurrentThread(),
|
||||||
|
&creationStartTime,
|
||||||
|
&exitStartTime,
|
||||||
|
&kernelStartTime,
|
||||||
|
&userStartTime);
|
||||||
|
strTest(speedblock, 32768, 65536);
|
||||||
|
GetThreadTimes(GetCurrentThread(),
|
||||||
|
&creationStopTime,
|
||||||
|
&exitStopTime,
|
||||||
|
&kernelStopTime,
|
||||||
|
&userStopTime);
|
||||||
|
readtime = filetimetoms(&userStopTime)-filetimetoms(&userStartTime);
|
||||||
|
Output("Speed test complete: Timing=%g\n",
|
||||||
|
((double)readtime)/1000);
|
||||||
|
|
||||||
|
Output("Speed test: SMULL speed\n");
|
||||||
|
|
||||||
|
GetThreadTimes(GetCurrentThread(),
|
||||||
|
&creationStartTime,
|
||||||
|
&exitStartTime,
|
||||||
|
&kernelStartTime,
|
||||||
|
&userStartTime);
|
||||||
|
smullTest(speedblock, 32768, 65536);
|
||||||
|
GetThreadTimes(GetCurrentThread(),
|
||||||
|
&creationStopTime,
|
||||||
|
&exitStopTime,
|
||||||
|
&kernelStopTime,
|
||||||
|
&userStopTime);
|
||||||
|
readtime = filetimetoms(&userStopTime)-filetimetoms(&userStartTime);
|
||||||
|
Output("Speed test complete: Timing=%g\n",
|
||||||
|
((double)readtime)/1000);
|
||||||
|
}
|
||||||
|
|
||||||
|
int main(int argc, char *argv[]){
|
||||||
|
FILE *in;
|
||||||
|
FILE *out = NULL;
|
||||||
|
FILE *refin = NULL;
|
||||||
|
FILE *refout = NULL;
|
||||||
|
int dectime, readtime;
|
||||||
|
FILETIME userStartTime, userStopTime;
|
||||||
|
FILETIME kernelStartTime, kernelStopTime;
|
||||||
|
FILETIME exitStartTime, exitStopTime;
|
||||||
|
FILETIME creationStartTime, creationStopTime;
|
||||||
|
TestParams params;
|
||||||
|
|
||||||
|
if (argc < 2)
|
||||||
|
{
|
||||||
|
Output("Syntax: testtremor <infile> [<outfile>]\n");
|
||||||
|
exit(EXIT_FAILURE);
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifdef PROFILE
|
||||||
|
in = fopen(argv[1], "rb");
|
||||||
|
if (in == NULL)
|
||||||
|
{
|
||||||
|
Output("Failed to open '%s' for input\n", argv[1]);
|
||||||
|
exit(EXIT_FAILURE);
|
||||||
|
}
|
||||||
|
|
||||||
|
params.in = in;
|
||||||
|
params.out = NULL;
|
||||||
|
params.refin = NULL;
|
||||||
|
params.refout = NULL;
|
||||||
|
params.max_samples = 0x7FFFFFFF;
|
||||||
|
Profile_init(184000, 4);
|
||||||
|
run_test(¶ms);
|
||||||
|
Profile_dump();
|
||||||
|
#else
|
||||||
|
in = fopen(argv[1], "rb");
|
||||||
|
if (in == NULL)
|
||||||
|
{
|
||||||
|
Output("Failed to open '%s' for input\n", argv[1]);
|
||||||
|
exit(EXIT_FAILURE);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (argc >= 3)
|
||||||
|
{
|
||||||
|
out = fopen(argv[2], "wb");
|
||||||
|
if (out == NULL)
|
||||||
|
{
|
||||||
|
Output("Failed to open '%s' for output\n", argv[2]);
|
||||||
|
exit(EXIT_FAILURE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (argc >= 4)
|
||||||
|
{
|
||||||
|
refin = fopen(argv[3], "rb");
|
||||||
|
if (refin == NULL)
|
||||||
|
{
|
||||||
|
Output("Can't find reference file. Creating instead.\n");
|
||||||
|
refout = fopen(argv[3], "wb");
|
||||||
|
if (refout == NULL)
|
||||||
|
{
|
||||||
|
Output("Failed to open '%s' as output reference file\n", argv[3]);
|
||||||
|
exit(EXIT_FAILURE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Output("First test: Decode correctness\n");
|
||||||
|
params.in = in;
|
||||||
|
params.out = out;
|
||||||
|
params.refin = refin;
|
||||||
|
params.refout = refout;
|
||||||
|
params.max_samples = 1*1024*1024;
|
||||||
|
run_test(¶ms);
|
||||||
|
Output("First test complete\n");
|
||||||
|
if (out != NULL)
|
||||||
|
fclose(out);
|
||||||
|
if (refin != NULL)
|
||||||
|
fclose(refin);
|
||||||
|
if (refout != NULL)
|
||||||
|
fclose(refout);
|
||||||
|
Output("Second test: Decode speed\n");
|
||||||
|
in = fopen(argv[1], "rb");
|
||||||
|
if (in == NULL)
|
||||||
|
{
|
||||||
|
Output("Failed to open '%s' for input\n", argv[1]);
|
||||||
|
exit(EXIT_FAILURE);
|
||||||
|
}
|
||||||
|
GetThreadTimes(GetCurrentThread(),
|
||||||
|
&creationStartTime,
|
||||||
|
&exitStartTime,
|
||||||
|
&kernelStartTime,
|
||||||
|
&userStartTime);
|
||||||
|
params.in = in;
|
||||||
|
params.out = NULL;
|
||||||
|
params.refin = NULL;
|
||||||
|
params.refout = NULL;
|
||||||
|
params.max_samples = 0x7FFFFFFF;
|
||||||
|
run_test(¶ms);
|
||||||
|
GetThreadTimes(GetCurrentThread(),
|
||||||
|
&creationStopTime,
|
||||||
|
&exitStopTime,
|
||||||
|
&kernelStopTime,
|
||||||
|
&userStopTime);
|
||||||
|
|
||||||
|
dectime = filetimetoms(&userStopTime)-filetimetoms(&userStartTime);
|
||||||
|
Output("Second test complete: Timing=%g\n",
|
||||||
|
((double)dectime)/1000);
|
||||||
|
Output("Third test: File read speed\n");
|
||||||
|
|
||||||
|
in = fopen(argv[1], "rb");
|
||||||
|
if (in == NULL)
|
||||||
|
{
|
||||||
|
Output("Failed to open '%s' for input\n", argv[1]);
|
||||||
|
exit(EXIT_FAILURE);
|
||||||
|
}
|
||||||
|
GetThreadTimes(GetCurrentThread(),
|
||||||
|
&creationStartTime,
|
||||||
|
&exitStartTime,
|
||||||
|
&kernelStartTime,
|
||||||
|
&userStartTime);
|
||||||
|
while (!feof(in))
|
||||||
|
{
|
||||||
|
fread(pcmout,1,4096,in);
|
||||||
|
}
|
||||||
|
GetThreadTimes(GetCurrentThread(),
|
||||||
|
&creationStopTime,
|
||||||
|
&exitStopTime,
|
||||||
|
&kernelStopTime,
|
||||||
|
&userStopTime);
|
||||||
|
readtime = filetimetoms(&userStopTime)-filetimetoms(&userStartTime);
|
||||||
|
Output("Third test complete: Timing=%g\n",
|
||||||
|
((double)readtime)/1000);
|
||||||
|
Output("Adjusted decode time: Timing=%g\n",
|
||||||
|
((double)(dectime-readtime))/1000);
|
||||||
|
#endif
|
||||||
|
Output("Done.\n");
|
||||||
|
return(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifdef _WIN32_WCE
|
||||||
|
|
||||||
|
#define TESTFILE 0
|
||||||
|
|
||||||
|
int WinMain(HINSTANCE h,HINSTANCE i,LPWSTR l,int n)
|
||||||
|
{
|
||||||
|
#if TESTFILE == 9
|
||||||
|
char *argv[] = { "testtremor",
|
||||||
|
"\\Storage Card\\Tremolo\\infile9.ogg",
|
||||||
|
"\\Storage Card\\Tremolo\\output9.pcm",
|
||||||
|
#ifdef _LOW_ACCURACY_
|
||||||
|
"\\Storage Card\\Tremolo\\outputL9.ref",
|
||||||
|
#else
|
||||||
|
"\\Storage Card\\Tremolo\\output9.ref",
|
||||||
|
#endif /* _LOW_ACCURACY_ */
|
||||||
|
NULL };
|
||||||
|
#endif
|
||||||
|
#if TESTFILE == 2
|
||||||
|
char *argv[] = { "testtremor",
|
||||||
|
"\\Storage Card\\Tremolo\\infile2.ogg",
|
||||||
|
"\\Storage Card\\Tremolo\\output2.pcm",
|
||||||
|
#ifdef _LOW_ACCURACY_
|
||||||
|
"\\Storage Card\\Tremolo\\outputL2.ref",
|
||||||
|
#else
|
||||||
|
"\\Storage Card\\Tremolo\\output2.ref",
|
||||||
|
#endif /* _LOW_ACCURACY_ */
|
||||||
|
NULL };
|
||||||
|
#endif
|
||||||
|
#if TESTFILE == 0
|
||||||
|
char *argv[] = { "testtremor",
|
||||||
|
"\\Storage Card\\Tremolo\\infile.ogg",
|
||||||
|
"\\Storage Card\\Tremolo\\output.pcm",
|
||||||
|
#ifdef _LOW_ACCURACY_
|
||||||
|
"\\Storage Card\\Tremolo\\outputL.ref",
|
||||||
|
#else
|
||||||
|
"\\Storage Card\\Tremolo\\output.ref",
|
||||||
|
#endif /* _LOW_ACCURACY_ */
|
||||||
|
NULL };
|
||||||
|
#endif
|
||||||
|
return main(4, argv);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
@ -1,44 +1,24 @@
|
||||||
/************************************************************************
|
/********************************************************************
|
||||||
* Copyright (C) 2002-2009, Xiph.org Foundation
|
* *
|
||||||
* Copyright (C) 2010, Robin Watts for Pinknoise Productions Ltd
|
* THIS FILE IS PART OF THE OggVorbis 'TREMOR' CODEC SOURCE CODE. *
|
||||||
* All rights reserved.
|
* *
|
||||||
*
|
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
|
||||||
* modification, are permitted provided that the following conditions
|
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
|
||||||
* are met:
|
* *
|
||||||
*
|
* THE OggVorbis 'TREMOR' SOURCE CODE IS (C) COPYRIGHT 1994-2003 *
|
||||||
* * Redistributions of source code must retain the above copyright
|
* BY THE Xiph.Org FOUNDATION http://www.xiph.org/ *
|
||||||
* 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 names of the Xiph.org Foundation nor Pinknoise
|
|
||||||
* Productions Ltd 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 COPYRIGHT
|
|
||||||
* OWNER 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.
|
|
||||||
************************************************************************
|
|
||||||
|
|
||||||
function: stdio-based convenience library for opening/seeking/decoding
|
function: stdio-based convenience library for opening/seeking/decoding
|
||||||
last mod: $Id: vorbisfile.c,v 1.6.2.5 2003/11/20 06:16:17 xiphmont Exp $
|
last mod: $Id: vorbisfile.c,v 1.6.2.5 2003/11/20 06:16:17 xiphmont Exp $
|
||||||
|
|
||||||
************************************************************************/
|
********************************************************************/
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
//#include <gerrno.h>
|
#include <errno.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
|
||||||
|
|
@ -48,8 +28,6 @@
|
||||||
#include "os.h"
|
#include "os.h"
|
||||||
#include "misc.h"
|
#include "misc.h"
|
||||||
|
|
||||||
int gerrno;
|
|
||||||
|
|
||||||
#define NOTOPEN 0
|
#define NOTOPEN 0
|
||||||
#define PARTOPEN 1
|
#define PARTOPEN 1
|
||||||
#define OPENED 2
|
#define OPENED 2
|
||||||
|
|
@ -81,20 +59,20 @@ int gerrno;
|
||||||
we only want coarse navigation through the stream. */
|
we only want coarse navigation through the stream. */
|
||||||
|
|
||||||
/*************************************************************************
|
/*************************************************************************
|
||||||
* Many, many internal helpers. The intention is not to be confusing;
|
* Many, many internal helpers. The intention is not to be confusing;
|
||||||
* rampant duplication and monolithic function implementation would be
|
* rampant duplication and monolithic function implementation would be
|
||||||
* harder to understand anyway. The high level functions are last. Begin
|
* harder to understand anyway. The high level functions are last. Begin
|
||||||
* grokking near the end of the file */
|
* grokking near the end of the file */
|
||||||
|
|
||||||
|
|
||||||
/* read a little more data from the file/pipe into the ogg_sync framer */
|
/* read a little more data from the file/pipe into the ogg_sync framer */
|
||||||
static long _get_data(OggVorbis_File *vf){
|
static long _get_data(OggVorbis_File *vf){
|
||||||
gerrno=0;
|
errno=0;
|
||||||
if(vf->datasource){
|
if(vf->datasource){
|
||||||
unsigned char *buffer=ogg_sync_bufferin(vf->oy,CHUNKSIZE);
|
unsigned char *buffer=ogg_sync_bufferin(vf->oy,CHUNKSIZE);
|
||||||
long bytes=(vf->callbacks.read_func)(buffer,1,CHUNKSIZE,vf->datasource);
|
long bytes=(vf->callbacks.read_func)(buffer,1,CHUNKSIZE,vf->datasource);
|
||||||
if(bytes>0)ogg_sync_wrote(vf->oy,bytes);
|
if(bytes>0)ogg_sync_wrote(vf->oy,bytes);
|
||||||
if(bytes==0 && gerrno)return -1;
|
if(bytes==0 && errno)return -1;
|
||||||
return bytes;
|
return bytes;
|
||||||
}else
|
}else
|
||||||
return 0;
|
return 0;
|
||||||
|
|
@ -102,7 +80,7 @@ static long _get_data(OggVorbis_File *vf){
|
||||||
|
|
||||||
/* save a tiny smidge of verbosity to make the code more readable */
|
/* save a tiny smidge of verbosity to make the code more readable */
|
||||||
static void _seek_helper(OggVorbis_File *vf,ogg_int64_t offset){
|
static void _seek_helper(OggVorbis_File *vf,ogg_int64_t offset){
|
||||||
if(vf->datasource){
|
if(vf->datasource){
|
||||||
(vf->callbacks.seek_func)(vf->datasource, offset, SEEK_SET);
|
(vf->callbacks.seek_func)(vf->datasource, offset, SEEK_SET);
|
||||||
vf->offset=offset;
|
vf->offset=offset;
|
||||||
ogg_sync_reset(vf->oy);
|
ogg_sync_reset(vf->oy);
|
||||||
|
|
@ -123,7 +101,7 @@ static void _seek_helper(OggVorbis_File *vf,ogg_int64_t offset){
|
||||||
n) search for a new page beginning for n bytes
|
n) search for a new page beginning for n bytes
|
||||||
|
|
||||||
return: <0) did not find a page (OV_FALSE, OV_EOF, OV_EREAD)
|
return: <0) did not find a page (OV_FALSE, OV_EOF, OV_EREAD)
|
||||||
n) found a page at absolute offset n
|
n) found a page at absolute offset n
|
||||||
|
|
||||||
produces a refcounted page */
|
produces a refcounted page */
|
||||||
|
|
||||||
|
|
@ -135,7 +113,7 @@ static ogg_int64_t _get_next_page(OggVorbis_File *vf,ogg_page *og,
|
||||||
|
|
||||||
if(boundary>0 && vf->offset>=boundary)return OV_FALSE;
|
if(boundary>0 && vf->offset>=boundary)return OV_FALSE;
|
||||||
more=ogg_sync_pageseek(vf->oy,og);
|
more=ogg_sync_pageseek(vf->oy,og);
|
||||||
|
|
||||||
if(more<0){
|
if(more<0){
|
||||||
/* skipped n bytes */
|
/* skipped n bytes */
|
||||||
vf->offset-=more;
|
vf->offset-=more;
|
||||||
|
|
@ -154,7 +132,7 @@ static ogg_int64_t _get_next_page(OggVorbis_File *vf,ogg_page *og,
|
||||||
ogg_int64_t ret=vf->offset;
|
ogg_int64_t ret=vf->offset;
|
||||||
vf->offset+=more;
|
vf->offset+=more;
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -212,18 +190,18 @@ static int _bisect_forward_serialno(OggVorbis_File *vf,
|
||||||
ogg_int64_t next=end;
|
ogg_int64_t next=end;
|
||||||
ogg_page og={0,0,0,0};
|
ogg_page og={0,0,0,0};
|
||||||
ogg_int64_t ret;
|
ogg_int64_t ret;
|
||||||
|
|
||||||
/* the below guards against garbage seperating the last and
|
/* the below guards against garbage seperating the last and
|
||||||
first pages of two links. */
|
first pages of two links. */
|
||||||
while(searched<endsearched){
|
while(searched<endsearched){
|
||||||
ogg_int64_t bisect;
|
ogg_int64_t bisect;
|
||||||
|
|
||||||
if(endsearched-searched<CHUNKSIZE){
|
if(endsearched-searched<CHUNKSIZE){
|
||||||
bisect=searched;
|
bisect=searched;
|
||||||
}else{
|
}else{
|
||||||
bisect=(searched+endsearched)/2;
|
bisect=(searched+endsearched)/2;
|
||||||
}
|
}
|
||||||
|
|
||||||
_seek_helper(vf,bisect);
|
_seek_helper(vf,bisect);
|
||||||
ret=_get_next_page(vf,&og,-1);
|
ret=_get_next_page(vf,&og,-1);
|
||||||
if(ret==OV_EREAD)return OV_EREAD;
|
if(ret==OV_EREAD)return OV_EREAD;
|
||||||
|
|
@ -239,7 +217,7 @@ static int _bisect_forward_serialno(OggVorbis_File *vf,
|
||||||
_seek_helper(vf,next);
|
_seek_helper(vf,next);
|
||||||
ret=_get_next_page(vf,&og,-1);
|
ret=_get_next_page(vf,&og,-1);
|
||||||
if(ret==OV_EREAD)return OV_EREAD;
|
if(ret==OV_EREAD)return OV_EREAD;
|
||||||
|
|
||||||
if(searched>=end || ret<0){
|
if(searched>=end || ret<0){
|
||||||
ogg_page_release(&og);
|
ogg_page_release(&og);
|
||||||
vf->links=m+1;
|
vf->links=m+1;
|
||||||
|
|
@ -252,7 +230,7 @@ static int _bisect_forward_serialno(OggVorbis_File *vf,
|
||||||
ogg_page_release(&og);
|
ogg_page_release(&og);
|
||||||
if(ret==OV_EREAD)return OV_EREAD;
|
if(ret==OV_EREAD)return OV_EREAD;
|
||||||
}
|
}
|
||||||
|
|
||||||
vf->offsets[m]=begin;
|
vf->offsets[m]=begin;
|
||||||
vf->serialnos[m]=currentno;
|
vf->serialnos[m]=currentno;
|
||||||
return 0;
|
return 0;
|
||||||
|
|
@ -264,7 +242,7 @@ static int _decode_clear(OggVorbis_File *vf){
|
||||||
vf->vd=0;
|
vf->vd=0;
|
||||||
vf->ready_state=STREAMSET;
|
vf->ready_state=STREAMSET;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(vf->ready_state>=STREAMSET){
|
if(vf->ready_state>=STREAMSET){
|
||||||
vorbis_info_clear(&vf->vi);
|
vorbis_info_clear(&vf->vi);
|
||||||
vorbis_comment_clear(&vf->vc);
|
vorbis_comment_clear(&vf->vc);
|
||||||
|
|
@ -286,7 +264,7 @@ static int _fetch_headers(OggVorbis_File *vf,
|
||||||
ogg_page og={0,0,0,0};
|
ogg_page og={0,0,0,0};
|
||||||
ogg_packet op={0,0,0,0,0,0};
|
ogg_packet op={0,0,0,0,0,0};
|
||||||
int i,ret;
|
int i,ret;
|
||||||
|
|
||||||
if(vf->ready_state>OPENED)_decode_clear(vf);
|
if(vf->ready_state>OPENED)_decode_clear(vf);
|
||||||
|
|
||||||
if(!og_ptr){
|
if(!og_ptr){
|
||||||
|
|
@ -298,13 +276,13 @@ static int _fetch_headers(OggVorbis_File *vf,
|
||||||
|
|
||||||
ogg_stream_reset_serialno(vf->os,ogg_page_serialno(og_ptr));
|
ogg_stream_reset_serialno(vf->os,ogg_page_serialno(og_ptr));
|
||||||
if(serialno)*serialno=vf->os->serialno;
|
if(serialno)*serialno=vf->os->serialno;
|
||||||
|
|
||||||
/* extract the initial header from the first page and verify that the
|
/* extract the initial header from the first page and verify that the
|
||||||
Ogg bitstream is in fact Vorbis data */
|
Ogg bitstream is in fact Vorbis data */
|
||||||
|
|
||||||
vorbis_info_init(vi);
|
vorbis_info_init(vi);
|
||||||
vorbis_comment_init(vc);
|
vorbis_comment_init(vc);
|
||||||
|
|
||||||
i=0;
|
i=0;
|
||||||
while(i<3){
|
while(i<3){
|
||||||
ogg_stream_pagein(vf->os,og_ptr);
|
ogg_stream_pagein(vf->os,og_ptr);
|
||||||
|
|
@ -330,7 +308,7 @@ static int _fetch_headers(OggVorbis_File *vf,
|
||||||
ogg_packet_release(&op);
|
ogg_packet_release(&op);
|
||||||
ogg_page_release(&og);
|
ogg_page_release(&og);
|
||||||
vf->ready_state=LINKSET;
|
vf->ready_state=LINKSET;
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
bail_header:
|
bail_header:
|
||||||
ogg_packet_release(&op);
|
ogg_packet_release(&op);
|
||||||
|
|
@ -380,10 +358,10 @@ static void _prefetch_all_offsets(OggVorbis_File *vf, ogg_int64_t dataoffset){
|
||||||
ogg_page og={0,0,0,0};
|
ogg_page og={0,0,0,0};
|
||||||
int i;
|
int i;
|
||||||
ogg_int64_t ret;
|
ogg_int64_t ret;
|
||||||
|
|
||||||
vf->dataoffsets=_ogg_malloc(vf->links*sizeof(*vf->dataoffsets));
|
vf->dataoffsets=_ogg_malloc(vf->links*sizeof(*vf->dataoffsets));
|
||||||
vf->pcmlengths=_ogg_malloc(vf->links*2*sizeof(*vf->pcmlengths));
|
vf->pcmlengths=_ogg_malloc(vf->links*2*sizeof(*vf->pcmlengths));
|
||||||
|
|
||||||
for(i=0;i<vf->links;i++){
|
for(i=0;i<vf->links;i++){
|
||||||
if(i==0){
|
if(i==0){
|
||||||
/* we already grabbed the initial header earlier. Just set the offset */
|
/* we already grabbed the initial header earlier. Just set the offset */
|
||||||
|
|
@ -419,10 +397,10 @@ static void _prefetch_all_offsets(OggVorbis_File *vf, ogg_int64_t dataoffset){
|
||||||
/* this should not be possible unless the file is
|
/* this should not be possible unless the file is
|
||||||
truncated/mangled */
|
truncated/mangled */
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if(ogg_page_serialno(&og)!=vf->serialnos[i])
|
if(ogg_page_serialno(&og)!=vf->serialnos[i])
|
||||||
break;
|
break;
|
||||||
|
|
||||||
pos=ogg_page_granulepos(&og);
|
pos=ogg_page_granulepos(&og);
|
||||||
|
|
||||||
/* count blocksizes of all frames in the page */
|
/* count blocksizes of all frames in the page */
|
||||||
|
|
@ -497,7 +475,7 @@ static int _make_decode_ready(OggVorbis_File *vf){
|
||||||
default:
|
default:
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int _open_seekable2(OggVorbis_File *vf){
|
static int _open_seekable2(OggVorbis_File *vf){
|
||||||
|
|
@ -511,11 +489,11 @@ static int _open_seekable2(OggVorbis_File *vf){
|
||||||
/* we can seek, so set out learning all about this file */
|
/* we can seek, so set out learning all about this file */
|
||||||
(vf->callbacks.seek_func)(vf->datasource,0,SEEK_END);
|
(vf->callbacks.seek_func)(vf->datasource,0,SEEK_END);
|
||||||
vf->offset=vf->end=(vf->callbacks.tell_func)(vf->datasource);
|
vf->offset=vf->end=(vf->callbacks.tell_func)(vf->datasource);
|
||||||
|
|
||||||
/* We get the offset for the last page of the physical bitstream.
|
/* We get the offset for the last page of the physical bitstream.
|
||||||
Most OggVorbis files will contain a single logical bitstream */
|
Most OggVorbis files will contain a single logical bitstream */
|
||||||
end=_get_prev_page(vf,&og);
|
end=_get_prev_page(vf,&og);
|
||||||
if(end<0)return (int)end;
|
if(end<0)return end;
|
||||||
|
|
||||||
/* more than one logical bitstream? */
|
/* more than one logical bitstream? */
|
||||||
tempserialno=ogg_page_serialno(&og);
|
tempserialno=ogg_page_serialno(&og);
|
||||||
|
|
@ -543,11 +521,11 @@ static int _open_seekable2(OggVorbis_File *vf){
|
||||||
bitstream boundary and dumps the decoding machine. If the decoding
|
bitstream boundary and dumps the decoding machine. If the decoding
|
||||||
machine is unloaded, it loads it. It also keeps pcm_offset up to
|
machine is unloaded, it loads it. It also keeps pcm_offset up to
|
||||||
date (seek and read both use this. seek uses a special hack with
|
date (seek and read both use this. seek uses a special hack with
|
||||||
readp).
|
readp).
|
||||||
|
|
||||||
return: <0) error, OV_HOLE (lost packet) or OV_EOF
|
return: <0) error, OV_HOLE (lost packet) or OV_EOF
|
||||||
0) need more data (only if readp==0)
|
0) need more data (only if readp==0)
|
||||||
1) got a packet
|
1) got a packet
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static int _fetch_and_process_packet(OggVorbis_File *vf,
|
static int _fetch_and_process_packet(OggVorbis_File *vf,
|
||||||
|
|
@ -560,7 +538,7 @@ static int _fetch_and_process_packet(OggVorbis_File *vf,
|
||||||
/* handle one packet. Try to fetch it from current stream state */
|
/* handle one packet. Try to fetch it from current stream state */
|
||||||
/* extract packets from page */
|
/* extract packets from page */
|
||||||
while(1){
|
while(1){
|
||||||
|
|
||||||
/* process a packet if we can. If the machine isn't loaded,
|
/* process a packet if we can. If the machine isn't loaded,
|
||||||
neither is a page */
|
neither is a page */
|
||||||
if(vf->ready_state==INITSET){
|
if(vf->ready_state==INITSET){
|
||||||
|
|
@ -582,15 +560,15 @@ static int _fetch_and_process_packet(OggVorbis_File *vf,
|
||||||
submit them,
|
submit them,
|
||||||
vorbis_synthesis will
|
vorbis_synthesis will
|
||||||
reject them */
|
reject them */
|
||||||
|
|
||||||
vf->samptrack+=vorbis_dsp_pcmout(vf->vd,NULL,0);
|
vf->samptrack+=vorbis_dsp_pcmout(vf->vd,NULL,0);
|
||||||
vf->bittrack+=op.bytes*8;
|
vf->bittrack+=op.bytes*8;
|
||||||
|
|
||||||
/* update the pcm offset. */
|
/* update the pcm offset. */
|
||||||
if(granulepos!=-1 && !op.e_o_s){
|
if(granulepos!=-1 && !op.e_o_s){
|
||||||
int link=(vf->seekable?vf->current_link:0);
|
int link=(vf->seekable?vf->current_link:0);
|
||||||
int i,samples;
|
int i,samples;
|
||||||
|
|
||||||
/* this packet has a pcm_offset on it (the last packet
|
/* this packet has a pcm_offset on it (the last packet
|
||||||
completed on a page carries the offset) After processing
|
completed on a page carries the offset) After processing
|
||||||
(above), we know the pcm position of the *last* sample
|
(above), we know the pcm position of the *last* sample
|
||||||
|
|
@ -612,7 +590,7 @@ static int _fetch_and_process_packet(OggVorbis_File *vf,
|
||||||
is very broken */
|
is very broken */
|
||||||
|
|
||||||
samples=vorbis_dsp_pcmout(vf->vd,NULL,0);
|
samples=vorbis_dsp_pcmout(vf->vd,NULL,0);
|
||||||
|
|
||||||
granulepos-=samples;
|
granulepos-=samples;
|
||||||
for(i=0;i<link;i++)
|
for(i=0;i<link;i++)
|
||||||
granulepos+=vf->pcmlengths[i*2+1];
|
granulepos+=vf->pcmlengths[i*2+1];
|
||||||
|
|
@ -622,7 +600,7 @@ static int _fetch_and_process_packet(OggVorbis_File *vf,
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -633,8 +611,7 @@ static int _fetch_and_process_packet(OggVorbis_File *vf,
|
||||||
ret=0;
|
ret=0;
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
ret=(int)_get_next_page(vf,&og,-1);
|
if((ret=_get_next_page(vf,&og,-1))<0){
|
||||||
if(ret<0){
|
|
||||||
ret=OV_EOF; /* eof. leave unitialized */
|
ret=OV_EOF; /* eof. leave unitialized */
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
@ -642,7 +619,7 @@ static int _fetch_and_process_packet(OggVorbis_File *vf,
|
||||||
/* bitrate tracking; add the header's bytes here, the body bytes
|
/* bitrate tracking; add the header's bytes here, the body bytes
|
||||||
are done by packet above */
|
are done by packet above */
|
||||||
vf->bittrack+=og.header_len*8;
|
vf->bittrack+=og.header_len*8;
|
||||||
|
|
||||||
/* has our decoding just traversed a bitstream boundary? */
|
/* has our decoding just traversed a bitstream boundary? */
|
||||||
if(vf->ready_state==INITSET){
|
if(vf->ready_state==INITSET){
|
||||||
if(vf->current_serialno!=ogg_page_serialno(&og)){
|
if(vf->current_serialno!=ogg_page_serialno(&og)){
|
||||||
|
|
@ -657,7 +634,7 @@ static int _fetch_and_process_packet(OggVorbis_File *vf,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Do we need to load a new machine before submitting the page? */
|
/* Do we need to load a new machine before submitting the page? */
|
||||||
/* This is different in the seekable and non-seekable cases.
|
/* This is different in the seekable and non-seekable cases.
|
||||||
|
|
||||||
In the seekable case, we already have all the header
|
In the seekable case, we already have all the header
|
||||||
information loaded and cached; we just initialize the machine
|
information loaded and cached; we just initialize the machine
|
||||||
|
|
@ -668,13 +645,13 @@ static int _fetch_and_process_packet(OggVorbis_File *vf,
|
||||||
we're now nominally at the header of the next bitstream
|
we're now nominally at the header of the next bitstream
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if(vf->ready_state!=INITSET){
|
if(vf->ready_state!=INITSET){
|
||||||
int link,ret;
|
int link,ret;
|
||||||
|
|
||||||
if(vf->ready_state<STREAMSET){
|
if(vf->ready_state<STREAMSET){
|
||||||
if(vf->seekable){
|
if(vf->seekable){
|
||||||
vf->current_serialno=ogg_page_serialno(&og);
|
vf->current_serialno=ogg_page_serialno(&og);
|
||||||
|
|
||||||
/* match the serialno to bitstream section. We use this rather than
|
/* match the serialno to bitstream section. We use this rather than
|
||||||
offset positions to avoid problems near logical bitstream
|
offset positions to avoid problems near logical bitstream
|
||||||
boundaries */
|
boundaries */
|
||||||
|
|
@ -689,17 +666,17 @@ static int _fetch_and_process_packet(OggVorbis_File *vf,
|
||||||
vf->current_link=link;
|
vf->current_link=link;
|
||||||
ret=_fetch_headers(vf,&vf->vi,&vf->vc,&vf->current_serialno,&og);
|
ret=_fetch_headers(vf,&vf->vi,&vf->vc,&vf->current_serialno,&og);
|
||||||
if(ret) goto cleanup;
|
if(ret) goto cleanup;
|
||||||
|
|
||||||
}else{
|
}else{
|
||||||
/* we're streaming */
|
/* we're streaming */
|
||||||
/* fetch the three header packets, build the info struct */
|
/* fetch the three header packets, build the info struct */
|
||||||
|
|
||||||
int ret=_fetch_headers(vf,&vf->vi,&vf->vc,&vf->current_serialno,&og);
|
int ret=_fetch_headers(vf,&vf->vi,&vf->vc,&vf->current_serialno,&og);
|
||||||
if(ret) goto cleanup;
|
if(ret) goto cleanup;
|
||||||
vf->current_link++;
|
vf->current_link++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(_make_decode_ready(vf)) return OV_EBADLINK;
|
if(_make_decode_ready(vf)) return OV_EBADLINK;
|
||||||
}
|
}
|
||||||
ogg_stream_pagein(vf->os,&og);
|
ogg_stream_pagein(vf->os,&og);
|
||||||
|
|
@ -714,7 +691,7 @@ static int _fetch_and_process_packet(OggVorbis_File *vf,
|
||||||
fseek64 */
|
fseek64 */
|
||||||
static int _fseek64_wrap(FILE *f,ogg_int64_t off,int whence){
|
static int _fseek64_wrap(FILE *f,ogg_int64_t off,int whence){
|
||||||
if(f==NULL)return -1;
|
if(f==NULL)return -1;
|
||||||
return fseek(f,(long)off,whence);
|
return fseek(f,off,whence);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int _ov_open1(void *f,OggVorbis_File *vf,char *initial,
|
static int _ov_open1(void *f,OggVorbis_File *vf,char *initial,
|
||||||
|
|
@ -801,7 +778,7 @@ int ov_clear(OggVorbis_File *vf){
|
||||||
|
|
||||||
/* inspects the OggVorbis file and finds/documents all the logical
|
/* inspects the OggVorbis file and finds/documents all the logical
|
||||||
bitstreams contained in it. Tries to be tolerant of logical
|
bitstreams contained in it. Tries to be tolerant of logical
|
||||||
bitstream sections that are truncated/woogie.
|
bitstream sections that are truncated/woogie.
|
||||||
|
|
||||||
return: -1) error
|
return: -1) error
|
||||||
0) OK
|
0) OK
|
||||||
|
|
@ -824,7 +801,7 @@ int ov_open(FILE *f,OggVorbis_File *vf,char *initial,long ibytes){
|
||||||
|
|
||||||
return ov_open_callbacks((void *)f, vf, initial, ibytes, callbacks);
|
return ov_open_callbacks((void *)f, vf, initial, ibytes, callbacks);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Only partially open the vorbis file; test for Vorbisness, and load
|
/* Only partially open the vorbis file; test for Vorbisness, and load
|
||||||
the headers for the first chain. Do not seek (although test for
|
the headers for the first chain. Do not seek (although test for
|
||||||
seekability). Use ov_test_open to finish opening the file, else
|
seekability). Use ov_test_open to finish opening the file, else
|
||||||
|
|
@ -846,7 +823,7 @@ int ov_test(FILE *f,OggVorbis_File *vf,char *initial,long ibytes){
|
||||||
|
|
||||||
return ov_test_callbacks((void *)f, vf, initial, ibytes, callbacks);
|
return ov_test_callbacks((void *)f, vf, initial, ibytes, callbacks);
|
||||||
}
|
}
|
||||||
|
|
||||||
int ov_test_open(OggVorbis_File *vf){
|
int ov_test_open(OggVorbis_File *vf){
|
||||||
if(vf->ready_state!=PARTOPEN)return OV_EINVAL;
|
if(vf->ready_state!=PARTOPEN)return OV_EINVAL;
|
||||||
return _ov_open2(vf);
|
return _ov_open2(vf);
|
||||||
|
|
@ -884,11 +861,11 @@ long ov_bitrate(OggVorbis_File *vf,int i){
|
||||||
* gcc 3.x on x86 miscompiled this at optimisation level 2 and above,
|
* gcc 3.x on x86 miscompiled this at optimisation level 2 and above,
|
||||||
* so this is slightly transformed to make it work.
|
* so this is slightly transformed to make it work.
|
||||||
*/
|
*/
|
||||||
return (long)(bits*1000/ov_time_total(vf,-1));
|
return bits*1000/ov_time_total(vf,-1);
|
||||||
}else{
|
}else{
|
||||||
if(vf->seekable){
|
if(vf->seekable){
|
||||||
/* return the actual bitrate */
|
/* return the actual bitrate */
|
||||||
return (long)((vf->offsets[i+1]-vf->dataoffsets[i])*8000/ov_time_total(vf,i));
|
return (vf->offsets[i+1]-vf->dataoffsets[i])*8000/ov_time_total(vf,i);
|
||||||
}else{
|
}else{
|
||||||
/* return nominal if set */
|
/* return nominal if set */
|
||||||
if(vf->vi.bitrate_nominal>0){
|
if(vf->vi.bitrate_nominal>0){
|
||||||
|
|
@ -909,13 +886,13 @@ long ov_bitrate(OggVorbis_File *vf,int i){
|
||||||
|
|
||||||
/* returns the actual bitrate since last call. returns -1 if no
|
/* returns the actual bitrate since last call. returns -1 if no
|
||||||
additional data to offer since last call (or at beginning of stream),
|
additional data to offer since last call (or at beginning of stream),
|
||||||
EINVAL if stream is only partially open
|
EINVAL if stream is only partially open
|
||||||
*/
|
*/
|
||||||
long ov_bitrate_instant(OggVorbis_File *vf){
|
long ov_bitrate_instant(OggVorbis_File *vf){
|
||||||
long ret;
|
long ret;
|
||||||
if(vf->ready_state<OPENED)return OV_EINVAL;
|
if(vf->ready_state<OPENED)return OV_EINVAL;
|
||||||
if(vf->samptrack==0)return OV_FALSE;
|
if(vf->samptrack==0)return OV_FALSE;
|
||||||
ret=(long)(vf->bittrack/vf->samptrack*vf->vi.rate);
|
ret=vf->bittrack/vf->samptrack*vf->vi.rate;
|
||||||
vf->bittrack=0;
|
vf->bittrack=0;
|
||||||
vf->samptrack=0;
|
vf->samptrack=0;
|
||||||
return ret;
|
return ret;
|
||||||
|
|
@ -954,7 +931,7 @@ ogg_int64_t ov_raw_total(OggVorbis_File *vf,int i){
|
||||||
/* returns: total PCM length (samples) of content if i==-1 PCM length
|
/* returns: total PCM length (samples) of content if i==-1 PCM length
|
||||||
(samples) of that logical bitstream for i==0 to n
|
(samples) of that logical bitstream for i==0 to n
|
||||||
OV_EINVAL if the stream is not seekable (we can't know the
|
OV_EINVAL if the stream is not seekable (we can't know the
|
||||||
length) or only partially open
|
length) or only partially open
|
||||||
*/
|
*/
|
||||||
ogg_int64_t ov_pcm_total(OggVorbis_File *vf,int i){
|
ogg_int64_t ov_pcm_total(OggVorbis_File *vf,int i){
|
||||||
if(vf->ready_state<OPENED)return OV_EINVAL;
|
if(vf->ready_state<OPENED)return OV_EINVAL;
|
||||||
|
|
@ -973,7 +950,7 @@ ogg_int64_t ov_pcm_total(OggVorbis_File *vf,int i){
|
||||||
/* returns: total milliseconds of content if i==-1
|
/* returns: total milliseconds of content if i==-1
|
||||||
milliseconds in that logical bitstream for i==0 to n
|
milliseconds in that logical bitstream for i==0 to n
|
||||||
OV_EINVAL if the stream is not seekable (we can't know the
|
OV_EINVAL if the stream is not seekable (we can't know the
|
||||||
length) or only partially open
|
length) or only partially open
|
||||||
*/
|
*/
|
||||||
ogg_int64_t ov_time_total(OggVorbis_File *vf,int i){
|
ogg_int64_t ov_time_total(OggVorbis_File *vf,int i){
|
||||||
if(vf->ready_state<OPENED)return OV_EINVAL;
|
if(vf->ready_state<OPENED)return OV_EINVAL;
|
||||||
|
|
@ -1000,7 +977,7 @@ int ov_raw_seek(OggVorbis_File *vf,ogg_int64_t pos){
|
||||||
ogg_stream_state *work_os=NULL;
|
ogg_stream_state *work_os=NULL;
|
||||||
ogg_page og={0,0,0,0};
|
ogg_page og={0,0,0,0};
|
||||||
ogg_packet op={0,0,0,0,0,0};
|
ogg_packet op={0,0,0,0,0,0};
|
||||||
|
|
||||||
if(vf->ready_state<OPENED)return OV_EINVAL;
|
if(vf->ready_state<OPENED)return OV_EINVAL;
|
||||||
if(!vf->seekable)
|
if(!vf->seekable)
|
||||||
return OV_ENOSEEK; /* don't dump machine if we can't seek */
|
return OV_ENOSEEK; /* don't dump machine if we can't seek */
|
||||||
|
|
@ -1015,7 +992,7 @@ int ov_raw_seek(OggVorbis_File *vf,ogg_int64_t pos){
|
||||||
ogg_stream_reset_serialno(vf->os,
|
ogg_stream_reset_serialno(vf->os,
|
||||||
vf->current_serialno); /* must set serialno */
|
vf->current_serialno); /* must set serialno */
|
||||||
vorbis_dsp_restart(vf->vd);
|
vorbis_dsp_restart(vf->vd);
|
||||||
|
|
||||||
_seek_helper(vf,pos);
|
_seek_helper(vf,pos);
|
||||||
|
|
||||||
/* we need to make sure the pcm_offset is set, but we don't want to
|
/* we need to make sure the pcm_offset is set, but we don't want to
|
||||||
|
|
@ -1025,12 +1002,12 @@ int ov_raw_seek(OggVorbis_File *vf,ogg_int64_t pos){
|
||||||
|
|
||||||
So, a hack. We use two stream states; a local scratch state and
|
So, a hack. We use two stream states; a local scratch state and
|
||||||
the shared vf->os stream state. We use the local state to
|
the shared vf->os stream state. We use the local state to
|
||||||
scan, and the shared state as a buffer for later decode.
|
scan, and the shared state as a buffer for later decode.
|
||||||
|
|
||||||
Unfortuantely, on the last page we still advance to last packet
|
Unfortuantely, on the last page we still advance to last packet
|
||||||
because the granulepos on the last page is not necessarily on a
|
because the granulepos on the last page is not necessarily on a
|
||||||
packet boundary, and we need to make sure the granpos is
|
packet boundary, and we need to make sure the granpos is
|
||||||
correct.
|
correct.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|
@ -1044,7 +1021,7 @@ int ov_raw_seek(OggVorbis_File *vf,ogg_int64_t pos){
|
||||||
if(vf->ready_state>=STREAMSET){
|
if(vf->ready_state>=STREAMSET){
|
||||||
/* snarf/scan a packet if we can */
|
/* snarf/scan a packet if we can */
|
||||||
int result=ogg_stream_packetout(work_os,&op);
|
int result=ogg_stream_packetout(work_os,&op);
|
||||||
|
|
||||||
if(result>0){
|
if(result>0){
|
||||||
|
|
||||||
if(vf->vi.codec_setup){
|
if(vf->vi.codec_setup){
|
||||||
|
|
@ -1053,18 +1030,18 @@ int ov_raw_seek(OggVorbis_File *vf,ogg_int64_t pos){
|
||||||
ogg_stream_packetout(vf->os,NULL);
|
ogg_stream_packetout(vf->os,NULL);
|
||||||
thisblock=0;
|
thisblock=0;
|
||||||
}else{
|
}else{
|
||||||
|
|
||||||
if(eosflag)
|
if(eosflag)
|
||||||
ogg_stream_packetout(vf->os,NULL);
|
ogg_stream_packetout(vf->os,NULL);
|
||||||
else
|
else
|
||||||
if(lastblock)accblock+=(lastblock+thisblock)>>2;
|
if(lastblock)accblock+=(lastblock+thisblock)>>2;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(op.granulepos!=-1){
|
if(op.granulepos!=-1){
|
||||||
int i,link=vf->current_link;
|
int i,link=vf->current_link;
|
||||||
ogg_int64_t granulepos=op.granulepos-vf->pcmlengths[link*2];
|
ogg_int64_t granulepos=op.granulepos-vf->pcmlengths[link*2];
|
||||||
if(granulepos<0)granulepos=0;
|
if(granulepos<0)granulepos=0;
|
||||||
|
|
||||||
for(i=0;i<link;i++)
|
for(i=0;i<link;i++)
|
||||||
granulepos+=vf->pcmlengths[i*2+1];
|
granulepos+=vf->pcmlengths[i*2+1];
|
||||||
vf->pcm_offset=granulepos-accblock;
|
vf->pcm_offset=granulepos-accblock;
|
||||||
|
|
@ -1076,7 +1053,7 @@ int ov_raw_seek(OggVorbis_File *vf,ogg_int64_t pos){
|
||||||
ogg_stream_packetout(vf->os,NULL);
|
ogg_stream_packetout(vf->os,NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!lastblock){
|
if(!lastblock){
|
||||||
if(_get_next_page(vf,&og,-1)<0){
|
if(_get_next_page(vf,&og,-1)<0){
|
||||||
vf->pcm_offset=ov_pcm_total(vf,-1);
|
vf->pcm_offset=ov_pcm_total(vf,-1);
|
||||||
|
|
@ -1087,7 +1064,7 @@ int ov_raw_seek(OggVorbis_File *vf,ogg_int64_t pos){
|
||||||
vf->pcm_offset=-1;
|
vf->pcm_offset=-1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* did we just grab a page from other than current link? */
|
/* did we just grab a page from other than current link? */
|
||||||
if(vf->ready_state>=STREAMSET)
|
if(vf->ready_state>=STREAMSET)
|
||||||
if(vf->current_serialno!=ogg_page_serialno(&og)){
|
if(vf->current_serialno!=ogg_page_serialno(&og)){
|
||||||
|
|
@ -1097,25 +1074,25 @@ int ov_raw_seek(OggVorbis_File *vf,ogg_int64_t pos){
|
||||||
|
|
||||||
if(vf->ready_state<STREAMSET){
|
if(vf->ready_state<STREAMSET){
|
||||||
int link;
|
int link;
|
||||||
|
|
||||||
vf->current_serialno=ogg_page_serialno(&og);
|
vf->current_serialno=ogg_page_serialno(&og);
|
||||||
for(link=0;link<vf->links;link++)
|
for(link=0;link<vf->links;link++)
|
||||||
if(vf->serialnos[link]==vf->current_serialno)break;
|
if(vf->serialnos[link]==vf->current_serialno)break;
|
||||||
if(link==vf->links)
|
if(link==vf->links)
|
||||||
goto seek_error; /* sign of a bogus stream. error out,
|
goto seek_error; /* sign of a bogus stream. error out,
|
||||||
leave machine uninitialized */
|
leave machine uninitialized */
|
||||||
|
|
||||||
/* need to initialize machine to this link */
|
/* need to initialize machine to this link */
|
||||||
{
|
{
|
||||||
int ret=_set_link_number_preserve_pos(vf,link);
|
int ret=_set_link_number_preserve_pos(vf,link);
|
||||||
if(ret) goto seek_error;
|
if(ret) goto seek_error;
|
||||||
}
|
}
|
||||||
ogg_stream_reset_serialno(vf->os,vf->current_serialno);
|
ogg_stream_reset_serialno(vf->os,vf->current_serialno);
|
||||||
ogg_stream_reset_serialno(work_os,vf->current_serialno);
|
ogg_stream_reset_serialno(work_os,vf->current_serialno);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
ogg_page dup;
|
ogg_page dup;
|
||||||
ogg_page_dup(&dup,&og);
|
ogg_page_dup(&dup,&og);
|
||||||
|
|
@ -1160,7 +1137,7 @@ int ov_pcm_seek_page(OggVorbis_File *vf,ogg_int64_t pos){
|
||||||
if(vf->ready_state<OPENED)return OV_EINVAL;
|
if(vf->ready_state<OPENED)return OV_EINVAL;
|
||||||
if(!vf->seekable)return OV_ENOSEEK;
|
if(!vf->seekable)return OV_ENOSEEK;
|
||||||
if(pos<0 || pos>total)return OV_EINVAL;
|
if(pos<0 || pos>total)return OV_EINVAL;
|
||||||
|
|
||||||
/* which bitstream section does this pcm offset occur in? */
|
/* which bitstream section does this pcm offset occur in? */
|
||||||
for(link=vf->links-1;link>=0;link--){
|
for(link=vf->links-1;link>=0;link--){
|
||||||
total-=vf->pcmlengths[link*2+1];
|
total-=vf->pcmlengths[link*2+1];
|
||||||
|
|
@ -1191,22 +1168,22 @@ int ov_pcm_seek_page(OggVorbis_File *vf,ogg_int64_t pos){
|
||||||
ogg_int64_t endtime = vf->pcmlengths[link*2+1]+begintime;
|
ogg_int64_t endtime = vf->pcmlengths[link*2+1]+begintime;
|
||||||
ogg_int64_t target=pos-total+begintime;
|
ogg_int64_t target=pos-total+begintime;
|
||||||
ogg_int64_t best=begin;
|
ogg_int64_t best=begin;
|
||||||
|
|
||||||
while(begin<end){
|
while(begin<end){
|
||||||
ogg_int64_t bisect;
|
ogg_int64_t bisect;
|
||||||
|
|
||||||
if(end-begin<CHUNKSIZE){
|
if(end-begin<CHUNKSIZE){
|
||||||
bisect=begin;
|
bisect=begin;
|
||||||
}else{
|
}else{
|
||||||
/* take a (pretty decent) guess. */
|
/* take a (pretty decent) guess. */
|
||||||
bisect=begin +
|
bisect=begin +
|
||||||
(target-begintime)*(end-begin)/(endtime-begintime) - CHUNKSIZE;
|
(target-begintime)*(end-begin)/(endtime-begintime) - CHUNKSIZE;
|
||||||
if(bisect<=begin)
|
if(bisect<=begin)
|
||||||
bisect=begin+1;
|
bisect=begin+1;
|
||||||
}
|
}
|
||||||
|
|
||||||
_seek_helper(vf,bisect);
|
_seek_helper(vf,bisect);
|
||||||
|
|
||||||
while(begin<end){
|
while(begin<end){
|
||||||
result=_get_next_page(vf,&og,end-vf->offset);
|
result=_get_next_page(vf,&og,end-vf->offset);
|
||||||
if(result==OV_EREAD) goto seek_error;
|
if(result==OV_EREAD) goto seek_error;
|
||||||
|
|
@ -1223,10 +1200,10 @@ int ov_pcm_seek_page(OggVorbis_File *vf,ogg_int64_t pos){
|
||||||
ogg_int64_t granulepos=ogg_page_granulepos(&og);
|
ogg_int64_t granulepos=ogg_page_granulepos(&og);
|
||||||
if(granulepos==-1)continue;
|
if(granulepos==-1)continue;
|
||||||
if(granulepos<target){
|
if(granulepos<target){
|
||||||
best=result; /* raw offset of packet with granulepos */
|
best=result; /* raw offset of packet with granulepos */
|
||||||
begin=vf->offset; /* raw offset of next page */
|
begin=vf->offset; /* raw offset of next page */
|
||||||
begintime=granulepos;
|
begintime=granulepos;
|
||||||
|
|
||||||
if(target-begintime>44100)break;
|
if(target-begintime>44100)break;
|
||||||
bisect=begin; /* *not* begin + 1 */
|
bisect=begin; /* *not* begin + 1 */
|
||||||
}else{
|
}else{
|
||||||
|
|
@ -1252,11 +1229,11 @@ int ov_pcm_seek_page(OggVorbis_File *vf,ogg_int64_t pos){
|
||||||
/* found our page. seek to it, update pcm offset. Easier case than
|
/* found our page. seek to it, update pcm offset. Easier case than
|
||||||
raw_seek, don't keep packets preceeding granulepos. */
|
raw_seek, don't keep packets preceeding granulepos. */
|
||||||
{
|
{
|
||||||
|
|
||||||
/* seek */
|
/* seek */
|
||||||
_seek_helper(vf,best);
|
_seek_helper(vf,best);
|
||||||
vf->pcm_offset=-1;
|
vf->pcm_offset=-1;
|
||||||
|
|
||||||
if(_get_next_page(vf,&og,-1)<0){
|
if(_get_next_page(vf,&og,-1)<0){
|
||||||
ogg_page_release(&og);
|
ogg_page_release(&og);
|
||||||
return OV_EOF; /* shouldn't happen */
|
return OV_EOF; /* shouldn't happen */
|
||||||
|
|
@ -1272,9 +1249,9 @@ int ov_pcm_seek_page(OggVorbis_File *vf,ogg_int64_t pos){
|
||||||
preceeding page. Keep fetching previous pages until we
|
preceeding page. Keep fetching previous pages until we
|
||||||
get one with a granulepos or without the 'continued' flag
|
get one with a granulepos or without the 'continued' flag
|
||||||
set. Then just use raw_seek for simplicity. */
|
set. Then just use raw_seek for simplicity. */
|
||||||
|
|
||||||
_seek_helper(vf,best);
|
_seek_helper(vf,best);
|
||||||
|
|
||||||
while(1){
|
while(1){
|
||||||
result=_get_prev_page(vf,&og);
|
result=_get_prev_page(vf,&og);
|
||||||
if(result<0) goto seek_error;
|
if(result<0) goto seek_error;
|
||||||
|
|
@ -1286,7 +1263,7 @@ int ov_pcm_seek_page(OggVorbis_File *vf,ogg_int64_t pos){
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(result<0){
|
if(result<0){
|
||||||
result = OV_EBADPACKET;
|
result = OV_EBADPACKET;
|
||||||
goto seek_error;
|
goto seek_error;
|
||||||
}
|
}
|
||||||
if(op.granulepos!=-1){
|
if(op.granulepos!=-1){
|
||||||
|
|
@ -1299,7 +1276,7 @@ int ov_pcm_seek_page(OggVorbis_File *vf,ogg_int64_t pos){
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* verify result */
|
/* verify result */
|
||||||
if(vf->pcm_offset>pos || pos>ov_pcm_total(vf,-1)){
|
if(vf->pcm_offset>pos || pos>ov_pcm_total(vf,-1)){
|
||||||
result=OV_EFAULT;
|
result=OV_EFAULT;
|
||||||
|
|
@ -1311,7 +1288,7 @@ int ov_pcm_seek_page(OggVorbis_File *vf,ogg_int64_t pos){
|
||||||
ogg_page_release(&og);
|
ogg_page_release(&og);
|
||||||
ogg_packet_release(&op);
|
ogg_packet_release(&op);
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
seek_error:
|
seek_error:
|
||||||
|
|
||||||
ogg_page_release(&og);
|
ogg_page_release(&og);
|
||||||
|
|
@ -1323,7 +1300,7 @@ int ov_pcm_seek_page(OggVorbis_File *vf,ogg_int64_t pos){
|
||||||
return (int)result;
|
return (int)result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* seek to a sample offset relative to the decompressed pcm stream
|
/* seek to a sample offset relative to the decompressed pcm stream
|
||||||
returns zero on success, nonzero on failure */
|
returns zero on success, nonzero on failure */
|
||||||
|
|
||||||
int ov_pcm_seek(OggVorbis_File *vf,ogg_int64_t pos){
|
int ov_pcm_seek(OggVorbis_File *vf,ogg_int64_t pos){
|
||||||
|
|
@ -1347,19 +1324,19 @@ int ov_pcm_seek(OggVorbis_File *vf,ogg_int64_t pos){
|
||||||
continue; /* non audio packet */
|
continue; /* non audio packet */
|
||||||
}
|
}
|
||||||
if(lastblock)vf->pcm_offset+=(lastblock+thisblock)>>2;
|
if(lastblock)vf->pcm_offset+=(lastblock+thisblock)>>2;
|
||||||
|
|
||||||
if(vf->pcm_offset+((thisblock+
|
if(vf->pcm_offset+((thisblock+
|
||||||
vorbis_info_blocksize(&vf->vi,1))>>2)>=pos)break;
|
vorbis_info_blocksize(&vf->vi,1))>>2)>=pos)break;
|
||||||
|
|
||||||
/* remove the packet from packet queue and track its granulepos */
|
/* remove the packet from packet queue and track its granulepos */
|
||||||
ogg_stream_packetout(vf->os,NULL);
|
ogg_stream_packetout(vf->os,NULL);
|
||||||
vorbis_dsp_synthesis(vf->vd,&op,0); /* set up a vb with
|
vorbis_dsp_synthesis(vf->vd,&op,0); /* set up a vb with
|
||||||
only tracking, no
|
only tracking, no
|
||||||
pcm_decode */
|
pcm_decode */
|
||||||
|
|
||||||
/* end of logical stream case is hard, especially with exact
|
/* end of logical stream case is hard, especially with exact
|
||||||
length positioning. */
|
length positioning. */
|
||||||
|
|
||||||
if(op.granulepos>-1){
|
if(op.granulepos>-1){
|
||||||
int i;
|
int i;
|
||||||
/* always believe the stream markers */
|
/* always believe the stream markers */
|
||||||
|
|
@ -1368,19 +1345,19 @@ int ov_pcm_seek(OggVorbis_File *vf,ogg_int64_t pos){
|
||||||
for(i=0;i<vf->current_link;i++)
|
for(i=0;i<vf->current_link;i++)
|
||||||
vf->pcm_offset+=vf->pcmlengths[i*2+1];
|
vf->pcm_offset+=vf->pcmlengths[i*2+1];
|
||||||
}
|
}
|
||||||
|
|
||||||
lastblock=thisblock;
|
lastblock=thisblock;
|
||||||
|
|
||||||
}else{
|
}else{
|
||||||
if(ret<0 && ret!=OV_HOLE)break;
|
if(ret<0 && ret!=OV_HOLE)break;
|
||||||
|
|
||||||
/* suck in a new page */
|
/* suck in a new page */
|
||||||
if(_get_next_page(vf,&og,-1)<0)break;
|
if(_get_next_page(vf,&og,-1)<0)break;
|
||||||
if(vf->current_serialno!=ogg_page_serialno(&og))_decode_clear(vf);
|
if(vf->current_serialno!=ogg_page_serialno(&og))_decode_clear(vf);
|
||||||
|
|
||||||
if(vf->ready_state<STREAMSET){
|
if(vf->ready_state<STREAMSET){
|
||||||
int link,ret;
|
int link,ret;
|
||||||
|
|
||||||
vf->current_serialno=ogg_page_serialno(&og);
|
vf->current_serialno=ogg_page_serialno(&og);
|
||||||
for(link=0;link<vf->links;link++)
|
for(link=0;link<vf->links;link++)
|
||||||
if(vf->serialnos[link]==vf->current_serialno)break;
|
if(vf->serialnos[link]==vf->current_serialno)break;
|
||||||
|
|
@ -1410,10 +1387,10 @@ int ov_pcm_seek(OggVorbis_File *vf,ogg_int64_t pos){
|
||||||
ogg_int64_t target=pos-vf->pcm_offset;
|
ogg_int64_t target=pos-vf->pcm_offset;
|
||||||
long samples=vorbis_dsp_pcmout(vf->vd,NULL,0);
|
long samples=vorbis_dsp_pcmout(vf->vd,NULL,0);
|
||||||
|
|
||||||
if(samples>target)samples=(long)target;
|
if(samples>target)samples=target;
|
||||||
vorbis_dsp_read(vf->vd,samples);
|
vorbis_dsp_read(vf->vd,samples);
|
||||||
vf->pcm_offset+=samples;
|
vf->pcm_offset+=samples;
|
||||||
|
|
||||||
if(samples<target)
|
if(samples<target)
|
||||||
if(_fetch_and_process_packet(vf,1,1)<=0)
|
if(_fetch_and_process_packet(vf,1,1)<=0)
|
||||||
vf->pcm_offset=ov_pcm_total(vf,-1); /* eof */
|
vf->pcm_offset=ov_pcm_total(vf,-1); /* eof */
|
||||||
|
|
@ -1424,7 +1401,7 @@ int ov_pcm_seek(OggVorbis_File *vf,ogg_int64_t pos){
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* seek to a playback time relative to the decompressed pcm stream
|
/* seek to a playback time relative to the decompressed pcm stream
|
||||||
returns zero on success, nonzero on failure */
|
returns zero on success, nonzero on failure */
|
||||||
int ov_time_seek(OggVorbis_File *vf,ogg_int64_t milliseconds){
|
int ov_time_seek(OggVorbis_File *vf,ogg_int64_t milliseconds){
|
||||||
/* translate time to PCM position and call ov_pcm_seek */
|
/* translate time to PCM position and call ov_pcm_seek */
|
||||||
|
|
@ -1436,7 +1413,7 @@ int ov_time_seek(OggVorbis_File *vf,ogg_int64_t milliseconds){
|
||||||
if(vf->ready_state<OPENED)return OV_EINVAL;
|
if(vf->ready_state<OPENED)return OV_EINVAL;
|
||||||
if(!vf->seekable)return OV_ENOSEEK;
|
if(!vf->seekable)return OV_ENOSEEK;
|
||||||
if(milliseconds<0 || milliseconds>time_total)return OV_EINVAL;
|
if(milliseconds<0 || milliseconds>time_total)return OV_EINVAL;
|
||||||
|
|
||||||
/* which bitstream section does this time offset occur in? */
|
/* which bitstream section does this time offset occur in? */
|
||||||
for(link=vf->links-1;link>=0;link--){
|
for(link=vf->links-1;link>=0;link--){
|
||||||
pcm_total-=vf->pcmlengths[link*2+1];
|
pcm_total-=vf->pcmlengths[link*2+1];
|
||||||
|
|
@ -1448,13 +1425,13 @@ int ov_time_seek(OggVorbis_File *vf,ogg_int64_t milliseconds){
|
||||||
{
|
{
|
||||||
int ret=_set_link_number(vf,link);
|
int ret=_set_link_number(vf,link);
|
||||||
if(ret)return ret;
|
if(ret)return ret;
|
||||||
return
|
return
|
||||||
ov_pcm_seek(vf,pcm_total+(milliseconds-time_total)*
|
ov_pcm_seek(vf,pcm_total+(milliseconds-time_total)*
|
||||||
vf->vi.rate/1000);
|
vf->vi.rate/1000);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* page-granularity version of ov_time_seek
|
/* page-granularity version of ov_time_seek
|
||||||
returns zero on success, nonzero on failure */
|
returns zero on success, nonzero on failure */
|
||||||
int ov_time_seek_page(OggVorbis_File *vf,ogg_int64_t milliseconds){
|
int ov_time_seek_page(OggVorbis_File *vf,ogg_int64_t milliseconds){
|
||||||
/* translate time to PCM position and call ov_pcm_seek */
|
/* translate time to PCM position and call ov_pcm_seek */
|
||||||
|
|
@ -1466,7 +1443,7 @@ int ov_time_seek_page(OggVorbis_File *vf,ogg_int64_t milliseconds){
|
||||||
if(vf->ready_state<OPENED)return OV_EINVAL;
|
if(vf->ready_state<OPENED)return OV_EINVAL;
|
||||||
if(!vf->seekable)return OV_ENOSEEK;
|
if(!vf->seekable)return OV_ENOSEEK;
|
||||||
if(milliseconds<0 || milliseconds>time_total)return OV_EINVAL;
|
if(milliseconds<0 || milliseconds>time_total)return OV_EINVAL;
|
||||||
|
|
||||||
/* which bitstream section does this time offset occur in? */
|
/* which bitstream section does this time offset occur in? */
|
||||||
for(link=vf->links-1;link>=0;link--){
|
for(link=vf->links-1;link>=0;link--){
|
||||||
pcm_total-=vf->pcmlengths[link*2+1];
|
pcm_total-=vf->pcmlengths[link*2+1];
|
||||||
|
|
@ -1478,7 +1455,7 @@ int ov_time_seek_page(OggVorbis_File *vf,ogg_int64_t milliseconds){
|
||||||
{
|
{
|
||||||
int ret=_set_link_number(vf,link);
|
int ret=_set_link_number(vf,link);
|
||||||
if(ret)return ret;
|
if(ret)return ret;
|
||||||
return
|
return
|
||||||
ov_pcm_seek_page(vf,pcm_total+(milliseconds-time_total)*
|
ov_pcm_seek_page(vf,pcm_total+(milliseconds-time_total)*
|
||||||
vf->vi.rate/1000);
|
vf->vi.rate/1000);
|
||||||
}
|
}
|
||||||
|
|
@ -1502,12 +1479,12 @@ ogg_int64_t ov_time_tell(OggVorbis_File *vf){
|
||||||
int link=0;
|
int link=0;
|
||||||
ogg_int64_t pcm_total=0;
|
ogg_int64_t pcm_total=0;
|
||||||
ogg_int64_t time_total=0;
|
ogg_int64_t time_total=0;
|
||||||
|
|
||||||
if(vf->ready_state<OPENED)return OV_EINVAL;
|
if(vf->ready_state<OPENED)return OV_EINVAL;
|
||||||
if(vf->seekable){
|
if(vf->seekable){
|
||||||
pcm_total=ov_pcm_total(vf,-1);
|
pcm_total=ov_pcm_total(vf,-1);
|
||||||
time_total=ov_time_total(vf,-1);
|
time_total=ov_time_total(vf,-1);
|
||||||
|
|
||||||
/* which bitstream section does this time offset occur in? */
|
/* which bitstream section does this time offset occur in? */
|
||||||
for(link=vf->links-1;link>=0;link--){
|
for(link=vf->links-1;link>=0;link--){
|
||||||
pcm_total-=vf->pcmlengths[link*2+1];
|
pcm_total-=vf->pcmlengths[link*2+1];
|
||||||
|
|
@ -1522,7 +1499,7 @@ ogg_int64_t ov_time_tell(OggVorbis_File *vf){
|
||||||
/* link: -1) return the vorbis_info struct for the bitstream section
|
/* link: -1) return the vorbis_info struct for the bitstream section
|
||||||
currently being decoded
|
currently being decoded
|
||||||
0-n) to request information for a specific bitstream section
|
0-n) to request information for a specific bitstream section
|
||||||
|
|
||||||
In the case of a non-seekable bitstream, any call returns the
|
In the case of a non-seekable bitstream, any call returns the
|
||||||
current bitstream. NULL in the case that the machine is not
|
current bitstream. NULL in the case that the machine is not
|
||||||
initialized */
|
initialized */
|
||||||
|
|
|
||||||
|
|
@ -1,39 +1,19 @@
|
||||||
/************************************************************************
|
/********************************************************************
|
||||||
* Copyright (C) 2002-2009, Xiph.org Foundation
|
* *
|
||||||
* Copyright (C) 2010, Robin Watts for Pinknoise Productions Ltd
|
* THIS FILE IS PART OF THE OggVorbis 'TREMOR' CODEC SOURCE CODE. *
|
||||||
* All rights reserved.
|
* *
|
||||||
*
|
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
|
||||||
* modification, are permitted provided that the following conditions
|
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
|
||||||
* are met:
|
* *
|
||||||
*
|
* THE OggVorbis 'TREMOR' SOURCE CODE IS (C) COPYRIGHT 1994-2002 *
|
||||||
* * Redistributions of source code must retain the above copyright
|
* BY THE Xiph.Org FOUNDATION http://www.xiph.org/ *
|
||||||
* 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 names of the Xiph.org Foundation nor Pinknoise
|
|
||||||
* Productions Ltd 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 COPYRIGHT
|
|
||||||
* OWNER 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.
|
|
||||||
************************************************************************
|
|
||||||
|
|
||||||
function: window lookup tables
|
function: window lookup tables
|
||||||
|
|
||||||
************************************************************************/
|
********************************************************************/
|
||||||
|
|
||||||
|
|
||||||
#include "os_types.h"
|
#include "os_types.h"
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,24 @@
|
||||||
|
diff -ru ./codebook.c /Users/cocos/Downloads/Tremolo008/codebook.c
|
||||||
|
--- ./codebook.c 2018-11-07 16:47:06.000000000 +0800
|
||||||
|
+++ /Users/cocos/Downloads/Tremolo008/codebook.c 2010-02-01 21:45:48.000000000 +0800
|
||||||
|
@@ -679,7 +679,7 @@
|
||||||
|
}
|
||||||
|
case 4:
|
||||||
|
{
|
||||||
|
- //Output("32/32");
|
||||||
|
+ Output("32/32");
|
||||||
|
for(i=0;i<read;i++){
|
||||||
|
chase=((ogg_uint32_t *)(book->dec_table))[chase*2+((lok>>i)&1)];
|
||||||
|
if(chase&0x80000000UL)break;
|
||||||
|
Only in .: local_modification.diff
|
||||||
|
diff -ru ./misc.h /Users/cocos/Downloads/Tremolo008/misc.h
|
||||||
|
--- ./misc.h 2018-11-07 16:46:32.000000000 +0800
|
||||||
|
+++ /Users/cocos/Downloads/Tremolo008/misc.h 2007-07-05 18:35:10.000000000 +0800
|
||||||
|
@@ -46,7 +46,6 @@
|
||||||
|
#ifndef _LOW_ACCURACY_
|
||||||
|
/* 64 bit multiply */
|
||||||
|
|
||||||
|
-#include <endian.h>
|
||||||
|
#include <sys/types.h>
|
||||||
|
|
||||||
|
#if BYTE_ORDER==LITTLE_ENDIAN
|
||||||
Loading…
Reference in New Issue