diff options
Diffstat (limited to 'libavfilter/colorspacedsp.h')
-rw-r--r-- | libavfilter/colorspacedsp.h | 31 |
1 files changed, 27 insertions, 4 deletions
diff --git a/libavfilter/colorspacedsp.h b/libavfilter/colorspacedsp.h index 7a64f9dfa5..a81e4f0a52 100644 --- a/libavfilter/colorspacedsp.h +++ b/libavfilter/colorspacedsp.h @@ -42,12 +42,35 @@ typedef void (*yuv2yuv_fn)(uint8_t *yuv_out[3], const ptrdiff_t yuv_out_stride[3 int w, int h, const int16_t yuv2yuv_coeffs[3][3][8], const int16_t yuv_offset[2][8]); +enum BitDepthIndex { + BPP_8, + BPP_10, + BPP_12, + NB_BPP, +}; + +enum ChromaSubsamplingIndex { + SS_444, + SS_422, + SS_420, + NB_SS, +}; + typedef struct ColorSpaceDSPContext { - yuv2rgb_fn yuv2rgb[3 /* 0: 8bit, 1: 10bit, 2: 12bit */][3 /* 0: 444, 1: 422, 2: 420 */]; - rgb2yuv_fn rgb2yuv[3 /* 0: 8bit, 1: 10bit, 2: 12bit */][3 /* 0: 444, 1: 422, 2: 420 */]; - rgb2yuv_fsb_fn rgb2yuv_fsb[3 /* 0: 8bit, 1: 10bit, 2: 12bit */][3 /* 0: 444, 1: 422, 2: 420 */]; - yuv2yuv_fn yuv2yuv[3 /* in_depth */][3 /* out_depth */][3 /* 0: 444, 1: 422, 2: 420 */]; + /* Convert input YUV pixel buffer from a user into an internal, 15bpp array + * of intermediate RGB data. */ + yuv2rgb_fn yuv2rgb[NB_BPP][NB_SS]; + /* Convert intermediate RGB data (15bpp, internal format) into YUV data and + * store into user-provided output buffer */ + rgb2yuv_fn rgb2yuv[NB_BPP][NB_SS]; + /* Same as rgb2yuv(), but use floyd-steinberg dithering */ + rgb2yuv_fsb_fn rgb2yuv_fsb[NB_BPP][NB_SS]; + /* Direct yuv-to-yuv conversion (input and output are both user-provided + * buffers) */ + yuv2yuv_fn yuv2yuv[NB_BPP /* in */][NB_BPP /* out */][NB_SS]; + /* In-place 3x3 matrix multiplication. Input and output are both 15bpp + * (our internal data format) */ void (*multiply3x3)(int16_t *data[3], ptrdiff_t stride, int w, int h, const int16_t m[3][3][8]); } ColorSpaceDSPContext; |