1
0
Fork 0
forked from len0rd/rockbox

New makefile solution: A single invocation of 'make' to build the entire tree. Fully controlled dependencies give faster and more correct recompiles.

Many #include lines adjusted to conform to the new standards.


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19146 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Björn Stenberg 2008-11-20 11:27:31 +00:00
parent f66c303467
commit c6b3d38a15
221 changed files with 2081 additions and 3657 deletions

View file

@ -1,256 +0,0 @@
# __________ __ ___.
# Open \______ \ ____ ____ | | _\_ |__ _______ ___
# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
# \/ \/ \/ \/ \/
# $Id$
#
INCLUDES = -I$(FIRMDIR)/include -I$(FIRMDIR)/export -I$(FIRMDIR)/common \
-I$(FIRMDIR)/drivers -I$(APPSDIR) -Ilib -I$(BUILDDIR)
CFLAGS = $(INCLUDES) $(GCCOPTS) $(TARGET_INC) $(TARGET) $(EXTRA_DEFINES) \
-DTARGET_ID=$(TARGET_ID) -DMEM=${MEMORYSIZE} -DCODEC
ifdef APPEXTRA
INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA)))
endif
ifdef SOFTWARECODECS
CODECLIBS = -lspc -lmad -la52 -lffmpegFLAC -ltremor -lwavpack -lmusepack -lalac -lfaad -lm4a -lspeex -ldemac -lwma -lasap
OUTPUT = libspc libmad liba52 libffmpegFLAC libwma libtremor libwavpack libmusepack libalac libfaad libm4a libspeex libdemac libasap
endif
# we "borrow" the plugin LDS file
LDS := $(APPSDIR)/plugins/plugin.lds
LINKCODEC := $(OBJDIR)/codeclink.lds
DEPFILE = $(OBJDIR)/dep-codecs
# This sets up 'SRC' based on the files mentioned in SOURCES
include $(TOOLSDIR)/makesrc.inc
ROCKS := $(SRC:%.c=$(OBJDIR)/%.codec)
SOURCES = $(SRC)
ELFS := $(SRC:%.c=$(OBJDIR)/%.elf)
OBJS := $(SRC:%.c=$(OBJDIR)/%.o)
# as created by the cross-compiler for win32:
DEFS := $(SRC:%.c=$(OBJDIR)/%.def)
DIRS = .
CODECLIB := $(BUILDDIR)/libcodec.a
CODECDEPS = $(LINKCODEC) $(CODECLIB)
.PHONY: libspc libmad liba52 libffmpegFLAC libtremor libspeex libwavpack libmusepack libalac libfaad libm4a libdemac libwma libasap
all: $(LINKCODEC) $(ROCKS)
ifndef SIMVER
$(BUILDDIR)/%.a : % $(CODECDEPS)
# special dependencies
$(OBJDIR)/spc.elf : $(BUILDDIR)/libspc.a
$(OBJDIR)/mpa.elf : $(BUILDDIR)/libmad.a
$(OBJDIR)/a52.elf : $(BUILDDIR)/liba52.a
$(OBJDIR)/flac.elf : $(BUILDDIR)/libffmpegFLAC.a
$(OBJDIR)/vorbis.elf : $(BUILDDIR)/libtremor.a
$(OBJDIR)/speex.elf : $(BUILDDIR)/libspeex.a
$(OBJDIR)/mpc.elf : $(BUILDDIR)/libmusepack.a
$(OBJDIR)/wavpack.elf : $(BUILDDIR)/libwavpack.a
$(OBJDIR)/alac.elf : $(BUILDDIR)/libalac.a $(BUILDDIR)/libm4a.a
$(OBJDIR)/aac.elf : $(BUILDDIR)/libfaad.a $(BUILDDIR)/libm4a.a
$(OBJDIR)/shorten.elf : $(BUILDDIR)/libffmpegFLAC.a
$(OBJDIR)/ape.elf : $(BUILDDIR)/libdemac.a
$(OBJDIR)/wma.elf : $(BUILDDIR)/libwma.a
$(OBJDIR)/wavpack_enc.elf: $(BUILDDIR)/libwavpack.a
$(OBJDIR)/asap.elf : $(BUILDDIR)/libasap.a
# standard dependencies
$(OBJDIR)/%.elf: $(OBJDIR)/%.o $(OBJDIR)/codec_crt0.o $(CODECLIB)
$(call PRINTS,LD $(@F))$(CC) $(CFLAGS) -o $@ $^ \
-L$(BUILDDIR) -lcodec -lgcc -T$(LINKCODEC) \
-Wl,--gc-sections,-Map,$(OBJDIR)/$*.map
$(OBJDIR)/%.codec : $(OBJDIR)/%.elf
$(call PRINTS,OBJCOPY $(@F))$(OC) -O binary $< $@
else
ifeq ($(SIMVER), x11)
###################################################
# This is the X11 simulator version
$(OBJDIR)/%.codec : $(OBJDIR)/%.o $(OBJDIR)/codec_crt0.o $(BUILDDIR)/libcodec.a $(OUTPUT)
$(call PRINTS,LD $(@F))$(CC) $(CFLAGS) $(SHARED_FLAG) $< $(OBJDIR)/codec_crt0.o -L$(BUILDDIR) $(CODECLIBS) -lcodec -o $@
ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN)
# 'x' must be kept or you'll have "Win32 error 5"
# $ fgrep 5 /usr/include/w32api/winerror.h | head -1
# #define ERROR_ACCESS_DENIED 5L
else
$(SILENT)chmod -x $@
endif
else # end of x11-simulator
ifeq ($(SIMVER), sdl)
###################################################
# This is the SDL simulator version
$(OBJDIR)/%.codec : $(OBJDIR)/%.o $(OBJDIR)/codec_crt0.o $(BUILDDIR)/libcodec.a $(OUTPUT)
$(call PRINTS,LD $(@F))$(CC) $(CFLAGS) $(SHARED_FLAG) $< $(OBJDIR)/codec_crt0.o -L$(BUILDDIR) $(CODECLIBS) -lcodec -o $@
ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN)
# 'x' must be kept or you'll have "Win32 error 5"
# $ fgrep 5 /usr/include/w32api/winerror.h | head -1
# #define ERROR_ACCESS_DENIED 5L
else
$(SILENT)chmod -x $@
endif
else # end of sdl-simulator
###################################################
# This is the win32 simulator version
DLLTOOLFLAGS = --export-all
DLLWRAPFLAGS = -s --entry _DllMain@12 --target=i386-mingw32 -mno-cygwin
$(OBJDIR)/%.codec : $(OBJDIR)/%.o $(OBJDIR)/codec_crt0.o $(BUILDDIR)/libcodec.a $(OUTPUT)
$(call PRINTS,DLL $(@F))$(DLLTOOL) $(DLLTOOLFLAGS) -z $(OBJDIR)/$*.def $< $(OBJDIR)/codec_crt0.o
$(SILENT)$(DLLWRAP) $(DLLWRAPFLAGS) --def $(OBJDIR)/$*.def $< $(OBJDIR)/codec_crt0.o\
$(BUILDDIR)/libcodec.a $(patsubst -l%,$(BUILDDIR)/lib%.a,$(CODECLIBS)) \
-o $@
ifeq ($(findstring CYGWIN,$(UNAME)),CYGWIN)
# 'x' must be kept or you'll have "Win32 error 5"
# $ fgrep 5 /usr/include/w32api/winerror.h | head -1
# #define ERROR_ACCESS_DENIED 5L
else
$(SILENT)chmod -x $@
endif
endif # end of win32-simulator
endif
endif # end of simulator section
include $(TOOLSDIR)/make.inc
$(BUILDDIR)/libcodec.a:
$(SILENT)mkdir -p $(OBJDIR)/lib
$(call PRINTS,MAKE in codecs/lib)$(MAKE) -C lib OBJDIR=$(OBJDIR)/lib
$(LINKCODEC): $(LDS)
$(call PRINTS,build $(@F))cat $< | $(CC) -DMEMORYSIZE=$(MEMORYSIZE) -DCODEC $(INCLUDES) $(TARGET) $(DEFINES) -E -P - >$@
$(BUILDDIR)/libspc.a: libspc
libspc:
$(SILENT)mkdir -p $(OBJDIR)/libspc
$(call PRINTS,MAKE in libspc)$(MAKE) -C libspc OBJDIR=$(OBJDIR)/libspc OUTPUT=$(BUILDDIR)/libspc.a
$(BUILDDIR)/libmad.a: libmad
libmad:
$(SILENT)mkdir -p $(OBJDIR)/libmad
$(call PRINTS,MAKE in libmad)$(MAKE) -C libmad OBJDIR=$(OBJDIR)/libmad OUTPUT=$(BUILDDIR)/libmad.a
$(BUILDDIR)/liba52.a: liba52
liba52:
$(SILENT)mkdir -p $(OBJDIR)/liba52
$(call PRINTS,MAKE in liba52)$(MAKE) -C liba52 OBJDIR=$(OBJDIR)/liba52 OUTPUT=$(BUILDDIR)/liba52.a
$(BUILDDIR)/libwma.a: libwma
libwma:
$(SILENT)mkdir -p $(OBJDIR)/libwma
$(call PRINTS,MAKE in libwma)$(MAKE) -C libwma OBJDIR=$(OBJDIR)/libwma OUTPUT=$(BUILDDIR)/libwma.a
$(BUILDDIR)/libffmpegFLAC.a: libffmpegFLAC
libffmpegFLAC:
$(SILENT)mkdir -p $(OBJDIR)/libffmpegFLAC
$(call PRINTS,MAKE in libffmpegFLAC)$(MAKE) -C libffmpegFLAC OBJDIR=$(OBJDIR)/libffmpegFLAC OUTPUT=$(BUILDDIR)/libffmpegFLAC.a
$(BUILDDIR)/libtremor.a: libtremor
libtremor:
$(SILENT)mkdir -p $(OBJDIR)/libtremor
$(call PRINTS,MAKE in libtremor)$(MAKE) -C libtremor OBJDIR=$(OBJDIR)/libtremor OUTPUT=$(BUILDDIR)/libtremor.a
$(BUILDDIR)/libspeex.a: libspeex
libspeex:
$(SILENT)mkdir -p $(OBJDIR)/libspeex
$(call PRINTS,MAKE in libspeex)$(MAKE) -C libspeex OBJDIR=$(OBJDIR)/libspeex OUTPUT=$(BUILDDIR)/libspeex.a
$(BUILDDIR)/libwavpack.a: libwavpack
libwavpack:
$(SILENT)mkdir -p $(OBJDIR)/libwavpack
$(call PRINTS,MAKE in libwavpack)$(MAKE) -C libwavpack OBJDIR=$(OBJDIR)/libwavpack OUTPUT=$(BUILDDIR)/libwavpack.a
$(BUILDDIR)/libmusepack.a: libmusepack
libmusepack:
$(SILENT)mkdir -p $(OBJDIR)/libmusepack
$(call PRINTS,MAKE in libmusepack)$(MAKE) -C libmusepack OBJDIR=$(OBJDIR)/libmusepack OUTPUT=$(BUILDDIR)/libmusepack.a
$(BUILDDIR)/libalac.a: libalac
libalac:
$(SILENT)mkdir -p $(OBJDIR)/libalac
$(call PRINTS,MAKE in libalac)$(MAKE) -C libalac OBJDIR=$(OBJDIR)/libalac OUTPUT=$(BUILDDIR)/libalac.a
$(BUILDDIR)/libm4a.a: libm4a
libm4a:
$(SILENT)mkdir -p $(OBJDIR)/libm4a
$(call PRINTS,MAKE in libm4a)$(MAKE) -C libm4a OBJDIR=$(OBJDIR)/libm4a OUTPUT=$(BUILDDIR)/libm4a.a
$(BUILDDIR)/libfaad.a: libfaad
libfaad:
$(SILENT)mkdir -p $(OBJDIR)/libfaad
$(call PRINTS,MAKE in libfaad)$(MAKE) -C libfaad OBJDIR=$(OBJDIR)/libfaad OUTPUT=$(BUILDDIR)/libfaad.a
$(BUILDDIR)/libdemac.a: libdemac
libdemac:
$(SILENT)mkdir -p $(OBJDIR)/libdemac
$(call PRINTS,MAKE in libdemac)$(MAKE) -C demac/libdemac OBJDIR=$(OBJDIR)/libdemac OUTPUT=$(BUILDDIR)/libdemac.a
$(BUILDDIR)/libasap.a: libasap
libasap:
$(SILENT)mkdir -p $(OBJDIR)/libasap
$(call PRINTS,MAKE in libasap)$(MAKE) -C libasap OBJDIR=$(OBJDIR)/libasap OUTPUT=$(BUILDDIR)/libasap.a
clean:
$(call PRINTS,cleaning codecs)rm -fr \
$(OBJDIR)/libspc $(BUILDDIR)/libspc.a \
$(OBJDIR)/libmad $(BUILDDIR)/libmad.a \
$(OBJDIR)/liba52 $(BUILDDIR)/liba52.a \
$(OBJDIR)/libffmpegFLAC $(BUILDDIR)/libffmpegFLAC.a \
$(OBJDIR)/libtremor $(BUILDDIR)/libtremor.a \
$(OBJDIR)/libspeex $(BUILDDIR)/libSpeex.a \
$(OBJDIR)/libwavpack $(BUILDDIR)/libwavpack.a \
$(OBJDIR)/libmusepack $(BUILDDIR)/libmusepack.a \
$(OBJDIR)/libalac $(BUILDDIR)/libalac.a \
$(OBJDIR)/libfaad $(BUILDDIR)/libfaad.a \
$(OBJDIR)/libm4a $(BUILDDIR)/libm4a.a \
$(OBJDIR)/libdemac $(BUILDDIR)/libdemac.a \
$(OBJDIR)/libwma $(BUILDDIR)/libwma.a
$(OBJDIR)/libasap $(BUILDDIR)/libasap.a
$(SILENT)$(MAKE) -C libspc clean OBJDIR=$(OBJDIR)/libspc
$(SILENT)$(MAKE) -C libmad clean OBJDIR=$(OBJDIR)/libmad
$(SILENT)$(MAKE) -C liba52 clean OBJDIR=$(OBJDIR)/liba52
$(SILENT)$(MAKE) -C libffmpegFLAC clean OBJDIR=$(OBJDIR)/libffmpegFLAC
$(SILENT)$(MAKE) -C libtremor clean OBJDIR=$(OBJDIR)/libtremor
$(SILENT)$(MAKE) -C libspeex clean OBJDIR=$(OBJDIR)/libspeex
$(SILENT)$(MAKE) -C libwavpack clean OBJDIR=$(OBJDIR)/libwavpack
$(SILENT)$(MAKE) -C libmusepack clean OBJDIR=$(OBJDIR)/libmusepack
$(SILENT)$(MAKE) -C libalac clean OBJDIR=$(OBJDIR)/libalac
$(SILENT)$(MAKE) -C libfaad clean OBJDIR=$(OBJDIR)/libfaad
$(SILENT)$(MAKE) -C libm4a clean OBJDIR=$(OBJDIR)/libm4a
$(SILENT)$(MAKE) -C demac/libdemac clean OBJDIR=$(OBJDIR)/libdemac
$(SILENT)$(MAKE) -C libwma clean OBJDIR=$(OBJDIR)/libwma
$(SILENT)$(MAKE) -C libasap clean OBJDIR=$(OBJDIR)/libasap
$(SILENT)$(MAKE) -C lib clean OBJDIR=$(OBJDIR)/lib
ifneq ($(MAKECMDGOALS),clean)
-include $(DEPFILE)
endif

