From bee20294e0d8e1eb6502688d5b9112c7854c70fa Mon Sep 17 00:00:00 2001 From: "jk7744.park" Date: Tue, 8 Sep 2015 22:02:28 +0900 Subject: [PATCH] tizen 2.3.1 release --- .gitignore | 46 ++ ChangeLog | 20 + INSTALL | 106 ++- Makefile.alt | 15 - Makefile.am | 58 +- amrnb/Makefile.alt | 119 ---- amrnb/Makefile.am | 38 +- amrnb/opencore-amrnb.sym | 6 + amrnb/wrapper.cpp | 4 + amrwb/Makefile.alt | 98 --- amrwb/Makefile.am | 13 +- amrwb/opencore-amrwb.sym | 3 + build_osx.sh | 10 - configure.ac | 27 +- depcomp | 74 +- install-sh | 29 +- m4/lt~obsolete.m4 | 12 +- missing | 53 +- opencore-amr.manifest | 5 + opencore/ChangeLog | 790 ++++++++++++++++++++- opencore/README | 27 +- .../audio/gsm_amr/amr_nb/common/Android.mk | 1 - .../audio/gsm_amr/amr_nb/common/include/basic_op.h | 7 +- .../amr_nb/common/include/basic_op_arm_gcc_v5.h | 70 +- .../amr_nb/common/include/basic_op_c_equivalent.h | 24 +- .../audio/gsm_amr/amr_nb/common/include/l_add.h | 19 +- .../audio/gsm_amr/amr_nb/common/include/l_mac.h | 18 +- .../audio/gsm_amr/amr_nb/common/include/l_msu.h | 22 +- .../audio/gsm_amr/amr_nb/common/include/l_mult.h | 23 +- .../audio/gsm_amr/amr_nb/common/include/l_sub.h | 22 +- .../audio/gsm_amr/amr_nb/common/include/mpy_32.h | 40 +- .../gsm_amr/amr_nb/common/include/mpy_32_16.h | 40 +- .../audio/gsm_amr/amr_nb/common/include/mult.h | 23 +- .../audio/gsm_amr/amr_nb/common/include/norm_l.h | 31 +- .../audio/gsm_amr/amr_nb/common/include/norm_s.h | 34 +- .../audio/gsm_amr/amr_nb/common/include/typedef.h | 3 +- .../audio/gsm_amr/amr_nb/common/src/add.cpp | 2 +- .../audio/gsm_amr/amr_nb/common/src/az_lsp.cpp | 2 +- .../audio/gsm_amr/amr_nb/common/src/bytesused.cpp | 171 ----- .../audio/gsm_amr/amr_nb/common/src/gc_pred.cpp | 4 +- .../audio/gsm_amr/amr_nb/common/src/mult_r.cpp | 2 +- .../audio/gsm_amr/amr_nb/common/src/norm_l.cpp | 4 +- .../audio/gsm_amr/amr_nb/common/src/norm_s.cpp | 4 +- .../gsm_amr/amr_nb/common/src/qua_gain_tbl.cpp | 2 + .../audio/gsm_amr/amr_nb/common/src/sub.cpp | 2 +- .../audio/gsm_amr/amr_nb/common/src/syn_filt.cpp | 8 +- .../codecs_v2/audio/gsm_amr/amr_nb/dec/Android.mk | 1 - .../codecs_v2/audio/gsm_amr/amr_nb/dec/src/agc.cpp | 6 +- .../audio/gsm_amr/amr_nb/dec/src/ph_disp.cpp | 2 +- .../audio/gsm_amr/amr_nb/dec/src/post_pro.cpp | 5 +- .../codecs_v2/audio/gsm_amr/amr_nb/enc/Android.mk | 1 - .../codecs_v2/audio/gsm_amr/amr_wb/dec/Android.mk | 1 - .../audio/gsm_amr/amr_wb/dec/src/isp_az.cpp | 6 +- .../gsm_amr/amr_wb/dec/src/normalize_amr_wb.cpp | 6 +- .../gsm_amr/amr_wb/dec/src/normalize_amr_wb.h | 19 +- .../amr_wb/dec/src/pvamrwbdecoder_basic_op.h | 16 +- .../dec/src/pvamrwbdecoder_basic_op_cequivalent.h | 3 +- .../dec/src/pvamrwbdecoder_basic_op_gcc_armv5.h | 6 +- .../codecs_v2/audio/gsm_amr/common/dec/Android.mk | 1 - .../common/dec/include/pvgsmamrdecoderinterface.h | 1 + oscl/oscl_base_macros.h | 25 + packaging/opencore-amr.manifest | 5 - packaging/opencore-amr.spec | 23 +- test/Makefile.alt | 23 - test/Makefile.am | 32 +- test/{amrnb-dec.cpp => amrnb-dec.c} | 44 +- test/amrnb-enc-sine.c | 59 ++ test/amrnb-enc.c | 121 +++- test/{amrwb-dec.cpp => amrwb-dec.c} | 46 +- test/linkboth.c | 8 +- test/wav.cpp | 87 --- test/wavreader.c | 162 +++++ test/{wav.h => wavreader.h} | 34 +- test/wavwriter.c | 111 +++ test/wavwriter.h | 36 + 75 files changed, 1871 insertions(+), 1150 deletions(-) create mode 100644 .gitignore delete mode 100644 Makefile.alt delete mode 100644 amrnb/Makefile.alt create mode 100644 amrnb/opencore-amrnb.sym delete mode 100644 amrwb/Makefile.alt create mode 100644 amrwb/opencore-amrwb.sym delete mode 100755 build_osx.sh create mode 100755 opencore-amr.manifest delete mode 100644 opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/bytesused.cpp create mode 100644 oscl/oscl_base_macros.h delete mode 100644 packaging/opencore-amr.manifest delete mode 100644 test/Makefile.alt rename test/{amrnb-dec.cpp => amrnb-dec.c} (74%) create mode 100644 test/amrnb-enc-sine.c rename test/{amrwb-dec.cpp => amrwb-dec.c} (73%) delete mode 100644 test/wav.cpp create mode 100644 test/wavreader.c rename test/{wav.h => wavreader.h} (62%) create mode 100644 test/wavwriter.c create mode 100644 test/wavwriter.h diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..605df9f --- /dev/null +++ b/.gitignore @@ -0,0 +1,46 @@ +build_log +*.log +*.pyc +usr +opt +*.o +*.os +*.exe +packages +binaries +*.ipk +*~ +*.lo +*.la +.deps +.libs +Makefile +Makefile.in +build-stamp +config.h +config.status +debian/files +debian/*.substvars +debian/*.install +debian/*.debhelper +debian/libopencore-amrnb-dev/ +debian/libopencore-amrnb-dbg/ +debian/libopencore-amrnb/ +debian/libopencore-amrwb-dev/ +debian/libopencore-amrwb-dbg/ +debian/libopencore-amrwb/ +libtool +opencore-amrnb.pc +src/Makefile +src/Makefile.in +stamp-h1 +aclocal.m4 +config.guess +config.hin +config.sub +configure +ltmain.sh +m4/libtool.m4 +m4/ltoptions.m4 +m4/ltsugar.m4 +m4/ltversion.m4 diff --git a/ChangeLog b/ChangeLog index 316ff9d..6acf662 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,2 +1,22 @@ +0.1.3 + - Adjusted libtool flags for building DLLs for windows + - Update to the latest upstream opencore source + - Updated and improved example applications + - Add options for enabling the arm inline assembly + - Add options for disabling the encoder or decoder in the amrnb library + - Avoid dependencies on libstdc++ if building the source as C + - Hide internal symbols in shared libraries + - Minor tweaks + - Remove old static makefiles and corresponding build scripts + +0.1.2 + - Fixed AMR-NB encoding on 64-bit architectures + - Switch to using automake/autoconf/libtool + - Update to the latest upstream opencore source as of September 1, 2009 + +0.1.1 + - Rename the libraries from libamr* to libopencore-amr* + - Fix a bunch of compiler warnings + 0.1.0 - Start of opencore-amr project. diff --git a/INSTALL b/INSTALL index 2550dab..a1e89e1 100644 --- a/INSTALL +++ b/INSTALL @@ -1,11 +1,13 @@ Installation Instructions ************************* -Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005, -2006, 2007, 2008, 2009 Free Software Foundation, Inc. +Copyright (C) 1994-1996, 1999-2002, 2004-2011 Free Software Foundation, +Inc. - This file is free documentation; the Free Software Foundation gives -unlimited permission to copy, distribute and modify it. + Copying and distribution of this file, with or without modification, +are permitted in any medium without royalty provided the copyright +notice and this notice are preserved. This file is offered as-is, +without warranty of any kind. Basic Installation ================== @@ -13,7 +15,11 @@ Basic Installation Briefly, the shell commands `./configure; make; make install' should configure, build, and install this package. The following more-detailed instructions are generic; see the `README' file for -instructions specific to this package. +instructions specific to this package. Some packages provide this +`INSTALL' file but do not implement all of the features documented +below. The lack of an optional feature in a given package is not +necessarily a bug. More recommendations for GNU packages can be found +in *note Makefile Conventions: (standards)Makefile Conventions. The `configure' shell script attempts to guess correct values for various system-dependent variables used during compilation. It uses @@ -42,7 +48,7 @@ may remove or edit it. you want to change it or regenerate `configure' using a newer version of `autoconf'. -The simplest way to compile this package is: + The simplest way to compile this package is: 1. `cd' to the directory containing the package's source code and type `./configure' to configure the package for your system. @@ -53,12 +59,22 @@ The simplest way to compile this package is: 2. Type `make' to compile the package. 3. Optionally, type `make check' to run any self-tests that come with - the package. + the package, generally using the just-built uninstalled binaries. 4. Type `make install' to install the programs and any data files and - documentation. - - 5. You can remove the program binaries and object files from the + documentation. When installing into a prefix owned by root, it is + recommended that the package be configured and built as a regular + user, and only the `make install' phase executed with root + privileges. + + 5. Optionally, type `make installcheck' to repeat any self-tests, but + this time using the binaries in their final installed location. + This target does not install anything. Running this target as a + regular user, particularly if the prior `make install' required + root privileges, verifies that the installation completed + correctly. + + 6. You can remove the program binaries and object files from the source code directory by typing `make clean'. To also remove the files that `configure' created (so you can compile the package for a different kind of computer), type `make distclean'. There is @@ -67,8 +83,15 @@ The simplest way to compile this package is: all sorts of other programs in order to regenerate files that came with the distribution. - 6. Often, you can also type `make uninstall' to remove the installed - files again. + 7. Often, you can also type `make uninstall' to remove the installed + files again. In practice, not all packages have tested that + uninstallation works correctly, even though it is required by the + GNU Coding Standards. + + 8. Some packages, particularly those that use Automake, provide `make + distcheck', which can by used by developers to test that all other + targets like `make install' and `make uninstall' work correctly. + This target is generally not run by end users. Compilers and Options ===================== @@ -93,7 +116,8 @@ same time, by placing the object files for each architecture in their own directory. To do this, you can use GNU `make'. `cd' to the directory where you want the object files and executables to go and run the `configure' script. `configure' automatically checks for the -source code in the directory that `configure' is in and in `..'. +source code in the directory that `configure' is in and in `..'. This +is known as a "VPATH" build. With a non-GNU `make', it is safer to compile the package for one architecture at a time in the source code directory. After you have @@ -120,7 +144,8 @@ Installation Names By default, `make install' installs the package's commands under `/usr/local/bin', include files under `/usr/local/include', etc. You can specify an installation prefix other than `/usr/local' by giving -`configure' the option `--prefix=PREFIX'. +`configure' the option `--prefix=PREFIX', where PREFIX must be an +absolute file name. You can specify separate installation prefixes for architecture-specific files and architecture-independent files. If you @@ -131,15 +156,46 @@ Documentation and other data files still use the regular prefix. In addition, if you use an unusual directory layout you can give options like `--bindir=DIR' to specify different values for particular kinds of files. Run `configure --help' for a list of the directories -you can set and what kinds of files go in them. +you can set and what kinds of files go in them. In general, the +default for these options is expressed in terms of `${prefix}', so that +specifying just `--prefix' will affect all of the other directory +specifications that were not explicitly provided. + + The most portable way to affect installation locations is to pass the +correct locations to `configure'; however, many packages provide one or +both of the following shortcuts of passing variable assignments to the +`make install' command line to change installation locations without +having to reconfigure or recompile. + + The first method involves providing an override variable for each +affected directory. For example, `make install +prefix=/alternate/directory' will choose an alternate location for all +directory configuration variables that were expressed in terms of +`${prefix}'. Any directories that were specified during `configure', +but not in terms of `${prefix}', must each be overridden at install +time for the entire installation to be relocated. The approach of +makefile variable overrides for each directory variable is required by +the GNU Coding Standards, and ideally causes no recompilation. +However, some platforms have known limitations with the semantics of +shared libraries that end up requiring recompilation when using this +method, particularly noticeable in packages that use GNU Libtool. + + The second method involves providing the `DESTDIR' variable. For +example, `make install DESTDIR=/alternate/directory' will prepend +`/alternate/directory' before all installation names. The approach of +`DESTDIR' overrides is not required by the GNU Coding Standards, and +does not work on platforms that have drive letters. On the other hand, +it does better at avoiding recompilation issues, and works well even +when some directory options were not specified in terms of `${prefix}' +at `configure' time. + +Optional Features +================= If the package supports it, you can cause programs to be installed with an extra prefix or suffix on their names by giving `configure' the option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. -Optional Features -================= - Some packages pay attention to `--enable-FEATURE' options to `configure', where FEATURE indicates an optional part of the package. They may also pay attention to `--with-PACKAGE' options, where PACKAGE @@ -152,6 +208,13 @@ find the X include and library files automatically, but if it doesn't, you can use the `configure' options `--x-includes=DIR' and `--x-libraries=DIR' to specify their locations. + Some packages offer the ability to configure how verbose the +execution of `make' will be. For these packages, running `./configure +--enable-silent-rules' sets the default to minimal output, which can be +overridden with `make V=1'; while running `./configure +--disable-silent-rules' sets the default to verbose, which can be +overridden with `make V=0'. + Particular systems ================== @@ -163,6 +226,11 @@ order to use an ANSI C compiler: and if that doesn't work, install pre-built binaries of GCC for HP-UX. + HP-UX `make' updates targets which have the same time stamps as +their prerequisites, which makes it generally unusable when shipped +generated files such as `configure' are involved. Use GNU `make' +instead. + On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot parse its `' header file. The option `-nodtk' can be used as a workaround. If GNU CC is not installed, it is therefore recommended @@ -288,7 +356,7 @@ operates. `configure' can determine that directory automatically. `--prefix=DIR' - Use DIR as the installation prefix. *Note Installation Names:: + Use DIR as the installation prefix. *note Installation Names:: for more details, including other options available for fine-tuning the installation locations. diff --git a/Makefile.alt b/Makefile.alt deleted file mode 100644 index 30c3595..0000000 --- a/Makefile.alt +++ /dev/null @@ -1,15 +0,0 @@ -all: - $(MAKE) -f Makefile.alt -C amrnb BUILD_AS_C=1 - $(MAKE) -f Makefile.alt -C amrwb BUILD_AS_C=1 - -distclean: clean -clean: - $(MAKE) -f Makefile.alt -C amrnb clean - $(MAKE) -f Makefile.alt -C amrwb clean - -install: - $(MAKE) -f Makefile.alt -C amrnb install BUILD_AS_C=1 - $(MAKE) -f Makefile.alt -C amrwb install BUILD_AS_C=1 - -.PHONY: install - diff --git a/Makefile.am b/Makefile.am index d30dd37..f8eee3f 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,32 +1,36 @@ -SUBDIRS = amrnb amrwb test +SUBDIRS = amrnb amrwb +if EXAMPLES + SUBDIRS += test +endif ACLOCAL_AMFLAGS = -I m4 -noinst_HEADERS = oscl/oscl_base.h oscl/oscl_mem.h +noinst_HEADERS = oscl/oscl_base.h oscl/oscl_mem.h oscl/oscl_base_macros.h -EXTRA_DIST = LICENSE Makefile.alt build_osx.sh \ - opencore/README opencore/NOTICE opencore/ChangeLog \ - opencore/codecs_v2/audio/gsm_amr/patent_disclaimer.txt \ - opencore/codecs_v2/audio/gsm_amr/common/dec/include \ - opencore/codecs_v2/audio/gsm_amr/common/dec/build \ - opencore/codecs_v2/audio/gsm_amr/common/dec/Android.mk \ - opencore/codecs_v2/audio/gsm_amr/amr_nb/common/Android.mk \ - opencore/codecs_v2/audio/gsm_amr/amr_nb/common/build \ - opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include \ - opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/*.cpp \ - opencore/codecs_v2/audio/gsm_amr/amr_nb/dec/Android.mk \ - opencore/codecs_v2/audio/gsm_amr/amr_nb/dec/build \ - opencore/codecs_v2/audio/gsm_amr/amr_nb/dec/include \ - opencore/codecs_v2/audio/gsm_amr/amr_nb/dec/src/*.cpp \ - opencore/codecs_v2/audio/gsm_amr/amr_nb/dec/src/*.h \ - opencore/codecs_v2/audio/gsm_amr/amr_nb/enc/Android.mk \ - opencore/codecs_v2/audio/gsm_amr/amr_nb/enc/build \ - opencore/codecs_v2/audio/gsm_amr/amr_nb/enc/include \ - opencore/codecs_v2/audio/gsm_amr/amr_nb/enc/src/*.cpp \ - opencore/codecs_v2/audio/gsm_amr/amr_nb/enc/src/*.h \ - opencore/codecs_v2/audio/gsm_amr/amr_wb/dec/Android.mk \ - opencore/codecs_v2/audio/gsm_amr/amr_wb/dec/build \ - opencore/codecs_v2/audio/gsm_amr/amr_wb/dec/include \ - opencore/codecs_v2/audio/gsm_amr/amr_wb/dec/src/*.cpp \ - opencore/codecs_v2/audio/gsm_amr/amr_wb/dec/src/*.h +EXTRA_DIST = $(top_srcdir)/LICENSE \ + $(top_srcdir)/opencore/README \ + $(top_srcdir)/opencore/NOTICE opencore/ChangeLog \ + $(top_srcdir)/opencore/codecs_v2/audio/gsm_amr/patent_disclaimer.txt \ + $(top_srcdir)/opencore/codecs_v2/audio/gsm_amr/common/dec/include \ + $(top_srcdir)/opencore/codecs_v2/audio/gsm_amr/common/dec/build \ + $(top_srcdir)/opencore/codecs_v2/audio/gsm_amr/common/dec/Android.mk \ + $(top_srcdir)/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/Android.mk \ + $(top_srcdir)/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/build \ + $(top_srcdir)/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include \ + $(top_srcdir)/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/*.cpp \ + $(top_srcdir)/opencore/codecs_v2/audio/gsm_amr/amr_nb/dec/Android.mk \ + $(top_srcdir)/opencore/codecs_v2/audio/gsm_amr/amr_nb/dec/build \ + $(top_srcdir)/opencore/codecs_v2/audio/gsm_amr/amr_nb/dec/include \ + $(top_srcdir)/opencore/codecs_v2/audio/gsm_amr/amr_nb/dec/src/*.cpp \ + $(top_srcdir)/opencore/codecs_v2/audio/gsm_amr/amr_nb/dec/src/*.h \ + $(top_srcdir)/opencore/codecs_v2/audio/gsm_amr/amr_nb/enc/Android.mk \ + $(top_srcdir)/opencore/codecs_v2/audio/gsm_amr/amr_nb/enc/build \ + $(top_srcdir)/opencore/codecs_v2/audio/gsm_amr/amr_nb/enc/include \ + $(top_srcdir)/opencore/codecs_v2/audio/gsm_amr/amr_nb/enc/src/*.cpp \ + $(top_srcdir)/opencore/codecs_v2/audio/gsm_amr/amr_nb/enc/src/*.h \ + $(top_srcdir)/opencore/codecs_v2/audio/gsm_amr/amr_wb/dec/Android.mk \ + $(top_srcdir)/opencore/codecs_v2/audio/gsm_amr/amr_wb/dec/build \ + $(top_srcdir)/opencore/codecs_v2/audio/gsm_amr/amr_wb/dec/include \ + $(top_srcdir)/opencore/codecs_v2/audio/gsm_amr/amr_wb/dec/src/*.cpp \ + $(top_srcdir)/opencore/codecs_v2/audio/gsm_amr/amr_wb/dec/src/*.h diff --git a/amrnb/Makefile.alt b/amrnb/Makefile.alt deleted file mode 100644 index 0dbc567..0000000 --- a/amrnb/Makefile.alt +++ /dev/null @@ -1,119 +0,0 @@ -# Just set OC_BASE to the opencore root, or set AMR_BASE directly to -# a detached gsm_amr directory -OC_BASE = ../opencore -AMR_BASE = $(OC_BASE)/codecs_v2/audio/gsm_amr -LIBDIR=lib -BINDIR=bin - -# To compile as C instead of C++, define BUILD_AS_C -ifneq (, $(BUILD_AS_C)) - CXX = $(CC) - CXXFLAGS += -x c -std=c99 -endif - -ifeq (, $(PREFIX)) - PREFIX = /usr/local -endif - -DEC_DIR = $(AMR_BASE)/amr_nb/dec -ENC_DIR = $(AMR_BASE)/amr_nb/enc -COMMON_DIR = $(AMR_BASE)/amr_nb/common -DEC_SRC_DIR = $(DEC_DIR)/src -ENC_SRC_DIR = $(ENC_DIR)/src -COMMON_SRC_DIR = $(COMMON_DIR)/src -OSCL = ../oscl - -CPPFLAGS = -I$(OSCL) -I$(DEC_SRC_DIR) -I$(COMMON_DIR)/include -I$(DEC_DIR)/include -I$(AMR_BASE)/common/dec/include -I$(ENC_SRC_DIR) - -# Find all the source files -DEC_SRC := $(shell cd $(DEC_SRC_DIR) && echo *.cpp) -ENC_SRC := $(shell cd $(ENC_SRC_DIR) && echo *.cpp) -COMMON_SRC := $(shell cd $(COMMON_SRC_DIR) && echo *.cpp) - -# Exclude these files -DEC_SRC := $(DEC_SRC:decoder_gsm_amr.cpp=) -DEC_SRC := $(DEC_SRC:pvgsmamrdecoder.cpp=) -ENC_SRC := $(ENC_SRC:gsmamr_encoder_wrapper.cpp=) -COMMON_SRC := $(COMMON_SRC:bits2prm.cpp=) -COMMON_SRC := $(COMMON_SRC:copy.cpp=) -COMMON_SRC := $(COMMON_SRC:div_32.cpp=) -COMMON_SRC := $(COMMON_SRC:l_abs.cpp=) -COMMON_SRC := $(COMMON_SRC:vad1.cpp=) -COMMON_SRC := $(COMMON_SRC:r_fft.cpp=) -COMMON_SRC := $(COMMON_SRC:vad2.cpp=) - -DEC_OBJS := $(DEC_SRC:.cpp=.o) -DEC_OBJS := $(patsubst %,$(DEC_SRC_DIR)/%, $(DEC_OBJS)) -ENC_OBJS := $(ENC_SRC:.cpp=.o) -ENC_OBJS := $(patsubst %,$(ENC_SRC_DIR)/%, $(ENC_OBJS)) -COMMON_OBJS := $(COMMON_SRC:.cpp=.o) -COMMON_OBJS := $(patsubst %,$(COMMON_SRC_DIR)/%, $(COMMON_OBJS)) - -OBJS = wrapper.o $(DEC_OBJS) $(ENC_OBJS) $(COMMON_OBJS) -SOBJS = $(OBJS:%.o=%.lo) - -#Versioning -MAJOR = 0 -MINOR = 1 -REVISION = 1 -VERSION = $(MAJOR).$(MINOR).$(REVISION) - -ifeq ($(shell uname), Darwin) - SHLIB_EXT = dylib - SHLIB_FLAGS = -dynamiclib -else - ifeq ($(shell uname | sed -e 's/\(MINGW32_NT\)\(.*\)/\1/'), MINGW32_NT) - SHLIB_EXT = $(MAJOR).$(MINOR).$(REVISION).dll - SHLIB_FLAGS = -shared - SONAME = libopencore-amrnb-$(MAJOR).dll - else - SHLIB_EXT = so.$(MAJOR).$(MINOR).$(REVISION) - SHLIB_FLAGS = -shared - SONAME = libopencore-amrnb.so.$(MAJOR) - endif -endif -SHLIB = libopencore-amrnb.$(SHLIB_EXT) - -all: libopencore-amrnb.a $(SHLIB) - -$(SHLIB): $(SOBJS) -ifeq ($(shell uname), Darwin) - $(CXX) $(SHLIB_FLAGS) -o $@ $+ $(LDFLAGS) -else - $(CXX) $(SHLIB_FLAGS) -o $@ $+ -Wl,-soname,$(SONAME) $(LDFLAGS) -endif - -%.lo: %.c - $(CC) $(CPPFLAGS) $(CFLAGS) -fPIC -DPIC -c $< -o $@ - -%.lo: %.cpp - $(CXX) $(CPPFLAGS) $(CXXFLAGS) -fPIC -DPIC -c $< -o $@ - -libopencore-amrnb.a: $(OBJS) - ar rcs $@ $+ - -install: libopencore-amrnb.a $(SHLIB) - install -d $(DESTDIR)$(PREFIX)/$(LIBDIR) - install -m 644 libopencore-amrnb.a $(DESTDIR)$(PREFIX)/$(LIBDIR) -ifeq ($(shell uname | sed -e 's/\(MINGW32_NT\)\(.*\)/\1/'), MINGW32_NT) - install -d $(DESTDIR)$(PREFIX)/$(BINDIR) - install $(SHLIB) $(DESTDIR)$(PREFIX)/$(BINDIR) -else - install $(SHLIB) $(DESTDIR)$(PREFIX)/$(LIBDIR) -endif -ifneq ($(shell uname), Darwin) -ifeq ($(shell uname | sed -e 's/\(MINGW32_NT\)\(.*\)/\1/'), MINGW32_NT) - ln -sf $(SHLIB) $(DESTDIR)$(PREFIX)/$(BINDIR)/$(SONAME) - ln -sf $(DESTDIR)$(PREFIX)/$(BINDIR)/$(SONAME) $(DESTDIR)$(PREFIX)/$(BINDIR)/libopencore-amrnb.dll -else - ln -sf $(SHLIB) $(DESTDIR)$(PREFIX)/$(LIBDIR)/$(SONAME) - ln -sf $(SONAME) $(DESTDIR)$(PREFIX)/$(LIBDIR)/libopencore-amrnb.so -endif -endif - install -d $(DESTDIR)$(PREFIX)/include/opencore-amrnb - install -m 644 interf_dec.h $(DESTDIR)$(PREFIX)/include/opencore-amrnb - install -m 644 interf_enc.h $(DESTDIR)$(PREFIX)/include/opencore-amrnb - -clean: - rm -f $(SHLIB) libopencore-amrnb.a *.o *.lo $(OBJS) $(SOBJS) - diff --git a/amrnb/Makefile.am b/amrnb/Makefile.am index cc4cf3c..1b42bd5 100644 --- a/amrnb/Makefile.am +++ b/amrnb/Makefile.am @@ -14,21 +14,31 @@ OSCL = $(top_srcdir)/oscl AM_CFLAGS = -I$(OSCL) -I$(DEC_SRC_DIR) -I$(COMMON_DIR)/include \ -I$(DEC_DIR)/include -I$(AMR_BASE)/common/dec/include -I$(ENC_SRC_DIR) +if GCC_ARMV5 + AM_CFLAGS += -DPV_CPU_ARCH_VERSION=5 -DPV_COMPILER=1 +endif + if COMPILE_AS_C AM_CFLAGS += -x c -std=c99 + libopencore_amrnb_la_LINK = $(LINK) $(libopencore_amrnb_la_LDFLAGS) + # Mention a dummy pure C file to trigger generation of the $(LINK) variable + nodist_EXTRA_libopencore_amrnb_la_SOURCES = dummy.c +else + libopencore_amrnb_la_LINK = $(CXXLINK) $(libopencore_amrnb_la_LDFLAGS) endif AM_CXXFLAGS = $(AM_CFLAGS) amrnbincludedir = $(includedir)/opencore-amrnb -amrnbinclude_HEADERS = interf_dec.h interf_enc.h +amrnbinclude_HEADERS = pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = opencore-amrnb.pc lib_LTLIBRARIES = libopencore-amrnb.la -libopencore_amrnb_la_LDFLAGS = -version-info @OPENCORE_AMRNB_VERSION@ +libopencore_amrnb_la_LDFLAGS = -version-info @OPENCORE_AMRNB_VERSION@ -no-undefined -export-symbols $(top_srcdir)/amrnb/opencore-amrnb.sym +EXTRA_DIST = $(top_srcdir)/amrnb/opencore-amrnb.sym # Our sources to include. There are certain sources we exclude and they are # $(DEC_SRC_DIR)/decoder_gsm_amr.cpp @@ -42,7 +52,10 @@ libopencore_amrnb_la_LDFLAGS = -version-info @OPENCORE_AMRNB_VERSION@ # $(COMMON_SRC_DIR)/vad1.cpp # $(COMMON_SRC_DIR)/vad2.cpp libopencore_amrnb_la_SOURCES = \ - wrapper.cpp \ + wrapper.cpp + +if AMRNB_DECODER + libopencore_amrnb_la_SOURCES += \ $(DEC_SRC_DIR)/agc.cpp \ $(DEC_SRC_DIR)/amrdecode.cpp \ $(DEC_SRC_DIR)/a_refl.cpp \ @@ -77,7 +90,14 @@ libopencore_amrnb_la_SOURCES = \ $(DEC_SRC_DIR)/pstfilt.cpp \ $(DEC_SRC_DIR)/qgain475_tab.cpp \ $(DEC_SRC_DIR)/sp_dec.cpp \ - $(DEC_SRC_DIR)/wmf_to_ets.cpp \ + $(DEC_SRC_DIR)/wmf_to_ets.cpp + amrnbinclude_HEADERS += interf_dec.h +else + AM_CFLAGS += -DDISABLE_AMRNB_DECODER +endif + +if AMRNB_ENCODER + libopencore_amrnb_la_SOURCES += \ $(ENC_SRC_DIR)/amrencode.cpp \ $(ENC_SRC_DIR)/autocorr.cpp \ $(ENC_SRC_DIR)/c1035pf.cpp \ @@ -138,12 +158,17 @@ libopencore_amrnb_la_SOURCES = \ $(ENC_SRC_DIR)/spreproc.cpp \ $(ENC_SRC_DIR)/spstproc.cpp \ $(ENC_SRC_DIR)/ton_stab.cpp \ - $(ENC_SRC_DIR)/vad1.cpp \ + $(ENC_SRC_DIR)/vad1.cpp + amrnbinclude_HEADERS += interf_enc.h +else + AM_CFLAGS += -DDISABLE_AMRNB_ENCODER +endif + +libopencore_amrnb_la_SOURCES += \ $(COMMON_SRC_DIR)/add.cpp \ $(COMMON_SRC_DIR)/az_lsp.cpp \ $(COMMON_SRC_DIR)/bitno_tab.cpp \ $(COMMON_SRC_DIR)/bitreorder_tab.cpp \ - $(COMMON_SRC_DIR)/bytesused.cpp \ $(COMMON_SRC_DIR)/c2_9pf_tab.cpp \ $(COMMON_SRC_DIR)/div_s.cpp \ $(COMMON_SRC_DIR)/extract_h.cpp \ @@ -197,4 +222,3 @@ libopencore_amrnb_la_SOURCES = \ $(COMMON_SRC_DIR)/weight_a.cpp \ $(COMMON_SRC_DIR)/window_tab.cpp -EXTRA_DIST = Makefile.alt diff --git a/amrnb/opencore-amrnb.sym b/amrnb/opencore-amrnb.sym new file mode 100644 index 0000000..25bc1c7 --- /dev/null +++ b/amrnb/opencore-amrnb.sym @@ -0,0 +1,6 @@ +Decoder_Interface_init +Decoder_Interface_exit +Decoder_Interface_Decode +Encoder_Interface_init +Encoder_Interface_exit +Encoder_Interface_Encode diff --git a/amrnb/wrapper.cpp b/amrnb/wrapper.cpp index 9af8a0e..633f251 100644 --- a/amrnb/wrapper.cpp +++ b/amrnb/wrapper.cpp @@ -24,6 +24,7 @@ #include "interf_enc.h" #include +#ifndef DISABLE_AMRNB_DECODER void* Decoder_Interface_init(void) { void* ptr = NULL; GSMInitDecode(&ptr, (int8*)"Decoder"); @@ -39,7 +40,9 @@ void Decoder_Interface_Decode(void* state, const unsigned char* in, short* out, in++; AMRDecode(state, (enum Frame_Type_3GPP) type, (UWord8*) in, out, MIME_IETF); } +#endif +#ifndef DISABLE_AMRNB_ENCODER struct encoder_state { void* encCtx; void* pidSyncCtx; @@ -64,4 +67,5 @@ int Encoder_Interface_Encode(void* s, enum Mode mode, const short* speech, unsig out[0] |= 0x04; return ret; } +#endif diff --git a/amrwb/Makefile.alt b/amrwb/Makefile.alt deleted file mode 100644 index a59cea9..0000000 --- a/amrwb/Makefile.alt +++ /dev/null @@ -1,98 +0,0 @@ -# Just set OC_BASE to the opencore root, or set AMR_BASE directly to -# a detached gsm_amr directory -OC_BASE = ../opencore -AMR_BASE = $(OC_BASE)/codecs_v2/audio/gsm_amr -LIBDIR=lib -BINDIR=bin - -# To compile as C instead of C++, define BUILD_AS_C -ifneq (, $(BUILD_AS_C)) - CXX = $(CC) - CXXFLAGS += -x c -std=c99 -endif - -ifeq (, $(PREFIX)) - PREFIX = /usr/local -endif - -DEC_DIR = $(AMR_BASE)/amr_wb/dec -DEC_SRC_DIR = $(DEC_DIR)/src -OSCL = ../oscl - -CPPFLAGS = -I$(OSCL) -I$(DEC_SRC_DIR) -I$(DEC_DIR)/include -I$(AMR_BASE)/common/dec/include - -# Find all the source files -# Exclude only decoder_amr_wb.cpp, not dtx_decoder_amr_wb.cpp -DEC_SRC := $(shell cd $(DEC_SRC_DIR) && echo *.cpp | sed 's/ decoder_amr_wb.cpp//') - -DEC_OBJS := $(DEC_SRC:.cpp=.o) -DEC_OBJS := $(patsubst %,$(DEC_SRC_DIR)/%, $(DEC_OBJS)) - -OBJS = wrapper.o $(DEC_OBJS) -SOBJS = $(OBJS:%.o=%.lo) - -#Versioning -MAJOR = 0 -MINOR = 1 -REVISION = 1 -VERSION = $(MAJOR).$(MINOR).$(REVISION) - -ifeq ($(shell uname), Darwin) - SHLIB_EXT = dylib - SHLIB_FLAGS = -dynamiclib -else - ifeq ($(shell uname | sed -e 's/\(MINGW32_NT\)\(.*\)/\1/'), MINGW32_NT) - SHLIB_EXT = $(MAJOR).$(MINOR).$(REVISION).dll - SHLIB_FLAGS = -shared - SONAME = libopencore-amrwb-$(MAJOR).dll - else - SHLIB_EXT = so.$(MAJOR).$(MINOR).$(REVISION) - SHLIB_FLAGS = -shared - SONAME = libopencore-amrwb.so.$(MAJOR) - endif -endif -SHLIB = libopencore-amrwb.$(SHLIB_EXT) - -all: libopencore-amrwb.a $(SHLIB) - -$(SHLIB): $(SOBJS) -ifeq ($(shell uname), Darwin) - $(CXX) $(SHLIB_FLAGS) -o $@ $+ $(LDFLAGS) -else - $(CXX) $(SHLIB_FLAGS) -o $@ $+ -Wl,-soname,$(SONAME) $(LDFLAGS) -endif - -%.lo: %.c - $(CC) $(CPPFLAGS) $(CFLAGS) -fPIC -DPIC -c $< -o $@ - -%.lo: %.cpp - $(CXX) $(CPPFLAGS) $(CXXFLAGS) -fPIC -DPIC -c $< -o $@ - -libopencore-amrwb.a: $(OBJS) - ar rcs $@ $+ - -install: libopencore-amrwb.a $(SHLIB) - install -d $(DESTDIR)$(PREFIX)/$(LIBDIR) - install -m 644 libopencore-amrwb.a $(DESTDIR)$(PREFIX)/$(LIBDIR) -ifeq ($(shell uname | sed -e 's/\(MINGW32_NT\)\(.*\)/\1/'), MINGW32_NT) - install -d $(DESTDIR)$(PREFIX)/$(BINDIR) - install $(SHLIB) $(DESTDIR)$(PREFIX)/$(BINDIR) -else - install $(SHLIB) $(DESTDIR)$(PREFIX)/$(LIBDIR) -endif -ifneq ($(shell uname), Darwin) -ifeq ($(shell uname | sed -e 's/\(MINGW32_NT\)\(.*\)/\1/'), MINGW32_NT) - ln -sf $(SHLIB) $(DESTDIR)$(PREFIX)/$(BINDIR)/$(SONAME) - ln -sf $(DESTDIR)$(PREFIX)/$(BINDIR)/$(SONAME) $(DESTDIR)$(PREFIX)/$(BINDIR)/libopencore-amrwb.dll -else - ln -sf $(SHLIB) $(DESTDIR)$(PREFIX)/$(LIBDIR)/$(SONAME) - ln -sf $(SONAME) $(DESTDIR)$(PREFIX)/$(LIBDIR)/libopencore-amrwb.so -endif -endif - install -d $(DESTDIR)$(PREFIX)/include/opencore-amrwb - install -m 644 dec_if.h $(DESTDIR)$(PREFIX)/include/opencore-amrwb - install -m 644 if_rom.h $(DESTDIR)$(PREFIX)/include/opencore-amrwb - -clean: - rm -f $(SHLIB) libopencore-amrwb.a *.o *.lo $(OBJS) $(SOBJS) - diff --git a/amrwb/Makefile.am b/amrwb/Makefile.am index 37a917f..a6cc33c 100644 --- a/amrwb/Makefile.am +++ b/amrwb/Makefile.am @@ -10,8 +10,17 @@ OSCL = $(top_srcdir)/oscl AM_CFLAGS = -I$(OSCL) -I$(DEC_SRC_DIR) -I$(DEC_DIR)/include \ -I$(AMR_BASE)/common/dec/include +if GCC_ARMV5 + AM_CFLAGS += -DPV_CPU_ARCH_VERSION=5 -DPV_COMPILER=1 +endif + if COMPILE_AS_C AM_CFLAGS += -x c -std=c99 + libopencore_amrwb_la_LINK = $(LINK) $(libopencore_amrwb_la_LDFLAGS) + # Mention a dummy pure C file to trigger generation of the $(LINK) variable + nodist_EXTRA_libopencore_amrwb_la_SOURCES = dummy.c +else + libopencore_amrwb_la_LINK = $(CXXLINK) $(libopencore_amrwb_la_LDFLAGS) endif AM_CXXFLAGS = $(AM_CFLAGS) @@ -24,7 +33,8 @@ pkgconfig_DATA = opencore-amrwb.pc lib_LTLIBRARIES = libopencore-amrwb.la -libopencore_amrwb_la_LDFLAGS = -version-info @OPENCORE_AMRWB_VERSION@ +libopencore_amrwb_la_LDFLAGS = -version-info @OPENCORE_AMRWB_VERSION@ -no-undefined -export-symbols $(top_srcdir)/amrwb/opencore-amrwb.sym +EXTRA_DIST = $(top_srcdir)/amrwb/opencore-amrwb.sym # Our sources to include. There are certain sources we exclude and they are # $(DEC_SRC_DIR)/decoder_amr_wb.cpp @@ -70,4 +80,3 @@ libopencore_amrwb_la_SOURCES = \ $(DEC_SRC_DIR)/wb_syn_filt.cpp \ $(DEC_SRC_DIR)/weight_amrwb_lpc.cpp -EXTRA_DIST = Makefile.alt diff --git a/amrwb/opencore-amrwb.sym b/amrwb/opencore-amrwb.sym new file mode 100644 index 0000000..9a1cfcb --- /dev/null +++ b/amrwb/opencore-amrwb.sym @@ -0,0 +1,3 @@ +D_IF_init +D_IF_decode +D_IF_exit diff --git a/build_osx.sh b/build_osx.sh deleted file mode 100755 index 7f79561..0000000 --- a/build_osx.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh - -export CFLAGS="-isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4 -arch ppc -arch i386" -export CXXFLAGS="$CFLAGS" -export LDFLAGS="-Wl,-syslibroot,/Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4 -arch ppc -arch i386" -export BUILD_AS_C=1 - -make -f Makefile.alt -C amrnb "$@" || exit 1 -make -f Makefile.alt -C amrwb "$@" || exit 1 - diff --git a/configure.ac b/configure.ac index 3fe916c..8b0f504 100644 --- a/configure.ac +++ b/configure.ac @@ -1,10 +1,11 @@ # -*- Autoconf -*- # Process this file with autoconf to produce a configure script. -AC_INIT([opencore-amr], [0.1.2], [https://sourceforge.net/apps/trac/opencore-amr/]) +AC_INIT([opencore-amr], [0.1.3], [http://sourceforge.net/projects/opencore-amr/]) AC_CONFIG_AUX_DIR(.) AC_CONFIG_MACRO_DIR([m4]) AM_INIT_AUTOMAKE([tar-ustar]) +m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) AC_CONFIG_HEADERS([config.h]) AM_MAINTAINER_MODE @@ -18,9 +19,29 @@ AC_ARG_ENABLE([compile-c], [enable compiling as C program (default is yes)])], [compile_as_c=$enableval], [compile_as_c=yes]) +AC_ARG_ENABLE([gcc-armv5], + [AS_HELP_STRING([--enable-gcc-armv5], + [enable GCC specific ARMv5 assembler (default is no)])], + [gcc_armv5=$enableval], [gcc_armv5=no]) +AC_ARG_ENABLE([amrnb-encoder], + [AS_HELP_STRING([--enable-amrnb-encoder], + [enable AMR-NB encoder (default is yes)])], + [amrnb_encoder=$enableval], [amrnb_encoder=yes]) +AC_ARG_ENABLE([amrnb-decoder], + [AS_HELP_STRING([--enable-amrnb-decoder], + [enable AMR-NB decoder (default is yes)])], + [amrnb_decoder=$enableval], [amrnb_decoder=yes]) +AC_ARG_ENABLE([examples], + [AS_HELP_STRING([--enable-examples], + [enable example encoding/decoding programs (default is no)])], + [examples=$enableval], [examples=no]) # Automake conditionals to set AM_CONDITIONAL(COMPILE_AS_C, test x$compile_as_c = xyes) +AM_CONDITIONAL(GCC_ARMV5, test x$gcc_armv5 = xyes) +AM_CONDITIONAL(AMRNB_ENCODER, test x$amrnb_encoder = xyes) +AM_CONDITIONAL(AMRNB_DECODER, test x$amrnb_decoder = xyes) +AM_CONDITIONAL(EXAMPLES, test x$examples = xyes) # Checks for programs. AC_PROG_CXX @@ -58,8 +79,8 @@ AC_CHECK_FUNCS([memset]) # OpenCORE AMR soname version to use # goes by ‘current[:revision[:age]]’ with the soname ending up as # current.age.revision. -OPENCORE_AMRNB_VERSION=0:2:0 -OPENCORE_AMRWB_VERSION=0:2:0 +OPENCORE_AMRNB_VERSION=0:3:0 +OPENCORE_AMRWB_VERSION=0:3:0 AC_SUBST(OPENCORE_AMRNB_VERSION) AC_SUBST(OPENCORE_AMRWB_VERSION) diff --git a/depcomp b/depcomp index df8eea7..bd0ac08 100755 --- a/depcomp +++ b/depcomp @@ -1,10 +1,10 @@ #! /bin/sh # depcomp - compile a program generating dependencies as side-effects -scriptversion=2009-04-28.21; # UTC +scriptversion=2011-12-04.11; # UTC -# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009 Free -# Software Foundation, Inc. +# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009, 2010, +# 2011 Free Software Foundation, Inc. # 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 @@ -44,7 +44,7 @@ Environment variables: object Object file output by `PROGRAMS ARGS'. DEPDIR directory where to store dependencies. depfile Dependency file to output. - tmpdepfile Temporary file to use when outputing dependencies. + tmpdepfile Temporary file to use when outputting dependencies. libtool Whether libtool is used (yes/no). Report bugs to . @@ -90,10 +90,18 @@ if test "$depmode" = msvcmsys; then # This is just like msvisualcpp but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 - cygpath_u="sed s,\\\\\\\\,/,g" + cygpath_u='sed s,\\\\,/,g' depmode=msvisualcpp fi +if test "$depmode" = msvc7msys; then + # This is just like msvc7 but w/o cygpath translation. + # Just convert the backslash-escaped backslashes to single forward + # slashes to satisfy depend.m4 + cygpath_u='sed s,\\\\,/,g' + depmode=msvc7 +fi + case "$depmode" in gcc3) ## gcc 3 implements dependency tracking that does exactly what @@ -158,10 +166,12 @@ gcc) ' < "$tmpdepfile" | ## Some versions of gcc put a space before the `:'. On the theory ## that the space means something, we add a space to the output as -## well. +## well. hp depmode also adds that space, but also prefixes the VPATH +## to the object. Take care to not repeat it in the output. ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. - sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \ + | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; @@ -405,6 +415,52 @@ tru64) rm -f "$tmpdepfile" ;; +msvc7) + if test "$libtool" = yes; then + showIncludes=-Wc,-showIncludes + else + showIncludes=-showIncludes + fi + "$@" $showIncludes > "$tmpdepfile" + stat=$? + grep -v '^Note: including file: ' "$tmpdepfile" + if test "$stat" = 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + echo "$object : \\" > "$depfile" + # The first sed program below extracts the file names and escapes + # backslashes for cygpath. The second sed program outputs the file + # name when reading, but also accumulates all include files in the + # hold buffer in order to output them again at the end. This only + # works with sed implementations that can handle large buffers. + sed < "$tmpdepfile" -n ' +/^Note: including file: *\(.*\)/ { + s//\1/ + s/\\/\\\\/g + p +}' | $cygpath_u | sort -u | sed -n ' +s/ /\\ /g +s/\(.*\)/ \1 \\/p +s/.\(.*\) \\/\1:/ +H +$ { + s/.*/ / + G + p +}' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +msvc7msys) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + #nosideeffect) # This comment above is used by automake to tell side-effect # dependency tracking mechanisms from slower ones. @@ -503,7 +559,9 @@ makedepend) touch "$tmpdepfile" ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" rm -f "$depfile" - cat < "$tmpdepfile" > "$depfile" + # makedepend may prepend the VPATH from the source file name to the object. + # No need to regex-escape $object, excess matching of '.' is harmless. + sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile" sed '1,2d' "$tmpdepfile" | tr ' ' ' ' | \ ## Some versions of the HPUX 10.20 sed can't process this invocation diff --git a/install-sh b/install-sh index 6781b98..a9244eb 100755 --- a/install-sh +++ b/install-sh @@ -1,7 +1,7 @@ #!/bin/sh # install - install a program, script, or datafile -scriptversion=2009-04-28.21; # UTC +scriptversion=2011-01-19.21; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the @@ -156,6 +156,10 @@ while test $# -ne 0; do -s) stripcmd=$stripprog;; -t) dst_arg=$2 + # Protect names problematic for `test' and other utilities. + case $dst_arg in + -* | [=\(\)!]) dst_arg=./$dst_arg;; + esac shift;; -T) no_target_directory=true;; @@ -186,6 +190,10 @@ if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then fi shift # arg dst_arg=$arg + # Protect names problematic for `test' and other utilities. + case $dst_arg in + -* | [=\(\)!]) dst_arg=./$dst_arg;; + esac done fi @@ -200,7 +208,11 @@ if test $# -eq 0; then fi if test -z "$dir_arg"; then - trap '(exit $?); exit' 1 2 13 15 + do_exit='(exit $ret); exit $ret' + trap "ret=129; $do_exit" 1 + trap "ret=130; $do_exit" 2 + trap "ret=141; $do_exit" 13 + trap "ret=143; $do_exit" 15 # Set umask so as not to create temps with too-generous modes. # However, 'strip' requires both read and write access to temps. @@ -228,9 +240,9 @@ fi for src do - # Protect names starting with `-'. + # Protect names problematic for `test' and other utilities. case $src in - -*) src=./$src;; + -* | [=\(\)!]) src=./$src;; esac if test -n "$dir_arg"; then @@ -252,12 +264,7 @@ do echo "$0: no destination specified." >&2 exit 1 fi - dst=$dst_arg - # Protect names starting with `-'. - case $dst in - -*) dst=./$dst;; - esac # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. @@ -385,7 +392,7 @@ do case $dstdir in /*) prefix='/';; - -*) prefix='./';; + [-=\(\)!]*) prefix='./';; *) prefix='';; esac @@ -403,7 +410,7 @@ do for d do - test -z "$d" && continue + test X"$d" = X && continue prefix=$prefix$d if test -d "$prefix"; then diff --git a/m4/lt~obsolete.m4 b/m4/lt~obsolete.m4 index 637bb20..c573da9 100644 --- a/m4/lt~obsolete.m4 +++ b/m4/lt~obsolete.m4 @@ -1,13 +1,13 @@ # lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- # -# Copyright (C) 2004, 2005, 2007 Free Software Foundation, Inc. +# Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc. # Written by Scott James Remnant, 2004. # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. -# serial 4 lt~obsolete.m4 +# serial 5 lt~obsolete.m4 # These exist entirely to fool aclocal when bootstrapping libtool. # @@ -77,7 +77,6 @@ m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])]) m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])]) m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])]) m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])]) -m4_ifndef([AC_LIBTOOL_RC], [AC_DEFUN([AC_LIBTOOL_RC])]) m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])]) m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])]) @@ -90,3 +89,10 @@ m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])]) m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])]) m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])]) m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])]) +m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])]) +m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])]) +m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])]) +m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])]) +m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])]) +m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])]) +m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])]) diff --git a/missing b/missing index 28055d2..86a8fc3 100755 --- a/missing +++ b/missing @@ -1,10 +1,10 @@ #! /bin/sh # Common stub for a few missing GNU programs while installing. -scriptversion=2009-04-28.21; # UTC +scriptversion=2012-01-06.13; # UTC # Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006, -# 2008, 2009 Free Software Foundation, Inc. +# 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc. # Originally by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify @@ -84,7 +84,6 @@ Supported PROGRAM values: help2man touch the output file lex create \`lex.yy.c', if possible, from existing .c makeinfo touch the output file - tar try tar, gnutar, gtar, then tar without non-portable flags yacc create \`y.tab.[ch]', if possible, from existing .[ch] Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and @@ -122,15 +121,6 @@ case $1 in # Not GNU programs, they don't have --version. ;; - tar*) - if test -n "$run"; then - echo 1>&2 "ERROR: \`tar' requires --run" - exit 1 - elif test "x$2" = "x--version" || test "x$2" = "x--help"; then - exit 1 - fi - ;; - *) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. @@ -226,7 +216,7 @@ WARNING: \`$1' $msg. You should only need it if \`Bison' from any GNU archive site." rm -f y.tab.c y.tab.h if test $# -ne 1; then - eval LASTARG="\${$#}" + eval LASTARG=\${$#} case $LASTARG in *.y) SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` @@ -256,7 +246,7 @@ WARNING: \`$1' is $msg. You should only need it if \`Flex' from any GNU archive site." rm -f lex.yy.c if test $# -ne 1; then - eval LASTARG="\${$#}" + eval LASTARG=\${$#} case $LASTARG in *.l) SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` @@ -318,41 +308,6 @@ WARNING: \`$1' is $msg. You should only need it if touch $file ;; - tar*) - shift - - # We have already tried tar in the generic part. - # Look for gnutar/gtar before invocation to avoid ugly error - # messages. - if (gnutar --version > /dev/null 2>&1); then - gnutar "$@" && exit 0 - fi - if (gtar --version > /dev/null 2>&1); then - gtar "$@" && exit 0 - fi - firstarg="$1" - if shift; then - case $firstarg in - *o*) - firstarg=`echo "$firstarg" | sed s/o//` - tar "$firstarg" "$@" && exit 0 - ;; - esac - case $firstarg in - *h*) - firstarg=`echo "$firstarg" | sed s/h//` - tar "$firstarg" "$@" && exit 0 - ;; - esac - fi - - echo 1>&2 "\ -WARNING: I can't seem to be able to run \`tar' with the given arguments. - You may want to install GNU tar or Free paxutils, or check the - command line arguments." - exit 1 - ;; - *) echo 1>&2 "\ WARNING: \`$1' is needed, and is $msg. diff --git a/opencore-amr.manifest b/opencore-amr.manifest new file mode 100755 index 0000000..a76fdba --- /dev/null +++ b/opencore-amr.manifest @@ -0,0 +1,5 @@ + + + + + diff --git a/opencore/ChangeLog b/opencore/ChangeLog index d7f4819..4558f96 100644 --- a/opencore/ChangeLog +++ b/opencore/ChangeLog @@ -1,17 +1,771 @@ =============================================================================== +2010-06-25 OpenCORE 2.50 + +New Features +- Mediascanner-albumart support +- Add new player engine test case for HTTP streaming transfer mode +- Adding BGR support for CC16 in codecs +- Provide a runtime setting to prioritize SW codecs over HW codecs in the case +of thumbnail retrieval. +- Addition of DLNA specific 'byte-seek' support for Pause/Resume and Seek cases. +- Player engine test configuration modifications +- Add profiling capability to OMX AVC/MPEG4/AAC encoder components. +- Add support for the PSSH Atom to the mp4 composer, as specified in the +Protected Interoperable File Format (PIFF) Specification +- Timestamp smoothing for incoming audio timestamps +- Add support for the boxes 'enca', 'encv', 'enct', 'sinf' and 'frma' to the +mp4 composer +- Add SetParameter as an extension command to Android MediaPlayer +- Adding support of forward playback with rendering only I-frames +- Modify the mp4 composer to verify the existence of entries in the mfra box +before rendering it. +- Updates to DRM interfaces and test cases +- Initialize iSkipToIDR to false for OMX AVC decoder. +- Gapless and playlist support for MP4, MP3, and WMA +- Framework support for MPEG-2 FF Parser +- Changes at the PE Node and mp4 parser node to support PDL random position of +fragmented clips with out-of-band mfra information +- Allowing scrubbing inside playerengine +- MP4 Parser/composer mods to improve metadata support +- Graceful degradation phase 1 (Key-frame-only mode in case of many late frames) +- Makefile feature to build static aggregate +- Add support for building against Android eclair +- Add integration support for 3rd party audio library +- AAC lib - Add new message that signals back change of Mode (new PCE) +- Allow reconfig of MIOs for playlist scenarios +- Android makefile segment separation / refactoring +- Addition of new event PVMFInfoSourceFormatUpdated +- Support for AAC multichannel contents to be partially decoded (output +only 2 channels). +- Implement PVMFOMXEncNode::GetProfileAndLevel() to query for the final +profile/level after intialize. +- Add support for changing bit rate/frame rate/intra refresh rate to OMXEncNode. +- Allow local.mk file for applications to define steps for running target +- Support for m4b file format +- New ARM macros in build make system. +- Add a target in module level unit test to display the list of available +targets +- Support M4V bitstream with short header mode. +- Support the PIFF Enhancements in the mp4 parser library +- Metadata updates for mp3 parser +- Added an utility function to set RTSP proxy server information +(https://review.source.android.com/#change,14369) +- Build changes to support a restricted Main Profile AVC decoder optimized for +ARMv6 +- Adding scaling support for YUV422toYUV420. +- When initialization error occurs to one of the selected tracks, allow the +playback of remaining tracks without a complete shut down. +- Add progressive playback support in MP4 movie fragment playback +- Add stdout from engine unit test output to junit xml logs +- Large File Support in MP4 PDL and PPB +- Added the test cases in PVME and FMU for protected test content +- New Common Parser Node for AMR and WAV + +Improvements +- H264 raw support for PVMI MIO file input / output +- Retrieve "duration" metadata in mediascanner through metadataretriever +- Fix for compiler warnings in mediaoutputnode and player engine test app. +- Base node should add itself to Scheduler only in a valid Created state. +- Codesize reduction for FMU +- Implemented additional APIs in CPM plugin. +- AAC lib - Enable redundant PCE syntax element on a raw bitstream +- Add metadata support for aac, amr, awb and wav files. +- Change logger levels to appropriate values in android video mio and jb node +for certain log statements +- H264 raw support for PVMI MIO file input / output +- Add Extended Atom types to the mp4 composer +- Add test for receiving data in 2way engine unit tests. +- Remove unused KVPs from engine and codecs +- Changes made to API of a CPM plugin. +- OMXConfigParser is modified to differentiate VC1 component from WMV component +so that WMV7 and WMV8 get rejected by VC1 component. +- OMX Encoder node needs to save SPS/PPS for its possible query in the case of +H264_RAW format +- If the encoder node marks the frame as keyframe, there is no need to sniff +the bitstream +- Update source duration for video playlists +- Build OMX wrappers in thumb mode in Android +- Add a new 2way engine unit test. +- Port File Output node to new base node interface design. +- Removal of 2way VideoParser Node +- Copyright date in OpenCORE source code should reflect the last time the file +was modified +- Deprecate support for platforms without native 64-bit functionality. +- Modify media layer node to use the base node framework +- Add full metadata support for OMX MPEG4/H263 decoders - +profile/level/post-processing +- Replace numeric values in code with enum +- Add command line configurable timeout for pvplayer_engine_test +- Some CML2 rules related to so_name can create errors with "n" symbol used as +module name +- Watchdog timer to monitor start of data reception +- Update the priority of some log messages +- Use parseID3Tag for aac files +- Node commands should succeed if the node is already in the resultant state in +the base node. +- Miscellaneous DRM-related modifications +- Modify jitter buffer node to use the base node framework +- Refactor Media Output node +- Remove linker warnings w.r.t. libopencore_player and libopencore_net_support +- PVMFMediaClock takes care of device latency. Remove the device latency +processing in AMIO. +- Port PVMP4FFComposerNode with the new Node Interface +- Port Protocol Engine node to new node design +- Refactor Media Output node to use new node interface +- Changes to a DRM utility +- Deprecate (and defunct) support for non-OMX nodes and builds +- Introduce authoring clock for recording AV sync +- Allow a single MIO to act as both compressed and uncompressed for the author +engine +- Separating registration of ClockStateObserver and the latency in +PVMFMediaClock +- Add API in PVMp4H263EncExtensionInterface to set H.263 GOB header interval +- New constructor and parse method overloads for node interface implementation +- OMX call error handling +- Handle end of track event in player engine testcase for I-frame mode playback +- Add RTSP return error code to the PVMF status return code +- Remove PVMFDummyFileOutputNode +- Clear the playback intent in PVME to avoid incorrect consumption of rights +- Based on most recent Khronos clarifications - partially consumed buffers are +not allowed in OMX +- Modify socket node to use the base node framework +- Adding support for RTSPT tests for new server +- Addition of Large File Support in MP4 Parser Library +- Dynamically calculate omx encoder output buffer sizes instead of hard-coding +the size +- Cleanup of 2way engine code. +- Add warning logger message in the NegotiateComponentParameters functions for +2-way +- Update OMX test app to test creation/destruction of the same component +multiple times in a row (especially useful for dynamic loading) +- Remove dependency of fileoutputnode on pvPlayer SDK +- cleanup of old Keys from MIOs +- Remove API QueryUUID from all interfaces +- Remove usage of USE_CML2_CONFIG since all the builds have been converted to +CML2 +- Change MPEG4 encoder OMX component to generate VOL header before getting +any input frames. +- Fix gcc 4.4.1 compiler warnings +- Remove unnecessary makefile templates from OpenCORE +- Support for raw compressed headers in track meta data +- Add a 2way engine unit test for when buffers are provided by MIO. +- Remove dependency on oscl string from oscl_uuid. +- Cleanup of 2way engine code. +- NDEBUG and OSCL_RELEASE_BUILD macro consolidation +- Use GetEventExtensionInterface to pass indication details from pv2way +- Bypass pasp atom box in mp4 parser +(https://review.source.android.com/#change,12330) +- CPM cleanup +- Add mp3 track support in mp4 parser +(https://review.source.android.com/#change,12329) +- Separate variable XCFLAGS to hold C-compiler flags +- Use openssl crypto library within pvcrypto +- Process the config data in the omx decoder components even if there are no +output buffers available +- Add support for multichannel aac clips with no channel distribution +information +- Add test duration to junit-like XML log output from test framework +- Makefile update for new module +- Change component library name in makefile +- Move amr and avc common libraries from opencore_common into omx_sharedlibrary +- Move libpvmioaviwavfileinput.a libavifileparser.a out of libopencore_common.so +- Deprecate GetMetadataKeys, GetNodeMetadataKeys, GetNumMetadataKeys, and +ReleaseNodeMetadataKeys APIs. +- Improvement in an internal build and the export of some additional methods +- Move amr_common and avc_common lib to libomx_sharedlibrary.so +- Print out time taken to complete each OMX test case. +- Check for INTRA frames in the MPPTYPE box when the H263 frames are using the +extended PTYPE header +- Introduce new KVP string +- Improve the check for GLOBAL_CPU_ARCH_VERSION in codecs lib makefile to make +it scalable to higher version of ARM architecture. +- Move ResetData() function in android surface output inside Reset() +- Improve buffer negotiation with 3rd party omx components, as it will let +them have the final say in the number of buffers. +- Set release level logging to 1 for all platforms +- Sending position status update before SetPlaybackRange command completion. +- Improving the current logic in player engine for video scrubbing +- Improve color conversion unit test +- Remove unnecessary check in PEUT PS and SS testcases for the number of +buffering complete events. +- Improved error reporting in DRM plugin. +- Added player test cases for DRM +- Changes to deal with use-cases when sdcard/phone memory gets full while +recording +- Reset PaddingFrameInfo in MP3 parser after retrieving frame data +- Cleaned up DRM plugin interface +- PEUT for shoutcast shall check playback session to verify if it is valid +shoutcast session. +- Modify AVCConfigParser to handle multiple SPSs/PPSs, AUD and SEI NALs. +- Add profile and channel metadata support in AAC and AMR parsers +- Modified CPM plugin data structure +- Modify AVCConfigParser to handle multiple SPSs/PPSs, AUD and SEI NALs. +- Fix for repositioning large offsets during MP4 PS +- Add more metadata support in MP3 Parser and ID3 Parcom + +Bugs Fixed +- Unit test fixes for CPM plugin +- Improved handling of some MP4 Poison clips +- Modify MP4 parser to not send EOS if duration available from content is 0 +- Fix for deadlock between player engine and OMX component threads caused by a +mismatched queue depth and number of new output AVC buffers during port +reconfiguration +- Player hangs on normal playback under certain test conditions +- Adjust the AVC decoder to handle non-compliant bitstreams which have a +non-zero frame_num for IDRs +- Failure in InitNextValidClipInPlaylist( ) should report a command failure. +- Change to support additional argument in constructor of base node interface +implementation +- Initialization of display width and display height in the mp4 parser node +- Reset PaddingFrameInfo in MP3 parser after retrieving frame data +- Handle PVMFErrProcessing condition in case wrong URL is specified in PS or +shoutcast +- New CommonParserPort needs to derive from +PvmiCapabilityAndConfigPortFormatImpl +- Fix for proper handling of MP4 clips with invalid edit list atoms +- Audio timestamp was not initialized properly for LATM case. +- Fix for test PEUT 425 by making sure that the state transition in the test +code from STATE_UPDATEDATASOURCE to STATE_GETMETADATAVALUESLIST is serialized. +- Separate clock for rendering MIOs for 2way lipsync +- This work fixes infinite loop when OMX InitDecoder fails +- MP4 recognizer has been modified to further check the brand information +inside "ftyp" atom and not declare OMA2 DCF files as mp4. +- If the AVC decoder reports an error in the last frame of a sequence, the +OpenMAX component does not flush the decoder's output +- MP3 http playback reports error for low bitrate connection. +- Fix for running a test number multiple times in makefile target for running +parallel player engine tests +- Fixed OMX base dec node to handle 0 sample size and updated FMU to retrieve +metadata for new file extension +- MediaOutputNode module unit test failure +- Add dependency of librt to Android x86 builds +- Data type inconsistency in code of OMX test app +- Wrong thumbnails retrieved for Mp4 contents +- Incorrect time stamps with B frames in H264 high profile +- Conditionally support -Wno-psabi compiler flag for Android simulator +- For AVC clips with more number of SPS/PPS than the number of buffers +allocated, the node returns error and the clip cannot be played. +- Specific test mp3 content cannot be played on streaming with HTTP Progressive +protocol +- Inconsistent Keep-Alive timer during RTSP streaming +- Adding the missing Metadata functionality in the omx audio dec node. +- Memory leak in 2way proxy adapter +- Use clock_gettime(MONOTONIC) instead of gettimeofday() on linux platform to +have a consistent clock +- Fix for playback progress not being reported correctly for sessions in which +the duration is not known upfront. +- MP3 duration is not calculated when there is a CPM plugin +- Seek on Mp3 PS for contents without having any XING or VBRI headers results +in No-op +- Add support of "YUV 420 Semi Planer" in Encoder Node. +- Completely eliminate logging from omx proxy and omx component unless +explicitly enabled +- Fix for hang in player engine test case 862 +- Issue with seek sample number when repositioning near the beginning of a +recorded file. +- Disable setting OMX_Video_ControlRateMax to OmxComponent +- Unreleased array causing memory leaks in mp4 parser node +- MP3 parser does not recover from invalid frame embedded on mp3 stream +- Disabling outgoing skew indication messages +- AVC Sample entry not parsed correctly for picture parameter set +- Fix Assert failure in player engine TC 941 +- Fix memory leak in Android extension media player APIs +- Add OMX AVC support to 2way +- Set pre-defined VOL header for PV2Way +- Logic to detect end of track for Mp4 FF having moof atoms need to modified +- Fix get_ISO8601_str_time api on certain platforms +- parseMP4() in mediascanner.cpp couldn't detect unknown type correctly. +- RTSP streaming start time always start from zero +- Failure in PlayerEngine Unit testcase +- EOS Timestamp is invalid from mp3 source node +- Support for multiple frames in a single data block of AAC ADTS parser +- Check for NULL ptr access in CPV324m2Way::HandleNodeErrorEvent +- Fix seek failure when seek to almost end of one mp4 content +- Protocol engine node download auto resume algorithm simplification +- Conditionally convert compiler warnings to errors in android folder +- Fix for possible race condition in FMU's thumbnail retrieval +- PS/MP3 unable to set start playback time when duration is unknown +- Fix for out-of-bound array access in m4v config parser function. +- Fix for thumbnail retrieval when using file handle in Android +- Remove unnecessary code from android logger config +- Bug for Size limitation in case of streaming +- Change ParseM4VFSI to be more lenient to profile/level error and add SPL4a +and SPL5 support to m4vencoder. +- Set/GetDataSinkFormatType +- Thumbnail loading take much more time in all video content +- memory access violation occurs -3g2 content containing moof atom +- OMX Decoder Node Scheduling may be affected due to node refactoring change +- Close the MetadataDriver semaphore to prevent an assert. +- Fix an RTSP tunneling url problem +- Choppy audio after pausing and resuming 2way call +- EOS message being overwritten by BOS in the mediaoutputnode +- Do not access iTimestampVec.back() if the vector is empty. +- 2way's h223LCtest and h223test are failing. +- Use config parser information to configure OMX AAC component. Still expect to +get Port settings changed event in case of implicit AAC+ +- Calling UpdateDataSource before calling AddDataSource() could result in a +crash +- Allow SDKINFO Header to use environment variables if set +- Fix 2way unit test assertion failure. +- Fix socket communication scenario for 2way +- Out of bounds access during CPM Register Content for MP4 and MP3 clips +- Fix MP3 gapless playback EOC message iFramesToFollowEOC calculation +- Removed OsclThread::EnableKill, added OsclThread::CanTerminate +- Delaying the release of a source node until after the engine command completes +- PVMFInfoStartOfData and PVMFInfoEndOfData events need to be serialized at the +mediaoutputnode during clip transition +- Ensure that PVOMXRegistry calls OsclSharedLibrary LoadLib and Close only once. +- Fix player engine test cases 48 and 49 +- Datasource being removed prematurely +- Change some of the time related variables in M4venc and AmrEnc OMX component +from uint32 to OMX_TICKS or int64. +- Fix for incorrect display dimensions under certain conditions. +- Add a new testcase for Pause - Skip - Resume +- Use Wno-psabi flag when building against eclair SDK +- In OMX decoder node - In case of an invalid input NAL or empty input +message, input OMX buffer needs to be released +- Music app crashes and gallery application is not present on android-2.1_r1 +emulator +- Bug in ColorConvert lib (RGB16 to yuv420 conversion) +- Memory access violation occurs +- Player engine changes to add a log line and remove regular decoder node +reference +- Incoming user input messages are not passed to application +- Check semaphore before closing +- Timed Text file playback issue +- Fix pv_config_selected.mk in opencore_value_add for 2way changes. +- Add stub definitions to fix korg master branch build for newly declared +functions +- MP4 Fileformat Edit List storing offset in wrong timescale. +- AAC lib - colored noise produced when decoding file with clipped levels +- ReleaseMetadataValues resulting in a hang when called without GetMetadataKeys +- Update the thread safe queue to handle events from multiple threads +- Fix MP4 source node metadata retrieval for playlist +- Fix PEUT TC 400-455 playlist input file path +- Make audio MIOs for gapless tests active so that samples are not dropped for +being late +- Fix problem with using external buffers for OMX encoder for 2way. +- Check if CPM object exists before creating one in MP4 parser node +- PVME unable to retrieve metadata for DRM protected content +- Cleanup 2way local.mk +- OMX audio dec node should process multiple BOS (BOC/EOC) messages correctly +in case of LATM format +- Multiplexed data gets corrupted when is there is no data in logical channel +- Prevent redundant oscl file cache writeupdate calls when closing file +- OSCL SetSize() implementation +- Changed logfile appenders to take boolean flag indicating whether or not +(default) to flush after every write. Add 'fsync' to linux oscl file +implementation +- Fix broken build due to pvmedia_io_fileoutput +- Move implementation of some 2-way methods from header file into C file +- Player engine not using the source node capconfig interface for all engine +capconfig calls +- Fix for TC 21 on MP3 clips +- TC 414 (FullPlaylistPauseSkipToNextTrackResumeTest) failing with full logging +turned ON +- Handling for packets received after RTSP PLAY response with timestamps less +than the advertised rtpbase +- Modify the AMR Enc OMX component to take timestamp from the OMX client and +remove logic to detect gaps or overlaps. +- Sometimes cancelall command is not executed on all the data sinks in +cancellation process by the engine. +- AAC lib - Fix for random crash under certain test condition +- Additional changes in the AAC lib to support redundant PCE +- Memory leaks when using PVMP4FF_USE_EXTN_UDTA mode in MP4 Composer library +- If the ERecognizerStart command is canceled, do not queue a ERecognizerClose. +- Fix issue where an RTSP server returns a start NPT that is non-zero despite +the application's request for a zero NPT +- MP4 parser node fixes for retrieving key-value pairs without a track index in +the input string +- Re-issue commands in 2way engine to be run later. +- correct rtpinfo was not used while deciding ts +- OMX Decoder Node Scheduling may be affected due to node refactoring change +- Duration was not converted to millisec timescale properly +- Remove unneeded dependency on header files in mediaoutputnode +- Linux oscl time converts time differrently depending on whether or not zulu +is set +- Add check to prevent engine clock from starting if engine is not in started +state +- Protect oscl file native seek and read operations on the same file handle +- A flag needs to be initialized correctly for decoder node codec config data +not to be affected by inserting a pause command +- Fix for eAAC clips seek resulting in wrong speed +- AAC lib - Audio artifacts when decoding clip with continue saturated levels +- Missing metadata key "writer" in metadatadriver.cpp +- TARGET_ARCH_VERSION missing from Config.mk +- AAC-lib Compiler bug on Android build creates the wrong assembly code +- Disconnect-Seek mode support for pause/resume +- Fix for MP3 parser returning incorrect value for bitrate key +- When outgoing user input message is deleted, VT crashes +- Fixing media scanner inappropriate removal of media files +(https://review.source.android.com/#change,14161) +- Change to return engine state as prepared (not started) if the engine +has moved into auto_pause after prepare state, without being started. +- Updating out-of-order packets handling logic +- Added support to handle multiple 'elst' entries in MP4 FF. That improved AV +sync while playing the content which has multiple edit list. +- Remove empty OSCL source files and add comment to empty 2way makefile +- This record fixed a streaming module unit test problem +- PVME test crashes while running .mp4 files +- Oscl file cache read error for large block sizes +- Update the mp3ffparser node to handle the cancel command in init. +- Null-terminate the string sent as part of PVMFInfoSourceFormatUpdated event +- PV_CFLAGS set to wrong value in Config.mk +- OMX unit test modifications +- AAC recognizer - fails by qualifying valid extension-less MP3 clip as AAC +- Fix parsing of certain HTTP URLs. +- Initialize _currentPlaybackSampleTimestamp to zero in +SampleTableAtom::resetTrackByTime() +- Use threadsafe callback AO in camera input MIO to reschedule the AO +- Modified PVME to handle the failures from SetSourceInitializationData in +SourceNode +- Check EOS buffer flag if in the middle of partial frame assembly in omx +component +- Fix for AAC silence insertion for the mono case and the AAC+ case +- Disable filewriter thread in composer node +- test_adts_x.pcm +- Peeking samples from an mp4 fragmented files may return wrong information +- Fixed timestamp conversion for B-frames. +- Fix live RTSP streaming issue +- MP4 Source node doesnt resets FirstValidClip's index after Stop/Reset +- OMX AVCDec output buffer calculation for cropped output could be smaller than +required. Hence, the buffer calculation part must be modified. +- Fix an assert involving iStride and iSliceHeight in omx video decoder node +- A 64-bit overflow when computing energy levels was incorrectly saturated with +a 32-bit max., instead of a 64-bit max in the AAC decoder +- Fix live RTSP streaming issue +- Passing the call ReleaseNodeMetadataValues from the source node to the CPM +plugin. +- Add robustness to AAC SBR with silence insertion. +- Fix BOS and EOS timestamps for MP3 +- Fix player engine playlist unit test 414 +- Change implementation of XML escape() for memory leak analysis +- Improvements at the Download Manager, PE Node and mp4 parser in order to +accomodate new Progressive Streaming protocols. +- Incorrect duration for AAC ADIF file +- Call failure when two TCS are received +- Allow repositioning in mp4 files without stss atoms +- Update the description of setParametersSync API +- Fix multiple repositioning usecases with MP3 gapless playlists +- Audio distortion heard in AMR-NB audio clip +- AAC multichannel decoder robustness improvement to prevent crash. +- Export GetRemoteCodecCapability method for 2-way +- Fix logical error in error handling +- Corrected intialization of ParserObject and ClipIndex for Metadata parsing in +MP3FF. +- resolve player engine test RELEASE Linux build compilation errors on gcc 4.3 +- Recognizer fails to recognize file but file is larger than minimum needed. +- Improvements at the Download Manager, Protocol Engine node in order to +accomodate new Progressive Streaming protocols +- Error events from the audio thread are not handled correctly +- OSCL Unicode to UTF8 modification +- Fix deadlock in mp3 parser and node for mp3 files that are smaller than the +minimum desired for recognition +- Fix parsing of certain RTSP URLs. +- VT TC-58 failure +- OsclMemPoolResizableAllocator does not allocate memory in a circular way, +causes fragmentation. +- Fix out-of-bounds array index issue in 2way-stack. +- Changed bitmask in oscl_UTF8ToUnicode function so sign extension with 32-bit +wchars is handled properly. +- cleanup of old Keys from MIOs +- Fixed memory leak on file trackfragmentatom.cpp +- Corrected SkipMediaTS calculation and FrameDuration for Backward playback +- Node shall not set async flag for sync command on CPM. +- Follow-on RIO-7292 to fix PV_CPU_ARCH_VERSION value in Android.mk files. +- Handle PVMFInfoErrorHandlingComplete info events in the FMU +- Fixed track fragment atom parsing to allow UUID atom +- BaseNode shall use the logger tag supplied by node and enable complete node +logging. +- Incorrect handling of INSUFFICIENT_DATA error when parsing mp4 movie fragment +clip +- Fixed bug in player engine error-handling code. +- Media Output Node sync margins are not being set for video tracks + + +=============================================================================== +2009-12-08 OpenCORE 2.07 + +New Features +- Support 3GPP fast content switch +- Player engine changes and new interfaces for gapless playback +- Player unit test additions +- Add KVP mechanism to set max/min UDP port number +- Support PE node feature selection for static builds +- SetFSIParam( ) extension interface is implemented. It was previously stubbed +out. FSI (VOL header or SPS/PPS) is sent to the encoder as preferred encoding +parameters. +- Introduce ASM and condition support for arm in tool generated project files. +- GetActualAACConfig - add mime type as input to process properly RFC 3016 type +streams +- Updates to player engine and media output node for gapless playback +- Implement support for I-frame request in OMX encoder node +- Add support for AAC Dual Mono +- Add a new KVP to control audio output in trickplay mode. +- CPM changes and new player engine unit test cases. +- Add Track ID as input parameter to the addTrack mp4 composer API + +Improvements +- Added pvlogger_empty_layout.h as an optional logger output string format that +appends nothing to the output string. +- Code cleanup in MP4 decoder vop code +- AAC lib - improve ADTS searching capabilities - needed for applications not +using aac parser +- Change to use audio output buffer size calculation to be based on time as in +the OMX audio dec node rather than based on a fixed number of samples as in the +OMX components default. +- Handle more non-standard OMX component state transition errors +- Removal of 2way VideoParser Node +- Update MediaIONodeRepositionDuringPreparedTest test case to run till EOS +- Improve FillBufferDoneProcessing and ParseAVCFullFrameIntoNALs in OMX encoder +nodes +- Add support for linking against eclair-specific libraries +- Adding a new api to turn silence insertion logic on or off (engine->omx +decoder node->omx audio component). +- Introduce -Wno-psabi into android makefiles +- Modify logging in PVME Test so that it's consistent with the other logging +- Cleanup in the android folder (logging, whitespace, etc) +- Changes in android folder to sync-up with eclair changes +- Removed unused code oscl_mempool_allocator.h/.cpp +- Include pvlogger library in oscl build +- Updating run_ae_test make target for logging +- Minor bug fix to support movie fragments MP4 files with empty sample +description tables and common PE Node code refactoring + +Bugs Fixed +- Video and timer gets stuck on repositioning while the audio continues +- A/V Sync Issue on Simple playback and timer goes beyond the limit with Video +playback only (Audio Stops) +- Fix for redundant rule to copy getactualaacconfig.h +- MP4 file parser and parser node modified to support a very large value of +timescale +- Improvements in AAC file parser for ADTS recognition +- Code cleanup in pvmf_node_interface +- Failures in Java-based mediaframework unit test cases. +- Fix for failure on resumption from long pauses during RTSP streaming. +- Remove an extra call of ResetData from ThreadLogoff in AndroidSurfaceOutput +- Mp4 composer node File writer hang issue +- Typo in the OMX node log statements +- Uninitialized variable iPlayElementIndex of structure PVPPlaybackPosition +causing repositioning problems +- In AAC and AMR parser nodes, UsageComplete should be called only when the +content is protected +- MP4 parser node returning the same command twice +- Hang in Player engine when cancel called in prepare +- Use clock_gettime(MONOTONIC) instead of gettimeofday() on linux platform to +have a consistent clock +- In PVPlayerEngine::DoVerifyAndSetPlayerParameter, hard-coded enum value is +wrong +- OMX encoder node bug in processing SPS PPS for components that produce NAL +start codes +- Classes with virtual methods should have virtual destructors too +- Fix for crash in AAC Decoder unit test app +- Map key 'track-info/track-number' to 'tracknumber' for Android MediaScanner +to recognize the key. +- MP3 FF parser should not pass the Xing/LAME header frame to dec node +- AMR file parser improvements +- Removed parsing support for WMF AMR tracks from MP4 file parser. +- Improvements in OMX test application +- Fix crash in 2way stack unit test +- Change in oscl statfs to accomodate blank paths +- Add Error handling at buffer memory allocation error +- Fix rebuffering after PVMFInfoBufferingComplete at mp4 PPB +- AVC configuration modifications +- Using sample duration in addition to timestamp for syncronization +- FMU video MIO does not set video subformat type correctly +- Fix uninitialized memory in 2way engine unit tests +- Updated PVPlayerEngine::ReleaseMetadataValues to properly handle clip index +argument +- Fix for running a test number multiple times in makefile target for running +parallel player engine tests +- OMX Encoder node returns failure if OMX components returns Failure for +"OMX_IndexConfigCommonRotate" parameter +- Remove tests not applicable for OpenCORE +- MediaScanner has some API calls which are missing the interface +- Cap lower bound player engine watchdog timer duration to default value +- Enable File-writer for Mp4 composer node +- Early and Late Sync Margins changed for better AV Sync + + +=============================================================================== +2009-11-08 OpenCORE 2.06 + +New Features +- Add support for the PLS playlist file format for use with Shoutcast +- Adding code to benchmark encoding/decoding operation in the OMX component +- Add support for junit-like XML log output to test framework +- AAC utility getaacaudioinfo - add support for adts clips parsing +- Add support in playerdriver for RTSP streaming based on an input SDP file. +- Player engine unit test needs to support a list of test case ranges +- Add support for authoring btrt atom in mp4 composer to record bitrate +information. +- Unit test logger option unification +- Add SetDuration capability and new command status code in the base node +- Add build macro for turning compiler warnings into errors in Android.mk files +- New color conversion library suite for YUV420 to YUV422 conversion; supports +basic conversion as well as 90 and 270 degree rotation +- Add communication between OMXEncNode and Composer node for MaxBitRate and +DecodingBufferDB +- Support PVMF_MIME_H264_RAW where decoder config info is not always available +before the actual decoding start +- Support for YUV422 to OMX encoder components (M4V and AVC) +- Enable track selection helper to choose the OMX component used for each track +- Changes in PlayerEngine, FMU, and source nodes to allow retrieval of +thumbnails for protected content +- Gapless audio support at the file format and source node level + +Improvements +- Change the default behavior of the local makefiles to flag compiler warnings +as errors and provide a new flag to disable it +- AMR-NB modifications from AOSP +https://review.source.android.com/10904 +https://review.source.android.com/10905 +https://review.source.android.com/10906 +- Eliminate memcopies of output buffers in omx components (where possible) +- Move helper functions ( MoveCmdToCurrentQueue and MoveCmdToCancelQueue ) to +base node +- Add logic to the OMX encoder to choose another component if one fails +- Update the logic in the encoder node when choosing an OMX encoder +- Track selection metadata ("track-info/selected") needs to be added in AAC/AMR + and MP3 nodes +- Code size reduction +- Ignore pause and seek for live streaming +- New player engine test content +- Add API to 2Way engine to support selection of codecs and their preference +order +- Port OMXBaseNode, OMXVideoNode and OMXAudioNode to new Node Interface +- Build system support for ARM_GCC_V4 from AOSP +https://review.source.android.com/9668 +- Add ID3V2 metadata support in mp4 parser libary defined by 3GPP Rel 7. Move +all metadata related operations from MP4 PN to library +- Variable _mp4ErrorCode to UNSUPPORTED_FILE_TYPE for any brand type in +mpeg4file.cpp should not be set +- Encoder nodes should be added only for uncompressed MIO in 2way engine +- PV OMX component returns invalid supported profile/level pair +- Removing memory leaks in MDBS +- Create Generic 2Way Pause/Resume unit test +- Add insert_element() and clear() methods to OSCL linked list +- Update Player developers guide for CancelCommand and CancelAllCommands error +return values +- Remove a check in sliding_window_process to make avc decoder tolerate an +error condition and continue decoding +- Remove YUV buffer alignment calculations from the OMX decoder node. This is +currently done in the OMX components +- Add the ability to report info and error events from the author MIOs +- Modifying current command queue and cancel command queue to a single command +in the base node +- Refactor RTSP client engine node for cleaner interfacing with streaming +manager node +- Adding support for configuring the number of output buffers as a part of +dynamic port reconfiguration in omx test app +- Refactor MP3FFParserNode to use the base node implementation +- Refactor DownloadManager Node to use the base node implementation +- Refactor MP4 FF Parser Node to use the base node implementation +- Add CallNativeSetSize() API for OSCL File +- Change H.263 encoding default GOB header interval to 0 + +Bugs Fixed +- Track IDs are huge in particular mp4 clip causing crash +- Source node's handling of CPM cmds in Reset is incorrect +- [PDL] Download resume doesn't work if server response doesn't include the +Content-Length header. +- Android_camera_input.cpp method statusUpdate returns unhandled exception +- Hardcoded values in mp4a atom in the composer. (2030968) +- Download manager node uses shoutcast support by default +- atom 'meta' is not skipped +- Video playback is distorted (not normal) during playback for somes clips +- Need the ability to disable CPM in source nodes +- Crash in OsclTimer +- Nodes getting schedule extra number of times +- Update Android MIO to use authoring clock to achieve better AV sync in +encoding +- Implementation of trick play support +- Modify player engine's QueryInterface implementation +- Not able to play InValidId3Tags.mp3 content +- Fixes for building OpenCORE on android-x86 +- Streaming Manager node modification to make feature specific plugins +dynamically loadable +- Memory leak in video telephony engine +- OsclMemPoolResizableAllocator has been modified to take into account the +size specified via setMaxSzForNewMemPoolBuffer while expanding the mempool +- OMX AMR component fixed to support 3 Role strings properly +- Crash in video telephony engine +- PVAuthor Developer's Guide has been updated to clarify 3GP vs MP4 file +authoring +- RTSP amr-nb streaming can not start playback, need to seek then playback +start +- Fix the issues in Table of Contents implementation in Mp3 Parser +- Hang in one accepted/negotiated format 2way engine unit test +- Fix a problem where a node based on the base node implementation was not +getting resheduled to process the next command when multiple commands +(RequestPort in this case) were queued. +- PVMFRecognizer improvements, including multi-pass recognition etc. +- Send correct YUV format to the VMIO instead of PVMF_MIME_FORMAT_UNKNOWN +- By default, use current system time as creation & modification date in MP4 +composer node +- Audio issue in RTSP streaming caused by AMR decoder problem. +- Fix an issue where PVPlayerEngine::Prepare() never completes. If server +sends OPTIONS request to the PVPlayer, PVPlayer does not send SETUP request +to the server and PVPlayerEngine::Prepare() never completes +- Fix for reading from files using a file descriptor with an non-zero offset +- Fix potential crash during streaming session with multiple frames per packet +- Minor refactoring of integer datatype use +- Fix issue where an incorrect VOL header for MPEG4 video content results in +no video playback +- Add an extra condition for the multi-line check in an HTTP response header +- Move inlined code from header to cpp file for pvmf_event_handling +- Update the omx decoder node to reject a component if +iOMXComponentUsesFullAVCFrames is false +- Crash in video telephony engine cleanup +- Report a more appropriate failure status via the author engine when +underlying node commands fails +- Fix the fileoutput MIO to take into account the 422 UYVY format +- Fix for opening shared asset file handles multiple times +- Fileformat parser changes to support some specific mp4 content +- Limit the max size of album art to 3MB +- Changes in sending the Buffering Status +- Adding support for authoring moof clips for live sessions in mp4 composer +library +- PVPlayer crashes when trying to do Progressive Streaming of a specific +MP4 Clip +- Incorrect mime string comparision in pv2way datapath +- Fix for memory leak in mp4 local playback at GetMetaDataValue +- Implement HandleExtensionAPICommands for OMXDecNode +- Change OMX enc node Reset() to return success even OMX comp GetState() +fails or returns bad states +- Treat OMX_EventError with OMX_ErrorInvalidState as if OMX client get an +OMX_EventCmdComplete indicating state transition failure +- Add CTOR in RepositionRequestStruct to init the members +- Fix for testcase 805 with local content +- Logging in PVME Test not working properly for threaded mode +- Thumbnail extraction when no sample present in stss atom +- MP3 frames may have different sampling rate or number of channels. So, +in the omx mp3 component, logic has been added to ensure that only decoding of +consistent frames is sent as output and silence will replace mismatched frames +- Content truncated while seeking specific YouTube clip +- Player Engine should not fail playback if the Source node does not support +Playback control interface +- Cleanup test input and output filenames used in 2way tests +- Error in video display while playing minimum size content (48*48) +- Valgrind error fixes +- Fix a bug in SPS length calculation +- PVME doesn't retrieve metadata properly if file has an invalid extension +- Wrong sequence numbers from video parser node +- Using RTCP SR reports to perform AV sync once, if server does not provide +rtp-info in PLAY response. +- Mp3 parsernode should pass source context to CPM plugins + + +=============================================================================== 2009-08-06 OpenCORE 2.05 New Features - Helper function to retrieve extended messages from command responses. - - Support for eAAC+ encode in the pvAuthor engine. - - Add conversion operations to OSCL_String classes. - - RTSPT support (3GPP streaming over TCP). To test, replace "rtsp" with "rtspt" in the control URL (in source URL or SDP file). It is assumed that the user has access to a server with TCP streaming capability. - - PV Metadata Engine (ME). This engine is targeted at applications that want to retrieve metadata for any given clip in a generic manner. Typically, a lot of these applications would like to scan large batches of content. Since ME @@ -19,11 +773,9 @@ is mainly targeted at apps like mediascanner, where speed is the most important factor, thumbnail extraction is not supported. For applications that do want to extract thumbnails in a generic manner along with the metadata, PV's FrameAndMetadata Utility (FMU) is recommended instead. - - 2way Lip-Sync unit test cases. - -Improvement +Improvements - A new base node implementation is introduced for the purpose of refactoring and consolidating common logic in the nodes. The changes will improve maintainability and make it easier to create new nodes. @@ -153,7 +905,7 @@ firewall packets to the server - Clean up warnings and some negotiate parameter changes from omx dec & enc test apps - Fix valgrind issue reported with android simulator in omx base node -- Add more supported rate control types in pvmp4h263encextension.h +- Add more supported rate control types in pv_video_encnode_extension.h - Memory leak in player engine test case 807 - Addressed compiler warnings in PVME - nBufferAlignment of OMX_PARAM_PORTDEFINITIONTYPE is initialized to negative @@ -162,7 +914,8 @@ value when playing clip on android using qcom decoders - pvplayer_engine_test is detecting 'rtspt_test.sdp' as a url instead a local file - Count of command line arguments being read in PVME Test App is incorrect -- Player engine test case 1307 fails when run with a mp4 file containing 3GPP timed text track +- Player engine test case 1307 fails when run with a mp4 file containing 3GPP +timed text track - PVMFInfoDataReady event being sent to the engine after the unit test calls stop - PlayerEngine doesn't free reference to PVMFDataSourceNodeRegistryInitInterface @@ -192,11 +945,9 @@ introduced to allow for an external entity to pass a datastream interface to the player SDK. The external entity is responsible for doing the actual download of the media data. Full support in Android is not complete until playerdriver changes and more unit testing is done. - - Fixed cache option in Oscl_File Adding an option to configure the Oscl file cache to use one or more fixed caches in addition to the movable cache. - - Modify author engine to contain a notion of "authoring clock" Author engine has the option to pass an "authoring clock" to media input components so that they can use this to sync audio and video timestamps. @@ -208,24 +959,17 @@ used in author engine unit test currently operate from a file and have no need for such a clock, but some device media input components can make use of the clock if needed in the future, since author engine will pass the clock pointer all the time to data sources. - - Shoutcast (of MP3) support Shoutcast support of MP3 and internet radio streaming is added. - - Enable AAC PDL Support More robust support of PDL of AAC content, including underflow handling. - - Add support for 3GPP2 speech (EVRC, QCELP etc) in MP4 FF library Support for the 3GPP2 speech codecs is added at the file format library level. No 3GPP2 speech codecs are added. - - OpenMAX encoder and decoder unit test suite - - Use external filehandle in Android - - Introduce new macro to android makefiles to enable 2way - Improvements - Add support for "all" metadata key in CPM plugins. This feature provides a single key to request that all available metadata be returned. @@ -273,7 +1017,6 @@ config data is missing (but is required by the format) - Update playerdriver.cpp to send "disable-firewall-packets" KVP key based on system Android property - Bugs Fixed - Moov atom is not being written into .3gp file if Author driver does not close file handle. @@ -328,13 +1071,13 @@ Bugs Fixed string has a CR at the end - Sequence number rollover in RTP info param during prolonged RTSP streaming + =============================================================================== 2009-03-31 OpenCORE 2.03 Improvements - Enable OpenCORE on master - part 2 - =============================================================================== 2009-03-10 OpenCORE 2.02 @@ -375,7 +1118,6 @@ Improvements - OMX Khronos header files (Omx_Core.h, Omx_Component.h) capitalization changed to match that from the Khronos (previously they were all lowercase). - Bugs Fixed - Memory leak when running GCF TC212 (2way-related) - MediaClockConverter divided by zero caused by timescale 0 @@ -465,6 +1207,7 @@ New APIs / Behaviors needed and was removed. See the playerdriver.cpp for details of the change. + =============================================================================== 2009-01-26 OpenCORE 2.0 (2.00) @@ -578,3 +1321,8 @@ Known Issues - The OpenMAX encoder node is not handling Reset correctly in all cases. +=============================================================================== +2008-10-21 OpenCORE 1.0 (1.00) + +OpenCORE 1.0 is the initial contribution to AOSP. It has both release-1.0 +and android-1.0 tags. diff --git a/opencore/README b/opencore/README index 1a26415..d63d0f9 100644 --- a/opencore/README +++ b/opencore/README @@ -1,14 +1,13 @@ - Welcome to OpenCORE + Welcome to OpenCORE -OpenCORE is the multimedia framework of Android -originally contributed by PacketVideo. It provides -an extensible framework for multimedia rendering and + http://www.opencore.net/ + +OpenCORE is the multimedia framework of Android originally contributed by +PacketVideo. It provides an extensible framework for multimedia rendering and authoring and video telephony (3G-324M). -The following is a brief overview of the directory -structure to make it easier to understand the organization. -Below is a list of the top-level directories along with a brief -note about the contents. +The following an overview of the directory structure which includes a list of +the top-level directories along with a brief note describing the contents. __ |-- android [Contains the components the interface OpenCORE with @@ -22,21 +21,21 @@ __ |-- doc [Contains the documentation required to interface with | OpenCORE] |-- engines [Contains the implementation of the player and author - | engines as well as a utility for metadata.] + | engines as well as a utility for metadata] |-- extern_libs_v2 [Contains 3rd-party libraries used by OpenCORE. | Currently this directory contains header files | defining the Khronos OpenMax IL interface] |-- extern_tools_v2 [Contains 3rd-party tools used to build OpenCORE | indpendently of the Android build system] |-- fileformats [Contains the libraries for parsing a variety of - | fileformats including mp4/3gp,mp3,wav,aac.] + | fileformats including mp4/3gp,mp3,wav,aac] |-- modules [Contains build files for aggregating low-level libraries] |-- nodes [Contains the OpenCORE framework "nodes", which is | the abstraction used to implement independent multimedia | processing units that can be connected in a flow graph] |-- oscl [This is the Operating System Compatibility Layer which | provides the mapping OS APIs as well as some basic - | data structures and utilities.] + | data structures and utilities] |-- protocols [Contains parsers and composers for a variety of network | protocols such as HTTP, RTP/RTCP, RTSP, and SDP] |-- pvmi [Contains fundamental definitions that make up OpenCORE. @@ -44,8 +43,8 @@ __ | Multimedia Infrastructure] |-- tools_v2 [Contains tools used to build the libraries outside of Android] -Within each library the following directory structure, with a few exceptions, -to organize the files: +Within each library, the following directory structure, with a few exceptions, +is implemented to organize the files: __ |-- build @@ -53,7 +52,7 @@ __ |-- doc <- directory for any documentation specific to this lib |-- include <- header files that are part of the external interface go here |-- src <- source and internal header files of the library - |-- test <- test code (follows a similar structure. + |-- test <- test code (follows a similar structure) |-- build |-- make |-- include diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/Android.mk b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/Android.mk index 550e5fe..d978dbe 100644 --- a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/Android.mk +++ b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/Android.mk @@ -57,7 +57,6 @@ LOCAL_SRC_FILES := \ LOCAL_MODULE := libpv_amr_nb_common_lib LOCAL_CFLAGS := $(PV_CFLAGS) - LOCAL_ARM_MODE := arm LOCAL_STATIC_LIBRARIES := diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/basic_op.h b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/basic_op.h index d38f953..fd66e9a 100644 --- a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/basic_op.h +++ b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/basic_op.h @@ -1,5 +1,5 @@ /* ------------------------------------------------------------------ - * Copyright (C) 1998-2009 PacketVideo + * Copyright (C) 1998-2010 PacketVideo * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -49,10 +49,7 @@ terms listed above has been obtained from the copyright holder. ----------------------------------------------------------------------------*/ #include "basicop_malloc.h" -#if defined(PV_ARM_V5) -#include "basic_op_arm_v5.h" - -#elif defined(PV_ARM_GCC_V5) +#if ((PV_CPU_ARCH_VERSION >=5) && (PV_COMPILER == EPV_ARM_GNUC)) #include "basic_op_arm_gcc_v5.h" #else diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/basic_op_arm_gcc_v5.h b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/basic_op_arm_gcc_v5.h index 1abc4fa..5752171 100644 --- a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/basic_op_arm_gcc_v5.h +++ b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/basic_op_arm_gcc_v5.h @@ -112,7 +112,7 @@ extern "C" L_sum = 32-bit sum of L_var1 and L_var2 (Word32) */ - __inline Word32 L_add(register Word32 L_var1, register Word32 L_var2, Flag *pOverflow) + static inline Word32 L_add(register Word32 L_var1, register Word32 L_var2, Flag *pOverflow) { register Word32 ra = L_var1; register Word32 rb = L_var2; @@ -120,7 +120,7 @@ extern "C" OSCL_UNUSED_ARG(pOverflow); - asm volatile("qadd %0, %1, %2" + __asm__ volatile("qadd %0, %1, %2" : "=r"(result) : "r"(ra), "r"(rb) ); @@ -149,7 +149,7 @@ extern "C" Returns: L_diff = 32-bit difference of L_var1 and L_var2 (Word32) */ - __inline Word32 L_sub(Word32 L_var1, Word32 L_var2, Flag *pOverflow) + static inline Word32 L_sub(Word32 L_var1, Word32 L_var2, Flag *pOverflow) { register Word32 ra = L_var1; register Word32 rb = L_var2; @@ -157,7 +157,7 @@ extern "C" OSCL_UNUSED_ARG(pOverflow); - asm volatile("qsub %0, %1, %2" + __asm__ volatile("qsub %0, %1, %2" : "=r"(result) : "r"(ra), "r"(rb) ); @@ -197,12 +197,12 @@ extern "C" OSCL_UNUSED_ARG(pOverflow); - asm volatile("smulbb %0, %1, %2" + __asm__ volatile("smulbb %0, %1, %2" : "=r"(result) : "r"(rb), "r"(rc) ); - asm volatile("qdadd %0, %1, %2" + __asm__ volatile("qdadd %0, %1, %2" : "=r"(rc) : "r"(ra), "r"(result) ); @@ -232,7 +232,7 @@ extern "C" L_product = 32-bit product of L_var1 and L_var2 (Word32) */ - __inline Word32 L_mult(Word16 var1, Word16 var2, Flag *pOverflow) + static inline Word32 L_mult(Word16 var1, Word16 var2, Flag *pOverflow) { register Word32 ra = var1; register Word32 rb = var2; @@ -241,12 +241,12 @@ extern "C" OSCL_UNUSED_ARG(pOverflow); - asm volatile("smulbb %0, %1, %2" + __asm__ volatile("smulbb %0, %1, %2" : "=r"(product) : "r"(ra), "r"(rb) ); - asm volatile("qadd %0, %1, %2" + __asm__ volatile("qadd %0, %1, %2" : "=r"(result) : "r"(product), "r"(product) ); @@ -277,7 +277,7 @@ extern "C" Returns: result = 32-bit result of L_var3 - (var1 * var2) */ - __inline Word32 L_msu(Word32 L_var3, Word16 var1, Word16 var2, Flag *pOverflow) + static inline Word32 L_msu(Word32 L_var3, Word16 var1, Word16 var2, Flag *pOverflow) { register Word32 ra = L_var3; register Word32 rb = var1; @@ -287,12 +287,12 @@ extern "C" OSCL_UNUSED_ARG(pOverflow); - asm volatile("smulbb %0, %1, %2" + __asm__ volatile("smulbb %0, %1, %2" : "=r"(product) : "r"(rb), "r"(rc) ); - asm volatile("qdsub %0, %1, %2" + __asm__ volatile("qdsub %0, %1, %2" : "=r"(result) : "r"(ra), "r"(product) ); @@ -338,44 +338,44 @@ extern "C" OSCL_UNUSED_ARG(pOverflow); - asm volatile("smulbb %0, %1, %2" + __asm__ volatile("smulbb %0, %1, %2" : "=r"(L_product) : "r"(ra), "r"(rc) ); - asm volatile("mov %0, #0" + __asm__ volatile("mov %0, #0" : "=r"(result) ); - asm volatile("qdadd %0, %1, %2" + __asm__ volatile("qdadd %0, %1, %2" : "=r"(L_sum) : "r"(result), "r"(L_product) ); - asm volatile("smulbb %0, %1, %2" + __asm__ volatile("smulbb %0, %1, %2" : "=r"(product32) : "r"(ra), "r"(rd) ); - asm volatile("mov %0, %1, ASR #15" + __asm__ volatile("mov %0, %1, ASR #15" : "=r"(ra) : "r"(product32) ); - asm volatile("qdadd %0, %1, %2" + __asm__ volatile("qdadd %0, %1, %2" : "=r"(L_product) : "r"(L_sum), "r"(ra) ); - asm volatile("smulbb %0, %1, %2" + __asm__ volatile("smulbb %0, %1, %2" : "=r"(product32) : "r"(rb), "r"(rc) ); - asm volatile("mov %0, %1, ASR #15" + __asm__ volatile("mov %0, %1, ASR #15" : "=r"(rb) : "r"(product32) ); - asm volatile("qdadd %0, %1, %2" + __asm__ volatile("qdadd %0, %1, %2" : "=r"(L_sum) : "r"(L_product), "r"(rb) ); @@ -417,29 +417,29 @@ extern "C" OSCL_UNUSED_ARG(pOverflow); - asm volatile("smulbb %0, %1, %2" + __asm__ volatile("smulbb %0, %1, %2" : "=r"(L_product) : "r"(ra), "r"(rc) ); - asm volatile("mov %0, #0" + __asm__ volatile("mov %0, #0" : "=r"(result) ); - asm volatile("qdadd %0, %1, %2" + __asm__ volatile("qdadd %0, %1, %2" : "=r"(L_product) : "r"(result), "r"(L_product) ); - asm volatile("smulbb %0, %1, %2" + __asm__ volatile("smulbb %0, %1, %2" : "=r"(result) : "r"(rb), "r"(rc) ); - asm volatile("mov %0, %1, ASR #15" + __asm__ volatile("mov %0, %1, ASR #15" : "=r"(ra) : "r"(result) ); - asm volatile("qdadd %0, %1, %2" + __asm__ volatile("qdadd %0, %1, %2" : "=r"(result) : "r"(L_product), "r"(ra) ); @@ -468,7 +468,7 @@ extern "C" Returns: product = 16-bit limited product of var1 and var2 (Word16) */ - __inline Word16 mult(Word16 var1, Word16 var2, Flag *pOverflow) + static inline Word16 mult(Word16 var1, Word16 var2, Flag *pOverflow) { register Word32 ra = var1; register Word32 rb = var2; @@ -477,12 +477,12 @@ extern "C" OSCL_UNUSED_ARG(pOverflow); - asm volatile( + __asm__ volatile( "smulbb %0, %1, %2" : "=r"(temp) : "r"(ra), "r"(rb) ); - asm volatile( + __asm__ volatile( "qadd %0, %1, %2\n\t" "mov %0, %0, asr #16" : "=&r*i"(product) @@ -492,33 +492,33 @@ extern "C" return ((Word16) product); } - __inline Word32 amrnb_fxp_mac_16_by_16bb(Word32 L_var1, Word32 L_var2, Word32 L_var3) + static inline Word32 amrnb_fxp_mac_16_by_16bb(Word32 L_var1, Word32 L_var2, Word32 L_var3) { register Word32 ra = L_var1; register Word32 rb = L_var2; register Word32 rc = L_var3; Word32 result; - asm volatile("smlabb %0, %1, %2, %3" + __asm__ volatile("smlabb %0, %1, %2, %3" : "=r"(result) : "r"(ra), "r"(rb), "r"(rc) ); return (result); } - __inline Word32 amrnb_fxp_msu_16_by_16bb(Word32 L_var1, Word32 L_var2, Word32 L_var3) + static inline Word32 amrnb_fxp_msu_16_by_16bb(Word32 L_var1, Word32 L_var2, Word32 L_var3) { register Word32 ra = L_var1; register Word32 rb = L_var2; register Word32 rc = L_var3; Word32 result; - asm volatile("rsb %0, %1, #0" + __asm__ volatile("rsb %0, %1, #0" : "=r"(ra) : "r"(ra) ); - asm volatile("smlabb %0, %1, %2, %3" + __asm__ volatile("smlabb %0, %1, %2, %3" : "=r"(result) : "r"(ra), "r"(rb), "r"(rc) ); diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/basic_op_c_equivalent.h b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/basic_op_c_equivalent.h index eb91049..62072a5 100644 --- a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/basic_op_c_equivalent.h +++ b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/basic_op_c_equivalent.h @@ -117,9 +117,9 @@ extern "C" if ((L_var1 ^ L_var2) >= 0) { - if ((L_sum ^ L_var1) < 0) + if ((L_sum ^ L_var1) >> 31) { - L_sum = (L_var1 < 0) ? MIN_32 : MAX_32; + L_sum = (L_var1 >> 31) ? MIN_32 : MAX_32; *pOverflow = 1; } } @@ -155,11 +155,11 @@ extern "C" L_diff = L_var1 - L_var2; - if ((L_var1 ^ L_var2) < 0) + if ((L_var1 ^ L_var2) >> 31) { if ((L_diff ^ L_var1) & MIN_32) { - L_diff = (L_var1 < 0L) ? MIN_32 : MAX_32; + L_diff = (L_var1 >> 31) ? MIN_32 : MAX_32; *pOverflow = 1; } } @@ -202,9 +202,9 @@ extern "C" /* Check if L_sum and L_var_3 share the same sign */ if ((L_var3 ^ result) > 0) { - if ((L_sum ^ L_var3) < 0) + if ((L_sum ^ L_var3) >> 31) { - L_sum = (L_var3 < 0) ? MIN_32 : MAX_32; + L_sum = (L_var3 >> 31) ? MIN_32 : MAX_32; *pOverflow = 1; } } @@ -342,9 +342,9 @@ extern "C" if ((L_product ^ product32) > 0) { - if ((L_sum ^ L_product) < 0) + if ((L_sum ^ L_product) >> 31) { - L_sum = (L_product < 0) ? MIN_32 : MAX_32; + L_sum = (L_product >> 31) ? MIN_32 : MAX_32; } } @@ -358,9 +358,9 @@ extern "C" if ((L_product ^ product32) > 0) { - if ((L_sum ^ L_product) < 0) + if ((L_sum ^ L_product) >> 31) { - L_sum = (L_product < 0) ? MIN_32 : MAX_32; + L_sum = (L_product >> 31) ? MIN_32 : MAX_32; } } return (L_sum); @@ -413,9 +413,9 @@ extern "C" if ((L_product ^ result) > 0) { - if ((L_sum ^ L_product) < 0) + if ((L_sum ^ L_product) >> 31) { - L_sum = (L_product < 0) ? MIN_32 : MAX_32; + L_sum = (L_product >> 31) ? MIN_32 : MAX_32; *pOverflow = 1; } } diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/l_add.h b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/l_add.h index 8fceb9d..ac72c31 100644 --- a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/l_add.h +++ b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/l_add.h @@ -1,5 +1,5 @@ /* ------------------------------------------------------------------ - * Copyright (C) 1998-2009 PacketVideo + * Copyright (C) 1998-2010 PacketVideo * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -87,22 +87,7 @@ extern "C" ; GLOBAL FUNCTION DEFINITIONS ; Function Prototype declaration ----------------------------------------------------------------------------*/ -#if defined(PV_ARM_V5) /* Instructions for ARM Assembly on ADS*/ - - __inline Word32 L_add(register Word32 L_var1, register Word32 L_var2, Flag *pOverflow) - { - Word32 result; - - OSCL_UNUSED_ARG(pOverflow); - __asm - { - QADD result, L_var1, L_var2 - } - return(result); - } - -#elif defined(PV_ARM_GCC_V5) /* Instructions for ARM-linux cross-compiler*/ - +#if ((PV_CPU_ARCH_VERSION >=5) && (PV_COMPILER == EPV_ARM_GNUC))/* Instructions for ARM-linux cross-compiler*/ __inline Word32 L_add(register Word32 L_var1, register Word32 L_var2, Flag *pOverflow) { register Word32 ra = L_var1; diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/l_mac.h b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/l_mac.h index 865f043..f672428 100644 --- a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/l_mac.h +++ b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/l_mac.h @@ -1,5 +1,5 @@ /* ------------------------------------------------------------------ - * Copyright (C) 1998-2009 PacketVideo + * Copyright (C) 1998-2010 PacketVideo * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -86,21 +86,7 @@ extern "C" ; GLOBAL FUNCTION DEFINITIONS ; Function Prototype declaration ----------------------------------------------------------------------------*/ -#if defined(PV_ARM_V5) /* Instructions for ARM Assembly on ADS*/ - - __inline Word32 L_mac(Word32 L_var3, Word16 var1, Word16 var2, Flag *pOverflow) - { - Word32 result; - Word32 L_sum; - - OSCL_UNUSED_ARG(pOverflow); - - __asm {SMULBB result, var1, var2} - __asm {QDADD L_sum, L_var3, result} - return (L_sum); - } - -#elif defined(PV_ARM_GCC_V5) /* Instructions for ARM-linux cross-compiler*/ +#if ((PV_CPU_ARCH_VERSION >=5) && (PV_COMPILER == EPV_ARM_GNUC))/* Instructions for ARM-linux cross-compiler*/ static inline Word32 L_mac(Word32 L_var3, Word16 var1, Word16 var2, Flag *pOverflow) { diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/l_msu.h b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/l_msu.h index b1a51ba..86c5735 100644 --- a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/l_msu.h +++ b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/l_msu.h @@ -1,5 +1,5 @@ /* ------------------------------------------------------------------ - * Copyright (C) 1998-2009 PacketVideo + * Copyright (C) 1998-2010 PacketVideo * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -88,25 +88,7 @@ extern "C" ; GLOBAL FUNCTION DEFINITIONS ; Function Prototype declaration ----------------------------------------------------------------------------*/ -#if defined(PV_ARM_V5) /* Instructions for ARM Assembly on ADS*/ - - __inline Word32 L_msu(Word32 L_var3, Word16 var1, Word16 var2, Flag *pOverflow) - { - Word32 product; - Word32 result; - - OSCL_UNUSED_ARG(pOverflow); - - __asm - { - SMULBB product, var1, var2 - QDSUB result, L_var3, product - } - - return (result); - } - -#elif defined(PV_ARM_GCC_V5) /* Instructions for ARM-linux cross-compiler*/ +#if ((PV_CPU_ARCH_VERSION >=5) && (PV_COMPILER == EPV_ARM_GNUC))/* Instructions for ARM-linux cross-compiler*/ __inline Word32 L_msu(Word32 L_var3, Word16 var1, Word16 var2, Flag *pOverflow) { diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/l_mult.h b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/l_mult.h index 2aaea47..33fedb1 100644 --- a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/l_mult.h +++ b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/l_mult.h @@ -1,5 +1,5 @@ /* ------------------------------------------------------------------ - * Copyright (C) 1998-2009 PacketVideo + * Copyright (C) 1998-2010 PacketVideo * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -87,26 +87,7 @@ extern "C" ; GLOBAL FUNCTION DEFINITIONS ; Function Prototype declaration ----------------------------------------------------------------------------*/ - -#if defined(PV_ARM_V5) /* Instructions for ARM Assembly on ADS*/ - - __inline Word32 L_mult(Word16 var1, Word16 var2, Flag *pOverflow) - { - Word32 result; - Word32 product; - - OSCL_UNUSED_ARG(pOverflow); - - __asm - { - SMULBB product, var1, var2 - QADD result, product, product - } - - return (result); - } - -#elif defined(PV_ARM_GCC_V5) /* Instructions for ARM-linux cross-compiler*/ +#if ((PV_CPU_ARCH_VERSION >=5) && (PV_COMPILER == EPV_ARM_GNUC))/* Instructions for ARM-linux cross-compiler*/ __inline Word32 L_mult(Word16 var1, Word16 var2, Flag *pOverflow) { diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/l_sub.h b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/l_sub.h index a9b0732..88d86ca 100644 --- a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/l_sub.h +++ b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/l_sub.h @@ -1,5 +1,5 @@ /* ------------------------------------------------------------------ - * Copyright (C) 1998-2009 PacketVideo + * Copyright (C) 1998-2010 PacketVideo * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -51,6 +51,7 @@ terms listed above has been obtained from the copyright holder. ----------------------------------------------------------------------------*/ #include "basicop_malloc.h" + /*--------------------------------------------------------------------------*/ #ifdef __cplusplus extern "C" @@ -88,24 +89,7 @@ extern "C" ; GLOBAL FUNCTION DEFINITIONS ; Function Prototype declaration ----------------------------------------------------------------------------*/ -#if defined(PV_ARM_V5) /* Instructions for ARM Assembly on ADS*/ - - __inline Word32 L_sub(Word32 L_var1, Word32 L_var2, Flag *pOverflow) - { - Word32 result; - - OSCL_UNUSED_ARG(pOverflow); - - __asm - { - QSUB result, L_var1, L_var2 - } - - return(result); - - } - -#elif defined(PV_ARM_GCC_V5) /* Instructions for ARM-linux cross-compiler*/ +#if ((PV_CPU_ARCH_VERSION >=5) && (PV_COMPILER == EPV_ARM_GNUC)) /* Instructions for ARM-linux cross-compiler*/ __inline Word32 L_sub(Word32 L_var1, Word32 L_var2, Flag *pOverflow) { diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/mpy_32.h b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/mpy_32.h index f2cb7cf..8df43c9 100644 --- a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/mpy_32.h +++ b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/mpy_32.h @@ -1,5 +1,5 @@ /* ------------------------------------------------------------------ - * Copyright (C) 1998-2009 PacketVideo + * Copyright (C) 1998-2010 PacketVideo * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -88,47 +88,13 @@ extern "C" ; GLOBAL FUNCTION DEFINITIONS ; Function Prototype declaration ----------------------------------------------------------------------------*/ -#if defined(PV_ARM_V5) /* Instructions for ARM Assembly on ADS*/ +#if ((PV_CPU_ARCH_VERSION >=5) && (PV_COMPILER == EPV_ARM_GNUC))/* Instructions for ARM-linux cross-compiler*/ - __inline Word32 Mpy_32(Word16 L_var1_hi, + static inline Word32 Mpy_32(Word16 L_var1_hi, Word16 L_var1_lo, Word16 L_var2_hi, Word16 L_var2_lo, Flag *pOverflow) - - { - /*---------------------------------------------------------------------------- - ; Define all local variables - ----------------------------------------------------------------------------*/ - Word32 L_product; - Word32 L_sum; - Word32 product32; - - OSCL_UNUSED_ARG(pOverflow); - /*---------------------------------------------------------------------------- - ; Function body here - ----------------------------------------------------------------------------*/ - /* L_product = L_mult (L_var1_hi, L_var2_hi, pOverflow);*/ - - __asm {SMULBB L_product, L_var1_hi, L_var2_hi} - __asm {QDADD L_product, 0, L_product} - __asm {SMULBB product32, L_var1_hi, L_var2_lo} - product32 >>= 15; - __asm {QDADD L_sum, L_product, product32} - L_product = L_sum; - __asm {SMULBB product32, L_var1_lo, L_var2_hi} - product32 >>= 15; - __asm {QDADD L_sum, L_product, product32} - return (L_sum); - } - -#elif defined(PV_ARM_GCC_V5) /* Instructions for ARM-linux cross-compiler*/ - - static inline Word32 Mpy_32(Word16 L_var1_hi, - Word16 L_var1_lo, - Word16 L_var2_hi, - Word16 L_var2_lo, - Flag *pOverflow) { register Word32 product32; register Word32 L_sum; diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/mpy_32_16.h b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/mpy_32_16.h index 33ade51..3a68e69 100644 --- a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/mpy_32_16.h +++ b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/mpy_32_16.h @@ -1,5 +1,5 @@ /* ------------------------------------------------------------------ - * Copyright (C) 1998-2009 PacketVideo + * Copyright (C) 1998-2010 PacketVideo * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -88,36 +88,14 @@ extern "C" ; GLOBAL FUNCTION DEFINITIONS ; Function Prototype declaration ----------------------------------------------------------------------------*/ -#if defined(PV_ARM_V5) /* Instructions for ARM Assembly on ADS*/ +#if ((PV_CPU_ARCH_VERSION >=5) && (PV_COMPILER == EPV_ARM_GNUC))/* Instructions for ARM-linux cross-compiler*/ - __inline Word32 Mpy_32_16(Word16 L_var1_hi, + static inline Word32 Mpy_32_16(Word16 L_var1_hi, Word16 L_var1_lo, Word16 var2, Flag *pOverflow) { - Word32 L_product; - Word32 L_sum; - Word32 result; - - OSCL_UNUSED_ARG(pOverflow); - - __asm {SMULBB L_product, L_var1_hi, var2} - __asm {QDADD L_product, 0, L_product} - __asm {SMULBB result, L_var1_lo, var2} - result >>= 15; - __asm {QDADD L_sum, L_product, result} - return (L_sum); - } - -#elif defined(PV_ARM_GCC_V5) /* Instructions for ARM-linux cross-compiler*/ - - static inline Word32 Mpy_32_16(Word16 L_var1_hi, - Word16 L_var1_lo, - Word16 var2, - Flag *pOverflow) - { - register Word32 ra = L_var1_hi; register Word32 rb = L_var1_lo; register Word32 rc = var2; @@ -125,29 +103,29 @@ extern "C" OSCL_UNUSED_ARG(pOverflow); - asm volatile("smulbb %0, %1, %2" + __asm__ volatile("smulbb %0, %1, %2" : "=r"(L_product) : "r"(ra), "r"(rc) ); - asm volatile("mov %0, #0" + __asm__ volatile("mov %0, #0" : "=r"(result) ); - asm volatile("qdadd %0, %1, %2" + __asm__ volatile("qdadd %0, %1, %2" : "=r"(L_product) : "r"(result), "r"(L_product) ); - asm volatile("smulbb %0, %1, %2" + __asm__ volatile("smulbb %0, %1, %2" : "=r"(result) : "r"(rb), "r"(rc) ); - asm volatile("mov %0, %1, ASR #15" + __asm__ volatile("mov %0, %1, ASR #15" : "=r"(ra) : "r"(result) ); - asm volatile("qdadd %0, %1, %2" + __asm__ volatile("qdadd %0, %1, %2" : "=r"(result) : "r"(L_product), "r"(ra) ); diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/mult.h b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/mult.h index eac2004..c89a94e 100644 --- a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/mult.h +++ b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/mult.h @@ -1,5 +1,5 @@ /* ------------------------------------------------------------------ - * Copyright (C) 1998-2009 PacketVideo + * Copyright (C) 1998-2010 PacketVideo * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -85,26 +85,7 @@ extern "C" ; GLOBAL FUNCTION DEFINITIONS ; Function Prototype declaration ----------------------------------------------------------------------------*/ -#if defined(PV_ARM_V5) - - __inline Word16 mult(Word16 var1, Word16 var2, Flag *pOverflow) - { - Word32 product; - - OSCL_UNUSED_ARG(pOverflow); - - __asm - { - SMULBB product, var1, var2 - MOV product, product, ASR #15 - CMP product, 0x7FFF - MOVGE product, 0x7FFF - } - - return ((Word16) product); - } - -#elif defined(PV_ARM_GCC_V5) +#if ((PV_CPU_ARCH_VERSION >=5) && (PV_COMPILER == EPV_ARM_GNUC)) __inline Word16 mult(Word16 var1, Word16 var2, Flag *pOverflow) { diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/norm_l.h b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/norm_l.h index faea591..288b6c7 100644 --- a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/norm_l.h +++ b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/norm_l.h @@ -1,5 +1,5 @@ /* ------------------------------------------------------------------ - * Copyright (C) 1998-2009 PacketVideo + * Copyright (C) 1998-2010 PacketVideo * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -86,29 +86,9 @@ extern "C" ; GLOBAL FUNCTION DEFINITIONS ; Function Prototype declaration ----------------------------------------------------------------------------*/ -#if !( defined(PV_ARM_V5) || defined(PV_ARM_GCC_V5) ) - /* C EQUIVALENT */ - OSCL_IMPORT_REF Word16 norm_l(Word32 L_var1); - -#elif defined(PV_ARM_V5) - - __inline Word16 norm_l(Word32 L_var1) - { - register Word32 var_out = 0; - - __asm - { - CMP L_var1, #0 - EORNE L_var1, L_var1, L_var1, LSL #1 - CLZNE var_out, L_var1 - } - - return ((Word16)var_out); - } - -#elif defined(PV_ARM_GCC_V5) +#if ((PV_CPU_ARCH_VERSION >=5) && (PV_COMPILER == EPV_ARM_GNUC)) static inline Word16 norm_l(Word32 L_var1) { register Word32 var_out = 0; @@ -116,7 +96,7 @@ extern "C" if (L_var1) { ra ^= (ra << 1); - asm volatile( + __asm__ volatile( "clz %0, %1" : "=r"(var_out) : "r"(ra) @@ -124,6 +104,9 @@ extern "C" } return (var_out); } +#else + /* C EQUIVALENT */ + OSCL_IMPORT_REF Word16 norm_l(Word32 L_var1); #endif /*---------------------------------------------------------------------------- @@ -134,5 +117,3 @@ extern "C" #endif #endif - - diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/norm_s.h b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/norm_s.h index 955903a..7847f34 100644 --- a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/norm_s.h +++ b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/norm_s.h @@ -1,5 +1,5 @@ /* ------------------------------------------------------------------ - * Copyright (C) 1998-2009 PacketVideo + * Copyright (C) 1998-2010 PacketVideo * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -86,31 +86,9 @@ extern "C" ; GLOBAL FUNCTION DEFINITIONS ; Function Prototype declaration ----------------------------------------------------------------------------*/ -#if !( defined(PV_ARM_V5) || defined(PV_ARM_GCC_V5) ) - /* C EQUIVALENT */ - - OSCL_IMPORT_REF Word16 norm_s(Word16 var1); - -#elif defined(PV_ARM_V5) - - __inline Word16 norm_s(Word16 var) - { - register Word32 var_out = 0; - Word32 var1 = var << 16; - - __asm - { - CMP var1, #0 - EORNE var1, var1, var1, LSL #1 - CLZNE var_out, var1 - } - - return ((Word16)var_out); - } - -#elif defined(PV_ARM_GCC_V5) +#if ((PV_CPU_ARCH_VERSION >=5) && (PV_COMPILER == EPV_ARM_GNUC)) static inline Word16 norm_s(Word16 var1) { register Word32 var_out = 0; @@ -118,7 +96,7 @@ extern "C" if (ra) { ra ^= (ra << 1); - asm volatile( + __asm__ volatile( "clz %0, %1" : "=r"(var_out) : "r"(ra) @@ -126,7 +104,9 @@ extern "C" } return (var_out); } - +#else + /*C EQUIVALENT */ + OSCL_IMPORT_REF Word16 norm_s(Word16 var1); #endif /*---------------------------------------------------------------------------- ; END @@ -136,5 +116,3 @@ extern "C" #endif #endif - - diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/typedef.h b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/typedef.h index ee4d732..3cf16d5 100644 --- a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/typedef.h +++ b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/typedef.h @@ -1,5 +1,5 @@ /* ------------------------------------------------------------------ - * Copyright (C) 1998-2009 PacketVideo + * Copyright (C) 1998-2010 PacketVideo * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -40,6 +40,7 @@ terms listed above has been obtained from the copyright holder. * ******************************************************************************** */ +#include "oscl_base_macros.h"// has integer values of PV_COMPILER #ifndef typedef_h #define typedef_h "$Id $" diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/add.cpp b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/add.cpp index 8085ac2..0a1182b 100644 --- a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/add.cpp +++ b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/add.cpp @@ -158,7 +158,7 @@ OSCL_EXPORT_REF Word16 add_16(Word16 var1, Word16 var2, Flag *pOverflow) *pOverflow = 1; sum = MAX_16; } - else if (sum < (Word32) 0xffff8000L) + else if (sum < (Word32) - 32768) { *pOverflow = 1; sum = MIN_16; diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/az_lsp.cpp b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/az_lsp.cpp index 6f6bf4d..7711ac9 100644 --- a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/az_lsp.cpp +++ b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/az_lsp.cpp @@ -240,7 +240,7 @@ static Word16 Chebps(Word16 x, t0 += (Word32) * (p_f) << 13; - if ((UWord32)(t0 - 0xfe000000L) < (UWord32)0x03ffffffL) + if ((UWord32)(t0 + 33554432) < 67108863) { cheb = (Word16)(t0 >> 10); } diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/bytesused.cpp b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/bytesused.cpp deleted file mode 100644 index 4893542..0000000 --- a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/bytesused.cpp +++ /dev/null @@ -1,171 +0,0 @@ -/* ------------------------------------------------------------------ - * Copyright (C) 1998-2009 PacketVideo - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. - * See the License for the specific language governing permissions - * and limitations under the License. - * ------------------------------------------------------------------- - */ -/**************************************************************************************** -Portions of this file are derived from the following 3GPP standard: - - 3GPP TS 26.073 - ANSI-C code for the Adaptive Multi-Rate (AMR) speech codec - Available from http://www.3gpp.org - -(C) 2004, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TTA, TTC) -Permission to distribute, modify and use this file under the standard license -terms listed above has been obtained from the copyright holder. -****************************************************************************************/ -/* - - Filename: bytesused.cpp - ------------------------------------------------------------------------------- - INPUT AND OUTPUT DEFINITIONS - - Inputs: - None - - Local Stores/Buffers/Pointers Needed: - None - - Global Stores/Buffers/Pointers Needed: - None - - Outputs: - None - - Pointers and Buffers Modified: - None - - Local Stores Modified: - None - - Global Stores Modified: - None - ------------------------------------------------------------------------------- - FUNCTION DESCRIPTION - - This function creates a table called BytesUsed that holds the value that - describes the number of bytes required to hold one frame worth of data in - the WMF (non-IF2) frame format. Each table entry is the sum of the frame - type byte and the number of bytes used up by the core speech data for each - 3GPP frame type. - ------------------------------------------------------------------------------- - REQUIREMENTS - - None - ------------------------------------------------------------------------------- - REFERENCES - - [1] "AMR Speech Codec Frame Structure", 3GPP TS 26.101 version 4.1.0 - Release 4, June 2001, page 13. - ------------------------------------------------------------------------------- - PSEUDO-CODE - - ------------------------------------------------------------------------------- -*/ - - -/*---------------------------------------------------------------------------- -; INCLUDES -----------------------------------------------------------------------------*/ -#include "typedef.h" - -/*--------------------------------------------------------------------------*/ -#ifdef __cplusplus -extern "C" -{ -#endif - - /*---------------------------------------------------------------------------- - ; MACROS - ; Define module specific macros here - ----------------------------------------------------------------------------*/ - - - /*---------------------------------------------------------------------------- - ; DEFINES - ; Include all pre-processor statements here. Include conditional - ; compile variables also. - ----------------------------------------------------------------------------*/ - - /*---------------------------------------------------------------------------- - ; LOCAL FUNCTION DEFINITIONS - ; Function Prototype declaration - ----------------------------------------------------------------------------*/ - - - /*---------------------------------------------------------------------------- - ; LOCAL STORE/BUFFER/POINTER DEFINITIONS - ; Variable declaration - defined here and used outside this module - ----------------------------------------------------------------------------*/ - const short BytesUsed[16] = - { - 13, /* 4.75 */ - 14, /* 5.15 */ - 16, /* 5.90 */ - 18, /* 6.70 */ - 20, /* 7.40 */ - 21, /* 7.95 */ - 27, /* 10.2 */ - 32, /* 12.2 */ - 6, /* GsmAmr comfort noise */ - 7, /* Gsm-Efr comfort noise */ - 6, /* IS-641 comfort noise */ - 6, /* Pdc-Efr comfort noise */ - 0, /* future use */ - 0, /* future use */ - 0, /* future use */ - 1 /* No transmission */ - }; - /*---------------------------------------------------------------------------- - ; EXTERNAL FUNCTION REFERENCES - ; Declare functions defined elsewhere and referenced in this module - ----------------------------------------------------------------------------*/ - - - /*---------------------------------------------------------------------------- - ; EXTERNAL GLOBAL STORE/BUFFER/POINTER REFERENCES - ; Declare variables used in this module but defined elsewhere - ----------------------------------------------------------------------------*/ - - - /*--------------------------------------------------------------------------*/ -#ifdef __cplusplus -} -#endif - -/*---------------------------------------------------------------------------- -; FUNCTION CODE -----------------------------------------------------------------------------*/ - -/*---------------------------------------------------------------------------- -; Define all local variables -----------------------------------------------------------------------------*/ - - -/*---------------------------------------------------------------------------- -; Function body here -----------------------------------------------------------------------------*/ - - -/*---------------------------------------------------------------------------- -; Return nothing or data or data pointer -----------------------------------------------------------------------------*/ - diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/gc_pred.cpp b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/gc_pred.cpp index 9179fe4..71519e9 100644 --- a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/gc_pred.cpp +++ b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/gc_pred.cpp @@ -479,7 +479,7 @@ OSCL_EXPORT_REF void gc_pred( ener_code <<= 4; - if (ener_code < 0) /* Check for saturation */ + if ((ener_code >> 31)) /* Check for saturation */ { ener_code = MAX_32; } @@ -648,7 +648,7 @@ OSCL_EXPORT_REF void gc_pred( *pOverflow = 1; L_tmp = MAX_32; } - else if (L_tmp < (Word32) 0xffe00000L) + else if (L_tmp < -2097152) { *pOverflow = 1; L_tmp = MIN_32; diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/mult_r.cpp b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/mult_r.cpp index 6ee82b2..003afc7 100644 --- a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/mult_r.cpp +++ b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/mult_r.cpp @@ -173,7 +173,7 @@ OSCL_EXPORT_REF Word16 mult_r(Word16 var1, Word16 var2, Flag *pOverflow) *pOverflow = 1; L_product_arr = MAX_16; } - else if (L_product_arr < (Word32) 0xffff8000L) + else if (L_product_arr < (Word32) - 32768) { *pOverflow = 1; L_product_arr = MIN_16; diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/norm_l.cpp b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/norm_l.cpp index e690246..dc4ca72 100644 --- a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/norm_l.cpp +++ b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/norm_l.cpp @@ -1,5 +1,5 @@ /* ------------------------------------------------------------------ - * Copyright (C) 1998-2009 PacketVideo + * Copyright (C) 1998-2010 PacketVideo * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -152,7 +152,7 @@ Word16 norm_l (Word32 L_var1) /*---------------------------------------------------------------------------- ; FUNCTION CODE ----------------------------------------------------------------------------*/ -#if !( defined(PV_ARM_V5) || defined(PV_ARM_GCC_V5) ) +#if !((PV_CPU_ARCH_VERSION >=5) && ((PV_COMPILER == EPV_ARM_GNUC) || (PV_COMPILER == EPV_ARM_RVCT))) OSCL_EXPORT_REF Word16 norm_l(register Word32 L_var1) { /*---------------------------------------------------------------------------- diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/norm_s.cpp b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/norm_s.cpp index 892d06e..4fdc6d2 100644 --- a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/norm_s.cpp +++ b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/norm_s.cpp @@ -1,5 +1,5 @@ /* ------------------------------------------------------------------ - * Copyright (C) 1998-2009 PacketVideo + * Copyright (C) 1998-2010 PacketVideo * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -153,7 +153,7 @@ Word16 norm_s (Word16 var1) /*---------------------------------------------------------------------------- ; FUNCTION CODE ----------------------------------------------------------------------------*/ -#if !( defined(PV_ARM_V5) || defined(PV_ARM_GCC_V5) ) +#if !((PV_CPU_ARCH_VERSION >=5) && ((PV_COMPILER == EPV_ARM_GNUC) || (PV_COMPILER == EPV_ARM_RVCT))) OSCL_EXPORT_REF Word16 norm_s(register Word16 var1) { diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/qua_gain_tbl.cpp b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/qua_gain_tbl.cpp index c0470b7..116a1b4 100644 --- a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/qua_gain_tbl.cpp +++ b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/qua_gain_tbl.cpp @@ -83,6 +83,7 @@ extern "C" /* table used in 'high' rates: MR67 MR74 */ + extern const Word16 table_gain_highrates[]; const Word16 table_gain_highrates[VQ_SIZE_HIGHRATES*4] = { @@ -227,6 +228,7 @@ extern "C" /* table used in 'low' rates: MR475, MR515, MR59 */ + extern const Word16 table_gain_lowrates[]; const Word16 table_gain_lowrates[VQ_SIZE_LOWRATES*4] = { /*g_pit, g_fac, qua_ener_MR122, qua_ener */ diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/sub.cpp b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/sub.cpp index ed9fccc..479c40e 100644 --- a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/sub.cpp +++ b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/sub.cpp @@ -157,7 +157,7 @@ OSCL_EXPORT_REF Word16 sub(Word16 var1, Word16 var2, Flag *pOverflow) /* to conserve MIPS, i.e., var_out = saturate (diff) */ - if ((UWord32)(diff - 0xFFFF8000L) > 0x000FFFF) + if ((UWord32)(diff + 32768) > 0x000FFFF) { if (diff > (Word32) 0x0007FFFL) { diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/syn_filt.cpp b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/syn_filt.cpp index 221f4dc..e84ee66 100644 --- a/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/syn_filt.cpp +++ b/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/syn_filt.cpp @@ -225,7 +225,7 @@ OSCL_EXPORT_REF void Syn_filt( } /* check for overflow on s1 */ - if ((UWord32)(s1 - 0xf8000000L) < 0x0fffffffL) + if ((UWord32)(s1 + 134217728) < 0x0fffffffL) { temp = (Word16)(s1 >> 12); } @@ -246,7 +246,7 @@ OSCL_EXPORT_REF void Syn_filt( p_yy1 = yy; /* check for overflow on s2 */ - if ((UWord32)(s2 - 0xf8000000L) < 0x0fffffffL) + if ((UWord32)(s2 + 134217728) < 0x0fffffffL) { temp = (Word16)(s2 >> 12); } @@ -283,7 +283,7 @@ OSCL_EXPORT_REF void Syn_filt( s1 = amrnb_fxp_msu_16_by_16bb((Word32) * (p_a++), (Word32) * (p_yy1), s1); } - if ((UWord32)(s1 - 0xf8000000L) < 0x0fffffffL) + if ((UWord32)(s1 + 134217728) < 0x0fffffffL) { temp = (Word16)(s1 >> 12); } @@ -301,7 +301,7 @@ OSCL_EXPORT_REF void Syn_filt( *(p_y++) = temp; p_yy1 = p_y; - if ((UWord32)(s2 - 0xf8000000L) < 0x0fffffffL) + if ((UWord32)(s2 + 134217728) < 0x0fffffffL) { *(p_y++) = (Word16)(s2 >> 12); } diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_nb/dec/Android.mk b/opencore/codecs_v2/audio/gsm_amr/amr_nb/dec/Android.mk index a3bd037..48ecacb 100644 --- a/opencore/codecs_v2/audio/gsm_amr/amr_nb/dec/Android.mk +++ b/opencore/codecs_v2/audio/gsm_amr/amr_nb/dec/Android.mk @@ -43,7 +43,6 @@ LOCAL_SRC_FILES := \ LOCAL_MODULE := libpvdecoder_gsmamr LOCAL_CFLAGS := $(PV_CFLAGS) - LOCAL_ARM_MODE := arm LOCAL_STATIC_LIBRARIES := diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_nb/dec/src/agc.cpp b/opencore/codecs_v2/audio/gsm_amr/amr_nb/dec/src/agc.cpp index c06c24a..9f5525d 100644 --- a/opencore/codecs_v2/audio/gsm_amr/amr_nb/dec/src/agc.cpp +++ b/opencore/codecs_v2/audio/gsm_amr/amr_nb/dec/src/agc.cpp @@ -904,7 +904,7 @@ void agc2( { s = MAX_32; } - else if (s < (Word32) 0xFF000000L) + else if (s < (Word32) - 16777216) { s = MIN_32; } @@ -920,7 +920,7 @@ void agc2( { L_temp = MAX_32; } - else if (s < (Word32) 0xFFC00000L) + else if (s < (Word32) - 4194304) { L_temp = MIN_32; } @@ -940,7 +940,7 @@ void agc2( { sig_out[i] = MAX_16; } - else if (L_temp < (Word32) 0xF0000000L) + else if (L_temp < (Word32) - 268435456) { sig_out[i] = MIN_16; } diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_nb/dec/src/ph_disp.cpp b/opencore/codecs_v2/audio/gsm_amr/amr_nb/dec/src/ph_disp.cpp index 30631f4..22fe3b5 100644 --- a/opencore/codecs_v2/audio/gsm_amr/amr_nb/dec/src/ph_disp.cpp +++ b/opencore/codecs_v2/audio/gsm_amr/amr_nb/dec/src/ph_disp.cpp @@ -625,7 +625,7 @@ void ph_disp( *pOverflow = 1; L_temp = MAX_32; } - else if (L_temp < (Word32) 0xe0000000L) + else if (L_temp < (Word32) - 536870912) { *pOverflow = 1; L_temp = MIN_32; diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_nb/dec/src/post_pro.cpp b/opencore/codecs_v2/audio/gsm_amr/amr_nb/dec/src/post_pro.cpp index 7bf5021..3e3f4e1 100644 --- a/opencore/codecs_v2/audio/gsm_amr/amr_nb/dec/src/post_pro.cpp +++ b/opencore/codecs_v2/audio/gsm_amr/amr_nb/dec/src/post_pro.cpp @@ -1,5 +1,5 @@ /* ------------------------------------------------------------------ - * Copyright (C) 1998-2009 PacketVideo + * Copyright (C) 1998-2010 PacketVideo * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -296,7 +296,8 @@ void Post_Process( L_tmp += ((Word32) st->x0) * c_b0; L_tmp += ((Word32) st->x1) * c_b1; L_tmp += ((Word32) x2) * c_b2; - L_tmp <<= 3; + + L_tmp = L_shl(L_tmp, 3, pOverflow); /* Multiplication by two of output speech with saturation. */ diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_nb/enc/Android.mk b/opencore/codecs_v2/audio/gsm_amr/amr_nb/enc/Android.mk index 100268e..a40eaf3 100644 --- a/opencore/codecs_v2/audio/gsm_amr/amr_nb/enc/Android.mk +++ b/opencore/codecs_v2/audio/gsm_amr/amr_nb/enc/Android.mk @@ -68,7 +68,6 @@ LOCAL_SRC_FILES := \ LOCAL_MODULE := libpvencoder_gsmamr LOCAL_CFLAGS := $(PV_CFLAGS) - LOCAL_ARM_MODE := arm LOCAL_STATIC_LIBRARIES := diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_wb/dec/Android.mk b/opencore/codecs_v2/audio/gsm_amr/amr_wb/dec/Android.mk index e096ff8..21d9ddb 100644 --- a/opencore/codecs_v2/audio/gsm_amr/amr_wb/dec/Android.mk +++ b/opencore/codecs_v2/audio/gsm_amr/amr_wb/dec/Android.mk @@ -47,7 +47,6 @@ LOCAL_SRC_FILES := \ LOCAL_MODULE := libpvamrwbdecoder LOCAL_CFLAGS := $(PV_CFLAGS) - LOCAL_ARM_MODE := arm LOCAL_STATIC_LIBRARIES := diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_wb/dec/src/isp_az.cpp b/opencore/codecs_v2/audio/gsm_amr/amr_wb/dec/src/isp_az.cpp index dbcf2f3..e353f31 100644 --- a/opencore/codecs_v2/audio/gsm_amr/amr_wb/dec/src/isp_az.cpp +++ b/opencore/codecs_v2/audio/gsm_amr/amr_wb/dec/src/isp_az.cpp @@ -1,5 +1,5 @@ /* ------------------------------------------------------------------ - * Copyright (C) 1998-2009 PacketVideo + * Copyright (C) 1998-2010 PacketVideo * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -265,11 +265,7 @@ void Isp_Az( } /* a[NC] = 0.5*f1[NC]*(1.0 + isp[M-1]); */ - - t0 = (int32)(((int64)f1[nc] * isp[m - 1]) >> 16) << 1; - - t0 = add_int32(f1[nc], t0); /* from Q23 to Q12 and * 0.5 */ diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_wb/dec/src/normalize_amr_wb.cpp b/opencore/codecs_v2/audio/gsm_amr/amr_wb/dec/src/normalize_amr_wb.cpp index 25dcf13..bdca939 100644 --- a/opencore/codecs_v2/audio/gsm_amr/amr_wb/dec/src/normalize_amr_wb.cpp +++ b/opencore/codecs_v2/audio/gsm_amr/amr_wb/dec/src/normalize_amr_wb.cpp @@ -1,5 +1,5 @@ /* ------------------------------------------------------------------ - * Copyright (C) 1998-2009 PacketVideo + * Copyright (C) 1998-2010 PacketVideo * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -104,9 +104,7 @@ Returns ; FUNCTION CODE ----------------------------------------------------------------------------*/ -#if defined(PV_ARM_V5) -#elif defined(PV_ARM_GCC_V5) - +#if ((PV_CPU_ARCH_VERSION >=5) && ((PV_COMPILER == EPV_ARM_RVCT) || (PV_COMPILER == EPV_ARM_GNUC))) /* function is inlined in header file */ diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_wb/dec/src/normalize_amr_wb.h b/opencore/codecs_v2/audio/gsm_amr/amr_wb/dec/src/normalize_amr_wb.h index 7c5fe22..73ccb71 100644 --- a/opencore/codecs_v2/audio/gsm_amr/amr_wb/dec/src/normalize_amr_wb.h +++ b/opencore/codecs_v2/audio/gsm_amr/amr_wb/dec/src/normalize_amr_wb.h @@ -1,5 +1,5 @@ /* ------------------------------------------------------------------ - * Copyright (C) 1998-2009 PacketVideo + * Copyright (C) 1998-2010 PacketVideo * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -48,7 +48,6 @@ terms listed above has been obtained from the copyright holder. ----------------------------------------------------------------------------*/ #include "pv_amr_wb_type_defs.h" - /*---------------------------------------------------------------------------- ; MACROS ; Define module specific macros here @@ -62,21 +61,7 @@ terms listed above has been obtained from the copyright holder. ; DEFINES AND SIMPLE TYPEDEF'S ----------------------------------------------------------------------------*/ -#if defined(PV_ARM_V5) - -__inline int16 normalize_amr_wb(int32 x) -{ - int32 y; - __asm - { - clz y, x; - sub y, y, #1 - } - return (y); -} - - -#elif defined(PV_ARM_GCC_V5) +#if ((PV_CPU_ARCH_VERSION >=5) && (PV_COMPILER == EPV_ARM_GNUC)) __inline int16 normalize_amr_wb(int32 x) diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_wb/dec/src/pvamrwbdecoder_basic_op.h b/opencore/codecs_v2/audio/gsm_amr/amr_wb/dec/src/pvamrwbdecoder_basic_op.h index 7b9e900..86f70b3 100644 --- a/opencore/codecs_v2/audio/gsm_amr/amr_wb/dec/src/pvamrwbdecoder_basic_op.h +++ b/opencore/codecs_v2/audio/gsm_amr/amr_wb/dec/src/pvamrwbdecoder_basic_op.h @@ -1,5 +1,5 @@ /* ------------------------------------------------------------------ - * Copyright (C) 1998-2009 PacketVideo + * Copyright (C) 1998-2010 PacketVideo * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -75,7 +75,7 @@ terms listed above has been obtained from the copyright holder. range : 0x8000 <= var_out <= 0x7fff. ----------------------------------------------------------------------------*/ -static inline int16 negate_int16(int16 var1) +static inline int16 negate_int16(int16 var1) { return (((var1 == MIN_16) ? MAX_16 : -var1)); } @@ -105,7 +105,7 @@ static inline int16 negate_int16(int16 var1) range : 0x8000 <= var_out <= 0x7fff. ----------------------------------------------------------------------------*/ -static inline int16 shl_int16(int16 var1, int16 var2) +static inline int16 shl_int16(int16 var1, int16 var2) { int16 var_out; @@ -149,7 +149,7 @@ static inline int16 shl_int16(int16 var1, int16 var2) ----------------------------------------------------------------------------*/ -static inline int32 shl_int32(int32 L_var1, int16 var2) +static inline int32 shl_int32(int32 L_var1, int16 var2) { int32 L_var_out; @@ -193,7 +193,7 @@ static inline int32 shl_int32(int32 L_var1, int16 var2) ----------------------------------------------------------------------------*/ -static inline int32 shr_int32(int32 L_var1, int16 var2) +static inline int32 shr_int32(int32 L_var1, int16 var2) { int32 L_var_out; @@ -220,11 +220,7 @@ static inline int32 shr_int32(int32 L_var1, int16 var2) -#if defined(PV_ARM_V5) - -#include "pvamrwbdecoder_basic_op_armv5.h" - -#elif defined(PV_ARM_GCC_V5) +#if ((PV_CPU_ARCH_VERSION >=5) && (PV_COMPILER == EPV_ARM_GNUC)) #include "pvamrwbdecoder_basic_op_gcc_armv5.h" diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_wb/dec/src/pvamrwbdecoder_basic_op_cequivalent.h b/opencore/codecs_v2/audio/gsm_amr/amr_wb/dec/src/pvamrwbdecoder_basic_op_cequivalent.h index 7a34d89..8b9faaa 100644 --- a/opencore/codecs_v2/audio/gsm_amr/amr_wb/dec/src/pvamrwbdecoder_basic_op_cequivalent.h +++ b/opencore/codecs_v2/audio/gsm_amr/amr_wb/dec/src/pvamrwbdecoder_basic_op_cequivalent.h @@ -1,5 +1,5 @@ /* ------------------------------------------------------------------ - * Copyright (C) 1998-2009 PacketVideo + * Copyright (C) 1998-2010 PacketVideo * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -522,7 +522,6 @@ extern "C" static inline int32 fxp_mul32_by_16b(int32 L_var1, const int32 L_var2) { - int32 L_mul = (int32)(((int64)L_var1 * (L_var2 << 16)) >> 32); return L_mul; diff --git a/opencore/codecs_v2/audio/gsm_amr/amr_wb/dec/src/pvamrwbdecoder_basic_op_gcc_armv5.h b/opencore/codecs_v2/audio/gsm_amr/amr_wb/dec/src/pvamrwbdecoder_basic_op_gcc_armv5.h index de3baba..c2c9f36 100644 --- a/opencore/codecs_v2/audio/gsm_amr/amr_wb/dec/src/pvamrwbdecoder_basic_op_gcc_armv5.h +++ b/opencore/codecs_v2/audio/gsm_amr/amr_wb/dec/src/pvamrwbdecoder_basic_op_gcc_armv5.h @@ -1,5 +1,5 @@ /* ------------------------------------------------------------------ - * Copyright (C) 1998-2009 PacketVideo + * Copyright (C) 1998-2010 PacketVideo * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -42,14 +42,13 @@ terms listed above has been obtained from the copyright holder. #ifndef PVAMRWBDECODER_BASIC_OP_GCC_ARMV5_H #define PVAMRWBDECODER_BASIC_OP_GCC_ARMV5_H + #ifdef __cplusplus extern "C" { #endif -#if (defined(PV_ARM_GCC_V5)||defined(PV_ARM_GCC_V4)) - static inline int16 sub_int16(int16 var1, int16 var2) { register int32 L_var_out; @@ -300,7 +299,6 @@ extern "C" #define fxp_mul32_by_16b( a, b) fxp_mul32_by_16( a, b) -#endif #ifdef __cplusplus } diff --git a/opencore/codecs_v2/audio/gsm_amr/common/dec/Android.mk b/opencore/codecs_v2/audio/gsm_amr/common/dec/Android.mk index 2acf59e..3ba1c63 100644 --- a/opencore/codecs_v2/audio/gsm_amr/common/dec/Android.mk +++ b/opencore/codecs_v2/audio/gsm_amr/common/dec/Android.mk @@ -9,7 +9,6 @@ LOCAL_SRC_FILES := \ LOCAL_CFLAGS := $(PV_CFLAGS) -LOCAL_ARM_MODE := arm LOCAL_STATIC_LIBRARIES := diff --git a/opencore/codecs_v2/audio/gsm_amr/common/dec/include/pvgsmamrdecoderinterface.h b/opencore/codecs_v2/audio/gsm_amr/common/dec/include/pvgsmamrdecoderinterface.h index d3e41f8..2d9b9df 100644 --- a/opencore/codecs_v2/audio/gsm_amr/common/dec/include/pvgsmamrdecoderinterface.h +++ b/opencore/codecs_v2/audio/gsm_amr/common/dec/include/pvgsmamrdecoderinterface.h @@ -188,6 +188,7 @@ typedef struct tPVAmrDecoderExternal class CDecoder_AMRInterface { public: + virtual ~CDecoder_AMRInterface() {}; OSCL_IMPORT_REF virtual int32 StartL(tPVAmrDecoderExternal * pExt, bool aAllocateInputBuffer = false, bool aAllocateOutputBuffer = false) = 0; diff --git a/oscl/oscl_base_macros.h b/oscl/oscl_base_macros.h new file mode 100644 index 0000000..7fadf2e --- /dev/null +++ b/oscl/oscl_base_macros.h @@ -0,0 +1,25 @@ +/* ------------------------------------------------------------------ + * Copyright (C) 2009 Martin Storsjo + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. + * See the License for the specific language governing permissions + * and limitations under the License. + * ------------------------------------------------------------------- + */ + +#ifndef OSCL_BASE_MACROS_H +#define OSCL_BASE_MACROS_H + +#define EPV_ARM_GNUC 1 +#define EPV_ARM_RVCT 2 + +#endif diff --git a/packaging/opencore-amr.manifest b/packaging/opencore-amr.manifest deleted file mode 100644 index 017d22d..0000000 --- a/packaging/opencore-amr.manifest +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/packaging/opencore-amr.spec b/packaging/opencore-amr.spec index 1e7ef6c..544354f 100644 --- a/packaging/opencore-amr.spec +++ b/packaging/opencore-amr.spec @@ -1,17 +1,11 @@ Name: opencore-amr Summary: opencore AMRNB dev package -Version: 0.1.2 -Release: 2 +Version: 0.1.3 +Release: 0 Group: libdevel License: Apache-2.0 Source0: %{name}-%{version}.tar.gz -Source1001: packaging/opencore-amr.manifest -BuildRequires: pkgconfig(dbus-glib-1) -BuildRequires: pkgconfig(dlog) -BuildRequires: pkgconfig(vconf) -BuildRequires: cmake -BuildRequires: gettext-devel %description opencore AMRNB dev package @@ -29,13 +23,14 @@ opencore AMRNB dev package (Developement) %setup -q %build -cp %{SOURCE1001} . ./autogen.sh ./configure --prefix=/usr --mandir=%{_prefix}/share/man --infodir=%{_prefix}/share/info CFLAGS="$CFLAGS" LDFLAGS="$LDFLAGS" make %{?jobs:-j%jobs} %install rm -rf %{buildroot} +mkdir -p %{buildroot}/usr/share/license +cp LICENSE %{buildroot}/usr/share/license/%{name} %make_install %post @@ -46,17 +41,13 @@ rm -rf %{buildroot} %files %manifest opencore-amr.manifest %defattr(-,root,root,-) -%{_libdir}/libopencore-amrnb.so.0 -%{_libdir}/libopencore-amrnb.so.0.0.2 -%{_libdir}/libopencore-amrwb.so.0 -%{_libdir}/libopencore-amrwb.so.0.0.2 +%{_libdir}/libopencore-amrnb.so* +%{_libdir}/libopencore-amrwb.so* +%{_datadir}/license/%{name} %files devel -%manifest opencore-amr.manifest %defattr(-,root,root,-) %{_includedir}/opencore-amrnb/*.h %{_includedir}/opencore-amrwb/*.h -%{_libdir}/libopencore-amrnb.so -%{_libdir}/libopencore-amrwb.so %{_libdir}/pkgconfig/opencore-amrnb.pc %{_libdir}/pkgconfig/opencore-amrwb.pc diff --git a/test/Makefile.alt b/test/Makefile.alt deleted file mode 100644 index afab10e..0000000 --- a/test/Makefile.alt +++ /dev/null @@ -1,23 +0,0 @@ -CFLAGS = -Wall -pedantic -I../amrnb -I../amrwb -CXXFLAGS = $(CFLAGS) -LDFLAGS = -L../amrnb -L../amrwb - -all: amrnb-dec amrnb-enc amrwb-dec - -amrnb-dec: amrnb-dec.o wav.o - $(CXX) -o $@ $+ $(LDFLAGS) -lopencore-amrnb - -amrnb-enc: amrnb-enc.o - $(CC) -o $@ $+ $(LDFLAGS) -lm -lopencore-amrnb - -amrwb-dec: amrwb-dec.o wav.o - $(CXX) -o $@ $+ $(LDFLAGS) -lopencore-amrwb - -# To check that both libraries can be linked in statically at the same -# time without duplicate symbols -linkboth: linkboth.o - $(CC) -static -o $@ $+ $(LDFLAGS) -lopencore-amrnb -lopencore-amrwb - -clean: - rm -f amrnb-dec amrnb-enc amrwb-dec linkboth *.o out.wav out.amr - diff --git a/test/Makefile.am b/test/Makefile.am index 63e9b3f..a0c4ffa 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -1,23 +1,35 @@ -noinst_PROGRAMS = amrnb-dec$(EXEEXT) amrnb-enc$(EXEEXT) amrwb-dec$(EXEEXT) linkboth$(EXEEXT) - -EXTRA_DIST = Makefile.alt +bin_PROGRAMS = amrwb-dec$(EXEEXT) +noinst_PROGRAMS = linkboth$(EXEEXT) +AM_CFLAGS = + +if AMRNB_DECODER + bin_PROGRAMS += amrnb-dec$(EXEEXT) +else + AM_CFLAGS += -DDISABLE_AMRNB_DECODER +endif +if AMRNB_ENCODER + bin_PROGRAMS += amrnb-enc$(EXEEXT) + noinst_PROGRAMS += amrnb-enc-sine$(EXEEXT) +else + AM_CFLAGS += -DDISABLE_AMRNB_ENCODER +endif INCLUDES = -I$(top_srcdir)/amrnb -I$(top_srcdir)/amrwb -CLEANFILES = out.amr out.wav - amrnb_dec_LDADD = $(top_builddir)/amrnb/libopencore-amrnb.la amrnb_enc_LDADD = $(top_builddir)/amrnb/libopencore-amrnb.la -amrnb_enc_LDFLAGS = -lm +amrnb_enc_sine_LDADD = $(top_builddir)/amrnb/libopencore-amrnb.la +amrnb_enc_sine_LDFLAGS = -lm amrwb_dec_LDADD = $(top_builddir)/amrwb/libopencore-amrwb.la linkboth_LDFLAGS = -static linkboth_LDADD = $(top_builddir)/amrnb/libopencore-amrnb.la $(top_builddir)/amrwb/libopencore-amrwb.la -amrnb_dec_SOURCES = amrnb-dec.cpp wav.cpp -amrnb_enc_SOURCES = amrnb-enc.c -amrwb_dec_SOURCES = amrwb-dec.cpp wav.cpp +amrnb_dec_SOURCES = amrnb-dec.c wavwriter.c +amrnb_enc_SOURCES = amrnb-enc.c wavreader.c +amrnb_enc_sine_SOURCES = amrnb-enc-sine.c +amrwb_dec_SOURCES = amrwb-dec.c wavwriter.c linkboth_SOURCES = linkboth.c -noinst_HEADERS = wav.h +noinst_HEADERS = wavwriter.h wavreader.h diff --git a/test/amrnb-dec.cpp b/test/amrnb-dec.c similarity index 74% rename from test/amrnb-dec.cpp rename to test/amrnb-dec.c index 98a352d..f558392 100644 --- a/test/amrnb-dec.cpp +++ b/test/amrnb-dec.c @@ -19,65 +19,69 @@ #include #include #include -#include "wav.h" -extern "C" { +#include "wavwriter.h" #include -} /* From WmfDecBytesPerFrame in dec_input_format_tab.cpp */ const int sizes[] = { 12, 13, 15, 17, 19, 20, 26, 31, 5, 6, 5, 5, 0, 0, 0, 0 }; int main(int argc, char *argv[]) { - if (argc < 2) { - fprintf(stderr, "%s in.amr\n", argv[0]); + FILE* in; + char header[6]; + int n; + void *wav, *amr; + if (argc < 3) { + fprintf(stderr, "%s in.amr out.wav\n", argv[0]); return 1; } - FILE* in = fopen(argv[1], "rb"); + in = fopen(argv[1], "rb"); if (!in) { perror(argv[1]); return 1; } - char header[6]; - int n = fread(header, 1, 6, in); + n = fread(header, 1, 6, in); if (n != 6 || memcmp(header, "#!AMR\n", 6)) { fprintf(stderr, "Bad header\n"); return 1; } - WavWriter wav("out.wav", 8000, 16, 1); + wav = wav_write_open(argv[2], 8000, 16, 1); + if (!wav) { + fprintf(stderr, "Unable to open %s\n", argv[2]); + return 1; + } - void* amr = Decoder_Interface_init(); - while (true) { - uint8_t buffer[500]; + amr = Decoder_Interface_init(); + while (1) { + uint8_t buffer[500], littleendian[320], *ptr; + int size, i; + int16_t outbuffer[160]; /* Read the mode byte */ n = fread(buffer, 1, 1, in); if (n <= 0) break; /* Find the packet size */ - int size = sizes[(buffer[0] >> 3) & 0x0f]; - if (size <= 0) - break; + size = sizes[(buffer[0] >> 3) & 0x0f]; n = fread(buffer + 1, 1, size, in); if (n != size) break; /* Decode the packet */ - int16_t outbuffer[160]; Decoder_Interface_Decode(amr, buffer, outbuffer, 0); /* Convert to little endian and write to wav */ - uint8_t littleendian[320]; - uint8_t* ptr = littleendian; - for (int i = 0; i < 160; i++) { + ptr = littleendian; + for (i = 0; i < 160; i++) { *ptr++ = (outbuffer[i] >> 0) & 0xff; *ptr++ = (outbuffer[i] >> 8) & 0xff; } - wav.writeData(littleendian, 320); + wav_write_data(wav, littleendian, 320); } fclose(in); Decoder_Interface_exit(amr); + wav_write_close(wav); return 0; } diff --git a/test/amrnb-enc-sine.c b/test/amrnb-enc-sine.c new file mode 100644 index 0000000..51c04b2 --- /dev/null +++ b/test/amrnb-enc-sine.c @@ -0,0 +1,59 @@ +/* ------------------------------------------------------------------ + * Copyright (C) 2009 Martin Storsjo + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. + * See the License for the specific language governing permissions + * and limitations under the License. + * ------------------------------------------------------------------- + */ + +#include +#include +#include +#include + +int main(int argc, char *argv[]) { + int i, j; + void* amr; + FILE* out; + int sample_pos = 0; + + if (argc < 2) { + fprintf(stderr, "%s out.amr\n", argv[0]); + return 1; + } + + amr = Encoder_Interface_init(0); + out = fopen(argv[1], "wb"); + if (!out) { + perror(argv[1]); + return 1; + } + + fwrite("#!AMR\n", 1, 6, out); + for (i = 0; i < 1000; i++) { + short buf[160]; + uint8_t outbuf[500]; + int n; + for (j = 0; j < 160; j++) { + buf[j] = 32767*sin(440*2*3.141592654*sample_pos/8000); + sample_pos++; + } + n = Encoder_Interface_Encode(amr, MR475, buf, outbuf, 0); + fwrite(outbuf, 1, n, out); + } + fclose(out); + Encoder_Interface_exit(amr); + + return 0; +} + diff --git a/test/amrnb-enc.c b/test/amrnb-enc.c index 9a16098..6fc5d40 100644 --- a/test/amrnb-enc.c +++ b/test/amrnb-enc.c @@ -18,32 +18,127 @@ #include #include -#include #include +#include +#include +#include "wavreader.h" + +void usage(const char* name) { + fprintf(stderr, "%s [-r bitrate] [-d] in.wav out.amr\n", name); +} + +enum Mode findMode(const char* str) { + struct { + enum Mode mode; + int rate; + } modes[] = { + { MR475, 4750 }, + { MR515, 5150 }, + { MR59, 5900 }, + { MR67, 6700 }, + { MR74, 7400 }, + { MR795, 7950 }, + { MR102, 10200 }, + { MR122, 12200 } + }; + int rate = atoi(str); + int closest = -1; + int closestdiff = 0; + unsigned int i; + for (i = 0; i < sizeof(modes)/sizeof(modes[0]); i++) { + if (modes[i].rate == rate) + return modes[i].mode; + if (closest < 0 || closestdiff > abs(modes[i].rate - rate)) { + closest = i; + closestdiff = abs(modes[i].rate - rate); + } + } + fprintf(stderr, "Using bitrate %d\n", modes[closest].rate); + return modes[closest].mode; +} int main(int argc, char *argv[]) { - int i, j; - void* amr; - FILE* out; - int sample_pos = 0; + enum Mode mode = MR122; + int ch, dtx = 0; + const char *infile, *outfile; + FILE *out; + void *wav, *amr; + int format, sampleRate, channels, bitsPerSample; + int inputSize; + uint8_t* inputBuf; + while ((ch = getopt(argc, argv, "r:d")) != -1) { + switch (ch) { + case 'r': + mode = findMode(optarg); + break; + case 'd': + dtx = 1; + break; + case '?': + default: + usage(argv[0]); + return 1; + } + } + if (argc - optind < 2) { + usage(argv[0]); + return 1; + } + infile = argv[optind]; + outfile = argv[optind + 1]; - amr = Encoder_Interface_init(0); - out = fopen("out.amr", "wb"); + wav = wav_read_open(infile); + if (!wav) { + fprintf(stderr, "Unable to open wav file %s\n", infile); + return 1; + } + if (!wav_get_header(wav, &format, &channels, &sampleRate, &bitsPerSample, NULL)) { + fprintf(stderr, "Bad wav file %s\n", infile); + return 1; + } + if (format != 1) { + fprintf(stderr, "Unsupported WAV format %d\n", format); + return 1; + } + if (bitsPerSample != 16) { + fprintf(stderr, "Unsupported WAV sample depth %d\n", bitsPerSample); + return 1; + } + if (channels != 1) + fprintf(stderr, "Warning, only compressing one audio channel\n"); + if (sampleRate != 8000) + fprintf(stderr, "Warning, AMR-NB uses 8000 Hz sample rate (WAV file has %d Hz)\n", sampleRate); + inputSize = channels*2*160; + inputBuf = (uint8_t*) malloc(inputSize); + + amr = Encoder_Interface_init(dtx); + out = fopen(outfile, "wb"); + if (!out) { + perror(outfile); + return 1; + } fwrite("#!AMR\n", 1, 6, out); - for (i = 0; i < 1000; i++) { + while (1) { short buf[160]; uint8_t outbuf[500]; - int n; - for (j = 0; j < 160; j++) { - buf[j] = 32767*sin(440*2*3.141592654*sample_pos/8000); - sample_pos++; + int read, i, n; + read = wav_read_data(wav, inputBuf, inputSize); + read /= channels; + read /= 2; + if (read < 160) + break; + for (i = 0; i < 160; i++) { + const uint8_t* in = &inputBuf[2*channels*i]; + buf[i] = in[0] | (in[1] << 8); } - n = Encoder_Interface_Encode(amr, MR475, buf, outbuf, 0); + n = Encoder_Interface_Encode(amr, mode, buf, outbuf, 0); fwrite(outbuf, 1, n, out); } + free(inputBuf); fclose(out); Encoder_Interface_exit(amr); + wav_read_close(wav); return 0; } diff --git a/test/amrwb-dec.cpp b/test/amrwb-dec.c similarity index 73% rename from test/amrwb-dec.cpp rename to test/amrwb-dec.c index 740181d..7a121e8 100644 --- a/test/amrwb-dec.cpp +++ b/test/amrwb-dec.c @@ -19,63 +19,69 @@ #include #include #include -#include "wav.h" -extern "C" { +#include "wavwriter.h" #include -} /* From pvamrwbdecoder_api.h, by dividing by 8 and rounding up */ -const int sizes[] = { 17, 23, 32, 36, 40, 46, 50, 58, 60, 5, -1, -1, -1, -1, -1, -1 }; +const int sizes[] = { 17, 23, 32, 36, 40, 46, 50, 58, 60, 5, -1, -1, -1, -1, -1, 0 }; int main(int argc, char *argv[]) { - if (argc < 2) { - fprintf(stderr, "%s in.amr\n", argv[0]); + FILE* in; + char header[9]; + int n; + void *wav, *amr; + if (argc < 3) { + fprintf(stderr, "%s in.amr out.wav\n", argv[0]); return 1; } - FILE* in = fopen(argv[1], "rb"); + in = fopen(argv[1], "rb"); if (!in) { perror(argv[1]); return 1; } - char header[9]; - int n = fread(header, 1, 9, in); + n = fread(header, 1, 9, in); if (n != 9 || memcmp(header, "#!AMR-WB\n", 9)) { fprintf(stderr, "Bad header\n"); return 1; } - WavWriter wav("out.wav", 16000, 16, 1); - void* amr = D_IF_init(); - while (true) { - uint8_t buffer[500]; + wav = wav_write_open(argv[2], 16000, 16, 1); + if (!wav) { + fprintf(stderr, "Unable to open %s\n", argv[2]); + return 1; + } + amr = D_IF_init(); + while (1) { + uint8_t buffer[500], littleendian[640], *ptr; + int size, i; + int16_t outbuffer[320]; /* Read the mode byte */ n = fread(buffer, 1, 1, in); if (n <= 0) break; /* Find the packet size */ - int size = sizes[(buffer[0] >> 3) & 0x0f]; - if (size <= 0) + size = sizes[(buffer[0] >> 3) & 0x0f]; + if (size < 0) break; n = fread(buffer + 1, 1, size, in); if (n != size) break; /* Decode the packet */ - int16_t outbuffer[320]; D_IF_decode(amr, buffer, outbuffer, 0); /* Convert to little endian and write to wav */ - uint8_t littleendian[640]; - uint8_t* ptr = littleendian; - for (int i = 0; i < 320; i++) { + ptr = littleendian; + for (i = 0; i < 320; i++) { *ptr++ = (outbuffer[i] >> 0) & 0xff; *ptr++ = (outbuffer[i] >> 8) & 0xff; } - wav.writeData(littleendian, 640); + wav_write_data(wav, littleendian, 640); } fclose(in); D_IF_exit(amr); + wav_write_close(wav); return 0; } diff --git a/test/linkboth.c b/test/linkboth.c index d2345ae..26a3f35 100644 --- a/test/linkboth.c +++ b/test/linkboth.c @@ -24,11 +24,15 @@ #include int main(int argc, char *argv[]) { +#ifndef DISABLE_AMRNB_DECODER void* amrnb = Decoder_Interface_init(); - void* amrnb_enc = Encoder_Interface_init(0); - void* amrwb = D_IF_init(); Decoder_Interface_exit(amrnb); +#endif +#ifndef DISABLE_AMRNB_ENCODER + void* amrnb_enc = Encoder_Interface_init(0); Encoder_Interface_exit(amrnb_enc); +#endif + void* amrwb = D_IF_init(); D_IF_exit(amrwb); return 0; } diff --git a/test/wav.cpp b/test/wav.cpp deleted file mode 100644 index fb3f015..0000000 --- a/test/wav.cpp +++ /dev/null @@ -1,87 +0,0 @@ -/* ------------------------------------------------------------------ - * Copyright (C) 2009 Martin Storsjo - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - * express or implied. - * See the License for the specific language governing permissions - * and limitations under the License. - * ------------------------------------------------------------------- - */ - -#include "wav.h" - -void WavWriter::writeString(const char *str) { - fputc(str[0], wav); - fputc(str[1], wav); - fputc(str[2], wav); - fputc(str[3], wav); -} - -void WavWriter::writeInt32(int value) { - fputc((value >> 0) & 0xff, wav); - fputc((value >> 8) & 0xff, wav); - fputc((value >> 16) & 0xff, wav); - fputc((value >> 24) & 0xff, wav); -} - -void WavWriter::writeInt16(int value) { - fputc((value >> 0) & 0xff, wav); - fputc((value >> 8) & 0xff, wav); -} - -void WavWriter::writeHeader(int length) { - writeString("RIFF"); - writeInt32(4 + 8 + 16 + 8 + length); - writeString("WAVE"); - - writeString("fmt "); - writeInt32(16); - - int bytesPerFrame = bitsPerSample/8*channels; - int bytesPerSec = bytesPerFrame*sampleRate; - writeInt16(1); // Format - writeInt16(channels); // Channels - writeInt32(sampleRate); // Samplerate - writeInt32(bytesPerSec); // Bytes per sec - writeInt16(bytesPerFrame); // Bytes per frame - writeInt16(bitsPerSample); // Bits per sample - - writeString("data"); - writeInt32(length); -} - -WavWriter::WavWriter(const char *filename, int sampleRate, int bitsPerSample, int channels) { - wav = fopen(filename, "wb"); - if (wav == NULL) - return; - dataLength = 0; - this->sampleRate = sampleRate; - this->bitsPerSample = bitsPerSample; - this->channels = channels; - - writeHeader(dataLength); -} - -WavWriter::~WavWriter() { - if (wav == NULL) - return; - fseek(wav, 0, SEEK_SET); - writeHeader(dataLength); - fclose(wav); -} - -void WavWriter::writeData(const unsigned char* data, int length) { - if (wav == NULL) - return; - fwrite(data, length, 1, wav); - dataLength += length; -} - diff --git a/test/wavreader.c b/test/wavreader.c new file mode 100644 index 0000000..55d2ab9 --- /dev/null +++ b/test/wavreader.c @@ -0,0 +1,162 @@ +/* ------------------------------------------------------------------ + * Copyright (C) 2009 Martin Storsjo + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. + * See the License for the specific language governing permissions + * and limitations under the License. + * ------------------------------------------------------------------- + */ + +#include "wavreader.h" +#include +#include +#include +#include + +#define TAG(a, b, c, d) (((a) << 24) | ((b) << 16) | ((c) << 8) | (d)) + +struct wav_reader { + FILE *wav; + uint32_t data_length; + + int format; + int sample_rate; + int bits_per_sample; + int channels; + int byte_rate; + int block_align; +}; + +static uint32_t read_tag(struct wav_reader* wr) { + uint32_t tag = 0; + tag = (tag << 8) | fgetc(wr->wav); + tag = (tag << 8) | fgetc(wr->wav); + tag = (tag << 8) | fgetc(wr->wav); + tag = (tag << 8) | fgetc(wr->wav); + return tag; +} + +static uint32_t read_int32(struct wav_reader* wr) { + uint32_t value = 0; + value |= fgetc(wr->wav) << 0; + value |= fgetc(wr->wav) << 8; + value |= fgetc(wr->wav) << 16; + value |= fgetc(wr->wav) << 24; + return value; +} + +static uint16_t read_int16(struct wav_reader* wr) { + uint16_t value = 0; + value |= fgetc(wr->wav) << 0; + value |= fgetc(wr->wav) << 8; + return value; +} + +void* wav_read_open(const char *filename) { + struct wav_reader* wr = (struct wav_reader*) malloc(sizeof(*wr)); + long data_pos = 0; + memset(wr, 0, sizeof(*wr)); + + wr->wav = fopen(filename, "rb"); + if (wr->wav == NULL) { + free(wr); + return NULL; + } + + while (1) { + uint32_t tag, tag2, length; + tag = read_tag(wr); + if (feof(wr->wav)) + break; + length = read_int32(wr); + if (tag != TAG('R', 'I', 'F', 'F') || length < 4) { + fseek(wr->wav, length, SEEK_CUR); + continue; + } + tag2 = read_tag(wr); + length -= 4; + if (tag2 != TAG('W', 'A', 'V', 'E')) { + fseek(wr->wav, length, SEEK_CUR); + continue; + } + // RIFF chunk found, iterate through it + while (length >= 8) { + uint32_t subtag, sublength; + subtag = read_tag(wr); + if (feof(wr->wav)) + break; + sublength = read_int32(wr); + length -= 8; + if (length < sublength) + break; + if (subtag == TAG('f', 'm', 't', ' ')) { + if (sublength < 16) { + // Insufficient data for 'fmt ' + break; + } + wr->format = read_int16(wr); + wr->channels = read_int16(wr); + wr->sample_rate = read_int32(wr); + wr->byte_rate = read_int32(wr); + wr->block_align = read_int16(wr); + wr->bits_per_sample = read_int16(wr); + } else if (subtag == TAG('d', 'a', 't', 'a')) { + data_pos = ftell(wr->wav); + wr->data_length = sublength; + fseek(wr->wav, sublength, SEEK_CUR); + } else { + fseek(wr->wav, sublength, SEEK_CUR); + } + length -= sublength; + } + if (length > 0) { + // Bad chunk? + fseek(wr->wav, length, SEEK_CUR); + } + } + fseek(wr->wav, data_pos, SEEK_SET); + return wr; +} + +void wav_read_close(void* obj) { + struct wav_reader* wr = (struct wav_reader*) obj; + fclose(wr->wav); + free(wr); +} + +int wav_get_header(void* obj, int* format, int* channels, int* sample_rate, int* bits_per_sample, unsigned int* data_length) { + struct wav_reader* wr = (struct wav_reader*) obj; + if (format) + *format = wr->format; + if (channels) + *channels = wr->channels; + if (sample_rate) + *sample_rate = wr->sample_rate; + if (bits_per_sample) + *bits_per_sample = wr->bits_per_sample; + if (data_length) + *data_length = wr->data_length; + return wr->format && wr->sample_rate; +} + +int wav_read_data(void* obj, unsigned char* data, unsigned int length) { + struct wav_reader* wr = (struct wav_reader*) obj; + int n; + if (wr->wav == NULL) + return -1; + if (length > wr->data_length) + length = wr->data_length; + n = fread(data, 1, length, wr->wav); + wr->data_length -= length; + return n; +} + diff --git a/test/wav.h b/test/wavreader.h similarity index 62% rename from test/wav.h rename to test/wavreader.h index ae77383..57a13ff 100644 --- a/test/wav.h +++ b/test/wavreader.h @@ -16,32 +16,22 @@ * ------------------------------------------------------------------- */ -#ifndef WAV_H -#define WAV_H +#ifndef WAVREADER_H +#define WAVREADER_H -#include - -class WavWriter { -public: - WavWriter(const char *filename, int sampleRate, int bitsPerSample, int channels); - ~WavWriter(); - - void writeData(const unsigned char* data, int length); - -private: - void writeString(const char *str); - void writeInt32(int value); - void writeInt16(int value); +#ifdef __cplusplus +extern "C" { +#endif - void writeHeader(int length); +void* wav_read_open(const char *filename); +void wav_read_close(void* obj); - FILE *wav; - int dataLength; +int wav_get_header(void* obj, int* format, int* channels, int* sample_rate, int* bits_per_sample, unsigned int* data_length); +int wav_read_data(void* obj, unsigned char* data, unsigned int length); - int sampleRate; - int bitsPerSample; - int channels; -}; +#ifdef __cplusplus +} +#endif #endif diff --git a/test/wavwriter.c b/test/wavwriter.c new file mode 100644 index 0000000..3df9914 --- /dev/null +++ b/test/wavwriter.c @@ -0,0 +1,111 @@ +/* ------------------------------------------------------------------ + * Copyright (C) 2009 Martin Storsjo + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. + * See the License for the specific language governing permissions + * and limitations under the License. + * ------------------------------------------------------------------- + */ + +#include "wavwriter.h" +#include +#include +#include +#include + +struct wav_writer { + FILE *wav; + int data_length; + + int sample_rate; + int bits_per_sample; + int channels; +}; + +static void write_string(struct wav_writer* ww, const char *str) { + fputc(str[0], ww->wav); + fputc(str[1], ww->wav); + fputc(str[2], ww->wav); + fputc(str[3], ww->wav); +} + +static void write_int32(struct wav_writer* ww, int value) { + fputc((value >> 0) & 0xff, ww->wav); + fputc((value >> 8) & 0xff, ww->wav); + fputc((value >> 16) & 0xff, ww->wav); + fputc((value >> 24) & 0xff, ww->wav); +} + +static void write_int16(struct wav_writer* ww, int value) { + fputc((value >> 0) & 0xff, ww->wav); + fputc((value >> 8) & 0xff, ww->wav); +} + +static void write_header(struct wav_writer* ww, int length) { + int bytes_per_frame, bytes_per_sec; + write_string(ww, "RIFF"); + write_int32(ww, 4 + 8 + 16 + 8 + length); + write_string(ww, "WAVE"); + + write_string(ww, "fmt "); + write_int32(ww, 16); + + bytes_per_frame = ww->bits_per_sample/8*ww->channels; + bytes_per_sec = bytes_per_frame*ww->sample_rate; + write_int16(ww, 1); // Format + write_int16(ww, ww->channels); // Channels + write_int32(ww, ww->sample_rate); // Samplerate + write_int32(ww, bytes_per_sec); // Bytes per sec + write_int16(ww, bytes_per_frame); // Bytes per frame + write_int16(ww, ww->bits_per_sample); // Bits per sample + + write_string(ww, "data"); + write_int32(ww, length); +} + +void* wav_write_open(const char *filename, int sample_rate, int bits_per_sample, int channels) { + struct wav_writer* ww = (struct wav_writer*) malloc(sizeof(*ww)); + memset(ww, 0, sizeof(*ww)); + ww->wav = fopen(filename, "wb"); + if (ww->wav == NULL) { + free(ww); + return NULL; + } + ww->data_length = 0; + ww->sample_rate = sample_rate; + ww->bits_per_sample = bits_per_sample; + ww->channels = channels; + + write_header(ww, ww->data_length); + return ww; +} + +void wav_write_close(void* obj) { + struct wav_writer* ww = (struct wav_writer*) obj; + if (ww->wav == NULL) { + free(ww); + return; + } + fseek(ww->wav, 0, SEEK_SET); + write_header(ww, ww->data_length); + fclose(ww->wav); + free(ww); +} + +void wav_write_data(void* obj, const unsigned char* data, int length) { + struct wav_writer* ww = (struct wav_writer*) obj; + if (ww->wav == NULL) + return; + fwrite(data, length, 1, ww->wav); + ww->data_length += length; +} + diff --git a/test/wavwriter.h b/test/wavwriter.h new file mode 100644 index 0000000..9767ad1 --- /dev/null +++ b/test/wavwriter.h @@ -0,0 +1,36 @@ +/* ------------------------------------------------------------------ + * Copyright (C) 2009 Martin Storsjo + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. + * See the License for the specific language governing permissions + * and limitations under the License. + * ------------------------------------------------------------------- + */ + +#ifndef WAVWRITER_H +#define WAVWRITER_H + +#ifdef __cplusplus +extern "C" { +#endif + +void* wav_write_open(const char *filename, int sample_rate, int bits_per_sample, int channels); +void wav_write_close(void* obj); + +void wav_write_data(void* obj, const unsigned char* data, int length); + +#ifdef __cplusplus +} +#endif + +#endif + -- 2.7.4