Commit 86c256be authored by Nicolas Dufresne's avatar Nicolas Dufresne Committed by Mauro Carvalho Chehab
Browse files

media: v4l2-common: Add support for fractional bpp



Fraction bytes-per-pixel exist for some packed format. You will find
notably on Rockhip platform that 10bit data is stored fully packed,
meaning that there is 1.25 pixels per bytes. This can be represented
with the fraction 5/4 and can be used to scale the width into a
bytesperline.

Signed-off-by: default avatarNicolas Dufresne <nicolas.dufresne@collabora.com>
Signed-off-by: default avatarBenjamin Gaignard <benjamin.gaignard@collabora.com>
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@kernel.org>
parent 2ef33723
Loading
Loading
Loading
Loading
+80 −80

File changed.

Preview size limit exceeded, changes collapsed.

+2 −0
Original line number Diff line number Diff line
@@ -480,6 +480,7 @@ enum v4l2_pixel_encoding {
 * @mem_planes: Number of memory planes, which includes the alpha plane (1 to 4).
 * @comp_planes: Number of component planes, which includes the alpha plane (1 to 4).
 * @bpp: Array of per-plane bytes per pixel
 * @bpp_div: Array of per-plane bytes per pixel divisors to support fractional pixel sizes.
 * @hdiv: Horizontal chroma subsampling factor
 * @vdiv: Vertical chroma subsampling factor
 * @block_w: Per-plane macroblock pixel width (optional)
@@ -491,6 +492,7 @@ struct v4l2_format_info {
	u8 mem_planes;
	u8 comp_planes;
	u8 bpp[4];
	u8 bpp_div[4];
	u8 hdiv;
	u8 vdiv;
	u8 block_w[4];