diff options
author | Niklas Haas <git@haasn.dev> | 2024-10-10 12:16:44 +0200 |
---|---|---|
committer | Niklas Haas <git@haasn.dev> | 2024-11-21 12:49:56 +0100 |
commit | 2d077f9acda4946b3455ded5778fb3fc7e85bba2 (patch) | |
tree | 44ab5d5889e65b4067fbe54f4e7966a31f4c9f13 /libswscale/loongarch | |
parent | 10d1be262126f1699a89b54cf5f23a5370c57cb5 (diff) | |
download | ffmpeg-2d077f9acda4946b3455ded5778fb3fc7e85bba2.tar.gz |
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/loongarch')
-rw-r--r-- | libswscale/loongarch/input_lasx.c | 2 | ||||
-rw-r--r-- | libswscale/loongarch/input_lsx.c | 2 | ||||
-rw-r--r-- | libswscale/loongarch/output_lasx.c | 10 | ||||
-rw-r--r-- | libswscale/loongarch/output_lsx.c | 10 | ||||
-rw-r--r-- | libswscale/loongarch/swscale_init_loongarch.c | 28 | ||||
-rw-r--r-- | libswscale/loongarch/swscale_lasx.c | 8 | ||||
-rw-r--r-- | libswscale/loongarch/swscale_lsx.c | 8 | ||||
-rw-r--r-- | libswscale/loongarch/yuv2rgb_lasx.c | 8 | ||||
-rw-r--r-- | libswscale/loongarch/yuv2rgb_lsx.c | 12 |
9 files changed, 44 insertions, 44 deletions
diff --git a/libswscale/loongarch/input_lasx.c b/libswscale/loongarch/input_lasx.c index b682179c6e..046f395ae5 100644 --- a/libswscale/loongarch/input_lasx.c +++ b/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: diff --git a/libswscale/loongarch/input_lsx.c b/libswscale/loongarch/input_lsx.c index 2bc7577961..c0e5627690 100644 --- a/libswscale/loongarch/input_lsx.c +++ b/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: diff --git a/libswscale/loongarch/output_lasx.c b/libswscale/loongarch/output_lasx.c index 4e5ad3d802..21d0a501b0 100644 --- a/libswscale/loongarch/output_lasx.c +++ b/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 diff --git a/libswscale/loongarch/output_lsx.c b/libswscale/loongarch/output_lsx.c index 29fe30758a..24e6de5535 100644 --- a/libswscale/loongarch/output_lsx.c +++ b/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 diff --git a/libswscale/loongarch/swscale_init_loongarch.c b/libswscale/loongarch/swscale_init_loongarch.c index f02e957998..843fa08196 100644 --- a/libswscale/loongarch/swscale_init_loongarch.c +++ b/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; diff --git a/libswscale/loongarch/swscale_lasx.c b/libswscale/loongarch/swscale_lasx.c index 79fa4c64b0..fcaca3123b 100644 --- a/libswscale/loongarch/swscale_lasx.c +++ b/libswscale/loongarch/swscale_lasx.c @@ -677,7 +677,7 @@ void ff_hscale_16_to_15_lasx(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 i; const uint16_t *src = (const uint16_t *) _src; int sh = desc->comp[0].depth - 1; @@ -688,7 +688,7 @@ void ff_hscale_16_to_15_lasx(SwsInternal *c, int16_t *dst, int dstW, __m256i zero = __lasx_xvldi(0); if (sh < 15) { - sh = isAnyRGB(c->srcFormat) || c->srcFormat==AV_PIX_FMT_PAL8 ? 13 : + 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) { sh = 15; @@ -824,7 +824,7 @@ void ff_hscale_16_to_19_lasx(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 i; int32_t *dst = (int32_t *) _dst; const uint16_t *src = (const uint16_t *) _src; @@ -835,7 +835,7 @@ void ff_hscale_16_to_19_lasx(SwsInternal *c, int16_t *_dst, int dstW, __m256i shift; __m256i zero = __lasx_xvldi(0); - if ((isAnyRGB(c->srcFormat) || c->srcFormat == AV_PIX_FMT_PAL8) + 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) { diff --git a/libswscale/loongarch/swscale_lsx.c b/libswscale/loongarch/swscale_lsx.c index dbdaf18de6..fce09800fe 100644 --- a/libswscale/loongarch/swscale_lsx.c +++ b/libswscale/loongarch/swscale_lsx.c @@ -27,11 +27,11 @@ void ff_hscale_16_to_15_lsx(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 : + 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) { sh = 15; @@ -43,11 +43,11 @@ void ff_hscale_16_to_19_lsx(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 */ diff --git a/libswscale/loongarch/yuv2rgb_lasx.c b/libswscale/loongarch/yuv2rgb_lasx.c index 1b36d617b5..e9e4a63a0a 100644 --- a/libswscale/loongarch/yuv2rgb_lasx.c +++ b/libswscale/loongarch/yuv2rgb_lasx.c @@ -173,11 +173,11 @@ __m256i shuf3 = {0x1E0F0E1C0D0C1A0B, 0x0101010101010101, \ 0x1E0F0E1C0D0C1A0B, 0x0101010101010101}; \ YUV2RGB_LOAD_COE \ - y = (c->dstW + 7) & ~7; \ + y = (c->opts.dst_w + 7) & ~7; \ h_size = y >> 4; \ res = y & 15; \ \ - vshift = c->srcFormat != AV_PIX_FMT_YUV422P; \ + vshift = c->opts.src_format != AV_PIX_FMT_YUV422P; \ for (y = 0; y < srcSliceH; y += 2) { \ dst_type *image1 = (dst_type *)(dst[0] + (y + srcSliceY) * dstStride[0]);\ dst_type *image2 = (dst_type *)(image1 + dstStride[0]);\ @@ -199,11 +199,11 @@ __m256i a = __lasx_xvldi(0xFF); \ \ YUV2RGB_LOAD_COE \ - y = (c->dstW + 7) & ~7; \ + y = (c->opts.dst_w + 7) & ~7; \ h_size = y >> 4; \ res = y & 15; \ \ - vshift = c->srcFormat != AV_PIX_FMT_YUV422P; \ + vshift = c->opts.src_format != AV_PIX_FMT_YUV422P; \ for (y = 0; y < srcSliceH; y += 2) { \ int yd = y + srcSliceY; \ dst_type av_unused *r, *g, *b; \ diff --git a/libswscale/loongarch/yuv2rgb_lsx.c b/libswscale/loongarch/yuv2rgb_lsx.c index f2f424265f..6339d07d6c 100644 --- a/libswscale/loongarch/yuv2rgb_lsx.c +++ b/libswscale/loongarch/yuv2rgb_lsx.c @@ -128,9 +128,9 @@ \ YUV2RGB_LOAD_COE \ \ - h_size = c->dstW >> 4; \ - res = (c->dstW & 15) >> 1; \ - vshift = c->srcFormat != AV_PIX_FMT_YUV422P; \ + h_size = c->opts.dst_w >> 4; \ + res = (c->opts.dst_w & 15) >> 1; \ + vshift = c->opts.src_format != AV_PIX_FMT_YUV422P; \ for (y = 0; y < srcSliceH; y += 2) { \ dst_type av_unused *r, *g, *b; \ dst_type *image1 = (dst_type *)(dst[0] + (y + srcSliceY) * dstStride[0]);\ @@ -156,9 +156,9 @@ \ YUV2RGB_LOAD_COE \ \ - h_size = c->dstW >> 4; \ - res = (c->dstW & 15) >> 1; \ - vshift = c->srcFormat != AV_PIX_FMT_YUV422P; \ + h_size = c->opts.dst_w >> 4; \ + res = (c->opts.dst_w & 15) >> 1; \ + vshift = c->opts.src_format != AV_PIX_FMT_YUV422P; \ for (y = 0; y < srcSliceH; y += 2) { \ int yd = y + srcSliceY; \ dst_type av_unused *r, *g, *b; \ |