Support for Tremor for Ogg Vorbis decoding.

git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@1940 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
meep-eep
2005-11-01 03:20:07 +00:00
parent 5ad8fd07ca
commit 5d10765ab6
5 changed files with 72 additions and 13 deletions
+2
View File
@@ -1,4 +1,6 @@
Changes towards version 0.5: Changes towards version 0.5:
- Added support for Tremor for Ogg Vorbis decoding (avoids floating point
math) - SvdB
- Fixed T-Pet compulsion graphics (partially); bug #772 - Alex - Fixed T-Pet compulsion graphics (partially); bug #772 - Alex
- Doing game-state file I/O in memory instead of temp files; - Doing game-state file I/O in memory instead of temp files;
should avoid problems as in bug #752 - Alex should avoid problems as in bug #752 - Alex
+11 -2
View File
@@ -48,8 +48,8 @@ OpenAL (Win32 only)
Homepage: http://www.openal.org/ Homepage: http://www.openal.org/
SDK download: http://developer.creative.com/articles/article.asp?cat=1&sbcat=31&aid=45&file=OpenALSDK.zip SDK download: http://developer.creative.com/articles/article.asp?cat=1&sbcat=31&aid=45&file=OpenALSDK.zip
Ogg Vorbis libogg and libvorbis
Audio codec used for music and speech. Audio codec to play Ogg Vorbis files, used for music and speech.
Homepage: http://www.xiph.org/ogg/vorbis/index.html Homepage: http://www.xiph.org/ogg/vorbis/index.html
Download: Download:
For Windows: For Windows:
@@ -58,6 +58,14 @@ Ogg Vorbis
http://www.vorbis.com/download_unix.psp http://www.vorbis.com/download_unix.psp
download libogg and libvorbis. download libogg and libvorbis.
Tremor (alternative for libogg and libvorbis)
Audio codec to play Ogg Vorbis files, used for music and speech.
This library avoids floating point math and should be used instead
of libogg and libvorbis when floating point support is not available
or slow (on some handhelds and game consoles).
Homepage: http://www.xiph.org/vorbis/
Download: http://svn.xiph.org/trunk/Tremor (Subversion)
Zlib v1.2 Zlib v1.2
Data compression / decompression library Data compression / decompression library
Homepage: http://www.gzip.org/zlib/ Homepage: http://www.gzip.org/zlib/
@@ -70,3 +78,4 @@ If you find these aren't enough, or if you know the names
of the corresponding RPM etc. packages, please report to of the corresponding RPM etc. packages, please report to
<sc2-devel@lists.sourceforge.net> or visit <sc2-devel@lists.sourceforge.net> or visit
http://sourceforge.net/projects/sc2 http://sourceforge.net/projects/sc2
+21 -7
View File
@@ -28,11 +28,9 @@ uqm_requirements()
check_endianness check_endianness
# Libraries used # Libraries always used
use_library SDL 1.2.3 || exit 1 use_library SDL 1.2.3 || exit 1
use_library SDL_image || exit 1 use_library SDL_image || exit 1
#have_library vorbis || exit 1
have_library vorbisfile || exit 1
# Add defines for HAVE_READDIR_R, HAVE_SETENV, HAVE_STRUPR # Add defines for HAVE_READDIR_R, HAVE_SETENV, HAVE_STRUPR
@@ -56,7 +54,7 @@ uqm_requirements()
uqm_prepare_config() uqm_prepare_config()
{ {
# Describe the menu: # Describe the menu:
MENU_main_ITEMS="debug graphics sound ioformat" MENU_main_ITEMS="debug graphics sound ovcodec ioformat"
case "$HOST_SYSTEM" in case "$HOST_SYSTEM" in
Darwin) Darwin)
# Installation directory not modifiable # Installation directory not modifiable
@@ -72,6 +70,7 @@ uqm_prepare_config()
MENU_main_ITEM_debug_TYPE=CHOICE MENU_main_ITEM_debug_TYPE=CHOICE
MENU_main_ITEM_graphics_TYPE=CHOICE MENU_main_ITEM_graphics_TYPE=CHOICE
MENU_main_ITEM_sound_TYPE=CHOICE MENU_main_ITEM_sound_TYPE=CHOICE
MENU_main_ITEM_ovcodec_TYPE=CHOICE
MENU_main_ITEM_ioformat_TYPE=CHOICE MENU_main_ITEM_ioformat_TYPE=CHOICE
MENU_main_ITEM_link_TYPE=CHOICE MENU_main_ITEM_link_TYPE=CHOICE
MENU_main_ITEM_install_path_TYPE=MENU MENU_main_ITEM_install_path_TYPE=MENU
@@ -149,8 +148,6 @@ uqm_prepare_config()
sound_mixsdl_action() { sound_mixsdl_action() {
CFLAGS="$CFLAGS -DSOUNDMODULE_SDL" CFLAGS="$CFLAGS -DSOUNDMODULE_SDL"
SOUNDMODULE=mixsdl SOUNDMODULE=mixsdl
use_library vorbisfile
# use_library vorbis
} }
CHOICE_sound_OPTION_openal_TITLE="Include OpenAL support (experimental)" CHOICE_sound_OPTION_openal_TITLE="Include OpenAL support (experimental)"
CHOICE_sound_OPTION_openal_PRECOND="have_library openal" CHOICE_sound_OPTION_openal_PRECOND="have_library openal"
@@ -159,10 +156,27 @@ uqm_prepare_config()
CFLAGS="$CFLAGS -DHAVE_OPENAL -DSOUNDMODULE_SDL" CFLAGS="$CFLAGS -DHAVE_OPENAL -DSOUNDMODULE_SDL"
SOUNDMODULE=openal SOUNDMODULE=openal
use_library openal use_library openal
}
CHOICE_sound_DEFAULT=mixsdl
CHOICE_ovcodec_OPTIONS="standard tremor"
CHOICE_ovcodec_TITLE="Ogg Vorbis codec"
CHOICE_ovcodec_OPTION_standard_TITLE="Xiph libogg + libvorbis"
CHOICE_ovcodec_OPTION_standard_PRECOND="have_library vorbisfile"
# CHOICE_ovcodec_OPTION_standard_PRECOND="have_library vorbisfile && have_library vorbis"
CHOICE_ovcodec_OPTION_standard_ACTION=ovcodec_standard_action
ovcodec_standard_action() {
use_library vorbisfile use_library vorbisfile
# use_library vorbis # use_library vorbis
} }
CHOICE_sound_DEFAULT=mixsdl CHOICE_ovcodec_OPTION_tremor_TITLE="Tremor (avoids floating point math)"
CHOICE_ovcodec_OPTION_tremor_PRECOND="have_library tremor"
CHOICE_ovcodec_OPTION_tremor_ACTION=ovcodec_tremor_action
ovcodec_tremor_action() {
CFLAGS="$CFLAGS -DOVCODEC_TREMOR"
use_library tremor
}
CHOICE_ovcodec_DEFAULT=standard
CHOICE_ioformat_OPTIONS="stdio stdio_zip" CHOICE_ioformat_OPTIONS="stdio stdio_zip"
CHOICE_ioformat_TITLE="Supported file i/o methods" CHOICE_ioformat_TITLE="Supported file i/o methods"
+20
View File
@@ -179,6 +179,26 @@ LIB_vorbisfile_DETECT="try_pkgconfig_lib vorbisfile vorbisfile"
LIB_vorbisfile_DEPEND_DETECT_BIN="pkgconfig" LIB_vorbisfile_DEPEND_DETECT_BIN="pkgconfig"
### Tremor ###
LIB_tremor_NAME="tremor"
case "$HOST_SYSTEM" in
FreeBSD|OpenBSD)
LIB_tremor_CFLAGS="-I/usr/local/include"
LIB_tremor_LDFLAGS="-L/usr/local/lib -lvorbisidec"
;;
Darwin)
# Assumed values - please let me know if you can verify this.
LIB_tremor_CFLAGS=""
LIB_tremor_LDFLAGS="-framework Tremor"
;;
*)
LIB_tremor_CFLAGS=""
LIB_tremor_LDFLAGS="-lvorbisidec"
;;
esac
LIB_tremor_VERSION=""
### zlib ### ### zlib ###
LIB_zlib_NAME="zlib" LIB_zlib_NAME="zlib"
LIB_zlib_CFLAGS="" LIB_zlib_CFLAGS=""
+16 -2
View File
@@ -25,8 +25,13 @@
#include "types.h" #include "types.h"
#include "uio.h" #include "uio.h"
#include "decoder.h" #include "decoder.h"
#include <vorbis/codec.h> #ifdef OVCODEC_TREMOR
#include <vorbis/vorbisfile.h> # include <tremor/ivorbiscodec.h>
# include <tremor/ivorbisfile.h>
#else
# include <vorbis/codec.h>
# include <vorbis/vorbisfile.h>
#endif /* OVCODEC_TREMOR */
#include "oggaud.h" #include "oggaud.h"
@@ -221,8 +226,12 @@ ova_Decode (THIS_PTR, void* buf, sint32 bufsize)
long rc; long rc;
int bitstream; int bitstream;
#ifdef OVCODEC_TREMOR
rc = ov_read (&ova->vf, buf, bufsize, &bitstream);
#else
rc = ov_read (&ova->vf, buf, bufsize, ova_formats->want_big_endian, rc = ov_read (&ova->vf, buf, bufsize, ova_formats->want_big_endian,
2, 1, &bitstream); 2, 1, &bitstream);
#endif /* OVCODEC_TREMOR */
if (rc < 0) if (rc < 0)
ova->last_error = rc; ova->last_error = rc;
@@ -254,5 +263,10 @@ ova_GetFrame (THIS_PTR)
TFB_OggSoundDecoder* ova = (TFB_OggSoundDecoder*) This; TFB_OggSoundDecoder* ova = (TFB_OggSoundDecoder*) This;
// this is the closest to a frame there is in ogg vorbis stream // this is the closest to a frame there is in ogg vorbis stream
// doesn't seem to be a func to retrive it // doesn't seem to be a func to retrive it
#ifdef OVCODEC_TREMOR
return ova->vf.os->pageno;
#else
return ova->vf.os.pageno; return ova->vf.os.pageno;
#endif /* OVCODEC_TREMOR */
} }