Add support for VDPAU video out, including hardware decoding.
[mplayer/glamo.git] / TOOLS / alaw-gen.c
blob0f32ad4d8789bed23c4d7806cc7a9f174dda4fe3
1 #include <stdio.h>
2 #include <stdlib.h>
4 // sox -t raw -A -r 8000 -b alaw.alaw -t sw alaw.out
6 int main(void){
7 int i;
8 FILE *f;
10 f=fopen("alaw.dat","wb");
11 for(i=0;i<256;i++) fwrite(&i,1,1,f);
12 fclose(f);
14 system("sox -t raw -A -r 8000 -b alaw.dat -t sw alaw.out");
16 printf("// Generated by TOOLS/alaw-gen.c\n\n");
18 printf("#ifndef MPLAYER_ALAW_H\n");
19 printf("#define MPLAYER_ALAW_H\n");
21 printf("\nconst short alaw2short[]={\n");
23 f=fopen("alaw.out","rb");
24 for(i=0;i<256;i++){
25 signed short x;
26 fread(&x,2,1,f);
27 printf("%7d",x);
28 if(i!=255) putchar(',');
29 if((i&7)==7) printf("\n");
31 fclose(f);
32 printf("};\n");
34 system("sox -t raw -U -r 8000 -b alaw.dat -t sw alaw.out");
36 printf("\nconst short ulaw2short[]={\n");
38 f=fopen("alaw.out","rb");
39 for(i=0;i<256;i++){
40 signed short x;
41 fread(&x,2,1,f);
42 printf("%7d",x);
43 if(i!=255) putchar(',');
44 if((i&7)==7) printf("\n");
46 fclose(f);
47 printf("};\n\n");
49 printf("#endif /* MPLAYER_ALAW_H */\n");
51 return 0;