summaryrefslogtreecommitdiffstats
path: root/firmware
diff options
context:
space:
mode:
authorJens Arnold <amiconn@rockbox.org>2005-08-22 00:15:57 +0000
committerJens Arnold <amiconn@rockbox.org>2005-08-22 00:15:57 +0000
commit249f86cb347830865c98e5cd99b7c815daec9aee (patch)
treee705fb9b0a31a18a03e5064288324354afcc3805 /firmware
parentd4496efee7bd30e4e976cf9937c75f5d00f3acb5 (diff)
downloadrockbox-249f86cb347830865c98e5cd99b7c815daec9aee.tar.gz
rockbox-249f86cb347830865c98e5cd99b7c815daec9aee.zip
Some slight size optimisations.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7383 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware')
-rw-r--r--firmware/mp3data.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/firmware/mp3data.c b/firmware/mp3data.c
index 260412b68a..bca8560188 100644
--- a/firmware/mp3data.c
+++ b/firmware/mp3data.c
@@ -122,39 +122,39 @@ static bool mp3headerinfo(struct mp3info *info, unsigned long header)
int freqindex;
/* MPEG Audio Version */
- switch(header & VERSION_MASK) {
+ switch((header & VERSION_MASK) >> 19) {
case 0:
/* MPEG version 2.5 is not an official standard */
info->version = MPEG_VERSION2_5;
bittable = MPEG_VERSION2 - 1; /* use the V2 bit rate table */
break;
-
- case (1L << 19):
+
+ case 1:
return false;
- case (2L << 19):
+ case 2:
/* MPEG version 2 (ISO/IEC 13818-3) */
info->version = MPEG_VERSION2;
bittable = MPEG_VERSION2 - 1;
break;
- case (3L << 19):
+ case 3:
/* MPEG version 1 (ISO/IEC 11172-3) */
info->version = MPEG_VERSION1;
bittable = MPEG_VERSION1 - 1;
break;
}
- switch(header & LAYER_MASK) {
+ switch((header & LAYER_MASK) >> 17) {
case 0:
return false;
- case (1L << 17):
+ case 1:
info->layer = 2;
break;
- case (2L << 17):
+ case 2:
info->layer = 1;
break;
- case (3L << 17):
+ case 3:
info->layer = 0;
break;
}
@@ -174,7 +174,7 @@ static bool mp3headerinfo(struct mp3info *info, unsigned long header)
return false;
info->padding = (header & 0x0200)?1:0;
-
+
/* Calculate number of bytes, calculation depends on layer */
switch(info->layer) {
case 0: