[xiph-commits] r15572 - in trunk/ffmpeg2theora: . src

j at svn.xiph.org j at svn.xiph.org
Wed Dec 10 05:21:51 PST 2008


Author: j
Date: 2008-12-10 05:21:50 -0800 (Wed, 10 Dec 2008)
New Revision: 15572

Modified:
   trunk/ffmpeg2theora/
   trunk/ffmpeg2theora/src/ffmpeg2theora.c
Log:
pad image with black, thnaks manx


Property changes on: trunk/ffmpeg2theora
___________________________________________________________________
Name: bzr:revision-info
   - timestamp: 2008-12-10 02:05:07.615999937 +0100
committer: j
properties: 
	branch-nick: ffmpeg2theora

   + timestamp: 2008-12-10 14:21:22.056999922 +0100
committer: j
properties: 
	branch-nick: ffmpeg2theora

Name: bzr:text-parents
   - src/ffmpeg2theora.c	j-20081126143259-i8qw0ht9sdq2reu5

   + 
Name: bzr:revision-id:v3-single1-dHJ1bmsvZmZtcGVnMnRoZW9yYQ..
   - 191 j-20080517230830-he5x8v2m8yrfiw35
192 j-20080518224037-pkmoctzf4qce7tog
193 j-20080518224409-6hbfp3k2ssn6egqa
194 j-20080520111939-dhi52qwbqe7a47cu
195 j-20080523092252-gj9k9db0s67vl7dw
196 j-20080523092420-l0850yrq1qkgz9t0
197 j-20080523093057-l5g0ezzy5geu0pey
198 j-20080523094343-kcno1dm2e1lr38q4
199 j-20080523163006-kjl6ewea5sxawmq2
200 j-20080523165904-l2vm52qae0hlqkhp
201 j-20080523175432-2ed953iktnl8c7cr
202 j-20080525100939-7oja8pk08v9fquiw
203 j-20080526111321-nhzaqh6ivzn0vs7b
204 j-20080527100851-2v5eyxxrq1riqi50
205 j-20080527101341-9ynbgth2b15jw792
206 j-20080527205556-19tffvfrxgt3khld
207 j-20080527205840-zeestdde3v1zks9k
208 j-20080527210129-e73y56uwmzbcid00
209 j-20080527211813-5ll680ed1q4byp16
210 j-20080528102006-aeippim0tn70mz3f
211 j-20080528104907-40kiidjojvta8j61
212 j-20080528111329-vkqbt7xkat2o9h4z
213 j-20080529102940-q9xdwm5v9espzomv
214 j-20080529111405-nmh99aon1kmh22qm
215 j-20080530094948-ncq064s4uggd9z95
216 j-20080530095056-hko2vjfwipikwjyu
217 j-20080530171822-bab8sy8lpotf8081
218 j-20080603170442-v0pxspvfcucvsaex
219 j-20080617110355-xwbeg1xidmv8fubp
220 j-20080617110518-khqlhaan52kz3lii
221 j-20080723194934-63m20dc3zmkhwj4o
222 j-20080724140108-ntgbrk6913nvtk4b
223 j-20080802221321-3fcp0s6rehryx0n5
224 j-20080802221340-0s6mh8llk6nyon5d
225 j-20080901112127-tyeax385hwukjt13
226 j-20080915075112-fg3yc8radbplosnc
227 j-20080921103515-w89p8jqwt3oq5u20
228 j-20080921103703-prnl3ls2f6u4g177
229 j-20080921104137-otk3xx827h5cofwl
230 j-20080921104242-dswny7jm93stokej
231 j-20081001102101-rl2rf1x9u8e5zrqk
232 j-20081001103246-0uwni13nt5b2mqyw
233 j-20081001104039-68e6rbv58e743plv
234 j-20081001111423-31lxb69fs7023eqi
235 j-20081001112345-eo9e3eheszd68pkb
236 j-20081002180939-vwdafec5iu2ihyq6
237 j-20081003143408-49wdpdkvhnf719rq
238 j-20081003153911-nh2fzqikxgbm7tuk
239 j-20081006092929-7kh3399r2tkat0x8
240 j-20081006120928-dqhlormykse02wss
241 j-20081010131634-o5sswtynyozb0dmb
242 j-20081010134449-4i1ak9vg1yv4ix53
243 j-20081010154655-55t7kuwhmo8964ya
244 j-20081010171055-w0wdhrrxucgdpvn1
245 j-20081016143100-chii7fl38ao2h6rd
246 j-20081105200328-iez493l5o7o333ae
247 j-20081105202607-3vjd88uf5rgna3pi
248 j-20081105204931-zah2kekajc2u9czu
249 j-20081110173803-i116mo4960rnmsqt
250 j-20081110173921-b79zigtpvfvowzd6
251 j-20081122150642-x51oi8he4clq62kw
252 j-20081126135201-8y0orpwbdzn0doai
253 j-20081126135947-3cs80yi3e2gyrup2
254 j-20081126143259-i8qw0ht9sdq2reu5
255 j-20081130165903-33vl4qmpoayhhqw5
256 j-20081130204237-ny099kahbu1vaij8
257 j-20081210010507-nugypyrs2e2oh4ut

   + 191 j-20080517230830-he5x8v2m8yrfiw35
