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 757022 - pnm: Implementation of GRAY16 handling
pnm: Implementation of GRAY16 handling
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
git master
Other All
: Normal enhancement
: 1.9.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2015-10-23 13:20 UTC by Dimitrios Katsaros
Modified: 2016-05-23 21:22 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch implementing GRAY16 handling for pnmenc (9.40 KB, patch)
2015-10-23 13:22 UTC, Dimitrios Katsaros
accepted-commit_now Details | Review
Patch implementing GRAY16 handling for pnmdec (8.94 KB, patch)
2015-10-23 13:23 UTC, Dimitrios Katsaros
none Details | Review
pnmenc: Implementation of GRAY16 handling (8.93 KB, patch)
2016-05-15 16:04 UTC, Jan Schmidt
needs-work Details | Review
pnmenc: Implementation of GRAY16 handling (8.93 KB, patch)
2016-05-15 16:07 UTC, Jan Schmidt
none Details | Review

Description Dimitrios Katsaros 2015-10-23 13:20:10 UTC
The pnm encoder and decoder components do not include handling for 16Bit grayscale images. This patch set extend the functionality of the elements, adding GRAY16_BE and GRAY16_LE handling. 

For the decoder, 16Bit images are defined when the max value of the raw pnm is larger than 255. for BE and LE handling, the downstream peer is queried and compatible caps are determined, prioritizing BE. The reason we prioritize BE is because BE is the preferred format for 16bit pgm images (http://netpbm.sourceforge.net/doc/pamendian.html).
Comment 1 Dimitrios Katsaros 2015-10-23 13:22:52 UTC
Created attachment 313941 [details] [review]
Patch implementing GRAY16 handling for pnmenc
Comment 2 Dimitrios Katsaros 2015-10-23 13:23:29 UTC
Created attachment 313942 [details] [review]
Patch implementing GRAY16 handling for pnmdec
Comment 3 Jan Schmidt 2016-05-15 15:44:12 UTC
Review of attachment 313941 [details] [review]:

Generally looks good except for the one niggle that I'll remove, thanks

::: gst/pnm/gstpnmenc.c
@@ +176,3 @@
 }
 
+;

Spurious extra ; here
Comment 4 Jan Schmidt 2016-05-15 16:03:32 UTC
Review of attachment 313941 [details] [review]:

::: gst/pnm/gstpnmenc.c
@@ +248,3 @@
   if (gst_buffer_map (frame->output_buffer, &omap, GST_MAP_WRITE) == FALSE) {
     ret = GST_FLOW_ERROR;
+    g_free (header);

This is freed already at the done: label

@@ +254,3 @@
     /* Unmap already mapped buffer */
     gst_buffer_unmap (frame->output_buffer, &omap);
+    g_free (header);

Same here.

@@ +371,3 @@
   gst_buffer_unmap (frame->output_buffer, &omap);
   gst_buffer_unmap (frame->input_buffer, &imap);
+  g_free (header);

and here.
Comment 5 Jan Schmidt 2016-05-15 16:04:47 UTC
Created attachment 327939 [details] [review]
pnmenc: Implementation of GRAY16 handling
Comment 6 Jan Schmidt 2016-05-15 16:05:36 UTC
Fixed the problems in the pnmenc patch. The remaining one I just realised is that there's no differentiation between GRAY16_BE input and GRAY16_LE input. That needs fixing first.
Comment 7 Jan Schmidt 2016-05-15 16:07:39 UTC
Created attachment 327941 [details] [review]
pnmenc: Implementation of GRAY16 handling