Opened 13 years ago
Closed 13 years ago
#850 closed defect (fixed)
jpg: fix colors for sequential RGB
Reported by: | ami_stuff | Owned by: | |
---|---|---|---|
Priority: | normal | Component: | avcodec |
Version: | git-master | Keywords: | mjpeg gbr24p |
Cc: | Blocked By: | ||
Blocking: | Reproduced by developer: | yes | |
Analyzed by developer: | no |
Description
this hack seems to solve the problem
mjpegdec.c:
av_log(s->avctx, AV_LOG_ERROR, "decode_sos: index(%d) out of components\n", index); return -1; } /* Metasoft MJPEG codec has Cb and Cr swapped */ - if (s->avctx->codec_tag == MKTAG('M', 'T', 'S', 'J') - && 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;
Attachments (1)
Change History (4)
by , 13 years ago
Attachment: | sequential_RGB_24bpp.jpg added |
---|
comment:2 by , 13 years ago
Component: | undetermined → avcodec |
---|---|
Keywords: | mjpeg gbr24p added |
Reproduced by developer: | set |
Status: | new → open |
Version: | unspecified → git-master |
Above hack does not help, i is always 0 for this sample.
diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c index 166c223..a439cff 100644 --- a/libavcodec/mjpegdec.c +++ b/libavcodec/mjpegdec.c @@ -1018,6 +1018,8 @@ int ff_mjpeg_decode_sos(MJpegDecodeContext *s, if(nb_components == 3 && s->nb_components == 3 && s->avctx->pix_fmt == PIX_FMT_GBR24P) index = (i+2)%3; + if(nb_components == 1 && s->avctx->pix_fmt == PIX_FMT_GBR24P) + index = (index+2)%3; s->comp_index[i] = index;
comment:3 by , 13 years ago
Resolution: | → fixed |
---|---|
Status: | open → closed |
applied a modified version of carls patch
Note:
See TracTickets
for help on using tickets.