FS#11454 - Tuning of compiler options for codecs

Attached to Project: Rockbox
Opened by Nils Wallménius (nls) - Saturday, 03 July 2010, 19:19 GMT
Last edited by Nils Wallménius (nls) - Sunday, 18 July 2010, 19:06 GMT
Task Type Patches
Category Codecs
Status Closed
Assigned To No-one
Operating System SW-codec
Severity Low
Priority Normal
Reported Version Release 3.6
Due in Version Next release
Due Date Undecided
Percent Complete 100%
Votes 0
Private No


I've run test_codec runs of all the files in test_files (except the ape files) on both my h300 and c200 and come up with this tuning.

speedups are as follows
cook 8-14%
faad 2-6%
tta 1%
wma 7-14%
tremor ~0.5%

alac 1%
faad 2-3%
tta 6%
wma 2%
wv 2%

It would be nice if others could run the same type of benchmark on other cpu's, i'm not sure all arms behave the same so maybe we need more fine grained control.
To do so, just apply the codec_flag_test.diff patch below and edit the CODECFLAGS line in apps/codecs/codecs.make to compile all the codecs with the specified compiler flags.
Note that the flag_test patch does not affect the codeclib since testing that separately for optimal compilation flags might be necessary, it was on h300 at least.
This task depends upon

Closed by  Nils Wallménius (nls)
Sunday, 18 July 2010, 19:06 GMT
Reason for closing:  Accepted
Additional comments about closing:  synced and committed except for the aac and tta parts that were already committed
Comment by Yoshihisa Uchida (Uchida) - Monday, 05 July 2010, 11:26 GMT
The following error occurs when iPod video's Rockbox builds on r27272 + codec_flag_test.diff.

ld: /home/yoshihisa/rockbox/build/apps/codecs/mpc.elf section `.ibss'
will not fit in region `PLUGIN_IRAM'
ld: region `PLUGIN_IRAM' overflowed by 5808 bytes
collect2: ld returned 1 exit status

On r27272 + codecs_tuned_v2.diff, iPod video's Rockbox builds success.
tta codec : decoding speed ~+3 % (174.73 % -> 177.73%). (other codecs does not check).

Comment by Andree Buschmann (Buschel) - Monday, 05 July 2010, 16:00 GMT
musepack (mpc) is fully optimized with all the "-Ox". We should not change this.

Edit: Also libmad will be slower when using optimization levels > -O1. So, libmad should not be changed (at least for arm) either.
Comment by Nils Wallménius (nls) - Tuesday, 06 July 2010, 07:31 GMT
Buschel, that's what i found too so the patch doesn't change them...
The test patch is just wat i used for testing if others wanted to try on targets with cpu's i don't have.
The test patch currently sets O3 and that can easily be changed in codecs.mke if you want to test.