Lines Matching defs:vdata

151 	VORBIS_PRIVATE *vdata = (VORBIS_PRIVATE *) psf->codec_data ;
165 vorbis_info_init (&vdata->vinfo) ;
166 vorbis_comment_init (&vdata->vcomment) ;
178 if (vorbis_synthesis_headerin (&vdata->vinfo, &vdata->vcomment, &odata->opacket) < 0)
219 vorbis_synthesis_headerin (&vdata->vinfo, &vdata->vcomment, &odata->opacket) ;
230 psf_log_printf (psf, "Bitstream is %d channel, %D Hz\n", vdata->vinfo.channels, vdata->vinfo.rate) ;
231 psf_log_printf (psf, "Encoded by : %s\n", vdata->vcomment.vendor) ;
244 vorbis_calculate_granulepos (psf, &vdata->pcm_start) ;
245 vdata->gp = vdata->pcm_start ;
250 vdata->pcm_end = (uint64_t) -1 ;
254 last_page = ogg_sync_last_page_before (psf, odata, &vdata->pcm_end, psf->filelength, odata->ostream.serialno) ;
261 vdata->last_page = last_page ;
267 psf_log_printf (psf, "PCM offset : %D\n", vdata->pcm_start) ;
268 if (vdata->pcm_end != (uint64_t) -1)
269 psf_log_printf (psf, "PCM end : %D\n", vdata->pcm_end) ;
277 dd = vorbis_comment_query (&vdata->vcomment, vorbis_metatypes [i].name, 0) ;
291 psf->sf.samplerate = vdata->vinfo.rate ;
292 psf->sf.channels = vdata->vinfo.channels ;
294 psf->sf.frames = (vdata->pcm_end != (uint64_t) -1) ? vdata->pcm_end - vdata->pcm_start : SF_COUNT_MAX ;
299 vorbis_synthesis_init (&vdata->vdsp, &vdata->vinfo) ;
304 vorbis_block_init (&vdata->vdsp, &vdata->vblock) ;
313 VORBIS_PRIVATE *vdata = (VORBIS_PRIVATE *) psf->codec_data ;
316 vorbis_info_init (&vdata->vinfo) ;
319 ret = vorbis_encode_init_vbr (&vdata->vinfo, psf->sf.channels, psf->sf.samplerate, vdata->quality) ;
322 ret = vorbis_encode_init (&vdata->vinfo, psf->sf.channels, psf->sf.samplerate, -1, 128000, -1) ; /* average bitrate mode */
323 ret = ( vorbis_encode_setup_managed (&vdata->vinfo, psf->sf.channels, psf->sf.samplerate, -1, 128000, -1)
324 || vorbis_encode_ctl (&vdata->vinfo, OV_ECTL_RATEMANAGE_AVG, NULL)
325 || vorbis_encode_setup_init (&vdata->vinfo)
331 vdata->gp = 0 ;
334 vorbis_comment_init (&vdata->vcomment) ;
336 vorbis_comment_add_tag (&vdata->vcomment, "ENCODER", "libsndfile") ;
358 vorbis_comment_add_tag (&vdata->vcomment, name, psf->strings.storage + psf->strings.data [k].offset) ;
362 vorbis_analysis_init (&vdata->vdsp, &vdata->vinfo) ;
363 vorbis_block_init (&vdata->vdsp, &vdata->vblock) ;
385 vorbis_analysis_headerout (&vdata->vdsp, &vdata->vcomment, &header, &header_comm, &header_code) ;
404 VORBIS_PRIVATE *vdata = psf->codec_data ;
406 if (odata == NULL || vdata == NULL)
417 vorbis_analysis_wrote (&vdata->vdsp, 0) ;
418 while (vorbis_analysis_blockout (&vdata->vdsp, &vdata->vblock) == 1)
422 vorbis_analysis (&vdata->vblock, NULL) ;
423 vorbis_bitrate_addblock (&vdata->vblock) ;
425 while (vorbis_bitrate_flushpacket (&vdata->vdsp, &odata->opacket))
447 vorbis_block_clear (&vdata->vblock) ;
448 vorbis_dsp_clear (&vdata->vdsp) ;
449 vorbis_comment_clear (&vdata->vcomment) ;
450 vorbis_info_clear (&vdata->vinfo) ;
458 VORBIS_PRIVATE* vdata ;
466 vdata = calloc (1, sizeof (VORBIS_PRIVATE)) ;
467 psf->codec_data = vdata ;
488 vdata->quality = 0.4 ;
515 VORBIS_PRIVATE *vdata = (VORBIS_PRIVATE *) psf->codec_data ;
525 vdata->quality = 1.0 - *((double *) data) ;
528 vdata->quality = SF_MAX (0.0, SF_MIN (1.0, vdata->quality)) ;
530 psf_log_printf (psf, "%s : Setting SFC_SET_VBR_ENCODING_QUALITY to %f.\n", __func__, vdata->quality) ;
621 { VORBIS_PRIVATE *vdata = psf->codec_data ;
635 while ((samples = vorbis_synthesis_pcmout (&vdata->vdsp, &pcm)) > 0)
640 vorbis_synthesis_read (&vdata->vdsp, samples) ;
641 vdata->gp += samples ;
654 vorbis_synthesis_restart (&vdata->vdsp) ;
655 vorbis_calculate_granulepos (psf, &vdata->gp) ;
660 if (vorbis_synthesis (&vdata->vblock, &(odata->pkt [odata->pkt_indx])) == 0) /* test for success! */
661 vorbis_synthesis_blockin (&vdata->vdsp, &vdata->vblock) ;
692 vorbis_write_samples (SF_PRIVATE *psf, OGG_PRIVATE *odata, VORBIS_PRIVATE *vdata, int in_frames)
694 vorbis_analysis_wrote (&vdata->vdsp, in_frames) ;
701 while (vorbis_analysis_blockout (&vdata->vdsp, &vdata->vblock) == 1)
704 vorbis_analysis (&vdata->vblock, NULL) ;
705 vorbis_bitrate_addblock (&vdata->vblock) ;
707 while (vorbis_bitrate_flushpacket (&vdata->vdsp, &odata->opacket))
727 vdata->gp += in_frames ;
736 VORBIS_PRIVATE *vdata = (VORBIS_PRIVATE *) psf->codec_data ;
738 float **buffer = vorbis_analysis_buffer (&vdata->vdsp, in_frames) ;
743 vorbis_write_samples (psf, odata, vdata, in_frames) ;
752 VORBIS_PRIVATE *vdata = (VORBIS_PRIVATE *) psf->codec_data ;
754 float **buffer = vorbis_analysis_buffer (&vdata->vdsp, in_frames) ;
759 vorbis_write_samples (psf, odata, vdata, in_frames) ;
768 VORBIS_PRIVATE *vdata = (VORBIS_PRIVATE *) psf->codec_data ;
770 float **buffer = vorbis_analysis_buffer (&vdata->vdsp, in_frames) ;
775 vorbis_write_samples (psf, odata, vdata, in_frames) ;
784 VORBIS_PRIVATE *vdata = (VORBIS_PRIVATE *) psf->codec_data ;
786 float **buffer = vorbis_analysis_buffer (&vdata->vdsp, in_frames) ;
791 vorbis_write_samples (psf, odata, vdata, in_frames) ;
799 VORBIS_PRIVATE *vdata = (VORBIS_PRIVATE *) psf->codec_data ;
802 const int blocksize = vorbis_info_blocksize (&vdata->vinfo, 1) ;
806 thisblock = vorbis_synthesis_pcmout (&vdata->vdsp, NULL) ;
808 { if ((uint64_t) thisblock + vdata->gp >= target)
809 thisblock = SF_MIN (thisblock, (int) (target - vdata->gp)) ;
811 vorbis_synthesis_read (&vdata->vdsp, thisblock) ;
812 vdata->gp += thisblock ;
813 if (vdata->gp == target)
819 for ( ; vdata->gp < target ; )
830 vorbis_synthesis_restart (&vdata->vdsp) ;
831 vorbis_calculate_granulepos (psf, &vdata->gp) ;
832 if (target < vdata->gp)
840 thisblock = vorbis_packet_blocksize (&vdata->vinfo, pkt) ;
848 { vdata->gp += ((lastblock + thisblock) / 4) ;
852 if (vdata->gp + ((thisblock + blocksize) / 4) >= target)
857 vorbis_synthesis_trackonly (&vdata->vblock, pkt) ;
858 vorbis_synthesis_blockin (&vdata->vdsp, &vdata->vblock) ;
864 vorbis_read_sample (psf, (void *) NULL, (target - vdata->gp) * psf->sf.channels, vorbis_rnull) ;
872 VORBIS_PRIVATE *vdata = (VORBIS_PRIVATE *) psf->codec_data ;
877 if (vdata->pcm_end == (uint64_t) -1)
882 if (target_gp >= vdata->gp &&
883 target_gp - vdata->gp < ((unsigned) (VORBIS_SEEK_THRESHOLD) * psf->sf.samplerate))
898 search_target_gp = vorbis_info_blocksize (&vdata->vinfo, 1) / 2 ;
901 ret = ogg_stream_seek_page_search (psf, odata, search_target_gp, vdata->pcm_start,
902 vdata->pcm_end, &best_gp, psf->dataoffset, vdata->last_page, vdata->vinfo.rate) ;
909 vorbis_synthesis_restart (&vdata->vdsp) ;
910 ret = vorbis_calculate_granulepos (psf, &vdata->gp) ;
919 VORBIS_PRIVATE *vdata = (VORBIS_PRIVATE *) psf->codec_data ;
923 if (odata == NULL || vdata == NULL)
932 { target_gp = (uint64_t) offset + vdata->pcm_start ;
936 if (ret < 0 || vdata->gp > target_gp)
943 vdata->gp = vdata->pcm_start ;
944 vorbis_synthesis_restart (&vdata->vdsp) ;
949 return vdata->gp - vdata->pcm_start ;
968 VORBIS_PRIVATE *vdata = (VORBIS_PRIVATE *) psf->codec_data ;
996 { thisblock = vorbis_packet_blocksize (&vdata->vinfo, &pkt [i]) ;