Log in

View Full Version : Help with Avisynth filter dev


Pages : 1 [2]

Guest
31st December 2006, 17:42
Learn to use a profiler and then test different approaches. Or learn assembler and inspect the generated code.

IanB
1st January 2007, 08:58
Mythical code! You know plugh->GlobalSomething() is invariant within the loop, the compiler cannot tell.for (i=0;i<h;i++) {
for (j=0;j<w;j++){
if (plugh->GlobalSomething()) {
d[i,j]=s[i,j]+1;
}
else {
d[i,j]=s[i,j]-1;
}
}
}orif (plugh->GlobalSomething()) {
for (i=0;i<h;i++) {
for (j=0;j<w;j++){
d[i,j]=s[i,j]+1;
}
}
}
else {
for (i=0;i<h;i++) {
for (j=0;j<w;j++){
d[i,j]=-s[i,j]-1;
}
}
}Which do you think a) is faster and b) is smaller.