]> hackdaworld.org Git - my-code/beginners.git/commitdiff
vbitrate calculator
authorhackbard <hackbard>
Wed, 10 Dec 2003 22:20:19 +0000 (22:20 +0000)
committerhackbard <hackbard>
Wed, 10 Dec 2003 22:20:19 +0000 (22:20 +0000)
br_calc.c [new file with mode: 0644]

diff --git a/br_calc.c b/br_calc.c
new file mode 100644 (file)
index 0000000..68fbed4
--- /dev/null
+++ b/br_calc.c
@@ -0,0 +1,29 @@
+#include <stdio.h>
+#include <stdlib.h>
+
+#define CD (700*1024*8)
+
+int main(int argc, char **argv) {
+
+ int time;
+ int cds;
+ int abitrate;
+
+ if (argc!=4) {
+  puts("usage: %s <#cd's> <movie dureation in minuites> <audi kb/s>");
+  return -1;
+ }
+
+ time=atoi(argv[2]);
+ cds=atoi(argv[1]);
+ abitrate=atoi(argv[3]);
+
+ /* time in seconds */
+ time*=60;
+
+ printf("use %d kb/s as vbitrate when encoding with %d kb/s of audiodata!\n",
+               ((cds*CD)/time)-abitrate,
+               abitrate);
+
+ return 1;
+}