[xiph-commits] r11072 - experimental/j/ffmpeg2theora-exp

j at svn.xiph.org j at svn.xiph.org
Thu Mar 30 14:48:22 PST 2006


Author: j
Date: 2006-03-30 14:48:19 -0800 (Thu, 30 Mar 2006)
New Revision: 11072

Modified:
   experimental/j/ffmpeg2theora-exp/ffmpeg2theora.c
   experimental/j/ffmpeg2theora-exp/theorautils.c
   experimental/j/ffmpeg2theora-exp/theorautils.h
Log:
update to new theora-exp api, though the rest f2t-exp would needs
some updating too..



Modified: experimental/j/ffmpeg2theora-exp/ffmpeg2theora.c
===================================================================
--- experimental/j/ffmpeg2theora-exp/ffmpeg2theora.c	2006-03-30 22:36:54 UTC (rev 11071)
+++ experimental/j/ffmpeg2theora-exp/ffmpeg2theora.c	2006-03-30 22:48:19 UTC (rev 11072)
@@ -431,7 +431,7 @@
             /* video settings here */
             /* config file? commandline options? v2v presets? */
             
-            theora_info_init (&info.ti);
+            th_info_init (&info.ti);
             
             info.ti.frame_width = this->frame_width;  
             info.ti.frame_height = this->frame_height;  
@@ -450,14 +450,14 @@
             /* this is pixel aspect ratio */
             info.ti.aspect_numerator=this->aspect_numerator;
             info.ti.aspect_denominator=this->aspect_denominator;
-            // FIXME: is all input material with fps==25 OC_CS_ITU_REC_470BG?
+            // FIXME: is all input material with fps==25 TH_CS_ITU_REC_470BG?
             // guess not, commandline option to select colorspace would be the best.
             if(this->fps==25)
-                info.ti.colorspace = OC_CS_ITU_REC_470BG;
+                info.ti.colorspace = TH_CS_ITU_REC_470BG;
             else if(abs(this->fps-30)<1)
-                info.ti.colorspace = OC_CS_ITU_REC_470M;
+                info.ti.colorspace = TH_CS_ITU_REC_470M;
             else
-                info.ti.colorspace = OC_CS_UNSPECIFIED;
+                info.ti.colorspace = TH_CS_UNSPECIFIED;
 
             info.ti.target_bitrate = this->video_bitrate; 
             info.ti.quality = this->video_quality;
@@ -473,7 +473,7 @@
             // range 0-2, 0 sharp, 2 less sharp,less bandwidth
             info.ti.sharpness = this->sharpness;
 */
-            info.ti.pixel_fmt=OC_PF_420;
+            info.ti.pixel_fmt=TH_PF_420;
             info.ti.keyframe_granule_shift=6;
         }
         /* audio settings here */
@@ -580,7 +580,7 @@
                     first=0;
                     //now output_resized
                     /* pysical pages */
-                    static theora_ycbcr_buffer ycbcr;
+                    static th_ycbcr_buffer ycbcr;
                     /* Theora is a one-frame-in,one-frame-out system; submit a frame
                      * for compression and pull out the packet */
                     ycbcr[0].width = this->frame_width;
@@ -882,7 +882,7 @@
     }
     // set some variables;
     init_info(&info);
