Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2012-01-10 21:29:16 +0400
committerPaul B Mahol <onemda@gmail.com>2012-01-10 22:00:38 +0400
commit4ad40d6d9f489aed3e4b283c640e81585686e4a1 (patch)
treec797923978d1eb8a4e65f556d6d7c7a4b4928b44 /libswscale/rgb2rgb.c
parent277030627d847d1478fe0d64fe7fdeb8fb7d837a (diff)
rgb2rgb: rgb12tobgr12()
Diffstat (limited to 'libswscale/rgb2rgb.c')
-rw-r--r--libswscale/rgb2rgb.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/libswscale/rgb2rgb.c b/libswscale/rgb2rgb.c
index 5b84f89ec5..c6c1ebaaa5 100644
--- a/libswscale/rgb2rgb.c
+++ b/libswscale/rgb2rgb.c
@@ -282,6 +282,19 @@ void rgb15tobgr15(const uint8_t *src, uint8_t *dst, int src_size)
}
}
+void rgb12tobgr12(const uint8_t *src, uint8_t *dst, int src_size)
+{
+ int i;
+ int num_pixels = src_size >> 1;
+
+ for (i = 0; i < num_pixels; i++) {
+ unsigned br;
+ unsigned rgb = ((const uint16_t *)src)[i];
+ br = rgb & 0x0F0F;
+ ((uint16_t *)dst)[i] = (br >> 8) | (rgb & 0x00F0) | (br << 8);
+ }
+}
+
void bgr8torgb8(const uint8_t *src, uint8_t *dst, int src_size)
{
int i;