FreeCalypso > hg > gsm-net-reveng
view trau-decode/extr-efr.c @ 63:4a906c2075bc
top Makefile: d144 depends on utils
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Wed, 25 Sep 2024 18:49:39 +0000 |
parents | 0565aaa84b17 |
children |
line wrap: on
line source
/* * This module implements the EFR decoding part of trau-extr. */ #include <stdio.h> #include <stdint.h> #include <stdlib.h> #include <string.h> #include <strings.h> #include <gsm_efr.h> #include "osmo_bits.h" static void dbits_to_frame(d_bits, frame) ubit_t *d_bits; uint8_t *frame; { ubit_t intermed[248], *ip; uint8_t *op, mask; unsigned nb; intermed[0] = 1; intermed[1] = 1; intermed[2] = 0; intermed[3] = 0; bcopy(d_bits + 1, intermed + 4, 38); bcopy(d_bits + 42, intermed + 42, 53); bcopy(d_bits + 98, intermed + 95, 50); bcopy(d_bits + 151, intermed + 145, 53); bcopy(d_bits + 207, intermed + 198, 50); ip = intermed; op = frame; for (nb = 0; nb < EFR_RTP_FRAME_LEN; nb++) { *op = 0; for (mask = 0x80; mask; mask >>= 1) { if (*ip) *op |= mask; ip++; } op++; } } void convert_efr_frame(d_bits, outf) ubit_t *d_bits; FILE *outf; { uint8_t frame[EFR_RTP_FRAME_LEN]; dbits_to_frame(d_bits, frame); fwrite(frame, 1, EFR_RTP_FRAME_LEN, outf); }