summaryrefslogtreecommitdiffstats
path: root/include/osmocom/codec
diff options
context:
space:
mode:
authorPhilipp Maier <pmaier@sysmocom.de>2017-12-16 03:42:15 +0700
committerVadim Yanitskiy <axilirator@gmail.com>2018-01-15 20:12:03 +0000
commit40def49ac4b8babbd1b17c232137ce50a428706b (patch)
treebd7fe78e287a432825f765fa2a42e96fd857de84 /include/osmocom/codec
parentc0771d62c19a09608a570a433da5c0c9de6f4884 (diff)
libosmocodec: implement ECU (Error Concealment Unit) for FR
When a bad GSM voice frame is received, it's being replaced by a silence frame. This may cause unpleasant audio effects. This change implements a functionality to craft a replacement frame from the last known good frame. Currently, only FR is supported, support for other codecs may be added latter. Change-Id: I06a21f60db01bfe1c2b838f93866fad1d53fdcd1
Diffstat (limited to 'include/osmocom/codec')
-rw-r--r--include/osmocom/codec/ecu.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/include/osmocom/codec/ecu.h b/include/osmocom/codec/ecu.h
new file mode 100644
index 00000000..f7a29a00
--- /dev/null
+++ b/include/osmocom/codec/ecu.h
@@ -0,0 +1,15 @@
+#pragma once
+
+#include <stdint.h>
+#include <stdbool.h>
+
+#include <osmocom/codec/codec.h>
+
+/* Codec independent ECU state */
+struct osmo_ecu_fr_state {
+ bool subsequent_lost_frame;
+ uint8_t frame_backup[GSM_FR_BYTES];
+};
+
+void osmo_ecu_fr_reset(struct osmo_ecu_fr_state *state, uint8_t *frame);
+int osmo_ecu_fr_conceal(struct osmo_ecu_fr_state *state, uint8_t *frame);