mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2024-12-25 08:42:39 +00:00
vf_blackframe: use the name 's' for the pointer to the private context
This is shorter and consistent across filters.
This commit is contained in:
parent
b3ea76624a
commit
a2a696990c
@ -61,25 +61,25 @@ static int query_formats(AVFilterContext *ctx)
|
|||||||
static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
|
static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
|
||||||
{
|
{
|
||||||
AVFilterContext *ctx = inlink->dst;
|
AVFilterContext *ctx = inlink->dst;
|
||||||
BlackFrameContext *blackframe = ctx->priv;
|
BlackFrameContext *s = ctx->priv;
|
||||||
int x, i;
|
int x, i;
|
||||||
int pblack = 0;
|
int pblack = 0;
|
||||||
uint8_t *p = frame->data[0];
|
uint8_t *p = frame->data[0];
|
||||||
|
|
||||||
for (i = 0; i < frame->height; i++) {
|
for (i = 0; i < frame->height; i++) {
|
||||||
for (x = 0; x < inlink->w; x++)
|
for (x = 0; x < inlink->w; x++)
|
||||||
blackframe->nblack += p[x] < blackframe->bthresh;
|
s->nblack += p[x] < s->bthresh;
|
||||||
p += frame->linesize[0];
|
p += frame->linesize[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
pblack = blackframe->nblack * 100 / (inlink->w * inlink->h);
|
pblack = s->nblack * 100 / (inlink->w * inlink->h);
|
||||||
if (pblack >= blackframe->bamount)
|
if (pblack >= s->bamount)
|
||||||
av_log(ctx, AV_LOG_INFO, "frame:%u pblack:%u pts:%"PRId64" t:%f\n",
|
av_log(ctx, AV_LOG_INFO, "frame:%u pblack:%u pts:%"PRId64" t:%f\n",
|
||||||
blackframe->frame, pblack, frame->pts,
|
s->frame, pblack, frame->pts,
|
||||||
frame->pts == AV_NOPTS_VALUE ? -1 : frame->pts * av_q2d(inlink->time_base));
|
frame->pts == AV_NOPTS_VALUE ? -1 : frame->pts * av_q2d(inlink->time_base));
|
||||||
|
|
||||||
blackframe->frame++;
|
s->frame++;
|
||||||
blackframe->nblack = 0;
|
s->nblack = 0;
|
||||||
return ff_filter_frame(inlink->dst->outputs[0], frame);
|
return ff_filter_frame(inlink->dst->outputs[0], frame);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user