Commit 95183d25 authored by Paul B Mahol's avatar Paul B Mahol

avfilter/vf_atadenoise: add sigma options

parent ee1d1c4b
......@@ -7096,6 +7096,15 @@ Alternatively can be set to @code{s} serial.
Parallel can be faster then serial, while other way around is never true.
Parallel will abort early on first change being greater then thresholds, while serial
will continue processing other side of frames if they are equal or below thresholds.
@item 0s
@item 1s
@item 2s
Set sigma for 1st plane, 2nd plane or 3rd plane. Default is 32767.
Valid range is from 0 to 32767.
This options controls weight for each pixel in radius defined by size.
Default value means every pixel have same weight.
Setting this option to 0 effectively disables filtering.
@end table
@subsection Commands
......
......@@ -31,12 +31,12 @@ enum ATAAlgorithm {
};
typedef struct ATADenoiseDSPContext {
void (*filter_row)(const uint8_t *src, uint8_t *dst,
const uint8_t **srcf,
int w, int mid, int size,
int thra, int thrb);
void (*filter_row[4])(const uint8_t *src, uint8_t *dst,
const uint8_t **srcf,
int w, int mid, int size,
int thra, int thrb, const float *weight);
} ATADenoiseDSPContext;
void ff_atadenoise_init_x86(ATADenoiseDSPContext *dsp, int depth, int algorithm);
void ff_atadenoise_init_x86(ATADenoiseDSPContext *dsp, int depth, int algorithm, const float *sigma);
#endif /* AVFILTER_ATADENOISE_H */
This diff is collapsed.
......@@ -28,22 +28,24 @@
void ff_atadenoise_filter_row8_sse4(const uint8_t *src, uint8_t *dst,
const uint8_t **srcf,
int w, int mid, int size,
int thra, int thrb);
int thra, int thrb, const float *weights);
void ff_atadenoise_filter_row8_serial_sse4(const uint8_t *src, uint8_t *dst,
const uint8_t **srcf,
int w, int mid, int size,
int thra, int thrb);
int thra, int thrb, const float *weights);
av_cold void ff_atadenoise_init_x86(ATADenoiseDSPContext *dsp, int depth, int algorithm)
av_cold void ff_atadenoise_init_x86(ATADenoiseDSPContext *dsp, int depth, int algorithm, const float *sigma)
{
int cpu_flags = av_get_cpu_flags();
if (ARCH_X86_64 && EXTERNAL_SSE4(cpu_flags) && depth <= 8 && algorithm == PARALLEL) {
dsp->filter_row = ff_atadenoise_filter_row8_sse4;
}
for (int p = 0; p < 4; p++) {
if (ARCH_X86_64 && EXTERNAL_SSE4(cpu_flags) && depth <= 8 && algorithm == PARALLEL && sigma[p] == INT16_MAX) {
dsp->filter_row[p] = ff_atadenoise_filter_row8_sse4;
}
if (ARCH_X86_64 && EXTERNAL_SSE4(cpu_flags) && depth <= 8 && algorithm == SERIAL) {
dsp->filter_row = ff_atadenoise_filter_row8_serial_sse4;
if (ARCH_X86_64 && EXTERNAL_SSE4(cpu_flags) && depth <= 8 && algorithm == SERIAL && sigma[p] == INT16_MAX) {
dsp->filter_row[p] = ff_atadenoise_filter_row8_serial_sse4;
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment