本群聊天记录200608.htm
来自「本源码是基于C语言的H.264标准的JM源代码模型」· HTM 代码 · 共 1,128 行 · 第 1/5 页
HTM
1,128 行
</table>firstime <br>
(500144) 21:11:41 <br>
这个 switch 语句中包括对 一般 slice 的处理 <table border="0" width="1080" id="table1" cellspacing="0" cellpadding="0">
<tr><br>
<td><font color="#B3C9E8" size="2">
----------------------------------------------------------------------------------------------------------------------------------------------------------</font></td>
</tr>
</table>firstime <br>
(500144) 21:11:46 <br>
对 IDR 的处理 <table border="0" width="1080" id="table1" cellspacing="0" cellpadding="0">
<tr><br>
<td><font color="#B3C9E8" size="2">
----------------------------------------------------------------------------------------------------------------------------------------------------------</font></td>
</tr>
</table>firstime <br>
(500144) 21:12:05 <br>
对 DP1、DPB、DPC 的处理 <table border="0" width="1080" id="table1" cellspacing="0" cellpadding="0">
<tr><br>
<td><font color="#B3C9E8" size="2">
----------------------------------------------------------------------------------------------------------------------------------------------------------</font></td>
</tr>
</table>firstime <br>
(500144) 21:12:28 <br>
包括对 SPS、PPS 的处理<br>
等等 <table border="0" width="1080" id="table1" cellspacing="0" cellpadding="0">
<tr><br>
<td><font color="#B3C9E8" size="2">
----------------------------------------------------------------------------------------------------------------------------------------------------------</font></td>
</tr>
</table>firstime <br>
(500144) 21:12:47 <br>
解码器现在遇到的第一个 NALU 是 SPS <table border="0" width="1080" id="table1" cellspacing="0" cellpadding="0">
<tr><br>
<td><font color="#B3C9E8" size="2">
----------------------------------------------------------------------------------------------------------------------------------------------------------</font></td>
</tr>
</table>firstime <br>
(500144) 21:13:41 <br>
因此解码器经过解析之后的 nal_unit_type 的值必然为 7 <table border="0" width="1080" id="table1" cellspacing="0" cellpadding="0">
<tr><br>
<td><font color="#B3C9E8" size="2">
----------------------------------------------------------------------------------------------------------------------------------------------------------</font></td>
</tr>
</table>firstime <br>
(500144) 21:14:13 <br>
解码器就会跳转到 case NALU_TYPE_SPS<br>
并进入 ProcessSPS 函数 <table border="0" width="1080" id="table1" cellspacing="0" cellpadding="0">
<tr><br>
<td><font color="#B3C9E8" size="2">
----------------------------------------------------------------------------------------------------------------------------------------------------------</font></td>
</tr>
</table>firstime <br>
(500144) 21:14:20 <br>
我们跟进 ProcessSPS 函数 <table border="0" width="1080" id="table1" cellspacing="0" cellpadding="0">
<tr><br>
<td><font color="#B3C9E8" size="2">
----------------------------------------------------------------------------------------------------------------------------------------------------------</font></td>
</tr>
</table>firstime <br>
(500144) 21:16:25 <br>
该函数中最重要的函数是 InterpretSPS <table border="0" width="1080" id="table1" cellspacing="0" cellpadding="0">
<tr><br>
<td><font color="#B3C9E8" size="2">
----------------------------------------------------------------------------------------------------------------------------------------------------------</font></td>
</tr>
</table>firstime <br>
(500144) 21:16:29 <br>
我们跟进它 <table border="0" width="1080" id="table1" cellspacing="0" cellpadding="0">
<tr><br>
<td><font color="#B3C9E8" size="2">
----------------------------------------------------------------------------------------------------------------------------------------------------------</font></td>
</tr>
</table>firstime <br>
(500144) 21:16:53 <br>
进入这个函数之后,发现什么了? <table border="0" width="1080" id="table1" cellspacing="0" cellpadding="0">
<tr><br>
<td><font color="#B3C9E8" size="2">
----------------------------------------------------------------------------------------------------------------------------------------------------------</font></td>
</tr>
</table>firstime <br>
(500144) 21:17:09 <br>
第 77 行是什么? <table border="0" width="1080" id="table1" cellspacing="0" cellpadding="0">
<tr><br>
<td><font color="#B3C9E8" size="2">
----------------------------------------------------------------------------------------------------------------------------------------------------------</font></td>
</tr>
</table>firstime <br>
(500144) 21:17:24 <br>
第 77 行就是在从码流中解码 profile_idc <table border="0" width="1080" id="table1" cellspacing="0" cellpadding="0">
<tr><br>
<td><font color="#B3C9E8" size="2">
----------------------------------------------------------------------------------------------------------------------------------------------------------</font></td>
</tr>
</table>firstime <br>
(500144) 21:18:45 <br>
u_v 是一个函数,该函数的作用就是按 7.3.2.1 小节第二行最后一列的 u(8) 规定的编码方式解码 profile_idc <table border="0" width="1080" id="table1" cellspacing="0" cellpadding="0">
<tr><br>
<td><font color="#B3C9E8" size="2">
----------------------------------------------------------------------------------------------------------------------------------------------------------</font></td>
</tr>
</table>406088589 <br>
(406088589) 21:19:01 <br>
打扰一下,能不能说一下哪行是什么内容 <table border="0" width="1080" id="table1" cellspacing="0" cellpadding="0">
<tr><br>
<td><font color="#B3C9E8" size="2">
----------------------------------------------------------------------------------------------------------------------------------------------------------</font></td>
</tr>
</table>firstime <br>
(500144) 21:19:31 <br>
看见第 77 行的那个 8 了么?就是7.3.2.1 小节第二行最后一列的 u(8) 指定的那个 8 <table border="0" width="1080" id="table1" cellspacing="0" cellpadding="0">
<tr><br>
<td><font color="#B3C9E8" size="2">
----------------------------------------------------------------------------------------------------------------------------------------------------------</font></td>
</tr>
</table>firstime <br>
(500144) 21:20:40 <br>
再看第 79、80、81 行在干什么? <table border="0" width="1080" id="table1" cellspacing="0" cellpadding="0">
<tr><br>
<td><font color="#B3C9E8" size="2">
----------------------------------------------------------------------------------------------------------------------------------------------------------</font></td>
</tr>
</table>lingzhen <br>
(22818452) 21:20:42 <br>
请继续,请不要随意打断 <table border="0" width="1080" id="table1" cellspacing="0" cellpadding="0">
<tr><br>
<td><font color="#B3C9E8" size="2">
----------------------------------------------------------------------------------------------------------------------------------------------------------</font></td>
</tr>
</table>firstime <br>
(500144) 21:21:03 <br>
他们分别在解码 constrained_set0_flag、constrained_set1_flag、constrained_set2_flag <table border="0" width="1080" id="table1" cellspacing="0" cellpadding="0">
<tr><br>
<td><font color="#B3C9E8" size="2">
----------------------------------------------------------------------------------------------------------------------------------------------------------</font></td>
</tr>
</table>firstime <br>
(500144) 21:21:20 <br>
解码器为什么要在这里解码这三个语法元素呢? <table border="0" width="1080" id="table1" cellspacing="0" cellpadding="0">
<tr><br>
<td><font color="#B3C9E8" size="2">
----------------------------------------------------------------------------------------------------------------------------------------------------------</font></td>
</tr>
</table>firstime <br>
(500144) 21:22:10 <br>
因为标准的 7.3.2.1 小节规定了 profile_idc 之后是这三个语法元素,所以解码器必须在这里解码这三个语法元素 <table border="0" width="1080" id="table1" cellspacing="0" cellpadding="0">
<tr><br>
<td><font color="#B3C9E8" size="2">
----------------------------------------------------------------------------------------------------------------------------------------------------------</font></td>
</tr>
</table>firstime <br>
(500144) 21:22:31 <br>
那么解码器到底该以什么方式解码这三个语法元素呢? <table border="0" width="1080" id="table1" cellspacing="0" cellpadding="0">
<tr><br>
<td><font color="#B3C9E8" size="2">
----------------------------------------------------------------------------------------------------------------------------------------------------------</font></td>
</tr>
</table>firstime <br>
(500144) 21:23:00 <br>
标准的 7.3.2.1 小节第三、四、五行最后一列都规定好了 <table border="0" width="1080" id="table1" cellspacing="0" cellpadding="0">
<tr><br>
<td><font color="#B3C9E8" size="2">
----------------------------------------------------------------------------------------------------------------------------------------------------------</font></td>
</tr>
</table>firstime <br>
(500144) 21:23:12 <br>
都采用 u(1) <table border="0" width="1080" id="table1" cellspacing="0" cellpadding="0">
<tr><br>
<td><font color="#B3C9E8" size="2">
----------------------------------------------------------------------------------------------------------------------------------------------------------</font></td>
</tr>
</table>firstime <br>
(500144) 21:23:27 <br>
u(1) 在解码器代码中就是 u_1 <table border="0" width="1080" id="table1" cellspacing="0" cellpadding="0">
<tr><br>
<td><font color="#B3C9E8" size="2">
----------------------------------------------------------------------------------------------------------------------------------------------------------</font></td>
</tr>
</table>firstime <br>
(500144) 21:23:34 <br>
u(1) 在解码器代码中就是 u_1 函数 <table border="0" width="1080" id="table1" cellspacing="0" cellpadding="0">
<tr><br>
<td><font color="#B3C9E8" size="2">
----------------------------------------------------------------------------------------------------------------------------------------------------------</font></td>
</tr>
</table>firstime <br>
(500144) 21:24:05 <br>
InterpretSPS 函数接下来的一长串的代码在做什么? <table border="0" width="1080" id="table1" cellspacing="0" cellpadding="0">
<tr><br>
<td><font color="#B3C9E8" size="2">
----------------------------------------------------------------------------------------------------------------------------------------------------------</font></td>
</tr>
</table>firstime <br>
(500144) 21:24:14 <br>
你们看明白了么? <table border="0" width="1080" id="table1" cellspacing="0" cellpadding="0">
<tr><br>
<td><font color="#B3C9E8" size="2">
----------------------------------------------------------------------------------------------------------------------------------------------------------</font></td>
</tr>
</table>Aries*Kevin <br>
(18820403) 21:24:21 <br>
明白 <table border="0" width="1080" id="table1" cellspacing="0" cellpadding="0">
<tr><br>
<td><font color="#B3C9E8" size="2">
----------------------------------------------------------------------------------------------------------------------------------------------------------</font></td>
</tr>
</table>406088589 <br>
(406088589) 21:24:26 <table border="0" width="1080" id="table1" cellspacing="0" cellpadding="0">
<tr><br>
<td><font color="#B3C9E8" size="2">
----------------------------------------------------------------------------------------------------------------------------------------------------------</font></td>
</tr>
</table>
firstime <br>
(500144) 21:24:41 <br>
对,就是在按照 7.3.2.1 小节规定的顺序挨着解码每个语法元素 <table border="0" width="1080" id="table1" cellspacing="0" cellpadding="0">
<tr><br>
<td><font color="#B3C9E8" size="2">
----------------------------------------------------------------------------------------------------------------------------------------------------------</font></td>
</tr>
</table>firstime <br>
(500144) 21:25:24 <br>
具体内容请大家下来自己慢慢对照分析 <table border="0" width="1080" id="table1" cellspacing="0" cellpadding="0">
<tr><br>
<td><font color="#B3C9E8" size="2">
----------------------------------------------------------------------------------------------------------------------------------------------------------</font></td>
</tr>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?