跳转到主要内容

【工程师分享】使用prealloc-args降低MPSoC VCU解码的初始延时

作者:付汉杰,<a href="mailto:hankf@xilinx.com">hankf@xilinx.com</a&gt;,文章转载自:<a id="link_3" href="https://forums.xilinx.com/t5/%E5%B5%8C%E5%85%A5%E5%BC%8F-%E5%B7%A5%E5%8…;

刚启动MPSoC的VCU解码器时,解码器先分析码流,得到分辨率信息后再调用回调函数分配buffer。这会耗费时间,增加延迟。如果希望减少延迟,可以使用prealloc-args参数,提前指定视频分辨率信息,提前分配buffer。

prealloc-args参数的格式是&ldquo;--prealloc-args max-widthxmax-height: video-mode:chroma-mode:bitdepth:profile-idc:level&rdquo;。max-widthxmax-height指示分辨率,比如1920x1080。video-mode是,逐行用progr。chroma-mode只444、422、420等格式。bitdepth说明每个色彩像素使用多少bit。profile-idc指编码规范的<a href="https://nam02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fen.wi…; target="_blank" rel="noopener nofollow noopener noreferrer">Profile</a>,可以参考<a href="https://nam02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fen.wi…; target="_blank" rel="noopener nofollow noopener noreferrer">https://en.wikipedia.org/wiki/Advanced_Video_Coding#Profiles</a&gt;。对于H.264,常用的Baseline Profile (BP)是66,Main Profile (MP)是77,High Profile (HiP)是100。level代表解码器最大支持的分辨率。对于常用的level 5.1,使用 51。对于YUV420 8-bit图像,可以使用参数&ldquo;--prealloc-args 1920x1080:progr:420:8:100:51&rdquo;。