FFmpeg
4.0
|
#include "libavutil/avassert.h"
#include "libavutil/opt.h"
#include "libavutil/pixdesc.h"
#include "avfilter.h"
#include "formats.h"
#include "internal.h"
#include "video.h"
Go to the source code of this file.
Data Structures | |
struct | weighted_avg |
struct | NLMeansContext |
struct | thread_data |
Macros | |
#define | WEIGHT_LUT_NBITS 9 |
#define | WEIGHT_LUT_SIZE (1<<WEIGHT_LUT_NBITS) |
#define | OFFSET(x) offsetof(NLMeansContext, x) |
#define | FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM |
#define | CHECK_ODD_FIELD(field, name) |
Functions | |
AVFILTER_DEFINE_CLASS (nlmeans) | |
static int | query_formats (AVFilterContext *ctx) |
static int | get_integral_patch_value (const uint32_t *ii, int ii_lz_32, int x, int y, int p) |
static void | compute_safe_ssd_integral_image_c (uint32_t *dst, int dst_linesize_32, const uint8_t *s1, int linesize1, const uint8_t *s2, int linesize2, int w, int h) |
Compute squared difference of the safe area (the zone where s1 and s2 overlap). More... | |
static void | compute_unsafe_ssd_integral_image (uint32_t *dst, int dst_linesize_32, int startx, int starty, const uint8_t *src, int linesize, int offx, int offy, int r, int sw, int sh, int w, int h) |
Compute squared difference of an unsafe area (the zone nor s1 nor s2 could be readable). More... | |
static void | compute_ssd_integral_image (uint32_t *ii, int ii_linesize_32, const uint8_t *src, int linesize, int offx, int offy, int e, int w, int h) |
static int | config_input (AVFilterLink *inlink) |
static int | nlmeans_slice (AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs) |
static int | nlmeans_plane (AVFilterContext *ctx, int w, int h, int p, int r, uint8_t *dst, int dst_linesize, const uint8_t *src, int src_linesize) |
static int | filter_frame (AVFilterLink *inlink, AVFrame *in) |
static av_cold int | init (AVFilterContext *ctx) |
static av_cold void | uninit (AVFilterContext *ctx) |
Variables | |
static const AVOption | nlmeans_options [] |
static const AVFilterPad | nlmeans_inputs [] |
static const AVFilterPad | nlmeans_outputs [] |
AVFilter | ff_vf_nlmeans |
#define WEIGHT_LUT_NBITS 9 |
Definition at line 47 of file vf_nlmeans.c.
#define WEIGHT_LUT_SIZE (1<<WEIGHT_LUT_NBITS) |
Definition at line 48 of file vf_nlmeans.c.
Referenced by init().
#define OFFSET | ( | x | ) | offsetof(NLMeansContext, x) |
Definition at line 71 of file vf_nlmeans.c.
#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM |
Definition at line 72 of file vf_nlmeans.c.
#define CHECK_ODD_FIELD | ( | field, | |
name | |||
) |
Definition at line 473 of file vf_nlmeans.c.
Referenced by init().
AVFILTER_DEFINE_CLASS | ( | nlmeans | ) |
|
static |
Definition at line 84 of file vf_nlmeans.c.
|
inlinestatic |
Definition at line 132 of file vf_nlmeans.c.
Referenced by nlmeans_slice().
|
static |
Compute squared difference of the safe area (the zone where s1 and s2 overlap).
It is likely the largest integral zone, so it is interesting to do as little checks as possible; contrary to the unsafe version of this function, we do not need any clipping here.
The line above dst and the column to its left are always readable.
This C version computes the SSD integral image using a scalar accumulator, while for SIMD implementation it is likely more interesting to use the two-loops algorithm variant.
Definition at line 153 of file vf_nlmeans.c.
Referenced by compute_ssd_integral_image().
|
inlinestatic |
Compute squared difference of an unsafe area (the zone nor s1 nor s2 could be readable).
On the other hand, the line above dst and the column to its left are always readable.
There is little point in having this function SIMDified as it is likely too complex and only handle small portions of the image.
dst | integral image |
dst_linesize_32 | integral image linesize (in 32-bit integers unit) |
startx | integral starting x position |
starty | integral starting y position |
src | source plane buffer |
linesize | source plane linesize |
offx | source offsetting in x |
offy | source offsetting in y r absolute maximum source offsetting |
sw | source width |
sh | source height |
w | width to compute |
h | height to compute |
Definition at line 198 of file vf_nlmeans.c.
Referenced by compute_ssd_integral_image(), and main().
|
static |
Definition at line 240 of file vf_nlmeans.c.
Referenced by main(), and nlmeans_plane().
|
static |
Definition at line 303 of file vf_nlmeans.c.
|
static |
Definition at line 366 of file vf_nlmeans.c.
Referenced by nlmeans_plane().
|
static |
Definition at line 394 of file vf_nlmeans.c.
Referenced by filter_frame().
|
static |
Definition at line 445 of file vf_nlmeans.c.
|
static |
Definition at line 481 of file vf_nlmeans.c.
|
static |
Definition at line 515 of file vf_nlmeans.c.
|
static |
Definition at line 73 of file vf_nlmeans.c.
|
static |
Definition at line 522 of file vf_nlmeans.c.
|
static |
Definition at line 532 of file vf_nlmeans.c.
AVFilter ff_vf_nlmeans |
Definition at line 540 of file vf_nlmeans.c.