Fix T47724: VSE crops video if horizontal resolution isn't divisible by 8
authorSergey Sharybin <sergey.vfx@gmail.com>
Thu, 10 Mar 2016 08:17:27 +0000 (13:17 +0500)
committerSergey Sharybin <sergey.vfx@gmail.com>
Thu, 10 Mar 2016 08:22:09 +0000 (13:22 +0500)
This is a bit annoying, but FFmpeg can't deal with unaligned arrays in some
cases. There seems to be an easy workaround with using SWS_ACCURATE_RND flag
which should be harmless since we don't really scaling frames, but only
using sws_scale to change color space.

Additionally, this is what VLC is also using.

source/blender/imbuf/intern/anim_movie.c

index 1b4ce4225d6fff04a74e084879b7640de559922a..1b3b9c28d7423e7c51819219ee1221d9153107fc 100644 (file)
@@ -600,7 +600,7 @@ static int startffmpeg(struct anim *anim)
                anim->x,
                anim->y,
                AV_PIX_FMT_RGBA,
-               SWS_FAST_BILINEAR | SWS_PRINT_INFO | SWS_FULL_CHR_H_INT,
+               SWS_FAST_BILINEAR | SWS_PRINT_INFO | SWS_FULL_CHR_H_INT | SWS_ACCURATE_RND,
                NULL, NULL, NULL);
                
        if (!anim->img_convert_ctx) {