Lines Matching full:ve

250 static int write_vorbis_header(sox_format_t * ft, vorbis_enc_t * ve)  in write_vorbis_header()  argument
274 &ve->vd, &vc, &header_main, &header_comments, &header_codebooks) < 0) { in write_vorbis_header()
279 ogg_stream_packetin(&ve->os, &header_main); /* And stream them out */ in write_vorbis_header()
280 ogg_stream_packetin(&ve->os, &header_comments); in write_vorbis_header()
281 ogg_stream_packetin(&ve->os, &header_codebooks); in write_vorbis_header()
283 while (ogg_stream_flush(&ve->os, &ve->og) && ret == HEADER_OK) in write_vorbis_header()
284 if (!oe_write_page(&ve->og, ft)) in write_vorbis_header()
297 vorbis_enc_t *ve; in startwrite() local
304 ve = vb->vorbis_enc_data = lsx_malloc(sizeof(vorbis_enc_t)); in startwrite()
306 vorbis_info_init(&ve->vi); in startwrite()
324 if (vorbis_encode_init_vbr(&ve->vi, ft->signal.channels, ft->signal.rate + .5, quality / 10)) in startwrite()
330 vorbis_analysis_init(&ve->vd, &ve->vi); in startwrite()
331 vorbis_block_init(&ve->vd, &ve->vb); in startwrite()
333 ogg_stream_init(&ve->os, INT_MAX & (int)RANQD1); /* Random serial number */ in startwrite()
335 if (write_vorbis_header(ft, ve) == HEADER_ERROR) { in startwrite()
348 vorbis_enc_t *ve = vb->vorbis_enc_data; in write_samples() local
350 float **buffer = vorbis_analysis_buffer(&ve->vd, (int) samples); in write_samples()
361 vorbis_analysis_wrote(&ve->vd, (int) samples); in write_samples()
363 while (vorbis_analysis_blockout(&ve->vd, &ve->vb) == 1) { in write_samples()
365 vorbis_analysis(&ve->vb, &ve->op); in write_samples()
366 vorbis_bitrate_addblock(&ve->vb); in write_samples()
369 while (vorbis_bitrate_flushpacket(&ve->vd, &ve->op)) { in write_samples()
370 ogg_stream_packetin(&ve->os, &ve->op); in write_samples()
372 /* If we've gone over a page boundary, we can do actual in write_samples()
377 int result = ogg_stream_pageout(&ve->os, &ve->og); in write_samples()
382 ret = oe_write_page(&ve->og, ft); in write_samples()
386 if (ogg_page_eos(&ve->og)) in write_samples()
398 vorbis_enc_t *ve = vb->vorbis_enc_data; in stopwrite() local
403 ogg_stream_clear(&ve->os); in stopwrite()
404 vorbis_block_clear(&ve->vb); in stopwrite()
405 vorbis_dsp_clear(&ve->vd); in stopwrite()
406 vorbis_info_clear(&ve->vi); in stopwrite()