mirror of
https://github.com/LuckfoxTECH/luckfox-pico.git
synced 2026-01-19 09:52:31 +01:00
update:add luckfox-pico Ultra support
This commit is contained in:
committed by
luckfox-eng33
parent
1e160dee55
commit
d3153ac97e
43
sysdrv/tools/board/buildroot/mpv_patch/0002-change-j1.patch
Normal file
43
sysdrv/tools/board/buildroot/mpv_patch/0002-change-j1.patch
Normal file
@@ -0,0 +1,43 @@
|
||||
--- a/video/out/filter_kernels.c 2024-04-26 11:14:00.377199103 +0800
|
||||
+++ b/video/out/filter_kernels.c 2024-04-26 11:13:50.217202856 +0800
|
||||
@@ -32,6 +32,31 @@
|
||||
|
||||
// NOTE: all filters are designed for discrete convolution
|
||||
|
||||
+double factorial(int n) {
|
||||
+ if (n == 0)
|
||||
+ return 1;
|
||||
+ else
|
||||
+ return n * factorial(n - 1);
|
||||
+}
|
||||
+
|
||||
+double power(double base, int exponent) {
|
||||
+ double result = 1.0;
|
||||
+ for (int i = 0; i < exponent; i++) {
|
||||
+ result *= base;
|
||||
+ }
|
||||
+ return result;
|
||||
+}
|
||||
+
|
||||
+double BesselJ1(double x) {
|
||||
+ double result = 0.0;
|
||||
+ for (int n = 0; n <= 10; n++) {
|
||||
+ result += power(-1, n) * power(x / 2.0, 2 * n + 1) / (factorial(n) * factorial(n + 1));
|
||||
+ }
|
||||
+ return result;
|
||||
+}
|
||||
+
|
||||
+
|
||||
+
|
||||
const struct filter_window *mp_find_filter_window(const char *name)
|
||||
{
|
||||
if (!name)
|
||||
@@ -324,7 +349,7 @@
|
||||
if (fabs(x) < 1e-8)
|
||||
return 1.0;
|
||||
x *= M_PI;
|
||||
- return 2.0 * j1(x) / x;
|
||||
+ return 2.0 * BesselJ1(x) / x;
|
||||
}
|
||||
|
||||
static double sphinx(params *p, double x)
|
||||
Reference in New Issue
Block a user