added string2hex prog (usefull for wep key)
[my-code/beginners.git] / br_calc.c
1 #include <stdio.h>
2 #include <stdlib.h>
3
4 #define CD (700*1024*8)
5
6 int main(int argc, char **argv) {
7
8  int time;
9  int cds;
10  int abitrate;
11
12  if (argc!=4) {
13   puts("usage: %s <#cd's> <movie dureation in minuites> <audi kb/s>");
14   return -1;
15  }
16
17  time=atoi(argv[2]);
18  cds=atoi(argv[1]);
19  abitrate=atoi(argv[3]);
20
21  /* time in seconds */
22  time*=60;
23
24  printf("use %d kb/s as vbitrate when encoding with %d kb/s of audiodata!\n",
25                 ((cds*CD)/time)-abitrate,
26                 abitrate);
27
28  return 1;
29 }