]> git.sesse.net Git - x264/commitdiff
Fix incorrect chroma swap for some input pixfmts
authorAnton Mitrofanov <BugMaster@narod.ru>
Wed, 13 Jul 2011 11:55:38 +0000 (15:55 +0400)
committerFiona Glaser <fiona@x264.com>
Thu, 14 Jul 2011 23:37:54 +0000 (16:37 -0700)
Problem occurred if pixfmt of lavf/ffms input was PIX_FMT_RGB24 or PIX_FMT_YUV444P.

filters/video/resize.c

index cc51cd8c35fad069a776e53a4dbeac33e3e87e2a..1917f67b70d476ff241981f33525157deb826237 100644 (file)
@@ -465,8 +465,8 @@ static int init( hnd_t *handle, cli_vid_filter_t *filter, video_info_t *info, x2
     h->scale = h->dst;
 
     /* swap chroma planes if YV12/YV24 is involved, as libswscale works with I420/I444 */
-    int src_csp = info->csp & X264_CSP_MASK;
-    int dst_csp = h->dst_csp & X264_CSP_MASK;
+    int src_csp = info->csp & (X264_CSP_MASK | X264_CSP_OTHER);
+    int dst_csp = h->dst_csp & (X264_CSP_MASK | X264_CSP_OTHER);
     h->pre_swap_chroma  = src_csp == X264_CSP_YV12 || src_csp == X264_CSP_YV24;
     h->post_swap_chroma = dst_csp == X264_CSP_YV12 || dst_csp == X264_CSP_YV24;