mirror of https://git.ffmpeg.org/ffmpeg.git
Decode RGB ljpeg to RGB24.
No alpha channel is decoded, the output used to be completely transparent.
This commit is contained in:
parent
9608e3a182
commit
51d7cd3596
|
@ -324,7 +324,7 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s)
|
|||
switch(pix_fmt_id){
|
||||
case 0x11111100:
|
||||
if(s->rgb){
|
||||
s->avctx->pix_fmt = PIX_FMT_BGRA;
|
||||
s->avctx->pix_fmt = PIX_FMT_BGR24;
|
||||
}else{
|
||||
if(s->component_id[0] == 'Q' && s->component_id[1] == 'F' && s->component_id[2] == 'A'){
|
||||
s->avctx->pix_fmt = PIX_FMT_GBR24P;
|
||||
|
@ -687,21 +687,21 @@ static int ljpeg_decode_rgb_scan(MJpegDecodeContext *s, int predictor, int point
|
|||
|
||||
if(s->rct){
|
||||
for(mb_x = 0; mb_x < s->mb_width; mb_x++) {
|
||||
ptr[4*mb_x+1] = buffer[mb_x][0] - ((buffer[mb_x][1] + buffer[mb_x][2] - 0x200)>>2);
|
||||
ptr[4*mb_x+0] = buffer[mb_x][1] + ptr[4*mb_x+1];
|
||||
ptr[4*mb_x+2] = buffer[mb_x][2] + ptr[4*mb_x+1];
|
||||
ptr[3*mb_x+1] = buffer[mb_x][0] - ((buffer[mb_x][1] + buffer[mb_x][2] - 0x200)>>2);
|
||||
ptr[3*mb_x+0] = buffer[mb_x][1] + ptr[3*mb_x+1];
|
||||
ptr[3*mb_x+2] = buffer[mb_x][2] + ptr[3*mb_x+1];
|
||||
}
|
||||
}else if(s->pegasus_rct){
|
||||
for(mb_x = 0; mb_x < s->mb_width; mb_x++) {
|
||||
ptr[4*mb_x+1] = buffer[mb_x][0] - ((buffer[mb_x][1] + buffer[mb_x][2])>>2);
|
||||
ptr[4*mb_x+0] = buffer[mb_x][1] + ptr[4*mb_x+1];
|
||||
ptr[4*mb_x+2] = buffer[mb_x][2] + ptr[4*mb_x+1];
|
||||
ptr[3*mb_x+1] = buffer[mb_x][0] - ((buffer[mb_x][1] + buffer[mb_x][2])>>2);
|
||||
ptr[3*mb_x+0] = buffer[mb_x][1] + ptr[3*mb_x+1];
|
||||
ptr[3*mb_x+2] = buffer[mb_x][2] + ptr[3*mb_x+1];
|
||||
}
|
||||
}else{
|
||||
for(mb_x = 0; mb_x < s->mb_width; mb_x++) {
|
||||
ptr[4*mb_x+0] = buffer[mb_x][2];
|
||||
ptr[4*mb_x+1] = buffer[mb_x][1];
|
||||
ptr[4*mb_x+2] = buffer[mb_x][0];
|
||||
ptr[3*mb_x+0] = buffer[mb_x][2];
|
||||
ptr[3*mb_x+1] = buffer[mb_x][1];
|
||||
ptr[3*mb_x+2] = buffer[mb_x][0];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
|
||||
#define LIBAVCODEC_VERSION_MAJOR 53
|
||||
#define LIBAVCODEC_VERSION_MINOR 41
|
||||
#define LIBAVCODEC_VERSION_MICRO 0
|
||||
#define LIBAVCODEC_VERSION_MICRO 1
|
||||
|
||||
#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
|
||||
LIBAVCODEC_VERSION_MINOR, \
|
||||
|
|
Loading…
Reference in New Issue