diff --git a/libavfilter/vf_sab.c b/libavfilter/vf_sab.c index da59439652..6b88c86281 100644 --- a/libavfilter/vf_sab.c +++ b/libavfilter/vf_sab.c @@ -107,24 +107,24 @@ AVFILTER_DEFINE_CLASS(sab); static av_cold int init(AVFilterContext *ctx) { - SabContext *sab = ctx->priv; + SabContext *s = ctx->priv; /* make chroma default to luma values, if not explicitly set */ - if (sab->chroma.radius < RADIUS_MIN) - sab->chroma.radius = sab->luma.radius; - if (sab->chroma.pre_filter_radius < PRE_FILTER_RADIUS_MIN) - sab->chroma.pre_filter_radius = sab->luma.pre_filter_radius; - if (sab->chroma.strength < STRENGTH_MIN) - sab->chroma.strength = sab->luma.strength; + if (s->chroma.radius < RADIUS_MIN) + s->chroma.radius = s->luma.radius; + if (s->chroma.pre_filter_radius < PRE_FILTER_RADIUS_MIN) + s->chroma.pre_filter_radius = s->luma.pre_filter_radius; + if (s->chroma.strength < STRENGTH_MIN) + s->chroma.strength = s->luma.strength; - sab->luma.quality = sab->chroma.quality = 3.0; - sab->sws_flags = SWS_POINT; + s->luma.quality = s->chroma.quality = 3.0; + s->sws_flags = SWS_POINT; av_log(ctx, AV_LOG_VERBOSE, "luma_radius:%f luma_pre_filter_radius::%f luma_strength:%f " "chroma_radius:%f chroma_pre_filter_radius:%f chroma_strength:%f\n", - sab->luma .radius, sab->luma .pre_filter_radius, sab->luma .strength, - sab->chroma.radius, sab->chroma.pre_filter_radius, sab->chroma.strength); + s->luma .radius, s->luma .pre_filter_radius, s->luma .strength, + s->chroma.radius, s->chroma.pre_filter_radius, s->chroma.strength); return 0; } @@ -140,10 +140,10 @@ static void close_filter_param(FilterParam *f) static av_cold void uninit(AVFilterContext *ctx) { - SabContext *sab = ctx->priv; + SabContext *s = ctx->priv; - close_filter_param(&sab->luma); - close_filter_param(&sab->chroma); + close_filter_param(&s->luma); + close_filter_param(&s->chroma); } static int open_filter_param(FilterParam *f, int width, int height, unsigned int sws_flags) @@ -200,22 +200,22 @@ static int open_filter_param(FilterParam *f, int width, int height, unsigned int static int config_props(AVFilterLink *inlink) { - SabContext *sab = inlink->dst->priv; + SabContext *s = inlink->dst->priv; const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(inlink->format); int ret; - sab->hsub = desc->log2_chroma_w; - sab->vsub = desc->log2_chroma_h; + s->hsub = desc->log2_chroma_w; + s->vsub = desc->log2_chroma_h; - close_filter_param(&sab->luma); - ret = open_filter_param(&sab->luma, inlink->w, inlink->h, sab->sws_flags); + close_filter_param(&s->luma); + ret = open_filter_param(&s->luma, inlink->w, inlink->h, s->sws_flags); if (ret < 0) return ret; - close_filter_param(&sab->chroma); - ret = open_filter_param(&sab->chroma, - FF_CEIL_RSHIFT(inlink->w, sab->hsub), - FF_CEIL_RSHIFT(inlink->h, sab->vsub), sab->sws_flags); + close_filter_param(&s->chroma); + ret = open_filter_param(&s->chroma, + FF_CEIL_RSHIFT(inlink->w, s->hsub), + FF_CEIL_RSHIFT(inlink->h, s->vsub), s->sws_flags); return ret; } @@ -281,7 +281,7 @@ static void blur(uint8_t *dst, const int dst_linesize, static int filter_frame(AVFilterLink *inlink, AVFrame *inpic) { - SabContext *sab = inlink->dst->priv; + SabContext *s = inlink->dst->priv; AVFilterLink *outlink = inlink->dst->outputs[0]; AVFrame *outpic; @@ -293,12 +293,12 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *inpic) av_frame_copy_props(outpic, inpic); blur(outpic->data[0], outpic->linesize[0], inpic->data[0], inpic->linesize[0], - inlink->w, inlink->h, &sab->luma); + inlink->w, inlink->h, &s->luma); if (inpic->data[2]) { - int cw = FF_CEIL_RSHIFT(inlink->w, sab->hsub); - int ch = FF_CEIL_RSHIFT(inlink->h, sab->vsub); - blur(outpic->data[1], outpic->linesize[1], inpic->data[1], inpic->linesize[1], cw, ch, &sab->chroma); - blur(outpic->data[2], outpic->linesize[2], inpic->data[2], inpic->linesize[2], cw, ch, &sab->chroma); + int cw = FF_CEIL_RSHIFT(inlink->w, s->hsub); + int ch = FF_CEIL_RSHIFT(inlink->h, s->vsub); + blur(outpic->data[1], outpic->linesize[1], inpic->data[1], inpic->linesize[1], cw, ch, &s->chroma); + blur(outpic->data[2], outpic->linesize[2], inpic->data[2], inpic->linesize[2], cw, ch, &s->chroma); } av_frame_free(&inpic);