summaryrefslogtreecommitdiffstats
path: root/libavcodec/tscc.c
diff options
context:
space:
mode:
authorRoberto Togni <r_togni@tiscali.it>2005-01-31 22:34:02 +0000
committerRoberto Togni <r_togni@tiscali.it>2005-01-31 22:34:02 +0000
commitb2eef2f0eae21b3f1075db63f84be906ba4df05c (patch)
tree414e91fccc4254fcac5b01694a9173c7564aa43f /libavcodec/tscc.c
parente993bc03acf074f3eeb34d074af5a0ffb60206ef (diff)
downloadffmpeg-streaming-b2eef2f0eae21b3f1075db63f84be906ba4df05c.zip
ffmpeg-streaming-b2eef2f0eae21b3f1075db63f84be906ba4df05c.tar.gz
Add 32bit RGB support
Originally committed as revision 3912 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/tscc.c')
-rw-r--r--libavcodec/tscc.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/libavcodec/tscc.c b/libavcodec/tscc.c
index e38ef7e..6cc9ca8 100644
--- a/libavcodec/tscc.c
+++ b/libavcodec/tscc.c
@@ -116,7 +116,7 @@ static int decode_rle(CamtasiaContext *c, unsigned int srcsize)
}
pos += p2;
} else { //Run of pixels
- int pix[3]; //original pixel
+ int pix[4]; //original pixel
switch(c->bpp){
case 8: pix[0] = *src++;
break;
@@ -127,6 +127,11 @@ static int decode_rle(CamtasiaContext *c, unsigned int srcsize)
pix[1] = *src++;
pix[2] = *src++;
break;
+ case 32: pix[0] = *src++;
+ pix[1] = *src++;
+ pix[2] = *src++;
+ pix[3] = *src++;
+ break;
}
if (output + p1 * (c->bpp / 8) > output_end)
continue;
@@ -141,6 +146,11 @@ static int decode_rle(CamtasiaContext *c, unsigned int srcsize)
*output++ = pix[1];
*output++ = pix[2];
break;
+ case 32: *output++ = pix[0];
+ *output++ = pix[1];
+ *output++ = pix[2];
+ *output++ = pix[3];
+ break;
}
}
pos += p1;
@@ -252,9 +262,10 @@ static int decode_init(AVCodecContext *avctx)
switch(avctx->bits_per_sample){
case 8: avctx->pix_fmt = PIX_FMT_PAL8; break;
case 16: avctx->pix_fmt = PIX_FMT_RGB555; break;
- case 24: av_log(avctx, AV_LOG_ERROR, "Camtasia warning: RGB24 is just guessed\n");
+ case 24:
avctx->pix_fmt = PIX_FMT_BGR24;
break;
+ case 32: avctx->pix_fmt = PIX_FMT_RGBA32; break;
default: av_log(avctx, AV_LOG_ERROR, "Camtasia error: unknown depth %i bpp\n", avctx->bits_per_sample);
return -1;
}
OpenPOWER on IntegriCloud