mirror of
https://github.com/RaySollium99/picodrive.git
synced 2025-09-05 07:17:45 -04:00
make gp2x mp3 playback functional (need to unpack and compile helix decoder separately in platform/common/helix)
This commit is contained in:
parent
c79d0bb90f
commit
340e528ff8
13 changed files with 274 additions and 59 deletions
|
@ -21,33 +21,6 @@ unsigned short mpeg1_l3_bitrates[16] = {
|
|||
0, 32, 40, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320
|
||||
};
|
||||
|
||||
int mp3_find_sync_word(const unsigned char *buf, int size)
|
||||
{
|
||||
const unsigned char *p, *pe;
|
||||
|
||||
/* find byte-aligned syncword - need 12 (MPEG 1,2) or 11 (MPEG 2.5) matching bits */
|
||||
for (p = buf, pe = buf + size - 3; p <= pe; p++)
|
||||
{
|
||||
int pn;
|
||||
if (p[0] != 0xff)
|
||||
continue;
|
||||
pn = p[1];
|
||||
if ((pn & 0xf8) != 0xf8 || // currently must be MPEG1
|
||||
(pn & 6) == 0) { // invalid layer
|
||||
p++; continue;
|
||||
}
|
||||
pn = p[2];
|
||||
if ((pn & 0xf0) < 0x20 || (pn & 0xf0) == 0xf0 || // bitrates
|
||||
(pn & 0x0c) != 0) { // not 44kHz
|
||||
continue;
|
||||
}
|
||||
|
||||
return p - buf;
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
static int try_get_bitrate(unsigned char *buf, int buf_size)
|
||||
{
|
||||
int offs1, offs = 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue