这是本群 2006 年 8 月 29 日晚第四次研讨会的部分聊天记录,目的是帮初学者弄清楚标准和 JM 代码是如何联系在一起的。
其中提及的代码是原始的 JM86 解码器代码(下载地址:http://iphome.hhi.de/suehring/tml/),提及的标准是 200503 版的标准(下载地址:http://www.itu.int/rec/T-REC-H.264-200503-I/en)。
2006年8月29日
firstime
(500144) 20:40:54
首先我们先讲一下码流结构
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
shirley
(250610658) 20:41:00
我进不去
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 20:41:09
H.264 码流是由一个个 NALU 组成的
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 20:42:06
而 NALU 又是由 NALU 头和 RBSP 数据组成
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 20:42:33
这体现在标准文档中就是 7.3.1 小节
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 20:42:41
请大家打开 7.3.1 小节
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 20:43:39
在第 7 章的 Syntax 表中,我们可以看见很多加粗了的字体
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 20:44:04
凡是加粗了的字体都是需要编码的语法元素
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 20:44:23
7.3.1 第一个加粗的字体是 forbidden_zero_bit
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 20:44:59
最后一列是 f(1)
这说明该语法元素采用 1 比特定长编码
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 20:45:31
那么 forbidden_zero_bit 到底是什么意思呢
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 20:45:44
7.4.1 小节中做了解释
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 20:46:43
7.3.1 第二个加粗的字体是 nal_ref_idc,该行最后一列是 u(2),这说明该语法元素采用 u(2) 方式编码
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 20:47:17
那么 u(2) 是什么编码方式呢?
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 20:47:39
7.3 节上面的段落做了说明
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 20:48:08
对包括 ue、u、te等等编码方式都在那里做了说明
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 20:49:03
7.3.1 第三个加粗的字体是 nal_unit_type,该语法元素编码方式我就不说了,跟前一个语法元素 nal_ref_idc 是同样道理
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 20:49:48
所有加粗的字体到底表示什么含义在 Semantics 一部分中都有相应说明
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 20:50:10
例如 7.3.1 小节中加粗字体的说明 就是 7.4.1 小节中
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 20:51:17
7.3.2.1 小节中加粗的字体的说明就在 7.4.2.1 小节中,7.3 节与 7.4 节是完全对应的
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 20:51:49
7.3.1 小节说明了一个 NALU 的结构
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 20:52:10
也就是说对于一个 H.264 码流
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 20:52:47
对于一个 H.264 码流中的一个 NALU ,该 NALU 的第一个比特必然是表示 forbidden_zero_bit
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 20:53:01
该 NALU 的第二、三个比特必然是表示 nal_ref_idc
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 20:53:27
该 NALU 的第四~八个比特必然是表示 nal_unit_type
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 20:54:15
那么对于解码器,解码 H.264 码流必然要按顺序处理这些语法元素
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
丘比特神箭
(50953531) 20:54:24
可以打断一下吗?
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 20:54:37
你有什么事
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
丘比特神箭
(50953531) 20:55:15
可否顺便把本地解码和RTP解码一块说下,有些不明白两个码流的结构
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 20:55:41
最后来讲
有疑问请先写到纸上
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 20:56:03
我们看一下 JM 解码器是如何按顺序处理这些语法元素的
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
Pertinax
(54411308) 20:56:07
建议安排专门的时间提问.
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 20:56:16
请打开 JM86
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 20:56:22
找到 main 函数
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 20:57:24
main 函数中 decode_one_frame 以前的部分不做分析,因为这些部分都是一些初始化工作,以及读文件操作,并没有解码
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 20:57:34
我们进入 decode_one_frame 函数
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 20:57:55
再进入 read_new_slice 函数
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 20:58:17
read_new_slice 函数的主要作用是读取 NALU 单元数据
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 20:58:29
附带做一些解码的准备工作
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 20:59:10
在 read_new_slice 函数中
我们最先遇到的两个函数是 GetAnnexbNALU 和 GetRTPNALU
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 20:59:35
这两个函数由一个 if 语句控制,选择调用
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 21:00:24
这就涉及到 H.264 的两种码流格式
GetAnnexbNALU 处理字节流格式的码流
GetRTPNALU 处理 RTP 格式码流
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 21:01:20
字节流格式的码流主要用于存储,例如制作 DVD(当然现在的 DVD 还不是用 H.264)
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 21:01:41
RTP 格式码流主要用于网络传送,例如在线看电影
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 21:01:56
现在我们进入 GetAnnexbNALU 函数
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 21:02:48
在 GetAnnexbNALU 函数 中,我们可以看见一下三行语句:
nalu->forbidden_bit = (nalu->buf[0]>>7) & 1;
nalu->nal_reference_idc = (nalu->buf[0]>>5) & 3;
nalu->nal_unit_type = (nalu->buf[0]) & 0x1f;
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 21:03:12
第一行就是解码器在处理 7.3.1 小节中的第一个语法元素
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 21:03:29
第二行就是解码器在处理 7.3.1 小节中的第二个被加粗的语法元素
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 21:05:09
我们知道 H.264 码流的第一个 NALU 是 SPS
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 21:05:32
所以 7.3 部分接下来就描述了 SPS 的语法结构
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 21:06:01
那么解码器下一步工作当然是要解码 SPS
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 21:06:20
我们先看一下标准中 SPS 的结构,请看 7.3.2.1 小节
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 21:06:50
加粗的字体就是被编码的语法元素,也就是解码器必须解码的语法元素
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 21:07:19
而且解码器必须按照 7.3 部分中加粗字体的顺序来解码
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 21:07:58
对于 SPS,按照 7.3.2.1 的规定,解码器必须首先解码 profile_idc
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 21:08:44
profile_idc 后面的 u(8) 我就不说什么意思了
刚才已经解释过了,profile_idc 的含义我也不说了,在 7.4.2.1 小节中有解释
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 21:09:07
那么我们看看解码器到底是不是按照 7.3.2.1 规定来做的呢
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 21:10:05
请看 read_new_slice 函数的 case 语句
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 21:10:18
也就是第 576 行
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 21:10:59
根据 NALU 的头解析出来的 nal_unit_type
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 21:11:21
解码器会进行不同 NALU 单元的处理
大家可以浏览一下
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 21:11:41
这个 switch 语句中包括对 一般 slice 的处理
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 21:11:46
对 IDR 的处理
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 21:12:05
对 DP1、DPB、DPC 的处理
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 21:12:28
包括对 SPS、PPS 的处理
等等
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 21:12:47
解码器现在遇到的第一个 NALU 是 SPS
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 21:13:41
因此解码器经过解析之后的 nal_unit_type 的值必然为 7
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 21:14:13
解码器就会跳转到 case NALU_TYPE_SPS
并进入 ProcessSPS 函数
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 21:14:20
我们跟进 ProcessSPS 函数
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 21:16:25
该函数中最重要的函数是 InterpretSPS
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 21:16:29
我们跟进它
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 21:16:53
进入这个函数之后,发现什么了?
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 21:17:09
第 77 行是什么?
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 21:17:24
第 77 行就是在从码流中解码 profile_idc
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 21:18:45
u_v 是一个函数,该函数的作用就是按 7.3.2.1 小节第二行最后一列的 u(8) 规定的编码方式解码 profile_idc
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
406088589
(406088589) 21:19:01
打扰一下,能不能说一下哪行是什么内容
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 21:19:31
看见第 77 行的那个 8 了么?就是7.3.2.1 小节第二行最后一列的 u(8) 指定的那个 8
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 21:20:40
再看第 79、80、81 行在干什么?
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
lingzhen
(22818452) 21:20:42
请继续,请不要随意打断
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 21:21:03
他们分别在解码 constrained_set0_flag、constrained_set1_flag、constrained_set2_flag
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 21:21:20
解码器为什么要在这里解码这三个语法元素呢?
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 21:22:10
因为标准的 7.3.2.1 小节规定了 profile_idc 之后是这三个语法元素,所以解码器必须在这里解码这三个语法元素
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 21:22:31
那么解码器到底该以什么方式解码这三个语法元素呢?
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 21:23:00
标准的 7.3.2.1 小节第三、四、五行最后一列都规定好了
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 21:23:12
都采用 u(1)
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 21:23:27
u(1) 在解码器代码中就是 u_1
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 21:23:34
u(1) 在解码器代码中就是 u_1 函数
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 21:24:05
InterpretSPS 函数接下来的一长串的代码在做什么?
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 21:24:14
你们看明白了么?
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
Aries*Kevin
(18820403) 21:24:21
明白
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
406088589
(406088589) 21:24:26
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 21:24:41
对,就是在按照 7.3.2.1 小节规定的顺序挨着解码每个语法元素
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 21:25:24
具体内容请大家下来自己慢慢对照分析
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 21:25:30
SPS 我就讲到这里
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 21:25:46
H.264 码流的第二个 NALU 是什么?
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
Aries*Kevin
(18820403) 21:25:54
[自定义表情]
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
李鹏
(3776473) 21:26:00
idr
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
Maha MAN
(47946245) 21:26:06
pps
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
最初的梦想
(124779275) 21:26:23
pps
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 21:26:46
是 PPS,所以解码器下一步必然会跳转到 read_new_slice 函数中的 case NALU_TYPE_PPS
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 21:27:02
并调用 ProcessPPS 函数,我们进这个函数看一下
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 21:27:27
ProcessPPS 函数里最重要的函数仍然是 InterpretPPS
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 21:27:32
我们再进去
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 21:27:57
请从第 145 行开始看,从 145 行以后的代码在做什么?
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 21:28:50
是的,在完全按照标准 7.3.2.2 小节规定的内容解码 PPS
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 21:29:25
没什么难度,我们的 PPS 也就不分析了
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 21:30:43
H.264 码流的第三个 NALU 假设是 IDR(因为有可能是定界符,我记不清楚了,毕厚杰的书上有一个图)
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 21:31:29
那么解码器就要跳转到 read_new_slice 函数中的 case NALU_TYPE_IDR
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 21:32:05
我们直接看第 596 行
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 21:32:17
进入 FirstPartOfSliceHeader 函数
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
真天才
(15311062) 21:32:45
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 21:33:36
因为 H.264 中的图像都是按照片来组织的
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 21:34:11
因此片作为最大的语法结构而存在
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 21:34:19
不考虑片组
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 21:34:28
正如我论文中讲的
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 21:34:47
我们再回头来说一下 NALU
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
萝卜
(43696314) 21:34:55
论文?
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 21:35:29
刚才我们已经知道了 H.264 码流是一个个 NALU 拼在一起的,首尾相连
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 21:35:50
每个 NALU 由头和体组成
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 21:37:07
NALU 头就是刚才我们看的 7.3.1 小节中的三个粗体字forbidden_zero_bit(1比特)、nal_ref_idc(2比特)、nal_unit_type(5比特)
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 21:37:34
NALU 体就是 RBSP 数据
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
~枝 [路]
(14517405) 21:37:51
EBSP
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 21:38:04
恩,可能我记错了
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
yatany
(5815326) 21:38:13
是RBSP:)
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
jimmy
(20292042) 21:38:18
EBSP:在RBSP的基础上增加了防止伪起始码字节(仿校验字节)(0X03)
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 21:38:33
EBSP 数据又是由一个个片组成的
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 21:38:44
片又由片头和片数据组成
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 21:39:21
所以解码器取出整个片数据后,接下来必然要处理片头
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 21:39:48
刚才我们已经进入到了 FirstPartOfSliceHeader 函数,从这个函数的名字上,我们就已经知道它在做什么了
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 21:40:05
那么解码器在这个函数里具体该怎么做呢?
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 21:40:38
标准 7.3.3 小节已经做了规定
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 21:41:11
所以解码器必然是按照标准 7.3.3 小节规定的顺序来做的
请大家看对照一下 7.3.3 小节和 FirstPartOfSliceHeader 函数
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 21:42:19
标准 7.3.3 小节规定的其他内容当然是在 RestOfSliceHeader 函数里完成了
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 21:43:14
虽然标准 7.3.3 小节规定的内容被分到了两个函数中进行处理
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 21:43:40
但是解码器必然不可能打乱标准 7.3.3 小节规定的顺序
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 21:44:22
所以虽然在解码器代码中的 FirstPartOfSliceHeader 函数与 RestOfSliceHeader 函数之间插入了一个 UseParameterSet 函数
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 21:44:35
但是 UseParameterSet 函数绝对不可能读码流
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 21:45:28
因为 FirstPartOfSliceHeader 函数处理的最后一个语法元素是 pic_parameter_set_id ,RestOfSliceHeader 函数处理的第一个语法元素是 frame_num
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 21:46:22
而标准 7.3.3 小节规定语法元素 pic_parameter_set_id 之后紧接着是语法元素frame_num ,所以如果 UseParameterSet 函数读了码流就必然导致比特错误
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 21:47:10
UseParameterSet 函数做了什么呢?我们进去之后可以看见它主要是激活 SPS 和 PPS
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 21:48:03
因为后面语法元素的解码会使用到 SPS、PPS 里的参数,所以在解码后续语法元素之前必须先找到正确的 SPS、PPS
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 21:50:08
请看标准 7.3.3 中的 ref_pic_list_reordering( )
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 21:50:46
7.3.3 规定了解码完片头的语法元素,要进行 ref_pic_list_reordering 操作,那么我们的解码器是不是这样做的呢?
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 21:51:35
进入 RestOfSliceHeader 函数之后,我们可以发现有 ref_pic_list_reordering 函数,所以可以证明我们的解码器的确是按照标准规定来做的
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 21:52:19
RestOfSliceHeader 函数后面的代码所做的工作也都是按照标准的 7.3.3 节做的
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 21:53:30
我们可以进入 ref_pic_list_reordering 函数看一下,代码是否是按照标准的 7.3.3.1 小节规定在做
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 21:54:18
到这里大家应该已经将标准第 7 章与代码联系起来了吧?
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
Maha MAN
(47946245) 21:54:43
联系起来了
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
Aries*Kevin
(18820403) 21:54:51
明白
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
Maha MAN
(47946245) 21:54:58
联系很紧
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 21:55:00
看标准的人一般都觉得第 7 章不知道有什么用
现在大家应该知道第 7 章是很有用了的吧
第 7 章正是解码器伪代码
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
Maha MAN
(47946245) 21:55:30
存在必合理
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
萝卜
(43696314) 21:55:33
不错
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
406088589
(406088589) 21:56:02
ref_pic_list_reordering和RestOfSliceHeader()
只是挨着呀
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
拈花一笑
(35041962) 21:56:15
一个NALU对应一个片?
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 21:56:17
其实说到这里我就已经可以不说了
因为大家学会了将标准与代码对应的方法,后面都只是一个查找的过程
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
Maha MAN
(47946245) 21:56:32
对的
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
yatany
(5815326) 21:57:01
同问: 一个NALU对应一个片?
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
浓子猪
(12210414) 21:57:14
谢谢
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 21:57:18
请等一会儿再问
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
小颖
(30711254) 21:57:18
十分感谢
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 21:57:25
我还要讲
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
Maha MAN
(47946245) 21:57:36
你注释的jm8.6在ftp中吗?
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 21:57:36
那么下面我就不用再一步步挨着讲了,跳跃一下
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
Maha MAN
(47946245) 21:57:39
ok!
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
robby
(307287092) 21:57:40
yatany(5815326) 21:57:01
同问: 一个NALU对应一个片?
不对
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 21:57:53
这个问题我等一下回答
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 21:58:04
回到 decode_one_frame 函数
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 21:58:17
我们刚才分析的是 read_new_slice 函数
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 21:58:30
我们接下来看一下 decode_slice 函数
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 21:58:44
进入该函数
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 21:59:07
该函数中最重要的是 decode_one_slice 函数,再进入
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 21:59:32
这才真正开始解码
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 22:00:03
相信大家已经看见 decode_one_slice 函数中我的一些注释
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 22:00:27
我们直接看 read_one_macroblock 函数
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 22:02:31
这个函数与 7.3.4 有一定对应关系
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 22:03:42
我们看看 7.3.4 中粗体字 mb_skip_run
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 22:04:36
我们可以看见该语法元素存在的条件是
if( !entropy_coding_mode_flag )
也就是采用 CAVLC 编码时候
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 22:05:07
我这里只以 CAVLC 为例进行讲解
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 22:05:54
我们再看代码 read_one_macroblock 函数第 690 行
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 22:06:10
第 689 行正是在从码流中读取该语法元素
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 22:06:42
而第 689 行执行的条件是由 684 行的 else 决定
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 22:06:49
这个 else 是什么呢?
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 22:07:02
我们找到这个 else 配对的 if
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 22:07:14
正是第 622 行
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 22:07:31
else if (active_pps->entropy_coding_mode_flag == CABAC)
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 22:08:18
所以我们就知道了当解码非 I 片而且采用 CAVLC 编码时候就会执行到第 689 行
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 22:08:33
这里我解释一下 mb_skip_run 是什么意思
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 22:09:02
mb_skip_run 表示从当前宏块开始连续出现的 skip 宏块的数量
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 22:09:39
解码器在这里解码出 mb_skip_run 后,就会根据 mb_skip_run 的值进行相应处理
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 22:10:20
mb_skip_run 在代码中是变量 img->cod_counter
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 22:10:45
img->cod_counter 大于 0 就直接调用处理 skip 宏块的代码
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 22:11:27
我们再来看看后面的几个 interpret 函数
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 22:12:13
解码器出于程序的考虑将解码得到的宏块类型要进行一个转换,就是在这些 interpret 函数里实现的
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 22:13:29
再给大家讲一个代码与标准对应非常紧密的地方
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 22:13:42
请看函数 readMotionInfoFromNAL
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 22:14:48
该函数从第 1732 行以后分别进行了参考帧、MV的读取
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 22:15:26
这正是进行了 7.3.5.1 所规定的内容
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 22:16:08
我今天晚上主要是教大家一个将代码和标准对应的方法
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 22:16:28
我想到此为止,目的应该达到了
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
李鹏
(3776473) 22:17:18
一个sps后,有若干个pps么
还是只有一个
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
lingzhen
(22818452) 22:17:21
感谢
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
kitty
(13682786) 22:17:21
蓝风车什么时候讲编码啊?
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
萝卜
(43696314) 22:17:30
我又一个问题 就是标准的c那一栏什么意思
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
fuyangts
(472153116) 22:17:49
我来问个问题吧
每一个语法元素的descriptor
f(1) u(2) b(8)
有什么区别?
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 22:17:53
李鹏:这主要由编码器决定
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 22:17:58
JM 代码只有一个
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
最初的梦想
(124779275) 22:18:06
以前讲的内容在哪儿可以查到
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
robby
(307287092) 22:18:16
请问编码部分和标准联系怎么样?
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
李鹏
(3776473) 22:18:19
噢,谢谢骄子
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
406088589
(406088589) 22:18:24
加注释的代码在哪下?
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 22:18:42
c那一栏什么意思
——请看标准 7.2
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
最初的梦想
(124779275) 22:18:43
ftp好像有
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
子蓝心晋
(122055706) 22:18:45
希望能够讲讲编码部分
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
yatany
(5815326) 22:18:50
请问 : 一个NALU对应一个片?
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 22:18:50
分类(在表中以C标记)表明了片数据被划分为三类片数据分割的情况。片数据A类分割包含所有的2类语法元素。片数据B类分割包含所有的3类语法元素。片数据C类分割包含所有的4类语法元素。其他类语法元素取值的含义未做规定。对于某些语法元素,使用一个垂直竖线表示其包含两类语法元素。在这种情况下,该语法元素将使用的分类值将在文本中进一步确定。
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
lingzhen
(22818452) 22:19:06
您用的标准2005.3和2003.5版本上主要差别在哪里?
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
robby
(307287092) 22:19:09
不知道什么时候有编码部分的讲座噢
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
迷惑
(93757815) 22:19:18
期待中
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
~枝 [路]
(14517405) 22:19:20
5815326(yatany) 22:18:50
请问 : 一个NALU对应一个片?
NO。
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 22:19:20
f(1) u(2) b(8)在 7.3 小节上面有总结
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 22:19:34
一个NALU对应一个片说法不太准确
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
fuyangts
(472153116) 22:19:51
我的意思是说f(1)和u(1)执行的内容是一样的
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
$pArt@n
(15287943) 22:20:01
“今天我第一次看得的这个文件是SEI开头的。 我想问SEI有什么作用,对编解码有什么干涉吗?”
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
我同学问的问题,希望解答一下
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
fuyangts
(472153116) 22:20:05
为什么要设两个descriptor
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 22:20:09
f(1)和u(1)执行的内容当然不一样
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
~枝 [路]
(14517405) 22:20:14
修正补充饺子说的NALU结构这块。
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 22:20:18
f(1)是1比特定长编码
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
fuyangts
(472153116) 22:20:27
u(1)呢
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
~枝 [路]
(14517405) 22:20:35
NALU = NALU header + EBSP
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
sophie
(40069726) 22:20:55
请问一下:decode_one_frame()函数注释的是解码I和P帧,那么解码B帧在哪里做的呢?
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
~枝 [路]
(14517405) 22:20:57
EBSP = 变换过的RBSP
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
406088589
(406088589) 22:20:59
case NALU_TYPE_SLICE:
case NALU_TYPE_IDR:
case NALU_TYPE_DPA
case NALU_TYPE_DPB:
case NALU_TYPE_DPC
case NALU_TYPE_SEI:
case NALU_TYPE_PPS
case NALU_TYPE_SPS
case NALU_TYPE_AUD:
case NALU_TYPE_EOSEQ:
case NALU_TYPE_EOSTREAM:
case NALU_TYPE_FILL
什么时候进入哪个,有什么说明的文章或书么?
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 22:21:10
decode_one_frame()包括 I、P、B
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
~枝 [路]
(14517405) 22:21:24
RBSP = 码流片段。
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
大强
(56518490) 22:21:35
EBSP在标准的哪部分?
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 22:21:46
406088589:我已经说过了,进入哪个 case 是由从 NALU 头里解码出来的 nalu_type 决定的
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
sophie
(40069726) 22:21:56
哦,知道了
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
406088589
(406088589) 22:22:24
那为什么就先进sps
pps
idr
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 22:22:39
SEI 是辅助增强信息,我的理解是类似于分层编码的机制
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 22:22:59
那为什么就先进sps:因为 H.264 码流就是这样组织在一起的
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
lingzhen
(22818452) 22:23:10
您用的标准2005.3和2003.5版本上主要差别在哪里? 好像前者是正式标准
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
问心
(4360097) 22:23:13
SEI里有一些编码器logo的信息
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
萝卜
(43696314) 22:23:28
SEI里有一些编码器logo的信息 ?
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 22:23:34
2003.5可能没有 high profile 的内容
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
问心
(4360097) 22:23:36
我们做的时候直接去掉了SEI
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
萝卜
(43696314) 22:23:39
怎么讲? logo是什么
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
Maha MAN
(47946245) 22:23:41
你的注释代码在ftp里吗?
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 22:23:45
一般用不上 SEI
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 22:23:55
注释代码在ftp
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
Leon
(138888986) 22:24:03
现在使用main profile的多吗?
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
~枝 [路]
(14517405) 22:24:08
大家都不看BBS的吗?讲的时候现下也来得及啊。
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
萝卜
(43696314) 22:24:12
骄子 解码你都看完了吧?
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
最初的梦想
(124779275) 22:24:20
以前的研讨会的聊天记录呢
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 22:24:29
只能说我看了一半
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
问心
(4360097) 22:24:35
就是用一些编码器编的码,它要留一些它的信息
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
Maha MAN
(47946245) 22:24:43
是这个吗?
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
Maha MAN
(47946245) 22:24:45
[自定义表情]
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 22:24:52
是
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
Maha MAN
(47946245) 22:25:01
谢谢
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
lingzhen
(22818452) 22:25:04
骄子,解码器中的误码隐藏部分用了吗?效果怎么样?
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 22:25:16
NALU 包括一个片、SPS、PPS、SEI等等
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 22:25:41
解码器中的误码隐藏只对丢包有用
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
fuyangts
(472153116) 22:26:37
字节流格式和RTP格式码流,具体的不同点有哪些?相关的资料哪里有?
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
lingzhen
(22818452) 22:26:55
嗯,你现在研究的解码器是独立于信号误码的?或者是本地解码?
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 22:27:20
字节流格式主要用于文件存储,因此在该格式码流中 NALU 前面只有一个开始前缀
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
问心
(4360097) 22:27:23
firstime(500144) 22:25:41
解码器中的误码隐藏只对丢包有用 ???
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
lingzhen
(22818452) 22:27:25
字节流一般是用于存储
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
lingzhen
(22818452) 22:27:30
呵呵
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 22:27:48
RTP格式码流因为需要进行网络传输,因此 NALU 前面还有很多辅助信息
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
~枝 [路]
(14517405) 22:27:51
4360097(Christy) 22:27:23
firstime(500144) 22:25:41
解码器中的误码隐藏只对丢包有用 ???
是的。
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
fuyangts
(472153116) 22:27:57
谢谢
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 22:28:59
[自定义表情]
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 22:29:00
这个就是 RTP 包的格式
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
fuyangts
(472153116) 22:29:21
哦,这样啊
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
问心
(4360097) 22:29:23
他怎么知道丢包?我看那个ei_flag的置位没看明白
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
军
(362876845) 22:29:31
能把JM86上传的共享里面吗
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
fuyangts
(472153116) 22:29:38
有点想MPEG2中的传送流和程序流
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 22:29:43
丢包之后,包的序号不连续
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
Maha MAN
(47946245) 22:30:22
看不到图 什么样子的!
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 22:30:23
解码器一旦检测到包序号不连续就会将不连续地方的 ei_flag 置 1
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
问心
(4360097) 22:30:41
哦,谢谢
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
萝卜
(43696314) 22:30:47
rtp格式就是在字节流前加包头吗?
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 22:31:01
不是
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 22:31:14
字节流 = 开始前缀 + NALU
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
萝卜
(43696314) 22:31:20
和网络打包不一样吗?
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 22:31:27
而 RTP 中没有 开始前缀
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
问心
(4360097) 22:33:02
RTP中没有开始前缀,为什么还是要插03?
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
萝卜
(43696314) 22:33:30
防止伪起始码
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
问心
(4360097) 22:33:59
可是RTP完全可以不用起始码啊
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
~枝 [路]
(14517405) 22:34:04
层不一样。
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 22:34:06
或许是为了与字节流格式统一吧
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
Pertinax
(54411308) 22:34:15
为什么要分ABC片?
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 22:34:27
为什么要分ABC片?
——请看我的论文
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
~枝 [路]
(14517405) 22:34:31
03是NALU层的。
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
~枝 [路]
(14517405) 22:34:43
NALU是对RBSP的封装。
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
萝卜
(43696314) 22:34:46
骄子你的论文那里?
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
Pertinax
(54411308) 22:35:01
至少给个论文名字啊
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
~枝 [路]
(14517405) 22:35:03
而RTP之类的是对NALU的封装。
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 22:35:10
分ABC片主要目的是为了对重要程度不同的数据进行不同程度的保护
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
~枝 [路]
(14517405) 22:35:12
数据封装。
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
萝卜
(43696314) 22:35:31
baseline 没有数据分割吧
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 22:35:41
也在“本群原创资料”中
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
Maha MAN
(47946245) 22:36:08
这个吗?
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 22:36:14
是
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
~枝 [路]
(14517405) 22:36:24
baseline只是如何产生RBSP,如何封装NALU。具体如何传输,RTP之类只是一种方式。文件copy也是一种方式。
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
Pertinax
(54411308) 22:37:00
找到了,拜读哈。
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
Pertinax
(54411308) 22:37:25
再问一个:
一般baseline最多有多少参考帧
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 22:37:57
任意
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
~枝 [路]
(14517405) 22:38:09
16吧。
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
Pertinax
(54411308) 22:38:17
你的意思只有不超过 最大 dbp限制就可以〉?
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
406088589
(406088589) 22:38:27
那如果要通过rtp传输的话,是不是,只要在解头的时候,按照那个格式,把rtp的几种加上就行,里面不用改?
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
萝卜
(43696314) 22:38:30
骄子 那时你的毕业论文?
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 22:38:31
baseline 没有限制个数
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
fuyangts
(472153116) 22:38:41
解码profile_idc之后解码器要做什么工作?比如baseline不支持CABAC那么后面相应的位entropy_coding_mode_flag是不是就不存在了,如果存在,相抵触怎么办?
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
问心
(4360097) 22:39:08
不存在的值都有默认值的
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 22:39:11
当然不会执行 CABAC 的代码
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 22:40:22
编码器如果是编码 baseline ,那么码流中自然就不存在与 CABAC 相关的语法元素,例如 entropy_coding_mode_flag
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
Pertinax
(54411308) 22:41:03
我算了一下,参考帧level==1 是4 帧的样子,1.2
到2.1是6帧的样子。。。。都是按420算的。 但是1.1的却是个小数。
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 22:41:16
解码器解码 SPS ,得知码流是 baseline 后,自然也就不会去调用与 CABAC 相关的解码程序,也就不会出错了
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
Pertinax
(54411308) 22:41:59
如果参考帧任意的话。 怎么估计 解码所需 dbp内存最大值?
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
~枝 [路]
(14517405) 22:42:17
gop
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
Pertinax
(54411308) 22:42:35
什么玩意?
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
fuyangts
(472153116) 22:42:35
但是我在读程序的时候没有发现检查profile_idc值的代码
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
~枝 [路]
(14517405) 22:43:07
log2_max_frame_num_minus4
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 22:43:24
profile_idc 为 baseline ,active_pps->entropy_coding_mode_flag 就不会为 CABAC
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
~枝 [路]
(14517405) 22:43:50
log2_max_frame_num_minus4 => max gop length
可以估算最多有多少参考帧。
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
Pertinax
(54411308) 22:43:58
但是log2...要在具体文件中才有阿。 在实现解码器的时候,不可能有文件阿
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 22:44:15
log2_max_frame_num_minus4 是码流中的语法元素
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
~枝 [路]
(14517405) 22:44:32
另外的限制就是解码器的物理限制了。
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 22:44:40
请看 7.3.2.1
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
Pertinax
(54411308) 22:44:50
就是啊,你必须解码slice header 后才能得到帧数。
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
~枝 [路]
(14517405) 22:44:58
恩哼
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
~枝 [路]
(14517405) 22:45:23
SO?
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
Pertinax
(54411308) 22:45:38
我的意思是,移植代码到片上时, 预留多大的内存,我才能号称我支持baseline
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 22:45:53
参考整数是编码配置文件决定的
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
Pertinax
(54411308) 22:46:03
而那会是没有解码数据的。
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 22:46:16
请看编码配置文件的参数 NumberReferenceFrames
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 22:47:06
码流是否是 baseline 并不是由多少个参考帧决定的
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
Pertinax
(54411308) 22:47:29
明白了。 没有帧数限制,只要最大dpb限制。
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
问心
(4360097) 22:47:42
16帧的参考帧队列你怎么都是要维护的
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 22:48:06
有没有谁对 CAVLC 比较熟悉的?
我有个 CAVLC 的问题
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
~枝 [路]
(14517405) 22:48:07
不一定。。
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
fuyangts
(472153116) 22:48:10
维护这些参考帧需要什么操作
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
~枝 [路]
(14517405) 22:48:15
饺子有问题??
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
fuyangts
(472153116) 22:48:27
我熟悉cavlc
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
~枝 [路]
(14517405) 22:48:40
内存维护,,还能要什么操作诶。。
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
fuyangts
(472153116) 22:48:43
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
Pertinax
(54411308) 22:48:56
维护这些参考帧需要什么操作
marking 吧。
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
问心
(4360097) 22:48:56
fuyangts(472153116) 22:48:10
维护这些参考帧需要什么操作
reorder
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 22:49:01
JM 进行 CAVLC 编码时候,对于 level = 8 的情况是采用 escape suffix 处理的
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
fuyangts
(472153116) 22:49:28
escape suffix这什么意思
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
Maha MAN
(47946245) 22:49:32
what's mean?
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
fuyangts
(472153116) 22:49:41
level是8 不算很大
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 22:49:42
我修改代码将 level = 8 的情况采用无符号数表示,结果编码出来的码流与未修改完全一样
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 22:49:45
我不知道为什么
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 22:50:15
你连 escape suffix 都不知道还说懂 CAVLC 啊?
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
Pertinax
(54411308) 22:50:20
这里有看ffmpeg 的264decoder的么?
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
Aries*Kevin
(18820403) 22:50:35
我有个同学看
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
Maha MAN
(47946245) 22:50:37
我看了一部分
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
fuyangts
(472153116) 22:50:37
你的level是第一个非拖尾系数?
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
Aries*Kevin
(18820403) 22:50:53
不过说ffmpeg的那个写的太乱
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 22:50:55
我说的 level 是非零系数幅值
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
Pertinax
(54411308) 22:50:55
空了讨论啊。
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
fuyangts
(472153116) 22:50:59
level的编码很固定
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
Maha MAN
(47946245) 22:51:03
乱的很
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
Pertinax
(54411308) 22:51:14
就是啊。 特别是全局变量,一个包一个
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
Pertinax
(54411308) 22:51:23
互相包。
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
~枝 [路]
(14517405) 22:53:12
ffmpeg的挺好啊,怎么说乱?
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
Pertinax
(54411308) 22:53:30
全局变量好混乱哦。
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
GraneGuang
(120617050) 22:53:30
请问大家:现在h264做到怎样的水平了?
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
~枝 [路]
(14517405) 22:53:31
level 8 的哪个没找到。哪个函数里?
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
Maha MAN
(47946245) 22:53:43
大部分代码都在一个h.264文件里
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
Pertinax
(54411308) 22:53:44
n 多 context..
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
~枝 [路]
(14517405) 22:53:45
全局变量??
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
问心
(4360097) 22:53:47
ffmpeg看一部分还是能看懂的,但是要移植就比较麻烦
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
GraneGuang
(120617050) 22:53:52
能不能介绍一下
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
~枝 [路]
(14517405) 22:53:52
ffmpeg有全局变量?
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
Aries*Kevin
(18820403) 22:54:08
有在blackfin上移植t264的么?
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
Maha MAN
(47946245) 22:54:13
回去睡了 886 各位
多谢骄子了
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
GraneGuang
(120617050) 22:54:14
有谁介绍一下呢
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
Pertinax
(54411308) 22:54:15
是,代码还是比较好读。就是全局的东西太繁了。
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
GraneGuang
(120617050) 22:54:32
你要在blackfin 上移植t264?
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
~枝 [路]
(14517405) 22:54:48
ffmpeg没有全局变量,只有全局的codec连表。
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
~枝 [路]
(14517405) 22:55:11
其他东西都是封装在各种context结构里的。
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
Pertinax
(54411308) 22:55:20
就是那些context
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
Pertinax
(54411308) 22:55:37
我自己写了个main函数。 把264的提出来了单独。
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 22:55:40
H.264代码工人:
你看看编码器 writeSyntaxElement_Level_VLC1 函数
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
~枝 [路]
(14517405) 22:55:58
主要就两个context,一个还是关于图象的。
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
Pertinax
(54411308) 22:56:11
等一下
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
fuyangts
(472153116) 22:56:20
晕了,代码过长,发不上来
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 22:56:20
对于 level = 8 的情况是放到 else if 里处理的
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 22:56:57
我将 if (levabs < 8) 改为 if (levabs <= 8) 编码出来结果完全相同
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
fuyangts
(472153116) 22:57:04
for(i=0; i<TotalCoeff; i++)
{
if(i<TrailingOnes)
write_trailing_one(bits,level[i]);
else {
int level_code = ((Abs(level[i])-1) <<1) + is_nagetive(level[i]);
if(TrailingOnes<3 && i==TrailingOnes)
level_code -= 2;
int level_prefix=0,level_suffix=0;
if (suffixLength == 0)
{
if (level_code < 14)
{
level_prefix = level_code;
write_level_prefix(bits, level_prefix);
// level_suffix = 0;
}
else if(level_code < 30)
{
level_prefix = 14;
level_suffix = level_code - level_prefix;
write_level_prefix(bits, level_prefix);
write_level_suffix(bits, level_suffix, 4);
}
else //
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
fuyangts
(472153116) 22:57:05
level_code >= 30
{
level_prefix = 15;
level_suffix = level_code - level_prefix - 15;
write_level_prefix(bits, level_prefix);
write_level_suffix(bits, level_suffix, 12);
}
}
else
{
level_prefix = level_code>>suffixLength;
if (level_prefix < 15)
{
level_suffix = level_code & (~(0xffffffff<<suffixLength));
write_level_prefix(bits, level_prefix);
write_level_suffix(bits, level_suffix, suffixLength);
}
else //level_prefix>=15
{
level_prefix = 15;
level_suffix = level_code - (level_prefix<<suffixLength);
write_level_prefix(bits, level_prefix);
write_level_suffix(bits, lev
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
fuyangts
(472153116) 22:57:05
el_suffix, 12);
}
}
/************************************************************************/
if(suffixLength ==0 ) suffixLength++;
if(Abs(level[i]) > (3<<(suffixLength-1)) && suffixLength<6 )
suffixLength++;
}
}
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
fuyangts
(472153116) 22:57:54
cavlc编码的,截取了level那一段
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 22:58:26
fuyangts:
你看过 JM 的 CAVLC 编码代码不?
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
~枝 [路]
(14517405) 22:58:28
==,JM的不好懂,等我找x264的。
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
fuyangts
(472153116) 22:58:45
我看标准写的
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
Pertinax
(54411308) 22:58:45
AVCodecContext H264Context 还有MpegContext , 什么什么的。。。。。你搞懂他们之间的层次关系了么?
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 22:58:51
不知道 x264 跟 JM 一样不
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
fuyangts
(472153116) 22:58:52
解码看过JM
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
fuyangts
(472153116) 22:59:10
编码没看过
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 22:59:33
哦
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
Pertinax
(54411308) 22:59:48
牛人呢?
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
GraneGuang
(120617050) 23:00:48
现在研究h264的人和公司很多,就不知道到了什么水平,请各位告知,谢谢
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
Pertinax
(54411308) 23:01:24
这个水平怎么衡量嘛?
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
Pertinax
(54411308) 23:01:39
又不能编码。。。
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
~枝 [路]
(14517405) 23:01:44
AVCodecContext H264Context 还有MpegContext
就前俩有用,后面的就里面的s有用,好象是这个名。
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
sophie
(40069726) 23:02:11
骄子: 改成你那样应该会变啊,是说这吧?
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
sophie
(40069726) 23:02:14
if (levabs < 8)
{
se->len = levabs * 2 + sign - 1;//len=prefix +1
se->inf = 1; //code value =1
}
else if (levabs < 8+8)
{
// escape code1
se->len = 14 + 1 + 4;
se->inf = (1 << 4) | ((levabs - 8) << 1) | sign;
}
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 23:02:24
是的
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
sophie
(40069726) 23:02:47
我先回去了,明天仔细研究一下
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 23:02:50
我把 if (levabs < 8) 改成 if (levabs <= 8) ,编码出来的码流完全相同
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
问心
(4360097) 23:03:07
你设个断点在那里看看啊
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
sophie
(40069726) 23:03:16
怎么会这样呢,自己算一下都不是一样的
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
GraneGuang
(120617050) 23:03:25
我很想了解清楚这一领域的现状,但是因为自己以前都没有干过这一行,刚刚介入,所以请教大家
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
fuyangts
(472153116) 23:03:34
哦,哈哈,我知道你说的8是什么意思了
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 23:03:35
但按照 CAVLC 编码原理,if (levabs <= 8) 比 if (levabs < 8) 编码的码字短 4 个比特
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 23:03:47
是啊
就是奇怪啊
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
sophie
(40069726) 23:03:58
那你else if里头改没?
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 23:04:14
else if 不用改
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
fuyangts
(472153116) 23:04:49
我的代码中 int level_code = ((Abs(level[i])-1) <<1) + is_nagetive(level[i]);
当 level是8的时候算出来是 level_code = 14;
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
fuyangts
(472153116) 23:05:07
14是编码的一个分界线
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
exchange
(345411704) 23:05:32
谁有量化步长的那个表的?发一个看看啊,谢谢
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
~枝 [路]
(14517405) 23:05:47
标准里那个level表格叫啥记得不?
我记得跑的结果确实是一样的。但忘记为啥了。
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
fuyangts
(472153116) 23:05:53
当level_code小于14的时候,能够正常的编码
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
fuyangts
(472153116) 23:06:05
也就是level = 8
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
fuyangts
(472153116) 23:06:56
当level>=8的时候编码出来的数前缀会>15,所以要用另一种方式编码
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
fuyangts
(472153116) 23:08:08
也就是令前缀是14,后缀长度用4位
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
GraneGuang
(120617050) 23:08:42
睡了,88
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
Pertinax
(54411308) 23:08:47
弱弱的问句 memory bandwidth 啥意思?
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
Pertinax
(54411308) 23:09:18
应该是 memory-bandwidth....
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 23:11:39
大家有空试一下这个网址
http://www.anychat.cn
如果效果好我们以后可以用这个开研讨会
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
fuyangts
(472153116) 23:16:34
唉,搞不懂参考帧是怎么组织的
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
~枝 [路]
(14517405) 23:16:42
饺子,x264的代码没有8这个分界。我还没搞明白jm里的分界为啥和vlc_num没关系。
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
~枝 [路]
(14517405) 23:17:36
x264的代码基本和7.3.5.3.1一致。jm的变化还没搞懂。
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 23:18:35
哦
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
~枝 [路]
(14517405) 23:24:47
标准9.2.2里也没有8这个分界。。。
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
fuyangts
(472153116) 23:25:24
你们实际编一下就知道怎么回事了
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
~枝 [路]
(14517405) 23:25:46
编起来应该一样。。
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 23:25:59
JVT-C028 里面有
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
~枝 [路]
(14517405) 23:26:22
0~15就是前导0的个数。
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
fuyangts
(472153116) 23:26:31
关键是前缀最多是15,太大的数编出来前缀超过15,所以才有前缀是14的时候后缀读4位,前缀是15的时候后缀读12位
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
fuyangts
(472153116) 23:26:50
8刚好在分界线上
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
~枝 [路]
(14517405) 23:27:31
知道了。。。
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
~枝 [路]
(14517405) 23:27:45
关键就是8的求法。。
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
fuyangts
(472153116) 23:28:34
我编程的时候弄了好几天,最后把它绕过去了
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
fuyangts
(472153116) 23:28:53
反正结果一样就成
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
~枝 [路]
(14517405) 23:29:50
标准和x264里,都是把有符号的level转成无符号的ilevelcode。这样,8变成了14,-8变成了15。于是。。。。就这样了。
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
fuyangts
(472153116) 23:30:07
是
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
~枝 [路]
(14517405) 23:30:10
jm里是直接求绝对值。
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
fuyangts
(472153116) 23:30:58
14 29是区分前缀<=13 =14 =15的分界线
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 23:32:12
我就是不知道 8 采用两种不同方法为什么结果一样
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 23:32:31
按照 CAVLC 编码原理
两种方法相差 4 比特
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
fuyangts
(472153116) 23:33:04
你编完的码流 能够解码么
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 23:33:10
当然能
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
fuyangts
(472153116) 23:33:11
用JM的解码器
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
虎虎
(173935527) 23:36:31
大家好,我终于又回来了
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
虎虎
(173935527) 23:36:36
谢谢管理员了
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 23:36:47
要积极发言
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
虎虎
(173935527) 23:36:57
我们公司不让上QQ,所以白天上不了
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
虎虎
(173935527) 23:37:22
但是晚上回来太累了,所以就没有上,也就周六和周日上
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 23:38:01
哦
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
胖胖阿金&zgj
(33659657) 23:38:55
anychat 要注册的啊?
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 23:39:11
可以注册
也可以游客
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
~枝 [路]
(14517405) 23:39:25
我忽然觉得是你编码没遇到这个情况了。饺子。
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 23:39:38
什么意思?
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 23:39:46
编码没遇到这个情况
——什么意思
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
~枝 [路]
(14517405) 23:39:51
就是没有碰到刚好=8的情况。
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 23:40:08
不是
我跟踪了的
有 8
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
~枝 [路]
(14517405) 23:40:35
那码流一样?
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
fuyangts
(472153116) 23:40:42
骄子,你那个8后面有几个拖尾系数?
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
~枝 [路]
(14517405) 23:40:49
就算一样,解的一样?
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 23:41:02
编码出来的码流完全一样
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 23:41:10
所以解码出来当然也完全一样
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
~枝 [路]
(14517405) 23:41:24
码流不该一样的来。。
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 23:41:46
对 8 采用哪种方式编码跟几个拖尾系数没关系
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 23:41:54
是不该一样
但结果的确一样
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
fuyangts
(472153116) 23:41:58
有关系
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 23:41:59
你可以马上试验一下看
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
fuyangts
(472153116) 23:42:07
是有关系的
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 23:42:59
没关系啊
非零系数幅值跟拖尾系数编码过程没有任何相关性吧
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
fuyangts
(472153116) 23:43:48
如果后面有3个拖尾系数,8应该编前缀14,后缀0
如果后面<3个拖尾系数,8应该编前缀12,没有后缀
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
fuyangts
(472153116) 23:44:01
你看一下结果是不是这样
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
fuyangts
(472153116) 23:44:49
还有一个前提,8应该是第一个非拖尾的系数
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
fuyangts
(472153116) 23:45:39
fuyangts(472153116) 23:43:52
如果后面有3个拖尾系数,8应该编前缀14,后缀0—— 这里后缀4位,都是0
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 23:47:48
恩
我再想一下
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
~枝 [路]
(14517405) 23:48:58
symbol2vlc(se);
完了直接看se->len和->bitpattern和。
不该一样的。。
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
~枝 [路]
(14517405) 23:49:12
fuyangts,不该是这事。
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
fuyangts
(472153116) 23:49:20
为什么
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
~枝 [路]
(14517405) 23:50:12
if (vlcnum == 0)
writeSyntaxElement_Level_VLC1(currSE, dataPart);
else
writeSyntaxElement_Level_VLCN(currSE, vlcnum, dataPart);
那段代码是上面的调用里的
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
firstime
(500144) 23:50:35
天晚了
我明天还要上班
以后跟你们讨论
再见
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
fuyangts
(472153116) 23:50:43
bye
---------------------------------------------------------------------------------------------------------------------------------------------------------- |
~枝 [路]
(14517405) 23:50:57
肯定是14或15。