[xiph-commits] r17974 - branches/theora-1.1/examples

giles at svn.xiph.org giles at svn.xiph.org
Sat May 7 15:31:49 PDT 2011


Author: giles
Date: 2011-05-07 15:31:49 -0700 (Sat, 07 May 2011)
New Revision: 17974

Modified:
   branches/theora-1.1/examples/dump_psnr.c
   branches/theora-1.1/examples/player_example.c
   branches/theora-1.1/examples/png2theora.c
Log:
Merge whitespace cleanup in the examples from trunk.


Modified: branches/theora-1.1/examples/dump_psnr.c
===================================================================
--- branches/theora-1.1/examples/dump_psnr.c	2011-05-07 22:23:45 UTC (rev 17973)
+++ branches/theora-1.1/examples/dump_psnr.c	2011-05-07 22:31:49 UTC (rev 17974)
@@ -10,8 +10,8 @@
  *                                                                  *
  ********************************************************************
 
-  function: example dumpvid application; dumps  Theora streams
-  last mod: $Id: dump_video.c 15675 2009-02-06 09:43:27Z tterribe $
+  function: example dumpvid application; dumps Theora streams
+  last mod: $Id$
 
  ********************************************************************/
 
@@ -1043,7 +1043,7 @@
 
 static void usage(char *_argv[]){
   fprintf(stderr,"Usage: %s [options] <video1> <video2>\n"
-   "    <video1> and <video1> may be either YUV4MPEG or Ogg Theora files.\n\n"
+   "    <video1> and <video2> may be either YUV4MPEG or Ogg Theora files.\n\n"
    "    Options:\n\n"
    "      -f --frame-type Show frame type and QI value for each Theora frame.\n"
    "      -s --summary    Only output the summary line.\n"


Property changes on: branches/theora-1.1/examples/dump_psnr.c
___________________________________________________________________
Added: svn:keywords
   + Id
Added: svn:mergeinfo
   + /experimental/derf/theora-ptalarbvorm/examples/dump_psnr.c:16806-17444
/trunk/theora/examples/dump_psnr.c:14138-15320,15741,17445-17973
Added: svn:eol-style
   + native

Modified: branches/theora-1.1/examples/player_example.c
===================================================================
--- branches/theora-1.1/examples/player_example.c	2011-05-07 22:23:45 UTC (rev 17973)
+++ branches/theora-1.1/examples/player_example.c	2011-05-07 22:31:49 UTC (rev 17974)
@@ -337,7 +337,7 @@
     yuv_overlay = SDL_CreateYUVOverlay(w, h,
                                      SDL_YV12_OVERLAY,
                                      screen);
-  
+
   if ( (yuv_overlay == NULL && px_fmt!=TH_PF_444) || (screen == NULL && px_fmt==TH_PF_444) ) {
     fprintf(stderr, "SDL: xCouldn't create SDL_yuv_overlay: %s\n",
             SDL_GetError());
@@ -373,7 +373,7 @@
 
   if (px_fmt==TH_PF_422) {
     uv_offset=(ti.pic_x/2)+(yuv[1].stride)*(ti.pic_y);
-    /* SDL doesn't have a planar 4:2:2 */ 
+    /* SDL doesn't have a planar 4:2:2 */
     for(i=0;i<yuv_overlay->h;i++) {
       int j;
       char *in_y  = (char *)yuv[0].data+y_offset+yuv[0].stride*i;
@@ -404,7 +404,7 @@
         out[4*j+0]=OC_CLAMP255(b);
         out[4*j+1]=OC_CLAMP255(g);
         out[4*j+2]=OC_CLAMP255(r);
-      }  
+      }
       output=SDL_CreateRGBSurfaceFrom(RGBbuffer,screen->w,screen->h,32,4*screen->w,0,0,0,0);
       SDL_BlitSurface(output,NULL,screen,NULL);
     }
@@ -432,7 +432,7 @@
     SDL_UnlockYUVOverlay(yuv_overlay);
     /* Show, baby, show! */
     SDL_DisplayYUVOverlay(yuv_overlay, &rect);
-  } else { 
+  } else {
     SDL_Flip(screen);
   }
 }
@@ -667,9 +667,9 @@
     th_info_clear(&ti);
     th_comment_clear(&tc);
   }
-  
+
   th_setup_free(ts);
