mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
avcodec/mjpegdec: rgba64 ljpeg support
Fixes Ticket2965 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
1e4e0bd907
commit
7fb2622456
@ -371,7 +371,7 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s)
|
|||||||
break;
|
break;
|
||||||
case 0x11111111:
|
case 0x11111111:
|
||||||
if (s->rgb)
|
if (s->rgb)
|
||||||
s->avctx->pix_fmt = AV_PIX_FMT_ABGR;
|
s->avctx->pix_fmt = s->bits <= 8 ? AV_PIX_FMT_ABGR : AV_PIX_FMT_RGBA64;
|
||||||
else {
|
else {
|
||||||
s->avctx->pix_fmt = s->bits <= 8 ? AV_PIX_FMT_YUVA444P : AV_PIX_FMT_YUVA444P16;
|
s->avctx->pix_fmt = s->bits <= 8 ? AV_PIX_FMT_YUVA444P : AV_PIX_FMT_YUVA444P16;
|
||||||
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;
|
||||||
@ -868,8 +868,14 @@ static int ljpeg_decode_rgb_scan(MJpegDecodeContext *s, int nb_components, int p
|
|||||||
if (s->nb_components == 4) {
|
if (s->nb_components == 4) {
|
||||||
for(i=0; i<nb_components; i++) {
|
for(i=0; i<nb_components; i++) {
|
||||||
int c= s->comp_index[i];
|
int c= s->comp_index[i];
|
||||||
for(mb_x = 0; mb_x < s->mb_width; mb_x++) {
|
if (s->bits <= 8) {
|
||||||
ptr[4*mb_x+3-c] = buffer[mb_x][i];
|
for(mb_x = 0; mb_x < s->mb_width; mb_x++) {
|
||||||
|
ptr[4*mb_x+3-c] = buffer[mb_x][i];
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
for(mb_x = 0; mb_x < s->mb_width; mb_x++) {
|
||||||
|
((uint16_t*)ptr)[4*mb_x+c] = buffer[mb_x][i];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (s->rct) {
|
} else if (s->rct) {
|
||||||
|
Loading…
Reference in New Issue
Block a user