29 #define DEFAULT_PACKET_SIZE 1024
30 #define OVERREAD_SIZE 3
76 for (; p < end - 3; p += 4) {
77 uint32_t x = *(uint32_t*)p;
79 if (x & (~(x+0x01010101)) & 0x80808080) {
82 }
else if (p[1] == 0xff) {
84 }
else if (p[2] == 0xff) {
86 }
else if (p[3] == 0xff) {
92 for (; p <
end; ++p) {
93 if (*p == 0xff)
return p;
103 unsigned int soi_pos;
108 if (current_pos > current_pos + cache_size)
112 current_pos + cache_size +
135 uint8_t *startmarker_ptr, *
end, *search_end, marker;
154 if (startmarker_ptr >= search_end - 1 ||
155 *(startmarker_ptr + 1) !=
EOI)
break;
158 if (startmarker_ptr != search_end) {
159 marker = *(startmarker_ptr + 1);
164 mxg->
soi_ptr = startmarker_ptr;
165 }
else if (marker ==
EOI) {
187 }
else if ( (
SOF0 <= marker && marker <=
SOF15) ||
188 (
SOS <= marker && marker <=
COM) ) {
207 if (marker ==
APP13 && size >= 16) {
212 pkt->
size = size - 14;
213 pkt->
data = startmarker_ptr + 16;
223 }
else if (marker ==
COM && size >= 18 &&
224 !strncmp(startmarker_ptr + 4,
"MXF", 3)) {