Unified · Split
| @@ -31,6 +31,7 @@ · 30 unmodified lines | ||
| 31 | 31 | #include "libavcodec/vvc/vvcdsp.h" |
| 32 | 32 | #include "libavcodec/x86/h26x/h2656dsp.h" |
| 33 | 33 | |
| 34 | +#if ARCH_X86_64 | |
| 34 | 35 | #define FW_PUT(name, depth, opt) \ |
| 35 | 36 | static void ff_vvc_put_ ## name ## _ ## depth ## _##opt(int16_t *dst, const uint8_t *src, ptrdiff_t srcstride, \ |
| 36 | 37 | int height, const int8_t *hf, const int8_t *vf, int width) \ |
| @@ -204,51 +205,52 @@ AVG_FUNCS(16, 12, avx2) · 167 unmodified lines | ||
| 204 | 205 | c->inter.avg = bf(avg, bd, opt); \ |
| 205 | 206 | c->inter.w_avg = bf(w_avg, bd, opt); \ |
| 206 | 207 | } while (0) |
| 208 | +#endif | |
| 207 | 209 | |
| 208 | 210 | void ff_vvc_dsp_init_x86(VVCDSPContext *const c, const int bd) |
| 209 | 211 | { |
| 212 | +#if ARCH_X86_64 | |
| 210 | 213 | const int cpu_flags = av_get_cpu_flags(); |
| 211 | 214 | |
| 212 | − if (ARCH_X86_64) { | |
| 213 | − if (bd == 8) { | |
| 214 | − if (EXTERNAL_SSE4(cpu_flags)) { | |
| 215 | − MC_LINK_SSE4(8); | |
| 216 | − } | |
| 217 | − if (EXTERNAL_AVX2_FAST(cpu_flags)) { | |
| 218 | − MC_LINKS_AVX2(8); | |
| 219 | − } | |
| 220 | − } else if (bd == 10) { | |
| 221 | − if (EXTERNAL_SSE4(cpu_flags)) { | |
| 222 | − MC_LINK_SSE4(10); | |
| 223 | − } | |
| 224 | − if (EXTERNAL_AVX2_FAST(cpu_flags)) { | |
| 225 | − MC_LINKS_AVX2(10); | |
| 226 | − MC_LINKS_16BPC_AVX2(10); | |
| 227 | − } | |
| 228 | − } else if (bd == 12) { | |
| 229 | − if (EXTERNAL_SSE4(cpu_flags)) { | |
| 230 | − MC_LINK_SSE4(12); | |
| 231 | − } | |
| 232 | − if (EXTERNAL_AVX2_FAST(cpu_flags)) { | |
| 233 | − MC_LINKS_AVX2(12); | |
| 234 | − MC_LINKS_16BPC_AVX2(12); | |
| 235 | − } | |
| 215 | + if (bd == 8) { | |
| 216 | + if (EXTERNAL_SSE4(cpu_flags)) { | |
| 217 | + MC_LINK_SSE4(8); | |
| 236 | 218 | } |
| 219 | + if (EXTERNAL_AVX2_FAST(cpu_flags)) { | |
| 220 | + MC_LINKS_AVX2(8); | |
| 221 | + } | |
| 222 | + } else if (bd == 10) { | |
| 223 | + if (EXTERNAL_SSE4(cpu_flags)) { | |
| 224 | + MC_LINK_SSE4(10); | |
| 225 | + } | |
| 226 | + if (EXTERNAL_AVX2_FAST(cpu_flags)) { | |
| 227 | + MC_LINKS_AVX2(10); | |
| 228 | + MC_LINKS_16BPC_AVX2(10); | |
| 229 | + } | |
| 230 | + } else if (bd == 12) { | |
| 231 | + if (EXTERNAL_SSE4(cpu_flags)) { | |
| 232 | + MC_LINK_SSE4(12); | |
| 233 | + } | |
| 234 | + if (EXTERNAL_AVX2_FAST(cpu_flags)) { | |
| 235 | + MC_LINKS_AVX2(12); | |
| 236 | + MC_LINKS_16BPC_AVX2(12); | |
| 237 | + } | |
| 238 | + } | |
| 237 | 239 | |
| 238 | − if (EXTERNAL_AVX2(cpu_flags)) { | |
| 239 | − switch (bd) { | |
| 240 | − case 8: | |
| 241 | − AVG_INIT(8, avx2); | |
| 242 | − break; | |
| 243 | − case 10: | |
| 244 | − AVG_INIT(10, avx2); | |
| 245 | − break; | |
| 246 | − case 12: | |
| 247 | − AVG_INIT(12, avx2); | |
| 248 | − break; | |
| 249 | − default: | |
| 250 | − break; | |
| 251 | − } | |
| 240 | + if (EXTERNAL_AVX2(cpu_flags)) { | |
| 241 | + switch (bd) { | |
| 242 | + case 8: | |
| 243 | + AVG_INIT(8, avx2); | |
| 244 | + break; | |
| 245 | + case 10: | |
| 246 | + AVG_INIT(10, avx2); | |
| 247 | + break; | |
| 248 | + case 12: | |
| 249 | + AVG_INIT(12, avx2); | |
| 250 | + break; | |
| 251 | + default: | |
| 252 | + break; | |
| 252 | 253 | } |
| 253 | 254 | } |
| 255 | +#endif | |
| 254 | 256 | } |