[vorbis-dev] Peak value

volsung at asu.edu volsung at asu.edu
Tue Jan 22 21:53:29 PST 2002



On Tue, 22 Jan 2002 volsung at asu.edu wrote:

> On Tue, 22 Jan 2002, Paul Martin wrote:
> 
> > /* gain is in decibels, and clipped is a boolean which indicates
> >    whether this block has any samples which have been clipped */
> > 
> > long ov_read_scale(OggVorbis_File *vf,char *buffer,int length,
> > 		    int bigendianp,int word,int sgned,int *bitstream,
> > 		    float gain, int *clipped){
> 
> This seems like a reasonable addition, though I would be in favor of changing
> the gain parameter into a standard multiplicative scale factor.

Actually, I spoke without sufficient thought.  First, it seems that the number
of parameters is getting a little out of hand.  Second, such a function could
be constructed from ov_read_float() (once fixed slightly), a loop to apply the
scale factor, and a helper function to convert floating point numbers to
integer audio samples.  In addition, breaking the process into 2 parts would
allow other transformations (such as hard limiting) to take place, if needed.

It really seems that this function is too specific to go into vorbisfile.


---
Stan Seibert

<p><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-dev-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-dev mailing list