diff options
author | Niklas Haas <git@haasn.dev> | 2024-10-01 12:22:16 +0200 |
---|---|---|
committer | Niklas Haas <git@haasn.dev> | 2024-10-07 19:51:34 +0200 |
commit | 20b350b28488a588b79387926dd623c04af2a116 (patch) | |
tree | 47b84ae725c2d01e2c533ab92c1cf764a861c63e | |
parent | b90d522d2c6a05b26fe7c4f0198740b630bea94d (diff) | |
download | ffmpeg-20b350b28488a588b79387926dd623c04af2a116.tar.gz |
swscale/internal: add typedefs for input reading functions
Sponsored-by: Sovereign Tech Fund
Signed-off-by: Niklas Haas <git@haasn.dev>
-rw-r--r-- | libswscale/swscale_internal.h | 47 |
1 files changed, 31 insertions, 16 deletions
diff --git a/libswscale/swscale_internal.h b/libswscale/swscale_internal.h index 804fd12bdb..c734a49617 100644 --- a/libswscale/swscale_internal.h +++ b/libswscale/swscale_internal.h @@ -292,6 +292,31 @@ typedef void (*yuv2anyX_fn)(struct SwsContext *c, const int16_t *lumFilter, const int16_t **alpSrc, uint8_t **dest, int dstW, int y); +/** + * Unscaled conversion of luma/alpha plane to YV12 for horizontal scaler. + */ +typedef void (*planar1_YV12_fn)(uint8_t *dst, const uint8_t *src, const uint8_t *src2, + const uint8_t *src3, int width, uint32_t *pal, + void *opaque); + +/** + * Unscaled conversion of chroma plane to YV12 for horizontal scaler. + */ +typedef void (*planar2_YV12_fn)(uint8_t *dst, uint8_t *dst2, const uint8_t *src, + const uint8_t *src2, const uint8_t *src3, + int width, uint32_t *pal, void *opaque); + +/** + * Unscaled conversion of arbitrary planar data (e.g. RGBA) to YV12, through + * conversion using the given color matrix. + */ +typedef void (*planarX_YV12_fn)(uint8_t *dst, const uint8_t *src[4], int width, + int32_t *rgb2yuv, void *opaque); + +typedef void (*planarX2_YV12_fn)(uint8_t *dst, uint8_t *dst2, + const uint8_t *src[4], int width, + int32_t *rgb2yuv, void *opaque); + struct SwsSlice; struct SwsFilterDescriptor; @@ -561,28 +586,18 @@ struct SwsContext { /// Opaque data pointer passed to all input functions. void *input_opaque; - /// Unscaled conversion of luma plane to YV12 for horizontal scaler. - void (*lumToYV12)(uint8_t *dst, const uint8_t *src, const uint8_t *src2, const uint8_t *src3, - int width, uint32_t *pal, void *opq); - /// Unscaled conversion of alpha plane to YV12 for horizontal scaler. - void (*alpToYV12)(uint8_t *dst, const uint8_t *src, const uint8_t *src2, const uint8_t *src3, - int width, uint32_t *pal, void *opq); - /// Unscaled conversion of chroma planes to YV12 for horizontal scaler. - void (*chrToYV12)(uint8_t *dstU, uint8_t *dstV, - const uint8_t *src1, const uint8_t *src2, const uint8_t *src3, - int width, uint32_t *pal, void *opq); + planar1_YV12_fn lumToYV12; + planar1_YV12_fn alpToYV12; + planar2_YV12_fn chrToYV12; /** * Functions to read planar input, such as planar RGB, and convert * internally to Y/UV/A. */ /** @{ */ - void (*readLumPlanar)(uint8_t *dst, const uint8_t *src[4], int width, int32_t *rgb2yuv, - void *opq); - void (*readChrPlanar)(uint8_t *dstU, uint8_t *dstV, const uint8_t *src[4], - int width, int32_t *rgb2yuv, void *opq); - void (*readAlpPlanar)(uint8_t *dst, const uint8_t *src[4], int width, int32_t *rgb2yuv, - void *opq); + planarX_YV12_fn readLumPlanar; + planarX_YV12_fn readAlpPlanar; + planarX2_YV12_fn readChrPlanar; /** @} */ /** |