GNOME Bugzilla – Bug 757022
pnm: Implementation of GRAY16 handling
Last modified: 2016-05-23 21:22:54 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).
Created attachment 313941 [details] [review] Patch implementing GRAY16 handling for pnmenc
Created attachment 313942 [details] [review] Patch implementing GRAY16 handling for pnmdec
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
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.
Created attachment 327939 [details] [review] pnmenc: Implementation of GRAY16 handling
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.
Created attachment 327941 [details] [review] pnmenc: Implementation of GRAY16 handling