diff options
author | Ronald S. Bultje <rsbultje@gmail.com> | 2016-04-06 14:08:21 -0400 |
---|---|---|
committer | Ronald S. Bultje <rsbultje@gmail.com> | 2016-04-12 16:42:45 -0400 |
commit | 2e2e08a35b479c5a2049a0f7eaf20e00aa78e923 (patch) | |
tree | 9a5368429034d0875dec98b0d230b76eaccd580c /libavfilter/colorspacedsp.h | |
parent | d7815df40285245805d056f6113d5a4b12620c0b (diff) | |
download | ffmpeg-2e2e08a35b479c5a2049a0f7eaf20e00aa78e923.tar.gz |
lavfi: new colorspace conversion filter.
The intent here is similar to colormatrix, but it's LGPLv2.1-or-later
(instead of GPLv2.0) and supports gamma/chromaticity correction.
Diffstat (limited to 'libavfilter/colorspacedsp.h')
-rw-r--r-- | libavfilter/colorspacedsp.h | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/libavfilter/colorspacedsp.h b/libavfilter/colorspacedsp.h new file mode 100644 index 0000000000..357111752b --- /dev/null +++ b/libavfilter/colorspacedsp.h @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2016 Ronald S. Bultje <rsbultje@gmail.com> + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVFILTER_COLORSPACEDSP_H +#define AVFILTER_COLORSPACEDSP_H + +#include <stddef.h> +#include <stdint.h> + +typedef void (*yuv2rgb_fn)(int16_t *rgb[3], ptrdiff_t rgb_stride, + uint8_t *yuv[3], ptrdiff_t yuv_stride[3], + int w, int h, const int16_t yuv2rgb_coeffs[3][3][8], + const int16_t yuv_offset[8]); +typedef void (*rgb2yuv_fn)(uint8_t *yuv[3], ptrdiff_t yuv_stride[3], + int16_t *rgb[3], ptrdiff_t rgb_stride, + int w, int h, const int16_t rgb2yuv_coeffs[3][3][8], + const int16_t yuv_offset[8]); +typedef void (*yuv2yuv_fn)(uint8_t *yuv_out[3], ptrdiff_t yuv_out_stride[3], + uint8_t *yuv_in[3], ptrdiff_t yuv_in_stride[3], + int w, int h, const int16_t yuv2yuv_coeffs[3][3][8], + const int16_t yuv_offset[2][8]); + +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 */]; + yuv2yuv_fn yuv2yuv[3 /* in_depth */][3 /* out_depth */][3 /* 0: 444, 1: 422, 2: 420 */]; + + void (*multiply3x3)(int16_t *data[3], ptrdiff_t stride, + int w, int h, const int16_t m[3][3][8]); +} ColorSpaceDSPContext; + +void ff_colorspacedsp_init(ColorSpaceDSPContext *dsp); + +#endif /* AVFILTER_COLORSPACEDSP_H */ |