简述了adts,由mpeg2标准中产生,后mpeg4也采纳并修订,是Audio Data Transport Stream的英文缩写。结构其实非常简单,7个字节的header,然后是数据,然后又是7字节header,然后是数据...重点在header,数据是encoder层级的,暂时不关注。header包括两部分,先是Fixed Header,然后是Variable Header。
援引标准文档
Table 8 – Syntax of adts_fixed_header()
adts_fixed_header()
{
syncword; 12 bslbf
ID; 1 bslbf
layer; 2 uimsbf
protection_absent; 1 bslbf
profile; 2 uimsbf
sampling_frequency_index; 4 uimsbf
private_bit; 1 bslbf
channel_configuration; 3 uimsbf
original/copy; 1 bslbf
home; 1 bslbf
}
Table 9 – Syntax of adts_variable_header()
adts_variable_header()
{
copyright_identification_bit; 1 bslbf
copyright_identification_start; 1 bslbf
frame_length; 13 bslbf
adts_buffer_fullness; 11 bslbf
number_of_raw_data_blocks_in_frame; 2 uimsfb
}
可以看到,两部分各28比特位,共56比特位,7字节。
如何填充一个header结构?
先看Fixed部分
首两个字节一般都是1111 1111 1111 0001,如果音频数据包含crc校验信息,最后一位就是0。
对应关系如下:
syncword 1111 1111 1111
ID 0
layer 00
protection_absent 1
然后接下来的一个半字节,
如下:
profile 两位,见下表
sampling_frequency_index 四位,见下表
private_bit 0
channel_configuration 三位,见下表,立体声为2,即010
original_copy 0
home 0
这部分标志位需要解释一下
援引标准文档
profile
Table 31 – Profiles
0 Main profile
1 Low Complexity profile (LC)
2 Scalable Sampling Rate profile (SSR)
3 (reserved)
sampling_frequency_index
Table 35 – Sampling frequency dependent on sampling_frequency_index
sampling_frequency_index sampling frequeny [Hz]
0x0 96000
0x1 88200
0x2 64000
0x3 48000
0x4 44100
0x5 32000
0x6 24000
0x7 22050
0x8 16000
0x9 12000
0xa 11025
0xb 8000
0xc reserved
0xd reserved
0xe reserved
0xf reserved
再看Variable部分
前两位,一般都是00
copyright_identification_bit 0
copyright_identification_start 0
frame_length,等于数据包大小加上7--header的大小。
frame_length 00 0001 1000 000
adts_buffer_fullness全是1,即0x7FF
adts_buffer_fullness 1 1111 1111 11
number_of_raw_data_blocks_in_frame一般为00
number_of_raw_data_blocks_in_frame 00
本文详细介绍了ADTS(Audio Data Transport Stream)音频流格式,包括其起源和发展历程。ADTS由MPEG2标准产生,并被MPEG4采纳修订。文章深入解析了ADTS的数据结构,分为固定的7字节头部和后续的数据部分。头部又细分为固定头部和可变头部,分别阐述了各个字段的意义及其在音频流中的作用。
1146

被折叠的 条评论
为什么被折叠?



