Skip to content

Commit

Permalink
HACK: avcodec/rkmppdec: Force aligning coded width and height to 64
Browse files Browse the repository at this point in the history
The chromium would try to align planes' width and height to 32, which
might break the plane buffers' contiguous required by RGA.

Passing a 64-aligned coded width and height to avoid that.

Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
  • Loading branch information
JeffyCN committed May 21, 2021
1 parent f6012a9 commit f06fbed
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions libavcodec/rkmppdec.c
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,11 @@ static int rkmpp_get_frame(AVCodecContext *avctx, AVFrame *frame, int timeout)
avctx->width = mpp_frame_get_width(mppframe);
avctx->height = mpp_frame_get_height(mppframe);

// chromium would align planes' width and height to 32, adding this
// hack to avoid breaking the plane buffers' contiguous.
avctx->coded_width = FFALIGN(avctx->width, 64);
avctx->coded_height = FFALIGN(avctx->height, 64);

decoder->mpi->control(decoder->ctx, MPP_DEC_SET_INFO_CHANGE_READY, NULL);

av_buffer_unref(&decoder->frames_ref);
Expand Down

0 comments on commit f06fbed

Please sign in to comment.