I accidentally loaded some non-audio data in my application, and I'm
getting:
a.out: layer3.c:2640: mad_layer_III: Assertion `stream->md_len + md_len - si.main_data_begin <= (511 + 2048 + 8)' failed.
I'm using the low-level interface. I can reproduce this with madlld,
if I change INPUT_BUFFER_SIZE from 5*8192 to 4*8192 or lower (my own
buffer is 16k).
The file (edited down as small as I can get it while still triggering
this) is at:
http://zewt.org/~glenn/testfile
There's …
[View More]some MPEG-1 video in there, which I suppose MAD is picking up;
that's fine, I just want it to gracefully play garbage or give a fatal
error, without dying.
--
Glenn Maynard
[View Less]
Assuming your MPEG source has a different sample rate, you'll need
to resample it after it has been decoded. You can find example code
in the resample.c module of madplay.
Average each pair of stereo samples to get mono; drop least-significant
bits (with rounding maybe) to get to 8 bits.
Out of interest, what is your application? I've tried 7-bit mono at 11kHz,
and it sounded awful :-)
> -----Original Message-----
> From: mad-dev-admin(a)lists.mars.org
> [mailto:mad-dev-admin@…
[View More]lists.mars.org]On Behalf Of Wen
> Sent: 30 December 2004 07:33
> To: mad-dev(a)lists.mars.org
> Subject: [mad-dev] how to convert mp3 into wav by mad?
>
>
> may i get the wave in 1mono 8bit 8000khz?
>
> --
> With my best regards,
> Wen
>
The contents of this email and any attachments are sent for the personal attention
of the addressee(s) only and may be confidential. If you are not the intended
addressee, any use, disclosure or copying of this email and any attachments is
unauthorised - please notify the sender by return and delete the message. Any
representations or commitments expressed in this email are subject to contract.
ntl Group Limited
[View Less]
Hi!
I want to a little discuss this topic - MAD performance.
1. The reason is - usage of MAD in embedded systems. In this case memory
usage and cpu cycles consumption are become critical issues. Rewriting
of 7-8 functions on asm can provide good compromise between software
complexity and decoder performance. Yes it makes code platform
specific - but I hope it is acceptable way for embedded systems.
2. some current results. Using such way I've ported MAD to 2 dsp
platform: TI …
[View More]tms320vc55xx and 3DSP sp3r5m.
Memory:
Simple libmab + minimad application can be fitted in less than 16 000
DSP instructions and all data memory usage: constant tables +
buffers + stack takes less than 64 kBytes.
Cycles:
there are functions with fixed "cycles requirements" - independent
of input bitsream, slightly depended and highly.
good example of first type is frame synthesis - mad_synth_frame()
and last type - III_huffdecode();
now in average for these dsp synthesis takes ~100-120k cycles
3. interest. And finally I wanna ask only one thing:
Is it possible to improve III_huffdecode() function in meaning of
cycles usage?
because right now average frame size of input mp3 bitstream is
300-400 bytes (128 kbps / 44 frames ) - and to decode this 350 bytes
III_huffdecode() spends ~250k+ cycles! this is real bottleneck in
calculation process. And at higher bitrates cycles consumption just
growing up.
What ways can you propose to overcome it?
for example scenario:
- "unpack necessary tables" : ~50k cycles
- "look up" decoding process: less than ... cycles
any proposal are highly welcome.
--
Best regards,
Grigory mailto:Ryhor@tut.by
[View Less]