Browse code

lavfi/kerndeint: move is_rgb_packed definition to the internal context

No need to recompute it for each new frame.

Stefano Sabatini authored on 2013/02/16 03:44:08
Showing 1 changed files
... ...
@@ -40,6 +40,7 @@ typedef struct {
40 40
     int           frame; ///< frame count, starting from 0
41 41
     int           thresh, map, order, sharp, twoway;
42 42
     int           vsub;
43
+    int           is_packed_rgb;
43 44
     uint8_t       *tmp_data    [4];  ///< temporary plane data buffer
44 45
     int            tmp_linesize[4];  ///< temporary plane byte linesize
45 46
     int            tmp_bwidth  [4];  ///< temporary plane byte width
... ...
@@ -100,6 +101,7 @@ static int config_props(AVFilterLink *inlink)
100 100
     const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(inlink->format);
101 101
     int ret;
102 102
 
103
+    kerndeint->is_packed_rgb = av_pix_fmt_desc_get(inlink->format)->flags & PIX_FMT_RGB;
103 104
     kerndeint->vsub = desc->log2_chroma_h;
104 105
 
105 106
     ret = av_image_alloc(kerndeint->tmp_data, kerndeint->tmp_linesize,
... ...
@@ -150,7 +152,7 @@ static int filter_frame(AVFilterLink *inlink, AVFilterBufferRef *inpic)
150 150
     const int sharp  = kerndeint->sharp;
151 151
     const int twoway = kerndeint->twoway;
152 152
 
153
-    const int is_packed_rgb = av_pix_fmt_desc_get(inlink->format)->flags & PIX_FMT_RGB;
153
+    const int is_packed_rgb = kerndeint->is_packed_rgb;
154 154
 
155 155
     outpic = ff_get_video_buffer(outlink, AV_PERM_WRITE|AV_PERM_ALIGN, outlink->w, outlink->h);
156 156
     if (!outpic) {