]> www.infradead.org Git - users/dwmw2/linux.git/commit
media: imx-jpeg: Change the pattern size to 128x64
authorMing Qian <ming.qian@oss.nxp.com>
Mon, 21 Apr 2025 08:12:55 +0000 (16:12 +0800)
committerHans Verkuil <hverkuil@xs4all.nl>
Thu, 24 Apr 2025 13:21:37 +0000 (15:21 +0200)
commitf65fbf8c3d6711325f947b49d4067e7d05fd79de
tree33280f6c42b946c6c8f6c1613cd7b6c8d21f33fb
parent7500bb9cf164edbb2c8117d57620227b1a4a8369
media: imx-jpeg: Change the pattern size to 128x64

In order to decode a motion-jpeg bitstream, which doesn't provide a DHT,
the driver will first decode a pattern jpeg and use the DHT found in the
pattern to decode the first actual frame. This mode is called
"repeat-mode" and it utilizes linked descriptors.

The smallest supported resolution of 64x64 was used for that pattern to
not cause unneeded performance delay. This choice, however, can cause a
corrupted decoded picture of the first frame after the pattern, when the
resolution of that frame is larger than the pattern and is not aligned
to 64.

By altering the pattern size to 128x64, this corruption can be avoided.
That size has been confirmed to be safe by the hardware designers.
Additionally, a DMA buffer needs to be allocated to store the decoded
picture of the pattern image.

Signed-off-by: Ming Qian <ming.qian@oss.nxp.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Signed-off-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
drivers/media/platform/nxp/imx-jpeg/mxc-jpeg.c
drivers/media/platform/nxp/imx-jpeg/mxc-jpeg.h