[FFmpeg-cvslog] x86/vvc/vvcdsp_init: coalesce function initializers

James Almer git at videolan.org
Tue May 14 17:18:47 EEST 2024


ffmpeg | branch: master | James Almer <jamrial at gmail.com> | Tue May 14 11:17:54 2024 -0300| [14aff7e45ec6a78a0e22b7debd9a407c6cfad69b] | committer: James Almer

x86/vvc/vvcdsp_init: coalesce function initializers

Signed-off-by: James Almer <jamrial at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=14aff7e45ec6a78a0e22b7debd9a407c6cfad69b
---

 libavcodec/x86/vvc/vvcdsp_init.c | 37 +++++++++++++++----------------------
 1 file changed, 15 insertions(+), 22 deletions(-)

diff --git a/libavcodec/x86/vvc/vvcdsp_init.c b/libavcodec/x86/vvc/vvcdsp_init.c
index ce4660d933..0e68971b2c 100644
--- a/libavcodec/x86/vvc/vvcdsp_init.c
+++ b/libavcodec/x86/vvc/vvcdsp_init.c
@@ -318,48 +318,41 @@ void ff_vvc_dsp_init_x86(VVCDSPContext *const c, const int bd)
 #if ARCH_X86_64
     const int cpu_flags = av_get_cpu_flags();
 
-    if (bd == 8) {
+    switch (bd) {
+    case 8:
         if (EXTERNAL_SSE4(cpu_flags)) {
             MC_LINK_SSE4(8);
         }
         if (EXTERNAL_AVX2_FAST(cpu_flags)) {
+            ALF_INIT(8);
+            AVG_INIT(8, avx2);
             MC_LINKS_AVX2(8);
         }
-    } else if (bd == 10) {
+        break;
+    case 10:
         if (EXTERNAL_SSE4(cpu_flags)) {
             MC_LINK_SSE4(10);
         }
         if (EXTERNAL_AVX2_FAST(cpu_flags)) {
+            ALF_INIT(10);
+            AVG_INIT(10, avx2);
             MC_LINKS_AVX2(10);
             MC_LINKS_16BPC_AVX2(10);
         }
-    } else if (bd == 12) {
+        break;
+    case 12:
         if (EXTERNAL_SSE4(cpu_flags)) {
             MC_LINK_SSE4(12);
         }
         if (EXTERNAL_AVX2_FAST(cpu_flags)) {
+            ALF_INIT(12);
+            AVG_INIT(12, avx2);
             MC_LINKS_AVX2(12);
             MC_LINKS_16BPC_AVX2(12);
         }
-    }
-
-    if (EXTERNAL_AVX2(cpu_flags)) {
-        switch (bd) {
-            case 8:
-                ALF_INIT(8);
-                AVG_INIT(8, avx2);
-                break;
-            case 10:
-                ALF_INIT(10);
-                AVG_INIT(10, avx2);
-                break;
-            case 12:
-                ALF_INIT(12);
-                AVG_INIT(12, avx2);
-                break;
-            default:
-                break;
-        }
+        break;
+    default:
+        break;
     }
 #endif
 }



More information about the ffmpeg-cvslog mailing list