[vlc-devel] [PATCH] Eliminate double filtering in case of identical image parameters when performing ImageConvert.

Aleksas Pielikis ant.kampo at gmail.com
Mon Nov 14 14:21:08 CET 2016


Hello,

Attached an image.c patch. Patch contains minor modification that should 
eliminate double filtering in case of identical image parameters when 
performing ImageConvert (image_Convert).
Unfortuantely could not perform any test on the change, since I do not 
have the build/test envirnment set up. But the change is very minor and 
straight forward. Otherwise should comply with patch checklist.

Kind regards,
Aleksas Pielikis

-------------- next part --------------
From 9095dda4f6c9bc299682adf4be20ab181c2a1e95 Mon Sep 17 00:00:00 2001
From: Aleksas Pielikis <ant.kampo at gmail.com>
Date: Mon, 14 Nov 2016 15:10:00 +0200
Subject: [PATCH] Eliminates double filtering in case of identical image
 parameters when performing ImageConvert.

---
 src/misc/image.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/misc/image.c b/src/misc/image.c
index 0f25609..4832bff 100644
--- a/src/misc/image.c
+++ b/src/misc/image.c
@@ -477,18 +477,18 @@ static picture_t *ImageConvert( image_handler_t *p_image, picture_t *p_pic,
 
     picture_Hold( p_pic );
 
-    p_pif = p_image->p_filter->pf_video_filter( p_image->p_filter, p_pic );
-
     if( p_fmt_in->i_chroma == p_fmt_out->i_chroma &&
         p_fmt_in->i_width == p_fmt_out->i_width &&
         p_fmt_in->i_height == p_fmt_out->i_height )
     {
-        /* Duplicate image */
-        picture_Release( p_pif ); /* XXX: Better fix must be possible */
         p_pif = p_image->p_filter->pf_video_buffer_new( p_image->p_filter );
         if( p_pif )
             picture_Copy( p_pif, p_pic );
     }
+    else
+    {
+        p_pif = p_image->p_filter->pf_video_filter( p_image->p_filter, p_pic );
+    }
 
     return p_pif;
 }
-- 
2.5.3.windows.1



More information about the vlc-devel mailing list