1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-21 10:55:51 +02:00

swscale/rgb2xyz: expose these functions internally

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Niklas Haas <git@haasn.dev>
This commit is contained in:
Niklas Haas 2024-10-07 19:38:03 +02:00
parent 775de8c19d
commit 403a20b2e6
2 changed files with 12 additions and 6 deletions

View File

@ -637,7 +637,7 @@ 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,
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,7 +696,7 @@ static void xyz12Torgb48(struct SwsContext *c, uint8_t *dst, int dst_stride,
}
}
static void rgb48Toxyz12(struct SwsContext *c, uint8_t *dst, int dst_stride,
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 */

View File

@ -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)
{