codec: Add functions for AMR s->d bits and d->s bits

These functions implement re-ordering of bits as per TS 06.90 / 26.101
based on the already existing tables we've had in libosmocoding.

Change-Id: Ia4ac2aea2e96f9185f082a07ca64dfc5276efb46
diff --git a/include/osmocom/codec/codec.h b/include/osmocom/codec/codec.h
index 6a1bf9f..cbdad75 100644
--- a/include/osmocom/codec/codec.h
+++ b/include/osmocom/codec/codec.h
@@ -6,6 +6,7 @@
 #include <stdbool.h>
 
 #include <osmocom/core/utils.h>
+#include <osmocom/core/bits.h>
 
 /* TS 101318 Chapter 5.1: 260 bits + 4bit sig */
 #define GSM_FR_BYTES	33
@@ -51,6 +52,11 @@
        AMR_GOOD = 1
 };
 
+extern const uint8_t gsm690_bitlength[AMR_NO_DATA+1];
+
+int osmo_amr_s_to_d(ubit_t *out, const ubit_t *in, uint16_t n_bits, enum osmo_amr_type amr_mode);
+int osmo_amr_d_to_s(ubit_t *out, const ubit_t *in, uint16_t n_bits, enum osmo_amr_type amr_mode);
+
 /*! Check if given AMR Frame Type is a speech frame
  *  \param[in] ft AMR Frame Type
  *  \returns true if AMR with given Frame Type contains voice, false otherwise