[xiph-commits] r15534 - branches/theora-thusnelda/examples

giles at svn.xiph.org giles at svn.xiph.org
Tue Nov 25 15:57:55 PST 2008


Author: giles
Date: 2008-11-25 15:57:54 -0800 (Tue, 25 Nov 2008)
New Revision: 15534

Modified:
   branches/theora-thusnelda/examples/encoder_example.c
Log:
Remove the limits on the the video rate target in the encoder example.

I don't know why these are here, but thusnelda doesn't have any rate 
control at all, so they are unnecessary. Furthermore, 2 Mbps is too
low for much HD and larger content, so it's better to remove them
with the expectation that a wider range will be acceptable to the final 
encoder.

The file format itself records the target bitrate in the ident header, 
but this field is limited to 24 bits in units of bits per second, for
a maximum of 16 Mbps. Another reason this field isn't very useful. 

Because of this, the ui will warn about clamping to 16 Mbps if a larger 
value is requested. This is, in fact, what the current code does in
theora_encode_init().


Modified: branches/theora-thusnelda/examples/encoder_example.c
===================================================================
--- branches/theora-thusnelda/examples/encoder_example.c	2008-11-25 17:27:58 UTC (rev 15533)
+++ branches/theora-thusnelda/examples/encoder_example.c	2008-11-25 23:57:54 UTC (rev 15534)
@@ -723,10 +723,13 @@
 
     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");
+      if(video_r<0){
+        fprintf(stderr,"Illegal video bitrate (choose > 0 please)\n");
         exit(1);
       }
+      if(video_r>(1<<24)-1){
+        fprintf(stderr,"Warning: encoder may limit video to 16 Mbps\n");
+      }
       video_q=0;
      break;
 



More information about the commits mailing list