[hal_jpegd]: Check output format before decoding

Change-Id: I035297695a4ff027814507e829adba1a767f61e8
Signed-off-by: Johnson Ding <johnson.ding@rock-chips.com>
This commit is contained in:
Johnson Ding
2021-08-19 16:42:26 +08:00
committed by Herman Chen
parent 516fd94a0b
commit 0faeb9413f
5 changed files with 32 additions and 8 deletions

View File

@@ -664,8 +664,13 @@ int dec_decode(MpiDecTestCmd *cmd)
}
} else {
/* NOTE: change output format before jpeg decoding */
if (cmd->format < MPP_FMT_BUTT)
if (MPP_FRAME_FMT_IS_YUV(cmd->format) || MPP_FRAME_FMT_IS_RGB(cmd->format)) {
ret = mpi->control(ctx, MPP_DEC_SET_OUTPUT_FORMAT, &cmd->format);
if (ret) {
mpp_err("Failed to set output format %d\n", cmd->format);
goto MPP_TEST_OUT;
}
}
while (!data.eos) {
dec_advanced(&data);