192 j-20080518224037-pkmoctzf4qce7tog
193 j-20080518224409-6hbfp3k2ssn6egqa
194 j-20080520111939-dhi52qwbqe7a47cu
195 j-20080523092252-gj9k9db0s67vl7dw
196 j-20080523092420-l0850yrq1qkgz9t0
197 j-20080523093057-l5g0ezzy5geu0pey
198 j-20080523094343-kcno1dm2e1lr38q4
199 j-20080523163006-kjl6ewea5sxawmq2
200 j-20080523165904-l2vm52qae0hlqkhp
201 j-20080523175432-2ed953iktnl8c7cr
202 j-20080525100939-7oja8pk08v9fquiw
203 j-20080526111321-nhzaqh6ivzn0vs7b
204 j-20080527100851-2v5eyxxrq1riqi50
205 j-20080527101341-9ynbgth2b15jw792
206 j-20080527205556-19tffvfrxgt3khld
207 j-20080527205840-zeestdde3v1zks9k
208 j-20080527210129-e73y56uwmzbcid00
209 j-20080527211813-5ll680ed1q4byp16
210 j-20080528102006-aeippim0tn70mz3f
211 j-20080528104907-40kiidjojvta8j61
212 j-20080528111329-vkqbt7xkat2o9h4z
213 j-20080529102940-q9xdwm5v9espzomv
214 j-20080529111405-nmh99aon1kmh22qm
215 j-20080530094948-ncq064s4uggd9z95
216 j-20080530095056-hko2vjfwipikwjyu
217 j-20080530171822-bab8sy8lpotf8081
218 j-20080603170442-v0pxspvfcucvsaex
219 j-20080617110355-xwbeg1xidmv8fubp
220 j-20080617110518-khqlhaan52kz3lii
221 j-20080723194934-63m20dc3zmkhwj4o
222 j-20080724140108-ntgbrk6913nvtk4b
223 j-20080802221321-3fcp0s6rehryx0n5
224 j-20080802221340-0s6mh8llk6nyon5d
225 j-20080901112127-tyeax385hwukjt13
226 j-20080915075112-fg3yc8radbplosnc
227 j-20080921103515-w89p8jqwt3oq5u20
228 j-20080921103703-prnl3ls2f6u4g177
229 j-20080921104137-otk3xx827h5cofwl
230 j-20080921104242-dswny7jm93stokej
231 j-20081001102101-rl2rf1x9u8e5zrqk
232 j-20081001103246-0uwni13nt5b2mqyw
233 j-20081001104039-68e6rbv58e743plv
234 j-20081001111423-31lxb69fs7023eqi
235 j-20081001112345-eo9e3eheszd68pkb
236 j-20081002180939-vwdafec5iu2ihyq6
237 j-20081003143408-49wdpdkvhnf719rq
238 j-20081003153911-nh2fzqikxgbm7tuk
239 j-20081006092929-7kh3399r2tkat0x8
240 j-20081006120928-dqhlormykse02wss
241 j-20081010131634-o5sswtynyozb0dmb
242 j-20081010134449-4i1ak9vg1yv4ix53
243 j-20081010154655-55t7kuwhmo8964ya
244 j-20081010171055-w0wdhrrxucgdpvn1
245 j-20081016143100-chii7fl38ao2h6rd
246 j-20081105200328-iez493l5o7o333ae
247 j-20081105202607-3vjd88uf5rgna3pi
248 j-20081105204931-zah2kekajc2u9czu
249 j-20081110173803-i116mo4960rnmsqt
250 j-20081110173921-b79zigtpvfvowzd6
251 j-20081122150642-x51oi8he4clq62kw
252 j-20081126135201-8y0orpwbdzn0doai
253 j-20081126135947-3cs80yi3e2gyrup2
254 j-20081126143259-i8qw0ht9sdq2reu5
255 j-20081130165903-33vl4qmpoayhhqw5
256 j-20081130204237-ny099kahbu1vaij8
257 j-20081210010507-nugypyrs2e2oh4ut
258 j-20081210132122-a4nm3f7l2zhnrvca


