[xiph-commits] r9234 - trunk/ffmpeg2theora

j at motherfish-iii.xiph.org j at motherfish-iii.xiph.org
Sat May 7 14:33:35 PDT 2005


Author: j
Date: 2005-05-07 14:33:30 -0700 (Sat, 07 May 2005)
New Revision: 9234

Modified:
   trunk/ffmpeg2theora/ffmpeg2theora.c
Log:
scale the frame size up to the nearest /16 and calculate offsets(fix)

Modified: trunk/ffmpeg2theora/ffmpeg2theora.c
===================================================================
--- trunk/ffmpeg2theora/ffmpeg2theora.c	2005-05-07 20:18:13 UTC (rev 9233)
+++ trunk/ffmpeg2theora/ffmpeg2theora.c	2005-05-07 21:33:30 UTC (rev 9234)
@@ -239,8 +239,10 @@
             this->picture_width = venc->width;
         if(!this->picture_height)
             this->picture_height = venc->height;
-        this->frame_width = this->picture_width + (this->picture_width % 16);        
-        this->frame_height = this->picture_height + (this->picture_height % 16);
+        /* Theora has a divisible-by-sixteen restriction for the encoded video size */
+        /* scale the frame size up to the nearest /16 and calculate offsets */
+        this->frame_width = ((this->picture_width + 15) >>4)<<4;
+        this->frame_height = ((this->picture_height + 15) >>4)<<4;
 
         this->frame_x_offset = 0;
         this->frame_y_offset = 0;



More information about the commits mailing list