raydon
21st November 2009, 15:33
Hi everyone. I am currently developing a utility for importing non-native video to the Humax Foxsat HDR. (The first public release is already available). I want to improve on H264 support and I need a simple method to decode the slice_type fom a NAL unit slice_header. I don't want to use a full implementation of bitstream class and exp-golomb decode. Ideally I just want to read the first few bytes of the NAL payload and decode first_mb_in_slice then the slice_type code. Here is an example of what I mean. These are the first few bytes of a non-IDR NAL unit containing an I-slice(type 7). 00 00 01 61 88 C3 3B 51 11 62 67 3F FB 14 82 74. As I see it the first byte of the payload is byte 5 (88) Converting this and next two bytes (C3 & 3B) into a bitstream gives 100010001100001100111011. The exp-golomb coded number for 7 is 001000 and I would have expected to see this pattern somewhere in these first few bytes. Have I got this wrong ? Can anyone with a better understanding please explain what I am missing here, and show me an example of how to retrieve the code 7 from these bytes?