Commit ef213e30 authored by Francois Buergisser's avatar Francois Buergisser Committed by Ezequiel Garcia

media: hantro: Fix picture order count table enable

The picture order count table only makes sense for profiles
higher than Baseline. This is confirmed by the H.264 specification
(See 8.2.1 Decoding process for picture order count), which
clarifies how POC are used for features not present in Baseline.

Picture order counts are used to determine initial picture orderings
for reference pictures in the decoding of B slices, to represent picture
order differences between frames or fields for motion vector derivation
in temporal direct mode, for implicit mode weighted prediction in B slices,
and for decoder conformance checking.

As a side note, this change matches various vendors downstream codebases,
including ChromiumOS and IMX VPU libraries.

Fixes: dea0a82f ("media: hantro: Add support for H264 decoding on G1")
Signed-off-by: default avatarFrancois Buergisser <>
Signed-off-by: Ezequiel Garcia's avatarEzequiel Garcia <>
Signed-off-by: default avatarJonas Karlman <>
Reviewed-by: Boris Brezillon's avatarBoris Brezillon <>
Tested-by: Boris Brezillon's avatarBoris Brezillon <>
Cc: <>      # for v5.4 and up
Signed-off-by: default avatarHans Verkuil <>
Signed-off-by: default avatarMauro Carvalho Chehab <>
parent b5412d49
......@@ -34,9 +34,11 @@ static void set_params(struct hantro_ctx *ctx)
reg = G1_REG_DEC_CTRL0_DEC_AXI_WR_ID(0x0);
if (sps->flags & V4L2_H264_SPS_FLAG_MB_ADAPTIVE_FRAME_FIELD)
if (sps->profile_idc > 66 && dec_param->nal_ref_idc)
if (sps->profile_idc > 66) {
if (dec_param->nal_ref_idc)
if (!(sps->flags & V4L2_H264_SPS_FLAG_FRAME_MBS_ONLY) &&
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment