[xiph-commits] r14560 - in experimental/ribamar/etheora: examples src

ribamar at svn.xiph.org ribamar at svn.xiph.org
Sat Mar 8 22:45:26 PST 2008


Author: ribamar
Date: 2008-03-08 22:45:25 -0800 (Sat, 08 Mar 2008)
New Revision: 14560

Modified:
   experimental/ribamar/etheora/examples/encoder-example.c
   experimental/ribamar/etheora/src/etheora.c
Log:
fixing aspect ratio bug

Modified: experimental/ribamar/etheora/examples/encoder-example.c
===================================================================
--- experimental/ribamar/etheora/examples/encoder-example.c	2008-03-09 03:50:05 UTC (rev 14559)
+++ experimental/ribamar/etheora/examples/encoder-example.c	2008-03-09 06:45:25 UTC (rev 14560)
@@ -46,7 +46,8 @@
 	fprintf(stderr, "debug info in Debug.txt.\n"); 
 
 	/* configuring encoder: 640x480 video 12/1 frames per second. */
-	etheora_enc_setup(&ec, 640, 480, ETHEORA_ASPECT_NORMAL, 
+	//etheora_enc_setup(&ec, 640, 480, ETHEORA_ASPECT_NORMAL, 
+	etheora_enc_setup(&ec, 640, 480, ETHEORA_ASPECT_WIDE_SCREEN, 
 				12, 1, fout, finfo);
 
 	/* last chance to change theora parameters before encoding.

Modified: experimental/ribamar/etheora/src/etheora.c
===================================================================
--- experimental/ribamar/etheora/src/etheora.c	2008-03-09 03:50:05 UTC (rev 14559)
+++ experimental/ribamar/etheora/src/etheora.c	2008-03-09 06:45:25 UTC (rev 14560)
@@ -211,18 +211,16 @@
 	ti->frame_width = frame_width;
 	ti->frame_height = frame_height;
 	ti->offset_x = ti->offset_y = 0;
-	ti->aspect_numerator = frame_width;
-	ti->aspect_denominator = frame_height;
+	ti->aspect_numerator = 1;
+	ti->aspect_denominator = 1;
 	if(aspect ==  ETHEORA_ASPECT_NORMAL){
-		ti->aspect_numerator = 4;
-		ti->aspect_denominator = 3;
+		ti->aspect_numerator = 4 * frame_height;
+		ti->aspect_denominator = 3 * frame_width;
 	}
 	if(aspect ==  ETHEORA_ASPECT_WIDE_SCREEN){
-		ti->aspect_numerator = 16;
-		ti->aspect_denominator = 9;
+		ti->aspect_numerator = 16 * frame_height;
+		ti->aspect_denominator = 9 * frame_width;
 	}
-		ti->aspect_numerator = 1;
-		ti->aspect_denominator = 1;
 	ti->fps_numerator = fps_numerator;
 	ti->fps_denominator = fps_denominator;
 	ti->colorspace = ETHEORA_TINFO_COLORSPACE;  //OC_CS_UNSPECIFIED;



More information about the commits mailing list