View file

@ -20,7 +20,6 @@
****************************************************************************/
#include "codeclib.h"
#define ROCKBOX
#include <codecs/demac/libdemac/demac.h>
CODEC_HEADER

View file

@ -1,49 +0,0 @@
/***************************************************************************
* __________ __ ___.
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
* \/ \/ \/ \/ \/
* $Id$
*
* Copyright (C) 2005 Jens Arnold
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
* KIND, either express or implied.
*
****************************************************************************/
/* Global declarations to be used in rockbox software codecs */
#include "config.h"
#include "system.h"
#include <sys/types.h>
extern struct codec_api *ci;
/* Get these functions 'out of the way' of the standard functions. Not doing
* so confuses the cygwin linker, and maybe others. These functions need to
* be implemented elsewhere */
#define malloc(x) codec_malloc(x)
#define calloc(x,y) codec_calloc(x,y)
#define realloc(x,y) codec_realloc(x,y)
#define free(x) codec_free(x)
#define alloca(x) __builtin_alloca(x)
void* codec_malloc(size_t size);
void* codec_calloc(size_t nmemb, size_t size);
void* codec_realloc(void* ptr, size_t size);
void codec_free(void* ptr);
#define abs(x) ((x)>0?(x):-(x))
#define labs(x) abs(x)
void qsort(void *base, size_t nmemb, size_t size, int(*compar)(const void *, const void *));

103
apps/codecs/codecs.make Normal file
View file

@ -0,0 +1,103 @@
# __________ __ ___.
# Open \______ \ ____ ____ | | _\_ |__ _______ ___
# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
# \/ \/ \/ \/ \/
# $Id: Makefile 19082 2008-11-10 23:54:24Z zagor $
#
CODECDIR = $(BUILDDIR)/apps/codecs
CODECS_SRC := $(call preprocess, $(APPSDIR)/codecs/SOURCES)
OTHER_SRC += $(CODECS_SRC)
CODECS := $(CODECS_SRC:.c=.codec)
CODECS := $(subst $(ROOTDIR),$(BUILDDIR),$(CODECS))
# the codec helper library
include $(APPSDIR)/codecs/lib/libcodec.make
# the codec libraries
include $(APPSDIR)/codecs/demac/libdemac.make
include $(APPSDIR)/codecs/liba52/liba52.make
include $(APPSDIR)/codecs/libalac/libalac.make
include $(APPSDIR)/codecs/libasap/libasap.make
include $(APPSDIR)/codecs/libfaad/libfaad.make
include $(APPSDIR)/codecs/libffmpegFLAC/libffmpegFLAC.make
include $(APPSDIR)/codecs/libm4a/libm4a.make
include $(APPSDIR)/codecs/libmad/libmad.make
include $(APPSDIR)/codecs/libmusepack/libmusepack.make
include $(APPSDIR)/codecs/libspc/libspc.make
include $(APPSDIR)/codecs/libspeex/libspeex.make
include $(APPSDIR)/codecs/libtremor/libtremor.make
include $(APPSDIR)/codecs/libwavpack/libwavpack.make
include $(APPSDIR)/codecs/libwma/libwma.make
# compile flags for codecs
CODECFLAGS = $(CFLAGS) -I$(APPSDIR)/codecs -I$(APPSDIR)/codecs/lib \
-DCODEC
CODEC_LDS := $(APPSDIR)/plugins/plugin.lds # codecs and plugins use same file
CODECLINK_LDS := $(CODECDIR)/codec.link
CODEC_CRT0 := $(CODECDIR)/codec_crt0.o
CODECLIBS := $(DEMACLIB) $(A52LIB) $(ALACLIB) $(ASAPLIB) \
$(FAADLIB) $(FFMPEGFLACLIB) $(M4ALIB) $(MADLIB) $(MUSEPACKLIB) \
$(SPCLIB) $(SPEEXLIB) $(TREMORLIB) $(WAVPACKLIB) $(WMALIB) \
$(CODECLIB)
$(CODECS): $(CODEC_CRT0) $(CODECLINK_LDS)
$(CODECLINK_LDS): $(CODEC_LDS)
$(call PRINTS,PP $(@F))
$(call preprocess2file, $<, $@)
# codec/library dependencies
$(CODECDIR)/spc.codec : $(CODECDIR)/libspc.a
$(CODECDIR)/mpa.codec : $(CODECDIR)/libmad.a
$(CODECDIR)/a52.codec : $(CODECDIR)/liba52.a
$(CODECDIR)/flac.codec : $(CODECDIR)/libffmpegFLAC.a
$(CODECDIR)/vorbis.codec : $(CODECDIR)/libtremor.a
$(CODECDIR)/speex.codec : $(CODECDIR)/libspeex.a
$(CODECDIR)/mpc.codec : $(CODECDIR)/libmusepack.a
$(CODECDIR)/wavpack.codec : $(CODECDIR)/libwavpack.a
$(CODECDIR)/alac.codec : $(CODECDIR)/libalac.a $(CODECDIR)/libm4a.a
$(CODECDIR)/aac.codec : $(CODECDIR)/libfaad.a $(CODECDIR)/libm4a.a
$(CODECDIR)/shorten.codec : $(CODECDIR)/libffmpegFLAC.a
$(CODECDIR)/ape.codec : $(CODECDIR)/libdemac.a
$(CODECDIR)/wma.codec : $(CODECDIR)/libwma.a
$(CODECDIR)/wavpack_enc.codec: $(CODECDIR)/libwavpack.a
$(CODECDIR)/asap.codec : $(CODECDIR)/libasap.a
$(CODECS): $(CODECLIB) # this must be last in codec dependency list
# libfaad and libmusepack both contain a huffman.h file, with different
# content. So we compile them with special command lines:
# pattern rule for compiling codecs
$(CODECDIR)/%.o: $(ROOTDIR)/apps/codecs/%.c
$(SILENT)mkdir -p $(dir $@)
$(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) \
-I$(dir $<) $(CODECFLAGS) -c $< -o $@
# pattern rule for compiling codecs
$(CODECDIR)/%.o: $(ROOTDIR)/apps/codecs/%.S
$(SILENT)mkdir -p $(dir $@)
$(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) \
-I$(dir $<) $(CODECFLAGS) -c $< -o $@
ifdef SIMVER
CODECLDFLAGS = $(SHARED_FLAG) # <-- from Makefile
else
CODECLDFLAGS = -T$(CODECLINK_LDS) -Wl,--gc-sections -Wl,-Map,$(CODECDIR)/$*.map
CODECFLAGS += -UDEBUG -DNDEBUG
endif
$(CODECDIR)/%.codec: $(CODECDIR)/%.o
$(call PRINTS,LD $(@F))$(CC) $(CODECFLAGS) -o $(CODECDIR)/$*.elf \
$(filter %.o, $^) \
$(filter %.a, $^) \
-lgcc $(CODECLDFLAGS)
$(call PRINTS,OC $(@F))$(OC) -O binary $(CODECDIR)/$*.elf $@

