Unified · Split
| @@ -215,6 +215,18 @@ ALF_FUNCS(16, 12, avx2) · 214 unmodified lines | ||
| 215 | 215 | |
| 216 | 216 | #endif |
| 217 | 217 | |
| 218 | +#define AVG_INIT(bd, opt) do { \ | |
| 219 | + c->inter.avg = bf(vvc_avg, bd, opt); \ | |
| 220 | + c->inter.w_avg = bf(vvc_w_avg, bd, opt); \ | |
| 221 | +} while (0) | |
| 222 | + | |
| 223 | +#define DMVR_INIT(bd) do { \ | |
| 224 | + c->inter.dmvr[0][0] = ff_vvc_dmvr_##bd##_avx2; \ | |
| 225 | + c->inter.dmvr[0][1] = ff_vvc_dmvr_h_##bd##_avx2; \ | |
| 226 | + c->inter.dmvr[1][0] = ff_vvc_dmvr_v_##bd##_avx2; \ | |
| 227 | + c->inter.dmvr[1][1] = ff_vvc_dmvr_hv_##bd##_avx2; \ | |
| 228 | +} while (0) | |
| 229 | + | |
| 218 | 230 | #define PEL_LINK(dst, C, W, idx1, idx2, name, D, opt) \ |
| 219 | 231 | dst[C][W][idx1][idx2] = vvc_put_## name ## _ ## D ## _##opt; \ |
| 220 | 232 | dst ## _uni[C][W][idx1][idx2] = ff_h2656_put_uni_ ## name ## _ ## D ## _##opt; \ |
| @@ -280,17 +292,8 @@ ALF_FUNCS(16, 12, avx2) · 59 unmodified lines | ||
| 280 | 292 | MC_TAP_LINKS_16BPC_AVX2(LUMA, 8, bd); \ |
| 281 | 293 | MC_TAP_LINKS_16BPC_AVX2(CHROMA, 4, bd); |
| 282 | 294 | |
| 283 | −#define AVG_INIT(bd, opt) do { \ | |
| 284 | − c->inter.avg = bf(vvc_avg, bd, opt); \ | |
| 285 | − c->inter.w_avg = bf(vvc_w_avg, bd, opt); \ | |
| 286 | −} while (0) | |
| 287 | − | |
| 288 | −#define DMVR_INIT(bd) do { \ | |
| 289 | − c->inter.dmvr[0][0] = ff_vvc_dmvr_##bd##_avx2; \ | |
| 290 | − c->inter.dmvr[0][1] = ff_vvc_dmvr_h_##bd##_avx2; \ | |
| 291 | − c->inter.dmvr[1][0] = ff_vvc_dmvr_v_##bd##_avx2; \ | |
| 292 | − c->inter.dmvr[1][1] = ff_vvc_dmvr_hv_##bd##_avx2; \ | |
| 293 | −} while (0) | |
| 295 | +int ff_vvc_sad_avx2(const int16_t *src0, const int16_t *src1, int dx, int dy, int block_w, int block_h); | |
| 296 | +#define SAD_INIT() c->inter.sad = ff_vvc_sad_avx2 | |
| 294 | 297 | |
| 295 | 298 | #define ALF_INIT(bd) do { \ |
| 296 | 299 | c->alf.filter[LUMA] = vvc_alf_filter_luma_##bd##_avx2; \ |
| @@ -298,8 +301,6 @@ ALF_FUNCS(16, 12, avx2) · 1 unmodified line | ||
| 298 | 301 | c->alf.classify = vvc_alf_classify_##bd##_avx2; \ |
| 299 | 302 | } while (0) |
| 300 | 303 | |
| 301 | −int ff_vvc_sad_avx2(const int16_t *src0, const int16_t *src1, int dx, int dy, int block_w, int block_h); | |
| 302 | −#define SAD_INIT() c->inter.sad = ff_vvc_sad_avx2 | |
| 303 | 304 | #endif |
| 304 | 305 | |
| 305 | 306 | |
| @@ -319,12 +320,15 @@ void ff_vvc_dsp_init_x86(VVCDSPContext *const c, const int bd) · 13 unmodified lines | ||
| 319 | 320 | #endif |
| 320 | 321 | #if HAVE_AVX2_EXTERNAL |
| 321 | 322 | if (EXTERNAL_AVX2_FAST(cpu_flags)) { |
| 322 | − ALF_INIT(8); | |
| 323 | + // inter | |
| 323 | 324 | AVG_INIT(8, avx2); |
| 325 | + DMVR_INIT(8); | |
| 324 | 326 | MC_LINKS_AVX2(8); |
| 325 | 327 | OF_INIT(8); |
| 326 | − DMVR_INIT(8); | |
| 327 | 328 | SAD_INIT(); |
| 329 | + | |
| 330 | + // filter | |
| 331 | + ALF_INIT(8); | |
| 328 | 332 | } |
| 329 | 333 | #endif |
| 330 | 334 | break; |
| @@ -336,13 +340,16 @@ void ff_vvc_dsp_init_x86(VVCDSPContext *const c, const int bd) · 5 unmodified lines | ||
| 336 | 340 | #endif |
| 337 | 341 | #if HAVE_AVX2_EXTERNAL |
| 338 | 342 | if (EXTERNAL_AVX2_FAST(cpu_flags)) { |
| 339 | − ALF_INIT(10); | |
| 343 | + // inter | |
| 340 | 344 | AVG_INIT(10, avx2); |
| 345 | + DMVR_INIT(10); | |
| 341 | 346 | MC_LINKS_AVX2(10); |
| 342 | 347 | MC_LINKS_16BPC_AVX2(10); |
| 343 | 348 | OF_INIT(10); |
| 344 | − DMVR_INIT(10); | |
| 345 | 349 | SAD_INIT(); |
| 350 | + | |
| 351 | + // filter | |
| 352 | + ALF_INIT(10); | |
| 346 | 353 | } |
| 347 | 354 | #endif |
| 348 | 355 | break; |
| @@ -354,13 +361,16 @@ void ff_vvc_dsp_init_x86(VVCDSPContext *const c, const int bd) · 5 unmodified lines | ||
| 354 | 361 | #endif |
| 355 | 362 | #if HAVE_AVX2_EXTERNAL |
| 356 | 363 | if (EXTERNAL_AVX2_FAST(cpu_flags)) { |
| 357 | − ALF_INIT(12); | |
| 364 | + // inter | |
| 358 | 365 | AVG_INIT(12, avx2); |
| 366 | + DMVR_INIT(12); | |
| 359 | 367 | MC_LINKS_AVX2(12); |
| 360 | 368 | MC_LINKS_16BPC_AVX2(12); |
| 361 | 369 | OF_INIT(12); |
| 362 | − DMVR_INIT(12); | |
| 363 | 370 | SAD_INIT(); |
| 371 | + | |
| 372 | + // filter | |
| 373 | + ALF_INIT(12); | |
| 364 | 374 | } |
| 365 | 375 | #endif |
| 366 | 376 | break; |