History

x86/vvcdec: misc, reordered functions in dsp_init for improved readability

Nuo Mi committed 2 years ago

Commit 62f3d7e1 parent 038314b1 file · +29 −19Browse files

Unified · Split

libavcodec/x86/vvc/dsp_init.c+29−19
@@ -215,6 +215,18 @@ ALF_FUNCS(16, 12, avx2) · 214 unmodified lines
215215
216216 #endif
217217
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+
218230 #define PEL_LINK(dst, C, W, idx1, idx2, name, D, opt) \
219231 dst[C][W][idx1][idx2] = vvc_put_## name ## _ ## D ## _##opt; \
220232 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
280292 MC_TAP_LINKS_16BPC_AVX2(LUMA, 8, bd); \
281293 MC_TAP_LINKS_16BPC_AVX2(CHROMA, 4, bd);
282294
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
294297
295298 #define ALF_INIT(bd) do { \
296299 c->alf.filter[LUMA] = vvc_alf_filter_luma_##bd##_avx2; \
@@ -298,8 +301,6 @@ ALF_FUNCS(16, 12, avx2) · 1 unmodified line
298301 c->alf.classify = vvc_alf_classify_##bd##_avx2; \
299302 } while (0)
300303
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
303304 #endif
304305
305306
@@ -319,12 +320,15 @@ void ff_vvc_dsp_init_x86(VVCDSPContext *const c, const int bd) · 13 unmodified lines
319320 #endif
320321 #if HAVE_AVX2_EXTERNAL
321322 if (EXTERNAL_AVX2_FAST(cpu_flags)) {
322− ALF_INIT(8);
323+ // inter
323324 AVG_INIT(8, avx2);
325+ DMVR_INIT(8);
324326 MC_LINKS_AVX2(8);
325327 OF_INIT(8);
326− DMVR_INIT(8);
327328 SAD_INIT();
329+
330+ // filter
331+ ALF_INIT(8);
328332 }
329333 #endif
330334 break;
@@ -336,13 +340,16 @@ void ff_vvc_dsp_init_x86(VVCDSPContext *const c, const int bd) · 5 unmodified lines
336340 #endif
337341 #if HAVE_AVX2_EXTERNAL
338342 if (EXTERNAL_AVX2_FAST(cpu_flags)) {
339− ALF_INIT(10);
343+ // inter
340344 AVG_INIT(10, avx2);
345+ DMVR_INIT(10);
341346 MC_LINKS_AVX2(10);
342347 MC_LINKS_16BPC_AVX2(10);
343348 OF_INIT(10);
344− DMVR_INIT(10);
345349 SAD_INIT();
350+
351+ // filter
352+ ALF_INIT(10);
346353 }
347354 #endif
348355 break;
@@ -354,13 +361,16 @@ void ff_vvc_dsp_init_x86(VVCDSPContext *const c, const int bd) · 5 unmodified lines
354361 #endif
355362 #if HAVE_AVX2_EXTERNAL
356363 if (EXTERNAL_AVX2_FAST(cpu_flags)) {
357− ALF_INIT(12);
364+ // inter
358365 AVG_INIT(12, avx2);
366+ DMVR_INIT(12);
359367 MC_LINKS_AVX2(12);
360368 MC_LINKS_16BPC_AVX2(12);
361369 OF_INIT(12);
362− DMVR_INIT(12);
363370 SAD_INIT();
371+
372+ // filter
373+ ALF_INIT(12);
364374 }
365375 #endif
366376 break;

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