Re: [PATCH 7/8] [media] s5p_jpeg: Prevent JPEG 4:2:0 > YUV 4:2:0 decompression
On 04/09/2014 09:56 AM, Sachin Kamat wrote: Hi Jacek, On 9 April 2014 13:01, Jacek Anaszewski wrote: On 04/08/2014 09:49 AM, Sachin Kamat wrote: Hello Sachin, Thanks for the review. I put it into info message because this is rather hard for the user to figure out why the adjustment occurred, bearing in mind that JPEG with the same subsampling and even width is decompressed properly. This is not a common adjustment like alignment, and thus in my opinion it requires displaying the information. Are there some rules that say what cases are relevant for using the v4l2_info macro? Not really, but generally info messages are concise and detailed explanations provided as part of comments. Thanks for the explanation, I will stick to it. Regards, Jacek Anaszewski -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 7/8] [media] s5p_jpeg: Prevent JPEG 4:2:0 > YUV 4:2:0 decompression
Hi Jacek, On 9 April 2014 13:01, Jacek Anaszewski wrote: > On 04/08/2014 09:49 AM, Sachin Kamat wrote: >> > Hello Sachin, > > Thanks for the review. I put it into info message because this is > rather hard for the user to figure out why the adjustment occurred, > bearing in mind that JPEG with the same subsampling and even width > is decompressed properly. This is not a common adjustment like > alignment, and thus in my opinion it requires displaying the > information. Are there some rules that say what cases are relevant > for using the v4l2_info macro? Not really, but generally info messages are concise and detailed explanations provided as part of comments. -- With warm regards, Sachin -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 7/8] [media] s5p_jpeg: Prevent JPEG 4:2:0 > YUV 4:2:0 decompression
On 04/08/2014 09:49 AM, Sachin Kamat wrote: Hi Jacek, On 7 April 2014 18:46, Jacek Anaszewski wrote: Prevent decompression of a JPEG 4:2:0 with odd width to the YUV 4:2:0 compliant formats for Exynos4x12 SoCs and adjust capture format to RGB565 in such a case. This is required because the configuration would produce a raw image with broken luma component. Signed-off-by: Jacek Anaszewski Signed-off-by: Kyungmin Park --- + if (ctx->subsampling == V4L2_JPEG_CHROMA_SUBSAMPLING_420 && + (ctx->out_q.w & 1) && + (pix->pixelformat == V4L2_PIX_FMT_NV12 || +pix->pixelformat == V4L2_PIX_FMT_NV21 || +pix->pixelformat == V4L2_PIX_FMT_YUV420)) { + pix->pixelformat = V4L2_PIX_FMT_RGB565; + fmt = s5p_jpeg_find_format(ctx, pix->pixelformat, + FMT_TYPE_CAPTURE); + v4l2_info(&ctx->jpeg->v4l2_dev, + "Adjusted capture fourcc to RGB565. Decompression\n" + "of a JPEG file with 4:2:0 subsampling and odd\n" + "width to the YUV 4:2:0 compliant formats produces\n" + "a raw image with broken luma component.\n"); This could be made a comment in the code rather than a info message. Hello Sachin, Thanks for the review. I put it into info message because this is rather hard for the user to figure out why the adjustment occurred, bearing in mind that JPEG with the same subsampling and even width is decompressed properly. This is not a common adjustment like alignment, and thus in my opinion it requires displaying the information. Are there some rules that say what cases are relevant for using the v4l2_info macro? Regards, Jacek Anaszewski -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 7/8] [media] s5p_jpeg: Prevent JPEG 4:2:0 > YUV 4:2:0 decompression
Hi Jacek, On 7 April 2014 18:46, Jacek Anaszewski wrote: > Prevent decompression of a JPEG 4:2:0 with odd width to > the YUV 4:2:0 compliant formats for Exynos4x12 SoCs and > adjust capture format to RGB565 in such a case. This is > required because the configuration would produce a raw > image with broken luma component. > > Signed-off-by: Jacek Anaszewski > Signed-off-by: Kyungmin Park > --- > + if (ctx->subsampling == V4L2_JPEG_CHROMA_SUBSAMPLING_420 && > + (ctx->out_q.w & 1) && > + (pix->pixelformat == V4L2_PIX_FMT_NV12 || > +pix->pixelformat == V4L2_PIX_FMT_NV21 || > +pix->pixelformat == V4L2_PIX_FMT_YUV420)) { > + pix->pixelformat = V4L2_PIX_FMT_RGB565; > + fmt = s5p_jpeg_find_format(ctx, pix->pixelformat, > + FMT_TYPE_CAPTURE); > + v4l2_info(&ctx->jpeg->v4l2_dev, > + "Adjusted capture fourcc to RGB565. Decompression\n" > + "of a JPEG file with 4:2:0 subsampling and odd\n" > + "width to the YUV 4:2:0 compliant formats > produces\n" > + "a raw image with broken luma component.\n"); This could be made a comment in the code rather than a info message. -- With warm regards, Sachin -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html