Browse code

avfilter/vf_extractplanes: use the name 's' for the pointer to the private context

Signed-off-by: Paul B Mahol <onemda@gmail.com>

Paul B Mahol authored on 2015/01/28 23:26:13
Showing 1 changed files
... ...
@@ -134,7 +134,7 @@ static int query_formats(AVFilterContext *ctx)
134 134
 static int config_input(AVFilterLink *inlink)
135 135
 {
136 136
     AVFilterContext *ctx = inlink->dst;
137
-    ExtractPlanesContext *e = ctx->priv;
137
+    ExtractPlanesContext *s = ctx->priv;
138 138
     const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(inlink->format);
139 139
     int plane_avail, ret, i;
140 140
     uint8_t rgba_map[4];
... ...
@@ -143,20 +143,20 @@ static int config_input(AVFilterLink *inlink)
143 143
                                                  PLANE_Y |
144 144
                                 ((desc->nb_components > 2) ? PLANE_U|PLANE_V : 0)) |
145 145
                   ((desc->flags & AV_PIX_FMT_FLAG_ALPHA) ? PLANE_A : 0);
146
-    if (e->requested_planes & ~plane_avail) {
146
+    if (s->requested_planes & ~plane_avail) {
147 147
         av_log(ctx, AV_LOG_ERROR, "Requested planes not available.\n");
148 148
         return AVERROR(EINVAL);
149 149
     }
150
-    if ((ret = av_image_fill_linesizes(e->linesize, inlink->format, inlink->w)) < 0)
150
+    if ((ret = av_image_fill_linesizes(s->linesize, inlink->format, inlink->w)) < 0)
151 151
         return ret;
152 152
 
153
-    e->depth = (desc->comp[0].depth_minus1 + 1) >> 3;
154
-    e->step = av_get_padded_bits_per_pixel(desc) >> 3;
155
-    e->is_packed_rgb = !(desc->flags & AV_PIX_FMT_FLAG_PLANAR);
153
+    s->depth = (desc->comp[0].depth_minus1 + 1) >> 3;
154
+    s->step = av_get_padded_bits_per_pixel(desc) >> 3;
155
+    s->is_packed_rgb = !(desc->flags & AV_PIX_FMT_FLAG_PLANAR);
156 156
     if (desc->flags & AV_PIX_FMT_FLAG_RGB) {
157 157
         ff_fill_rgba_map(rgba_map, inlink->format);
158 158
         for (i = 0; i < 4; i++)
159
-            e->map[i] = rgba_map[e->map[i]];
159
+            s->map[i] = rgba_map[s->map[i]];
160 160
     }
161 161
 
162 162
     return 0;
... ...
@@ -166,11 +166,11 @@ static int config_output(AVFilterLink *outlink)
166 166
 {
167 167
     AVFilterContext *ctx = outlink->src;
168 168
     AVFilterLink *inlink = ctx->inputs[0];
169
-    ExtractPlanesContext *e = ctx->priv;
169
+    ExtractPlanesContext *s = ctx->priv;
170 170
     const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(inlink->format);
171 171
     const int output = outlink->srcpad - ctx->output_pads;
172 172
 
173
-    if (e->map[output] == 1 || e->map[output] == 2) {
173
+    if (s->map[output] == 1 || s->map[output] == 2) {
174 174
         outlink->h = FF_CEIL_RSHIFT(inlink->h, desc->log2_chroma_h);
175 175
         outlink->w = FF_CEIL_RSHIFT(inlink->w, desc->log2_chroma_w);
176 176
     }
... ...
@@ -206,12 +206,12 @@ static void extract_from_packed(uint8_t *dst, int dst_linesize,
206 206
 static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
207 207
 {
208 208
     AVFilterContext *ctx = inlink->dst;
209
-    ExtractPlanesContext *e = ctx->priv;
209
+    ExtractPlanesContext *s = ctx->priv;
210 210
     int i, eof = 0, ret = 0;
211 211
 
212 212
     for (i = 0; i < ctx->nb_outputs; i++) {
213 213
         AVFilterLink *outlink = ctx->outputs[i];
214
-        const int idx = e->map[i];
214
+        const int idx = s->map[i];
215 215
         AVFrame *out;
216 216
 
217 217
         if (outlink->closed)
... ...
@@ -224,16 +224,16 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
224 224
         }
225 225
         av_frame_copy_props(out, frame);
226 226
 
227
-        if (e->is_packed_rgb) {
227
+        if (s->is_packed_rgb) {
228 228
             extract_from_packed(out->data[0], out->linesize[0],
229 229
                                 frame->data[0], frame->linesize[0],
230 230
                                 outlink->w, outlink->h,
231
-                                e->depth,
232
-                                e->step, idx);
231
+                                s->depth,
232
+                                s->step, idx);
233 233
         } else {
234 234
             av_image_copy_plane(out->data[0], out->linesize[0],
235 235
                                 frame->data[idx], frame->linesize[idx],
236
-                                e->linesize[idx], outlink->h);
236
+                                s->linesize[idx], outlink->h);
237 237
         }
238 238
 
239 239
         ret = ff_filter_frame(outlink, out);
... ...
@@ -253,8 +253,8 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
253 253
 
254 254
 static av_cold int init(AVFilterContext *ctx)
255 255
 {
256
-    ExtractPlanesContext *e = ctx->priv;
257
-    int planes = (e->requested_planes & 0xf) | (e->requested_planes >> 4);
256
+    ExtractPlanesContext *s = ctx->priv;
257
+    int planes = (s->requested_planes & 0xf) | (s->requested_planes >> 4);
258 258
     int i;
259 259
 
260 260
     for (i = 0; i < 4; i++) {
... ...
@@ -267,7 +267,7 @@ static av_cold int init(AVFilterContext *ctx)
267 267
         name = av_asprintf("out%d", ctx->nb_outputs);
268 268
         if (!name)
269 269
             return AVERROR(ENOMEM);
270
-        e->map[ctx->nb_outputs] = i;
270
+        s->map[ctx->nb_outputs] = i;
271 271
         pad.name = name;
272 272
         pad.type = AVMEDIA_TYPE_VIDEO;
273 273
         pad.config_props = config_output;
... ...
@@ -313,9 +313,9 @@ AVFilter ff_vf_extractplanes = {
313 313
 
314 314
 static av_cold int init_alphaextract(AVFilterContext *ctx)
315 315
 {
316
-    ExtractPlanesContext *e = ctx->priv;
316
+    ExtractPlanesContext *s = ctx->priv;
317 317
 
318
-    e->requested_planes = PLANE_A;
318
+    s->requested_planes = PLANE_A;
319 319
 
320 320
     return init(ctx);
321 321
 }