[x264-devel] commit: Fix incompatible csp format issue (Steven Walters )

git at videolan.org git at videolan.org
Tue Dec 7 09:15:48 CET 2010


x264 | branch: master | Steven Walters <kemuri9 at gmail.com> | Sun Oct 10 18:17:35 2010 -0400| [71cf5fd3fb62752b84de39fd14284da9900afca5] | committer: Jason Garrett-Glaser 

Fix incompatible csp format issue
Problem occurred with unknown pixel formats and non mod2 resolutions in the resize filter.

> http://git.videolan.org/gitweb.cgi/x264.git/?a=commit;h=71cf5fd3fb62752b84de39fd14284da9900afca5
---

 filters/video/resize.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/filters/video/resize.c b/filters/video/resize.c
index 48f22cf..464bfdf 100644
--- a/filters/video/resize.c
+++ b/filters/video/resize.c
@@ -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;
     }



More information about the x264-devel mailing list