summaryrefslogtreecommitdiff
path: root/libavfilter/x86/vf_atadenoise_init.c
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2021-01-21 18:48:27 +0100
committerPaul B Mahol <onemda@gmail.com>2021-01-22 16:21:22 +0100
commit95183d25e8900e7c7cb507a70616def0f5d1abf3 (patch)
tree2920001937e8f8897092276d31f0fa2f148337c4 /libavfilter/x86/vf_atadenoise_init.c
parentee1d1c4b377052635920a71f8fb2efd77ea3b38c (diff)
avfilter/vf_atadenoise: add sigma options
Diffstat (limited to 'libavfilter/x86/vf_atadenoise_init.c')
-rw-r--r--libavfilter/x86/vf_atadenoise_init.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/libavfilter/x86/vf_atadenoise_init.c b/libavfilter/x86/vf_atadenoise_init.c
index 1f69b1af3f..3f87f3c445 100644
--- a/libavfilter/x86/vf_atadenoise_init.c
+++ b/libavfilter/x86/vf_atadenoise_init.c
@@ -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;
+ }
}
}