GNOME Bugzilla – Bug 687350
Add nv12/nv21 converter to i420
Last modified: 2012-11-02 14:13:00 UTC
Created attachment 227813 [details] [review] ffmpegcolorspace: Add NV12/NV21 to I420 convertion NV12/NV21 is the same format as i420, but with different byte placement. Currently in ffmpegcolorspace it get converted in two step NV12 -> RGB -> I420. I wrote converters for this, so we can get more decent performance when encoders are that picky.
Review of attachment 227813 [details] [review]: Actually this should go through Y444 and not RGB... sounds like another bug too. ::: gst/ffmpegcolorspace/imgconvert.c @@ +1575,3 @@ + /* Split UY plane to seperate U and V planes */ + for (w = width / 2; w--;) { + for (h = height / 2; h--;) { This is wrong for odd width/height @@ +1692,3 @@ + /* Split UY plane to seperate U and V planes */ + for (w = width / 2; w--;) { + for (h = height / 2; h--;) { This is wrong for odd width/height too
(In reply to comment #1) > Review of attachment 227813 [details] [review]: > > Actually this should go through Y444 and not RGB... sounds like another bug > too. > > ::: gst/ffmpegcolorspace/imgconvert.c > @@ +1575,3 @@ > + /* Split UY plane to seperate U and V planes */ > + for (w = width / 2; w--;) { > + for (h = height / 2; h--;) { > > This is wrong for odd width/height > > @@ +1692,3 @@ > + /* Split UY plane to seperate U and V planes */ > + for (w = width / 2; w--;) { > + for (h = height / 2; h--;) { > > This is wrong for odd width/height too You got a very good point, let me o back to code then.
Created attachment 227886 [details] [review] Added support for odd width and height
commit d263c3690d2cbc4d328dc4b9e81133608747ecb9 Author: Nicolas Dufresne <nicolas.dufresne@collabora.com> Date: Thu Nov 1 12:05:25 2012 +0100 ffmpegcolorspace: Add NV12/NV21 to I420 convertion https://bugzilla.gnome.org/show_bug.cgi?id=687350