mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
jpeg: rgb support
Fixes Ticket297 Based on a patch by Carl Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
3638f56dca
commit
c36edf3899
@ -326,8 +326,12 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s)
|
|||||||
if(s->rgb){
|
if(s->rgb){
|
||||||
s->avctx->pix_fmt = PIX_FMT_BGRA;
|
s->avctx->pix_fmt = PIX_FMT_BGRA;
|
||||||
}else{
|
}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->pix_fmt = s->cs_itu601 ? PIX_FMT_YUV444P : PIX_FMT_YUVJ444P;
|
||||||
s->avctx->color_range = s->cs_itu601 ? AVCOL_RANGE_MPEG : AVCOL_RANGE_JPEG;
|
s->avctx->color_range = s->cs_itu601 ? AVCOL_RANGE_MPEG : AVCOL_RANGE_JPEG;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
assert(s->nb_components==3);
|
assert(s->nb_components==3);
|
||||||
break;
|
break;
|
||||||
@ -992,6 +996,9 @@ int ff_mjpeg_decode_sos(MJpegDecodeContext *s,
|
|||||||
&& nb_components == 3 && s->nb_components == 3 && i)
|
&& nb_components == 3 && s->nb_components == 3 && i)
|
||||||
index = 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->comp_index[i] = index;
|
||||||
|
|
||||||
s->nb_blocks[i] = s->h_count[index] * s->v_count[index];
|
s->nb_blocks[i] = s->h_count[index] * s->v_count[index];
|
||||||
|
Loading…
Reference in New Issue
Block a user