├── AndroidManetPtt
├── .gitignore
├── libs
│ ├── libmanet.jar
│ └── armeabi
│ │ └── libspeex_jni.so
├── res
│ ├── drawable-hdpi
│ │ ├── icon.png
│ │ ├── eye_icon.png
│ │ ├── chat_icon.png
│ │ ├── group_icon.png
│ │ ├── groups_icon.png
│ │ ├── info_icon.png
│ │ ├── peer_icon.png
│ │ ├── stop_icon.png
│ │ ├── chat_red_icon.png
│ │ ├── orb_red_icon.png
│ │ ├── peer_red_icon.png
│ │ ├── settings_icon.png
│ │ ├── chat_green_icon.png
│ │ ├── chat_orange_icon.png
│ │ ├── group_green_icon.png
│ │ ├── group_red_icon.png
│ │ ├── orb_green_icon.png
│ │ ├── orb_orange_icon.png
│ │ ├── peer_green_icon.png
│ │ └── group_orange_icon.png
│ ├── drawable-ldpi
│ │ ├── icon.png
│ │ └── settings_icon.png
│ ├── drawable-mdpi
│ │ ├── icon.png
│ │ └── settings_icon.png
│ ├── drawable
│ │ ├── microphone_normal_image.png
│ │ ├── microphone_conflict_image.png
│ │ ├── microphone_disabled_image.png
│ │ ├── microphone_playback_image.png
│ │ └── microphone_pressed_image.png
│ ├── layout
│ │ ├── groupname.xml
│ │ ├── viewchannel.xml
│ │ ├── listtextitem.xml
│ │ ├── listchannelrow.xml
│ │ ├── viewgroup.xml
│ │ ├── viewgroups.xml
│ │ ├── spinnerchannelrow.xml
│ │ ├── main.xml
│ │ └── creategroup.xml
│ ├── values
│ │ ├── arrays.xml
│ │ └── strings.xml
│ ├── menu
│ │ └── menu.xml
│ └── xml
│ │ ├── settings_audio.xml
│ │ └── settings_comm.xml
├── obj
│ └── local
│ │ └── armeabi
│ │ ├── libspeex_jni.so
│ │ └── objs
│ │ └── speex_jni
│ │ ├── speex
│ │ └── libspeex
│ │ │ ├── gain_table.o.d
│ │ │ ├── exc_5_64_table.o.d
│ │ │ ├── gain_table_lbr.o.d
│ │ │ ├── lsp_tables_nb.o.d
│ │ │ ├── exc_10_16_table.o.d
│ │ │ ├── exc_10_32_table.o.d
│ │ │ ├── exc_20_32_table.o.d
│ │ │ ├── exc_5_256_table.o.d
│ │ │ ├── exc_8_128_table.o.d
│ │ │ ├── high_lsp_tables.o.d
│ │ │ ├── window.o.d
│ │ │ ├── lpc.o.d
│ │ │ ├── vq.o.d
│ │ │ ├── vbr.o.d
│ │ │ ├── bits.o.d
│ │ │ ├── lsp.o.d
│ │ │ ├── filters.o.d
│ │ │ ├── speex_callbacks.o.d
│ │ │ └── cb_search.o.d
│ │ └── speex_jni.o.d
├── docs
│ └── license
│ │ └── copyright.txt
├── .settings
│ └── org.eclipse.jdt.core.prefs
├── jni
│ ├── speex
│ │ ├── include
│ │ │ └── speex
│ │ │ │ ├── speex_config_types.h
│ │ │ │ ├── speex_types.h
│ │ │ │ └── speex_callbacks.h
│ │ ├── COPYING
│ │ └── libspeex
│ │ │ ├── lpc.h
│ │ │ ├── exc_10_16_table.c
│ │ │ ├── gain_table_lbr.c
│ │ │ ├── vbr.h
│ │ │ ├── vq.h
│ │ │ ├── exc_10_32_table.c
│ │ │ ├── lsp.h
│ │ │ ├── quant_lsp.h
│ │ │ ├── exc_5_64_table.c
│ │ │ ├── exc_20_32_table.c
│ │ │ ├── stack_alloc.h
│ │ │ ├── cb_search.h
│ │ │ ├── filters.h
│ │ │ ├── gain_table.c
│ │ │ ├── vq.c
│ │ │ ├── speex_callbacks.c
│ │ │ ├── fixed_generic.h
│ │ │ ├── exc_8_128_table.c
│ │ │ ├── high_lsp_tables.c
│ │ │ ├── window.c
│ │ │ ├── os_support.h
│ │ │ └── ltp.h
│ ├── Android.mk
│ └── speex_jni.cpp
├── .classpath
├── src
│ ├── org
│ │ └── span
│ │ │ └── ptt
│ │ │ ├── channels
│ │ │ ├── NullChannel.java
│ │ │ ├── ListenOnlyChannel.java
│ │ │ ├── PeerChannel.java
│ │ │ ├── GroupChannel.java
│ │ │ ├── ViewChannel.java
│ │ │ ├── ChannelAdapter.java
│ │ │ └── Channel.java
│ │ │ ├── groups
│ │ │ ├── Group.java
│ │ │ ├── ViewGroup.java
│ │ │ ├── ViewGroups.java
│ │ │ └── GroupHelper.java
│ │ │ ├── service
│ │ │ ├── ConnectionServiceHelper.java
│ │ │ └── ConnectionService.java
│ │ │ ├── util
│ │ │ ├── PhoneIPs.java
│ │ │ └── AudioParams.java
│ │ │ ├── recorder
│ │ │ ├── MultiRecorder.java
│ │ │ ├── SingleRecorder.java
│ │ │ └── Recorder.java
│ │ │ ├── settings
│ │ │ ├── AudioSettings.java
│ │ │ └── CommSettings.java
│ │ │ └── PeersQueryActivity.java
│ └── ro
│ │ └── ui
│ │ └── pttdroid
│ │ └── codecs
│ │ └── Speex.java
├── project.properties
├── .project
└── AndroidManifest.xml
└── README.md
/AndroidManetPtt/.gitignore:
--------------------------------------------------------------------------------
1 | /bin
2 | /gen
3 |
--------------------------------------------------------------------------------
/AndroidManetPtt/libs/libmanet.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ProjectSPAN/android-manet-ptt/HEAD/AndroidManetPtt/libs/libmanet.jar
--------------------------------------------------------------------------------
/AndroidManetPtt/libs/armeabi/libspeex_jni.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ProjectSPAN/android-manet-ptt/HEAD/AndroidManetPtt/libs/armeabi/libspeex_jni.so
--------------------------------------------------------------------------------
/AndroidManetPtt/res/drawable-hdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ProjectSPAN/android-manet-ptt/HEAD/AndroidManetPtt/res/drawable-hdpi/icon.png
--------------------------------------------------------------------------------
/AndroidManetPtt/res/drawable-ldpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ProjectSPAN/android-manet-ptt/HEAD/AndroidManetPtt/res/drawable-ldpi/icon.png
--------------------------------------------------------------------------------
/AndroidManetPtt/res/drawable-mdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ProjectSPAN/android-manet-ptt/HEAD/AndroidManetPtt/res/drawable-mdpi/icon.png
--------------------------------------------------------------------------------
/AndroidManetPtt/res/drawable-hdpi/eye_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ProjectSPAN/android-manet-ptt/HEAD/AndroidManetPtt/res/drawable-hdpi/eye_icon.png
--------------------------------------------------------------------------------
/AndroidManetPtt/obj/local/armeabi/libspeex_jni.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ProjectSPAN/android-manet-ptt/HEAD/AndroidManetPtt/obj/local/armeabi/libspeex_jni.so
--------------------------------------------------------------------------------
/AndroidManetPtt/res/drawable-hdpi/chat_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ProjectSPAN/android-manet-ptt/HEAD/AndroidManetPtt/res/drawable-hdpi/chat_icon.png
--------------------------------------------------------------------------------
/AndroidManetPtt/res/drawable-hdpi/group_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ProjectSPAN/android-manet-ptt/HEAD/AndroidManetPtt/res/drawable-hdpi/group_icon.png
--------------------------------------------------------------------------------
/AndroidManetPtt/res/drawable-hdpi/groups_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ProjectSPAN/android-manet-ptt/HEAD/AndroidManetPtt/res/drawable-hdpi/groups_icon.png
--------------------------------------------------------------------------------
/AndroidManetPtt/res/drawable-hdpi/info_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ProjectSPAN/android-manet-ptt/HEAD/AndroidManetPtt/res/drawable-hdpi/info_icon.png
--------------------------------------------------------------------------------
/AndroidManetPtt/res/drawable-hdpi/peer_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ProjectSPAN/android-manet-ptt/HEAD/AndroidManetPtt/res/drawable-hdpi/peer_icon.png
--------------------------------------------------------------------------------
/AndroidManetPtt/res/drawable-hdpi/stop_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ProjectSPAN/android-manet-ptt/HEAD/AndroidManetPtt/res/drawable-hdpi/stop_icon.png
--------------------------------------------------------------------------------
/AndroidManetPtt/res/drawable-hdpi/chat_red_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ProjectSPAN/android-manet-ptt/HEAD/AndroidManetPtt/res/drawable-hdpi/chat_red_icon.png
--------------------------------------------------------------------------------
/AndroidManetPtt/res/drawable-hdpi/orb_red_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ProjectSPAN/android-manet-ptt/HEAD/AndroidManetPtt/res/drawable-hdpi/orb_red_icon.png
--------------------------------------------------------------------------------
/AndroidManetPtt/res/drawable-hdpi/peer_red_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ProjectSPAN/android-manet-ptt/HEAD/AndroidManetPtt/res/drawable-hdpi/peer_red_icon.png
--------------------------------------------------------------------------------
/AndroidManetPtt/res/drawable-hdpi/settings_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ProjectSPAN/android-manet-ptt/HEAD/AndroidManetPtt/res/drawable-hdpi/settings_icon.png
--------------------------------------------------------------------------------
/AndroidManetPtt/res/drawable-ldpi/settings_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ProjectSPAN/android-manet-ptt/HEAD/AndroidManetPtt/res/drawable-ldpi/settings_icon.png
--------------------------------------------------------------------------------
/AndroidManetPtt/res/drawable-mdpi/settings_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ProjectSPAN/android-manet-ptt/HEAD/AndroidManetPtt/res/drawable-mdpi/settings_icon.png
--------------------------------------------------------------------------------
/AndroidManetPtt/res/drawable-hdpi/chat_green_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ProjectSPAN/android-manet-ptt/HEAD/AndroidManetPtt/res/drawable-hdpi/chat_green_icon.png
--------------------------------------------------------------------------------
/AndroidManetPtt/res/drawable-hdpi/chat_orange_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ProjectSPAN/android-manet-ptt/HEAD/AndroidManetPtt/res/drawable-hdpi/chat_orange_icon.png
--------------------------------------------------------------------------------
/AndroidManetPtt/res/drawable-hdpi/group_green_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ProjectSPAN/android-manet-ptt/HEAD/AndroidManetPtt/res/drawable-hdpi/group_green_icon.png
--------------------------------------------------------------------------------
/AndroidManetPtt/res/drawable-hdpi/group_red_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ProjectSPAN/android-manet-ptt/HEAD/AndroidManetPtt/res/drawable-hdpi/group_red_icon.png
--------------------------------------------------------------------------------
/AndroidManetPtt/res/drawable-hdpi/orb_green_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ProjectSPAN/android-manet-ptt/HEAD/AndroidManetPtt/res/drawable-hdpi/orb_green_icon.png
--------------------------------------------------------------------------------
/AndroidManetPtt/res/drawable-hdpi/orb_orange_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ProjectSPAN/android-manet-ptt/HEAD/AndroidManetPtt/res/drawable-hdpi/orb_orange_icon.png
--------------------------------------------------------------------------------
/AndroidManetPtt/res/drawable-hdpi/peer_green_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ProjectSPAN/android-manet-ptt/HEAD/AndroidManetPtt/res/drawable-hdpi/peer_green_icon.png
--------------------------------------------------------------------------------
/AndroidManetPtt/res/drawable-hdpi/group_orange_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ProjectSPAN/android-manet-ptt/HEAD/AndroidManetPtt/res/drawable-hdpi/group_orange_icon.png
--------------------------------------------------------------------------------
/AndroidManetPtt/res/drawable/microphone_normal_image.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ProjectSPAN/android-manet-ptt/HEAD/AndroidManetPtt/res/drawable/microphone_normal_image.png
--------------------------------------------------------------------------------
/AndroidManetPtt/res/drawable/microphone_conflict_image.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ProjectSPAN/android-manet-ptt/HEAD/AndroidManetPtt/res/drawable/microphone_conflict_image.png
--------------------------------------------------------------------------------
/AndroidManetPtt/res/drawable/microphone_disabled_image.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ProjectSPAN/android-manet-ptt/HEAD/AndroidManetPtt/res/drawable/microphone_disabled_image.png
--------------------------------------------------------------------------------
/AndroidManetPtt/res/drawable/microphone_playback_image.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ProjectSPAN/android-manet-ptt/HEAD/AndroidManetPtt/res/drawable/microphone_playback_image.png
--------------------------------------------------------------------------------
/AndroidManetPtt/res/drawable/microphone_pressed_image.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ProjectSPAN/android-manet-ptt/HEAD/AndroidManetPtt/res/drawable/microphone_pressed_image.png
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | android-manet-ptt
2 | =================
3 |
4 | SPAN - Android Manet Push-to-Talk Voice Chat
5 |
6 | Google Play:
7 | https://play.google.com/store/apps/details?id=org.span.ptt
8 |
--------------------------------------------------------------------------------
/AndroidManetPtt/docs/license/copyright.txt:
--------------------------------------------------------------------------------
1 | SPAN - Smart Phone Ad-Hoc Networking project
2 | Copyright (c) 2012 The MITRE Corporation.
3 |
4 | Portions of the code, images, and other resources are
5 | copyright (c) 2012 Ionut Ursuleanu.
--------------------------------------------------------------------------------
/AndroidManetPtt/obj/local/armeabi/objs/speex_jni/speex/libspeex/gain_table.o.d:
--------------------------------------------------------------------------------
1 | /home/ionut/Android/workspace/pttdroid/obj/local/armeabi/objs/speex_jni/speex/libspeex/gain_table.o: \
2 | /home/ionut/Android/workspace/pttdroid/jni/speex/libspeex/gain_table.c
3 |
--------------------------------------------------------------------------------
/AndroidManetPtt/obj/local/armeabi/objs/speex_jni/speex/libspeex/exc_5_64_table.o.d:
--------------------------------------------------------------------------------
1 | /home/ionut/Android/workspace/pttdroid/obj/local/armeabi/objs/speex_jni/speex/libspeex/exc_5_64_table.o: \
2 | /home/ionut/Android/workspace/pttdroid/jni/speex/libspeex/exc_5_64_table.c
3 |
--------------------------------------------------------------------------------
/AndroidManetPtt/obj/local/armeabi/objs/speex_jni/speex/libspeex/gain_table_lbr.o.d:
--------------------------------------------------------------------------------
1 | /home/ionut/Android/workspace/pttdroid/obj/local/armeabi/objs/speex_jni/speex/libspeex/gain_table_lbr.o: \
2 | /home/ionut/Android/workspace/pttdroid/jni/speex/libspeex/gain_table_lbr.c
3 |
--------------------------------------------------------------------------------
/AndroidManetPtt/obj/local/armeabi/objs/speex_jni/speex/libspeex/lsp_tables_nb.o.d:
--------------------------------------------------------------------------------
1 | /home/ionut/Android/workspace/pttdroid/obj/local/armeabi/objs/speex_jni/speex/libspeex/lsp_tables_nb.o: \
2 | /home/ionut/Android/workspace/pttdroid/jni/speex/libspeex/lsp_tables_nb.c
3 |
--------------------------------------------------------------------------------
/AndroidManetPtt/obj/local/armeabi/objs/speex_jni/speex/libspeex/exc_10_16_table.o.d:
--------------------------------------------------------------------------------
1 | /home/ionut/Android/workspace/pttdroid/obj/local/armeabi/objs/speex_jni/speex/libspeex/exc_10_16_table.o: \
2 | /home/ionut/Android/workspace/pttdroid/jni/speex/libspeex/exc_10_16_table.c
3 |
--------------------------------------------------------------------------------
/AndroidManetPtt/obj/local/armeabi/objs/speex_jni/speex/libspeex/exc_10_32_table.o.d:
--------------------------------------------------------------------------------
1 | /home/ionut/Android/workspace/pttdroid/obj/local/armeabi/objs/speex_jni/speex/libspeex/exc_10_32_table.o: \
2 | /home/ionut/Android/workspace/pttdroid/jni/speex/libspeex/exc_10_32_table.c
3 |
--------------------------------------------------------------------------------
/AndroidManetPtt/obj/local/armeabi/objs/speex_jni/speex/libspeex/exc_20_32_table.o.d:
--------------------------------------------------------------------------------
1 | /home/ionut/Android/workspace/pttdroid/obj/local/armeabi/objs/speex_jni/speex/libspeex/exc_20_32_table.o: \
2 | /home/ionut/Android/workspace/pttdroid/jni/speex/libspeex/exc_20_32_table.c
3 |
--------------------------------------------------------------------------------
/AndroidManetPtt/obj/local/armeabi/objs/speex_jni/speex/libspeex/exc_5_256_table.o.d:
--------------------------------------------------------------------------------
1 | /home/ionut/Android/workspace/pttdroid/obj/local/armeabi/objs/speex_jni/speex/libspeex/exc_5_256_table.o: \
2 | /home/ionut/Android/workspace/pttdroid/jni/speex/libspeex/exc_5_256_table.c
3 |
--------------------------------------------------------------------------------
/AndroidManetPtt/obj/local/armeabi/objs/speex_jni/speex/libspeex/exc_8_128_table.o.d:
--------------------------------------------------------------------------------
1 | /home/ionut/Android/workspace/pttdroid/obj/local/armeabi/objs/speex_jni/speex/libspeex/exc_8_128_table.o: \
2 | /home/ionut/Android/workspace/pttdroid/jni/speex/libspeex/exc_8_128_table.c
3 |
--------------------------------------------------------------------------------
/AndroidManetPtt/obj/local/armeabi/objs/speex_jni/speex/libspeex/high_lsp_tables.o.d:
--------------------------------------------------------------------------------
1 | /home/ionut/Android/workspace/pttdroid/obj/local/armeabi/objs/speex_jni/speex/libspeex/high_lsp_tables.o: \
2 | /home/ionut/Android/workspace/pttdroid/jni/speex/libspeex/high_lsp_tables.c
3 |
--------------------------------------------------------------------------------
/AndroidManetPtt/.settings/org.eclipse.jdt.core.prefs:
--------------------------------------------------------------------------------
1 | #Fri Nov 26 13:37:45 EET 2010
2 | eclipse.preferences.version=1
3 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
4 | org.eclipse.jdt.core.compiler.compliance=1.5
5 | org.eclipse.jdt.core.compiler.source=1.5
6 |
--------------------------------------------------------------------------------
/AndroidManetPtt/jni/speex/include/speex/speex_config_types.h:
--------------------------------------------------------------------------------
1 | #ifndef __SPEEX_TYPES_H__
2 | #define __SPEEX_TYPES_H__
3 |
4 | /* these are filled in by configure */
5 | typedef short spx_int16_t;
6 | typedef unsigned short spx_uint16_t;
7 | typedef int spx_int32_t;
8 | typedef unsigned int spx_uint32_t;
9 |
10 | #endif
11 |
12 |
--------------------------------------------------------------------------------
/AndroidManetPtt/res/layout/groupname.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/AndroidManetPtt/res/layout/viewchannel.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/AndroidManetPtt/res/layout/listtextitem.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/AndroidManetPtt/.classpath:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/AndroidManetPtt/src/org/span/ptt/channels/NullChannel.java:
--------------------------------------------------------------------------------
1 | package org.span.ptt.channels;
2 |
3 | public class NullChannel extends Channel {
4 |
5 | // NOTE: should only be invoked by ChannelHelper
6 | protected NullChannel() {
7 | super(ChannelHelper.CHANNEL_NULL);
8 | }
9 |
10 | @Override
11 | public boolean equals(Object other) {
12 | if (other instanceof NullChannel) {
13 | return true;
14 | }
15 | return false;
16 | }
17 |
18 | @Override
19 | public boolean isRecorderEnabled() {
20 | return false;
21 | }
22 |
23 | @Override
24 | public boolean isPlayerEnabled() {
25 | return false;
26 | }
27 | }
--------------------------------------------------------------------------------
/AndroidManetPtt/project.properties:
--------------------------------------------------------------------------------
1 | # This file is automatically generated by Android Tools.
2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED!
3 | #
4 | # This file must be checked in Version Control Systems.
5 | #
6 | # To customize properties used by the Ant build system edit
7 | # "ant.properties", and override values to adapt the script to your
8 | # project structure.
9 | #
10 | # To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
11 | #proguard.config=${sdk.dir}\tools\proguard\proguard-android.txt:proguard-project.txt
12 |
13 | # Project target.
14 | target=android-9
15 |
--------------------------------------------------------------------------------
/AndroidManetPtt/src/ro/ui/pttdroid/codecs/Speex.java:
--------------------------------------------------------------------------------
1 | package ro.ui.pttdroid.codecs;
2 |
3 | public class Speex {
4 |
5 | static {
6 | System.loadLibrary("speex_jni");
7 | }
8 |
9 | private static final int[] encodedSizes = {6, 10, 15, 20, 20, 28, 28, 38, 38, 46, 62};
10 |
11 | public static int getEncodedSize(int quality) {
12 | return encodedSizes[quality];
13 | }
14 |
15 | public static native void open(int quality);
16 | public static native int decode(byte[] in, int length, short[] out);
17 | public static native int encode(short[] in, byte[] out);
18 | public static native void close();
19 |
20 | }
21 |
--------------------------------------------------------------------------------
/AndroidManetPtt/src/org/span/ptt/channels/ListenOnlyChannel.java:
--------------------------------------------------------------------------------
1 | package org.span.ptt.channels;
2 |
3 | public class ListenOnlyChannel extends Channel {
4 |
5 | // NOTE: should only be invoked by ChannelHelper
6 | protected ListenOnlyChannel () {
7 | super(ChannelHelper.CHANNEL_LISTEN_ONLY);
8 | }
9 |
10 | @Override
11 | public boolean equals(Object other) {
12 | if (other instanceof ListenOnlyChannel) {
13 | return true;
14 | }
15 | return false;
16 | }
17 |
18 | @Override
19 | public boolean isRecorderEnabled() {
20 | return false;
21 | }
22 |
23 | @Override
24 | public boolean isPlayerEnabled() {
25 | return true;
26 | }
27 | }
--------------------------------------------------------------------------------
/AndroidManetPtt/src/org/span/ptt/groups/Group.java:
--------------------------------------------------------------------------------
1 | package org.span.ptt.groups;
2 |
3 | import java.net.InetAddress;
4 | import java.util.List;
5 |
6 | public class Group {
7 |
8 | public int id = -1;
9 | public String name = null;
10 | public List peers = null;
11 | public InetAddress addr = null;
12 |
13 | public Group (int id, String name, List peers, InetAddress addr) {
14 | this.id = id;
15 | this.name = name;
16 | this.peers = peers;
17 | this.addr = addr;
18 | }
19 |
20 | @Override
21 | public String toString() {
22 | return name;
23 | }
24 |
25 | public boolean containsHostAddress(String host) {
26 | return peers.contains(host);
27 | }
28 | }
--------------------------------------------------------------------------------
/AndroidManetPtt/res/layout/listchannelrow.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
13 |
14 |
17 |
18 |
--------------------------------------------------------------------------------
/AndroidManetPtt/src/org/span/ptt/channels/PeerChannel.java:
--------------------------------------------------------------------------------
1 | package org.span.ptt.channels;
2 |
3 | import java.net.InetAddress;
4 |
5 | public class PeerChannel extends Channel {
6 |
7 | // NOTE: should only be invoked by ChannelHelper
8 | public PeerChannel(String name, InetAddress addr) { // TODO
9 | super(name);
10 | this.addr = addr;
11 | }
12 |
13 | @Override
14 | public boolean equals(Object other) {
15 | if (other instanceof PeerChannel) {
16 | PeerChannel channel = (PeerChannel) other;
17 | if (channel.name.equals(name)) {
18 | return true;
19 | }
20 | }
21 | return false;
22 | }
23 |
24 | @Override
25 | public boolean isRecorderEnabled() {
26 | return true;
27 | }
28 |
29 | @Override
30 | public boolean isPlayerEnabled() {
31 | return true;
32 | }
33 | }
--------------------------------------------------------------------------------
/AndroidManetPtt/res/values/arrays.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | - Broadcast
5 | - Multicast
6 | - Unicast
7 |
8 |
9 | - 0
10 | - 1
11 | - 2
12 |
13 |
14 |
15 | - 24.6 kbps
16 | - 18.2 kbps
17 | - 15.0 kbps
18 | - 11.0 kbps
19 | - 8.00 kbps
20 | - 5.95 kbps
21 | - 3.95 kbps
22 |
23 |
24 | - 10
25 | - 9
26 | - 7
27 | - 5
28 | - 3
29 | - 2
30 | - 1
31 |
32 |
33 |
--------------------------------------------------------------------------------
/AndroidManetPtt/obj/local/armeabi/objs/speex_jni/speex/libspeex/window.o.d:
--------------------------------------------------------------------------------
1 | /home/ionut/Android/workspace/pttdroid/obj/local/armeabi/objs/speex_jni/speex/libspeex/window.o: \
2 | /home/ionut/Android/workspace/pttdroid/jni/speex/libspeex/window.c \
3 | /home/ionut/Android/workspace/pttdroid/jni/speex/libspeex/arch.h \
4 | /home/ionut/Android/workspace/pttdroid/jni/speex/include/speex/speex_types.h \
5 | /home/ionut/Android/workspace/pttdroid/jni/speex/include/speex/speex_config_types.h \
6 | /home/ionut/Android/workspace/pttdroid/jni/speex/libspeex/fixed_generic.h
7 |
8 | /home/ionut/Android/workspace/pttdroid/jni/speex/libspeex/arch.h:
9 |
10 | /home/ionut/Android/workspace/pttdroid/jni/speex/include/speex/speex_types.h:
11 |
12 | /home/ionut/Android/workspace/pttdroid/jni/speex/include/speex/speex_config_types.h:
13 |
14 | /home/ionut/Android/workspace/pttdroid/jni/speex/libspeex/fixed_generic.h:
15 |
--------------------------------------------------------------------------------
/AndroidManetPtt/res/layout/viewgroup.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
10 |
11 |
16 |
17 |
18 |
19 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/AndroidManetPtt/res/layout/viewgroups.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
10 |
11 |
16 |
17 |
18 |
19 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/AndroidManetPtt/res/menu/menu.xml:
--------------------------------------------------------------------------------
1 |
2 |
24 |
--------------------------------------------------------------------------------
/AndroidManetPtt/res/layout/spinnerchannelrow.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
13 |
14 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/AndroidManetPtt/src/org/span/ptt/service/ConnectionServiceHelper.java:
--------------------------------------------------------------------------------
1 | package org.span.ptt.service;
2 |
3 | import android.widget.Toast;
4 |
5 | public class ConnectionServiceHelper {
6 |
7 | // singleton
8 | private static ConnectionServiceHelper instance = null;
9 |
10 | private ConnectionService service = null;
11 |
12 | private ConnectionServiceHelper() {}
13 |
14 | public static ConnectionServiceHelper getInstance() {
15 | if (instance == null) {
16 | instance = new ConnectionServiceHelper();
17 | }
18 | return instance;
19 | }
20 |
21 | public void setService(ConnectionService service) {
22 | this.service = service;
23 | }
24 |
25 | private void displayToastMessage(String message) {
26 | Toast.makeText(service, message, Toast.LENGTH_LONG).show();
27 | }
28 |
29 | public void setup() {
30 | service.showNotification("Push to talk service is running."); // TODO: use strings.xml
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/AndroidManetPtt/src/org/span/ptt/channels/GroupChannel.java:
--------------------------------------------------------------------------------
1 | package org.span.ptt.channels;
2 |
3 | import java.util.List;
4 |
5 | import org.span.ptt.groups.Group;
6 |
7 |
8 | public class GroupChannel extends Channel {
9 |
10 | public Group group = null;
11 | public List channels = null;
12 |
13 | // NOTE: should only be invoked by ChannelHelper
14 | protected GroupChannel (Group group, List channels) {
15 | super(group.name);
16 | this.group = group;
17 | this.channels = channels;
18 | addr = group.addr;
19 | }
20 |
21 | @Override
22 | public boolean equals(Object other) {
23 | if (other instanceof GroupChannel) {
24 | GroupChannel channel = (GroupChannel) other;
25 | if (channel.group.id == group.id) {
26 | return true;
27 | }
28 | }
29 | return false;
30 | }
31 |
32 | @Override
33 | public boolean isRecorderEnabled() {
34 | return true;
35 | }
36 |
37 | @Override
38 | public boolean isPlayerEnabled() {
39 | return true;
40 | }
41 | }
--------------------------------------------------------------------------------
/AndroidManetPtt/.project:
--------------------------------------------------------------------------------
1 |
2 |
3 | AndroidManetPtt
4 |
5 |
6 |
7 |
8 |
9 | com.android.ide.eclipse.adt.ResourceManagerBuilder
10 |
11 |
12 |
13 |
14 | com.android.ide.eclipse.adt.PreCompilerBuilder
15 |
16 |
17 |
18 |
19 | org.eclipse.jdt.core.javabuilder
20 |
21 |
22 |
23 |
24 | com.android.ide.eclipse.adt.ApkBuilder
25 |
26 |
27 |
28 |
29 |
30 | com.android.ide.eclipse.adt.AndroidNature
31 | org.eclipse.jdt.core.javanature
32 |
33 |
34 |
--------------------------------------------------------------------------------
/AndroidManetPtt/obj/local/armeabi/objs/speex_jni/speex/libspeex/lpc.o.d:
--------------------------------------------------------------------------------
1 | /home/ionut/Android/workspace/pttdroid/obj/local/armeabi/objs/speex_jni/speex/libspeex/lpc.o: \
2 | /home/ionut/Android/workspace/pttdroid/jni/speex/libspeex/lpc.c \
3 | /home/ionut/Android/workspace/pttdroid/jni/speex/libspeex/lpc.h \
4 | /home/ionut/Android/workspace/pttdroid/jni/speex/libspeex/arch.h \
5 | /home/ionut/Android/workspace/pttdroid/jni/speex/include/speex/speex_types.h \
6 | /home/ionut/Android/workspace/pttdroid/jni/speex/include/speex/speex_config_types.h \
7 | /home/ionut/Android/workspace/pttdroid/jni/speex/libspeex/fixed_generic.h
8 |
9 | /home/ionut/Android/workspace/pttdroid/jni/speex/libspeex/lpc.h:
10 |
11 | /home/ionut/Android/workspace/pttdroid/jni/speex/libspeex/arch.h:
12 |
13 | /home/ionut/Android/workspace/pttdroid/jni/speex/include/speex/speex_types.h:
14 |
15 | /home/ionut/Android/workspace/pttdroid/jni/speex/include/speex/speex_config_types.h:
16 |
17 | /home/ionut/Android/workspace/pttdroid/jni/speex/libspeex/fixed_generic.h:
18 |
--------------------------------------------------------------------------------
/AndroidManetPtt/res/layout/main.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
11 |
12 |
16 |
17 |
22 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/AndroidManetPtt/obj/local/armeabi/objs/speex_jni/speex_jni.o.d:
--------------------------------------------------------------------------------
1 | /home/ionut/Android/workspace/pttdroid/obj/local/armeabi/objs/speex_jni/speex_jni.o: \
2 | /home/ionut/Android/workspace/pttdroid/jni/speex_jni.cpp \
3 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/jni.h \
4 | /home/ionut/Android/workspace/pttdroid/jni/speex/include/speex/speex.h \
5 | /home/ionut/Android/workspace/pttdroid/jni/speex/include/speex/speex_bits.h \
6 | /home/ionut/Android/workspace/pttdroid/jni/speex/include/speex/speex_types.h \
7 | /home/ionut/Android/workspace/pttdroid/jni/speex/include/speex/speex_config_types.h
8 |
9 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/jni.h:
10 |
11 | /home/ionut/Android/workspace/pttdroid/jni/speex/include/speex/speex.h:
12 |
13 | /home/ionut/Android/workspace/pttdroid/jni/speex/include/speex/speex_bits.h:
14 |
15 | /home/ionut/Android/workspace/pttdroid/jni/speex/include/speex/speex_types.h:
16 |
17 | /home/ionut/Android/workspace/pttdroid/jni/speex/include/speex/speex_config_types.h:
18 |
--------------------------------------------------------------------------------
/AndroidManetPtt/res/layout/creategroup.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
10 |
11 |
16 |
17 |
22 |
23 |
24 |
25 |
28 |
29 |
30 |
--------------------------------------------------------------------------------
/AndroidManetPtt/src/org/span/ptt/util/PhoneIPs.java:
--------------------------------------------------------------------------------
1 | package org.span.ptt.util;
2 |
3 | import java.io.IOException;
4 | import java.net.InetAddress;
5 | import java.net.NetworkInterface;
6 | import java.util.Enumeration;
7 | import java.util.LinkedList;
8 |
9 | import android.util.Log;
10 |
11 | public class PhoneIPs {
12 |
13 | static private LinkedList inetAddresses = new LinkedList();
14 |
15 | public static void load() {
16 | inetAddresses.clear();
17 | try {
18 | Enumeration networkInterfaceEnum = NetworkInterface.getNetworkInterfaces();
19 |
20 | while(networkInterfaceEnum.hasMoreElements()) {
21 | Enumeration inetAddresseEnum = networkInterfaceEnum.nextElement().getInetAddresses();
22 |
23 | while(inetAddresseEnum.hasMoreElements()) {
24 | inetAddresses.add(inetAddresseEnum.nextElement());
25 | }
26 | }
27 | }
28 | catch(IOException e) {
29 | Log.d("MyNetworkInterfaces", e.toString());
30 | }
31 | }
32 |
33 | public static boolean contains(InetAddress addr) {
34 | return inetAddresses.contains(addr);
35 | }
36 |
37 | }
38 |
--------------------------------------------------------------------------------
/AndroidManetPtt/src/org/span/ptt/util/AudioParams.java:
--------------------------------------------------------------------------------
1 | package org.span.ptt.util;
2 |
3 | import android.media.AudioFormat;
4 | import android.media.AudioRecord;
5 | import android.media.AudioTrack;
6 |
7 | public abstract class AudioParams {
8 |
9 | public static final int SAMPLE_RATE = 8000;
10 | public static final int FRAME_SIZE = 160;
11 | public static final int FRAME_SIZE_IN_SHORTS = 160;
12 | public static final int FRAME_SIZE_IN_BYTES = 320;
13 | public static final int ENCODING_PCM_NUM_BITS = AudioFormat.ENCODING_PCM_16BIT;
14 |
15 | public static final int RECORD_BUFFER_SIZE = Math.max(
16 | SAMPLE_RATE,
17 | ceil(AudioRecord.getMinBufferSize(
18 | SAMPLE_RATE,
19 | AudioFormat.CHANNEL_CONFIGURATION_MONO,
20 | ENCODING_PCM_NUM_BITS)));
21 | public static final int TRACK_BUFFER_SIZE = Math.max(
22 | FRAME_SIZE,
23 | ceil(AudioTrack.getMinBufferSize(
24 | SAMPLE_RATE,
25 | AudioFormat.CHANNEL_CONFIGURATION_MONO,
26 | ENCODING_PCM_NUM_BITS)));
27 |
28 | private static int ceil(int size) {
29 | return (int) Math.ceil( ( (double) size / FRAME_SIZE )) * FRAME_SIZE;
30 | }
31 |
32 | }
33 |
--------------------------------------------------------------------------------
/AndroidManetPtt/obj/local/armeabi/objs/speex_jni/speex/libspeex/vq.o.d:
--------------------------------------------------------------------------------
1 | /home/ionut/Android/workspace/pttdroid/obj/local/armeabi/objs/speex_jni/speex/libspeex/vq.o: \
2 | /home/ionut/Android/workspace/pttdroid/jni/speex/libspeex/vq.c \
3 | /home/ionut/Android/workspace/pttdroid/jni/speex/libspeex/vq.h \
4 | /home/ionut/Android/workspace/pttdroid/jni/speex/libspeex/arch.h \
5 | /home/ionut/Android/workspace/pttdroid/jni/speex/include/speex/speex_types.h \
6 | /home/ionut/Android/workspace/pttdroid/jni/speex/include/speex/speex_config_types.h \
7 | /home/ionut/Android/workspace/pttdroid/jni/speex/libspeex/fixed_generic.h \
8 | /home/ionut/Android/workspace/pttdroid/jni/speex/libspeex/stack_alloc.h
9 |
10 | /home/ionut/Android/workspace/pttdroid/jni/speex/libspeex/vq.h:
11 |
12 | /home/ionut/Android/workspace/pttdroid/jni/speex/libspeex/arch.h:
13 |
14 | /home/ionut/Android/workspace/pttdroid/jni/speex/include/speex/speex_types.h:
15 |
16 | /home/ionut/Android/workspace/pttdroid/jni/speex/include/speex/speex_config_types.h:
17 |
18 | /home/ionut/Android/workspace/pttdroid/jni/speex/libspeex/fixed_generic.h:
19 |
20 | /home/ionut/Android/workspace/pttdroid/jni/speex/libspeex/stack_alloc.h:
21 |
--------------------------------------------------------------------------------
/AndroidManetPtt/src/org/span/ptt/recorder/MultiRecorder.java:
--------------------------------------------------------------------------------
1 | package org.span.ptt.recorder;
2 |
3 | import java.util.HashSet;
4 | import java.util.Set;
5 |
6 | import org.span.ptt.channels.Channel;
7 | import org.span.ptt.channels.GroupChannel;
8 |
9 |
10 | public class MultiRecorder extends Recorder {
11 |
12 | private Set recorders = null;
13 |
14 | public MultiRecorder(Channel channel) {
15 | super(channel);
16 | }
17 |
18 | protected void init() {
19 | super.init();
20 |
21 | GroupChannel groupChannel = (GroupChannel) channel;
22 |
23 | recorders = new HashSet();
24 |
25 | Recorder recorder = null;
26 | for(Channel channel : groupChannel.channels) {
27 | recorder = new SingleRecorder(channel);
28 | recorder.init();
29 | recorders.add(recorder);
30 | }
31 | }
32 |
33 | protected void release() {
34 | super.release();
35 |
36 | if(recorders != null) {
37 | for (Recorder recorder : recorders) {
38 | recorder.release();
39 | }
40 | }
41 | }
42 |
43 | @Override
44 | protected void send() {
45 | for (Recorder recorder : recorders) {
46 | recorder.send();
47 | }
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/AndroidManetPtt/res/xml/settings_audio.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
9 |
10 |
18 |
19 |
25 |
26 |
32 |
33 |
39 |
40 |
41 |
--------------------------------------------------------------------------------
/AndroidManetPtt/jni/Android.mk:
--------------------------------------------------------------------------------
1 | LOCAL_PATH := $(call my-dir)
2 | SPEEX := speex
3 |
4 | include $(CLEAR_VARS)
5 | LOCAL_MODULE := speex_jni
6 | LOCAL_SRC_FILES := speex_jni.cpp \
7 | $(SPEEX)/libspeex/speex.c \
8 | $(SPEEX)/libspeex/speex_callbacks.c \
9 | $(SPEEX)/libspeex/bits.c \
10 | $(SPEEX)/libspeex/modes.c \
11 | $(SPEEX)/libspeex/nb_celp.c \
12 | $(SPEEX)/libspeex/exc_20_32_table.c \
13 | $(SPEEX)/libspeex/exc_5_256_table.c \
14 | $(SPEEX)/libspeex/exc_5_64_table.c \
15 | $(SPEEX)/libspeex/exc_8_128_table.c \
16 | $(SPEEX)/libspeex/exc_10_32_table.c \
17 | $(SPEEX)/libspeex/exc_10_16_table.c \
18 | $(SPEEX)/libspeex/filters.c \
19 | $(SPEEX)/libspeex/quant_lsp.c \
20 | $(SPEEX)/libspeex/ltp.c \
21 | $(SPEEX)/libspeex/lpc.c \
22 | $(SPEEX)/libspeex/lsp.c \
23 | $(SPEEX)/libspeex/vbr.c \
24 | $(SPEEX)/libspeex/gain_table.c \
25 | $(SPEEX)/libspeex/gain_table_lbr.c \
26 | $(SPEEX)/libspeex/lsp_tables_nb.c \
27 | $(SPEEX)/libspeex/cb_search.c \
28 | $(SPEEX)/libspeex/vq.c \
29 | $(SPEEX)/libspeex/window.c \
30 | $(SPEEX)/libspeex/high_lsp_tables.c
31 |
32 | LOCAL_C_INCLUDES +=
33 | LOCAL_CFLAGS = -DFIXED_POINT -DEXPORT="" -UHAVE_CONFIG_H -I$(LOCAL_PATH)/$(SPEEX)/include
34 | include $(BUILD_SHARED_LIBRARY)
35 |
--------------------------------------------------------------------------------
/AndroidManetPtt/src/org/span/ptt/groups/ViewGroup.java:
--------------------------------------------------------------------------------
1 | package org.span.ptt.groups;
2 |
3 | import org.span.ptt.R;
4 |
5 | import android.app.ListActivity;
6 | import android.os.Bundle;
7 | import android.view.View;
8 | import android.widget.ArrayAdapter;
9 | import android.widget.Button;
10 | import android.widget.ListView;
11 |
12 | public class ViewGroup extends ListActivity {
13 |
14 | private ListView mainListView = null;
15 |
16 | private Button btnDelete = null;
17 |
18 | private Group group = null;
19 |
20 | /** Called when the activity is first created. */
21 | @Override
22 | public void onCreate(Bundle bundle) {
23 | super.onCreate(bundle);
24 |
25 | setContentView(R.layout.viewgroup);
26 |
27 | btnDelete = (Button) findViewById(R.id.btnDelete);
28 | btnDelete.setOnClickListener(new View.OnClickListener() {
29 | public void onClick(View v) {
30 | GroupHelper.deleteGroup(group.id);
31 | finish();
32 | }
33 | });
34 |
35 | mainListView = getListView();
36 |
37 | int id = getIntent().getExtras().getInt(GroupHelper.GROUP_ID);
38 |
39 | group = GroupHelper.getGroup(id);
40 |
41 | showGroup();
42 | }
43 |
44 | private void showGroup() {
45 | setTitle("View Group: " + group.name);
46 |
47 | String[] peers = new String[group.peers.size()];
48 | group.peers.toArray(peers);
49 |
50 | mainListView.setAdapter(new ArrayAdapter(this,
51 | R.layout.listtextitem, peers));
52 |
53 | mainListView.setItemsCanFocus(false);
54 | mainListView.setChoiceMode(ListView.CHOICE_MODE_NONE);
55 | mainListView.setEnabled(false); // prevent clicking
56 | }
57 | }
--------------------------------------------------------------------------------
/AndroidManetPtt/src/org/span/ptt/channels/ViewChannel.java:
--------------------------------------------------------------------------------
1 | package org.span.ptt.channels;
2 |
3 | import java.util.ArrayList;
4 | import java.util.List;
5 |
6 | import org.span.ptt.PeersQueryActivity;
7 | import org.span.ptt.R;
8 |
9 | import android.os.Bundle;
10 | import android.view.View;
11 | import android.widget.AdapterView;
12 | import android.widget.ListView;
13 | import android.widget.AdapterView.OnItemClickListener;
14 |
15 | public class ViewChannel extends PeersQueryActivity {
16 |
17 | private ListView mainListView = null;
18 | private ChannelAdapter adapter = null;
19 |
20 | private Channel channel = null;
21 |
22 | /** Called when the activity is first created. */
23 | @Override
24 | public void onCreate(Bundle bundle) {
25 | super.onCreate(bundle);
26 |
27 | setContentView(R.layout.viewchannel);
28 |
29 | mainListView = (ListView) findViewById(R.id.list);
30 | mainListView.setOnItemClickListener(new OnItemClickListener() {
31 | public void onItemClick(AdapterView> parent, View view, int position, long index) {
32 | // TODO
33 | }
34 | });
35 |
36 | channel = ChannelHelper.getChannel();
37 | }
38 |
39 | protected void updateChannelList() {
40 | List myChannels = new ArrayList();
41 | if (channel instanceof PeerChannel) {
42 | myChannels.add(channel);
43 | } else if (channel instanceof GroupChannel) {
44 | GroupChannel groupChannel = (GroupChannel) channel;
45 | myChannels.addAll(groupChannel.channels);
46 | }
47 |
48 | adapter = new ChannelAdapter(this, R.layout.listchannelrow, myChannels);
49 | mainListView.setAdapter(adapter);
50 | mainListView.setItemsCanFocus(false);
51 | mainListView.setChoiceMode(ListView.CHOICE_MODE_NONE); // TODO
52 |
53 | adapter.notifyDataSetChanged(); // force redraw
54 | }
55 | }
--------------------------------------------------------------------------------
/AndroidManetPtt/jni/speex/COPYING:
--------------------------------------------------------------------------------
1 | Copyright 2002-2008 Xiph.org Foundation
2 | Copyright 2002-2008 Jean-Marc Valin
3 | Copyright 2005-2007 Analog Devices Inc.
4 | Copyright 2005-2008 Commonwealth Scientific and Industrial Research
5 | Organisation (CSIRO)
6 | Copyright 1993, 2002, 2006 David Rowe
7 | Copyright 2003 EpicGames
8 | Copyright 1992-1994 Jutta Degener, Carsten Bormann
9 |
10 | Redistribution and use in source and binary forms, with or without
11 | modification, are permitted provided that the following conditions
12 | are met:
13 |
14 | - Redistributions of source code must retain the above copyright
15 | notice, this list of conditions and the following disclaimer.
16 |
17 | - Redistributions in binary form must reproduce the above copyright
18 | notice, this list of conditions and the following disclaimer in the
19 | documentation and/or other materials provided with the distribution.
20 |
21 | - Neither the name of the Xiph.org Foundation nor the names of its
22 | contributors may be used to endorse or promote products derived from
23 | this software without specific prior written permission.
24 |
25 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
26 | ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
27 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
28 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR
29 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
30 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
31 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
32 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
33 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
34 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
35 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36 |
--------------------------------------------------------------------------------
/AndroidManetPtt/src/org/span/ptt/channels/ChannelAdapter.java:
--------------------------------------------------------------------------------
1 | package org.span.ptt.channels;
2 |
3 | import java.util.List;
4 |
5 | import org.span.ptt.R;
6 |
7 |
8 | import android.content.Context;
9 | import android.view.LayoutInflater;
10 | import android.view.View;
11 | import android.view.ViewGroup;
12 | import android.widget.BaseAdapter;
13 | import android.widget.ImageButton;
14 | import android.widget.TextView;
15 |
16 | public class ChannelAdapter extends BaseAdapter {
17 | private Context context;
18 |
19 | private int resource = -1;
20 |
21 | private List channels;
22 |
23 | public ChannelAdapter(Context context, int resource, List channels) {
24 | this.context = context;
25 | this.resource = resource;
26 | this.channels = channels;
27 | }
28 |
29 | public int getCount() {
30 | return channels.size();
31 | }
32 |
33 | public Object getItem(int position) {
34 | return channels.get(position);
35 | }
36 |
37 | public long getItemId(int position) {
38 | return position;
39 | }
40 |
41 | public View getView(int position, View convertView, ViewGroup viewGroup) {
42 | Channel channel = channels.get(position);
43 | if (convertView == null) {
44 | LayoutInflater inflater = (LayoutInflater) context
45 | .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
46 | convertView = inflater.inflate(resource, null);
47 | }
48 |
49 | TextView tvName = (TextView) convertView.findViewById(R.id.tvName);
50 | tvName.setText(channel.name);
51 |
52 | // set channel status icon
53 | ImageButton btnInfo = (ImageButton) convertView.findViewById(R.id.btnInfo);
54 | int resource = ChannelHelper.getChannelStatusResource(channel);
55 | btnInfo.setImageResource(resource);
56 |
57 | return convertView;
58 | }
59 | }
--------------------------------------------------------------------------------
/AndroidManetPtt/src/org/span/ptt/channels/Channel.java:
--------------------------------------------------------------------------------
1 | package org.span.ptt.channels;
2 |
3 | import java.net.InetAddress;
4 |
5 | import android.content.Context;
6 | import android.content.SharedPreferences;
7 | import android.content.res.Resources;
8 | import android.preference.PreferenceManager;
9 |
10 | public abstract class Channel implements Comparable {
11 |
12 | public static final int GOOD_STATUS = 0;
13 | public static final int BAD_STATUS = 1;
14 | public static final int PARTIAL_STATUS = 2;
15 |
16 | public static final int BROADCAST = 0;
17 | public static final int MULTICAST = 1;
18 | public static final int UNICAST = 2;
19 |
20 | public static final int VOICE_PORT = 2011;
21 | public static final int PROBE_PORT = 2012;
22 |
23 | public String name = null;
24 |
25 | public int port = VOICE_PORT;
26 | public InetAddress addr = null;
27 |
28 | public int status = BAD_STATUS;
29 |
30 | public Channel(String name) {
31 | this.name = name;
32 | }
33 |
34 | @Override
35 | public String toString() {
36 | return name;
37 | }
38 |
39 | @Override
40 | public abstract boolean equals(Object other);
41 |
42 | public int compareTo(Channel other) {
43 | return name.compareTo(other.name);
44 | }
45 |
46 | public abstract boolean isRecorderEnabled();
47 |
48 | public abstract boolean isPlayerEnabled();
49 |
50 | public void setStatus(int status) {
51 | this.status = status;
52 | }
53 |
54 | public void getSettings(Context context) {
55 | SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
56 | Resources res = context.getResources();
57 |
58 | /*
59 | useSpeex = prefs.getBoolean(
60 | "use_speex",
61 | USE_SPEEX);
62 | speexQuality = Integer.parseInt(prefs.getString(
63 | "speex_quality",
64 | res.getStringArray(R.array.speex_quality_values)[0]));
65 | echoState = prefs.getBoolean(
66 | "echo",
67 | ECHO_OFF);
68 | speakerState = prefs.getBoolean(
69 | "speaker",
70 | SPEAKER_OFF);
71 | */
72 | }
73 | }
--------------------------------------------------------------------------------
/AndroidManetPtt/res/xml/settings_comm.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
45 |
46 |
52 |
53 |
--------------------------------------------------------------------------------
/AndroidManetPtt/src/org/span/ptt/groups/ViewGroups.java:
--------------------------------------------------------------------------------
1 | package org.span.ptt.groups;
2 |
3 | import java.util.List;
4 |
5 | import org.span.ptt.R;
6 | import org.span.ptt.channels.Channel;
7 |
8 |
9 | import android.app.ListActivity;
10 | import android.content.Intent;
11 | import android.os.Bundle;
12 | import android.view.View;
13 | import android.widget.AdapterView;
14 | import android.widget.AdapterView.OnItemClickListener;
15 | import android.widget.ArrayAdapter;
16 | import android.widget.Button;
17 | import android.widget.ListView;
18 |
19 | public class ViewGroups extends ListActivity {
20 |
21 | private ListView mainListView = null;
22 |
23 | private Button btnCreate = null;
24 |
25 | private List groups = null;
26 |
27 | /** Called when the activity is first created. */
28 | @Override
29 | public void onCreate(Bundle bundle) {
30 | super.onCreate(bundle);
31 |
32 | setContentView(R.layout.viewgroups);
33 |
34 | btnCreate = (Button) findViewById(R.id.btnCreate);
35 | btnCreate.setOnClickListener(new View.OnClickListener() {
36 | public void onClick(View v) {
37 | Intent i = new Intent(ViewGroups.this, CreateGroup.class);
38 | startActivityForResult(i, 0);
39 | }
40 | });
41 |
42 | mainListView = getListView();
43 | mainListView.setOnItemClickListener(new OnItemClickListener() {
44 | public void onItemClick(AdapterView> parent, View view, int position, long index) {
45 | Intent i = new Intent(ViewGroups.this, ViewGroup.class);
46 | Group group = (Group) mainListView.getAdapter().getItem(position);
47 | i.putExtra(GroupHelper.GROUP_ID, group.id);
48 | startActivityForResult(i, 0);
49 | }
50 | });
51 | }
52 |
53 | @Override
54 | public void onStart() {
55 | super.onStart();
56 |
57 | groups = GroupHelper.getGroups();
58 |
59 | showGroups();
60 | }
61 |
62 | private void showGroups() {
63 | ArrayAdapter adapter =
64 | new ArrayAdapter(this, R.layout.listtextitem, groups);
65 | mainListView.setAdapter(adapter);
66 | mainListView.setItemsCanFocus(false);
67 | mainListView.setChoiceMode(ListView.CHOICE_MODE_SINGLE);
68 | }
69 | }
--------------------------------------------------------------------------------
/AndroidManetPtt/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
24 |
25 |
26 |
28 |
29 |
30 |
32 |
33 |
34 |
36 |
37 |
38 |
40 |
41 |
42 |
44 |
45 |
46 |
49 |
50 |
51 |
52 |
--------------------------------------------------------------------------------
/AndroidManetPtt/jni/speex/libspeex/lpc.h:
--------------------------------------------------------------------------------
1 | /* Copyright (C) 2002 Jean-Marc Valin */
2 | /**
3 | @file lpc.h
4 | @brief Functions for LPC (Linear Prediction Coefficients) analysis
5 | */
6 | /*
7 | Redistribution and use in source and binary forms, with or without
8 | modification, are permitted provided that the following conditions
9 | are met:
10 |
11 | - Redistributions of source code must retain the above copyright
12 | notice, this list of conditions and the following disclaimer.
13 |
14 | - Redistributions in binary form must reproduce the above copyright
15 | notice, this list of conditions and the following disclaimer in the
16 | documentation and/or other materials provided with the distribution.
17 |
18 | - Neither the name of the Xiph.org Foundation nor the names of its
19 | contributors may be used to endorse or promote products derived from
20 | this software without specific prior written permission.
21 |
22 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
23 | ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
24 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
25 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR
26 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
27 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
28 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
29 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
30 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
31 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
32 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 | */
34 |
35 | #ifndef LPC_H
36 | #define LPC_H
37 |
38 | #include "arch.h"
39 |
40 | void _spx_autocorr(
41 | const spx_word16_t * x, /* in: [0...n-1] samples x */
42 | spx_word16_t *ac, /* out: [0...lag-1] ac values */
43 | int lag, int n);
44 |
45 | spx_word32_t /* returns minimum mean square error */
46 | _spx_lpc(
47 | spx_coef_t * lpc, /* [0...p-1] LPC coefficients */
48 | const spx_word16_t * ac, /* in: [0...p] autocorrelation values */
49 | int p
50 | );
51 |
52 |
53 | #endif
54 |
--------------------------------------------------------------------------------
/AndroidManetPtt/jni/speex/libspeex/exc_10_16_table.c:
--------------------------------------------------------------------------------
1 | /* Copyright (C) 2002 Jean-Marc Valin
2 | File: exc_10_16_table.c
3 | Codebook for excitation in narrowband CELP mode (3200 bps)
4 |
5 | Redistribution and use in source and binary forms, with or without
6 | modification, are permitted provided that the following conditions
7 | are met:
8 |
9 | - Redistributions of source code must retain the above copyright
10 | notice, this list of conditions and the following disclaimer.
11 |
12 | - Redistributions in binary form must reproduce the above copyright
13 | notice, this list of conditions and the following disclaimer in the
14 | documentation and/or other materials provided with the distribution.
15 |
16 | - Neither the name of the Xiph.org Foundation nor the names of its
17 | contributors may be used to endorse or promote products derived from
18 | this software without specific prior written permission.
19 |
20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21 | ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR
24 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
26 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
27 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
28 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
29 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
30 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 | */
32 |
33 |
34 | const signed char exc_10_16_table[160] = {
35 | 22,39,14,44,11,35,-2,23,-4,6,
36 | 46,-28,13,-27,-23,12,4,20,-5,9,
37 | 37,-18,-23,23,0,9,-6,-20,4,-1,
38 | -17,-5,-4,17,0,1,9,-2,1,2,
39 | 2,-12,8,-25,39,15,9,16,-55,-11,
40 | 9,11,5,10,-2,-60,8,13,-6,11,
41 | -16,27,-47,-12,11,1,16,-7,9,-3,
42 | -29,9,-14,25,-19,34,36,12,40,-10,
43 | -3,-24,-14,-37,-21,-35,-2,-36,3,-6,
44 | 67,28,6,-17,-3,-12,-16,-15,-17,-7,
45 | -59,-36,-13,1,7,1,2,10,2,11,
46 | 13,10,8,-2,7,3,5,4,2,2,
47 | -3,-8,4,-5,6,7,-42,15,35,-2,
48 | -46,38,28,-20,-9,1,7,-3,0,-2,
49 | 0,0,0,0,0,0,0,0,0,0,
50 | -15,-28,52,32,5,-5,-17,-20,-10,-1};
51 |
--------------------------------------------------------------------------------
/AndroidManetPtt/jni/speex_jni.cpp:
--------------------------------------------------------------------------------
1 | #include
2 |
3 | #include
4 |
5 | const int FRAME_SIZE = 160;
6 |
7 | const int CODEC_OPENED = 1;
8 | const int CODEC_CLOSED = 0;
9 |
10 | int codec_status = 0;
11 |
12 | SpeexBits ebits, dbits;
13 | void *enc_state;
14 | void *dec_state;
15 |
16 | jshort in_enc_tmp[FRAME_SIZE], out_dec_tmp[FRAME_SIZE];
17 | jbyte out_enc_tmp[FRAME_SIZE], in_dec_tmp[FRAME_SIZE];
18 |
19 | extern "C"
20 | JNIEXPORT void JNICALL Java_ro_ui_pttdroid_codecs_Speex_open(JNIEnv *env, jobject obj, jint quality) {
21 | if(codec_status==CODEC_OPENED)
22 | return;
23 |
24 | codec_status = CODEC_OPENED;
25 |
26 | speex_bits_init(&ebits);
27 | speex_bits_init(&dbits);
28 |
29 | enc_state = speex_encoder_init(&speex_nb_mode);
30 | dec_state = speex_decoder_init(&speex_nb_mode);
31 |
32 | int tmp = quality;
33 | speex_encoder_ctl(enc_state, SPEEX_SET_QUALITY, &tmp);
34 | }
35 |
36 | extern "C"
37 | JNIEXPORT jint JNICALL Java_ro_ui_pttdroid_codecs_Speex_encode(JNIEnv *env, jobject obj, jshortArray in, jbyteArray out) {
38 | if(codec_status==CODEC_CLOSED)
39 | return (jint)0;
40 |
41 | speex_bits_reset(&ebits);
42 |
43 | env->GetShortArrayRegion(in, 0, FRAME_SIZE, in_enc_tmp);
44 | speex_encode_int(enc_state, in_enc_tmp, &ebits);
45 |
46 | jint outSize = speex_bits_write(&ebits, (char *)out_enc_tmp, FRAME_SIZE);
47 | env->SetByteArrayRegion(out, 0, outSize, out_enc_tmp);
48 |
49 | return (jint)outSize;
50 | }
51 |
52 | extern "C"
53 | JNIEXPORT jint JNICALL Java_ro_ui_pttdroid_codecs_Speex_decode(JNIEnv *env, jobject obj, jbyteArray in, jint inSize, jshortArray out) {
54 | if(codec_status==CODEC_CLOSED)
55 | return (jint)0;
56 |
57 | env->GetByteArrayRegion(in, 0, inSize, in_dec_tmp);
58 | speex_bits_read_from(&dbits, (char *)in_dec_tmp, inSize);
59 | speex_decode_int(dec_state, &dbits, out_dec_tmp);
60 | env->SetShortArrayRegion(out, 0, FRAME_SIZE, out_dec_tmp);
61 |
62 | return (jint)FRAME_SIZE;
63 | }
64 |
65 | extern "C"
66 | JNIEXPORT void JNICALL Java_ro_ui_pttdroid_codecs_Speex_close(JNIEnv *env, jobject obj) {
67 | if(codec_status==CODEC_CLOSED)
68 | return;
69 |
70 | codec_status = CODEC_CLOSED;
71 |
72 | speex_bits_destroy(&ebits);
73 | speex_bits_destroy(&dbits);
74 | speex_decoder_destroy(dec_state);
75 | speex_encoder_destroy(enc_state);
76 | }
77 |
78 |
--------------------------------------------------------------------------------
/AndroidManetPtt/jni/speex/libspeex/gain_table_lbr.c:
--------------------------------------------------------------------------------
1 | /* Copyright (C) 2002 Jean-Marc Valin
2 | File: gain_table_lbr.c
3 | Codebook for 3-tap pitch prediction gain (32 entries)
4 |
5 | Redistribution and use in source and binary forms, with or without
6 | modification, are permitted provided that the following conditions are
7 | met:
8 |
9 | 1. Redistributions of source code must retain the above copyright notice,
10 | this list of conditions and the following disclaimer.
11 |
12 | 2. Redistributions in binary form must reproduce the above copyright
13 | notice, this list of conditions and the following disclaimer in the
14 | documentation and/or other materials provided with the distribution.
15 |
16 | 3. The name of the author may not be used to endorse or promote products
17 | derived from this software without specific prior written permission.
18 |
19 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
20 | IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
21 | OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
22 | DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
23 | INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
24 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
25 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26 | HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
27 | STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
28 | ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 | POSSIBILITY OF SUCH DAMAGE.
30 | */
31 |
32 | const signed char gain_cdbk_lbr[128] = {
33 | -32, -32, -32, 0,
34 | -31, -58, -16, 22,
35 | -41, -24, -43, 14,
36 | -56, -22, -55, 29,
37 | -13, 33, -41, 47,
38 | -4, -39, -9, 29,
39 | -41, 15, -12, 38,
40 | -8, -15, -12, 31,
41 | 1, 2, -44, 40,
42 | -22, -66, -42, 27,
43 | -38, 28, -23, 38,
44 | -21, 14, -37, 31,
45 | 0, 21, -50, 52,
46 | -53, -71, -27, 33,
47 | -37, -1, -19, 25,
48 | -19, -5, -28, 22,
49 | 6, 65, -44, 74,
50 | -33, -48, -33, 9,
51 | -40, 57, -14, 58,
52 | -17, 4, -45, 32,
53 | -31, 38, -33, 36,
54 | -23, 28, -40, 39,
55 | -43, 29, -12, 46,
56 | -34, 13, -23, 28,
57 | -16, 15, -27, 34,
58 | -14, -82, -15, 43,
59 | -31, 25, -32, 29,
60 | -21, 5, -5, 38,
61 | -47, -63, -51, 33,
62 | -46, 12, 3, 47,
63 | -28, -17, -29, 11,
64 | -10, 14, -40, 38};
65 |
--------------------------------------------------------------------------------
/AndroidManetPtt/src/org/span/ptt/recorder/SingleRecorder.java:
--------------------------------------------------------------------------------
1 | package org.span.ptt.recorder;
2 |
3 | import java.io.IOException;
4 | import java.net.DatagramPacket;
5 | import java.net.DatagramSocket;
6 | import java.net.SocketException;
7 |
8 | import org.span.ptt.channels.Channel;
9 |
10 | import android.util.Log;
11 |
12 |
13 | public class SingleRecorder extends Recorder {
14 |
15 | protected DatagramSocket socket;
16 | protected DatagramPacket packet;
17 |
18 | public SingleRecorder(Channel channel) {
19 | super(channel);
20 | }
21 |
22 | @Override
23 | protected void send() {
24 | try {
25 | packet = new DatagramPacket(
26 | encodedFrame,
27 | encodedFrame.length,
28 | channel.addr,
29 | channel.port);
30 |
31 | // Send encoded frame packed within an UDP datagram
32 | if (packet.getAddress() != null) { // TODO: special channel
33 | // Log.d("PTT", "Sending to " + packet.getAddress().getHostAddress() + " : " + bytesToHex(packet.getData())); // DEBUG
34 |
35 | socket.send(packet);
36 | }
37 |
38 | } catch (IOException e) {
39 | e.printStackTrace();
40 | }
41 | }
42 |
43 | public static String bytesToHex(byte[] bytes) {
44 | final char[] hexArray = {'0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'};
45 | char[] hexChars = new char[bytes.length * 2];
46 | int v;
47 | for ( int j = 0; j < bytes.length; j++ ) {
48 | v = bytes[j] & 0xFF;
49 | hexChars[j * 2] = hexArray[v >>> 4];
50 | hexChars[j * 2 + 1] = hexArray[v & 0x0F];
51 | }
52 | return new String(hexChars);
53 | }
54 |
55 | protected void init() {
56 | super.init();
57 |
58 | try {
59 | Log.d("PTT", "SingleRecorder, txPort: " + channel.port + ", remote addr: " + channel.addr.getHostAddress() + "::" + channel.port); // DEBUG
60 |
61 | // bind to any available local port; don't care since we're not rxing, only txing
62 | // receiver addr and port specified in packet; don't connect to remote host
63 | socket = new DatagramSocket();
64 | socket.setSoTimeout(SO_TIMEOUT_MILLISEC);
65 | }
66 | catch(SocketException e) {
67 | e.printStackTrace();
68 | }
69 | }
70 |
71 | protected void release() {
72 | super.release();
73 |
74 | if(socket != null) {
75 | socket.close();
76 | socket = null;
77 | }
78 | }
79 | }
80 |
--------------------------------------------------------------------------------
/AndroidManetPtt/src/org/span/ptt/settings/AudioSettings.java:
--------------------------------------------------------------------------------
1 | package org.span.ptt.settings;
2 |
3 | import org.span.ptt.R;
4 |
5 | import android.content.Context;
6 | import android.content.SharedPreferences;
7 | import android.content.res.Resources;
8 | import android.os.Bundle;
9 | import android.preference.PreferenceActivity;
10 | import android.preference.PreferenceManager;
11 |
12 | public class AudioSettings extends PreferenceActivity {
13 |
14 | private static boolean useSpeex;
15 | private static int speexQuality;
16 | private static boolean echoState;
17 | private static boolean speakerState;
18 | private static boolean talkOverState;
19 |
20 | public static final boolean USE_SPEEX = true;
21 | public static final boolean DONT_USE_SPEEX = false;
22 | public static final boolean ECHO_ON = true;
23 | public static final boolean ECHO_OFF = false;
24 | public static final boolean SPEAKER_ON = true;
25 | public static final boolean SPEAKER_OFF = false;
26 | public static final boolean TALK_OVER_ON = true;
27 | public static final boolean TALK_OVER_OFF = false;
28 |
29 | @Override
30 | public void onCreate(Bundle savedInstanceState) {
31 | super.onCreate(savedInstanceState);
32 | addPreferencesFromResource(R.xml.settings_audio);
33 | }
34 |
35 | /**
36 | * Update cache settings
37 | * @param context
38 | */
39 | public static void getSettings(Context context) {
40 | SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
41 | Resources res = context.getResources();
42 |
43 | useSpeex = prefs.getBoolean("use_speex", DONT_USE_SPEEX);
44 | speexQuality = Integer.parseInt(prefs.getString("speex_quality",
45 | res.getStringArray(R.array.speex_quality_values)[0]));
46 | echoState = prefs.getBoolean("echo", ECHO_OFF);
47 | speakerState = prefs.getBoolean("speaker", SPEAKER_ON);
48 | talkOverState = prefs.getBoolean("talkover", TALK_OVER_OFF);
49 | }
50 |
51 | public static boolean useSpeex() {
52 | return useSpeex;
53 | }
54 |
55 | public static int getSpeexQuality() {
56 | return speexQuality;
57 | }
58 |
59 | public static boolean getEchoState() {
60 | return echoState;
61 | }
62 |
63 | public static boolean getSpeakerState() {
64 | return speakerState;
65 | }
66 |
67 | public static boolean getTalkOverState() {
68 | return talkOverState;
69 | }
70 | }
71 |
--------------------------------------------------------------------------------
/AndroidManetPtt/jni/speex/libspeex/vbr.h:
--------------------------------------------------------------------------------
1 | /* Copyright (C) 2002 Jean-Marc Valin */
2 | /**
3 | @file vbr.h
4 | @brief Variable Bit-Rate (VBR) related routines
5 | */
6 | /*
7 | Redistribution and use in source and binary forms, with or without
8 | modification, are permitted provided that the following conditions
9 | are met:
10 |
11 | - Redistributions of source code must retain the above copyright
12 | notice, this list of conditions and the following disclaimer.
13 |
14 | - Redistributions in binary form must reproduce the above copyright
15 | notice, this list of conditions and the following disclaimer in the
16 | documentation and/or other materials provided with the distribution.
17 |
18 | - Neither the name of the Xiph.org Foundation nor the names of its
19 | contributors may be used to endorse or promote products derived from
20 | this software without specific prior written permission.
21 |
22 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
23 | ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
24 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
25 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR
26 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
27 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
28 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
29 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
30 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
31 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
32 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 |
34 | */
35 |
36 |
37 | #ifndef VBR_H
38 | #define VBR_H
39 |
40 | #include "arch.h"
41 |
42 | #define VBR_MEMORY_SIZE 5
43 |
44 | extern const float vbr_nb_thresh[9][11];
45 | extern const float vbr_hb_thresh[5][11];
46 | extern const float vbr_uhb_thresh[2][11];
47 |
48 | /** VBR state. */
49 | typedef struct VBRState {
50 | float energy_alpha;
51 | float average_energy;
52 | float last_energy;
53 | float last_log_energy[VBR_MEMORY_SIZE];
54 | float accum_sum;
55 | float last_pitch_coef;
56 | float soft_pitch;
57 | float last_quality;
58 | float noise_level;
59 | float noise_accum;
60 | float noise_accum_count;
61 | int consec_noise;
62 | } VBRState;
63 |
64 | void vbr_init(VBRState *vbr);
65 |
66 | float vbr_analysis(VBRState *vbr, spx_word16_t *sig, int len, int pitch, float pitch_coef);
67 |
68 | void vbr_destroy(VBRState *vbr);
69 |
70 | #endif
71 |
--------------------------------------------------------------------------------
/AndroidManetPtt/jni/speex/libspeex/vq.h:
--------------------------------------------------------------------------------
1 | /* Copyright (C) 2002 Jean-Marc Valin */
2 | /**
3 | @file vq.h
4 | @brief Vector quantization
5 | */
6 | /*
7 | Redistribution and use in source and binary forms, with or without
8 | modification, are permitted provided that the following conditions
9 | are met:
10 |
11 | - Redistributions of source code must retain the above copyright
12 | notice, this list of conditions and the following disclaimer.
13 |
14 | - Redistributions in binary form must reproduce the above copyright
15 | notice, this list of conditions and the following disclaimer in the
16 | documentation and/or other materials provided with the distribution.
17 |
18 | - Neither the name of the Xiph.org Foundation nor the names of its
19 | contributors may be used to endorse or promote products derived from
20 | this software without specific prior written permission.
21 |
22 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
23 | ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
24 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
25 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR
26 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
27 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
28 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
29 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
30 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
31 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
32 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 | */
34 |
35 | #ifndef VQ_H
36 | #define VQ_H
37 |
38 | #include "arch.h"
39 |
40 | int scal_quant(spx_word16_t in, const spx_word16_t *boundary, int entries);
41 | int scal_quant32(spx_word32_t in, const spx_word32_t *boundary, int entries);
42 |
43 | #ifdef _USE_SSE
44 | #include
45 | void vq_nbest(spx_word16_t *in, const __m128 *codebook, int len, int entries, __m128 *E, int N, int *nbest, spx_word32_t *best_dist, char *stack);
46 |
47 | void vq_nbest_sign(spx_word16_t *in, const __m128 *codebook, int len, int entries, __m128 *E, int N, int *nbest, spx_word32_t *best_dist, char *stack);
48 | #else
49 | void vq_nbest(spx_word16_t *in, const spx_word16_t *codebook, int len, int entries, spx_word32_t *E, int N, int *nbest, spx_word32_t *best_dist, char *stack);
50 |
51 | void vq_nbest_sign(spx_word16_t *in, const spx_word16_t *codebook, int len, int entries, spx_word32_t *E, int N, int *nbest, spx_word32_t *best_dist, char *stack);
52 | #endif
53 |
54 | #endif
55 |
--------------------------------------------------------------------------------
/AndroidManetPtt/jni/speex/libspeex/exc_10_32_table.c:
--------------------------------------------------------------------------------
1 | /* Copyright (C) 2002 Jean-Marc Valin
2 | File: exc_10_32_table.c
3 | Codebook for excitation in narrowband CELP mode (4000 bps)
4 |
5 | Redistribution and use in source and binary forms, with or without
6 | modification, are permitted provided that the following conditions
7 | are met:
8 |
9 | - Redistributions of source code must retain the above copyright
10 | notice, this list of conditions and the following disclaimer.
11 |
12 | - Redistributions in binary form must reproduce the above copyright
13 | notice, this list of conditions and the following disclaimer in the
14 | documentation and/or other materials provided with the distribution.
15 |
16 | - Neither the name of the Xiph.org Foundation nor the names of its
17 | contributors may be used to endorse or promote products derived from
18 | this software without specific prior written permission.
19 |
20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21 | ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR
24 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
26 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
27 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
28 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
29 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
30 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 | */
32 |
33 |
34 | const signed char exc_10_32_table[320] = {
35 | 7,17,17,27,25,22,12,4,-3,0,
36 | 28,-36,39,-24,-15,3,-9,15,-5,10,
37 | 31,-28,11,31,-21,9,-11,-11,-2,-7,
38 | -25,14,-22,31,4,-14,19,-12,14,-5,
39 | 4,-7,4,-5,9,0,-2,42,-47,-16,
40 | 1,8,0,9,23,-57,0,28,-11,6,
41 | -31,55,-45,3,-5,4,2,-2,4,-7,
42 | -3,6,-2,7,-3,12,5,8,54,-10,
43 | 8,-7,-8,-24,-25,-27,-14,-5,8,5,
44 | 44,23,5,-9,-11,-11,-13,-9,-12,-8,
45 | -29,-8,-22,6,-15,3,-12,-1,-5,-3,
46 | 34,-1,29,-16,17,-4,12,2,1,4,
47 | -2,-4,2,-1,11,-3,-52,28,30,-9,
48 | -32,25,44,-20,-24,4,6,-1,0,0,
49 | 0,0,0,0,0,0,0,0,0,0,
50 | -25,-10,22,29,13,-13,-22,-13,-4,0,
51 | -4,-16,10,15,-36,-24,28,25,-1,-3,
52 | 66,-33,-11,-15,6,0,3,4,-2,5,
53 | 24,-20,-47,29,19,-2,-4,-1,0,-1,
54 | -2,3,1,8,-11,5,5,-57,28,28,
55 | 0,-16,4,-4,12,-6,-1,2,-20,61,
56 | -9,24,-22,-42,29,6,17,8,4,2,
57 | -65,15,8,10,5,6,5,3,2,-2,
58 | -3,5,-9,4,-5,23,13,23,-3,-63,
59 | 3,-5,-4,-6,0,-3,23,-36,-46,9,
60 | 5,5,8,4,9,-5,1,-3,10,1,
61 | -6,10,-11,24,-47,31,22,-12,14,-10,
62 | 6,11,-7,-7,7,-31,51,-12,-6,7,
63 | 6,-17,9,-11,-20,52,-19,3,-6,-6,
64 | -8,-5,23,-41,37,1,-21,10,-14,8,
65 | 7,5,-15,-15,23,39,-26,-33,7,2,
66 | -32,-30,-21,-8,4,12,17,15,14,11};
67 |
--------------------------------------------------------------------------------
/AndroidManetPtt/jni/speex/libspeex/lsp.h:
--------------------------------------------------------------------------------
1 | /*---------------------------------------------------------------------------*\
2 | Original Copyright
3 | FILE........: AK2LSPD.H
4 | TYPE........: Turbo C header file
5 | COMPANY.....: Voicetronix
6 | AUTHOR......: James Whitehall
7 | DATE CREATED: 21/11/95
8 |
9 | Modified by Jean-Marc Valin
10 |
11 | This file contains functions for converting Linear Prediction
12 | Coefficients (LPC) to Line Spectral Pair (LSP) and back. Note that the
13 | LSP coefficients are not in radians format but in the x domain of the
14 | unit circle.
15 |
16 | \*---------------------------------------------------------------------------*/
17 | /**
18 | @file lsp.h
19 | @brief Line Spectral Pair (LSP) functions.
20 | */
21 | /* Speex License:
22 |
23 | Redistribution and use in source and binary forms, with or without
24 | modification, are permitted provided that the following conditions
25 | are met:
26 |
27 | - Redistributions of source code must retain the above copyright
28 | notice, this list of conditions and the following disclaimer.
29 |
30 | - Redistributions in binary form must reproduce the above copyright
31 | notice, this list of conditions and the following disclaimer in the
32 | documentation and/or other materials provided with the distribution.
33 |
34 | - Neither the name of the Xiph.org Foundation nor the names of its
35 | contributors may be used to endorse or promote products derived from
36 | this software without specific prior written permission.
37 |
38 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
39 | ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
40 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
41 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR
42 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
43 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
44 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
45 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
46 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
47 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
48 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
49 | */
50 |
51 | #ifndef __AK2LSPD__
52 | #define __AK2LSPD__
53 |
54 | #include "arch.h"
55 |
56 | int lpc_to_lsp (spx_coef_t *a, int lpcrdr, spx_lsp_t *freq, int nb, spx_word16_t delta, char *stack);
57 | void lsp_to_lpc(spx_lsp_t *freq, spx_coef_t *ak, int lpcrdr, char *stack);
58 |
59 | /*Added by JMV*/
60 | void lsp_enforce_margin(spx_lsp_t *lsp, int len, spx_word16_t margin);
61 |
62 | void lsp_interpolate(spx_lsp_t *old_lsp, spx_lsp_t *new_lsp, spx_lsp_t *interp_lsp, int len, int subframe, int nb_subframes);
63 |
64 | #endif /* __AK2LSPD__ */
65 |
--------------------------------------------------------------------------------
/AndroidManetPtt/jni/speex/libspeex/quant_lsp.h:
--------------------------------------------------------------------------------
1 | /* Copyright (C) 2002 Jean-Marc Valin */
2 | /**
3 | @file quant_lsp.h
4 | @brief LSP vector quantization
5 | */
6 | /*
7 | Redistribution and use in source and binary forms, with or without
8 | modification, are permitted provided that the following conditions
9 | are met:
10 |
11 | - Redistributions of source code must retain the above copyright
12 | notice, this list of conditions and the following disclaimer.
13 |
14 | - Redistributions in binary form must reproduce the above copyright
15 | notice, this list of conditions and the following disclaimer in the
16 | documentation and/or other materials provided with the distribution.
17 |
18 | - Neither the name of the Xiph.org Foundation nor the names of its
19 | contributors may be used to endorse or promote products derived from
20 | this software without specific prior written permission.
21 |
22 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
23 | ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
24 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
25 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR
26 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
27 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
28 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
29 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
30 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
31 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
32 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 | */
34 |
35 | #ifndef QUANT_LSP_H
36 | #define QUANT_LSP_H
37 |
38 | #include
39 | #include "arch.h"
40 |
41 | #define MAX_LSP_SIZE 20
42 |
43 | #define NB_CDBK_SIZE 64
44 | #define NB_CDBK_SIZE_LOW1 64
45 | #define NB_CDBK_SIZE_LOW2 64
46 | #define NB_CDBK_SIZE_HIGH1 64
47 | #define NB_CDBK_SIZE_HIGH2 64
48 |
49 | /*Narrowband codebooks*/
50 | extern const signed char cdbk_nb[];
51 | extern const signed char cdbk_nb_low1[];
52 | extern const signed char cdbk_nb_low2[];
53 | extern const signed char cdbk_nb_high1[];
54 | extern const signed char cdbk_nb_high2[];
55 |
56 | /* Quantizes narrowband LSPs with 30 bits */
57 | void lsp_quant_nb(spx_lsp_t *lsp, spx_lsp_t *qlsp, int order, SpeexBits *bits);
58 |
59 | /* Decodes quantized narrowband LSPs */
60 | void lsp_unquant_nb(spx_lsp_t *lsp, int order, SpeexBits *bits);
61 |
62 | /* Quantizes low bit-rate narrowband LSPs with 18 bits */
63 | void lsp_quant_lbr(spx_lsp_t *lsp, spx_lsp_t *qlsp, int order, SpeexBits *bits);
64 |
65 | /* Decodes quantized low bit-rate narrowband LSPs */
66 | void lsp_unquant_lbr(spx_lsp_t *lsp, int order, SpeexBits *bits);
67 |
68 | /* Quantizes high-band LSPs with 12 bits */
69 | void lsp_quant_high(spx_lsp_t *lsp, spx_lsp_t *qlsp, int order, SpeexBits *bits);
70 |
71 | /* Decodes high-band LSPs */
72 | void lsp_unquant_high(spx_lsp_t *lsp, int order, SpeexBits *bits);
73 |
74 | #endif
75 |
--------------------------------------------------------------------------------
/AndroidManetPtt/src/org/span/ptt/settings/CommSettings.java:
--------------------------------------------------------------------------------
1 | package org.span.ptt.settings;
2 |
3 | import java.net.InetAddress;
4 | import java.net.UnknownHostException;
5 |
6 | import org.span.ptt.R;
7 |
8 |
9 | import android.content.Context;
10 | import android.content.SharedPreferences;
11 | import android.content.res.Resources;
12 | import android.os.Bundle;
13 | import android.preference.PreferenceActivity;
14 | import android.preference.PreferenceManager;
15 | import android.util.Log;
16 |
17 | public class CommSettings extends PreferenceActivity {
18 |
19 | /*
20 | private static InetAddress broadcastAddr;
21 | private static InetAddress multicastAddr;
22 | private static InetAddress unicastAddr;
23 |
24 | public static final int BROADCAST = 0;
25 | public static final int MULTICAST = 1;
26 | public static final int UNICAST = 2;
27 |
28 | private static int castType;
29 | private static int port;
30 | */
31 |
32 | private static boolean vpnState;
33 |
34 | public static final boolean VPN_ON = true;
35 | public static final boolean VPN_OFF = false;
36 |
37 | @Override
38 | public void onCreate(Bundle savedInstanceState) {
39 | super.onCreate(savedInstanceState);
40 | addPreferencesFromResource(R.xml.settings_comm);
41 | }
42 |
43 | /**
44 | * Update cache settings
45 | * @param context
46 | */
47 | public static void getSettings(Context context) {
48 | SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
49 | Resources res = context.getResources();
50 |
51 | vpnState = prefs.getBoolean("vpn", VPN_OFF);
52 |
53 | /*
54 | try {
55 | castType = Integer.parseInt(prefs.getString(
56 | "cast_type",
57 | res.getStringArray(R.array.cast_types_values)[0]));
58 | broadcastAddr = InetAddress.getByName(prefs.getString(
59 | "broadcast_addr",
60 | res.getString(R.string.broadcast_addr_default)));
61 | multicastAddr = InetAddress.getByName(prefs.getString(
62 | "multicast_addr",
63 | res.getString(R.string.multicast_addr_default)));
64 | unicastAddr = InetAddress.getByName(prefs.getString(
65 | "unicast_addr",
66 | res.getString(R.string.unicast_addr_default)));
67 | port = Integer.parseInt(prefs.getString(
68 | "port",
69 | res.getString(R.string.port_default)));
70 | }
71 | catch(UnknownHostException e) {
72 | Log.d("CommSettings", e.getMessage());
73 | }
74 | */
75 | }
76 |
77 | public static boolean getVpnState() {
78 | return vpnState;
79 | }
80 |
81 | /*
82 | public static int getCastType() {
83 | return castType;
84 | }
85 |
86 | public static InetAddress getBroadcastAddr() {
87 | return broadcastAddr;
88 | }
89 |
90 | public static InetAddress getMulticastAddr() {
91 | return multicastAddr;
92 | }
93 |
94 | public static InetAddress getUnicastAddr() {
95 | return unicastAddr;
96 | }
97 |
98 | public static int getPort() {
99 | return port;
100 | }
101 | */
102 | }
103 |
--------------------------------------------------------------------------------
/AndroidManetPtt/jni/speex/libspeex/exc_5_64_table.c:
--------------------------------------------------------------------------------
1 | /* Copyright (C) 2002 Jean-Marc Valin
2 | File: exc_5_64_table.c
3 | Codebook for excitation in narrowband CELP mode (9600 bps)
4 |
5 | Redistribution and use in source and binary forms, with or without
6 | modification, are permitted provided that the following conditions
7 | are met:
8 |
9 | - Redistributions of source code must retain the above copyright
10 | notice, this list of conditions and the following disclaimer.
11 |
12 | - Redistributions in binary form must reproduce the above copyright
13 | notice, this list of conditions and the following disclaimer in the
14 | documentation and/or other materials provided with the distribution.
15 |
16 | - Neither the name of the Xiph.org Foundation nor the names of its
17 | contributors may be used to endorse or promote products derived from
18 | this software without specific prior written permission.
19 |
20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21 | ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR
24 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
26 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
27 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
28 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
29 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
30 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 | */
32 |
33 |
34 | const signed char exc_5_64_table[320]={
35 | 1,5,-15,49,-66,
36 | -48,-4,50,-44,7,
37 | 37,16,-18,25,-26,
38 | -26,-15,19,19,-27,
39 | -47,28,57,5,-17,
40 | -32,-41,68,21,-2,
41 | 64,56,8,-16,-13,
42 | -26,-9,-16,11,6,
43 | -39,25,-19,22,-31,
44 | 20,-45,55,-43,10,
45 | -16,47,-40,40,-20,
46 | -51,3,-17,-14,-15,
47 | -24,53,-20,-46,46,
48 | 27,-68,32,3,-18,
49 | -5,9,-31,16,-9,
50 | -10,-1,-23,48,95,
51 | 47,25,-41,-32,-3,
52 | 15,-25,-55,36,41,
53 | -27,20,5,13,14,
54 | -22,5,2,-23,18,
55 | 46,-15,17,-18,-34,
56 | -5,-8,27,-55,73,
57 | 16,2,-1,-17,40,
58 | -78,33,0,2,19,
59 | 4,53,-16,-15,-16,
60 | -28,-3,-13,49,8,
61 | -7,-29,27,-13,32,
62 | 20,32,-61,16,14,
63 | 41,44,40,24,20,
64 | 7,4,48,-60,-77,
65 | 17,-6,-48,65,-15,
66 | 32,-30,-71,-10,-3,
67 | -6,10,-2,-7,-29,
68 | -56,67,-30,7,-5,
69 | 86,-6,-10,0,5,
70 | -31,60,34,-38,-3,
71 | 24,10,-2,30,23,
72 | 24,-41,12,70,-43,
73 | 15,-17,6,13,16,
74 | -13,8,30,-15,-8,
75 | 5,23,-34,-98,-4,
76 | -13,13,-48,-31,70,
77 | 12,31,25,24,-24,
78 | 26,-7,33,-16,8,
79 | 5,-11,-14,-8,-65,
80 | 13,10,-2,-9,0,
81 | -3,-68,5,35,7,
82 | 0,-31,-1,-17,-9,
83 | -9,16,-37,-18,-1,
84 | 69,-48,-28,22,-21,
85 | -11,5,49,55,23,
86 | -86,-36,16,2,13,
87 | 63,-51,30,-11,13,
88 | 24,-18,-6,14,-19,
89 | 1,41,9,-5,27,
90 | -36,-44,-34,-37,-21,
91 | -26,31,-39,15,43,
92 | 5,-8,29,20,-8,
93 | -20,-52,-28,-1,13,
94 | 26,-34,-10,-9,27,
95 | -8,8,27,-66,4,
96 | 12,-22,49,10,-77,
97 | 32,-18,3,-38,12,
98 | -3,-1,2,2,0};
99 |
--------------------------------------------------------------------------------
/AndroidManetPtt/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | MANET Voice Chat
5 | Settings
6 | Communication Settings
7 | Communication
8 | Cast & port
9 | Cast type
10 | Choose how many devices will receive the audio data.
11 | Port
12 |
13 | 2010
14 | IP addresses
15 | Broadcast address
16 | Audio data will be received by all devices witch are on the same network.
17 | 255.255.255.255
18 | Multicast address
19 | Audio data will be received only by devices registered on the given address and are on the same network.
20 | 230.0.0.1
21 | Unicast address
22 | Audio data will be received only by one device, designated by the given address.
23 | 192.168.0.1
24 | Audio Settings
25 | Audio
26 | Use codec
27 | Codec on
28 | Codec off
29 | Codec bit rate
30 |
31 | Echo
32 | Echo on
33 | Echo off
34 | Device speaker
35 | Device speaker on
36 | Device speaker off (handset mode)
37 | Multiple speakers
38 | Can talk over fellow peers
39 | Can\'t talk over fellow peers
40 | Mesh P2P VPN
41 | Use mesh P2P VPN
42 | Don\'t use mesh P2P VPN
43 | Reset All
44 | Reset All
45 | All settings were restored to their default values
46 | Groups
47 | Create Group
48 | Create Group
49 | View Groups
50 | View Groups
51 | View Group
52 | View Group
53 | Channel Info
54 | View Channel
55 | Select a Mode, Group, or Peer
56 |
--------------------------------------------------------------------------------
/AndroidManetPtt/src/org/span/ptt/groups/GroupHelper.java:
--------------------------------------------------------------------------------
1 | package org.span.ptt.groups;
2 |
3 | import java.net.InetAddress;
4 | import java.net.UnknownHostException;
5 | import java.util.ArrayList;
6 | import java.util.Arrays;
7 | import java.util.HashMap;
8 | import java.util.List;
9 | import java.util.Map;
10 |
11 | import android.content.Context;
12 | import android.content.SharedPreferences;
13 | import android.preference.PreferenceManager;
14 |
15 | public class GroupHelper {
16 |
17 | public static final String GROUP_PREFS = "groups";
18 | public static final String GROUP_ID = "group_id";
19 |
20 | public static final String GROUP_NAME = "group_name";
21 | public static final String GROUP_LIST = "group_list";
22 | public static final String GROUP_ADDR = "group_addr";
23 | public static final String GROUP_MAX_ID = "group_max_id";
24 |
25 | private static Map groupMap = null;
26 |
27 | private static SharedPreferences prefs = null;
28 |
29 | private static int nextId = -1; // next group id
30 |
31 | public static void getSettings(Context context) {
32 | prefs = PreferenceManager.getDefaultSharedPreferences(context);
33 | loadGroups();
34 | }
35 |
36 | private static void loadGroups() {
37 | groupMap = new HashMap(); // TODO: sort alphabetically
38 |
39 | nextId = prefs.getInt(GROUP_MAX_ID, -1) + 1;
40 |
41 | for (int id = 0; id < nextId; id++) {
42 | if (prefs.contains(GROUP_NAME + "." + id)) {
43 | String name = prefs.getString(GROUP_NAME + "." + id, "");
44 | String list = prefs.getString(GROUP_LIST + "." + id, "");
45 | String addr = prefs.getString(GROUP_ADDR + "." + id, "");
46 |
47 | ArrayList peers = new ArrayList();
48 | peers.addAll(Arrays.asList(list.split(",")));
49 |
50 | try {
51 | InetAddress inetAddr = InetAddress.getByName(addr);
52 | Group group = new Group(id, name, peers, inetAddr);
53 | groupMap.put(id, group);
54 | } catch (UnknownHostException e) {
55 | e.printStackTrace();
56 | }
57 | }
58 | }
59 | }
60 |
61 | public static List getGroups() {
62 | List groups = new ArrayList(groupMap.values());
63 | return groups;
64 | }
65 |
66 | public static Group getGroup(int id) {
67 | return groupMap.get(id);
68 | }
69 |
70 | /*
71 | public static String[] getNames(List groups) {
72 | String[] names = new String[groups.size()];
73 | for (int i = 0; i < groups.size(); i ++) {
74 | names[i] = groups.get(i).name;
75 | }
76 | return names;
77 | }
78 | */
79 |
80 | public static Group createGroup(String name, List peers, InetAddress addr) {
81 | String items = "";
82 | for (int i = 0; i < peers.size(); i++) {
83 | items += peers.get(i) + ",";
84 | }
85 | items = items.substring(0, items.length()-1);
86 |
87 | Group group = new Group(nextId, name, peers, addr);
88 |
89 | SharedPreferences.Editor prefEditor = prefs.edit();
90 |
91 | prefEditor.putString(GROUP_NAME + "." + nextId, name);
92 | prefEditor.putString(GROUP_LIST + "." + nextId, items);
93 | prefEditor.putString(GROUP_ADDR + "." + nextId, addr.getHostAddress());
94 | prefEditor.putInt(GROUP_MAX_ID, nextId);
95 |
96 | prefEditor.commit();
97 |
98 | groupMap.put(nextId, group);
99 |
100 | nextId++; // next group id
101 |
102 | return group;
103 | }
104 |
105 | public static void deleteGroup(int id) {
106 | SharedPreferences.Editor prefEditor = prefs.edit();
107 |
108 | prefEditor.remove(GROUP_NAME + "." + id);
109 | prefEditor.remove(GROUP_LIST + "." + id);
110 | prefEditor.remove(GROUP_ADDR + "." + id);
111 |
112 | prefEditor.commit();
113 |
114 | groupMap.remove(id);
115 | }
116 | }
--------------------------------------------------------------------------------
/AndroidManetPtt/jni/speex/libspeex/exc_20_32_table.c:
--------------------------------------------------------------------------------
1 | /* Copyright (C) 2002 Jean-Marc Valin
2 | File: exc_20_32_table.c
3 | Codebook for excitation in narrowband CELP mode (2000 bps)
4 |
5 | Redistribution and use in source and binary forms, with or without
6 | modification, are permitted provided that the following conditions
7 | are met:
8 |
9 | - Redistributions of source code must retain the above copyright
10 | notice, this list of conditions and the following disclaimer.
11 |
12 | - Redistributions in binary form must reproduce the above copyright
13 | notice, this list of conditions and the following disclaimer in the
14 | documentation and/or other materials provided with the distribution.
15 |
16 | - Neither the name of the Xiph.org Foundation nor the names of its
17 | contributors may be used to endorse or promote products derived from
18 | this software without specific prior written permission.
19 |
20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21 | ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR
24 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
26 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
27 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
28 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
29 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
30 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 | */
32 |
33 |
34 | const signed char exc_20_32_table[640] = {
35 | 12,32,25,46,36,33,9,14,-3,6,1,-8,0,-10,-5,-7,-7,-7,-5,-5,
36 | 31,-27,24,-32,-4,10,-11,21,-3,19,23,-9,22,24,-10,-1,-10,-13,-7,-11,
37 | 42,-33,31,19,-8,0,-10,-16,1,-21,-17,10,-8,14,8,4,11,-2,5,-2,
38 | -33,11,-16,33,11,-4,9,-4,11,2,6,-5,8,-5,11,-4,-6,26,-36,-16,
39 | 0,4,-2,-8,12,6,-1,34,-46,-22,9,9,21,9,5,-66,-5,26,2,10,
40 | 13,2,19,9,12,-81,3,13,13,0,-14,22,-35,6,-7,-4,6,-6,10,-6,
41 | -31,38,-33,0,-10,-11,5,-12,12,-17,5,0,-6,13,-9,10,8,25,33,2,
42 | -12,8,-6,10,-2,21,7,17,43,5,11,-7,-9,-20,-36,-20,-23,-4,-4,-3,
43 | 27,-9,-9,-49,-39,-38,-11,-9,6,5,23,25,5,3,3,4,1,2,-3,-1,
44 | 87,39,17,-21,-9,-19,-9,-15,-13,-14,-17,-11,-10,-11,-8,-6,-1,-3,-3,-1,
45 | -54,-34,-27,-8,-11,-4,-5,0,0,4,8,6,9,7,9,7,6,5,5,5,
46 | 48,10,19,-10,12,-1,9,-3,2,5,-3,2,-2,-2,0,-2,-26,6,9,-7,
47 | -16,-9,2,7,7,-5,-43,11,22,-11,-9,34,37,-15,-13,-6,1,-1,1,1,
48 | -64,56,52,-11,-27,5,4,3,1,2,1,3,-1,-4,-4,-10,-7,-4,-4,2,
49 | -1,-7,-7,-12,-10,-15,-9,-5,-5,-11,-16,-13,6,16,4,-13,-16,-10,-4,2,
50 | -47,-13,25,47,19,-14,-20,-8,-17,0,-3,-13,1,6,-17,-14,15,1,10,6,
51 | -24,0,-10,19,-69,-8,14,49,17,-5,33,-29,3,-4,0,2,-8,5,-6,2,
52 | 120,-56,-12,-47,23,-9,6,-5,1,2,-5,1,-10,4,-1,-1,4,-1,0,-3,
53 | 30,-52,-67,30,22,11,-1,-4,3,0,7,2,0,1,-10,-4,-8,-13,5,1,
54 | 1,-1,5,13,-9,-3,-10,-62,22,48,-4,-6,2,3,5,1,1,4,1,13,
55 | 3,-20,10,-9,13,-2,-4,9,-20,44,-1,20,-32,-67,19,0,28,11,8,2,
56 | -11,15,-19,-53,31,2,34,10,6,-4,-58,8,10,13,14,1,12,2,0,0,
57 | -128,37,-8,44,-9,26,-3,18,2,6,11,-1,9,1,5,3,0,1,1,2,
58 | 12,3,-2,-3,7,25,9,18,-6,-37,3,-8,-16,3,-10,-7,17,-34,-44,11,
59 | 17,-15,-3,-16,-1,-13,11,-46,-65,-2,8,13,2,4,4,5,15,5,9,6,
60 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
61 | -9,19,-12,12,-28,38,29,-1,12,2,5,23,-10,3,4,-15,21,-4,3,3,
62 | 6,17,-9,-4,-8,-20,26,5,-10,6,1,-19,18,-15,-12,47,-6,-2,-7,-9,
63 | -1,-17,-2,-2,-14,30,-14,2,-7,-4,-1,-12,11,-25,16,-3,-12,11,-7,7,
64 | -17,1,19,-28,31,-7,-10,7,-10,3,12,5,-16,6,24,41,-29,-54,0,1,
65 | 7,-1,5,-6,13,10,-4,-8,8,-9,-27,-53,-38,-1,10,19,17,16,12,12,
66 | 0,3,-7,-4,13,12,-31,-14,6,-5,3,5,17,43,50,25,10,1,-6,-2};
67 |
--------------------------------------------------------------------------------
/AndroidManetPtt/src/org/span/ptt/PeersQueryActivity.java:
--------------------------------------------------------------------------------
1 | package org.span.ptt;
2 |
3 | import java.util.HashSet;
4 |
5 |
6 | import org.span.ptt.channels.ChannelHelper;
7 | import org.span.ptt.service.ConnectionService;
8 | import org.span.service.ManetHelper;
9 | import org.span.service.ManetObserver;
10 | import org.span.service.legal.EulaHelper;
11 | import org.span.service.legal.EulaObserver;
12 | import org.span.service.routing.Node;
13 | import org.span.service.core.ManetService.AdhocStateEnum;
14 | import org.span.service.system.ManetConfig;
15 | import android.app.Activity;
16 | import android.content.Intent;
17 | import android.os.Bundle;
18 | import android.os.Handler;
19 |
20 | public abstract class PeersQueryActivity extends Activity implements EulaObserver, ManetObserver {
21 |
22 | private ManetHelper manet = null;
23 |
24 | private static Handler handler = new Handler();
25 |
26 | private static Runnable channelRunnable;
27 | private static final int CHANNEL_CHECK_PERIOD_MILLISEC = 5000;
28 |
29 | @Override
30 | public void onCreate(Bundle savedInstanceState) {
31 | super.onCreate(savedInstanceState);
32 |
33 | manet = new ManetHelper(this);
34 | manet.registerObserver(this);
35 |
36 | EulaHelper eula = new EulaHelper(this, this);
37 | eula.showDialog();
38 | }
39 |
40 | @Override
41 | public void onResume() {
42 | super.onResume();
43 |
44 | if (manet.isConnectedToService()) {
45 | handler.removeCallbacks(channelRunnable);
46 | handler.post(channelRunnable); // run now
47 | }
48 | }
49 |
50 | @Override
51 | public void onPause() {
52 | super.onPause();
53 | handler.removeCallbacks(channelRunnable);
54 | }
55 |
56 | @Override
57 | public void onDestroy() {
58 | super.onDestroy();
59 |
60 | manet.unregisterObserver(this);
61 |
62 | if (manet.isConnectedToService()) {
63 | manet.disconnectFromService();
64 | }
65 | }
66 |
67 | protected abstract void updateChannelList();
68 |
69 | public void onEulaAccepted() {
70 | // used to be part of onPostCreate()
71 | if (!manet.isConnectedToService()) {
72 | manet.connectToService();
73 | }
74 |
75 | // start service so that it runs even if no active activities are bound to it
76 | // do nothing if the service is already running
77 | startService(new Intent(this, ConnectionService.class));
78 | }
79 |
80 | public void onServiceConnected() {
81 | // Update channel list
82 | channelRunnable = new Runnable() {
83 |
84 | public void run() {
85 | manet.sendPeersQuery();
86 | handler.postDelayed(this, CHANNEL_CHECK_PERIOD_MILLISEC);
87 | }
88 | };
89 |
90 | handler.removeCallbacks(channelRunnable);
91 | handler.post(channelRunnable); // run now
92 | }
93 |
94 | public void onServiceDisconnected() {
95 | handler.removeCallbacks(channelRunnable);
96 | }
97 |
98 | public void onServiceStarted() {
99 | // TODO Auto-generated method stub
100 | }
101 |
102 | public void onServiceStopped() {
103 | // TODO Auto-generated method stub
104 | }
105 |
106 | public void onAdhocStateUpdated(AdhocStateEnum state, String info) {
107 | // TODO Auto-generated method stub
108 | }
109 |
110 | public void onConfigUpdated(ManetConfig manetcfg) {
111 | // TODO Auto-generated method stub
112 | }
113 |
114 | public void onRoutingInfoUpdated(String info) {
115 | // TODO Auto-generated method stub
116 | }
117 |
118 | public void onPeersUpdated(HashSet peers) {
119 | ChannelHelper.updateChannels(peers);
120 | updateChannelList();
121 | }
122 |
123 | public void onError(String error) {
124 | // TODO Auto-generated method stub
125 | }
126 | }
--------------------------------------------------------------------------------
/AndroidManetPtt/jni/speex/libspeex/stack_alloc.h:
--------------------------------------------------------------------------------
1 | /* Copyright (C) 2002 Jean-Marc Valin */
2 | /**
3 | @file stack_alloc.h
4 | @brief Temporary memory allocation on stack
5 | */
6 | /*
7 | Redistribution and use in source and binary forms, with or without
8 | modification, are permitted provided that the following conditions
9 | are met:
10 |
11 | - Redistributions of source code must retain the above copyright
12 | notice, this list of conditions and the following disclaimer.
13 |
14 | - Redistributions in binary form must reproduce the above copyright
15 | notice, this list of conditions and the following disclaimer in the
16 | documentation and/or other materials provided with the distribution.
17 |
18 | - Neither the name of the Xiph.org Foundation nor the names of its
19 | contributors may be used to endorse or promote products derived from
20 | this software without specific prior written permission.
21 |
22 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
23 | ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
24 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
25 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR
26 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
27 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
28 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
29 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
30 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
31 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
32 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 | */
34 |
35 | #ifndef STACK_ALLOC_H
36 | #define STACK_ALLOC_H
37 |
38 | #ifdef USE_ALLOCA
39 | # ifdef WIN32
40 | # include
41 | # else
42 | # ifdef HAVE_ALLOCA_H
43 | # include
44 | # else
45 | # include
46 | # endif
47 | # endif
48 | #endif
49 |
50 | /**
51 | * @def ALIGN(stack, size)
52 | *
53 | * Aligns the stack to a 'size' boundary
54 | *
55 | * @param stack Stack
56 | * @param size New size boundary
57 | */
58 |
59 | /**
60 | * @def PUSH(stack, size, type)
61 | *
62 | * Allocates 'size' elements of type 'type' on the stack
63 | *
64 | * @param stack Stack
65 | * @param size Number of elements
66 | * @param type Type of element
67 | */
68 |
69 | /**
70 | * @def VARDECL(var)
71 | *
72 | * Declare variable on stack
73 | *
74 | * @param var Variable to declare
75 | */
76 |
77 | /**
78 | * @def ALLOC(var, size, type)
79 | *
80 | * Allocate 'size' elements of 'type' on stack
81 | *
82 | * @param var Name of variable to allocate
83 | * @param size Number of elements
84 | * @param type Type of element
85 | */
86 |
87 | #ifdef ENABLE_VALGRIND
88 |
89 | #include
90 |
91 | #define ALIGN(stack, size) ((stack) += ((size) - (long)(stack)) & ((size) - 1))
92 |
93 | #define PUSH(stack, size, type) (VALGRIND_MAKE_NOACCESS(stack, 1000),ALIGN((stack),sizeof(type)),VALGRIND_MAKE_WRITABLE(stack, ((size)*sizeof(type))),(stack)+=((size)*sizeof(type)),(type*)((stack)-((size)*sizeof(type))))
94 |
95 | #else
96 |
97 | #define ALIGN(stack, size) ((stack) += ((size) - (long)(stack)) & ((size) - 1))
98 |
99 | #define PUSH(stack, size, type) (ALIGN((stack),sizeof(type)),(stack)+=((size)*sizeof(type)),(type*)((stack)-((size)*sizeof(type))))
100 |
101 | #endif
102 |
103 | #if defined(VAR_ARRAYS)
104 | #define VARDECL(var)
105 | #define ALLOC(var, size, type) type var[size]
106 | #elif defined(USE_ALLOCA)
107 | #define VARDECL(var) var
108 | #define ALLOC(var, size, type) var = alloca(sizeof(type)*(size))
109 | #else
110 | #define VARDECL(var) var
111 | #define ALLOC(var, size, type) var = PUSH(stack, size, type)
112 | #endif
113 |
114 |
115 | #endif
116 |
--------------------------------------------------------------------------------
/AndroidManetPtt/jni/speex/libspeex/cb_search.h:
--------------------------------------------------------------------------------
1 | /* Copyright (C) 2002 Jean-Marc Valin & David Rowe */
2 | /**
3 | @file cb_search.h
4 | @brief Overlapped codebook search
5 | */
6 | /*
7 | Redistribution and use in source and binary forms, with or without
8 | modification, are permitted provided that the following conditions
9 | are met:
10 |
11 | - Redistributions of source code must retain the above copyright
12 | notice, this list of conditions and the following disclaimer.
13 |
14 | - Redistributions in binary form must reproduce the above copyright
15 | notice, this list of conditions and the following disclaimer in the
16 | documentation and/or other materials provided with the distribution.
17 |
18 | - Neither the name of the Xiph.org Foundation nor the names of its
19 | contributors may be used to endorse or promote products derived from
20 | this software without specific prior written permission.
21 |
22 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
23 | ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
24 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
25 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR
26 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
27 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
28 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
29 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
30 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
31 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
32 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 | */
34 |
35 | #ifndef CB_SEARCH_H
36 | #define CB_SEARCH_H
37 |
38 | #include
39 | #include "arch.h"
40 |
41 | /** Split codebook parameters. */
42 | typedef struct split_cb_params {
43 | int subvect_size;
44 | int nb_subvect;
45 | const signed char *shape_cb;
46 | int shape_bits;
47 | int have_sign;
48 | } split_cb_params;
49 |
50 |
51 | void split_cb_search_shape_sign(
52 | spx_word16_t target[], /* target vector */
53 | spx_coef_t ak[], /* LPCs for this subframe */
54 | spx_coef_t awk1[], /* Weighted LPCs for this subframe */
55 | spx_coef_t awk2[], /* Weighted LPCs for this subframe */
56 | const void *par, /* Codebook/search parameters */
57 | int p, /* number of LPC coeffs */
58 | int nsf, /* number of samples in subframe */
59 | spx_sig_t *exc,
60 | spx_word16_t *r,
61 | SpeexBits *bits,
62 | char *stack,
63 | int complexity,
64 | int update_target
65 | );
66 |
67 | void split_cb_shape_sign_unquant(
68 | spx_sig_t *exc,
69 | const void *par, /* non-overlapping codebook */
70 | int nsf, /* number of samples in subframe */
71 | SpeexBits *bits,
72 | char *stack,
73 | spx_int32_t *seed
74 | );
75 |
76 |
77 | void noise_codebook_quant(
78 | spx_word16_t target[], /* target vector */
79 | spx_coef_t ak[], /* LPCs for this subframe */
80 | spx_coef_t awk1[], /* Weighted LPCs for this subframe */
81 | spx_coef_t awk2[], /* Weighted LPCs for this subframe */
82 | const void *par, /* Codebook/search parameters */
83 | int p, /* number of LPC coeffs */
84 | int nsf, /* number of samples in subframe */
85 | spx_sig_t *exc,
86 | spx_word16_t *r,
87 | SpeexBits *bits,
88 | char *stack,
89 | int complexity,
90 | int update_target
91 | );
92 |
93 |
94 | void noise_codebook_unquant(
95 | spx_sig_t *exc,
96 | const void *par, /* non-overlapping codebook */
97 | int nsf, /* number of samples in subframe */
98 | SpeexBits *bits,
99 | char *stack,
100 | spx_int32_t *seed
101 | );
102 |
103 | #endif
104 |
--------------------------------------------------------------------------------
/AndroidManetPtt/jni/speex/include/speex/speex_types.h:
--------------------------------------------------------------------------------
1 | /* speex_types.h taken from libogg */
2 | /********************************************************************
3 | * *
4 | * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
5 | * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
6 | * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
7 | * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
8 | * *
9 | * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2002 *
10 | * by the Xiph.Org Foundation http://www.xiph.org/ *
11 | * *
12 | ********************************************************************
13 |
14 | function: #ifdef jail to whip a few platforms into the UNIX ideal.
15 | last mod: $Id: os_types.h 7524 2004-08-11 04:20:36Z conrad $
16 |
17 | ********************************************************************/
18 | /**
19 | @file speex_types.h
20 | @brief Speex types
21 | */
22 | #ifndef _SPEEX_TYPES_H
23 | #define _SPEEX_TYPES_H
24 |
25 | #if defined(_WIN32)
26 |
27 | # if defined(__CYGWIN__)
28 | # include <_G_config.h>
29 | typedef _G_int32_t spx_int32_t;
30 | typedef _G_uint32_t spx_uint32_t;
31 | typedef _G_int16_t spx_int16_t;
32 | typedef _G_uint16_t spx_uint16_t;
33 | # elif defined(__MINGW32__)
34 | typedef short spx_int16_t;
35 | typedef unsigned short spx_uint16_t;
36 | typedef int spx_int32_t;
37 | typedef unsigned int spx_uint32_t;
38 | # elif defined(__MWERKS__)
39 | typedef int spx_int32_t;
40 | typedef unsigned int spx_uint32_t;
41 | typedef short spx_int16_t;
42 | typedef unsigned short spx_uint16_t;
43 | # else
44 | /* MSVC/Borland */
45 | typedef __int32 spx_int32_t;
46 | typedef unsigned __int32 spx_uint32_t;
47 | typedef __int16 spx_int16_t;
48 | typedef unsigned __int16 spx_uint16_t;
49 | # endif
50 |
51 | #elif defined(__MACOS__)
52 |
53 | # include
54 | typedef SInt16 spx_int16_t;
55 | typedef UInt16 spx_uint16_t;
56 | typedef SInt32 spx_int32_t;
57 | typedef UInt32 spx_uint32_t;
58 |
59 | #elif (defined(__APPLE__) && defined(__MACH__)) /* MacOS X Framework build */
60 |
61 | # include
62 | typedef int16_t spx_int16_t;
63 | typedef u_int16_t spx_uint16_t;
64 | typedef int32_t spx_int32_t;
65 | typedef u_int32_t spx_uint32_t;
66 |
67 | #elif defined(__BEOS__)
68 |
69 | /* Be */
70 | # include
71 | typedef int16_t spx_int16_t;
72 | typedef u_int16_t spx_uint16_t;
73 | typedef int32_t spx_int32_t;
74 | typedef u_int32_t spx_uint32_t;
75 |
76 | #elif defined (__EMX__)
77 |
78 | /* OS/2 GCC */
79 | typedef short spx_int16_t;
80 | typedef unsigned short spx_uint16_t;
81 | typedef int spx_int32_t;
82 | typedef unsigned int spx_uint32_t;
83 |
84 | #elif defined (DJGPP)
85 |
86 | /* DJGPP */
87 | typedef short spx_int16_t;
88 | typedef int spx_int32_t;
89 | typedef unsigned int spx_uint32_t;
90 |
91 | #elif defined(R5900)
92 |
93 | /* PS2 EE */
94 | typedef int spx_int32_t;
95 | typedef unsigned spx_uint32_t;
96 | typedef short spx_int16_t;
97 |
98 | #elif defined(__SYMBIAN32__)
99 |
100 | /* Symbian GCC */
101 | typedef signed short spx_int16_t;
102 | typedef unsigned short spx_uint16_t;
103 | typedef signed int spx_int32_t;
104 | typedef unsigned int spx_uint32_t;
105 |
106 | #elif defined(CONFIG_TI_C54X) || defined (CONFIG_TI_C55X)
107 |
108 | typedef short spx_int16_t;
109 | typedef unsigned short spx_uint16_t;
110 | typedef long spx_int32_t;
111 | typedef unsigned long spx_uint32_t;
112 |
113 | #elif defined(CONFIG_TI_C6X)
114 |
115 | typedef short spx_int16_t;
116 | typedef unsigned short spx_uint16_t;
117 | typedef int spx_int32_t;
118 | typedef unsigned int spx_uint32_t;
119 |
120 | #else
121 |
122 | # include
123 |
124 | #endif
125 |
126 | #endif /* _SPEEX_TYPES_H */
127 |
--------------------------------------------------------------------------------
/AndroidManetPtt/src/org/span/ptt/recorder/Recorder.java:
--------------------------------------------------------------------------------
1 | package org.span.ptt.recorder;
2 |
3 | import org.span.ptt.channels.Channel;
4 | import org.span.ptt.settings.AudioSettings;
5 | import org.span.ptt.util.AudioParams;
6 | import org.span.ptt.util.PhoneIPs;
7 |
8 | import ro.ui.pttdroid.codecs.Speex;
9 | import android.media.AudioFormat;
10 | import android.media.AudioRecord;
11 | import android.media.MediaRecorder.AudioSource;
12 |
13 | public abstract class Recorder implements Runnable {
14 |
15 | protected final int SO_TIMEOUT_MILLISEC = 0;
16 |
17 | protected Channel channel = null;
18 |
19 | protected AudioRecord recorder;
20 | /*
21 | * True if thread is running, false otherwise.
22 | * This boolean is used for internal synchronization.
23 | */
24 | protected boolean isRunning = false;
25 | /*
26 | * True if thread is safely stopped.
27 | * This boolean must be false in order to be able to start the thread.
28 | * After changing it to true the thread is finished, without the ability to start it again.
29 | */
30 | protected boolean isFinishing = false;
31 |
32 | protected static short[] pcmFrame = new short[AudioParams.FRAME_SIZE];
33 | protected static byte[] encodedFrame;
34 |
35 | public Recorder(Channel channel) {
36 | this.channel = channel;
37 | }
38 |
39 | @Override
40 | public boolean equals(Object other) {
41 | if (other instanceof Recorder) {
42 | Recorder recorder = (Recorder) other;
43 | if (recorder.channel.equals(recorder.channel)) {
44 | return true;
45 | }
46 | }
47 | return false;
48 | }
49 |
50 | public void run() {
51 | if (!channel.isRecorderEnabled()) {
52 | return;
53 | }
54 |
55 | // Set audio specific thread priority
56 | android.os.Process.setThreadPriority(android.os.Process.THREAD_PRIORITY_URGENT_AUDIO);
57 |
58 | while(!isFinishing()) {
59 | init();
60 | while(isRunning()) {
61 |
62 | // Read PCM from the microphone buffer & encode it
63 | if(AudioSettings.useSpeex() == AudioSettings.USE_SPEEX) {
64 | recorder.read(pcmFrame, 0, AudioParams.FRAME_SIZE);
65 | Speex.encode(pcmFrame, encodedFrame);
66 | }
67 | else {
68 | recorder.read(encodedFrame, 0, AudioParams.FRAME_SIZE_IN_BYTES);
69 | }
70 |
71 | send();
72 | }
73 |
74 | release();
75 | /*
76 | * While is not running block the thread.
77 | * By doing it, CPU time is saved.
78 | */
79 | synchronized(this) {
80 | try {
81 | if(!isFinishing())
82 | this.wait();
83 | }
84 | catch(InterruptedException e) {
85 | e.printStackTrace();
86 | }
87 | }
88 | }
89 | }
90 |
91 | protected void init() {
92 | PhoneIPs.load();
93 |
94 | if(AudioSettings.useSpeex() == AudioSettings.USE_SPEEX) {
95 | encodedFrame = new byte[Speex.getEncodedSize(AudioSettings.getSpeexQuality())];
96 | } else {
97 | encodedFrame = new byte[AudioParams.FRAME_SIZE_IN_BYTES];
98 | }
99 |
100 | recorder = new AudioRecord(
101 | AudioSource.MIC,
102 | AudioParams.SAMPLE_RATE,
103 | AudioFormat.CHANNEL_CONFIGURATION_MONO,
104 | AudioParams.ENCODING_PCM_NUM_BITS,
105 | AudioParams.RECORD_BUFFER_SIZE);
106 |
107 | recorder.startRecording();
108 | }
109 |
110 | protected void release() {
111 | if(recorder != null) {
112 | recorder.stop();
113 | recorder.release();
114 | recorder = null;
115 | }
116 | }
117 |
118 | public synchronized boolean isRunning() {
119 | return isRunning;
120 | }
121 |
122 | public synchronized void resumeAudio() {
123 | isRunning = true;
124 | this.notify();
125 | }
126 |
127 | public synchronized void pauseAudio() {
128 | isRunning = false;
129 | }
130 |
131 | public synchronized boolean isFinishing() {
132 | return isFinishing;
133 | }
134 |
135 | public synchronized void finish() {
136 | pauseAudio();
137 | isFinishing = true;
138 | this.notify();
139 | }
140 |
141 | protected abstract void send();
142 | }
143 |
--------------------------------------------------------------------------------
/AndroidManetPtt/src/org/span/ptt/service/ConnectionService.java:
--------------------------------------------------------------------------------
1 | package org.span.ptt.service;
2 |
3 | import org.span.ptt.R;
4 |
5 | import android.app.Notification;
6 | import android.app.NotificationManager;
7 | import android.app.PendingIntent;
8 | import android.app.Service;
9 | import android.content.ComponentName;
10 | import android.content.Intent;
11 | import android.os.Handler;
12 | import android.os.IBinder;
13 | import android.os.Message;
14 | import android.os.Messenger;
15 | import android.util.Log;
16 |
17 | public class ConnectionService extends Service {
18 |
19 | private final static String TAG = "ConnectionService";
20 |
21 | // unique id for the notification
22 | private static final int NOTIFICATION_ID = 0;
23 |
24 | private final Messenger receiveMessenger = new Messenger(new IncomingHandler());
25 |
26 | // notification management
27 | private NotificationManager notificationManager = null;
28 |
29 | private Notification notification = null;
30 |
31 | private PendingIntent pendingIntent = null;
32 |
33 | private ConnectionServiceHelper helper = null;
34 |
35 | @Override
36 | public IBinder onBind(Intent intent) {
37 | return receiveMessenger.getBinder();
38 | }
39 |
40 | @Override
41 | public void onCreate() {
42 | super.onCreate();
43 | Log.d(TAG, "onCreate()"); // DEBUG
44 |
45 | // android.os.Debug.waitForDebugger(); // DEBUG
46 |
47 | // notification management
48 | notificationManager = (NotificationManager)getSystemService(NOTIFICATION_SERVICE);
49 | notificationManager.cancelAll(); // in case service was force-killed
50 |
51 | helper = ConnectionServiceHelper.getInstance();
52 | helper.setService(this);
53 | helper.setup();
54 |
55 | // TODO: After "No longer want ..." eventually kills the service,
56 | // this method will be called. Gracefully resume operations.
57 | }
58 |
59 | @Override
60 | public void onDestroy() {
61 | super.onDestroy();
62 | Log.d(TAG, "onDestroy()"); // DEBUG
63 | }
64 |
65 | @Override
66 | public void onStart(Intent intent, int startId) {
67 | super.onStart(intent, startId);
68 | Log.d(TAG, "onStart"); // DEBUG
69 | }
70 |
71 | // called by the system every time a client explicitly starts the service by calling startService(Intent)
72 | @Override
73 | public int onStartCommand(Intent intent, int flags, int startId) {
74 | Log.d(TAG, "onStartCommand"); // DEBUG
75 | return START_STICKY; // run service until explicitly stopped
76 | }
77 |
78 | public void showNotification(String content) {
79 |
80 | int icon = R.drawable.icon;
81 |
82 | if (notification == null || notification.icon != icon) {
83 | // set the icon, ticker text, and timestamp
84 | notification = new Notification(icon, content, System.currentTimeMillis());
85 |
86 | // try to prevent service from being killed with "no longer want";
87 | // this only prolongs the inevitable
88 | startForeground(NOTIFICATION_ID, notification);
89 |
90 | // pending intent to launch main activity if the user selects notification
91 | // pendingIntent = PendingIntent.getActivity(this, 0, new Intent(this, DummyActivity.class), 0);
92 |
93 | Intent launchIntent = new Intent(Intent.ACTION_MAIN).addCategory(Intent.CATEGORY_LAUNCHER);
94 | launchIntent.setComponent(new ComponentName("org.span.ptt", "org.span.ptt.Main"));
95 | pendingIntent = PendingIntent.getActivity(this, 0, launchIntent, 0);
96 |
97 | // don't allow user to clear notification
98 | notification.flags = notification.flags | Notification.FLAG_ONGOING_EVENT;
99 | } else {
100 | // set the ticker text
101 | notification.tickerText = content;
102 | }
103 |
104 | // set the info for the views that show in the notification panel
105 | notification.setLatestEventInfo(this, "MANET Voice Chat", content, pendingIntent);
106 |
107 | // send the notification
108 | notificationManager.notify(NOTIFICATION_ID, notification);
109 | }
110 |
111 | private class IncomingHandler extends Handler {
112 |
113 | @Override
114 | public void handleMessage(Message rxmessage) {
115 | switch (rxmessage.what) {
116 |
117 | // TODO
118 |
119 | default:
120 | super.handleMessage(rxmessage);
121 | }
122 | }
123 | }
124 | }
--------------------------------------------------------------------------------
/AndroidManetPtt/jni/speex/libspeex/filters.h:
--------------------------------------------------------------------------------
1 | /* Copyright (C) 2002 Jean-Marc Valin */
2 | /**
3 | @file filters.h
4 | @brief Various analysis/synthesis filters
5 | */
6 | /*
7 | Redistribution and use in source and binary forms, with or without
8 | modification, are permitted provided that the following conditions
9 | are met:
10 |
11 | - Redistributions of source code must retain the above copyright
12 | notice, this list of conditions and the following disclaimer.
13 |
14 | - Redistributions in binary form must reproduce the above copyright
15 | notice, this list of conditions and the following disclaimer in the
16 | documentation and/or other materials provided with the distribution.
17 |
18 | - Neither the name of the Xiph.org Foundation nor the names of its
19 | contributors may be used to endorse or promote products derived from
20 | this software without specific prior written permission.
21 |
22 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
23 | ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
24 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
25 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR
26 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
27 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
28 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
29 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
30 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
31 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
32 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 | */
34 |
35 | #ifndef FILTERS_H
36 | #define FILTERS_H
37 |
38 | #include "arch.h"
39 |
40 | spx_word16_t compute_rms(const spx_sig_t *x, int len);
41 | spx_word16_t compute_rms16(const spx_word16_t *x, int len);
42 | void signal_mul(const spx_sig_t *x, spx_sig_t *y, spx_word32_t scale, int len);
43 | void signal_div(const spx_word16_t *x, spx_word16_t *y, spx_word32_t scale, int len);
44 |
45 | #ifdef FIXED_POINT
46 |
47 | int normalize16(const spx_sig_t *x, spx_word16_t *y, spx_sig_t max_scale, int len);
48 |
49 | #endif
50 |
51 |
52 | #define HIGHPASS_NARROWBAND 0
53 | #define HIGHPASS_WIDEBAND 2
54 | #define HIGHPASS_INPUT 0
55 | #define HIGHPASS_OUTPUT 1
56 | #define HIGHPASS_IRS 4
57 |
58 | void highpass(const spx_word16_t *x, spx_word16_t *y, int len, int filtID, spx_mem_t *mem);
59 |
60 |
61 | void qmf_decomp(const spx_word16_t *xx, const spx_word16_t *aa, spx_word16_t *, spx_word16_t *y2, int N, int M, spx_word16_t *mem, char *stack);
62 | void qmf_synth(const spx_word16_t *x1, const spx_word16_t *x2, const spx_word16_t *a, spx_word16_t *y, int N, int M, spx_word16_t *mem1, spx_word16_t *mem2, char *stack);
63 |
64 | void filter_mem16(const spx_word16_t *x, const spx_coef_t *num, const spx_coef_t *den, spx_word16_t *y, int N, int ord, spx_mem_t *mem, char *stack);
65 | void iir_mem16(const spx_word16_t *x, const spx_coef_t *den, spx_word16_t *y, int N, int ord, spx_mem_t *mem, char *stack);
66 | void fir_mem16(const spx_word16_t *x, const spx_coef_t *num, spx_word16_t *y, int N, int ord, spx_mem_t *mem, char *stack);
67 |
68 | /* Apply bandwidth expansion on LPC coef */
69 | void bw_lpc(spx_word16_t , const spx_coef_t *lpc_in, spx_coef_t *lpc_out, int order);
70 | void sanitize_values32(spx_word32_t *vec, spx_word32_t min_val, spx_word32_t max_val, int len);
71 |
72 |
73 | void syn_percep_zero16(const spx_word16_t *xx, const spx_coef_t *ak, const spx_coef_t *awk1, const spx_coef_t *awk2, spx_word16_t *y, int N, int ord, char *stack);
74 | void residue_percep_zero16(const spx_word16_t *xx, const spx_coef_t *ak, const spx_coef_t *awk1, const spx_coef_t *awk2, spx_word16_t *y, int N, int ord, char *stack);
75 |
76 | void compute_impulse_response(const spx_coef_t *ak, const spx_coef_t *awk1, const spx_coef_t *awk2, spx_word16_t *y, int N, int ord, char *stack);
77 |
78 | void multicomb(
79 | spx_word16_t *exc, /*decoded excitation*/
80 | spx_word16_t *new_exc, /*enhanced excitation*/
81 | spx_coef_t *ak, /*LPC filter coefs*/
82 | int p, /*LPC order*/
83 | int nsf, /*sub-frame size*/
84 | int pitch, /*pitch period*/
85 | int max_pitch, /*pitch gain (3-tap)*/
86 | spx_word16_t comb_gain, /*gain of comb filter*/
87 | char *stack
88 | );
89 |
90 | #endif
91 |
--------------------------------------------------------------------------------
/AndroidManetPtt/jni/speex/libspeex/gain_table.c:
--------------------------------------------------------------------------------
1 | /* Copyright (C) 2002 Jean-Marc Valin
2 | File: gain_table.c
3 | Codebook for 3-tap pitch prediction gain (128 entries)
4 |
5 | Redistribution and use in source and binary forms, with or without
6 | modification, are permitted provided that the following conditions are
7 | met:
8 |
9 | 1. Redistributions of source code must retain the above copyright notice,
10 | this list of conditions and the following disclaimer.
11 |
12 | 2. Redistributions in binary form must reproduce the above copyright
13 | notice, this list of conditions and the following disclaimer in the
14 | documentation and/or other materials provided with the distribution.
15 |
16 | 3. The name of the author may not be used to endorse or promote products
17 | derived from this software without specific prior written permission.
18 |
19 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
20 | IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
21 | OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
22 | DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
23 | INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
24 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
25 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26 | HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
27 | STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
28 | ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 | POSSIBILITY OF SUCH DAMAGE.
30 | */
31 |
32 | const signed char gain_cdbk_nb[512] = {
33 | -32, -32, -32, 0,
34 | -28, -67, -5, 33,
35 | -42, -6, -32, 18,
36 | -57, -10, -54, 35,
37 | -16, 27, -41, 42,
38 | 19, -19, -40, 36,
39 | -45, 24, -21, 40,
40 | -8, -14, -18, 28,
41 | 1, 14, -58, 53,
42 | -18, -88, -39, 39,
43 | -38, 21, -18, 37,
44 | -19, 20, -43, 38,
45 | 10, 17, -48, 54,
46 | -52, -58, -13, 33,
47 | -44, -1, -11, 32,
48 | -12, -11, -34, 22,
49 | 14, 0, -46, 46,
50 | -37, -35, -34, 5,
51 | -25, 44, -30, 43,
52 | 6, -4, -63, 49,
53 | -31, 43, -41, 43,
54 | -23, 30, -43, 41,
55 | -43, 26, -14, 44,
56 | -33, 1, -13, 27,
57 | -13, 18, -37, 37,
58 | -46, -73, -45, 34,
59 | -36, 24, -25, 34,
60 | -36, -11, -20, 19,
61 | -25, 12, -18, 33,
62 | -36, -69, -59, 34,
63 | -45, 6, 8, 46,
64 | -22, -14, -24, 18,
65 | -1, 13, -44, 44,
66 | -39, -48, -26, 15,
67 | -32, 31, -37, 34,
68 | -33, 15, -46, 31,
69 | -24, 30, -36, 37,
70 | -41, 31, -23, 41,
71 | -50, 22, -4, 50,
72 | -22, 2, -21, 28,
73 | -17, 30, -34, 40,
74 | -7, -60, -28, 29,
75 | -38, 42, -28, 42,
76 | -44, -11, 21, 43,
77 | -16, 8, -44, 34,
78 | -39, -55, -43, 21,
79 | -11, -35, 26, 41,
80 | -9, 0, -34, 29,
81 | -8, 121, -81, 113,
82 | 7, -16, -22, 33,
83 | -37, 33, -31, 36,
84 | -27, -7, -36, 17,
85 | -34, 70, -57, 65,
86 | -37, -11, -48, 21,
87 | -40, 17, -1, 44,
88 | -33, 6, -6, 33,
89 | -9, 0, -20, 34,
90 | -21, 69, -33, 57,
91 | -29, 33, -31, 35,
92 | -55, 12, -1, 49,
93 | -33, 27, -22, 35,
94 | -50, -33, -47, 17,
95 | -50, 54, 51, 94,
96 | -1, -5, -44, 35,
97 | -4, 22, -40, 45,
98 | -39, -66, -25, 24,
99 | -33, 1, -26, 20,
100 | -24, -23, -25, 12,
101 | -11, 21, -45, 44,
102 | -25, -45, -19, 17,
103 | -43, 105, -16, 82,
104 | 5, -21, 1, 41,
105 | -16, 11, -33, 30,
106 | -13, -99, -4, 57,
107 | -37, 33, -15, 44,
108 | -25, 37, -63, 54,
109 | -36, 24, -31, 31,
110 | -53, -56, -38, 26,
111 | -41, -4, 4, 37,
112 | -33, 13, -30, 24,
113 | 49, 52, -94, 114,
114 | -5, -30, -15, 23,
115 | 1, 38, -40, 56,
116 | -23, 12, -36, 29,
117 | -17, 40, -47, 51,
118 | -37, -41, -39, 11,
119 | -49, 34, 0, 58,
120 | -18, -7, -4, 34,
121 | -16, 17, -27, 35,
122 | 30, 5, -62, 65,
123 | 4, 48, -68, 76,
124 | -43, 11, -11, 38,
125 | -18, 19, -15, 41,
126 | -23, -62, -39, 23,
127 | -42, 10, -2, 41,
128 | -21, -13, -13, 25,
129 | -9, 13, -47, 42,
130 | -23, -62, -24, 24,
131 | -44, 60, -21, 58,
132 | -18, -3, -52, 32,
133 | -22, 22, -36, 34,
134 | -75, 57, 16, 90,
135 | -19, 3, 10, 45,
136 | -29, 23, -38, 32,
137 | -5, -62, -51, 38,
138 | -51, 40, -18, 53,
139 | -42, 13, -24, 32,
140 | -34, 14, -20, 30,
141 | -56, -75, -26, 37,
142 | -26, 32, 15, 59,
143 | -26, 17, -29, 29,
144 | -7, 28, -52, 53,
145 | -12, -30, 5, 30,
146 | -5, -48, -5, 35,
147 | 2, 2, -43, 40,
148 | 21, 16, 16, 75,
149 | -25, -45, -32, 10,
150 | -43, 18, -10, 42,
151 | 9, 0, -1, 52,
152 | -1, 7, -30, 36,
153 | 19, -48, -4, 48,
154 | -28, 25, -29, 32,
155 | -22, 0, -31, 22,
156 | -32, 17, -10, 36,
157 | -64, -41, -62, 36,
158 | -52, 15, 16, 58,
159 | -30, -22, -32, 6,
160 | -7, 9, -38, 36};
161 |
--------------------------------------------------------------------------------
/AndroidManetPtt/jni/speex/libspeex/vq.c:
--------------------------------------------------------------------------------
1 | /* Copyright (C) 2002 Jean-Marc Valin
2 | File: vq.c
3 | Vector quantization
4 |
5 | Redistribution and use in source and binary forms, with or without
6 | modification, are permitted provided that the following conditions
7 | are met:
8 |
9 | - Redistributions of source code must retain the above copyright
10 | notice, this list of conditions and the following disclaimer.
11 |
12 | - Redistributions in binary form must reproduce the above copyright
13 | notice, this list of conditions and the following disclaimer in the
14 | documentation and/or other materials provided with the distribution.
15 |
16 | - Neither the name of the Xiph.org Foundation nor the names of its
17 | contributors may be used to endorse or promote products derived from
18 | this software without specific prior written permission.
19 |
20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21 | ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR
24 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
26 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
27 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
28 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
29 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
30 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 | */
32 |
33 | #ifdef HAVE_CONFIG_H
34 | #include "config.h"
35 | #endif
36 |
37 | #include "vq.h"
38 | #include "stack_alloc.h"
39 | #include "arch.h"
40 |
41 | #ifdef _USE_SSE
42 | #include
43 | #include "vq_sse.h"
44 | #elif defined(SHORTCUTS) && (defined(ARM4_ASM) || defined(ARM5E_ASM))
45 | #include "vq_arm4.h"
46 | #elif defined(BFIN_ASM)
47 | #include "vq_bfin.h"
48 | #endif
49 |
50 |
51 | int scal_quant(spx_word16_t in, const spx_word16_t *boundary, int entries)
52 | {
53 | int i=0;
54 | while (iboundary[0])
55 | {
56 | boundary++;
57 | i++;
58 | }
59 | return i;
60 | }
61 |
62 | int scal_quant32(spx_word32_t in, const spx_word32_t *boundary, int entries)
63 | {
64 | int i=0;
65 | while (iboundary[0])
66 | {
67 | boundary++;
68 | i++;
69 | }
70 | return i;
71 | }
72 |
73 |
74 | #ifndef OVERRIDE_VQ_NBEST
75 | /*Finds the indices of the n-best entries in a codebook*/
76 | void vq_nbest(spx_word16_t *in, const spx_word16_t *codebook, int len, int entries, spx_word32_t *E, int N, int *nbest, spx_word32_t *best_dist, char *stack)
77 | {
78 | int i,j,k,used;
79 | used = 0;
80 | for (i=0;i= 1) && (k > used || dist < best_dist[k-1]); k--)
93 | {
94 | best_dist[k]=best_dist[k-1];
95 | nbest[k] = nbest[k-1];
96 | }
97 | best_dist[k]=dist;
98 | nbest[k]=i;
99 | used++;
100 | }
101 | }
102 | }
103 | #endif
104 |
105 |
106 |
107 |
108 | #ifndef OVERRIDE_VQ_NBEST_SIGN
109 | /*Finds the indices of the n-best entries in a codebook with sign*/
110 | void vq_nbest_sign(spx_word16_t *in, const spx_word16_t *codebook, int len, int entries, spx_word32_t *E, int N, int *nbest, spx_word32_t *best_dist, char *stack)
111 | {
112 | int i,j,k, sign, used;
113 | used=0;
114 | for (i=0;i0)
120 | {
121 | sign=0;
122 | dist=-dist;
123 | } else
124 | {
125 | sign=1;
126 | }
127 | #ifdef FIXED_POINT
128 | dist = ADD32(dist,SHR32(E[i],1));
129 | #else
130 | dist = ADD32(dist,.5f*E[i]);
131 | #endif
132 | if (i= 1) && (k > used || dist < best_dist[k-1]); k--)
135 | {
136 | best_dist[k]=best_dist[k-1];
137 | nbest[k] = nbest[k-1];
138 | }
139 | best_dist[k]=dist;
140 | nbest[k]=i;
141 | used++;
142 | if (sign)
143 | nbest[k]+=entries;
144 | }
145 | }
146 | }
147 | #endif
148 |
--------------------------------------------------------------------------------
/AndroidManetPtt/jni/speex/libspeex/speex_callbacks.c:
--------------------------------------------------------------------------------
1 | /* Copyright (C) 2002 Jean-Marc Valin
2 | File speex_callbacks.c
3 | Callback handling and in-band signalling
4 |
5 |
6 | Redistribution and use in source and binary forms, with or without
7 | modification, are permitted provided that the following conditions
8 | are met:
9 |
10 | - Redistributions of source code must retain the above copyright
11 | notice, this list of conditions and the following disclaimer.
12 |
13 | - Redistributions in binary form must reproduce the above copyright
14 | notice, this list of conditions and the following disclaimer in the
15 | documentation and/or other materials provided with the distribution.
16 |
17 | - Neither the name of the Xiph.org Foundation nor the names of its
18 | contributors may be used to endorse or promote products derived from
19 | this software without specific prior written permission.
20 |
21 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22 | ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
24 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR
25 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
26 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
27 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
28 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
29 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
30 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
31 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 |
33 | */
34 |
35 | #ifdef HAVE_CONFIG_H
36 | #include "config.h"
37 | #endif
38 |
39 | #include
40 | #include "arch.h"
41 | #include "os_support.h"
42 |
43 | EXPORT int speex_inband_handler(SpeexBits *bits, SpeexCallback *callback_list, void *state)
44 | {
45 | int id;
46 | SpeexCallback *callback;
47 | /*speex_bits_advance(bits, 5);*/
48 | id=speex_bits_unpack_unsigned(bits, 4);
49 | callback = callback_list+id;
50 |
51 | if (callback->func)
52 | {
53 | return callback->func(bits, state, callback->data);
54 | } else
55 | /*If callback is not registered, skip the right number of bits*/
56 | {
57 | int adv;
58 | if (id<2)
59 | adv = 1;
60 | else if (id<8)
61 | adv = 4;
62 | else if (id<10)
63 | adv = 8;
64 | else if (id<12)
65 | adv = 16;
66 | else if (id<14)
67 | adv = 32;
68 | else
69 | adv = 64;
70 | speex_bits_advance(bits, adv);
71 | }
72 | return 0;
73 | }
74 |
75 | EXPORT int speex_std_mode_request_handler(SpeexBits *bits, void *state, void *data)
76 | {
77 | spx_int32_t m;
78 | m = speex_bits_unpack_unsigned(bits, 4);
79 | speex_encoder_ctl(data, SPEEX_SET_MODE, &m);
80 | return 0;
81 | }
82 |
83 | EXPORT int speex_std_low_mode_request_handler(SpeexBits *bits, void *state, void *data)
84 | {
85 | spx_int32_t m;
86 | m = speex_bits_unpack_unsigned(bits, 4);
87 | speex_encoder_ctl(data, SPEEX_SET_LOW_MODE, &m);
88 | return 0;
89 | }
90 |
91 | EXPORT int speex_std_high_mode_request_handler(SpeexBits *bits, void *state, void *data)
92 | {
93 | spx_int32_t m;
94 | m = speex_bits_unpack_unsigned(bits, 4);
95 | speex_encoder_ctl(data, SPEEX_SET_HIGH_MODE, &m);
96 | return 0;
97 | }
98 |
99 | #ifndef DISABLE_VBR
100 | EXPORT int speex_std_vbr_request_handler(SpeexBits *bits, void *state, void *data)
101 | {
102 | spx_int32_t vbr;
103 | vbr = speex_bits_unpack_unsigned(bits, 1);
104 | speex_encoder_ctl(data, SPEEX_SET_VBR, &vbr);
105 | return 0;
106 | }
107 | #endif /* #ifndef DISABLE_VBR */
108 |
109 | EXPORT int speex_std_enh_request_handler(SpeexBits *bits, void *state, void *data)
110 | {
111 | spx_int32_t enh;
112 | enh = speex_bits_unpack_unsigned(bits, 1);
113 | speex_decoder_ctl(data, SPEEX_SET_ENH, &enh);
114 | return 0;
115 | }
116 |
117 | #ifndef DISABLE_VBR
118 | EXPORT int speex_std_vbr_quality_request_handler(SpeexBits *bits, void *state, void *data)
119 | {
120 | float qual;
121 | qual = speex_bits_unpack_unsigned(bits, 4);
122 | speex_encoder_ctl(data, SPEEX_SET_VBR_QUALITY, &qual);
123 | return 0;
124 | }
125 | #endif /* #ifndef DISABLE_VBR */
126 |
127 | EXPORT int speex_std_char_handler(SpeexBits *bits, void *state, void *data)
128 | {
129 | unsigned char ch;
130 | ch = speex_bits_unpack_unsigned(bits, 8);
131 | _speex_putc(ch, data);
132 | /*printf("speex_std_char_handler ch=%x\n", ch);*/
133 | return 0;
134 | }
135 |
136 |
137 |
138 | /* Default handler for user callbacks: skip it */
139 | EXPORT int speex_default_user_handler(SpeexBits *bits, void *state, void *data)
140 | {
141 | int req_size = speex_bits_unpack_unsigned(bits, 4);
142 | speex_bits_advance(bits, 5+8*req_size);
143 | return 0;
144 | }
145 |
--------------------------------------------------------------------------------
/AndroidManetPtt/obj/local/armeabi/objs/speex_jni/speex/libspeex/vbr.o.d:
--------------------------------------------------------------------------------
1 | /home/ionut/Android/workspace/pttdroid/obj/local/armeabi/objs/speex_jni/speex/libspeex/vbr.o: \
2 | /home/ionut/Android/workspace/pttdroid/jni/speex/libspeex/vbr.c \
3 | /home/ionut/Android/workspace/pttdroid/jni/speex/libspeex/vbr.h \
4 | /home/ionut/Android/workspace/pttdroid/jni/speex/libspeex/arch.h \
5 | /home/ionut/Android/workspace/pttdroid/jni/speex/include/speex/speex_types.h \
6 | /home/ionut/Android/workspace/pttdroid/jni/speex/include/speex/speex_config_types.h \
7 | /home/ionut/Android/workspace/pttdroid/jni/speex/libspeex/fixed_generic.h \
8 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/math.h \
9 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/sys/cdefs.h \
10 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/sys/cdefs_elf.h \
11 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/sys/types.h \
12 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/stdint.h \
13 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/sys/_types.h \
14 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/machine/_types.h \
15 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/linux/posix_types.h \
16 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/linux/stddef.h \
17 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/linux/compiler.h \
18 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/asm/posix_types.h \
19 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/asm/types.h \
20 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/linux/types.h \
21 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/machine/kernel.h \
22 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/sys/sysmacros.h \
23 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/limits.h \
24 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/sys/limits.h \
25 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/linux/limits.h \
26 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/machine/internal_types.h \
27 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/machine/limits.h
28 |
29 | /home/ionut/Android/workspace/pttdroid/jni/speex/libspeex/vbr.h:
30 |
31 | /home/ionut/Android/workspace/pttdroid/jni/speex/libspeex/arch.h:
32 |
33 | /home/ionut/Android/workspace/pttdroid/jni/speex/include/speex/speex_types.h:
34 |
35 | /home/ionut/Android/workspace/pttdroid/jni/speex/include/speex/speex_config_types.h:
36 |
37 | /home/ionut/Android/workspace/pttdroid/jni/speex/libspeex/fixed_generic.h:
38 |
39 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/math.h:
40 |
41 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/sys/cdefs.h:
42 |
43 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/sys/cdefs_elf.h:
44 |
45 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/sys/types.h:
46 |
47 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/stdint.h:
48 |
49 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/sys/_types.h:
50 |
51 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/machine/_types.h:
52 |
53 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/linux/posix_types.h:
54 |
55 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/linux/stddef.h:
56 |
57 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/linux/compiler.h:
58 |
59 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/asm/posix_types.h:
60 |
61 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/asm/types.h:
62 |
63 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/linux/types.h:
64 |
65 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/machine/kernel.h:
66 |
67 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/sys/sysmacros.h:
68 |
69 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/limits.h:
70 |
71 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/sys/limits.h:
72 |
73 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/linux/limits.h:
74 |
75 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/machine/internal_types.h:
76 |
77 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/machine/limits.h:
78 |
--------------------------------------------------------------------------------
/AndroidManetPtt/obj/local/armeabi/objs/speex_jni/speex/libspeex/bits.o.d:
--------------------------------------------------------------------------------
1 | /home/ionut/Android/workspace/pttdroid/obj/local/armeabi/objs/speex_jni/speex/libspeex/bits.o: \
2 | /home/ionut/Android/workspace/pttdroid/jni/speex/libspeex/bits.c \
3 | /home/ionut/Android/workspace/pttdroid/jni/speex/include/speex/speex_bits.h \
4 | /home/ionut/Android/workspace/pttdroid/jni/speex/libspeex/arch.h \
5 | /home/ionut/Android/workspace/pttdroid/jni/speex/include/speex/speex_types.h \
6 | /home/ionut/Android/workspace/pttdroid/jni/speex/include/speex/speex_config_types.h \
7 | /home/ionut/Android/workspace/pttdroid/jni/speex/libspeex/fixed_generic.h \
8 | /home/ionut/Android/workspace/pttdroid/jni/speex/libspeex/os_support.h \
9 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/string.h \
10 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/sys/cdefs.h \
11 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/sys/cdefs_elf.h \
12 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/malloc.h \
13 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/stdio.h \
14 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/sys/_types.h \
15 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/machine/_types.h \
16 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/sys/types.h \
17 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/stdint.h \
18 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/linux/posix_types.h \
19 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/linux/stddef.h \
20 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/linux/compiler.h \
21 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/asm/posix_types.h \
22 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/asm/types.h \
23 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/linux/types.h \
24 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/machine/kernel.h \
25 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/sys/sysmacros.h \
26 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/stdlib.h \
27 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/alloca.h \
28 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/strings.h \
29 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/memory.h
30 |
31 | /home/ionut/Android/workspace/pttdroid/jni/speex/include/speex/speex_bits.h:
32 |
33 | /home/ionut/Android/workspace/pttdroid/jni/speex/libspeex/arch.h:
34 |
35 | /home/ionut/Android/workspace/pttdroid/jni/speex/include/speex/speex_types.h:
36 |
37 | /home/ionut/Android/workspace/pttdroid/jni/speex/include/speex/speex_config_types.h:
38 |
39 | /home/ionut/Android/workspace/pttdroid/jni/speex/libspeex/fixed_generic.h:
40 |
41 | /home/ionut/Android/workspace/pttdroid/jni/speex/libspeex/os_support.h:
42 |
43 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/string.h:
44 |
45 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/sys/cdefs.h:
46 |
47 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/sys/cdefs_elf.h:
48 |
49 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/malloc.h:
50 |
51 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/stdio.h:
52 |
53 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/sys/_types.h:
54 |
55 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/machine/_types.h:
56 |
57 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/sys/types.h:
58 |
59 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/stdint.h:
60 |
61 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/linux/posix_types.h:
62 |
63 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/linux/stddef.h:
64 |
65 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/linux/compiler.h:
66 |
67 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/asm/posix_types.h:
68 |
69 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/asm/types.h:
70 |
71 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/linux/types.h:
72 |
73 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/machine/kernel.h:
74 |
75 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/sys/sysmacros.h:
76 |
77 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/stdlib.h:
78 |
79 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/alloca.h:
80 |
81 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/strings.h:
82 |
83 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/memory.h:
84 |
--------------------------------------------------------------------------------
/AndroidManetPtt/obj/local/armeabi/objs/speex_jni/speex/libspeex/lsp.o.d:
--------------------------------------------------------------------------------
1 | /home/ionut/Android/workspace/pttdroid/obj/local/armeabi/objs/speex_jni/speex/libspeex/lsp.o: \
2 | /home/ionut/Android/workspace/pttdroid/jni/speex/libspeex/lsp.c \
3 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/math.h \
4 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/sys/cdefs.h \
5 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/sys/cdefs_elf.h \
6 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/sys/types.h \
7 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/stdint.h \
8 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/sys/_types.h \
9 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/machine/_types.h \
10 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/linux/posix_types.h \
11 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/linux/stddef.h \
12 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/linux/compiler.h \
13 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/asm/posix_types.h \
14 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/asm/types.h \
15 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/linux/types.h \
16 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/machine/kernel.h \
17 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/sys/sysmacros.h \
18 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/limits.h \
19 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/sys/limits.h \
20 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/linux/limits.h \
21 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/machine/internal_types.h \
22 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/machine/limits.h \
23 | /home/ionut/Android/workspace/pttdroid/jni/speex/libspeex/lsp.h \
24 | /home/ionut/Android/workspace/pttdroid/jni/speex/libspeex/arch.h \
25 | /home/ionut/Android/workspace/pttdroid/jni/speex/include/speex/speex_types.h \
26 | /home/ionut/Android/workspace/pttdroid/jni/speex/include/speex/speex_config_types.h \
27 | /home/ionut/Android/workspace/pttdroid/jni/speex/libspeex/fixed_generic.h \
28 | /home/ionut/Android/workspace/pttdroid/jni/speex/libspeex/stack_alloc.h \
29 | /home/ionut/Android/workspace/pttdroid/jni/speex/libspeex/math_approx.h
30 |
31 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/math.h:
32 |
33 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/sys/cdefs.h:
34 |
35 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/sys/cdefs_elf.h:
36 |
37 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/sys/types.h:
38 |
39 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/stdint.h:
40 |
41 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/sys/_types.h:
42 |
43 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/machine/_types.h:
44 |
45 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/linux/posix_types.h:
46 |
47 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/linux/stddef.h:
48 |
49 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/linux/compiler.h:
50 |
51 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/asm/posix_types.h:
52 |
53 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/asm/types.h:
54 |
55 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/linux/types.h:
56 |
57 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/machine/kernel.h:
58 |
59 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/sys/sysmacros.h:
60 |
61 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/limits.h:
62 |
63 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/sys/limits.h:
64 |
65 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/linux/limits.h:
66 |
67 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/machine/internal_types.h:
68 |
69 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/machine/limits.h:
70 |
71 | /home/ionut/Android/workspace/pttdroid/jni/speex/libspeex/lsp.h:
72 |
73 | /home/ionut/Android/workspace/pttdroid/jni/speex/libspeex/arch.h:
74 |
75 | /home/ionut/Android/workspace/pttdroid/jni/speex/include/speex/speex_types.h:
76 |
77 | /home/ionut/Android/workspace/pttdroid/jni/speex/include/speex/speex_config_types.h:
78 |
79 | /home/ionut/Android/workspace/pttdroid/jni/speex/libspeex/fixed_generic.h:
80 |
81 | /home/ionut/Android/workspace/pttdroid/jni/speex/libspeex/stack_alloc.h:
82 |
83 | /home/ionut/Android/workspace/pttdroid/jni/speex/libspeex/math_approx.h:
84 |
--------------------------------------------------------------------------------
/AndroidManetPtt/jni/speex/libspeex/fixed_generic.h:
--------------------------------------------------------------------------------
1 | /* Copyright (C) 2003 Jean-Marc Valin */
2 | /**
3 | @file fixed_generic.h
4 | @brief Generic fixed-point operations
5 | */
6 | /*
7 | Redistribution and use in source and binary forms, with or without
8 | modification, are permitted provided that the following conditions
9 | are met:
10 |
11 | - Redistributions of source code must retain the above copyright
12 | notice, this list of conditions and the following disclaimer.
13 |
14 | - Redistributions in binary form must reproduce the above copyright
15 | notice, this list of conditions and the following disclaimer in the
16 | documentation and/or other materials provided with the distribution.
17 |
18 | - Neither the name of the Xiph.org Foundation nor the names of its
19 | contributors may be used to endorse or promote products derived from
20 | this software without specific prior written permission.
21 |
22 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
23 | ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
24 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
25 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR
26 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
27 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
28 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
29 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
30 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
31 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
32 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 | */
34 |
35 | #ifndef FIXED_GENERIC_H
36 | #define FIXED_GENERIC_H
37 |
38 | #define QCONST16(x,bits) ((spx_word16_t)(.5+(x)*(((spx_word32_t)1)<<(bits))))
39 | #define QCONST32(x,bits) ((spx_word32_t)(.5+(x)*(((spx_word32_t)1)<<(bits))))
40 |
41 | #define NEG16(x) (-(x))
42 | #define NEG32(x) (-(x))
43 | #define EXTRACT16(x) ((spx_word16_t)(x))
44 | #define EXTEND32(x) ((spx_word32_t)(x))
45 | #define SHR16(a,shift) ((a) >> (shift))
46 | #define SHL16(a,shift) ((a) << (shift))
47 | #define SHR32(a,shift) ((a) >> (shift))
48 | #define SHL32(a,shift) ((a) << (shift))
49 | #define PSHR16(a,shift) (SHR16((a)+((1<<((shift))>>1)),shift))
50 | #define PSHR32(a,shift) (SHR32((a)+((EXTEND32(1)<<((shift))>>1)),shift))
51 | #define VSHR32(a, shift) (((shift)>0) ? SHR32(a, shift) : SHL32(a, -(shift)))
52 | #define SATURATE16(x,a) (((x)>(a) ? (a) : (x)<-(a) ? -(a) : (x)))
53 | #define SATURATE32(x,a) (((x)>(a) ? (a) : (x)<-(a) ? -(a) : (x)))
54 |
55 | #define SHR(a,shift) ((a) >> (shift))
56 | #define SHL(a,shift) ((spx_word32_t)(a) << (shift))
57 | #define PSHR(a,shift) (SHR((a)+((EXTEND32(1)<<((shift))>>1)),shift))
58 | #define SATURATE(x,a) (((x)>(a) ? (a) : (x)<-(a) ? -(a) : (x)))
59 |
60 |
61 | #define ADD16(a,b) ((spx_word16_t)((spx_word16_t)(a)+(spx_word16_t)(b)))
62 | #define SUB16(a,b) ((spx_word16_t)(a)-(spx_word16_t)(b))
63 | #define ADD32(a,b) ((spx_word32_t)(a)+(spx_word32_t)(b))
64 | #define SUB32(a,b) ((spx_word32_t)(a)-(spx_word32_t)(b))
65 |
66 |
67 | /* result fits in 16 bits */
68 | #define MULT16_16_16(a,b) ((((spx_word16_t)(a))*((spx_word16_t)(b))))
69 |
70 | /* (spx_word32_t)(spx_word16_t) gives TI compiler a hint that it's 16x16->32 multiply */
71 | #define MULT16_16(a,b) (((spx_word32_t)(spx_word16_t)(a))*((spx_word32_t)(spx_word16_t)(b)))
72 |
73 | #define MAC16_16(c,a,b) (ADD32((c),MULT16_16((a),(b))))
74 | #define MULT16_32_Q12(a,b) ADD32(MULT16_16((a),SHR((b),12)), SHR(MULT16_16((a),((b)&0x00000fff)),12))
75 | #define MULT16_32_Q13(a,b) ADD32(MULT16_16((a),SHR((b),13)), SHR(MULT16_16((a),((b)&0x00001fff)),13))
76 | #define MULT16_32_Q14(a,b) ADD32(MULT16_16((a),SHR((b),14)), SHR(MULT16_16((a),((b)&0x00003fff)),14))
77 |
78 | #define MULT16_32_Q11(a,b) ADD32(MULT16_16((a),SHR((b),11)), SHR(MULT16_16((a),((b)&0x000007ff)),11))
79 | #define MAC16_32_Q11(c,a,b) ADD32(c,ADD32(MULT16_16((a),SHR((b),11)), SHR(MULT16_16((a),((b)&0x000007ff)),11)))
80 |
81 | #define MULT16_32_P15(a,b) ADD32(MULT16_16((a),SHR((b),15)), PSHR(MULT16_16((a),((b)&0x00007fff)),15))
82 | #define MULT16_32_Q15(a,b) ADD32(MULT16_16((a),SHR((b),15)), SHR(MULT16_16((a),((b)&0x00007fff)),15))
83 | #define MAC16_32_Q15(c,a,b) ADD32(c,ADD32(MULT16_16((a),SHR((b),15)), SHR(MULT16_16((a),((b)&0x00007fff)),15)))
84 |
85 |
86 | #define MAC16_16_Q11(c,a,b) (ADD32((c),SHR(MULT16_16((a),(b)),11)))
87 | #define MAC16_16_Q13(c,a,b) (ADD32((c),SHR(MULT16_16((a),(b)),13)))
88 | #define MAC16_16_P13(c,a,b) (ADD32((c),SHR(ADD32(4096,MULT16_16((a),(b))),13)))
89 |
90 | #define MULT16_16_Q11_32(a,b) (SHR(MULT16_16((a),(b)),11))
91 | #define MULT16_16_Q13(a,b) (SHR(MULT16_16((a),(b)),13))
92 | #define MULT16_16_Q14(a,b) (SHR(MULT16_16((a),(b)),14))
93 | #define MULT16_16_Q15(a,b) (SHR(MULT16_16((a),(b)),15))
94 |
95 | #define MULT16_16_P13(a,b) (SHR(ADD32(4096,MULT16_16((a),(b))),13))
96 | #define MULT16_16_P14(a,b) (SHR(ADD32(8192,MULT16_16((a),(b))),14))
97 | #define MULT16_16_P15(a,b) (SHR(ADD32(16384,MULT16_16((a),(b))),15))
98 |
99 | #define MUL_16_32_R15(a,bh,bl) ADD32(MULT16_16((a),(bh)), SHR(MULT16_16((a),(bl)),15))
100 |
101 | #define DIV32_16(a,b) ((spx_word16_t)(((spx_word32_t)(a))/((spx_word16_t)(b))))
102 | #define PDIV32_16(a,b) ((spx_word16_t)(((spx_word32_t)(a)+((spx_word16_t)(b)>>1))/((spx_word16_t)(b))))
103 | #define DIV32(a,b) (((spx_word32_t)(a))/((spx_word32_t)(b)))
104 | #define PDIV32(a,b) (((spx_word32_t)(a)+((spx_word16_t)(b)>>1))/((spx_word32_t)(b)))
105 |
106 | #endif
107 |
--------------------------------------------------------------------------------
/AndroidManetPtt/jni/speex/include/speex/speex_callbacks.h:
--------------------------------------------------------------------------------
1 | /* Copyright (C) 2002 Jean-Marc Valin*/
2 | /**
3 | @file speex_callbacks.h
4 | @brief Describes callback handling and in-band signalling
5 | */
6 | /*
7 | Redistribution and use in source and binary forms, with or without
8 | modification, are permitted provided that the following conditions
9 | are met:
10 |
11 | - Redistributions of source code must retain the above copyright
12 | notice, this list of conditions and the following disclaimer.
13 |
14 | - Redistributions in binary form must reproduce the above copyright
15 | notice, this list of conditions and the following disclaimer in the
16 | documentation and/or other materials provided with the distribution.
17 |
18 | - Neither the name of the Xiph.org Foundation nor the names of its
19 | contributors may be used to endorse or promote products derived from
20 | this software without specific prior written permission.
21 |
22 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
23 | ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
24 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
25 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR
26 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
27 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
28 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
29 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
30 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
31 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
32 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 |
34 | */
35 |
36 | #ifndef SPEEX_CALLBACKS_H
37 | #define SPEEX_CALLBACKS_H
38 | /** @defgroup SpeexCallbacks Various definitions for Speex callbacks supported by the decoder.
39 | * @{
40 | */
41 |
42 | #include "speex.h"
43 |
44 | #ifdef __cplusplus
45 | extern "C" {
46 | #endif
47 |
48 | /** Total number of callbacks */
49 | #define SPEEX_MAX_CALLBACKS 16
50 |
51 | /* Describes all the in-band requests */
52 |
53 | /*These are 1-bit requests*/
54 | /** Request for perceptual enhancement (1 for on, 0 for off) */
55 | #define SPEEX_INBAND_ENH_REQUEST 0
56 | /** Reserved */
57 | #define SPEEX_INBAND_RESERVED1 1
58 |
59 | /*These are 4-bit requests*/
60 | /** Request for a mode change */
61 | #define SPEEX_INBAND_MODE_REQUEST 2
62 | /** Request for a low mode change */
63 | #define SPEEX_INBAND_LOW_MODE_REQUEST 3
64 | /** Request for a high mode change */
65 | #define SPEEX_INBAND_HIGH_MODE_REQUEST 4
66 | /** Request for VBR (1 on, 0 off) */
67 | #define SPEEX_INBAND_VBR_QUALITY_REQUEST 5
68 | /** Request to be sent acknowledge */
69 | #define SPEEX_INBAND_ACKNOWLEDGE_REQUEST 6
70 | /** Request for VBR (1 for on, 0 for off) */
71 | #define SPEEX_INBAND_VBR_REQUEST 7
72 |
73 | /*These are 8-bit requests*/
74 | /** Send a character in-band */
75 | #define SPEEX_INBAND_CHAR 8
76 | /** Intensity stereo information */
77 | #define SPEEX_INBAND_STEREO 9
78 |
79 | /*These are 16-bit requests*/
80 | /** Transmit max bit-rate allowed */
81 | #define SPEEX_INBAND_MAX_BITRATE 10
82 |
83 | /*These are 32-bit requests*/
84 | /** Acknowledge packet reception */
85 | #define SPEEX_INBAND_ACKNOWLEDGE 12
86 |
87 | /** Callback function type */
88 | typedef int (*speex_callback_func)(SpeexBits *bits, void *state, void *data);
89 |
90 | /** Callback information */
91 | typedef struct SpeexCallback {
92 | int callback_id; /**< ID associated to the callback */
93 | speex_callback_func func; /**< Callback handler function */
94 | void *data; /**< Data that will be sent to the handler */
95 | void *reserved1; /**< Reserved for future use */
96 | int reserved2; /**< Reserved for future use */
97 | } SpeexCallback;
98 |
99 | /** Handle in-band request */
100 | int speex_inband_handler(SpeexBits *bits, SpeexCallback *callback_list, void *state);
101 |
102 | /** Standard handler for mode request (change mode, no questions asked) */
103 | int speex_std_mode_request_handler(SpeexBits *bits, void *state, void *data);
104 |
105 | /** Standard handler for high mode request (change high mode, no questions asked) */
106 | int speex_std_high_mode_request_handler(SpeexBits *bits, void *state, void *data);
107 |
108 | /** Standard handler for in-band characters (write to stderr) */
109 | int speex_std_char_handler(SpeexBits *bits, void *state, void *data);
110 |
111 | /** Default handler for user-defined requests: in this case, just ignore */
112 | int speex_default_user_handler(SpeexBits *bits, void *state, void *data);
113 |
114 |
115 |
116 | /** Standard handler for low mode request (change low mode, no questions asked) */
117 | int speex_std_low_mode_request_handler(SpeexBits *bits, void *state, void *data);
118 |
119 | /** Standard handler for VBR request (Set VBR, no questions asked) */
120 | int speex_std_vbr_request_handler(SpeexBits *bits, void *state, void *data);
121 |
122 | /** Standard handler for enhancer request (Turn enhancer on/off, no questions asked) */
123 | int speex_std_enh_request_handler(SpeexBits *bits, void *state, void *data);
124 |
125 | /** Standard handler for VBR quality request (Set VBR quality, no questions asked) */
126 | int speex_std_vbr_quality_request_handler(SpeexBits *bits, void *state, void *data);
127 |
128 |
129 | #ifdef __cplusplus
130 | }
131 | #endif
132 |
133 | /** @} */
134 | #endif
135 |
--------------------------------------------------------------------------------
/AndroidManetPtt/jni/speex/libspeex/exc_8_128_table.c:
--------------------------------------------------------------------------------
1 | /* Copyright (C) 2002 Jean-Marc Valin
2 | File: exc_8_128_table.c
3 | Codebook for excitation in narrowband CELP mode (7000 bps)
4 |
5 | Redistribution and use in source and binary forms, with or without
6 | modification, are permitted provided that the following conditions
7 | are met:
8 |
9 | - Redistributions of source code must retain the above copyright
10 | notice, this list of conditions and the following disclaimer.
11 |
12 | - Redistributions in binary form must reproduce the above copyright
13 | notice, this list of conditions and the following disclaimer in the
14 | documentation and/or other materials provided with the distribution.
15 |
16 | - Neither the name of the Xiph.org Foundation nor the names of its
17 | contributors may be used to endorse or promote products derived from
18 | this software without specific prior written permission.
19 |
20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21 | ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR
24 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
26 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
27 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
28 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
29 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
30 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 | */
32 |
33 |
34 | const signed char exc_8_128_table[1024] = {
35 | -14,9,13,-32,2,-10,31,-10,
36 | -8,-8,6,-4,-1,10,-64,23,
37 | 6,20,13,6,8,-22,16,34,
38 | 7,42,-49,-28,5,26,4,-15,
39 | 41,34,41,32,33,24,23,14,
40 | 8,40,34,4,-24,-41,-19,-15,
41 | 13,-13,33,-54,24,27,-44,33,
42 | 27,-15,-15,24,-19,14,-36,14,
43 | -9,24,-12,-4,37,-5,16,-34,
44 | 5,10,33,-15,-54,-16,12,25,
45 | 12,1,2,0,3,-1,-4,-4,
46 | 11,2,-56,54,27,-20,13,-6,
47 | -46,-41,-33,-11,-5,7,12,14,
48 | -14,-5,8,20,6,3,4,-8,
49 | -5,-42,11,8,-14,25,-2,2,
50 | 13,11,-22,39,-9,9,5,-45,
51 | -9,7,-9,12,-7,34,-17,-102,
52 | 7,2,-42,18,35,-9,-34,11,
53 | -5,-2,3,22,46,-52,-25,-9,
54 | -94,8,11,-5,-5,-5,4,-7,
55 | -35,-7,54,5,-32,3,24,-9,
56 | -22,8,65,37,-1,-12,-23,-6,
57 | -9,-28,55,-33,14,-3,2,18,
58 | -60,41,-17,8,-16,17,-11,0,
59 | -11,29,-28,37,9,-53,33,-14,
60 | -9,7,-25,-7,-11,26,-32,-8,
61 | 24,-21,22,-19,19,-10,29,-14,
62 | 0,0,0,0,0,0,0,0,
63 | -5,-52,10,41,6,-30,-4,16,
64 | 32,22,-27,-22,32,-3,-28,-3,
65 | 3,-35,6,17,23,21,8,2,
66 | 4,-45,-17,14,23,-4,-31,-11,
67 | -3,14,1,19,-11,2,61,-8,
68 | 9,-12,7,-10,12,-3,-24,99,
69 | -48,23,50,-37,-5,-23,0,8,
70 | -14,35,-64,-5,46,-25,13,-1,
71 | -49,-19,-15,9,34,50,25,11,
72 | -6,-9,-16,-20,-32,-33,-32,-27,
73 | 10,-8,12,-15,56,-14,-32,33,
74 | 3,-9,1,65,-9,-9,-10,-2,
75 | -6,-23,9,17,3,-28,13,-32,
76 | 4,-2,-10,4,-16,76,12,-52,
77 | 6,13,33,-6,4,-14,-9,-3,
78 | 1,-15,-16,28,1,-15,11,16,
79 | 9,4,-21,-37,-40,-6,22,12,
80 | -15,-23,-14,-17,-16,-9,-10,-9,
81 | 13,-39,41,5,-9,16,-38,25,
82 | 46,-47,4,49,-14,17,-2,6,
83 | 18,5,-6,-33,-22,44,50,-2,
84 | 1,3,-6,7,7,-3,-21,38,
85 | -18,34,-14,-41,60,-13,6,16,
86 | -24,35,19,-13,-36,24,3,-17,
87 | -14,-10,36,44,-44,-29,-3,3,
88 | -54,-8,12,55,26,4,-2,-5,
89 | 2,-11,22,-23,2,22,1,-25,
90 | -39,66,-49,21,-8,-2,10,-14,
91 | -60,25,6,10,27,-25,16,5,
92 | -2,-9,26,-13,-20,58,-2,7,
93 | 52,-9,2,5,-4,-15,23,-1,
94 | -38,23,8,27,-6,0,-27,-7,
95 | 39,-10,-14,26,11,-45,-12,9,
96 | -5,34,4,-35,10,43,-22,-11,
97 | 56,-7,20,1,10,1,-26,9,
98 | 94,11,-27,-14,-13,1,-11,0,
99 | 14,-5,-6,-10,-4,-15,-8,-41,
100 | 21,-5,1,-28,-8,22,-9,33,
101 | -23,-4,-4,-12,39,4,-7,3,
102 | -60,80,8,-17,2,-6,12,-5,
103 | 1,9,15,27,31,30,27,23,
104 | 61,47,26,10,-5,-8,-12,-13,
105 | 5,-18,25,-15,-4,-15,-11,12,
106 | -2,-2,-16,-2,-6,24,12,11,
107 | -4,9,1,-9,14,-45,57,12,
108 | 20,-35,26,11,-64,32,-10,-10,
109 | 42,-4,-9,-16,32,24,7,10,
110 | 52,-11,-57,29,0,8,0,-6,
111 | 17,-17,-56,-40,7,20,18,12,
112 | -6,16,5,7,-1,9,1,10,
113 | 29,12,16,13,-2,23,7,9,
114 | -3,-4,-5,18,-64,13,55,-25,
115 | 9,-9,24,14,-25,15,-11,-40,
116 | -30,37,1,-19,22,-5,-31,13,
117 | -2,0,7,-4,16,-67,12,66,
118 | -36,24,-8,18,-15,-23,19,0,
119 | -45,-7,4,3,-13,13,35,5,
120 | 13,33,10,27,23,0,-7,-11,
121 | 43,-74,36,-12,2,5,-8,6,
122 | -33,11,-16,-14,-5,-7,-3,17,
123 | -34,27,-16,11,-9,15,33,-31,
124 | 8,-16,7,-6,-7,63,-55,-17,
125 | 11,-1,20,-46,34,-30,6,9,
126 | 19,28,-9,5,-24,-8,-23,-2,
127 | 31,-19,-16,-5,-15,-18,0,26,
128 | 18,37,-5,-15,-2,17,5,-27,
129 | 21,-33,44,12,-27,-9,17,11,
130 | 25,-21,-31,-7,13,33,-8,-25,
131 | -7,7,-10,4,-6,-9,48,-82,
132 | -23,-8,6,11,-23,3,-3,49,
133 | -29,25,31,4,14,16,9,-4,
134 | -18,10,-26,3,5,-44,-9,9,
135 | -47,-55,15,9,28,1,4,-3,
136 | 46,6,-6,-38,-29,-31,-15,-6,
137 | 3,0,14,-6,8,-54,-50,33,
138 | -5,1,-14,33,-48,26,-4,-5,
139 | -3,-5,-3,-5,-28,-22,77,55,
140 | -1,2,10,10,-9,-14,-66,-49,
141 | 11,-36,-6,-20,10,-10,16,12,
142 | 4,-1,-16,45,-44,-50,31,-2,
143 | 25,42,23,-32,-22,0,11,20,
144 | -40,-35,-40,-36,-32,-26,-21,-13,
145 | 52,-22,6,-24,-20,17,-5,-8,
146 | 36,-25,-11,21,-26,6,34,-8,
147 | 7,20,-3,5,-25,-8,18,-5,
148 | -9,-4,1,-9,20,20,39,48,
149 | -24,9,5,-65,22,29,4,3,
150 | -43,-11,32,-6,9,19,-27,-10,
151 | -47,-14,24,10,-7,-36,-7,-1,
152 | -4,-5,-5,16,53,25,-26,-29,
153 | -4,-12,45,-58,-34,33,-5,2,
154 | -1,27,-48,31,-15,22,-5,4,
155 | 7,7,-25,-3,11,-22,16,-12,
156 | 8,-3,7,-11,45,14,-73,-19,
157 | 56,-46,24,-20,28,-12,-2,-1,
158 | -36,-3,-33,19,-6,7,2,-15,
159 | 5,-31,-45,8,35,13,20,0,
160 | -9,48,-13,-43,-3,-13,2,-5,
161 | 72,-68,-27,2,1,-2,-7,5,
162 | 36,33,-40,-12,-4,-5,23,19};
163 |
--------------------------------------------------------------------------------
/AndroidManetPtt/obj/local/armeabi/objs/speex_jni/speex/libspeex/filters.o.d:
--------------------------------------------------------------------------------
1 | /home/ionut/Android/workspace/pttdroid/obj/local/armeabi/objs/speex_jni/speex/libspeex/filters.o: \
2 | /home/ionut/Android/workspace/pttdroid/jni/speex/libspeex/filters.c \
3 | /home/ionut/Android/workspace/pttdroid/jni/speex/libspeex/filters.h \
4 | /home/ionut/Android/workspace/pttdroid/jni/speex/libspeex/arch.h \
5 | /home/ionut/Android/workspace/pttdroid/jni/speex/include/speex/speex_types.h \
6 | /home/ionut/Android/workspace/pttdroid/jni/speex/include/speex/speex_config_types.h \
7 | /home/ionut/Android/workspace/pttdroid/jni/speex/libspeex/fixed_generic.h \
8 | /home/ionut/Android/workspace/pttdroid/jni/speex/libspeex/stack_alloc.h \
9 | /home/ionut/Android/workspace/pttdroid/jni/speex/libspeex/math_approx.h \
10 | /home/ionut/Android/workspace/pttdroid/jni/speex/libspeex/ltp.h \
11 | /home/ionut/Android/workspace/pttdroid/jni/speex/include/speex/speex_bits.h \
12 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/math.h \
13 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/sys/cdefs.h \
14 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/sys/cdefs_elf.h \
15 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/sys/types.h \
16 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/stdint.h \
17 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/sys/_types.h \
18 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/machine/_types.h \
19 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/linux/posix_types.h \
20 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/linux/stddef.h \
21 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/linux/compiler.h \
22 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/asm/posix_types.h \
23 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/asm/types.h \
24 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/linux/types.h \
25 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/machine/kernel.h \
26 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/sys/sysmacros.h \
27 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/limits.h \
28 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/sys/limits.h \
29 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/linux/limits.h \
30 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/machine/internal_types.h \
31 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/machine/limits.h
32 |
33 | /home/ionut/Android/workspace/pttdroid/jni/speex/libspeex/filters.h:
34 |
35 | /home/ionut/Android/workspace/pttdroid/jni/speex/libspeex/arch.h:
36 |
37 | /home/ionut/Android/workspace/pttdroid/jni/speex/include/speex/speex_types.h:
38 |
39 | /home/ionut/Android/workspace/pttdroid/jni/speex/include/speex/speex_config_types.h:
40 |
41 | /home/ionut/Android/workspace/pttdroid/jni/speex/libspeex/fixed_generic.h:
42 |
43 | /home/ionut/Android/workspace/pttdroid/jni/speex/libspeex/stack_alloc.h:
44 |
45 | /home/ionut/Android/workspace/pttdroid/jni/speex/libspeex/math_approx.h:
46 |
47 | /home/ionut/Android/workspace/pttdroid/jni/speex/libspeex/ltp.h:
48 |
49 | /home/ionut/Android/workspace/pttdroid/jni/speex/include/speex/speex_bits.h:
50 |
51 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/math.h:
52 |
53 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/sys/cdefs.h:
54 |
55 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/sys/cdefs_elf.h:
56 |
57 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/sys/types.h:
58 |
59 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/stdint.h:
60 |
61 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/sys/_types.h:
62 |
63 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/machine/_types.h:
64 |
65 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/linux/posix_types.h:
66 |
67 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/linux/stddef.h:
68 |
69 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/linux/compiler.h:
70 |
71 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/asm/posix_types.h:
72 |
73 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/asm/types.h:
74 |
75 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/linux/types.h:
76 |
77 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/machine/kernel.h:
78 |
79 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/sys/sysmacros.h:
80 |
81 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/limits.h:
82 |
83 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/sys/limits.h:
84 |
85 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/linux/limits.h:
86 |
87 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/machine/internal_types.h:
88 |
89 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/machine/limits.h:
90 |
--------------------------------------------------------------------------------
/AndroidManetPtt/obj/local/armeabi/objs/speex_jni/speex/libspeex/speex_callbacks.o.d:
--------------------------------------------------------------------------------
1 | /home/ionut/Android/workspace/pttdroid/obj/local/armeabi/objs/speex_jni/speex/libspeex/speex_callbacks.o: \
2 | /home/ionut/Android/workspace/pttdroid/jni/speex/libspeex/speex_callbacks.c \
3 | /home/ionut/Android/workspace/pttdroid/jni/speex/include/speex/speex_callbacks.h \
4 | /home/ionut/Android/workspace/pttdroid/jni/speex/include/speex/speex.h \
5 | /home/ionut/Android/workspace/pttdroid/jni/speex/include/speex/speex_bits.h \
6 | /home/ionut/Android/workspace/pttdroid/jni/speex/include/speex/speex_types.h \
7 | /home/ionut/Android/workspace/pttdroid/jni/speex/include/speex/speex_config_types.h \
8 | /home/ionut/Android/workspace/pttdroid/jni/speex/libspeex/arch.h \
9 | /home/ionut/Android/workspace/pttdroid/jni/speex/libspeex/fixed_generic.h \
10 | /home/ionut/Android/workspace/pttdroid/jni/speex/libspeex/os_support.h \
11 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/string.h \
12 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/sys/cdefs.h \
13 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/sys/cdefs_elf.h \
14 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/malloc.h \
15 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/stdio.h \
16 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/sys/_types.h \
17 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/machine/_types.h \
18 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/sys/types.h \
19 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/stdint.h \
20 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/linux/posix_types.h \
21 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/linux/stddef.h \
22 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/linux/compiler.h \
23 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/asm/posix_types.h \
24 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/asm/types.h \
25 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/linux/types.h \
26 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/machine/kernel.h \
27 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/sys/sysmacros.h \
28 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/stdlib.h \
29 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/alloca.h \
30 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/strings.h \
31 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/memory.h
32 |
33 | /home/ionut/Android/workspace/pttdroid/jni/speex/include/speex/speex_callbacks.h:
34 |
35 | /home/ionut/Android/workspace/pttdroid/jni/speex/include/speex/speex.h:
36 |
37 | /home/ionut/Android/workspace/pttdroid/jni/speex/include/speex/speex_bits.h:
38 |
39 | /home/ionut/Android/workspace/pttdroid/jni/speex/include/speex/speex_types.h:
40 |
41 | /home/ionut/Android/workspace/pttdroid/jni/speex/include/speex/speex_config_types.h:
42 |
43 | /home/ionut/Android/workspace/pttdroid/jni/speex/libspeex/arch.h:
44 |
45 | /home/ionut/Android/workspace/pttdroid/jni/speex/libspeex/fixed_generic.h:
46 |
47 | /home/ionut/Android/workspace/pttdroid/jni/speex/libspeex/os_support.h:
48 |
49 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/string.h:
50 |
51 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/sys/cdefs.h:
52 |
53 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/sys/cdefs_elf.h:
54 |
55 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/malloc.h:
56 |
57 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/stdio.h:
58 |
59 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/sys/_types.h:
60 |
61 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/machine/_types.h:
62 |
63 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/sys/types.h:
64 |
65 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/stdint.h:
66 |
67 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/linux/posix_types.h:
68 |
69 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/linux/stddef.h:
70 |
71 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/linux/compiler.h:
72 |
73 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/asm/posix_types.h:
74 |
75 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/asm/types.h:
76 |
77 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/linux/types.h:
78 |
79 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/machine/kernel.h:
80 |
81 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/sys/sysmacros.h:
82 |
83 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/stdlib.h:
84 |
85 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/alloca.h:
86 |
87 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/strings.h:
88 |
89 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/memory.h:
90 |
--------------------------------------------------------------------------------
/AndroidManetPtt/jni/speex/libspeex/high_lsp_tables.c:
--------------------------------------------------------------------------------
1 | /* Copyright (C) 2002 Jean-Marc Valin
2 | File: high_lsp_tables.c
3 | Codebooks for high-band LSPs in SB-CELP mode
4 |
5 | Redistribution and use in source and binary forms, with or without
6 | modification, are permitted provided that the following conditions are
7 | met:
8 |
9 | 1. Redistributions of source code must retain the above copyright notice,
10 | this list of conditions and the following disclaimer.
11 |
12 | 2. Redistributions in binary form must reproduce the above copyright
13 | notice, this list of conditions and the following disclaimer in the
14 | documentation and/or other materials provided with the distribution.
15 |
16 | 3. The name of the author may not be used to endorse or promote products
17 | derived from this software without specific prior written permission.
18 |
19 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
20 | IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
21 | OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
22 | DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
23 | INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
24 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
25 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26 | HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
27 | STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
28 | ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 | POSSIBILITY OF SUCH DAMAGE.
30 | */
31 |
32 | const signed char high_lsp_cdbk[512]={
33 | 39,12,-14,-20,-29,-61,-67,-76,
34 | -32,-71,-67,68,77,46,34,5,
35 | -13,-48,-46,-72,-81,-84,-60,-58,
36 | -40,-28,82,93,68,45,29,3,
37 | -19,-47,-28,-43,-35,-30,-8,-13,
38 | -39,-91,-91,-123,-96,10,10,-6,
39 | -18,-55,-60,-91,-56,-36,-27,-16,
40 | -48,-75,40,28,-10,-28,35,9,
41 | 37,19,1,-20,-31,-41,-18,-25,
42 | -35,-68,-80,45,27,-1,47,13,
43 | 0,-29,-35,-57,-50,-79,-73,-38,
44 | -19,5,35,14,-10,-23,16,-8,
45 | 5,-24,-40,-62,-23,-27,-22,-16,
46 | -18,-46,-72,-77,43,21,33,1,
47 | -80,-70,-70,-64,-56,-52,-39,-33,
48 | -31,-38,-19,-19,-15,32,33,-2,
49 | 7,-15,-15,-24,-23,-33,-41,-56,
50 | -24,-57,5,89,64,41,27,5,
51 | -9,-47,-60,-97,-97,-124,-20,-9,
52 | -44,-73,31,29,-4,64,48,7,
53 | -35,-57,0,-3,-26,-47,-3,-6,
54 | -40,-76,-79,-48,12,81,55,10,
55 | 9,-24,-43,-73,-57,-69,16,5,
56 | -28,-53,18,29,20,0,-4,-11,
57 | 6,-13,23,7,-17,-35,-37,-37,
58 | -30,-68,-63,6,24,-9,-14,3,
59 | 21,-13,-27,-57,-49,-80,-24,-41,
60 | -5,-16,-5,1,45,25,12,-7,
61 | 3,-15,-6,-16,-15,-8,6,-13,
62 | -42,-81,-80,-87,14,1,-10,-3,
63 | -43,-69,-46,-24,-28,-29,36,6,
64 | -43,-56,-12,12,54,79,43,9,
65 | 54,22,2,8,-12,-43,-46,-52,
66 | -38,-69,-89,-5,75,38,33,5,
67 | -13,-53,-62,-87,-89,-113,-99,-55,
68 | -34,-37,62,55,33,16,21,-2,
69 | -17,-46,-29,-38,-38,-48,-39,-42,
70 | -36,-75,-72,-88,-48,-30,21,2,
71 | -15,-57,-64,-98,-84,-76,25,1,
72 | -46,-80,-12,18,-7,3,34,6,
73 | 38,31,23,4,-1,20,14,-15,
74 | -43,-78,-91,-24,14,-3,54,16,
75 | 0,-27,-28,-44,-56,-83,-92,-89,
76 | -3,34,56,41,36,22,20,-8,
77 | -7,-35,-42,-62,-49,3,12,-10,
78 | -50,-87,-96,-66,92,70,38,9,
79 | -70,-71,-62,-42,-39,-43,-11,-7,
80 | -50,-79,-58,-50,-31,32,31,-6,
81 | -4,-25,7,-17,-38,-70,-58,-27,
82 | -43,-83,-28,59,36,20,31,2,
83 | -27,-71,-80,-109,-98,-75,-33,-32,
84 | -31,-2,33,15,-6,43,33,-5,
85 | 0,-22,-10,-27,-34,-49,-11,-20,
86 | -41,-91,-100,-121,-39,57,41,10,
87 | -19,-50,-38,-59,-60,-70,-18,-20,
88 | -8,-31,-8,-15,1,-14,-26,-25,
89 | 33,21,32,17,1,-19,-19,-26,
90 | -58,-81,-35,-22,45,30,11,-11,
91 | 3,-26,-48,-87,-67,-83,-58,3,
92 | -1,-26,-20,44,10,25,39,5,
93 | -9,-35,-27,-38,7,10,4,-9,
94 | -42,-85,-102,-127,52,44,28,10,
95 | -47,-61,-40,-39,-17,-1,-10,-33,
96 | -42,-74,-48,21,-4,70,52,10};
97 |
98 |
99 | const signed char high_lsp_cdbk2[512]={
100 | -36,-62,6,-9,-10,-14,-56,23,
101 | 1,-26,23,-48,-17,12,8,-7,
102 | 23,29,-36,-28,-6,-29,-17,-5,
103 | 40,23,10,10,-46,-13,36,6,
104 | 4,-30,-29,62,32,-32,-1,22,
105 | -14,1,-4,-22,-45,2,54,4,
106 | -30,-57,-59,-12,27,-3,-31,8,
107 | -9,5,10,-14,32,66,19,9,
108 | 2,-25,-37,23,-15,18,-38,-31,
109 | 5,-9,-21,15,0,22,62,30,
110 | 15,-12,-14,-46,77,21,33,3,
111 | 34,29,-19,50,2,11,9,-38,
112 | -12,-37,62,1,-15,54,32,6,
113 | 2,-24,20,35,-21,2,19,24,
114 | -13,55,4,9,39,-19,30,-1,
115 | -21,73,54,33,8,18,3,15,
116 | 6,-19,-47,6,-3,-48,-50,1,
117 | 26,20,8,-23,-50,65,-14,-55,
118 | -17,-31,-37,-28,53,-1,-17,-53,
119 | 1,57,11,-8,-25,-30,-37,64,
120 | 5,-52,-45,15,23,31,15,14,
121 | -25,24,33,-2,-44,-56,-18,6,
122 | -21,-43,4,-12,17,-37,20,-10,
123 | 34,15,2,15,55,21,-11,-31,
124 | -6,46,25,16,-9,-25,-8,-62,
125 | 28,17,20,-32,-29,26,30,25,
126 | -19,2,-16,-17,26,-51,2,50,
127 | 42,19,-66,23,29,-2,3,19,
128 | -19,-37,32,15,6,30,-34,13,
129 | 11,-5,40,31,10,-42,4,-9,
130 | 26,-9,-70,17,-2,-23,20,-22,
131 | -55,51,-24,-31,22,-22,15,-13,
132 | 3,-10,-28,-16,56,4,-63,11,
133 | -18,-15,-18,-38,-35,16,-7,34,
134 | -1,-21,-49,-47,9,-37,7,8,
135 | 69,55,20,6,-33,-45,-10,-9,
136 | 6,-9,12,71,15,-3,-42,-7,
137 | -24,32,-35,-2,-42,-17,-5,0,
138 | -2,-33,-54,13,-12,-34,47,23,
139 | 19,55,7,-8,74,31,14,16,
140 | -23,-26,19,12,-18,-49,-28,-31,
141 | -20,2,-14,-20,-47,78,40,13,
142 | -23,-11,21,-6,18,1,47,5,
143 | 38,35,32,46,22,8,13,16,
144 | -14,18,51,19,40,39,11,-26,
145 | -1,-17,47,2,-53,-15,31,-22,
146 | 38,21,-15,-16,5,-33,53,15,
147 | -38,86,11,-3,-24,49,13,-4,
148 | -11,-18,28,20,-12,-27,-26,35,
149 | -25,-35,-3,-20,-61,30,10,-55,
150 | -12,-22,-52,-54,-14,19,-32,-12,
151 | 45,15,-8,-48,-9,11,-32,8,
152 | -16,-34,-13,51,18,38,-2,-32,
153 | -17,22,-2,-18,-28,-70,59,27,
154 | -28,-19,-10,-20,-9,-9,-8,-21,
155 | 21,-8,35,-2,45,-3,-9,12,
156 | 0,30,7,-39,43,27,-38,-91,
157 | 30,26,19,-55,-4,63,14,-17,
158 | 13,9,13,2,7,4,6,61,
159 | 72,-1,-17,29,-1,-22,-17,8,
160 | -28,-37,63,44,41,3,2,14,
161 | 9,-6,75,-8,-7,-12,-15,-12,
162 | 13,9,-4,30,-22,-65,15,0,
163 | -45,4,-4,1,5,22,11,23};
164 |
--------------------------------------------------------------------------------
/AndroidManetPtt/jni/speex/libspeex/window.c:
--------------------------------------------------------------------------------
1 | /* Copyright (C) 2006 Jean-Marc Valin
2 | File: window.c
3 |
4 | Redistribution and use in source and binary forms, with or without
5 | modification, are permitted provided that the following conditions
6 | are met:
7 |
8 | - Redistributions of source code must retain the above copyright
9 | notice, this list of conditions and the following disclaimer.
10 |
11 | - Redistributions in binary form must reproduce the above copyright
12 | notice, this list of conditions and the following disclaimer in the
13 | documentation and/or other materials provided with the distribution.
14 |
15 | - Neither the name of the Xiph.org Foundation nor the names of its
16 | contributors may be used to endorse or promote products derived from
17 | this software without specific prior written permission.
18 |
19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 | ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR
23 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
24 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
25 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
26 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
27 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
28 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
29 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 | */
31 |
32 | #ifdef HAVE_CONFIG_H
33 | #include "config.h"
34 | #endif
35 |
36 | #include "arch.h"
37 |
38 | #ifdef FIXED_POINT
39 | const spx_word16_t lag_window[11] = {
40 | 16384, 16337, 16199, 15970, 15656, 15260, 14790, 14254, 13659, 13015, 12330
41 | };
42 |
43 | const spx_word16_t lpc_window[200] = {
44 | 1310, 1313, 1321, 1333, 1352, 1375, 1403, 1436,
45 | 1475, 1518, 1567, 1621, 1679, 1743, 1811, 1884,
46 | 1962, 2044, 2132, 2224, 2320, 2421, 2526, 2636,
47 | 2750, 2868, 2990, 3116, 3246, 3380, 3518, 3659,
48 | 3804, 3952, 4104, 4259, 4417, 4578, 4742, 4909,
49 | 5079, 5251, 5425, 5602, 5781, 5963, 6146, 6331,
50 | 6518, 6706, 6896, 7087, 7280, 7473, 7668, 7863,
51 | 8059, 8256, 8452, 8650, 8847, 9044, 9241, 9438,
52 | 9635, 9831, 10026, 10220, 10414, 10606, 10797, 10987,
53 | 11176, 11363, 11548, 11731, 11912, 12091, 12268, 12443,
54 | 12615, 12785, 12952, 13116, 13277, 13435, 13590, 13742,
55 | 13890, 14035, 14176, 14314, 14448, 14578, 14704, 14826,
56 | 14944, 15058, 15168, 15273, 15374, 15470, 15562, 15649,
57 | 15732, 15810, 15883, 15951, 16015, 16073, 16127, 16175,
58 | 16219, 16257, 16291, 16319, 16342, 16360, 16373, 16381,
59 | 16384, 16384, 16384, 16384, 16384, 16384, 16384, 16384,
60 | 16384, 16384, 16384, 16384, 16384, 16384, 16384, 16384,
61 | 16384, 16384, 16384, 16384, 16384, 16384, 16384, 16384,
62 | 16384, 16384, 16384, 16384, 16384, 16384, 16384, 16384,
63 | 16384, 16384, 16384, 16384, 16384, 16384, 16384, 16384,
64 | 16384, 16384, 16384, 16384, 16384, 16384, 16384, 16384,
65 | 16384, 16384, 16384, 16361, 16294, 16183, 16028, 15830,
66 | 15588, 15304, 14979, 14613, 14207, 13763, 13282, 12766,
67 | 12215, 11631, 11016, 10373, 9702, 9007, 8289, 7551,
68 | 6797, 6028, 5251, 4470, 3695, 2943, 2248, 1696
69 | };
70 | #else
71 | const spx_word16_t lag_window[11] = {
72 | 1.00000, 0.99716, 0.98869, 0.97474, 0.95554, 0.93140, 0.90273, 0.86998, 0.83367, 0.79434, 0.75258
73 | };
74 |
75 | const spx_word16_t lpc_window[200] = {
76 | 0.080000f, 0.080158f, 0.080630f, 0.081418f, 0.082520f, 0.083935f, 0.085663f, 0.087703f,
77 | 0.090052f, 0.092710f, 0.095674f, 0.098943f, 0.102514f, 0.106385f, 0.110553f, 0.115015f,
78 | 0.119769f, 0.124811f, 0.130137f, 0.135744f, 0.141628f, 0.147786f, 0.154212f, 0.160902f,
79 | 0.167852f, 0.175057f, 0.182513f, 0.190213f, 0.198153f, 0.206328f, 0.214731f, 0.223357f,
80 | 0.232200f, 0.241254f, 0.250513f, 0.259970f, 0.269619f, 0.279453f, 0.289466f, 0.299651f,
81 | 0.310000f, 0.320507f, 0.331164f, 0.341965f, 0.352901f, 0.363966f, 0.375151f, 0.386449f,
82 | 0.397852f, 0.409353f, 0.420943f, 0.432615f, 0.444361f, 0.456172f, 0.468040f, 0.479958f,
83 | 0.491917f, 0.503909f, 0.515925f, 0.527959f, 0.540000f, 0.552041f, 0.564075f, 0.576091f,
84 | 0.588083f, 0.600042f, 0.611960f, 0.623828f, 0.635639f, 0.647385f, 0.659057f, 0.670647f,
85 | 0.682148f, 0.693551f, 0.704849f, 0.716034f, 0.727099f, 0.738035f, 0.748836f, 0.759493f,
86 | 0.770000f, 0.780349f, 0.790534f, 0.800547f, 0.810381f, 0.820030f, 0.829487f, 0.838746f,
87 | 0.847800f, 0.856643f, 0.865269f, 0.873672f, 0.881847f, 0.889787f, 0.897487f, 0.904943f,
88 | 0.912148f, 0.919098f, 0.925788f, 0.932214f, 0.938372f, 0.944256f, 0.949863f, 0.955189f,
89 | 0.960231f, 0.964985f, 0.969447f, 0.973615f, 0.977486f, 0.981057f, 0.984326f, 0.987290f,
90 | 0.989948f, 0.992297f, 0.994337f, 0.996065f, 0.997480f, 0.998582f, 0.999370f, 0.999842f,
91 | 1.000000f, 1.000000f, 1.000000f, 1.000000f, 1.000000f, 1.000000f, 1.000000f, 1.000000f,
92 | 1.000000f, 1.000000f, 1.000000f, 1.000000f, 1.000000f, 1.000000f, 1.000000f, 1.000000f,
93 | 1.000000f, 1.000000f, 1.000000f, 1.000000f, 1.000000f, 1.000000f, 1.000000f, 1.000000f,
94 | 1.000000f, 1.000000f, 1.000000f, 1.000000f, 1.000000f, 1.000000f, 1.000000f, 1.000000f,
95 | 1.000000f, 1.000000f, 1.000000f, 1.000000f, 1.000000f, 1.000000f, 1.000000f, 1.000000f,
96 | 1.000000f, 1.000000f, 1.000000f, 1.000000f, 1.000000f, 1.000000f, 1.000000f, 1.000000f,
97 | 1.000000f, 1.000000f, 1.000000f, 0.998640f, 0.994566f, 0.987787f, 0.978324f, 0.966203f,
98 | 0.951458f, 0.934131f, 0.914270f, 0.891931f, 0.867179f, 0.840084f, 0.810723f, 0.779182f,
99 | 0.745551f, 0.709930f, 0.672424f, 0.633148f, 0.592223f, 0.549781f, 0.505964f, 0.460932f,
100 | 0.414863f, 0.367968f, 0.320511f, 0.272858f, 0.225569f, 0.179655f, 0.137254f, 0.103524f
101 | };
102 | #endif
103 |
--------------------------------------------------------------------------------
/AndroidManetPtt/jni/speex/libspeex/os_support.h:
--------------------------------------------------------------------------------
1 | /* Copyright (C) 2007 Jean-Marc Valin
2 |
3 | File: os_support.h
4 | This is the (tiny) OS abstraction layer. Aside from math.h, this is the
5 | only place where system headers are allowed.
6 |
7 | Redistribution and use in source and binary forms, with or without
8 | modification, are permitted provided that the following conditions are
9 | met:
10 |
11 | 1. Redistributions of source code must retain the above copyright notice,
12 | this list of conditions and the following disclaimer.
13 |
14 | 2. Redistributions in binary form must reproduce the above copyright
15 | notice, this list of conditions and the following disclaimer in the
16 | documentation and/or other materials provided with the distribution.
17 |
18 | 3. The name of the author may not be used to endorse or promote products
19 | derived from this software without specific prior written permission.
20 |
21 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
22 | IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
23 | OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
24 | DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
25 | INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
26 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
27 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 | HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
29 | STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
30 | ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
31 | POSSIBILITY OF SUCH DAMAGE.
32 | */
33 |
34 | #ifndef OS_SUPPORT_H
35 | #define OS_SUPPORT_H
36 |
37 | #include
38 | #include
39 | #include
40 |
41 | #ifdef HAVE_CONFIG_H
42 | #include "config.h"
43 | #endif
44 | #ifdef OS_SUPPORT_CUSTOM
45 | #include "os_support_custom.h"
46 | #endif
47 |
48 | /** Speex wrapper for calloc. To do your own dynamic allocation, all you need to do is replace this function, speex_realloc and speex_free
49 | NOTE: speex_alloc needs to CLEAR THE MEMORY */
50 | #ifndef OVERRIDE_SPEEX_ALLOC
51 | static inline void *speex_alloc (int size)
52 | {
53 | /* WARNING: this is not equivalent to malloc(). If you want to use malloc()
54 | or your own allocator, YOU NEED TO CLEAR THE MEMORY ALLOCATED. Otherwise
55 | you will experience strange bugs */
56 | return calloc(size,1);
57 | }
58 | #endif
59 |
60 | /** Same as speex_alloc, except that the area is only needed inside a Speex call (might cause problem with wideband though) */
61 | #ifndef OVERRIDE_SPEEX_ALLOC_SCRATCH
62 | static inline void *speex_alloc_scratch (int size)
63 | {
64 | /* Scratch space doesn't need to be cleared */
65 | return calloc(size,1);
66 | }
67 | #endif
68 |
69 | /** Speex wrapper for realloc. To do your own dynamic allocation, all you need to do is replace this function, speex_alloc and speex_free */
70 | #ifndef OVERRIDE_SPEEX_REALLOC
71 | static inline void *speex_realloc (void *ptr, int size)
72 | {
73 | return realloc(ptr, size);
74 | }
75 | #endif
76 |
77 | /** Speex wrapper for calloc. To do your own dynamic allocation, all you need to do is replace this function, speex_realloc and speex_alloc */
78 | #ifndef OVERRIDE_SPEEX_FREE
79 | static inline void speex_free (void *ptr)
80 | {
81 | free(ptr);
82 | }
83 | #endif
84 |
85 | /** Same as speex_free, except that the area is only needed inside a Speex call (might cause problem with wideband though) */
86 | #ifndef OVERRIDE_SPEEX_FREE_SCRATCH
87 | static inline void speex_free_scratch (void *ptr)
88 | {
89 | free(ptr);
90 | }
91 | #endif
92 |
93 | /** Copy n bytes of memory from src to dst. The 0* term provides compile-time type checking */
94 | #ifndef OVERRIDE_SPEEX_COPY
95 | #define SPEEX_COPY(dst, src, n) (memcpy((dst), (src), (n)*sizeof(*(dst)) + 0*((dst)-(src)) ))
96 | #endif
97 |
98 | /** Copy n bytes of memory from src to dst, allowing overlapping regions. The 0* term
99 | provides compile-time type checking */
100 | #ifndef OVERRIDE_SPEEX_MOVE
101 | #define SPEEX_MOVE(dst, src, n) (memmove((dst), (src), (n)*sizeof(*(dst)) + 0*((dst)-(src)) ))
102 | #endif
103 |
104 | /** Set n bytes of memory to value of c, starting at address s */
105 | #ifndef OVERRIDE_SPEEX_MEMSET
106 | #define SPEEX_MEMSET(dst, c, n) (memset((dst), (c), (n)*sizeof(*(dst))))
107 | #endif
108 |
109 |
110 | #ifndef OVERRIDE_SPEEX_FATAL
111 | static inline void _speex_fatal(const char *str, const char *file, int line)
112 | {
113 | fprintf (stderr, "Fatal (internal) error in %s, line %d: %s\n", file, line, str);
114 | exit(1);
115 | }
116 | #endif
117 |
118 | #ifndef OVERRIDE_SPEEX_WARNING
119 | static inline void speex_warning(const char *str)
120 | {
121 | #ifndef DISABLE_WARNINGS
122 | fprintf (stderr, "warning: %s\n", str);
123 | #endif
124 | }
125 | #endif
126 |
127 | #ifndef OVERRIDE_SPEEX_WARNING_INT
128 | static inline void speex_warning_int(const char *str, int val)
129 | {
130 | #ifndef DISABLE_WARNINGS
131 | fprintf (stderr, "warning: %s %d\n", str, val);
132 | #endif
133 | }
134 | #endif
135 |
136 | #ifndef OVERRIDE_SPEEX_NOTIFY
137 | static inline void speex_notify(const char *str)
138 | {
139 | #ifndef DISABLE_NOTIFICATIONS
140 | fprintf (stderr, "notification: %s\n", str);
141 | #endif
142 | }
143 | #endif
144 |
145 | #ifndef OVERRIDE_SPEEX_PUTC
146 | /** Speex wrapper for putc */
147 | static inline void _speex_putc(int ch, void *file)
148 | {
149 | FILE *f = (FILE *)file;
150 | fprintf(f, "%c", ch);
151 | }
152 | #endif
153 |
154 | #define speex_fatal(str) _speex_fatal(str, __FILE__, __LINE__);
155 | #define speex_assert(cond) {if (!(cond)) {speex_fatal("assertion failed: " #cond);}}
156 |
157 | #ifndef RELEASE
158 | static inline void print_vec(float *vec, int len, char *name)
159 | {
160 | int i;
161 | printf ("%s ", name);
162 | for (i=0;i
36 | #include "arch.h"
37 |
38 | /** LTP parameters. */
39 | typedef struct {
40 | const signed char *gain_cdbk;
41 | int gain_bits;
42 | int pitch_bits;
43 | } ltp_params;
44 |
45 | #ifdef FIXED_POINT
46 | #define gain_3tap_to_1tap(g) (ABS(g[1]) + (g[0]>0 ? g[0] : -SHR16(g[0],1)) + (g[2]>0 ? g[2] : -SHR16(g[2],1)))
47 | #else
48 | #define gain_3tap_to_1tap(g) (ABS(g[1]) + (g[0]>0 ? g[0] : -.5*g[0]) + (g[2]>0 ? g[2] : -.5*g[2]))
49 | #endif
50 |
51 | spx_word32_t inner_prod(const spx_word16_t *x, const spx_word16_t *y, int len);
52 | void pitch_xcorr(const spx_word16_t *_x, const spx_word16_t *_y, spx_word32_t *corr, int len, int nb_pitch, char *stack);
53 |
54 | void open_loop_nbest_pitch(spx_word16_t *sw, int start, int end, int len, int *pitch, spx_word16_t *gain, int N, char *stack);
55 |
56 |
57 | /** Finds the best quantized 3-tap pitch predictor by analysis by synthesis */
58 | int pitch_search_3tap(
59 | spx_word16_t target[], /* Target vector */
60 | spx_word16_t *sw,
61 | spx_coef_t ak[], /* LPCs for this subframe */
62 | spx_coef_t awk1[], /* Weighted LPCs #1 for this subframe */
63 | spx_coef_t awk2[], /* Weighted LPCs #2 for this subframe */
64 | spx_sig_t exc[], /* Overlapping codebook */
65 | const void *par,
66 | int start, /* Smallest pitch value allowed */
67 | int end, /* Largest pitch value allowed */
68 | spx_word16_t pitch_coef, /* Voicing (pitch) coefficient */
69 | int p, /* Number of LPC coeffs */
70 | int nsf, /* Number of samples in subframe */
71 | SpeexBits *bits,
72 | char *stack,
73 | spx_word16_t *exc2,
74 | spx_word16_t *r,
75 | int complexity,
76 | int cdbk_offset,
77 | int plc_tuning,
78 | spx_word32_t *cumul_gain
79 | );
80 |
81 | /*Unquantize adaptive codebook and update pitch contribution*/
82 | void pitch_unquant_3tap(
83 | spx_word16_t exc[], /* Input excitation */
84 | spx_word32_t exc_out[], /* Output excitation */
85 | int start, /* Smallest pitch value allowed */
86 | int end, /* Largest pitch value allowed */
87 | spx_word16_t pitch_coef, /* Voicing (pitch) coefficient */
88 | const void *par,
89 | int nsf, /* Number of samples in subframe */
90 | int *pitch_val,
91 | spx_word16_t *gain_val,
92 | SpeexBits *bits,
93 | char *stack,
94 | int lost,
95 | int subframe_offset,
96 | spx_word16_t last_pitch_gain,
97 | int cdbk_offset
98 | );
99 |
100 | /** Forced pitch delay and gain */
101 | int forced_pitch_quant(
102 | spx_word16_t target[], /* Target vector */
103 | spx_word16_t *sw,
104 | spx_coef_t ak[], /* LPCs for this subframe */
105 | spx_coef_t awk1[], /* Weighted LPCs #1 for this subframe */
106 | spx_coef_t awk2[], /* Weighted LPCs #2 for this subframe */
107 | spx_sig_t exc[], /* Excitation */
108 | const void *par,
109 | int start, /* Smallest pitch value allowed */
110 | int end, /* Largest pitch value allowed */
111 | spx_word16_t pitch_coef, /* Voicing (pitch) coefficient */
112 | int p, /* Number of LPC coeffs */
113 | int nsf, /* Number of samples in subframe */
114 | SpeexBits *bits,
115 | char *stack,
116 | spx_word16_t *exc2,
117 | spx_word16_t *r,
118 | int complexity,
119 | int cdbk_offset,
120 | int plc_tuning,
121 | spx_word32_t *cumul_gain
122 | );
123 |
124 | /** Unquantize forced pitch delay and gain */
125 | void forced_pitch_unquant(
126 | spx_word16_t exc[], /* Input excitation */
127 | spx_word32_t exc_out[], /* Output excitation */
128 | int start, /* Smallest pitch value allowed */
129 | int end, /* Largest pitch value allowed */
130 | spx_word16_t pitch_coef, /* Voicing (pitch) coefficient */
131 | const void *par,
132 | int nsf, /* Number of samples in subframe */
133 | int *pitch_val,
134 | spx_word16_t *gain_val,
135 | SpeexBits *bits,
136 | char *stack,
137 | int lost,
138 | int subframe_offset,
139 | spx_word16_t last_pitch_gain,
140 | int cdbk_offset
141 | );
142 |
--------------------------------------------------------------------------------
/AndroidManetPtt/obj/local/armeabi/objs/speex_jni/speex/libspeex/cb_search.o.d:
--------------------------------------------------------------------------------
1 | /home/ionut/Android/workspace/pttdroid/obj/local/armeabi/objs/speex_jni/speex/libspeex/cb_search.o: \
2 | /home/ionut/Android/workspace/pttdroid/jni/speex/libspeex/cb_search.c \
3 | /home/ionut/Android/workspace/pttdroid/jni/speex/libspeex/cb_search.h \
4 | /home/ionut/Android/workspace/pttdroid/jni/speex/include/speex/speex_bits.h \
5 | /home/ionut/Android/workspace/pttdroid/jni/speex/libspeex/arch.h \
6 | /home/ionut/Android/workspace/pttdroid/jni/speex/include/speex/speex_types.h \
7 | /home/ionut/Android/workspace/pttdroid/jni/speex/include/speex/speex_config_types.h \
8 | /home/ionut/Android/workspace/pttdroid/jni/speex/libspeex/fixed_generic.h \
9 | /home/ionut/Android/workspace/pttdroid/jni/speex/libspeex/filters.h \
10 | /home/ionut/Android/workspace/pttdroid/jni/speex/libspeex/stack_alloc.h \
11 | /home/ionut/Android/workspace/pttdroid/jni/speex/libspeex/vq.h \
12 | /home/ionut/Android/workspace/pttdroid/jni/speex/libspeex/math_approx.h \
13 | /home/ionut/Android/workspace/pttdroid/jni/speex/libspeex/os_support.h \
14 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/string.h \
15 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/sys/cdefs.h \
16 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/sys/cdefs_elf.h \
17 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/malloc.h \
18 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/stdio.h \
19 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/sys/_types.h \
20 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/machine/_types.h \
21 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/sys/types.h \
22 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/stdint.h \
23 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/linux/posix_types.h \
24 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/linux/stddef.h \
25 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/linux/compiler.h \
26 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/asm/posix_types.h \
27 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/asm/types.h \
28 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/linux/types.h \
29 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/machine/kernel.h \
30 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/sys/sysmacros.h \
31 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/stdlib.h \
32 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/alloca.h \
33 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/strings.h \
34 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/memory.h
35 |
36 | /home/ionut/Android/workspace/pttdroid/jni/speex/libspeex/cb_search.h:
37 |
38 | /home/ionut/Android/workspace/pttdroid/jni/speex/include/speex/speex_bits.h:
39 |
40 | /home/ionut/Android/workspace/pttdroid/jni/speex/libspeex/arch.h:
41 |
42 | /home/ionut/Android/workspace/pttdroid/jni/speex/include/speex/speex_types.h:
43 |
44 | /home/ionut/Android/workspace/pttdroid/jni/speex/include/speex/speex_config_types.h:
45 |
46 | /home/ionut/Android/workspace/pttdroid/jni/speex/libspeex/fixed_generic.h:
47 |
48 | /home/ionut/Android/workspace/pttdroid/jni/speex/libspeex/filters.h:
49 |
50 | /home/ionut/Android/workspace/pttdroid/jni/speex/libspeex/stack_alloc.h:
51 |
52 | /home/ionut/Android/workspace/pttdroid/jni/speex/libspeex/vq.h:
53 |
54 | /home/ionut/Android/workspace/pttdroid/jni/speex/libspeex/math_approx.h:
55 |
56 | /home/ionut/Android/workspace/pttdroid/jni/speex/libspeex/os_support.h:
57 |
58 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/string.h:
59 |
60 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/sys/cdefs.h:
61 |
62 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/sys/cdefs_elf.h:
63 |
64 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/malloc.h:
65 |
66 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/stdio.h:
67 |
68 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/sys/_types.h:
69 |
70 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/machine/_types.h:
71 |
72 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/sys/types.h:
73 |
74 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/stdint.h:
75 |
76 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/linux/posix_types.h:
77 |
78 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/linux/stddef.h:
79 |
80 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/linux/compiler.h:
81 |
82 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/asm/posix_types.h:
83 |
84 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/asm/types.h:
85 |
86 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/linux/types.h:
87 |
88 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/machine/kernel.h:
89 |
90 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/sys/sysmacros.h:
91 |
92 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/stdlib.h:
93 |
94 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/alloca.h:
95 |
96 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/strings.h:
97 |
98 | /home/ionut/Android/android-ndk-r4b/build/platforms/android-4/arch-arm/usr/include/memory.h:
99 |
--------------------------------------------------------------------------------