View file

@ -0,0 +1,24 @@
# __________ __ ___.
# Open \______ \ ____ ____ | | _\_ |__ _______ ___
# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
# \/ \/ \/ \/ \/
# $Id: Makefile 19082 2008-11-10 23:54:24Z zagor $
#
# libdemac
DEMACLIB := $(CODECDIR)/libdemac.a
DEMACLIB_SRC := $(call preprocess, $(APPSDIR)/codecs/demac/libdemac/SOURCES)
DEMACLIB_OBJ := $(call c2obj, $(DEMACLIB_SRC))
OTHER_SRC += $(DEMACLIB_SRC)
$(DEMACLIB): $(DEMACLIB_OBJ)
$(call PRINTS,AR $(@F))$(AR) rs $@ $^ >/dev/null 2>&1
DEMACFLAGS = $(filter-out -O%,$(CODECFLAGS))
DEMACFLAGS += -O3
$(CODECDIR)/demac/%.o: $(ROOTDIR)/apps/codecs/demac/%.c
$(SILENT)mkdir -p $(dir $@)
$(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) $(DEMACFLAGS) -c $< -o $@

View file

@ -33,7 +33,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA
#include "config.h"
#ifndef __ASSEMBLER__
#include "../lib/codeclib.h"
#include "codeclib.h"
#include <codecs.h>
#endif

View file

@ -1,50 +0,0 @@
# __________ __ ___.
# Open \______ \ ____ ____ | | _\_ |__ _______ ___
# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
# \/ \/ \/ \/ \/
# $Id$
#
# ../.. for the codec.h in the apps dir
# .. for stuff in the codecs dir
# . for stuff in the codeclib dir
INCLUDES=-I$(APPSDIR) -I.. -I. $(TARGET_INC) -I$(FIRMDIR)/include -I$(FIRMDIR)/export \
-I$(FIRMDIR)/common -I$(BUILDDIR)
ifdef APPEXTRA
INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA)))
endif
CFLAGS = $(INCLUDES) $(GCCOPTS) \
$(TARGET) $(EXTRA_DEFINES) -DMEM=${MEMORYSIZE} -DCODEC
# Sectioned compilation for target
ifndef SIMVER
CFLAGS += -ffunction-sections -fdata-sections
endif
# This sets up 'SRC' based on the files mentioned in SOURCES
include $(TOOLSDIR)/makesrc.inc
SOURCES = $(SRC)
OBJS2 := $(SRC:%.c=$(OBJDIR)/%.o)
OBJS = $(patsubst %.S, $(OBJDIR)/%.o, $(OBJS2))
DEPFILE = $(OBJDIR)/dep-codeclib
DIRS = .
OUTPUT = $(BUILDDIR)/libcodec.a
all: $(OUTPUT)
$(OUTPUT): $(OBJS)
$(call PRINTS,AR+RANLIB $(@F))$(AR) ruv $@ $+ >/dev/null 2>&1
$(SILENT)$(RANLIB) $@
include $(TOOLSDIR)/make.inc
clean:
$(call PRINTS,cleaning codecs/lib)rm -f $(OBJS) $(OUTPUT) $(DEPFILE)
-include $(DEPFILE)

View file

@ -27,8 +27,8 @@
#include "codeclib.h"
#include "metadata.h"
long mem_ptr;
long bufsize;
size_t mem_ptr;
size_t bufsize;
unsigned char* mp3buf; // The actual MP3 buffer from Rockbox
unsigned char* mallocbuf; // 512K from the start of MP3 buffer
unsigned char* filebuf; // The rest of the MP3 buffer

View file

@ -25,14 +25,23 @@
#include <sys/types.h>
extern struct codec_api *ci;
extern long mem_ptr;
extern long bufsize;
extern size_t mem_ptr;
extern size_t bufsize;
extern unsigned char* mp3buf; /* The actual MP3 buffer from Rockbox */
extern unsigned char* mallocbuf; /* The free space after the codec in the codec buffer */
extern unsigned char* filebuf; /* The rest of the MP3 buffer */
/* Standard library functions that are used by the codecs follow here */
/* Get these functions 'out of the way' of the standard functions. Not doing
* so confuses the cygwin linker, and maybe others. These functions need to
* be implemented elsewhere */
#define malloc(x) codec_malloc(x)
#define calloc(x,y) codec_calloc(x,y)
#define realloc(x,y) codec_realloc(x,y)
#define free(x) codec_free(x)
#define alloca(x) __builtin_alloca(x)
void* codec_malloc(size_t size);
void* codec_calloc(size_t nmemb, size_t size);
void* codec_realloc(void* ptr, size_t size);

View file

@ -0,0 +1,23 @@
# __________ __ ___.
# Open \______ \ ____ ____ | | _\_ |__ _______ ___
# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
# \/ \/ \/ \/ \/
# $Id: Makefile 19082 2008-11-10 23:54:24Z zagor $
#
CODECLIB := $(CODECDIR)/libcodec.a
CODECLIB_SRC := $(call preprocess, $(APPSDIR)/codecs/lib/SOURCES)
CODECLIB_OBJ := $(call c2obj, $(CODECLIB_SRC))
OTHER_SRC += $(CODECLIB_SRC)
$(CODECLIB): $(CODECLIB_OBJ)
$(call PRINTS,AR $(@F))$(AR) rs $@ $^ >/dev/null 2>&1
CODECLIBFLAGS = $(CODECFLAGS) -ffunction-sections
$(CODECDIR)/lib/%.o: $(ROOTDIR)/apps/codecs/lib/%.c
$(SILENT)mkdir -p $(dir $@)
$(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) \
-I$(dir $<) $(CODECLIBFLAGS) -c $< -o $@

View file

@ -1,43 +0,0 @@
# __________ __ ___.
# Open \______ \ ____ ____ | | _\_ |__ _______ ___
# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
# \/ \/ \/ \/ \/
# $Id$
#
INCLUDES=-I$(APPSDIR) -I.. -I. -I$(FIRMDIR)/include -I$(FIRMDIR)/export \
-I$(FIRMDIR)/common -I$(FIRMDIR)/drivers -I$(BUILDDIR)
ifdef APPEXTRA
INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA)))
endif
A52OPTS = -O2
CFLAGS = $(INCLUDES) $(GCCOPTS) $(TARGET_INC) $(A52OPTS) $(TARGET) \
$(EXTRA_DEFINES) -DMEM=${MEMORYSIZE} $(PROFILE_OPTS)
# This sets up 'SRC' based on the files mentioned in SOURCES
include $(TOOLSDIR)/makesrc.inc
SOURCES = $(SRC)
OBJS2 := $(SRC:%.c=$(OBJDIR)/%.o)
OBJS = $(patsubst %.S, $(OBJDIR)/%.o, $(OBJS2))
DEPFILE = $(OBJDIR)/dep-liba52
DIRS =
all: $(OUTPUT)
$(OUTPUT): $(OBJS)
$(call PRINTS,AR+RANLIB $(@F))$(AR) ruv $@ $+ >/dev/null 2>&1
$(SILENT)$(RANLIB) $@
include $(TOOLSDIR)/make.inc
clean:
$(call PRINTS,cleaning liba52)rm -f $(OBJS) $(OUTPUT) $(DEPFILE)
ifneq ($(MAKECMDGOALS),clean)
-include $(DEPFILE)
endif

View file

@ -1,4 +1,4 @@
#include "../codec.h"
#include "codeclib.h"
/* a52dec profiling */
/* #undef A52DEC_GPROF */

View file

@ -0,0 +1,17 @@
# __________ __ ___.
# Open \______ \ ____ ____ | | _\_ |__ _______ ___
# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
# \/ \/ \/ \/ \/
# $Id: Makefile 19082 2008-11-10 23:54:24Z zagor $
#
# liba52
A52LIB := $(CODECDIR)/liba52.a
A52LIB_SRC := $(call preprocess, $(APPSDIR)/codecs/liba52/SOURCES)
A52LIB_OBJ := $(call c2obj, $(A52LIB_SRC))
OTHER_SRC += $(A52LIB_SRC)
$(A52LIB): $(A52LIB_OBJ)
$(call PRINTS,AR $(@F))$(AR) rs $@ $^ >/dev/null 2>&1

View file

@ -1,43 +0,0 @@
# __________ __ ___.
# Open \______ \ ____ ____ | | _\_ |__ _______ ___
# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
# \/ \/ \/ \/ \/
# $Id$
#
INCLUDES=-I$(APPSDIR) -I.. -I. -I$(FIRMDIR)/include -I$(FIRMDIR)/export \
-I$(FIRMDIR)/common -I$(FIRMDIR)/drivers -I$(BUILDDIR)
ifdef APPEXTRA
INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA)))
endif
ALACOPTS = -O3
CFLAGS = $(INCLUDES) $(GCCOPTS) $(TARGET_INC) $(ALACOPTS) $(TARGET) \
$(EXTRA_DEFINES) -DMEM=${MEMORYSIZE} $(PROFILE_OPTS)
# This sets up 'SRC' based on the files mentioned in SOURCES
include $(TOOLSDIR)/makesrc.inc
SOURCES = $(SRC)
OBJS2 := $(SRC:%.c=$(OBJDIR)/%.o)
OBJS = $(patsubst %.S, $(OBJDIR)/%.o, $(OBJS2))
DEPFILE = $(OBJDIR)/dep-libalac
DIRS =
all: $(OUTPUT)
$(OUTPUT): $(OBJS)
$(call PRINTS,AR+RANLIB $(@F))$(AR) ruv $@ $+ >/dev/null 2>&1
$(SILENT)$(RANLIB) $@
include $(TOOLSDIR)/make.inc
clean:
$(call PRINTS,cleaning libalac)rm -f $(OBJS) $(OUTPUT) $(DEPFILE)
ifneq ($(MAKECMDGOALS),clean)
-include $(DEPFILE)
endif

View file

@ -35,7 +35,7 @@
#include <string.h>
#include <inttypes.h>
#include "../codec.h"
#include "codeclib.h"
#include "decomp.h"
int16_t predictor_coef_table[32] IBSS_ATTR;

