view doc/AMR-library-tests @ 585:3c6bf0d26ee7

TW-TS-005 reader: fix maximum line length bug TW-TS-005 section 4.1 states: The maximum allowed length of each line is 80 characters, not including the OS-specific newline encoding. The implementation of this line length limit in the TW-TS-005 hex file reader function in the present suite was wrong, such that lines of the full maximum length could not be read. Fix it. Note that this bug affects comment lines too, not just actual RTP payloads. Neither Annex A nor Annex B features an RTP payload format that goes to the maximum of 40 bytes, but if a comment line goes to the maximum allowed length of 80 characters not including the terminating newline, the bug will be triggered, necessitating the present fix.
author Mychaela Falconia <falcon@freecalypso.org>
date Tue, 25 Feb 2025 07:49:28 +0000
parents cc0c244bd233
children
line wrap: on
line source

The present suite includes a pair of command line programs that exercise
libtwamr encoder and decoder in 3GPP test sequence format, allowing this library
to be tested against the official test sequences of 3GPP TS 26.074.

twamr-tseq-enc
==============

This program reads a *.inp file from the collection of TS 26.074, encodes it
per selected AMR mode using libtwamr functions, and emits the encoder output in
3GPP-defined .cod format.  The command line structure of twamr-tseq-enc is as
follows:

twamr-tseq-enc [-d] [-2] input.inp mode output.cod

The middle argument specifies the codec mode to be used; there is no default.
Ordinarily the mode argument is one of these 8 keywords:

	MR475
	MR515
	MR59
	MR67
	MR74
	MR795
	MR102
	MR122

However, this mode argument can also take the form of "file:$modefile", where
$modefile is an ASCII text file giving one of the above mode keywords per line.
This form is needed when testing the encoding of t21.inp per t21.mod control
file.

twamr-tseq-enc flag options: -d enables DTX, -2 switches the VAD algorithm from
VAD1 default to VAD2 alternative.  The two options can be combined as -d2.

twamr-tseq-dec
==============

This program reads a *.cod file in 3GPP AMR test sequence format, decodes it
using libtwamr functions, and emits the decoder output in a raw PCM *.out file.
The command line structure of twamr-tseq-dec is as follows:

twamr-tseq-dec [-r] input.cod output.out

By default the first word of each *.cod frame is expected to be a Tx frame type
as in enum TXFrameType; with -r option this first word is expected to be an Rx
frame type as in enum RXFrameType instead.  This option directly corresponds to
-rxframetype in the reference decoder program from 3GPP.

Byte order considerations
=========================

Both twamr-tseq-enc and twamr-tseq-dec read and write their input and output
files (16-bit linear PCM on one end and 3GPP *.cod test sequence format on the
other end) in the local machine's native byte order.  3GPP shipped their
TS 26.074 collection of AMR test sequences in little-endian byte order; given
that most GSM software developers are now largely forced by economic pressures
to work on x86 or ARM architecture machines rather than more noble SPARC or
PowerPC systems, the local byte order of the developer's machine will typically
be LE, matching TS 26.074 files as published.