if(build_vlc(&s->vlcs[class][index], bits_table, val_table, code_max + 1, 0, class > 0) < 0){
return -1;
}
- if(class>0 && build_vlc(&s->vlcs[2][index], bits_table, val_table, code_max + 1, 0, 0) < 0){
+
+ if(class>0){
+ free_vlc(&s->vlcs[2][index]);
+ if(build_vlc(&s->vlcs[2][index], bits_table, val_table, code_max + 1, 0, 0) < 0){
return -1;
+ }
}
}
return 0;
block[0] = val;
/* AC coefs */
i = 0;
- {OPEN_READER(re, &s->gb)
+ {OPEN_READER(re, &s->gb);
do {
UPDATE_CACHE(re, &s->gb);
- GET_VLC(code, re, &s->gb, s->vlcs[1][ac_index].table, 9, 2)
+ GET_VLC(code, re, &s->gb, s->vlcs[1][ac_index].table, 9, 2);
i += ((unsigned)code) >> 4;
code &= 0xf;
if(code){
if(code > MIN_CACHE_BITS - 16){
- UPDATE_CACHE(re, &s->gb)
+ UPDATE_CACHE(re, &s->gb);
}
{
int cache=GET_CACHE(re,&s->gb);
level = (NEG_USR32(sign ^ cache,code) ^ sign) - sign;
}
- LAST_SKIP_BITS(re, &s->gb, code)
+ LAST_SKIP_BITS(re, &s->gb, code);
if (i > 63) {
av_log(s->avctx, AV_LOG_ERROR, "error count: %d\n", i);
block[j] = level * quant_matrix[j];
}
}while(i<63);
- CLOSE_READER(re, &s->gb)}
+ CLOSE_READER(re, &s->gb);}
return 0;
}
(*EOBRUN)--;
return 0;
}
- {OPEN_READER(re, &s->gb)
+ {OPEN_READER(re, &s->gb);
for(i=ss;;i++) {
UPDATE_CACHE(re, &s->gb);
- GET_VLC(code, re, &s->gb, s->vlcs[2][ac_index].table, 9, 2)
+ GET_VLC(code, re, &s->gb, s->vlcs[2][ac_index].table, 9, 2);
run = ((unsigned) code) >> 4;
code &= 0xF;
if(code) {
i += run;
if(code > MIN_CACHE_BITS - 16){
- UPDATE_CACHE(re, &s->gb)
+ UPDATE_CACHE(re, &s->gb);
}
{
int cache=GET_CACHE(re,&s->gb);
level = (NEG_USR32(sign ^ cache,code) ^ sign) - sign;
}
- LAST_SKIP_BITS(re, &s->gb, code)
+ LAST_SKIP_BITS(re, &s->gb, code);
if (i >= se) {
if(i == se){
}
}
}
- CLOSE_READER(re, &s->gb)}
+ CLOSE_READER(re, &s->gb);}
if(i > *last_nnz)
*last_nnz = i;
return 0;
else {
for(;;i++) {
UPDATE_CACHE(re, &s->gb);
- GET_VLC(code, re, &s->gb, s->vlcs[2][ac_index].table, 9, 2)
+ GET_VLC(code, re, &s->gb, s->vlcs[2][ac_index].table, 9, 2);
if(code & 0xF) {
run = ((unsigned) code) >> 4;
if(i == se) {
if(i > *last_nnz)
*last_nnz = i;
- CLOSE_READER(re, &s->gb)
+ CLOSE_READER(re, &s->gb);
return 0;
}
}else{
}
val = -1;
found:
- dprintf(NULL, "find_marker skipped %d bytes\n", skipped);
+ av_dlog(NULL, "find_marker skipped %d bytes\n", skipped);
*pbuf_ptr = buf_ptr;
return val;
}
av_freep(&s->ljpeg_buffer);
s->ljpeg_buffer_size=0;
- for(i=0;i<2;i++) {
+ for(i=0;i<3;i++) {
for(j=0;j<4;j++)
free_vlc(&s->vlcs[i][j]);
}
return 0;
}
-AVCodec mjpeg_decoder = {
+AVCodec ff_mjpeg_decoder = {
"mjpeg",
AVMEDIA_TYPE_VIDEO,
CODEC_ID_MJPEG,
ff_mjpeg_decode_frame,
CODEC_CAP_DR1,
NULL,
- .max_lowres = 8,
+ .max_lowres = 4,
.long_name = NULL_IF_CONFIG_SMALL("MJPEG (Motion JPEG)"),
};
-AVCodec thp_decoder = {
+AVCodec ff_thp_decoder = {
"thp",
AVMEDIA_TYPE_VIDEO,
CODEC_ID_THP,