summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xaconfigure22
-rw-r--r--aconfigure.ac12
-rw-r--r--pjmedia/build/os-auto.mak.in7
-rw-r--r--pjmedia/build/os-darwinos.mak7
-rw-r--r--pjmedia/build/os-linux.mak7
-rw-r--r--pjmedia/build/os-win32.mak7
-rw-r--r--pjmedia/include/pjmedia-codec/config_auto.h.in6
-rw-r--r--pjmedia/src/pjmedia-codec/g722/g722_enc.c4
8 files changed, 69 insertions, 3 deletions
diff --git a/aconfigure b/aconfigure
index 8c04574c..295a5b7e 100755
--- a/aconfigure
+++ b/aconfigure
@@ -308,7 +308,7 @@ ac_includes_default="\
# include <unistd.h>
#endif"
-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CXX CXXFLAGS ac_ct_CXX ac_pjdir CPP EGREP ac_os_objs ac_pjmedia_snd ac_pa_cflags ac_pa_use_alsa ac_pa_use_oss ac_no_small_filter ac_no_large_filter ac_no_speex_aec ac_no_g711_codec ac_no_l16_codec ac_no_gsm_codec ac_no_speex_codec ac_no_ilbc_codec ac_no_ssl openssl_h_present libssl_present libcrypto_present ac_cross_compile ac_linux_poll ac_host ac_main_obj LIBOBJS LTLIBOBJS'
+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CXX CXXFLAGS ac_ct_CXX ac_pjdir CPP EGREP ac_os_objs ac_pjmedia_snd ac_pa_cflags ac_pa_use_alsa ac_pa_use_oss ac_no_small_filter ac_no_large_filter ac_no_speex_aec ac_no_g711_codec ac_no_l16_codec ac_no_gsm_codec ac_no_g722_codec ac_no_speex_codec ac_no_ilbc_codec ac_no_ssl openssl_h_present libssl_present libcrypto_present ac_cross_compile ac_linux_poll ac_host ac_main_obj LIBOBJS LTLIBOBJS'
ac_subst_files=''
# Initialize some variables set by options.
@@ -865,6 +865,7 @@ Optional Features:
--disable-g711-codec Exclude G.711 codecs from the build
--disable-l16-codec Exclude Linear/L16 codec family from the build
--disable-gsm-codec Exclude GSM codec in the build
+ --disable-g722-codec Exclude G.722 codec in the build
--disable-speex-codec Exclude Speex codecs in the build
--disable-ilbc-codec Exclude iLBC codec in the build
--enable-libsamplerate Link with libsamplerate when available. Note that
@@ -10474,6 +10475,24 @@ echo "${ECHO_T}Checking if GSM codec is disabled...no" >&6
fi;
+# Check whether --enable-g722-codec or --disable-g722-codec was given.
+if test "${enable_g722_codec+set}" = set; then
+ enableval="$enable_g722_codec"
+ if test "$enable_g722_codec" = "no"; then
+ ac_no_g722_codec=1
+ cat >>confdefs.h <<\_ACEOF
+#define PJMEDIA_HAS_G722_CODEC 0
+_ACEOF
+
+ echo "$as_me:$LINENO: result: Checking if G.722 codec is disabled...yes" >&5
+echo "${ECHO_T}Checking if G.722 codec is disabled...yes" >&6
+ fi
+else
+ echo "$as_me:$LINENO: result: Checking if G.722 codec is disabled...no" >&5
+echo "${ECHO_T}Checking if G.722 codec is disabled...no" >&6
+fi;
+
+
# Check whether --enable-speex-codec or --disable-speex-codec was given.
if test "${enable_speex_codec+set}" = set; then
enableval="$enable_speex_codec"
@@ -11677,6 +11696,7 @@ s,@ac_no_speex_aec@,$ac_no_speex_aec,;t t
s,@ac_no_g711_codec@,$ac_no_g711_codec,;t t
s,@ac_no_l16_codec@,$ac_no_l16_codec,;t t
s,@ac_no_gsm_codec@,$ac_no_gsm_codec,;t t
+s,@ac_no_g722_codec@,$ac_no_g722_codec,;t t
s,@ac_no_speex_codec@,$ac_no_speex_codec,;t t
s,@ac_no_ilbc_codec@,$ac_no_ilbc_codec,;t t
s,@ac_no_ssl@,$ac_no_ssl,;t t
diff --git a/aconfigure.ac b/aconfigure.ac
index 5b0f2ae6..aa466138 100644
--- a/aconfigure.ac
+++ b/aconfigure.ac
@@ -475,6 +475,18 @@ AC_ARG_ENABLE(gsm-codec,
fi],
AC_MSG_RESULT([Checking if GSM codec is disabled...no]))
+dnl # Include G.722 codec
+AC_SUBST(ac_no_g722_codec)
+AC_ARG_ENABLE(g722-codec,
+ AC_HELP_STRING([--disable-g722-codec],
+ [Exclude G.722 codec in the build]),
+ [if test "$enable_g722_codec" = "no"; then
+ [ac_no_g722_codec=1]
+ AC_DEFINE(PJMEDIA_HAS_G722_CODEC,0)
+ AC_MSG_RESULT([Checking if G.722 codec is disabled...yes])
+ fi],
+ AC_MSG_RESULT([Checking if G.722 codec is disabled...no]))
+
dnl # Include Speex codec
AC_SUBST(ac_no_speex_codec)
AC_ARG_ENABLE(speex-codec,
diff --git a/pjmedia/build/os-auto.mak.in b/pjmedia/build/os-auto.mak.in
index 7e18ea92..ce823913 100644
--- a/pjmedia/build/os-auto.mak.in
+++ b/pjmedia/build/os-auto.mak.in
@@ -26,6 +26,7 @@ AC_NO_L16_CODEC=@ac_no_l16_codec@
AC_NO_GSM_CODEC=@ac_no_gsm_codec@
AC_NO_SPEEX_CODEC=@ac_no_speex_codec@
AC_NO_ILBC_CODEC=@ac_no_ilbc_codec@
+AC_NO_G722_CODEC=@ac_no_g722_codec@
export CODEC_OBJS=
@@ -65,6 +66,12 @@ else
export CODEC_OBJS += ilbc.o
endif
+ifeq ($(AC_NO_G722_CODEC),1)
+export CFLAGS += -DPJMEDIA_HAS_G722_CODEC=0
+else
+export CODEC_OBJS += g722.o g722/g722_enc.o g722/g722_dec.o
+endif
+
#
# PortAudio
diff --git a/pjmedia/build/os-darwinos.mak b/pjmedia/build/os-darwinos.mak
index f76d3403..1126bc3f 100644
--- a/pjmedia/build/os-darwinos.mak
+++ b/pjmedia/build/os-darwinos.mak
@@ -23,6 +23,7 @@ AC_NO_L16_CODEC=0
AC_NO_GSM_CODEC=0
AC_NO_SPEEX_CODEC=0
AC_NO_ILBC_CODEC=0
+AC_NO_G722_CODEC=0
export CODEC_OBJS=
@@ -63,6 +64,12 @@ else
export CODEC_OBJS += ilbc.o
endif
+ifeq ($(AC_NO_G722_CODEC),1)
+export CFLAGS += -DPJMEDIA_HAS_G722_CODEC=0
+else
+export CODEC_OBJS += g722.o g722/g722_enc.o g722/g722_dec.o
+endif
+
#
# PortAudio
diff --git a/pjmedia/build/os-linux.mak b/pjmedia/build/os-linux.mak
index f707eb5c..184284e9 100644
--- a/pjmedia/build/os-linux.mak
+++ b/pjmedia/build/os-linux.mak
@@ -18,6 +18,7 @@ AC_NO_L16_CODEC=0
AC_NO_GSM_CODEC=0
AC_NO_SPEEX_CODEC=0
AC_NO_ILBC_CODEC=0
+AC_NO_G722_CODEC=0
export CODEC_OBJS=
@@ -57,6 +58,12 @@ else
export CODEC_OBJS += ilbc.o
endif
+ifeq ($(AC_NO_G722_CODEC),1)
+export CFLAGS += -DPJMEDIA_HAS_G722_CODEC=0
+else
+export CODEC_OBJS += g722.o g722/g722_enc.o g722/g722_dec.o
+endif
+
#
# PortAudio
diff --git a/pjmedia/build/os-win32.mak b/pjmedia/build/os-win32.mak
index 0767ceec..dcc4dea9 100644
--- a/pjmedia/build/os-win32.mak
+++ b/pjmedia/build/os-win32.mak
@@ -19,6 +19,7 @@ AC_NO_L16_CODEC=0
AC_NO_GSM_CODEC=0
AC_NO_SPEEX_CODEC=0
AC_NO_ILBC_CODEC=0
+AC_NO_G722_CODEC=0
export CODEC_OBJS=
@@ -59,6 +60,12 @@ else
export CODEC_OBJS += ilbc.o
endif
+ifeq ($(AC_NO_G722_CODEC),1)
+export CFLAGS += -DPJMEDIA_HAS_G722_CODEC=0
+else
+export CODEC_OBJS += g722.o g722/g722_enc.o g722/g722_dec.o
+endif
+
#
# PortAudio
diff --git a/pjmedia/include/pjmedia-codec/config_auto.h.in b/pjmedia/include/pjmedia-codec/config_auto.h.in
index 528390cd..efbfdd1a 100644
--- a/pjmedia/include/pjmedia-codec/config_auto.h.in
+++ b/pjmedia/include/pjmedia-codec/config_auto.h.in
@@ -54,6 +54,12 @@
#endif
+/* G722 codec */
+#ifndef PJMEDIA_HAS_G722_CODEC
+#undef PJMEDIA_HAS_G722_CODEC
+#endif
+
+
#endif /* __PJMEDIA_CODEC_CONFIG_AUTO_H_ */
diff --git a/pjmedia/src/pjmedia-codec/g722/g722_enc.c b/pjmedia/src/pjmedia-codec/g722/g722_enc.c
index e71aad1b..30453eb9 100644
--- a/pjmedia/src/pjmedia-codec/g722/g722_enc.c
+++ b/pjmedia/src/pjmedia-codec/g722/g722_enc.c
@@ -76,7 +76,7 @@ static int block1l (int xl, int sl, int detl)
sil = el >> 15 ;
if (sil == 0 ) wd = el ;
- else wd = 32767 - el & 32767 ;
+ else wd = 32767 - (el & 32767) ;
mil = 1 ;
@@ -304,7 +304,7 @@ static int block1h (int xh, int sh, int deth)
sih = eh >> 15 ;
if (sih == 0 ) wd = eh ;
- else wd = 32767 - eh & 32767 ;
+ else wd = 32767 - (eh & 32767) ;
hdu = (564 << 3) * deth;
wd1 = (hdu >> 15) ;