diff options
author | Paul B Mahol <onemda@gmail.com> | 2012-01-10 02:54:34 +0000 |
---|---|---|
committer | Ronald S. Bultje <rsbultje@gmail.com> | 2012-01-09 20:09:41 -0800 |
commit | 0b8b3387a977dcdb6fb9e53bcc9966d34b2e4cec (patch) | |
tree | 0ef77d62b6dbca3da6c63f9e7f8fead08eaaa2c4 /libswscale | |
parent | 0c50edb789c6489aad477d19bab5b06b01a36d91 (diff) | |
download | ffmpeg-0b8b3387a977dcdb6fb9e53bcc9966d34b2e4cec.tar.gz |
rgb2rgb: allow conversion for <15 bpp
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
Diffstat (limited to 'libswscale')
-rw-r--r-- | libswscale/swscale_unscaled.c | 62 |
1 files changed, 31 insertions, 31 deletions
diff --git a/libswscale/swscale_unscaled.c b/libswscale/swscale_unscaled.c index 7c339b6c05..57695483ea 100644 --- a/libswscale/swscale_unscaled.c +++ b/libswscale/swscale_unscaled.c @@ -360,8 +360,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) @@ -383,38 +383,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; } } |