History

x86/vvc/vvcdsp_init: coalesce function initializers

James Almer committed 2 years ago

Commit 14aff7e1 parent 3fa98f21 file · +15 −22Browse files

Unified · Split

libavcodec/x86/vvc/vvcdsp_init.c+15−22
@@ -318,48 +318,41 @@ void ff_vvc_dsp_init_x86(VVCDSPContext *const c, const int bd) · 317 unmodified lines
318318 #if ARCH_X86_64
319319 const int cpu_flags = av_get_cpu_flags();
320320
321− if (bd == 8) {
321+ switch (bd) {
322+ case 8:
322323 if (EXTERNAL_SSE4(cpu_flags)) {
323324 MC_LINK_SSE4(8);
324325 }
325326 if (EXTERNAL_AVX2_FAST(cpu_flags)) {
327+ ALF_INIT(8);
328+ AVG_INIT(8, avx2);
326329 MC_LINKS_AVX2(8);
327330 }
328− } else if (bd == 10) {
331+ break;
332+ case 10:
329333 if (EXTERNAL_SSE4(cpu_flags)) {
330334 MC_LINK_SSE4(10);
331335 }
332336 if (EXTERNAL_AVX2_FAST(cpu_flags)) {
337+ ALF_INIT(10);
338+ AVG_INIT(10, avx2);
333339 MC_LINKS_AVX2(10);
334340 MC_LINKS_16BPC_AVX2(10);
335341 }
336− } else if (bd == 12) {
342+ break;
343+ case 12:
337344 if (EXTERNAL_SSE4(cpu_flags)) {
338345 MC_LINK_SSE4(12);
339346 }
340347 if (EXTERNAL_AVX2_FAST(cpu_flags)) {
348+ ALF_INIT(12);
349+ AVG_INIT(12, avx2);
341350 MC_LINKS_AVX2(12);
342351 MC_LINKS_16BPC_AVX2(12);
343352 }
344− }
345−
346− if (EXTERNAL_AVX2(cpu_flags)) {
347− switch (bd) {
348− case 8:
349− ALF_INIT(8);
350− AVG_INIT(8, avx2);
351− break;
352− case 10:
353− ALF_INIT(10);
354− AVG_INIT(10, avx2);
355− break;
356− case 12:
357− ALF_INIT(12);
358− AVG_INIT(12, avx2);
359− break;
360− default:
361− break;
362− }
353+ break;
354+ default:
355+ break;
363356 }
364357 #endif
365358 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t