]> git.sesse.net Git - ffmpeg/blobdiff - libavfilter/x86/vf_atadenoise_init.c
avdevice/avdevice: Constify avdevice_list_input_sources/output_sinks
[ffmpeg] / libavfilter / x86 / vf_atadenoise_init.c
index 1f69b1af3f669fd654eb8107d5818a61b1de2a98..3f87f3c445f6efaea584de19563d02211b14dfc9 100644 (file)
 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;
+        }
     }
 }