[FFmpeg-cvslog] Decode RGB ljpeg to RGB24.
Carl Eugen Hoyos
git at videolan.org
Thu Dec 8 02:50:11 CET 2011
ffmpeg | branch: master | Carl Eugen Hoyos <cehoyos at ag.or.at> | Thu Dec 8 02:17:44 2011 +0100| [51d7cd3596fa5341358d107e5a6d6e1945e98520] | committer: Carl Eugen Hoyos
Decode RGB ljpeg to RGB24.
No alpha channel is decoded, the output used to be completely transparent.
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=51d7cd3596fa5341358d107e5a6d6e1945e98520
---
libavcodec/mjpegdec.c | 20 ++++++++++----------
libavcodec/version.h | 2 +-
2 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c
index 7e69f28..5a51201 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 14b04ba..3c9c4dc 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, \
More information about the ffmpeg-cvslog
mailing list