From 769996654b54209f85ab5bdf852e06def713de36 Mon Sep 17 00:00:00 2001 From: Nils Wallménius Date: Fri, 16 Sep 2011 14:00:06 +0000 Subject: libtremor: save a kB or two limiting an array size to the maximum number of channels we support and using a shorter type for another. No speed diff. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30559 a1c6a512-1295-4272-9138-f99709370657 --- apps/codecs/libtremor/backends.h | 6 +++--- apps/codecs/libtremor/mapping0.c | 6 ++++-- 2 files changed, 7 insertions(+), 5 deletions(-) (limited to 'apps') diff --git a/apps/codecs/libtremor/backends.h b/apps/codecs/libtremor/backends.h index 9b63080a6b..e27f1f2b80 100644 --- a/apps/codecs/libtremor/backends.h +++ b/apps/codecs/libtremor/backends.h @@ -110,7 +110,7 @@ typedef struct{ typedef struct vorbis_info_mapping0{ int submaps; /* <= 16 */ - int chmuxlist[256]; /* up to 256 channels in a Vorbis stream */ + int chmuxlist[CHANNELS]; /* up to 256 channels in a Vorbis stream */ int floorsubmap[16]; /* [mux] submap to floors */ int residuesubmap[16]; /* [mux] submap to residue */ @@ -121,8 +121,8 @@ typedef struct vorbis_info_mapping0{ #endif int coupling_steps; - int coupling_mag[256]; - int coupling_ang[256]; + unsigned char coupling_mag[256]; + unsigned char coupling_ang[256]; } vorbis_info_mapping0; #endif diff --git a/apps/codecs/libtremor/mapping0.c b/apps/codecs/libtremor/mapping0.c index 9284775718..9042b9c174 100644 --- a/apps/codecs/libtremor/mapping0.c +++ b/apps/codecs/libtremor/mapping0.c @@ -147,8 +147,10 @@ static vorbis_info_mapping *mapping0_unpack(vorbis_info *vi,oggpack_buffer *opb) info->coupling_steps=oggpack_read(opb,8)+1; if(info->coupling_steps<=0)goto err_out; for(i=0;icoupling_steps;i++){ - int testM=info->coupling_mag[i]=oggpack_read(opb,ilog(vi->channels)); - int testA=info->coupling_ang[i]=oggpack_read(opb,ilog(vi->channels)); + int testM=oggpack_read(opb,ilog(vi->channels)); + info->coupling_mag[i]=testM; + int testA=oggpack_read(opb,ilog(vi->channels)); + info->coupling_ang[i]=testA; if(testM<0 || testA<0 || -- cgit v1.2.3