(C)Copyright 2000 NTT Cyber Space Laboratories
TwinVQ Ver. 2.3
2000.10.4
TwinVQ decoder is a program which decodes TwinVQ compressed bit stream and generates output signal. In sample program, both input and output are assumed file.
TwinVQ has data structure shown in Fig.1. The audio part consists of compressed bit streams, and the header part includes decoding parameters and side information.
TwinVQ decoder program consists of five major modules shown in Fig.2. Interface of green line depends on the input and output devices.
Fig. 1 Structure of TwinVQ decoder
{ <initialization > while( < reading bit stream > ){ < decode process > < output process > } < termination > }
Above procedures are included in main() (decoder.cxx)
Both decoder module and bit stream reading module are initialized. Memory allocation (flat array) is necessary for audio output. (Refer to TvqDecodeFrame() .)
Initialization should be carried out as the following order.
For details, refer to
InitializeDecoder()
(decoder.cxx)
CHeaderManager::Create()
TvqGetStandardChunkInfo()
After initialization, header information can be retrieved by using header manager.
Refer to message()
.
Bit stream reading is carried out every frame. In sample program, TvqReadBsFrame() reads bit stream and converts the information into (INDEX) format for TwinVQ decoder module.
INDEX format is decompressed to audio signal by TvqDecodeFrame().
Audio signal is written to output device.
In sample program, frtobuf()
converts the audio
signal into 16 bit PCM, and fwrite()
writes it on
output file.
Termination process is needed at the end of bit stream.
TestDec.exe can be build by Visual C++ 6.0 using workspace TestDec.dsw or ModEnc.dsw. For Linux users, do "make" in "ModEnc/" directory.
Decoder can be executed in DOS prompt (command prompt for Windows NT) as follows.
> TestDec <bitstream file name > <output file name > [ff | rew]
For output file, both *.wav format and headerless
signed 16-bit integer format are supported.
Every sample is stored in 2 Bytes. In case of stereo, samples are stored in
the order of L, R, L, R.
ff or rew option is used for Fast Forward and Rewind demonstration.
There is minimum version of the main program, simple_dec.cxx, in the package. The decoder.cxx file can be replaced by this program.
TwinVQ decoder module is provided in DLL form. Functions can be classified into the following three categories.
Functions are listed below.
category | function name | mandatory | outline |
initialization/termination | TvqInitialize() | Yes | initialize decoder module |
---|---|---|---|
TvqTerminate() | Yes | terminate decoder module | |
TvqGetVectorInfo() | Yes | Initialize setup information | |
TvqResetFrameCounter() | reset frame counter | ||
decode process | TvqDecodeFrame() | Yes | frame wise decoding process |
TvqWtypeToBtype() | Yes | translate window-type to block-type | |
TvqUpdateVectorInfo() | Yes | update setup information | |
TvqSetFrameCounter() | set frame counter | ||
inquiry | TvqCheckVersion() | Yes | format version ID |
TvqGetSetupInfo() | setup information | ||
TvqGetConfInfo() | Yes | quntizater configuration parameter | |
TvqGetFrameSize() | Yes | frame size | |
TvqGetNumChannels() | Yes | number of channels | |
TvqGetBitRate() | bit rate | ||
TvqGetSamplingRate() | sampling rate | ||
TvqGetNumFixedBitsPerFrame() | Yes | bits per frame | |
TvqGetNumFrames() | frame counter | ||
TvqGetModuleVersion() | version of software |
category | function | mandatory | outline |
initialize | TvqGetBsHeaderInfo() |
Yes | read bit stream header |
TvqinitBsReader() |
Yes | initialize bit stream reading module | |
process | TvqReadBsFrame() |
Yes | frame wise bit stream reading |
TvqSkipFrame() |
frame skip | ||
TvqGetBsFramePoint() |
current frame number |
CHeaderManager
class
of C++.
frtobuf()