4. Reference Implementation and Software Architecture
Annex C+ is defined by an accompanying electronic attachment containing version 2.1 of a reference ANSI-C source code. This floating-point simulation is considered the normative specification, taking precedence over the textual descriptions in the document.
4.1. Simulation Software
The reference code includes two main executable programs:
- coderepc.c: The encoder, which takes an input file, an output bitstream file, and options for DTX and bit rate.
- decoderepc.c: The decoder, which takes a bitstream file and creates a decoded output file.
The encoder supports the following run-time options:
- dtx_option: 0 for DTX disabled, 1 for DTX enabled.
- rate_option: 0 for 6.4 kbit/s, 1 for 8 kbit/s (default), 2 for 11.8 kbit/s. This can also be a file name to specify the rate on a frame-by-frame basis.
4.2. Software Modules
The software is organized into a series of C files, each responsible for a specific function. The following table lists the key software files and their relationship to the different G.729 annexes.
| File Name | Description | Link |
| Core & Common Modules | ||
| Gainpred.c | Gain predictor | C |
| Lpfuncp.c | Miscellaneous routines related to LP filter | C+E |
| Cor_func.c | Miscellaneous routines related to excitation computation | C |
| Pre_proc.c | Pre-processing (HP filtering and scaling) | C |
| Post_pro.c | Post processing (HP filtering and scaling) | C |
| Tab_ld8k.c | ROM tables | C |
| Ld8k.h | Function prototypes | C |
| Tab_ld8k.h | Extern ROM table declarations | C |
| Typedef.h | Data type definition (machine dependent) | C |
| Filter.c | Filter functions | C+E |
| Lpcp.c | LP analysis | C+E |
| Lspdece.c | LSP decoding routines | C+E |
| Lspgetqe.c | LSP quantizer | C+E |
| Qua_lspe.c | LSP quantizer | C+E |
| Coderepc.c | Main encoder routine | C+B+D+E |
| Corld8ep.c | Encoder routine | C+B+D+E |
| Decoddep.c | Main decoder routine | C+B+D+E |
| Decld8ep.c | Decoder routine | C+B+D+E |
| Acelfp_cp.c | search ACELP fixed codebook (6.4, 8, 11.8 kbit/s) | C+D+E |
| Dacelep.c | Decode algebraic codebook (6.4, 8, 11.8 kbit/s) | C+D+E |
| Pstfltpep.c | Postfilter routines | C+B+E |
| Bitsepcp.c | Bit manipulation routines | C+B+D+E |
| Annex-Specific & New Modules | ||
| Taming.c | Pitch instability control | C |
| Qsidgain.c | SID Gain Quantization | B |
| Qsidlsf.c | SID-LSF Quantization | B |
| Tab_dtx.c | ROM tables | B |
| Vad.h | Prototype and Constants | B |
| Octet.h | Octet transmission mode definition | B |
| Tab_dx.h | Extern ROM table declarations | B |
| Pwf_c | Computation of perceptual weighting coefficients (8 kbit/s) | C |
| Pwfde.c | Computation of perceptual weighting coefficients (11.8 kbit/s) | E |
| Vad.c | VAD | B |
| Dtx.c | DTX Decision | B |
| Dtx.h | Prototype and Constants | B |
| Calcexc.c | CNG Excitation Calculation | B |
| Dec_sid.c | Decode SID Information | B |
| Phdisp.c | Phase dispersion | C+B |
| Bwfw.c | Backward/forward switch selection | E |
| Bwfwfunc.c | Miscellaneous routines related to backward/forward switch | E |
| Track_pe.c | Pitch tracking | E |
| Pitchp.c | Pitch search | C+D+E |
| Declaep.c | Decode adaptive-codebook index | C+D+E |
| Q_gaincp.c | Gain quantizer | C+D+E |
| Degaincp.c | Decode gain | C+D+E |
| Tabld8ep.c | ROM tables for G.729 at 6.4 and 11.8 kbit/s | D+E |
| Tabld8ep.h | Extern ROM declarations for G.729 at 6.4 and 11.8 kbit/s | D+E |
| Ld8ep.h | Constant and Function prototypes for G.729 at 6.4 and 11.8 kbit/s | D+E |
| Mus_dtct.c | Music detection module | New |