Commit bae3390b authored by diego's avatar diego

Replace hackish support for amr-nb and amr-wb. Instead of including the source

of the reference implementation it is possible to use proper libraries now.
patch by Stanislav Brabec, sbrabec suse cz, changes and bug fixes by me


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@8717 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 223f61e6
...@@ -102,7 +102,6 @@ show_help(){ ...@@ -102,7 +102,6 @@ show_help(){
echo " --enable-amr-nb enable amr-nb floating point audio codec" echo " --enable-amr-nb enable amr-nb floating point audio codec"
echo " --enable-amr-nb-fixed enable amr-nb fixed-point codec" echo " --enable-amr-nb-fixed enable amr-nb fixed-point codec"
echo " --enable-amr-wb enable amr-wb floating point audio codec" echo " --enable-amr-wb enable amr-wb floating point audio codec"
echo " --enable-amr-if2 enable amr-wb IF2 audio codec"
echo "" echo ""
echo "Advanced options (experts only):" echo "Advanced options (experts only):"
echo " --source-path=PATH path to source code [$source_path]" echo " --source-path=PATH path to source code [$source_path]"
...@@ -640,7 +639,6 @@ CMDLINE_SELECT=" ...@@ -640,7 +639,6 @@ CMDLINE_SELECT="
$CONFIG_LIST $CONFIG_LIST
$TARGET_LIST $TARGET_LIST
$THREADS_LIST $THREADS_LIST
amr_if2
debug debug
extra_warnings extra_warnings
shared shared
...@@ -765,7 +763,6 @@ v4l2="yes" ...@@ -765,7 +763,6 @@ v4l2="yes"
v4l="yes" v4l="yes"
# libraries # libraries
amr_if2="no"
amr_nb="no" amr_nb="no"
amr_nb_fixed="no" amr_nb_fixed="no"
amr_wb="no" amr_wb="no"
...@@ -1587,11 +1584,13 @@ for thread in $THREADS_LIST; do ...@@ -1587,11 +1584,13 @@ for thread in $THREADS_LIST; do
fi fi
done done
enabled_any amr_nb amr_nb_fixed amr_wb amr_if2 && enable amr enabled_any amr_nb amr_nb_fixed amr_wb && enable amr
enabled_all amr_nb amr_nb_fixed && enabled_all amr_nb amr_nb_fixed &&
die "Only one of amr_nb and amr_nb_fixed may be enabled." die "Only one of amr_nb and amr_nb_fixed may be enabled."
# these are off by default, so fail if requested and not available # these are off by default, so fail if requested and not available
enabled amr_nb && require libamrnb amrnb/interf_dec.h Speech_Decode_Frame_init -lamrnb -lm
enabled amr_wb && require libamrwb amrwb/dec_if.h D_IF_init -lamrwb -lm
enabled liba52 && require liba52 a52dec/a52.h a52_init -la52 enabled liba52 && require liba52 a52dec/a52.h a52_init -la52
enabled libdts && require libdts dts.h dts_init -ldts -lm enabled libdts && require libdts dts.h dts_init -ldts -lm
enabled libgsm && require libgsm gsm.h gsm_create -lgsm enabled libgsm && require libgsm gsm.h gsm_create -lgsm
...@@ -1868,7 +1867,6 @@ echo "zlib enabled $zlib" ...@@ -1868,7 +1867,6 @@ echo "zlib enabled $zlib"
echo "AMR-NB float support $amr_nb" echo "AMR-NB float support $amr_nb"
echo "AMR-NB fixed support $amr_nb_fixed" echo "AMR-NB fixed support $amr_nb_fixed"
echo "AMR-WB float support $amr_wb" echo "AMR-WB float support $amr_wb"
echo "AMR-WB IF2 support $amr_if2"
if disabled gpl; then if disabled gpl; then
echo "License: LGPL" echo "License: LGPL"
else else
...@@ -2006,10 +2004,6 @@ echo "SRC_PATH=\"$source_path\"" >> config.mak ...@@ -2006,10 +2004,6 @@ echo "SRC_PATH=\"$source_path\"" >> config.mak
echo "SRC_PATH_BARE=$source_path" >> config.mak echo "SRC_PATH_BARE=$source_path" >> config.mak
echo "BUILD_ROOT=\"$PWD\"" >> config.mak echo "BUILD_ROOT=\"$PWD\"" >> config.mak
if enabled amr_if2; then
echo "AMR_CFLAGS=-DIF2=1" >> config.mak
fi
# Apparently it's not possible to portably echo a backslash. # Apparently it's not possible to portably echo a backslash.
if enabled asmalign_pot; then if enabled asmalign_pot; then
printf '#define ASMALIGN(ZEROBITS) ".align " #ZEROBITS "\\n\\t"\n' >> $TMPH printf '#define ASMALIGN(ZEROBITS) ".align " #ZEROBITS "\\n\\t"\n' >> $TMPH
...@@ -2054,8 +2048,6 @@ if enabled source_path_used; then ...@@ -2054,8 +2048,6 @@ if enabled source_path_used; then
libavcodec/mlib \ libavcodec/mlib \
libavcodec/ppc \ libavcodec/ppc \
libavcodec/amr \ libavcodec/amr \
libavcodec/amr_float \
libavcodec/amrwb_float \
libpostproc \ libpostproc \
libavutil \ libavutil \
libswscale \ libswscale \
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
# #
include ../config.mak include ../config.mak
CFLAGS+=-I$(SRC_PATH)/libswscale $(AMR_CFLAGS) CFLAGS+=-I$(SRC_PATH)/libswscale
OBJS= bitstream.o \ OBJS= bitstream.o \
utils.o \ utils.o \
...@@ -270,33 +270,11 @@ OBJS-$(CONFIG_X264) += x264.o ...@@ -270,33 +270,11 @@ OBJS-$(CONFIG_X264) += x264.o
OBJS-$(CONFIG_XVID) += xvidff.o xvid_rc.o OBJS-$(CONFIG_XVID) += xvidff.o xvid_rc.o
OBJS-$(CONFIG_AMR) += amr.o OBJS-$(CONFIG_AMR) += amr.o
OBJS-$(CONFIG_AMR_NB) += amr_float/sp_dec.o \
amr_float/sp_enc.o \
amr_float/interf_dec.o \
amr_float/interf_enc.o
ifeq ($(CONFIG_AMR_NB_FIXED),yes) ifeq ($(CONFIG_AMR_NB_FIXED),yes)
EXTRAOBJS += amr/*.o EXTRAOBJS += amr/*.o
EXTRADEPS=amrlibs EXTRADEPS=amrlibs
endif endif
OBJS-$(CONFIG_AMR_WB) += amrwb_float/dec_acelp.o \
amrwb_float/dec_dtx.o \
amrwb_float/dec_gain.o \
amrwb_float/dec_if.o \
amrwb_float/dec_lpc.o \
amrwb_float/dec_main.o \
amrwb_float/dec_rom.o \
amrwb_float/dec_util.o \
amrwb_float/enc_acelp.o \
amrwb_float/enc_dtx.o \
amrwb_float/enc_gain.o \
amrwb_float/enc_if.o \
amrwb_float/enc_lpc.o \
amrwb_float/enc_main.o \
amrwb_float/enc_rom.o \
amrwb_float/enc_util.o \
amrwb_float/if_rom.o
OBJS-$(CONFIG_AAC_PARSER) += parser.o OBJS-$(CONFIG_AAC_PARSER) += parser.o
OBJS-$(CONFIG_AC3_PARSER) += parser.o ac3.o OBJS-$(CONFIG_AC3_PARSER) += parser.o ac3.o
...@@ -433,10 +411,8 @@ clean:: ...@@ -433,10 +411,8 @@ clean::
ps2/*.o ps2/*~ \ ps2/*.o ps2/*~ \
sh4/*.o sh4/*~ \ sh4/*.o sh4/*~ \
sparc/*.o sparc/*~ \ sparc/*.o sparc/*~ \
amr_float/*.o \
apiexample $(TESTS) apiexample $(TESTS)
-$(MAKE) -C amr clean -$(MAKE) -C amr clean
-$(MAKE) -C amrwb_float -f makefile.gcc clean
apiexample: apiexample.o $(LIB) apiexample: apiexample.o $(LIB)
......
...@@ -82,8 +82,8 @@ ...@@ -82,8 +82,8 @@
#include "amr/e_homing.h" #include "amr/e_homing.h"
#else #else
#include "amr_float/interf_dec.h" #include <amrnb/interf_dec.h>
#include "amr_float/interf_enc.h" #include <amrnb/interf_enc.h>
#endif #endif
static const char *nb_bitrate_unsupported = static const char *nb_bitrate_unsupported =
...@@ -532,8 +532,9 @@ AVCodec amr_nb_encoder = ...@@ -532,8 +532,9 @@ AVCodec amr_nb_encoder =
#define typedef_h #define typedef_h
#endif #endif
#include "amrwb_float/enc_if.h" #include <amrwb/enc_if.h>
#include "amrwb_float/dec_if.h" #include <amrwb/dec_if.h>
#include <amrwb/if_rom.h>
/* Common code for fixed and float version*/ /* Common code for fixed and float version*/
typedef struct AMRWB_bitrates typedef struct AMRWB_bitrates
...@@ -652,8 +653,6 @@ static int amr_wb_decode_init(AVCodecContext * avctx) ...@@ -652,8 +653,6 @@ static int amr_wb_decode_init(AVCodecContext * avctx)
return 0; return 0;
} }
extern const UWord8 block_size[];
static int amr_wb_decode_frame(AVCodecContext * avctx, static int amr_wb_decode_frame(AVCodecContext * avctx,
void *data, int *data_size, void *data, int *data_size,
uint8_t * buf, int buf_size) uint8_t * buf, int buf_size)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment