[FFmpeg-cvslog] swscale/internal: add typedefs for input reading functions

Niklas Haas git at videolan.org
Mon Oct 7 20:52:32 EEST 2024


ffmpeg | branch: master | Niklas Haas <git at haasn.dev> | Tue Oct  1 12:22:16 2024 +0200| [20b350b28488a588b79387926dd623c04af2a116] | committer: Niklas Haas

swscale/internal: add typedefs for input reading functions

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Niklas Haas <git at haasn.dev>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=20b350b28488a588b79387926dd623c04af2a116
---

 libswscale/swscale_internal.h | 47 ++++++++++++++++++++++++++++---------------
 1 file 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;
     /** @} */
 
     /**



More information about the ffmpeg-cvslog mailing list