54 for (i = 0; i < 2; ++i)
79 const uint8_t *buf_ptr,
int buf_size)
91 const uint8_t *buf_ptr,
int buf_size)
93 unsigned bitmask_size, mb_count;
100 bitmask_size = (mb_count + 7) >> 3;
101 if (bitmask_size > buf_size - 12) {
103 "MXM bitmask is not complete\n");
112 "MXM bitmask memory allocation error\n");
120 "Completion bitmask memory allocation error\n");
127 memcpy(s->
mxm_bitmask, buf_ptr + 12, bitmask_size);
131 uint8_t completion_check = 0xFF;
132 for (i = 0; i < bitmask_size; ++i) {
143 const uint8_t *buf_ptr,
int buf_size)
149 if (len > 14 && len <= buf_size && !strncmp(buf_ptr + 2,
"MXM", 3)) {
163 "Picture dimensions stored in SOF and MXM mismatch\n");
167 if (reference_ptr->
data[0]) {
173 "Dimensions of current and reference picture mismatch\n");
183 void *
data,
int *got_frame,
187 int buf_size = avpkt->
size;
190 const uint8_t *buf_end, *buf_ptr;
191 const uint8_t *unescaped_buf_ptr;
192 int unescaped_buf_size;
197 buf_end = buf + buf_size;
200 while (buf_ptr < buf_end) {
202 &unescaped_buf_ptr, &unescaped_buf_size);
208 if (start_code >=
APP0 && start_code <=
APP15) {
212 switch (start_code) {
223 "quantization table decode error\n");
231 "huffman table decode error\n");
246 "SOF data decode error\n");
251 "Interlaced mode not supported in MxPEG\n");
259 "Can not process SOS without SOF data, skipping\n");
265 "First picture has no SOF, skipping\n");
270 "Non-key frame has no MXM, skipping\n");
294 if (!reference_ptr->
data[0] &&
336 return buf_ptr - buf;