summaryrefslogtreecommitdiff
path: root/firmware/mpeg.c
diff options
context:
space:
mode:
authorLinus Nielsen Feltzing <linus@haxx.se>2002-08-01 08:16:44 +0000
committerLinus Nielsen Feltzing <linus@haxx.se>2002-08-01 08:16:44 +0000
commit1d21ca902303b559999418ea260103ec37b026de (patch)
treee2a8dfe7014cddd0bce44f8ebf0e1492ab20e6ea /firmware/mpeg.c
parent364783a3d51ab7c4b2a1e806878348035b672584 (diff)
downloadrockbox-1d21ca902303b559999418ea260103ec37b026de.tar.gz
rockbox-1d21ca902303b559999418ea260103ec37b026de.zip
Moved bitswap() to internal RAM
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@1502 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/mpeg.c')
-rw-r--r--firmware/mpeg.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/firmware/mpeg.c b/firmware/mpeg.c
index e61f794161..947098639a 100644
--- a/firmware/mpeg.c
+++ b/firmware/mpeg.c
@@ -468,6 +468,7 @@ static void dma_tick(void)
468 } 468 }
469} 469}
470 470
471static void bitswap(unsigned short *data, int length) __attribute__ ((section (".icode")));
471static void bitswap(unsigned short *data, int length) 472static void bitswap(unsigned short *data, int length)
472{ 473{
473 int i = length; 474 int i = length;
@@ -636,6 +637,7 @@ static void mpeg_thread(void)
636 int unplayed_space_left; 637 int unplayed_space_left;
637 int amount_to_read; 638 int amount_to_read;
638 int amount_to_swap; 639 int amount_to_swap;
640 int t1, t2;
639 641
640 play_pending = false; 642 play_pending = false;
641 playing = false; 643 playing = false;
@@ -782,8 +784,11 @@ static void mpeg_thread(void)
782 amount_to_swap); 784 amount_to_swap);
783 785
784 DEBUGF("B %x\n", amount_to_swap); 786 DEBUGF("B %x\n", amount_to_swap);
787 t1 = current_tick;
785 bitswap((unsigned short *)(mp3buf + mp3buf_swapwrite), 788 bitswap((unsigned short *)(mp3buf + mp3buf_swapwrite),
786 (amount_to_swap+1)/2); 789 (amount_to_swap+1)/2);
790 t2 = current_tick;
791 DEBUGF("time: %d\n", t2 - t1);
787 792
788 mp3buf_swapwrite += amount_to_swap; 793 mp3buf_swapwrite += amount_to_swap;
789 if(mp3buf_swapwrite >= mp3buflen) 794 if(mp3buf_swapwrite >= mp3buflen)
@@ -858,9 +863,12 @@ static void mpeg_thread(void)
858 if(mpeg_file >= 0) 863 if(mpeg_file >= 0)
859 { 864 {
860 DEBUGF("R\n"); 865 DEBUGF("R\n");
866 t1 = current_tick;
861 len = read(mpeg_file, mp3buf+mp3buf_write, amount_to_read); 867 len = read(mpeg_file, mp3buf+mp3buf_write, amount_to_read);
862 if(len > 0) 868 if(len > 0)
863 { 869 {
870 t2 = current_tick;
871 DEBUGF("time: %d\n", t2 - t1);
864 DEBUGF("R: %x\n", len); 872 DEBUGF("R: %x\n", len);
865 /* Tell ourselves that we need to swap some data */ 873 /* Tell ourselves that we need to swap some data */
866 queue_post(&mpeg_queue, MPEG_SWAP_DATA, 0); 874 queue_post(&mpeg_queue, MPEG_SWAP_DATA, 0);