1 /* (c)Copyright 1996-2000 NTT Cyber Space Laboratories */
2 /* Released on 2000.05.22 by N. Iwakami */
3 /* Modified on 2000.05.25 by N. Iwakami */
4 /* Released on 2000.09.06 by N. Iwakami */
6 // Modified for MPlayer on 2004.12.29
15 # define DllPort __declspec( dllexport )
17 # define DllPort __declspec( dllimport )
24 extern "C" { // only need to import/export C interface if used by C++ source code
27 /************************/
28 /*** General settings ***/
29 /************************/
30 /* Initialization error code */
31 enum INIT_ERROR_CODE
{
32 TVQ_NO_ERROR
= 0, // no error
34 TVQ_ERROR_VERSION
, // wrong version
35 TVQ_ERROR_CHANNEL
, // channel setting error
36 TVQ_ERROR_MODE
, // wrong coding mode
37 TVQ_ERROR_PARAM
, // inner parameter setting error
38 TVQ_ERROR_N_CAN
, // wrong number of VQ pre-selection candidates, used only in encoder
42 #define TVQ_UNKNOWN_VERSION -1
68 #define N_BTYPE 3 // number of block types
69 #define N_INTR_TYPE 4 // number of interleave types, enum BLOCK_TYPE is commonly used for detecting interleave types.
71 /* maximum number of channels */
74 /* type definition of code information interface */
81 int *segment_sw
[ N_CH_MAX
];
82 int *band_sw
[ N_CH_MAX
];
83 int *fg_intensity
[ N_CH_MAX
];
101 int pgain
[ N_CH_MAX
];
109 /***********************************************/
110 /*** Definitions about program configuration ***/
111 /***********************************************/
112 /* type definition of tvqConfInfoSubBlock */
114 int sf_sz
; // subframe size
115 int nsf
; // number of subframes
116 int ndiv
; // number of division of weighted interleave vector quantization
117 int ncrb
; // number of Bark-scale subbands
118 int fw_ndiv
; // number of division of BSE VQ
119 int fw_nbit
; // number of bits for BSE VQ
120 int nsubg
; // number of sub-blocks for gain coding
121 int ppc_enable
; // PPC switch
122 int ebc_enable
; // EBC switch
123 int ebc_crb_base
; // EBC base band
124 int ebc_bits
; // EBC bits
125 int fbc_enable
; // FBC switch
126 int fbc_n_segment
; // FBC number of segments
127 int fbc_nband
; // FBC number of subbands
128 int *fbc_crb_tbl
; // FBC subband table
129 } tvqConfInfoSubBlock
;
131 /* type definition of tvqConfInfo */
133 /* frame configuration */
135 /* window type coding */
142 /* Bark-scale envelope coding */
147 /* pitch excitation */
152 /* block type dependent parameters */
153 tvqConfInfoSubBlock cfg
[N_BTYPE
];
158 /*************************************************/
159 /*** Definitions about TwinVQ bitstream header ***/
160 /*************************************************/
161 //#include "declib_src/tvq_hdr.h"
163 //#define BUFSIZ 1024
166 #define KEYWORD_BYTES 4
167 #define VERSION_BYTES 8
168 #define ELEM_BYTES sizeof(unsigned long)
174 char ID
[KEYWORD_BYTES
+VERSION_BYTES
+1];
177 int channelMode
; /* channel mode (mono:0/stereo:1) */
178 int bitRate
; /* bit rate (kbit/s) */
179 int samplingRate
; /* sampling rate (44.1 kHz -> 44) */
180 int securityLevel
; /* security level (always 0) */
187 char Extr
[BUFSIZ
]; // add by OKAMOTO 99.12.21
192 // TwinVQ decoder initialization/termination functions
193 //DllPort int TvqInitialize( headerInfo *setupInfo, INDEX *index, int dispErrorMessageBox );
194 //DllPort void TvqTerminate( INDEX *index );
195 //DllPort void TvqGetVectorInfo(int *bits0[], int *bits1[]);
196 //DllPort void TvqResetFrameCounter();
198 // TwinVQ decoder function
199 //DllPort void TvqDecodeFrame(INDEX *indexp, float out[]);
200 //DllPort int TvqWtypeToBtype( int w_type, int *btype );
201 //DllPort void TvqUpdateVectorInfo(int varbits, int *ndiv, int bits0[], int bits1[]);
202 //DllPort void TvqSetFrameCounter( int position );
204 // TwinVQ query functions
205 //DllPort int TvqCheckVersion(char *versionID);
206 //DllPort void TvqGetSetupInfo(headerInfo *setupInfo); // setup information
207 //DllPort void TvqGetConfInfo(tvqConfInfo *cf); // configuration information
208 //DllPort int TvqGetFrameSize(); // frame size
209 //DllPort int TvqGetNumChannels(); // number of channels
210 //DllPort int TvqGetBitRate(); // total bitrate
211 //DllPort float TvqGetSamplingRate(); // sampling rate
212 //DllPort int TvqGetNumFixedBitsPerFrame(); // number of fixed bits per frame
213 //DllPort int TvqGetNumFrames(); // number of decoded frame
214 //DllPort int TvqGetModuleVersion( char* versionString );
216 #ifdef V2PLUS_SUPPORT
217 // TwinVQ FB coding tool control
218 DllPort
void TvqFbCountUsedBits(int nbit
); // count number of used bits
219 DllPort
float TvqGetFbCurrentBitrate(); // query average bitrate for the tool
220 DllPort
int TvqGetFbTotalBits(); // query total number of used bits
228 #endif /* MPLAYER_VQF_H */