On 04/08/2014 09:49 AM, Sachin Kamat wrote:
Hi Jacek,
On 7 April 2014 18:46, Jacek Anaszewski <j.anaszewski@xxxxxxxxxxx> 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 <j.anaszewski@xxxxxxxxxxx>
Signed-off-by: Kyungmin Park <kyungmin.park@xxxxxxxxxxx>
---
<snip>
+ 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 majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html