| 710 | } |
| 711 | |
| 712 | av_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)) || |
no test coverage detected