aboutsummaryrefslogtreecommitdiffstats
path: root/libswscale/yuv2rgb.c
diff options
context:
space:
mode:
authorNiklas Haas <git@haasn.dev>2024-10-10 12:16:44 +0200
committerNiklas Haas <git@haasn.dev>2024-11-21 12:49:56 +0100
commit2d077f9acda4946b3455ded5778fb3fc7e85bba2 (patch)
tree44ab5d5889e65b4067fbe54f4e7966a31f4c9f13 /libswscale/yuv2rgb.c
parent10d1be262126f1699a89b54cf5f23a5370c57cb5 (diff)
downloadffmpeg-2d077f9acda4946b3455ded5778fb3fc7e85bba2.tar.gz
swscale/internal: group user-facing options together
This is a preliminary step to separating these into a new struct. This commit contains no functional changes, it is a pure search-and-replace. Sponsored-by: Sovereign Tech Fund Signed-off-by: Niklas Haas <git@haasn.dev>
Diffstat (limited to 'libswscale/yuv2rgb.c')
-rw-r--r--libswscale/yuv2rgb.c80
1 files changed, 40 insertions, 40 deletions
diff --git a/libswscale/yuv2rgb.c b/libswscale/yuv2rgb.c
index f4fa1c0549..ff8e013da4 100644
--- a/libswscale/yuv2rgb.c
+++ b/libswscale/yuv2rgb.c
@@ -155,7 +155,7 @@ const int *sws_getCoefficients(int colorspace)
const uint8_t av_unused *pv_1 = src[2] + (y >> !yuv422) * srcStride[2]; \
const uint8_t av_unused *pu_2, *pv_2; \
const uint8_t av_unused *pa_1, *pa_2; \
- unsigned int h_size = c->dstW >> 3; \
+ unsigned int h_size = c->opts.dst_w >> 3; \
if (nb_dst_planes > 1) { \
dst1_1 = (dst_type *)(dst[1] + (yd) * dstStride[1]); \
dst1_2 = (dst_type *)(dst[1] + (yd + 1) * dstStride[1]); \
@@ -195,7 +195,7 @@ const int *sws_getCoefficients(int colorspace)
dst2_2 += dst_delta >> ss; \
} \
} \
- if (c->dstW & (4 >> ss)) { \
+ if (c->opts.dst_w & (4 >> ss)) { \
int av_unused Y, U, V; \
#define ENDYUV2RGBFUNC() \
@@ -485,9 +485,9 @@ YUV2RGBFUNC(yuv2rgb_c_1_ordered_dither, uint8_t, 0, 0, 1)
dst_1 += 1;
dst_2 += 1;
}
- if (c->dstW & 7) {
+ if (c->opts.dst_w & 7) {
int av_unused Y, U, V;
- int pixels_left = c->dstW & 7;
+ int pixels_left = c->opts.dst_w & 7;
const uint8_t *d128 = ff_dither_8x8_220[yd & 7];
char out_1 = 0, out_2 = 0;
g = c->table_gU[128 + YUVRGB_TABLE_HEADROOM] + c->table_gV[128 + YUVRGB_TABLE_HEADROOM];
@@ -575,10 +575,10 @@ SwsFunc ff_yuv2rgb_get_func_ptr(SwsInternal *c)
av_log(c, AV_LOG_WARNING,
"No accelerated colorspace conversion found from %s to %s.\n",
- av_get_pix_fmt_name(c->srcFormat), av_get_pix_fmt_name(c->dstFormat));
+ av_get_pix_fmt_name(c->opts.src_format), av_get_pix_fmt_name(c->opts.dst_format));
- if (c->srcFormat == AV_PIX_FMT_YUV422P) {
- switch (c->dstFormat) {
+ if (c->opts.src_format == AV_PIX_FMT_YUV422P) {
+ switch (c->opts.dst_format) {
case AV_PIX_FMT_BGR48BE:
case AV_PIX_FMT_BGR48LE:
return yuv422p_bgr48_c;
@@ -587,11 +587,11 @@ SwsFunc ff_yuv2rgb_get_func_ptr(SwsInternal *c)
return yuv422p_rgb48_c;
case AV_PIX_FMT_ARGB:
case AV_PIX_FMT_ABGR:
- if (CONFIG_SWSCALE_ALPHA && isALPHA(c->srcFormat))
+ if (CONFIG_SWSCALE_ALPHA && isALPHA(c->opts.src_format))
return yuva422p_argb_c;
case AV_PIX_FMT_RGBA:
case AV_PIX_FMT_BGRA:
- return (CONFIG_SWSCALE_ALPHA && isALPHA(c->srcFormat)) ? yuva422p_rgba_c : yuv422p_rgb32_c;
+ return (CONFIG_SWSCALE_ALPHA && isALPHA(c->opts.src_format)) ? yuva422p_rgba_c : yuv422p_rgb32_c;
case AV_PIX_FMT_RGB24:
return yuv422p_rgb24_c;
case AV_PIX_FMT_BGR24:
@@ -620,7 +620,7 @@ SwsFunc ff_yuv2rgb_get_func_ptr(SwsInternal *c)
return yuv422p_gbrp_c;
}
} else {
- switch (c->dstFormat) {
+ switch (c->opts.dst_format) {
case AV_PIX_FMT_BGR48BE:
case AV_PIX_FMT_BGR48LE:
return yuv2rgb_c_bgr48;
@@ -629,11 +629,11 @@ SwsFunc ff_yuv2rgb_get_func_ptr(SwsInternal *c)
return yuv2rgb_c_48;
case AV_PIX_FMT_ARGB:
case AV_PIX_FMT_ABGR:
- if (CONFIG_SWSCALE_ALPHA && isALPHA(c->srcFormat))
+ if (CONFIG_SWSCALE_ALPHA && isALPHA(c->opts.src_format))
return yuva2argb_c;
case AV_PIX_FMT_RGBA:
case AV_PIX_FMT_BGRA:
- return (CONFIG_SWSCALE_ALPHA && isALPHA(c->srcFormat)) ? yuva2rgba_c : yuv2rgb_c_32;
+ return (CONFIG_SWSCALE_ALPHA && isALPHA(c->opts.src_format)) ? yuva2rgba_c : yuv2rgb_c_32;
case AV_PIX_FMT_RGB24:
return yuv2rgb_c_24_rgb;
case AV_PIX_FMT_BGR24:
@@ -706,29 +706,29 @@ av_cold int ff_yuv2rgb_c_init_tables(SwsInternal *c, const int inv_table[4],
int fullRange, int brightness,
int contrast, int saturation)
{
- const int isRgb = c->dstFormat == AV_PIX_FMT_RGB32 ||
- c->dstFormat == AV_PIX_FMT_RGB32_1 ||
- c->dstFormat == AV_PIX_FMT_BGR24 ||
- c->dstFormat == AV_PIX_FMT_RGB565BE ||
- c->dstFormat == AV_PIX_FMT_RGB565LE ||
- c->dstFormat == AV_PIX_FMT_RGB555BE ||
- c->dstFormat == AV_PIX_FMT_RGB555LE ||
- c->dstFormat == AV_PIX_FMT_RGB444BE ||
- c->dstFormat == AV_PIX_FMT_RGB444LE ||
- c->dstFormat == AV_PIX_FMT_X2RGB10BE ||
- c->dstFormat == AV_PIX_FMT_X2RGB10LE ||
- c->dstFormat == AV_PIX_FMT_RGB8 ||
- c->dstFormat == AV_PIX_FMT_RGB4 ||
- c->dstFormat == AV_PIX_FMT_RGB4_BYTE ||
- c->dstFormat == AV_PIX_FMT_MONOBLACK;
- const int isNotNe = c->dstFormat == AV_PIX_FMT_NE(RGB565LE, RGB565BE) ||
- c->dstFormat == AV_PIX_FMT_NE(RGB555LE, RGB555BE) ||
- c->dstFormat == AV_PIX_FMT_NE(RGB444LE, RGB444BE) ||
- c->dstFormat == AV_PIX_FMT_NE(BGR565LE, BGR565BE) ||
- c->dstFormat == AV_PIX_FMT_NE(BGR555LE, BGR555BE) ||
- c->dstFormat == AV_PIX_FMT_NE(BGR444LE, BGR444BE) ||
- c->dstFormat == AV_PIX_FMT_NE(X2RGB10LE, X2RGB10BE) ||
- c->dstFormat == AV_PIX_FMT_NE(X2BGR10LE, X2BGR10BE);
+ const int isRgb = c->opts.dst_format == AV_PIX_FMT_RGB32 ||
+ c->opts.dst_format == AV_PIX_FMT_RGB32_1 ||
+ c->opts.dst_format == AV_PIX_FMT_BGR24 ||
+ c->opts.dst_format == AV_PIX_FMT_RGB565BE ||
+ c->opts.dst_format == AV_PIX_FMT_RGB565LE ||
+ c->opts.dst_format == AV_PIX_FMT_RGB555BE ||
+ c->opts.dst_format == AV_PIX_FMT_RGB555LE ||
+ c->opts.dst_format == AV_PIX_FMT_RGB444BE ||
+ c->opts.dst_format == AV_PIX_FMT_RGB444LE ||
+ c->opts.dst_format == AV_PIX_FMT_X2RGB10BE ||
+ c->opts.dst_format == AV_PIX_FMT_X2RGB10LE ||
+ c->opts.dst_format == AV_PIX_FMT_RGB8 ||
+ c->opts.dst_format == AV_PIX_FMT_RGB4 ||
+ c->opts.dst_format == AV_PIX_FMT_RGB4_BYTE ||
+ c->opts.dst_format == AV_PIX_FMT_MONOBLACK;
+ const int isNotNe = c->opts.dst_format == AV_PIX_FMT_NE(RGB565LE, RGB565BE) ||
+ c->opts.dst_format == AV_PIX_FMT_NE(RGB555LE, RGB555BE) ||
+ c->opts.dst_format == AV_PIX_FMT_NE(RGB444LE, RGB444BE) ||
+ c->opts.dst_format == AV_PIX_FMT_NE(BGR565LE, BGR565BE) ||
+ c->opts.dst_format == AV_PIX_FMT_NE(BGR555LE, BGR555BE) ||
+ c->opts.dst_format == AV_PIX_FMT_NE(BGR444LE, BGR444BE) ||
+ c->opts.dst_format == AV_PIX_FMT_NE(X2RGB10LE, X2RGB10BE) ||
+ c->opts.dst_format == AV_PIX_FMT_NE(X2BGR10LE, X2BGR10BE);
const int bpp = c->dstFormatBpp;
uint8_t *y_table;
uint16_t *y_table16;
@@ -904,7 +904,7 @@ av_cold int ff_yuv2rgb_c_init_tables(SwsInternal *c, const int inv_table[4],
rbase = isRgb ? 20 : 0;
gbase = 10;
bbase = isRgb ? 0 : 20;
- needAlpha = CONFIG_SWSCALE_ALPHA && isALPHA(c->srcFormat);
+ needAlpha = CONFIG_SWSCALE_ALPHA && isALPHA(c->opts.src_format);
if (!needAlpha)
abase = 30;
ALLOC_YUV_TABLE(table_plane_size * 3 * 4);
@@ -928,12 +928,12 @@ av_cold int ff_yuv2rgb_c_init_tables(SwsInternal *c, const int inv_table[4],
break;
case 32:
case 64:
- base = (c->dstFormat == AV_PIX_FMT_RGB32_1 ||
- c->dstFormat == AV_PIX_FMT_BGR32_1) ? 8 : 0;
+ base = (c->opts.dst_format == AV_PIX_FMT_RGB32_1 ||
+ c->opts.dst_format == AV_PIX_FMT_BGR32_1) ? 8 : 0;
rbase = base + (isRgb ? 16 : 0);
gbase = base + 8;
bbase = base + (isRgb ? 0 : 16);
- needAlpha = CONFIG_SWSCALE_ALPHA && isALPHA(c->srcFormat);
+ needAlpha = CONFIG_SWSCALE_ALPHA && isALPHA(c->opts.src_format);
if (!needAlpha)
abase = (base + 24) & 31;
ALLOC_YUV_TABLE(table_plane_size * 3 * 4);
@@ -953,7 +953,7 @@ av_cold int ff_yuv2rgb_c_init_tables(SwsInternal *c, const int inv_table[4],
fill_gv_table(c->table_gV, 4, cgv);
break;
default:
- if(!isPlanar(c->dstFormat) || bpp <= 24)
+ if(!isPlanar(c->opts.dst_format) || bpp <= 24)
av_log(c, AV_LOG_ERROR, "%ibpp not supported by yuv2rgb\n", bpp);
return AVERROR(EINVAL);
}