android: jpeg: Use stride instead of image width for line address

When calculating the luma line address, the image width is used instead
of the stride. Without padding at the end of the line the the values
should be identical, but this is conceptually incorrect in any case. Fix
it.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>
This commit is contained in:
Laurent Pinchart 2021-09-06 17:39:12 +03:00
parent a814205664
commit 2dca2b2fc6

View file

@ -152,7 +152,7 @@ void EncoderLibJpeg::compressNV(Span<const uint8_t> frame)
for (unsigned int y = 0; y < compress_.image_height; y++) {
unsigned char *dst = &tmprowbuf[0];
const unsigned char *src_y = src + y * compress_.image_width;
const unsigned char *src_y = src + y * y_stride;
const unsigned char *src_cb = src_c + (y / vertSubSample) * c_stride + cb_pos;
const unsigned char *src_cr = src_c + (y / vertSubSample) * c_stride + cr_pos;