aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarl Eugen Hoyos <cehoyos@ag.or.at>2011-12-08 02:17:44 +0100
committerCarl Eugen Hoyos <cehoyos@ag.or.at>2011-12-08 02:45:53 +0100
commit51d7cd3596fa5341358d107e5a6d6e1945e98520 (patch)
treed8592ff233878d168e1b47686597cc2763b1b07e
parent9608e3a182fdd05fcc8056a25a8aaa91eb1746cc (diff)
downloadffmpeg-51d7cd3596fa5341358d107e5a6d6e1945e98520.tar.gz
Decode RGB ljpeg to RGB24.
No alpha channel is decoded, the output used to be completely transparent.
-rw-r--r--libavcodec/mjpegdec.c20
-rw-r--r--libavcodec/version.h2
2 files changed, 11 insertions, 11 deletions
diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c
index 7e69f28da6..5a51201d9d 100644
--- a/libavcodec/mjpegdec.c
+++ b/libavcodec/mjpegdec.c
@@ -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];
}
}
}
diff --git a/libavcodec/version.h b/libavcodec/version.h
index 14b04bac01..3c9c4dc896 100644
--- a/libavcodec/version.h
+++ b/libavcodec/version.h
@@ -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, \