encoder intialization

(C)Copyright 2000 NTT Cyber Space Laboratories

# Manual for encoder intialization

Prior to encoding process, the following initialization is mandatory.

1. obtaining setup information
2. intialization of encoder module

## 1. obtaining program setup information

### 1.1 encoder setup information

Setup information is stored as the member of struct `headerInfo` and `encSpecificInfo`. `headerInfo` has common information and encSpecificInfo has encoder specific information.

`typedef struct{ int N_CAN_GLOBAL; /* number of preselection candidates of VQ*/ /* the smaller, the faster */ /* the larger, the higher quality */ } encSpecificInfo;`

Refer to combnation of parameters

In sample program, setup parameters are obtained from commandline. Audio parameters are obtained from header of WAVE header.

### 1.2 specification of Input and output

In sample program, input and output file names are set from command line.

## 2. Initialization of TwinVQ

Initialization should be done as follows.

### 2.1 Initialization of TwinVQ encoder module

Encoder module is initialized by `TvqEncInitialize()`

### 2.2 Initialization of bit stream generation module

Bit stream generation module is initialized by `TvqInitBsWriter()`

### 2.3 Initialization of the audio input

Audio buffer need memory of {number of samples per frame}x{number of channels}

Number of samples and number of channels can be obtained by `TvqEncGetFrameSize()` and `TvqEncGetNumChannels()`

### 2.4 Generation of header

Header objects are generated by TvqCreateHeaderChunk(), which is in ChunkHelper.cxx. In TvqCreateHeaderChunk(), extended information is obtained from configuration file, while standard information is obtained from the struct `headerInfo`.

### 2.5 Output of header

Header objects are written by TvqPutBsHeaderInfo()

.