View file

@ -0,0 +1,24 @@
# __________ __ ___.
# Open \______ \ ____ ____ | | _\_ |__ _______ ___
# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
# \/ \/ \/ \/ \/
# $Id: Makefile 19082 2008-11-10 23:54:24Z zagor $
#
# libalac
ALACLIB := $(CODECDIR)/libalac.a
ALACLIB_SRC := $(call preprocess, $(APPSDIR)/codecs/libalac/SOURCES)
ALACLIB_OBJ := $(call c2obj, $(ALACLIB_SRC))
OTHER_SRC += $(ALACLIB_SRC)
$(ALACLIB): $(ALACLIB_OBJ)
$(call PRINTS,AR $(@F))$(AR) rs $@ $^ >/dev/null 2>&1
ALACFLAGS = $(filter-out -O%,$(CODECFLAGS))
ALACFLAGS += -O3
$(CODECDIR)/libalac/%.o: $(ROOTDIR)/apps/codecs/libalac/%.c
$(SILENT)mkdir -p $(dir $@)
$(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) $(ALACFLAGS) -c $< -o $@

View file

@ -1,44 +0,0 @@
# __________ __ ___.
# Open \______ \ ____ ____ | | _\_ |__ _______ ___
# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
# \/ \/ \/ \/ \/
# $Id: Makefile 13920 2007-07-16 21:16:52Z jethead71 $
#
INCLUDES=-I$(APPSDIR) -I.. -I../lib -I. -I$(FIRMDIR)/include -I$(FIRMDIR)/export \
-I$(FIRMDIR)/common -I$(FIRMDIR)/drivers -I$(BUILDDIR)
ifdef APPEXTRA
INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA)))
endif
SPCOPTS = -O -DROCKBOX
CFLAGS = $(INCLUDES) $(GCCOPTS) $(TARGET_INC) $(SPCOPTS) $(TARGET) \
$(EXTRA_DEFINES) -DMEM=${MEMORYSIZE} $(PROFILE_OPTS) -DCODEC=1
# This sets up 'SRC' based on the files mentioned in SOURCES
include $(TOOLSDIR)/makesrc.inc
SOURCES = $(SRC)
OBJS2 := $(SRC:%.c=$(OBJDIR)/%.o)
OBJS = $(patsubst %.S, $(OBJDIR)/%.o, $(OBJS2))
DEPFILE = $(OBJDIR)/dep-spc
DIRS =
all: $(OUTPUT)
$(OUTPUT): $(OBJS)
$(call PRINTS,AR+RANLIB $(@F))$(AR) ruv $@ $+ >/dev/null 2>&1
$(SILENT)$(RANLIB) $@
include $(TOOLSDIR)/make.inc
clean:
$(call PRINTS,cleaning spc)rm -f $(OBJS) $(OUTPUT) $(DEPFILE)
ifneq ($(MAKECMDGOALS),clean)
-include $(DEPFILE)
endif

View file

@ -0,0 +1,24 @@
# __________ __ ___.
# Open \______ \ ____ ____ | | _\_ |__ _______ ___
# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
# \/ \/ \/ \/ \/
# $Id: Makefile 19082 2008-11-10 23:54:24Z zagor $
#
# libasap
ASAPLIB := $(CODECDIR)/libasap.a
ASAPLIB_SRC := $(call preprocess, $(APPSDIR)/codecs/libasap/SOURCES)
ASAPLIB_OBJ := $(call c2obj, $(ASAPLIB_SRC))
OTHER_SRC += $(ASAPLIB_SRC)
$(ASAPLIB): $(ASAPLIB_OBJ)
$(call PRINTS,AR $(@F))$(AR) rs $@ $^ >/dev/null 2>&1
ASAPFLAGS = $(filter-out -O%,$(CODECFLAGS))
ASAPFLAGS += -O1
$(CODECDIR)/libasap/%.o: $(ROOTDIR)/apps/codecs/libasap/%.c
$(SILENT)mkdir -p $(dir $@)
$(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) $(ASAPFLAGS) -c $< -o $@

View file

@ -1,43 +0,0 @@
# __________ __ ___.
# Open \______ \ ____ ____ | | _\_ |__ _______ ___
# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
# \/ \/ \/ \/ \/
# $Id$
#
INCLUDES=-I$(APPSDIR) -I.. -I. -I$(FIRMDIR)/include -I$(FIRMDIR)/export \
-I$(FIRMDIR)/common -I$(FIRMDIR)/drivers -I$(BUILDDIR)
ifdef APPEXTRA
INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA)))
endif
FAADOPTS = -O2 -Wno-char-subscripts
CFLAGS = $(INCLUDES) $(GCCOPTS) $(TARGET_INC) $(FAADOPTS) $(TARGET) \
$(EXTRA_DEFINES) -DMEM=${MEMORYSIZE} $(PROFILE_OPTS)
# This sets up 'SRC' based on the files mentioned in SOURCES
include $(TOOLSDIR)/makesrc.inc
SOURCES = $(SRC)
OBJS2 := $(SRC:%.c=$(OBJDIR)/%.o)
OBJS = $(patsubst %.S, $(OBJDIR)/%.o, $(OBJS2))
DEPFILE = $(OBJDIR)/dep-libfaad
DIRS =
all: $(OUTPUT)
$(OUTPUT): $(OBJS)
$(call PRINTS,AR+RANLIB $(@F))$(AR) ruv $@ $+ >/dev/null 2>&1
$(SILENT)$(RANLIB) $@
include $(TOOLSDIR)/make.inc
clean:
$(call PRINTS,cleaning libfaad)rm -f $(OBJS) $(OUTPUT) $(DEPFILE)
ifneq ($(MAKECMDGOALS),clean)
-include $(DEPFILE)
endif

View file

@ -33,8 +33,7 @@ extern "C" {
#endif
#include "faad_config.h"
#include "../codec.h"
#include "../lib/codeclib.h"
#include "codeclib.h"
extern struct codec_api* ci;

View file

@ -0,0 +1,18 @@
# __________ __ ___.
# Open \______ \ ____ ____ | | _\_ |__ _______ ___
# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
# \/ \/ \/ \/ \/
# $Id: Makefile 19082 2008-11-10 23:54:24Z zagor $
#
# libfaad
FAADLIB := $(CODECDIR)/libfaad.a
FAADLIB_SRC := $(call preprocess, $(APPSDIR)/codecs/libfaad/SOURCES)
FAADLIB_OBJ := $(call c2obj, $(FAADLIB_SRC))
OTHER_SRC += $(FAADLIB_SRC)
OTHER_INC += -I$(APPSDIR)/codecs/libfaad
$(FAADLIB): $(FAADLIB_OBJ)
$(call PRINTS,AR $(@F))$(AR) rs $@ $^ >/dev/null 2>&1

View file

@ -1,43 +0,0 @@
# __________ __ ___.
# Open \______ \ ____ ____ | | _\_ |__ _______ ___
# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
# \/ \/ \/ \/ \/
# $Id$
#
INCLUDES=-I$(APPSDIR) -I.. -I. -I$(FIRMDIR)/include -I$(FIRMDIR)/export \
-I$(FIRMDIR)/common -I$(FIRMDIR)/drivers -I$(BUILDDIR)
ifdef APPEXTRA
INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA)))
endif
FLACOPTS = -O2
CFLAGS = $(INCLUDES) $(GCCOPTS) $(TARGET_INC) $(FLACOPTS) $(TARGET) \
$(EXTRA_DEFINES) -DMEM=${MEMORYSIZE} $(PROFILE_OPTS)
# This sets up 'SRC' based on the files mentioned in SOURCES
include $(TOOLSDIR)/makesrc.inc
SOURCES = $(SRC)
OBJS2 := $(SRC:%.c=$(OBJDIR)/%.o)
OBJS = $(patsubst %.S, $(OBJDIR)/%.o, $(OBJS2))
DEPFILE = $(OBJDIR)/dep-libffmpegFLAC
DIRS =
all: $(OUTPUT)
$(OUTPUT): $(OBJS)
$(call PRINTS,AR+RANLIB $(@F))$(AR) ruv $@ $+ >/dev/null 2>&1
$(SILENT)$(RANLIB) $@
include $(TOOLSDIR)/make.inc
clean:
$(call PRINTS,cleaning libffmpegFLAC)rm -f $(OBJS) $(OUTPUT) $(DEPFILE)
ifneq ($(MAKECMDGOALS),clean)
-include $(DEPFILE)
endif

View file

@ -34,7 +34,7 @@
#include <inttypes.h>
#include <stdbool.h>
#ifndef BUILD_STANDALONE
#include "../codec.h"
#include "codeclib.h"
#endif
#include "bitstream.h"

View file

@ -0,0 +1,17 @@
# __________ __ ___.
# Open \______ \ ____ ____ | | _\_ |__ _______ ___
# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
# \/ \/ \/ \/ \/
# $Id: Makefile 19082 2008-11-10 23:54:24Z zagor $
#
# libffmpegFLAC
FFMPEGFLACLIB := $(CODECDIR)/libffmpegFLAC.a
FFMPEGFLACLIB_SRC := $(call preprocess, $(APPSDIR)/codecs/libffmpegFLAC/SOURCES)
FFMPEGFLACLIB_OBJ := $(call c2obj, $(FFMPEGFLACLIB_SRC))
OTHER_SRC += $(FFMPEGFLACLIB_SRC)
$(FFMPEGFLACLIB): $(FFMPEGFLACLIB_OBJ)
$(call PRINTS,AR $(@F))$(AR) rs $@ $^ >/dev/null 2>&1

View file

@ -1,7 +1,7 @@
#ifdef BUILD_STANDALONE
#define ICONST_ATTR
#else
#include "../codec.h"
#include "codeclib.h"
#endif
#include <inttypes.h>

View file

@ -1,43 +0,0 @@
# __________ __ ___.
# Open \______ \ ____ ____ | | _\_ |__ _______ ___
# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
# \/ \/ \/ \/ \/
# $Id$
#
INCLUDES=-I$(APPSDIR) -I.. -I. -I$(FIRMDIR)/include -I$(FIRMDIR)/export \
-I$(FIRMDIR)/common -I$(FIRMDIR)/drivers -I$(BUILDDIR)
ifdef APPEXTRA
INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA)))
endif
M4AOPTS = -O3
CFLAGS = $(INCLUDES) $(GCCOPTS) $(TARGET_INC) $(M4AOPTS) $(TARGET) \
$(EXTRA_DEFINES) -DMEM=${MEMORYSIZE} $(PROFILE_OPTS)
# This sets up 'SRC' based on the files mentioned in SOURCES
include $(TOOLSDIR)/makesrc.inc
SOURCES = $(SRC)
OBJS2 := $(SRC:%.c=$(OBJDIR)/%.o)
OBJS = $(patsubst %.S, $(OBJDIR)/%.o, $(OBJS2))
DEPFILE = $(OBJDIR)/dep-libm4a
DIRS =
all: $(OUTPUT)
$(OUTPUT): $(OBJS)
$(call PRINTS,AR+RANLIB $(@F))$(AR) ruv $@ $+ >/dev/null 2>&1
$(SILENT)$(RANLIB) $@
include $(TOOLSDIR)/make.inc
clean:
$(call PRINTS,cleaning libm4a)rm -f $(OBJS) $(OUTPUT) $(DEPFILE)
ifneq ($(MAKECMDGOALS),clean)
-include $(DEPFILE)
endif

