mirror of https://git.ffmpeg.org/ffmpeg.git
lavu/tx: simplify in-place permute search function
This commit is contained in:
parent
f9cb557d66
commit
9ddaf0c9f0
|
@ -114,8 +114,7 @@ int ff_tx_gen_ptwo_inplace_revtab_idx(AVTXContext *s)
|
||||||
if (!(s->inplace_idx = av_malloc(s->m*sizeof(*s->inplace_idx))))
|
if (!(s->inplace_idx = av_malloc(s->m*sizeof(*s->inplace_idx))))
|
||||||
return AVERROR(ENOMEM);
|
return AVERROR(ENOMEM);
|
||||||
|
|
||||||
for (int d = 1; d < s->m; d++) {
|
for (int src = 1; src < s->m; src++) {
|
||||||
int src = d, start_src = src;
|
|
||||||
int dst = s->revtab[src];
|
int dst = s->revtab[src];
|
||||||
int found = 0;
|
int found = 0;
|
||||||
|
|
||||||
|
@ -123,7 +122,6 @@ int ff_tx_gen_ptwo_inplace_revtab_idx(AVTXContext *s)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
do {
|
do {
|
||||||
src = dst;
|
|
||||||
for (int j = 0; j < nb_inplace_idx; j++) {
|
for (int j = 0; j < nb_inplace_idx; j++) {
|
||||||
if (dst == s->inplace_idx[j]) {
|
if (dst == s->inplace_idx[j]) {
|
||||||
found = 1;
|
found = 1;
|
||||||
|
@ -131,10 +129,10 @@ int ff_tx_gen_ptwo_inplace_revtab_idx(AVTXContext *s)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
dst = s->revtab[dst];
|
dst = s->revtab[dst];
|
||||||
} while (dst != start_src && !found);
|
} while (dst != src && !found);
|
||||||
|
|
||||||
if (!found)
|
if (!found)
|
||||||
s->inplace_idx[nb_inplace_idx++] = start_src;
|
s->inplace_idx[nb_inplace_idx++] = src;
|
||||||
}
|
}
|
||||||
|
|
||||||
s->inplace_idx[nb_inplace_idx++] = 0;
|
s->inplace_idx[nb_inplace_idx++] = 0;
|
||||||
|
|
Loading…
Reference in New Issue