Rockbox.org home
release
dev builds
extras
themes manual
wiki
device status forums
mailing lists
IRC bugs
patches
dev guide



Rockbox mail archive

Subject: RE: Re[2]: LOW_WATER and high bitrates

RE: Re[2]: LOW_WATER and high bitrates

From: Nielsen Linus (ext) <"Nielsen>
Date: Thu, 1 Aug 2002 07:40:46 +0200

> Are we reading the data from disk and sending it to the mp3
> decoder without noticing mp3 frames or are we aware of the
> mp3frames? (I think the first one.)

Definitely the first one.

> How can I find the beginning of an mp3-frame (and find the header)?

You will have to search the bitstream for a frame sync word.

> If that is possible, I think we should update the
> bitrate-field of the id3tag-struct by making it the
> average of the ones that were found by
> now, like:
>
> double bitrate_sum = 0.0;
> double frames_read = 0.0;
>
> void DEI3(void) {
>
> // reading data from disk
>
> // get bitrate of actually read frame
>
> bitrate_sum += bitrate_this_frame;
> frames_read += 1.0;
> mp3entry.bitrate = (int)(bitrate_sum / frames_read);
>
> }
>
> (double to prevent overflow)

First of all, it would take the CPU a lot of time to search that data and
find the frame sync words. Secondly, we don't have floating point support.
This CPU has no floating point unit. I don't think that is feasible.

> The playing time should also be updated while playing the song.

What firmware are you using? We have been displaying play time for ages.

> I'd prefer this instead of reading in the whole file before
> playing it (it takes too long).

What makes you think we read the whole file before playing it?

> And I think it'll give a really good average value very quickly.

No, that is taken care of dynamically by the decoder DSP, regardless of our
efforts.

/Linus
Received on 2002-08-01

Page template was last modified "Sat Sep 18 20:21:06 2021" The Rockbox Crew -- Privacy Policy