View file

@ -33,11 +33,14 @@
#include <inttypes.h>
#include <stdlib.h>
#include "../codec.h"
#include "codeclib.h"
#include "m4a.h"
#if defined(DEBUG) || defined(SIMULATOR)
#ifdef DEBUGF
#undef DEBUGF
#endif
#define DEBUGF qtmovie->stream->ci->debugf
#else
#define DEBUGF(...)

View file

@ -0,0 +1,24 @@
# __________ __ ___.
# Open \______ \ ____ ____ | | _\_ |__ _______ ___
# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
# \/ \/ \/ \/ \/
# $Id: Makefile 19082 2008-11-10 23:54:24Z zagor $
#
# libm4a
M4ALIB := $(CODECDIR)/libm4a.a
M4ALIB_SRC := $(call preprocess, $(APPSDIR)/codecs/libm4a/SOURCES)
M4ALIB_OBJ := $(call c2obj, $(M4ALIB_SRC))
OTHER_SRC += $(M4ALIB_SRC)
$(M4ALIB): $(M4ALIB_OBJ)
$(call PRINTS,AR $(@F))$(AR) rs $@ $^ >/dev/null 2>&1
M4AFLAGS = $(filter-out -O%,$(CODECFLAGS))
M4AFLAGS += -O3
$(CODECDIR)/libm4a/%.o: $(ROOTDIR)/apps/codecs/libm4a/%.c
$(SILENT)mkdir -p $(dir $@)
$(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) $(M4AFLAGS) -c $< -o $@

View file

@ -23,13 +23,6 @@
#include <inttypes.h>
#include "m4a.h"
#if defined(DEBUG) || defined(SIMULATOR)
extern struct codec_api* rb;
#define DEBUGF rb->debugf
#else
#define DEBUGF(...)
#endif
/* Implementation of the stream.h functions used by libalac */
#define _Swap32(v) do { \

View file

@ -1,50 +0,0 @@
# __________ __ ___.
# Open \______ \ ____ ____ | | _\_ |__ _______ ___
# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
# \/ \/ \/ \/ \/
# $Id$
#
INCLUDES=-I$(APPSDIR) -I.. -I. -I$(FIRMDIR)/include -I$(FIRMDIR)/export \
-I$(FIRMDIR)/common -I$(FIRMDIR)/drivers -I$(BUILDDIR)
ifdef APPEXTRA
INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA)))
endif
# NOTE: FPM_ define has been moved to global.h
MADOPTS = -UDEBUG -DNDEBUG -O2
# We build libmad separately for mpegplayer
ifdef MPEGPLAYER
EXTRA_DEFINES += -DMPEGPLAYER
endif
CFLAGS = $(INCLUDES) $(GCCOPTS) $(TARGET_INC) $(MADOPTS) $(TARGET) \
$(EXTRA_DEFINES) -DMEM=${MEMORYSIZE} $(PROFILE_OPTS)
# This sets up 'SRC' based on the files mentioned in SOURCES
include $(TOOLSDIR)/makesrc.inc
SOURCES = $(SRC)
OBJS2 := $(SRC:%.c=$(OBJDIR)/%.o)
OBJS = $(patsubst %.S, $(OBJDIR)/%.o, $(OBJS2))
DEPFILE = $(OBJDIR)/dep-libmad
DIRS =
all: $(OUTPUT)
$(OUTPUT): $(OBJS)
$(call PRINTS,AR+RANLIB $(@F))$(AR) ruv $@ $+ >/dev/null 2>&1
$(SILENT)$(RANLIB) $@
include $(TOOLSDIR)/make.inc
clean:
$(call PRINTS,cleaning libmad)rm -f $(OBJS) $(OUTPUT) $(DEPFILE)
ifneq ($(MAKECMDGOALS),clean)
-include $(DEPFILE)
endif

View file

@ -31,7 +31,7 @@
# include "timer.h"
# include "layer12.h"
# include "layer3.h"
# include "../lib/codeclib.h"
# include "codeclib.h"
static
unsigned long const bitrate_table[5][15] = {

View file

@ -19,7 +19,7 @@
* $Id$
*/
#include "../codec.h"
#include "codeclib.h"
# ifndef LIBMAD_GLOBAL_H
# define LIBMAD_GLOBAL_H

View file

@ -0,0 +1,54 @@
# __________ __ ___.
# Open \______ \ ____ ____ | | _\_ |__ _______ ___
# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
# \/ \/ \/ \/ \/
# $Id: Makefile 19082 2008-11-10 23:54:24Z zagor $
#
# we need to build two different mad libraries
# (one for codec, one for mpegplayer)
# so a little trickery is necessary
MADFLAGS = $(CODECFLAGS) -UDEBUG -DNDEBUG -I$(APPSDIR)/codecs/libmad
MPEGMADFLAGS = $(MADFLAGS) -DMPEGPLAYER
# libmad
MADLIB := $(CODECDIR)/libmad.a
MADLIB_SRC := $(call preprocess, $(APPSDIR)/codecs/libmad/SOURCES)
MADLIB_OBJ := $(call c2obj, $(MADLIB_SRC))
OTHER_SRC += $(MADLIB_SRC)
$(MADLIB): $(MADLIB_OBJ)
$(call PRINTS,AR $(@F))$(AR) rs $@ $^ >/dev/null 2>&1
# libmad-mpeg
MPEGMADLIB := $(CODECDIR)/libmad-mpeg.a
MPEGMADLIB_SRC := $(call preprocess, $(APPSDIR)/codecs/libmad/SOURCES)
MPEGMADLIB_OBJ := $(subst .c,.o,$(subst .S,.o,$(subst $(ROOTDIR)/apps/codecs/libmad,$(BUILDDIR)/apps/codecs/libmad-mpeg,$(MPEGMADLIB_SRC))))
$(MPEGMADLIB): $(MPEGMADLIB_OBJ)
$(call PRINTS,AR $(@F))$(AR) rs $@ $^ >/dev/null 2>&1
# pattern rules
$(CODECDIR)/libmad-mpeg/%.o : $(ROOTDIR)/apps/codecs/libmad/%.c
$(SILENT)mkdir -p $(dir $@)
$(call PRINTS,CC $(subst $(ROOTDIR)/,,$<)) \
$(CC) $(MPEGMADFLAGS) -c $< -o $@
$(CODECDIR)/libmad-mpeg/%.o : $(ROOTDIR)/apps/codecs/libmad/%.S
$(SILENT)mkdir -p $(dir $@)
$(call PRINTS,CC $(subst $(ROOTDIR)/,,$<)) \
$(CC) $(MPEGMADFLAGS) -c $< -o $@
$(CODECDIR)/libmad/%.o: $(ROOTDIR)/apps/codecs/libmad/%.c
$(SILENT)mkdir -p $(dir $@)
$(call PRINTS,CC $(subst $(ROOTDIR)/,,$<)) \
$(CC) $(MADFLAGS) -c $< -o $@
$(CODECDIR)/libmad/%.o: $(ROOTDIR)/apps/codecs/libmad/%.S
$(SILENT)mkdir -p $(dir $@)
$(call PRINTS,CC $(subst $(ROOTDIR)/,,$<)) \
$(CC) $(MADFLAGS) -c $< -o $@

View file

@ -1,49 +0,0 @@
# __________ __ ___.
# Open \______ \ ____ ____ | | _\_ |__ _______ ___
# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
# \/ \/ \/ \/ \/
# $Id$
#
INCLUDES=-I$(APPSDIR) -I.. -I. -I$(FIRMDIR)/include -I$(FIRMDIR)/export \
-I$(FIRMDIR)/common -I$(FIRMDIR)/drivers -I$(BUILDDIR)
ifdef APPEXTRA
INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA)))
endif
# libmusepack is faster on ARM-targets with -O1 instead of -O2
ifeq ($(CPU),arm)
MUSEPACKOPTS += -O1
else
MUSEPACKOPTS += -O2
endif
CFLAGS = $(INCLUDES) $(GCCOPTS) $(TARGET_INC) $(MUSEPACKOPTS) $(TARGET) \
$(EXTRA_DEFINES) -DMEM=${MEMORYSIZE} $(PROFILE_OPTS)
# This sets up 'SRC' based on the files mentioned in SOURCES
include $(TOOLSDIR)/makesrc.inc
SOURCES = $(SRC)
OBJS2 := $(SRC:%.c=$(OBJDIR)/%.o)
OBJS = $(patsubst %.S, $(OBJDIR)/%.o, $(OBJS2))
DEPFILE = $(OBJDIR)/dep-libmusepack
DIRS =
all: $(OUTPUT)
$(OUTPUT): $(OBJS)
$(call PRINTS,AR+RANLIB $(@F))$(AR) ruv $@ $+ >/dev/null 2>&1
$(SILENT)$(RANLIB) $@
include $(TOOLSDIR)/make.inc
clean:
$(call PRINTS,cleaning libmusepack)rm -f $(OBJS) $(OUTPUT) $(DEPFILE)
ifneq ($(MAKECMDGOALS),clean)
-include $(DEPFILE)
endif

View file

@ -35,9 +35,9 @@
/// \file huffsv46.c
/// Implementations of huffman decoding for streamversions < 7.
#include <musepack.h>
#include <requant.h>
#include <huffman.h>
#include "musepack.h"
#include "requant.h"
#include "huffman.h"
#ifdef MPC_SUPPORT_SV456

View file

@ -35,9 +35,9 @@
/// \file huffsv7.c
/// Implementations of sv7 huffman decoding functions.
#include <musepack.h>
#include <huffman.h>
#include <requant.h>
#include "musepack.h"
#include "huffman.h"
#include "requant.h"
const HuffmanTyp mpc_table_HuffHdr [10] ICONST_ATTR =
{{2147483648u,1,0},{1610612736u,3,1},{1577058304u,7,-4},{1568669696u,9,3},{1560281088u,9,4},{1543503872u,8,-5},{1476395008u,6,2},{1342177280u,5,-3},{1073741824u,4,-2},{0u,2,-1},};

View file

