mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2024-12-26 17:32:06 +00:00
avfilter/vf_morpho: move structure processing in separate loop
This commit is contained in:
parent
63d7ea38c7
commit
bbe410a7fd
@ -808,30 +808,13 @@ static int do_morpho(FFFrameSync *fs)
|
|||||||
av_frame_copy_props(out, in);
|
av_frame_copy_props(out, in);
|
||||||
|
|
||||||
for (int p = 0; p < s->nb_planes; p++) {
|
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 uint8_t *ssrc = structurepic->data[p];
|
||||||
const int ssrc_linesize = structurepic->linesize[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 swidth = s->splanewidth[p];
|
||||||
const int sheight = s->splaneheight[p];
|
const int sheight = s->splaneheight[p];
|
||||||
const int width = s->planewidth[p];
|
|
||||||
const int height = s->planeheight[p];
|
|
||||||
const int depth = s->depth;
|
const int depth = s->depth;
|
||||||
int type_size = s->type_size;
|
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) {
|
if (!s->got_structure[p] || s->structures) {
|
||||||
free_chord_set(&s->SE[p]);
|
free_chord_set(&s->SE[p]);
|
||||||
|
|
||||||
@ -843,6 +826,28 @@ copy:
|
|||||||
goto fail;
|
goto fail;
|
||||||
s->got_structure[p] = 1;
|
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 ||
|
if (s->SE[p].minX == INT16_MAX ||
|
||||||
s->SE[p].minY == INT16_MAX ||
|
s->SE[p].minY == INT16_MAX ||
|
||||||
|
Loading…
Reference in New Issue
Block a user