From: Anton Mitrofanov Date: Wed, 13 Jul 2011 11:55:38 +0000 (+0400) Subject: Fix incorrect chroma swap for some input pixfmts X-Git-Url: http://www.zmx.ovh/git.videolan.org/?a=commitdiff_plain;h=4bc22b042f90df62452b3056f8cd6d7066572e4f;p=x264.git Fix incorrect chroma swap for some input pixfmts Problem occurred if pixfmt of lavf/ffms input was PIX_FMT_RGB24 or PIX_FMT_YUV444P. --- diff --git a/filters/video/resize.c b/filters/video/resize.c index cc51cd8c..1917f67b 100644 --- a/filters/video/resize.c +++ b/filters/video/resize.c @@ -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;