Skip to content

Commit

Permalink
staging/bcm2835-codec: bytesperline for YUV420/YVU420 needs to be 64
Browse files Browse the repository at this point in the history
Matching #4419, the ISP
block (which is also used on the input of the encoder, and output
of the decoder) needs the base address of all planes to be aligned
to multiples of 32. This includes the chroma planes of YUV420 and
YVU420.
If the height is only a multiple of 2 (not 4), then you get an odd
number of lines in the second plane, which means the 3rd plane
starts at a multiple of bytesperline/2.

Set the minimum bytesperline alignment to 64 for those formats
so that the plane alignment is always right.

Signed-off-by: Dave Stevenson <[email protected]>
  • Loading branch information
6by9 authored and pelwell committed Nov 29, 2021
1 parent 6505412 commit 600d86e
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -157,14 +157,14 @@ static const struct bcm2835_codec_fmt supported_formats[] = {
/* YUV formats */
.fourcc = V4L2_PIX_FMT_YUV420,
.depth = 8,
.bytesperline_align = 32,
.bytesperline_align = 64,
.flags = 0,
.mmal_fmt = MMAL_ENCODING_I420,
.size_multiplier_x2 = 3,
}, {
.fourcc = V4L2_PIX_FMT_YVU420,
.depth = 8,
.bytesperline_align = 32,
.bytesperline_align = 64,
.flags = 0,
.mmal_fmt = MMAL_ENCODING_YV12,
.size_multiplier_x2 = 3,
Expand Down

0 comments on commit 600d86e

Please sign in to comment.