-  
+
   if(vorbis_p){
     vorbis_synthesis_init(&vd,&vi);
     vorbis_block_init(&vd,&vb);


Property changes on: branches/theora-1.1/examples/player_example.c
___________________________________________________________________
Added: svn:mergeinfo
   + /experimental/derf/theora-ptalarbvorm/examples/player_example.c:16806-17444
/trunk/theora/examples/player_example.c:14138-15320,15741,17445-17972

Modified: branches/theora-1.1/examples/png2theora.c
===================================================================
--- branches/theora-1.1/examples/png2theora.c	2011-05-07 22:23:45 UTC (rev 17973)
+++ branches/theora-1.1/examples/png2theora.c	2011-05-07 22:31:49 UTC (rev 17974)
@@ -60,9 +60,9 @@
 
 static FILE *ogg_fp = NULL;
 static ogg_stream_state ogg_os;
-static ogg_packet op;   
+static ogg_packet op;
 static ogg_page og;
-    
+
 static th_enc_ctx      *td;
 static th_info          ti;
 
@@ -85,8 +85,8 @@
  {"keyframe-freq",required_argument,NULL,'k'},
  {"buf-delay",required_argument,NULL,'d'},
  {"two-pass",no_argument,NULL,'\2'},
- {"first-pass",required_argument,NULL,'\3'}, 
- {"second-pass",required_argument,NULL,'\4'},  
+ {"first-pass",required_argument,NULL,'\3'},
+ {"second-pass",required_argument,NULL,'\4'},
  {NULL,0,NULL,0}
 };
 
@@ -131,7 +131,7 @@
           "                                  two-pass encoding.\n"
           "  --chroma-444                    Use 4:4:4 chroma subsampling\n"
           "  --chroma-422                    Use 4:2:2 chroma subsampling\n"
-          "                                  (4:2:0 is default)\n\n" 
+          "                                  (4:2:0 is default)\n\n"
           "  -s --aspect-numerator <n>       Aspect ratio numerator, default is 0\n"
           "  -S --aspect-denominator <n>     Aspect ratio denominator, default is 0\n"
           "  -f --framerate-numerator <n>    Frame rate numerator\n"
@@ -182,7 +182,7 @@
   if (i == 0) return(-1);
   if (compar != NULL)
     qsort((void *)(*namelist), (size_t)i, sizeof(struct dirent *), compar);
-    
+
   return(i);
 }
 #endif
@@ -256,13 +256,13 @@
     return 1;
   }
 
-  if (passno!=1) { 
+  if (passno!=1) {
     ogg_stream_packetin(&ogg_os, &op);
     while(ogg_stream_pageout(&ogg_os, &og)) {
       fwrite(og.header, og.header_len, 1, ogg_fp);
       fwrite(og.body, og.body_len, 1, ogg_fp);
     }
-  }  
+  }
 
   return 0;
 }
@@ -303,14 +303,14 @@
   yuv_y = ycbcr[0].data;
   yuv_u = ycbcr[1].data;
   yuv_v = ycbcr[2].data;
-  
+
   /*This ignores gamma and RGB primary/whitepoint differences.
     It also isn't terribly fast (though a decent compiler will
     strength-reduce the division to a multiplication).*/
 
   if (chroma_format == TH_PF_420) {
     for(y = 0; y < h; y += 2) {
-      y1=y+(y+1<h);      
+      y1=y+(y+1<h);
       for(x = 0; x < w; x += 2) {
         x1=x+(x+1<w);
         png_byte r0 = png[y][3 * x + 0];
@@ -325,12 +325,12 @@
         png_byte r3 = png[y1][3 * x1 + 0];
         png_byte g3 = png[y1][3 * x1 + 1];
         png_byte b3 = png[y1][3 * x1 + 2];
-        
+
         yuv_y[x  + y * yuv_w]  = clamp((65481*r0+128553*g0+24966*b0+4207500)/255000);
         yuv_y[x1 + y * yuv_w]  = clamp((65481*r1+128553*g1+24966*b1+4207500)/255000);
         yuv_y[x  + y1 * yuv_w] = clamp((65481*r2+128553*g2+24966*b2+4207500)/255000);
         yuv_y[x1 + y1 * yuv_w] = clamp((65481*r3+128553*g3+24966*b3+4207500)/255000);
-        
+
         yuv_u[(x >> 1) + (y >> 1) * ycbcr[1].stride] =
           clamp( ((-33488*r0-65744*g0+99232*b0+29032005)/4 +
                   (-33488*r0-65744*g0+99232*b0+29032005)/4 +
@@ -365,10 +365,10 @@
         png_byte r1 = png[y][3 * x1 + 0];
         png_byte g1 = png[y][3 * x1 + 1];
         png_byte b1 = png[y][3 * x1 + 2];
-        
+
         yuv_y[x  + y * yuv_w] = clamp((65481*r0+128553*g0+24966*b0+4207500)/255000);
         yuv_y[x1 + y * yuv_w] = clamp((65481*r1+128553*g1+24966*b1+4207500)/255000);
-        
+
         yuv_u[(x >> 1) + y * ycbcr[1].stride] =
           clamp( ((-33488*r0-65744*g0+99232*b0+29032005)/2 +
                   (-33488*r1-65744*g1+99232*b1+29032005)/2)/225930);
@@ -376,7 +376,7 @@
           clamp( ((157024*r0-131488*g0-25536*b0+45940035)/2 +
                   (157024*r1-131488*g1-25536*b1+45940035)/2)/357510);
       }
-    }    
+    }
   }
 
 }