-    theora_comment_init (&info.tc);
+    th_comment_init (&info.tc);
     
     while((c=getopt_long(argc,argv,optstring,options,&long_option_index))!=EOF){
         switch(c)
@@ -944,25 +944,25 @@
                 if (metadata_flag){
                     switch(metadata_flag) {
                         case 10:
-                            theora_comment_add_tag(&info.tc, "ARTIST", optarg);
+                            th_comment_add_tag(&info.tc, "ARTIST", optarg);
                             break;
                         case 11:
-                            theora_comment_add_tag(&info.tc, "TITLE", optarg);
+                            th_comment_add_tag(&info.tc, "TITLE", optarg);
                             break;
                         case 12:
-                            theora_comment_add_tag(&info.tc, "DATE", optarg);
+                            th_comment_add_tag(&info.tc, "DATE", optarg);
                             break;
                         case 13:
-                            theora_comment_add_tag(&info.tc, "LOCATION", optarg);
+                            th_comment_add_tag(&info.tc, "LOCATION", optarg);
                             break;
                         case 14:
-                            theora_comment_add_tag(&info.tc, "ORGANIZATION", optarg);
+                            th_comment_add_tag(&info.tc, "ORGANIZATION", optarg);
                             break;
                         case 15:
-                            theora_comment_add_tag(&info.tc, "COPYRIGHT", optarg);
+                            th_comment_add_tag(&info.tc, "COPYRIGHT", optarg);
                             break;
                         case 16:
-                            theora_comment_add_tag(&info.tc, "LICENSE", optarg);
+                            th_comment_add_tag(&info.tc, "LICENSE", optarg);
                             break;
                     }
                     metadata_flag=0;

Modified: experimental/j/ffmpeg2theora-exp/theorautils.c
===================================================================
--- experimental/j/ffmpeg2theora-exp/theorautils.c	2006-03-30 22:36:54 UTC (rev 11071)
+++ experimental/j/ffmpeg2theora-exp/theorautils.c	2006-03-30 22:48:19 UTC (rev 11072)
@@ -59,8 +59,8 @@
     
     if(!info->audio_only){
         ogg_stream_init (&info->to, rand ());    /* oops, add one ot the above */
-        info->td=theora_encode_alloc(&info->ti);
-        theora_info_clear (&info->ti);
+        info->td=th_encode_alloc(&info->ti);
+        th_info_clear (&info->ti);
     }
     /* init theora done */
 
@@ -94,9 +94,9 @@
 
     /* first packet will get its own page automatically */
     if(!info->audio_only){
-        theora_comment_init(&info->tc);  
-        theora_comment_add_tag (&info->tc, "ENCODER",PACKAGE_STRING);  
-        if(theora_encode_flushheader(info->td,&info->tc,&op)<=0){  
+        th_comment_init(&info->tc);  
+        th_comment_add_tag (&info->tc, "ENCODER",PACKAGE_STRING);  
+        if(th_encode_flushheader(info->td,&info->tc,&op)<=0){  
             fprintf(stderr,"Internal Theora library error.\n");  
             exit(1);  
         }  
@@ -110,7 +110,7 @@
  	 
         /* create the remaining theora headers */  
         for(;;){  
-            ret = theora_encode_flushheader(info->td,&info->tc,&op);  
+            ret = th_encode_flushheader(info->td,&info->tc,&op);  
             if(ret<0){  
                 fprintf(stderr,"Internal Theora library error.\n");  
                 exit(1);  
@@ -177,11 +177,11 @@
  * @param yuv_buffer
  * @param e_o_s 1 indicates ond of stream
  */
-void oggmux_add_video (oggmux_info *info, theora_ycbcr_buffer ycbcr, int e_o_s){
+void oggmux_add_video (oggmux_info *info, th_ycbcr_buffer ycbcr, int e_o_s){
     ogg_packet op;
     
-    theora_encode_ycbcr_in(info->td,ycbcr);  
-    while(theora_encode_packetout(info->td, e_o_s, &op)) {  
+    th_encode_ycbcr_in(info->td,ycbcr);  
+    while(th_encode_packetout(info->td, e_o_s, &op)) {  
         ogg_stream_packetin (&info->to, &op);  
     }
 }
@@ -294,7 +294,7 @@
           memcpy(info->videopage+og.header_len , og.body, og.body_len);
 
           info->videopage_valid = 1;
-          info->videotime = theora_granule_time (info->td,
+          info->videotime = th_granule_time (info->td,
                   ogg_page_granulepos(&og));
         }
       }
@@ -352,7 +352,7 @@
     vorbis_info_clear (&info->vi);
 
     ogg_stream_clear (&info->to);
-    theora_encode_free (info->td);
+    th_encode_free (info->td);
 
     if (info->outfile && info->outfile != stdout)
         fclose (info->outfile);

Modified: experimental/j/ffmpeg2theora-exp/theorautils.h
===================================================================
--- experimental/j/ffmpeg2theora-exp/theorautils.h	2006-03-30 22:36:54 UTC (rev 11071)
+++ experimental/j/ffmpeg2theora-exp/theorautils.h	2006-03-30 22:48:19 UTC (rev 11072)
@@ -45,10 +45,10 @@
 
     /* theora settings */
     theora_info ti;
-    theora_comment tc;
+    th_comment tc;
 
     /* state info */    
-    theora_enc_ctx *td;
+    th_enc_ctx *td;
     vorbis_dsp_state vd; /* central working state for the packet->PCM decoder */
     vorbis_block vb;     /* local working space for packet->PCM decode */
 
@@ -79,7 +79,7 @@
 
 extern void init_info(oggmux_info *info);
 extern void oggmux_init (oggmux_info *info);
-extern void oggmux_add_video (oggmux_info *info, theora_ycbcr_buffer ycbcr, int e_o_s);
+extern void oggmux_add_video (oggmux_info *info, th_ycbcr_buffer ycbcr, int e_o_s);
 extern void oggmux_add_audio (oggmux_info *info, int16_t * readbuffer, int bytesread, int samplesread,int e_o_s);
 extern void oggmux_flush (oggmux_info *info, int e_o_s);
 extern void oggmux_close (oggmux_info *info);



More information about the commits mailing list