Modified: trunk/ffmpeg2theora/src/ffmpeg2theora.c
===================================================================
--- trunk/ffmpeg2theora/src/ffmpeg2theora.c	2008-12-10 08:14:03 UTC (rev 15571)
+++ trunk/ffmpeg2theora/src/ffmpeg2theora.c	2008-12-10 13:21:50 UTC (rev 15572)
@@ -103,7 +103,9 @@
 
 static int using_stdin = 0;
 
+static int padcolor[3] = { 16, 128, 128 };
 
+
 /**
  * Allocate and initialise an AVFrame.
  */
@@ -650,6 +652,9 @@
         AVFrame *output_buffered=NULL;
         AVFrame *output_cropped_p=NULL;
         AVFrame *output_cropped=NULL;
+        AVFrame *output_padded_p=NULL;
+        AVFrame *output_padded=NULL;
+                        
         
 
         AVPacket pkt;
@@ -687,12 +692,14 @@
             output_p = output = frame_alloc(this->pix_fmt,
                             vstream->codec->width,vstream->codec->height);
             output_resized_p = output_resized = frame_alloc(this->pix_fmt,
-                            this->frame_width, this->frame_height);
+                            this->picture_width, this->picture_height);
             output_cropped_p = output_cropped = frame_alloc(this->pix_fmt,
                             vstream->codec->width-this->frame_leftBand,
                             vstream->codec->height-this->frame_topBand);
             output_buffered_p = output_buffered = frame_alloc(this->pix_fmt,
                             this->frame_width, this->frame_height);
+            output_padded_p = output_padded = frame_alloc(this->pix_fmt,
+                            this->frame_width, this->frame_height);
 
             /* video settings here */
             /* config file? commandline options? v2v presets? */
@@ -933,7 +940,18 @@
                             else{
                                 output_resized = output_cropped;
                             }
-
+                            if ((this->frame_width!=this->picture_width) || (this->frame_height!=this->picture_height)) {
+                              if (av_picture_pad((AVPicture *)output_padded,
+                                                 (AVPicture *)output_resized,
+                                                 this->frame_height, this->frame_width, this->pix_fmt,
+                                                 0, this->frame_height - this->picture_height,
+                                                 0, this->frame_width - this->picture_width,
+                                                 padcolor ) < 0 ) {
+                                av_log(NULL, AV_LOG_ERROR, "error padding frame\n");
+                              }
+                            } else {
+                              output_padded = output_resized;
+                            }
                         }
                         ptr += len1;
                         len -= len1;
@@ -951,7 +969,7 @@
                     }
                     if(got_picture) {
                       first=0;
-                      av_picture_copy ((AVPicture *)output_buffered, (AVPicture *)output_resized, this->pix_fmt, this->frame_width, this->frame_height);
+                      av_picture_copy ((AVPicture *)output_buffered, (AVPicture *)output_padded, this->pix_fmt, this->frame_width, this->frame_height);
                     }
                     if(!got_picture){
                         break;
@@ -1051,6 +1069,7 @@
             frame_dealloc(output_resized_p);
             frame_dealloc(output_buffered_p);
             frame_dealloc(output_cropped_p);
+            frame_dealloc(output_padded_p);
         }
         av_free(audio_buf);
         av_free(resampled);



More information about the commits mailing list