Hello,
I'm not sure if this list is the proper place for this post; please
correct me if it is not.
I am attempting to use libtheora and I have been looking through the
examples in the distribution
Excerpt from encoder_example.c --
case 'V':
video_r=rint(atof(optarg)*1000);
if(video_r<45000 || video_r>2000000) {
fprintf(stderr,"Illegal video bitrate (choose 45kbps through
2000kbps)\n");
exit(1);
}
video_q=0;
break;
I assume 'kbps' is Kilobits Per Second (kbit/s) and
*theora_info.target_bitrate* is in Bits Per Second.
If this is true then shouldn't the argument (optarg) be multiplied by
1024 and not 1000? Or does it matter?
Thanks,
Draco
draco@dragonsguild.net
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://lists.xiph.org/pipermail/theora-dev/attachments/20050805/53b51693/attachment.htm
On Fri, Aug 05, 2005 at 01:52:14AM -0500, Draco wrote:> I assume 'kbps' is Kilobits Per Second (kbit/s) and > *theora_info.target_bitrate* is in Bits Per Second. > If this is true then shouldn't the argument (optarg) be multiplied by > 1024 and not 1000? Or does it matter?Well, it doesn't really matter, but traditionally bitrates are in base 10 units instead of base 2 like filesize. So a kilobyte of data is 1024 bytes, but 1 kbps is 1000 bits per second. so at 1 kbps it takes 8.192 seconds to send 1 kilobyte. I think it's because the use of kbps in digital telecommunications predates/evolved separately from the standardization on powers of 2 in computer data storage. All of which makes the practice of using powers of 2 in compressed audio bitrates quite strange. A 128 kbps MP3 file is 128000 bits per second, or 2^7 * 10^3, not 2^17 or 131072 bits per second. -r