@@ -497,7 +497,7 @@
   } else {
     if ((ycbcr[0].width != yuv_w) || (ycbcr[0].height != yuv_h)){
       fprintf(stderr, "Input size %lux%lu does not match %dx%d\n", yuv_w,yuv_h,ycbcr[0].width,ycbcr[0].height);
-      exit(1);            
+      exit(1);
     }
   }
 
@@ -525,7 +525,7 @@
   for(ret=0;_v;ret++)_v>>=1;
   return ret;
 }
-      
+
 int
 main(int argc, char *argv[])
 {
@@ -538,7 +538,7 @@
   struct dirent **png_files;
   int soft_target=0;
   int ret;
-      
+
   while(1) {
 
     c=getopt_long(argc,argv,optstring,options,&long_option_index);
@@ -714,7 +714,7 @@
       exit(1);
     }
 
-    if (passno!=2) fprintf(stderr,"%d frames, %dx%d\n",n,w,h);    
+    if (passno!=2) fprintf(stderr,"%d frames, %dx%d\n",n,w,h);
 
     /* setup complete.  Raw processing loop */
     switch(passno){
@@ -726,9 +726,9 @@
       break;
     }
 
-    fprintf(stderr, "%s\n", input_png); 
+    fprintf(stderr, "%s\n", input_png);
 
-    th_info_init(&ti);    
+    th_info_init(&ti);
     ti.frame_width = ((w + 15) >>4)<<4;
     ti.frame_height = ((h + 15)>>4)<<4;
     ti.pic_width = w;
@@ -745,7 +745,7 @@
     ti.quality = video_quality;
     ti.keyframe_granule_shift=ilog(keyframe_frequency-1);
 
-    td=th_encode_alloc(&ti);  
+    td=th_encode_alloc(&ti);
     th_info_clear(&ti);
     /* setting just the granule shift only allows power-of-two keyframe
        spacing.  Set the actual requested spacing. */
@@ -838,7 +838,7 @@
     /* first packet will get its own page automatically */
     if(th_encode_flushheader(td,&tc,&op)<=0){
       fprintf(stderr,"Internal Theora library error.\n");
-      exit(1); 
+      exit(1);
     }
     th_comment_clear(&tc);
     if(passno!=1){
@@ -893,7 +893,7 @@
           exit(1);
         }
        fprintf(stderr, "%s\n", input_png);
-      }      
+      }
     } while (!last);
 
     if(passno==1){
@@ -923,13 +923,13 @@
   if(ogg_stream_flush(&ogg_os, &og)) {
     fwrite(og.header, og.header_len, 1, ogg_fp);
     fwrite(og.body, og.body_len, 1, ogg_fp);
-  }            
+  }
 
   free(input_directory);
   free(input_filter);
 
   while (n--) free(png_files[n]);
-  free(png_files);  
+  free(png_files);
 
   if(ogg_fp){
     fflush(ogg_fp);


Property changes on: branches/theora-1.1/examples/png2theora.c
___________________________________________________________________
Added: svn:mergeinfo
   + /experimental/derf/theora-ptalarbvorm/examples/png2theora.c:16806-17444
/trunk/theora/examples/png2theora.c:14138-15320,15741,17445-17972



More information about the commits mailing list