aboutsummaryrefslogtreecommitdiffstats
path: root/libswscale/swscale_unscaled.c
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2012-01-10 02:17:33 +0000
committerPaul B Mahol <onemda@gmail.com>2012-01-10 18:00:38 +0000
commit277030627d847d1478fe0d64fe7fdeb8fb7d837a (patch)
tree6472b686dc3580ecb851aeadc01e0d772ed7f9c5 /libswscale/swscale_unscaled.c
parent047a28f759e9e501e973c82a488f8f6a3239b9d2 (diff)
downloadffmpeg-277030627d847d1478fe0d64fe7fdeb8fb7d837a.tar.gz
rgb2rgb: allow conversion for <15 bpp
Diffstat (limited to 'libswscale/swscale_unscaled.c')
-rw-r--r--libswscale/swscale_unscaled.c62
1 files changed, 31 insertions, 31 deletions
diff --git a/libswscale/swscale_unscaled.c b/libswscale/swscale_unscaled.c
index 401666b525..748681c0ee 100644
--- a/libswscale/swscale_unscaled.c
+++ b/libswscale/swscale_unscaled.c
@@ -404,8 +404,8 @@ static int rgbToRgbWrapper(SwsContext *c, const uint8_t *src[], int srcStride[],
const enum PixelFormat dstFormat = c->dstFormat;
const int srcBpp = (c->srcFormatBpp + 7) >> 3;
const int dstBpp = (c->dstFormatBpp + 7) >> 3;
- const int srcId = c->srcFormatBpp >> 2; /* 1:0, 4:1, 8:2, 15:3, 16:4, 24:6, 32:8 */
- const int dstId = c->dstFormatBpp >> 2;
+ const int srcId = c->srcFormatBpp;
+ const int dstId = c->dstFormatBpp;
void (*conv)(const uint8_t *src, uint8_t *dst, int src_size) = NULL;
#define CONV_IS(src, dst) (srcFormat == PIX_FMT_##src && dstFormat == PIX_FMT_##dst)
@@ -427,38 +427,38 @@ static int rgbToRgbWrapper(SwsContext *c, const uint8_t *src[], int srcStride[],
/* BGR -> BGR */
if ((isBGRinInt(srcFormat) && isBGRinInt(dstFormat)) ||
(isRGBinInt(srcFormat) && isRGBinInt(dstFormat))) {
- switch (srcId | (dstId << 4)) {
- case 0x34: conv = rgb16to15; break;
- case 0x36: conv = rgb24to15; break;
- case 0x38: conv = rgb32to15; break;
- case 0x43: conv = rgb15to16; break;
- case 0x46: conv = rgb24to16; break;
- case 0x48: conv = rgb32to16; break;
- case 0x63: conv = rgb15to24; break;
- case 0x64: conv = rgb16to24; break;
- case 0x68: conv = rgb32to24; break;
- case 0x83: conv = rgb15to32; break;
- case 0x84: conv = rgb16to32; break;
- case 0x86: conv = rgb24to32; break;
+ switch (srcId | (dstId << 16)) {
+ case 0x000F0010: conv = rgb16to15; break;
+ case 0x000F0018: conv = rgb24to15; break;
+ case 0x000F0020: conv = rgb32to15; break;
+ case 0x0010000F: conv = rgb15to16; break;
+ case 0x00100018: conv = rgb24to16; break;
+ case 0x00100020: conv = rgb32to16; break;
+ case 0x0018000F: conv = rgb15to24; break;
+ case 0x00180010: conv = rgb16to24; break;
+ case 0x00180020: conv = rgb32to24; break;
+ case 0x0020000F: conv = rgb15to32; break;
+ case 0x00200010: conv = rgb16to32; break;
+ case 0x00200018: conv = rgb24to32; break;
}
} else if ((isBGRinInt(srcFormat) && isRGBinInt(dstFormat)) ||
(isRGBinInt(srcFormat) && isBGRinInt(dstFormat))) {
- switch (srcId | (dstId << 4)) {
- case 0x33: conv = rgb15tobgr15; break;
- case 0x34: conv = rgb16tobgr15; break;
- case 0x36: conv = rgb24tobgr15; break;
- case 0x38: conv = rgb32tobgr15; break;
- case 0x43: conv = rgb15tobgr16; break;
- case 0x44: conv = rgb16tobgr16; break;
- case 0x46: conv = rgb24tobgr16; break;
- case 0x48: conv = rgb32tobgr16; break;
- case 0x63: conv = rgb15tobgr24; break;
- case 0x64: conv = rgb16tobgr24; break;
- case 0x66: conv = rgb24tobgr24; break;
- case 0x68: conv = rgb32tobgr24; break;
- case 0x83: conv = rgb15tobgr32; break;
- case 0x84: conv = rgb16tobgr32; break;
- case 0x86: conv = rgb24tobgr32; break;
+ switch (srcId | (dstId << 16)) {
+ case 0x000F000F: conv = rgb15tobgr15; break;
+ case 0x000F0010: conv = rgb16tobgr15; break;
+ case 0x000F0018: conv = rgb24tobgr15; break;
+ case 0x000F0020: conv = rgb32tobgr15; break;
+ case 0x0010000F: conv = rgb15tobgr16; break;
+ case 0x00100010: conv = rgb16tobgr16; break;
+ case 0x00100018: conv = rgb24tobgr16; break;
+ case 0x00100020: conv = rgb32tobgr16; break;
+ case 0x0018000F: conv = rgb15tobgr24; break;
+ case 0x00180010: conv = rgb16tobgr24; break;
+ case 0x00180018: conv = rgb24tobgr24; break;
+ case 0x00180020: conv = rgb32tobgr24; break;
+ case 0x0020000F: conv = rgb15tobgr32; break;
+ case 0x00200010: conv = rgb16tobgr32; break;
+ case 0x00200018: conv = rgb24tobgr32; break;
}
}