代码改变世界

H264分层编码SVC

2019-10-21 10:26  拂堤杨柳醉春烟  阅读(2086)  评论(0编辑  收藏  举报

参考链接文档:

https://blog.csdn.net/tanningzhong/article/details/80578981

 

https://blog.csdn.net/qq_29350001/article/details/78271900

 

分层的关键:

openh264 中 temporal layer 的输出顺序与帧率

在 openh264 的内部,存在一张表,用来记录每一层的输出顺序,可以在 encoder_data_tables.cpp 中找到内容如下:

解析如下:

iTemporalLayerNum 的值为 1 时,使用 uiGopSize = 1 的配置,即每一帧为一组,每一组的 uiTemporalId 值为 0

iTemporalLayerNum 的值为 2 时,使用 uiGopSize = 2 的配置,即每两帧为一组,每一组中对应的uiTemporalId 为 [0, 1]

iTemporalLayerNum 的值为 3 时,使用 uiGopSize = 4 的配置,即每四帧为一组,每一组中对应的uiTemporalId 为 [0, 2, 1, 2]

iTemporalLayerNum 的值为 4 时,使用 uiGopSize = 8 的配置,即每 8 帧为一组,每一组中对应的uiTemporalId 为 [0, 3, 2, 3, 1, 3, 2, 3]

根据上述描述以及输入的帧率可计算每一层的帧率是多少,例如在 30fps 下分两层输出,则 T0 帧率为 15fps;

分 3 层时,每 4 帧组则有完整 7 组,则 T0 的帧率有 7 + 1 = 8fps,T1 的帧率有 8 + 7 = 15fps,T2 则有 30fps;

分 4 层的情况可按相同的方法计算每一层的帧率。

————————————————
版权声明:本文为CSDN博主「老衲不出家」的原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/tanningzhong/article/details/80578981