forked from satellite/osmo-ir77
codec: Allow building without libosmocore
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
This commit is contained in:
parent
982cba9029
commit
6f7b0702a6
|
@ -1,6 +1,12 @@
|
|||
CC=gcc
|
||||
CFLAGS=`pkg-config libosmocore --cflags` -Wall -O2 -march=native
|
||||
LDLIBS=`pkg-config libosmocore --libs` -lm
|
||||
CFLAGS=-Wall -O2 -march=native
|
||||
LDLIBS=-lm
|
||||
|
||||
CHK_LIBOSMOCORE_RV=$(shell pkg-config --exists libosmocore; echo $$?)
|
||||
ifeq ($(CHK_LIBOSMOCORE_RV),0)
|
||||
CFLAGS+=`pkg-config libosmocore --cflags` -DHAVE_LIBOSMOCORE
|
||||
LDLIBS+=`pkg-config libosmocore --libs`
|
||||
endif
|
||||
|
||||
OBJS=ir77_ambe_decode
|
||||
|
||||
|
|
|
@ -0,0 +1,24 @@
|
|||
#ifndef __OSMO_IR77_AMBE_COMPAT_BITS_H__
|
||||
#define __OSMO_IR77_AMBE_COMPAT_BITS_H__
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
typedef uint8_t ubit_t;
|
||||
typedef uint8_t pbit_t;
|
||||
|
||||
static inline int
|
||||
osmo_pbit2ubit_ext(
|
||||
ubit_t *out, unsigned int out_ofs,
|
||||
const pbit_t *in, unsigned int in_ofs,
|
||||
unsigned int num_bits, int lsb_mode)
|
||||
{
|
||||
int i, ip, bn;
|
||||
for (i=0; i<num_bits; i++) {
|
||||
ip = in_ofs + i;
|
||||
bn = lsb_mode ? (ip&7) : (7-(ip&7));
|
||||
out[out_ofs+i] = !!(in[ip>>3] & (1<<bn));
|
||||
}
|
||||
return out_ofs + num_bits;
|
||||
}
|
||||
|
||||
#endif /* __OSMO_IR77_AMBE_COMPAT_BITS_H__ */
|
|
@ -25,7 +25,11 @@
|
|||
* \brief Iridium AMBE vocoder ECC routines
|
||||
*/
|
||||
|
||||
#ifdef HAVE_LIBOSMOCORE
|
||||
#include <osmocom/core/bits.h>
|
||||
#else
|
||||
#include "compat_bits.h"
|
||||
#endif
|
||||
|
||||
#include "ecc_tables.h"
|
||||
|
||||
|
|
|
@ -32,8 +32,6 @@
|
|||
|
||||
#include <math.h>
|
||||
|
||||
#include <osmocom/core/bits.h>
|
||||
|
||||
#include "private.h"
|
||||
|
||||
|
||||
|
|
|
@ -29,7 +29,11 @@
|
|||
* \brief Iridium AMBE vocoder private header
|
||||
*/
|
||||
|
||||
#ifdef HAVE_LIBOSMOCORE
|
||||
#include <osmocom/core/bits.h>
|
||||
#else
|
||||
#include "compat_bits.h"
|
||||
#endif
|
||||
|
||||
|
||||
#define AMBE_RATE 8000 /*!< \brief AMBE sample rate (Hz) */
|
||||
|
|
Loading…
Reference in New Issue