/*
***********************************************************************
*
* Copyright (C) 1999 Ericsson Radio Systems AB
* 
* The Association of Radio Industries and Businesses (ARIB) has the
* licence to reproduce, distribute and publish the Bit Exact C Code
* programs in this CD-ROM together with the other parts of the RCR
* STD-27 (Personal Digital Cellular Telecommunication System)
* specification.
* 
* Ericsson has declared Option 1 (royalty-free licence) to ARIB for
* its Essential Industrial Property Rights related to the ACELP
* specification and the Bit Exact C Code programs. The royalty-free
* licence is limited to the development and manufacturing of
* products complying with the RCR STD-27H specification (or
* subsequent versions) for sale and use in Japan. Copying of the
* program(s) for any other purpose requires the prior written
* permission from Ericsson.
* 
* The user of the Bit Exact C Code hereby acknowledges the
* following:
* 
* 1.  Ericsson does not provide the user with any warranties,
*     whether express or implied, including but not limited to
*     warranties of merchantability and fitness for a particular
*     purpose relating to the Bit Exact C Code.
* 
* 2.  Ericsson shall have no responsibility whatsoever to indemnify
*     the user against actions or claims for infringement of any
*     intellectual property rights, e.g. patents, copyrights,
*     registered designs or any other rights, by reason of the
*     user's use of the Bit Exact C Code.
* 
***********************************************************************
*/

This is an updated version to version 27H of the 6.7 kbps PDC Enhanced
Full Rate Codec from Ericsson. Using the Ericsson naming of versions
this is version 2.4. An description of the differencies to earlier
versions can be found in the document "Description of version 2.4 of
PDC-EFR speech codec".


DISTRIBUTION CONTENTS:
~~~~~~~~~~~~~~~~~~~~~
In directory src:

- source files (*.c, *.h, *.tab)
    coder.c       main of the speech encoder
    decoder.c     main of the speech decoder

- additional files
    readme.txt    this file
    makefile.sun  makefile for gcc on SUN
    makefile.pc   makefile for Borland's bcc on PC
    coder.rsp     response file for Borland linker
    decoder.rsp   response file for Borland linker

In directory testinp:

- Speech encoder input test sequences.

In directory testcod:

- Speech encoder reference output sequences.

In directory testout:

- Speech decoder reference output sequences.


All source files are in PC file format. SUN users should convert
the source files to SUN's file format before use.

All test sequences are headerless 16 bit words stored in PC byte 
order. SUN users should convert the source files to SUN's file
format before use, i.e. perform a byte swap.


USAGE:
~~~~~
Without vox:

  coder speech_file bitstream_file
  decoder bitstream_file synth_file

With vox:

  coder speech_file bitstream_file.vox vox

Note that a Voice Activity Detection (VAD) device has to be added
to the encoder to utilize the VOX functionallity in the encoder.
The VAD should control the already locally defined variable
`VAD_flag' (see cod_6k7.c).


VERIFICATION:
~~~~~~~~~~~~ 
Bit-exactness of compilation must be verified using test sequences
as described in the PDC Enhanced Full Rate baseline text.

Compilation and verification of the codec have been performed on
both SUN and PC. The SUN verification were done on a SUN Ultra 10 with
SunOS 5.5.1, running the GNU gcc-2.7.2 compiler. The PC verification
were done with a Pentium PC/166MHz with Windows 95, running the
Borland C++ 5.0 compiler in an MS-DOS console window.

An example of how the installation verification could be done
on a SUN computer is shown below. The comparison commands at the end
should yield no differences.

# Verification with respect to test sequences 1 to 5
foreach i (1 2 3 4 5)
   coder ../testinp/tstseq{$i}.inp ver.middle{$i} 
   decoder ver.middle{$i} ver{$i}
end
foreach i (1 2 3 4 5)
   diff ver.middle{$i} ../testcod/tstseq{$i}.cod
   diff ver{$i} ../testout/tstseq{$i}.out
end
 
# Verification with respect to test sequences 6 to 8
# The input file 'testinp/tstvox6.inp' force the VAD_flag to various
# values according to table 7.1 of the PDC Enhanced Full Rate 
# baseline text.
#

# Verification with respect to test sequences 6 to 8
foreach i (6 7 8)
   coder ../testinp/tstseq{$i}.inp ver.middle{$i} vox ../testinp/tstvox{$i}.inp ../testinp/tstvad{$i}.inp
end
foreach i (6 7 8)
   diff ver.middle{$i} ../testcod/tstseq{$i}.cod
end
