Files
test2/source/blender/sequencer/intern/render.hh
Aras Pranckevicius c26db69f58 VSE: Simplify and optimize effect multi-threading
Cleanup (and make slightly faster as a side effect) the way VSE effects
do multi-threading. Previously (some of them) were using
IMB_processor_apply_threaded with C-like machinery (which internally
uses a task pool), switch that over to a helper apply_effect_op
(which internally uses a parallel for). Based on profiling, parallel
for is slightly more efficient (task pool takes a bit until all the
tasks are "pushed" into the pool). Note however that some VSE effects
were already doing parallel for internally; these are not affected.

VSE scene at 4K resolution, with four 4K resolution PNG images blended
over each other, time it takes to do render_strip_stack:
- Ryzen 5950X (Win/VS2022): 38.9ms -> 34.7ms
- Mac M4 Max: 21.9ms -> 19.8ms

Now that all VSE effects are internally threaded via parallel for,
there's no need for the init_execution and execute_slice machinery,
so remove all that.

You might also notice that half of "over drop" effect code is gone.
It was accidentally not doing anything whatsoever for the last 18 years
(since 2.42), and currently observed behavior matches documentation
and "internet knowledge", so let's  accept it as correct.

Pull Request: https://projects.blender.org/blender/blender/pulls/132380
2025-01-01 11:11:49 +01:00

60 lines
1.8 KiB
C++

/* SPDX-FileCopyrightText: 2024 Blender Authors
*
* SPDX-License-Identifier: GPL-2.0-or-later */
#pragma once
/** \file
* \ingroup sequencer
*/
#include "BLI_math_vector_types.hh"
#include "BLI_vector.hh"
struct ImBuf;
struct LinkNode;
struct ListBase;
struct Scene;
struct SeqEffectHandle;
struct SeqRenderData;
struct Sequence;
/* mutable state for sequencer */
struct SeqRenderState {
LinkNode *scene_parents = nullptr;
};
/* Strip corner coordinates in screen pixel space. Note that they might not be
* axis aligned when rotation is present. */
struct StripScreenQuad {
blender::float2 v0, v1, v2, v3;
bool is_empty() const
{
return v0 == v1 && v2 == v3 && v0 == v2;
}
};
ImBuf *seq_render_give_ibuf_seqbase(const SeqRenderData *context,
float timeline_frame,
int chan_shown,
ListBase *channels,
ListBase *seqbasep);
void seq_imbuf_to_sequencer_space(const Scene *scene, ImBuf *ibuf, bool make_float);
blender::Vector<Sequence *> seq_get_shown_sequences(
const Scene *scene, ListBase *channels, ListBase *seqbase, int timeline_frame, int chanshown);
ImBuf *seq_render_strip(const SeqRenderData *context,
SeqRenderState *state,
Sequence *seq,
float timeline_frame);
/* Renders Mask into an image suitable for sequencer:
* RGB channels contain mask intensity; alpha channel is opaque. */
ImBuf *seq_render_mask(const SeqRenderData *context,
Mask *mask,
float frame_index,
bool make_float);
void seq_imbuf_assign_spaces(const Scene *scene, ImBuf *ibuf);
StripScreenQuad get_strip_screen_quad(const SeqRenderData *context, const Sequence *seq);