History

swscale/range_convert: drop redundant conditionals from arch-specific init functions

These conditions are already checked for in the main init function.

Ramiro Polla committed 2 years ago

Commit f7ee0191 parent 7728b335 files · +2 −11Browse files

Unified · Split

5 files
  1. libswscale/aarch64/swscale.c +0 −2
  2. libswscale/loongarch/swscale_init_loongarch.c +0 −4
  3. libswscale/riscv/swscale.c +1 −2
  4. libswscale/swscale.c +1 −1
  5. libswscale/x86/swscale.c +0 −2
libswscale/aarch64/swscale.c+0−2
@@ -228,7 +228,6 @@ av_cold void ff_sws_init_range_convert_aarch64(SwsInternal *c) · 227 unmodified lines
228228 int cpu_flags = av_get_cpu_flags();
229229
230230 if (have_neon(cpu_flags)) {
231− if (c->srcRange != c->dstRange && !isAnyRGB(c->dstFormat)) {
232231 if (c->dstBpc <= 14) {
233232 if (c->srcRange) {
234233 c->lumConvertRange = ff_lumRangeFromJpeg_neon;
@@ -239,7 +238,6 @@ av_cold void ff_sws_init_range_convert_aarch64(SwsInternal *c) · 4 unmodified lines
239238 }
240239 }
241240 }
242− }
243241 }
244242
245243 av_cold void ff_sws_init_swscale_aarch64(SwsInternal *c)
libswscale/loongarch/swscale_init_loongarch.c+0−4
@@ -29,7 +29,6 @@ av_cold void ff_sws_init_range_convert_loongarch(SwsInternal *c) · 28 unmodified lines
2929 int cpu_flags = av_get_cpu_flags();
3030
3131 if (have_lsx(cpu_flags)) {
32− if (c->srcRange != c->dstRange && !isAnyRGB(c->dstFormat)) {
3332 if (c->dstBpc <= 14) {
3433 if (c->srcRange) {
3534 c->lumConvertRange = lumRangeFromJpeg_lsx;
@@ -39,11 +38,9 @@ av_cold void ff_sws_init_range_convert_loongarch(SwsInternal *c) · 3 unmodified lines
3938 c->chrConvertRange = chrRangeToJpeg_lsx;
4039 }
4140 }
42− }
4341 }
4442 #if HAVE_LASX
4543 if (have_lasx(cpu_flags)) {
46− if (c->srcRange != c->dstRange && !isAnyRGB(c->dstFormat)) {
4744 if (c->dstBpc <= 14) {
4845 if (c->srcRange) {
4946 c->lumConvertRange = lumRangeFromJpeg_lasx;
@@ -53,7 +50,6 @@ av_cold void ff_sws_init_range_convert_loongarch(SwsInternal *c) · 3 unmodified lines
5350 c->chrConvertRange = chrRangeToJpeg_lasx;
5451 }
5552 }
56− }
5753 }
5854 #endif // #if HAVE_LASX
5955 }
libswscale/riscv/swscale.c+1−2
@@ -39,8 +39,7 @@ av_cold void ff_sws_init_range_convert_riscv(SwsInternal *c) · 38 unmodified lines
3939 { ff_range_lum_from_jpeg_16_rvv, ff_range_chr_from_jpeg_16_rvv },
4040 };
4141
42− if (c->srcRange != c->dstRange && !isAnyRGB(c->dstFormat) &&
43− c->dstBpc <= 14 &&
42+ if (c->dstBpc <= 14 &&
4443 (flags & AV_CPU_FLAG_RVV_I32) && (flags & AV_CPU_FLAG_RVB)) {
4544 bool from = c->srcRange != 0;
4645
libswscale/swscale.c+1−1
@@ -562,7 +562,6 @@ av_cold void ff_sws_init_range_convert(SwsInternal *c) · 561 unmodified lines
562562 c->chrConvertRange = chrRangeToJpeg16_c;
563563 }
564564 }
565− }
566565
567566 #if ARCH_AARCH64
568567 ff_sws_init_range_convert_aarch64(c);
@@ -573,6 +572,7 @@ av_cold void ff_sws_init_range_convert(SwsInternal *c) · 4 unmodified lines
573572 #elif ARCH_X86
574573 ff_sws_init_range_convert_x86(c);
575574 #endif
575+ }
576576 }
577577
578578 static av_cold void sws_init_swscale(SwsInternal *c)
libswscale/x86/swscale.c+0−2
@@ -474,14 +474,12 @@ RANGE_CONVERT_FUNCS_DECL(avx2); · 473 unmodified lines
474474
475475 av_cold void ff_sws_init_range_convert_x86(SwsInternal *c)
476476 {
477− if (c->srcRange != c->dstRange && !isAnyRGB(c->dstFormat)) {
478477 int cpu_flags = av_get_cpu_flags();
479478 if (EXTERNAL_AVX2_FAST(cpu_flags)) {
480479 RANGE_CONVERT_FUNCS(avx2);
481480 } else if (EXTERNAL_SSE2(cpu_flags)) {
482481 RANGE_CONVERT_FUNCS(sse2);
483482 }
484− }
485483 }
486484
487485 av_cold void ff_sws_init_swscale_x86(SwsInternal *c)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t