summaryrefslogtreecommitdiff
path: root/libavutil/tx.c
diff options
context:
space:
mode:
authorLynne <dev@lynne.ee>2022-10-01 12:35:14 +0200
committerLynne <dev@lynne.ee>2022-11-24 15:58:33 +0100
commit958b3760b54245b934054f8aa72a608bdb2a48b8 (patch)
treee80c2dcb7d198f00ca4b2de7ac987e34404e8a96 /libavutil/tx.c
parent6ddd10c3e2d63d1ad1ea1034b0e3862107a27063 (diff)
lavu/tx: improve transform tree logging
Now prints the actual codelet size used, as well as the number of allowed factors.
Diffstat (limited to 'libavutil/tx.c')
-rw-r--r--libavutil/tx.c56
1 files changed, 35 insertions, 21 deletions
diff --git a/libavutil/tx.c b/libavutil/tx.c
index a1173f6137..319392788f 100644
--- a/libavutil/tx.c
+++ b/libavutil/tx.c
@@ -343,7 +343,7 @@ static void print_type(AVBPrint *bp, enum AVTXType type)
"unknown");
}
-static void print_cd_info(const FFTXCodelet *cd, int prio, int print_prio)
+static void print_cd_info(const FFTXCodelet *cd, int prio, int len, int print_prio)
{
AVBPrint bp = { 0 };
av_bprint_init(&bp, 0, AV_BPRINT_SIZE_AUTOMATIC);
@@ -353,27 +353,41 @@ static void print_cd_info(const FFTXCodelet *cd, int prio, int print_prio)
print_type(&bp, cd->type);
av_bprintf(&bp, ", len: ");
- if (cd->min_len != cd->max_len)
- av_bprintf(&bp, "[%i, ", cd->min_len);
-
- if (cd->max_len == TX_LEN_UNLIMITED)
- av_bprintf(&bp, "∞");
- else
- av_bprintf(&bp, "%i", cd->max_len);
-
- av_bprintf(&bp, "%s, factors: [", cd->min_len != cd->max_len ? "]" : "");
- for (int i = 0; i < TX_MAX_SUB; i++) {
- if (i && cd->factors[i])
- av_bprintf(&bp, ", ");
- if (cd->factors[i] == TX_FACTOR_ANY)
- av_bprintf(&bp, "any");
- else if (cd->factors[i])
- av_bprintf(&bp, "%i", cd->factors[i]);
+ if (!len) {
+ if (cd->min_len != cd->max_len)
+ av_bprintf(&bp, "[%i, ", cd->min_len);
+
+ if (cd->max_len == TX_LEN_UNLIMITED)
+ av_bprintf(&bp, "∞");
else
- break;
+ av_bprintf(&bp, "%i", cd->max_len);
+ } else {
+ av_bprintf(&bp, "%i", len);
}
- av_bprintf(&bp, "], ");
+ if (cd->factors[1]) {
+ av_bprintf(&bp, "%s, factors", !len && cd->min_len != cd->max_len ? "]" : "");
+ if (!cd->nb_factors)
+ av_bprintf(&bp, ": [");
+ else
+ av_bprintf(&bp, "[%i]: [", cd->nb_factors);
+
+ for (int i = 0; i < TX_MAX_FACTORS; i++) {
+ if (i && cd->factors[i])
+ av_bprintf(&bp, ", ");
+ if (cd->factors[i] == TX_FACTOR_ANY)
+ av_bprintf(&bp, "any");
+ else if (cd->factors[i])
+ av_bprintf(&bp, "%i", cd->factors[i]);
+ else
+ break;
+ }
+
+ av_bprintf(&bp, "], ");
+ } else {
+ av_bprintf(&bp, "%s, factor: %i, ",
+ !len && cd->min_len != cd->max_len ? "]" : "", cd->factors[0]);
+ }
print_flags(&bp, cd->flags);
if (print_prio)
@@ -389,7 +403,7 @@ static void print_tx_structure(AVTXContext *s, int depth)
for (int i = 0; i <= depth; i++)
av_log(NULL, AV_LOG_DEBUG, " ");
- print_cd_info(cd, cd->prio, 0);
+ print_cd_info(cd, cd->prio, s->len, 0);
for (int i = 0; i < s->nb_sub; i++)
print_tx_structure(&s->sub[i], depth + 1);
@@ -604,7 +618,7 @@ av_cold int ff_tx_init_subtx(AVTXContext *s, enum AVTXType type,
for (int i = 0; i < nb_cd_matches; i++) {
av_log(NULL, AV_LOG_DEBUG, " %i: ", i + 1);
- print_cd_info(cd_matches[i].cd, cd_matches[i].prio, 1);
+ print_cd_info(cd_matches[i].cd, cd_matches[i].prio, 0, 1);
}
#endif