mirror of https://git.ffmpeg.org/ffmpeg.git
Stop the approximation in bessel() once it does no longer improve.
This is faster. Originally committed as revision 21038 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
parent
9df9b810c5
commit
2efcf29275
|
@ -76,11 +76,13 @@ typedef struct AVResampleContext{
|
||||||
*/
|
*/
|
||||||
static double bessel(double x){
|
static double bessel(double x){
|
||||||
double v=1;
|
double v=1;
|
||||||
|
double lastv=0;
|
||||||
double t=1;
|
double t=1;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
x= x*x/4;
|
x= x*x/4;
|
||||||
for(i=1; i<50; i++){
|
for(i=1; v != lastv; i++){
|
||||||
|
lastv=v;
|
||||||
t *= x/(i*i);
|
t *= x/(i*i);
|
||||||
v += t;
|
v += t;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue