Skip to content

Commit 4328017

Browse files
ZefuLIintel-mediadev
authored andcommittedSep 7, 2021
[Decode] Fix AV1 log2 calculation issue in DDI.
When delta_lf_res = 0, log(0) could cause unexpected behavior in driver.
1 parent 7f7818c commit 4328017

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed
 

‎media_common/agnostic/common/codec/shared/codec_def_common.h

+10
Original file line numberDiff line numberDiff line change
@@ -633,4 +633,14 @@ static __inline int32_t CodecHal_Clip3(int x, int y, int z)
633633

634634
return ret;
635635
}
636+
637+
static __inline uint32_t CeilLog2(uint32_t value)
638+
{
639+
uint32_t res = 0;
640+
641+
while (value > (uint32_t)(1 << res)) res++;
642+
643+
return res;
644+
}
645+
636646
#endif // __CODEC_DEF_COMMON_H__

0 commit comments

Comments
 (0)
Please sign in to comment.