Commit Graph

9 Commits

Author SHA1 Message Date
Xuewei Meng 9ca88b3bef avfilter/vf_guided: support single input
Support single input for guided filter by adding guidance mode.
If the guidance mode is off, single input is required. And
edge-preserving smoothing is conducted. If the mode is on, two
inputs are needed. The second input serves as the guidance. For
this mode, more tasks are supported, such as detail enhancement,
dehazing and so on.

Signed-off-by: Xuewei Meng <xwmeng96@gmail.com>
Reviewed-by: Steven Liu <lq@chinaffmpeg.org>
2021-06-29 16:05:31 +08:00
Andreas Rheinhardt a0ab83bf93 avfilter/vf_guided: Don't needlessly copy properties, fix potential NPD
ref_frame is owned by the framesync structure and should therefore not
be modified; furthermore, these properties that are copied don't seem to
be used at all, so copying is unnecessary. Finally copying when the
destination frame is NULL gives a guaranteed segfault.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-05-23 13:42:16 +02:00
Andreas Rheinhardt 376e80ad74 avfilter/vf_guided: Fix leak of frames
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-05-23 13:42:16 +02:00
Andreas Rheinhardt 618d186b8c avfilter/vf_guided: Don't free frame we don't own
Reviewed-by: Steven Liu <lq@chinaffmpeg.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-05-23 13:42:04 +02:00
Gyan Doshi 234e719194 avfilter/guided: reindent after 93ddb9b617 2021-05-14 15:37:45 +05:30
Gyan Doshi 93ddb9b617 avfilter/guided: simplify subsampling assignment.
Reduce option ranges to effective values.

Signed-off-by: Gyan Doshi <ffmpeg@gyani.pro>
Reviewed-by: Steven Liu <liuqi05@kuaishou.com>
2021-05-14 15:33:30 +05:30
Xuewei Meng 43d70feb78 GSoC: Support fast guided filter.
Two modes are supported in guided filter, basic mode and fast mode.
Basic mode is the initial pushed guided filter without optimization.
Fast mode is implemented based on the basic one by sub-sampling method.
The sub-sampling ratio which can be defined by users controls the
algorithm complexity. The larger the sub-sampling ratio, the lower
the algorithm complexity.

Signed-off-by: Xuewei Meng <xwmeng96@gmail.com>
Reviewed-by: Steven Liu <liuqi05@kuaishou.com>
2021-05-13 11:59:11 +08:00
Andreas Rheinhardt 7fac6efa97 avfilter/vf_guided: Add missing const
Forgotten in f8d910e90f.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-05-11 00:29:16 +02:00
Xuewei Meng f8d910e90f GSoC: Add guided filter
Add examples on how to use this filter, and improve the code style.
Implement the slice-level parallelism for guided filter.
Add the basic version of guided filter.

Signed-off-by: Xuewei Meng <xwmeng96@gmail.com>
Reviewed-by: Steven Liu <liuqi05@kuaishou.com>
2021-05-10 13:34:29 +08:00