[FFmpeg-devel] [PATCH] lavfi/kerndeint: use aligned linesizes for the temporary buffer.

Clément Bœsch ubitux at gmail.com
Sun Jan 6 19:34:16 CET 2013


This improves the performances just enough to match mp=kerndeint.
---
 libavfilter/vf_kerndeint.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavfilter/vf_kerndeint.c b/libavfilter/vf_kerndeint.c
index 382b8a7..a929714 100644
--- a/libavfilter/vf_kerndeint.c
+++ b/libavfilter/vf_kerndeint.c
@@ -102,7 +102,7 @@ static int config_props(AVFilterLink *inlink)
     kerndeint->vsub = desc->log2_chroma_h;
 
     ret = av_image_alloc(kerndeint->tmp_data, kerndeint->tmp_bwidth,
-                          inlink->w, inlink->h, inlink->format, 1);
+                          inlink->w, inlink->h, inlink->format, 16);
     if (ret < 0)
         return ret;
     memset(kerndeint->tmp_data[0], 0, ret);
@@ -157,7 +157,7 @@ static int filter_frame(AVFilterLink *inlink, AVFilterBufferRef *inpic)
 
     for (plane = 0; inpic->data[plane] && plane < 4; plane++) {
         h = plane == 0 ? inlink->h : inlink->h >> kerndeint->vsub;
-        bwidth = kerndeint->tmp_bwidth[plane];
+        bwidth = av_image_get_linesize(inlink->format, inlink->w, plane);
 
         srcp = srcp_saved = inpic->data[plane];
         src_linesize      = inpic->linesize[plane];
-- 
1.8.1



More information about the ffmpeg-devel mailing list