Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: mkver via ffmpeg-devel <ffmpeg-devel@ffmpeg.org>
To: ffmpeg-devel@ffmpeg.org
Cc: mkver <code@ffmpeg.org>
Subject: [FFmpeg-devel] [PATCH] vf_noise (PR #20699)
Date: Mon, 13 Oct 2025 16:56:56 -0000
Message-ID: <176037461733.25.7482280556874605784@bf907ddaa564> (raw)

PR #20699 opened by mkver
URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/20699
Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/20699.patch


>From f868a52fd1642daf745e15b4684c9e5631db68a3 Mon Sep 17 00:00:00 2001
From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Date: Mon, 13 Oct 2025 06:20:07 +0200
Subject: [PATCH 1/7] avfilter/vf_noise: Make private context smaller

"all" only exists to set options; it does not need the big arrays
contained in FilterParams.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavfilter/vf_noise.h | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/libavfilter/vf_noise.h b/libavfilter/vf_noise.h
index 92998e54c9..25876baab5 100644
--- a/libavfilter/vf_noise.h
+++ b/libavfilter/vf_noise.h
@@ -50,7 +50,10 @@ typedef struct NoiseContext {
     int nb_planes;
     int bytewidth[4];
     int height[4];
-    FilterParams all;
+    struct {
+        int seed, strength;
+        unsigned flags;
+    } all;
     FilterParams param[4];
     void (*line_noise)(uint8_t *dst, const uint8_t *src, const int8_t *noise, int len, int shift);
     void (*line_noise_avg)(uint8_t *dst, const uint8_t *src, int len, const int8_t * const *shift);
-- 
2.49.1


>From 8b2900b61fdc4da6bcd6bf7a2d162f97ac63d9fe Mon Sep 17 00:00:00 2001
From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Date: Mon, 13 Oct 2025 09:43:38 +0200
Subject: [PATCH 2/7] avfilter/vf_noise: Don't write beyond end-of-array

This is not only UB, but also leads to races and nondeterministic
output, because the write one last the end of the buffer actually
conflicts with accesses by the thread that actually owns it.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavfilter/vf_noise.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavfilter/vf_noise.c b/libavfilter/vf_noise.c
index a6613f663e..69ea528788 100644
--- a/libavfilter/vf_noise.c
+++ b/libavfilter/vf_noise.c
@@ -214,7 +214,7 @@ static void noise(uint8_t *dst, const uint8_t *src,
 
             if (flags & NOISE_AVERAGED) {
                 n->line_noise_avg(dst + x, src + x, w, (const int8_t**)p->prev_shift[ix]);
-                p->prev_shift[ix][shift & 3] = noise + shift;
+                p->prev_shift[ix][shift % 3] = noise + shift;
             } else {
                 n->line_noise(dst + x, src + x, noise, w, shift);
             }
-- 
2.49.1


>From 2f4fc55e77034ace360961ad86f0e1030f039a17 Mon Sep 17 00:00:00 2001
From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Date: Mon, 13 Oct 2025 10:26:06 +0200
Subject: [PATCH 3/7] avfilter/vf_noise: Fix race with very tall images

When using averaged noise with height > MAX_RES (i.e. 4096),
multiple threads would access the same prev_shift slot,
leading to races. Fix this by disabling slice threading
in such scenarios.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavfilter/vf_noise.c | 5 ++++-
 libavfilter/vf_noise.h | 1 +
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/libavfilter/vf_noise.c b/libavfilter/vf_noise.c
index 69ea528788..5b88b76e05 100644
--- a/libavfilter/vf_noise.c
+++ b/libavfilter/vf_noise.c
@@ -271,12 +271,15 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *inpicref)
                 fp->rand_shift[i] = av_lfg_get(&fp->lfg) & (MAX_SHIFT - 1);
             }
             fp->rand_shift_init = 1;
+            if (fp->flags & NOISE_AVERAGED && outlink->h > MAX_RES)
+                n->slice_threading_impossible = 1;
         }
     }
 
     td.in = inpicref; td.out = out;
     ff_filter_execute(ctx, filter_slice, &td, NULL,
-                      FFMIN(n->height[0], ff_filter_get_nb_threads(ctx)));
+                      n->slice_threading_impossible ? 1 :
+                          FFMIN(n->height[0], ff_filter_get_nb_threads(ctx)));
     emms_c();
 
     if (inpicref != out)
