[xiph-commits] r7358 - trunk/theora/examples

tterribe at dactyl.lonelymoon.com tterribe
Mon Jul 26 18:08:14 PDT 2004


Author: tterribe
Date: Mon Jul 26 18:08:14 2004
New Revision: 7358

Modified:
trunk/theora/examples/encoder_example.c
Log:
Change padding offsets to always be even, cf. the recommendation in
Section 4.4.4 of the spec.


Modified: trunk/theora/examples/encoder_example.c
===================================================================
--- trunk/theora/examples/encoder_example.c	2004-07-27 00:40:03 UTC (rev 7357)
+++ trunk/theora/examples/encoder_example.c	2004-07-27 01:08:13 UTC (rev 7358)
@@ -618,8 +618,11 @@
/* scale the frame size up to the nearest /16 and calculate offsets */
video_x=((frame_x + 15) >>4)<<4;
video_y=((frame_y + 15) >>4)<<4;
-  frame_x_offset=(video_x-frame_x)/2;
-  frame_y_offset=(video_y-frame_y)/2;
+  /* We force the offset to be even.
+     This ensures that the chroma samples align properly with the luma
+      samples. */
+  frame_x_offset=((video_x-frame_x)/2)&~1;
+  frame_y_offset=((video_y-frame_y)/2)&~1;

theora_info_init(&ti);
ti.width=video_x;



More information about the commits mailing list