MCPcopy Create free account
hub / github.com/FFmpeg/FFmpeg / get_codelet_prio

Function get_codelet_prio

libavutil/tx.c:367–398  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

365};
366
367static int get_codelet_prio(const FFTXCodelet *cd, int cpu_flags, int len)
368{
369 int prio = cd->prio;
370 int max_factor = 0;
371
372 /* If the CPU has a SLOW flag, and the instruction is also flagged
373 * as being slow for such, reduce its priority */
374 for (int i = 0; i < FF_ARRAY_ELEMS(cpu_slow_penalties); i++) {
375 if ((cpu_flags & cd->cpu_flags) & cpu_slow_penalties[i][0])
376 prio -= cpu_slow_penalties[i][1];
377 }
378
379 /* Prioritize aligned-only codelets */
380 if ((cd->flags & FF_TX_ALIGNED) && !(cd->flags & AV_TX_UNALIGNED))
381 prio += 64;
382
383 /* Codelets for specific lengths are generally faster */
384 if ((len == cd->min_len) && (len == cd->max_len))
385 prio += 64;
386
387 /* Forward-only or inverse-only transforms are generally better */
388 if ((cd->flags & (FF_TX_FORWARD_ONLY | FF_TX_INVERSE_ONLY)))
389 prio += 64;
390
391 /* Larger factors are generally better */
392 for (int i = 0; i < TX_MAX_SUB; i++)
393 max_factor = FFMAX(cd->factors[i], max_factor);
394 if (max_factor)
395 prio += 16*max_factor;
396
397 return prio;
398}
399
400typedef struct FFTXLenDecomp {
401 int len;

Callers 2

ff_tx_decompose_lengthFunction · 0.85
ff_tx_init_subtxFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected