[Mplayer-cvslog] CVS: main/TOOLS alaw-gen.c,NONE,1.1

GEREOFFY arpi_esp at users.sourceforge.net
Fri May 25 20:17:29 CEST 2001


Update of /cvsroot/mplayer/main/TOOLS
In directory usw-pr-cvs1:/tmp/cvs-serv7305

Added Files:
	alaw-gen.c 
Log Message:
alaw and ulaw table generator

--- NEW FILE ---
#include <stdio.h>
#include <stdlib.h>

// sox -t raw -A -r 8000 -b alaw.alaw -t sw alaw.out

int main(){
int i;
FILE *f;

f=fopen("alaw.dat","wb");
for(i=0;i<256;i++) fwrite(&i,1,1,f);
fclose(f);

system("sox -t raw -A -r 8000 -b alaw.dat -t sw alaw.out");

printf("// Generated by TOOLS/alaw-gen.c\n");

printf("\nshort alaw2short[]={\n");

f=fopen("alaw.out","rb");
for(i=0;i<256;i++){
  signed short x;
  fread(&x,2,1,f);
  printf("%6d",x);
  if(i!=255) putchar(',');
  if((i&7)==7) printf("\n");
}
fclose(f);
printf("}\n");

system("sox -t raw -U -r 8000 -b alaw.dat -t sw alaw.out");

printf("\nshort ulaw2short[]={\n");

f=fopen("alaw.out","rb");
for(i=0;i<256;i++){
  signed short x;
  fread(&x,2,1,f);
  printf("%6d",x);
  if(i!=255) putchar(',');
  if((i&7)==7) printf("\n");
}
fclose(f);
printf("}\n");


}


_______________________________________________
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