Track compositing behavior change
Track compositing in Kdenlive is one cause of slowdown in timeline playback. For each frame on each track, we check if the frame has an alpha channel, then we check if the dimension of the image is same of larger than project profile. If there is no alpha channel and image is not smaller, we consider the frame as opaque and no compositing is performed.
One corner case is if user adds a video with an aspect ratio slightly different than the project's profile size. See for example screenshot below.
The video is over a pink color clip, and as its aspect ratio is slightly different, a compositing is applied and we see the pink background in the borders. This means that the track compositing is performed and playback performance is poor.
My proposal would be to change this behavior and consider frames with on alpha but a different aspect ratio as opaque. So the result would be as below: pink background not visible anymore.
If user still want to have transparent borders, it can simply be done by adding a transform effect for example. This change can lead to some big performance improvements in some specific use cases (as mentionned when using source clips with a different aspect ratio). For example playing a single 4k clip in timeline with a different aspect ratio, the playback fps is currently ~7 fps on my laptop, while with the proposed change it goes back to 25 fps as compositing with the black background track is bypassed.
Is there any objection ?