[Mplayer-cvslog] CVS: main alaw.c,1.1.1.1,1.2
GEREOFFY
arpi_esp at users.sourceforge.net
Fri May 11 03:20:24 CEST 2001
Update of /cvsroot/mplayer/main
In directory usw-pr-cvs1:/tmp/cvs-serv5106
Modified Files:
alaw.c
Log Message:
uLaw support
Index: alaw.c
===================================================================
RCS file: /cvsroot/mplayer/main/alaw.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -r1.1.1.1 -r1.2
*** alaw.c 2001/02/24 20:28:23 1.1.1.1
--- alaw.c 2001/05/11 01:20:22 1.2
***************
*** 7,11 ****
#define xaUBYTE unsigned char
! xaULONG long xa_alaw_2_sign[256];
void Gen_aLaw_2_Signed()
--- 7,56 ----
#define xaUBYTE unsigned char
! //xaULONG long xa_alaw_2_sign[256];
! xaULONG xa_alaw_2_sign[256];
! xaULONG xa_ulaw_2_sign[256];
!
! /*
! ** This routine converts from ulaw to 16 bit linear.
! **
! ** Craig Reese: IDA/Supercomputing Research Center
! ** 29 September 1989
! **
! ** References:
! ** 1) CCITT Recommendation G.711 (very difficult to follow)
! ** 2) MIL-STD-188-113,"Interoperability and Performance Standards
! ** for Analog-to_Digital Conversion Techniques,"
! ** 17 February 1987
! **
! ** Input: 8 bit ulaw sample
! ** Output: signed 16 bit linear sample
! */
!
! xaLONG XA_uLaw_to_Signed( ulawbyte )
! xaUBYTE ulawbyte;
! {
! static int exp_lut[8] = { 0, 132, 396, 924, 1980, 4092, 8316, 16764 };
! int sign, exponent, mantissa, sample;
!
! ulawbyte = ~ ulawbyte;
! sign = ( ulawbyte & 0x80 );
! exponent = ( ulawbyte >> 4 ) & 0x07;
! mantissa = ulawbyte & 0x0F;
! sample = exp_lut[exponent] + ( mantissa << ( exponent + 3 ) );
! if ( sign != 0 ) sample = -sample;
!
! return sample;
! }
!
! void Gen_uLaw_2_Signed()
! { xaULONG i;
! for(i=0;i<256;i++)
! { xaUBYTE data = (xaUBYTE)(i);
! xaLONG d = XA_uLaw_to_Signed( data );
! xa_ulaw_2_sign[i] = (xaULONG)((xaULONG)(d) & 0xffff);
! }
! }
!
!
void Gen_aLaw_2_Signed()
_______________________________________________
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