[FFmpeg-cvslog] lavfi/kerndeint: move is_rgb_packed definition to the internal context

Stefano Sabatini git at videolan.org
Sat Feb 16 00:18:07 CET 2013


ffmpeg | branch: master | Stefano Sabatini <stefasab at gmail.com> | Fri Feb 15 19:44:08 2013 +0100| [f84ef19f3f8b72e838c96e86661879670ecb2442] | committer: Stefano Sabatini

lavfi/kerndeint: move is_rgb_packed definition to the internal context

No need to recompute it for each new frame.

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

 libavfilter/vf_kerndeint.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/libavfilter/vf_kerndeint.c b/libavfilter/vf_kerndeint.c
index 8449d00..9b77e09 100644
--- a/libavfilter/vf_kerndeint.c
+++ b/libavfilter/vf_kerndeint.c
@@ -40,6 +40,7 @@ typedef struct {
     int           frame; ///< frame count, starting from 0
     int           thresh, map, order, sharp, twoway;
     int           vsub;
+    int           is_packed_rgb;
     uint8_t       *tmp_data    [4];  ///< temporary plane data buffer
     int            tmp_linesize[4];  ///< temporary plane byte linesize
     int            tmp_bwidth  [4];  ///< temporary plane byte width
@@ -100,6 +101,7 @@ static int config_props(AVFilterLink *inlink)
     const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(inlink->format);
     int ret;
 
+    kerndeint->is_packed_rgb = av_pix_fmt_desc_get(inlink->format)->flags & PIX_FMT_RGB;
     kerndeint->vsub = desc->log2_chroma_h;
 
     ret = av_image_alloc(kerndeint->tmp_data, kerndeint->tmp_linesize,
@@ -150,7 +152,7 @@ static int filter_frame(AVFilterLink *inlink, AVFilterBufferRef *inpic)
     const int sharp  = kerndeint->sharp;
     const int twoway = kerndeint->twoway;
 
-    const int is_packed_rgb = av_pix_fmt_desc_get(inlink->format)->flags & PIX_FMT_RGB;
+    const int is_packed_rgb = kerndeint->is_packed_rgb;
 
     outpic = ff_get_video_buffer(outlink, AV_PERM_WRITE|AV_PERM_ALIGN, outlink->w, outlink->h);
     if (!outpic) {



More information about the ffmpeg-cvslog mailing list