[vorbis] Output signal of the Tremor Codec
John Edwards
john.edwards33 at ntlworld.com
Thu Oct 23 02:44:31 PDT 2003
----- Original Message -----
m: "Ralph Giles" <giles at xiph.org>
To: <vorbis at xiph.org>
On Thursday, October 23, 2003 10:00 AM, Ralph Giles wrote:
Subject: Re: [vorbis] Output signal of the Tremor Codec
<p>> The lower-level vorbis_systhesis_pcmout() call returns a pointer to an
> array of channels, each an array of 32 bit integers with what looks like
> 24 bit precision. This may make more sense for your application,
> especially if you use a >16 bit DAC. In any case, it avoids a copy if
> there's room to do the interleaving in the FPGA. See the implementation
> of ov_read() in vorbisfile.c for an example of the conversion.
Actually, and for my own purposes, I added the following to vorbisfile.c in
the Tremor lib so that I could play with the decoded non-interleaved 16 bit
ints:
long ov_read_int(OggVorbis_File *vf,int ***pcm_channels,int length,
int *bitstream){
int i,j;
if(vf->ready_state<OPENED)return(OV_EINVAL);
while(1){
if(vf->ready_state>=STREAMSET){
int **pcm;
long samples=vorbis_synthesis_pcmout(&vf->vd,&pcm);
if(samples){
long channels=ov_info(vf,-1)->channels;
for(i=0;i<channels;i++) { /* It's faster in this order */
for(j=0;j<samples;j++) {
pcm[i][j]=CLIP_TO_15(pcm[i][j]>>9);
}
}
if(pcm_channels)*pcm_channels=pcm;
if(samples>length)samples=length;
vorbis_synthesis_read(&vf->vd,samples);
vf->pcm_offset+=samples;
if(bitstream)*bitstream=vf->current_link;
return samples;
}
}
/* suck in another packet */
{
int ret=_fetch_and_process_packet(vf,1,1);
if(ret==OV_EOF)return(0);
if(ret<=0)return(ret);
}
}
}
John
<p>--- >8 ----
List archives: http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'vorbis-request at xiph.org'
containing only the word 'unsubscribe' in the body. No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.
More information about the Vorbis
mailing list