AC3 Header

This is just a quick reference to the frame header of an AC3 stream. There is no intention to fully explain AC3, for that you should read standard A/52a, available from ATSC.org (Advanced Television Systems Committee).

An AC3 frame has the following structure:
syncframe()
{
      syncinfo();
      bsi()
;
      for(blk=0, blk<6, blk++)
      {
            audblk();
      }
      auxdata();
      errorcheck()
;
} // end of syncframe

Syncinfo

byte 0byte 1byte 2byte 3byte 4
7654321076543210765432107654321076543210
Syncword - 0B77 CRC1 fscod frmsizcod

CRC1 applies to the first 5/8 of the frame

fscod sampling rate values

valuesampling rate
0048K
0144.1K
1032K
11reserved

frmsizcod frame size code
valuenominal bit rate16-bit words per syncframe
Fs=32KFs=44.1KFs=48K
00000032Kbps966964
00000132Kbps967064
00001040Kbps1208780
00001140Kbps1208880
00010048Kbps14410496
00010148Kbps14410596
00011056Kbps168121112
00011156Kbps168122112
00100064Kbps192139128
00100164Kbps192140128
00101080Kbps240174160
00101180Kbps240175160
00110096Kbps288208192
00110196Kbps288209192
001110112Kbps336243224
001111112Kbps336244224
010000128Kbps384278256
010001128Kbps384279256
010010160Kbps480348320
010011160Kbps480349320
010100192Kbps576417384
010101192Kbps576418384
010110224Kbps672487448
010111224Kbps672488448
011000256Kbps768557512
011001256Kbps768558512
011010320Kbps960696640
011011320Kbps960697640
011100384Kbps1152835768
011101384Kbps1152836768
011110448Kbps1344975896
011111448Kbps1344976896
100000512Kbps153611141024
100001512Kbps153611151024
100010576Kbps172812531152
100011576Kbps172812541152
100100640Kbps192013931280
100101640Kbps192013941280
100110 to 111111 reserved

BSI

The BSI contains many conditionally included fields, so there is no fixed alignment.

standard (A52) variablebit lengthalternate (A52a) variable
bsid = 8 in this version 5bsid = 6 in this version
bsmod 3no change
acmod 3:
if((acmod & 0x1) && (acmod != 0x1)) /* 3 front channels */ {cmixlev } 2:
if(acmod & 0x4) /* if a surround channel exists */ {surmixlev } 2:
if(acmod == 0x2) /* if in 2/0 mode */ {dsurmod } 2:
lfeon 1:
dialnorm 5:
compre 1:
if(compre) {compr } 8:
lancode 1:
if(langcode) {langcod } 8:
audioprodie 1:
if(audioprodie) {mixlevel } 5:
if(audioprodie) {roomtyp } 2:
if(acmod == 0) /* 1+1 mode, so some items need a second value */ :
{  :
    dialnorm2 5:
    compr2e 1:
    if(compr2e) {compr2 } 8:
    lancod2e 1:
    if(langcod2e) {langcod2 } 8:
    audioprodi2e 1:
    if(audioprodi2e) {mixlevel2 } 5:
    if(audioprodi2e) {roomtyp2 } 2:
}  :
copyrightb 1:
origbs 1no change
timecod1e 1xbsi1e
if(timecod1e) {timecod1 } 14if(xbsi1e) {
dmixmod (2 bits)
ltrtcmixlev (3 bits)
ltrtsurmixlev (3 bits)
lorocmixlev (3 bits)
lorosurmixlev (3 bits)
}
timecod2e 1xbsi2e
if(timecod2e) {timecod2 } 14if(xbsi2e) {
dsurexmod (2 bits)
dheadphonmod (2 bits)
adconvtyp (1 bit)
xbsi2 (8 bits - reserved for future expansion)
encinfo (1 bit - reserved for encoder use)
}
addbsie 1no change
if(addbsie) {addbsil } 6:
if(addbsie) {addbsi } 8*addbsilno change


bsmod bitstream mode

bsmodacmodType of Service
000anymain audio service: complete main (CM)
001anymain audio service: music and effects (ME)
010anyassociated service: visually impaired (VI)
011anyassociated service: hearing impaired (HI)
100anyassociated service: dialog (D)
101anyassociated service: commentary (C)
110anyassociated service: emergency (E)
111001associated service: voice over (VO)
111010 to 111main audio service: karaoke


acmod audio coding mode

acmodaudio coding modenfchansChannel Array Order
0001+12Ch1, Ch2
0011/01C
0102/02L, R
0113/03L, C, R
1002/13L, R, S
1013/14L, C, R, S
1102/24L, R, SL, SR
1113/25L, C, R, SL, SR


cmixlev - center mix level (acmod 3, 5, 7)

valuecenter mix level
000.707 (-3.0 dB)
010.595 (-4.5 dB)
100.500 (-6.0 dB)
11reserved


surmixlev - surround mix level (acmod 4, 5, 6, 7)

valuesurround mix level
000.707 (-3.0 dB)
010.500 (-6.0 dB)
100
11reserved


dsurmod - dolby surround mode (acmod 2)

valueindication
00not indicated
01Not Dolby Surround encoded
10Dolby Surround encoded
11reserved


