32 int len, h, max_packet_size;
35 int begin_of_slice, end_of_slice, frame_type, temporal_reference;
41 temporal_reference = 0;
44 int begin_of_sequence;
46 begin_of_sequence = 0;
47 len = max_packet_size - 4;
60 if((start_code & 0xFFFFFF00) == 0x100) {
62 if (start_code == 0x100) {
63 frame_type = (r[1] & 0x38) >> 3;
64 temporal_reference = (int)r[0] << 2 | r[1] >> 6;
66 if (start_code == 0x1B8) {
67 begin_of_sequence = 1;
70 if (r - buf1 - 4 <= len) {
72 if (begin_of_slice == 0) {
80 if ((r1 - buf1 > 4) && (r - r1 < max_packet_size)) {
93 h |= temporal_reference << 16;
94 h |= begin_of_sequence << 13;
95 h |= begin_of_slice << 12;
96 h |= end_of_slice << 11;
105 memcpy(q, buf1, len);
114 begin_of_slice = end_of_slice;