History

avfilter/vf_maskfun: rename too generic variables

Paul B Mahol committed 4 years ago

Commit 7aa69301 parent 580fb6a1 file · +15 −15Browse files

Showing the changes to libavfilter (1 of 1 file). Show all

Unified · Split

libavfilter/vf_maskfun.c+15−15
@@ -35,7 +35,7 @@ typedef struct MaskFunContext { · 34 unmodified lines
3535 int sum;
3636
3737 int linesize[4];
38− int width[4], height[4];
38+ int planewidth[4], planeheight[4];
3939 int nb_planes;
4040 int depth;
4141 int max;
@@ -101,7 +101,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *frame) · 59 unmodified lines
101101 }
102102
103103 ff_filter_execute(ctx, s->maskfun, frame, NULL,
104− FFMIN(s->height[1], ff_filter_get_nb_threads(ctx)));
104+ FFMIN(s->planeheight[1], ff_filter_get_nb_threads(ctx)));
105105
106106 return ff_filter_frame(outlink, frame);
107107 }
@@ -115,8 +115,8 @@ static int getsum##name(AVFilterContext *ctx, AVFrame *out) \ · 7 unmodified lines
115115 \
116116 for (p = 0; p < s->nb_planes; p++) { \
117117 const int linesize = out->linesize[p] / div; \
118− const int w = s->width[p]; \
119− const int h = s->height[p]; \
118+ const int w = s->planewidth[p]; \
119+ const int h = s->planeheight[p]; \
120120 type *dst = (type *)out->data[p]; \
121121 \
122122 if (!((1 << p) & s->planes)) \
@@ -150,8 +150,8 @@ static int maskfun##name(AVFilterContext *ctx, void *arg, \ · 27 unmodified lines
150150 \
151151 for (p = 0; p < s->nb_planes; p++) { \
152152 const int linesize = out->linesize[p] / div; \
153− const int w = s->width[p]; \
154− const int h = s->height[p]; \
153+ const int w = s->planewidth[p]; \
154+ const int h = s->planeheight[p]; \
155155 const int slice_start = (h * jobnr) / nb_jobs; \
156156 const int slice_end = (h * (jobnr+1)) / nb_jobs; \
157157 type *dst = (type *)out->data[p] + slice_start * linesize; \
@@ -186,8 +186,8 @@ static void fill_frame(AVFilterContext *ctx) · 28 unmodified lines
186186 for (int p = 0; p < s->nb_planes; p++) {
187187 uint8_t *dst = s->empty->data[p];
188188
189− for (int y = 0; y < s->height[p]; y++) {
190− memset(dst, s->fill, s->width[p]);
189+ for (int y = 0; y < s->planeheight[p]; y++) {
190+ memset(dst, s->fill, s->planewidth[p]);
191191 dst += s->empty->linesize[p];
192192 }
193193 }
@@ -195,8 +195,8 @@ static void fill_frame(AVFilterContext *ctx) · 1 unmodified line
195195 for (int p = 0; p < s->nb_planes; p++) {
196196 uint16_t *dst = (uint16_t *)s->empty->data[p];
197197
198− for (int y = 0; y < s->height[p]; y++) {
199− for (int x = 0; x < s->width[p]; x++)
198+ for (int y = 0; y < s->planeheight[p]; y++) {
199+ for (int x = 0; x < s->planewidth[p]; x++)
200200 dst[x] = s->fill;
201201 dst += s->empty->linesize[p] / 2;
202202 }
@@ -212,7 +212,7 @@ static void set_max_sum(AVFilterContext *ctx) · 9 unmodified lines
212212 for (int p = 0; p < s->nb_planes; p++) {
213213 if (!((1 << p) & s->planes))
214214 continue;
215− s->max_sum += (uint64_t)s->sum * s->width[p] * s->height[p];
215+ s->max_sum += (uint64_t)s->sum * s->planewidth[p] * s->planeheight[p];
216216 }
217217 }
218218
@@ -230,10 +230,10 @@ static int config_input(AVFilterLink *inlink) · 11 unmodified lines
230230
231231 hsub = desc->log2_chroma_w;
232232 vsub = desc->log2_chroma_h;
233− s->height[1] = s->height[2] = AV_CEIL_RSHIFT(inlink->h, vsub);
234− s->height[0] = s->height[3] = inlink->h;
235− s->width[1] = s->width[2] = AV_CEIL_RSHIFT(inlink->w, hsub);
236− s->width[0] = s->width[3] = inlink->w;
233+ s->planeheight[1] = s->planeheight[2] = AV_CEIL_RSHIFT(inlink->h, vsub);
234+ s->planeheight[0] = s->planeheight[3] = inlink->h;
235+ s->planewidth[1] = s->planewidth[2] = AV_CEIL_RSHIFT(inlink->w, hsub);
236+ s->planewidth[0] = s->planewidth[3] = inlink->w;
237237
238238 s->depth = desc->comp[0].depth;
239239 s->max = (1 << s->depth) - 1;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t