diff --git a/libavfilter/vf_noise.h b/libavfilter/vf_noise.h
index 25876baab5..62d7bee02c 100644
--- a/libavfilter/vf_noise.h
+++ b/libavfilter/vf_noise.h
@@ -50,6 +50,7 @@ typedef struct NoiseContext {
     int nb_planes;
     int bytewidth[4];
     int height[4];
+    int slice_threading_impossible;
     struct {
         int seed, strength;
         unsigned flags;
-- 
2.49.1


>From d9828d1ded3ca490ad9a183938b04904ffda9c95 Mon Sep 17 00:00:00 2001
From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Date: Mon, 13 Oct 2025 12:20:32 +0200
Subject: [PATCH 4/7] avfilter/vf_noise: Avoid cast

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavfilter/vf_noise.c | 2 +-
 libavfilter/vf_noise.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavfilter/vf_noise.c b/libavfilter/vf_noise.c
index 5b88b76e05..43e7ad6c45 100644
--- a/libavfilter/vf_noise.c
+++ b/libavfilter/vf_noise.c
@@ -213,7 +213,7 @@ static void noise(uint8_t *dst, const uint8_t *src,
             int shift = p->rand_shift[ix];
 
             if (flags & NOISE_AVERAGED) {
-                n->line_noise_avg(dst + x, src + x, w, (const int8_t**)p->prev_shift[ix]);
+                n->line_noise_avg(dst + x, src + x, w, p->prev_shift[ix]);
                 p->prev_shift[ix][shift % 3] = noise + shift;
             } else {
                 n->line_noise(dst + x, src + x, noise, w, shift);
diff --git a/libavfilter/vf_noise.h b/libavfilter/vf_noise.h
index 62d7bee02c..081a0bbf77 100644
--- a/libavfilter/vf_noise.h
+++ b/libavfilter/vf_noise.h
@@ -40,7 +40,7 @@ typedef struct FilterParams {
     AVLFG lfg;
     int seed;
     int8_t *noise;
-    int8_t *prev_shift[MAX_RES][3];
+    const int8_t *prev_shift[MAX_RES][3];
     int rand_shift[MAX_RES];
     int rand_shift_init;
 } FilterParams;
-- 
2.49.1


>From abab9a2ff60808a2239fbd9a0848a7117788cc79 Mon Sep 17 00:00:00 2001
From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Date: Mon, 13 Oct 2025 13:16:22 +0200
Subject: [PATCH 5/7] avfilter/x86/vf_noise: Make line_noise_avg_mmx() match C
 function

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavfilter/x86/vf_noise.c | 29 ++++++++++++++++-------------
 1 file changed, 16 insertions(+), 13 deletions(-)

diff --git a/libavfilter/x86/vf_noise.c b/libavfilter/x86/vf_noise.c
index 43387c9908..2a7646728f 100644
--- a/libavfilter/x86/vf_noise.c
+++ b/libavfilter/x86/vf_noise.c
@@ -33,27 +33,30 @@ static void line_noise_avg_mmx(uint8_t *dst, const uint8_t *src,
 
     __asm__ volatile(
             "mov %5, %%"FF_REG_a"           \n\t"
+            "pxor   %%mm4, %%mm4            \n\t"
             ".p2align 4                     \n\t"
             "1:                             \n\t"
             "movq (%1, %%"FF_REG_a"), %%mm1 \n\t"
             "movq (%0, %%"FF_REG_a"), %%mm0 \n\t"
             "paddb (%2, %%"FF_REG_a"), %%mm1\n\t"
             "paddb (%3, %%"FF_REG_a"), %%mm1\n\t"
+            "movq %%mm4, %%mm5              \n\t"
+            "pcmpgtb %%mm0, %%mm5           \n\t"
+            "movq %%mm0, %%mm6              \n\t"
             "movq %%mm0, %%mm2              \n\t"
+            "punpcklbw %%mm5, %%mm0         \n\t"
+            "punpckhbw %%mm5, %%mm2         \n\t"
+            "movq %%mm4, %%mm5              \n\t"
+            "pcmpgtb %%mm1, %%mm5           \n\t"
             "movq %%mm1, %%mm3              \n\t"
-            "punpcklbw %%mm0, %%mm0         \n\t"
-            "punpckhbw %%mm2, %%mm2         \n\t"
-            "punpcklbw %%mm1, %%mm1         \n\t"
-            "punpckhbw %%mm3, %%mm3         \n\t"
-            "pmulhw %%mm0, %%mm1            \n\t"
-            "pmulhw %%mm2, %%mm3            \n\t"
-            "paddw %%mm1, %%mm1             \n\t"
-            "paddw %%mm3, %%mm3             \n\t"
-            "paddw %%mm0, %%mm1             \n\t"
-            "paddw %%mm2, %%mm3             \n\t"
-            "psrlw $8, %%mm1                \n\t"
-            "psrlw $8, %%mm3                \n\t"
-            "packuswb %%mm3, %%mm1          \n\t"
+            "punpcklbw %%mm5, %%mm1         \n\t"
+            "punpckhbw %%mm5, %%mm3         \n\t"
+            "pmullw %%mm0, %%mm1            \n\t"
+            "pmullw %%mm2, %%mm3            \n\t"
+            "psraw $7, %%mm1                \n\t"
+            "psraw $7, %%mm3                \n\t"
+            "packsswb %%mm3, %%mm1          \n\t"
+            "paddb %%mm6, %%mm1             \n\t"
             "movq %%mm1, (%4, %%"FF_REG_a") \n\t"
             "add $8, %%"FF_REG_a"           \n\t"
             " js 1b                         \n\t"
-- 
2.49.1


>From 35788171b0cdc60100f537efcf8ebe7013c80aea Mon Sep 17 00:00:00 2001
From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Date: Mon, 13 Oct 2025 15:35:35 +0200
Subject: [PATCH 6/7] avfilter/x86/vf_noise: Port line_noise funcs to SSE2

This avoids having to fix up ABI violations via emms_c and
also leads to a 73% speedup for the line noise average version
here.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavfilter/vf_noise.c     |   2 -
 libavfilter/x86/vf_noise.c | 120 ++++++++++++++++++-------------------
 2 files changed, 60 insertions(+), 62 deletions(-)

diff --git a/libavfilter/vf_noise.c b/libavfilter/vf_noise.c
index 43e7ad6c45..74d63fe61b 100644
--- a/libavfilter/vf_noise.c
+++ b/libavfilter/vf_noise.c
@@ -24,7 +24,6 @@
  * noise generator
  */
 
-#include "libavutil/emms.h"
 #include "libavutil/mem.h"
 #include "libavutil/opt.h"
 #include "libavutil/imgutils.h"
@@ -280,7 +279,6 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *inpicref)
     ff_filter_execute(ctx, filter_slice, &td, NULL,
                       n->slice_threading_impossible ? 1 :
                           FFMIN(n->height[0], ff_filter_get_nb_threads(ctx)));
-    emms_c();
 
     if (inpicref != out)
         av_frame_free(&inpicref);
diff --git a/libavfilter/x86/vf_noise.c b/libavfilter/x86/vf_noise.c
index 2a7646728f..e3df0f553b 100644
--- a/libavfilter/x86/vf_noise.c
+++ b/libavfilter/x86/vf_noise.c
@@ -26,78 +26,80 @@
 
 #if HAVE_INLINE_ASM
 #if HAVE_6REGS
-static void line_noise_avg_mmx(uint8_t *dst, const uint8_t *src,
-                                      int len, const int8_t * const *shift)
+static void line_noise_avg_sse2(uint8_t *dst, const uint8_t *src,
+                                int len, const int8_t * const *shift)
 {
-    x86_reg mmx_len = len & (~7);
+    x86_reg xmm_len = len & (~15);
 
     __asm__ volatile(
-            "mov %5, %%"FF_REG_a"           \n\t"
-            "pxor   %%mm4, %%mm4            \n\t"
-            ".p2align 4                     \n\t"
-            "1:                             \n\t"
-            "movq (%1, %%"FF_REG_a"), %%mm1 \n\t"
-            "movq (%0, %%"FF_REG_a"), %%mm0 \n\t"
-            "paddb (%2, %%"FF_REG_a"), %%mm1\n\t"
-            "paddb (%3, %%"FF_REG_a"), %%mm1\n\t"
-            "movq %%mm4, %%mm5              \n\t"
-            "pcmpgtb %%mm0, %%mm5           \n\t"
-            "movq %%mm0, %%mm6              \n\t"
-            "movq %%mm0, %%mm2              \n\t"
-            "punpcklbw %%mm5, %%mm0         \n\t"
-            "punpckhbw %%mm5, %%mm2         \n\t"
-            "movq %%mm4, %%mm5              \n\t"
-            "pcmpgtb %%mm1, %%mm5           \n\t"
-            "movq %%mm1, %%mm3              \n\t"
-            "punpcklbw %%mm5, %%mm1         \n\t"
-            "punpckhbw %%mm5, %%mm3         \n\t"
-            "pmullw %%mm0, %%mm1            \n\t"
-            "pmullw %%mm2, %%mm3            \n\t"
-            "psraw $7, %%mm1                \n\t"
-            "psraw $7, %%mm3                \n\t"
-            "packsswb %%mm3, %%mm1          \n\t"
-            "paddb %%mm6, %%mm1             \n\t"
-            "movq %%mm1, (%4, %%"FF_REG_a") \n\t"
-            "add $8, %%"FF_REG_a"           \n\t"
+            "mov                    %5, %%"FF_REG_a"       \n\t"
+            "pxor               %%xmm4, %%xmm4             \n\t"
+            ".p2align 4                                    \n\t"
+            "1:                                            \n\t"
+            "movdqu (%1, %%"FF_REG_a"), %%xmm1             \n\t"
+            "movdqu (%2, %%"FF_REG_a"), %%xmm2             \n\t"
+            "movdqu (%3, %%"FF_REG_a"), %%xmm3             \n\t"
+            "movdqa (%0, %%"FF_REG_a"), %%xmm0             \n\t"
+            "paddb              %%xmm2, %%xmm1             \n\t"
+            "paddb              %%xmm3, %%xmm1             \n\t"
+            "movdqa             %%xmm4, %%xmm5             \n\t"
+            "pcmpgtb            %%xmm0, %%xmm5             \n\t"
+            "movdqa             %%xmm0, %%xmm6             \n\t"
+            "movdqa             %%xmm0, %%xmm2             \n\t"
+            "punpcklbw          %%xmm5, %%xmm0             \n\t"
+            "punpckhbw          %%xmm5, %%xmm2             \n\t"
+            "movdqa             %%xmm4, %%xmm5             \n\t"
+            "pcmpgtb            %%xmm1, %%xmm5             \n\t"
+            "movdqa             %%xmm1, %%xmm3             \n\t"
+            "punpcklbw          %%xmm5, %%xmm1             \n\t"
+            "punpckhbw          %%xmm5, %%xmm3             \n\t"
+            "pmullw             %%xmm0, %%xmm1             \n\t"
+            "pmullw             %%xmm2, %%xmm3             \n\t"
+            "psraw                  $7, %%xmm1             \n\t"
+            "psraw                  $7, %%xmm3             \n\t"
+            "packsswb           %%xmm3, %%xmm1             \n\t"
+            "paddb              %%xmm6, %%xmm1             \n\t"
+            "movdqa             %%xmm1, (%4, %%"FF_REG_a") \n\t"
+            "add                   $16, %%"FF_REG_a"       \n\t"
             " js 1b                         \n\t"
-            :: "r" (src+mmx_len), "r" (shift[0]+mmx_len), "r" (shift[1]+mmx_len), "r" (shift[2]+mmx_len),
-               "r" (dst+mmx_len), "g" (-mmx_len)
+            :: "r" (src+xmm_len), "r" (shift[0]+xmm_len), "r" (shift[1]+xmm_len), "r" (shift[2]+xmm_len),
+               "r" (dst+xmm_len), "g" (-xmm_len)
             : "%"FF_REG_a
         );
 
-    if (mmx_len != len){
-        const int8_t *shift2[3] = { shift[0]+mmx_len, shift[1]+mmx_len, shift[2]+mmx_len };
-        ff_line_noise_avg_c(dst+mmx_len, src+mmx_len, len-mmx_len, shift2);
+    if (xmm_len != len){
+        const int8_t *shift2[3] = { shift[0]+xmm_len, shift[1]+xmm_len, shift[2]+xmm_len };
+        ff_line_noise_avg_c(dst + xmm_len, src + xmm_len, len - xmm_len, shift2);
     }
 }
 #endif /* HAVE_6REGS */
 
-static void line_noise_mmxext(uint8_t *dst, const uint8_t *src,
-                              const int8_t *noise, int len, int shift)
+static void line_noise_sse2(uint8_t *dst, const uint8_t *src,
+                            const int8_t *noise, int len, int shift)
 {
-    x86_reg mmx_len = len & (~7);
+    x86_reg xmm_len = len & (~15);
     noise += shift;
 
     __asm__ volatile(
-            "mov %3, %%"FF_REG_a"             \n\t"
-            "pcmpeqb %%mm7, %%mm7             \n\t"
-            "psllw $15, %%mm7                 \n\t"
-            "packsswb %%mm7, %%mm7            \n\t"
-            ".p2align 4                       \n\t"
-            "1:                               \n\t"
-            "movq (%0, %%"FF_REG_a"), %%mm0   \n\t"
-            "movq (%1, %%"FF_REG_a"), %%mm1   \n\t"
-            "pxor %%mm7, %%mm0                \n\t"
-            "paddsb %%mm1, %%mm0              \n\t"
-            "pxor %%mm7, %%mm0                \n\t"
-            "movntq %%mm0, (%2, %%"FF_REG_a") \n\t"
-            "add $8, %%"FF_REG_a"             \n\t"
-            " js 1b                           \n\t"
-            :: "r" (src+mmx_len), "r" (noise+mmx_len), "r" (dst+mmx_len), "g" (-mmx_len)
+            "mov                    %3, %%"FF_REG_a"       \n\t"
+            "pcmpeqb            %%xmm7, %%xmm7             \n\t"
+            "psllw                 $15, %%xmm7             \n\t"
+            "packsswb           %%xmm7, %%xmm7             \n\t"
+            ".p2align 4                                    \n\t"
+            "1:                                            \n\t"
+            "movdqa (%0, %%"FF_REG_a"), %%xmm0             \n\t"
+            "movdqu (%1, %%"FF_REG_a"), %%xmm1             \n\t"
+            "pxor               %%xmm7, %%xmm0             \n\t"
+            "paddsb             %%xmm1, %%xmm0             \n\t"
+            "pxor               %%xmm7, %%xmm0             \n\t"
+            "movntdq            %%xmm0, (%2, %%"FF_REG_a") \n\t"
+            "add                   $16, %%"FF_REG_a"       \n\t"
+            " js                    1b                     \n\t"
+            :: "r" (src+xmm_len), "r" (noise+xmm_len), "r" (dst+xmm_len), "g" (-xmm_len)
             : "%"FF_REG_a
             );
-    if (mmx_len != len)
-        ff_line_noise_c(dst+mmx_len, src+mmx_len, noise+mmx_len, len-mmx_len, 0);
+    if (xmm_len != len)
+        ff_line_noise_c(dst+xmm_len, src + xmm_len, noise + xmm_len, len - xmm_len, 0);
 }
 #endif /* HAVE_INLINE_ASM */
 
@@ -106,13 +108,11 @@ av_cold void ff_noise_init_x86(NoiseContext *n)
 #if HAVE_INLINE_ASM
     int cpu_flags = av_get_cpu_flags();
 
-    if (INLINE_MMX(cpu_flags)) {
+    if (INLINE_SSE2(cpu_flags)) {
 #if HAVE_6REGS
-        n->line_noise_avg = line_noise_avg_mmx;
+        n->line_noise_avg = line_noise_avg_sse2;
 #endif
-    }
-    if (INLINE_MMXEXT(cpu_flags)) {
-        n->line_noise     = line_noise_mmxext;
+        n->line_noise     = line_noise_sse2;
     }
 #endif
 }
-- 
2.49.1


>From 66fd0d4dc7d9ff7797307523fb0e4cc403288800 Mon Sep 17 00:00:00 2001
From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Date: Mon, 13 Oct 2025 18:55:15 +0200
Subject: [PATCH 7/7] avfilter/vf_noise: Deduplicate option flags

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavfilter/vf_noise.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/libavfilter/vf_noise.c b/libavfilter/vf_noise.c
index 74d63fe61b..ae4a08ca50 100644
--- a/libavfilter/vf_noise.c
+++ b/libavfilter/vf_noise.c
@@ -46,12 +46,8 @@ typedef struct ThreadData {
     {#name"_seed", "set component #"#x" noise seed", OFFSET(param.seed), AV_OPT_TYPE_INT, {.i64=-1}, -1, INT_MAX, FLAGS},        \
     {#name"_strength", "set component #"#x" strength", OFFSET(param.strength), AV_OPT_TYPE_INT, {.i64=0}, 0, 100, FLAGS},        \
     {#name"s",         "set component #"#x" strength", OFFSET(param.strength), AV_OPT_TYPE_INT, {.i64=0}, 0, 100, FLAGS},        \
-    {#name"_flags", "set component #"#x" flags", OFFSET(param.flags), AV_OPT_TYPE_FLAGS, {.i64=0}, 0, 31, FLAGS, .unit = #name"_flags"}, \
-    {#name"f", "set component #"#x" flags", OFFSET(param.flags), AV_OPT_TYPE_FLAGS, {.i64=0}, 0, 31, FLAGS, .unit = #name"_flags"},      \
-    {"a", "averaged noise", 0, AV_OPT_TYPE_CONST, {.i64=NOISE_AVERAGED}, 0, 0, FLAGS, .unit = #name"_flags"},                            \
-    {"p", "(semi)regular pattern", 0, AV_OPT_TYPE_CONST, {.i64=NOISE_PATTERN},  0, 0, FLAGS, .unit = #name"_flags"},                     \
-    {"t", "temporal noise", 0, AV_OPT_TYPE_CONST, {.i64=NOISE_TEMPORAL}, 0, 0, FLAGS, .unit = #name"_flags"},                            \
-    {"u", "uniform noise",  0, AV_OPT_TYPE_CONST, {.i64=NOISE_UNIFORM},  0, 0, FLAGS, .unit = #name"_flags"},
+    {#name"_flags", "set component #"#x" flags", OFFSET(param.flags), AV_OPT_TYPE_FLAGS, {.i64=0}, 0, 31, FLAGS, .unit = "flags"}, \
+    {#name"f", "set component #"#x" flags", OFFSET(param.flags), AV_OPT_TYPE_FLAGS, {.i64=0}, 0, 31, FLAGS, .unit = "flags"},      \
 
 static const AVOption noise_options[] = {
     NOISE_PARAMS(all, 0, all)
@@ -59,6 +55,10 @@ static const AVOption noise_options[] = {
     NOISE_PARAMS(c1,  1, param[1])
     NOISE_PARAMS(c2,  2, param[2])
     NOISE_PARAMS(c3,  3, param[3])
+    {"a", "averaged noise", 0, AV_OPT_TYPE_CONST, {.i64=NOISE_AVERAGED}, 0, 0, FLAGS, .unit = "flags"},
+    {"p", "(semi)regular pattern", 0, AV_OPT_TYPE_CONST, {.i64=NOISE_PATTERN},  0, 0, FLAGS, .unit = "flags"},
+    {"t", "temporal noise", 0, AV_OPT_TYPE_CONST, {.i64=NOISE_TEMPORAL}, 0, 0, FLAGS, .unit = "flags"},
+    {"u", "uniform noise",  0, AV_OPT_TYPE_CONST, {.i64=NOISE_UNIFORM},  0, 0, FLAGS, .unit = "flags"},
     {NULL}
 };
 
-- 
2.49.1

_______________________________________________
ffmpeg-devel mailing list -- ffmpeg-devel@ffmpeg.org
To unsubscribe send an email to ffmpeg-devel-leave@ffmpeg.org

                 reply	other threads:[~2025-10-13 16:57 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=176037461733.25.7482280556874605784@bf907ddaa564 \
    --to=ffmpeg-devel@ffmpeg.org \
    --cc=code@ffmpeg.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git