[xiph-commits] r14942 - trunk/ffmpeg2theora

j at svn.xiph.org j at svn.xiph.org
Fri May 23 02:49:50 PDT 2008


Author: j
Date: 2008-05-23 02:49:49 -0700 (Fri, 23 May 2008)
New Revision: 14942

Modified:
   trunk/ffmpeg2theora/
   trunk/ffmpeg2theora/ffmpeg2theora.c
Log:
split out prepare_yuv_buffer


Property changes on: trunk/ffmpeg2theora
___________________________________________________________________
Name: bzr:revision-info
   - timestamp: 2008-05-20 13:19:39.566999912 +0200
committer: j
properties: 
	branch-nick: ffmpeg2theora

   + timestamp: 2008-05-23 11:22:52.762000084 +0200
committer: j
properties: 
	branch-nick: ffmpeg2theora

Name: bzr:revision-id:v3-single1-dHJ1bmsvZmZtcGVnMnRoZW9yYQ..
   - 191 j-20080517230830-he5x8v2m8yrfiw35
192 j-20080518224037-pkmoctzf4qce7tog
193 j-20080518224409-6hbfp3k2ssn6egqa
194 j-20080520111939-dhi52qwbqe7a47cu

   + 191 j-20080517230830-he5x8v2m8yrfiw35
192 j-20080518224037-pkmoctzf4qce7tog
193 j-20080518224409-6hbfp3k2ssn6egqa
194 j-20080520111939-dhi52qwbqe7a47cu
195 j-20080523092252-gj9k9db0s67vl7dw


Modified: trunk/ffmpeg2theora/ffmpeg2theora.c
===================================================================
--- trunk/ffmpeg2theora/ffmpeg2theora.c	2008-05-23 03:07:54 UTC (rev 14941)
+++ trunk/ffmpeg2theora/ffmpeg2theora.c	2008-05-23 09:49:49 UTC (rev 14942)
@@ -600,6 +600,28 @@
     return this;
 }
 
+void prepare_yuv_buffer(ff2theora this, yuv_buffer *yuv, AVFrame *output_buffered) {
+    /* pysical pages */
+    yuv->y_width = this->frame_width;
+    yuv->y_height = this->frame_height;
+    yuv->y_stride = output_buffered->linesize[0];
+
+    yuv->uv_width = this->frame_width / 2;
+    yuv->uv_height = this->frame_height / 2;
+    yuv->uv_stride = output_buffered->linesize[1];
+
+    yuv->y = output_buffered->data[0];
+    yuv->u = output_buffered->data[1];
+    yuv->v = output_buffered->data[2];
+    if (y_lut_used) {
+        lut_apply(y_lut, yuv->y, yuv->y, yuv->y_width, yuv->y_height, yuv->y_stride);
+    }
+    if (uv_lut_used) {
+        lut_apply(uv_lut, yuv->u, yuv->u, yuv->uv_width, yuv->uv_height, yuv->uv_stride);
+        lut_apply(uv_lut, yuv->v, yuv->v, yuv->uv_width, yuv->uv_height, yuv->uv_stride);
+    }
+}
+
 void ff2theora_output(ff2theora this) {
     int i;
     AVCodecContext *aenc = NULL;
@@ -1042,11 +1064,6 @@
                   ks->subtitles_count++;
               }
           }
-          else {
-            ks->filename=NULL;
-            ks->num_subtitles=0;
-            ks->subtitles=NULL;
-          }
         }
 
         if(info.audio_only && (this->end_time>0 || this->start_time>0)){
@@ -1183,28 +1200,11 @@
                         len -= len1;
                     }
                     //now output_resized
+
                     if(!first) {
-                      /* pysical pages */
-                      yuv.y_width = this->frame_width;
-                      yuv.y_height = this->frame_height;
-                      yuv.y_stride = output_buffered->linesize[0];
-
-                      yuv.uv_width = this->frame_width / 2;
-                      yuv.uv_height = this->frame_height / 2;
-                      yuv.uv_stride = output_buffered->linesize[1];
-
-                      yuv.y = output_buffered->data[0];
-                      yuv.u = output_buffered->data[1];
-                      yuv.v = output_buffered->data[2];
                       if(got_picture || e_o_s) {
+                        prepare_yuv_buffer(this, &yuv, output_buffered);
                         do {
-                          if (y_lut_used) {
-                              lut_apply(y_lut, yuv.y, yuv.y, yuv.y_width, yuv.y_height, yuv.y_stride);
-                          }
-                          if (uv_lut_used) {
-                              lut_apply(uv_lut, yuv.u, yuv.u, yuv.uv_width, yuv.uv_height, yuv.uv_stride);
-                              lut_apply(uv_lut, yuv.v, yuv.v, yuv.uv_width, yuv.uv_height, yuv.uv_stride);
-                          }
                           oggmux_add_video(&info, &yuv, e_o_s);
                           this->frame_count++;
                         } while(dups--);



More information about the commits mailing list