Rya
12th June 2006, 14:24
I'm trying to figure out the format of the NAL Units in X264. I added a printf command in the source:
int write_nalu_bsf( hnd_t handle, uint8_t *p_nalu, int i_size )
{
int n;
for(n=0; n < i_size; n++){
printf("%02X", p_nalu[n]);
}
printf("\n");
if (fwrite(p_nalu, i_size, 1, (FILE *)handle) > 0){
return i_size;
}
return -1;
}
However the hexadecimal output of one of the lines here will be:
00000001419AF97CB3FFE...
These first hexadecimal values seem to follow a certain rule, so I'm pretty sure they don't belong to the payload. However if I look at the definition of a NAL unit header, it says:
F - 1 bit
NRI - 2 bit
TYPE - 5 bit
Which would only be 8 bits i.e. only 2 hexadecimals.
Question is where can I find F, NRI and TYPE in the output and where does the payload start?
int write_nalu_bsf( hnd_t handle, uint8_t *p_nalu, int i_size )
{
int n;
for(n=0; n < i_size; n++){
printf("%02X", p_nalu[n]);
}
printf("\n");
if (fwrite(p_nalu, i_size, 1, (FILE *)handle) > 0){
return i_size;
}
return -1;
}
However the hexadecimal output of one of the lines here will be:
00000001419AF97CB3FFE...
These first hexadecimal values seem to follow a certain rule, so I'm pretty sure they don't belong to the payload. However if I look at the definition of a NAL unit header, it says:
F - 1 bit
NRI - 2 bit
TYPE - 5 bit
Which would only be 8 bits i.e. only 2 hexadecimals.
Question is where can I find F, NRI and TYPE in the output and where does the payload start?