After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 687350 - Add nv12/nv21 converter to i420
Add nv12/nv21 converter to i420
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
0.10.x
Other Linux
: Normal normal
: 0.10.37
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2012-11-01 15:31 UTC by Nicolas Dufresne (ndufresne)
Modified: 2012-11-02 14:13 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
ffmpegcolorspace: Add NV12/NV21 to I420 convertion (3.28 KB, patch)
2012-11-01 15:31 UTC, Nicolas Dufresne (ndufresne)
needs-work Details | Review
Added support for odd width and height (3.59 KB, patch)
2012-11-02 12:22 UTC, Nicolas Dufresne (ndufresne)
committed Details | Review

Description Nicolas Dufresne (ndufresne) 2012-11-01 15:31:21 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.
Comment 1 Sebastian Dröge (slomo) 2012-11-01 15:49:52 UTC
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
Comment 2 Nicolas Dufresne (ndufresne) 2012-11-02 09:02:05 UTC
(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.
Comment 3 Nicolas Dufresne (ndufresne) 2012-11-02 12:22:23 UTC
Created attachment 227886 [details] [review]
Added support for odd width and height
Comment 4 Olivier Crête 2012-11-02 13:40:30 UTC
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