comparison mjpeg.c @ 584:03e395b31197 libavcodec

handle DRI/RST markers patch by Leon van Stuivenberg <leonvs at iae dot nl>
author michaelni
date Sat, 27 Jul 2002 08:27:02 +0000
parents 4273be971bf8
children 8c9edc20599a
comparison
equal deleted inserted replaced
583:d6955d0d7d27 584:03e395b31197
1002 x = 0; 1002 x = 0;
1003 y++; 1003 y++;
1004 } 1004 }
1005 } 1005 }
1006 } 1006 }
1007 if (s->restart_interval && !--s->restart_count) {
1008 align_get_bits(&s->gb);
1009 skip_bits(&s->gb, 16); /* skip RSTn */
1010 for (j=0; j<nb_components; j++) /* reset dc */
1011 s->last_dc[j] = 1024;
1012 }
1007 } 1013 }
1008 } 1014 }
1009 ret = 0; 1015 ret = 0;
1010 the_end: 1016 the_end:
1011 emms_c(); 1017 emms_c();
1154 unsigned int state, v; 1160 unsigned int state, v;
1155 int val; 1161 int val;
1156 1162
1157 state = *header_state; 1163 state = *header_state;
1158 buf_ptr = *pbuf_ptr; 1164 buf_ptr = *pbuf_ptr;
1165 retry:
1159 if (state) { 1166 if (state) {
1160 /* get marker */ 1167 /* get marker */
1161 found: 1168 found:
1162 if (buf_ptr < buf_end) { 1169 if (buf_ptr < buf_end) {
1163 val = *buf_ptr++; 1170 val = *buf_ptr++;
1164 state = 0; 1171 state = 0;
1172 if ((val >= RST0) && (val <= RST7))
1173 goto retry;
1165 } else { 1174 } else {
1166 val = -1; 1175 val = -1;
1167 } 1176 }
1168 } else { 1177 } else {
1169 while (buf_ptr < buf_end) { 1178 while (buf_ptr < buf_end) {