lfeon - Low frequency effects (LFE) on, 0=off, 1=on
dialnorm - Dialog normalization, average level, in -dB, of dialog channel with respect to digital 100%. The value of 0 is reserved, and decoders should use -31 dB
compre and compr - see section 7.7.2 of A52A
langcode and langcod - reserved
audproie - audio production information exists
mixlevel - mixing level, the absolute acoustic sound pressure level of an individual channel during the final mixing session. The peak mixing level is 80 + the 5-bit value dB SPL.

roomtyp - The type and calibration of the mixing room used for the final mixing session.

roomtypType of Mixing Room
00not indicated
01large room, X curve monitor
10small room, flat monitor
11reserved

dialnorm2, compr2e, compr2, langcod2e, langcod2, audprodi2e, mixlevel2, roomtyp2 - same as above, but for Ch2 of 1+1 mode.
copyrightb - copyright bit, 0=not protected by copyright, 1=protected by copyright.
origbs - original bit stream, 1=original, 0=copy

timecod1e, timecod1 - most significant 14 bits of time code, as follows:

131211109876543210
hours (0-23) minutes (0-59) seconds/8 (0-7)

timecod2e, timecod2 - least significant 14 bits of time code, as follows:
131211109876543210
seconds mod 8 (0-7) frames (0-29)1/64 frames (0-63)

addbsie - flag for presence of additional bit stream information.
addbsil - length in bytes of additional bit stream information.
addbsi - additional bit stream information, up to 64 bytes.

Fields of alternate (A52a) BSI


dmixmod - preferred stereo downmix mode

dmixmodIndication
00not indicated
01Lt/Rt downmix preferred
10Lo/Ro downmix preferred
11reserved


ltrtcmixlev - Lt/Rt Center Mix Level
ltrtsurmixlev - Lt/Rt Surround Mix Level
lorocmixlev - Lo/Ro Center Mix Level
lorosurmixlev - Lo/Ro Surround Mix Level

valuelevel
0001.414 (+3.0 dB)
0011.189 (+1.5 dB)
0101.000 (0.0 dB)
0110.841 (-1.5 dB)
1000.707 (-3.0 dB)
1010.595 (-4.5 dB)
1100.500 (-6.0 dB)
1110.000 (-inf dB)


dsurexmod - Dolby Surround EX Mode

dsurexmodIndication
00not indicated
01Not Dolby Surround EX encoded
10Dolby Surround EX encoded
11reserved


dheadphonmod - Dolby Headphone Mode

dheadphonmodIndication
00not indicated
01Not Dolby Headphone encoded
10Dolby Headphone encoded
11reserved


adconvtyp - A/D Converter zType

adconvtypIndication
0Standard
1HDCD

 

 

Forward: http://rmworkshop.com/dvd_info/related_info/ac3hdr.html

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
头信息示例如下vbf_version = 2.6; header { sw_part_number = "8895913857"; sw_version = "B"; sw_part_type = DATA; data_format_identifier = 0x00; ecu_address = 0x1012; erase = { { 0x00B60000, 0x00010000 }, { 0x40200300, 0x00000D00 } }; verification_block_start = 0x40200300; verification_block_length = 0x0000002C; verification_block_root_hash = 0x3AB70E8A9C521B370E37D6FF03263770426297167C495C80C8AF3EA0B9AC3C7C; file_checksum = 0xEDB03AFF; sw_signature_dev = 0x7B3E3A02DBBC87DCC7BB9BFD795C7D1355C82DCA947BA5225B5BC549F4FF1648C3DC78C7947DF7F751A856351FBF340CB9F9E5B0790F026DC080800EA8A7AE6383DF63A0C8447ADB921A29A6FD2B84BA83D4769301FDBD3B019442A8FC588864F299D546587019E7700C345899F4CBEA7E5F831132DDC563C589DDD64F5A842129B803BC4C324310918162BC01E6312374A370A39F201F425B4DB457F8BA829A459BD5ED9E1673D9BD923D5E1287AAB45AC3B8999FC96CA514CB5EFBEBD5B23FDBF8AC944C376F44153B2C7F3B415AB87D274A4BD2DD120B70DA67721062F03125FA9D162C10855CD4F59A43253D0421A8D7AE851188E9D0EB1BAB13DE308012; sw_signature = 0x422CB67A399E4C7E0AA3621C8B9DA49947E5E655E83D0181A76CFA8FEFD250E0615576E3907530A4263F3198B8080ACE74E5113987EFA419B88B409D794860FD4A65511B2C95B1716947C6B7BE335800D8231C327AB866B7CA4D4F9CCB06BEEBDBA5EB797E21FC419B7D608D68FDD9F8095603ED298991DB8AC836D023B2059BF3641D6BADC4F626F5DC201561726FE9FB58BB4AEA0A04B0D9FE3B05C072AAA0CFE711679635187062FDB1AED7309E3D4F3400D1A4254884832CDB20C2C7DA0E264EF7F622DC0042C94AB19D7C74C966999A2A6D0F4C43EE179FFB6743FD056113898DFD1FF3E5E0DDE3B7010381857F046CCAD27357F39403FA2776821C438F; }, 请用c写代码 把头信息都解析出来
06-09
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值