summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThom Johansen <thomj@rockbox.org>2005-10-27 11:00:24 +0000
committerThom Johansen <thomj@rockbox.org>2005-10-27 11:00:24 +0000
commitc2628f3af96f4a2a539d3f179988251a8b6301db (patch)
tree1ed2773f4bf77873041df7db5e90832ee41eaae5
parent0b38c7dcbe283ba7d13531831a5367afae668e69 (diff)
downloadrockbox-c2628f3af96f4a2a539d3f179988251a8b6301db.tar.gz
rockbox-c2628f3af96f4a2a539d3f179988251a8b6301db.tar.bz2
rockbox-c2628f3af96f4a2a539d3f179988251a8b6301db.zip
Replaced jump table with a more efficient one.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7658 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/codecs/libffmpegFLAC/coldfire.S25
1 files changed, 11 insertions, 14 deletions
diff --git a/apps/codecs/libffmpegFLAC/coldfire.S b/apps/codecs/libffmpegFLAC/coldfire.S
index 7e19e4b695..720e6edd86 100644
--- a/apps/codecs/libffmpegFLAC/coldfire.S
+++ b/apps/codecs/libffmpegFLAC/coldfire.S
@@ -48,21 +48,18 @@ lpc_decode_emac:
moveq.l #8, %d3
cmp.l %d3, %d2
jgt .default | order is over 8, jump to default case
- lea.l .jumptable, %a4
- move.l (%a4, %d2.l*4), %a4
- jmp (%a4)
- .align 4 | avoid unaligned fetch
+ jmp.l (2, %pc, %d2.l*4) | jump to loop corresponding to pred_order
.jumptable:
- .long .exit
- .long .order1
- .long .order2
- .long .order3
- .long .order4
- .long .order5
- .long .order6
- .long .order7
- .long .order8
+ bra.w .exit | zero order filter isn't possible, exit function
+ bra.w .order1
+ bra.w .order2
+ bra.w .order3
+ bra.w .order4
+ bra.w .order5
+ bra.w .order6
+ bra.w .order7
+| last jump table entry coincides with target, so leave it out
.order8:
movem.l (%a1), %d3-%d7/%a2-%a4 | load lpc coefs
move.l (%a0)+, %a5 | load first history sample
@@ -78,7 +75,7 @@ lpc_decode_emac:
movclr.l %acc0, %d2 | get sum
asr.l %d1, %d2 | shift sum by lp_quantization bits
add.l %d2, (%a0) | add residual and save
- lea.l (-6*4, %a0), %a0 | history pointer points at second element
+ lea.l (-6*4, %a0), %a0 | point history back at second element
subq.l #1, %d0 | decrement counter
jne .loop8 | are we done?
jra .exit