[Mplayer-cvslog] CVS: main/mp3lib bswap.h,NONE,1.1 sr1.c,1.4,1.5

Nick Kurshev nickols_k at users.sourceforge.net
Wed Jun 6 11:33:38 CEST 2001


Update of /cvsroot/mplayer/main/mp3lib
In directory usw-pr-cvs1:/tmp/cvs-serv27964/main/mp3lib

Modified Files:
	sr1.c 
Added Files:
	bswap.h 
Log Message:
Minor optimization

--- NEW FILE ---
/* Let it be for now*/
#include "../libac3/bswap.h"
Index: sr1.c
===================================================================
RCS file: /cvsroot/mplayer/main/mp3lib/sr1.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** sr1.c	2001/05/09 07:55:32	1.4
--- sr1.c	2001/06/06 09:33:36	1.5
***************
*** 25,29 ****
  #include "huffman.h"
  #include "mp3.h"
! 
  #include "d_cpu.h"
  
--- 25,29 ----
  #include "huffman.h"
  #include "mp3.h"
! #include "bswap.h"
  #include "d_cpu.h"
  
***************
*** 123,129 ****
    if((bitsleft-=number_of_bits)<0) return 0;
    if(!number_of_bits) return 0;
!    rval = wordpointer[0];
!          rval <<= 8;
!          rval |= wordpointer[1];
           rval <<= bitindex;
           rval &= 0xffff;
--- 123,127 ----
    if((bitsleft-=number_of_bits)<0) return 0;
    if(!number_of_bits) return 0;
!   rval = bswap_16(*((unsigned short *)wordpointer));
           rval <<= bitindex;
           rval &= 0xffff;
***************
*** 160,176 ****
  LOCAL int stream_head_read(unsigned char *hbuf,unsigned long *newhead){
    if(mp3_read(hbuf,4) != 4) return FALSE;
!   *newhead = ((unsigned long) hbuf[0] << 24) |
!                    ((unsigned long) hbuf[1] << 16) |
!                    ((unsigned long) hbuf[2] << 8)  |
!                     (unsigned long) hbuf[3];
!         return TRUE;
  }
  
  LOCAL int stream_head_shift(unsigned char *hbuf,unsigned long *head){
!   memmove (&hbuf[0], &hbuf[1], 3);
    if(mp3_read(hbuf+3,1) != 1) return 0;
    *head <<= 8;
    *head |= hbuf[3];
-   *head &= 0xffffffff;
    return 1;
  }
--- 158,170 ----
  LOCAL int stream_head_read(unsigned char *hbuf,unsigned long *newhead){
    if(mp3_read(hbuf,4) != 4) return FALSE;
!   *newhead = bswap_32(*((unsigned long *)hbuf));
!   return TRUE;
  }
  
  LOCAL int stream_head_shift(unsigned char *hbuf,unsigned long *head){
!   *((unsigned long *)hbuf) >>= 8;
    if(mp3_read(hbuf+3,1) != 1) return 0;
    *head <<= 8;
    *head |= hbuf[3];
    return 1;
  }
***************
*** 183,189 ****
  
      // head_check:
!     if( (newhead & 0xffe00000) != 0xffe00000)   return FALSE;
!     if( ((newhead>>12)&0xf) == 0xf)     return FALSE;
!     if( ((newhead>>10)&0x3) == 0x3 )    return FALSE;
  
      fr->lay = 4-((newhead>>17)&3);
--- 177,182 ----
  
      // head_check:
!     if( (newhead & 0xffe00000) != 0xffe00000 ||  
!         (newhead & 0x0000f300) == 0x0000f300) return FALSE;
  
      fr->lay = 4-((newhead>>17)&3);


_______________________________________________
Mplayer-cvslog mailing list
Mplayer-cvslog at lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/mplayer-cvslog



More information about the MPlayer-cvslog mailing list