Skip to content

Commit

Permalink
rkmppdec: divide hor stride by 4 when in AFBC. Most likely an mpp bug
Browse files Browse the repository at this point in the history
  • Loading branch information
boogieeeee committed Jan 4, 2024
1 parent 1b2fe16 commit 4487c02
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion libavcodec/rkmppdec.c
Original file line number Diff line number Diff line change
Expand Up @@ -514,7 +514,8 @@ static int rkmpp_export_frame(AVCodecContext *avctx, AVFrame *frame, MppFrame mp
DRM_FORMAT_MOD_ARM_AFBC(AFBC_FORMAT_MOD_SPARSE | AFBC_FORMAT_MOD_BLOCK_SIZE_16x16);
layer->format = rkmpp_get_drm_afbc_format(mpp_fmt);
layer->nb_planes = 1;
layer->planes[0].pitch = mpp_frame_get_hor_stride(mpp_frame);
// no idea why 1/4, found by testing, should be an mpp bug
layer->planes[0].pitch = mpp_frame_get_hor_stride(mpp_frame) >> 2;
layer->planes[0].offset = mpp_frame_get_offset_y(mpp_frame) * layer->planes[0].pitch;
} else {
layer->format = rkmpp_get_drm_format(mpp_fmt);
Expand Down

0 comments on commit 4487c02

Please sign in to comment.