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");
113 "MXM bitmask memory allocation error\n");
121 "Completion bitmask memory allocation error\n");
128 memcpy(s->
mxm_bitmask, buf_ptr + 12, bitmask_size);
132 uint8_t completion_check = 0xFF;
133 for (i = 0; i < bitmask_size; ++i) {
144 const uint8_t *buf_ptr,
int buf_size)
150 if (len > 14 && len <= buf_size && !strncmp(buf_ptr + 2,
"MXM", 3)) {
164 "Picture dimensions stored in SOF and MXM mismatch\n");
168 if (reference_ptr->
data[0]) {
174 "Dimensions of current and reference picture mismatch\n");
184 void *
data,
int *got_frame,
188 int buf_size = avpkt->
size;
191 const uint8_t *buf_end, *buf_ptr;
192 const uint8_t *unescaped_buf_ptr;
193 int unescaped_buf_size;
198 buf_end = buf + buf_size;
201 while (buf_ptr < buf_end) {
203 &unescaped_buf_ptr, &unescaped_buf_size);
209 if (start_code >=
APP0 && start_code <=
APP15) {
213 switch (start_code) {
224 "quantization table decode error\n");
232 "huffman table decode error\n");
247 "SOF data decode error\n");
252 "Interlaced mode not supported in MxPEG\n");
260 "Can not process SOS without SOF data, skipping\n");
266 "First picture has no SOF, skipping\n");
271 "Non-key frame has no MXM, skipping\n");
293 if (!reference_ptr->
data[0] &&
333 return buf_ptr -
buf;