Skip to content

Commit a074aa4

Browse files
Kwiboomchehab
authored andcommitted
media: rkvdec: h264: Fix bit depth wrap in pps packet
The luma and chroma bit depth fields in the pps packet are 3 bits wide. 8 is wrongly added to the bit depth values written to these 3 bit fields. Because only the 3 LSB are written, the hardware was configured correctly. Correct this by not adding 8 to the luma and chroma bit depth value. Fixes: cd33c83 ("media: rkvdec: Add the rkvdec driver") Signed-off-by: Jonas Karlman <[email protected]> Signed-off-by: Nicolas Dufresne <[email protected]> Reviewed-by: Ezequiel Garcia <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
1 parent 7ab889f commit a074aa4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/staging/media/rkvdec/rkvdec-h264.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -662,8 +662,8 @@ static void assemble_hw_pps(struct rkvdec_ctx *ctx,
662662
WRITE_PPS(0xff, PROFILE_IDC);
663663
WRITE_PPS(1, CONSTRAINT_SET3_FLAG);
664664
WRITE_PPS(sps->chroma_format_idc, CHROMA_FORMAT_IDC);
665-
WRITE_PPS(sps->bit_depth_luma_minus8 + 8, BIT_DEPTH_LUMA);
666-
WRITE_PPS(sps->bit_depth_chroma_minus8 + 8, BIT_DEPTH_CHROMA);
665+
WRITE_PPS(sps->bit_depth_luma_minus8, BIT_DEPTH_LUMA);
666+
WRITE_PPS(sps->bit_depth_chroma_minus8, BIT_DEPTH_CHROMA);
667667
WRITE_PPS(0, QPPRIME_Y_ZERO_TRANSFORM_BYPASS_FLAG);
668668
WRITE_PPS(sps->log2_max_frame_num_minus4, LOG2_MAX_FRAME_NUM_MINUS4);
669669
WRITE_PPS(sps->max_num_ref_frames, MAX_NUM_REF_FRAMES);

0 commit comments

Comments
 (0)