diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-05-16 16:36:59 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-05-16 16:45:43 +0200 |
commit | df003cbb565575fe539b06105b76a95db72e8720 (patch) | |
tree | 996367e987cd9905305241c4e80d2a50ddb9147c /libavfilter/vf_gradfun.c | |
parent | e55092b12b572e53b3970ca261e9205ae4cabcb0 (diff) | |
parent | 4753f802c00853859b7b4b8fdb79c35e082cb7f8 (diff) | |
download | ffmpeg-df003cbb565575fe539b06105b76a95db72e8720.tar.gz |
Merge commit '4753f802c00853859b7b4b8fdb79c35e082cb7f8'
* commit '4753f802c00853859b7b4b8fdb79c35e082cb7f8':
vf_libopencv: use the name 's' for the pointer to the private context
vf_hqdn3d: use the name 's' for the pointer to the private context
vf_hflip: use the name 's' for the pointer to the private context
vf_gradfun: use the name 's' for the pointer to the private context
Conflicts:
libavfilter/vf_gradfun.c
libavfilter/vf_hflip.c
libavfilter/vf_hqdn3d.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavfilter/vf_gradfun.c')
-rw-r--r-- | libavfilter/vf_gradfun.c | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/libavfilter/vf_gradfun.c b/libavfilter/vf_gradfun.c index 299cbf5e2e..6e92e3eed2 100644 --- a/libavfilter/vf_gradfun.c +++ b/libavfilter/vf_gradfun.c @@ -123,26 +123,26 @@ static void filter(GradFunContext *ctx, uint8_t *dst, const uint8_t *src, int wi static av_cold int init(AVFilterContext *ctx) { - GradFunContext *gf = ctx->priv; + GradFunContext *s = ctx->priv; - gf->thresh = (1 << 15) / gf->strength; - gf->radius = av_clip((gf->radius + 1) & ~1, 4, 32); + s->thresh = (1 << 15) / s->strength; + s->radius = av_clip((s->radius + 1) & ~1, 4, 32); - gf->blur_line = ff_gradfun_blur_line_c; - gf->filter_line = ff_gradfun_filter_line_c; + s->blur_line = ff_gradfun_blur_line_c; + s->filter_line = ff_gradfun_filter_line_c; if (ARCH_X86) - ff_gradfun_init_x86(gf); + ff_gradfun_init_x86(s); - av_log(ctx, AV_LOG_VERBOSE, "threshold:%.2f radius:%d\n", gf->strength, gf->radius); + av_log(ctx, AV_LOG_VERBOSE, "threshold:%.2f radius:%d\n", s->strength, s->radius); return 0; } static av_cold void uninit(AVFilterContext *ctx) { - GradFunContext *gf = ctx->priv; - av_freep(&gf->buf); + GradFunContext *s = ctx->priv; + av_freep(&s->buf); } static int query_formats(AVFilterContext *ctx) @@ -163,25 +163,25 @@ static int query_formats(AVFilterContext *ctx) static int config_input(AVFilterLink *inlink) { - GradFunContext *gf = inlink->dst->priv; + GradFunContext *s = inlink->dst->priv; const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(inlink->format); int hsub = desc->log2_chroma_w; int vsub = desc->log2_chroma_h; - gf->buf = av_mallocz((FFALIGN(inlink->w, 16) * (gf->radius + 1) / 2 + 32) * sizeof(uint16_t)); - if (!gf->buf) + s->buf = av_mallocz((FFALIGN(inlink->w, 16) * (s->radius + 1) / 2 + 32) * sizeof(uint16_t)); + if (!s->buf) return AVERROR(ENOMEM); - gf->chroma_w = FF_CEIL_RSHIFT(inlink->w, hsub); - gf->chroma_h = FF_CEIL_RSHIFT(inlink->h, vsub); - gf->chroma_r = av_clip(((((gf->radius >> hsub) + (gf->radius >> vsub)) / 2 ) + 1) & ~1, 4, 32); + s->chroma_w = FF_CEIL_RSHIFT(inlink->w, hsub); + s->chroma_h = FF_CEIL_RSHIFT(inlink->h, vsub); + s->chroma_r = av_clip(((((s->radius >> hsub) + (s->radius >> vsub)) / 2 ) + 1) & ~1, 4, 32); return 0; } static int filter_frame(AVFilterLink *inlink, AVFrame *in) { - GradFunContext *gf = inlink->dst->priv; + GradFunContext *s = inlink->dst->priv; AVFilterLink *outlink = inlink->dst->outputs[0]; AVFrame *out; int p, direct; @@ -202,15 +202,15 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in) for (p = 0; p < 4 && in->data[p]; p++) { int w = inlink->w; int h = inlink->h; - int r = gf->radius; + int r = s->radius; if (p) { - w = gf->chroma_w; - h = gf->chroma_h; - r = gf->chroma_r; + w = s->chroma_w; + h = s->chroma_h; + r = s->chroma_r; } if (FFMIN(w, h) > 2 * r) - filter(gf, out->data[p], in->data[p], w, h, out->linesize[p], in->linesize[p], r); + filter(s, out->data[p], in->data[p], w, h, out->linesize[p], in->linesize[p], r); else if (out->data[p] != in->data[p]) av_image_copy_plane(out->data[p], out->linesize[p], in->data[p], in->linesize[p], w, h); } |