Browse Source

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>
Niklas Haas 5 months ago
parent
commit
2d077f9acd

+ 14 - 14
libswscale/aarch64/swscale.c

@@ -45,11 +45,11 @@ static void ff_hscale16to15_4_neon(SwsInternal *c, int16_t *_dst, int dstW,
                       const uint8_t *_src, const int16_t *filter,
                       const int32_t *filterPos, int filterSize)
 {
-    const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(c->srcFormat);
+    const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(c->opts.src_format);
     int sh              = desc->comp[0].depth - 1;
 
     if (sh<15) {
-        sh = isAnyRGB(c->srcFormat) || c->srcFormat==AV_PIX_FMT_PAL8 ? 13 : (desc->comp[0].depth - 1);
+        sh = isAnyRGB(c->opts.src_format) || c->opts.src_format==AV_PIX_FMT_PAL8 ? 13 : (desc->comp[0].depth - 1);
     } else if (desc->flags & AV_PIX_FMT_FLAG_FLOAT) { /* float input are process like uint 16bpc */
         sh = 16 - 1;
     }
@@ -61,11 +61,11 @@ static void ff_hscale16to15_X8_neon(SwsInternal *c, int16_t *_dst, int dstW,
                       const uint8_t *_src, const int16_t *filter,
                       const int32_t *filterPos, int filterSize)
 {
-    const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(c->srcFormat);
+    const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(c->opts.src_format);
     int sh              = desc->comp[0].depth - 1;
 
     if (sh<15) {
-        sh = isAnyRGB(c->srcFormat) || c->srcFormat==AV_PIX_FMT_PAL8 ? 13 : (desc->comp[0].depth - 1);
+        sh = isAnyRGB(c->opts.src_format) || c->opts.src_format==AV_PIX_FMT_PAL8 ? 13 : (desc->comp[0].depth - 1);
     } else if (desc->flags & AV_PIX_FMT_FLAG_FLOAT) { /* float input are process like uint 16bpc */
         sh = 16 - 1;
     }
@@ -77,11 +77,11 @@ static void ff_hscale16to15_X4_neon(SwsInternal *c, int16_t *_dst, int dstW,
                       const uint8_t *_src, const int16_t *filter,
                       const int32_t *filterPos, int filterSize)
 {
-    const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(c->srcFormat);
+    const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(c->opts.src_format);
     int sh              = desc->comp[0].depth - 1;
 
     if (sh<15) {
-        sh = isAnyRGB(c->srcFormat) || c->srcFormat==AV_PIX_FMT_PAL8 ? 13 : (desc->comp[0].depth - 1);
+        sh = isAnyRGB(c->opts.src_format) || c->opts.src_format==AV_PIX_FMT_PAL8 ? 13 : (desc->comp[0].depth - 1);
     } else if (desc->flags & AV_PIX_FMT_FLAG_FLOAT) { /* float input are process like uint 16bpc */
         sh = 16 - 1;
     }
@@ -92,11 +92,11 @@ static void ff_hscale16to19_4_neon(SwsInternal *c, int16_t *_dst, int dstW,
                            const uint8_t *_src, const int16_t *filter,
                            const int32_t *filterPos, int filterSize)
 {
-    const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(c->srcFormat);
+    const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(c->opts.src_format);
     int bits            = desc->comp[0].depth - 1;
     int sh              = bits - 4;
 
-    if ((isAnyRGB(c->srcFormat) || c->srcFormat==AV_PIX_FMT_PAL8) && desc->comp[0].depth<16) {
+    if ((isAnyRGB(c->opts.src_format) || c->opts.src_format==AV_PIX_FMT_PAL8) && desc->comp[0].depth<16) {
         sh = 9;
     } else if (desc->flags & AV_PIX_FMT_FLAG_FLOAT) { /* float input are process like uint 16bpc */
         sh = 16 - 1 - 4;
@@ -110,11 +110,11 @@ static void ff_hscale16to19_X8_neon(SwsInternal *c, int16_t *_dst, int dstW,
                            const uint8_t *_src, const int16_t *filter,
                            const int32_t *filterPos, int filterSize)
 {
-    const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(c->srcFormat);
+    const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(c->opts.src_format);
     int bits            = desc->comp[0].depth - 1;
     int sh              = bits - 4;
 
-    if ((isAnyRGB(c->srcFormat) || c->srcFormat==AV_PIX_FMT_PAL8) && desc->comp[0].depth<16) {
+    if ((isAnyRGB(c->opts.src_format) || c->opts.src_format==AV_PIX_FMT_PAL8) && desc->comp[0].depth<16) {
         sh = 9;
     } else if (desc->flags & AV_PIX_FMT_FLAG_FLOAT) { /* float input are process like uint 16bpc */
         sh = 16 - 1 - 4;
@@ -128,11 +128,11 @@ static void ff_hscale16to19_X4_neon(SwsInternal *c, int16_t *_dst, int dstW,
                            const uint8_t *_src, const int16_t *filter,
                            const int32_t *filterPos, int filterSize)
 {
-    const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(c->srcFormat);
+    const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(c->opts.src_format);
     int bits            = desc->comp[0].depth - 1;
     int sh              = bits - 4;
 
-    if ((isAnyRGB(c->srcFormat) || c->srcFormat==AV_PIX_FMT_PAL8) && desc->comp[0].depth<16) {
+    if ((isAnyRGB(c->opts.src_format) || c->opts.src_format==AV_PIX_FMT_PAL8) && desc->comp[0].depth<16) {
         sh = 9;
     } else if (desc->flags & AV_PIX_FMT_FLAG_FLOAT) { /* float input are process like uint 16bpc */
         sh = 16 - 1 - 4;
@@ -229,7 +229,7 @@ av_cold void ff_sws_init_range_convert_aarch64(SwsInternal *c)
 
     if (have_neon(cpu_flags)) {
         if (c->dstBpc <= 14) {
-            if (c->srcRange) {
+            if (c->opts.src_range) {
                 c->lumConvertRange = ff_lumRangeFromJpeg_neon;
                 c->chrConvertRange = ff_chrRangeFromJpeg_neon;
             } else {
@@ -251,7 +251,7 @@ av_cold void ff_sws_init_swscale_aarch64(SwsInternal *c)
         if (c->dstBpc == 8) {
             c->yuv2planeX = ff_yuv2planeX_8_neon;
         }
-        switch (c->srcFormat) {
+        switch (c->opts.src_format) {
         case AV_PIX_FMT_ABGR:
             c->lumToYV12 = ff_abgr32ToY_neon;
             if (c->chrSrcHSubSample)

+ 18 - 16
libswscale/aarch64/swscale_unscaled.c

@@ -43,7 +43,7 @@ static int ifmt##_to_##ofmt##_neon_wrapper(SwsInternal *c, const uint8_t *const
                                            const int dstStride[]) {                         \
     const int16_t yuv2rgb_table[] = { YUV_TO_RGB_TABLE };                                   \
                                                                                             \
-    return ff_##ifmt##_to_##ofmt##_neon(c->srcW, srcSliceH,                                 \
+    return ff_##ifmt##_to_##ofmt##_neon(c->opts.src_w, srcSliceH,                           \
                                         dst[0] + srcSliceY * dstStride[0], dstStride[0],    \
                                         src[0], srcStride[0],                               \
                                         src[1], srcStride[1],                               \
@@ -71,7 +71,7 @@ static int ifmt##_to_##ofmt##_neon_wrapper(SwsInternal *c, const uint8_t *const
                                            const int dstStride[]) {                         \
     const int16_t yuv2rgb_table[] = { YUV_TO_RGB_TABLE };                                   \
                                                                                             \
-    return ff_##ifmt##_to_##ofmt##_neon(c->srcW, srcSliceH,                                 \
+    return ff_##ifmt##_to_##ofmt##_neon(c->opts.src_w, srcSliceH,                           \
                                         dst[0] + srcSliceY * dstStride[0], dstStride[0],    \
                                         src[0], srcStride[0],                               \
                                         src[1], srcStride[1],                               \
@@ -108,7 +108,7 @@ static int ifmt##_to_##ofmt##_neon_wrapper(SwsInternal *c, const uint8_t *const
                                            const int dstStride[]) {                         \
     const int16_t yuv2rgb_table[] = { YUV_TO_RGB_TABLE };                                   \
                                                                                             \
-    return ff_##ifmt##_to_##ofmt##_neon(c->srcW, srcSliceH,                                 \
+    return ff_##ifmt##_to_##ofmt##_neon(c->opts.src_w, srcSliceH,                           \
                                         dst[0] + srcSliceY * dstStride[0], dstStride[0],    \
                                         src[0], srcStride[0], src[1], srcStride[1],         \
                                         yuv2rgb_table,                                      \
@@ -133,7 +133,7 @@ static int ifmt##_to_##ofmt##_neon_wrapper(SwsInternal *c, const uint8_t *const
                                            const int dstStride[]) {                         \
     const int16_t yuv2rgb_table[] = { YUV_TO_RGB_TABLE };                                   \
                                                                                             \
-    return ff_##ifmt##_to_##ofmt##_neon(c->srcW, srcSliceH,                                 \
+    return ff_##ifmt##_to_##ofmt##_neon(c->opts.src_w, srcSliceH,                           \
                                         dst[0] + srcSliceY * dstStride[0], dstStride[0],    \
                                         src[0], srcStride[0], src[1], srcStride[1],         \
                                         yuv2rgb_table,                                      \
@@ -155,15 +155,17 @@ static int nv24_to_yuv420p_neon_wrapper(SwsInternal *c, const uint8_t *const src
     uint8_t *dst1 = dst[1] + dstStride[1] * srcSliceY / 2;
     uint8_t *dst2 = dst[2] + dstStride[2] * srcSliceY / 2;
 
-    ff_copyPlane(src[0], srcStride[0], srcSliceY, srcSliceH, c->srcW,
+    ff_copyPlane(src[0], srcStride[0], srcSliceY, srcSliceH, c->opts.src_w,
                  dst[0], dstStride[0]);
 
-    if (c->srcFormat == AV_PIX_FMT_NV24)
+    if (c->opts.src_format == AV_PIX_FMT_NV24)
         ff_nv24_to_yuv420p_chroma_neon(dst1, dstStride[1], dst2, dstStride[2],
-                                       src[1], srcStride[1], c->srcW / 2, srcSliceH);
+                                       src[1], srcStride[1], c->opts.src_w / 2,
+                                       srcSliceH);
     else
         ff_nv24_to_yuv420p_chroma_neon(dst2, dstStride[2], dst1, dstStride[1],
-                                       src[1], srcStride[1], c->srcW / 2, srcSliceH);
+                                       src[1], srcStride[1], c->opts.src_w / 2,
+                                       srcSliceH);
 
     return srcSliceH;
 }
@@ -183,10 +185,10 @@ DECLARE_FF_NVX_TO_ALL_RGBX_FUNCS(nv21)
  * assembly might be writing as much as 4*15=60 extra bytes at the end of the
  * line, which won't fit the 32-bytes buffer alignment. */
 #define SET_FF_NVX_TO_RGBX_FUNC(ifmt, IFMT, ofmt, OFMT, accurate_rnd) do {                  \
-    if (c->srcFormat == AV_PIX_FMT_##IFMT                                                   \
-        && c->dstFormat == AV_PIX_FMT_##OFMT                                                \
-        && !(c->srcH & 1)                                                                   \
-        && !(c->srcW & 15)                                                                  \
+    if (c->opts.src_format == AV_PIX_FMT_##IFMT                                             \
+        && c->opts.dst_format == AV_PIX_FMT_##OFMT                                          \
+        && !(c->opts.src_h & 1)                                                             \
+        && !(c->opts.src_w & 15)                                                            \
         && !accurate_rnd)                                                                   \
         c->convert_unscaled = ifmt##_to_##ofmt##_neon_wrapper;                              \
 } while (0)
@@ -200,16 +202,16 @@ DECLARE_FF_NVX_TO_ALL_RGBX_FUNCS(nv21)
 } while (0)
 
 static void get_unscaled_swscale_neon(SwsInternal *c) {
-    int accurate_rnd = c->flags & SWS_ACCURATE_RND;
+    int accurate_rnd = c->opts.flags & SWS_ACCURATE_RND;
 
     SET_FF_NVX_TO_ALL_RGBX_FUNC(nv12, NV12, accurate_rnd);
     SET_FF_NVX_TO_ALL_RGBX_FUNC(nv21, NV21, accurate_rnd);
     SET_FF_NVX_TO_ALL_RGBX_FUNC(yuv420p, YUV420P, accurate_rnd);
     SET_FF_NVX_TO_ALL_RGBX_FUNC(yuv422p, YUV422P, accurate_rnd);
 
-    if (c->dstFormat == AV_PIX_FMT_YUV420P &&
-        (c->srcFormat == AV_PIX_FMT_NV24 || c->srcFormat == AV_PIX_FMT_NV42) &&
-        !(c->srcH & 1) && !(c->srcW & 15) && !accurate_rnd)
+    if (c->opts.dst_format == AV_PIX_FMT_YUV420P &&
+        (c->opts.src_format == AV_PIX_FMT_NV24 || c->opts.src_format == AV_PIX_FMT_NV42) &&
+        !(c->opts.src_h & 1) && !(c->opts.src_w & 15) && !accurate_rnd)
         c->convert_unscaled = nv24_to_yuv420p_neon_wrapper;
 }
 

+ 8 - 8
libswscale/alphablend.c

@@ -24,10 +24,10 @@ int ff_sws_alphablendaway(SwsInternal *c, const uint8_t *const src[],
                           const int srcStride[], int srcSliceY, int srcSliceH,
                           uint8_t *const dst[], const int dstStride[])
 {
-    const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(c->srcFormat);
+    const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(c->opts.src_format);
     int nb_components = desc->nb_components;
     int plane, x, ysrc;
-    int plane_count = isGray(c->srcFormat) ? 1 : 3;
+    int plane_count = isGray(c->opts.src_format) ? 1 : 3;
     int sixteen_bits = desc->comp[0].depth >= 9;
     unsigned off    = 1<<(desc->comp[0].depth - 1);
     unsigned shift  = desc->comp[0].depth;
@@ -36,7 +36,7 @@ int ff_sws_alphablendaway(SwsInternal *c, const uint8_t *const src[],
 
     for (plane = 0; plane < plane_count; plane++) {
         int a = 0, b = 0;
-        if (c->alphablend == SWS_ALPHA_BLEND_CHECKERBOARD) {
+        if (c->opts.alpha_blend == SWS_ALPHA_BLEND_CHECKERBOARD) {
             a = (1<<(desc->comp[0].depth - 1))/2;
             b = 3*(1<<(desc->comp[0].depth-1))/2;
         }
@@ -47,7 +47,7 @@ int ff_sws_alphablendaway(SwsInternal *c, const uint8_t *const src[],
     av_assert0(plane_count == nb_components - 1);
     if (desc->flags & AV_PIX_FMT_FLAG_PLANAR) {
         for (plane = 0; plane < plane_count; plane++) {
-            int w = plane ? c->chrSrcW : c->srcW;
+            int w = plane ? c->chrSrcW : c->opts.src_w;
             int x_subsample = plane ? desc->log2_chroma_w: 0;
             int y_subsample = plane ? desc->log2_chroma_h: 0;
             for (ysrc = 0; ysrc < AV_CEIL_RSHIFT(srcSliceH, y_subsample); ysrc++) {
@@ -60,7 +60,7 @@ int ff_sws_alphablendaway(SwsInternal *c, const uint8_t *const src[],
                         const uint16_t *s = (const uint16_t *)(src[plane      ] +  srcStride[plane      ] * ysrc);
                         const uint16_t *a = (const uint16_t *)(src[plane_count] + (srcStride[plane_count] * ysrc << y_subsample));
                               uint16_t *d = (      uint16_t *)(dst[plane      ] +  dstStride[plane      ] * y);
-                        if ((!isBE(c->srcFormat)) == !HAVE_BIGENDIAN) {
+                        if ((!isBE(c->opts.src_format)) == !HAVE_BIGENDIAN) {
                             for (x = 0; x < w; x++) {
                                 if (y_subsample) {
                                     alpha = (a[2*x]              + a[2*x + 1] + 2 +
@@ -101,7 +101,7 @@ int ff_sws_alphablendaway(SwsInternal *c, const uint8_t *const src[],
                     const uint16_t *s = (const uint16_t *)(src[plane      ] + srcStride[plane      ] * ysrc);
                     const uint16_t *a = (const uint16_t *)(src[plane_count] + srcStride[plane_count] * ysrc);
                           uint16_t *d = (      uint16_t *)(dst[plane      ] + dstStride[plane      ] * y);
-                    if ((!isBE(c->srcFormat)) == !HAVE_BIGENDIAN) {
+                    if ((!isBE(c->opts.src_format)) == !HAVE_BIGENDIAN) {
                         for (x = 0; x < w; x++) {
                             unsigned u = s[x]*a[x] + target_table[((x^y)>>5)&1][plane]*(max-a[x]) + off;
                             d[x] = av_clip((u + (u >> shift)) >> shift, 0, max);
@@ -127,14 +127,14 @@ int ff_sws_alphablendaway(SwsInternal *c, const uint8_t *const src[],
         }
     } else {
         int alpha_pos = desc->comp[plane_count].offset;
-        int w = c->srcW;
+        int w = c->opts.src_w;
         for (ysrc = 0; ysrc < srcSliceH; ysrc++) {
             int y = ysrc + srcSliceY;
             if (sixteen_bits) {
                 const uint16_t *s = (const uint16_t *)(src[0] + srcStride[0] * ysrc + 2*!alpha_pos);
                 const uint16_t *a = (const uint16_t *)(src[0] + srcStride[0] * ysrc +    alpha_pos);
                       uint16_t *d = (      uint16_t *)(dst[0] + dstStride[0] * y);
-                if ((!isBE(c->srcFormat)) == !HAVE_BIGENDIAN) {
+                if ((!isBE(c->opts.src_format)) == !HAVE_BIGENDIAN) {
                     for (x = 0; x < w; x++) {
                         for (plane = 0; plane < plane_count; plane++) {
                             int x_index = (plane_count + 1) * x;

+ 12 - 12
libswscale/arm/swscale_unscaled.c

@@ -41,7 +41,7 @@ static int rgbx_to_nv12_neon_32_wrapper(SwsInternal *context, const uint8_t *con
     rgbx_to_nv12_neon_32(src[0] + srcSliceY * srcStride[0],
             dst[0] + srcSliceY * dstStride[0],
             dst[1] + (srcSliceY / 2) * dstStride[1],
-            context->srcW, srcSliceH,
+            context->opts.src_w, srcSliceH,
             dstStride[0], dstStride[1], srcStride[0],
             context->input_rgb2yuv_table);
 
@@ -55,7 +55,7 @@ static int rgbx_to_nv12_neon_16_wrapper(SwsInternal *context, const uint8_t *con
     rgbx_to_nv12_neon_16(src[0] + srcSliceY * srcStride[0],
             dst[0] + srcSliceY * dstStride[0],
             dst[1] + (srcSliceY / 2) * dstStride[1],
-            context->srcW, srcSliceH,
+            context->opts.src_w, srcSliceH,
             dstStride[0], dstStride[1], srcStride[0],
             context->input_rgb2yuv_table);
 
@@ -84,7 +84,7 @@ static int ifmt##_to_##ofmt##_neon_wrapper(SwsInternal *c, const uint8_t *const
                                            const int dstStride[]) {                         \
     const int16_t yuv2rgb_table[] = { YUV_TO_RGB_TABLE };                                   \
                                                                                             \
-    ff_##ifmt##_to_##ofmt##_neon(c->srcW, srcSliceH,                                        \
+    ff_##ifmt##_to_##ofmt##_neon(c->opts.src_w, srcSliceH,                                  \
                                  dst[0] + srcSliceY * dstStride[0], dstStride[0],           \
                                  src[0], srcStride[0],                                      \
                                  src[1], srcStride[1],                                      \
@@ -120,7 +120,7 @@ static int ifmt##_to_##ofmt##_neon_wrapper(SwsInternal *c, const uint8_t *const
                                            const int dstStride[]) {                         \
     const int16_t yuv2rgb_table[] = { YUV_TO_RGB_TABLE };                                   \
                                                                                             \
-    ff_##ifmt##_to_##ofmt##_neon(c->srcW, srcSliceH,                                        \
+    ff_##ifmt##_to_##ofmt##_neon(c->opts.src_w, srcSliceH,                                  \
                                  dst[0] + srcSliceY * dstStride[0], dstStride[0],           \
                                  src[0], srcStride[0], src[1], srcStride[1],                \
                                  yuv2rgb_table,                                             \
@@ -144,10 +144,10 @@ DECLARE_FF_NVX_TO_ALL_RGBX_FUNCS(nv21)
  * assembly might be writing as much as 4*15=60 extra bytes at the end of the
  * line, which won't fit the 32-bytes buffer alignment. */
 #define SET_FF_NVX_TO_RGBX_FUNC(ifmt, IFMT, ofmt, OFMT, accurate_rnd) do {                  \
-    if (c->srcFormat == AV_PIX_FMT_##IFMT                                                   \
-        && c->dstFormat == AV_PIX_FMT_##OFMT                                                \
-        && !(c->srcH & 1)                                                                   \
-        && !(c->srcW & 15)                                                                  \
+    if (c->opts.src_format == AV_PIX_FMT_##IFMT                                             \
+        && c->opts.dst_format == AV_PIX_FMT_##OFMT                                          \
+        && !(c->opts.src_h & 1)                                                             \
+        && !(c->opts.src_w & 15)                                                            \
         && !accurate_rnd) {                                                                 \
         c->convert_unscaled = ifmt##_to_##ofmt##_neon_wrapper;                              \
     }                                                                                       \
@@ -161,10 +161,10 @@ DECLARE_FF_NVX_TO_ALL_RGBX_FUNCS(nv21)
 } while (0)
 
 static void get_unscaled_swscale_neon(SwsInternal *c) {
-    int accurate_rnd = c->flags & SWS_ACCURATE_RND;
-    if (c->srcFormat == AV_PIX_FMT_RGBA
-            && c->dstFormat == AV_PIX_FMT_NV12
-            && (c->srcW >= 16)) {
+    int accurate_rnd = c->opts.flags & SWS_ACCURATE_RND;
+    if (c->opts.src_format == AV_PIX_FMT_RGBA
+            && c->opts.dst_format == AV_PIX_FMT_NV12
+            && (c->opts.src_w >= 16)) {
         c->convert_unscaled = accurate_rnd ? rgbx_to_nv12_neon_32_wrapper
                                            : rgbx_to_nv12_neon_16_wrapper;
     }

+ 1 - 1
libswscale/input.c

@@ -1563,7 +1563,7 @@ av_cold void ff_sws_init_input_funcs(SwsInternal *c,
                                      planarX_YV12_fn *readAlpPlanar,
                                      planarX2_YV12_fn *readChrPlanar)
 {
-    enum AVPixelFormat srcFormat = c->srcFormat;
+    enum AVPixelFormat srcFormat = c->opts.src_format;
 
     *chrToYV12 = NULL;
     switch (srcFormat) {

+ 1 - 1
libswscale/loongarch/input_lasx.c

@@ -203,7 +203,7 @@ void planar_rgb_to_y_lasx(uint8_t *_dst, const uint8_t *src[4], int width,
 
 av_cold void ff_sws_init_input_lasx(SwsInternal *c)
 {
-    enum AVPixelFormat srcFormat = c->srcFormat;
+    enum AVPixelFormat srcFormat = c->opts.src_format;
 
     switch (srcFormat) {
     case AV_PIX_FMT_YUYV422:

+ 1 - 1
libswscale/loongarch/input_lsx.c

@@ -23,7 +23,7 @@
 
 av_cold void ff_sws_init_input_lsx(SwsInternal *c)
 {
-    enum AVPixelFormat srcFormat = c->srcFormat;
+    enum AVPixelFormat srcFormat = c->opts.src_format;
 
     switch (srcFormat) {
     case AV_PIX_FMT_YUYV422:

+ 5 - 5
libswscale/loongarch/output_lasx.c

@@ -888,7 +888,7 @@ static av_always_inline void yuv2rgb_write_full(SwsInternal *c,
     {
         int r,g,b;
 
-        switch (c->dither) {
+        switch (c->opts.dither) {
         default:
         case SWS_DITHER_AUTO:
         case SWS_DITHER_ED:
@@ -1784,7 +1784,7 @@ av_cold void ff_sws_init_output_lasx(SwsInternal *c,
                                      yuv2packedX_fn *yuv2packedX,
                                      yuv2anyX_fn *yuv2anyX)
 {
-    enum AVPixelFormat dstFormat = c->dstFormat;
+    enum AVPixelFormat dstFormat = c->opts.dst_format;
 
     /* Add initialization once optimized */
     if (isSemiPlanarYUV(dstFormat) && isDataInHighBits(dstFormat)) {
@@ -1797,8 +1797,8 @@ av_cold void ff_sws_init_output_lasx(SwsInternal *c,
         *yuv2planeX = yuv2planeX_8_lasx;
     }
 
-    if(c->flags & SWS_FULL_CHR_H_INT) {
-        switch (c->dstFormat) {
+    if(c->opts.flags & SWS_FULL_CHR_H_INT) {
+        switch (c->opts.dst_format) {
         case AV_PIX_FMT_RGBA:
 #if CONFIG_SMALL
             c->yuv2packedX = yuv2rgba32_full_X_lasx;
@@ -1911,7 +1911,7 @@ av_cold void ff_sws_init_output_lasx(SwsInternal *c,
             break;
     }
     } else {
-        switch (c->dstFormat) {
+        switch (c->opts.dst_format) {
         case AV_PIX_FMT_RGB32:
         case AV_PIX_FMT_BGR32:
 #if CONFIG_SMALL

+ 5 - 5
libswscale/loongarch/output_lsx.c

@@ -838,7 +838,7 @@ static av_always_inline void yuv2rgb_write_full(SwsInternal *c,
     {
         int r,g,b;
 
-        switch (c->dither) {
+        switch (c->opts.dither) {
         default:
         case SWS_DITHER_AUTO:
         case SWS_DITHER_ED:
@@ -1633,7 +1633,7 @@ av_cold void ff_sws_init_output_lsx(SwsInternal *c,
                                     yuv2packedX_fn *yuv2packedX,
                                     yuv2anyX_fn *yuv2anyX)
 {
-    enum AVPixelFormat dstFormat = c->dstFormat;
+    enum AVPixelFormat dstFormat = c->opts.dst_format;
 
     /* Add initialization once optimized */
     if (isSemiPlanarYUV(dstFormat) && isDataInHighBits(dstFormat)) {
@@ -1646,8 +1646,8 @@ av_cold void ff_sws_init_output_lsx(SwsInternal *c,
         *yuv2planeX = yuv2planeX_8_lsx;
     }
 
-    if(c->flags & SWS_FULL_CHR_H_INT) {
-        switch (c->dstFormat) {
+    if(c->opts.flags & SWS_FULL_CHR_H_INT) {
+        switch (c->opts.dst_format) {
         case AV_PIX_FMT_RGBA:
 #if CONFIG_SMALL
             c->yuv2packedX = yuv2rgba32_full_X_lsx;
@@ -1760,7 +1760,7 @@ av_cold void ff_sws_init_output_lsx(SwsInternal *c,
             break;
     }
     } else {
-        switch (c->dstFormat) {
+        switch (c->opts.dst_format) {
         case AV_PIX_FMT_RGB32:
         case AV_PIX_FMT_BGR32:
 #if CONFIG_SMALL

+ 14 - 14
libswscale/loongarch/swscale_init_loongarch.c

@@ -30,7 +30,7 @@ av_cold void ff_sws_init_range_convert_loongarch(SwsInternal *c)
 
     if (have_lsx(cpu_flags)) {
         if (c->dstBpc <= 14) {
-            if (c->srcRange) {
+            if (c->opts.src_range) {
                 c->lumConvertRange = lumRangeFromJpeg_lsx;
                 c->chrConvertRange = chrRangeFromJpeg_lsx;
             } else {
@@ -42,7 +42,7 @@ av_cold void ff_sws_init_range_convert_loongarch(SwsInternal *c)
 #if HAVE_LASX
     if (have_lasx(cpu_flags)) {
         if (c->dstBpc <= 14) {
-            if (c->srcRange) {
+            if (c->opts,src_range) {
                 c->lumConvertRange = lumRangeFromJpeg_lasx;
                 c->chrConvertRange = chrRangeFromJpeg_lasx;
             } else {
@@ -107,29 +107,29 @@ av_cold SwsFunc ff_yuv2rgb_init_loongarch(SwsInternal *c)
     int cpu_flags = av_get_cpu_flags();
 #if HAVE_LASX
     if (have_lasx(cpu_flags)) {
-        if (c->srcFormat == AV_PIX_FMT_YUV420P) {
-            switch (c->dstFormat) {
+        if (c->opts.src_format == AV_PIX_FMT_YUV420P) {
+            switch (c->opts.dst_format) {
                 case AV_PIX_FMT_RGB24:
                     return yuv420_rgb24_lasx;
                 case AV_PIX_FMT_BGR24:
                     return yuv420_bgr24_lasx;
                 case AV_PIX_FMT_RGBA:
-                    if (CONFIG_SWSCALE_ALPHA && isALPHA(c->srcFormat)) {
+                    if (CONFIG_SWSCALE_ALPHA && isALPHA(c->opts.src_format)) {
                         break;
                     } else
                         return yuv420_rgba32_lasx;
                 case AV_PIX_FMT_ARGB:
-                    if (CONFIG_SWSCALE_ALPHA && isALPHA(c->srcFormat)) {
+                    if (CONFIG_SWSCALE_ALPHA && isALPHA(c->opts.src_format)) {
                         break;
                     } else
                         return yuv420_argb32_lasx;
                 case AV_PIX_FMT_BGRA:
-                    if (CONFIG_SWSCALE_ALPHA && isALPHA(c->srcFormat)) {
+                    if (CONFIG_SWSCALE_ALPHA && isALPHA(c->opts.src_format)) {
                         break;
                     } else
                         return yuv420_bgra32_lasx;
                 case AV_PIX_FMT_ABGR:
-                    if (CONFIG_SWSCALE_ALPHA && isALPHA(c->srcFormat)) {
+                    if (CONFIG_SWSCALE_ALPHA && isALPHA(c->opts.src_format)) {
                         break;
                     } else
                         return yuv420_abgr32_lasx;
@@ -138,29 +138,29 @@ av_cold SwsFunc ff_yuv2rgb_init_loongarch(SwsInternal *c)
     }
 #endif // #if HAVE_LASX
     if (have_lsx(cpu_flags)) {
-        if (c->srcFormat == AV_PIX_FMT_YUV420P) {
-            switch (c->dstFormat) {
+        if (c->opts.src_format == AV_PIX_FMT_YUV420P) {
+            switch (c->opts.dst_format) {
                 case AV_PIX_FMT_RGB24:
                     return yuv420_rgb24_lsx;
                 case AV_PIX_FMT_BGR24:
                     return yuv420_bgr24_lsx;
                 case AV_PIX_FMT_RGBA:
-                    if (CONFIG_SWSCALE_ALPHA && isALPHA(c->srcFormat)) {
+                    if (CONFIG_SWSCALE_ALPHA && isALPHA(c->opts.src_format)) {
                         break;
                     } else
                         return yuv420_rgba32_lsx;
                 case AV_PIX_FMT_ARGB:
-                    if (CONFIG_SWSCALE_ALPHA && isALPHA(c->srcFormat)) {
+                    if (CONFIG_SWSCALE_ALPHA && isALPHA(c->opts.src_format)) {
                         break;
                     } else
                         return yuv420_argb32_lsx;
                 case AV_PIX_FMT_BGRA:
-                    if (CONFIG_SWSCALE_ALPHA && isALPHA(c->srcFormat)) {
+                    if (CONFIG_SWSCALE_ALPHA && isALPHA(c->opts.src_format)) {
                         break;
                     } else
                         return yuv420_bgra32_lsx;
                 case AV_PIX_FMT_ABGR:
-                    if (CONFIG_SWSCALE_ALPHA && isALPHA(c->srcFormat)) {
+                    if (CONFIG_SWSCALE_ALPHA && isALPHA(c->opts.src_format)) {
                         break;
                     } else
                         return yuv420_abgr32_lsx;

Some files were not shown because too many files changed in this diff