Fix (unreported) Sequencer Drop effect: wrong initial offset in second input buffer.
Reading rest of the code, it's obvious we want to start à YOFF lines from start of rect2i, so we have to also multiply by number of components. Also did some minor cleanup.
This commit is contained in:
parent
8f29503b52
commit
fc4a51e3fa
|
@ -1086,15 +1086,15 @@ static void do_drop_effect_byte(float facf0, float facf1, int x, int y, unsigned
|
|||
fac1 = (int) (70.0f * facf0);
|
||||
fac2 = (int) (70.0f * facf1);
|
||||
|
||||
rt2 = (unsigned char *) (rect2i + yoff * width);
|
||||
rt1 = (unsigned char *) rect1i;
|
||||
out = (unsigned char *) outi;
|
||||
rt2 = rect2i + yoff * 4 * width;
|
||||
rt1 = rect1i;
|
||||
out = outi;
|
||||
for (y = 0; y < height - yoff; y++) {
|
||||
if (field) fac = fac1;
|
||||
else fac = fac2;
|
||||
field = !field;
|
||||
|
||||
memcpy(out, rt1, sizeof(int) * xoff);
|
||||
memcpy(out, rt1, sizeof(*out) * xoff * 4);
|
||||
rt1 += xoff * 4;
|
||||
out += xoff * 4;
|
||||
|
||||
|
@ -1109,7 +1109,7 @@ static void do_drop_effect_byte(float facf0, float facf1, int x, int y, unsigned
|
|||
}
|
||||
rt2 += xoff * 4;
|
||||
}
|
||||
memcpy(out, rt1, sizeof(int) * yoff * width);
|
||||
memcpy(out, rt1, sizeof(*out) * yoff * 4 * width);
|
||||
}
|
||||
|
||||
static void do_drop_effect_float(float facf0, float facf1, int x, int y, float *rect2i, float *rect1i, float *outi)
|
||||
|
@ -1126,7 +1126,7 @@ static void do_drop_effect_float(float facf0, float facf1, int x, int y, float *
|
|||
fac1 = 70.0f * facf0;
|
||||
fac2 = 70.0f * facf1;
|
||||
|
||||
rt2 = (rect2i + yoff * width);
|
||||
rt2 = rect2i + yoff * 4 * width;
|
||||
rt1 = rect1i;
|
||||
out = outi;
|
||||
for (y = 0; y < height - yoff; y++) {
|
||||
|
@ -1134,7 +1134,7 @@ static void do_drop_effect_float(float facf0, float facf1, int x, int y, float *
|
|||
else fac = fac2;
|
||||
field = !field;
|
||||
|
||||
memcpy(out, rt1, 4 * sizeof(float) * xoff);
|
||||
memcpy(out, rt1, sizeof(*out) * xoff * 4);
|
||||
rt1 += xoff * 4;
|
||||
out += xoff * 4;
|
||||
|
||||
|
@ -1149,7 +1149,7 @@ static void do_drop_effect_float(float facf0, float facf1, int x, int y, float *
|
|||
}
|
||||
rt2 += xoff * 4;
|
||||
}
|
||||
memcpy(out, rt1, 4 * sizeof(float) * yoff * width);
|
||||
memcpy(out, rt1, sizeof(*out) * yoff * 4 * width);
|
||||
}
|
||||
|
||||
/*********************** Mul *************************/
|
||||
|
|
Loading…
Reference in New Issue