-
Notifications
You must be signed in to change notification settings - Fork 9
NALUnit
uupaa edited this page Sep 11, 2018
·
3 revisions
nal_unit( NumBytesInNALunit ) { Descriptor
forbidden_zero_bit f(1) // 常に 0
nal_ref_idc u(2) // 0 以外なら参照すべき idc があります
nal_unit_type u(5)
NumBytesInRBSP = 0
nalUnitHeaderBytes = 1
if ( nal_unit_type == 14 || nal_unit_type == 20 ) {
svc_extension_flag u(1)
if( svc_extension_flag ) {
nal_unit_header_svc_extension( ) // specified in Annex G
} else {
nal_unit_header_mvc_extension( ) // specified in Annex H
}
nalUnitHeaderBytes += 3
}
for( i = nalUnitHeaderBytes; i < NumBytesInNALunit; i++ ) {
if( i + 2 < NumBytesInNALunit && next_bits( 24 ) == 0x000003 ) {
rbsp_byte[ NumBytesInRBSP++ ] b(8)
rbsp_byte[ NumBytesInRBSP++ ] b(8)
i += 2
emulation_prevention_three_byte f(8) // 常に 0x03
} else {
rbsp_byte[ NumBytesInRBSP++ ] b(8)
}
}
}