summaryrefslogtreecommitdiff
path: root/libswscale/rgb2rgb_template.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-11-19 14:17:26 +0100
committerMichael Niedermayer <michaelni@gmx.at>2013-11-19 15:13:48 +0100
commitef627bf9ecddfa888d4c6e4fd633852798c3b4a9 (patch)
treeacda9d2b5e84c4435999c1b7d4462f2a951c4215 /libswscale/rgb2rgb_template.c
parent722fb81dc5c8546eb6498629db7c8ebe2f9545c2 (diff)
swscale: add nv12/nv21->yuv420 converter
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libswscale/rgb2rgb_template.c')
-rw-r--r--libswscale/rgb2rgb_template.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/libswscale/rgb2rgb_template.c b/libswscale/rgb2rgb_template.c
index 98e3a1472e..56e735f6ca 100644
--- a/libswscale/rgb2rgb_template.c
+++ b/libswscale/rgb2rgb_template.c
@@ -693,6 +693,24 @@ static void interleaveBytes_c(const uint8_t *src1, const uint8_t *src2,
}
}
+static void deinterleaveBytes_c(const uint8_t *src, uint8_t *dst1, uint8_t *dst2,
+ int width, int height, int srcStride,
+ int dst1Stride, int dst2Stride)
+{
+ int h;
+
+ for (h = 0; h < height; h++) {
+ int w;
+ for (w = 0; w < width; w++) {
+ dst1[w] = src[2 * w + 0];
+ dst2[w] = src[2 * w + 1];
+ }
+ src += srcStride;
+ dst1 += dst1Stride;
+ dst2 += dst2Stride;
+ }
+}
+
static inline void vu9_to_vu12_c(const uint8_t *src1, const uint8_t *src2,
uint8_t *dst1, uint8_t *dst2,
int width, int height,
@@ -922,6 +940,7 @@ static av_cold void rgb2rgb_init_c(void)
planar2x = planar2x_c;
ff_rgb24toyv12 = ff_rgb24toyv12_c;
interleaveBytes = interleaveBytes_c;
+ deinterleaveBytes = deinterleaveBytes_c;
vu9_to_vu12 = vu9_to_vu12_c;
yvu9_to_yuy2 = yvu9_to_yuy2_c;