+ if live_signal_num == INPUT0_SIGNAL_NUM or live_signal_num == INPUT1_SIGNAL_NUM then -- Plain input.
+ local input_type = get_input_type(signals, live_signal_num)
+ local input_scale = needs_scale(signals, live_signal_num, width, height)
+ local chain = simple_chains[input_type][input_scale][true]
+ prepare = function()
+ chain.input:connect_signal(live_signal_num)
+ set_scale_parameters_if_needed(chain, width, height)
+ set_neutral_color_from_signal(chain.wb_effect, live_signal_num)
+ end
+ return chain.chain, prepare
+ elseif live_signal_num == STATIC_SIGNAL_NUM then -- Static picture.
+ prepare = function()
+ end
+ return static_chain_hq, prepare
+ elseif live_signal_num == FADE_SIGNAL_NUM then -- Fade.
+ local input0_type = get_input_type(signals, fade_src_signal)
+ local input0_scale = needs_scale(signals, fade_src_signal, width, height)
+ local input1_type = get_input_type(signals, fade_dst_signal)
+ local input1_scale = needs_scale(signals, fade_dst_signal, width, height)
+ local chain = fade_chains[input0_type][input0_scale][input1_type][input1_scale][true]
+ prepare = function()
+ if input0_type == "live" then
+ chain.input0.input:connect_signal(fade_src_signal)
+ set_neutral_color_from_signal(chain.input0.wb_effect, fade_src_signal)
+ end
+ set_scale_parameters_if_needed(chain.input0, width, height)
+ if input1_type == "live" then
+ chain.input1.input:connect_signal(fade_dst_signal)
+ set_neutral_color_from_signal(chain.input1.wb_effect, fade_dst_signal)
+ end
+ set_scale_parameters_if_needed(chain.input1, width, height)
+ local tt = calc_fade_progress(t, transition_start, transition_end)
+
+ chain.mix_effect:set_float("strength_first", 1.0 - tt)
+ chain.mix_effect:set_float("strength_second", tt)
+ end
+ return chain.chain, prepare
+ end
+
+ -- SBS code (live_signal_num == SBS_SIGNAL_NUM).
+ local input0_type = get_input_type(signals, INPUT0_SIGNAL_NUM)
+ local input1_type = get_input_type(signals, INPUT1_SIGNAL_NUM)
+ if t > transition_end and zoom_dst == 1.0 then