[Tremor] Need information of any Ogg player implementation on tremor

Timur Elzhov elzhov at gmail.com
Mon Apr 19 06:33:25 PDT 2010


2009/12/28 Diptopal Basu <diptopal.basu at gmail.com>:

>      If I wanted to test the Tremor decoder , how would I do it , are
> there any test cases available . Actually the previous questions I
> have been putting are meant for this .
>
>    Assuming I wanted to test the codec on an API level , what should
> be my steps ? For that matter if I wanted to test out any decoder or
> the player using it , how should I test it . I am not aware of testing
> on this domain hence my question .

Take the example from libvorbis (that do use of floating-point), find
"decoder_example.c", then you need to slightly modify it for use with
Tremor. Find the line

while((samples=vorbis_synthesis_pcmout(&vd,&pcm))>0)

above you'll see the declaration of pointer to PCM array declared as float

float **pcm

replace with int:

int **pcm;

below find the line where value for that array is calculated:

int val=floor(mono[j]*32767.f+.5f);

replace it with

int val=CLIP_TO_15(mono[j]>>9);

CLIP_TO_15 define somewhere above as

static inline int CLIP_TO_15(int x)
{
	if (x < -32768) return -32768;
	if (x > 32767) return 32767;
	return x;
}

or, probably more optimal:

static inline int CLIP_TO_15(int x)
{
	unsigned int tmp = x + 32768;
	return (tmp < 65536) ? x : (tmp < (1<<31)) ? 32767 : -32768;
}

Then link that code against Tremor. Probably, some initialization
function's signature for Tremor is different from that for Vorbis, I
don't remember exactly, sorry. But it could trivially be fixed, by
adding '1' as argument. Please tell me if you experienced the similar
problem.

Timur


More information about the Tremor mailing list