Lines Matching refs:vi
149 int vorbis_info_blocksize(vorbis_info *vi,int zo){ in vorbis_info_blocksize() argument
150 codec_setup_info *ci = vi->codec_setup; in vorbis_info_blocksize()
155 void vorbis_info_init(vorbis_info *vi){ in vorbis_info_init() argument
156 memset(vi,0,sizeof(*vi)); in vorbis_info_init()
157 vi->codec_setup=_ogg_calloc(1,sizeof(codec_setup_info)); in vorbis_info_init()
160 void vorbis_info_clear(vorbis_info *vi){ in vorbis_info_clear() argument
161 codec_setup_info *ci=vi->codec_setup; in vorbis_info_clear()
204 memset(vi,0,sizeof(*vi)); in vorbis_info_clear()
209 static int _vorbis_unpack_info(vorbis_info *vi,oggpack_buffer *opb){ in _vorbis_unpack_info() argument
210 codec_setup_info *ci=vi->codec_setup; in _vorbis_unpack_info()
213 vi->version=oggpack_read(opb,32); in _vorbis_unpack_info()
214 if(vi->version!=0)return(OV_EVERSION); in _vorbis_unpack_info()
216 vi->channels=oggpack_read(opb,8); in _vorbis_unpack_info()
217 vi->rate=oggpack_read(opb,32); in _vorbis_unpack_info()
219 vi->bitrate_upper=oggpack_read(opb,32); in _vorbis_unpack_info()
220 vi->bitrate_nominal=oggpack_read(opb,32); in _vorbis_unpack_info()
221 vi->bitrate_lower=oggpack_read(opb,32); in _vorbis_unpack_info()
226 if(vi->rate<1)goto err_out; in _vorbis_unpack_info()
227 if(vi->channels<1)goto err_out; in _vorbis_unpack_info()
236 vorbis_info_clear(vi); in _vorbis_unpack_info()
272 static int _vorbis_unpack_books(vorbis_info *vi,oggpack_buffer *opb){ in _vorbis_unpack_books() argument
273 codec_setup_info *ci=vi->codec_setup; in _vorbis_unpack_books()
301 ci->floor_param[i]=_floor_P[ci->floor_type[i]]->unpack(vi,opb); in _vorbis_unpack_books()
311 ci->residue_param[i]=_residue_P[ci->residue_type[i]]->unpack(vi,opb); in _vorbis_unpack_books()
321 ci->map_param[i]=_mapping_P[ci->map_type[i]]->unpack(vi,opb); in _vorbis_unpack_books()
345 vorbis_info_clear(vi); in _vorbis_unpack_books()
379 int vorbis_synthesis_headerin(vorbis_info *vi,vorbis_comment *vc,ogg_packet *op){ in vorbis_synthesis_headerin() argument
402 if(vi->rate!=0){ in vorbis_synthesis_headerin()
407 return(_vorbis_unpack_info(vi,&opb)); in vorbis_synthesis_headerin()
410 if(vi->rate==0){ in vorbis_synthesis_headerin()
418 if(vi->rate==0 || vc->vendor==NULL){ in vorbis_synthesis_headerin()
423 return(_vorbis_unpack_books(vi,&opb)); in vorbis_synthesis_headerin()
437 static int _vorbis_pack_info(oggpack_buffer *opb,vorbis_info *vi){ in _vorbis_pack_info() argument
438 codec_setup_info *ci=vi->codec_setup; in _vorbis_pack_info()
447 oggpack_write(opb,vi->channels,8); in _vorbis_pack_info()
448 oggpack_write(opb,vi->rate,32); in _vorbis_pack_info()
450 oggpack_write(opb,vi->bitrate_upper,32); in _vorbis_pack_info()
451 oggpack_write(opb,vi->bitrate_nominal,32); in _vorbis_pack_info()
452 oggpack_write(opb,vi->bitrate_lower,32); in _vorbis_pack_info()
491 static int _vorbis_pack_books(oggpack_buffer *opb,vorbis_info *vi){ in _vorbis_pack_books() argument
492 codec_setup_info *ci=vi->codec_setup; in _vorbis_pack_books()
529 _mapping_P[ci->map_type[i]]->pack(vi,ci->map_param[i],opb); in _vorbis_pack_books()
573 vorbis_info *vi=v->vi; in vorbis_analysis_headerout() local
585 if(_vorbis_pack_info(&opb,vi))goto err_out; in vorbis_analysis_headerout()
616 if(_vorbis_pack_books(&opb,vi))goto err_out; in vorbis_analysis_headerout()
649 return((double)granulepos/v->vi->rate); in vorbis_granule_time()