[FFmpeg-cvslog] lavfi/lut: add direct path.

Clément Bœsch git at videolan.org
Wed Apr 17 19:28:12 CEST 2013


ffmpeg | branch: master | Clément Bœsch <ubitux at gmail.com> | Wed Apr 17 12:07:46 2013 +0200| [3db3b278f2dcb16a710ff7052bbb40e99ba9c73a] | committer: Clément Bœsch

lavfi/lut: add direct path.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=3db3b278f2dcb16a710ff7052bbb40e99ba9c73a
---

 libavfilter/vf_lut.c  |   12 ++++++++++--
 tests/fate/filter.mak |    4 ++--
 2 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/libavfilter/vf_lut.c b/libavfilter/vf_lut.c
index 76db0f3..be497ac 100644
--- a/libavfilter/vf_lut.c
+++ b/libavfilter/vf_lut.c
@@ -260,14 +260,20 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
     AVFilterLink *outlink = ctx->outputs[0];
     AVFrame *out;
     uint8_t *inrow, *outrow, *inrow0, *outrow0;
-    int i, j, plane;
+    int i, j, plane, direct = 0;
 
+    if (av_frame_is_writable(in)) {
+        direct = 1;
+        out = in;
+    } else {
+        /* TODO reindent */
     out = ff_get_video_buffer(outlink, outlink->w, outlink->h);
     if (!out) {
         av_frame_free(&in);
         return AVERROR(ENOMEM);
     }
     av_frame_copy_props(out, in);
+    }
 
     if (lut->is_rgb) {
         /* packed */
@@ -316,7 +322,9 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
         }
     }
 
-    av_frame_free(&in);
+    if (!direct)
+        av_frame_free(&in);
+
     return ff_filter_frame(outlink, out);
 }
 
diff --git a/tests/fate/filter.mak b/tests/fate/filter.mak
index f973ce0..7b9890b 100644
--- a/tests/fate/filter.mak
+++ b/tests/fate/filter.mak
@@ -79,8 +79,8 @@ fate-filter-join: CMD = md5 -i $(SRC1) -i $(SRC2) -filter_complex join=channel_l
 fate-filter-join: CMP = oneline
 fate-filter-join: REF = 38fa1b18b0c46d77df6f17bfc4f078dd
 
-FATE_FILTER_VSYNTH-$(CONFIG_NEGATE_FILTER) += fate-filter-negate
-fate-filter-negate: CMD = framecrc -c:v pgmyuv -i $(SRC) -vf negate
+FATE_FILTER_VSYNTH-$(call ALLYES, NEGATE_FILTER PERMS_FILTER) += fate-filter-negate
+fate-filter-negate: CMD = framecrc -c:v pgmyuv -i $(SRC) -vf perms=random,negate
 
 FATE_FILTER_VSYNTH-$(CONFIG_HISTOGRAM_FILTER) += fate-filter-histogram-levels
 fate-filter-histogram-levels: CMD = framecrc -c:v pgmyuv -i $(SRC) -vf histogram -flags +bitexact -sws_flags +accurate_rnd+bitexact



More information about the ffmpeg-cvslog mailing list