@ -0,0 +1,29 @@
# __________ __ ___.
# Open \______ \ ____ ____ | | _\_ |__ _______ ___
# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
# \/ \/ \/ \/ \/
# $Id: Makefile 19082 2008-11-10 23:54:24Z zagor $
#
# libmusepack
MUSEPACKLIB := $(CODECDIR)/libmusepack.a
MUSEPACKLIB_SRC := $(call preprocess, $(APPSDIR)/codecs/libmusepack/SOURCES)
MUSEPACKLIB_OBJ := $(call c2obj, $(MUSEPACKLIB_SRC))
OTHER_SRC += $(MUSEPACKLIB_SRC)
$(MUSEPACKLIB): $(MUSEPACKLIB_OBJ)
$(call PRINTS,AR $(@F))$(AR) rs $@ $^ >/dev/null 2>&1
# libmusepack is faster on ARM-targets with -O1 than -O2
MUSEPACKFLAGS = $(filter-out -O%,$(CODECFLAGS)) -I$(APPSDIR)/codecs/libmusepack
ifeq ($(CPU),arm)
MUSEPACKFLAGS += -O1
else
MUSEPACKFLAGS += -O2
endif
$(CODECDIR)/libmusepack/%.o: $(ROOTDIR)/apps/codecs/libmusepack/%.c
$(SILENT)mkdir -p $(dir $@)
$(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) $(MUSEPACKFLAGS) -c $< -o $@

View file

@ -45,7 +45,9 @@ extern "C" {
//#include <stdlib.h>
#include <string.h>
#include "../codec.h"
#ifndef SIMULATOR
#include "codecs.h"
#endif
#include "config_types.h"
#include "decoder.h"
#include "math.h"

View file

@ -1,44 +0,0 @@
# __________ __ ___.
# Open \______ \ ____ ____ | | _\_ |__ _______ ___
# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
# \/ \/ \/ \/ \/
# $Id$
#
INCLUDES=-I$(APPSDIR) -I.. -I. -I$(FIRMDIR)/include -I$(FIRMDIR)/export \
-I$(FIRMDIR)/common -I$(FIRMDIR)/drivers -I$(BUILDDIR)
ifdef APPEXTRA
INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA)))
endif
SPCOPTS = -O -DROCKBOX
CFLAGS = $(INCLUDES) $(GCCOPTS) $(TARGET_INC) $(SPCOPTS) $(TARGET) \
$(EXTRA_DEFINES) -DMEM=${MEMORYSIZE} $(PROFILE_OPTS) -DCODEC=1
# This sets up 'SRC' based on the files mentioned in SOURCES
include $(TOOLSDIR)/makesrc.inc
SOURCES = $(SRC)
OBJS2 := $(SRC:%.c=$(OBJDIR)/%.o)
OBJS = $(patsubst %.S, $(OBJDIR)/%.o, $(OBJS2))
DEPFILE = $(OBJDIR)/dep-spc
DIRS =
all: $(OUTPUT)
$(OUTPUT): $(OBJS)
$(call PRINTS,AR+RANLIB $(@F))$(AR) ruv $@ $+ >/dev/null 2>&1
$(SILENT)$(RANLIB) $@
include $(TOOLSDIR)/make.inc
clean:
$(call PRINTS,cleaning spc)rm -f $(OBJS) $(OUTPUT) $(DEPFILE)
ifneq ($(MAKECMDGOALS),clean)
-include $(DEPFILE)
endif

View file

@ -0,0 +1,24 @@
# __________ __ ___.
# Open \______ \ ____ ____ | | _\_ |__ _______ ___
# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
# \/ \/ \/ \/ \/
# $Id: Makefile 19082 2008-11-10 23:54:24Z zagor $
#
# libspc
SPCLIB := $(CODECDIR)/libspc.a
SPCLIB_SRC := $(call preprocess, $(APPSDIR)/codecs/libspc/SOURCES)
SPCLIB_OBJ := $(call c2obj, $(SPCLIB_SRC))
OTHER_SRC += $(SPCLIB_SRC)
$(SPCLIB): $(SPCLIB_OBJ)
$(call PRINTS,AR $(@F))$(AR) rs $@ $^ >/dev/null 2>&1
SPCFLAGS = $(filter-out -O%,$(CODECFLAGS))
SPCFLAGS += -O1
$(CODECDIR)/libspc/%.o: $(ROOTDIR)/apps/codecs/libspc/%.c
$(SILENT)mkdir -p $(dir $@)
$(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) $(SPCFLAGS) -c $< -o $@

View file

@ -30,7 +30,9 @@
#define _SPC_CODEC_H_
/* rather than comment out asserts, just define NDEBUG */
#ifndef NDEBUG
#define NDEBUG
#endif
#include <assert.h>
/** Basic configuration options **/

View file

@ -22,8 +22,7 @@
****************************************************************************/
/* The CPU portion (shock!) */
#include "codec.h"
#include "codecs.h"
#include "codeclib.h"
#include "spc_codec.h"
#include "spc_profiler.h"

View file

@ -23,8 +23,7 @@
****************************************************************************/
/* The DSP portion (awe!) */
#include "codec.h"
#include "codecs.h"
#include "codeclib.h"
#include "spc_codec.h"
#include "spc_profiler.h"

View file

@ -20,8 +20,7 @@
* KIND, either express or implied.
*
****************************************************************************/
#include "codec.h"
#include "codecs.h"
#include "codeclib.h"
#include "spc_codec.h"
#include "spc_profiler.h"

View file

@ -25,7 +25,7 @@
#if defined(SPC_PROFILE) && defined(USEC_TIMER)
#include "codec.h"
#include "codeclib.h"
#include "spc_codec.h"
#define SPC_DEFINE_PROFILER_TIMERS
#include "spc_profiler.h"

View file

@ -1,57 +0,0 @@
# __________ __ ___.
# Open \______ \ ____ ____ | | _\_ |__ _______ ___
# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
# \/ \/ \/ \/ \/
# $Id: Makefile,v 1.16 2006-09-02 22:34:13 bagder Exp $
#
INCLUDES=-I$(APPSDIR) -I.. -I. -I$(FIRMDIR)/include -I$(FIRMDIR)/export \
-I$(FIRMDIR)/common -I$(FIRMDIR)/drivers -I$(BUILDDIR)
ifdef APPEXTRA
INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA)))
endif
SPEEXOPTS = -DHAVE_CONFIG_H -DSPEEX_DISABLE_ENCODER -DROCKBOX
# We're faster on ARM-targets with -O1 instead of -O2
ifeq ($(CPU),arm)
SPEEXOPTS += -O
else
SPEEXOPTS += -O2
endif
# We build Speex separately for use as a voice codec
ifdef ROCKBOX_VOICE_CODEC
EXTRA_DEFINES += -DROCKBOX_VOICE_CODEC
endif
CFLAGS = $(INCLUDES) $(GCCOPTS) $(TARGET_INC) $(SPEEXOPTS) $(TARGET) \
$(EXTRA_DEFINES) -DMEM=${MEMORYSIZE} ${PROFILE_OPTS} -Wno-unused-parameter
# This sets up 'SRC' based on the files mentioned in SOURCES
include $(TOOLSDIR)/makesrc.inc
SOURCES = $(SRC)
OBJS2 := $(SRC:%.c=$(OBJDIR)/%.o)
OBJS = $(patsubst %.S, $(OBJDIR)/%.o, $(OBJS2))
DEPFILE = $(OBJDIR)/dep-Speex
DIRS =
all: $(OUTPUT)
$(OUTPUT): $(OBJS)
@echo "AR+RANLIB $(notdir $@)"
@$(AR) ruv $@ $+ >/dev/null 2>&1
include $(TOOLSDIR)/make.inc
clean:
@echo "cleaning Speex"
@rm -f $(OBJS) $(OUTPUT) $(DEPFILE)
ifneq ($(MAKECMDGOALS),clean)
-include $(DEPFILE)
endif

View file

@ -36,7 +36,7 @@
#include "config-speex.h"
#endif
#include <speex/speex_bits.h>
#include "speex/speex_bits.h"
#include "arch.h"
#include "os_support.h"

View file

