if(s->rgb){
s->avctx->pix_fmt = PIX_FMT_BGRA;
}else{
+ if(s->component_id[0] == 'Q' && s->component_id[1] == 'F' && s->component_id[2] == 'A'){
+ s->avctx->pix_fmt = PIX_FMT_GBR24P;
+ }else{
s->avctx->pix_fmt = s->cs_itu601 ? PIX_FMT_YUV444P : PIX_FMT_YUVJ444P;
s->avctx->color_range = s->cs_itu601 ? AVCOL_RANGE_MPEG : AVCOL_RANGE_JPEG;
+ }
}
assert(s->nb_components==3);
break;
if (s->restart_interval && show_bits(&s->gb, i) == (1<<i)-1){ /* skip RSTn */
int pos= get_bits_count(&s->gb);
align_get_bits(&s->gb);
- while(show_bits(&s->gb, 8) == 0xFF)
+ while(get_bits_count(&s->gb) < s->gb.size_in_bits && show_bits(&s->gb, 8) == 0xFF)
skip_bits(&s->gb, 8);
- if((get_bits(&s->gb, 8)&0xF8) == 0xD0){
+ if(get_bits_count(&s->gb) < s->gb.size_in_bits && (get_bits(&s->gb, 8)&0xF8) == 0xD0){
for (i=0; i<nb_components; i++) /* reset dc */
s->last_dc[i] = 1024;
}else{
&& nb_components == 3 && s->nb_components == 3 && i)
index = 3 - i;
+ if(nb_components == 3 && s->nb_components == 3 && s->avctx->pix_fmt == PIX_FMT_GBR24P)
+ index = (i+2)%3;
+
s->comp_index[i] = index;
s->nb_blocks[i] = s->h_count[index] * s->v_count[index];
}
if(s->avctx->debug & FF_DEBUG_PICT_INFO)
- av_log(s->avctx, AV_LOG_DEBUG, "%s %s p:%d >>:%d ilv:%d bits:%d skip:%d %s\n", s->lossless ? "lossless" : "sequential DCT", s->rgb ? "RGB" : "",
+ av_log(s->avctx, AV_LOG_DEBUG, "%s %s p:%d >>:%d ilv:%d bits:%d skip:%d %s comp:%d\n", s->lossless ? "lossless" : "sequential DCT", s->rgb ? "RGB" : "",
predictor, point_transform, ilv, s->bits, s->mjpb_skiptosod,
- s->pegasus_rct ? "PRCT" : (s->rct ? "RCT" : ""));
+ s->pegasus_rct ? "PRCT" : (s->rct ? "RCT" : ""), nb_components);
/* mjpeg-b can have padding bytes between sos and image data, skip them */
return -1;
break;
case EOI:
- if ((s->buggy_avid && !s->interlaced) || s->restart_interval)
- break;
eoi_parser:
s->cur_scan = 0;
if (!s->got_picture) {
break;
}
if (ff_mjpeg_decode_sos(s, NULL, NULL) < 0 &&
- avctx->error_recognition >= FF_ER_EXPLODE)
+ (avctx->err_recognition & AV_EF_EXPLODE))
return AVERROR_INVALIDDATA;
- /* buggy avid puts EOI every 10-20th frame */
- /* if restart period is over process EOI */
- if ((s->buggy_avid && !s->interlaced) || s->restart_interval)
- goto eoi_parser;
break;
case DRI:
mjpeg_decode_dri(s);
#define OFFSET(x) offsetof(MJpegDecodeContext, x)
#define VD AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_DECODING_PARAM
static const AVOption options[] = {
- { "extern_huff", "Use external huffman table.", OFFSET(extern_huff), FF_OPT_TYPE_INT, { 0 }, 0, 1, VD },
+ { "extern_huff", "Use external huffman table.", OFFSET(extern_huff), AV_OPT_TYPE_INT, { 0 }, 0, 1, VD },
{ NULL },
};