terryleung
9th January 2009, 10:51
Hi all,
I am writing a program to extract the sequence_parameter_set_rbsp() from a mp4 file
However, i got into troubles
The mp4dump of the file(avcC box only)
type avcC
configurationVersion = 1 (0x01)
AVCProfileIndication = 66 (0x42)
profile_compatibility = 192 (0xc0)
AVCLevelIndication = 13 (0x0d)
reserved = 63 (0x3f) <6 bits>
lengthSizeMinusOne = 3 (0x3) <2 bits>
reserved1 = 7 (0x7) <3 bits>
numOfSequenceParameterSets = 1 (0x01) <5 bits>
sequenceParameterSetLength = 23 (0x0017)
sequenceParameterSetNALUnit = <23 bytes>
67 42 c0 0d 9a 74 0a 0f d8 08 80 00 00 03 00 80
00 00 0f 47 8a 15 50
numOfPictureParameterSets = 1 (0x01)
pictureParameterSetLength = 4 (0x0004)
pictureParameterSetNALUnit = <4 bytes> 68 ce 3c 80
I try to decode the sequenceParameterSetNALUnit
From my understanding
The first byte 67 is nal unit type where the last 5 bit indicate it is a sequence parameter set
and Then I decode from the second byte as a seq_parameter_set_rbsp() (in ISO/IEC 14496-10:2004 page 31)
After I decoded it, there are a lot of bit that is not used a the bitstream decoding process
I have tried to use x264 to encode a seq parameter set by using the function x264_nal_encode
Then I use my decode function to decode it, and it work very well (without any unused bit)
where is the seq_parameter_set_rbsp located in sequenceParameterSetNALUnit ???
I am writing a program to extract the sequence_parameter_set_rbsp() from a mp4 file
However, i got into troubles
The mp4dump of the file(avcC box only)
type avcC
configurationVersion = 1 (0x01)
AVCProfileIndication = 66 (0x42)
profile_compatibility = 192 (0xc0)
AVCLevelIndication = 13 (0x0d)
reserved = 63 (0x3f) <6 bits>
lengthSizeMinusOne = 3 (0x3) <2 bits>
reserved1 = 7 (0x7) <3 bits>
numOfSequenceParameterSets = 1 (0x01) <5 bits>
sequenceParameterSetLength = 23 (0x0017)
sequenceParameterSetNALUnit = <23 bytes>
67 42 c0 0d 9a 74 0a 0f d8 08 80 00 00 03 00 80
00 00 0f 47 8a 15 50
numOfPictureParameterSets = 1 (0x01)
pictureParameterSetLength = 4 (0x0004)
pictureParameterSetNALUnit = <4 bytes> 68 ce 3c 80
I try to decode the sequenceParameterSetNALUnit
From my understanding
The first byte 67 is nal unit type where the last 5 bit indicate it is a sequence parameter set
and Then I decode from the second byte as a seq_parameter_set_rbsp() (in ISO/IEC 14496-10:2004 page 31)
After I decoded it, there are a lot of bit that is not used a the bitstream decoding process
I have tried to use x264 to encode a seq parameter set by using the function x264_nal_encode
Then I use my decode function to decode it, and it work very well (without any unused bit)
where is the seq_parameter_set_rbsp located in sequenceParameterSetNALUnit ???