summaryrefslogtreecommitdiff
path: root/libavfilter/colorspacedsp.c
diff options
context:
space:
mode:
authorRonald S. Bultje <rsbultje@gmail.com>2016-05-03 13:53:17 -0400
committerRonald S. Bultje <rsbultje@gmail.com>2016-05-10 08:37:55 -0400
commit431117dcb55c9bd47febf9ee3379e14a5d6595c8 (patch)
treee4bb5bed1f77a604e4368fbe77267e4fbfb5b91b /libavfilter/colorspacedsp.c
parent9486de5a85f0c54f241849d6b22bee943da557d0 (diff)
vf_colorspace: add floyd-steinberg dithering option to full conversion.
Diffstat (limited to 'libavfilter/colorspacedsp.c')
-rw-r--r--libavfilter/colorspacedsp.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/libavfilter/colorspacedsp.c b/libavfilter/colorspacedsp.c
index d4c43c380f..735e4039a2 100644
--- a/libavfilter/colorspacedsp.c
+++ b/libavfilter/colorspacedsp.c
@@ -20,6 +20,10 @@
#include "colorspacedsp.h"
+/*
+ * SS_W/H stands for "subsampling_w/h"
+ * it's analogous to AVPixFmtDescriptor->log2_chroma_w/h.
+ */
#define SS_W 0
#define SS_H 0
@@ -114,6 +118,15 @@ void ff_colorspacedsp_init(ColorSpaceDSPContext *dsp)
init_rgb2yuv_fn(1, 10);
init_rgb2yuv_fn(2, 12);
+#define init_rgb2yuv_fsb_fn(idx, bit) \
+ dsp->rgb2yuv_fsb[idx][0] = rgb2yuv_fsb_444p##bit##_c; \
+ dsp->rgb2yuv_fsb[idx][1] = rgb2yuv_fsb_422p##bit##_c; \
+ dsp->rgb2yuv_fsb[idx][2] = rgb2yuv_fsb_420p##bit##_c
+
+ init_rgb2yuv_fsb_fn(0, 8);
+ init_rgb2yuv_fsb_fn(1, 10);
+ init_rgb2yuv_fsb_fn(2, 12);
+
#define init_yuv2yuv_fn(idx1, idx2, bit1, bit2) \
dsp->yuv2yuv[idx1][idx2][0] = yuv2yuv_444p##bit1##to##bit2##_c; \
dsp->yuv2yuv[idx1][idx2][1] = yuv2yuv_422p##bit1##to##bit2##_c; \