[xiph-commits] r17843 - trunk/theora/examples
giles at svn.xiph.org
giles at svn.xiph.org
Tue Feb 15 09:19:13 PST 2011
Author: giles
Date: 2011-02-15 09:19:12 -0800 (Tue, 15 Feb 2011)
New Revision: 17843
Modified:
trunk/theora/examples/player_example.c
trunk/theora/examples/png2theora.c
trunk/theora/examples/splayer.c
Log:
Remove trailing whitespace from some examples.
Modified: trunk/theora/examples/player_example.c
===================================================================
--- trunk/theora/examples/player_example.c 2011-02-15 11:44:08 UTC (rev 17842)
+++ trunk/theora/examples/player_example.c 2011-02-15 17:19:12 UTC (rev 17843)
@@ -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);
Modified: trunk/theora/examples/png2theora.c
===================================================================
--- trunk/theora/examples/png2theora.c 2011-02-15 11:44:08 UTC (rev 17842)
+++ trunk/theora/examples/png2theora.c 2011-02-15 17:19:12 UTC (rev 17843)
@@ -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);
Modified: trunk/theora/examples/splayer.c
===================================================================
--- trunk/theora/examples/splayer.c 2011-02-15 11:44:08 UTC (rev 17842)
+++ trunk/theora/examples/splayer.c 2011-02-15 17:19:12 UTC (rev 17843)
@@ -378,7 +378,7 @@
* Allocates PASTREAMIO_Stream structure.
*
* flags parameter can be an ORed combination of:
- * PABLIO_WRITE,
+ * PABLIO_WRITE,
* and either PABLIO_MONO or PABLIO_STEREO
*/
PaError OpenAudioStream( PASTREAMIO_Stream **rwblPtr, double sampleRate,
@@ -424,7 +424,7 @@
{
err = PASTREAMIO_InitFIFO( &aStream->outFIFO, numFrames, aStream->bytesPerFrame );
if( err != paNoError ) goto error;
- /* Make Write FIFO appear full initially.
+ /* Make Write FIFO appear full initially.
numBytes = RingBuffer_GetWriteAvailable( &aStream->outFIFO );
RingBuffer_AdvanceWriteIndex( &aStream->outFIFO, numBytes );*/
}
@@ -642,7 +642,7 @@
printf("Unable to initialize SDL: %s\n", SDL_GetError());
exit(1);
}
-
+
screen = SDL_SetVideoMode(ti.frame_width, ti.frame_height, 0, SDL_SWSURFACE);
if ( screen == NULL ) {
printf("Unable to set %dx%d video mode: %s\n",
More information about the commits
mailing list