Cleanup: None of VSE effects have three image inputs
So remove all code related to "ibuf3" handling since it is just always null. Pull Request: https://projects.blender.org/blender/blender/pulls/127348
This commit is contained in:
committed by
Aras Pranckevicius
parent
897f7a8482
commit
9d3b2b51a7
@@ -70,10 +70,9 @@ struct SeqEffectHandle {
|
|||||||
float timeline_frame,
|
float timeline_frame,
|
||||||
float fac,
|
float fac,
|
||||||
ImBuf *ibuf1,
|
ImBuf *ibuf1,
|
||||||
ImBuf *ibuf2,
|
ImBuf *ibuf2);
|
||||||
ImBuf *ibuf3);
|
|
||||||
|
|
||||||
ImBuf *(*init_execution)(const SeqRenderData *context, ImBuf *ibuf1, ImBuf *ibuf2, ImBuf *ibuf3);
|
ImBuf *(*init_execution)(const SeqRenderData *context, ImBuf *ibuf1, ImBuf *ibuf2);
|
||||||
|
|
||||||
void (*execute_slice)(const SeqRenderData *context,
|
void (*execute_slice)(const SeqRenderData *context,
|
||||||
Sequence *seq,
|
Sequence *seq,
|
||||||
@@ -81,7 +80,6 @@ struct SeqEffectHandle {
|
|||||||
float fac,
|
float fac,
|
||||||
const ImBuf *ibuf1,
|
const ImBuf *ibuf1,
|
||||||
const ImBuf *ibuf2,
|
const ImBuf *ibuf2,
|
||||||
const ImBuf *ibuf3,
|
|
||||||
int start_line,
|
int start_line,
|
||||||
int total_lines,
|
int total_lines,
|
||||||
ImBuf *out);
|
ImBuf *out);
|
||||||
|
|||||||
@@ -71,12 +71,10 @@ static SeqEffectHandle get_sequence_effect_impl(int seq_type);
|
|||||||
static void slice_get_byte_buffers(const SeqRenderData *context,
|
static void slice_get_byte_buffers(const SeqRenderData *context,
|
||||||
const ImBuf *ibuf1,
|
const ImBuf *ibuf1,
|
||||||
const ImBuf *ibuf2,
|
const ImBuf *ibuf2,
|
||||||
const ImBuf *ibuf3,
|
|
||||||
const ImBuf *out,
|
const ImBuf *out,
|
||||||
int start_line,
|
int start_line,
|
||||||
uchar **rect1,
|
uchar **rect1,
|
||||||
uchar **rect2,
|
uchar **rect2,
|
||||||
uchar **rect3,
|
|
||||||
uchar **rect_out)
|
uchar **rect_out)
|
||||||
{
|
{
|
||||||
int offset = 4 * start_line * context->rectx;
|
int offset = 4 * start_line * context->rectx;
|
||||||
@@ -87,21 +85,15 @@ static void slice_get_byte_buffers(const SeqRenderData *context,
|
|||||||
if (ibuf2) {
|
if (ibuf2) {
|
||||||
*rect2 = ibuf2->byte_buffer.data + offset;
|
*rect2 = ibuf2->byte_buffer.data + offset;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ibuf3) {
|
|
||||||
*rect3 = ibuf3->byte_buffer.data + offset;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void slice_get_float_buffers(const SeqRenderData *context,
|
static void slice_get_float_buffers(const SeqRenderData *context,
|
||||||
const ImBuf *ibuf1,
|
const ImBuf *ibuf1,
|
||||||
const ImBuf *ibuf2,
|
const ImBuf *ibuf2,
|
||||||
const ImBuf *ibuf3,
|
|
||||||
const ImBuf *out,
|
const ImBuf *out,
|
||||||
int start_line,
|
int start_line,
|
||||||
float **rect1,
|
float **rect1,
|
||||||
float **rect2,
|
float **rect2,
|
||||||
float **rect3,
|
|
||||||
float **rect_out)
|
float **rect_out)
|
||||||
{
|
{
|
||||||
int offset = 4 * start_line * context->rectx;
|
int offset = 4 * start_line * context->rectx;
|
||||||
@@ -112,10 +104,6 @@ static void slice_get_float_buffers(const SeqRenderData *context,
|
|||||||
if (ibuf2) {
|
if (ibuf2) {
|
||||||
*rect2 = ibuf2->float_buffer.data + offset;
|
*rect2 = ibuf2->float_buffer.data + offset;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ibuf3) {
|
|
||||||
*rect3 = ibuf3->float_buffer.data + offset;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static float4 load_premul_pixel(const uchar *ptr)
|
static float4 load_premul_pixel(const uchar *ptr)
|
||||||
@@ -165,7 +153,6 @@ static void store_opaque_black_pixel(float *dst)
|
|||||||
static ImBuf *prepare_effect_imbufs(const SeqRenderData *context,
|
static ImBuf *prepare_effect_imbufs(const SeqRenderData *context,
|
||||||
ImBuf *ibuf1,
|
ImBuf *ibuf1,
|
||||||
ImBuf *ibuf2,
|
ImBuf *ibuf2,
|
||||||
ImBuf *ibuf3,
|
|
||||||
bool uninitialized_pixels = true)
|
bool uninitialized_pixels = true)
|
||||||
{
|
{
|
||||||
ImBuf *out;
|
ImBuf *out;
|
||||||
@@ -174,15 +161,12 @@ static ImBuf *prepare_effect_imbufs(const SeqRenderData *context,
|
|||||||
int y = context->recty;
|
int y = context->recty;
|
||||||
int base_flags = uninitialized_pixels ? IB_uninitialized_pixels : 0;
|
int base_flags = uninitialized_pixels ? IB_uninitialized_pixels : 0;
|
||||||
|
|
||||||
if (!ibuf1 && !ibuf2 && !ibuf3) {
|
if (!ibuf1 && !ibuf2) {
|
||||||
/* hmmm, global float option ? */
|
/* hmmm, global float option ? */
|
||||||
out = IMB_allocImBuf(x, y, 32, IB_rect | base_flags);
|
out = IMB_allocImBuf(x, y, 32, IB_rect | base_flags);
|
||||||
}
|
}
|
||||||
else if ((ibuf1 && ibuf1->float_buffer.data) || (ibuf2 && ibuf2->float_buffer.data) ||
|
else if ((ibuf1 && ibuf1->float_buffer.data) || (ibuf2 && ibuf2->float_buffer.data)) {
|
||||||
(ibuf3 && ibuf3->float_buffer.data))
|
/* if any inputs are float, output is float too */
|
||||||
{
|
|
||||||
/* if any inputs are rectfloat, output is float too */
|
|
||||||
|
|
||||||
out = IMB_allocImBuf(x, y, 32, IB_rectfloat | base_flags);
|
out = IMB_allocImBuf(x, y, 32, IB_rectfloat | base_flags);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@@ -198,10 +182,6 @@ static ImBuf *prepare_effect_imbufs(const SeqRenderData *context,
|
|||||||
seq_imbuf_to_sequencer_space(scene, ibuf2, true);
|
seq_imbuf_to_sequencer_space(scene, ibuf2, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ibuf3 && !ibuf3->float_buffer.data) {
|
|
||||||
seq_imbuf_to_sequencer_space(scene, ibuf3, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
IMB_colormanagement_assign_float_colorspace(out, scene->sequencer_colorspace_settings.name);
|
IMB_colormanagement_assign_float_colorspace(out, scene->sequencer_colorspace_settings.name);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@@ -212,14 +192,10 @@ static ImBuf *prepare_effect_imbufs(const SeqRenderData *context,
|
|||||||
if (ibuf2 && !ibuf2->byte_buffer.data) {
|
if (ibuf2 && !ibuf2->byte_buffer.data) {
|
||||||
IMB_rect_from_float(ibuf2);
|
IMB_rect_from_float(ibuf2);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ibuf3 && !ibuf3->byte_buffer.data) {
|
|
||||||
IMB_rect_from_float(ibuf3);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* If effect only affecting a single channel, forward input's metadata to the output. */
|
/* If effect only affecting a single channel, forward input's metadata to the output. */
|
||||||
if (ibuf1 != nullptr && ibuf1 == ibuf2 && ibuf2 == ibuf3) {
|
if (ibuf1 != nullptr && ibuf1 == ibuf2) {
|
||||||
IMB_metadata_copy(out, ibuf1);
|
IMB_metadata_copy(out, ibuf1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -289,7 +265,6 @@ static void do_alphaover_effect(const SeqRenderData *context,
|
|||||||
float fac,
|
float fac,
|
||||||
const ImBuf *ibuf1,
|
const ImBuf *ibuf1,
|
||||||
const ImBuf *ibuf2,
|
const ImBuf *ibuf2,
|
||||||
const ImBuf * /*ibuf3*/,
|
|
||||||
int start_line,
|
int start_line,
|
||||||
int total_lines,
|
int total_lines,
|
||||||
ImBuf *out)
|
ImBuf *out)
|
||||||
@@ -297,16 +272,14 @@ static void do_alphaover_effect(const SeqRenderData *context,
|
|||||||
if (out->float_buffer.data) {
|
if (out->float_buffer.data) {
|
||||||
float *rect1 = nullptr, *rect2 = nullptr, *rect_out = nullptr;
|
float *rect1 = nullptr, *rect2 = nullptr, *rect_out = nullptr;
|
||||||
|
|
||||||
slice_get_float_buffers(
|
slice_get_float_buffers(context, ibuf1, ibuf2, out, start_line, &rect1, &rect2, &rect_out);
|
||||||
context, ibuf1, ibuf2, nullptr, out, start_line, &rect1, &rect2, nullptr, &rect_out);
|
|
||||||
|
|
||||||
do_alphaover_effect(fac, context->rectx, total_lines, rect1, rect2, rect_out);
|
do_alphaover_effect(fac, context->rectx, total_lines, rect1, rect2, rect_out);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
uchar *rect1 = nullptr, *rect2 = nullptr, *rect_out = nullptr;
|
uchar *rect1 = nullptr, *rect2 = nullptr, *rect_out = nullptr;
|
||||||
|
|
||||||
slice_get_byte_buffers(
|
slice_get_byte_buffers(context, ibuf1, ibuf2, out, start_line, &rect1, &rect2, &rect_out);
|
||||||
context, ibuf1, ibuf2, nullptr, out, start_line, &rect1, &rect2, nullptr, &rect_out);
|
|
||||||
|
|
||||||
do_alphaover_effect(fac, context->rectx, total_lines, rect1, rect2, rect_out);
|
do_alphaover_effect(fac, context->rectx, total_lines, rect1, rect2, rect_out);
|
||||||
}
|
}
|
||||||
@@ -354,7 +327,6 @@ static void do_alphaunder_effect(const SeqRenderData *context,
|
|||||||
float fac,
|
float fac,
|
||||||
const ImBuf *ibuf1,
|
const ImBuf *ibuf1,
|
||||||
const ImBuf *ibuf2,
|
const ImBuf *ibuf2,
|
||||||
const ImBuf * /*ibuf3*/,
|
|
||||||
int start_line,
|
int start_line,
|
||||||
int total_lines,
|
int total_lines,
|
||||||
ImBuf *out)
|
ImBuf *out)
|
||||||
@@ -362,16 +334,14 @@ static void do_alphaunder_effect(const SeqRenderData *context,
|
|||||||
if (out->float_buffer.data) {
|
if (out->float_buffer.data) {
|
||||||
float *rect1 = nullptr, *rect2 = nullptr, *rect_out = nullptr;
|
float *rect1 = nullptr, *rect2 = nullptr, *rect_out = nullptr;
|
||||||
|
|
||||||
slice_get_float_buffers(
|
slice_get_float_buffers(context, ibuf1, ibuf2, out, start_line, &rect1, &rect2, &rect_out);
|
||||||
context, ibuf1, ibuf2, nullptr, out, start_line, &rect1, &rect2, nullptr, &rect_out);
|
|
||||||
|
|
||||||
do_alphaunder_effect(fac, context->rectx, total_lines, rect1, rect2, rect_out);
|
do_alphaunder_effect(fac, context->rectx, total_lines, rect1, rect2, rect_out);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
uchar *rect1 = nullptr, *rect2 = nullptr, *rect_out = nullptr;
|
uchar *rect1 = nullptr, *rect2 = nullptr, *rect_out = nullptr;
|
||||||
|
|
||||||
slice_get_byte_buffers(
|
slice_get_byte_buffers(context, ibuf1, ibuf2, out, start_line, &rect1, &rect2, &rect_out);
|
||||||
context, ibuf1, ibuf2, nullptr, out, start_line, &rect1, &rect2, nullptr, &rect_out);
|
|
||||||
|
|
||||||
do_alphaunder_effect(fac, context->rectx, total_lines, rect1, rect2, rect_out);
|
do_alphaunder_effect(fac, context->rectx, total_lines, rect1, rect2, rect_out);
|
||||||
}
|
}
|
||||||
@@ -434,7 +404,6 @@ static void do_cross_effect(const SeqRenderData *context,
|
|||||||
float fac,
|
float fac,
|
||||||
const ImBuf *ibuf1,
|
const ImBuf *ibuf1,
|
||||||
const ImBuf *ibuf2,
|
const ImBuf *ibuf2,
|
||||||
const ImBuf * /*ibuf3*/,
|
|
||||||
int start_line,
|
int start_line,
|
||||||
int total_lines,
|
int total_lines,
|
||||||
ImBuf *out)
|
ImBuf *out)
|
||||||
@@ -442,16 +411,14 @@ static void do_cross_effect(const SeqRenderData *context,
|
|||||||
if (out->float_buffer.data) {
|
if (out->float_buffer.data) {
|
||||||
float *rect1 = nullptr, *rect2 = nullptr, *rect_out = nullptr;
|
float *rect1 = nullptr, *rect2 = nullptr, *rect_out = nullptr;
|
||||||
|
|
||||||
slice_get_float_buffers(
|
slice_get_float_buffers(context, ibuf1, ibuf2, out, start_line, &rect1, &rect2, &rect_out);
|
||||||
context, ibuf1, ibuf2, nullptr, out, start_line, &rect1, &rect2, nullptr, &rect_out);
|
|
||||||
|
|
||||||
do_cross_effect_float(fac, context->rectx, total_lines, rect1, rect2, rect_out);
|
do_cross_effect_float(fac, context->rectx, total_lines, rect1, rect2, rect_out);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
uchar *rect1 = nullptr, *rect2 = nullptr, *rect_out = nullptr;
|
uchar *rect1 = nullptr, *rect2 = nullptr, *rect_out = nullptr;
|
||||||
|
|
||||||
slice_get_byte_buffers(
|
slice_get_byte_buffers(context, ibuf1, ibuf2, out, start_line, &rect1, &rect2, &rect_out);
|
||||||
context, ibuf1, ibuf2, nullptr, out, start_line, &rect1, &rect2, nullptr, &rect_out);
|
|
||||||
|
|
||||||
do_cross_effect_byte(fac, context->rectx, total_lines, rect1, rect2, rect_out);
|
do_cross_effect_byte(fac, context->rectx, total_lines, rect1, rect2, rect_out);
|
||||||
}
|
}
|
||||||
@@ -503,22 +470,12 @@ static void do_gammacross_effect(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static ImBuf *gammacross_init_execution(const SeqRenderData *context,
|
|
||||||
ImBuf *ibuf1,
|
|
||||||
ImBuf *ibuf2,
|
|
||||||
ImBuf *ibuf3)
|
|
||||||
{
|
|
||||||
ImBuf *out = prepare_effect_imbufs(context, ibuf1, ibuf2, ibuf3);
|
|
||||||
return out;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void do_gammacross_effect(const SeqRenderData *context,
|
static void do_gammacross_effect(const SeqRenderData *context,
|
||||||
Sequence * /*seq*/,
|
Sequence * /*seq*/,
|
||||||
float /*timeline_frame*/,
|
float /*timeline_frame*/,
|
||||||
float fac,
|
float fac,
|
||||||
const ImBuf *ibuf1,
|
const ImBuf *ibuf1,
|
||||||
const ImBuf *ibuf2,
|
const ImBuf *ibuf2,
|
||||||
const ImBuf * /*ibuf3*/,
|
|
||||||
int start_line,
|
int start_line,
|
||||||
int total_lines,
|
int total_lines,
|
||||||
ImBuf *out)
|
ImBuf *out)
|
||||||
@@ -526,16 +483,14 @@ static void do_gammacross_effect(const SeqRenderData *context,
|
|||||||
if (out->float_buffer.data) {
|
if (out->float_buffer.data) {
|
||||||
float *rect1 = nullptr, *rect2 = nullptr, *rect_out = nullptr;
|
float *rect1 = nullptr, *rect2 = nullptr, *rect_out = nullptr;
|
||||||
|
|
||||||
slice_get_float_buffers(
|
slice_get_float_buffers(context, ibuf1, ibuf2, out, start_line, &rect1, &rect2, &rect_out);
|
||||||
context, ibuf1, ibuf2, nullptr, out, start_line, &rect1, &rect2, nullptr, &rect_out);
|
|
||||||
|
|
||||||
do_gammacross_effect(fac, context->rectx, total_lines, rect1, rect2, rect_out);
|
do_gammacross_effect(fac, context->rectx, total_lines, rect1, rect2, rect_out);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
uchar *rect1 = nullptr, *rect2 = nullptr, *rect_out = nullptr;
|
uchar *rect1 = nullptr, *rect2 = nullptr, *rect_out = nullptr;
|
||||||
|
|
||||||
slice_get_byte_buffers(
|
slice_get_byte_buffers(context, ibuf1, ibuf2, out, start_line, &rect1, &rect2, &rect_out);
|
||||||
context, ibuf1, ibuf2, nullptr, out, start_line, &rect1, &rect2, nullptr, &rect_out);
|
|
||||||
|
|
||||||
do_gammacross_effect(fac, context->rectx, total_lines, rect1, rect2, rect_out);
|
do_gammacross_effect(fac, context->rectx, total_lines, rect1, rect2, rect_out);
|
||||||
}
|
}
|
||||||
@@ -597,7 +552,6 @@ static void do_add_effect(const SeqRenderData *context,
|
|||||||
float fac,
|
float fac,
|
||||||
const ImBuf *ibuf1,
|
const ImBuf *ibuf1,
|
||||||
const ImBuf *ibuf2,
|
const ImBuf *ibuf2,
|
||||||
const ImBuf * /*ibuf3*/,
|
|
||||||
int start_line,
|
int start_line,
|
||||||
int total_lines,
|
int total_lines,
|
||||||
ImBuf *out)
|
ImBuf *out)
|
||||||
@@ -605,16 +559,14 @@ static void do_add_effect(const SeqRenderData *context,
|
|||||||
if (out->float_buffer.data) {
|
if (out->float_buffer.data) {
|
||||||
float *rect1 = nullptr, *rect2 = nullptr, *rect_out = nullptr;
|
float *rect1 = nullptr, *rect2 = nullptr, *rect_out = nullptr;
|
||||||
|
|
||||||
slice_get_float_buffers(
|
slice_get_float_buffers(context, ibuf1, ibuf2, out, start_line, &rect1, &rect2, &rect_out);
|
||||||
context, ibuf1, ibuf2, nullptr, out, start_line, &rect1, &rect2, nullptr, &rect_out);
|
|
||||||
|
|
||||||
do_add_effect_float(fac, context->rectx, total_lines, rect1, rect2, rect_out);
|
do_add_effect_float(fac, context->rectx, total_lines, rect1, rect2, rect_out);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
uchar *rect1 = nullptr, *rect2 = nullptr, *rect_out = nullptr;
|
uchar *rect1 = nullptr, *rect2 = nullptr, *rect_out = nullptr;
|
||||||
|
|
||||||
slice_get_byte_buffers(
|
slice_get_byte_buffers(context, ibuf1, ibuf2, out, start_line, &rect1, &rect2, &rect_out);
|
||||||
context, ibuf1, ibuf2, nullptr, out, start_line, &rect1, &rect2, nullptr, &rect_out);
|
|
||||||
|
|
||||||
do_add_effect_byte(fac, context->rectx, total_lines, rect1, rect2, rect_out);
|
do_add_effect_byte(fac, context->rectx, total_lines, rect1, rect2, rect_out);
|
||||||
}
|
}
|
||||||
@@ -678,7 +630,6 @@ static void do_sub_effect(const SeqRenderData *context,
|
|||||||
float fac,
|
float fac,
|
||||||
const ImBuf *ibuf1,
|
const ImBuf *ibuf1,
|
||||||
const ImBuf *ibuf2,
|
const ImBuf *ibuf2,
|
||||||
const ImBuf * /*ibuf3*/,
|
|
||||||
int start_line,
|
int start_line,
|
||||||
int total_lines,
|
int total_lines,
|
||||||
ImBuf *out)
|
ImBuf *out)
|
||||||
@@ -686,16 +637,14 @@ static void do_sub_effect(const SeqRenderData *context,
|
|||||||
if (out->float_buffer.data) {
|
if (out->float_buffer.data) {
|
||||||
float *rect1 = nullptr, *rect2 = nullptr, *rect_out = nullptr;
|
float *rect1 = nullptr, *rect2 = nullptr, *rect_out = nullptr;
|
||||||
|
|
||||||
slice_get_float_buffers(
|
slice_get_float_buffers(context, ibuf1, ibuf2, out, start_line, &rect1, &rect2, &rect_out);
|
||||||
context, ibuf1, ibuf2, nullptr, out, start_line, &rect1, &rect2, nullptr, &rect_out);
|
|
||||||
|
|
||||||
do_sub_effect_float(fac, context->rectx, total_lines, rect1, rect2, rect_out);
|
do_sub_effect_float(fac, context->rectx, total_lines, rect1, rect2, rect_out);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
uchar *rect1 = nullptr, *rect2 = nullptr, *rect_out = nullptr;
|
uchar *rect1 = nullptr, *rect2 = nullptr, *rect_out = nullptr;
|
||||||
|
|
||||||
slice_get_byte_buffers(
|
slice_get_byte_buffers(context, ibuf1, ibuf2, out, start_line, &rect1, &rect2, &rect_out);
|
||||||
context, ibuf1, ibuf2, nullptr, out, start_line, &rect1, &rect2, nullptr, &rect_out);
|
|
||||||
|
|
||||||
do_sub_effect_byte(fac, context->rectx, total_lines, rect1, rect2, rect_out);
|
do_sub_effect_byte(fac, context->rectx, total_lines, rect1, rect2, rect_out);
|
||||||
}
|
}
|
||||||
@@ -839,7 +788,6 @@ static void do_mul_effect(const SeqRenderData *context,
|
|||||||
float fac,
|
float fac,
|
||||||
const ImBuf *ibuf1,
|
const ImBuf *ibuf1,
|
||||||
const ImBuf *ibuf2,
|
const ImBuf *ibuf2,
|
||||||
const ImBuf * /*ibuf3*/,
|
|
||||||
int start_line,
|
int start_line,
|
||||||
int total_lines,
|
int total_lines,
|
||||||
ImBuf *out)
|
ImBuf *out)
|
||||||
@@ -847,16 +795,14 @@ static void do_mul_effect(const SeqRenderData *context,
|
|||||||
if (out->float_buffer.data) {
|
if (out->float_buffer.data) {
|
||||||
float *rect1 = nullptr, *rect2 = nullptr, *rect_out = nullptr;
|
float *rect1 = nullptr, *rect2 = nullptr, *rect_out = nullptr;
|
||||||
|
|
||||||
slice_get_float_buffers(
|
slice_get_float_buffers(context, ibuf1, ibuf2, out, start_line, &rect1, &rect2, &rect_out);
|
||||||
context, ibuf1, ibuf2, nullptr, out, start_line, &rect1, &rect2, nullptr, &rect_out);
|
|
||||||
|
|
||||||
do_mul_effect_float(fac, context->rectx, total_lines, rect1, rect2, rect_out);
|
do_mul_effect_float(fac, context->rectx, total_lines, rect1, rect2, rect_out);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
uchar *rect1 = nullptr, *rect2 = nullptr, *rect_out = nullptr;
|
uchar *rect1 = nullptr, *rect2 = nullptr, *rect_out = nullptr;
|
||||||
|
|
||||||
slice_get_byte_buffers(
|
slice_get_byte_buffers(context, ibuf1, ibuf2, out, start_line, &rect1, &rect2, &rect_out);
|
||||||
context, ibuf1, ibuf2, nullptr, out, start_line, &rect1, &rect2, nullptr, &rect_out);
|
|
||||||
|
|
||||||
do_mul_effect_byte(fac, context->rectx, total_lines, rect1, rect2, rect_out);
|
do_mul_effect_byte(fac, context->rectx, total_lines, rect1, rect2, rect_out);
|
||||||
}
|
}
|
||||||
@@ -1037,22 +983,19 @@ static void do_blend_mode_effect(const SeqRenderData *context,
|
|||||||
float fac,
|
float fac,
|
||||||
const ImBuf *ibuf1,
|
const ImBuf *ibuf1,
|
||||||
const ImBuf *ibuf2,
|
const ImBuf *ibuf2,
|
||||||
const ImBuf * /*ibuf3*/,
|
|
||||||
int start_line,
|
int start_line,
|
||||||
int total_lines,
|
int total_lines,
|
||||||
ImBuf *out)
|
ImBuf *out)
|
||||||
{
|
{
|
||||||
if (out->float_buffer.data) {
|
if (out->float_buffer.data) {
|
||||||
float *rect1 = nullptr, *rect2 = nullptr, *rect_out = nullptr;
|
float *rect1 = nullptr, *rect2 = nullptr, *rect_out = nullptr;
|
||||||
slice_get_float_buffers(
|
slice_get_float_buffers(context, ibuf1, ibuf2, out, start_line, &rect1, &rect2, &rect_out);
|
||||||
context, ibuf1, ibuf2, nullptr, out, start_line, &rect1, &rect2, nullptr, &rect_out);
|
|
||||||
do_blend_effect_float(
|
do_blend_effect_float(
|
||||||
fac, context->rectx, total_lines, rect1, rect2, seq->blend_mode, rect_out);
|
fac, context->rectx, total_lines, rect1, rect2, seq->blend_mode, rect_out);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
uchar *rect1 = nullptr, *rect2 = nullptr, *rect_out = nullptr;
|
uchar *rect1 = nullptr, *rect2 = nullptr, *rect_out = nullptr;
|
||||||
slice_get_byte_buffers(
|
slice_get_byte_buffers(context, ibuf1, ibuf2, out, start_line, &rect1, &rect2, &rect_out);
|
||||||
context, ibuf1, ibuf2, nullptr, out, start_line, &rect1, &rect2, nullptr, &rect_out);
|
|
||||||
do_blend_effect_byte(
|
do_blend_effect_byte(
|
||||||
fac, context->rectx, total_lines, rect1, rect2, seq->blend_mode, rect_out);
|
fac, context->rectx, total_lines, rect1, rect2, seq->blend_mode, rect_out);
|
||||||
}
|
}
|
||||||
@@ -1083,7 +1026,6 @@ static void do_colormix_effect(const SeqRenderData *context,
|
|||||||
float /*fac*/,
|
float /*fac*/,
|
||||||
const ImBuf *ibuf1,
|
const ImBuf *ibuf1,
|
||||||
const ImBuf *ibuf2,
|
const ImBuf *ibuf2,
|
||||||
const ImBuf * /*ibuf3*/,
|
|
||||||
int start_line,
|
int start_line,
|
||||||
int total_lines,
|
int total_lines,
|
||||||
ImBuf *out)
|
ImBuf *out)
|
||||||
@@ -1095,15 +1037,13 @@ static void do_colormix_effect(const SeqRenderData *context,
|
|||||||
|
|
||||||
if (out->float_buffer.data) {
|
if (out->float_buffer.data) {
|
||||||
float *rect1 = nullptr, *rect2 = nullptr, *rect_out = nullptr;
|
float *rect1 = nullptr, *rect2 = nullptr, *rect_out = nullptr;
|
||||||
slice_get_float_buffers(
|
slice_get_float_buffers(context, ibuf1, ibuf2, out, start_line, &rect1, &rect2, &rect_out);
|
||||||
context, ibuf1, ibuf2, nullptr, out, start_line, &rect1, &rect2, nullptr, &rect_out);
|
|
||||||
do_blend_effect_float(
|
do_blend_effect_float(
|
||||||
fac, context->rectx, total_lines, rect1, rect2, data->blend_effect, rect_out);
|
fac, context->rectx, total_lines, rect1, rect2, data->blend_effect, rect_out);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
uchar *rect1 = nullptr, *rect2 = nullptr, *rect_out = nullptr;
|
uchar *rect1 = nullptr, *rect2 = nullptr, *rect_out = nullptr;
|
||||||
slice_get_byte_buffers(
|
slice_get_byte_buffers(context, ibuf1, ibuf2, out, start_line, &rect1, &rect2, &rect_out);
|
||||||
context, ibuf1, ibuf2, nullptr, out, start_line, &rect1, &rect2, nullptr, &rect_out);
|
|
||||||
do_blend_effect_byte(
|
do_blend_effect_byte(
|
||||||
fac, context->rectx, total_lines, rect1, rect2, data->blend_effect, rect_out);
|
fac, context->rectx, total_lines, rect1, rect2, data->blend_effect, rect_out);
|
||||||
}
|
}
|
||||||
@@ -1457,10 +1397,9 @@ static ImBuf *do_wipe_effect(const SeqRenderData *context,
|
|||||||
float /*timeline_frame*/,
|
float /*timeline_frame*/,
|
||||||
float fac,
|
float fac,
|
||||||
ImBuf *ibuf1,
|
ImBuf *ibuf1,
|
||||||
ImBuf *ibuf2,
|
ImBuf *ibuf2)
|
||||||
ImBuf *ibuf3)
|
|
||||||
{
|
{
|
||||||
ImBuf *out = prepare_effect_imbufs(context, ibuf1, ibuf2, ibuf3);
|
ImBuf *out = prepare_effect_imbufs(context, ibuf1, ibuf2);
|
||||||
|
|
||||||
if (out->float_buffer.data) {
|
if (out->float_buffer.data) {
|
||||||
do_wipe_effect(seq,
|
do_wipe_effect(seq,
|
||||||
@@ -1607,7 +1546,6 @@ static void do_transform_effect(const SeqRenderData *context,
|
|||||||
float /*fac*/,
|
float /*fac*/,
|
||||||
const ImBuf *ibuf1,
|
const ImBuf *ibuf1,
|
||||||
const ImBuf * /*ibuf2*/,
|
const ImBuf * /*ibuf2*/,
|
||||||
const ImBuf * /*ibuf3*/,
|
|
||||||
int start_line,
|
int start_line,
|
||||||
int total_lines,
|
int total_lines,
|
||||||
ImBuf *out)
|
ImBuf *out)
|
||||||
@@ -1874,10 +1812,9 @@ static ImBuf *do_glow_effect(const SeqRenderData *context,
|
|||||||
float /*timeline_frame*/,
|
float /*timeline_frame*/,
|
||||||
float fac,
|
float fac,
|
||||||
ImBuf *ibuf1,
|
ImBuf *ibuf1,
|
||||||
ImBuf *ibuf2,
|
ImBuf *ibuf2)
|
||||||
ImBuf *ibuf3)
|
|
||||||
{
|
{
|
||||||
ImBuf *out = prepare_effect_imbufs(context, ibuf1, ibuf2, ibuf3);
|
ImBuf *out = prepare_effect_imbufs(context, ibuf1, ibuf2);
|
||||||
|
|
||||||
int render_size = 100 * context->rectx / context->scene->r.xsch;
|
int render_size = 100 * context->rectx / context->scene->r.xsch;
|
||||||
|
|
||||||
@@ -1950,11 +1887,10 @@ static ImBuf *do_solid_color(const SeqRenderData *context,
|
|||||||
float /*timeline_frame*/,
|
float /*timeline_frame*/,
|
||||||
float /*fac*/,
|
float /*fac*/,
|
||||||
ImBuf *ibuf1,
|
ImBuf *ibuf1,
|
||||||
ImBuf *ibuf2,
|
ImBuf *ibuf2)
|
||||||
ImBuf *ibuf3)
|
|
||||||
{
|
{
|
||||||
using namespace blender;
|
using namespace blender;
|
||||||
ImBuf *out = prepare_effect_imbufs(context, ibuf1, ibuf2, ibuf3);
|
ImBuf *out = prepare_effect_imbufs(context, ibuf1, ibuf2);
|
||||||
|
|
||||||
SolidColorVars *cv = (SolidColorVars *)seq->effectdata;
|
SolidColorVars *cv = (SolidColorVars *)seq->effectdata;
|
||||||
|
|
||||||
@@ -2016,8 +1952,7 @@ static ImBuf *do_multicam(const SeqRenderData *context,
|
|||||||
float timeline_frame,
|
float timeline_frame,
|
||||||
float /*fac*/,
|
float /*fac*/,
|
||||||
ImBuf * /*ibuf1*/,
|
ImBuf * /*ibuf1*/,
|
||||||
ImBuf * /*ibuf2*/,
|
ImBuf * /*ibuf2*/)
|
||||||
ImBuf * /*ibuf3*/)
|
|
||||||
{
|
{
|
||||||
ImBuf *out;
|
ImBuf *out;
|
||||||
Editing *ed;
|
Editing *ed;
|
||||||
@@ -2103,8 +2038,7 @@ static ImBuf *do_adjustment(const SeqRenderData *context,
|
|||||||
float timeline_frame,
|
float timeline_frame,
|
||||||
float /*fac*/,
|
float /*fac*/,
|
||||||
ImBuf * /*ibuf1*/,
|
ImBuf * /*ibuf1*/,
|
||||||
ImBuf * /*ibuf2*/,
|
ImBuf * /*ibuf2*/)
|
||||||
ImBuf * /*ibuf3*/)
|
|
||||||
{
|
{
|
||||||
ImBuf *out;
|
ImBuf *out;
|
||||||
Editing *ed;
|
Editing *ed;
|
||||||
@@ -2294,8 +2228,7 @@ static ImBuf *do_speed_effect(const SeqRenderData *context,
|
|||||||
float timeline_frame,
|
float timeline_frame,
|
||||||
float fac,
|
float fac,
|
||||||
ImBuf *ibuf1,
|
ImBuf *ibuf1,
|
||||||
ImBuf *ibuf2,
|
ImBuf *ibuf2)
|
||||||
ImBuf *ibuf3)
|
|
||||||
{
|
{
|
||||||
SpeedControlVars *s = (SpeedControlVars *)seq->effectdata;
|
SpeedControlVars *s = (SpeedControlVars *)seq->effectdata;
|
||||||
SeqEffectHandle cross_effect = get_sequence_effect_impl(SEQ_TYPE_CROSS);
|
SeqEffectHandle cross_effect = get_sequence_effect_impl(SEQ_TYPE_CROSS);
|
||||||
@@ -2305,7 +2238,7 @@ static ImBuf *do_speed_effect(const SeqRenderData *context,
|
|||||||
fac = speed_effect_interpolation_ratio_get(context->scene, seq, timeline_frame);
|
fac = speed_effect_interpolation_ratio_get(context->scene, seq, timeline_frame);
|
||||||
/* Current frame is ibuf1, next frame is ibuf2. */
|
/* Current frame is ibuf1, next frame is ibuf2. */
|
||||||
out = seq_render_effect_execute_threaded(
|
out = seq_render_effect_execute_threaded(
|
||||||
&cross_effect, context, nullptr, timeline_frame, fac, ibuf1, ibuf2, ibuf3);
|
&cross_effect, context, nullptr, timeline_frame, fac, ibuf1, ibuf2);
|
||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2325,7 +2258,6 @@ static void do_overdrop_effect(const SeqRenderData *context,
|
|||||||
float fac,
|
float fac,
|
||||||
const ImBuf *ibuf1,
|
const ImBuf *ibuf1,
|
||||||
const ImBuf *ibuf2,
|
const ImBuf *ibuf2,
|
||||||
const ImBuf * /*ibuf3*/,
|
|
||||||
int start_line,
|
int start_line,
|
||||||
int total_lines,
|
int total_lines,
|
||||||
ImBuf *out)
|
ImBuf *out)
|
||||||
@@ -2336,8 +2268,7 @@ static void do_overdrop_effect(const SeqRenderData *context,
|
|||||||
if (out->float_buffer.data) {
|
if (out->float_buffer.data) {
|
||||||
float *rect1 = nullptr, *rect2 = nullptr, *rect_out = nullptr;
|
float *rect1 = nullptr, *rect2 = nullptr, *rect_out = nullptr;
|
||||||
|
|
||||||
slice_get_float_buffers(
|
slice_get_float_buffers(context, ibuf1, ibuf2, out, start_line, &rect1, &rect2, &rect_out);
|
||||||
context, ibuf1, ibuf2, nullptr, out, start_line, &rect1, &rect2, nullptr, &rect_out);
|
|
||||||
|
|
||||||
do_drop_effect_float(fac, x, y, rect1, rect2, rect_out);
|
do_drop_effect_float(fac, x, y, rect1, rect2, rect_out);
|
||||||
do_alphaover_effect(fac, x, y, rect1, rect2, rect_out);
|
do_alphaover_effect(fac, x, y, rect1, rect2, rect_out);
|
||||||
@@ -2345,8 +2276,7 @@ static void do_overdrop_effect(const SeqRenderData *context,
|
|||||||
else {
|
else {
|
||||||
uchar *rect1 = nullptr, *rect2 = nullptr, *rect_out = nullptr;
|
uchar *rect1 = nullptr, *rect2 = nullptr, *rect_out = nullptr;
|
||||||
|
|
||||||
slice_get_byte_buffers(
|
slice_get_byte_buffers(context, ibuf1, ibuf2, out, start_line, &rect1, &rect2, &rect_out);
|
||||||
context, ibuf1, ibuf2, nullptr, out, start_line, &rect1, &rect2, nullptr, &rect_out);
|
|
||||||
|
|
||||||
do_drop_effect_byte(fac, x, y, rect1, rect2, rect_out);
|
do_drop_effect_byte(fac, x, y, rect1, rect2, rect_out);
|
||||||
do_alphaover_effect(fac, x, y, rect1, rect2, rect_out);
|
do_alphaover_effect(fac, x, y, rect1, rect2, rect_out);
|
||||||
@@ -2485,8 +2415,7 @@ static ImBuf *do_gaussian_blur_effect(const SeqRenderData *context,
|
|||||||
float /*timeline_frame*/,
|
float /*timeline_frame*/,
|
||||||
float /*fac*/,
|
float /*fac*/,
|
||||||
ImBuf *ibuf1,
|
ImBuf *ibuf1,
|
||||||
ImBuf * /*ibuf2*/,
|
ImBuf * /*ibuf2*/)
|
||||||
ImBuf * /*ibuf3*/)
|
|
||||||
{
|
{
|
||||||
using namespace blender;
|
using namespace blender;
|
||||||
|
|
||||||
@@ -2502,7 +2431,7 @@ static ImBuf *do_gaussian_blur_effect(const SeqRenderData *context,
|
|||||||
const bool is_float = ibuf1->float_buffer.data;
|
const bool is_float = ibuf1->float_buffer.data;
|
||||||
|
|
||||||
/* Horizontal blur: create output, blur ibuf1 into it. */
|
/* Horizontal blur: create output, blur ibuf1 into it. */
|
||||||
ImBuf *out = prepare_effect_imbufs(context, ibuf1, nullptr, nullptr);
|
ImBuf *out = prepare_effect_imbufs(context, ibuf1, nullptr);
|
||||||
threading::parallel_for(IndexRange(context->recty), 32, [&](const IndexRange y_range) {
|
threading::parallel_for(IndexRange(context->recty), 32, [&](const IndexRange y_range) {
|
||||||
const int y_first = y_range.first();
|
const int y_first = y_range.first();
|
||||||
const int y_size = y_range.size();
|
const int y_size = y_range.size();
|
||||||
@@ -2530,7 +2459,7 @@ static ImBuf *do_gaussian_blur_effect(const SeqRenderData *context,
|
|||||||
|
|
||||||
/* Vertical blur: create output, blur previous output into it. */
|
/* Vertical blur: create output, blur previous output into it. */
|
||||||
ibuf1 = out;
|
ibuf1 = out;
|
||||||
out = prepare_effect_imbufs(context, ibuf1, nullptr, nullptr);
|
out = prepare_effect_imbufs(context, ibuf1, nullptr);
|
||||||
threading::parallel_for(IndexRange(context->recty), 32, [&](const IndexRange y_range) {
|
threading::parallel_for(IndexRange(context->recty), 32, [&](const IndexRange y_range) {
|
||||||
const int y_first = y_range.first();
|
const int y_first = y_range.first();
|
||||||
const int y_size = y_range.size();
|
const int y_size = y_range.size();
|
||||||
@@ -3131,12 +3060,11 @@ static ImBuf *do_text_effect(const SeqRenderData *context,
|
|||||||
float /*timeline_frame*/,
|
float /*timeline_frame*/,
|
||||||
float /*fac*/,
|
float /*fac*/,
|
||||||
ImBuf * /*ibuf1*/,
|
ImBuf * /*ibuf1*/,
|
||||||
ImBuf * /*ibuf2*/,
|
ImBuf * /*ibuf2*/)
|
||||||
ImBuf * /*ibuf3*/)
|
|
||||||
{
|
{
|
||||||
/* NOTE: text rasterization only fills in part of output image,
|
/* NOTE: text rasterization only fills in part of output image,
|
||||||
* need to clear it. */
|
* need to clear it. */
|
||||||
ImBuf *out = prepare_effect_imbufs(context, nullptr, nullptr, nullptr, false);
|
ImBuf *out = prepare_effect_imbufs(context, nullptr, nullptr, false);
|
||||||
TextVars *data = static_cast<TextVars *>(seq->effectdata);
|
TextVars *data = static_cast<TextVars *>(seq->effectdata);
|
||||||
const int width = out->x;
|
const int width = out->x;
|
||||||
const int height = out->y;
|
const int height = out->y;
|
||||||
@@ -3322,13 +3250,9 @@ static void get_default_fac_fade(const Scene *scene,
|
|||||||
*fac = math::clamp(*fac, 0.0f, 1.0f);
|
*fac = math::clamp(*fac, 0.0f, 1.0f);
|
||||||
}
|
}
|
||||||
|
|
||||||
static ImBuf *init_execution(const SeqRenderData *context,
|
static ImBuf *init_execution(const SeqRenderData *context, ImBuf *ibuf1, ImBuf *ibuf2)
|
||||||
ImBuf *ibuf1,
|
|
||||||
ImBuf *ibuf2,
|
|
||||||
ImBuf *ibuf3)
|
|
||||||
{
|
{
|
||||||
ImBuf *out = prepare_effect_imbufs(context, ibuf1, ibuf2, ibuf3);
|
ImBuf *out = prepare_effect_imbufs(context, ibuf1, ibuf2);
|
||||||
|
|
||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3361,7 +3285,6 @@ static SeqEffectHandle get_sequence_effect_impl(int seq_type)
|
|||||||
rval.multithreaded = true;
|
rval.multithreaded = true;
|
||||||
rval.early_out = early_out_fade;
|
rval.early_out = early_out_fade;
|
||||||
rval.get_default_fac = get_default_fac_fade;
|
rval.get_default_fac = get_default_fac_fade;
|
||||||
rval.init_execution = gammacross_init_execution;
|
|
||||||
rval.execute_slice = do_gammacross_effect;
|
rval.execute_slice = do_gammacross_effect;
|
||||||
break;
|
break;
|
||||||
case SEQ_TYPE_ADD:
|
case SEQ_TYPE_ADD:
|
||||||
|
|||||||
@@ -757,7 +757,7 @@ struct RenderEffectInitData {
|
|||||||
const SeqRenderData *context;
|
const SeqRenderData *context;
|
||||||
Sequence *seq;
|
Sequence *seq;
|
||||||
float timeline_frame, fac;
|
float timeline_frame, fac;
|
||||||
ImBuf *ibuf1, *ibuf2, *ibuf3;
|
ImBuf *ibuf1, *ibuf2;
|
||||||
|
|
||||||
ImBuf *out;
|
ImBuf *out;
|
||||||
};
|
};
|
||||||
@@ -767,7 +767,7 @@ struct RenderEffectThread {
|
|||||||
const SeqRenderData *context;
|
const SeqRenderData *context;
|
||||||
Sequence *seq;
|
Sequence *seq;
|
||||||
float timeline_frame, fac;
|
float timeline_frame, fac;
|
||||||
ImBuf *ibuf1, *ibuf2, *ibuf3;
|
ImBuf *ibuf1, *ibuf2;
|
||||||
|
|
||||||
ImBuf *out;
|
ImBuf *out;
|
||||||
int start_line, tot_line;
|
int start_line, tot_line;
|
||||||
@@ -788,7 +788,6 @@ static void render_effect_execute_init_handle(void *handle_v,
|
|||||||
handle->fac = init_data->fac;
|
handle->fac = init_data->fac;
|
||||||
handle->ibuf1 = init_data->ibuf1;
|
handle->ibuf1 = init_data->ibuf1;
|
||||||
handle->ibuf2 = init_data->ibuf2;
|
handle->ibuf2 = init_data->ibuf2;
|
||||||
handle->ibuf3 = init_data->ibuf3;
|
|
||||||
handle->out = init_data->out;
|
handle->out = init_data->out;
|
||||||
|
|
||||||
handle->start_line = start_line;
|
handle->start_line = start_line;
|
||||||
@@ -805,7 +804,6 @@ static void *render_effect_execute_do_thread(void *thread_data_v)
|
|||||||
thread_data->fac,
|
thread_data->fac,
|
||||||
thread_data->ibuf1,
|
thread_data->ibuf1,
|
||||||
thread_data->ibuf2,
|
thread_data->ibuf2,
|
||||||
thread_data->ibuf3,
|
|
||||||
thread_data->start_line,
|
thread_data->start_line,
|
||||||
thread_data->tot_line,
|
thread_data->tot_line,
|
||||||
thread_data->out);
|
thread_data->out);
|
||||||
@@ -819,11 +817,10 @@ ImBuf *seq_render_effect_execute_threaded(SeqEffectHandle *sh,
|
|||||||
float timeline_frame,
|
float timeline_frame,
|
||||||
float fac,
|
float fac,
|
||||||
ImBuf *ibuf1,
|
ImBuf *ibuf1,
|
||||||
ImBuf *ibuf2,
|
ImBuf *ibuf2)
|
||||||
ImBuf *ibuf3)
|
|
||||||
{
|
{
|
||||||
RenderEffectInitData init_data;
|
RenderEffectInitData init_data;
|
||||||
ImBuf *out = sh->init_execution(context, ibuf1, ibuf2, ibuf3);
|
ImBuf *out = sh->init_execution(context, ibuf1, ibuf2);
|
||||||
|
|
||||||
init_data.sh = sh;
|
init_data.sh = sh;
|
||||||
init_data.context = context;
|
init_data.context = context;
|
||||||
@@ -832,7 +829,6 @@ ImBuf *seq_render_effect_execute_threaded(SeqEffectHandle *sh,
|
|||||||
init_data.fac = fac;
|
init_data.fac = fac;
|
||||||
init_data.ibuf1 = ibuf1;
|
init_data.ibuf1 = ibuf1;
|
||||||
init_data.ibuf2 = ibuf2;
|
init_data.ibuf2 = ibuf2;
|
||||||
init_data.ibuf3 = ibuf3;
|
|
||||||
init_data.out = out;
|
init_data.out = out;
|
||||||
|
|
||||||
IMB_processor_apply_threaded(out->y,
|
IMB_processor_apply_threaded(out->y,
|
||||||
@@ -854,15 +850,14 @@ static ImBuf *seq_render_effect_strip_impl(const SeqRenderData *context,
|
|||||||
int i;
|
int i;
|
||||||
SeqEffectHandle sh = SEQ_effect_handle_get(seq);
|
SeqEffectHandle sh = SEQ_effect_handle_get(seq);
|
||||||
const FCurve *fcu = nullptr;
|
const FCurve *fcu = nullptr;
|
||||||
ImBuf *ibuf[3];
|
ImBuf *ibuf[2];
|
||||||
Sequence *input[3];
|
Sequence *input[2];
|
||||||
ImBuf *out = nullptr;
|
ImBuf *out = nullptr;
|
||||||
|
|
||||||
ibuf[0] = ibuf[1] = ibuf[2] = nullptr;
|
ibuf[0] = ibuf[1] = nullptr;
|
||||||
|
|
||||||
input[0] = seq->seq1;
|
input[0] = seq->seq1;
|
||||||
input[1] = seq->seq2;
|
input[1] = seq->seq2;
|
||||||
input[2] = seq->seq3;
|
|
||||||
|
|
||||||
if (!sh.execute && !(sh.execute_slice && sh.init_execution)) {
|
if (!sh.execute && !(sh.execute_slice && sh.init_execution)) {
|
||||||
/* effect not supported in this version... */
|
/* effect not supported in this version... */
|
||||||
@@ -887,10 +882,10 @@ static ImBuf *seq_render_effect_strip_impl(const SeqRenderData *context,
|
|||||||
|
|
||||||
switch (early_out) {
|
switch (early_out) {
|
||||||
case StripEarlyOut::NoInput:
|
case StripEarlyOut::NoInput:
|
||||||
out = sh.execute(context, seq, timeline_frame, fac, nullptr, nullptr, nullptr);
|
out = sh.execute(context, seq, timeline_frame, fac, nullptr, nullptr);
|
||||||
break;
|
break;
|
||||||
case StripEarlyOut::DoEffect:
|
case StripEarlyOut::DoEffect:
|
||||||
for (i = 0; i < 3; i++) {
|
for (i = 0; i < 2; i++) {
|
||||||
/* Speed effect requires time remapping of `timeline_frame` for input(s). */
|
/* Speed effect requires time remapping of `timeline_frame` for input(s). */
|
||||||
if (input[0] && seq->type == SEQ_TYPE_SPEED) {
|
if (input[0] && seq->type == SEQ_TYPE_SPEED) {
|
||||||
int target_frame = floor(
|
int target_frame = floor(
|
||||||
@@ -907,10 +902,10 @@ static ImBuf *seq_render_effect_strip_impl(const SeqRenderData *context,
|
|||||||
if (ibuf[0] && (ibuf[1] || SEQ_effect_get_num_inputs(seq->type) == 1)) {
|
if (ibuf[0] && (ibuf[1] || SEQ_effect_get_num_inputs(seq->type) == 1)) {
|
||||||
if (sh.multithreaded) {
|
if (sh.multithreaded) {
|
||||||
out = seq_render_effect_execute_threaded(
|
out = seq_render_effect_execute_threaded(
|
||||||
&sh, context, seq, timeline_frame, fac, ibuf[0], ibuf[1], ibuf[2]);
|
&sh, context, seq, timeline_frame, fac, ibuf[0], ibuf[1]);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
out = sh.execute(context, seq, timeline_frame, fac, ibuf[0], ibuf[1], ibuf[2]);
|
out = sh.execute(context, seq, timeline_frame, fac, ibuf[0], ibuf[1]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -926,7 +921,7 @@ static ImBuf *seq_render_effect_strip_impl(const SeqRenderData *context,
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < 3; i++) {
|
for (i = 0; i < 2; i++) {
|
||||||
IMB_freeImBuf(ibuf[i]);
|
IMB_freeImBuf(ibuf[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1925,19 +1920,19 @@ static ImBuf *seq_render_strip_stack_apply_effect(
|
|||||||
if (swap_input) {
|
if (swap_input) {
|
||||||
if (sh.multithreaded) {
|
if (sh.multithreaded) {
|
||||||
out = seq_render_effect_execute_threaded(
|
out = seq_render_effect_execute_threaded(
|
||||||
&sh, context, seq, timeline_frame, fac, ibuf2, ibuf1, nullptr);
|
&sh, context, seq, timeline_frame, fac, ibuf2, ibuf1);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
out = sh.execute(context, seq, timeline_frame, fac, ibuf2, ibuf1, nullptr);
|
out = sh.execute(context, seq, timeline_frame, fac, ibuf2, ibuf1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (sh.multithreaded) {
|
if (sh.multithreaded) {
|
||||||
out = seq_render_effect_execute_threaded(
|
out = seq_render_effect_execute_threaded(
|
||||||
&sh, context, seq, timeline_frame, fac, ibuf1, ibuf2, nullptr);
|
&sh, context, seq, timeline_frame, fac, ibuf1, ibuf2);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
out = sh.execute(context, seq, timeline_frame, fac, ibuf1, ibuf2, nullptr);
|
out = sh.execute(context, seq, timeline_frame, fac, ibuf1, ibuf2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -34,8 +34,7 @@ ImBuf *seq_render_effect_execute_threaded(SeqEffectHandle *sh,
|
|||||||
float timeline_frame,
|
float timeline_frame,
|
||||||
float fac,
|
float fac,
|
||||||
ImBuf *ibuf1,
|
ImBuf *ibuf1,
|
||||||
ImBuf *ibuf2,
|
ImBuf *ibuf2);
|
||||||
ImBuf *ibuf3);
|
|
||||||
void seq_imbuf_to_sequencer_space(const Scene *scene, ImBuf *ibuf, bool make_float);
|
void seq_imbuf_to_sequencer_space(const Scene *scene, ImBuf *ibuf, bool make_float);
|
||||||
blender::Vector<Sequence *> seq_get_shown_sequences(
|
blender::Vector<Sequence *> seq_get_shown_sequences(
|
||||||
const Scene *scene, ListBase *channels, ListBase *seqbase, int timeline_frame, int chanshown);
|
const Scene *scene, ListBase *channels, ListBase *seqbase, int timeline_frame, int chanshown);
|
||||||
|
|||||||
Reference in New Issue
Block a user