summaryrefslogtreecommitdiff
path: root/libavfilter
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2023-05-08 16:12:07 +0200
committerPaul B Mahol <onemda@gmail.com>2023-05-08 17:48:43 +0200
commitbbe410a7fd912277f99b9c071f9ca095b201ef34 (patch)
treed60686a607140bc6bf064bf67e36be4230eb024e /libavfilter
parent63d7ea38c79cb91b40b2f238ee13e2a18a1b7a50 (diff)
downloadffmpeg-bbe410a7fd912277f99b9c071f9ca095b201ef34.tar.gz
avfilter/vf_morpho: move structure processing in separate loop
Diffstat (limited to 'libavfilter')
-rw-r--r--libavfilter/vf_morpho.c39
1 files changed, 22 insertions, 17 deletions
diff --git a/libavfilter/vf_morpho.c b/libavfilter/vf_morpho.c
index f91957ab81..64b199ac03 100644
--- a/libavfilter/vf_morpho.c
+++ b/libavfilter/vf_morpho.c
@@ -808,30 +808,13 @@ static int do_morpho(FFFrameSync *fs)
av_frame_copy_props(out, in);
for (int p = 0; p < s->nb_planes; p++) {
- const uint8_t *src = in->data[p];
- int src_linesize = in->linesize[p];
const uint8_t *ssrc = structurepic->data[p];
const int ssrc_linesize = structurepic->linesize[p];
- uint8_t *dst = out->data[p];
- int dst_linesize = out->linesize[p];
const int swidth = s->splanewidth[p];
const int sheight = s->splaneheight[p];
- const int width = s->planewidth[p];
- const int height = s->planeheight[p];
const int depth = s->depth;
int type_size = s->type_size;
- if (ctx->is_disabled || !(s->planes & (1 << p))) {
-copy:
- av_image_copy_plane(out->data[p] + 0 * out->linesize[p],
- out->linesize[p],
- in->data[p] + 0 * in->linesize[p],
- in->linesize[p],
- width * ((s->depth + 7) / 8),
- height);
- continue;
- }
-
if (!s->got_structure[p] || s->structures) {
free_chord_set(&s->SE[p]);
@@ -843,6 +826,28 @@ copy:
goto fail;
s->got_structure[p] = 1;
}
+ }
+
+ for (int p = 0; p < s->nb_planes; p++) {
+ const uint8_t *src = in->data[p];
+ int src_linesize = in->linesize[p];
+ uint8_t *dst = out->data[p];
+ int dst_linesize = out->linesize[p];
+ const int width = s->planewidth[p];
+ const int height = s->planeheight[p];
+ const int depth = s->depth;
+ int type_size = s->type_size;
+
+ if (ctx->is_disabled || !(s->planes & (1 << p))) {
+copy:
+ av_image_copy_plane(out->data[p] + 0 * out->linesize[p],
+ out->linesize[p],
+ in->data[p] + 0 * in->linesize[p],
+ in->linesize[p],
+ width * ((depth + 7) / 8),
+ height);
+ continue;
+ }
if (s->SE[p].minX == INT16_MAX ||
s->SE[p].minY == INT16_MAX ||