From 40def49ac4b8babbd1b17c232137ce50a428706b Mon Sep 17 00:00:00 2001 From: Philipp Maier Date: Sat, 16 Dec 2017 03:42:15 +0700 Subject: 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 --- include/osmocom/codec/ecu.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 include/osmocom/codec/ecu.h (limited to 'include/osmocom/codec') 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 +#include + +#include + +/* 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); -- cgit v1.2.3