VSE: make Wipe effect 6x-20x faster #115837

Merged
Aras Pranckevicius merged 2 commits from aras_p/blender:vse-wipe-opt into main 2023-12-06 19:43:08 +01:00
1 changed files with 3 additions and 11 deletions
Showing only changes of commit 33e73ad398 - Show all commits

View File

@ -1419,8 +1419,6 @@ static float in_band(float width, float dist, int side, int dir)
static float check_zone(const WipeZone *wipezone, int x, int y, float fac)
{
float posx, posy, hyp, hyp2, angle, hwidth, b1, b2, b3, pointdist;
/* some future stuff */
/* float hyp3, hyp4, b4, b5 */
float temp1, temp2, temp3, temp4; /* some placeholder variables */
int xo = wipezone->xo;
int yo = wipezone->yo;
@ -1549,15 +1547,9 @@ static float check_zone(const WipeZone *wipezone, int x, int y, float fac)
x = x - halfx;
y = y - halfy;
temp2 = asin(abs(y) / hypot(x, y));
if (x <= 0 && y >= 0) {
temp2 = float(M_PI) - temp2;
}
else if (x <= 0 && y <= 0) {
temp2 += float(M_PI);
}
else if (x >= 0 && y <= 0) {
temp2 = 2.0f * float(M_PI) - temp2;
temp2 = atan2f(y, x);
if (temp2 < 0.0f) {
temp2 += 2.0f * float(M_PI);
}
if (wipezone->forward) {