Skip to content

Commit

Permalink
Extend AV1 decoding level to 6.3
Browse files Browse the repository at this point in the history
Caluclate level mapping based on the spec.

Signed-off-by: Yan Wang <yan.wang@linux.intel.com>
  • Loading branch information
wangyan42164 authored and dmitryermilov committed Aug 5, 2020
1 parent fab8930 commit a7e69f8
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 36 deletions.
6 changes: 6 additions & 0 deletions _studio/mfx_lib/decode/av1/src/mfx_av1_dec_decode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,12 @@ mfxStatus CheckLevel(mfxVideoParam* in, mfxVideoParam* out)
case MFX_LEVEL_AV1_43:
case MFX_LEVEL_AV1_5:
case MFX_LEVEL_AV1_51:
case MFX_LEVEL_AV1_52:
case MFX_LEVEL_AV1_53:
case MFX_LEVEL_AV1_6:
case MFX_LEVEL_AV1_61:
case MFX_LEVEL_AV1_62:
case MFX_LEVEL_AV1_63:
out->mfx.CodecLevel = in->mfx.CodecLevel;
break;
default:
Expand Down
35 changes: 3 additions & 32 deletions _studio/shared/umc/codec/av1_dec/src/umc_av1_decoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,39 +74,10 @@ namespace UMC_AV1_DECODER

inline uint32_t MapLevel(uint32_t levelIdx)
{
switch (levelIdx)
{
case 0:
return MFX_LEVEL_AV1_2;
case 1:
return MFX_LEVEL_AV1_21;
case 2:
return MFX_LEVEL_AV1_22;
case 3:
return MFX_LEVEL_AV1_23;
case 4:
return MFX_LEVEL_AV1_3;
case 5:
return MFX_LEVEL_AV1_31;
case 6:
return MFX_LEVEL_AV1_32;
case 7:
return MFX_LEVEL_AV1_33;
case 8:
return MFX_LEVEL_AV1_4;
case 9:
return MFX_LEVEL_AV1_41;
case 10:
return MFX_LEVEL_AV1_42;
case 11:
return MFX_LEVEL_AV1_43;
case 12:
return MFX_LEVEL_AV1_5;
case 13:
return MFX_LEVEL_AV1_51;
default:
if (levelIdx >= 0 && levelIdx < 20)
return (2 + (levelIdx >> 2)) * 10 + (levelIdx & 3);
else
return MFX_LEVEL_UNKNOWN;
}
}

UMC::Status AV1Decoder::DecodeHeader(UMC::MediaData* in, UMC_AV1_DECODER::AV1DecoderParams& par)
Expand Down
12 changes: 9 additions & 3 deletions api/include/mfxstructures.h
Original file line number Diff line number Diff line change
Expand Up @@ -512,16 +512,22 @@ enum {
MFX_LEVEL_AV1_21 = 21,
MFX_LEVEL_AV1_22 = 22,
MFX_LEVEL_AV1_23 = 23,
MFX_LEVEL_AV1_3 = 3,
MFX_LEVEL_AV1_3 = 30,
MFX_LEVEL_AV1_31 = 31,
MFX_LEVEL_AV1_32 = 32,
MFX_LEVEL_AV1_33 = 33,
MFX_LEVEL_AV1_4 = 4,
MFX_LEVEL_AV1_4 = 40,
MFX_LEVEL_AV1_41 = 41,
MFX_LEVEL_AV1_42 = 42,
MFX_LEVEL_AV1_43 = 43,
MFX_LEVEL_AV1_5 = 5,
MFX_LEVEL_AV1_5 = 50,
MFX_LEVEL_AV1_51 = 51,
MFX_LEVEL_AV1_52 = 52,
MFX_LEVEL_AV1_53 = 53,
MFX_LEVEL_AV1_6 = 60,
MFX_LEVEL_AV1_61 = 61,
MFX_LEVEL_AV1_62 = 62,
MFX_LEVEL_AV1_63 = 63,
#endif
};

Expand Down
2 changes: 1 addition & 1 deletion doc/mediasdk-man.md
Original file line number Diff line number Diff line change
Expand Up @@ -8023,7 +8023,7 @@ The `CodecLevel` enumerator itemizes codec levels for all codecs.
`MFX_LEVEL_VC1_LOW`,<br>`MFX_LEVEL_VC1_MEDIAN`,<br>`MFX_LEVEL_VC1_HIGH` | VC-1 Level Low (simple & main profiles)
`MFX_LEVEL_VC1_0`,<br>`MFX_LEVEL_VC1_1`,<br>`MFX_LEVEL_VC1_2`,<br>`MFX_LEVEL_VC1_3`,<br>`MFX_LEVEL_VC1_4` | VC-1 advanced profile levels
`MFX_LEVEL_HEVC_1`,<br>`MFX_LEVEL_HEVC_2`,<br>`MFX_LEVEL_HEVC_21`,<br>`MFX_LEVEL_HEVC_3`,<br>`MFX_LEVEL_HEVC_31`,<br>`MFX_LEVEL_HEVC_4`,<br>`MFX_LEVEL_HEVC_41`,<br>`MFX_LEVEL_HEVC_5`,<br>`MFX_LEVEL_HEVC_51`,<br>`MFX_LEVEL_HEVC_52`,<br>`MFX_LEVEL_HEVC_6`,<br>`MFX_LEVEL_HEVC_61`,<br>`MFX_LEVEL_HEVC_62`,<br><br>`MFX_TIER_HEVC_MAIN`,<br>`MFX_TIER_HEVC_HIGH` | HEVC levels and tiers
`MFX_LEVEL_AV1_2`,<br>`MFX_LEVEL_AV1_21`,<br>`MFX_LEVEL_AV1_22`,<br>`MFX_LEVEL_AV1_23`,<br>`MFX_LEVEL_AV1_3`,<br>`MFX_LEVEL_AV1_31`,<br>`MFX_LEVEL_AV1_32`,<br>`MFX_LEVEL_AV1_33`,<br>`MFX_LEVEL_AV1_4`,<br>`MFX_LEVEL_AV1_41`,<br>`MFX_LEVEL_AV1_42`,<br>`MFX_LEVEL_AV1_43`,<br>`MFX_LEVEL_AV1_5`,<br>`MFX_LEVEL_AV1_51` | AV1 levels
`MFX_LEVEL_AV1_2`,<br>`MFX_LEVEL_AV1_21`,<br>`MFX_LEVEL_AV1_22`,<br>`MFX_LEVEL_AV1_23`,<br>`MFX_LEVEL_AV1_3`,<br>`MFX_LEVEL_AV1_31`,<br>`MFX_LEVEL_AV1_32`,<br>`MFX_LEVEL_AV1_33`,<br>`MFX_LEVEL_AV1_4`,<br>`MFX_LEVEL_AV1_41`,<br>`MFX_LEVEL_AV1_42`,<br>`MFX_LEVEL_AV1_43`,<br>`MFX_LEVEL_AV1_5`,<br>`MFX_LEVEL_AV1_51`,<br>`MFX_LEVEL_AV1_52`,<br>`MFX_LEVEL_AV1_53`,<br>`MFX_LEVEL_AV1_6`,<br>`MFX_LEVEL_AV1_61`,<br>`MFX_LEVEL_AV1_62`,<br>`MFX_LEVEL_AV1_63` | AV1 levels

**Change History**

Expand Down

0 comments on commit a7e69f8

Please sign in to comment.