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

Function ff_tx_init_subtx

libavutil/tx.c:712–901  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

710}
711
712av_cold int ff_tx_init_subtx(AVTXContext *s, enum AVTXType type,
713 uint64_t flags, FFTXCodeletOptions *opts,
714 int len, int inv, const void *scale)
715{
716 int ret = 0;
717 AVTXContext *sub = NULL;
718 TXCodeletMatch *cd_tmp, *cd_matches = NULL;
719 unsigned int cd_matches_size = 0;
720 int codelet_list_idx = codelet_list_num;
721 int nb_cd_matches = 0;
722#if !CONFIG_SMALL
723 AVBPrint bp;
724#endif
725
726 /* We still accept functions marked with SLOW, even if the CPU is
727 * marked with the same flag, but we give them lower priority. */
728 const int cpu_flags = av_get_cpu_flags();
729
730 /* Flags the transform wants */
731 uint64_t req_flags = flags;
732
733 /* Flags the codelet may require to be present */
734 uint64_t inv_req_mask = AV_TX_FULL_IMDCT |
735 AV_TX_REAL_TO_REAL |
736 AV_TX_REAL_TO_IMAGINARY |
737 FF_TX_PRESHUFFLE |
738 FF_TX_ASM_CALL;
739
740 /* Unaligned codelets are compatible with the aligned flag */
741 if (req_flags & FF_TX_ALIGNED)
742 req_flags |= AV_TX_UNALIGNED;
743
744 /* If either flag is set, both are okay, so don't check for an exact match */
745 if ((req_flags & AV_TX_INPLACE) && (req_flags & FF_TX_OUT_OF_PLACE))
746 req_flags &= ~(AV_TX_INPLACE | FF_TX_OUT_OF_PLACE);
747 if ((req_flags & FF_TX_ALIGNED) && (req_flags & AV_TX_UNALIGNED))
748 req_flags &= ~(FF_TX_ALIGNED | AV_TX_UNALIGNED);
749
750 /* Loop through all codelets in all codelet lists to find matches
751 * to the requirements */
752 while (codelet_list_idx--) {
753 const FFTXCodelet * const * list = codelet_list[codelet_list_idx];
754 const FFTXCodelet *cd = NULL;
755
756 while ((cd = *list++)) {
757 /* Check if the type matches */
758 if (cd->type != TX_TYPE_ANY && type != cd->type)
759 continue;
760
761 /* Check direction for non-orthogonal codelets */
762 if (((cd->flags & FF_TX_FORWARD_ONLY) && inv) ||
763 ((cd->flags & (FF_TX_INVERSE_ONLY | AV_TX_FULL_IMDCT)) && !inv) ||
764 ((cd->flags & (FF_TX_FORWARD_ONLY | AV_TX_REAL_TO_REAL)) && inv) ||
765 ((cd->flags & (FF_TX_FORWARD_ONLY | AV_TX_REAL_TO_IMAGINARY)) && inv))
766 continue;
767
768 /* Check if the requested flags match from both sides */
769 if (((req_flags & cd->flags) != (req_flags)) ||

Callers 11

TX_NAME(ff_tx_fft_init)Function · 0.85
TX_NAME(ff_tx_mdct_init)Function · 0.85
TX_NAME(ff_tx_rdft_init)Function · 0.85
TX_NAME(ff_tx_dct_init)Function · 0.85
av_tx_initFunction · 0.85
m_inv_initFunction · 0.85
fft_pfa_initFunction · 0.85

Calls 15

av_get_cpu_flagsFunction · 0.85
check_cd_factorsFunction · 0.85
av_fast_reallocFunction · 0.85
get_codelet_prioFunction · 0.85
av_bprint_initFunction · 0.85
av_bprintfFunction · 0.85
print_typeFunction · 0.85
print_flagsFunction · 0.85
av_logFunction · 0.85
print_cd_infoFunction · 0.85
reset_ctxFunction · 0.85
av_freepFunction · 0.85

Tested by

no test coverage detected