Showing the changes to libavcodec (1 of 1 file). Show all
Unified · Split
| @@ -31,6 +31,7 @@ · 30 unmodified lines | |||
| 31 | #include "libavcodec/vvc/vvcdsp.h" | 31 | #include "libavcodec/vvc/vvcdsp.h" |
| 32 | #include "libavcodec/x86/h26x/h2656dsp.h" | 32 | #include "libavcodec/x86/h26x/h2656dsp.h" |
| 33 | 33 | ||
| 34 | #if ARCH_X86_64 | ||
| 34 | #define FW_PUT(name, depth, opt) \ | 35 | #define FW_PUT(name, depth, opt) \ |
| 35 | static void ff_vvc_put_ ## name ## _ ## depth ## _##opt(int16_t *dst, const uint8_t *src, ptrdiff_t srcstride, \ | 36 | static void ff_vvc_put_ ## name ## _ ## depth ## _##opt(int16_t *dst, const uint8_t *src, ptrdiff_t srcstride, \ |
| 36 | int height, const int8_t *hf, const int8_t *vf, int width) \ | 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 | c->inter.avg = bf(avg, bd, opt); \ | 205 | c->inter.avg = bf(avg, bd, opt); \ |
| 205 | c->inter.w_avg = bf(w_avg, bd, opt); \ | 206 | c->inter.w_avg = bf(w_avg, bd, opt); \ |
| 206 | } while (0) | 207 | } while (0) |
| 208 | #endif | ||
| 207 | 209 | ||
| 208 | void ff_vvc_dsp_init_x86(VVCDSPContext *const c, const int bd) | 210 | void ff_vvc_dsp_init_x86(VVCDSPContext *const c, const int bd) |
| 209 | { | 211 | { |
| 212 | #if ARCH_X86_64 | ||
| 210 | const int cpu_flags = av_get_cpu_flags(); | 213 | const int cpu_flags = av_get_cpu_flags(); |
| 211 | 214 | ||
| 212 | if (ARCH_X86_64) { | 215 | if (bd == 8) { |
| 213 | if (bd == 8) { | 216 | if (EXTERNAL_SSE4(cpu_flags)) { |
| 214 | if (EXTERNAL_SSE4(cpu_flags)) { | 217 | MC_LINK_SSE4(8); |
| 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 | } | ||
| 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)) { | 240 | if (EXTERNAL_AVX2(cpu_flags)) { |
| 239 | switch (bd) { | 241 | switch (bd) { |
| 240 | case 8: | 242 | case 8: |
| 241 | AVG_INIT(8, avx2); | 243 | AVG_INIT(8, avx2); |
| 242 | break; | 244 | break; |
| 243 | case 10: | 245 | case 10: |
| 244 | AVG_INIT(10, avx2); | 246 | AVG_INIT(10, avx2); |
| 245 | break; | 247 | break; |
| 246 | case 12: | 248 | case 12: |
| 247 | AVG_INIT(12, avx2); | 249 | AVG_INIT(12, avx2); |
| 248 | break; | 250 | break; |
| 249 | default: | 251 | default: |
| 250 | break; | 252 | break; |
| 251 | } | ||
| 252 | } | 253 | } |
| 253 | } | 254 | } |
| 255 | #endif | ||
| 254 | } | 256 | } |