diff options
author | Stefano Sabatini <stefasab@gmail.com> | 2011-10-23 18:57:07 +0200 |
---|---|---|
committer | Stefano Sabatini <stefasab@gmail.com> | 2011-10-23 23:54:37 +0200 |
commit | 1679a40b74102f969404564518b77001ac0a5092 (patch) | |
tree | 58cba6fa9a51bdf9c26cad54040bf889423eb121 /libavfilter/vf_boxblur.c | |
parent | 9eb867e11790ec4e30662244954c8f20dac99def (diff) | |
download | ffmpeg-streaming-1679a40b74102f969404564518b77001ac0a5092.zip ffmpeg-streaming-1679a40b74102f969404564518b77001ac0a5092.tar.gz |
vf_boxblur: fix slice-drawing
This filter does not support slice-drawing, the whole blurred image needs
to be written in end_frame().
Diffstat (limited to 'libavfilter/vf_boxblur.c')
-rw-r--r-- | libavfilter/vf_boxblur.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/libavfilter/vf_boxblur.c b/libavfilter/vf_boxblur.c index 8d82c43..1f8e0f6 100644 --- a/libavfilter/vf_boxblur.c +++ b/libavfilter/vf_boxblur.c @@ -298,7 +298,9 @@ static void vblur(uint8_t *dst, int dst_linesize, const uint8_t *src, int src_li h, radius, power, temp); } -static void draw_slice(AVFilterLink *inlink, int y0, int h0, int slice_dir) +static void null_draw_slice(AVFilterLink *inlink, int y, int h, int slice_dir) { } + +static void end_frame(AVFilterLink *inlink) { AVFilterContext *ctx = inlink->dst; BoxBlurContext *boxblur = ctx->priv; @@ -306,9 +308,9 @@ static void draw_slice(AVFilterLink *inlink, int y0, int h0, int slice_dir) AVFilterBufferRef *inpicref = inlink ->cur_buf; AVFilterBufferRef *outpicref = outlink->out_buf; int plane; - int cw = inlink->w >> boxblur->hsub, ch = h0 >> boxblur->vsub; + int cw = inlink->w >> boxblur->hsub, ch = inlink->h >> boxblur->vsub; int w[4] = { inlink->w, cw, cw, inlink->w }; - int h[4] = { h0, ch, ch, h0 }; + int h[4] = { inlink->h, ch, ch, inlink->h }; for (plane = 0; inpicref->data[plane] && plane < 4; plane++) hblur(outpicref->data[plane], outpicref->linesize[plane], @@ -322,7 +324,8 @@ static void draw_slice(AVFilterLink *inlink, int y0, int h0, int slice_dir) w[plane], h[plane], boxblur->radius[plane], boxblur->power[plane], boxblur->temp); - avfilter_draw_slice(outlink, y0, h0, slice_dir); + avfilter_draw_slice(outlink, 0, inlink->h, 1); + avfilter_end_frame(outlink); } AVFilter avfilter_vf_boxblur = { @@ -336,10 +339,11 @@ AVFilter avfilter_vf_boxblur = { .inputs = (AVFilterPad[]) {{ .name = "default", .type = AVMEDIA_TYPE_VIDEO, .config_props = config_input, - .draw_slice = draw_slice, + .draw_slice = null_draw_slice, + .end_frame = end_frame, .min_perms = AV_PERM_READ }, { .name = NULL}}, .outputs = (AVFilterPad[]) {{ .name = "default", .type = AVMEDIA_TYPE_VIDEO, }, { .name = NULL}}, -};
\ No newline at end of file +}; |