@ -522,6 +522,9 @@ char *stack,
spx_int32_t *seed
)
{
(void)nsf;
(void)stack;
(void)seed;
int i,j;
VARDECL(int *ind);
VARDECL(int *signs);
@ -609,6 +612,9 @@ char *stack,
spx_int32_t *seed
)
{
(void)par;
(void)bits;
(void)stack;
int i;
/* FIXME: This is bad, but I don't think the function ever gets called anyway */
for (i=0;i<nsf;i++)

View file

@ -35,7 +35,7 @@
#ifndef CB_SEARCH_H
#define CB_SEARCH_H
#include <speex/speex_bits.h>
#include "speex/speex_bits.h"
#include "arch.h"
/** Split codebook parameters. */

View file

@ -1,5 +1,5 @@
#ifndef ROCKBOX_VOICE_ENCODER
#include "../codec.h"
#include "codeclib.h"
#include "autoconf.h"
#else
#define ICODE_ATTR

View file

@ -353,6 +353,7 @@ void filter_mem16(const spx_word16_t *x, const spx_coef_t *num, const spx_coef_t
#ifndef OVERRIDE_IIR_MEM16
void iir_mem16(const spx_word16_t *x, const spx_coef_t *den, spx_word16_t *y, int N, int ord, spx_mem_t *mem, char *stack)
{
(void)stack;
int i,j;
spx_word16_t yi,nyi;
@ -497,6 +498,7 @@ void qmf_synth(const spx_word16_t *x1, const spx_word16_t *x2, const spx_word16_
all odd x[i] are zero -- well, actually they are left out of the array now
N and M are multiples of 4 */
{
(void)stack;
int i, j;
int M2, N2;
VARDECL(spx_word16_t *xx1);
@ -681,6 +683,9 @@ spx_word16_t comb_gain, /*gain of comb filter*/
char *stack
)
{
(void)ak;
(void)p;
(void)stack;
int i;
VARDECL(spx_word16_t *iexc);
spx_word16_t old_ener, new_ener;

View file

@ -55,9 +55,9 @@ TODO:
#include "arch.h"
#include <speex/speex.h>
#include <speex/speex_bits.h>
#include <speex/speex_jitter.h>
#include "speex/speex.h"
#include "speex/speex_bits.h"
#include "speex/speex_jitter.h"
#include "os_support.h"
#ifndef NULL

View file

@ -0,0 +1,60 @@
# __________ __ ___.
# Open \______ \ ____ ____ | | _\_ |__ _______ ___
# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
# \/ \/ \/ \/ \/
# $Id: Makefile 19082 2008-11-10 23:54:24Z zagor $
#
# we need to build two different speex libraries
# (one for codec, one for core voice)
# so a little trickery is necessary
SPEEXFLAGS = $(filter-out -O%,$(CODECFLAGS)) \
-DHAVE_CONFIG_H -DSPEEX_DISABLE_ENCODER \
-I$(APPSDIR)/codecs/libspeex
# libspeex is faster on ARM-targets with -O1 instead of -O2
ifeq ($(CPU),arm)
SPEEXFLAGS += -O1
else
SPEEXFLAGS += -O2
endif
VOICESPEEXFLAGS = $(filter-out -ffunction-sections, $(filter-out -DCODEC,$(SPEEXFLAGS))) -DROCKBOX_VOICE_CODEC
# libspeex
SPEEXLIB := $(CODECDIR)/libspeex.a
SPEEXLIB_SRC := $(call preprocess, $(APPSDIR)/codecs/libspeex/SOURCES)
SPEEXLIB_OBJ := $(call c2obj, $(SPEEXLIB_SRC))
OTHER_SRC += $(SPEEXLIB_SRC)
$(SPEEXLIB): $(SPEEXLIB_OBJ)
$(call PRINTS,AR $(@F))$(AR) rs $@ $^ >/dev/null 2>&1
# libspeex-voice
VOICESPEEXLIB := $(CODECDIR)/libspeex-voice.a
VOICESPEEXLIB_SRC := $(call preprocess, $(APPSDIR)/codecs/libspeex/SOURCES)
VOICESPEEXLIB_OBJ := $(subst .c,.o,$(subst .S,.o,$(subst $(ROOTDIR)/apps/codecs/libspeex,$(BUILDDIR)/apps/codecs/libspeex-voice,$(VOICESPEEXLIB_SRC))))
$(VOICESPEEXLIB): $(VOICESPEEXLIB_OBJ)
$(call PRINTS,AR $(@F))$(AR) rs $@ $^ >/dev/null 2>&1
# pattern rules
$(CODECDIR)/libspeex-voice/%.o : $(ROOTDIR)/apps/codecs/libspeex/%.c
$(SILENT)mkdir -p $(dir $@)
$(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) $(VOICESPEEXFLAGS) -c $< -o $@
$(CODECDIR)/libspeex-voice/%.o : $(ROOTDIR)/apps/codecs/libspeex/%.S
$(SILENT)mkdir -p $(dir $@)
$(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) $(VOICESPEEXFLAGS) -c $< -o $@
$(CODECDIR)/libspeex/%.o: $(ROOTDIR)/apps/codecs/libspeex/%.c
$(SILENT)mkdir -p $(dir $@)
$(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) $(SPEEXFLAGS) -c $< -o $@
$(CODECDIR)/libspeex/%.o: $(ROOTDIR)/apps/codecs/libspeex/%.S
$(SILENT)mkdir -p $(dir $@)
$(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) $(SPEEXFLAGS) -c $< -o $@

View file

@ -409,6 +409,7 @@ void lsp_to_lpc(spx_lsp_t *freq,spx_coef_t *ak,int lpcrdr, char *stack)
/* float *ak array of LPC coefficients */
/* int lpcrdr order of LPC coefficients */
{
(void)stack;
int i,j;
spx_word32_t xout1,xout2,xin;
spx_word32_t mult, a;

View file

@ -38,7 +38,7 @@
#include "ltp.h"
#include "stack_alloc.h"
#include "filters.h"
#include <speex/speex_bits.h>
#include "speex/speex_bits.h"
#include "math_approx.h"
#include "os_support.h"
@ -674,6 +674,9 @@ spx_word16_t last_pitch_gain,
int cdbk_offset
)
{
(void)end;
(void)pitch_coef;
(void)stack;
int i;
int pitch;
int gain_index;
@ -826,6 +829,14 @@ spx_word16_t last_pitch_gain,
int cdbk_offset
)
{
(void)end;
(void)par;
(void)bits;
(void)stack;
(void)count_lost;
(void)subframe_offset;
(void)last_pitch_gain;
(void)cdbk_offset;
int i;
#ifdef FIXED_POINT
if (pitch_coef>63)

View file

@ -32,7 +32,7 @@
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <speex/speex_bits.h>
#include "speex/speex_bits.h"
#include "arch.h"
/** LTP parameters. */

View file

@ -87,6 +87,7 @@ spx_word32_t inner_prod(const spx_word16_t *x, const spx_word16_t *y, int len)
#define OVERRIDE_PITCH_XCORR
void pitch_xcorr(const spx_word16_t *_x, const spx_word16_t *_y, spx_word32_t *corr, int len, int nb_pitch, char *stack)
{
(void)stack;
int i,j;
for (i=0;i<nb_pitch;i+=4)
{

View file

@ -36,8 +36,8 @@
#ifndef MODES_H
#define MODES_H
#include <speex/speex.h>
#include <speex/speex_bits.h>
#include "speex/speex.h"
#include "speex/speex_bits.h"
#include "arch.h"
#define NB_SUBMODES 16

View file

@ -43,12 +43,12 @@
#include "filters.h"
#include "stack_alloc.h"
#include "vq.h"
#include <speex/speex_bits.h>
#include "speex/speex_bits.h"
#include "vbr.h"
#include "arch.h"
#include "math_approx.h"
#include "os_support.h"
#include <speex/speex_callbacks.h>
#include "speex/speex_callbacks.h"
#ifdef VORBIS_PSYCHO
#include "vorbis_psy.h"

View file

@ -37,8 +37,8 @@
#define NB_CELP_H
#include "modes.h"
#include <speex/speex_bits.h>
#include <speex/speex_callbacks.h>
#include "speex/speex_bits.h"
#include "speex/speex_callbacks.h"
#include "vbr.h"
#include "filters.h"

View file

@ -35,7 +35,7 @@
#ifndef QUANT_LSP_H
#define QUANT_LSP_H
#include <speex/speex_bits.h>
#include "speex/speex_bits.h"
#include "arch.h"
#define MAX_LSP_SIZE 20

View file

@ -24,8 +24,7 @@
/* We don't want all this stuff if we're building encoder */
#ifndef ROCKBOX_VOICE_ENCODER
#include "../codec.h"
#include "../lib/codeclib.h"
#include "codeclib.h"
#include "debug.h"
#if !defined(ROCKBOX_VOICE_CODEC)
@ -35,6 +34,7 @@
#define DEBUGF ci->debugf
#endif
#ifdef ROCKBOX_HAS_LOGF
#undef LOGF
#define LOGF ci->logf
@ -75,6 +75,9 @@ static inline void speex_free_scratch (void *ptr)
#define OVERRIDE_SPEEX_FATAL 1
static inline void _speex_fatal(const char *str, const char *file, int line)
{
(void)str;
(void)file;
(void)line;
DEBUGF("Fatal error: %s\n", str);
//exit(1);
}
@ -82,24 +85,30 @@ static inline void _speex_fatal(const char *str, const char *file, int line)
#define OVERRIDE_SPEEX_WARNING 1
static inline void speex_warning(const char *str)
{
(void)str;
DEBUGF("warning: %s\n", str);
}
#define OVERRIDE_SPEEX_WARNING_INT 1
static inline void speex_warning_int(const char *str, int val)
{
(void)str;
(void)val;
DEBUGF("warning: %s %d\n", str, val);
}
#define OVERRIDE_SPEEX_NOTIFY 1
static inline void speex_notify(const char *str)
{
(void)str;
DEBUGF("notice: %s\n", str);
}
#define OVERRIDE_SPEEX_PUTC 1
static inline void _speex_putc(int ch, void *file)
{
(void)ch;
(void)file;
//FILE *f = (FILE *)file;
//printf("%c", ch);
}

View file

@ -37,7 +37,7 @@
#define SB_CELP_H
#include "modes.h"
#include <speex/speex_bits.h>
#include "speex/speex_bits.h"
#include "nb_celp.h"
/**Structure representing the full state of the sub-band encoder*/

View file

@ -21,7 +21,7 @@
extern "C" {
#endif
#include "../../codec.h"
#include "codeclib.h"
typedef short spx_ogg_int16_t;
typedef unsigned short spx_ogg_uint16_t;

View file

@ -36,7 +36,7 @@
#include "config-speex.h"
#endif
#include <speex/speex_callbacks.h>
#include "speex/speex_callbacks.h"
#include "arch.h"
#include "os_support.h"
@ -74,6 +74,7 @@ int speex_inband_handler(SpeexBits *bits, SpeexCallback *callback_list, void *st
int speex_std_mode_request_handler(SpeexBits *bits, void *state, void *data)
{
(void)state;
spx_int32_t m;
m = speex_bits_unpack_unsigned(bits, 4);
speex_encoder_ctl(data, SPEEX_SET_MODE, &m);
@ -82,6 +83,7 @@ int speex_std_mode_request_handler(SpeexBits *bits, void *state, void *data)
int speex_std_low_mode_request_handler(SpeexBits *bits, void *state, void *data)
{
(void)state;
spx_int32_t m;
m = speex_bits_unpack_unsigned(bits, 4);
speex_encoder_ctl(data, SPEEX_SET_LOW_MODE, &m);
@ -90,6 +92,7 @@ int speex_std_low_mode_request_handler(SpeexBits *bits, void *state, void *data)
int speex_std_high_mode_request_handler(SpeexBits *bits, void *state, void *data)
{
(void)state;
spx_int32_t m;
m = speex_bits_unpack_unsigned(bits, 4);
speex_encoder_ctl(data, SPEEX_SET_HIGH_MODE, &m);
@ -99,6 +102,7 @@ int speex_std_high_mode_request_handler(SpeexBits *bits, void *state, void *data
#ifndef DISABLE_VBR
int speex_std_vbr_request_handler(SpeexBits *bits, void *state, void *data)
{
(void)state;
spx_int32_t vbr;
vbr = speex_bits_unpack_unsigned(bits, 1);
speex_encoder_ctl(data, SPEEX_SET_VBR, &vbr);
@ -108,6 +112,7 @@ int speex_std_vbr_request_handler(SpeexBits *bits, void *state, void *data)
int speex_std_enh_request_handler(SpeexBits *bits, void *state, void *data)
{
(void)state;
spx_int32_t enh;
enh = speex_bits_unpack_unsigned(bits, 1);
speex_decoder_ctl(data, SPEEX_SET_ENH, &enh);
@ -117,6 +122,7 @@ int speex_std_enh_request_handler(SpeexBits *bits, void *state, void *data)
#ifndef DISABLE_VBR
int speex_std_vbr_quality_request_handler(SpeexBits *bits, void *state, void *data)
{
(void)state;
float qual;
qual = speex_bits_unpack_unsigned(bits, 4);
speex_encoder_ctl(data, SPEEX_SET_VBR_QUALITY, &qual);
@ -126,6 +132,7 @@ int speex_std_vbr_quality_request_handler(SpeexBits *bits, void *state, void *da
int speex_std_char_handler(SpeexBits *bits, void *state, void *data)
{
(void)state;
unsigned char ch;
ch = speex_bits_unpack_unsigned(bits, 8);
_speex_putc(ch, data);
@ -133,11 +140,11 @@ int speex_std_char_handler(SpeexBits *bits, void *state, void *data)
return 0;
}
/* Default handler for user callbacks: skip it */
int speex_default_user_handler(SpeexBits *bits, void *state, void *data)
{
(void)state;
(void)data;
int req_size = speex_bits_unpack_unsigned(bits, 4);
speex_bits_advance(bits, 5+8*req_size);
return 0;

View file

@ -36,8 +36,8 @@
#endif
#include "arch.h"
#include <speex/speex_header.h>
#include <speex/speex.h>
#include "speex/speex_header.h"
#include "speex/speex.h"
#include "os_support.h"
#ifndef NULL

View file

@ -33,8 +33,8 @@
#include "config-speex.h"
#endif
#include <speex/speex_stereo.h>
#include <speex/speex_callbacks.h>
#include "speex/speex_stereo.h"
#include "speex/speex_callbacks.h"
#include "math_approx.h"
#include "vq.h"
#include <math.h>
@ -278,6 +278,7 @@ void speex_decode_stereo_int(spx_int16_t *data, int frame_size, SpeexStereoState
int speex_std_stereo_request_handler(SpeexBits *bits, void *state, void *data)
{
(void)state;
RealSpeexStereoState *stereo;
spx_word16_t sign=1, dexp;
int tmp;

View file

@ -1,49 +0,0 @@
# __________ __ ___.
# Open \______ \ ____ ____ | | _\_ |__ _______ ___
# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
# \/ \/ \/ \/ \/
# $Id$
#
INCLUDES=-I$(APPSDIR) -I.. -I. -I$(FIRMDIR)/include -I$(FIRMDIR)/export \
-I$(FIRMDIR)/common -I$(FIRMDIR)/drivers -I$(BUILDDIR)
ifdef APPEXTRA
INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA)))
endif
# Tremor is slightly faster on coldfire with -O3
ifeq ($(CPU),coldfire)
TREMOROPTS = -O3
else
TREMOROPTS = -O2
endif
CFLAGS = $(INCLUDES) $(GCCOPTS) $(TARGET_INC) $(TREMOROPTS) $(TARGET) \
$(EXTRA_DEFINES) -DMEM=${MEMORYSIZE} ${PROFILE_OPTS}
# This sets up 'SRC' based on the files mentioned in SOURCES
include $(TOOLSDIR)/makesrc.inc
SOURCES = $(SRC)
OBJS2 := $(SRC:%.c=$(OBJDIR)/%.o)
OBJS = $(patsubst %.S, $(OBJDIR)/%.o, $(OBJS2))
DEPFILE = $(OBJDIR)/dep-libtremor
DIRS =
all: $(OUTPUT)
$(OUTPUT): $(OBJS)
$(call PRINTS,AR+RANLIB $(@F))$(AR) ruv $@ $+ >/dev/null 2>&1
$(SILENT)$(RANLIB) $@
include $(TOOLSDIR)/make.inc
clean:
$(call PRINTS,cleaning libtremor)rm -f $(OBJS) $(OUTPUT) $(DEPFILE)
ifneq ($(MAKECMDGOALS),clean)
-include $(DEPFILE)
endif

View file

@ -1,4 +1,4 @@
#include "../codec.h"
#include "codeclib.h"
#ifdef CPU_ARM
#define _ARM_ASSEM_
#endif

View file

@ -1 +1 @@
#include "../../../firmware/common/ctype.c"
#include "common/ctype.c"

View file

@ -0,0 +1,36 @@
# __________ __ ___.
# Open \______ \ ____ ____ | | _\_ |__ _______ ___
# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
# \/ \/ \/ \/ \/
# $Id: Makefile 19082 2008-11-10 23:54:24Z zagor $
#
# libtremor
TREMORLIB := $(CODECDIR)/libtremor.a
TREMORLIB_SRC := $(call preprocess, $(APPSDIR)/codecs/libtremor/SOURCES)
TREMORLIB_OBJ := $(call c2obj, $(TREMORLIB_SRC))
OTHER_SRC += $(TREMORLIB_SRC)
$(TREMORLIB): $(TREMORLIB_OBJ)
$(call PRINTS,AR $(@F))$(AR) rs $@ $^ >/dev/null 2>&1
$(CODECDIR)/libtremor/%.o: $(ROOTDIR)/apps/codecs/libtremor/%.c
$(SILENT)mkdir -p $(dir $@)
$(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) \
-I$(APPSDIR)/codecs/libtremor \
$(CODECFLAGS) $(CFLAGS) -c $< -o $@
TREMORFLAGS = -I$(APPSDIR)/codecs/libtremor $(filter-out -O%,$(CODECFLAGS))
# Tremor is slightly faster on coldfire with -O3
ifeq ($(CPU),coldfire)
TREMORFLAGS += -O3
else
TREMORFLAGS += -O2
endif
$(CODECDIR)/libtremor/%.o: $(ROOTDIR)/apps/codecs/libtremor/%.c
$(SILENT)mkdir -p $(dir $@)
$(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) $(TREMORFLAGS) -c $< -o $@

View file

@ -21,7 +21,7 @@
#include <math.h>
#include "ogg.h"
#include "ivorbiscodec.h"
#include <codecs/lib/codeclib.h>
#include "codeclib.h"
#include "codec_internal.h"
#include "codebook.h"
#include "window.h"

View file

@ -1,7 +1,6 @@
#include <os_types.h>
#include "os_types.h"
static unsigned char *mallocbuf;
static size_t bufsize, tmp_ptr, mem_ptr;
static size_t tmp_ptr;
void ogg_malloc_init(void)
{

View file

@ -1,43 +0,0 @@
# __________ __ ___.
# Open \______ \ ____ ____ | | _\_ |__ _______ ___
# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
# \/ \/ \/ \/ \/
# $Id$
#
INCLUDES=-I$(APPSDIR) -I.. -I. -I$(FIRMDIR)/include -I$(FIRMDIR)/export \
-I$(FIRMDIR)/common -I$(FIRMDIR)/drivers -I$(BUILDDIR)
ifdef APPEXTRA
INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA)))
endif
WAVPACKOPTS = -O2
CFLAGS = $(INCLUDES) $(GCCOPTS) $(TARGET_INC) $(WAVPACKOPTS) $(TARGET) \
$(EXTRA_DEFINES) -DMEM=${MEMORYSIZE} $(PROFILE_OPTS)
# This sets up 'SRC' based on the files mentioned in SOURCES
include $(TOOLSDIR)/makesrc.inc
SOURCES = $(SRC)
OBJS2 := $(SRC:%.c=$(OBJDIR)/%.o)
OBJS = $(patsubst %.S, $(OBJDIR)/%.o, $(OBJS2))
DEPFILE = $(OBJDIR)/dep-libwavpack
DIRS =
all: $(OUTPUT)
$(OUTPUT): $(OBJS)
$(call PRINTS,AR+RANLIB $(@F))$(AR) ruv $@ $+ >/dev/null 2>&1
$(SILENT)$(RANLIB) $@
include $(TOOLSDIR)/make.inc
clean:
$(call PRINTS,cleaning libwavpack)rm -f $(OBJS) $(OUTPUT) $(DEPFILE)
ifneq ($(MAKECMDGOALS),clean)
-include $(DEPFILE)
endif

View file

@ -0,0 +1,17 @@
# __________ __ ___.
# Open \______ \ ____ ____ | | _\_ |__ _______ ___
# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
# \/ \/ \/ \/ \/
# $Id: Makefile 19082 2008-11-10 23:54:24Z zagor $
#
# libwavpack
WAVPACKLIB := $(CODECDIR)/libwavpack.a
WAVPACKLIB_SRC := $(call preprocess, $(APPSDIR)/codecs/libwavpack/SOURCES)
WAVPACKLIB_OBJ := $(call c2obj, $(WAVPACKLIB_SRC))
OTHER_SRC += $(WAVPACKLIB_SRC)
$(WAVPACKLIB): $(WAVPACKLIB_OBJ)
$(call PRINTS,AR $(@F))$(AR) rs $@ $^ >/dev/null 2>&1

View file

@ -7,9 +7,9 @@
////////////////////////////////////////////////////////////////////////////
// wavpack.h
#include "../codec.h"
#ifdef CODEC
#include "codeclib.h"
#endif
#include <inttypes.h>
// This header file contains all the definitions required by WavPack.

View file

@ -1,43 +0,0 @@
# __________ __ ___.
# Open \______ \ ____ ____ | | _\_ |__ _______ ___
# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
# \/ \/ \/ \/ \/
# $Id$
#
INCLUDES=-I$(APPSDIR) -I.. -I. -I$(FIRMDIR)/include -I$(FIRMDIR)/export \
-I$(FIRMDIR)/common -I$(FIRMDIR)/drivers -I$(BUILDDIR)
ifdef APPEXTRA
INCLUDES += $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA)))
endif
WMAOPTS = -O2 -DROCKBOX
CFLAGS = $(INCLUDES) $(GCCOPTS) $(TARGET_INC) $(WMAOPTS) $(TARGET) \
$(EXTRA_DEFINES) -DMEM=${MEMORYSIZE} $(PROFILE_OPTS) -DCODEC=1
# This sets up 'SRC' based on the files mentioned in SOURCES
include $(TOOLSDIR)/makesrc.inc
SOURCES = $(SRC)
OBJS2 := $(SRC:%.c=$(OBJDIR)/%.o)
OBJS = $(patsubst %.S, $(OBJDIR)/%.o, $(OBJS2))
DEPFILE = $(OBJDIR)/dep-libwma
DIRS =
all: $(OUTPUT)
$(OUTPUT): $(OBJS)
$(call PRINTS,AR+RANLIB $(@F))$(AR) ruv $@ $+ >/dev/null 2>&1
$(SILENT)$(RANLIB) $@
include $(TOOLSDIR)/make.inc
clean:
$(call PRINTS,cleaning libwma)rm -f $(OBJS) $(OUTPUT) $(DEPFILE)
ifneq ($(MAKECMDGOALS),clean)
-include $(DEPFILE)
endif

View file

@ -0,0 +1,17 @@
# __________ __ ___.
# Open \______ \ ____ ____ | | _\_ |__ _______ ___
# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
# \/ \/ \/ \/ \/
# $Id: Makefile 19082 2008-11-10 23:54:24Z zagor $
#
# libwma
WMALIB := $(CODECDIR)/libwma.a
WMALIB_SRC := $(call preprocess, $(APPSDIR)/codecs/libwma/SOURCES)
WMALIB_OBJ := $(call c2obj, $(WMALIB_SRC))
OTHER_SRC += $(WMALIB_SRC)
$(WMALIB): $(WMALIB_OBJ)
$(call PRINTS,AR $(@F))$(AR) rs $@ $^ >/dev/null 2>&1

View file

@ -464,7 +464,7 @@ enum codec_status codec_main(void)
int wmares, res;
uint8_t* audiobuf;
int audiobufsize;
int packetlength;
int packetlength = 0;
int errcount = 0;
/* Generic codec initialisation */