[FFmpeg-cvslog] swscale/rgb2xyz: expose these functions internally

Niklas Haas git at videolan.org
Wed Oct 9 14:21:35 EEST 2024


ffmpeg | branch: master | Niklas Haas <git at haasn.dev> | Mon Oct  7 19:38:03 2024 +0200| [403a20b2e61e3b164f6729f16e14fdfcee535ee8] | committer: Niklas Haas

swscale/rgb2xyz: expose these functions internally

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=403a20b2e61e3b164f6729f16e14fdfcee535ee8
---

 libswscale/swscale.c          | 12 ++++++------
 libswscale/swscale_internal.h |  6 ++++++
 2 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/libswscale/swscale.c b/libswscale/swscale.c
index 2d7b987071..5f77cad402 100644
--- a/libswscale/swscale.c
+++ b/libswscale/swscale.c
@@ -637,8 +637,8 @@ static int check_image_pointers(const uint8_t * const data[4], enum AVPixelForma
     return 1;
 }
 
-static void xyz12Torgb48(struct SwsContext *c, uint8_t *dst, int dst_stride,
-                         const uint8_t *src, int src_stride, int w, int h)
+void ff_xyz12Torgb48(const SwsContext *c, uint8_t *dst, int dst_stride,
+                     const uint8_t *src, int src_stride, int w, int h)
 {
     const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(c->srcFormat);
 
@@ -696,8 +696,8 @@ static void xyz12Torgb48(struct SwsContext *c, uint8_t *dst, int dst_stride,
     }
 }
 
-static void rgb48Toxyz12(struct SwsContext *c, uint8_t *dst, int dst_stride,
-                         const uint8_t *src, int src_stride, int w, int h)
+void ff_rgb48Toxyz12(const SwsContext *c, uint8_t *dst, int dst_stride,
+                     const uint8_t *src, int src_stride, int w, int h)
 {
     const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(c->dstFormat);
 
@@ -1001,7 +1001,7 @@ static int scale_internal(SwsContext *c,
         base = srcStride[0] < 0 ? c->xyz_scratch - srcStride[0] * (srcSliceH-1) :
                                   c->xyz_scratch;
 
-        xyz12Torgb48(c, base, srcStride[0], src2[0], srcStride[0], c->srcW, srcSliceH);
+        ff_xyz12Torgb48(c, base, srcStride[0], src2[0], srcStride[0], c->srcW, srcSliceH);
         src2[0] = base;
     }
 
@@ -1073,7 +1073,7 @@ static int scale_internal(SwsContext *c,
         }
 
         /* replace on the same data */
-        rgb48Toxyz12(c, dst, dstStride2[0], dst, dstStride2[0], c->dstW, ret);
+        ff_rgb48Toxyz12(c, dst, dstStride2[0], dst, dstStride2[0], c->dstW, ret);
     }
 
     /* reset slice direction at end of frame */
diff --git a/libswscale/swscale_internal.h b/libswscale/swscale_internal.h
index 1a991f11d8..cbafb9c8b4 100644
--- a/libswscale/swscale_internal.h
+++ b/libswscale/swscale_internal.h
@@ -1034,6 +1034,12 @@ void ff_copyPlane(const uint8_t *src, int srcStride,
                   int srcSliceY, int srcSliceH, int width,
                   uint8_t *dst, int dstStride);
 
+void ff_xyz12Torgb48(const SwsContext *c, uint8_t *dst, int dst_stride,
+                     const uint8_t *src, int src_stride, int w, int h);
+
+void ff_rgb48Toxyz12(const SwsContext *c, uint8_t *dst, int dst_stride,
+                     const uint8_t *src, int src_stride, int w, int h);
+
 static inline void fillPlane16(uint8_t *plane, int stride, int width, int height, int y,
                                int alpha, int bits, const int big_endian)
 {



More information about the ffmpeg-cvslog mailing list