mirror of
https://github.com/game-stop/veejay.git
synced 2025-12-05 15:30:02 +01:00
minor optimization, fix indenting
This commit is contained in:
@@ -61,14 +61,7 @@ void *swirl_malloc(int w, int h)
|
||||
if(!s) {
|
||||
return NULL;
|
||||
}
|
||||
/* s->buf[0] = vj_malloc( sizeof(uint8_t) * (w*h*3));
|
||||
if(!s->buf[0]) {
|
||||
swirl_free(s);
|
||||
return NULL;
|
||||
}
|
||||
s->buf[1] = s->buf[0] + (w*h);
|
||||
s->buf[2] = s->buf[1] + (w*h);
|
||||
*/
|
||||
|
||||
s->polar_map = (double*) vj_calloc(sizeof(double) * (w * h) );
|
||||
if(!s->polar_map) {
|
||||
swirl_free(s);
|
||||
@@ -108,8 +101,6 @@ void swirl_free(void *ptr)
|
||||
swirl_t *s = (swirl_t*) ptr;
|
||||
|
||||
if(s) {
|
||||
// if( s->buf[0] )
|
||||
// free(s->buf[0] );
|
||||
if( s->polar_map )
|
||||
free(s->polar_map);
|
||||
if( s->fish_angle )
|
||||
@@ -136,14 +127,12 @@ void swirl_apply(void *ptr, VJFrame *frame, int *args)
|
||||
double *polar_map = s->polar_map;
|
||||
double *fish_angle = s->fish_angle;
|
||||
int *cached_coords = s->cached_coords;
|
||||
// uint8_t **buf = s->buf;
|
||||
|
||||
if( s->v != v )
|
||||
{
|
||||
const unsigned int R = width;
|
||||
const double coeef = v;
|
||||
|
||||
/* pre calculate */
|
||||
int px,py;
|
||||
double r,a;
|
||||
double si,co;
|
||||
@@ -167,12 +156,9 @@ void swirl_apply(void *ptr, VJFrame *frame, int *args)
|
||||
s->v = v;
|
||||
}
|
||||
|
||||
// int strides[4] = { len, len, len , 0 };
|
||||
// vj_frame_copy( frame->data, buf, strides );
|
||||
|
||||
for(i=0; i < len; i++)
|
||||
{
|
||||
int idx = (cached_coords[i] == -1) ? 0 : cached_coords[i];
|
||||
int idx = cached_coords[i];
|
||||
|
||||
Y[i] = Y[idx];
|
||||
Cb[i] = Cb[idx];
|
||||
|
||||
Reference in New Issue
Block a user