]> git.videolan.org Git - x264.git/commitdiff
Fix incompatible csp format issue
authorSteven Walters <kemuri9@gmail.com>
Sun, 10 Oct 2010 22:17:35 +0000 (18:17 -0400)
committerJason Garrett-Glaser <darkshikari@gmail.com>
Sun, 5 Dec 2010 22:58:41 +0000 (14:58 -0800)
Problem occurred with unknown pixel formats and non mod2 resolutions in the resize filter.

filters/video/resize.c

index 48f22cf5b5da0ef78a8f1b4c0aad0f84d96872a3..464bfdf9421dc18665f9cc4ef6fd3fdd993b4206 100644 (file)
@@ -369,7 +369,14 @@ static int init( hnd_t *handle, cli_vid_filter_t *filter, video_info_t *info, x2
         h->dst.width  = info->width;
         h->dst.height = info->height;
         if( !strcmp( opt_string, "normcsp" ) )
+        {
             h->dst_csp = pick_closest_supported_csp( info->csp );
+            /* now fix the catch-all i420 choice if it does not allow for the current input resolution dimensions. */
+            if( h->dst_csp == X264_CSP_I420 && info->width&1 )
+                h->dst_csp = X264_CSP_I444;
+            if( h->dst_csp == X264_CSP_I420 && info->height&1 )
+                h->dst_csp = X264_CSP_I422;
+        }
         else if( handle_opts( optlist, opts, info, h ) )
             return -1;
     }