# HG changeset patch # User Mychaela Falconia # Date 1718665257 0 # Node ID dc7249923b3a9d76e4fbced280330534fd975ed7 # Parent cc3a831712a47f53a17b516058ec4037fe58442c libgsmhr1: implement TW-TS-002 output diff -r cc3a831712a4 -r dc7249923b3a libgsmhr1/Makefile --- a/libgsmhr1/Makefile Sat Jun 15 06:52:37 2024 +0000 +++ b/libgsmhr1/Makefile Mon Jun 17 23:00:57 2024 +0000 @@ -1,4 +1,4 @@ -OBJS= pack_frame.o rtp_in.o twts002_in.o unpack_frame.o +OBJS= pack_frame.o rtp_in.o twts002_in.o twts002_out.o unpack_frame.o HDRS= tw_gsmhr.h LIB= libgsmhr1.a diff -r cc3a831712a4 -r dc7249923b3a libgsmhr1/twts002_out.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libgsmhr1/twts002_out.c Mon Jun 17 23:00:57 2024 +0000 @@ -0,0 +1,14 @@ +/* + * The function implemented in this module converts the output of HRv1 + * speech encoder into an RTP payload per TW-TS-002, which in this + * particular case is also a valid RFC 5993 payload. + */ + +#include +#include "tw_gsmhr.h" + +void gsmhr_encoder_twts002_out(const int16_t *params, uint8_t *payload) +{ + payload[0] = params[19] ? 0x00 : 0x20; + gsmhr_pack_ts101318(params, payload + 1); +}