diff --git a/veejay-current/veejay-server/libvje/effects/alpha2img.c b/veejay-current/veejay-server/libvje/effects/alpha2img.c index 1b33f6f0..1dfb5c9a 100644 --- a/veejay-current/veejay-server/libvje/effects/alpha2img.c +++ b/veejay-current/veejay-server/libvje/effects/alpha2img.c @@ -17,11 +17,9 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 , USA. */ -#include -#include -#include -#include + #include "common.h" +#include #include "alpha2img.h" vj_effect *alpha2img_init(int w, int h) @@ -38,14 +36,15 @@ vj_effect *alpha2img_init(int w, int h) } -void alpha2img_apply( VJFrame *frame, int width, int height) +void alpha2img_apply( VJFrame *frame) { - uint8_t *Y = frame->data[0]; - uint8_t *Cb = frame->data[1]; - uint8_t *Cr = frame->data[2]; + uint8_t *Y = frame->data[0]; + uint8_t *Cb = frame->data[1]; + uint8_t *Cr = frame->data[2]; uint8_t *a = frame->data[3]; + const int len = frame->len; - veejay_memcpy( Y, a, frame->len ); - veejay_memset( Cb,128, (frame->ssm ? frame->len : frame->uv_len) ); - veejay_memset( Cr,128, (frame->ssm ? frame->len : frame->uv_len) ); + veejay_memcpy( Y, a, len ); + veejay_memset( Cb,128, (frame->ssm ? len : frame->uv_len) ); + veejay_memset( Cr,128, (frame->ssm ? len : frame->uv_len) ); } diff --git a/veejay-current/veejay-server/libvje/effects/alpha2img.h b/veejay-current/veejay-server/libvje/effects/alpha2img.h index f1aeada3..b756e342 100644 --- a/veejay-current/veejay-server/libvje/effects/alpha2img.h +++ b/veejay-current/veejay-server/libvje/effects/alpha2img.h @@ -20,10 +20,6 @@ #ifndef ALPHA2IMG_H #define ALPHA2IMG_H -#include -#include -#include - vj_effect *alpha2img_init(int w, int h); -void alpha2img_apply( VJFrame *frame, int width, int height); +void alpha2img_apply( VJFrame *frame); #endif diff --git a/veejay-current/veejay-server/libvje/effects/alphablend.c b/veejay-current/veejay-server/libvje/effects/alphablend.c index 6376ae9a..28eab605 100644 --- a/veejay-current/veejay-server/libvje/effects/alphablend.c +++ b/veejay-current/veejay-server/libvje/effects/alphablend.c @@ -17,14 +17,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 , USA. */ - -#include -#include -#include -#include + +#include "common.h" #include #include "alphablend.h" -#include "common.h" vj_effect *alphablend_init(int w, int h) { @@ -51,10 +47,11 @@ static inline int blend_plane( uint8_t *dst, uint8_t *A, uint8_t *B, uint8_t *aA return 0; } -void alphablend_apply( VJFrame *frame, VJFrame *frame2, int width,int height) +void alphablend_apply( VJFrame *frame, VJFrame *frame2) { - size_t uv_len = (frame->ssm ? frame->len : frame->uv_len ); - blend_plane( frame->data[0], frame->data[0], frame2->data[0], frame2->data[3], frame->len ); + const int len = frame->len; + const int uv_len = (frame->ssm ? len : frame->uv_len ); + blend_plane( frame->data[0], frame->data[0], frame2->data[0], frame2->data[3], len ); blend_plane( frame->data[1], frame->data[1], frame2->data[1], frame2->data[3], uv_len ); blend_plane( frame->data[2], frame->data[2], frame2->data[2], frame2->data[3], uv_len ); } diff --git a/veejay-current/veejay-server/libvje/effects/alphablend.h b/veejay-current/veejay-server/libvje/effects/alphablend.h index 43bd8d75..10067d40 100644 --- a/veejay-current/veejay-server/libvje/effects/alphablend.h +++ b/veejay-current/veejay-server/libvje/effects/alphablend.h @@ -20,11 +20,6 @@ #ifndef ALPHABLEND_H #define ALPHABLEND_H -#include -#include -#include - vj_effect *alphablend_init(int w, int h); -void alphablend_apply( VJFrame *frame, VJFrame *frame2, int width,int height); - +void alphablend_apply( VJFrame *frame, VJFrame *frame2); #endif diff --git a/veejay-current/veejay-server/libvje/effects/alphadampen.c b/veejay-current/veejay-server/libvje/effects/alphadampen.c index 24f695f6..fca8ed7b 100644 --- a/veejay-current/veejay-server/libvje/effects/alphadampen.c +++ b/veejay-current/veejay-server/libvje/effects/alphadampen.c @@ -17,9 +17,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 , USA. */ -#include -#include -#include + +#include "common.h" #include #include "alphadampen.h" @@ -46,13 +45,13 @@ vj_effect *alphadampen_init(int w, int h) void alphadampen_apply( VJFrame *frame, int b1) { - size_t i; - const size_t len = frame->len; - uint8_t tmp; - uint8_t *A = frame->data[3]; + size_t i; + const int len = frame->len; + uint8_t tmp; + uint8_t *A = frame->data[3]; const int base = (const int) b1; - for( i = 0 ; i < len ; i ++ ) + for( i = 0 ; i < len ; i ++ ) { tmp = A[i]; A[i] = (tmp / base) * base; // loose fractional part diff --git a/veejay-current/veejay-server/libvje/effects/alphadampen.h b/veejay-current/veejay-server/libvje/effects/alphadampen.h index 84ddb999..cde3cede 100644 --- a/veejay-current/veejay-server/libvje/effects/alphadampen.h +++ b/veejay-current/veejay-server/libvje/effects/alphadampen.h @@ -20,10 +20,6 @@ #ifndef ALPHA_DAMPEN_H #define ALPHA_DAMPEN_H -#include -#include -#include - vj_effect *alphadampen_init(int w, int h); void alphadampen_apply( VJFrame *frame, int b1); #endif diff --git a/veejay-current/veejay-server/libvje/effects/alphafill.c b/veejay-current/veejay-server/libvje/effects/alphafill.c index 2f5ce0a2..e9cb7b5c 100644 --- a/veejay-current/veejay-server/libvje/effects/alphafill.c +++ b/veejay-current/veejay-server/libvje/effects/alphafill.c @@ -17,11 +17,9 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 , USA. */ -#include -#include -#include -#include + #include "common.h" +#include #include "alphafill.h" vj_effect *alphafill_init(int w, int h) @@ -45,9 +43,9 @@ vj_effect *alphafill_init(int w, int h) return ve; } -void alphafill_apply( VJFrame *frame, int width, int height, int val) +void alphafill_apply( VJFrame *frame, int val) { - int len = (width * height); + const int len = frame->len; uint8_t *a = frame->data[3]; veejay_memset(a, val, len ); } diff --git a/veejay-current/veejay-server/libvje/effects/alphafill.h b/veejay-current/veejay-server/libvje/effects/alphafill.h index 95bfd1c0..68c2b3bc 100644 --- a/veejay-current/veejay-server/libvje/effects/alphafill.h +++ b/veejay-current/veejay-server/libvje/effects/alphafill.h @@ -20,10 +20,6 @@ #ifndef ALPHAFILL_H #define ALPHAFILL_H -#include -#include -#include - vj_effect *alphafill_init(int w, int h); -void alphafill_apply( VJFrame *frame, int width, int height, int val); +void alphafill_apply( VJFrame *frame, int val); #endif diff --git a/veejay-current/veejay-server/libvje/effects/alphaflatten.c b/veejay-current/veejay-server/libvje/effects/alphaflatten.c index 9dc591d9..9c235ea0 100644 --- a/veejay-current/veejay-server/libvje/effects/alphaflatten.c +++ b/veejay-current/veejay-server/libvje/effects/alphaflatten.c @@ -17,11 +17,9 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 , USA. */ -#include -#include -#include -#include + #include "common.h" +#include #include "alphaflatten.h" vj_effect *alphaflatten_init(int w, int h) @@ -49,10 +47,10 @@ vj_effect *alphaflatten_init(int w, int h) } -void alphaflatten_apply( VJFrame *frame, int width, int height, int mode) +void alphaflatten_apply( VJFrame *frame, int mode) { - unsigned int i; - const unsigned int len = frame->len; + unsigned int i; + const int len = frame->len; uint8_t *o0 = frame->data[0]; uint8_t *o1 = frame->data[1]; @@ -75,6 +73,4 @@ void alphaflatten_apply( VJFrame *frame, int width, int height, int mode) if( mode ) { veejay_memset( oA, 0, len ); } - - } diff --git a/veejay-current/veejay-server/libvje/effects/alphaflatten.h b/veejay-current/veejay-server/libvje/effects/alphaflatten.h index 8043713f..361bc1ab 100644 --- a/veejay-current/veejay-server/libvje/effects/alphaflatten.h +++ b/veejay-current/veejay-server/libvje/effects/alphaflatten.h @@ -20,10 +20,6 @@ #ifndef ALPHAFLATTEN_H #define ALPHAFLATTEN_H -#include -#include -#include - vj_effect *alphaflatten_init(int w, int h); -void alphaflatten_apply( VJFrame *frame, int width, int height, int mode); +void alphaflatten_apply( VJFrame *frame, int mode); #endif diff --git a/veejay-current/veejay-server/libvje/effects/alphanegate.c b/veejay-current/veejay-server/libvje/effects/alphanegate.c index 4a39b677..2e68b564 100644 --- a/veejay-current/veejay-server/libvje/effects/alphanegate.c +++ b/veejay-current/veejay-server/libvje/effects/alphanegate.c @@ -17,11 +17,9 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 , USA. */ -#include -#include -#include -#include + #include "common.h" +#include #include "alphanegate.h" vj_effect *alphanegate_init(int w, int h) @@ -49,9 +47,9 @@ vj_effect *alphanegate_init(int w, int h) } -void alphanegate_apply( VJFrame *frame, int width, int height, int val) +void alphanegate_apply( VJFrame *frame, int val) { - const unsigned int len = frame->len; + const int len = frame->len; uint8_t *A = frame->data[3]; unsigned int i; diff --git a/veejay-current/veejay-server/libvje/effects/alphanegate.h b/veejay-current/veejay-server/libvje/effects/alphanegate.h index 436fd0ab..9630817e 100644 --- a/veejay-current/veejay-server/libvje/effects/alphanegate.h +++ b/veejay-current/veejay-server/libvje/effects/alphanegate.h @@ -20,10 +20,6 @@ #ifndef ALPHANEGATE_H #define ALPHANEGATE_H -#include -#include -#include - vj_effect *alphanegate_init(int w, int h); -void alphanegate_apply( VJFrame *frame, int width, int height, int val); +void alphanegate_apply( VJFrame *frame, int val); #endif diff --git a/veejay-current/veejay-server/libvje/effects/alphaselect.c b/veejay-current/veejay-server/libvje/effects/alphaselect.c index 5d0ebdd1..988d3e76 100644 --- a/veejay-current/veejay-server/libvje/effects/alphaselect.c +++ b/veejay-current/veejay-server/libvje/effects/alphaselect.c @@ -22,11 +22,8 @@ * derived from greyselect.c */ -#include -#include -#include -#include #include "common.h" +#include #include "alphaselect.h" vj_effect *alphaselect_init(int w, int h) @@ -76,17 +73,16 @@ vj_effect *alphaselect_init(int w, int h) return ve; } -void alphaselect_apply( VJFrame *frame, int width, - int height, int i_angle, int r, int g, - int b, int swap) +void alphaselect_apply( VJFrame *frame, int i_angle, int r, int g, int b, int swap) { uint8_t *fg_cb, *fg_cr; int accept_angle_tg; int cb, cr; - float kg1, tmp, aa = 255.0f, bb = 255.0f, _y = 0; + float kg1, tmp, aa = 255.0f, bb = 255.0f; float angle = (float) i_angle / 100.0f; unsigned int pos; uint8_t val; + const int len = frame->len; uint8_t *Y = frame->data[0]; uint8_t *Cb = frame->data[1]; uint8_t *Cr = frame->data[2]; @@ -94,7 +90,6 @@ void alphaselect_apply( VJFrame *frame, int width, int iy=0,iu=128,iv=128; _rgb2yuv(r,g,b,iy,iu,iv); - _y = (float) iy; aa = (float) iu; bb = (float) iv; @@ -113,7 +108,7 @@ void alphaselect_apply( VJFrame *frame, int width, fg_cr = Cr; if( swap == 0 ) { - for (pos = (width * height); pos != 0; pos--) { + for (pos = len; pos != 0; pos--) { short xx, yy; xx = (((fg_cb[pos]) * cb) + ((fg_cr[pos]) * cr)) >> 7; yy = (((fg_cr[pos]) * cb) - ((fg_cb[pos]) * cr)) >> 7; @@ -133,7 +128,7 @@ void alphaselect_apply( VJFrame *frame, int width, } } else { - for (pos = (width * height); pos != 0; pos--) { + for (pos = len; pos != 0; pos--) { short xx, yy; xx = (((fg_cb[pos]) * cb) + ((fg_cr[pos]) * cr)) >> 7; yy = (((fg_cr[pos]) * cb) - ((fg_cb[pos]) * cr)) >> 7; @@ -153,4 +148,3 @@ void alphaselect_apply( VJFrame *frame, int width, } } } - diff --git a/veejay-current/veejay-server/libvje/effects/alphaselect.h b/veejay-current/veejay-server/libvje/effects/alphaselect.h index 080c46ea..7aec0194 100644 --- a/veejay-current/veejay-server/libvje/effects/alphaselect.h +++ b/veejay-current/veejay-server/libvje/effects/alphaselect.h @@ -20,13 +20,7 @@ #ifndef ALPHASELECT_H #define ALPHASELECT_H -#include -#include -#include - vj_effect *alphaselect_init(); -void alphaselect_apply( VJFrame *frame, int width, - int height, int i_angle, - int red, int green, int blue, int swap); +void alphaselect_apply( VJFrame *frame, int i_angle, int red, int green, int blue, int swap); void alphaselect_free(); #endif diff --git a/veejay-current/veejay-server/libvje/effects/alphaselect2.c b/veejay-current/veejay-server/libvje/effects/alphaselect2.c index c16fd97c..09bf0f24 100644 --- a/veejay-current/veejay-server/libvje/effects/alphaselect2.c +++ b/veejay-current/veejay-server/libvje/effects/alphaselect2.c @@ -22,11 +22,8 @@ * originally from http://gc-films.com/chromakey.html */ -#include -#include -#include -#include #include "common.h" +#include #include "alphaselect2.h" vj_effect *alphaselect2_init(int w, int h) @@ -92,7 +89,7 @@ void alphaselect2_apply( VJFrame *frame,int tola, int r, int g, int b, int tolb,int alpha) { unsigned int pos; - const unsigned int len = frame->len; + const int len = frame->len; uint8_t *Y = frame->data[0]; uint8_t *Cb = frame->data[1]; uint8_t *Cr = frame->data[2]; diff --git a/veejay-current/veejay-server/libvje/effects/alphaselect2.h b/veejay-current/veejay-server/libvje/effects/alphaselect2.h index 9d744cdf..fcd82968 100644 --- a/veejay-current/veejay-server/libvje/effects/alphaselect2.h +++ b/veejay-current/veejay-server/libvje/effects/alphaselect2.h @@ -20,10 +20,6 @@ #ifndef ALPHASELECT2_H #define ALPHASELECT2_H -#include -#include -#include - vj_effect *alphaselect2_init(); void alphaselect2_apply( VJFrame *frame, int tola,int red,int green,int blue, int tolb,int use_alpha); #endif diff --git a/veejay-current/veejay-server/libvje/effects/alphatransition.c b/veejay-current/veejay-server/libvje/effects/alphatransition.c index d40cf2a5..4f022cb8 100644 --- a/veejay-current/veejay-server/libvje/effects/alphatransition.c +++ b/veejay-current/veejay-server/libvje/effects/alphatransition.c @@ -18,13 +18,10 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 , USA. */ -#include -#include -#include -#include -#include "alphatransition.h" -#include #include "common.h" +#include +#include +#include "alphatransition.h" /* almost the same as masktransition.c, but adding threshold and direction parameters */ diff --git a/veejay-current/veejay-server/libvje/effects/alphatransition.h b/veejay-current/veejay-server/libvje/effects/alphatransition.h index f79aae1b..4437cab5 100644 --- a/veejay-current/veejay-server/libvje/effects/alphatransition.h +++ b/veejay-current/veejay-server/libvje/effects/alphatransition.h @@ -20,10 +20,6 @@ #ifndef ALPHATRANSITION_H #define ALPHATRANSITION_H -#include -#include -#include - void alphatransition_apply( VJFrame *frame, VJFrame *frame2, int index, int duration, int dir, int threshold); vj_effect *alphatransition_init(int w, int h); #endif diff --git a/veejay-current/veejay-server/libvje/effects/autoeq.c b/veejay-current/veejay-server/libvje/effects/autoeq.c index f46f0279..8877abe2 100644 --- a/veejay-current/veejay-server/libvje/effects/autoeq.c +++ b/veejay-current/veejay-server/libvje/effects/autoeq.c @@ -17,13 +17,11 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 , USA. */ -#include -#include -#include + +#include "common.h" #include #include "autoeq.h" -#include -#include "common.h" + vj_effect *autoeq_init(int w, int h) { vj_effect *ve = (vj_effect *) vj_calloc(sizeof(vj_effect)); @@ -73,19 +71,21 @@ void autoeq_free() } -void autoeq_apply( VJFrame *frame, int width, int height, int val, int intensity, int strength) +void autoeq_apply( VJFrame *frame, int val, int intensity, int strength) { + const int len = frame->len; + const int uv_len = frame->uv_len; if( val == 0 ) { VJFrame tmp; veejay_memcpy( &tmp, frame, sizeof(VJFrame)); - tmp.data[0] = (uint8_t*) vj_malloc( sizeof(uint8_t) * frame->len ); - vj_frame_copy1( frame->data[0], tmp.data[0], frame->len ); + tmp.data[0] = (uint8_t*) vj_malloc( sizeof(uint8_t) * len ); + vj_frame_copy1( frame->data[0], tmp.data[0], len ); veejay_histogram_draw( histogram_,&tmp, frame, intensity, strength ); - vj_frame_clear1( frame->data[1], 128, frame->uv_len ); - vj_frame_clear1( frame->data[2], 128, frame->uv_len ); + vj_frame_clear1( frame->data[1], 128, uv_len ); + vj_frame_clear1( frame->data[2], 128, uv_len ); free(tmp.data[0]); } diff --git a/veejay-current/veejay-server/libvje/effects/autoeq.h b/veejay-current/veejay-server/libvje/effects/autoeq.h index 9a5f175e..ba872f91 100644 --- a/veejay-current/veejay-server/libvje/effects/autoeq.h +++ b/veejay-current/veejay-server/libvje/effects/autoeq.h @@ -20,12 +20,8 @@ #ifndef AUTOEQ_H #define AUTOEQ_H -#include -#include -#include - vj_effect *autoeq_init(int w, int h); int autoeq_malloc(int w , int h ); void autoeq_free( ); -void autoeq_apply( VJFrame *frame, int width, int height, int val, int intensity, int strength); +void autoeq_apply( VJFrame *frame, int val, int intensity, int strength); #endif diff --git a/veejay-current/veejay-server/libvje/effects/average-blend.c b/veejay-current/veejay-server/libvje/effects/average-blend.c index 39770128..1c3a6a2e 100644 --- a/veejay-current/veejay-server/libvje/effects/average-blend.c +++ b/veejay-current/veejay-server/libvje/effects/average-blend.c @@ -18,11 +18,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 , USA. */ -#include -#include -#include -#include -#include +#include "common.h" #include #include #include "average-blend.h" @@ -48,8 +44,7 @@ vj_effect *average_blend_init(int w, int h) return ve; } -static void average_blend_apply1( VJFrame *frame, VJFrame *frame2, int width, - int height, int average_blend) +static void average_blend_apply1( VJFrame *frame, VJFrame *frame2, int average_blend) { unsigned int i; for( i = 0; i < average_blend; i ++ ) { @@ -70,24 +65,22 @@ static void average_blend_apply_job( void *arg ) } } -void average_blend_apply( VJFrame *frame, VJFrame *frame2, int width, - int height, int average_blend) +void average_blend_apply( VJFrame *frame, VJFrame *frame2, int average_blend) { - average_blend_apply1( frame,frame2,width,height,average_blend ); + average_blend_apply1( frame,frame2,average_blend ); } -void average_blend_applyN( VJFrame *frame, VJFrame *frame2, int width, - int height, int average_blend) +void average_blend_applyN( VJFrame *frame, VJFrame *frame2,int average_blend) { if( vj_task_available() ) { vj_task_set_from_frame( frame ); vj_task_set_param( average_blend,0 ); vj_task_run( frame->data, frame2->data, NULL, NULL, 3, (performer_job_routine) &average_blend_apply_job ); } else { - average_blend_apply1( frame,frame2,width,height,average_blend ); + average_blend_apply1( frame,frame2,average_blend ); } } - + static void average_blend_blend_apply1( uint8_t *src1[3], uint8_t *src2[3], int len, int uv_len, int average_blend ) { } diff --git a/veejay-current/veejay-server/libvje/effects/average-blend.h b/veejay-current/veejay-server/libvje/effects/average-blend.h index d9d0e540..b8051763 100644 --- a/veejay-current/veejay-server/libvje/effects/average-blend.h +++ b/veejay-current/veejay-server/libvje/effects/average-blend.h @@ -20,14 +20,10 @@ #ifndef AVERAGEBLEND_H #define AVERAGEBLEND_H -#include -#include -#include - vj_effect *average_blend_init(); -void average_blend_apply( VJFrame *frame, VJFrame *frame2, int width,int height, int average_blend); +void average_blend_apply( VJFrame *frame, VJFrame *frame2, int average_blend); void average_blend_blend_luma_apply( uint8_t *src, uint8_t *dst, int len, int average_blend ); void average_blend_blend_apply( uint8_t *src[3], uint8_t *dst[3], int len, int uv_len, int average_blend ); -void average_blend_applyN( VJFrame *frame, VJFrame *frame2, int width, int height, int average_blend); +void average_blend_applyN( VJFrame *frame, VJFrame *frame2, int average_blend); void average_blend_free(); #endif diff --git a/veejay-current/veejay-server/libvje/effects/average.c b/veejay-current/veejay-server/libvje/effects/average.c index 57d203ab..eb52f839 100644 --- a/veejay-current/veejay-server/libvje/effects/average.c +++ b/veejay-current/veejay-server/libvje/effects/average.c @@ -17,12 +17,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 , USA. */ -#include -#include -#include + +#include "common.h" #include #include "average.h" -#include "common.h" static double *running_sum[4] = { NULL, NULL, NULL, NULL }; static int last_params[2] = { 0,0 }; diff --git a/veejay-current/veejay-server/libvje/effects/average.h b/veejay-current/veejay-server/libvje/effects/average.h index b5ef7fce..0f1fe3f8 100644 --- a/veejay-current/veejay-server/libvje/effects/average.h +++ b/veejay-current/veejay-server/libvje/effects/average.h @@ -20,10 +20,6 @@ #ifndef AVERAGE_H #define AVERAGE_H -#include -#include -#include - vj_effect *average_init(); void average_apply(VJFrame *src, int sum, int mode); void average_free(); diff --git a/veejay-current/veejay-server/libvje/effects/baltantv.c b/veejay-current/veejay-server/libvje/effects/baltantv.c index 08b76130..5307b329 100644 --- a/veejay-current/veejay-server/libvje/effects/baltantv.c +++ b/veejay-current/veejay-server/libvje/effects/baltantv.c @@ -22,12 +22,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 , USA. */ -#include -#include -#include + +#include "common.h" #include #include "baltantv.h" -#include "common.h" vj_effect *baltantv_init(int w, int h) { @@ -84,23 +82,23 @@ void baltantv_free() planetable_ = NULL; } -void baltantv_apply( VJFrame *frame, int width, int height, int stride, int mode) +void baltantv_apply( VJFrame *frame, int stride, int mode) { unsigned int i,cf; - const int len = (width * height); + const int len = frame->len; uint8_t *Y = frame->data[0]; - uint8_t *pDst = planetable_ + (plane_ * frame->len); + uint8_t *pDst = planetable_ + (plane_ * len); for( i = 0; i < len ; i ++ ) pDst[i] = (Y[i] >> 2 ); - cf = plane_ & (stride-1); + cf = plane_ & (stride-1); uint8_t *pSrc[4] = { - planetable_ + (cf * frame->len), - planetable_ + ((cf+stride) * frame->len), - planetable_ + ((cf+stride*2) * frame->len), - planetable_ + ((cf+stride*3) * frame->len) + planetable_ + (cf * len), + planetable_ + ((cf+stride) * len), + planetable_ + ((cf+stride*2) * len), + planetable_ + ((cf+stride*3) * len) }; if( mode == 0 ) diff --git a/veejay-current/veejay-server/libvje/effects/baltantv.h b/veejay-current/veejay-server/libvje/effects/baltantv.h index a8d8581e..48dcf78e 100644 --- a/veejay-current/veejay-server/libvje/effects/baltantv.h +++ b/veejay-current/veejay-server/libvje/effects/baltantv.h @@ -20,12 +20,8 @@ #ifndef BALTAN_TVH #define BALTAN_TVH -#include -#include -#include - vj_effect *baltantv_init(int w, int h); -void baltantv_apply( VJFrame *frame, int width, int height, int stride, int mode); +void baltantv_apply( VJFrame *frame, int stride, int mode); int baltantv_malloc(int w, int h ); void baltantv_free(); #endif diff --git a/veejay-current/veejay-server/libvje/effects/bathroom.c b/veejay-current/veejay-server/libvje/effects/bathroom.c index 914869e7..3f850b47 100644 --- a/veejay-current/veejay-server/libvje/effects/bathroom.c +++ b/veejay-current/veejay-server/libvje/effects/bathroom.c @@ -24,13 +24,10 @@ to set the distance and mode */ -#include -#include -#include -#include +#include "common.h" #include #include "bathroom.h" -#include "common.h" + static uint8_t *bathroom_frame[4] = { NULL,NULL,NULL,NULL }; vj_effect *bathroom_init(int width,int height) @@ -97,8 +94,8 @@ void bathroom_free() { static void bathroom_verti_apply(VJFrame *frame, int val, int x0, int x1) { - const int width = frame->width; - const int height = frame->height; + const unsigned int width = frame->width; + const unsigned int height = frame->height; const int len = frame->len; unsigned int y_val = val; unsigned int x,y; @@ -125,8 +122,8 @@ static void bathroom_verti_apply(VJFrame *frame, int val, int x0, int x1) static void bathroom_alpha_verti_apply(VJFrame *frame, int val, int x0, int x1) { - const int width = frame->width; - const int height = frame->height; + const unsigned int width = frame->width; + const unsigned int height = frame->height; const int len = frame->len; unsigned int y_val = val; unsigned int x,y; @@ -156,8 +153,8 @@ static void bathroom_alpha_verti_apply(VJFrame *frame, int val, int x0, int x1) static void bathroom_hori_apply(VJFrame *frame, int val, int x0, int x1) { - const int width = frame->width; - const int height = frame->height; + const unsigned int width = frame->width; + const unsigned int height = frame->height; const int len = frame->len; unsigned int y_val = val; uint8_t *Y = frame->data[0]; @@ -183,8 +180,8 @@ static void bathroom_hori_apply(VJFrame *frame, int val, int x0, int x1) static void bathroom_alpha_hori_apply(VJFrame *frame, int val, int x0, int x1) { - const int width = frame->width; - const int height = frame->height; + const unsigned int width = frame->width; + const unsigned int height = frame->height; const int len = frame->len; unsigned int y_val = val; uint8_t *Y = frame->data[0]; diff --git a/veejay-current/veejay-server/libvje/effects/bathroom.h b/veejay-current/veejay-server/libvje/effects/bathroom.h index 17a776cf..7b6d2f22 100644 --- a/veejay-current/veejay-server/libvje/effects/bathroom.h +++ b/veejay-current/veejay-server/libvje/effects/bathroom.h @@ -20,10 +20,6 @@ #ifndef BATHROOM_H #define BATHROOM_H -#include -#include -#include - vj_effect *bathroom_init(int w, int h); int bathroom_malloc(int w, int h); void bathroom_free(); diff --git a/veejay-current/veejay-server/libvje/effects/bgpush.c b/veejay-current/veejay-server/libvje/effects/bgpush.c index f600eddc..0773c9bd 100644 --- a/veejay-current/veejay-server/libvje/effects/bgpush.c +++ b/veejay-current/veejay-server/libvje/effects/bgpush.c @@ -17,13 +17,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 , USA. */ -#include -#include -#include -#include + +#include "common.h" #include #include -#include "common.h" #include "bgpush.h" static uint8_t *frame_data = NULL; diff --git a/veejay-current/veejay-server/libvje/effects/bgsubtract.c b/veejay-current/veejay-server/libvje/effects/bgsubtract.c index 96547113..6d2ba55c 100644 --- a/veejay-current/veejay-server/libvje/effects/bgsubtract.c +++ b/veejay-current/veejay-server/libvje/effects/bgsubtract.c @@ -17,16 +17,13 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 , USA. */ -#include -#include -#include -#include "bgsubtract.h" + #include "common.h" -#include -#include +#include #include -#include "softblur.h" #include +#include "softblur.h" +#include "bgsubtract.h" static uint8_t *static_bg__ = NULL; static uint8_t *bg_frame__[4] = { NULL,NULL,NULL,NULL }; @@ -193,9 +190,10 @@ static void bgsubtract_show_bg( VJFrame *frame ) } } -void bgsubtract_apply(VJFrame *frame,int width, int height, int threshold, int method, int enabled, int alpha ) +void bgsubtract_apply(VJFrame *frame,int threshold, int method, int enabled, int alpha ) { - const int uv_len = (frame->ssm ? frame->len : frame->uv_len ); + const int len = frame->len; + const int uv_len = (frame->ssm ? len : frame->uv_len ); if( auto_hist ) vje_histogram_auto_eq( frame ); @@ -206,12 +204,12 @@ void bgsubtract_apply(VJFrame *frame,int width, int height, int threshold, int m bgsubtract_show_bg( frame ); break; case 1: - bgsubtract_cma_frame( frame->len, frame->data[0], bg_frame__[0] ); + bgsubtract_cma_frame( len, frame->data[0], bg_frame__[0] ); bgsubtract_show_bg( frame ); bg_n ++; break; case 2: - bgsubtract_avg_frame( frame->len, frame->data[0], bg_frame__[0] ); + bgsubtract_avg_frame( len, frame->data[0], bg_frame__[0] ); bgsubtract_show_bg( frame ); break; default: @@ -222,10 +220,10 @@ void bgsubtract_apply(VJFrame *frame,int width, int height, int threshold, int m if( alpha == 0 ) { veejay_memset( frame->data[1], 128, uv_len ); veejay_memset( frame->data[2], 128, uv_len ); - vje_diff_plane( bg_frame__[0], frame->data[0], frame->data[0], threshold, frame->len ); + vje_diff_plane( bg_frame__[0], frame->data[0], frame->data[0], threshold, len ); } else { - vje_diff_plane( bg_frame__[0], frame->data[0], frame->data[3], threshold, frame->len ); + vje_diff_plane( bg_frame__[0], frame->data[0], frame->data[3], threshold, len ); } } } diff --git a/veejay-current/veejay-server/libvje/effects/bgsubtract.h b/veejay-current/veejay-server/libvje/effects/bgsubtract.h index f1486e31..8a84eb8e 100644 --- a/veejay-current/veejay-server/libvje/effects/bgsubtract.h +++ b/veejay-current/veejay-server/libvje/effects/bgsubtract.h @@ -20,15 +20,11 @@ #ifndef BGSUBTRACT_H #define BGSUBTRACT_H -#include -#include -#include - vj_effect *bgsubtract_init(int width, int height); int bgsubtract_instances(); void bgsubtract_free(); int bgsubtract_malloc(int w, int h); int bgsubtract_prepare(VJFrame *frame); -void bgsubtract_apply(VJFrame *frame,int width,int height,int threshold, int method, int enabled, int to_alpha); +void bgsubtract_apply(VJFrame *frame,int threshold, int method, int enabled, int to_alpha); uint8_t *bgsubtract_get_bg_frame(unsigned int plane); #endif diff --git a/veejay-current/veejay-server/libvje/effects/binaryoverlays.c b/veejay-current/veejay-server/libvje/effects/binaryoverlays.c index 8997c7c3..d48d51eb 100644 --- a/veejay-current/veejay-server/libvje/effects/binaryoverlays.c +++ b/veejay-current/veejay-server/libvje/effects/binaryoverlays.c @@ -17,12 +17,9 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 , USA. */ -#include -#include +#include "common.h" #include -#include #include "binaryoverlays.h" -#include vj_effect *binaryoverlay_init(int w, int h) { @@ -305,21 +302,24 @@ static void _binary_and( VJFrame *frame, VJFrame *frame2, int w, int h ) -void binaryoverlay_apply( VJFrame *frame, VJFrame *frame2, int w, int h, int mode ) +void binaryoverlay_apply( VJFrame *frame, VJFrame *frame2, int mode ) { + const unsigned int width = frame->width; + const unsigned int height = frame->height; + switch(mode) { - case 0: _binary_not_and( frame,frame2,w,h ); break;// not a and not b - case 1: _binary_not_or( frame,frame2,w,h); break; // not a or not b - case 2: _binary_not_xor( frame,frame2,w,h); break; // not a xor not b - case 3: _binary_not_and_lh( frame,frame2,w,h ); break; // a and not b - case 4: _binary_not_or_lh( frame,frame2,w,h); break; // a or not b - case 5: _binary_not_xor_lh( frame,frame2,w,h); break; // a xor not b - case 6: _binary_not_and_rh (frame,frame2,w,h); break; // a and not b - case 7: _binary_not_or_rh( frame,frame2,w,h); break; // a or not b - case 8: _binary_or( frame,frame2,w,h); break; // a or b - case 9: _binary_and( frame,frame2,w,h); break; // a and b - case 10: _binary_not_xor_rh(frame,frame2,w,h); break; + case 0: _binary_not_and( frame,frame2,width, height ); break;// not a and not b + case 1: _binary_not_or( frame,frame2,width, height); break; // not a or not b + case 2: _binary_not_xor( frame,frame2,width, height); break; // not a xor not b + case 3: _binary_not_and_lh( frame,frame2,width, height ); break; // a and not b + case 4: _binary_not_or_lh( frame,frame2,width, height); break; // a or not b + case 5: _binary_not_xor_lh( frame,frame2,width, height); break; // a xor not b + case 6: _binary_not_and_rh (frame,frame2,width, height); break; // a and not b + case 7: _binary_not_or_rh( frame,frame2,width, height); break; // a or not b + case 8: _binary_or( frame,frame2,width, height); break; // a or b + case 9: _binary_and( frame,frame2,width, height); break; // a and b + case 10: _binary_not_xor_rh(frame,frame2,width, height); break; } } diff --git a/veejay-current/veejay-server/libvje/effects/binaryoverlays.h b/veejay-current/veejay-server/libvje/effects/binaryoverlays.h index a6e9d5ff..9f5bbae2 100644 --- a/veejay-current/veejay-server/libvje/effects/binaryoverlays.h +++ b/veejay-current/veejay-server/libvje/effects/binaryoverlays.h @@ -20,14 +20,7 @@ #ifndef BINARYOVERLAYS_H #define BINARYOVERLAYS_H -#include -#include -#include - vj_effect *binaryoverlay_init(int w, int h); - -void binaryoverlay_apply(VJFrame *frame, VJFrame *frame2, int width, - int height, int n); - +void binaryoverlay_apply(VJFrame *frame, VJFrame *frame2, int n); void magicoverlays_free(); #endif diff --git a/veejay-current/veejay-server/libvje/effects/blob.c b/veejay-current/veejay-server/libvje/effects/blob.c index 84079633..8da5aad4 100644 --- a/veejay-current/veejay-server/libvje/effects/blob.c +++ b/veejay-current/veejay-server/libvje/effects/blob.c @@ -48,11 +48,8 @@ */ -#include -#include -#include -#include #include "common.h" +#include #include "blob.h" typedef struct @@ -213,10 +210,11 @@ static blob_func blob_render(void) return &blob_render_circle; } -void blob_apply(VJFrame *frame, - int width, int height, int radius, int num, int speed, int shape) +void blob_apply(VJFrame *frame, int radius, int num, int speed, int shape) { - const int len = frame->len; + const unsigned int width = frame->width; + const unsigned int height = frame->height; + const int len = frame->len; uint8_t *srcY = frame->data[0]; uint8_t *srcCb= frame->data[1]; uint8_t *srcCr= frame->data[2]; diff --git a/veejay-current/veejay-server/libvje/effects/blob.h b/veejay-current/veejay-server/libvje/effects/blob.h index 881029f3..f1f9606e 100644 --- a/veejay-current/veejay-server/libvje/effects/blob.h +++ b/veejay-current/veejay-server/libvje/effects/blob.h @@ -20,13 +20,8 @@ #ifndef BLOB_H #define BLOB_H -#include -#include -#include - vj_effect *blob_init(int w, int h); -void blob_apply( VJFrame *frame, int width, int height, int p0,int p1, int p2, int p3); +void blob_apply( VJFrame *frame, int p0,int p1, int p2, int p3); int blob_malloc( int w, int h ); void blob_free(void); - #endif diff --git a/veejay-current/veejay-server/libvje/effects/boids.c b/veejay-current/veejay-server/libvje/effects/boids.c index 3482422d..4a741315 100644 --- a/veejay-current/veejay-server/libvje/effects/boids.c +++ b/veejay-current/veejay-server/libvje/effects/boids.c @@ -56,15 +56,10 @@ */ -#include -#include -#include -#include -#include #include "common.h" +#include #include "boids.h" - typedef struct { short x; // x @@ -333,9 +328,11 @@ static void boid_rule4_( int boid_id, int vlim ) blobs_[boid_id].vy = ( blobs_[boid_id].vy / fabs( blobs_[boid_id].vy) ) * vlim; } -void boids_apply(VJFrame *frame, - int width, int height, int radius, int num, int shape, int m1, int m2, int m3, int speed, int home_radius ) +void boids_apply(VJFrame *frame, int radius, int num, int shape, int m1, int m2, + int m3, int speed, int home_radius ) { + const unsigned int width = frame->width; + const unsigned int height = frame->height; const int len = frame->len; uint8_t *srcY = frame->data[0]; uint8_t *srcCb= frame->data[1]; diff --git a/veejay-current/veejay-server/libvje/effects/boids.h b/veejay-current/veejay-server/libvje/effects/boids.h index 0c0ebfb7..f2a19244 100644 --- a/veejay-current/veejay-server/libvje/effects/boids.h +++ b/veejay-current/veejay-server/libvje/effects/boids.h @@ -20,13 +20,9 @@ #ifndef BOIDS_H #define BOIDS_H -#include -#include -#include - vj_effect *boids_init(int w, int h); -void boids_apply( VJFrame *frame, int width, int height, int p0,int p1, int p2, int p3, int p4, int p5, int p6, int p7); +void boids_apply( VJFrame *frame, int p0,int p1, int p2, int p3, int p4, int p5, + int p6, int p7); int boids_malloc( int w, int h ); void boids_free(void); - #endif diff --git a/veejay-current/veejay-server/libvje/effects/borders.c b/veejay-current/veejay-server/libvje/effects/borders.c index c52259b0..d823e0e7 100644 --- a/veejay-current/veejay-server/libvje/effects/borders.c +++ b/veejay-current/veejay-server/libvje/effects/borders.c @@ -17,12 +17,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 , USA. */ -#include -#include -#include + +#include "common.h" #include #include "borders.h" -#include "common.h" vj_effect *borders_init(int width,int height) { diff --git a/veejay-current/veejay-server/libvje/effects/bwotsu.c b/veejay-current/veejay-server/libvje/effects/bwotsu.c index d6cb246b..b03acb24 100644 --- a/veejay-current/veejay-server/libvje/effects/bwotsu.c +++ b/veejay-current/veejay-server/libvje/effects/bwotsu.c @@ -17,12 +17,11 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 , USA. */ -#include -#include -#include -#include -#include "bwotsu.h" + #include "common.h" +#include +#include "bwotsu.h" + vj_effect *bwotsu_init(int w, int h) { vj_effect *ve = (vj_effect *) vj_calloc(sizeof(vj_effect)); @@ -129,8 +128,8 @@ void bwotsu_apply(VJFrame *frame, int mode, int skew, int invert) else Y[i] = h; } - veejay_memset( frame->data[1], 128, (frame->ssm ? frame->len : frame->uv_len) ); - veejay_memset( frame->data[2], 128, (frame->ssm ? frame->len : frame->uv_len) ); + veejay_memset( frame->data[1], 128, (frame->ssm ? len : frame->uv_len) ); + veejay_memset( frame->data[2], 128, (frame->ssm ? len : frame->uv_len) ); break; case 1: diff --git a/veejay-current/veejay-server/libvje/effects/bwotsu.h b/veejay-current/veejay-server/libvje/effects/bwotsu.h index 6bbe7f64..a4d19fd9 100644 --- a/veejay-current/veejay-server/libvje/effects/bwotsu.h +++ b/veejay-current/veejay-server/libvje/effects/bwotsu.h @@ -20,10 +20,6 @@ #ifndef BWOTSU_H #define BWOTSU_H -#include -#include -#include - vj_effect *bwotsu_init(); void bwotsu_apply(VJFrame *frame, int mode, int skew, int invert ); #endif diff --git a/veejay-current/veejay-server/libvje/effects/bwselect.c b/veejay-current/veejay-server/libvje/effects/bwselect.c index 3fd121f5..4ddc972d 100644 --- a/veejay-current/veejay-server/libvje/effects/bwselect.c +++ b/veejay-current/veejay-server/libvje/effects/bwselect.c @@ -18,11 +18,11 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 , USA. */ -#include -#include + +#include "common.h" #include #include "bwselect.h" -#include "common.h" + vj_effect *bwselect_init(int w, int h) { vj_effect *ve = (vj_effect *) vj_calloc(sizeof(vj_effect)); @@ -79,8 +79,7 @@ static void gamma_setup(double gamma_value) void bwselect_apply(VJFrame *frame, int min_threshold, int max_threshold, int gamma, int mode) { int r,c; - const int width = frame->width; - const int height = frame->height; + const unsigned int width = frame->width; const int len = frame->len; uint8_t *Y = frame->data[0]; uint8_t *Cb = frame->data[1]; @@ -100,8 +99,8 @@ void bwselect_apply(VJFrame *frame, int min_threshold, int max_threshold, int ga } } } - veejay_memset(Cb, 128, (frame->ssm ? frame->len : frame->uv_len)); - veejay_memset(Cr, 128, (frame->ssm ? frame->len : frame->uv_len)); + veejay_memset(Cb, 128, (frame->ssm ? len : frame->uv_len)); + veejay_memset(Cr, 128, (frame->ssm ? len : frame->uv_len)); } else { uint8_t *aA = frame->data[3]; @@ -137,8 +136,8 @@ void bwselect_apply(VJFrame *frame, int min_threshold, int max_threshold, int ga } } } - veejay_memset(Cb, 128, (frame->ssm ? frame->len : frame->uv_len)); - veejay_memset(Cr, 128, (frame->ssm ? frame->len : frame->uv_len)); + veejay_memset(Cb, 128, (frame->ssm ? len : frame->uv_len)); + veejay_memset(Cr, 128, (frame->ssm ? len : frame->uv_len)); } else { uint8_t *aA = frame->data[3]; diff --git a/veejay-current/veejay-server/libvje/effects/bwselect.h b/veejay-current/veejay-server/libvje/effects/bwselect.h index b16d61cf..dae64cbe 100644 --- a/veejay-current/veejay-server/libvje/effects/bwselect.h +++ b/veejay-current/veejay-server/libvje/effects/bwselect.h @@ -20,10 +20,6 @@ #ifndef BWSELECT_H #define BWSELECT_H -#include -#include -#include - vj_effect *bwselect_init(); void bwselect_apply(VJFrame *frame, int min_threshold,int max_threshold, int mode, int gamma); #endif diff --git a/veejay-current/veejay-server/libvje/effects/cali.c b/veejay-current/veejay-server/libvje/effects/cali.c index ca416ee6..72361796 100644 --- a/veejay-current/veejay-server/libvje/effects/cali.c +++ b/veejay-current/veejay-server/libvje/effects/cali.c @@ -17,19 +17,12 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 , USA. */ -#include -#include -#include -#include -#include +#include "common.h" #include -#include -#include #include #include -#include "common.h" -#include "cali.h" #include "softblur.h" +#include "cali.h" typedef struct { @@ -111,7 +104,7 @@ void cali_free(void *d) static int flood =0; -void cali_apply(void *ed, VJFrame *frame, int w, int h,int mode, int full) +void cali_apply(void *ed, VJFrame *frame,int mode, int full) { cali_data *c = (cali_data*) ed; @@ -129,24 +122,25 @@ void cali_apply(void *ed, VJFrame *frame, int w, int h,int mode, int full) uint8_t *Y = frame->data[0]; uint8_t *U = frame->data[1]; uint8_t *V = frame->data[2]; - const int chroma = 127; + const int chroma = 127; const int uv_len = frame->uv_len; + const int len = frame->len; int p,i; - const int len = w*h; + if( mode == 1 ) { //@ just show dark frame - veejay_memcpy(Y, c->b[0], (w*h)); + veejay_memcpy(Y, c->b[0], (len)); veejay_memcpy(U, c->b[1], uv_len); veejay_memcpy(V, c->b[2], uv_len); return; } else if ( mode == 2 ) { //@ just show light frame - veejay_memcpy(Y, c->l[0], (w*h)); + veejay_memcpy(Y, c->l[0], (len)); veejay_memcpy(U, c->l[1], uv_len); veejay_memcpy(V, c->l[2], uv_len); return; } else if ( mode == 3 ) { - veejay_memcpy(Y, c->m[0], (w*h)); + veejay_memcpy(Y, c->m[0], (len)); veejay_memcpy(U, c->m[1], uv_len); veejay_memcpy(V, c->m[2], uv_len); return; @@ -195,7 +189,7 @@ void cali_apply(void *ed, VJFrame *frame, int w, int h,int mode, int full) } else { //@ just show result of frame - dark current - for( i = 0; i <(w*h); i ++ ) { + for( i = 0; i <(len); i ++ ) { p = ( Y[i] - by[i] ); if( p < 0 ) Y[i] = pixel_Y_lo_; @@ -218,7 +212,3 @@ void cali_apply(void *ed, VJFrame *frame, int w, int h,int mode, int full) } } - - - - diff --git a/veejay-current/veejay-server/libvje/effects/cali.h b/veejay-current/veejay-server/libvje/effects/cali.h index f60e582f..be38056e 100644 --- a/veejay-current/veejay-server/libvje/effects/cali.h +++ b/veejay-current/veejay-server/libvje/effects/cali.h @@ -24,5 +24,5 @@ vj_effect *cali_init(int width, int height); void cali_free(void *d); int cali_malloc(void **c, int w, int h); int cali_prepare( void *ed, double meanY, double meanU, double meanV, uint8_t *data, int len, int uv_len ); -void cali_apply(void *d , VJFrame *frame,int width, int height, int mode, int full); +void cali_apply(void *d , VJFrame *frame, int mode, int full); #endif diff --git a/veejay-current/veejay-server/libvje/effects/cartonize.c b/veejay-current/veejay-server/libvje/effects/cartonize.c index 9e690e34..ca36347c 100644 --- a/veejay-current/veejay-server/libvje/effects/cartonize.c +++ b/veejay-current/veejay-server/libvje/effects/cartonize.c @@ -17,9 +17,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 , USA. */ -#include -#include -#include + +#include "common.h" #include #include "cartonize.h" @@ -51,13 +50,13 @@ vj_effect *cartonize_init(int w, int h) return ve; } -void cartonize_apply( VJFrame *frame, int width, int height, int b1, int b2, int b3) +void cartonize_apply( VJFrame *frame, int b1, int b2, int b3) { unsigned int i; - int len = (width * height); - int uv_len = (frame->ssm ? frame->len : frame->uv_len); - uint8_t tmp; - int p; + const int len = frame->len; + int uv_len = (frame->ssm ? len : frame->uv_len); + uint8_t tmp; + int p; uint8_t *Y = frame->data[0]; uint8_t *Cb = frame->data[1]; uint8_t *Cr = frame->data[2]; @@ -68,7 +67,7 @@ void cartonize_apply( VJFrame *frame, int width, int height, int b1, int b2, int // ubase/vbase cannot be 0 if(ubase==0) ubase=1; if(vbase==0) vbase=1; - for( i = 0 ; i < len ; i ++ ) + for( i = 0 ; i < len ; i ++ ) { tmp = Y[i]; Y[i] = (tmp / base) * base; // loose fractional part diff --git a/veejay-current/veejay-server/libvje/effects/cartonize.h b/veejay-current/veejay-server/libvje/effects/cartonize.h index b93ced41..825495e5 100644 --- a/veejay-current/veejay-server/libvje/effects/cartonize.h +++ b/veejay-current/veejay-server/libvje/effects/cartonize.h @@ -20,10 +20,6 @@ #ifndef CARTONIZE_H #define CARTONIZE_H -#include -#include -#include - vj_effect *cartonize_init(int w, int h); -void cartonize_apply( VJFrame *frame, int width, int height, int b1, int b2, int b3); +void cartonize_apply( VJFrame *frame, int b1, int b2, int b3); #endif diff --git a/veejay-current/veejay-server/libvje/effects/chameleon.c b/veejay-current/veejay-server/libvje/effects/chameleon.c index 6275749a..0db0f4fa 100644 --- a/veejay-current/veejay-server/libvje/effects/chameleon.c +++ b/veejay-current/veejay-server/libvje/effects/chameleon.c @@ -22,15 +22,13 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 , USA. */ -#include -#include -#include -#include + +#include "common.h" #include #include -#include "chameleon.h" -#include "common.h" #include "softblur.h" +#include "chameleon.h" + vj_effect *chameleon_init(int w, int h) { vj_effect *ve = (vj_effect *) vj_calloc(sizeof(vj_effect)); @@ -237,9 +235,9 @@ static void drawDisappearing(VJFrame *src, VJFrame *dest) plane = plane & (PLANES-1); } -void chameleon_apply( VJFrame *frame, int width, int height, int mode) +void chameleon_apply( VJFrame *frame, int mode) { - const int len = (width * height); + const int len = frame->len; VJFrame source; int strides[4] = { len, len, len, 0 }; vj_frame_copy( frame->data, tmpimage, strides ); diff --git a/veejay-current/veejay-server/libvje/effects/chameleon.h b/veejay-current/veejay-server/libvje/effects/chameleon.h index 42f5052d..9d877961 100644 --- a/veejay-current/veejay-server/libvje/effects/chameleon.h +++ b/veejay-current/veejay-server/libvje/effects/chameleon.h @@ -21,7 +21,7 @@ #ifndef CHAMELEON_H #define CHAMELEON_H vj_effect *chameleon_init(int w, int h); -void chameleon_apply( VJFrame *frame, int width, int height, int mode); +void chameleon_apply( VJFrame *frame, int mode); int chameleon_malloc(int w, int h ); void chameleon_free(); int chameleon_prepare( uint8_t *bg[4], int w, int h ); diff --git a/veejay-current/veejay-server/libvje/effects/chameleonblend.c b/veejay-current/veejay-server/libvje/effects/chameleonblend.c index e82c3de7..89c73868 100644 --- a/veejay-current/veejay-server/libvje/effects/chameleonblend.c +++ b/veejay-current/veejay-server/libvje/effects/chameleonblend.c @@ -22,14 +22,11 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 , USA. */ -#include -#include -#include -#include + +#include "common.h" #include #include "softblur.h" #include "chameleonblend.h" -#include "common.h" vj_effect *chameleonblend_init(int w, int h) { @@ -239,7 +236,7 @@ static void drawDisappearing(VJFrame *src, VJFrame *dest) plane = plane & (PLANES-1); } -void chameleonblend_apply( VJFrame *frame, VJFrame *source, int width, int height, int mode ) +void chameleonblend_apply( VJFrame *frame, VJFrame *source, int mode ) { uint32_t activity = 0; int auto_switch = 0; diff --git a/veejay-current/veejay-server/libvje/effects/chameleonblend.h b/veejay-current/veejay-server/libvje/effects/chameleonblend.h index 657efba3..ba91b3b5 100644 --- a/veejay-current/veejay-server/libvje/effects/chameleonblend.h +++ b/veejay-current/veejay-server/libvje/effects/chameleonblend.h @@ -21,7 +21,7 @@ #ifndef CHAMELEONBLEND_H #define CHAMELEONBLEND_H vj_effect *chameleonblend_init(int w, int h); -void chameleonblend_apply( VJFrame *frame, VJFrame *source, int width, int height, int mode); +void chameleonblend_apply( VJFrame *frame, VJFrame *source, int mode); int chameleonblend_malloc(int w, int h ); int chameleonblend_prepare( uint8_t *bg[4],int w, int h ); void chameleonblend_free(); diff --git a/veejay-current/veejay-server/libvje/effects/chromamagick.c b/veejay-current/veejay-server/libvje/effects/chromamagick.c index 39220ee5..03d930e1 100644 --- a/veejay-current/veejay-server/libvje/effects/chromamagick.c +++ b/veejay-current/veejay-server/libvje/effects/chromamagick.c @@ -23,13 +23,9 @@ threshold value or substraction value depending on the mode of this effect */ -#include -#include -#include +#include "common.h" #include #include "chromamagick.h" -#include -#include "common.h" vj_effect *chromamagick_init(int w, int h) { diff --git a/veejay-current/veejay-server/libvje/effects/chromamagickalpha.c b/veejay-current/veejay-server/libvje/effects/chromamagickalpha.c index fc925f15..6f84fd4b 100644 --- a/veejay-current/veejay-server/libvje/effects/chromamagickalpha.c +++ b/veejay-current/veejay-server/libvje/effects/chromamagickalpha.c @@ -23,13 +23,10 @@ threshold value or substraction value depending on the mode of this effect */ -#include -#include +#include "common.h" #include #include "chromamagickalpha.h" -#include -#include "common.h" -// fixme: mode 8 and 9 corrupt (green/purple cbcr) +// FIXME: mode 8 and 9 corrupt (green/purple cbcr) vj_effect *chromamagickalpha_init(int w, int h) { @@ -69,8 +66,7 @@ vj_effect *chromamagickalpha_init(int w, int h) return ve; } -static void chromamagicalpha_selectmin(VJFrame *frame, VJFrame *frame2, int width, - int height, int op_a) +static void chromamagicalpha_selectmin(VJFrame *frame, VJFrame *frame2, int op_a) { unsigned int i; const int len = frame->len; @@ -97,8 +93,7 @@ static void chromamagicalpha_selectmin(VJFrame *frame, VJFrame *frame2, int widt } } -static void chromamagicalpha_addsubselectlum(VJFrame *frame, VJFrame *frame2, - int width, int height, int op_a) +static void chromamagicalpha_addsubselectlum(VJFrame *frame, VJFrame *frame2, int op_a) { unsigned int i; int c, a, b; @@ -136,8 +131,7 @@ static void chromamagicalpha_addsubselectlum(VJFrame *frame, VJFrame *frame2, } } -static void chromamagicalpha_selectmax(VJFrame *frame, VJFrame *frame2, int width, - int height, int op_a) +static void chromamagicalpha_selectmax(VJFrame *frame, VJFrame *frame2, int op_a) { unsigned int i; const int len = frame->len; @@ -166,8 +160,7 @@ static void chromamagicalpha_selectmax(VJFrame *frame, VJFrame *frame2, int widt } } -static void chromamagicalpha_selectdiff(VJFrame *frame, VJFrame *frame2, - int width, int height, int op_a) +static void chromamagicalpha_selectdiff(VJFrame *frame, VJFrame *frame2, int op_a) { unsigned int i; const int len = frame->len; @@ -196,7 +189,7 @@ static void chromamagicalpha_selectdiff(VJFrame *frame, VJFrame *frame2, } } -static void chromamagicalpha_diffreplace(VJFrame *frame, VJFrame *frame2, int width, int height, int threshold) +static void chromamagicalpha_diffreplace(VJFrame *frame, VJFrame *frame2, int threshold) { /* op_a = threshold */ const int len = frame->len; @@ -244,8 +237,7 @@ static void chromamagicalpha_diffreplace(VJFrame *frame, VJFrame *frame2, int wi } } -static void chromamagicalpha_selectdiffneg(VJFrame *frame, VJFrame *frame2, - int width, int height, int op_a) +static void chromamagicalpha_selectdiffneg(VJFrame *frame, VJFrame *frame2, int op_a) { unsigned int i; const int len = frame->len; @@ -274,8 +266,7 @@ static void chromamagicalpha_selectdiffneg(VJFrame *frame, VJFrame *frame2, } } -static void chromamagicalpha_selectunfreeze(VJFrame *frame, VJFrame *frame2, - int width, int height, int op_a) +static void chromamagicalpha_selectunfreeze(VJFrame *frame, VJFrame *frame2, int op_a) { unsigned int i; const int len = frame->len; @@ -305,8 +296,7 @@ static void chromamagicalpha_selectunfreeze(VJFrame *frame, VJFrame *frame2, } } -static void chromamagicalpha_addlum(VJFrame *frame, VJFrame *frame2, int width, - int height, int op_a) +static void chromamagicalpha_addlum(VJFrame *frame, VJFrame *frame2, int op_a) { unsigned int i; const int len = frame->len; @@ -334,7 +324,7 @@ static void chromamagicalpha_addlum(VJFrame *frame, VJFrame *frame2, int width, } } -static void chromamagicalpha_exclusive(VJFrame *frame, VJFrame *frame2, int width, int height, int op_a) +static void chromamagicalpha_exclusive(VJFrame *frame, VJFrame *frame2, int op_a) { unsigned int i; const int len = frame->len; @@ -372,7 +362,7 @@ static void chromamagicalpha_exclusive(VJFrame *frame, VJFrame *frame2, int widt } -static void chromamagicalpha_diffnegate(VJFrame *frame, VJFrame *frame2, int width, int height, int op_a) +static void chromamagicalpha_diffnegate(VJFrame *frame, VJFrame *frame2, int op_a) { unsigned int i; const int len = frame->len; @@ -415,8 +405,7 @@ static void chromamagicalpha_diffnegate(VJFrame *frame, VJFrame *frame2, int wid } } -static void chromamagicalpha_additive(VJFrame *frame, VJFrame *frame2, int width, - int height, int op_a) +static void chromamagicalpha_additive(VJFrame *frame, VJFrame *frame2, int op_a) { unsigned int i; const int len = frame->len; @@ -452,8 +441,7 @@ static void chromamagicalpha_additive(VJFrame *frame, VJFrame *frame2, int width } -static void chromamagicalpha_basecolor(VJFrame *frame, VJFrame *frame2, - int width, int height, int op_a) +static void chromamagicalpha_basecolor(VJFrame *frame, VJFrame *frame2, int op_a) { unsigned int i; const int len = frame->len; @@ -494,7 +482,7 @@ static void chromamagicalpha_basecolor(VJFrame *frame, VJFrame *frame2, } } -static void chromamagicalpha_freeze(VJFrame *frame, VJFrame *frame2, int w, int h, int op_a) +static void chromamagicalpha_freeze(VJFrame *frame, VJFrame *frame2, int op_a) { const int len = frame->len; uint8_t *Y = frame->data[0]; @@ -547,7 +535,7 @@ static void chromamagicalpha_freeze(VJFrame *frame, VJFrame *frame2, int w, int } -static void chromamagicalpha_unfreeze( VJFrame *frame, VJFrame *frame2, int w, int h, int op_a ) +static void chromamagicalpha_unfreeze( VJFrame *frame, VJFrame *frame2, int op_a ) { unsigned int i; const int len = frame->len; @@ -584,7 +572,7 @@ static void chromamagicalpha_unfreeze( VJFrame *frame, VJFrame *frame2, int w, i } } -static void chromamagicalpha_hardlight( VJFrame *frame, VJFrame *frame2, int w, int h, int op_a) +static void chromamagicalpha_hardlight( VJFrame *frame, VJFrame *frame2, int op_a) { unsigned int i; const int len = frame->len; @@ -629,7 +617,7 @@ static void chromamagicalpha_hardlight( VJFrame *frame, VJFrame *frame2, int w, } } -static void chromamagicalpha_multiply( VJFrame *frame, VJFrame *frame2, int w, int h,int op_a ) +static void chromamagicalpha_multiply( VJFrame *frame, VJFrame *frame2,int op_a ) { unsigned int i; const int len = frame->len; @@ -668,7 +656,7 @@ static void chromamagicalpha_multiply( VJFrame *frame, VJFrame *frame2, int w, i } } -static void chromamagicalpha_divide(VJFrame *frame, VJFrame *frame2, int w, int h, int op_a ) +static void chromamagicalpha_divide(VJFrame *frame, VJFrame *frame2, int op_a ) { unsigned int i; const int len = frame->len; @@ -705,7 +693,7 @@ static void chromamagicalpha_divide(VJFrame *frame, VJFrame *frame2, int w, int } } -static void chromamagicalpha_substract(VJFrame *frame, VJFrame *frame2, int w, int h, int op_a) +static void chromamagicalpha_substract(VJFrame *frame, VJFrame *frame2, int op_a) { unsigned int i; const int len = frame->len; @@ -743,7 +731,7 @@ static void chromamagicalpha_substract(VJFrame *frame, VJFrame *frame2, int w, i } -static void chromamagicalpha_add(VJFrame *frame, VJFrame *frame2, int width, int height, int op_a) +static void chromamagicalpha_add(VJFrame *frame, VJFrame *frame2, int op_a) { unsigned int i; const int len = frame->len; @@ -779,7 +767,7 @@ static void chromamagicalpha_add(VJFrame *frame, VJFrame *frame2, int width, int } } -static void chromamagicalpha_screen(VJFrame *frame, VJFrame *frame2, int w, int h, int op_a) +static void chromamagicalpha_screen(VJFrame *frame, VJFrame *frame2, int op_a) { unsigned int i; const int len = frame->len; @@ -813,7 +801,7 @@ static void chromamagicalpha_screen(VJFrame *frame, VJFrame *frame2, int w, int } } -static void chromamagicalpha_difference(VJFrame *frame, VJFrame *frame2, int w, int h, int op_a) +static void chromamagicalpha_difference(VJFrame *frame, VJFrame *frame2, int op_a) { unsigned int i; const int len = frame->len; @@ -852,7 +840,7 @@ static void chromamagicalpha_difference(VJFrame *frame, VJFrame *frame2, int w, } /* not really softlight but still cool */ -static void chromamagicalpha_softlightmode(VJFrame *frame,VJFrame *frame2,int width,int height, int op_a) +static void chromamagicalpha_softlightmode(VJFrame *frame,VJFrame *frame2, int op_a) { unsigned int i; const int len = frame->len; @@ -893,8 +881,7 @@ static void chromamagicalpha_softlightmode(VJFrame *frame,VJFrame *frame2,int wi } } -static void chromamagicalpha_dodge(VJFrame *frame, VJFrame *frame2, int w, int h, - int op_a) { +static void chromamagicalpha_dodge(VJFrame *frame, VJFrame *frame2, int op_a) { unsigned int i; const int len = frame->len; uint8_t *Y = frame->data[0]; @@ -934,7 +921,7 @@ static void chromamagicalpha_dodge(VJFrame *frame, VJFrame *frame2, int w, int h } } -static void chromamagicalpha_darken(VJFrame *frame, VJFrame *frame2, int w, int h, int op_a) +static void chromamagicalpha_darken(VJFrame *frame, VJFrame *frame2, int op_a) { unsigned int i; const int len = frame->len; @@ -963,7 +950,7 @@ static void chromamagicalpha_darken(VJFrame *frame, VJFrame *frame2, int w, int } } -static void chromamagicalpha_lighten(VJFrame *frame, VJFrame *frame2, int w, int h, int op_a) +static void chromamagicalpha_lighten(VJFrame *frame, VJFrame *frame2, int op_a) { unsigned int i; @@ -993,7 +980,7 @@ static void chromamagicalpha_lighten(VJFrame *frame, VJFrame *frame2, int w, int } } -static void chromamagicalpha_reflect(VJFrame *frame, VJFrame *frame2,int width,int height, int op_a) +static void chromamagicalpha_reflect(VJFrame *frame, VJFrame *frame2, int op_a) { unsigned int i; const int len = frame->len; @@ -1040,7 +1027,7 @@ static void chromamagicalpha_reflect(VJFrame *frame, VJFrame *frame2,int width,i } } -static void chromamagicalpha_modadd(VJFrame *frame, VJFrame *frame2, int width,int height, int op_a) +static void chromamagicalpha_modadd(VJFrame *frame, VJFrame *frame2, int op_a) { unsigned int i; const int len = frame->len; @@ -1079,91 +1066,89 @@ static void chromamagicalpha_modadd(VJFrame *frame, VJFrame *frame2, int width,i } -void chromamagickalpha_apply(VJFrame *frame, VJFrame *frame2, - int width, int height, int type, int op_a) +void chromamagickalpha_apply(VJFrame *frame, VJFrame *frame2, int type, int op_a) { - switch (type) { case 0: - chromamagicalpha_addsubselectlum(frame, frame2, width, height, op_a); + chromamagicalpha_addsubselectlum(frame, frame2, op_a); break; case 1: - chromamagicalpha_selectmin(frame, frame2, width, height, op_a); + chromamagicalpha_selectmin(frame, frame2, op_a); break; case 2: - chromamagicalpha_selectmax(frame, frame2, width, height, op_a); + chromamagicalpha_selectmax(frame, frame2, op_a); break; case 3: - chromamagicalpha_selectdiff(frame, frame2, width, height, op_a); + chromamagicalpha_selectdiff(frame, frame2, op_a); break; case 4: - chromamagicalpha_selectdiffneg(frame, frame2, width, height, op_a); + chromamagicalpha_selectdiffneg(frame, frame2, op_a); break; case 5: - chromamagicalpha_addlum(frame, frame2, width, height, op_a); + chromamagicalpha_addlum(frame, frame2, op_a); break; case 6: - chromamagicalpha_selectunfreeze(frame, frame2, width, height, op_a); + chromamagicalpha_selectunfreeze(frame, frame2, op_a); break; case 7: - chromamagicalpha_exclusive(frame,frame2,width,height,op_a); + chromamagicalpha_exclusive(frame,frame2,op_a); break; case 8: - chromamagicalpha_diffnegate(frame,frame2,width,height,op_a); + chromamagicalpha_diffnegate(frame,frame2,op_a); break; case 9: - chromamagicalpha_additive( frame,frame2,width,height,op_a); + chromamagicalpha_additive( frame,frame2,op_a); break; case 10: - chromamagicalpha_basecolor(frame,frame2,width,height,op_a); + chromamagicalpha_basecolor(frame,frame2,op_a); break; case 11: - chromamagicalpha_freeze(frame,frame2,width,height,op_a); + chromamagicalpha_freeze(frame,frame2,op_a); break; case 12: - chromamagicalpha_unfreeze(frame,frame2,width,height,op_a); + chromamagicalpha_unfreeze(frame,frame2,op_a); break; case 13: - chromamagicalpha_hardlight(frame,frame2,width,height,op_a); + chromamagicalpha_hardlight(frame,frame2,op_a); break; case 14: - chromamagicalpha_multiply(frame,frame2,width,height,op_a); + chromamagicalpha_multiply(frame,frame2,op_a); break; case 15: - chromamagicalpha_divide(frame,frame2,width,height,op_a); + chromamagicalpha_divide(frame,frame2,op_a); break; case 16: - chromamagicalpha_substract(frame,frame2,width,height,op_a); + chromamagicalpha_substract(frame,frame2,op_a); break; case 17: - chromamagicalpha_add(frame,frame2,width,height,op_a); + chromamagicalpha_add(frame,frame2,op_a); break; case 18: - chromamagicalpha_screen(frame,frame2,width,height,op_a); + chromamagicalpha_screen(frame,frame2,op_a); break; case 19: - chromamagicalpha_difference(frame,frame2,width,height,op_a); + chromamagicalpha_difference(frame,frame2,op_a); break; case 20: - chromamagicalpha_softlightmode(frame,frame2,width,height,op_a); + chromamagicalpha_softlightmode(frame,frame2,op_a); break; case 21: - chromamagicalpha_dodge(frame,frame2,width,height,op_a); + chromamagicalpha_dodge(frame,frame2,op_a); break; case 22: - chromamagicalpha_reflect(frame,frame2,width,height,op_a); + chromamagicalpha_reflect(frame,frame2,op_a); break; case 23: - chromamagicalpha_diffreplace(frame,frame2,width,height,op_a); + chromamagicalpha_diffreplace(frame,frame2,op_a); break; case 24: - chromamagicalpha_darken( frame,frame2,width,height,op_a); + chromamagicalpha_darken( frame,frame2,op_a); break; case 25: - chromamagicalpha_lighten( frame,frame2,width,height,op_a); + chromamagicalpha_lighten( frame,frame2,op_a); break; case 26: - chromamagicalpha_modadd( frame,frame2,width,height,op_a); + chromamagicalpha_modadd( frame,frame2,op_a); break; } } diff --git a/veejay-current/veejay-server/libvje/effects/chromamagickalpha.h b/veejay-current/veejay-server/libvje/effects/chromamagickalpha.h index 7d92e658..c7f04768 100644 --- a/veejay-current/veejay-server/libvje/effects/chromamagickalpha.h +++ b/veejay-current/veejay-server/libvje/effects/chromamagickalpha.h @@ -20,10 +20,6 @@ #ifndef CHROMAMAGICKALPHA_H #define CHROMAMAGICKALPHA_H -#include -#include -#include - vj_effect *chromamagickalpha_init(); -void chromamagickalpha_apply(VJFrame *frame, VJFrame *frame2 , int width,int height, int type, int op0); +void chromamagickalpha_apply(VJFrame *frame, VJFrame *frame2, int type, int op0); #endif diff --git a/veejay-current/veejay-server/libvje/effects/chromapalette.c b/veejay-current/veejay-server/libvje/effects/chromapalette.c index 42f3feb7..5134a36d 100644 --- a/veejay-current/veejay-server/libvje/effects/chromapalette.c +++ b/veejay-current/veejay-server/libvje/effects/chromapalette.c @@ -17,13 +17,9 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 , USA. */ -#include -#include -#include -#include -#include "chromapalette.h" #include "common.h" -#include +#include +#include "chromapalette.h" vj_effect *chromapalette_init(int w, int h) { @@ -83,7 +79,7 @@ static inline int _chroma_key( uint8_t fg_cb, uint8_t fg_cr, uint8_t cb, uint8_t -void chromapalette_apply(VJFrame *frame, int width, int height, int angle, int r, int g, int b, int color_cb, int color_cr ) +void chromapalette_apply(VJFrame *frame, int angle, int r, int g, int b, int color_cb, int color_cr ) { unsigned int i; const int len = frame->len; diff --git a/veejay-current/veejay-server/libvje/effects/chromapalette.h b/veejay-current/veejay-server/libvje/effects/chromapalette.h index 48ec411b..0a5bbd5b 100644 --- a/veejay-current/veejay-server/libvje/effects/chromapalette.h +++ b/veejay-current/veejay-server/libvje/effects/chromapalette.h @@ -20,11 +20,6 @@ #ifndef CHROMAPAL_H #define CHROMAPAL_H -#include -#include -#include -#include - vj_effect *chromapalette_init(int w, int h); -void chromapalette_apply(VJFrame *frame, int width, int height, int a,int r,int g, int b,int c1,int c2); +void chromapalette_apply(VJFrame *frame, int a,int r,int g, int b,int c1,int c2); #endif diff --git a/veejay-current/veejay-server/libvje/effects/chromascratcher.c b/veejay-current/veejay-server/libvje/effects/chromascratcher.c index 8fed6507..46745599 100644 --- a/veejay-current/veejay-server/libvje/effects/chromascratcher.c +++ b/veejay-current/veejay-server/libvje/effects/chromascratcher.c @@ -17,13 +17,12 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 , USA. */ -#include -#include -#include -#include + #include "common.h" +#include #include "chromascratcher.h" #include "chromamagick.h" + #define RUP8(num)(((num)+8)&~8) static uint8_t *cframe[4] = {NULL,NULL,NULL,NULL}; static int cnframe = 0; @@ -139,8 +138,8 @@ void chromascratcher_apply(VJFrame *frame, int mode, int opacity, int n, int no_reverse) { unsigned int i; - const int width = frame->width; - const int height = frame->height; + const unsigned int width = frame->width; + const unsigned int height = frame->height; const int len = frame->len; const unsigned int op_a = (opacity > 255) ? 255 : opacity; const unsigned int op_b = 255 - op_a; diff --git a/veejay-current/veejay-server/libvje/effects/chromascratcher.h b/veejay-current/veejay-server/libvje/effects/chromascratcher.h index df656a0d..00767f24 100644 --- a/veejay-current/veejay-server/libvje/effects/chromascratcher.h +++ b/veejay-current/veejay-server/libvje/effects/chromascratcher.h @@ -20,11 +20,6 @@ #ifndef CHROMASCRATCHER_H #define CHROMASCRATCHER_H -#include -#include -#include -#include - vj_effect *chromascratcher_init(int w, int h); int chromascratcher_malloc(int w, int h); void chromascratcher_free(); diff --git a/veejay-current/veejay-server/libvje/effects/chromium.c b/veejay-current/veejay-server/libvje/effects/chromium.c index a0831b17..7a5559af 100644 --- a/veejay-current/veejay-server/libvje/effects/chromium.c +++ b/veejay-current/veejay-server/libvje/effects/chromium.c @@ -17,13 +17,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 , USA. */ -#include -#include -#include + +#include "common.h" #include #include "chromium.h" -#include "common.h" - vj_effect *chromium_init(int w, int h) { @@ -52,7 +49,7 @@ vj_effect *chromium_init(int w, int h) return ve; } -void chromium_apply(VJFrame *frame, int width, int height, int m ) +void chromium_apply(VJFrame *frame, int m ) { const int len = (frame->ssm ? frame->len : frame->uv_len); uint8_t *Cb = frame->data[1]; diff --git a/veejay-current/veejay-server/libvje/effects/chromium.h b/veejay-current/veejay-server/libvje/effects/chromium.h index b997d986..d3fb9024 100644 --- a/veejay-current/veejay-server/libvje/effects/chromium.h +++ b/veejay-current/veejay-server/libvje/effects/chromium.h @@ -20,10 +20,6 @@ #ifndef CHROMIUM_H #define CHROMIUM_H -#include -#include -#include - vj_effect *chromium_init(int w, int h); -void chromium_apply(VJFrame *frame, int width, int height, int n); +void chromium_apply(VJFrame *frame, int n); #endif diff --git a/veejay-current/veejay-server/libvje/effects/colflash.c b/veejay-current/veejay-server/libvje/effects/colflash.c index d705f379..cc72016a 100644 --- a/veejay-current/veejay-server/libvje/effects/colflash.c +++ b/veejay-current/veejay-server/libvje/effects/colflash.c @@ -17,12 +17,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 , USA. */ -#include -#include -#include + +#include "common.h" #include #include "colflash.h" -#include "common.h" // very simple color flashing fx @@ -61,25 +59,25 @@ vj_effect *colflash_init(int w, int h) static int color_flash_ = 0; static int color_delay_ = 0; static int delay_ = 0; -void colflash_apply( VJFrame *frame, int width, int height, int f,int r, int g, int b, int d) +void colflash_apply( VJFrame *frame, int f,int r, int g, int b, int d) { - unsigned int len = frame->len; - unsigned int uv_len = (frame->ssm ? frame->len : frame->uv_len); + const int len = frame->len; + const int uv_len = (frame->ssm ? len : frame->uv_len); - uint8_t *Y = frame->data[0]; + uint8_t *Y = frame->data[0]; uint8_t *Cb= frame->data[1]; uint8_t *Cr= frame->data[2]; uint8_t y=0,u=0,v=0; _rgb2yuv( r,g,b,y,u,v ); - + if( d != delay_ ) { delay_ = d; color_delay_ = d; - } - + } + if( color_delay_ ) { veejay_memset( Y, y, len ); @@ -95,8 +93,7 @@ void colflash_apply( VJFrame *frame, int width, int height, int f,int r, int g, color_delay_ = delay_; color_flash_ = 0; } - } - + } diff --git a/veejay-current/veejay-server/libvje/effects/colflash.h b/veejay-current/veejay-server/libvje/effects/colflash.h index 6264bc33..c253590c 100644 --- a/veejay-current/veejay-server/libvje/effects/colflash.h +++ b/veejay-current/veejay-server/libvje/effects/colflash.h @@ -20,10 +20,6 @@ #ifndef COLFLASH_H #define COLFLASH_H -#include -#include -#include - vj_effect *colflash_init(); -void colflash_apply( VJFrame *frame, int width, int height, int f,int r, int g, int b, int d); +void colflash_apply( VJFrame *frame, int f,int r, int g, int b, int d); #endif diff --git a/veejay-current/veejay-server/libvje/effects/colmorphology.c b/veejay-current/veejay-server/libvje/effects/colmorphology.c index 3050b641..3789ea11 100644 --- a/veejay-current/veejay-server/libvje/effects/colmorphology.c +++ b/veejay-current/veejay-server/libvje/effects/colmorphology.c @@ -17,12 +17,11 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 , USA. */ -#include -#include -#include + +#include "common.h" #include #include "colmorphology.h" -#include "common.h" + typedef uint8_t (*morph_func)(uint8_t *kernel, uint8_t mt[9] ); vj_effect *colmorphology_init(int w, int h) @@ -92,18 +91,19 @@ static inline uint8_t _erode_kernel3x3( uint8_t *kernel, uint8_t img[9]) return pixel_Y_hi_; } -void colmorphology_apply( VJFrame *frame, int width, int height, int threshold, int type, int passes ) +void colmorphology_apply( VJFrame *frame, int threshold, int type, int passes ) { unsigned int i,x,y; - unsigned int len = frame->len; + const unsigned int width = frame->width; + int len = frame->len; uint8_t *Y = frame->data[0]; uint8_t kernels[8][9] ={ { 1,1,1, 1,1,1 ,1,1,1 },//0 { 0,1,0, 1,1,1, 0,1,0 },//1 { 0,0,0, 1,1,1, 0,0,0 },//2 { 0,1,0, 0,1,0, 0,1,0 },//3 - { 0,0,1, 0,1,0, 1,0,0 },//4 - { 1,0,0, 0,1,0, 0,0,1 }, + { 0,0,1, 0,1,0, 1,0,0 },//4 + { 1,0,0, 0,1,0, 0,0,1 }, { 1,1,1, 0,0,0, 0,0,0 }, { 0,0,0, 0,0,0, 1,1,1 } }; diff --git a/veejay-current/veejay-server/libvje/effects/colmorphology.h b/veejay-current/veejay-server/libvje/effects/colmorphology.h index a87afa01..2c8031a1 100644 --- a/veejay-current/veejay-server/libvje/effects/colmorphology.h +++ b/veejay-current/veejay-server/libvje/effects/colmorphology.h @@ -20,12 +20,8 @@ #ifndef COLMORPHOLOGY_H #define COLMORPHOLOGY_H -#include -#include -#include - vj_effect *colmorphology_init(int w, int h); -void colmorphology_apply( VJFrame *frame, int width, int height, int t, int val, int n); -int colmorphology_malloc(int w, int h); -void colmorphology_free(void); +void colmorphology_apply( VJFrame *frame, int t, int val, int n); +int colmorphology_malloc(int w, int h); +void colmorphology_free(void); #endif diff --git a/veejay-current/veejay-server/libvje/effects/color.c b/veejay-current/veejay-server/libvje/effects/color.c index 6230fa5d..603ccc7a 100644 --- a/veejay-current/veejay-server/libvje/effects/color.c +++ b/veejay-current/veejay-server/libvje/effects/color.c @@ -17,9 +17,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 , USA. */ -#include -#include -#include + +#include "common.h" #include #include "color.h" diff --git a/veejay-current/veejay-server/libvje/effects/coloradjust.c b/veejay-current/veejay-server/libvje/effects/coloradjust.c index a33451f8..a994887f 100644 --- a/veejay-current/veejay-server/libvje/effects/coloradjust.c +++ b/veejay-current/veejay-server/libvje/effects/coloradjust.c @@ -17,13 +17,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 , USA. */ -#include -#include -#include -#include + +#include "common.h" #include #include "coloradjust.h" -#include "common.h" vj_effect *coloradjust_init(int w, int h) { diff --git a/veejay-current/veejay-server/libvje/effects/colorhis.c b/veejay-current/veejay-server/libvje/effects/colorhis.c index 75973dae..f8f30646 100644 --- a/veejay-current/veejay-server/libvje/effects/colorhis.c +++ b/veejay-current/veejay-server/libvje/effects/colorhis.c @@ -17,16 +17,14 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 , USA. */ -#include -#include -#include + +#include "common.h" #include -#include "colorhis.h" #include #include #include -#include -#include "common.h" +#include "colorhis.h" + vj_effect *colorhis_init(int w, int h) { vj_effect *ve = (vj_effect *) vj_calloc(sizeof(vj_effect)); @@ -107,10 +105,10 @@ void colorhis_free() } -void colorhis_apply( VJFrame *frame, int width, int height,int mode, int val, int intensity, int strength) +void colorhis_apply( VJFrame *frame,int mode, int val, int intensity, int strength) { - int src_fmt = (frame->uv_height == height ? PIX_FMT_YUV422P : PIX_FMT_YUV420P); - + int src_fmt = (frame->uv_height == frame->height ? PIX_FMT_YUV422P : PIX_FMT_YUV420P); + if(!convert_yuv) convert_yuv = yuv_fx_context_create( frame, rgb_frame_, src_fmt, PIX_FMT_RGB24 ); @@ -124,10 +122,10 @@ void colorhis_apply( VJFrame *frame, int width, int height,int mode, int val, in { veejay_histogram_analyze_rgb( histogram_,rgb_, frame ); veejay_histogram_equalize_rgb( histogram_, frame, rgb_, intensity, strength, mode ); - + if(!convert_rgb ) convert_rgb = yuv_fx_context_create( rgb_frame_, frame, PIX_FMT_RGB24, src_fmt ); yuv_fx_context_process( convert_rgb, rgb_frame_, frame ); - } + } } diff --git a/veejay-current/veejay-server/libvje/effects/colorhis.h b/veejay-current/veejay-server/libvje/effects/colorhis.h index 343abee6..cf969e21 100644 --- a/veejay-current/veejay-server/libvje/effects/colorhis.h +++ b/veejay-current/veejay-server/libvje/effects/colorhis.h @@ -20,12 +20,8 @@ #ifndef COLORHIS_H #define COLORHIS_H -#include -#include -#include - vj_effect *colorhis_init(int w, int h); int colorhis_malloc(int w , int h ); void colorhis_free( ); -void colorhis_apply( VJFrame *frame, int width, int height, int mode,int val, int intensity, int strength); +void colorhis_apply( VJFrame *frame, int mode,int val, int intensity, int strength); #endif diff --git a/veejay-current/veejay-server/libvje/effects/colormap.c b/veejay-current/veejay-server/libvje/effects/colormap.c index cc704d4c..b89a320f 100644 --- a/veejay-current/veejay-server/libvje/effects/colormap.c +++ b/veejay-current/veejay-server/libvje/effects/colormap.c @@ -17,11 +17,9 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 , USA. */ -#include -#include -#include + +#include "common.h" #include -#include #include "colormap.h" vj_effect *colormap_init(int w, int h) @@ -55,7 +53,7 @@ vj_effect *colormap_init(int w, int h) void colormap_apply( VJFrame *frame, int r, int g, int b) { unsigned int i; - const unsigned int uv_len = (frame->ssm ? frame->len : frame->uv_len ); + const int uv_len = (frame->ssm ? frame->len : frame->uv_len ); uint8_t *Y = frame->data[0]; uint8_t *Cb = frame->data[1]; uint8_t *Cr = frame->data[2]; diff --git a/veejay-current/veejay-server/libvje/effects/colormap.h b/veejay-current/veejay-server/libvje/effects/colormap.h index ab1a2b39..76358b04 100644 --- a/veejay-current/veejay-server/libvje/effects/colormap.h +++ b/veejay-current/veejay-server/libvje/effects/colormap.h @@ -20,10 +20,6 @@ #ifndef COLORMAP_H #define COLORMAP_H -#include -#include -#include - vj_effect *colormap_init(int w, int h); void colormap_apply( VJFrame *frame, int vala , int valb, int valc); #endif diff --git a/veejay-current/veejay-server/libvje/effects/colorshift.c b/veejay-current/veejay-server/libvje/effects/colorshift.c index 67ea64e0..bb59886f 100644 --- a/veejay-current/veejay-server/libvje/effects/colorshift.c +++ b/veejay-current/veejay-server/libvje/effects/colorshift.c @@ -17,13 +17,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 , USA. */ -#include -#include -#include -#include + +#include "common.h" #include #include "colorshift.h" -#include "common.h" vj_effect *colorshift_init(int w, int h) { @@ -61,7 +58,7 @@ vj_effect *colorshift_init(int w, int h) /* bitwise and test */ static void softmask2_apply(VJFrame *frame, int paramt) { - const unsigned int len = frame->len; + const int len = frame->len; unsigned int x; uint8_t *Y = frame->data[0]; for (x = 0; x < len; x++) @@ -70,7 +67,7 @@ static void softmask2_apply(VJFrame *frame, int paramt) static void softmask2_applycb(VJFrame *frame, int paramt) { - const unsigned int len = (frame->ssm ? frame->len : frame->uv_len); + const int len = (frame->ssm ? frame->len : frame->uv_len); uint8_t *Cb = frame->data[1]; unsigned int x; for (x = 0; x < len; x++) @@ -80,7 +77,7 @@ static void softmask2_applycb(VJFrame *frame, int paramt) static void softmask2_applycr(VJFrame *frame, int paramt) { uint8_t *Cr = frame->data[2]; - const unsigned int len = (frame->ssm ? frame->len : frame->uv_len); + const int len = (frame->ssm ? frame->len : frame->uv_len); unsigned int x; for (x = 0; x < len; x++) Cr[x] &= paramt; @@ -88,7 +85,7 @@ static void softmask2_applycr(VJFrame *frame, int paramt) static void softmask2_applycbcr(VJFrame *frame, int paramt) { - const unsigned int len = (frame->ssm ? frame->len : frame->uv_len); + const int len = (frame->ssm ? frame->len : frame->uv_len); unsigned int x; uint8_t *Cb = frame->data[1]; uint8_t *Cr = frame->data[2]; @@ -100,8 +97,8 @@ static void softmask2_applycbcr(VJFrame *frame, int paramt) static void softmask2_applyycbcr(VJFrame *frame, int paramt) { - const unsigned int len = frame->len; - const unsigned int uv_len = (frame->ssm ? frame->len : frame->uv_len); + const int len = frame->len; + const int uv_len = (frame->ssm ? len : frame->uv_len); uint8_t *Y = frame->data[0]; uint8_t *Cb = frame->data[1]; @@ -120,7 +117,7 @@ static void softmask2_applyycbcr(VJFrame *frame, int paramt) static void softmask_apply(VJFrame *frame, int paramt) { - const unsigned int len = frame->len; + const int len = frame->len; unsigned int x; uint8_t *Y = frame->data[0]; @@ -132,7 +129,7 @@ static void softmask_apply(VJFrame *frame, int paramt) static void softmask_applycb(VJFrame *frame, int paramt) { - const unsigned int len = (frame->ssm ? frame->len : frame->uv_len); + const int len = (frame->ssm ? frame->len : frame->uv_len); uint8_t *Cb = frame->data[1]; unsigned int x; @@ -143,7 +140,7 @@ static void softmask_applycb(VJFrame *frame, int paramt) static void softmask_applycr(VJFrame *frame, int paramt) { - const unsigned int len = (frame->ssm ? frame->len : frame->uv_len); + const int len = (frame->ssm ? frame->len : frame->uv_len); uint8_t *Cr = frame->data[2]; unsigned int x; @@ -154,7 +151,7 @@ static void softmask_applycr(VJFrame *frame, int paramt) static void softmask_applycbcr(VJFrame *frame, int paramt) { - const unsigned int len = (frame->ssm ? frame->len : frame->uv_len); + const int len = (frame->ssm ? frame->len : frame->uv_len); unsigned int x; uint8_t *Cb = frame->data[1]; uint8_t *Cr = frame->data[2]; @@ -172,7 +169,7 @@ static void softmask_applyycbcr(VJFrame *frame, int paramt) uint8_t *Y = frame->data[0]; uint8_t *Cb = frame->data[1]; uint8_t *Cr = frame->data[2]; - const unsigned int uv_len = (frame->ssm ? frame->len : frame->uv_len); + const int uv_len = (frame->ssm ? len : frame->uv_len); unsigned int x; for (x = 0; x < len; x++) diff --git a/veejay-current/veejay-server/libvje/effects/complexinvert.c b/veejay-current/veejay-server/libvje/effects/complexinvert.c index 8b6d57c7..378d341f 100644 --- a/veejay-current/veejay-server/libvje/effects/complexinvert.c +++ b/veejay-current/veejay-server/libvje/effects/complexinvert.c @@ -17,12 +17,9 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 , USA. */ -#include -#include -#include -#include -#include + #include "common.h" +#include #include "complexinvert.h" vj_effect *complexinvert_init(int w, int h) @@ -80,6 +77,7 @@ void complexinvert_apply(VJFrame *frame, int i_angle, int r, int g, int b, uint8_t *Y = frame->data[0]; uint8_t *Cb= frame->data[1]; uint8_t *Cr= frame->data[2]; + const int len = frame->len; int iy=pixel_Y_lo_,iu=128,iv=128; _rgb2yuv( r,g,b, iy,iu,iv ); _y = (float) iy; @@ -108,7 +106,7 @@ void complexinvert_apply(VJFrame *frame, int i_angle, int r, int g, int b, bg_cb = frame->data[1]; bg_cr = frame->data[2]; - for (pos = 0; pos < frame->len; pos++) + for (pos = 0; pos < len; pos++) { short xx, yy; diff --git a/veejay-current/veejay-server/libvje/effects/complexsaturate.c b/veejay-current/veejay-server/libvje/effects/complexsaturate.c index 5903415a..8d523995 100644 --- a/veejay-current/veejay-server/libvje/effects/complexsaturate.c +++ b/veejay-current/veejay-server/libvje/effects/complexsaturate.c @@ -17,12 +17,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 , USA. */ -#include -#include -#include -#include -#include "complexsaturate.h" + #include "common.h" +#include +#include "complexsaturate.h" vj_effect *complexsaturation_init(int w, int h) { @@ -75,7 +73,7 @@ void complexsaturation_apply(VJFrame *frame, int i_angle, int r, int g, int b, { // double degrees = adjust_degrees * 0.01; // double dsat = adjust_v * 0.01; - + const int len = frame->len; float hue = (adjust_degrees/180.0)*M_PI; float sat = (adjust_v / 100.0f); @@ -123,7 +121,7 @@ void complexsaturation_apply(VJFrame *frame, int i_angle, int r, int g, int b, bg_cr = frame->data[2]; const int s = (int) rint( sin(hue) * (1<<16) * sat ); const int c = (int) rint( cos(hue) * (1<<16) * sat ); - for (pos = 0; pos < frame->len; pos++) + for (pos = 0; pos < len; pos++) { short xx, yy; diff --git a/veejay-current/veejay-server/libvje/effects/complexsaturate.h b/veejay-current/veejay-server/libvje/effects/complexsaturate.h index f24ec631..9bc28fb9 100644 --- a/veejay-current/veejay-server/libvje/effects/complexsaturate.h +++ b/veejay-current/veejay-server/libvje/effects/complexsaturate.h @@ -20,10 +20,6 @@ #ifndef COMPLEXSATURATE_H #define COMPLEXSATURATE_H -#include -#include -#include - vj_effect *complexsaturation_init(); void complexsaturation_apply(VJFrame *frame, int i_angle, int red, int green, int blue, diff --git a/veejay-current/veejay-server/libvje/effects/complexsync.c b/veejay-current/veejay-server/libvje/effects/complexsync.c index 931bc07b..f6a5a466 100644 --- a/veejay-current/veejay-server/libvje/effects/complexsync.c +++ b/veejay-current/veejay-server/libvje/effects/complexsync.c @@ -17,12 +17,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 , USA. */ -#include -#include -#include + #include "common.h" +#include #include "complexsync.h" -#include static uint8_t *c_outofsync_buffer[4] = { NULL,NULL,NULL, NULL }; @@ -72,7 +70,7 @@ void complexsync_free() { void complexsync_apply(VJFrame *frame, VJFrame *frame2, int val) { const int len = frame->len; - const int width = frame->width; + const unsigned int width = frame->width; uint8_t *Y = frame->data[0]; uint8_t *Cb = frame->data[1]; uint8_t *Cr = frame->data[2]; diff --git a/veejay-current/veejay-server/libvje/effects/complexsync.h b/veejay-current/veejay-server/libvje/effects/complexsync.h index bdb36ae1..9f32057b 100644 --- a/veejay-current/veejay-server/libvje/effects/complexsync.h +++ b/veejay-current/veejay-server/libvje/effects/complexsync.h @@ -20,11 +20,6 @@ #ifndef COMPLEXSYNC_H #define COMPLEXSYNC_H -#include -#include -#include -#include - vj_effect *complexsync_init(int width, int height); int complexsync_malloc(int w, int h); void complexsync_free(); diff --git a/veejay-current/veejay-server/libvje/effects/complexthreshold.c b/veejay-current/veejay-server/libvje/effects/complexthreshold.c index a923635e..a21325c1 100644 --- a/veejay-current/veejay-server/libvje/effects/complexthreshold.c +++ b/veejay-current/veejay-server/libvje/effects/complexthreshold.c @@ -17,12 +17,9 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 , USA. */ -#include -#include -#include -#include -#include + #include "common.h" +#include #include "complexthreshold.h" //FIXME: rewrite this FX @@ -109,7 +106,7 @@ void complexthreshold_apply(VJFrame *frame, VJFrame *frame2, int i_angle, int matrix[5]; int val, tmp1; const int len = frame->len; - const int width = frame->width; + const unsigned int width = frame->width; uint8_t *Y = frame->data[0]; uint8_t *Cb = frame->data[1]; uint8_t *Cr = frame->data[2]; diff --git a/veejay-current/veejay-server/libvje/effects/constantblend.c b/veejay-current/veejay-server/libvje/effects/constantblend.c index 87726583..e4b3c25c 100644 --- a/veejay-current/veejay-server/libvje/effects/constantblend.c +++ b/veejay-current/veejay-server/libvje/effects/constantblend.c @@ -25,12 +25,10 @@ */ -#include -#include -#include +#include "common.h" #include #include "constantblend.h" -#include "common.h" + vj_effect *constantblend_init(int w, int h) { vj_effect *ve = (vj_effect *) vj_calloc(sizeof(vj_effect)); @@ -68,11 +66,10 @@ vj_effect *constantblend_init(int w, int h) return ve; } -void constantblend_apply( VJFrame *frame, int width, int height, - int type, int scale, int valY ) +void constantblend_apply( VJFrame *frame, int type, int scale, int valY ) { unsigned int i; - const int len = (width * height); + const int len = frame->len; const uint8_t y = (uint8_t) valY; const float s = ((float) scale / 100.0 ); diff --git a/veejay-current/veejay-server/libvje/effects/constantblend.h b/veejay-current/veejay-server/libvje/effects/constantblend.h index 2a2b675f..39a48b92 100644 --- a/veejay-current/veejay-server/libvje/effects/constantblend.h +++ b/veejay-current/veejay-server/libvje/effects/constantblend.h @@ -20,11 +20,6 @@ #ifndef constantblend_H #define constantblend_H -#include -#include -#include - vj_effect *constantblend_init(int w, int h); -void constantblend_apply( VJFrame *frame, int width, int height, int a, - int b, int c ); +void constantblend_apply( VJFrame *frame, int a, int b, int c); #endif diff --git a/veejay-current/veejay-server/libvje/effects/contourextract.c b/veejay-current/veejay-server/libvje/effects/contourextract.c index eca2a3e5..4f5e35d5 100644 --- a/veejay-current/veejay-server/libvje/effects/contourextract.c +++ b/veejay-current/veejay-server/libvje/effects/contourextract.c @@ -18,15 +18,12 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 , USA. */ -#include -#include -#include -#include + +#include "common.h" #include #include #include #include -#include "common.h" #include "softblur.h" #include "diff.h" #include "contourextract.h" @@ -208,8 +205,8 @@ void contourextract_apply(void *ed, VJFrame *frame, int threshold, int reverse, int mode, int take_bg, int feather, int min_blob_weight) { unsigned int i; - const int width = frame->width; - const int height = frame->height; + const unsigned int width = frame->width; + const unsigned int height = frame->height; const int len = frame->len; const int uv_len = frame->uv_len; uint8_t *Y = frame->data[0]; diff --git a/veejay-current/veejay-server/libvje/effects/contrast.c b/veejay-current/veejay-server/libvje/effects/contrast.c index d325c6d8..a96bb61c 100644 --- a/veejay-current/veejay-server/libvje/effects/contrast.c +++ b/veejay-current/veejay-server/libvje/effects/contrast.c @@ -17,12 +17,11 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 , USA. */ -#include -#include -#include + +#include "common.h" #include #include "contrast.h" -#include "common.h" + vj_effect *contrast_init(int w, int h) { vj_effect *ve = (vj_effect *) vj_calloc(sizeof(vj_effect)); @@ -60,7 +59,7 @@ static void contrast_cb_apply(VJFrame *frame, int *s) { unsigned int r; register int cb; register int cr; - const unsigned int uv_len = (frame->ssm ? frame->len: frame->uv_len); + const int uv_len = (frame->ssm ? frame->len: frame->uv_len); uint8_t *Cb = frame->data[1]; uint8_t *Cr = frame->data[2]; diff --git a/veejay-current/veejay-server/libvje/effects/contrast.h b/veejay-current/veejay-server/libvje/effects/contrast.h index f9131933..68525735 100644 --- a/veejay-current/veejay-server/libvje/effects/contrast.h +++ b/veejay-current/veejay-server/libvje/effects/contrast.h @@ -20,14 +20,7 @@ #ifndef CONTRAST_H #define CONTRAST_H -#include -#include -#include - vj_effect *contrast_init(); - - void contrast_apply(VJFrame *frame, int *t); - void contrast_free(); #endif diff --git a/veejay-current/veejay-server/libvje/effects/crosspixel.c b/veejay-current/veejay-server/libvje/effects/crosspixel.c index f66b0d73..d3b277dc 100644 --- a/veejay-current/veejay-server/libvje/effects/crosspixel.c +++ b/veejay-current/veejay-server/libvje/effects/crosspixel.c @@ -17,12 +17,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 , USA. */ -#include -#include + +#include "common.h" #include #include "crosspixel.h" -#include "common.h" -#include static uint8_t *cross_pixels[4] = { NULL,NULL,NULL, NULL}; @@ -78,15 +76,15 @@ void crosspixel_apply(VJFrame *frame, int t,int v) { const unsigned int vv = v * 2; // only even numbers const unsigned int u_vv = vv >> frame->shift_h; // sfhit = / 2, shift_v = 2 - const int width = frame->width; - const int height = frame->height; + const unsigned int width = frame->width; + const unsigned int height = frame->height; const int len = frame->len; const int uv_len = frame->uv_len; uint8_t *Y = frame->data[0]; uint8_t *Cb = frame->data[1]; uint8_t *Cr = frame->data[2]; - const int uv_width = frame->uv_width; - const int uv_height = frame->uv_height; + const unsigned int uv_width = frame->uv_width; + const unsigned int uv_height = frame->uv_height; unsigned int p = 0; int strides[4] = { len, uv_len, uv_len ,0}; diff --git a/veejay-current/veejay-server/libvje/effects/crosspixel.h b/veejay-current/veejay-server/libvje/effects/crosspixel.h index 2f3ff6d8..ccd4c92f 100644 --- a/veejay-current/veejay-server/libvje/effects/crosspixel.h +++ b/veejay-current/veejay-server/libvje/effects/crosspixel.h @@ -20,11 +20,6 @@ #ifndef CROSSPIXEL_H #define CROSSPIXEL_H -#include -#include -#include -#include - vj_effect *crosspixel_init(int w, int h); int crosspixel_malloc(int w, int h); void crosspixel_free(); diff --git a/veejay-current/veejay-server/libvje/effects/cutstop.c b/veejay-current/veejay-server/libvje/effects/cutstop.c index 2c3dab87..bc5fa377 100644 --- a/veejay-current/veejay-server/libvje/effects/cutstop.c +++ b/veejay-current/veejay-server/libvje/effects/cutstop.c @@ -20,13 +20,9 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 , USA. */ -#include -#include -#include -#include -#include -#include + #include "common.h" +#include #include "cutstop.h" static uint8_t *vvcutstop_buffer[4] = { NULL,NULL,NULL,NULL }; @@ -90,10 +86,11 @@ void cutstop_free() { } -void cutstop_apply( VJFrame *frame, int width, int height, int threshold, int freq, int cutmode, int holdmode) { +void cutstop_apply( VJFrame *frame, int threshold, int freq, int cutmode, int holdmode) +{ int i=0; - const unsigned int len = frame->len; - + const int len = frame->len; + uint8_t *Yb = vvcutstop_buffer[0]; uint8_t *Ub = vvcutstop_buffer[1]; uint8_t *Vb = vvcutstop_buffer[2]; diff --git a/veejay-current/veejay-server/libvje/effects/cutstop.h b/veejay-current/veejay-server/libvje/effects/cutstop.h index 8e9571b7..902bb691 100644 --- a/veejay-current/veejay-server/libvje/effects/cutstop.h +++ b/veejay-current/veejay-server/libvje/effects/cutstop.h @@ -1,13 +1,27 @@ +/* + * Linux VeeJay + * + * Copyright(C)2002 Niels Elburg + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License , or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 , USA. + */ + #ifndef CUTSTOP_H #define CUTSTOP_H void cutstop_free() ; - vj_effect *cutstop_init(int width , int height); - int cutstop_malloc(int width, int height); - -void cutstop_apply( VJFrame *frame, - int width, int height, int treshold, - int freq, int cutmode, int holdmode); - +void cutstop_apply( VJFrame *frame, int treshold, int freq, int cutmode, int holdmode); #endif diff --git a/veejay-current/veejay-server/libvje/effects/deinterlace.c b/veejay-current/veejay-server/libvje/effects/deinterlace.c index 6e6b3035..59f20e90 100644 --- a/veejay-current/veejay-server/libvje/effects/deinterlace.c +++ b/veejay-current/veejay-server/libvje/effects/deinterlace.c @@ -17,10 +17,9 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 , USA. */ -#include -#include -#include + #include "common.h" +#include #include "deinterlace.h" vj_effect *deinterlace_init(int w, int h) @@ -46,8 +45,8 @@ void deinterlace_apply(VJFrame *frame, int val) { const unsigned int uv_width = frame->uv_width; const unsigned int uv_height = frame->uv_height; - const int width = frame->width; - const int height = frame->height; + const unsigned int width = frame->width; + const unsigned int height = frame->height; uint8_t *Y = frame->data[0]; uint8_t *Cb = frame->data[1]; uint8_t *Cr = frame->data[2]; diff --git a/veejay-current/veejay-server/libvje/effects/deinterlace.h b/veejay-current/veejay-server/libvje/effects/deinterlace.h index d5e1b9a4..21717f24 100644 --- a/veejay-current/veejay-server/libvje/effects/deinterlace.h +++ b/veejay-current/veejay-server/libvje/effects/deinterlace.h @@ -20,10 +20,6 @@ #ifndef DEINTERLACE_H #define DEINTERLACE_H -#include -#include -#include - vj_effect *deinterlace_init(); void deinterlace_apply(VJFrame *frame, int val); void deinterlace_free(); diff --git a/veejay-current/veejay-server/libvje/effects/dices.c b/veejay-current/veejay-server/libvje/effects/dices.c index 9425b3fb..cec20269 100644 --- a/veejay-current/veejay-server/libvje/effects/dices.c +++ b/veejay-current/veejay-server/libvje/effects/dices.c @@ -26,11 +26,8 @@ * the GNU Public License. * */ -#include -#include -#include -#include -#include + +#include "common.h" #include #include "dices.h" @@ -125,8 +122,8 @@ void dice_create_map(int w, int h) void dices_apply( void *data, VJFrame *frame, int cube_bits) { int i = 0, map_x, map_y, map_i = 0, base, dx, dy, di=0; - int width, height; - width = frame->width; height = frame->height; + const unsigned int width = frame->width; + const unsigned int height = frame->height; uint8_t *Y = frame->data[0]; uint8_t *Cb = frame->data[1]; uint8_t *Cr = frame->data[2]; diff --git a/veejay-current/veejay-server/libvje/effects/dices.h b/veejay-current/veejay-server/libvje/effects/dices.h index 021926f7..48cb161b 100644 --- a/veejay-current/veejay-server/libvje/effects/dices.h +++ b/veejay-current/veejay-server/libvje/effects/dices.h @@ -20,10 +20,6 @@ #ifndef DICES_H #define DICES_H -#include -#include -#include - vj_effect *dices_init(int width, int height); int dices_malloc(int w, int h); void dices_free(); diff --git a/veejay-current/veejay-server/libvje/effects/diff.c b/veejay-current/veejay-server/libvje/effects/diff.c index 5c35271c..99a452e3 100644 --- a/veejay-current/veejay-server/libvje/effects/diff.c +++ b/veejay-current/veejay-server/libvje/effects/diff.c @@ -17,19 +17,14 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 , USA. */ -#include -#include -#include -#include -#include -#include -#include -#include -#include + +#include "common.h" #include +#include +#include #include "softblur.h" #include "diff.h" -#include "common.h" + static uint8_t *static_bg = NULL; static uint32_t *dt_map = NULL; @@ -136,8 +131,8 @@ void diff_apply(void *ed, VJFrame *frame, VJFrame *frame2, int threshold, { unsigned int i; const int len = frame->len; - const int width = frame->width; - const int height = frame->height; + const unsigned int width = frame->width; + const unsigned int height = frame->height; uint8_t *Y = frame->data[0]; uint8_t *Cb = frame->data[1]; uint8_t *Cr = frame->data[2]; diff --git a/veejay-current/veejay-server/libvje/effects/diffmap.c b/veejay-current/veejay-server/libvje/effects/diffmap.c index 2833e514..4d333111 100644 --- a/veejay-current/veejay-server/libvje/effects/diffmap.c +++ b/veejay-current/veejay-server/libvje/effects/diffmap.c @@ -17,14 +17,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 , USA. */ -#include -#include -#include -#include -#include -#include "diffmap.h" #include "common.h" +#include #include "softblur.h" +#include "diffmap.h" typedef int (*morph_func)(uint8_t *kernel, uint8_t mt[9] ); @@ -78,12 +74,14 @@ void differencemap_free(void) #define MAX(a,b) ( (a)>(b) ? (a) : (b) ) #endif -void differencemap_apply( VJFrame *frame, VJFrame *frame2,int width, int height, int threshold, int reverse, +void differencemap_apply( VJFrame *frame, VJFrame *frame2, int threshold, int reverse, int show ) { unsigned int x,y; - int len = (width * height); - uint8_t *Y = frame->data[0]; + const unsigned int width = frame->width; + const unsigned int height = frame->height; + int len = frame->len; + uint8_t *Y = frame->data[0]; uint8_t *Cb = frame->data[1]; uint8_t *Cr = frame->data[2]; uint8_t *Y2 = frame2->data[0]; diff --git a/veejay-current/veejay-server/libvje/effects/diffmap.h b/veejay-current/veejay-server/libvje/effects/diffmap.h index cab29704..286a6583 100644 --- a/veejay-current/veejay-server/libvje/effects/diffmap.h +++ b/veejay-current/veejay-server/libvje/effects/diffmap.h @@ -21,7 +21,7 @@ #ifndef DIFFERENCEMAP_H #define DIFFERENCEMAP_H vj_effect *differencemap_init(int w, int h); -void differencemap_apply( VJFrame *frame,VJFrame *frame2, int width, int height, int t, int n, int show); +void differencemap_apply( VJFrame *frame,VJFrame *frame2, int t, int n, int show); int differencemap_malloc(int w, int h); void differencemap_free(void); #endif diff --git a/veejay-current/veejay-server/libvje/effects/dissolve.c b/veejay-current/veejay-server/libvje/effects/dissolve.c index 6bc9d067..1cb2b78d 100644 --- a/veejay-current/veejay-server/libvje/effects/dissolve.c +++ b/veejay-current/veejay-server/libvje/effects/dissolve.c @@ -17,12 +17,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 , USA. */ -#include -#include -#include + +#include "common.h" #include #include "dissolve.h" -#include vj_effect *dissolve_init(int w, int h) { @@ -45,11 +43,10 @@ vj_effect *dissolve_init(int w, int h) -void dissolve_apply(VJFrame *frame, VJFrame *frame2, int width, - int height, int opacity) +void dissolve_apply(VJFrame *frame, VJFrame *frame2, int opacity) { unsigned int i; - unsigned int len = frame->len; + const int len = frame->len; const int op1 = (opacity > 255) ? 255 : opacity; const int op0 = 255 - op1; diff --git a/veejay-current/veejay-server/libvje/effects/dissolve.h b/veejay-current/veejay-server/libvje/effects/dissolve.h index 0d3571a4..e21e17ed 100644 --- a/veejay-current/veejay-server/libvje/effects/dissolve.h +++ b/veejay-current/veejay-server/libvje/effects/dissolve.h @@ -20,11 +20,6 @@ #ifndef DISSOLVE_H #define DISSOLVE_H -#include -#include -#include - vj_effect *dissolve_init(int w, int h); -void dissolve_apply( VJFrame *frame, VJFrame *frame2, int width, - int height, int dissolve); +void dissolve_apply( VJFrame *frame, VJFrame *frame2, int dissolve); #endif diff --git a/veejay-current/veejay-server/libvje/effects/distort.c b/veejay-current/veejay-server/libvje/effects/distort.c index 39ebd69d..3b2f5a0f 100644 --- a/veejay-current/veejay-server/libvje/effects/distort.c +++ b/veejay-current/veejay-server/libvje/effects/distort.c @@ -43,15 +43,10 @@ along with this program; see the file COPYING. If not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include -#include -#include -#include -#include -#include #include "common.h" -#include "distort.h" +#include #include "widthmirror.h" +#include "distort.h" static int plasma_table[512]; static int plasma_pos1 = 0; @@ -146,15 +141,15 @@ void distortion_free() void distortion_apply(VJFrame *frame, int inc_val1, int inc_val2, int inc_val3, int inc_val4, int inc_val5, int inc_val6 ) { - int x, y, i, j,yi; + int x, i, j; int tpos1 = 0, tpos2 = 0, tpos3 = 0, tpos4 = 0; const int z = 511; uint8_t *Y = frame->data[0]; uint8_t *Cb = frame->data[1]; uint8_t *Cr = frame->data[2]; - const int height = (const int) frame->height; - const int width = (const int) frame->width; + const unsigned int height = frame->height; + const unsigned int width = frame->width; const int len = frame->len; int strides[4] = { len,len,len, 0 }; diff --git a/veejay-current/veejay-server/libvje/effects/dither.c b/veejay-current/veejay-server/libvje/effects/dither.c index 56fcabb2..43511fd1 100644 --- a/veejay-current/veejay-server/libvje/effects/dither.c +++ b/veejay-current/veejay-server/libvje/effects/dither.c @@ -17,12 +17,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 , USA. */ -#include -#include -#include + +#include "common.h" #include #include "dither.h" -#include "common.h" vj_effect *dither_init(int w, int h) { @@ -60,8 +58,8 @@ void dither_apply(VJFrame *frame, int size, int random_on) long int dith[size][size]; long int i, j, d, v, l, m; uint8_t *Y = frame->data[0]; - int width, height; - width=frame->width; height = frame->height; + const unsigned int width = frame->width; + const unsigned int height = frame->height; if( last_size != size || random_on ) { diff --git a/veejay-current/veejay-server/libvje/effects/dither.h b/veejay-current/veejay-server/libvje/effects/dither.h index 6625c55e..15c13cee 100644 --- a/veejay-current/veejay-server/libvje/effects/dither.h +++ b/veejay-current/veejay-server/libvje/effects/dither.h @@ -20,10 +20,6 @@ #ifndef DITHER_H #define DITHER_H -#include -#include -#include - vj_effect *dither_init(); void dither_apply(VJFrame *frame, int size, int n); #endif diff --git a/veejay-current/veejay-server/libvje/effects/dummy.c b/veejay-current/veejay-server/libvje/effects/dummy.c index 12b66bd7..1c05e4d4 100644 --- a/veejay-current/veejay-server/libvje/effects/dummy.c +++ b/veejay-current/veejay-server/libvje/effects/dummy.c @@ -17,12 +17,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 , USA. */ -#include -#include -#include + +#include "common.h" #include #include "dummy.h" -#include "common.h" vj_effect *dummy_init(int w, int h) { @@ -65,7 +63,7 @@ void dummy_apply( VJFrame *frame, int color) void dummy_rgb_apply( VJFrame *frame, int r,int g, int b) { - const int len = frame->len; + const int len = frame->len; const int uv_len = frame->uv_len; int colorCb=128, colorCr=128, colorY=0; diff --git a/veejay-current/veejay-server/libvje/effects/dupmagic.c b/veejay-current/veejay-server/libvje/effects/dupmagic.c index 43adf787..3de1ec6f 100644 --- a/veejay-current/veejay-server/libvje/effects/dupmagic.c +++ b/veejay-current/veejay-server/libvje/effects/dupmagic.c @@ -17,12 +17,11 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 , USA. */ -#include -#include -#include -#include "dupmagic.h" -#include "magicoverlays.h" + #include "common.h" +#include +#include "magicoverlays.h" +#include "dupmagic.h" vj_effect *dupmagic_init(int w, int h) { diff --git a/veejay-current/veejay-server/libvje/effects/dupmagic.h b/veejay-current/veejay-server/libvje/effects/dupmagic.h index c0a5e9ce..d5fb3d4b 100644 --- a/veejay-current/veejay-server/libvje/effects/dupmagic.h +++ b/veejay-current/veejay-server/libvje/effects/dupmagic.h @@ -20,10 +20,6 @@ #ifndef DUPMAGIC_H #define DUPMAGIC_H -#include -#include -#include - vj_effect *dupmagic_init(); void dupmagic_apply(VJFrame *frame, VJFrame *frame2,int n); #endif diff --git a/veejay-current/veejay-server/libvje/effects/emboss.c b/veejay-current/veejay-server/libvje/effects/emboss.c index eae02d88..7670e5a9 100644 --- a/veejay-current/veejay-server/libvje/effects/emboss.c +++ b/veejay-current/veejay-server/libvje/effects/emboss.c @@ -17,13 +17,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 , USA. */ -#include -#include + +#include "common.h" #include #include "emboss.h" -#include -#include -#include "common.h" vj_effect *emboss_init(int w, int h) { @@ -86,7 +83,7 @@ static void xtreme_emboss_framedata(VJFrame *frame, int width, int height) { unsigned int r, c; uint8_t *Y = frame->data[0]; - int len = ( width * height ) - width; + int len = ( frame->len ) - width; for (r = width; r < len; r += width) { for (c = 1; c < (width-1); c++) @@ -107,7 +104,7 @@ static void xtreme_emboss_framedata(VJFrame *frame, int width, int height) static void another_try_edge(VJFrame *frame, int w, int h) { uint8_t p; - const unsigned int len=(w*h)-w; + const int len=frame->len-w; unsigned int r,c; uint8_t *Y = frame->data[0]; for(r=w; r < len; r+= w) @@ -132,7 +129,7 @@ static void another_try_edge(VJFrame *frame, int w, int h) static void lines_white_balance_framedata(VJFrame *frame, int width, int height) { unsigned int r, c; - const unsigned int len = (width * height) - width; + const int len = frame->len - width; uint8_t val; uint8_t *Y = frame->data[0]; for (r = width; r < len; r += width) @@ -157,7 +154,7 @@ static void emboss_test_framedata(VJFrame *frame, int width, int height) { int a, b, c; int i; - const int len = width * height; + const int len = frame->len; uint8_t *Y = frame->data[0]; for (i = 0; i < len; i++) { @@ -178,7 +175,8 @@ static void gray_emboss_framedata(VJFrame *frame, int width, int height) int r, c; uint8_t val; uint8_t *Y = frame->data[0]; - for (r = 0; r < (width * height); r += width) + const int len = frame->len; + for (r = 0; r < len; r += width) { for (c = 0; c < width; c++) { @@ -206,7 +204,7 @@ static void aggressive_emboss_framedata(VJFrame *frame, int width, int height) int r, c; uint8_t val; uint8_t *Y = frame->data[0]; - const int len = width * height; + const int len = frame->len; for (r = 0; r < len; r += width) { for (c = 0; c < width; c++) @@ -234,7 +232,8 @@ static void dark_emboss_framedata(VJFrame *frame, int width, int height) { int r, c; uint8_t *Y = frame->data[0]; - for (r = 0; r < (width * height); r += width) + const int len = frame->len; + for (r = 0; r < len; r += width) { for (c = 0; c < width; c++) { @@ -260,7 +259,8 @@ static void grayish_mood_framedata(VJFrame *frame, int width, int height) { int r, c; uint8_t *Y = frame->data[0]; - for (r = 0; r < (width * height); r += width) + const int len = frame->len; + for (r = 0; r < len; r += width) { for (c = 0; c < width; c++) { @@ -285,7 +285,7 @@ static void grayish_mood_framedata(VJFrame *frame, int width, int height) static void blur_dark_framedata(VJFrame *frame, int width, int height) { int r, c; - int len = (width*height) - width; + int len = frame->len - width; /* incomplete */ uint8_t *Y = frame->data[0]; for (r = width; r < len; r += width) @@ -307,8 +307,8 @@ static void blur_dark_framedata(VJFrame *frame, int width, int height) void emboss_apply(VJFrame *frame, int n) { - int width, height; - width=frame->width; height = frame->height; + const unsigned int width = frame->width; + const unsigned int height = frame->height; switch (n) { diff --git a/veejay-current/veejay-server/libvje/effects/emboss.h b/veejay-current/veejay-server/libvje/effects/emboss.h index abd695a0..ddbce0af 100644 --- a/veejay-current/veejay-server/libvje/effects/emboss.h +++ b/veejay-current/veejay-server/libvje/effects/emboss.h @@ -20,10 +20,6 @@ #ifndef EMBOSS_H #define EMBOSS_H -#include -#include -#include - vj_effect *emboss_init(); void emboss_apply(VJFrame *frame, int n); #endif diff --git a/veejay-current/veejay-server/libvje/effects/enhancemask.c b/veejay-current/veejay-server/libvje/effects/enhancemask.c index 3170028b..21b57a66 100644 --- a/veejay-current/veejay-server/libvje/effects/enhancemask.c +++ b/veejay-current/veejay-server/libvje/effects/enhancemask.c @@ -17,13 +17,11 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 , USA. */ -#include -#include -#include -#include -#include "enhancemask.h" #include "common.h" +#include +#include "enhancemask.h" + vj_effect *enhancemask_init(int width, int height) { vj_effect *ve = (vj_effect *) vj_calloc(sizeof(vj_effect)); @@ -52,9 +50,9 @@ void enhancemask_apply(VJFrame *frame, int *s ) //int s[9]= { 1, 0, -1, 2, 0, -2, 1 , 0 , -1}; unsigned int r; - const int width = frame->width; - const int height = frame->height; - const unsigned int len = (frame->len)-width-1; + const unsigned int width = frame->width; + const int len = frame->len; + const int len2 = len-width-1; uint8_t *Y = frame->data[0]; /* int sum=0; @@ -84,7 +82,7 @@ void enhancemask_apply(VJFrame *frame, int *s ) // unsigned int op0,op1; // op0 = (s[1] > 255) ? 255 : s[1]; // op1 = 255 - op1; - for(r=0; r < len; r++) { + for(r=0; r < len2; r++) { m = ( Y[r] + Y[r+1] + Y[r+width] + Y[r+width+1] + 2) >> 2; d = Y[r] - m; d *= s[0]; @@ -94,7 +92,7 @@ void enhancemask_apply(VJFrame *frame, int *s ) // Y[r] = (m * op0 + a * op1) / 255; Y[r] = m; } - for(r=len; r < (width*height); r++) { + for(r=len2; r < len; r++) { m = (Y[r] + Y[r+1] + Y[r-width] + Y[r-width+1] + 2) >> 2; d = Y[r]-m; d *= s[0]; diff --git a/veejay-current/veejay-server/libvje/effects/enhancemask.h b/veejay-current/veejay-server/libvje/effects/enhancemask.h index 05915bb1..d03de9a8 100644 --- a/veejay-current/veejay-server/libvje/effects/enhancemask.h +++ b/veejay-current/veejay-server/libvje/effects/enhancemask.h @@ -20,14 +20,7 @@ #ifndef ENHANCEMASK_H #define ENHANCEMASK_H -#include -#include -#include - vj_effect *enhancemask_init(int w, int h); - - void enhancemask_apply(VJFrame *frame, int *t); - void enhancemask_free(); #endif diff --git a/veejay-current/veejay-server/libvje/effects/feathermask.c b/veejay-current/veejay-server/libvje/effects/feathermask.c index 3c3f2447..73343d29 100644 --- a/veejay-current/veejay-server/libvje/effects/feathermask.c +++ b/veejay-current/veejay-server/libvje/effects/feathermask.c @@ -17,13 +17,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 , USA. */ -#include -#include -#include -#include + +#include "common.h" #include #include "feathermask.h" -#include "common.h" vj_effect *feathermask_init(int w,int h) { @@ -54,11 +51,11 @@ void feathermask_free() } } -static void feathermask1_apply( VJFrame *frame, uint8_t *alpha, int width, int height) +static void feathermask1_apply( VJFrame *frame, uint8_t *alpha, unsigned int width, unsigned int height) { - int r, c; - int len = (width * height) - width; - uint8_t *aA = frame->data[3]; + int r, c; + const int len = frame->len - width; + uint8_t *aA = frame->data[3]; for(r=width; r < len; r+=width) { for(c=1; c < (width-1); c++) { @@ -76,9 +73,12 @@ static void feathermask1_apply( VJFrame *frame, uint8_t *alpha, int width, int h } } -void feathermask_apply(VJFrame *frame, int width, int height) +void feathermask_apply(VJFrame *frame) { - vj_frame_copy1( frame->data[3],mask, width * height ); + const unsigned int width = frame->width; + const unsigned int height = frame->height; + const int len = frame->len; + vj_frame_copy1( frame->data[3],mask, len ); feathermask1_apply(frame, mask, width, height); } diff --git a/veejay-current/veejay-server/libvje/effects/feathermask.h b/veejay-current/veejay-server/libvje/effects/feathermask.h index f898717c..ddd3584e 100644 --- a/veejay-current/veejay-server/libvje/effects/feathermask.h +++ b/veejay-current/veejay-server/libvje/effects/feathermask.h @@ -20,12 +20,8 @@ #ifndef FEATHERMASK_H #define FEATHERMASK_H -#include -#include -#include - vj_effect *feathermask_init(int w, int h); -void feathermask_apply( VJFrame *frame, int width, int height); +void feathermask_apply( VJFrame *frame); int feathermask_malloc(int width, int height); void feathermask_free(); #endif diff --git a/veejay-current/veejay-server/libvje/effects/fibdownscale.c b/veejay-current/veejay-server/libvje/effects/fibdownscale.c index c3cd5cee..2e70b0a5 100644 --- a/veejay-current/veejay-server/libvje/effects/fibdownscale.c +++ b/veejay-current/veejay-server/libvje/effects/fibdownscale.c @@ -17,12 +17,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 , USA. */ -#include -#include -#include + +#include "common.h" #include #include "fibdownscale.h" -#include "common.h" vj_effect *fibdownscale_init(int w, int h) { @@ -53,8 +51,8 @@ vj_effect *fibdownscale_init(int w, int h) static void fibdownscale1_apply(VJFrame *frame, VJFrame *frame2) { unsigned i, f1; - unsigned int len = frame->len >> 1; - unsigned int uv_len = (frame->ssm ? frame->len : frame->uv_len) >> 1; + const int len = frame->len >> 1; + const int uv_len = (frame->ssm ? frame->len : frame->uv_len) >> 1; uint8_t *Y = frame->data[0]; uint8_t *Cb = frame->data[1]; @@ -114,8 +112,6 @@ static void fibrectangle1_apply(VJFrame *frame, VJFrame *frame2) void fibdownscale_apply(VJFrame *frame, VJFrame *frame2, int n) { - int width, height; - width = frame->width; height = frame->height; if (n == 0) fibdownscale1_apply(frame, frame2); if (n == 1) diff --git a/veejay-current/veejay-server/libvje/effects/fibdownscale.h b/veejay-current/veejay-server/libvje/effects/fibdownscale.h index 50f24aa7..d8953227 100644 --- a/veejay-current/veejay-server/libvje/effects/fibdownscale.h +++ b/veejay-current/veejay-server/libvje/effects/fibdownscale.h @@ -20,9 +20,6 @@ #ifndef FIBDOWNSCALE_H #define FIBDOWNSCALE_H -#include -#include -#include vj_effect *fibdownscale_init(); void fibdownscale_apply(VJFrame *frame, VJFrame *frame2, int n); #endif diff --git a/veejay-current/veejay-server/libvje/effects/fisheye.c b/veejay-current/veejay-server/libvje/effects/fisheye.c index 48d9babb..91d374b8 100644 --- a/veejay-current/veejay-server/libvje/effects/fisheye.c +++ b/veejay-current/veejay-server/libvje/effects/fisheye.c @@ -17,13 +17,11 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 , USA. */ -#include -#include -#include -#include "fisheye.h" -#include + #include "common.h" -#include +#include +#include "fisheye.h" + #define RUP8(num)(((num)+8)&~8) vj_effect *fisheye_init(int w, int h) @@ -117,12 +115,14 @@ static double __fisheye_i(double r, double v, double e) -void fisheye_apply(VJFrame *frame, int w, int h, int v, int alpha ) +void fisheye_apply(VJFrame *frame, int v, int alpha ) { int i; double (*pf)(double a, double b, double c); - const int len = frame->len; - uint8_t *Y = frame->data[0]; + const unsigned int width = frame->width; + const unsigned int height = frame->height; + const int len = frame->len; + uint8_t *Y = frame->data[0]; uint8_t *Cb = frame->data[1]; uint8_t *Cr = frame->data[2]; @@ -139,13 +139,13 @@ void fisheye_apply(VJFrame *frame, int w, int h, int v, int alpha ) if( v != _v ) { const double curve = 0.001 * v; - const unsigned int R = h/2; + const unsigned int R = height/2; const double coeef = R / log(curve * R + 1); /* pre calculate */ int px,py; double r,a,co,si; - const int w2 = w/2; - const int h2 = h/2; + const int w2 = width/2; + const int h2 = height/2; for(i=0; i < len; i++) { @@ -162,11 +162,11 @@ void fisheye_apply(VJFrame *frame, int w, int h, int v, int alpha ) py += h2; if(px < 0) px =0; - if(px > w) px = w; + if(px > width) px = width; if(py < 0) py = 0; - if(py >= (h-1)) py = h-1; + if(py >= (height-1)) py = height-1; - cached_coords[i] = (py * w)+px; + cached_coords[i] = (py * width)+px; } else { @@ -177,16 +177,16 @@ void fisheye_apply(VJFrame *frame, int w, int h, int v, int alpha ) _v = v; } - veejay_memcpy(buf[0], Y,(w*h)); - veejay_memcpy(buf[1], Cb,(w*h)); - veejay_memcpy(buf[2], Cr,(w*h)); + veejay_memcpy(buf[0], Y,(len)); + veejay_memcpy(buf[1], Cb,(len)); + veejay_memcpy(buf[2], Cr,(len)); if( alpha == 0 ) { for(i=0; i < len; i++) { if(cached_coords[i] == -1) { - Y[i] = pixel_Y_lo_; + Y[i] = pixel_Y_lo_; Cb[i] = 128; Cr[i] = 128; } diff --git a/veejay-current/veejay-server/libvje/effects/fisheye.h b/veejay-current/veejay-server/libvje/effects/fisheye.h index b4a4aa60..f7171502 100644 --- a/veejay-current/veejay-server/libvje/effects/fisheye.h +++ b/veejay-current/veejay-server/libvje/effects/fisheye.h @@ -20,13 +20,8 @@ #ifndef FISHEYE_H #define FISHEYE_H -#include -#include -#include -#include - vj_effect *fisheye_init(int w, int h); int fisheye_malloc(int w, int h); void fisheye_free(); -void fisheye_apply(VJFrame *frame, int width, int height, int val, int alpha ); +void fisheye_apply(VJFrame *frame, int val, int alpha ); #endif diff --git a/veejay-current/veejay-server/libvje/effects/flare.c b/veejay-current/veejay-server/libvje/effects/flare.c index 03490a45..2d07b73f 100644 --- a/veejay-current/veejay-server/libvje/effects/flare.c +++ b/veejay-current/veejay-server/libvje/effects/flare.c @@ -18,14 +18,9 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 , USA. */ - -#include -#include -#include -#include -#include -#include "flare.h" #include "common.h" +#include +#include "flare.h" /* blend by blurred mask. derived from radial blur and chromamagick effect. @@ -224,7 +219,7 @@ static void flare_darken(VJFrame *frame, VJFrame *frame2, int w, int h, int op_a static void flare_simple( VJFrame *frame, VJFrame *frame2, int w, int h, int op_a ) { unsigned int i; - unsigned int len = w* h; + const int len = frame->len; uint8_t *Y = frame->data[0]; uint8_t *Y2 = frame2->data[0]; @@ -264,20 +259,23 @@ static void flare_lighten(VJFrame *frame, VJFrame *frame2, int w, int h, int op_ } } -void flare_apply(VJFrame *A, - int width, int height, int type, int op_a, int radius) +void flare_apply(VJFrame *frame, int type, int op_a, int radius) { - int y,x; + int y,x; int plane = 0; - /* clone A */ - VJFrame B; - veejay_memcpy( &B, A, sizeof(VJFrame)); + const unsigned int width = frame->width; + const unsigned int height = frame->height; + const int len = frame->len; + + /* clone frame */ + VJFrame frame2; + veejay_memcpy( &frame2, frame, sizeof(VJFrame)); /* data is local */ - B.data[0] = flare_buf[0]; - B.data[1] = flare_buf[1]; - B.data[2] = flare_buf[2]; - int strides[4] = { A->len, A->len, A->len, 0 }; - vj_frame_copy( A->data, B.data,strides ); + frame2.data[0] = flare_buf[0]; + frame2.data[1] = flare_buf[1]; + frame2.data[2] = flare_buf[2]; + int strides[4] = { len, len, len, 0 }; + vj_frame_copy( frame->data, frame2.data,strides ); /* apply blur on Image, horizontal and vertical (blur2 is from xine, see radial blur */ @@ -285,8 +283,8 @@ void flare_apply(VJFrame *A, for( plane = 0; plane < 2; plane ++ ) { for( y = 0; y < height; y ++ ) - blur2( A->data[plane] + (y * width), - B.data[plane] + (y * width), + blur2( frame->data[plane] + (y * width), + frame2.data[plane] + (y * width), width, radius, 2, @@ -297,8 +295,8 @@ void flare_apply(VJFrame *A, for( plane = 0; plane <2; plane ++ ) { for( x = 0; x < width; x ++ ) - blur2( A->data[plane] + x , - B.data[plane] + x, + blur2( frame->data[plane] + x , + frame2.data[plane] + x, height, radius, 2, @@ -310,23 +308,23 @@ void flare_apply(VJFrame *A, switch( type ) { case 1: - flare_exclusive(A,&B,width,height,op_a); + flare_exclusive(frame,&frame2,width,height,op_a); break; case 2: - flare_additive(A,&B,width,height,op_a); + flare_additive(frame,&frame2,width,height,op_a); break; case 3: - flare_unfreeze(A,&B,width,height,op_a); + flare_unfreeze(frame,&frame2,width,height,op_a); break; case 4: - flare_darken(A,&B,width,height,op_a); + flare_darken(frame,&frame2,width,height,op_a); break; case 5: - flare_lighten( A, &B, width, height, op_a ); + flare_lighten( frame, &frame2, width, height, op_a ); break; default: - flare_simple( A, &B, width,height, op_a ); + flare_simple( frame, &frame2, width,height, op_a ); break; } diff --git a/veejay-current/veejay-server/libvje/effects/flare.h b/veejay-current/veejay-server/libvje/effects/flare.h index 6b2b33cb..574f9e61 100644 --- a/veejay-current/veejay-server/libvje/effects/flare.h +++ b/veejay-current/veejay-server/libvje/effects/flare.h @@ -20,12 +20,8 @@ #ifndef FLARE_H #define FLARE_H -#include -#include -#include - vj_effect *flare_init(int w, int h); int flare_malloc(int w, int h); -void flare_apply(VJFrame *A, int width, int height, int type, int theshold,int radius ); +void flare_apply(VJFrame *frame, int type, int theshold,int radius ); void flare_free(); #endif diff --git a/veejay-current/veejay-server/libvje/effects/flip.c b/veejay-current/veejay-server/libvje/effects/flip.c index 316160a6..2a26fa57 100644 --- a/veejay-current/veejay-server/libvje/effects/flip.c +++ b/veejay-current/veejay-server/libvje/effects/flip.c @@ -17,10 +17,9 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 , USA. */ -#include -#include -#include + #include "common.h" +#include #include "flip.h" vj_effect *flip_init(int w, int h) diff --git a/veejay-current/veejay-server/libvje/effects/flip.h b/veejay-current/veejay-server/libvje/effects/flip.h index 88a71661..f83e122a 100644 --- a/veejay-current/veejay-server/libvje/effects/flip.h +++ b/veejay-current/veejay-server/libvje/effects/flip.h @@ -20,10 +20,6 @@ #ifndef FLIP_H #define FLIP_H -#include -#include -#include - vj_effect *flip_init(); void flip_apply(VJFrame *frame, int n); #endif diff --git a/veejay-current/veejay-server/libvje/effects/frameborder.c b/veejay-current/veejay-server/libvje/effects/frameborder.c index c2310b9f..d129cd92 100644 --- a/veejay-current/veejay-server/libvje/effects/frameborder.c +++ b/veejay-current/veejay-server/libvje/effects/frameborder.c @@ -17,13 +17,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 , USA. */ -#include -#include -#include -#include -#include -#include "frameborder.h" + #include "common.h" +#include +#include "frameborder.h" vj_effect *frameborder_init(int width, int height) { diff --git a/veejay-current/veejay-server/libvje/effects/gamma.c b/veejay-current/veejay-server/libvje/effects/gamma.c index 747ee35e..9d836873 100644 --- a/veejay-current/veejay-server/libvje/effects/gamma.c +++ b/veejay-current/veejay-server/libvje/effects/gamma.c @@ -17,10 +17,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 , USA. */ -#include -#include -#include -#include + +#include "common.h" #include #include "gamma.h" @@ -62,7 +60,8 @@ static void gamma_setup(int width, int height, void gamma_apply(VJFrame *frame, int gamma_value) { - unsigned int i, len = frame->len; + unsigned int i; + const int len = frame->len; uint8_t *Y = frame->data[0]; if (gamma_value != gamma_flag) { diff --git a/veejay-current/veejay-server/libvje/effects/gaussblur.c b/veejay-current/veejay-server/libvje/effects/gaussblur.c index bf8b8dc5..e218a61b 100644 --- a/veejay-current/veejay-server/libvje/effects/gaussblur.c +++ b/veejay-current/veejay-server/libvje/effects/gaussblur.c @@ -18,16 +18,11 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 , USA. */ -#include -#include -#include -#include "gaussblur.h" -#include -#include #include "common.h" -#include +#include #include #include +#include "gaussblur.h" vj_effect *gaussblur_init(int w,int h) { @@ -165,14 +160,16 @@ static void gaussblur(uint8_t *dst, const int dst_linesize,const uint8_t *src, c void gaussblur_apply(VJFrame *frame, int radius, int strength, int quality ) { uint8_t *A = frame->data[3]; - const unsigned int len = frame->len; + const unsigned int width = frame->width; + const unsigned int height = frame->height; + const int len = frame->len; if( last_radius != radius || last_strength != strength || last_quality != quality ) { if( gaussfilter->filter_context ) { sws_freeContext( gaussfilter->filter_context ); } - if( gaussfilter_init( frame->width,frame->height, radius, strength, quality ) == 0 ) + if( gaussfilter_init( width, height, radius, strength, quality ) == 0 ) return; last_radius = radius; @@ -182,6 +179,6 @@ void gaussblur_apply(VJFrame *frame, int radius, int strength, int quality ) veejay_memcpy( temp, A, len ); - gaussblur( A, frame->width, temp, frame->width, frame->width,frame->height,gaussfilter->filter_context ); + gaussblur( A, width, temp, width, width, height, gaussfilter->filter_context ); } diff --git a/veejay-current/veejay-server/libvje/effects/gaussblur.h b/veejay-current/veejay-server/libvje/effects/gaussblur.h index a1c3049a..11d87989 100644 --- a/veejay-current/veejay-server/libvje/effects/gaussblur.h +++ b/veejay-current/veejay-server/libvje/effects/gaussblur.h @@ -20,10 +20,6 @@ #ifndef AGAUSSB_H #define AGAUSSB_H -#include -#include -#include - void gaussblur_apply(VJFrame *frame, int radius, int strength, int quality ); void gaussblur_free(); int gaussblur_malloc(int w, int h); diff --git a/veejay-current/veejay-server/libvje/effects/ghost.c b/veejay-current/veejay-server/libvje/effects/ghost.c index e89d1e0e..58bb551e 100644 --- a/veejay-current/veejay-server/libvje/effects/ghost.c +++ b/veejay-current/veejay-server/libvje/effects/ghost.c @@ -18,11 +18,8 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 , USA. */ -#include -#include -#include -#include #include "common.h" +#include #include "ghost.h" static uint8_t *ghost_buf[4] = { NULL,NULL,NULL, NULL}; @@ -77,14 +74,14 @@ void ghost_free() diff_map = NULL; } -void ghost_apply(VJFrame *frame, - int width, int height, int opacity) +void ghost_apply(VJFrame *frame, int opacity) { register int q,z=0; - int x,y,i; - const int len = frame->len; - const unsigned int op_a = opacity; - const unsigned int op_b = 255 - op_a; + int x,y,i; + const unsigned int width = frame->width; + const int len = frame->len; + const unsigned int op_a = opacity; + const unsigned int op_b = 255 - op_a; uint8_t *srcY = frame->data[0]; uint8_t *srcCb= frame->data[1]; uint8_t *srcCr= frame->data[2]; @@ -112,8 +109,6 @@ void ghost_apply(VJFrame *frame, for(i = 0; i < len; i ++ ) bm[i] = ( abs(srcY[i] - dY[i]) > 1 ? 0xff: 0x0); - - for( y = width; y < (len-width); y += width ) { for( x = 1; x < width - 1; x ++ ) diff --git a/veejay-current/veejay-server/libvje/effects/ghost.h b/veejay-current/veejay-server/libvje/effects/ghost.h index 3a0cb954..2e1ef33e 100644 --- a/veejay-current/veejay-server/libvje/effects/ghost.h +++ b/veejay-current/veejay-server/libvje/effects/ghost.h @@ -20,12 +20,8 @@ #ifndef GHOST_H #define GHOST_H -#include -#include -#include - vj_effect *ghost_init(int w, int h); -void ghost_apply( VJFrame *frame, int width, int height, int op); +void ghost_apply( VJFrame *frame, int op); int ghost_malloc( int w, int h ); void ghost_free(void); diff --git a/veejay-current/veejay-server/libvje/effects/greyselect.c b/veejay-current/veejay-server/libvje/effects/greyselect.c index 8b66ffcb..3764fde2 100644 --- a/veejay-current/veejay-server/libvje/effects/greyselect.c +++ b/veejay-current/veejay-server/libvje/effects/greyselect.c @@ -17,12 +17,9 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 , USA. */ -#include -#include -#include -#include -#include + #include "common.h" +#include #include "greyselect.h" vj_effect *greyselect_init(int w, int h) @@ -70,7 +67,7 @@ void greyselect_apply( VJFrame *frame, int i_angle, int r, int g, int b, int swa uint8_t *fg_cb, *fg_cr; int accept_angle_tg; int cb, cr; - float kg1, tmp, aa = 255.0f, bb = 255.0f, _y = 0; + float kg1, tmp, aa = 255.0f, bb = 255.0f; float angle = (float) i_angle / 100.0f; unsigned int pos; uint8_t val; @@ -78,7 +75,6 @@ void greyselect_apply( VJFrame *frame, int i_angle, int r, int g, int b, int swa uint8_t *Cr = frame->data[2]; int iy=0,iu=128,iv=128; _rgb2yuv(r,g,b,iy,iu,iv); - _y = (float) iy; aa = (float) iu; bb = (float) iv; diff --git a/veejay-current/veejay-server/libvje/effects/iris.c b/veejay-current/veejay-server/libvje/effects/iris.c index b08f9fed..e4d3e8a2 100644 --- a/veejay-current/veejay-server/libvje/effects/iris.c +++ b/veejay-current/veejay-server/libvje/effects/iris.c @@ -23,12 +23,10 @@ * weed-plugins/multi_transitions.c?revision=286 * */ -#include -#include -#include + +#include "common.h" #include #include "iris.h" -#include "common.h" vj_effect *iris_init(int w, int h) { @@ -53,10 +51,12 @@ vj_effect *iris_init(int w, int h) } -void iris_apply( VJFrame *frame, VJFrame *frame2, int width, int height, int val, int shape) +void iris_apply( VJFrame *frame, VJFrame *frame2, int val, int shape) { int i,j,k=0; - int len = (width * height); + const unsigned int width = frame->width; + const unsigned int height = frame->height; + const int len = frame->len; uint8_t *Y0 = frame->data[0]; uint8_t *Cb0 = frame->data[1]; diff --git a/veejay-current/veejay-server/libvje/effects/iris.h b/veejay-current/veejay-server/libvje/effects/iris.h index 95375307..128fc11d 100644 --- a/veejay-current/veejay-server/libvje/effects/iris.h +++ b/veejay-current/veejay-server/libvje/effects/iris.h @@ -20,11 +20,7 @@ #ifndef IRIS_H #define IRIS_H -#include -#include -#include - vj_effect *iris_init(); -void iris_apply( VJFrame *frame, VJFrame *frame2, int width, int height, int value, int shape); +void iris_apply( VJFrame *frame, VJFrame *frame2, int value, int shape); void iris_free(); #endif diff --git a/veejay-current/veejay-server/libvje/effects/isolate.c b/veejay-current/veejay-server/libvje/effects/isolate.c index 47ee759b..81b0b51f 100644 --- a/veejay-current/veejay-server/libvje/effects/isolate.c +++ b/veejay-current/veejay-server/libvje/effects/isolate.c @@ -17,12 +17,9 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 , USA. */ -#include -#include -#include -#include -#include + #include "common.h" +#include #include "isolate.h" vj_effect *isolate_init(int w, int h) @@ -70,7 +67,7 @@ void isolate_apply( VJFrame *frame, int i_angle, int r, int g, int b, int opacit uint8_t *fg_cb, *fg_cr; int accept_angle_tg; int cb, cr; - float kg1, tmp, aa = 255, bb = 255, _y = 0; + float kg1, tmp, aa = 255, bb = 255; float angle = (float) i_angle / 100.0f; unsigned int pos; uint8_t val; @@ -79,7 +76,6 @@ void isolate_apply( VJFrame *frame, int i_angle, int r, int g, int b, int opacit uint8_t *Cr = frame->data[2]; int iy=0,iu=0,iv=0; _rgb2yuv(r,g,b,iy,iu,iv); - _y = (float) iy; aa = (float) iu; bb = (float) iv; tmp = sqrt(((aa * aa) + (bb * bb))); diff --git a/veejay-current/veejay-server/libvje/effects/keyselect.c b/veejay-current/veejay-server/libvje/effects/keyselect.c index 898d5ae4..ab6ca868 100644 --- a/veejay-current/veejay-server/libvje/effects/keyselect.c +++ b/veejay-current/veejay-server/libvje/effects/keyselect.c @@ -17,13 +17,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 , USA. */ -#include -#include -#include -#include + +#include "common.h" #include #include "keyselect.h" -#include "common.h" vj_effect *keyselect_init(int w, int h) { @@ -141,8 +138,8 @@ void keyselect_apply( VJFrame *frame, VJFrame *frame2, int i_angle, { uint8_t *fg_y, *fg_cb, *fg_cr; uint8_t *bg_y, *bg_cb, *bg_cr; - const int width = frame->width; - const int height = frame->height; + const unsigned int width = frame->width; + const unsigned int height = frame->height; int accept_angle_tg, accept_angle_ctg, one_over_kc; int kfgy_scale, kg; int cb, cr; diff --git a/veejay-current/veejay-server/libvje/effects/killchroma.c b/veejay-current/veejay-server/libvje/effects/killchroma.c index abf8dbe4..d90daa3d 100644 --- a/veejay-current/veejay-server/libvje/effects/killchroma.c +++ b/veejay-current/veejay-server/libvje/effects/killchroma.c @@ -17,14 +17,9 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 , USA. */ -#include -#include -#include "killchroma.h" #include "common.h" -#include -#include -#include #include +#include "killchroma.h" vj_effect *killchroma_init(int w, int h) { @@ -53,13 +48,14 @@ vj_effect *killchroma_init(int w, int h) void killchroma_apply(VJFrame *frame, int n) { + const int len = frame->len; if(n==0) { - veejay_memset( frame->data[1], 128, (frame->ssm ? frame->len : frame->uv_len) ); - veejay_memset( frame->data[2], 128, (frame->ssm ? frame->len : frame->uv_len) ); + veejay_memset( frame->data[1], 128, (frame->ssm ? len : frame->uv_len) ); + veejay_memset( frame->data[2], 128, (frame->ssm ? len : frame->uv_len) ); } else { - veejay_memset( frame->data[n], 128, (frame->ssm ? frame->len : frame->uv_len ) ); + veejay_memset( frame->data[n], 128, (frame->ssm ? len : frame->uv_len ) ); } } diff --git a/veejay-current/veejay-server/libvje/effects/killchroma.h b/veejay-current/veejay-server/libvje/effects/killchroma.h index 9b113167..04b49c61 100644 --- a/veejay-current/veejay-server/libvje/effects/killchroma.h +++ b/veejay-current/veejay-server/libvje/effects/killchroma.h @@ -20,9 +20,6 @@ #ifndef KILLCHROMA_H #define KILLCHROMA_H -#include -#include -#include vj_effect *killchroma_init(); void killchroma_apply(VJFrame *v, int n); #endif diff --git a/veejay-current/veejay-server/libvje/effects/levelcorrection.c b/veejay-current/veejay-server/libvje/effects/levelcorrection.c index 4a6213cf..46e0cda5 100644 --- a/veejay-current/veejay-server/libvje/effects/levelcorrection.c +++ b/veejay-current/veejay-server/libvje/effects/levelcorrection.c @@ -18,13 +18,9 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 , USA. */ -#include -#include +#include "common.h" #include #include "levelcorrection.h" -#include -#include -#include "common.h" vj_effect *levelcorrection_init(int w,int h) { @@ -68,7 +64,7 @@ void levelcorrection_apply(VJFrame *frame, int min, int max, int bmin,int bmax) { unsigned int pos; uint8_t *A = frame->data[3]; - const unsigned int len = frame->len; + const int len = frame->len; /* level correction tables */ uint8_t __lookup_table[256]; diff --git a/veejay-current/veejay-server/libvje/effects/levelcorrection.h b/veejay-current/veejay-server/libvje/effects/levelcorrection.h index cc48f214..c1979dd5 100644 --- a/veejay-current/veejay-server/libvje/effects/levelcorrection.h +++ b/veejay-current/veejay-server/libvje/effects/levelcorrection.h @@ -20,9 +20,6 @@ #ifndef ALEVELCORRECTION_H #define ALEVELCORRECTION_H -#include -#include -#include void levelcorrection_apply(VJFrame *frame, int min, int max, int bmin, int bmax); vj_effect *levelcorrection_init(int w,int h); #endif diff --git a/veejay-current/veejay-server/libvje/effects/lumablend.c b/veejay-current/veejay-server/libvje/effects/lumablend.c index 33ba3ed0..350de770 100644 --- a/veejay-current/veejay-server/libvje/effects/lumablend.c +++ b/veejay-current/veejay-server/libvje/effects/lumablend.c @@ -18,12 +18,9 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 , USA. */ -#include -#include -#include +#include "common.h" #include #include -#include "common.h" #include "lumablend.h" vj_effect *lumablend_init(int w, int h) @@ -67,7 +64,7 @@ vj_effect *lumablend_init(int w, int h) static void opacity_by_threshold(VJFrame *frame, VJFrame *frame2, int threshold, int threshold2, int opacity) { - const int width = frame->width; + const unsigned int width = frame->width; const int len = frame->len; uint8_t **yuv1 = frame->data; uint8_t **yuv2 = frame2->data; @@ -95,7 +92,7 @@ static void opacity_by_threshold(VJFrame *frame, VJFrame *frame2, static void opacity_by_threshold_(VJFrame *frame, VJFrame *frame2, int threshold, int threshold2, int opacity) { - const int width = frame->width; + const unsigned int width = frame->width; const int len = frame->len; uint8_t **yuv1 = frame->data; uint8_t **yuv2 = frame2->data; @@ -121,7 +118,7 @@ static void opacity_by_threshold_(VJFrame *frame, VJFrame *frame2, static void opacity_by_threshold_blur(VJFrame *frame, VJFrame *frame2, int threshold, int threshold2, int opacity) { - const int width = frame->width; + const unsigned int width = frame->width; const int len = frame->len - width; uint8_t **yuv1 = frame->data; uint8_t **yuv2 = frame2->data; diff --git a/veejay-current/veejay-server/libvje/effects/lumakey.c b/veejay-current/veejay-server/libvje/effects/lumakey.c index 411de91b..960d052f 100644 --- a/veejay-current/veejay-server/libvje/effects/lumakey.c +++ b/veejay-current/veejay-server/libvje/effects/lumakey.c @@ -17,12 +17,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 , USA. */ -#include -#include -#include + +#include "common.h" #include #include "lumakey.h" -#include "common.h" vj_effect *lumakey_init(int width, int height) { diff --git a/veejay-current/veejay-server/libvje/effects/lumakeyalpha.c b/veejay-current/veejay-server/libvje/effects/lumakeyalpha.c index d5366da8..cf2ff35a 100644 --- a/veejay-current/veejay-server/libvje/effects/lumakeyalpha.c +++ b/veejay-current/veejay-server/libvje/effects/lumakeyalpha.c @@ -17,11 +17,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 , USA. */ -#include -#include + +#include "common.h" #include #include "lumakeyalpha.h" -#include "common.h" vj_effect *lumakeyalpha_init(int width, int height) { @@ -54,9 +53,10 @@ vj_effect *lumakeyalpha_init(int width, int height) return ve; } -void lumakeyalpha_apply( VJFrame *frame, VJFrame *frame2, int width,int height, int type, int opacity ) +void lumakeyalpha_apply( VJFrame *frame, VJFrame *frame2, int type, int opacity ) { - unsigned int i, len = width * height; + unsigned int i; + const int len = frame->len; unsigned int op1 = (opacity > 255) ? 255 : opacity; unsigned int op0 = 255 - op1; @@ -77,37 +77,37 @@ void lumakeyalpha_apply( VJFrame *frame, VJFrame *frame2, int width,int height, Y[i] = FEATHER( Y[i],op0,aB[i],Y2[i],op1 ); Cb[i]= FEATHER(Cb[i],op0,aB[i],Cb2[i],op1 ); - Cr[i]= FEATHER(Cr[i],op0,aB[i],Cr2[i],op1 ); + Cr[i]= FEATHER(Cr[i],op0,aB[i],Cr2[i],op1 ); } break; - case 1: + case 1: for( i = 0; i < len; i ++ ) { if( aA[i] == 0 ) continue; Y[i] = FEATHER( Y[i],op0,aB[i],Y2[i],op1 ); Cb[i]= FEATHER(Cb[i],op0,aB[i],Cb2[i],op1 ); - Cr[i]= FEATHER(Cr[i],op0,aB[i],Cr2[i],op1 ); + Cr[i]= FEATHER(Cr[i],op0,aB[i],Cr2[i],op1 ); } break; - case 2: + case 2: for( i = 0; i < len; i ++ ) { if( aB[i] == 0 || aA[i] == 0 ) continue; Y[i] = FEATHER( Y[i],op0,aB[i],Y2[i],op1 ); Cb[i]= FEATHER(Cb[i],op0,aB[i],Cb2[i],op1 ); - Cr[i]= FEATHER(Cr[i],op0,aB[i],Cr2[i],op1 ); + Cr[i]= FEATHER(Cr[i],op0,aB[i],Cr2[i],op1 ); } break; - case 3: + case 3: for( i = 0; i < len; i ++ ) { if( aB[i] == 0 && aA[i] == 0 ) continue; Y[i] = FEATHER( Y[i],op0,aB[i],Y2[i],op1 ); Cb[i]= FEATHER(Cb[i],op0,aB[i],Cb2[i],op1 ); - Cr[i]= FEATHER(Cr[i],op0,aB[i],Cr2[i],op1 ); + Cr[i]= FEATHER(Cr[i],op0,aB[i],Cr2[i],op1 ); } break; case 4: @@ -120,14 +120,14 @@ void lumakeyalpha_apply( VJFrame *frame, VJFrame *frame2, int width,int height, Cr[i]= FEATHER(Cr[i],op0,aA[i],Cr2[i],op1 ); } break; - case 5: + case 5: for( i = 0; i < len; i ++ ) { if( aA[i] == 0 ) continue; Y[i] = FEATHER( Y[i],op0,aA[i],Y2[i],op1 ); Cb[i]= FEATHER(Cb[i],op0,aA[i],Cb2[i],op1 ); - Cr[i]= FEATHER(Cr[i],op0,aA[i],Cr2[i],op1 ); + Cr[i]= FEATHER(Cr[i],op0,aA[i],Cr2[i],op1 ); } break; case 6: @@ -137,7 +137,7 @@ void lumakeyalpha_apply( VJFrame *frame, VJFrame *frame2, int width,int height, Y[i] = FEATHER( Y[i],op0,aA[i],Y2[i],op1 ); Cb[i]= FEATHER(Cb[i],op0,aA[i],Cb2[i],op1 ); - Cr[i]= FEATHER(Cr[i],op0,aA[i],Cr2[i],op1 ); + Cr[i]= FEATHER(Cr[i],op0,aA[i],Cr2[i],op1 ); } break; case 7: @@ -147,7 +147,7 @@ void lumakeyalpha_apply( VJFrame *frame, VJFrame *frame2, int width,int height, Y[i] = FEATHER( Y[i],op0,aA[i],Y2[i],op1 ); Cb[i]= FEATHER(Cb[i],op0,aA[i],Cb2[i],op1 ); - Cr[i]= FEATHER(Cr[i],op0,aA[i],Cr2[i],op1 ); + Cr[i]= FEATHER(Cr[i],op0,aA[i],Cr2[i],op1 ); } break; diff --git a/veejay-current/veejay-server/libvje/effects/lumakeyalpha.h b/veejay-current/veejay-server/libvje/effects/lumakeyalpha.h index 6a9938b0..36b43954 100644 --- a/veejay-current/veejay-server/libvje/effects/lumakeyalpha.h +++ b/veejay-current/veejay-server/libvje/effects/lumakeyalpha.h @@ -20,10 +20,6 @@ #ifndef LUMAKEYA_H #define LUMAKEYA_H -#include -#include -#include - vj_effect *lumakeyalpha_init(int w, int h); -void lumakeyalpha_apply( VJFrame *frame, VJFrame *frame2, int width, int height, int type, int opacity ); +void lumakeyalpha_apply( VJFrame *frame, VJFrame *frame2, int type, int opacity ); #endif diff --git a/veejay-current/veejay-server/libvje/effects/lumamagick.c b/veejay-current/veejay-server/libvje/effects/lumamagick.c index f2033b19..895c7b1f 100644 --- a/veejay-current/veejay-server/libvje/effects/lumamagick.c +++ b/veejay-current/veejay-server/libvje/effects/lumamagick.c @@ -19,13 +19,10 @@ */ /* 7 ,14, 24, 25, 26 */ -#include -#include -#include +#include "common.h" #include #include #include "lumamagick.h" -#include "common.h" /* 04/01/03: added transparency parameters for frame a and frame b in each function */ vj_effect *lumamagick_init(int width, int height) @@ -77,8 +74,8 @@ vj_effect *lumamagick_init(int width, int height) static void lumamagick_adddistorted(VJFrame *frame, VJFrame *frame2, int op_a, int op_b) { unsigned int i; - const unsigned int len = frame->len; - const unsigned int uv_len = (frame->ssm ? frame->len : frame->uv_len); + const int len = frame->len; + const int uv_len = (frame->ssm ? len : frame->uv_len); uint8_t *Y = frame->data[0]; uint8_t *Cb= frame->data[1]; uint8_t *Cr= frame->data[2]; @@ -117,8 +114,8 @@ static void lumamagick_add_distorted(VJFrame *frame, VJFrame *frame2, int op_a, uint8_t y1, y2, y3, cb, cr, cs; const double opacity_a = op_a * 0.01; const double opacity_b = op_b * 0.01; - const unsigned int len = frame->len; - const unsigned int uv_len = (frame->ssm ? frame->len : frame->uv_len); + const int len = frame->len; + const int uv_len = (frame->ssm ? len : frame->uv_len); uint8_t *Y = frame->data[0]; uint8_t *Cb= frame->data[1]; uint8_t *Cr= frame->data[2]; @@ -158,8 +155,8 @@ static void lumamagick_subdistorted(VJFrame *frame, VJFrame *frame2, int op_a, i uint8_t y1, y2, cb, cr; const double opacity_a = op_a * 0.01; const double opacity_b = op_b * 0.01; - const unsigned int len = frame->len; - const unsigned int uv_len = (frame->ssm ? frame->len : frame->uv_len); + const int len = frame->len; + const int uv_len = (frame->ssm ? len : frame->uv_len); uint8_t *Y = frame->data[0]; uint8_t *Cb= frame->data[1]; uint8_t *Cr= frame->data[2]; @@ -193,8 +190,8 @@ static void lumamagick_sub_distorted(VJFrame *frame, VJFrame *frame2, int op_a, const double opacity_a = op_a * 0.01; const double opacity_b = op_b * 0.01; uint8_t y1, y2, cb, cr, y3, cs; - const unsigned int len = frame->len; - const unsigned int uv_len = (frame->ssm ? frame->len : frame->uv_len); + const int len = frame->len; + const int uv_len = (frame->ssm ? len : frame->uv_len); uint8_t *Y = frame->data[0]; uint8_t *Cb= frame->data[1]; uint8_t *Cr= frame->data[2]; @@ -234,7 +231,7 @@ static void lumamagick_multiply(VJFrame *frame, VJFrame *frame2, int op_a, int o uint8_t y1, y2; const double opacity_a = op_a * 0.01; const double opacity_b = op_b * 0.01; - const unsigned int len = frame->len; + const int len = frame->len; uint8_t *Y = frame->data[0]; uint8_t *Y2 = frame2->data[0]; @@ -250,7 +247,7 @@ static void lumamagick_multiply(VJFrame *frame, VJFrame *frame2, int op_a, int o static void lumamagick_divide(VJFrame *frame, VJFrame *frame2 , int op_a, int op_b) { unsigned int i; - const unsigned int len = frame->width * frame->height; + const int len = frame->len; int b, c; const double opacity_a = op_a * 0.01; const double opacity_b = op_b * 0.01; @@ -269,7 +266,7 @@ static void lumamagick_divide(VJFrame *frame, VJFrame *frame2 , int op_a, int op static void lumamagick_negdiv(VJFrame *frame, VJFrame *frame2, int op_a ,int op_b ) { unsigned int i; - unsigned int len = frame->width * frame->height; + const int len = frame->len; uint8_t *Y = frame->data[0]; uint8_t *Y2 = frame2->data[0]; int b, c; @@ -293,7 +290,7 @@ static void lumamagick_additive(VJFrame *frame, VJFrame *frame2, int op_a, int o int a=0; const double opacity_a = op_a * 0.01; const double opacity_b = op_b * 0.01; - const unsigned int len = frame->len; + const int len = frame->len; uint8_t *Y = frame->data[0]; uint8_t *Y2 = frame2->data[0]; @@ -310,7 +307,7 @@ static void lumamagick_substractive(VJFrame *frame, VJFrame *frame2, int op_a, i int a; const double opacity_a = op_a * 0.01; const double opacity_b = op_b * 0.01; - const unsigned int len = frame->len; + const int len = frame->len; uint8_t *Y = frame->data[0]; uint8_t *Y2 = frame2->data[0]; @@ -327,7 +324,7 @@ static void lumamagick_softburn(VJFrame *frame, VJFrame *frame2, int op_a, int o int a, b, c; const double opacity_a = op_a * 0.01; const double opacity_b = op_b * 0.01; - const unsigned int len = frame->len; + const int len = frame->len; uint8_t *Y = frame->data[0]; uint8_t *Y2 = frame2->data[0]; @@ -358,7 +355,7 @@ static void lumamagick_inverseburn(VJFrame *frame, VJFrame *frame2, int op_a, in int a, b, c; const double opacity_a = op_a * 0.01; const double opacity_b = op_b * 0.01; - const unsigned int len = frame->len; + const int len = frame->len; uint8_t *Y = frame->data[0]; uint8_t *Y2 = frame2->data[0]; @@ -380,7 +377,7 @@ static void lumamagick_colordodge(VJFrame *frame, VJFrame *frame2, int op_a, int int a, b, c,d; const double opacity_a = op_a * 0.01; const double opacity_b = op_b * 0.01; - const unsigned int len = frame->len; + const int len = frame->len; uint8_t *Y = frame->data[0]; uint8_t *Y2 = frame2->data[0]; @@ -407,7 +404,7 @@ static void lumamagick_mulsub(VJFrame *frame, VJFrame *frame2 , int op_a, int op int a, b, c; const double opacity_a = op_a * 0.01; const double opacity_b = op_b * 0.01; - const unsigned int len = frame->len; + const int len = frame->len; uint8_t *Y = frame->data[0]; uint8_t *Y2 = frame2->data[0]; @@ -428,7 +425,7 @@ static void lumamagick_lighten(VJFrame *frame, VJFrame *frame2, int op_a, int op int a, b, c; const double opacity_a = op_a * 0.01; const double opacity_b = op_b * 0.01; - const unsigned int len = frame->len; + const int len = frame->len; uint8_t *Y = frame->data[0]; uint8_t *Y2 = frame2->data[0]; @@ -450,7 +447,7 @@ static void lumamagick_difference(VJFrame *frame, VJFrame *frame2, int op_a, int int a, b; const double opacity_a = op_a * 0.01; const double opacity_b = op_b * 0.01; - const unsigned int len = frame->len; + const int len = frame->len; uint8_t *Y = frame->data[0]; uint8_t *Y2 = frame2->data[0]; @@ -468,7 +465,7 @@ static void lumamagick_diffnegate(VJFrame *frame, VJFrame *frame2, int op_a, int int a, b; const double opacity_a = op_a * 0.01; const double opacity_b = op_b * 0.01; - const unsigned int len = frame->len; + const int len = frame->len; uint8_t *Y = frame->data[0]; uint8_t *Y2 = frame2->data[0]; @@ -486,7 +483,7 @@ static void lumamagick_exclusive(VJFrame *frame, VJFrame *frame2, int op_a, int int a, b, c; const double opacity_a = op_a * 0.01; const double opacity_b = op_b * 0.01; - const unsigned int len = frame->len; + const int len = frame->len; uint8_t *Y = frame->data[0]; uint8_t *Y2 = frame2->data[0]; @@ -507,7 +504,7 @@ static void lumamagick_basecolor(VJFrame *frame, VJFrame *frame2, int op_a, int int a, b, c, d; const double opacity_a = op_a * 0.01; const double opacity_b = op_b * 0.01; - const unsigned int len = frame->len; + const int len = frame->len; uint8_t *Y = frame->data[0]; uint8_t *Y2 = frame2->data[0]; @@ -527,7 +524,7 @@ static void lumamagick_freeze(VJFrame *frame, VJFrame *frame2 , int op_a, int op int a, b, c; const double opacity_a = op_a * 0.01; const double opacity_b = op_b * 0.01; - const unsigned int len = frame->len; + const int len = frame->len; uint8_t *Y = frame->data[0]; uint8_t *Y2 = frame2->data[0]; @@ -551,7 +548,7 @@ static void lumamagick_unfreeze(VJFrame *frame, VJFrame *frame2, int op_a, int o int a, b, c; const double opacity_a = op_a * 0.01; const double opacity_b = op_b * 0.01; - const unsigned int len = frame->len; + const int len = frame->len; uint8_t *Y = frame->data[0]; uint8_t *Y2 = frame2->data[0]; @@ -572,7 +569,7 @@ static void lumamagick_unfreeze(VJFrame *frame, VJFrame *frame2, int op_a, int o static void lumamagick_hardlight(VJFrame *frame, VJFrame *frame2, int op_a, int op_b) { unsigned int i; - const unsigned int len = frame->len; + const int len = frame->len; uint8_t *Y = frame->data[0]; uint8_t *Y2 = frame2->data[0]; @@ -596,7 +593,7 @@ static void lumamagick_hardlight(VJFrame *frame, VJFrame *frame2, int op_a, int static void lumamagick_relativeaddlum(VJFrame *frame, VJFrame *frame2, int op_a, int op_b) { unsigned int i; - const unsigned int len = frame->len; + const int len = frame->len; uint8_t *Y = frame->data[0]; uint8_t *Y2 = frame2->data[0]; int a, b, c, d; @@ -619,7 +616,7 @@ static void lumamagick_relativesublum(VJFrame *frame, VJFrame *frame2, int op_a, int a, b; const double opacity_a = op_a * 0.01; const double opacity_b = op_b * 0.01; - const unsigned int len = frame->len; + const int len = frame->len; uint8_t *Y = frame->data[0]; uint8_t *Y2 = frame2->data[0]; @@ -637,8 +634,8 @@ static void lumamagick_relativeadd(VJFrame *frame, VJFrame *frame2, int op_a, in int a, b, c, d; const double opacity_a = op_a * 0.01; const double opacity_b = op_b * 0.01; - const unsigned int len = frame->len; - const unsigned int uv_len = (frame->ssm ? frame->len : frame->uv_len); + const int len = frame->len; + const int uv_len = (frame->ssm ? len : frame->uv_len); uint8_t *Y = frame->data[0]; uint8_t *Cb= frame->data[1]; @@ -677,8 +674,8 @@ static void lumamagick_relativesub(VJFrame *frame, VJFrame *frame2, int op_a, in int a, b; const double opacity_a = op_a * 0.01; const double opacity_b = op_b * 0.01; - const unsigned int len = frame->len; - const unsigned int uv_len = (frame->ssm ? frame->len : frame->uv_len); + const int len = frame->len; + const int uv_len = (frame->ssm ? len : frame->uv_len); uint8_t *Y = frame->data[0]; uint8_t *Cb= frame->data[1]; uint8_t *Cr= frame->data[2]; @@ -709,7 +706,7 @@ static void lumamagick_minsubselect(VJFrame *frame, VJFrame *frame2, int op_a, i int a, b; const double opacity_a = op_a * 0.01; const double opacity_b = op_b * 0.01; - const unsigned int len = frame->len; + const int len = frame->len; uint8_t *Y = frame->data[0]; uint8_t *Y2 = frame2->data[0]; @@ -730,7 +727,7 @@ static void lumamagick_maxsubselect(VJFrame *frame, VJFrame *frame2, int op_a, i int a, b; const double opacity_a = op_a * 0.01; const double opacity_b = op_b * 0.01; - const unsigned int len = frame->len; + const int len = frame->len; uint8_t *Y = frame->data[0]; uint8_t *Y2 = frame2->data[0]; @@ -751,7 +748,7 @@ static void lumamagick_addsubselect(VJFrame *frame, VJFrame *frame2, int op_a, i int c, a, b; const double opacity_a = op_a * 0.01; const double opacity_b = op_b * 0.01; - const unsigned int len = frame->len; + const int len = frame->len; uint8_t *Y = frame->data[0]; uint8_t *Y2 = frame2->data[0]; @@ -774,7 +771,7 @@ static void lumamagick_maxselect(VJFrame *frame, VJFrame *frame2, int op_a, int int a, b; const double opacity_a = op_a * 0.01; const double opacity_b = op_b * 0.01; - const unsigned int len = frame->len; + const int len = frame->len; uint8_t *Y = frame->data[0]; uint8_t *Y2 = frame2->data[0]; @@ -793,7 +790,7 @@ static void lumamagick_minselect(VJFrame *frame, VJFrame *frame2, int op_a, int int a, b; const double opacity_a = op_a * 0.01; const double opacity_b = op_b * 0.01; - const unsigned int len = frame->len; + const int len = frame->len; uint8_t *Y = frame->data[0]; uint8_t *Y2 = frame2->data[0]; @@ -812,7 +809,7 @@ static void lumamagick_addtest(VJFrame *frame, VJFrame *frame2, int op_a, int op int c, a, b; const double opacity_a = op_a * 0.01; const double opacity_b = op_b * 0.01; - const unsigned int len = frame->len; + const int len = frame->len; uint8_t *Y = frame->data[0]; uint8_t *Y2 = frame2->data[0]; @@ -831,8 +828,8 @@ static void lumamagick_addtest2(VJFrame *frame, VJFrame *frame2, int op_a, int o int c, a, b; const double opacity_a = op_a * 0.01; const double opacity_b = op_b * 0.01; - const unsigned int len = frame->len; - const unsigned int uv_len = (frame->ssm ? frame->len : frame->uv_len); + const int len = frame->len; + const int uv_len = (frame->ssm ? len : frame->uv_len); uint8_t *Y = frame->data[0]; uint8_t *Cb= frame->data[1]; uint8_t *Cr= frame->data[2]; @@ -867,7 +864,7 @@ static void lumamagick_addtest4(VJFrame *frame, VJFrame *frame2, int op_a, int o int c, a, b; double opacity_a = op_a * 0.01; double opacity_b = op_b * 0.01; - const unsigned int len = frame->len; + const int len = frame->len; uint8_t *Y = frame->data[0]; uint8_t *Y2 = frame2->data[0]; @@ -891,8 +888,8 @@ void lumamagick_selectmin(VJFrame *frame, VJFrame *frame2, int op_a, int op_b) int a, b; const double opacity_a = op_a * 0.01; const double opacity_b = op_b * 0.01; - const unsigned int len = frame->len; - const unsigned int uv_len = frame->uv_len; + const int len = frame->len; + const int uv_len = frame->uv_len; uint8_t *Y = frame->data[0]; uint8_t *Cb= frame->data[1]; uint8_t *Cr= frame->data[2]; @@ -929,8 +926,8 @@ static void lumamagick_addtest3(VJFrame *frame, VJFrame *frame2, int op_a, int o int c, a, b; const double opacity_a = op_a * 0.01; const double opacity_b = op_b * 0.01; - const unsigned int len = frame->len; - const unsigned int uv_len = (frame->ssm ? frame->len : frame->uv_len); + const int len = frame->len; + const int uv_len = (frame->ssm ? len : frame->uv_len); uint8_t *Y = frame->data[0]; uint8_t *Cb= frame->data[1]; uint8_t *Cr= frame->data[2]; @@ -984,7 +981,7 @@ static void lumamagick_addlum(VJFrame *frame, VJFrame *frame2, int op_a, int op_ int c, a, b; const double opacity_a = op_a * 0.01; const double opacity_b = op_b * 0.01; - const unsigned int len = frame->len; + const int len = frame->len; uint8_t *Y = frame->data[0]; uint8_t *Y2 = frame2->data[0]; diff --git a/veejay-current/veejay-server/libvje/effects/lumamagick.h b/veejay-current/veejay-server/libvje/effects/lumamagick.h index 1dd14c4a..c69aad76 100644 --- a/veejay-current/veejay-server/libvje/effects/lumamagick.h +++ b/veejay-current/veejay-server/libvje/effects/lumamagick.h @@ -20,11 +20,6 @@ #ifndef LUMAMAGIC_H #define LUMAMAGIC_H -#include -#include -#include - vj_effect *lumamagick_init(); void lumamagic_apply(VJFrame *frame, VJFrame *frame2, int n, int op_a, int op_b); - #endif diff --git a/veejay-current/veejay-server/libvje/effects/lumamask.c b/veejay-current/veejay-server/libvje/effects/lumamask.c index c3ebf037..22e05083 100644 --- a/veejay-current/veejay-server/libvje/effects/lumamask.c +++ b/veejay-current/veejay-server/libvje/effects/lumamask.c @@ -28,11 +28,9 @@ */ -#include -#include -#include -#include + #include "common.h" +#include #include "lumamask.h" static uint8_t *buf[4] = { NULL,NULL,NULL,NULL }; @@ -97,7 +95,7 @@ void lumamask_apply( VJFrame *frame, VJFrame *frame2, int v_scale, int h_scale, int motion = 0; const unsigned int width = frame->width; const unsigned int height = frame->height; - const unsigned int len = frame->len; + const int len = frame->len; if( motionmap_active() ) { diff --git a/veejay-current/veejay-server/libvje/effects/magicalphaoverlays.c b/veejay-current/veejay-server/libvje/effects/magicalphaoverlays.c index aa0dddd2..5232d3f7 100644 --- a/veejay-current/veejay-server/libvje/effects/magicalphaoverlays.c +++ b/veejay-current/veejay-server/libvje/effects/magicalphaoverlays.c @@ -17,15 +17,12 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 , USA. */ -#include -#include -#include -#include + +#include "common.h" #include #include #include #include "magicalphaoverlays.h" -#include "common.h" vj_effect *overlayalphamagic_init(int w, int h) { @@ -64,11 +61,11 @@ vj_effect *overlayalphamagic_init(int w, int h) return ve; } -static void overlayalphamagic_adddistorted(VJFrame *frame, VJFrame *frame2,int width, int height) +static void overlayalphamagic_adddistorted(VJFrame *frame, VJFrame *frame2) { unsigned int i; - unsigned int len = width * height; - + const int len = frame->len; + uint8_t *A = frame->data[3]; uint8_t *A2 = frame2->data[3]; @@ -82,12 +79,11 @@ static void overlayalphamagic_adddistorted(VJFrame *frame, VJFrame *frame2,int w } -static void overlayalphamagic_add_distorted(VJFrame *frame, VJFrame *frame2,int width, int height) +static void overlayalphamagic_add_distorted(VJFrame *frame, VJFrame *frame2) { - unsigned int i; uint8_t y1, y2; - unsigned int len = width * height; + const int len = frame->len; uint8_t *A = frame->data[3]; uint8_t *A2 = frame2->data[3]; @@ -99,10 +95,10 @@ static void overlayalphamagic_add_distorted(VJFrame *frame, VJFrame *frame2,int } -static void overlayalphamagic_subdistorted(VJFrame *frame, VJFrame *frame2,int width, int height) +static void overlayalphamagic_subdistorted(VJFrame *frame, VJFrame *frame2) { unsigned int i; - unsigned int len = width * height; + const int len = frame->len; uint8_t *A = frame->data[3]; uint8_t *A2 = frame2->data[3]; @@ -115,11 +111,11 @@ static void overlayalphamagic_subdistorted(VJFrame *frame, VJFrame *frame2,int w } } -/*static void overlayalphamagic_sub_distorted(VJFrame *frame, VJFrame *frame2,int width, int height) +/*static void overlayalphamagic_sub_distorted(VJFrame *frame, VJFrame *frame2) { unsigned int i ; - unsigned int len = width * height; + const int len = frame->len; uint8_t *A = frame->data[3]; uint8_t *A2 = frame2->data[3]; @@ -131,20 +127,20 @@ static void overlayalphamagic_subdistorted(VJFrame *frame, VJFrame *frame2,int w } }*/ -static void overlayalphamagic_multiply(VJFrame *frame, VJFrame *frame2,int width, int height) +static void overlayalphamagic_multiply(VJFrame *frame, VJFrame *frame2) { unsigned int i; - unsigned int len = width * height; + const int len = frame->len; uint8_t *A = frame->data[3]; uint8_t *A2 = frame2->data[3]; for (i = 0; i < len; i++) A[i] = (A[i] * A2[i]) >> 8; } -static void overlayalphamagic_simpledivide(VJFrame *frame, VJFrame *frame2, int width,int height) +static void overlayalphamagic_simpledivide(VJFrame *frame, VJFrame *frame2) { unsigned int i; - unsigned int len = width * height; + const int len = frame->len; uint8_t *A = frame->data[3]; uint8_t *A2 = frame2->data[3]; for (i = 0; i < len; i++) { @@ -153,11 +149,11 @@ static void overlayalphamagic_simpledivide(VJFrame *frame, VJFrame *frame2, int } } -static void overlayalphamagic_divide(VJFrame *frame, VJFrame *frame2, int width,int height) +static void overlayalphamagic_divide(VJFrame *frame, VJFrame *frame2) { unsigned int i; int a, b, c; - unsigned int len = width * height; + const int len = frame->len; uint8_t *A = frame->data[3]; uint8_t *A2 = frame2->data[3]; for (i = 0; i < len; i++) { @@ -170,10 +166,9 @@ static void overlayalphamagic_divide(VJFrame *frame, VJFrame *frame2, int width, } } -static void overlayalphamagic_additive(VJFrame *frame, VJFrame *frame2,int width, int height) +static void overlayalphamagic_additive(VJFrame *frame, VJFrame *frame2) { - - unsigned int len = width * height; + int len = frame->len; uint8_t *A = frame->data[3]; uint8_t *A2 = frame2->data[3]; @@ -184,11 +179,11 @@ static void overlayalphamagic_additive(VJFrame *frame, VJFrame *frame2,int width } } -static void overlayalphamagic_substractive(VJFrame *frame, VJFrame *frame2,int width, int height) +static void overlayalphamagic_substractive(VJFrame *frame, VJFrame *frame2) { unsigned int i; - unsigned int len = width * height; + const int len = frame->len; uint8_t *A = frame->data[3]; uint8_t *A2 = frame2->data[3]; @@ -196,10 +191,10 @@ static void overlayalphamagic_substractive(VJFrame *frame, VJFrame *frame2,int w A[i] = CLAMP_Y( A[i] - A2[i] ); } -static void overlayalphamagic_softburn(VJFrame *frame, VJFrame *frame2,int width, int height) +static void overlayalphamagic_softburn(VJFrame *frame, VJFrame *frame2) { unsigned int i; - unsigned int len = width * height; + const int len = frame->len; uint8_t *A = frame->data[3]; uint8_t *A2 = frame2->data[3]; @@ -223,10 +218,10 @@ static void overlayalphamagic_softburn(VJFrame *frame, VJFrame *frame2,int width } } -static void overlayalphamagic_inverseburn(VJFrame *frame, VJFrame *frame2,int width, int height) +static void overlayalphamagic_inverseburn(VJFrame *frame, VJFrame *frame2) { unsigned int i; - unsigned int len = width * height; + const int len = frame->len; uint8_t *A = frame->data[3]; uint8_t *A2 = frame2->data[3]; @@ -242,10 +237,10 @@ static void overlayalphamagic_inverseburn(VJFrame *frame, VJFrame *frame2,int wi } } -static void overlayalphamagic_colordodge(VJFrame *frame, VJFrame *frame2,int width, int height) +static void overlayalphamagic_colordodge(VJFrame *frame, VJFrame *frame2) { unsigned int i; - unsigned int len = width * height; + const int len = frame->len; uint8_t *A = frame->data[3]; uint8_t *A2 = frame2->data[3]; @@ -264,10 +259,10 @@ static void overlayalphamagic_colordodge(VJFrame *frame, VJFrame *frame2,int wid } } -static void overlayalphamagic_mulsub(VJFrame *frame, VJFrame *frame2, int width, int height) +static void overlayalphamagic_mulsub(VJFrame *frame, VJFrame *frame2) { unsigned int i; - unsigned int len = width * height; + const int len = frame->len; uint8_t *A = frame->data[3]; uint8_t *A2 = frame2->data[3]; @@ -280,10 +275,10 @@ static void overlayalphamagic_mulsub(VJFrame *frame, VJFrame *frame2, int width, } } -static void overlayalphamagic_lighten(VJFrame *frame, VJFrame *frame2, int width,int height) +static void overlayalphamagic_lighten(VJFrame *frame, VJFrame *frame2) { unsigned int i; - unsigned int len = width * height; + const int len = frame->len; uint8_t *A = frame->data[3]; uint8_t *A2 = frame2->data[3]; @@ -299,10 +294,10 @@ static void overlayalphamagic_lighten(VJFrame *frame, VJFrame *frame2, int width } } -static void overlayalphamagic_difference(VJFrame *frame, VJFrame *frame2,int width, int height) +static void overlayalphamagic_difference(VJFrame *frame, VJFrame *frame2) { unsigned int i; - unsigned int len = width * height; + const int len = frame->len; uint8_t *A = frame->data[3]; uint8_t *A2 = frame2->data[3]; @@ -314,10 +309,10 @@ static void overlayalphamagic_difference(VJFrame *frame, VJFrame *frame2,int wid } } -static void overlayalphamagic_diffnegate(VJFrame *frame, VJFrame *frame2,int width, int height) +static void overlayalphamagic_diffnegate(VJFrame *frame, VJFrame *frame2) { unsigned int i; - unsigned int len = width * height; + const int len = frame->len; int a, b; uint8_t *A = frame->data[3]; uint8_t *A2 = frame2->data[3]; @@ -329,10 +324,10 @@ static void overlayalphamagic_diffnegate(VJFrame *frame, VJFrame *frame2,int wid } } -static void overlayalphamagic_exclusive(VJFrame *frame, VJFrame *frame2,int width, int height) +static void overlayalphamagic_exclusive(VJFrame *frame, VJFrame *frame2) { unsigned int i; - unsigned int len = width * height; + const int len = frame->len; uint8_t *A = frame->data[3]; uint8_t *A2 = frame2->data[3]; @@ -343,11 +338,11 @@ static void overlayalphamagic_exclusive(VJFrame *frame, VJFrame *frame2,int widt } } -static void overlayalphamagic_basecolor(VJFrame *frame, VJFrame *frame2,int width, int height) +static void overlayalphamagic_basecolor(VJFrame *frame, VJFrame *frame2) { unsigned int i; int a, b, c, d; - unsigned int len = width * height; + const int len = frame->len; uint8_t *A = frame->data[3]; uint8_t *A2 = frame2->data[3]; @@ -360,10 +355,10 @@ static void overlayalphamagic_basecolor(VJFrame *frame, VJFrame *frame2,int widt } } -static void overlayalphamagic_freeze(VJFrame *frame, VJFrame *frame2, int width,int height) +static void overlayalphamagic_freeze(VJFrame *frame, VJFrame *frame2) { unsigned int i; - unsigned int len = width * height; + const int len = frame->len; uint8_t *A = frame->data[3]; uint8_t *A2 = frame2->data[3]; @@ -376,10 +371,10 @@ static void overlayalphamagic_freeze(VJFrame *frame, VJFrame *frame2, int width, } } -static void overlayalphamagic_unfreeze(VJFrame *frame, VJFrame *frame2,int width, int height) +static void overlayalphamagic_unfreeze(VJFrame *frame, VJFrame *frame2) { unsigned int i; - unsigned int len = width * height; + const int len = frame->len; uint8_t *A = frame->data[3]; uint8_t *A2 = frame2->data[3]; @@ -392,10 +387,10 @@ static void overlayalphamagic_unfreeze(VJFrame *frame, VJFrame *frame2,int width } } -/*static void overlayalphamagic_hardlight(VJFrame *frame, VJFrame *frame2,int width, int height) +/*static void overlayalphamagic_hardlight(VJFrame *frame, VJFrame *frame2) { unsigned int i; - unsigned int len = width * height; + const int len = frame->len; uint8_t *A = frame->data[3]; uint8_t *A2 = frame2->data[3]; @@ -412,11 +407,11 @@ static void overlayalphamagic_unfreeze(VJFrame *frame, VJFrame *frame2,int width } }*/ -static void overlayalphamagic_relativeaddlum(VJFrame *frame, VJFrame *frame2,int width, int height) +static void overlayalphamagic_relativeaddlum(VJFrame *frame, VJFrame *frame2) { unsigned int i; int a, b, c, d; - unsigned int len = width * height; + const int len = frame->len; uint8_t *A = frame->data[3]; uint8_t *A2 = frame2->data[3]; @@ -429,10 +424,10 @@ static void overlayalphamagic_relativeaddlum(VJFrame *frame, VJFrame *frame2,int } } -static void overlayalphamagic_relativesublum(VJFrame *frame, VJFrame *frame2, int width, int height) +static void overlayalphamagic_relativesublum(VJFrame *frame, VJFrame *frame2) { unsigned int i; - unsigned int len = width * height; + const int len = frame->len; uint8_t *A = frame->data[3]; uint8_t *A2 = frame2->data[3]; @@ -444,10 +439,10 @@ static void overlayalphamagic_relativesublum(VJFrame *frame, VJFrame *frame2, in } } -static void overlayalphamagic_relativeadd(VJFrame *frame, VJFrame *frame2,int width, int height) +static void overlayalphamagic_relativeadd(VJFrame *frame, VJFrame *frame2) { unsigned int i; - unsigned int len = width * height; + const int len = frame->len; uint8_t *A = frame->data[3]; uint8_t *A2 = frame2->data[3]; @@ -461,10 +456,10 @@ static void overlayalphamagic_relativeadd(VJFrame *frame, VJFrame *frame2,int wi } } -static void overlayalphamagic_relativesub(VJFrame *frame, VJFrame *frame2,int width, int height) +static void overlayalphamagic_relativesub(VJFrame *frame, VJFrame *frame2) { unsigned int i; - unsigned int len = width * height; + const int len = frame->len; uint8_t *A = frame->data[3]; uint8_t *A2 = frame2->data[3]; @@ -477,10 +472,10 @@ static void overlayalphamagic_relativesub(VJFrame *frame, VJFrame *frame2,int wi } -static void overlayalphamagic_minsubselect(VJFrame *frame, VJFrame *frame2,int width, int height) +static void overlayalphamagic_minsubselect(VJFrame *frame, VJFrame *frame2) { unsigned int i; - unsigned int len = width * height; + const int len = frame->len; uint8_t *A = frame->data[3]; uint8_t *A2 = frame2->data[3]; @@ -495,10 +490,10 @@ static void overlayalphamagic_minsubselect(VJFrame *frame, VJFrame *frame2,int w } } -static void overlayalphamagic_maxsubselect(VJFrame *frame, VJFrame *frame2,int width, int height) +static void overlayalphamagic_maxsubselect(VJFrame *frame, VJFrame *frame2) { unsigned int i; - unsigned int len = width * height; + const int len = frame->len; uint8_t *A = frame->data[3]; uint8_t *A2 = frame2->data[3]; @@ -513,10 +508,10 @@ static void overlayalphamagic_maxsubselect(VJFrame *frame, VJFrame *frame2,int w } } -static void overlayalphamagic_addsubselect(VJFrame *frame, VJFrame *frame2,int width, int height) +static void overlayalphamagic_addsubselect(VJFrame *frame, VJFrame *frame2) { unsigned int i; - unsigned int len = width * height; + const int len = frame->len; uint8_t *A = frame->data[3]; uint8_t *A2 = frame2->data[3]; int c, a, b; @@ -532,10 +527,10 @@ static void overlayalphamagic_addsubselect(VJFrame *frame, VJFrame *frame2,int w } } -static void overlayalphamagic_maxselect(VJFrame *frame, VJFrame *frame2,int width, int height) +static void overlayalphamagic_maxselect(VJFrame *frame, VJFrame *frame2) { unsigned int i; - unsigned int len = width * height; + const int len = frame->len; uint8_t *A = frame->data[3]; uint8_t *A2 = frame2->data[3]; @@ -548,10 +543,10 @@ static void overlayalphamagic_maxselect(VJFrame *frame, VJFrame *frame2,int widt } } -static void overlayalphamagic_minselect(VJFrame *frame, VJFrame *frame2,int width, int height) +static void overlayalphamagic_minselect(VJFrame *frame, VJFrame *frame2) { unsigned int i; - unsigned int len = width * height; + const int len = frame->len; uint8_t *A = frame->data[3]; uint8_t *A2 = frame2->data[3]; @@ -564,10 +559,10 @@ static void overlayalphamagic_minselect(VJFrame *frame, VJFrame *frame2,int widt } } -static void overlayalphamagic_addtest(VJFrame *frame, VJFrame *frame2, int width,int height) +static void overlayalphamagic_addtest(VJFrame *frame, VJFrame *frame2) { unsigned int i; - unsigned int len = width * height; + const int len = frame->len; uint8_t *A = frame->data[3]; uint8_t *A2 = frame2->data[3]; @@ -580,10 +575,10 @@ static void overlayalphamagic_addtest(VJFrame *frame, VJFrame *frame2, int width } } -static void overlayalphamagic_addtest2(VJFrame *frame, VJFrame *frame2,int width, int height) +static void overlayalphamagic_addtest2(VJFrame *frame, VJFrame *frame2) { unsigned int i; - unsigned int len = width * height; + const int len = frame->len; uint8_t *A = frame->data[3]; uint8_t *A2 = frame2->data[3]; @@ -596,10 +591,10 @@ static void overlayalphamagic_addtest2(VJFrame *frame, VJFrame *frame2,int width } } -static void overlayalphamagic_addtest4(VJFrame *frame, VJFrame *frame2,int width, int height) +static void overlayalphamagic_addtest4(VJFrame *frame, VJFrame *frame2) { unsigned int i; - unsigned int len = width * height; + const int len = frame->len; uint8_t *A = frame->data[3]; uint8_t *A2 = frame2->data[3]; int a, b; @@ -614,10 +609,10 @@ static void overlayalphamagic_addtest4(VJFrame *frame, VJFrame *frame2,int width } } -static void overlayalphamagic_try - (VJFrame *frame, VJFrame *frame2, int width, int height) { +static void overlayalphamagic_try (VJFrame *frame, VJFrame *frame2, int width, int height) +{ unsigned int i; - unsigned int len = width * height; + const int len = frame->len; int a, b, p, q; uint8_t *A = frame->data[3]; uint8_t *A2 = frame2->data[3]; @@ -654,104 +649,104 @@ static void overlayalphamagic_try } } -void overlayalphamagic_apply(VJFrame *frame, VJFrame *frame2, int width,int height, int n, int visible) +void overlayalphamagic_apply(VJFrame *frame, VJFrame *frame2, int n, int visible) { switch (n) { case VJ_EFFECT_BLEND_ADDITIVE: - overlayalphamagic_additive(frame, frame2, width, height); + overlayalphamagic_additive(frame, frame2); break; case VJ_EFFECT_BLEND_SUBSTRACTIVE: - overlayalphamagic_substractive(frame, frame2, width, height); + overlayalphamagic_substractive(frame, frame2); break; case VJ_EFFECT_BLEND_MULTIPLY: - overlayalphamagic_multiply(frame, frame2, width, height); + overlayalphamagic_multiply(frame, frame2); break; case VJ_EFFECT_BLEND_DIVIDE: - overlayalphamagic_simpledivide(frame, frame2, width, height); + overlayalphamagic_simpledivide(frame, frame2); break; case VJ_EFFECT_BLEND_LIGHTEN: - overlayalphamagic_lighten(frame, frame2, width, height); + overlayalphamagic_lighten(frame, frame2); break; case VJ_EFFECT_BLEND_DIFFERENCE: - overlayalphamagic_difference(frame, frame2, width, height); + overlayalphamagic_difference(frame, frame2); break; case VJ_EFFECT_BLEND_DIFFNEGATE: - overlayalphamagic_diffnegate(frame, frame2, width, height); + overlayalphamagic_diffnegate(frame, frame2); break; case VJ_EFFECT_BLEND_EXCLUSIVE: - overlayalphamagic_exclusive(frame, frame2, width, height); + overlayalphamagic_exclusive(frame, frame2); break; case VJ_EFFECT_BLEND_BASECOLOR: - overlayalphamagic_basecolor(frame, frame2, width, height); + overlayalphamagic_basecolor(frame, frame2); break; case VJ_EFFECT_BLEND_FREEZE: - overlayalphamagic_freeze(frame, frame2, width, height); + overlayalphamagic_freeze(frame, frame2); break; case VJ_EFFECT_BLEND_UNFREEZE: - overlayalphamagic_unfreeze(frame, frame2, width, height); + overlayalphamagic_unfreeze(frame, frame2); break; case VJ_EFFECT_BLEND_RELADD: - overlayalphamagic_relativeadd(frame, frame2, width, height); + overlayalphamagic_relativeadd(frame, frame2); break; case VJ_EFFECT_BLEND_RELSUB: - overlayalphamagic_relativesub(frame, frame2, width, height); + overlayalphamagic_relativesub(frame, frame2); break; case VJ_EFFECT_BLEND_RELADDLUM: - overlayalphamagic_relativeaddlum(frame, frame2, width, height); + overlayalphamagic_relativeaddlum(frame, frame2); break; case VJ_EFFECT_BLEND_RELSUBLUM: - overlayalphamagic_relativesublum(frame, frame2, width, height); + overlayalphamagic_relativesublum(frame, frame2); break; case VJ_EFFECT_BLEND_MAXSEL: - overlayalphamagic_maxselect(frame, frame2, width, height); + overlayalphamagic_maxselect(frame, frame2); break; case VJ_EFFECT_BLEND_MINSEL: - overlayalphamagic_minselect(frame, frame2, width, height); + overlayalphamagic_minselect(frame, frame2); break; case VJ_EFFECT_BLEND_MINSUBSEL: - overlayalphamagic_minsubselect(frame, frame2, width, height); + overlayalphamagic_minsubselect(frame, frame2); break; case VJ_EFFECT_BLEND_MAXSUBSEL: - overlayalphamagic_maxsubselect(frame, frame2, width, height); + overlayalphamagic_maxsubselect(frame, frame2); break; case VJ_EFFECT_BLEND_ADDSUBSEL: - overlayalphamagic_addsubselect(frame, frame2, width, height); + overlayalphamagic_addsubselect(frame, frame2); break; case VJ_EFFECT_BLEND_ADDAVG: - overlayalphamagic_add_distorted(frame, frame2, width, height); + overlayalphamagic_add_distorted(frame, frame2); break; case VJ_EFFECT_BLEND_ADDTEST2: - overlayalphamagic_addtest(frame, frame2, width, height); + overlayalphamagic_addtest(frame, frame2); break; case VJ_EFFECT_BLEND_ADDTEST3: - overlayalphamagic_addtest2(frame, frame2, width, height); + overlayalphamagic_addtest2(frame, frame2); break; case VJ_EFFECT_BLEND_ADDTEST4: - overlayalphamagic_addtest4(frame, frame2, width, height); + overlayalphamagic_addtest4(frame, frame2); break; case VJ_EFFECT_BLEND_MULSUB: - overlayalphamagic_mulsub(frame, frame2, width, height); + overlayalphamagic_mulsub(frame, frame2); break; case VJ_EFFECT_BLEND_SOFTBURN: - overlayalphamagic_softburn(frame, frame2, width, height); + overlayalphamagic_softburn(frame, frame2); break; case VJ_EFFECT_BLEND_INVERSEBURN: - overlayalphamagic_inverseburn(frame, frame2, width, height); + overlayalphamagic_inverseburn(frame, frame2); break; case VJ_EFFECT_BLEND_COLORDODGE: - overlayalphamagic_colordodge(frame, frame2, width, height); + overlayalphamagic_colordodge(frame, frame2); break; case VJ_EFFECT_BLEND_ADDDISTORT: - overlayalphamagic_adddistorted(frame, frame2, width, height); + overlayalphamagic_adddistorted(frame, frame2); break; case VJ_EFFECT_BLEND_SUBDISTORT: - overlayalphamagic_subdistorted(frame, frame2, width, height); + overlayalphamagic_subdistorted(frame, frame2); break; case VJ_EFFECT_BLEND_ADDTEST5: - overlayalphamagic_try(frame, frame2, width, height); + overlayalphamagic_try(frame, frame2, frame->width, frame->height); break; case VJ_EFFECT_BLEND_NEGDIV: - overlayalphamagic_divide(frame,frame2,width,height); + overlayalphamagic_divide(frame,frame2); break; } diff --git a/veejay-current/veejay-server/libvje/effects/magicalphaoverlays.h b/veejay-current/veejay-server/libvje/effects/magicalphaoverlays.h index 07badcf3..daa52240 100644 --- a/veejay-current/veejay-server/libvje/effects/magicalphaoverlays.h +++ b/veejay-current/veejay-server/libvje/effects/magicalphaoverlays.h @@ -21,5 +21,5 @@ #ifndef MAGICALPHAOVERLAYS_H #define MAGICALPHAOVERLAYS_H vj_effect *overlayalphamagic_init(int w, int h); -void overlayalphamagic_apply( VJFrame *frame, VJFrame *frame2, int width,int height, int n, int mode); +void overlayalphamagic_apply( VJFrame *frame, VJFrame *frame2, int n, int mode); #endif diff --git a/veejay-current/veejay-server/libvje/effects/magicmirror.c b/veejay-current/veejay-server/libvje/effects/magicmirror.c index 3c733e5b..c063508c 100644 --- a/veejay-current/veejay-server/libvje/effects/magicmirror.c +++ b/veejay-current/veejay-server/libvje/effects/magicmirror.c @@ -17,11 +17,9 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 , USA. */ -#include -#include -#include -#include + #include "common.h" +#include #include "motionmap.h" #include "magicmirror.h" @@ -127,7 +125,7 @@ void magicmirror_apply( VJFrame *frame, int vx, int vy, int d, int n, int alpha { const unsigned int width = frame->width; const unsigned int height = frame->height; - const unsigned int len = frame->len; + const int len = frame->len; double c1 = (double)vx; double c2 = (double)vy; int motion = 0; diff --git a/veejay-current/veejay-server/libvje/effects/magicoverlays.c b/veejay-current/veejay-server/libvje/effects/magicoverlays.c index 8a9be50c..64b31e0b 100644 --- a/veejay-current/veejay-server/libvje/effects/magicoverlays.c +++ b/veejay-current/veejay-server/libvje/effects/magicoverlays.c @@ -17,14 +17,11 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 , USA. */ -#include -#include -#include + +#include "common.h" #include -#include "magicoverlays.h" #include -#include "common.h" -#include +#include "magicoverlays.h" vj_effect *overlaymagic_init(int w, int h) { @@ -67,8 +64,8 @@ vj_effect *overlaymagic_init(int w, int h) /* FIXME rename methods in lumamagick and chromamagick */ void overlaymagic_adddistorted(VJFrame *frame, VJFrame *frame2 ) { - unsigned int i; - unsigned int len = frame->width * frame->height; + int i; + const int len = frame->len; uint8_t *Y = frame->data[0]; uint8_t *Y2 = frame2->data[0]; @@ -85,9 +82,9 @@ void overlaymagic_adddistorted(VJFrame *frame, VJFrame *frame2 ) void overlaymagic_add_distorted(VJFrame *frame, VJFrame *frame2 ) { - unsigned int i; + int i; uint8_t y1, y2; - unsigned int len = frame->width * frame->height; + const int len = frame->len; uint8_t *Y = frame->data[0]; uint8_t *Y2 = frame2->data[0]; @@ -101,8 +98,8 @@ void overlaymagic_add_distorted(VJFrame *frame, VJFrame *frame2 ) void overlaymagic_subdistorted(VJFrame *frame, VJFrame *frame2 ) { - unsigned int i; - unsigned int len = frame->width * frame->height; + int i; + const int len = frame->len; uint8_t *Y = frame->data[0]; uint8_t *Y2 = frame2->data[0]; @@ -119,7 +116,7 @@ void overlaymagic_subdistorted(VJFrame *frame, VJFrame *frame2 ) void overlaymagic_sub_distorted(VJFrame *frame, VJFrame *frame2 ) { unsigned int i ; - unsigned int len = frame->width * frame->height; + const int len = frame->len; uint8_t *Y = frame->data[0]; uint8_t *Y2 = frame2->data[0]; @@ -134,8 +131,8 @@ void overlaymagic_sub_distorted(VJFrame *frame, VJFrame *frame2 ) void overlaymagic_multiply(VJFrame *frame, VJFrame *frame2 ) { - unsigned int i; - unsigned int len = frame->width * frame->height; + int i; + const int len = frame->len; uint8_t *Y = frame->data[0]; uint8_t *Y2 = frame2->data[0]; @@ -145,8 +142,8 @@ void overlaymagic_multiply(VJFrame *frame, VJFrame *frame2 ) void overlaymagic_simpledivide(VJFrame *frame, VJFrame *frame2 ) { - unsigned int i; - unsigned int len = frame->width * frame->height; + int i; + const int len = frame->len; uint8_t *Y = frame->data[0]; uint8_t *Y2 = frame2->data[0]; @@ -159,9 +156,9 @@ void overlaymagic_simpledivide(VJFrame *frame, VJFrame *frame2 ) void overlaymagic_divide(VJFrame *frame, VJFrame *frame2 ) { - unsigned int i; + int i; int a, b, c; - unsigned int len = frame->width * frame->height; + const int len = frame->len; uint8_t *Y = frame->data[0]; uint8_t *Y2 = frame2->data[0]; @@ -178,7 +175,7 @@ void overlaymagic_divide(VJFrame *frame, VJFrame *frame2 ) void overlaymagic_additive(VJFrame *frame, VJFrame *frame2 ) { - unsigned int len = frame->width * frame->height; + int len = frame->len; uint8_t *Y = frame->data[0]; uint8_t *Y2 = frame2->data[0]; @@ -193,8 +190,8 @@ void overlaymagic_additive(VJFrame *frame, VJFrame *frame2 ) void overlaymagic_substractive(VJFrame *frame, VJFrame *frame2 ) { - unsigned int i; - unsigned int len = frame->width * frame->height; + int i; + const int len = frame->len; uint8_t *Y = frame->data[0]; uint8_t *Y2 = frame2->data[0]; @@ -204,8 +201,8 @@ void overlaymagic_substractive(VJFrame *frame, VJFrame *frame2 ) void overlaymagic_softburn(VJFrame *frame, VJFrame *frame2 ) { - unsigned int i; - unsigned int len = frame->width * frame->height; + int i; + const int len = frame->len; uint8_t *Y = frame->data[0]; uint8_t *Y2 = frame2->data[0]; @@ -235,8 +232,8 @@ void overlaymagic_softburn(VJFrame *frame, VJFrame *frame2 ) void overlaymagic_inverseburn(VJFrame *frame, VJFrame *frame2 ) { - unsigned int i; - unsigned int len = frame->width * frame->height; + int i; + const int len = frame->len; uint8_t *Y = frame->data[0]; uint8_t *Y2 = frame2->data[0]; int a, b, c; @@ -255,8 +252,8 @@ void overlaymagic_inverseburn(VJFrame *frame, VJFrame *frame2 ) void overlaymagic_colordodge(VJFrame *frame, VJFrame *frame2 ) { - unsigned int i; - unsigned int len = frame->width * frame->height; + int i; + const int len = frame->len; uint8_t *Y = frame->data[0]; uint8_t *Y2 = frame2->data[0]; @@ -279,8 +276,8 @@ void overlaymagic_colordodge(VJFrame *frame, VJFrame *frame2 ) void overlaymagic_mulsub(VJFrame *frame, VJFrame *frame2 ) { - unsigned int i; - unsigned int len = frame->width * frame->height; + int i; + const int len = frame->len; uint8_t *Y = frame->data[0]; uint8_t *Y2 = frame2->data[0]; int a, b; @@ -296,8 +293,8 @@ void overlaymagic_mulsub(VJFrame *frame, VJFrame *frame2 ) void overlaymagic_lighten(VJFrame *frame, VJFrame *frame2 ) { - unsigned int i; - unsigned int len = frame->width * frame->height; + int i; + const int len = frame->len; uint8_t *Y = frame->data[0]; uint8_t *Y2 = frame2->data[0]; int a, b, c; @@ -316,8 +313,8 @@ void overlaymagic_lighten(VJFrame *frame, VJFrame *frame2 ) void overlaymagic_difference(VJFrame *frame, VJFrame *frame2 ) { - unsigned int i; - unsigned int len = frame->width * frame->height; + int i; + const int len = frame->len; uint8_t *Y = frame->data[0]; uint8_t *Y2 = frame2->data[0]; @@ -332,8 +329,8 @@ void overlaymagic_difference(VJFrame *frame, VJFrame *frame2 ) void overlaymagic_diffnegate(VJFrame *frame, VJFrame *frame2 ) { - unsigned int i; - unsigned int len = frame->width * frame->height; + int i; + const int len = frame->len; int a, b; uint8_t *Y = frame->data[0]; uint8_t *Y2 = frame2->data[0]; @@ -348,8 +345,8 @@ void overlaymagic_diffnegate(VJFrame *frame, VJFrame *frame2 ) void overlaymagic_exclusive(VJFrame *frame, VJFrame *frame2 ) { - unsigned int i; - unsigned int len = frame->width * frame->height; + int i; + const int len = frame->len; uint8_t *Y = frame->data[0]; uint8_t *Y2 = frame2->data[0]; @@ -363,9 +360,9 @@ void overlaymagic_exclusive(VJFrame *frame, VJFrame *frame2 ) void overlaymagic_basecolor(VJFrame *frame, VJFrame *frame2 ) { - unsigned int i; + int i; int a, b, c, d; - unsigned int len = frame->width * frame->height; + const int len = frame->len; uint8_t *Y = frame->data[0]; uint8_t *Y2 = frame2->data[0]; @@ -381,8 +378,8 @@ void overlaymagic_basecolor(VJFrame *frame, VJFrame *frame2 ) void overlaymagic_freeze(VJFrame *frame, VJFrame *frame2 ) { - unsigned int i; - unsigned int len = frame->width * frame->height; + int i; + const int len = frame->len; uint8_t *Y = frame->data[0]; uint8_t *Y2 = frame2->data[0]; @@ -398,8 +395,8 @@ void overlaymagic_freeze(VJFrame *frame, VJFrame *frame2 ) void overlaymagic_unfreeze(VJFrame *frame, VJFrame *frame2 ) { - unsigned int i; - unsigned int len = frame->width * frame->height; + int i; + const int len = frame->len; uint8_t *Y = frame->data[0]; uint8_t *Y2 = frame2->data[0]; @@ -415,8 +412,8 @@ void overlaymagic_unfreeze(VJFrame *frame, VJFrame *frame2 ) void overlaymagic_hardlight(VJFrame *frame, VJFrame *frame2 ) { - unsigned int i; - unsigned int len = frame->width * frame->height; + int i; + const int len = frame->len; uint8_t *Y = frame->data[0]; uint8_t *Y2 = frame2->data[0]; @@ -436,9 +433,9 @@ void overlaymagic_hardlight(VJFrame *frame, VJFrame *frame2 ) void overlaymagic_relativeaddlum(VJFrame *frame, VJFrame *frame2 ) { - unsigned int i; + int i; int a, b, c, d; - unsigned int len = frame->width * frame->height; + const int len = frame->len; uint8_t *Y = frame->data[0]; uint8_t *Y2 = frame2->data[0]; @@ -454,8 +451,8 @@ void overlaymagic_relativeaddlum(VJFrame *frame, VJFrame *frame2 ) void overlaymagic_relativesublum(VJFrame *frame, VJFrame *frame2 ) { - unsigned int i; - unsigned int len = frame->width * frame->height; + int i; + const int len = frame->len; uint8_t *Y = frame->data[0]; uint8_t *Y2 = frame2->data[0]; @@ -470,8 +467,8 @@ void overlaymagic_relativesublum(VJFrame *frame, VJFrame *frame2 ) void overlaymagic_relativeadd(VJFrame *frame, VJFrame *frame2 ) { - unsigned int i; - unsigned int len = frame->width * frame->height; + int i; + const int len = frame->len; uint8_t *Y = frame->data[0]; uint8_t *Y2 = frame2->data[0]; @@ -488,8 +485,8 @@ void overlaymagic_relativeadd(VJFrame *frame, VJFrame *frame2 ) void overlaymagic_relativesub(VJFrame *frame, VJFrame *frame2 ) { - unsigned int i; - unsigned int len = frame->width * frame->height; + int i; + const int len = frame->len; uint8_t *Y = frame->data[0]; uint8_t *Y2 = frame2->data[0]; @@ -504,8 +501,8 @@ void overlaymagic_relativesub(VJFrame *frame, VJFrame *frame2 ) void overlaymagic_minsubselect(VJFrame *frame, VJFrame *frame2 ) { - unsigned int i; - unsigned int len = frame->width * frame->height; + int i; + const int len = frame->len; uint8_t *Y = frame->data[0]; uint8_t *Y2 = frame2->data[0]; @@ -523,8 +520,8 @@ void overlaymagic_minsubselect(VJFrame *frame, VJFrame *frame2 ) void overlaymagic_maxsubselect(VJFrame *frame, VJFrame *frame2 ) { - unsigned int i; - unsigned int len = frame->width * frame->height; + int i; + const int len = frame->len; uint8_t *Y = frame->data[0]; uint8_t *Y2 = frame2->data[0]; @@ -542,8 +539,8 @@ void overlaymagic_maxsubselect(VJFrame *frame, VJFrame *frame2 ) void overlaymagic_addsubselect(VJFrame *frame, VJFrame *frame2 ) { - unsigned int i; - unsigned int len = frame->width * frame->height; + int i; + const int len = frame->len; uint8_t *Y = frame->data[0]; uint8_t *Y2 = frame2->data[0]; int c, a, b; @@ -562,8 +559,8 @@ void overlaymagic_addsubselect(VJFrame *frame, VJFrame *frame2 ) void overlaymagic_maxselect(VJFrame *frame, VJFrame *frame2 ) { - unsigned int i; - unsigned int len = frame->width * frame->height; + int i; + const int len = frame->len; uint8_t *Y = frame->data[0]; uint8_t *Y2 = frame2->data[0]; @@ -579,8 +576,8 @@ void overlaymagic_maxselect(VJFrame *frame, VJFrame *frame2 ) void overlaymagic_minselect(VJFrame *frame, VJFrame *frame2 ) { - unsigned int i; - unsigned int len = frame->width * frame->height; + int i; + const int len = frame->len; uint8_t *Y = frame->data[0]; uint8_t *Y2 = frame2->data[0]; @@ -596,8 +593,8 @@ void overlaymagic_minselect(VJFrame *frame, VJFrame *frame2 ) void overlaymagic_addtest(VJFrame *frame, VJFrame *frame2 ) { - unsigned int i; - unsigned int len = frame->width * frame->height; + int i; + const int len = frame->len; uint8_t *Y = frame->data[0]; uint8_t *Y2 = frame2->data[0]; @@ -613,8 +610,8 @@ void overlaymagic_addtest(VJFrame *frame, VJFrame *frame2 ) void overlaymagic_addtest2(VJFrame *frame, VJFrame *frame2 ) { - unsigned int i; - unsigned int len = frame->width * frame->height; + int i; + const int len = frame->len; uint8_t *Y = frame->data[0]; uint8_t *Y2 = frame2->data[0]; @@ -630,8 +627,8 @@ void overlaymagic_addtest2(VJFrame *frame, VJFrame *frame2 ) void overlaymagic_addtest4(VJFrame *frame, VJFrame *frame2 ) { - unsigned int i; - unsigned int len = frame->width * frame->height; + int i; + const int len = frame->len; uint8_t *Y = frame->data[0]; uint8_t *Y2 = frame2->data[0]; int a, b; @@ -650,8 +647,8 @@ void overlaymagic_addtest4(VJFrame *frame, VJFrame *frame2 ) void overlaymagic_try (VJFrame *frame, VJFrame *frame2) { - unsigned int i; - unsigned int len = frame->width * frame->height; + int i; + const int len = frame->len; int a, b, p, q; uint8_t *Y = frame->data[0]; uint8_t *Y2 = frame2->data[0]; diff --git a/veejay-current/veejay-server/libvje/effects/magicoverlays.h b/veejay-current/veejay-server/libvje/effects/magicoverlays.h index 974edea4..d99009fd 100644 --- a/veejay-current/veejay-server/libvje/effects/magicoverlays.h +++ b/veejay-current/veejay-server/libvje/effects/magicoverlays.h @@ -20,10 +20,6 @@ #ifndef MAGICOVERLAYS_H #define MAGICOVERLAYS_H -#include -#include -#include - vj_effect *overlaymagic_init(int w, int h); void overlaymagic_apply(VJFrame *frame, VJFrame *frame2, int n, int mode); void overlaymagic_adddistorted(VJFrame *frame, VJFrame *frame2 ); diff --git a/veejay-current/veejay-server/libvje/effects/magicoverlaysalpha.c b/veejay-current/veejay-server/libvje/effects/magicoverlaysalpha.c index f5b3768f..ca69b8a2 100644 --- a/veejay-current/veejay-server/libvje/effects/magicoverlaysalpha.c +++ b/veejay-current/veejay-server/libvje/effects/magicoverlaysalpha.c @@ -17,14 +17,13 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 , USA. */ -#include -#include -#include + +#include "common.h" #include -#include "magicoverlaysalpha.h" #include -#include "common.h" #include +#include "magicoverlaysalpha.h" + vj_effect *overlaymagicalpha_init(int w, int h) { vj_effect *ve = (vj_effect *) vj_calloc(sizeof(vj_effect)); @@ -61,11 +60,10 @@ vj_effect *overlaymagicalpha_init(int w, int h) return ve; } -static void overlaymagicalpha_adddistorted(VJFrame *frame, VJFrame *frame2, - int width, int height) +static void overlaymagicalpha_adddistorted(VJFrame *frame, VJFrame *frame2) { unsigned int i; - unsigned int len = width * height; + const int len = frame->len; uint8_t *Y = frame->data[0]; uint8_t *Y2 = frame2->data[0]; @@ -84,13 +82,12 @@ static void overlaymagicalpha_adddistorted(VJFrame *frame, VJFrame *frame2, } -static void overlaymagicalpha_add_distorted(VJFrame *frame, VJFrame *frame2, - int width, int height) +static void overlaymagicalpha_add_distorted(VJFrame *frame, VJFrame *frame2) { unsigned int i; uint8_t y1, y2; - unsigned int len = width * height; + const int len = frame->len; uint8_t *Y = frame->data[0]; uint8_t *Y2 = frame2->data[0]; uint8_t *aA = frame->data[3]; @@ -106,11 +103,10 @@ static void overlaymagicalpha_add_distorted(VJFrame *frame, VJFrame *frame2, } -static void overlaymagicalpha_subdistorted(VJFrame *frame, VJFrame *frame2, - int width, int height) +static void overlaymagicalpha_subdistorted(VJFrame *frame, VJFrame *frame2) { unsigned int i; - unsigned int len = width * height; + const int len = frame->len; uint8_t *Y = frame->data[0]; uint8_t *Y2 = frame2->data[0]; uint8_t *aA = frame->data[3]; @@ -127,12 +123,11 @@ static void overlaymagicalpha_subdistorted(VJFrame *frame, VJFrame *frame2, } /* - static void overlaymagicalpha_sub_distorted(VJFrame *frame, VJFrame *frame2, - int width, int height) + static void overlaymagicalpha_sub_distorted(VJFrame *frame, VJFrame *frame2) { unsigned int i ; - unsigned int len = width * height; + const int len = frame->len; uint8_t *Y = frame->data[0]; uint8_t *Y2 = frame2->data[0]; uint8_t *aA = frame->data[3]; @@ -149,11 +144,10 @@ static void overlaymagicalpha_subdistorted(VJFrame *frame, VJFrame *frame2, } */ -static void overlaymagicalpha_multiply(VJFrame *frame, VJFrame *frame2, - int width, int height) +static void overlaymagicalpha_multiply(VJFrame *frame, VJFrame *frame2) { unsigned int i; - unsigned int len = width * height; + const int len = frame->len; uint8_t *Y = frame->data[0]; uint8_t *Y2 = frame2->data[0]; uint8_t *aA = frame->data[3]; @@ -166,10 +160,10 @@ static void overlaymagicalpha_multiply(VJFrame *frame, VJFrame *frame2, } } -static void overlaymagicalpha_simpledivide(VJFrame *frame, VJFrame *frame2, int width,int height) +static void overlaymagicalpha_simpledivide(VJFrame *frame, VJFrame *frame2) { unsigned int i; - unsigned int len = width * height; + const int len = frame->len; uint8_t *Y = frame->data[0]; uint8_t *Y2 = frame2->data[0]; uint8_t *aA = frame->data[3]; @@ -184,12 +178,11 @@ static void overlaymagicalpha_simpledivide(VJFrame *frame, VJFrame *frame2, int } } -static void overlaymagicalpha_divide(VJFrame *frame, VJFrame *frame2, int width, - int height) +static void overlaymagicalpha_divide(VJFrame *frame, VJFrame *frame2) { unsigned int i; int a, b, c; - unsigned int len = width * height; + const int len = frame->len; uint8_t *Y = frame->data[0]; uint8_t *Y2 = frame2->data[0]; uint8_t *aA = frame->data[3]; @@ -208,10 +201,10 @@ static void overlaymagicalpha_divide(VJFrame *frame, VJFrame *frame2, int width, } } -static void overlaymagicalpha_additive(VJFrame *frame, VJFrame *frame2,int width, int height) +static void overlaymagicalpha_additive(VJFrame *frame, VJFrame *frame2) { - unsigned int len = width * height; + int len = frame->len; uint8_t *Y = frame->data[0]; uint8_t *Y2 = frame2->data[0]; uint8_t *aA = frame->data[3]; @@ -227,10 +220,10 @@ static void overlaymagicalpha_additive(VJFrame *frame, VJFrame *frame2,int width } } -static void overlaymagicalpha_substractive(VJFrame *frame, VJFrame *frame2,int width, int height) +static void overlaymagicalpha_substractive(VJFrame *frame, VJFrame *frame2) { unsigned int i; - unsigned int len = width * height; + const int len = frame->len; uint8_t *Y = frame->data[0]; uint8_t *Y2 = frame2->data[0]; uint8_t *aA = frame->data[3]; @@ -244,10 +237,10 @@ static void overlaymagicalpha_substractive(VJFrame *frame, VJFrame *frame2,int w } } -static void overlaymagicalpha_softburn(VJFrame *frame, VJFrame *frame2,int width, int height) +static void overlaymagicalpha_softburn(VJFrame *frame, VJFrame *frame2) { unsigned int i; - unsigned int len = width * height; + const int len = frame->len; uint8_t *Y = frame->data[0]; uint8_t *Y2 = frame2->data[0]; uint8_t *aA = frame->data[3]; @@ -276,10 +269,10 @@ static void overlaymagicalpha_softburn(VJFrame *frame, VJFrame *frame2,int width } } -static void overlaymagicalpha_inverseburn(VJFrame *frame, VJFrame *frame2,int width, int height) +static void overlaymagicalpha_inverseburn(VJFrame *frame, VJFrame *frame2) { unsigned int i; - unsigned int len = width * height; + const int len = frame->len; uint8_t *Y = frame->data[0]; uint8_t *Y2 = frame2->data[0]; uint8_t *aA = frame->data[3]; @@ -300,10 +293,10 @@ static void overlaymagicalpha_inverseburn(VJFrame *frame, VJFrame *frame2,int wi } } -static void overlaymagicalpha_colordodge(VJFrame *frame, VJFrame *frame2,int width, int height) +static void overlaymagicalpha_colordodge(VJFrame *frame, VJFrame *frame2) { unsigned int i; - unsigned int len = width * height; + const int len = frame->len; uint8_t *Y = frame->data[0]; uint8_t *Y2 = frame2->data[0]; uint8_t *aA = frame->data[3]; @@ -327,10 +320,10 @@ static void overlaymagicalpha_colordodge(VJFrame *frame, VJFrame *frame2,int wid } } -static void overlaymagicalpha_mulsub(VJFrame *frame, VJFrame *frame2, int width,int height) +static void overlaymagicalpha_mulsub(VJFrame *frame, VJFrame *frame2) { unsigned int i; - unsigned int len = width * height; + const int len = frame->len; uint8_t *Y = frame->data[0]; uint8_t *Y2 = frame2->data[0]; uint8_t *aA = frame->data[3]; @@ -347,10 +340,10 @@ static void overlaymagicalpha_mulsub(VJFrame *frame, VJFrame *frame2, int width, } } -static void overlaymagicalpha_lighten(VJFrame *frame, VJFrame *frame2, int width,int height) +static void overlaymagicalpha_lighten(VJFrame *frame, VJFrame *frame2) { unsigned int i; - unsigned int len = width * height; + const int len = frame->len; uint8_t *Y = frame->data[0]; uint8_t *Y2 = frame2->data[0]; uint8_t *aA = frame->data[3]; @@ -371,10 +364,10 @@ static void overlaymagicalpha_lighten(VJFrame *frame, VJFrame *frame2, int width } } -static void overlaymagicalpha_difference(VJFrame *frame, VJFrame *frame2,int width, int height) +static void overlaymagicalpha_difference(VJFrame *frame, VJFrame *frame2) { unsigned int i; - unsigned int len = width * height; + const int len = frame->len; uint8_t *Y = frame->data[0]; uint8_t *Y2 = frame2->data[0]; uint8_t *aA = frame->data[3]; @@ -391,10 +384,10 @@ static void overlaymagicalpha_difference(VJFrame *frame, VJFrame *frame2,int wid } } -static void overlaymagicalpha_diffnegate(VJFrame *frame, VJFrame *frame2,int width, int height) +static void overlaymagicalpha_diffnegate(VJFrame *frame, VJFrame *frame2) { unsigned int i; - unsigned int len = width * height; + const int len = frame->len; int a, b; uint8_t *Y = frame->data[0]; uint8_t *Y2 = frame2->data[0]; @@ -411,10 +404,10 @@ static void overlaymagicalpha_diffnegate(VJFrame *frame, VJFrame *frame2,int wid } } -static void overlaymagicalpha_exclusive(VJFrame *frame, VJFrame *frame2,int width, int height) +static void overlaymagicalpha_exclusive(VJFrame *frame, VJFrame *frame2) { unsigned int i; - unsigned int len = width * height; + const int len = frame->len; uint8_t *Y = frame->data[0]; uint8_t *Y2 = frame2->data[0]; uint8_t *aA = frame->data[3]; @@ -430,11 +423,11 @@ static void overlaymagicalpha_exclusive(VJFrame *frame, VJFrame *frame2,int widt } } -static void overlaymagicalpha_basecolor(VJFrame *frame, VJFrame *frame2,int width, int height) +static void overlaymagicalpha_basecolor(VJFrame *frame, VJFrame *frame2) { unsigned int i; int a, b, c, d; - unsigned int len = width * height; + const int len = frame->len; uint8_t *Y = frame->data[0]; uint8_t *Y2 = frame2->data[0]; uint8_t *aA = frame->data[3]; @@ -451,10 +444,10 @@ static void overlaymagicalpha_basecolor(VJFrame *frame, VJFrame *frame2,int widt } } -static void overlaymagicalpha_freeze(VJFrame *frame, VJFrame *frame2, int width,int height) +static void overlaymagicalpha_freeze(VJFrame *frame, VJFrame *frame2) { unsigned int i; - unsigned int len = width * height; + const int len = frame->len; uint8_t *Y = frame->data[0]; uint8_t *Y2 = frame2->data[0]; uint8_t *aA = frame->data[3]; @@ -472,10 +465,10 @@ static void overlaymagicalpha_freeze(VJFrame *frame, VJFrame *frame2, int width, } } -static void overlaymagicalpha_unfreeze(VJFrame *frame, VJFrame *frame2,int width, int height) +static void overlaymagicalpha_unfreeze(VJFrame *frame, VJFrame *frame2) { unsigned int i; - unsigned int len = width * height; + const int len = frame->len; uint8_t *Y = frame->data[0]; uint8_t *Y2 = frame2->data[0]; uint8_t *aA = frame->data[3]; @@ -494,10 +487,10 @@ static void overlaymagicalpha_unfreeze(VJFrame *frame, VJFrame *frame2,int width } /* -static void overlaymagicalpha_hardlight(VJFrame *frame, VJFrame *frame2,int width, int height) +static void overlaymagicalpha_hardlight(VJFrame *frame, VJFrame *frame2) { unsigned int i; - unsigned int len = width * height; + const int len = frame->len; uint8_t *Y = frame->data[0]; uint8_t *Y2 = frame2->data[0]; uint8_t *aA = frame->data[3]; @@ -520,11 +513,11 @@ static void overlaymagicalpha_hardlight(VJFrame *frame, VJFrame *frame2,int widt } */ -static void overlaymagicalpha_relativeaddlum(VJFrame *frame, VJFrame *frame2, int width, int height) +static void overlaymagicalpha_relativeaddlum(VJFrame *frame, VJFrame *frame2) { unsigned int i; int a, b, c, d; - unsigned int len = width * height; + const int len = frame->len; uint8_t *Y = frame->data[0]; uint8_t *Y2 = frame2->data[0]; uint8_t *aA = frame->data[3]; @@ -542,10 +535,10 @@ static void overlaymagicalpha_relativeaddlum(VJFrame *frame, VJFrame *frame2, in } } -static void overlaymagicalpha_relativesublum(VJFrame *frame, VJFrame *frame2, int width, int height) +static void overlaymagicalpha_relativesublum(VJFrame *frame, VJFrame *frame2) { unsigned int i; - unsigned int len = width * height; + const int len = frame->len; uint8_t *Y = frame->data[0]; uint8_t *Y2 = frame2->data[0]; uint8_t *aA = frame->data[3]; @@ -562,10 +555,10 @@ static void overlaymagicalpha_relativesublum(VJFrame *frame, VJFrame *frame2, in } } -static void overlaymagicalpha_relativeadd(VJFrame *frame, VJFrame *frame2,int width, int height) +static void overlaymagicalpha_relativeadd(VJFrame *frame, VJFrame *frame2) { unsigned int i; - unsigned int len = width * height; + const int len = frame->len; uint8_t *Y = frame->data[0]; uint8_t *Y2 = frame2->data[0]; uint8_t *aA = frame->data[3]; @@ -584,10 +577,10 @@ static void overlaymagicalpha_relativeadd(VJFrame *frame, VJFrame *frame2,int wi } } -static void overlaymagicalpha_relativesub(VJFrame *frame, VJFrame *frame2,int width, int height) +static void overlaymagicalpha_relativesub(VJFrame *frame, VJFrame *frame2) { unsigned int i; - unsigned int len = width * height; + const int len = frame->len; uint8_t *Y = frame->data[0]; uint8_t *Y2 = frame2->data[0]; uint8_t *aA = frame->data[3]; @@ -605,10 +598,10 @@ static void overlaymagicalpha_relativesub(VJFrame *frame, VJFrame *frame2,int wi } -static void overlaymagicalpha_minsubselect(VJFrame *frame, VJFrame *frame2, int width, int height) +static void overlaymagicalpha_minsubselect(VJFrame *frame, VJFrame *frame2) { unsigned int i; - unsigned int len = width * height; + const int len = frame->len; uint8_t *Y = frame->data[0]; uint8_t *Y2 = frame2->data[0]; uint8_t *aA = frame->data[3]; @@ -628,10 +621,10 @@ static void overlaymagicalpha_minsubselect(VJFrame *frame, VJFrame *frame2, int } } -static void overlaymagicalpha_maxsubselect(VJFrame *frame, VJFrame *frame2,int width, int height) +static void overlaymagicalpha_maxsubselect(VJFrame *frame, VJFrame *frame2) { unsigned int i; - unsigned int len = width * height; + const int len = frame->len; uint8_t *Y = frame->data[0]; uint8_t *Y2 = frame2->data[0]; uint8_t *aA = frame->data[3]; @@ -651,10 +644,10 @@ static void overlaymagicalpha_maxsubselect(VJFrame *frame, VJFrame *frame2,int w } } -static void overlaymagicalpha_addsubselect(VJFrame *frame, VJFrame *frame2,int width, int height) +static void overlaymagicalpha_addsubselect(VJFrame *frame, VJFrame *frame2) { unsigned int i; - unsigned int len = width * height; + const int len = frame->len; uint8_t *Y = frame->data[0]; uint8_t *Y2 = frame2->data[0]; uint8_t *aA = frame->data[3]; @@ -675,10 +668,10 @@ static void overlaymagicalpha_addsubselect(VJFrame *frame, VJFrame *frame2,int w } } -static void overlaymagicalpha_maxselect(VJFrame *frame, VJFrame *frame2,int width, int height) +static void overlaymagicalpha_maxselect(VJFrame *frame, VJFrame *frame2) { unsigned int i; - unsigned int len = width * height; + const int len = frame->len; uint8_t *Y = frame->data[0]; uint8_t *Y2 = frame2->data[0]; uint8_t *aA = frame->data[3]; @@ -696,10 +689,10 @@ static void overlaymagicalpha_maxselect(VJFrame *frame, VJFrame *frame2,int widt } } -static void overlaymagicalpha_minselect(VJFrame *frame, VJFrame *frame2,int width, int height) +static void overlaymagicalpha_minselect(VJFrame *frame, VJFrame *frame2) { unsigned int i; - unsigned int len = width * height; + const int len = frame->len; uint8_t *Y = frame->data[0]; uint8_t *Y2 = frame2->data[0]; uint8_t *aA = frame->data[3]; @@ -717,10 +710,10 @@ static void overlaymagicalpha_minselect(VJFrame *frame, VJFrame *frame2,int widt } } -static void overlaymagicalpha_addtest(VJFrame *frame, VJFrame *frame2, int width,int height) +static void overlaymagicalpha_addtest(VJFrame *frame, VJFrame *frame2) { unsigned int i; - unsigned int len = width * height; + const int len = frame->len; uint8_t *Y = frame->data[0]; uint8_t *Y2 = frame2->data[0]; uint8_t *aA = frame->data[3]; @@ -738,10 +731,10 @@ static void overlaymagicalpha_addtest(VJFrame *frame, VJFrame *frame2, int width } } -static void overlaymagicalpha_addtest2(VJFrame *frame, VJFrame *frame2,int width, int height) +static void overlaymagicalpha_addtest2(VJFrame *frame, VJFrame *frame2) { unsigned int i; - unsigned int len = width * height; + const int len = frame->len; uint8_t *Y = frame->data[0]; uint8_t *Y2 = frame2->data[0]; uint8_t *aA = frame->data[3]; @@ -759,10 +752,10 @@ static void overlaymagicalpha_addtest2(VJFrame *frame, VJFrame *frame2,int width } } -static void overlaymagicalpha_addtest4(VJFrame *frame, VJFrame *frame2,int width, int height) +static void overlaymagicalpha_addtest4(VJFrame *frame, VJFrame *frame2) { unsigned int i; - unsigned int len = width * height; + const int len = frame->len; uint8_t *Y = frame->data[0]; uint8_t *Y2 = frame2->data[0]; uint8_t *aA = frame->data[3]; @@ -784,10 +777,10 @@ static void overlaymagicalpha_addtest4(VJFrame *frame, VJFrame *frame2,int width } -static void overlaymagicalpha_try(VJFrame *frame, VJFrame *frame2, int width, int height) +static void overlaymagicalpha_try(VJFrame *frame, VJFrame *frame2) { unsigned int i; - unsigned int len = width * height; + const int len = frame->len; int a, b, p, q; uint8_t *Y = frame->data[0]; uint8_t *Y2 = frame2->data[0]; @@ -829,105 +822,104 @@ static void overlaymagicalpha_try(VJFrame *frame, VJFrame *frame2, int width, in } } -void overlaymagicalpha_apply(VJFrame *frame, VJFrame *frame2, int width, - int height, int n, int clearchroma) +void overlaymagicalpha_apply(VJFrame *frame, VJFrame *frame2, int n, int clearchroma) { switch (n) { case VJ_EFFECT_BLEND_ADDITIVE: - overlaymagicalpha_additive(frame, frame2, width, height); + overlaymagicalpha_additive(frame, frame2); break; case VJ_EFFECT_BLEND_SUBSTRACTIVE: - overlaymagicalpha_substractive(frame, frame2, width, height); + overlaymagicalpha_substractive(frame, frame2); break; case VJ_EFFECT_BLEND_MULTIPLY: - overlaymagicalpha_multiply(frame, frame2, width, height); + overlaymagicalpha_multiply(frame, frame2); break; case VJ_EFFECT_BLEND_DIVIDE: - overlaymagicalpha_simpledivide(frame, frame2, width, height); + overlaymagicalpha_simpledivide(frame, frame2); break; case VJ_EFFECT_BLEND_LIGHTEN: - overlaymagicalpha_lighten(frame, frame2, width, height); + overlaymagicalpha_lighten(frame, frame2); break; case VJ_EFFECT_BLEND_DIFFERENCE: - overlaymagicalpha_difference(frame, frame2, width, height); + overlaymagicalpha_difference(frame, frame2); break; case VJ_EFFECT_BLEND_DIFFNEGATE: - overlaymagicalpha_diffnegate(frame, frame2, width, height); + overlaymagicalpha_diffnegate(frame, frame2); break; case VJ_EFFECT_BLEND_EXCLUSIVE: - overlaymagicalpha_exclusive(frame, frame2, width, height); + overlaymagicalpha_exclusive(frame, frame2); break; case VJ_EFFECT_BLEND_BASECOLOR: - overlaymagicalpha_basecolor(frame, frame2, width, height); + overlaymagicalpha_basecolor(frame, frame2); break; case VJ_EFFECT_BLEND_FREEZE: - overlaymagicalpha_freeze(frame, frame2, width, height); + overlaymagicalpha_freeze(frame, frame2); break; case VJ_EFFECT_BLEND_UNFREEZE: - overlaymagicalpha_unfreeze(frame, frame2, width, height); + overlaymagicalpha_unfreeze(frame, frame2); break; case VJ_EFFECT_BLEND_RELADD: - overlaymagicalpha_relativeadd(frame, frame2, width, height); + overlaymagicalpha_relativeadd(frame, frame2); break; case VJ_EFFECT_BLEND_RELSUB: - overlaymagicalpha_relativesub(frame, frame2, width, height); + overlaymagicalpha_relativesub(frame, frame2); break; case VJ_EFFECT_BLEND_RELADDLUM: - overlaymagicalpha_relativeaddlum(frame, frame2, width, height); + overlaymagicalpha_relativeaddlum(frame, frame2); break; case VJ_EFFECT_BLEND_RELSUBLUM: - overlaymagicalpha_relativesublum(frame, frame2, width, height); + overlaymagicalpha_relativesublum(frame, frame2); break; case VJ_EFFECT_BLEND_MAXSEL: - overlaymagicalpha_maxselect(frame, frame2, width, height); + overlaymagicalpha_maxselect(frame, frame2); break; case VJ_EFFECT_BLEND_MINSEL: - overlaymagicalpha_minselect(frame, frame2, width, height); + overlaymagicalpha_minselect(frame, frame2); break; case VJ_EFFECT_BLEND_MINSUBSEL: - overlaymagicalpha_minsubselect(frame, frame2, width, height); + overlaymagicalpha_minsubselect(frame, frame2); break; case VJ_EFFECT_BLEND_MAXSUBSEL: - overlaymagicalpha_maxsubselect(frame, frame2, width, height); + overlaymagicalpha_maxsubselect(frame, frame2); break; case VJ_EFFECT_BLEND_ADDSUBSEL: - overlaymagicalpha_addsubselect(frame, frame2, width, height); + overlaymagicalpha_addsubselect(frame, frame2); break; case VJ_EFFECT_BLEND_ADDAVG: - overlaymagicalpha_add_distorted(frame, frame2, width, height); + overlaymagicalpha_add_distorted(frame, frame2); break; case VJ_EFFECT_BLEND_ADDTEST2: - overlaymagicalpha_addtest(frame, frame2, width, height); + overlaymagicalpha_addtest(frame, frame2); break; case VJ_EFFECT_BLEND_ADDTEST3: - overlaymagicalpha_addtest2(frame, frame2, width, height); + overlaymagicalpha_addtest2(frame, frame2); break; case VJ_EFFECT_BLEND_ADDTEST4: - overlaymagicalpha_addtest4(frame, frame2, width, height); + overlaymagicalpha_addtest4(frame, frame2); break; case VJ_EFFECT_BLEND_MULSUB: - overlaymagicalpha_mulsub(frame, frame2, width, height); + overlaymagicalpha_mulsub(frame, frame2); break; case VJ_EFFECT_BLEND_SOFTBURN: - overlaymagicalpha_softburn(frame, frame2, width, height); + overlaymagicalpha_softburn(frame, frame2); break; case VJ_EFFECT_BLEND_INVERSEBURN: - overlaymagicalpha_inverseburn(frame, frame2, width, height); + overlaymagicalpha_inverseburn(frame, frame2); break; case VJ_EFFECT_BLEND_COLORDODGE: - overlaymagicalpha_colordodge(frame, frame2, width, height); + overlaymagicalpha_colordodge(frame, frame2); break; case VJ_EFFECT_BLEND_ADDDISTORT: - overlaymagicalpha_adddistorted(frame, frame2, width, height); + overlaymagicalpha_adddistorted(frame, frame2); break; case VJ_EFFECT_BLEND_SUBDISTORT: - overlaymagicalpha_subdistorted(frame, frame2, width, height); + overlaymagicalpha_subdistorted(frame, frame2); break; case VJ_EFFECT_BLEND_ADDTEST5: - overlaymagicalpha_try(frame, frame2, width, height); + overlaymagicalpha_try(frame, frame2); break; case VJ_EFFECT_BLEND_NEGDIV: - overlaymagicalpha_divide(frame,frame2,width,height); + overlaymagicalpha_divide(frame,frame2); break; } diff --git a/veejay-current/veejay-server/libvje/effects/magicoverlaysalpha.h b/veejay-current/veejay-server/libvje/effects/magicoverlaysalpha.h index 13a43cc3..d1b93a83 100644 --- a/veejay-current/veejay-server/libvje/effects/magicoverlaysalpha.h +++ b/veejay-current/veejay-server/libvje/effects/magicoverlaysalpha.h @@ -20,12 +20,6 @@ #ifndef MAGICOVERLAYSALPHA_H #define MAGICOVERLAYSALPHA_H -#include -#include -#include - vj_effect *overlaymagicalpha_init(int w, int h); - -void overlaymagicalpha_apply( VJFrame *frame, VJFrame *frame2, int width,int height, int n, int mode); - +void overlaymagicalpha_apply( VJFrame *frame, VJFrame *frame2, int n, int mode); #endif diff --git a/veejay-current/veejay-server/libvje/effects/magicscratcher.c b/veejay-current/veejay-server/libvje/effects/magicscratcher.c index d22831d6..4f02b708 100644 --- a/veejay-current/veejay-server/libvje/effects/magicscratcher.c +++ b/veejay-current/veejay-server/libvje/effects/magicscratcher.c @@ -17,13 +17,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 , USA. */ -#include -#include -#include -#include + +#include "common.h" #include #include "magicscratcher.h" -#include "common.h" static uint8_t *mframe = NULL; static int m_frame = 0; @@ -104,9 +101,10 @@ static void store_mframe(uint8_t * yuv1[3], int w, int h, int n, int no_reverse) void magicscratcher_apply(VJFrame *frame, int mode, int n, int no_reverse) { - const int width = frame->width; - const int height = frame->height; - unsigned int x, len = frame->len; + const unsigned int width = frame->width; + const unsigned int height = frame->height; + unsigned int x; + int len = frame->len; uint8_t *Y = frame->data[0]; uint8_t *Cb= frame->data[1]; uint8_t *Cr= frame->data[2]; @@ -169,8 +167,8 @@ void magicscratcher_apply(VJFrame *frame, int mode, int n, int no_reverse) Y[x] = func_y( mframe[offset + x], Y[x]); } - veejay_memset( Cb, 128, (frame->ssm ? frame->len : frame->uv_len)); - veejay_memset( Cr, 128, (frame->ssm ? frame->len : frame->uv_len)); + veejay_memset( Cb, 128, (frame->ssm ? len : frame->uv_len)); + veejay_memset( Cr, 128, (frame->ssm ? len : frame->uv_len)); m_rerun = m_frame; diff --git a/veejay-current/veejay-server/libvje/effects/mask.c b/veejay-current/veejay-server/libvje/effects/mask.c index 9146145b..752f514a 100644 --- a/veejay-current/veejay-server/libvje/effects/mask.c +++ b/veejay-current/veejay-server/libvje/effects/mask.c @@ -17,12 +17,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 , USA. */ -#include -#include -#include + +#include "common.h" #include #include "mask.h" -#include "common.h" vj_effect *simplemask_init(int w, int h ) { @@ -100,8 +98,8 @@ static void mask_replace_white_fill(uint8_t *yuv1[3], uint8_t *yuv2[3], void simplemask_apply( VJFrame *frame, VJFrame *frame2, int threshold, int invert) { - const int width = frame->width; - const int height = frame->height; + const unsigned int width = frame->width; + const unsigned int height = frame->height; const int len = frame->len; switch(invert) { case 0 : mask_replace_black(frame->data,frame2->data,width,height,len,threshold); diff --git a/veejay-current/veejay-server/libvje/effects/mask.h b/veejay-current/veejay-server/libvje/effects/mask.h index b1875240..f9db542f 100644 --- a/veejay-current/veejay-server/libvje/effects/mask.h +++ b/veejay-current/veejay-server/libvje/effects/mask.h @@ -20,10 +20,6 @@ #ifndef SIMPLEMASK_H #define SIMPLEMASK_H -#include -#include -#include - vj_effect *simplemask_init(); void simplemask_apply( VJFrame *frame, VJFrame *frame2, int threshold, int invert); void mask_free(); diff --git a/veejay-current/veejay-server/libvje/effects/maskstop.c b/veejay-current/veejay-server/libvje/effects/maskstop.c index f6945113..c35d29f0 100644 --- a/veejay-current/veejay-server/libvje/effects/maskstop.c +++ b/veejay-current/veejay-server/libvje/effects/maskstop.c @@ -20,12 +20,9 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 , USA. */ -#include -#include -#include -#include -#include + #include "common.h" +#include #include "maskstop.h" static uint8_t *vvmaskstop_buffer[6]; @@ -90,9 +87,10 @@ void maskstop_free() { } -void maskstop_apply( VJFrame *frame, int width, int height, int negmask, int swapmask, int framefreq, int maskfreq) { +void maskstop_apply( VJFrame *frame, int negmask, int swapmask, int framefreq, int maskfreq) +{ int i=0; - const unsigned int len = frame->len; + const int len = frame->len; uint8_t *Yframe = vvmaskstop_buffer[0]; uint8_t *Uframe = vvmaskstop_buffer[1]; diff --git a/veejay-current/veejay-server/libvje/effects/maskstop.h b/veejay-current/veejay-server/libvje/effects/maskstop.h index 0e03f62d..4d520823 100644 --- a/veejay-current/veejay-server/libvje/effects/maskstop.h +++ b/veejay-current/veejay-server/libvje/effects/maskstop.h @@ -23,6 +23,6 @@ vj_effect *maskstop_init(int width, int height); int maskstop_malloc(int w, int h); void maskstop_free(); -void maskstop_apply( VJFrame *frame, int width, int height, int negmask, int swapmask, int framefreq, int maskfreq); +void maskstop_apply( VJFrame *frame,int negmask, int swapmask, int framefreq, int maskfreq); #endif diff --git a/veejay-current/veejay-server/libvje/effects/masktransition.c b/veejay-current/veejay-server/libvje/effects/masktransition.c index 94ad5b9e..fe38cac9 100644 --- a/veejay-current/veejay-server/libvje/effects/masktransition.c +++ b/veejay-current/veejay-server/libvje/effects/masktransition.c @@ -18,13 +18,10 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 , USA. */ -#include -#include -#include -#include -#include "masktransition.h" -#include #include "common.h" +#include +#include +#include "masktransition.h" vj_effect *masktransition_init(int width, int height) { @@ -143,8 +140,7 @@ void alpha_transition_apply( VJFrame *frame, uint8_t *B[4], int time_index ) } } -void masktransition_apply( VJFrame *frame, VJFrame *frame2, int width, - int height, int time_index, int duration ) +void masktransition_apply( VJFrame *frame, VJFrame *frame2, int time_index, int duration ) { alpha_blend_transition( frame->data[0],frame->data[1],frame->data[2],frame->data[3], diff --git a/veejay-current/veejay-server/libvje/effects/masktransition.h b/veejay-current/veejay-server/libvje/effects/masktransition.h index 50838b0f..4c761ae2 100644 --- a/veejay-current/veejay-server/libvje/effects/masktransition.h +++ b/veejay-current/veejay-server/libvje/effects/masktransition.h @@ -20,11 +20,7 @@ #ifndef MASKTRANSITION_H #define MASKTRANSITION_H -#include -#include -#include - -void masktransition_apply( VJFrame *frame, VJFrame *frame2, int width,int height, int index, int duration); -void alpha_transition_apply( VJFrame *frame, uint8_t *B[4], int time_index ); +void masktransition_apply( VJFrame *frame, VJFrame *frame2, int index, int duration); +void alpha_transition_apply( VJFrame *frame, uint8_t *B[4], int time_index ); vj_effect *masktransition_init(int w, int h); #endif diff --git a/veejay-current/veejay-server/libvje/effects/meanfilter.c b/veejay-current/veejay-server/libvje/effects/meanfilter.c index e36a9a96..4fdf4311 100644 --- a/veejay-current/veejay-server/libvje/effects/meanfilter.c +++ b/veejay-current/veejay-server/libvje/effects/meanfilter.c @@ -17,11 +17,9 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 , USA. */ -#include -#include -#include -#include + #include "common.h" +#include #include "meanfilter.h" static uint8_t *mean = NULL; diff --git a/veejay-current/veejay-server/libvje/effects/meanfilter.h b/veejay-current/veejay-server/libvje/effects/meanfilter.h index a20b6f4e..019cb473 100644 --- a/veejay-current/veejay-server/libvje/effects/meanfilter.h +++ b/veejay-current/veejay-server/libvje/effects/meanfilter.h @@ -20,10 +20,6 @@ #ifndef MEANFILTER_H #define MEANFILTER_H -#include -#include -#include - vj_effect *meanfilter_init(int w, int h); void meanfilter_apply( VJFrame *frame ); int meanfilter_malloc(int w, int h); diff --git a/veejay-current/veejay-server/libvje/effects/median.c b/veejay-current/veejay-server/libvje/effects/median.c index 7fe04a05..211ba516 100644 --- a/veejay-current/veejay-server/libvje/effects/median.c +++ b/veejay-current/veejay-server/libvje/effects/median.c @@ -17,14 +17,12 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 , USA. */ -#include -#include -#include -#include -#include + +#include "common.h" #include -#include "median.h" #include +#include "median.h" + vj_effect *medianfilter_init(int w, int h) { vj_effect *ve = (vj_effect *) vj_calloc(sizeof(vj_effect)); @@ -46,6 +44,9 @@ vj_effect *medianfilter_init(int w, int h) void medianfilter_apply( VJFrame *frame, int val) { + const unsigned int width = frame->width; + const unsigned int height = frame->height; + const int len = frame->len; uint8_t *Y = frame->data[0]; uint8_t *Cb = frame->data[1]; uint8_t *Cr = frame->data[2]; @@ -53,15 +54,15 @@ void medianfilter_apply( VJFrame *frame, int val) if( val == 0 ) return; - uint8_t *buffer = (uint8_t*) vj_malloc(sizeof(uint8_t)*frame->width*frame->height*3); - veejay_memset( buffer,0, frame->width*frame->height*3); - ctmf( Y, buffer, frame->width,frame->height,frame->width,frame->width,val,1,1024*1024*8); - ctmf( Cb,buffer + (frame->width*frame->height), frame->width,frame->height/2,frame->width,frame->width,val,1,512*1024); - ctmf( Cr,buffer + (frame->width*frame->height*2), frame->width,frame->height/2,frame->width,frame->width,val,1,512*1024); + uint8_t *buffer = (uint8_t*) vj_malloc(sizeof(uint8_t)*len*3); + veejay_memset( buffer,0, len*3); + ctmf( Y, buffer, width,height,width,width,val,1,1024*1024*8); + ctmf( Cb,buffer + (len), width,height/2,width,width,val,1,512*1024); + ctmf( Cr,buffer + (len*2), width,height/2,width,width,val,1,512*1024); - veejay_memcpy( Y, buffer, frame->width*frame->height); - veejay_memcpy( Cb,buffer + (frame->width*frame->height), frame->width*frame->height); - veejay_memcpy( Cr,buffer + (frame->width*frame->height*2), frame->width*frame->height); + veejay_memcpy( Y, buffer, len); + veejay_memcpy( Cb,buffer + (len), len); + veejay_memcpy( Cr,buffer + (len*2), len); free(buffer); diff --git a/veejay-current/veejay-server/libvje/effects/mirrors.c b/veejay-current/veejay-server/libvje/effects/mirrors.c index 91a7c45c..d4df20ee 100644 --- a/veejay-current/veejay-server/libvje/effects/mirrors.c +++ b/veejay-current/veejay-server/libvje/effects/mirrors.c @@ -17,13 +17,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 , USA. */ -#include -#include -#include -#include + +#include "common.h" #include #include "mirrors.h" -#include "common.h" vj_effect *mirrors_init(int width,int height) { @@ -138,13 +135,15 @@ static int N__ = 0; void mirrors_apply(VJFrame *frame, int type, int factor ) { + const unsigned int width = frame->width; + const unsigned int height = frame->height; int interpolate = 1; int motion = 0; int tmp1 = 0; int tmp2 = factor; if( motionmap_active() ) { - int hi = (int)((float)(frame->width * 0.33)); + int hi = (int)((float)(width * 0.33)); motionmap_scale_to( hi,hi,0,0,&tmp1,&tmp2,&n__,&N__); motion = 1; @@ -158,16 +157,16 @@ void mirrors_apply(VJFrame *frame, int type, int factor ) switch (type) { case 0: - _mirrors_v(frame->data, frame->width, frame->height, tmp2, 0); + _mirrors_v(frame->data, width, height, tmp2, 0); break; case 1: - _mirrors_v(frame->data,frame->width, frame->height,tmp2,1); + _mirrors_v(frame->data,width, height,tmp2,1); break; case 2: - _mirrors_h(frame->data,frame->width, frame->height,tmp2,0); + _mirrors_h(frame->data,width, height,tmp2,0); break; case 3: - _mirrors_h(frame->data,frame->width, frame->height,tmp2,1); + _mirrors_h(frame->data,width, height,tmp2,1); break; } diff --git a/veejay-current/veejay-server/libvje/effects/mirrors2.c b/veejay-current/veejay-server/libvje/effects/mirrors2.c index 738f0a08..8f489dd3 100644 --- a/veejay-current/veejay-server/libvje/effects/mirrors2.c +++ b/veejay-current/veejay-server/libvje/effects/mirrors2.c @@ -17,9 +17,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 , USA. */ -#include -#include -#include + +#include "common.h" #include #include "mirrors2.h" diff --git a/veejay-current/veejay-server/libvje/effects/mirrors2.h b/veejay-current/veejay-server/libvje/effects/mirrors2.h index d27d2727..777c84f4 100644 --- a/veejay-current/veejay-server/libvje/effects/mirrors2.h +++ b/veejay-current/veejay-server/libvje/effects/mirrors2.h @@ -20,13 +20,7 @@ #ifndef MIRRORS2_H #define MIRRORS2_H -#include -#include -#include - vj_effect *mirrors2_init(); - void mirrors2_apply( VJFrame *frame, int type); - void mirrors2_free(); #endif diff --git a/veejay-current/veejay-server/libvje/effects/mixtoalpha.c b/veejay-current/veejay-server/libvje/effects/mixtoalpha.c index a6d8d54e..04ef256f 100644 --- a/veejay-current/veejay-server/libvje/effects/mixtoalpha.c +++ b/veejay-current/veejay-server/libvje/effects/mixtoalpha.c @@ -17,14 +17,9 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 , USA. */ - -#include -#include -#include -#include -#include -#include + #include "common.h" +#include #include "mixtoalpha.h" vj_effect *mixtoalpha_init(int w, int h) @@ -57,9 +52,9 @@ vj_effect *mixtoalpha_init(int w, int h) return ve; } -void mixtoalpha_apply( VJFrame *frame, VJFrame *frame2, int width,int height, int mode, int scale) +void mixtoalpha_apply( VJFrame *frame, VJFrame *frame2, int mode, int scale) { - int len = frame->len; + const int len = frame->len; uint8_t *a = frame->data[3]; const uint8_t *Y = frame2->data[0]; uint8_t __lookup_table[256]; @@ -74,7 +69,7 @@ void mixtoalpha_apply( VJFrame *frame, VJFrame *frame2, int width,int height, in veejay_memcpy(a, frame2->data[3], len ); } - if( scale ) { + if( scale ) { int i; for( i = 0; i < len; i ++ ) { diff --git a/veejay-current/veejay-server/libvje/effects/mixtoalpha.h b/veejay-current/veejay-server/libvje/effects/mixtoalpha.h index b2c2c195..24cf7af6 100644 --- a/veejay-current/veejay-server/libvje/effects/mixtoalpha.h +++ b/veejay-current/veejay-server/libvje/effects/mixtoalpha.h @@ -20,11 +20,6 @@ #ifndef MIX2ALPHA_H #define MIX2ALPHA_H -#include -#include -#include - vj_effect *mixtoalpha_init(int w, int h); -void mixtoalpha_apply( VJFrame *frame, VJFrame *frame2, int width,int height, int mode, int alpha); - +void mixtoalpha_apply( VJFrame *frame, VJFrame *frame2, int mode, int alpha); #endif diff --git a/veejay-current/veejay-server/libvje/effects/morphology.c b/veejay-current/veejay-server/libvje/effects/morphology.c index 19265c63..27e1d7fb 100644 --- a/veejay-current/veejay-server/libvje/effects/morphology.c +++ b/veejay-current/veejay-server/libvje/effects/morphology.c @@ -17,13 +17,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 , USA. */ -#include -#include -#include -#include +#include "common.h" #include #include "morphology.h" -#include "common.h" + typedef uint8_t (*morph_func)(uint8_t *kernel, uint8_t *mt ); static uint8_t kernels[8][9] ={ @@ -31,8 +28,8 @@ static uint8_t kernels[8][9] ={ { 0,1,0, 1,1,1, 0,1,0 },//1 { 0,0,0, 1,1,1, 0,0,0 },//2 { 0,1,0, 0,1,0, 0,1,0 },//3 - { 0,0,1, 0,1,0, 1,0,0 },//4 - { 1,0,0, 0,1,0, 0,0,1 }, + { 0,0,1, 0,1,0, 1,0,0 },//4 + { 1,0,0, 0,1,0, 0,0,1 }, { 1,1,1, 0,0,0, 0,0,0 }, { 0,0,0, 0,0,0, 1,1,1 } }; @@ -150,7 +147,7 @@ void morphology_apply( VJFrame *frame, int threshold, int convolution_kernel, in int len = frame->len; int width = frame->width; - const unsigned int uv_len = (frame->ssm ? frame->len : frame->uv_len); + const int uv_len = (frame->ssm ? len : frame->uv_len); uint8_t *I = frame->data[0]; diff --git a/veejay-current/veejay-server/libvje/effects/morphology.h b/veejay-current/veejay-server/libvje/effects/morphology.h index d0dac230..2371fc50 100644 --- a/veejay-current/veejay-server/libvje/effects/morphology.h +++ b/veejay-current/veejay-server/libvje/effects/morphology.h @@ -20,10 +20,6 @@ #ifndef MORPHOLOGY_H #define MORPHOLOGY_H -#include -#include -#include - vj_effect *morphology_init(int w, int h); void morphology_apply( VJFrame *frame, int threshold, int kernel, int mode, int channel); int morphology_malloc(int w, int h); diff --git a/veejay-current/veejay-server/libvje/effects/motionblur.c b/veejay-current/veejay-server/libvje/effects/motionblur.c index 75a6ea1a..3ba9ccdc 100644 --- a/veejay-current/veejay-server/libvje/effects/motionblur.c +++ b/veejay-current/veejay-server/libvje/effects/motionblur.c @@ -17,12 +17,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 , USA. */ -#include -#include -#include + +#include "common.h" #include #include "motionblur.h" -#include static uint8_t *previous_frame[3] = { NULL,NULL,NULL }; vj_effect *motionblur_init(int width, int height) diff --git a/veejay-current/veejay-server/libvje/effects/motionblur.h b/veejay-current/veejay-server/libvje/effects/motionblur.h index 41dc48ac..fdcfdba9 100644 --- a/veejay-current/veejay-server/libvje/effects/motionblur.h +++ b/veejay-current/veejay-server/libvje/effects/motionblur.h @@ -20,14 +20,8 @@ #ifndef MOTIONBLUR_H #define MOTIONBLUR_H -#include -#include -#include -#include - vj_effect *motionblur_init(int w, int h); int motionblur_malloc(int w, int h); void motionblur_free(); void motionblur_apply( VJFrame *frame, int n); - #endif diff --git a/veejay-current/veejay-server/libvje/effects/motionmap.c b/veejay-current/veejay-server/libvje/effects/motionmap.c index 117199eb..12251169 100644 --- a/veejay-current/veejay-server/libvje/effects/motionmap.c +++ b/veejay-current/veejay-server/libvje/effects/motionmap.c @@ -18,18 +18,14 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 , USA. */ -#include -#include -#include +#include "common.h" #include -#include #include #include -#include "motionmap.h" -#include "common.h" +#include #include "softblur.h" #include "opacity.h" -#include +#include "motionmap.h" #define HIS_DEFAULT 6 #define HIS_LEN (8*25) @@ -372,9 +368,9 @@ static int last_act_decay = -1; void motionmap_apply( VJFrame *frame, int threshold, int limit1, int draw, int history, int decay, int interpol, int last_act_level, int act_decay ) { unsigned int i; - const int width = frame->width; - const int height = frame->height; - const unsigned int len = frame->len; + const unsigned int width = frame->width; + const unsigned int height = frame->height; + const int len = frame->len; uint8_t *Cb = frame->data[1]; uint8_t *Cr = frame->data[2]; const int limit = limit1 * 10; diff --git a/veejay-current/veejay-server/libvje/effects/motionmap.h b/veejay-current/veejay-server/libvje/effects/motionmap.h index 3bc28508..edc9d93d 100644 --- a/veejay-current/veejay-server/libvje/effects/motionmap.h +++ b/veejay-current/veejay-server/libvje/effects/motionmap.h @@ -20,7 +20,6 @@ #ifndef MOTIONMAP_H #define MOTIONMAP_H - vj_effect *motionmap_init(int w, int h); void motionmap_apply( VJFrame *frame, int t, int n, int draw, int histo, int op, int ip, int la, int ad); int motionmap_malloc(int w,int h); diff --git a/veejay-current/veejay-server/libvje/effects/mtracer.c b/veejay-current/veejay-server/libvje/effects/mtracer.c index 198dbce6..5e9a4f64 100644 --- a/veejay-current/veejay-server/libvje/effects/mtracer.c +++ b/veejay-current/veejay-server/libvje/effects/mtracer.c @@ -17,15 +17,12 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 , USA. */ -#include -#include -#include + +#include "common.h" #include #include "mtracer.h" -#include "common.h" #include "magicoverlays.h" - static uint8_t *mtrace_buffer[4] = { NULL,NULL,NULL,NULL }; static int mtrace_counter = 0; @@ -80,12 +77,13 @@ int mtracer_malloc(int w, int h) void mtracer_apply( VJFrame *frame, VJFrame *frame2, int mode, int n) { + const int len = frame->len; VJFrame m; veejay_memcpy( &m, frame, sizeof(VJFrame )); if (mtrace_counter == 0) { overlaymagic_apply(frame, frame2, mode,0); - vj_frame_copy1( mtrace_buffer[0], frame->data[0], frame->len ); + vj_frame_copy1( mtrace_buffer[0], frame->data[0], len ); } else { overlaymagic_apply(frame, frame2, mode,0); m.data[0] = mtrace_buffer[0]; @@ -93,7 +91,7 @@ void mtracer_apply( VJFrame *frame, VJFrame *frame2, int mode, int n) m.data[2] = frame->data[2]; m.data[3] = frame->data[3]; overlaymagic_apply( &m, frame2, mode, 0 ); - vj_frame_copy1( mtrace_buffer[0],frame->data[0], frame->len ); + vj_frame_copy1( mtrace_buffer[0],frame->data[0], len ); } mtrace_counter++; diff --git a/veejay-current/veejay-server/libvje/effects/mtracer.h b/veejay-current/veejay-server/libvje/effects/mtracer.h index 1412324f..ebe6f686 100644 --- a/veejay-current/veejay-server/libvje/effects/mtracer.h +++ b/veejay-current/veejay-server/libvje/effects/mtracer.h @@ -20,11 +20,6 @@ #ifndef MTRACER_H #define MTRACER_H -#include -#include -#include -#include - vj_effect *mtracer_init(int w, int h); int mtracer_malloc(int w, int h); void mtracer_free(); diff --git a/veejay-current/veejay-server/libvje/effects/negatechannel.c b/veejay-current/veejay-server/libvje/effects/negatechannel.c index a318cb88..8652e362 100644 --- a/veejay-current/veejay-server/libvje/effects/negatechannel.c +++ b/veejay-current/veejay-server/libvje/effects/negatechannel.c @@ -17,13 +17,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 , USA. */ -#include -#include -#include -#include + +#include "common.h" #include #include "negatechannel.h" -#include "common.h" vj_effect *negatechannel_init(int w, int h) { @@ -56,8 +53,8 @@ vj_effect *negatechannel_init(int w, int h) void negatechannel_apply( VJFrame *frame, int chan, int val) { int i; - const int len = (frame->width * frame->height); - const int uv_len = (frame->ssm ? frame->len : frame->uv_len); + const int len = frame->len; + const int uv_len = (frame->ssm ? len : frame->uv_len); uint8_t *Y = frame->data[0]; uint8_t *Cb = frame->data[1]; diff --git a/veejay-current/veejay-server/libvje/effects/negation.c b/veejay-current/veejay-server/libvje/effects/negation.c index 964569be..b949aad9 100644 --- a/veejay-current/veejay-server/libvje/effects/negation.c +++ b/veejay-current/veejay-server/libvje/effects/negation.c @@ -17,12 +17,9 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 , USA. */ -#include -#include -#include -#include -#include + #include "common.h" +#include #include "negation.h" vj_effect *negation_init(int w, int h) @@ -49,8 +46,8 @@ vj_effect *negation_init(int w, int h) void negation_apply( VJFrame *frame, int val) { int i; - const unsigned int len = frame->len; - const unsigned int uv_len = (frame->ssm ? frame->len : frame->uv_len ); + const int len = frame->len; + const int uv_len = (frame->ssm ? len : frame->uv_len ); uint8_t *Y = frame->data[0]; uint8_t *Cb = frame->data[1]; diff --git a/veejay-current/veejay-server/libvje/effects/negation.h b/veejay-current/veejay-server/libvje/effects/negation.h index 6c3c98ed..88f8cae4 100644 --- a/veejay-current/veejay-server/libvje/effects/negation.h +++ b/veejay-current/veejay-server/libvje/effects/negation.h @@ -20,10 +20,6 @@ #ifndef NEGATION_H #define NEGATION_H -#include -#include -#include - vj_effect *negation_init(int w, int h); void negation_apply( VJFrame *frame, int val); #endif diff --git a/veejay-current/veejay-server/libvje/effects/neighbours.c b/veejay-current/veejay-server/libvje/effects/neighbours.c index af85bb1c..e3fb7eb2 100644 --- a/veejay-current/veejay-server/libvje/effects/neighbours.c +++ b/veejay-current/veejay-server/libvje/effects/neighbours.c @@ -17,13 +17,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 , USA. */ -#include -#include -#include -#include -#include -#include "neighbours.h" + #include "common.h" +#include +#include "neighbours.h" vj_effect *neighbours_init(int w, int h) { @@ -225,26 +222,30 @@ static inline pixel_t evaluate_pixel_c( } -void neighbours_apply( VJFrame *frame, int width, int height, int brush_size, int intensity_level, int mode ) +void neighbours_apply( VJFrame *frame, int brush_size, int intensity_level, int mode ) { int x,y; const double intensity = intensity_level / 255.0; uint8_t *Y = tmp_buf[0]; uint8_t *Y2 = tmp_buf[1]; + + const unsigned int width = frame->width; + const unsigned int height = frame->height; + const int len = frame->len; uint8_t *dstY = frame->data[0]; uint8_t *dstCb = frame->data[1]; uint8_t *dstCr = frame->data[2]; // keep luma - vj_frame_copy1( frame->data[0],Y2,frame->len ); + vj_frame_copy1( frame->data[0],Y2,len ); if(mode) { - int strides[4] = { 0,frame->len, frame->len }; + int strides[4] = { 0,len, len }; uint8_t *dest[4] = { NULL, chromacity[0], chromacity[1],NULL }; vj_frame_copy( frame->data, dest, strides ); } // premultiply intensity map - for( y = 0 ; y < frame->len ; y ++ ) + for( y = 0 ; y < len ; y ++ ) Y[y] = (uint8_t) ( (double)Y2[y] * intensity ); if(!mode) diff --git a/veejay-current/veejay-server/libvje/effects/neighbours.h b/veejay-current/veejay-server/libvje/effects/neighbours.h index 3c1e1ff7..d7815cb7 100644 --- a/veejay-current/veejay-server/libvje/effects/neighbours.h +++ b/veejay-current/veejay-server/libvje/effects/neighbours.h @@ -20,12 +20,8 @@ #ifndef NEIGHBOURS_H #define NEIGHBOURS_H -#include -#include -#include - vj_effect *neighbours_init(int w, int h); int neighbours_malloc(int w, int h); void neighbours_free(void); -void neighbours_apply( VJFrame *frame, int width, int height, int brush_size, int level,int mode); +void neighbours_apply( VJFrame *frame, int brush_size, int level,int mode); #endif diff --git a/veejay-current/veejay-server/libvje/effects/neighbours2.c b/veejay-current/veejay-server/libvje/effects/neighbours2.c index 3a746401..4d7e5cff 100644 --- a/veejay-current/veejay-server/libvje/effects/neighbours2.c +++ b/veejay-current/veejay-server/libvje/effects/neighbours2.c @@ -17,13 +17,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 , USA. */ -#include -#include -#include -#include -#include -#include "neighbours2.h" + #include "common.h" +#include +#include "neighbours2.h" vj_effect *neighbours2_init(int w, int h) { @@ -225,27 +222,31 @@ static inline uint8_t evaluate_pixel_b( return( (uint8_t) ( y_map[ peak_index] )); } -void neighbours2_apply( VJFrame *frame, int width, int height, int brush_size, int intensity_level, int mode ) +void neighbours2_apply( VJFrame *frame, int brush_size, int intensity_level, int mode ) { int x,y; const double intensity = intensity_level / 255.0; uint8_t *Y = tmp_buf[0]; uint8_t *Y2 = tmp_buf[1]; + + const unsigned int width = frame->width; + const unsigned int height = frame->height; + const int len = frame->len; uint8_t *dstY = frame->data[0]; uint8_t *dstCb = frame->data[1]; uint8_t *dstCr = frame->data[2]; // keep luma - vj_frame_copy1( frame->data[0],Y2, frame->len ); + vj_frame_copy1( frame->data[0],Y2, len ); if(mode) { - int strides[4] = { 0, frame->len, frame->len,0 }; + int strides[4] = { 0, len, len,0 }; uint8_t *dest[4] = { NULL, chromacity[0],chromacity[1],NULL }; vj_frame_copy( frame->data, dest, strides ); } // premultiply intensity map - for( y = 0 ; y < frame->len ; y ++ ) + for( y = 0 ; y < len ; y ++ ) Y[y] = (uint8_t) ( (double)Y2[y] * intensity ); if(!mode) diff --git a/veejay-current/veejay-server/libvje/effects/neighbours2.h b/veejay-current/veejay-server/libvje/effects/neighbours2.h index 04b49426..13595c8f 100644 --- a/veejay-current/veejay-server/libvje/effects/neighbours2.h +++ b/veejay-current/veejay-server/libvje/effects/neighbours2.h @@ -20,12 +20,8 @@ #ifndef NEIGHBOURS2_H #define NEIGHBOURS2_H -#include -#include -#include - vj_effect *neighbours2_init(int w, int h); int neighbours2_malloc(int w, int h); void neighbours2_free(void); -void neighbours2_apply( VJFrame *frame, int width, int height, int brush_size, int level,int mode); +void neighbours2_apply( VJFrame *frame, int brush_size, int level,int mode); #endif diff --git a/veejay-current/veejay-server/libvje/effects/neighbours3.c b/veejay-current/veejay-server/libvje/effects/neighbours3.c index f3137cc8..5ba48dd1 100644 --- a/veejay-current/veejay-server/libvje/effects/neighbours3.c +++ b/veejay-current/veejay-server/libvje/effects/neighbours3.c @@ -18,13 +18,9 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 , USA. */ -#include -#include -#include -#include -#include -#include "neighbours3.h" #include "common.h" +#include +#include "neighbours3.h" vj_effect *neighbours3_init(int w, int h) { @@ -227,27 +223,31 @@ static inline uint8_t evaluate_pixel_b( return( (uint8_t) ( y_map[ peak_index] / peak_value )); } -void neighbours3_apply( VJFrame *frame, int width, int height, int brush_size, int intensity_level, int mode ) +void neighbours3_apply( VJFrame *frame, int brush_size, int intensity_level, int mode ) { int x,y; const double intensity = intensity_level / 255.0; uint8_t *Y = tmp_buf[0]; uint8_t *Y2 = tmp_buf[1]; + + const unsigned int width = frame->width; + const unsigned int height = frame->height; + const int len = frame->len; uint8_t *dstY = frame->data[0]; uint8_t *dstCb = frame->data[1]; uint8_t *dstCr = frame->data[2]; // keep luma - vj_frame_copy1( frame->data[0],Y2, frame->len ); + vj_frame_copy1( frame->data[0],Y2, len ); if(mode) { - int strides[4] = { 0, frame->len, frame->len, 0 }; + int strides[4] = { 0, len, len, 0 }; uint8_t *dest[4] = { NULL, chromacity[0], chromacity[1], NULL }; vj_frame_copy( frame->data, dest, strides ); } // premultiply intensity map - for( y = 0 ; y < frame->len ; y ++ ) + for( y = 0 ; y < len ; y ++ ) Y[y] = (uint8_t) ( (double)Y2[y] * intensity ); if(!mode) @@ -267,8 +267,8 @@ void neighbours3_apply( VJFrame *frame, int width, int height, int brush_size, i ); } } - veejay_memset( frame->data[1], 128, frame->len ); - veejay_memset( frame->data[2], 128, frame->len ); + veejay_memset( frame->data[1], 128, len ); + veejay_memset( frame->data[2], 128, len ); } else { diff --git a/veejay-current/veejay-server/libvje/effects/neighbours3.h b/veejay-current/veejay-server/libvje/effects/neighbours3.h index ae36db72..a885d855 100644 --- a/veejay-current/veejay-server/libvje/effects/neighbours3.h +++ b/veejay-current/veejay-server/libvje/effects/neighbours3.h @@ -20,12 +20,8 @@ #ifndef NEIGHBOURS3_H #define NEIGHBOURS3_H -#include -#include -#include - vj_effect *neighbours3_init(int w, int h); int neighbours3_malloc(int w, int h); void neighbours3_free(void); -void neighbours3_apply( VJFrame *frame, int width, int height, int brush_size, int level,int mode); +void neighbours3_apply( VJFrame *frame, int brush_size, int level,int mode); #endif diff --git a/veejay-current/veejay-server/libvje/effects/neighbours4.c b/veejay-current/veejay-server/libvje/effects/neighbours4.c index c30d5988..e475f449 100644 --- a/veejay-current/veejay-server/libvje/effects/neighbours4.c +++ b/veejay-current/veejay-server/libvje/effects/neighbours4.c @@ -17,13 +17,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 , USA. */ -#include -#include -#include -#include -#include -#include "neighbours4.h" + #include "common.h" +#include +#include "neighbours4.h" vj_effect *neighbours4_init(int w, int h) { @@ -265,32 +262,37 @@ static inline uint8_t evaluate_pixel_b( return( (uint8_t) ( y_map[ peak_index] / peak_value )); } -void neighbours4_apply( VJFrame *frame, int width, int height, int radius, int brush_size, int intensity_level, int mode ) +void neighbours4_apply( VJFrame *frame, int radius, int brush_size, + int intensity_level, int mode ) { int x,y; const double intensity = intensity_level / 255.0; uint8_t *Y = tmp_buf[0]; uint8_t *Y2 = tmp_buf[1]; + + const unsigned int width = frame->width; + const unsigned int height = frame->height; + const int len = frame->len; uint8_t *dstY = frame->data[0]; uint8_t *dstCb = frame->data[1]; uint8_t *dstCr = frame->data[2]; double r = (double)radius; // keep luma - vj_frame_copy1( frame->data[0], Y2, frame->len ); + vj_frame_copy1( frame->data[0], Y2, len ); create_circle( r, brush_size,width ); relpoint_t *p_points = &points[0]; if(mode) { - int strides[4] = { 0,frame->len, frame->len }; + int strides[4] = { 0,len, len }; uint8_t *dest[3] = { NULL, chromacity[0], chromacity[1] }; vj_frame_copy( frame->data, dest, strides ); } // premultiply intensity map - for( y = 0 ; y < frame->len ; y ++ ) + for( y = 0 ; y < len ; y ++ ) Y[y] = (uint8_t) ( (double)Y2[y] * intensity ); if(!mode) @@ -311,8 +313,8 @@ void neighbours4_apply( VJFrame *frame, int width, int height, int radius, int b ); } } - veejay_memset( frame->data[1], 128, frame->len ); - veejay_memset( frame->data[2], 128, frame->len ); + veejay_memset( frame->data[1], 128, len ); + veejay_memset( frame->data[2], 128, len ); } else { diff --git a/veejay-current/veejay-server/libvje/effects/neighbours4.h b/veejay-current/veejay-server/libvje/effects/neighbours4.h index 3c28115e..877f28c5 100644 --- a/veejay-current/veejay-server/libvje/effects/neighbours4.h +++ b/veejay-current/veejay-server/libvje/effects/neighbours4.h @@ -20,12 +20,8 @@ #ifndef NEIGHBOURS4_H #define NEIGHBOURS4_H -#include -#include -#include - vj_effect *neighbours4_init(int w, int h); int neighbours4_malloc(int w, int h); void neighbours4_free(void); -void neighbours4_apply( VJFrame *frame, int width, int height, int radius,int brush_size, int level,int mode); +void neighbours4_apply( VJFrame *frame, int radius,int brush_size, int level,int mode); #endif diff --git a/veejay-current/veejay-server/libvje/effects/neighbours5.c b/veejay-current/veejay-server/libvje/effects/neighbours5.c index d90b32da..238eb3d7 100644 --- a/veejay-current/veejay-server/libvje/effects/neighbours5.c +++ b/veejay-current/veejay-server/libvje/effects/neighbours5.c @@ -17,13 +17,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 , USA. */ -#include -#include -#include -#include -#include -#include "neighbours5.h" + #include "common.h" +#include +#include "neighbours5.h" vj_effect *neighbours5_init(int w, int h) { @@ -227,28 +224,32 @@ static inline uint8_t evaluate_pixel_b( return( (uint8_t) ( y_map[ peak_index] / peak_value )); } -void neighbours5_apply( VJFrame *frame, int width, int height, int brush_size, int intensity_level, int mode ) +void neighbours5_apply( VJFrame *frame, int brush_size, int intensity_level, int mode ) { int x,y; const double intensity = intensity_level / 255.0; uint8_t *Y = tmp_buf[0]; uint8_t *Y2 = tmp_buf[1]; + + const unsigned int width = frame->width; + const unsigned int height = frame->height; + const int len = frame->len; uint8_t *dstY = frame->data[0]; uint8_t *dstCb = frame->data[1]; uint8_t *dstCr = frame->data[2]; // keep luma - vj_frame_copy1( frame->data[0], Y2, frame->len ); + vj_frame_copy1( frame->data[0], Y2, len ); if(mode) { - int strides[4] = { 0,frame->len, frame->len,0 }; + int strides[4] = { 0,len, len,0 }; uint8_t *dest[4] = { NULL, chromacity[0], chromacity[1],NULL }; vj_frame_copy( frame->data, dest, strides ); } // premultiply intensity map - for( y = 0 ; y < frame->len ; y ++ ) + for( y = 0 ; y < len ; y ++ ) Y[y] = (uint8_t) ( (double)Y2[y] * intensity ); if(!mode) @@ -268,8 +269,8 @@ void neighbours5_apply( VJFrame *frame, int width, int height, int brush_size, i ); } } - veejay_memset( frame->data[1], 128, frame->len ); - veejay_memset( frame->data[2], 128, frame->len ); + veejay_memset( frame->data[1], 128, len ); + veejay_memset( frame->data[2], 128, len ); } else { diff --git a/veejay-current/veejay-server/libvje/effects/neighbours5.h b/veejay-current/veejay-server/libvje/effects/neighbours5.h index bf3f92c6..e8aa74b7 100644 --- a/veejay-current/veejay-server/libvje/effects/neighbours5.h +++ b/veejay-current/veejay-server/libvje/effects/neighbours5.h @@ -20,12 +20,8 @@ #ifndef NEIGHBOURS5_H #define NEIGHBOURS5_H -#include -#include -#include - vj_effect *neighbours5_init(int w, int h); int neighbours5_malloc(int w, int h); void neighbours5_free(void); -void neighbours5_apply( VJFrame *frame, int width, int height, int radius,int brush_size, int level); +void neighbours5_apply( VJFrame *frame, int radius,int brush_size, int level); #endif diff --git a/veejay-current/veejay-server/libvje/effects/nervous.c b/veejay-current/veejay-server/libvje/effects/nervous.c index 90401fe6..f881adea 100644 --- a/veejay-current/veejay-server/libvje/effects/nervous.c +++ b/veejay-current/veejay-server/libvje/effects/nervous.c @@ -24,10 +24,8 @@ in EffecTV ( http://effectv.sf.net ). */ -#include -#include -#include -#include + +#include "common.h" #include #include "nervous.h" @@ -85,10 +83,10 @@ void nervous_free(void) } -void nervous_apply( VJFrame *frame, int width, int height, int delay) +void nervous_apply( VJFrame *frame, int delay) { - int len = (width * height); - int uv_len = (frame->ssm == 1 ? frame->len : frame->uv_len); + const int len = frame->len; + int uv_len = (frame->ssm == 1 ? len : frame->uv_len); uint8_t *NY = nervous_buf[0] + (len * frames_elapsed ); uint8_t *NCb= nervous_buf[1] + (uv_len * frames_elapsed ); uint8_t *NCr= nervous_buf[2] + (uv_len * frames_elapsed ); diff --git a/veejay-current/veejay-server/libvje/effects/nervous.h b/veejay-current/veejay-server/libvje/effects/nervous.h index c8355090..997c62f2 100644 --- a/veejay-current/veejay-server/libvje/effects/nervous.h +++ b/veejay-current/veejay-server/libvje/effects/nervous.h @@ -20,12 +20,8 @@ #ifndef NERVOUS_H #define NERVOUS_H -#include -#include -#include - vj_effect *nervous_init(int w, int h); int nervous_malloc(int w, int h); void nervous_free(void); -void nervous_apply(VJFrame *Frame, int width, int height,int delay); +void nervous_apply(VJFrame *Frame, int delay); #endif diff --git a/veejay-current/veejay-server/libvje/effects/noiseadd.c b/veejay-current/veejay-server/libvje/effects/noiseadd.c index 0cc6c37e..2b52685c 100644 --- a/veejay-current/veejay-server/libvje/effects/noiseadd.c +++ b/veejay-current/veejay-server/libvje/effects/noiseadd.c @@ -17,13 +17,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 , USA. */ -#include -#include -#include -#include + +#include "common.h" #include #include "noiseadd.h" -#include "common.h" static uint8_t *Yb_frame; @@ -74,7 +71,7 @@ static void noiseblur1x3_maskapply(VJFrame* frame, int coeef ) { int r, c; double k = (coeef/100.0); uint8_t d; - const int width = frame->width; + const unsigned int width = frame->width; const int len = frame->len; uint8_t *Y = frame->data[0]; @@ -101,7 +98,7 @@ static void noiseblur3x3_maskapply(VJFrame* frame, int coeef ) { int r, c; const double k = (coeef/1000.0); uint8_t d; - const int width = frame->width; + const unsigned int width = frame->width; const int len = (frame->len)-width; uint8_t *Y = frame->data[0]; @@ -134,7 +131,7 @@ static void noiseneg3x3_maskapply(VJFrame *frame, int coeef ) { int r, c; const double k = (coeef/1000.0); uint8_t d; - const int width = frame->width; + const unsigned int width = frame->width; const int len = (frame->len)-width; uint8_t *Y = frame->data[0]; diff --git a/veejay-current/veejay-server/libvje/effects/noiseadd.h b/veejay-current/veejay-server/libvje/effects/noiseadd.h index 57bf9014..c0db8fdd 100644 --- a/veejay-current/veejay-server/libvje/effects/noiseadd.h +++ b/veejay-current/veejay-server/libvje/effects/noiseadd.h @@ -20,13 +20,8 @@ #ifndef NOISEADD_H #define NOISEADD_H -#include -#include -#include - vj_effect *noiseadd_init(int w, int h); void noiseadd_free(); int noiseadd_malloc(int w, int h); void noiseadd_apply( VJFrame *frame, int t, int n); - #endif diff --git a/veejay-current/veejay-server/libvje/effects/noisepencil.c b/veejay-current/veejay-server/libvje/effects/noisepencil.c index 90ab228f..a0e8bcba 100644 --- a/veejay-current/veejay-server/libvje/effects/noisepencil.c +++ b/veejay-current/veejay-server/libvje/effects/noisepencil.c @@ -18,13 +18,9 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 , USA. */ -#include -#include -#include -#include +#include "common.h" #include #include "noisepencil.h" -#include "common.h" static uint8_t *Yb_frame = NULL; @@ -314,21 +310,23 @@ static void noisepencil_5_apply(uint8_t *src[3], int width, int height, int coee /* with min_t -> max_t select the threshold to 'noise ' */ void noisepencil_apply(VJFrame *frame, int type, int coeef, int min_t, int max_t) { + const unsigned int width = frame->width; + const unsigned int height = frame->height; switch(type) { case 0: - noisepencil_1_apply(frame->data,frame->width,frame->height,coeef,min_t,max_t); + noisepencil_1_apply(frame->data,width, height, coeef,min_t,max_t); break; case 1: - noisepencil_2_apply(frame->data,frame->width,frame->height,coeef,min_t,max_t); + noisepencil_2_apply(frame->data, width, height, coeef,min_t,max_t); break; case 2: - noisepencil_3_apply(frame->data,frame->width,frame->height,coeef,min_t,max_t); + noisepencil_3_apply(frame->data, width, height, coeef,min_t,max_t); break; case 3: - noisepencil_4_apply(frame->data,frame->width,frame->height,coeef,min_t,max_t); + noisepencil_4_apply(frame->data, width, height, coeef,min_t,max_t); break; case 4: - noisepencil_5_apply(frame->data,frame->width,frame->height,coeef,min_t,max_t); + noisepencil_5_apply(frame->data, width, height, coeef,min_t,max_t); break; } } diff --git a/veejay-current/veejay-server/libvje/effects/noisepencil.h b/veejay-current/veejay-server/libvje/effects/noisepencil.h index 8a9f266c..32fb95d6 100644 --- a/veejay-current/veejay-server/libvje/effects/noisepencil.h +++ b/veejay-current/veejay-server/libvje/effects/noisepencil.h @@ -19,14 +19,9 @@ */ #ifndef NOISEPENCIL_H -#define NOISEPENCIL_H -#include -#include -#include - +#define NOISEPENCIL_H vj_effect *noisepencil_init (int w, int h); void noisepencil_free(); int noisepencil_malloc(int w, int h); void noisepencil_apply( VJFrame *frame, int t, int n, int a, int b); - #endif diff --git a/veejay-current/veejay-server/libvje/effects/opacity.c b/veejay-current/veejay-server/libvje/effects/opacity.c index 762411b3..5da2678b 100644 --- a/veejay-current/veejay-server/libvje/effects/opacity.c +++ b/veejay-current/veejay-server/libvje/effects/opacity.c @@ -34,15 +34,11 @@ * */ -#include -#include -#include -#include -#include + +#include "common.h" #include #include #include "opacity.h" -#include "common.h" vj_effect *opacity_init(int w, int h) { diff --git a/veejay-current/veejay-server/libvje/effects/opacityadv.c b/veejay-current/veejay-server/libvje/effects/opacityadv.c index 45d608c1..16b78400 100644 --- a/veejay-current/veejay-server/libvje/effects/opacityadv.c +++ b/veejay-current/veejay-server/libvje/effects/opacityadv.c @@ -17,10 +17,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 , USA. */ -#include -#include -#include -#include + +#include "common.h" #include #include "opacityadv.h" @@ -53,7 +51,9 @@ void opacityadv_apply( VJFrame *frame, VJFrame *frame2, int opacity, int threshold, int threshold2) { - unsigned int x, y, len = frame->width * frame->height; + unsigned int x, y; + const unsigned int width = frame->width; + const int len = frame->len; uint8_t a1, a2; unsigned int op0, op1; uint8_t *Y = frame->data[0]; @@ -62,7 +62,6 @@ void opacityadv_apply( VJFrame *frame, VJFrame *frame2, int opacity, uint8_t *Y2 = frame2->data[0]; uint8_t *Cb2= frame2->data[1]; uint8_t *Cr2= frame2->data[2]; - const int width = frame->width; op1 = (opacity > 255) ? 255 : opacity; op0 = 255 - op1; diff --git a/veejay-current/veejay-server/libvje/effects/opacitythreshold.c b/veejay-current/veejay-server/libvje/effects/opacitythreshold.c index 294fb838..d2cea6f9 100644 --- a/veejay-current/veejay-server/libvje/effects/opacitythreshold.c +++ b/veejay-current/veejay-server/libvje/effects/opacitythreshold.c @@ -50,7 +50,8 @@ vj_effect *opacitythreshold_init(int w, int h) void opacitythreshold_apply( VJFrame *frame, VJFrame *frame2, int opacity,int threshold, int t2) { const int width = frame->width; - unsigned int x, y, len = frame->len-width; + unsigned int x, y; + const int len = frame->len-width; uint8_t a1, a2; unsigned int op0, op1; uint8_t *Y = frame->data[0]; diff --git a/veejay-current/veejay-server/libvje/effects/overclock.c b/veejay-current/veejay-server/libvje/effects/overclock.c index 9643d443..321d9041 100644 --- a/veejay-current/veejay-server/libvje/effects/overclock.c +++ b/veejay-current/veejay-server/libvje/effects/overclock.c @@ -17,11 +17,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 , USA. */ -#include -#include -#include -#include -#include +#include "common.h" + #include #include "overclock.h" vj_effect *overclock_init(int w, int h) @@ -48,61 +45,6 @@ vj_effect *overclock_init(int w, int h) static uint8_t *oc_buf[3] = { NULL,NULL,NULL }; -//copied from xine -static inline void blur(uint8_t *dst, uint8_t *src, int w, int radius, int dstStep, int srcStep){ - int x; - const int length= radius*2 + 1; - const int inv= ((1<<16) + length/2)/length; - - int sum= 0; - - for(x=0; x>16; - } - - for(; x>16; - } - - for(; x>16; - } -} - -//copied from xine -static void blur2(uint8_t *dst, uint8_t *src, int w, int radius, int power, int dstStep, int srcStep){ - uint8_t temp[2][4096]; - uint8_t *a= temp[0], *b=temp[1]; - - if(radius){ - blur(a, src, w, radius, 1, srcStep); - for(; power>2; power--){ - uint8_t *c; - blur(b, a, w, radius, 1, 1); - c=a; a=b; b=c; - } - if(power>1) - blur(dst, a, w, radius, dstStep, 1); - else{ - int i; - for(i=0; iwidth; + const unsigned int height = frame->height; int x,y,dx,dy; uint8_t t = 0; int s = 0; diff --git a/veejay-current/veejay-server/libvje/effects/overclock.h b/veejay-current/veejay-server/libvje/effects/overclock.h index f826f739..ae9965ee 100644 --- a/veejay-current/veejay-server/libvje/effects/overclock.h +++ b/veejay-current/veejay-server/libvje/effects/overclock.h @@ -20,11 +20,8 @@ #ifndef OVERCLOCK_H #define OVERCLOCK_H -#include -#include -#include vj_effect *overclock_init(int w, int h); int overclock_malloc(int w, int h ); void overclock_free(); -void overclock_apply(VJFrame *frame, int width, int height, int val, int r); +void overclock_apply(VJFrame *frame, int val, int r); #endif diff --git a/veejay-current/veejay-server/libvje/effects/passthrough.c b/veejay-current/veejay-server/libvje/effects/passthrough.c index 76b91d13..7b28147b 100644 --- a/veejay-current/veejay-server/libvje/effects/passthrough.c +++ b/veejay-current/veejay-server/libvje/effects/passthrough.c @@ -18,9 +18,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 , USA. */ -#include -#include -#include +#include "common.h" #include #include "passthrough.h" diff --git a/veejay-current/veejay-server/libvje/effects/passthrough.h b/veejay-current/veejay-server/libvje/effects/passthrough.h index c8a28076..464f8d61 100644 --- a/veejay-current/veejay-server/libvje/effects/passthrough.h +++ b/veejay-current/veejay-server/libvje/effects/passthrough.h @@ -20,11 +20,6 @@ #ifndef PASSTHROUGHB_H #define PASSTHROUGHB_H -#include -#include -#include - vj_effect *passthrough_init(int w, int h); void passthrough_apply( VJFrame *frame, VJFrame *frame2); - #endif diff --git a/veejay-current/veejay-server/libvje/effects/pencilsketch.c b/veejay-current/veejay-server/libvje/effects/pencilsketch.c index b71bc41e..9489ae7a 100644 --- a/veejay-current/veejay-server/libvje/effects/pencilsketch.c +++ b/veejay-current/veejay-server/libvje/effects/pencilsketch.c @@ -17,11 +17,9 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 , USA. */ -#include -#include -#include -#include + #include "common.h" +#include #include "pencilsketch.h" extern int vj_task_available(); @@ -157,9 +155,9 @@ void pencilsketch_apply(VJFrame *frame, int type, int threshold_min, int threshold_max, int mode) { unsigned int i; - unsigned int len = frame->len; + int len = frame->len; const unsigned int width = frame->width; - const unsigned int uv_len = (frame->ssm ?frame->len : frame->uv_len); + const int uv_len = (frame->ssm ? len : frame->uv_len); int m,d; uint8_t y,yb; uint8_t *Y = frame->data[0]; diff --git a/veejay-current/veejay-server/libvje/effects/perspective.c b/veejay-current/veejay-server/libvje/effects/perspective.c index bb53a1a3..1873a392 100644 --- a/veejay-current/veejay-server/libvje/effects/perspective.c +++ b/veejay-current/veejay-server/libvje/effects/perspective.c @@ -17,13 +17,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 , USA. */ -#include -#include -#include -#include -#include -#include + #include "common.h" +#include +#include #include "perspective.h" vj_effect *perspective_init(int width , int height) @@ -100,8 +97,8 @@ void perspective_free() { void perspective_apply( VJFrame *frame, int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4, int reverse) { - const int width = frame->width; - const int height = frame->height; + const unsigned int width = frame->width; + const unsigned int height = frame->height; const int len = frame->len; if( x1 != perspective_[0] || y1 != perspective_[1] || x2 != perspective_[2] || y2 != perspective_[3] || diff --git a/veejay-current/veejay-server/libvje/effects/perspective.h b/veejay-current/veejay-server/libvje/effects/perspective.h index a43a3e42..cca61b2c 100644 --- a/veejay-current/veejay-server/libvje/effects/perspective.h +++ b/veejay-current/veejay-server/libvje/effects/perspective.h @@ -20,10 +20,6 @@ #ifndef PERSPECTIVE_H #define PERSPECTIVE_H -#include -#include -#include - vj_effect *perspective_init(int width, int height); int perspective_malloc(int w, int h); void perspective_free(); diff --git a/veejay-current/veejay-server/libvje/effects/photoplay.c b/veejay-current/veejay-server/libvje/effects/photoplay.c index 0a88fc9c..6b2794a5 100644 --- a/veejay-current/veejay-server/libvje/effects/photoplay.c +++ b/veejay-current/veejay-server/libvje/effects/photoplay.c @@ -17,11 +17,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 , USA. */ -#include -#include + +#include "common.h" #include #include "photoplay.h" -#include "common.h" vj_effect *photoplay_init(int w, int h) { @@ -201,9 +200,12 @@ static void put_photo( uint8_t *dst_plane, uint8_t *photo, int dst_w, int dst_h, } } -void photoplay_apply( VJFrame *frame, int width, int height, int size, int delay, int mode ) +void photoplay_apply( VJFrame *frame, int size, int delay, int mode ) { unsigned int i; + + const unsigned int width = frame->width; + const unsigned int height = frame->height; uint8_t *dstY = frame->data[0]; uint8_t *dstU = frame->data[1]; uint8_t *dstV = frame->data[2]; diff --git a/veejay-current/veejay-server/libvje/effects/photoplay.h b/veejay-current/veejay-server/libvje/effects/photoplay.h index 5084f1a7..293e8825 100644 --- a/veejay-current/veejay-server/libvje/effects/photoplay.h +++ b/veejay-current/veejay-server/libvje/effects/photoplay.h @@ -20,12 +20,8 @@ #ifndef PHOTOPLAY_H #define PHOTOPLAY_H -#include -#include -#include - vj_effect *photoplay_init(int w, int h); int photoplay_malloc(int w, int h); void photoplay_free(void); -void photoplay_apply( VJFrame *frame, int width, int height, int size, int behaviour, int mode); +void photoplay_apply( VJFrame *frame, int size, int behaviour, int mode); #endif diff --git a/veejay-current/veejay-server/libvje/effects/picinpic.c b/veejay-current/veejay-server/libvje/effects/picinpic.c index 11868dee..4ed687b1 100644 --- a/veejay-current/veejay-server/libvje/effects/picinpic.c +++ b/veejay-current/veejay-server/libvje/effects/picinpic.c @@ -22,15 +22,12 @@ This effect uses libpostproc , it should be enabled at compile time (--with-swscaler) if you want to use this Effect. */ -#include -#include -#include +#include "common.h" #include -#include "picinpic.h" #include #include -#include -#include "common.h" +#include "picinpic.h" + extern void vj_get_yuv444_template(VJFrame *src, int w, int h); typedef struct { @@ -99,10 +96,12 @@ static int nearest_div(int val ) return val; } -void picinpic_apply( void *user_data, VJFrame *frame, VJFrame *frame2, int width, int height, - int twidth, int theight, int x1, int y1 ) +void picinpic_apply( void *user_data, VJFrame *frame, VJFrame *frame2, + int twidth, int theight, int x1, int y1 ) { int x, y; + const unsigned int width = frame->width; + const unsigned int height = frame->height; pic_t *picture = (pic_t*) user_data; int view_width = nearest_div(twidth); int view_height = nearest_div(theight); diff --git a/veejay-current/veejay-server/libvje/effects/picinpic.h b/veejay-current/veejay-server/libvje/effects/picinpic.h index 3c8bc3af..d2f960a7 100644 --- a/veejay-current/veejay-server/libvje/effects/picinpic.h +++ b/veejay-current/veejay-server/libvje/effects/picinpic.h @@ -20,18 +20,9 @@ #ifndef PICINPIC_H #define PICINPIC_H - -#include -#include -#include -vj_effect *picinpic_init( int w, int h ); - -void picinpic_free(void *d); - -int picinpic_malloc( void **c, int w , int h ); - - -void picinpic_apply( void *user_data, VJFrame *frame, VJFrame *frame2, - int w, int h, int twidth, int theight, int x1, int y1 ); - +vj_effect *picinpic_init( int w, int h ); +void picinpic_free(void *d); +int picinpic_malloc( void **c, int w , int h ); +void picinpic_apply( void *user_data, VJFrame *frame, VJFrame *frame2, + int twidth, int theight, int x1, int y1 ); #endif diff --git a/veejay-current/veejay-server/libvje/effects/pixelate.c b/veejay-current/veejay-server/libvje/effects/pixelate.c index 19124852..441fa653 100644 --- a/veejay-current/veejay-server/libvje/effects/pixelate.c +++ b/veejay-current/veejay-server/libvje/effects/pixelate.c @@ -17,10 +17,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 , USA. */ -#include -#include -#include -#include + +#include "common.h" #include #include "pixelate.h" @@ -62,9 +60,9 @@ vj_effect *pixelate_init(int width, int height) void pixelate_apply( VJFrame *frame, int vv ) { unsigned int i,j ; - unsigned int len = frame->len; + const int len = frame->len; const unsigned int v = values[vv]; - const unsigned int uv_len = (frame->ssm ? frame->len : frame->uv_len); + const int uv_len = (frame->ssm ? len : frame->uv_len); unsigned int u_v = v >> (frame->ssm ? frame->shift_h: 1 ); if( u_v == 0 ) u_v = 1; diff --git a/veejay-current/veejay-server/libvje/effects/porterduff.c b/veejay-current/veejay-server/libvje/effects/porterduff.c index cab4eb2c..7f3a3b42 100644 --- a/veejay-current/veejay-server/libvje/effects/porterduff.c +++ b/veejay-current/veejay-server/libvje/effects/porterduff.c @@ -17,13 +17,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 , USA. */ -#include -#include + +#include "common.h" #include #include "porterduff.h" -#include -#include -#include "common.h" #ifndef MIN #define MIN(a,b) ( (a)>(b) ? (b) : (a) ) @@ -359,51 +356,52 @@ static void divide( uint8_t *A, uint8_t *B, int n_pixels ) } } -void porterduff_apply(VJFrame *frame, VJFrame *frame2, int width,int height, int mode) +void porterduff_apply(VJFrame *frame, VJFrame *frame2, int mode) { - switch( mode ) + const int len = frame->len; + switch( mode ) { case 0: - porterduff_dst( frame->data[0],frame2->data[0],frame->len ); + porterduff_dst( frame->data[0],frame2->data[0],len ); break; case 1: - porterduff_atop( frame->data[0],frame2->data[0], frame->len ); + porterduff_atop( frame->data[0],frame2->data[0], len ); break; case 2: - porterduff_dst_in( frame->data[0],frame2->data[0], frame->len ); + porterduff_dst_in( frame->data[0],frame2->data[0], len ); break; case 3: - porterduff_dst_over( frame->data[0],frame2->data[0],frame->len ); + porterduff_dst_over( frame->data[0],frame2->data[0],len ); break; case 4: - porterduff_dst_out( frame->data[0],frame2->data[0],frame->len ); + porterduff_dst_out( frame->data[0],frame2->data[0],len ); break; case 5: - porterduff_src_over( frame->data[0],frame2->data[0],frame->len ); + porterduff_src_over( frame->data[0],frame2->data[0],len ); break; case 6: - porterduff_src_atop( frame->data[0],frame2->data[0],frame->len ); + porterduff_src_atop( frame->data[0],frame2->data[0],len ); break; case 7: - porterduff_src_in( frame->data[0],frame2->data[0],frame->len ); + porterduff_src_in( frame->data[0],frame2->data[0],len ); break; case 8: - porterduff_src_out( frame->data[0],frame2->data[0],frame->len); + porterduff_src_out( frame->data[0],frame2->data[0],len); break; case 9: - svg_multiply( frame->data[0], frame2->data[0], frame->len ); + svg_multiply( frame->data[0], frame2->data[0], len ); break; case 10: - xor( frame->data[0], frame2->data[0], frame->len); + xor( frame->data[0], frame2->data[0], len); break; case 11: - add( frame->data[0], frame2->data[0], frame->len ); + add( frame->data[0], frame2->data[0], len ); break; case 12: - subtract(frame->data[0],frame2->data[0],frame->len); + subtract(frame->data[0],frame2->data[0],len); break; case 13: - divide(frame->data[0],frame2->data[0],frame->len); + divide(frame->data[0],frame2->data[0],len); break; } } diff --git a/veejay-current/veejay-server/libvje/effects/porterduff.h b/veejay-current/veejay-server/libvje/effects/porterduff.h index e2e8fa0e..2bce8e86 100644 --- a/veejay-current/veejay-server/libvje/effects/porterduff.h +++ b/veejay-current/veejay-server/libvje/effects/porterduff.h @@ -20,10 +20,6 @@ #ifndef PORTERDUFF_H #define PORTERUDFF_H -#include -#include -#include - vj_effect *porterduff_init(); -void porterduff_apply( VJFrame *frame, VJFrame *frame2, int width,int height,int mode ); +void porterduff_apply( VJFrame *frame, VJFrame *frame2,int mode ); #endif diff --git a/veejay-current/veejay-server/libvje/effects/posterize.c b/veejay-current/veejay-server/libvje/effects/posterize.c index 124ae23c..d0191789 100644 --- a/veejay-current/veejay-server/libvje/effects/posterize.c +++ b/veejay-current/veejay-server/libvje/effects/posterize.c @@ -17,12 +17,11 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 , USA. */ -#include -#include -#include + +#include "common.h" #include #include "posterize.h" -#include "common.h" + vj_effect *posterize_init(int w, int h) { vj_effect *ve = (vj_effect *) vj_calloc(sizeof(vj_effect)); @@ -75,5 +74,5 @@ static void _posterize_y_simple(uint8_t *src[3], int len, int value, int thresho void posterize_apply(VJFrame *frame, int factor, int t1,int t2) { - _posterize_y_simple( frame->data, (frame->width*frame->height), factor, t1,t2); + _posterize_y_simple( frame->data, frame->len, factor, t1,t2); } diff --git a/veejay-current/veejay-server/libvje/effects/posterize.h b/veejay-current/veejay-server/libvje/effects/posterize.h index 7a1955a9..4fe450f7 100644 --- a/veejay-current/veejay-server/libvje/effects/posterize.h +++ b/veejay-current/veejay-server/libvje/effects/posterize.h @@ -20,10 +20,6 @@ #ifndef POSTERIZE_H #define POSTERIZE_H -#include -#include -#include - vj_effect *posterize_init(); void posterize_apply(VJFrame *frame, int factor,int t1,int t2); void posterize_free(); diff --git a/veejay-current/veejay-server/libvje/effects/radcor.c b/veejay-current/veejay-server/libvje/effects/radcor.c index 1d7eb6d6..339ec84f 100644 --- a/veejay-current/veejay-server/libvje/effects/radcor.c +++ b/veejay-current/veejay-server/libvje/effects/radcor.c @@ -22,12 +22,10 @@ * http://local.wasp.uwa.edu.au/~pbourke/projection/lenscorrection/ * */ -#include -#include -#include + +#include "common.h" #include #include "radcor.h" -#include "common.h" vj_effect *radcor_init(int w, int h) { @@ -94,10 +92,10 @@ typedef struct void radcor_apply( VJFrame *frame, int alpaX, int alpaY, int dir, int alpha) { int i,j; - int width, height; - width = frame->width; height = frame->height; - int len = (width * height); int i2,j2; + const unsigned int width = frame->width; + const unsigned int height = frame->height; + const int len = frame->len; double x,y,x2,x3,y2,y3,r; uint8_t *Y = frame->data[0]; uint8_t *Cb = frame->data[1]; diff --git a/veejay-current/veejay-server/libvje/effects/radcor.h b/veejay-current/veejay-server/libvje/effects/radcor.h index 98063922..02d4c71b 100644 --- a/veejay-current/veejay-server/libvje/effects/radcor.h +++ b/veejay-current/veejay-server/libvje/effects/radcor.h @@ -20,10 +20,6 @@ #ifndef LENSCOR_H #define LENSCOR_H -#include -#include -#include - vj_effect *radcor_init(int w, int h); int radcor_malloc(int w, int h); void radcor_free(); diff --git a/veejay-current/veejay-server/libvje/effects/radialblur.c b/veejay-current/veejay-server/libvje/effects/radialblur.c index 7d845f33..5806b6ca 100644 --- a/veejay-current/veejay-server/libvje/effects/radialblur.c +++ b/veejay-current/veejay-server/libvje/effects/radialblur.c @@ -41,11 +41,10 @@ * mplayer's boxblur * Copyright (C) 2002 Michael Niedermayer */ -#include -#include + +#include "common.h" #include #include "radialblur.h" -#include "common.h" static uint8_t *radial_src[4] = { NULL,NULL,NULL,NULL}; @@ -104,8 +103,10 @@ static void rvblur_apply( uint8_t *dst, uint8_t *src, int w, int h, int r , int } -void radialblur_apply(VJFrame *frame, int width, int height, int radius, int power, int direction) +void radialblur_apply(VJFrame *frame, int radius, int power, int direction) { + const unsigned int width = frame->width; + const unsigned int height = frame->height; const int len = frame->len; const int uv_len = frame->uv_len; diff --git a/veejay-current/veejay-server/libvje/effects/radialblur.h b/veejay-current/veejay-server/libvje/effects/radialblur.h index 60b37ea1..154e3f59 100644 --- a/veejay-current/veejay-server/libvje/effects/radialblur.h +++ b/veejay-current/veejay-server/libvje/effects/radialblur.h @@ -20,13 +20,8 @@ #ifndef RADIALBLUR_H #define RADIALBLUR_H -#include -#include -#include - vj_effect *radialblur_init(int w, int h); int radialblur_malloc(int w, int h); -void radialblur_apply(VJFrame *frame, int width, int height, int r, - int p, int n); +void radialblur_apply(VJFrame *frame, int r, int p, int n); void radialblur_free(); #endif diff --git a/veejay-current/veejay-server/libvje/effects/radioactive.c b/veejay-current/veejay-server/libvje/effects/radioactive.c index 57121f76..052a300a 100644 --- a/veejay-current/veejay-server/libvje/effects/radioactive.c +++ b/veejay-current/veejay-server/libvje/effects/radioactive.c @@ -27,16 +27,13 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 , USA. */ -#include -#include -#include -#include -#include -#include -#include -#include "radioactive.h" -#include "softblur.h" + #include "common.h" +#include +//#include +#include +#include "softblur.h" +#include "radioactive.h" vj_effect *radioactivetv_init(int w, int h) { @@ -227,13 +224,16 @@ void radioactivetv_free() diffbuf = NULL; } -void radioactivetv_apply( VJFrame *frame, VJFrame *blue, int width, int height, - int mode, int snapRatio, int snapInterval, int threshold) +void radioactivetv_apply( VJFrame *frame, VJFrame *blue, int mode, int snapRatio, + int snapInterval, int threshold) { unsigned int x, y; - uint8_t *diff = diffbuf; - uint8_t *prev = diff + frame->len; + const unsigned int width = frame->width; + const unsigned int height = frame->height; const int len = frame->len; + + uint8_t *diff = diffbuf; + uint8_t *prev = diff + len; uint8_t *lum = frame->data[0]; uint8_t *dstY = lum; uint8_t *dstU = frame->data[1]; @@ -280,7 +280,7 @@ void radioactivetv_apply( VJFrame *frame, VJFrame *blue, int width, int height, for( y = 0; y < len; y ++ ){ diff[y] = abs(lum[y] - prev[y]); if(diff[y] < threshold ) - diff[y] = 0; + diff[y] = 0; prev[y] = (prev[y] + lum[y])>>1; } break; @@ -288,7 +288,7 @@ void radioactivetv_apply( VJFrame *frame, VJFrame *blue, int width, int height, for( y = 0; y < len; y ++ ) { diff[y] = abs(lum[y] - prev[y]); if(diff[y] < threshold ) - diff[y] = 0; + diff[y] = 0; prev[y] = lum[y]; } break; @@ -324,7 +324,7 @@ void radioactivetv_apply( VJFrame *frame, VJFrame *blue, int width, int height, for( y = 0; y < len; y ++ ) { diff[y] = abs(lum[y] - prev[y]); if(diff[y] < threshold ) - diff[y] = 0; + diff[y] = 0; prev[y] = lum[y]; } break; diff --git a/veejay-current/veejay-server/libvje/effects/radioactive.h b/veejay-current/veejay-server/libvje/effects/radioactive.h index 6e335284..abba409d 100644 --- a/veejay-current/veejay-server/libvje/effects/radioactive.h +++ b/veejay-current/veejay-server/libvje/effects/radioactive.h @@ -21,7 +21,8 @@ #ifndef RADIOACTIVE_TVH #define RADIOACTIVE_TVH vj_effect *radioactivetv_init(int w, int h); -void radioactivetv_apply( VJFrame *frame, VJFrame *blue,int width, int height, int bla,int stride, int mode, int thres); +void radioactivetv_apply( VJFrame *frame, VJFrame *blue, int bla,int stride, + int mode, int thres); int radioactivetv_malloc(int w, int h ); void radioactivetv_free(); #endif diff --git a/veejay-current/veejay-server/libvje/effects/randnoise.c b/veejay-current/veejay-server/libvje/effects/randnoise.c index 2bde41e0..0d064fa7 100644 --- a/veejay-current/veejay-server/libvje/effects/randnoise.c +++ b/veejay-current/veejay-server/libvje/effects/randnoise.c @@ -22,11 +22,8 @@ * Add pseudo random noise to image */ -#include -#include -#include -#include #include "common.h" +#include #include "randnoise.h" vj_effect *randnoise_init(int w, int h) @@ -60,7 +57,7 @@ static __thread unsigned long x = 123456789, y = 362436069, z = 521288629; void randnoise_apply( VJFrame *frame, int min, int max) { int i; - const unsigned int len = frame->len; + const int len = frame->len; uint8_t *Y = frame->data[0]; unsigned long t; diff --git a/veejay-current/veejay-server/libvje/effects/randnoise.h b/veejay-current/veejay-server/libvje/effects/randnoise.h index 63214d09..5c1cdb08 100644 --- a/veejay-current/veejay-server/libvje/effects/randnoise.h +++ b/veejay-current/veejay-server/libvje/effects/randnoise.h @@ -20,10 +20,6 @@ #ifndef RANDNOISE_H #define RANDNOISE_H -#include -#include -#include - vj_effect *randnoise_init(int w, int h); void randnoise_apply( VJFrame *frame, int min, int max); #endif diff --git a/veejay-current/veejay-server/libvje/effects/raster.c b/veejay-current/veejay-server/libvje/effects/raster.c index 201bba60..1e1e1e76 100644 --- a/veejay-current/veejay-server/libvje/effects/raster.c +++ b/veejay-current/veejay-server/libvje/effects/raster.c @@ -17,11 +17,9 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 , USA. */ -#include -#include -#include -#include + #include "common.h" +#include #include "raster.h" vj_effect *raster_init(int w, int h) diff --git a/veejay-current/veejay-server/libvje/effects/rawman.c b/veejay-current/veejay-server/libvje/effects/rawman.c index 8cd5df8b..adad501d 100644 --- a/veejay-current/veejay-server/libvje/effects/rawman.c +++ b/veejay-current/veejay-server/libvje/effects/rawman.c @@ -17,12 +17,11 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 , USA. */ -#include -#include -#include -#include + #include "common.h" +#include #include "rawman.h" + vj_effect *rawman_init(int w,int h) { vj_effect *ve = (vj_effect *) vj_calloc(sizeof(vj_effect)); @@ -54,7 +53,7 @@ vj_effect *rawman_init(int w,int h) void rawman_apply(VJFrame *frame, unsigned int mode, unsigned int YY) { - unsigned int len = frame->width * frame->height; + const int len = frame->len; unsigned int i; uint8_t *Y = frame->data[0]; diff --git a/veejay-current/veejay-server/libvje/effects/rawval.c b/veejay-current/veejay-server/libvje/effects/rawval.c index f33529b7..933e51e6 100644 --- a/veejay-current/veejay-server/libvje/effects/rawval.c +++ b/veejay-current/veejay-server/libvje/effects/rawval.c @@ -17,13 +17,11 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 , USA. */ -#include -#include -#include + +#include "common.h" #include #include "rawval.h" -#include -#include + vj_effect *rawval_init(int w,int h) { vj_effect *ve = (vj_effect *) vj_calloc(sizeof(vj_effect)); @@ -57,7 +55,7 @@ void rawval_apply( VJFrame *frame, const int color_cb, const int color_cr, const int new_color_cb, const int new_color_cr) { unsigned int i; - const unsigned int uv_len = (frame->ssm ? frame->len : frame->uv_len); + const int uv_len = (frame->ssm ? frame->len : frame->uv_len); uint8_t *Cb= frame->data[1]; uint8_t *Cr= frame->data[2]; diff --git a/veejay-current/veejay-server/libvje/effects/reflection.c b/veejay-current/veejay-server/libvje/effects/reflection.c index 5fc1ad5b..045d6a1d 100644 --- a/veejay-current/veejay-server/libvje/effects/reflection.c +++ b/veejay-current/veejay-server/libvje/effects/reflection.c @@ -41,14 +41,9 @@ /* orignal code for RGB, define INTENSITY( r + b + g / 3 ), this effect works in YCbCr space now. */ -#include -#include -#include -#include -#include -#include -#include "reflection.h" #include "common.h" +#include +#include "reflection.h" static short reflect_aSin[2048]; static int reflection_map[2048][256]; @@ -120,8 +115,8 @@ void reflection_apply(VJFrame *frame, int index1, int index2, int move) { unsigned int normalx, normaly, x, y; unsigned int lightx, lighty, temp; - const int width = frame->width; - const int height = frame->height; + const unsigned int width = frame->width; + const unsigned int height = frame->height; int uv_height = frame->uv_height; int uv_width = frame->uv_width; uint8_t *row = frame->data[0] + width + 1; diff --git a/veejay-current/veejay-server/libvje/effects/revtv.c b/veejay-current/veejay-server/libvje/effects/revtv.c index 598ff958..59fc9838 100644 --- a/veejay-current/veejay-server/libvje/effects/revtv.c +++ b/veejay-current/veejay-server/libvje/effects/revtv.c @@ -17,12 +17,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 , USA. */ -#include -#include -#include + +#include "common.h" #include #include "revtv.h" -#include "common.h" vj_effect *revtv_init(int max_width, int max_height) { @@ -65,8 +63,8 @@ void revtv_apply(VJFrame *frame, int linespace, int vscale, int color, int color int yval; int uv_width = frame->uv_width; int uv_height = frame->uv_height; - const int height = frame->height; - const int width = frame->width; + const unsigned int height = frame->height; + const unsigned int width = frame->width; int colorCb = bl_pix_get_color_cb(color); int colorCr = bl_pix_get_color_cr(color_num); diff --git a/veejay-current/veejay-server/libvje/effects/rgbchannel.c b/veejay-current/veejay-server/libvje/effects/rgbchannel.c index 9917c40e..ed1ff39a 100644 --- a/veejay-current/veejay-server/libvje/effects/rgbchannel.c +++ b/veejay-current/veejay-server/libvje/effects/rgbchannel.c @@ -17,12 +17,9 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 , USA. */ -#include -#include -#include -#include + +#include "common.h" #include -#include #include #include #include "rgbchannel.h" @@ -55,8 +52,10 @@ vj_effect *rgbchannel_init(int w, int h) return ve; } -void rgbchannel_apply( VJFrame *frame, int width, int height, int chr, int chg , int chb) +void rgbchannel_apply( VJFrame *frame, int chr, int chg , int chb) { + const unsigned int width = frame->width; + const unsigned int height = frame->height; int row_stride = width * 4; int x,y; uint8_t *rgba = frame->data[0]; diff --git a/veejay-current/veejay-server/libvje/effects/rgbchannel.h b/veejay-current/veejay-server/libvje/effects/rgbchannel.h index 1a82ea92..04b10293 100644 --- a/veejay-current/veejay-server/libvje/effects/rgbchannel.h +++ b/veejay-current/veejay-server/libvje/effects/rgbchannel.h @@ -20,10 +20,6 @@ #ifndef RGBCHANNEL_H #define RGBCHANNEL_H -#include -#include -#include - vj_effect *rgbchannel_init(int w, int h); -void rgbchannel_apply( VJFrame *frame, int width, int height, int r, int g, int b); +void rgbchannel_apply( VJFrame *frame, int r, int g, int b); #endif diff --git a/veejay-current/veejay-server/libvje/effects/rgbkey.c b/veejay-current/veejay-server/libvje/effects/rgbkey.c index 76898d7f..1bee6a9a 100644 --- a/veejay-current/veejay-server/libvje/effects/rgbkey.c +++ b/veejay-current/veejay-server/libvje/effects/rgbkey.c @@ -18,16 +18,11 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 , USA. */ -#include -#include -#include -#include +#include "common.h" #include -#include #include #include #include "rgbkey.h" -#include "common.h" extern int yuv_sws_get_cpu_flags(); @@ -209,7 +204,7 @@ void rgbkey_apply(VJFrame *frame, VJFrame *frame2, int tola, int r, int g,int b, uint8_t *Cr2= frame2->data[2]; uint8_t *A = frame->data[3]; uint8_t *B = frame2->data[3]; - const unsigned int len = frame->len; + const int len = frame->len; int iy=0,iu=128,iv=128; uint8_t *T = temp[0]; uint8_t op0,op1; diff --git a/veejay-current/veejay-server/libvje/effects/rgbkeysmooth.c b/veejay-current/veejay-server/libvje/effects/rgbkeysmooth.c index 7a851d21..3ad04759 100644 --- a/veejay-current/veejay-server/libvje/effects/rgbkeysmooth.c +++ b/veejay-current/veejay-server/libvje/effects/rgbkeysmooth.c @@ -17,13 +17,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 , USA. */ -#include -#include -#include -#include + +#include "common.h" #include #include "rgbkeysmooth.h" -#include "common.h" vj_effect *rgbkeysmooth_init(int w,int h) { diff --git a/veejay-current/veejay-server/libvje/effects/ripple.c b/veejay-current/veejay-server/libvje/effects/ripple.c index 2967fbca..6f8418d0 100644 --- a/veejay-current/veejay-server/libvje/effects/ripple.c +++ b/veejay-current/veejay-server/libvje/effects/ripple.c @@ -28,12 +28,8 @@ */ -#include -#include -#include -#include -#include #include "common.h" +#include #include "ripple.h" #define RIPPLE_DEGREES 360 @@ -116,8 +112,8 @@ void ripple_free() { void ripple_apply(VJFrame *frame, int _w, int _a , int _att ) { - const int width = frame->width; - const int height = frame->height; + const unsigned int width = frame->width; + const unsigned int height = frame->height; const int len = frame->len; double wp2 = width * 0.5; double hp2 = height * 0.5; diff --git a/veejay-current/veejay-server/libvje/effects/ripple.h b/veejay-current/veejay-server/libvje/effects/ripple.h index b68f1f9e..961a0dfb 100644 --- a/veejay-current/veejay-server/libvje/effects/ripple.h +++ b/veejay-current/veejay-server/libvje/effects/ripple.h @@ -20,11 +20,6 @@ #ifndef RIPPLE_H #define RIPPLE_H -#include -#include -#include -#include - vj_effect *ripple_init(int w, int h); void ripple_free(); int ripple_malloc(int w, int h); diff --git a/veejay-current/veejay-server/libvje/effects/rotozoom.c b/veejay-current/veejay-server/libvje/effects/rotozoom.c index 55a5e217..3262f43a 100644 --- a/veejay-current/veejay-server/libvje/effects/rotozoom.c +++ b/veejay-current/veejay-server/libvje/effects/rotozoom.c @@ -19,14 +19,9 @@ */ /* distortion effects */ -#include -#include -#include -#include -#include +#include "common.h" #include #include "rotozoom.h" -#include "common.h" static int *test_roto[9]; static int *test_roto2[9]; @@ -226,8 +221,8 @@ static void rotozoom1_apply(VJFrame *frame, uint8_t *data[3], int w, int h, void rotozoom_apply( VJFrame *frame, int mode, int rotate, int zoom, int autom) { - int width = frame->width; - int height = frame->height; + const unsigned int width = frame->width; + const unsigned int height = frame->height; const int len = frame->len; int strides[4] = {len ,len ,len ,0}; switch (autom) { /* alas must do memcpy */ diff --git a/veejay-current/veejay-server/libvje/effects/scratcher.c b/veejay-current/veejay-server/libvje/effects/scratcher.c index adbc3276..abc9b060 100644 --- a/veejay-current/veejay-server/libvje/effects/scratcher.c +++ b/veejay-current/veejay-server/libvje/effects/scratcher.c @@ -18,15 +18,10 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 , USA. */ -#include -#include -#include -#include -#include -#include -#include "scratcher.h" #include "common.h" -#include "opacity.h" +#include +#include "opacity.h" +#include "scratcher.h" static uint8_t *frame[4] = { NULL,NULL,NULL,NULL }; static int nframe = 0; @@ -131,7 +126,7 @@ static void store_frame(VJFrame *src, int n, int no_reverse) void scratcher_apply(VJFrame *src,int opacity, int n, int no_reverse) { - const unsigned int len = src->len; + const int len = src->len; const int offset = len * nframe; const int uv_len = src->uv_len; const int uv_offset = uv_len * nframe; diff --git a/veejay-current/veejay-server/libvje/effects/sinoids.c b/veejay-current/veejay-server/libvje/effects/sinoids.c index afee3e92..5226b855 100644 --- a/veejay-current/veejay-server/libvje/effects/sinoids.c +++ b/veejay-current/veejay-server/libvje/effects/sinoids.c @@ -18,14 +18,9 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 , USA. */ - -#include -#include -#include -#include -#include -#include "sinoids.h" #include "common.h" +#include +#include "sinoids.h" static int *sinoids_X = NULL; static uint8_t *sinoid_frame[3] = { NULL,NULL,NULL }; @@ -105,9 +100,11 @@ static void sinoids_recalc(int width, int z) { } static int current_sinoids = 100; -void sinoids_apply(VJFrame *frame, int m, int s) { + +void sinoids_apply(VJFrame *frame, int m, int s) +{ const int len = frame->len; - const int width = frame->width; + const unsigned int width = frame->width; unsigned int r,c; uint8_t *Y = frame->data[0]; uint8_t *Cb= frame->data[1]; diff --git a/veejay-current/veejay-server/libvje/effects/sinoids.h b/veejay-current/veejay-server/libvje/effects/sinoids.h index f9af98d7..a0b36873 100644 --- a/veejay-current/veejay-server/libvje/effects/sinoids.h +++ b/veejay-current/veejay-server/libvje/effects/sinoids.h @@ -20,13 +20,8 @@ #ifndef SINOIDS_H #define SINOIDS_H -#include -#include -#include - vj_effect *sinoids_init(int w, int h); void sinoids_free(); int sinoids_malloc(int w, int h); void sinoids_apply(VJFrame *frame, int a,int b); - #endif diff --git a/veejay-current/veejay-server/libvje/effects/slice.c b/veejay-current/veejay-server/libvje/effects/slice.c index 172ea1b6..87ed67d3 100644 --- a/veejay-current/veejay-server/libvje/effects/slice.c +++ b/veejay-current/veejay-server/libvje/effects/slice.c @@ -17,12 +17,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 , USA. */ -#include -#include -#include -#include "slice.h" -#include + #include "common.h" +#include +#include "slice.h" static uint8_t *slice_frame[4] = { NULL,NULL,NULL,NULL }; static int *slice_xshift = NULL; @@ -117,13 +115,13 @@ int current_period = 0; void slice_apply(VJFrame *frame, int val, int re_init) { unsigned int x,y,dx,dy; - const int width = frame->width; - const int height = frame->height; + const unsigned int width = frame->width; + const unsigned int height = frame->height; const int len = frame->len; uint8_t *Y = frame->data[0]; uint8_t *Cb= frame->data[1]; uint8_t *Cr= frame->data[2]; - uint8_t *A = frame->data[3]; + uint8_t *A = frame->data[3]; int interpolate = 1; int tmp1 = val; diff --git a/veejay-current/veejay-server/libvje/effects/slice.h b/veejay-current/veejay-server/libvje/effects/slice.h index c9c57741..2c4159a4 100644 --- a/veejay-current/veejay-server/libvje/effects/slice.h +++ b/veejay-current/veejay-server/libvje/effects/slice.h @@ -20,11 +20,6 @@ #ifndef SLICE_H #define SLICE_H -#include -#include -#include -#include - vj_effect *slice_init(int width, int height); int slice_malloc(int width, int height); void slice_free(); diff --git a/veejay-current/veejay-server/libvje/effects/slicer.c b/veejay-current/veejay-server/libvje/effects/slicer.c index 3268e9a8..12cf51bf 100644 --- a/veejay-current/veejay-server/libvje/effects/slicer.c +++ b/veejay-current/veejay-server/libvje/effects/slicer.c @@ -17,15 +17,11 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 , USA. */ - -#include -#include -#include -#include -#include -#include + #include "common.h" +#include #include "slicer.h" + static int *slice_xshift = NULL; static int *slice_yshift = NULL; static int last_period = -1; @@ -119,9 +115,9 @@ vj_effect *slicer_init(int w, int h) void slicer_apply( VJFrame *frame, VJFrame *frame2, int val1, int val2,int shatter, int period, int mode) { int x,y,p,q; - const int width = frame->width; - const int height = frame->height; - const unsigned int len = frame->len; + const unsigned int width = frame->width; + const unsigned int height = frame->height; + const int len = frame->len; uint8_t *Y = frame->data[0]; uint8_t *Cb= frame->data[1]; uint8_t *Cr= frame->data[2]; diff --git a/veejay-current/veejay-server/libvje/effects/smear.c b/veejay-current/veejay-server/libvje/effects/smear.c index fd752d86..27c85bec 100644 --- a/veejay-current/veejay-server/libvje/effects/smear.c +++ b/veejay-current/veejay-server/libvje/effects/smear.c @@ -18,11 +18,8 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 , USA. */ -#include -#include -#include -#include #include "common.h" +#include #include "smear.h" vj_effect *smear_init(int w, int h) diff --git a/veejay-current/veejay-server/libvje/effects/smuck.c b/veejay-current/veejay-server/libvje/effects/smuck.c index fc8122f7..a8fa2368 100644 --- a/veejay-current/veejay-server/libvje/effects/smuck.c +++ b/veejay-current/veejay-server/libvje/effects/smuck.c @@ -17,12 +17,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 , USA. */ -#include -#include -#include + +#include "common.h" #include #include "smuck.h" -#include "common.h" static int smuck_rand_val; @@ -56,8 +54,8 @@ static inline unsigned int smuck_fastrand() */ void smuck_apply( VJFrame *frame, VJFrame *frame2, int n) { - const int width = frame->width; - const int height = frame->height; + const unsigned int width = frame->width; + const unsigned int height = frame->height; unsigned int yd, xd, x, y; // different table ... const unsigned int smuck[18] = diff --git a/veejay-current/veejay-server/libvje/effects/softblur.c b/veejay-current/veejay-server/libvje/effects/softblur.c index cfad609a..6c313f33 100644 --- a/veejay-current/veejay-server/libvje/effects/softblur.c +++ b/veejay-current/veejay-server/libvje/effects/softblur.c @@ -17,12 +17,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 , USA. */ -#include -#include -#include + +#include "common.h" #include #include "softblur.h" -#include "common.h" vj_effect *softblur_init(int w,int h) { diff --git a/veejay-current/veejay-server/libvje/effects/solarize.c b/veejay-current/veejay-server/libvje/effects/solarize.c index 736b4d53..740579ef 100644 --- a/veejay-current/veejay-server/libvje/effects/solarize.c +++ b/veejay-current/veejay-server/libvje/effects/solarize.c @@ -1,3 +1,4 @@ + /* * Linux VeeJay * @@ -17,12 +18,11 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 , USA. */ -#include -#include -#include + +#include "common.h" #include #include "solarize.h" -#include + vj_effect *solarize_init(int w,int h) { vj_effect *ve = (vj_effect *) vj_calloc(sizeof(vj_effect)); @@ -46,7 +46,8 @@ vj_effect *solarize_init(int w,int h) void solarize_apply( VJFrame *frame, int threshold) { - int i, len= frame->len; + unsigned int i; + const int len= frame->len; uint8_t val; uint8_t *Y = frame->data[0]; uint8_t *Cb= frame->data[1]; diff --git a/veejay-current/veejay-server/libvje/effects/split.c b/veejay-current/veejay-server/libvje/effects/split.c index 3d3cd63d..65592a93 100644 --- a/veejay-current/veejay-server/libvje/effects/split.c +++ b/veejay-current/veejay-server/libvje/effects/split.c @@ -15,12 +15,11 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 , USA. */ -#include -#include -#include + +#include "common.h" #include #include "split.h" -#include "common.h" + static uint8_t *split_buf[4] = { NULL,NULL,NULL, NULL }; vj_effect *split_init(int width,int height) @@ -66,8 +65,8 @@ void split_free() { static void split_fib_downscale(VJFrame *frame, int width, int height) { - unsigned int i, len = frame->len/2; - unsigned int f; + int i, len = frame->len/2; + int f; unsigned int x, y; int uv_width; const int ilen = frame->len; @@ -105,7 +104,7 @@ static void split_fib_downscale(VJFrame *frame, int width, int height) static void split_fib_downscaleb(VJFrame *frame, int width, int height) { - unsigned int len = frame->len / 2; + int len = frame->len / 2; unsigned int uv_len = frame->uv_len /2; uint8_t *Y = frame->data[0]; uint8_t *Cb = frame->data[1]; @@ -125,11 +124,11 @@ static void split_fib_downscaleb(VJFrame *frame, int width, int height) static void dosquarefib(VJFrame *frame, int width, int height) { - unsigned int i, len = frame->len / 2; - unsigned int f; - unsigned int x, y, y1, y2; - unsigned int uv_len = frame->uv_len; - unsigned int uv_width = frame->uv_width; + int i, len = frame->len / 2; + int f; + int x, y, y1, y2; + int uv_len = frame->uv_len; + int uv_width = frame->uv_width; const unsigned int uv_height = frame->uv_height; unsigned int w3 = width >> 2; const unsigned int u_w3 = w3 >> frame->shift_h; @@ -205,7 +204,7 @@ static void dosquarefib(VJFrame *frame, int width, int height) static void split_push_downscale_uh(VJFrame *frame, int width, int height) { - unsigned int len = frame->len/2; + int len = frame->len/2; int strides[4] = { len,len,len ,0}; vj_frame_copy( frame->data, split_buf,strides ); @@ -594,7 +593,8 @@ static void split_v_first_half(VJFrame *frame, VJFrame *frame2, int width, static void split_v_second_halfs(VJFrame *frame, VJFrame *frame2, int width, int height) { - unsigned int r, c; + int r; + unsigned int c; const int lw = width / 2; const int len = frame->len; const int uv_height = frame->uv_height; @@ -639,8 +639,8 @@ static void split_h_first_half(VJFrame *frame, VJFrame *frame2, int width, static void split_h_second_half(VJFrame *frame, VJFrame *frame2, int width, int height) { - const unsigned int len = frame->len / 2; - const unsigned int uv_len = frame->uv_len / 2; + const int len = frame->len / 2; + const int uv_len = frame->uv_len / 2; int strides[4] = { len, uv_len, uv_len, 0 }; vj_frame_copy( frame2->data,frame->data, strides ); } @@ -648,8 +648,8 @@ static void split_h_second_half(VJFrame *frame, VJFrame *frame2, int width, static void split_h_first_halfs(VJFrame *frame, VJFrame *frame2, int width, int height) { - const unsigned int len = frame->len / 2; - const unsigned int uv_len = frame->uv_len / 2; + const int len = frame->len / 2; + const int uv_len = frame->uv_len / 2; int strides[4] = { len,uv_len,uv_len, 0 }; vj_frame_copy( frame2->data, frame->data, strides ); } @@ -657,8 +657,8 @@ static void split_h_first_halfs(VJFrame *frame, VJFrame *frame2, int width, static void split_h_second_halfs(VJFrame *frame, VJFrame *frame2, int width, int height) { - const unsigned int len = frame->len / 2; - const unsigned int uv_len = frame->uv_len / 2; + const int len = frame->len / 2; + const int uv_len = frame->uv_len / 2; int strides[4] = { len, uv_len, uv_len, 0 }; vj_frame_copy( frame2->data, frame->data, strides ); } diff --git a/veejay-current/veejay-server/libvje/effects/swirl.c b/veejay-current/veejay-server/libvje/effects/swirl.c index a99a160a..188a5b6a 100644 --- a/veejay-current/veejay-server/libvje/effects/swirl.c +++ b/veejay-current/veejay-server/libvje/effects/swirl.c @@ -17,14 +17,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 , USA. */ -#include -#include -#include -#include -#include "swirl.h" -#include + #include "common.h" -#include +#include +#include "swirl.h" vj_effect *swirl_init(int w, int h) { @@ -108,9 +104,11 @@ void swirl_free() static int _v = 0; -void swirl_apply(VJFrame *frame, int w, int h, int v) +void swirl_apply(VJFrame *frame, int v) { int i; + const unsigned int width = frame->width; + const unsigned int height = frame->height; const int len = frame->len; uint8_t *Y = frame->data[0]; uint8_t *Cb= frame->data[1]; @@ -118,55 +116,52 @@ void swirl_apply(VJFrame *frame, int w, int h, int v) if( v != _v ) { - //const double curve = (double) v; - const unsigned int R = w; - const double coeef = v; - //const double coeef = R / log(curve * R + 1); - //const double coeef = R / log( curve * R + 2); - /* pre calculate */ - int px,py; - double r,a; - double si,co; - const int w2 = w/2; - const int h2 = h/2; - - for(i=0; i < len; i++) - { - r = polar_map[i]; - a = fish_angle[i]; - if(r <= R) - { + //const double curve = (double) v; + const unsigned int R = width; + const double coeef = v; + //const double coeef = R / log(curve * R + 1); + //const double coeef = R / log( curve * R + 2); + /* pre calculate */ + int px,py; + double r,a; + double si,co; + const int w2 = width/2; + const int h2 = height/2; + + for(i=0; i < len; i++) + { + r = polar_map[i]; + a = fish_angle[i]; + if(r <= R) + { //uncomment for simple fisheye //p_y = a; //p_r = (r*r)/R; //sin_cos( co, si, p_y ); - sin_cos( co,si, (a+r/coeef)); - px = (int) ( r * co ); - py = (int) ( r * si ); + sin_cos( co,si, (a+r/coeef)); + px = (int) ( r * co ); + py = (int) ( r * si ); //sin_cos( co, si, (double)v ); //px = (int) (r * co); //py = (int) (r * si); //px = (int) ( p_r * co); //py = (int) ( p_r * si); - px += w2; - py += h2; + px += w2; + py += h2; - if(px < 0) px =0; - if(px > w) px = w; - if(py < 0) py = 0; - if(py >= (h-1)) py = h-1; - - cached_coords[i] = (py * w)+px; - - } - else - { - cached_coords[i] = -1; - - } - } - _v = v; + if(px < 0) px =0; + if(px > width) px = width; + if(py < 0) py = 0; + if(py >= (height-1)) py = height-1; + cached_coords[i] = (py * width)+px; + } + else + { + cached_coords[i] = -1; + } + } + _v = v; } int strides[4] = { len, len, len , 0 }; @@ -176,13 +171,12 @@ void swirl_apply(VJFrame *frame, int w, int h, int v) { if(cached_coords[i] == -1) { - Y[i] = pixel_Y_lo_; + Y[i] = pixel_Y_lo_; Cb[i] = 128; Cr[i] = 128; } else { - Y[i] = Y[ cached_coords[i] ]; Cb[i] = Cb[ cached_coords[i] ]; Cr[i] = Cr[ cached_coords[i] ]; diff --git a/veejay-current/veejay-server/libvje/effects/swirl.h b/veejay-current/veejay-server/libvje/effects/swirl.h index ad286c81..2bcb07e9 100644 --- a/veejay-current/veejay-server/libvje/effects/swirl.h +++ b/veejay-current/veejay-server/libvje/effects/swirl.h @@ -20,12 +20,8 @@ #ifndef SWIRL_H #define SWIRL_H -#include -#include -#include - vj_effect *swirl_init(int w, int h); int swirl_malloc(int w, int h); void swirl_free(); -void swirl_apply(VJFrame *frame, int width, int height, int val); +void swirl_apply(VJFrame *frame, int val); #endif diff --git a/veejay-current/veejay-server/libvje/effects/threshold.c b/veejay-current/veejay-server/libvje/effects/threshold.c index 4fdc5cd4..c2f09a4b 100644 --- a/veejay-current/veejay-server/libvje/effects/threshold.c +++ b/veejay-current/veejay-server/libvje/effects/threshold.c @@ -17,14 +17,11 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 , USA. */ -#include -#include -#include -#include -#include -#include "threshold.h" + #include "common.h" +#include #include "softblur.h" +#include "threshold.h" typedef int (*morph_func)(uint8_t *kernel, uint8_t mt[9] ); @@ -75,17 +72,18 @@ void threshold_free(void) #define MAX(a,b) ( (a)>(b) ? (a) : (b) ) #endif -void threshold_apply( VJFrame *frame, VJFrame *frame2,int width, int height, int threshold, int reverse ) +void threshold_apply( VJFrame *frame, VJFrame *frame2, int threshold, int reverse ) { unsigned int y,x; - uint8_t *Y = frame->data[0]; + const unsigned int width = frame->width; + const unsigned int height = frame->height; + const int len = frame->len; + uint8_t *Y = frame->data[0]; uint8_t *Cb = frame->data[1]; uint8_t *Cr = frame->data[2]; uint8_t *Y2 = frame2->data[0]; uint8_t *Cb2=frame2->data[1]; uint8_t *Cr2=frame2->data[2]; - - int len = frame->len; softblur_apply( frame, 0); binarify_1src( binary_img,Y,threshold,0, width,height); diff --git a/veejay-current/veejay-server/libvje/effects/threshold.h b/veejay-current/veejay-server/libvje/effects/threshold.h index 3a5e4df5..2268f7c8 100644 --- a/veejay-current/veejay-server/libvje/effects/threshold.h +++ b/veejay-current/veejay-server/libvje/effects/threshold.h @@ -21,7 +21,7 @@ #ifndef THRESHOLD_H #define THRESHOLD_H vj_effect *threshold_init(int w, int h); -void threshold_apply( VJFrame *frame,VJFrame *frame2, int width, int height, int t, int n); -int threshold_malloc(int w, int h); -void threshold_free(void); +void threshold_apply( VJFrame *frame,VJFrame *frame2, int t, int n); +int threshold_malloc(int w, int h); +void threshold_free(void); #endif diff --git a/veejay-current/veejay-server/libvje/effects/timedistort.c b/veejay-current/veejay-server/libvje/effects/timedistort.c index 1cf02a89..a9c4734e 100644 --- a/veejay-current/veejay-server/libvje/effects/timedistort.c +++ b/veejay-current/veejay-server/libvje/effects/timedistort.c @@ -25,14 +25,11 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 , USA. */ -#include -#include -#include -#include -#include -#include "timedistort.h" #include "common.h" +#include #include "softblur.h" +#include "timedistort.h" + #define PLANES 32 vj_effect *timedistort_init(int w, int h) @@ -129,10 +126,12 @@ void timedistort_free() nonmap = NULL; } -void timedistort_apply( VJFrame *frame, int width, int height, int val) +void timedistort_apply( VJFrame *frame, int val) { unsigned int i; - const int len = (width * height); + const unsigned int width = frame->width; + const unsigned int height = frame->height; + const int len = frame->len; uint8_t *Y = frame->data[0]; uint8_t *Cb = frame->data[1]; diff --git a/veejay-current/veejay-server/libvje/effects/timedistort.h b/veejay-current/veejay-server/libvje/effects/timedistort.h index 308fe128..43ab50e0 100644 --- a/veejay-current/veejay-server/libvje/effects/timedistort.h +++ b/veejay-current/veejay-server/libvje/effects/timedistort.h @@ -21,7 +21,7 @@ #ifndef TIMEDISTORT_H #define TIMEDISTORT_H vj_effect *timedistort_init(int w, int h); -void timedistort_apply( VJFrame *frame, int width, int height, int val); +void timedistort_apply( VJFrame *frame, int val); int timedistort_malloc(int w, int h); void timedistort_free(); #endif diff --git a/veejay-current/veejay-server/libvje/effects/toalpha.c b/veejay-current/veejay-server/libvje/effects/toalpha.c index 19d0ab15..a16663a7 100644 --- a/veejay-current/veejay-server/libvje/effects/toalpha.c +++ b/veejay-current/veejay-server/libvje/effects/toalpha.c @@ -17,11 +17,9 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 , USA. */ -#include -#include -#include -#include + #include "common.h" +#include #include "toalpha.h" static int __lookup_table[256]; @@ -56,9 +54,9 @@ vj_effect *toalpha_init(int w, int h) } -void toalpha_apply( VJFrame *frame, int width, int height, int mode) +void toalpha_apply( VJFrame *frame, int mode) { - int len = frame->len; + const int len = frame->len; uint8_t *a = frame->data[3]; uint8_t *Y = frame->data[0]; diff --git a/veejay-current/veejay-server/libvje/effects/toalpha.h b/veejay-current/veejay-server/libvje/effects/toalpha.h index 3862cdec..6dc2f0d0 100644 --- a/veejay-current/veejay-server/libvje/effects/toalpha.h +++ b/veejay-current/veejay-server/libvje/effects/toalpha.h @@ -20,10 +20,6 @@ #ifndef TOALPHA_H #define TOALPHA_H -#include -#include -#include - vj_effect *toalpha_init(int w, int h); -void toalpha_apply( VJFrame *frame, int width, int height,int mode); +void toalpha_apply( VJFrame *frame, int mode); #endif diff --git a/veejay-current/veejay-server/libvje/effects/tracer.c b/veejay-current/veejay-server/libvje/effects/tracer.c index 41ce475d..28554a5f 100644 --- a/veejay-current/veejay-server/libvje/effects/tracer.c +++ b/veejay-current/veejay-server/libvje/effects/tracer.c @@ -17,13 +17,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 , USA. */ -#include -#include -#include -#include + +#include "common.h" #include #include "tracer.h" -#include "common.h" static uint8_t *trace_buffer[4] = { NULL,NULL,NULL,NULL}; static int trace_counter = 0; @@ -68,7 +65,8 @@ void tracer_free() { void tracer_apply(VJFrame *frame, VJFrame *frame2, int opacity, int n) { - unsigned int x, len = frame->len; + unsigned int x; + const int len = frame->len; unsigned int op1 = (opacity > 255) ? 255 : opacity; unsigned int op0 = 255 - op1; unsigned int uv_len = frame->uv_len; diff --git a/veejay-current/veejay-server/libvje/effects/transform.c b/veejay-current/veejay-server/libvje/effects/transform.c index 20152cbd..56330fbd 100644 --- a/veejay-current/veejay-server/libvje/effects/transform.c +++ b/veejay-current/veejay-server/libvje/effects/transform.c @@ -17,12 +17,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 , USA. */ -#include -#include -#include + +#include "common.h" #include #include "transform.h" -#include "common.h" vj_effect *transform_init(int width,int height) { @@ -52,8 +50,8 @@ void transform_apply(VJFrame *frame, VJFrame *frame2, const int size) unsigned int ty, tx, y, x; const unsigned int uv_height = frame->uv_height; const unsigned int uv_width = frame->uv_width; - const int width = frame->width; - const int height = frame->height; + const unsigned int width = frame->width; + const unsigned int height = frame->height; uint8_t *Y = frame->data[0]; uint8_t *Cb= frame->data[1]; uint8_t *Cr= frame->data[2]; diff --git a/veejay-current/veejay-server/libvje/effects/travelmatte.c b/veejay-current/veejay-server/libvje/effects/travelmatte.c index e759baa4..eb33478d 100644 --- a/veejay-current/veejay-server/libvje/effects/travelmatte.c +++ b/veejay-current/veejay-server/libvje/effects/travelmatte.c @@ -17,11 +17,9 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 , USA. */ -#include -#include -#include -#include + #include "common.h" +#include #include "travelmatte.h" vj_effect *travelmatte_init(int w, int h) @@ -45,13 +43,13 @@ vj_effect *travelmatte_init(int w, int h) } -void travelmatte_apply( VJFrame *frame, VJFrame *frame2, int width, int height, int mode) +void travelmatte_apply( VJFrame *frame, VJFrame *frame2, int mode) { - const unsigned int len = frame->len; + const int len = frame->len; - uint8_t *a0 = frame->data[0]; - uint8_t *a1 = frame->data[1]; - uint8_t *a2 = frame->data[2]; + uint8_t *a0 = frame->data[0]; + uint8_t *a1 = frame->data[1]; + uint8_t *a2 = frame->data[2]; uint8_t *aA = frame->data[3]; uint8_t *o0 = frame->data[0]; diff --git a/veejay-current/veejay-server/libvje/effects/travelmatte.h b/veejay-current/veejay-server/libvje/effects/travelmatte.h index e2f92e0d..63b222ee 100644 --- a/veejay-current/veejay-server/libvje/effects/travelmatte.h +++ b/veejay-current/veejay-server/libvje/effects/travelmatte.h @@ -20,11 +20,7 @@ #ifndef TRAVELMATTE_H #define TRAVELMATTE_H -#include -#include -#include - vj_effect *travelmatte_init(int w, int h); -void travelmatte_apply( VJFrame *frame, VJFrame *frame2, int width,int height, int mode); +void travelmatte_apply( VJFrame *frame, VJFrame *frame2, int mode); void travelmatte_free(); #endif diff --git a/veejay-current/veejay-server/libvje/effects/tripplicity.c b/veejay-current/veejay-server/libvje/effects/tripplicity.c index a96097f2..25dabc99 100644 --- a/veejay-current/veejay-server/libvje/effects/tripplicity.c +++ b/veejay-current/veejay-server/libvje/effects/tripplicity.c @@ -23,10 +23,11 @@ Result will vary over different color spaces. */ -#include -#include + +#include "common.h" #include #include "tripplicity.h" + vj_effect *tripplicity_init(int w, int h) { vj_effect *ve = (vj_effect *) vj_calloc(sizeof(vj_effect)); @@ -56,12 +57,11 @@ vj_effect *tripplicity_init(int w, int h) -void tripplicity_apply( VJFrame *frame, VJFrame *frame2, int width, - int height, int opacityL, int opacityCb, int opacityCr) +void tripplicity_apply( VJFrame *frame, VJFrame *frame2, int opacityL, int opacityCb, int opacityCr) { unsigned int i; - const unsigned int len = frame->len; - const unsigned int uv_len = (frame->ssm ? frame->len : frame->uv_len); + const int len = frame->len; + const int uv_len = (frame->ssm ? len : frame->uv_len); uint8_t *Y = frame->data[0]; uint8_t *Cb= frame->data[1]; uint8_t *Cr= frame->data[2]; @@ -75,7 +75,6 @@ void tripplicity_apply( VJFrame *frame, VJFrame *frame2, int width, const uint8_t opCr1= (opacityCr > 255) ? 255: opacityCr; const uint8_t opCr0= 255 - opCr1; - for (i = 0; i < len; i++) { Y[i] = (op0 * Y[i] + op1 * Y2[i]) >> 8; diff --git a/veejay-current/veejay-server/libvje/effects/tripplicity.h b/veejay-current/veejay-server/libvje/effects/tripplicity.h index 3a8245a9..2d22afdf 100644 --- a/veejay-current/veejay-server/libvje/effects/tripplicity.h +++ b/veejay-current/veejay-server/libvje/effects/tripplicity.h @@ -20,11 +20,6 @@ #ifndef TRCITY_H #define TRCITY_H -#include -#include -#include - vj_effect *tripplicity_init(); -void tripplicity_apply( VJFrame *frame, VJFrame *frame2, int width, - int height, int opacityL, int opacityCb, int opacityCr); +void tripplicity_apply( VJFrame *frame, VJFrame *frame2, int opacityL, int opacityCb, int opacityCr); #endif diff --git a/veejay-current/veejay-server/libvje/effects/uvcorrect.c b/veejay-current/veejay-server/libvje/effects/uvcorrect.c index ef5f68e2..209b7b42 100644 --- a/veejay-current/veejay-server/libvje/effects/uvcorrect.c +++ b/veejay-current/veejay-server/libvje/effects/uvcorrect.c @@ -36,13 +36,9 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include -#include -#include +#include "common.h" #include #include "uvcorrect.h" -#include "common.h" -#include static uint8_t *chrominance = NULL; @@ -121,7 +117,8 @@ static inline void _chrominance_treatment(uint8_t *u,uint8_t *v, const int len) } -void uvcorrect_apply(VJFrame *frame, int width, int height, int angle, int urot_center, int vrot_center, int iuFactor, int ivFactor, int uv_min, int uv_max ) +void uvcorrect_apply(VJFrame *frame, int angle, int urot_center, int vrot_center, + int iuFactor, int ivFactor, int uv_min, int uv_max ) { float fU,fV,si,co; uint16_t iU,iV; diff --git a/veejay-current/veejay-server/libvje/effects/uvcorrect.h b/veejay-current/veejay-server/libvje/effects/uvcorrect.h index 715474d9..87f2aa1a 100644 --- a/veejay-current/veejay-server/libvje/effects/uvcorrect.h +++ b/veejay-current/veejay-server/libvje/effects/uvcorrect.h @@ -20,14 +20,9 @@ #ifndef UVCORRECT_H #define UVCORRECT_H -#include -#include -#include - vj_effect *uvcorrect_init(int w, int h); int uvcorrect_malloc(int w, int h); void uvcorrect_free(void); -void uvcorrect_apply(VJFrame *frame, int width, int height, - int alpha, int ualpha, int valpha, int uf, - int vf, int min, int max ); +void uvcorrect_apply(VJFrame *frame, int alpha, int ualpha, int valpha, int uf, + int vf, int min, int max ); #endif diff --git a/veejay-current/veejay-server/libvje/effects/videoplay.c b/veejay-current/veejay-server/libvje/effects/videoplay.c index e5928afc..1b42fe03 100644 --- a/veejay-current/veejay-server/libvje/effects/videoplay.c +++ b/veejay-current/veejay-server/libvje/effects/videoplay.c @@ -18,11 +18,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 , USA. */ -#include -#include + +#include "common.h" #include #include "videoplay.h" -#include "common.h" vj_effect *videoplay_init(int w, int h) { @@ -202,9 +201,11 @@ static void put_video( uint8_t *dst_plane, uint8_t *video, int dst_w, int dst_h, } } -void videoplay_apply( VJFrame *frame, VJFrame *B, int width, int height, int size, int delay, int mode ) +void videoplay_apply( VJFrame *frame, VJFrame *B, int size, int delay, int mode ) { unsigned int i; + const unsigned int width = frame->width; + const unsigned int height = frame->height; uint8_t *dstY = frame->data[0]; uint8_t *dstU = frame->data[1]; uint8_t *dstV = frame->data[2]; diff --git a/veejay-current/veejay-server/libvje/effects/videoplay.h b/veejay-current/veejay-server/libvje/effects/videoplay.h index 59a80fa1..f182ac90 100644 --- a/veejay-current/veejay-server/libvje/effects/videoplay.h +++ b/veejay-current/veejay-server/libvje/effects/videoplay.h @@ -20,12 +20,8 @@ #ifndef VIDEOPLAY_H #define VIDEOPLAY_H -#include -#include -#include - vj_effect *videoplay_init(int w, int h); int videoplay_malloc(int w, int h); void videoplay_free(void); -void videoplay_apply( VJFrame *frame, VJFrame *b,int width, int height, int size, int behaviour, int mode); +void videoplay_apply( VJFrame *frame, VJFrame *b, int size, int behaviour, int mode); #endif diff --git a/veejay-current/veejay-server/libvje/effects/videowall.c b/veejay-current/veejay-server/libvje/effects/videowall.c index 6052fc7c..fc8d41db 100644 --- a/veejay-current/veejay-server/libvje/effects/videowall.c +++ b/veejay-current/veejay-server/libvje/effects/videowall.c @@ -17,11 +17,11 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 , USA. */ -#include -#include + +#include "common.h" #include #include "videowall.h" -#include "common.h" + static inline int gcd(int p, int q ) { if(q==0) return p; else return(gcd(q,p%q)); } static inline int n_pics(int w, int h) @@ -214,9 +214,11 @@ static void put_photo( uint8_t *dst_plane, uint8_t *photo, int dst_w, int dst_h, } } -void videowall_apply( VJFrame *frameA, VJFrame *frameB, int width, int height, int a,int b, int c, int d ) +void videowall_apply( VJFrame *frameA, VJFrame *frameB, int a,int b, int c, int d ) { unsigned int i; + const unsigned int width = frameA->width; + const unsigned int height = frameA->height; uint8_t *dstY = frameA->data[0]; uint8_t *dstU = frameA->data[1]; uint8_t *dstV = frameA->data[2]; @@ -225,14 +227,14 @@ void videowall_apply( VJFrame *frameA, VJFrame *frameB, int width, int height, i { offset_table_x[a] = b; offset_table_y[a] = c; - } + } for( i = 0; i < 3; i ++ ) { take_photo( frameA->data[i], photo_list[(frame_counter%num_photos)]->data[i], width, height , frame_counter % num_photos); } frame_counter++; - + for( i = 0; i < 3; i ++ ) { take_photo( frameB->data[i], photo_list[(frame_counter%num_photos)]->data[i], width, height , frame_counter % num_photos); diff --git a/veejay-current/veejay-server/libvje/effects/videowall.h b/veejay-current/veejay-server/libvje/effects/videowall.h index ab9e5ba3..cde4552a 100644 --- a/veejay-current/veejay-server/libvje/effects/videowall.h +++ b/veejay-current/veejay-server/libvje/effects/videowall.h @@ -20,13 +20,8 @@ #ifndef VIDEOWALL_H #define VIDEOWALL_H -#include -#include -#include - vj_effect *videowall_init(int w, int h); int videowall_malloc(int w, int h); void videowall_free(void); -void videowall_apply( VJFrame *frameA, VJFrame *frameB,int width, int height, - int a, int b , int c, int d); +void videowall_apply( VJFrame *frameA, VJFrame *frameB, int a, int b , int c, int d); #endif diff --git a/veejay-current/veejay-server/libvje/effects/water.c b/veejay-current/veejay-server/libvje/effects/water.c index 8b23ec4e..13e9f34a 100644 --- a/veejay-current/veejay-server/libvje/effects/water.c +++ b/veejay-current/veejay-server/libvje/effects/water.c @@ -22,12 +22,8 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 , USA. */ -#include -#include -#include -#include -#include #include "common.h" +#include #include "softblur.h" #include "water.h" @@ -142,9 +138,7 @@ vj_effect *water_init(int width, int height) #define HIS_DEFAULT 2 static uint32_t histogram_[HIS_LEN]; -static int n__ = 0; -static uint32_t keyv_ = 0; -static uint32_t keyp_ = 0; + int water_malloc(void **d, int width, int height) { *d = (void*) vj_calloc(sizeof(water_t)); @@ -221,6 +215,9 @@ static void drawmotionframe( VJFrame *f , water_t *w ) /* globalactivity not used */ /* +static int n__ = 0; +static uint32_t keyv_ = 0; +static uint32_t keyp_ = 0; static int globalactivity(VJFrame *f2, water_t *w, int in) { int len = (f2->width * f2->height)/4; @@ -302,7 +299,7 @@ static void motiondetect(VJFrame *f, VJFrame *f2, int threshold, water_t *w) int *p = w->map1 + w->map_w + 1; int *q = w->map2 + w->map_w + 1; - int width = f->width; + const unsigned int width = f->width; int x,y,h; uint8_t *d = w->diff_img + width + 2; for( y = w->map_h - 2; y > 0 ; y -- ) { @@ -351,7 +348,7 @@ static void motiondetect2(VJFrame *f, VJFrame *f2, int threshold, water_t *w) int *p = w->map1 + w->map_w + 1; int *q = w->map2 + w->map_w + 1; - int width = f->width; + const unsigned int width = f->width; int x,y,h; uint8_t *d = w->diff_img + width + 2; for( y = w->map_h - 2; y > 0 ; y -- ) { @@ -400,7 +397,7 @@ static void motiondetect3(VJFrame *f, VJFrame *f2, int threshold, water_t *w) int *p = w->map1 + w->map_w + 1; int *q = w->map2 + w->map_w + 1; - int width = f->width; + const unsigned int width = f->width; int x,y,h; uint8_t *d = w->diff_img + width + 2; for( y = w->map_h - 2; y > 0 ; y -- ) { diff --git a/veejay-current/veejay-server/libvje/effects/waterrippletv.c b/veejay-current/veejay-server/libvje/effects/waterrippletv.c index b06e38bd..9c54eead 100644 --- a/veejay-current/veejay-server/libvje/effects/waterrippletv.c +++ b/veejay-current/veejay-server/libvje/effects/waterrippletv.c @@ -22,15 +22,9 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 , USA. */ - -#include -#include -#include +#include "common.h" #include #include "waterrippletv.h" -#include -#include -#include "common.h" static uint8_t *ripple_data[3]; @@ -218,7 +212,7 @@ static void raindrop() } static int last_fresh_rate = 0; -void waterrippletv_apply(VJFrame *frame, int width, int height, int fresh_rate, int loopnum, int decay) +void waterrippletv_apply(VJFrame *frame, int fresh_rate, int loopnum, int decay) { int x, y, i; int dx, dy; @@ -307,8 +301,8 @@ void waterrippletv_apply(VJFrame *frame, int width, int height, int fresh_rate, vp+=2; } - hi = height; - wi = width; + hi = frame->height; + wi = frame->width; vp = vtable; /* dest2 = dest; diff --git a/veejay-current/veejay-server/libvje/effects/waterrippletv.h b/veejay-current/veejay-server/libvje/effects/waterrippletv.h index e4467053..2f9b3625 100644 --- a/veejay-current/veejay-server/libvje/effects/waterrippletv.h +++ b/veejay-current/veejay-server/libvje/effects/waterrippletv.h @@ -20,13 +20,8 @@ #ifndef WARIPPLETV_H #define WARIPPLETV_H -#include -#include -#include -#include - vj_effect* waterrippletv_init(int width, int height); int waterrippletv_malloc(int w, int h); void waterrippletv_free(); -void waterrippletv_apply(VJFrame *frame, int width, int height, int val, int loop, int decay); +void waterrippletv_apply(VJFrame *frame, int val, int loop, int decay); #endif diff --git a/veejay-current/veejay-server/libvje/effects/whiteframe.c b/veejay-current/veejay-server/libvje/effects/whiteframe.c index 7b882548..9196eb55 100644 --- a/veejay-current/veejay-server/libvje/effects/whiteframe.c +++ b/veejay-current/veejay-server/libvje/effects/whiteframe.c @@ -17,12 +17,11 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 , USA. */ -#include -#include -#include + +#include "common.h" #include #include "whiteframe.h" -#include "common.h" + vj_effect *whiteframe_init(int w,int h) { vj_effect *ve = (vj_effect *) vj_calloc(sizeof(vj_effect)); diff --git a/veejay-current/veejay-server/libvje/effects/widthmirror.c b/veejay-current/veejay-server/libvje/effects/widthmirror.c index 4475a187..5b0f186a 100644 --- a/veejay-current/veejay-server/libvje/effects/widthmirror.c +++ b/veejay-current/veejay-server/libvje/effects/widthmirror.c @@ -17,9 +17,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 , USA. */ -#include -#include -#include + +#include "common.h" #include #include "widthmirror.h" @@ -46,7 +45,7 @@ vj_effect *widthmirror_init(int max_width,int h) void widthmirror_apply(VJFrame *frame, int width_div) { unsigned int r, c; - const int width = frame->width; + const unsigned int width = frame->width; const int len = frame->len; const int uv_len = frame->uv_len; const int uv_width = frame->uv_width; diff --git a/veejay-current/veejay-server/libvje/effects/zoom.c b/veejay-current/veejay-server/libvje/effects/zoom.c index 72a0157d..b7a03846 100644 --- a/veejay-current/veejay-server/libvje/effects/zoom.c +++ b/veejay-current/veejay-server/libvje/effects/zoom.c @@ -17,13 +17,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 , USA. */ -#include -#include -#include -#include -#include -#include + #include "common.h" +#include +#include #include "zoom.h" vj_effect *zoom_init(int width , int height) @@ -101,8 +98,8 @@ void zoom_free() { void zoom_apply( VJFrame *frame, int x, int y, int factor, int dir, int alpha) { - const int width = frame->width; - const int height = frame->height; + const unsigned int width = frame->width; + const unsigned int height = frame->height; const int len = frame->len; if( zoom_[0] != x || zoom_[1] != y || zoom_[2] != factor || !zoom_vp_ || dir != zoom_[3]) diff --git a/veejay-current/veejay-server/libvje/effects/zoom.h b/veejay-current/veejay-server/libvje/effects/zoom.h index f72c3ea8..f584560d 100644 --- a/veejay-current/veejay-server/libvje/effects/zoom.h +++ b/veejay-current/veejay-server/libvje/effects/zoom.h @@ -21,10 +21,6 @@ #ifndef ZOOM_H #define ZOOM_H -#include -#include -#include - vj_effect *zoom_init(int width, int height); int zoom_malloc(int w, int h); void zoom_free(); diff --git a/veejay-current/veejay-server/libvje/internal.h b/veejay-current/veejay-server/libvje/internal.h index 8f41e250..7b642ccd 100644 --- a/veejay-current/veejay-server/libvje/internal.h +++ b/veejay-current/veejay-server/libvje/internal.h @@ -304,7 +304,7 @@ enum { #define VJ_NUM_BLEND_EFFECTS VJ_EFFECT_BLEND_ADDTEST7 -extern void tripplicity_apply(VJFrame *frame1,VJFrame *frame2, int w, int h, int a, int b, int c ); +extern void tripplicity_apply(VJFrame *frame1,VJFrame *frame2, int a, int b, int c ); extern void dices_apply(void * data, VJFrame *frame, int cube_bits); extern void dither_apply( VJFrame *frame, int size, int n); extern void emboss_apply( VJFrame *frame, int n); @@ -432,126 +432,75 @@ extern void magicmirror_apply(VJFrame *frame, int x, int y, int d, int n, int al extern void lumamask_apply(VJFrame *frame,VJFrame *frame2, int n, int m, int border, int alpha); extern void smear_apply(VJFrame *frame, int n, int m); extern void raster_apply(VJFrame *frame, int v, int mode); - -extern void fisheye_apply(VJFrame *frame, int w, int h, int v, int alpha ); - -extern void swirl_apply(VJFrame *frame, int w, int h , int v ); - -extern void radialblur_apply(VJFrame *frame, int w, int h, int r, int p, int n); - -extern void binaryoverlay_apply(VJFrame *frame, VJFrame *frame2,int w, int h, int n); - -extern void chromium_apply( VJFrame *frame, int w, int h, int n); - -extern void chromapalette_apply( VJFrame *frame, int w, int h, int a, int r, int g, int b, int c1, int c2); - - -extern void uvcorrect_apply(VJFrame *frame, int width, int height, int angle, int urot_center, int vrot_center, int iuFactor, int ivFactor, int uvmin, int uvmax ); - -extern void dissolve_apply(VJFrame *frame,VJFrame *frame2, int w, int h, int opacity); - -extern void overclock_apply(VJFrame *frame, int w, int h, int val, int r); +extern void fisheye_apply(VJFrame *frame, int v, int alpha ); +extern void swirl_apply(VJFrame *frame, int v ); +extern void radialblur_apply(VJFrame *frame, int r, int p, int n); +extern void binaryoverlay_apply(VJFrame *frame, VJFrame *frame2, int n); +extern void chromium_apply( VJFrame *frame, int n); +extern void chromapalette_apply( VJFrame *frame, int a, int r, int g, int b, int c1, int c2); +extern void uvcorrect_apply(VJFrame *frame, int angle, int urot_center, + int vrot_center, int iuFactor, int ivFactor, int uvmin, int uvmax ); +extern void dissolve_apply(VJFrame *frame,VJFrame *frame2, int opacity); +extern void overclock_apply(VJFrame *frame, int val, int r); uint8_t *bgpush_get_bg_frame(unsigned int plane); - uint8_t *bgsubtract_get_bg_frame(unsigned int plane); - extern int bgsubtract_prepare(VJFrame *frame); - -extern void bgsubtract_apply(VJFrame *frame,int width, int height, int threshold, int method, int enabled, int alpha ); +extern void bgsubtract_apply(VJFrame *frame, int threshold, int method, int enabled, int alpha ); extern uint8_t* bgsubtractgauss_get_bg_frame(unsigned int plane); - extern int bgsubtractgauss_prepare(VJFrame *frame); - extern void bgsubtractgauss_apply(VJFrame *frame,int alpha, int threshold,int noise, int mode, int period, int morph ); extern int diff_prepare(void *data, uint8_t *map[4], int w, int h); extern int bgpush_prepare( VJFrame *frame ); -extern void cartonize_apply( VJFrame *frame, int w, int h, int b1, int b2, int b3 ); - -extern void morphology_apply( VJFrame *frame, int threshold, int kernel, int mode, int channel); - -extern void colmorphology_apply( VJFrame *frame, int w, int h, int t, int v, int p); - -extern void blob_apply( VJFrame *frame, int w, int h, int p0,int p1, int p2, int p3); - -extern void boids_apply( VJFrame *frame, int w, int h, int p0,int p1, int p2, int p3, int p4, int p5, int p6, int p7 -); -extern void porterduff_apply( VJFrame *frame, VJFrame *frame2, int w, int h, int mode); - -extern void ghost_apply(VJFrame *frame, int w, int h, int o ); -extern void neighbours_apply( VJFrame *frame, int width, int height, int brush_size, int level, int mode); -extern void neighbours2_apply( VJFrame *frame, int width, int height, int brush_size, int level, int mode); -extern void neighbours3_apply( VJFrame *frame, int width, int height, int brush_size, int level, int mode); -extern void neighbours4_apply( VJFrame *frame, int width, int height, int radius, int brush_size, int level, int mode); -extern void neighbours5_apply( VJFrame *frame, int width, int height, int radius, int brush_size, int level); -extern void cutstop_apply( VJFrame *frame, - int width, int height, int treshold, - int freq, int cutmode, int holdmode); -extern void maskstop_apply( VJFrame *frame, - int width, int height, int treshold, - int freq, int cutmode, int holdmode); -extern void photoplay_apply(VJFrame *frame, int w, int h, int a, int b, int c); - -extern void videoplay_apply(VJFrame *frame,VJFrame *B, int w, int h, int a, int b, int c); - -extern void videowall_apply(VJFrame *frame,VJFrame *B, int w, int h, int a, int b, int c, int d); - -extern void flare_apply(VJFrame *frame, int w, int h, int type, int threshold, int radius ); - -extern void constantblend_apply(VJFrame *frame , int w, int h, int type, int scale, int y ); - +extern void cartonize_apply( VJFrame *frame, int b1, int b2, int b3 ); +extern void morphology_apply( VJFrame *frame, int threshold, int kernel, int mode, int channel); +extern void colmorphology_apply( VJFrame *frame, int t, int v, int p); +extern void blob_apply( VJFrame *frame, int p0,int p1, int p2, int p3); +extern void boids_apply( VJFrame *frame, int p0,int p1, int p2, int p3, + int p4, int p5, int p6, int p7); +extern void porterduff_apply( VJFrame *frame, VJFrame *frame2, int mode); +extern void ghost_apply(VJFrame *frame, int o ); +extern void neighbours_apply( VJFrame *frame, int brush_size, int level, int mode); +extern void neighbours2_apply( VJFrame *frame, int brush_size, int level, int mode); +extern void neighbours3_apply( VJFrame *frame, int brush_size, int level, int mode); +extern void neighbours4_apply( VJFrame *frame, int radius, int brush_size, int level, int mode); +extern void neighbours5_apply( VJFrame *frame, int radius, int brush_size, int level); +extern void cutstop_apply( VJFrame *frame, int treshold, int freq, int cutmode, int holdmode); +extern void maskstop_apply( VJFrame *frame, int treshold, int freq, int cutmode, int holdmode); +extern void photoplay_apply(VJFrame *frame, int a, int b, int c); +extern void videoplay_apply(VJFrame *frame,VJFrame *B, int a, int b, int c); +extern void videowall_apply(VJFrame *frame,VJFrame *B, int a, int b, int c, int d); +extern void flare_apply(VJFrame *frame, int type, int threshold, int radius ); +extern void constantblend_apply(VJFrame *frame, int type, int scale, int y ); extern void picinpic_apply( void *user_data, VJFrame *frame, VJFrame *frame2, - int twidth, int theight, int x1, int y1, - int width, int height); - -extern void threshold_apply( VJFrame *frame, VJFrame *frame2,int width, int height, int threshold, int reverse ); - + int x1, int y1, int width, int height); +extern void threshold_apply( VJFrame *frame, VJFrame *frame2, int threshold, int reverse ); extern void motionmap_apply( VJFrame *frame, int threshold, int reverse, int draw, int his, int op, int ip, int la, int ad ); - -extern void rgbchannel_apply( VJFrame *frame, int width, int height, int chr, int chg , int chb); - -extern void differencemap_apply( VJFrame *f, VJFrame *f2, int w, int h, int t1, int rev, int show ); - -extern void autoeq_apply( VJFrame *frame, int width, int height, int val, int i, int s); - -extern void colorhis_apply( VJFrame *frame, int w, int h, int v, int m, int i, int s ); +extern void rgbchannel_apply( VJFrame *frame, int chr, int chg , int chb); +extern void differencemap_apply( VJFrame *f, VJFrame *f2, int t1, int rev, int show ); +extern void autoeq_apply( VJFrame *frame, int val, int i, int s); +extern void colorhis_apply( VJFrame *frame, int v, int m, int i, int s ); extern void diff_destroy(); - extern void texmap_destroy(); - extern void contourextract_destroy(); - extern void distortion_destroy(); - extern void rotozoom_destroy(); -extern void timedistort_apply( VJFrame *frame, int w, int h, int val ); - -extern void chameleon_apply( VJFrame *frame, int w, int h, int mode ); - -extern void chameleonblend_apply( VJFrame *frame, VJFrame *source, int w, int h, int mode ); - -extern void baltantv_apply (VJFrame *frame, int w, int h , int stride, int mode ); - -extern void radioactivetv_apply( VJFrame *a, VJFrame *b,int w, int h, int mode, int t, int sn, int threhold); - -extern void nervous_apply(VJFrame *Frame, int width, int height,int delay); - -extern void colflash_apply( VJFrame *frame, int width, int height, int f,int r, int g, int b, int d); - -extern void iris_apply( VJFrame *frame,VJFrame *frame2, int width, int height, int value, int shape ); - -extern void cali_apply(void *d , VJFrame *frame, - int width, int height, - int mode, int full); - -extern void waterrippletv_apply(VJFrame *frame, int width, int height, int fresh_rate, int loopnum, int decay); - +extern void timedistort_apply( VJFrame *frame, int val ); +extern void chameleon_apply( VJFrame *frame, int mode ); +extern void chameleonblend_apply( VJFrame *frame, VJFrame *source, int mode ); +extern void baltantv_apply (VJFrame *frame, int stride, int mode ); +extern void radioactivetv_apply( VJFrame *a, VJFrame *b, int mode, int t, int sn, int threhold); +extern void nervous_apply(VJFrame *Frame, int delay); +extern void colflash_apply( VJFrame *frame, int f,int r, int g, int b, int d); +extern void iris_apply( VJFrame *frame,VJFrame *frame2, int value, int shape ); +extern void cali_apply(void *d , VJFrame *frame, int mode, int full); +extern void waterrippletv_apply(VJFrame *frame, int fresh_rate, int loopnum, int decay); extern void radcor_apply( VJFrame *frame, int a, int b, int c, int alpha); extern int motionmap_prepare( uint8_t *map[4], int w, int h ); @@ -559,28 +508,25 @@ extern int chameleon_prepare( uint8_t *bg[4], int w, int h ); extern int contourextract_prepare(uint8_t *map[4], int w, int h); extern int chameleonblend_prepare( uint8_t *bg[4],int w, int h ); -extern void average_blend_applyN( VJFrame *frame, VJFrame *frame2, int width, int height, int average_blend); - -extern void average_blend_apply( VJFrame *frame, VJFrame *frame2, int width,int height, int average_blend); - -extern void toalpha_apply( VJFrame *frame, int width, int height, int mode); -extern void mixtoalpha_apply( VJFrame *frame, VJFrame *frame2, int width,int height, int mode, int scale); -extern void alpha2img_apply( VJFrame *frame, int width, int height); -extern void alphafill_apply( VJFrame *frame, int width, int height, int val); -extern void alphaflatten_apply( VJFrame *frame, int width, int height, int mode); -extern void overlayalphamagic_apply(VJFrame *frame, VJFrame *frame2, int width,int height, int n, int visible); -extern void travelmatte_apply( VJFrame *frame, VJFrame *frame2, int width,int height, int mode); -extern void feathermask_apply( VJFrame *frame, int width, int height ); -extern void alphaselect_apply( VJFrame *frame, int width,int height, int i_angle, int r, int g,int b, int swap); +extern void average_blend_apply( VJFrame *frame, VJFrame *frame2, int average_blend); +extern void toalpha_apply( VJFrame *frame, int mode); +extern void mixtoalpha_apply( VJFrame *frame, VJFrame *frame2, int mode, int scale); +extern void alpha2img_apply( VJFrame *frame); +extern void alphafill_apply( VJFrame *frame, int val); +extern void alphaflatten_apply( VJFrame *frame, int mode); +extern void overlayalphamagic_apply(VJFrame *frame, VJFrame *frame2, int n, int visible); +extern void travelmatte_apply( VJFrame *frame, VJFrame *frame2, int mode); +extern void feathermask_apply( VJFrame *frame ); +extern void alphaselect_apply( VJFrame *frame, int i_angle, int r, int g,int b, int swap); extern void alphaselect2_apply( VJFrame *frame, int tola, int r, int g,int b, int tolb,int alpha); -extern void alphablend_apply( VJFrame *frame, VJFrame *frame2, int width,int height); -extern void lumakeyalpha_apply( VJFrame *frame, VJFrame *frame2, int width, int height, int type, int opacity ); -extern void chromamagickalpha_apply( VJFrame *frame, VJFrame *frame2, int width, int height, int type, int opacity ); -extern void overlaymagicalpha_apply( VJFrame *frame, VJFrame *frame2, int width, int height, int type, int mode ); -extern void alphanegate_apply( VJFrame *frame, int width, int height, int value ); +extern void alphablend_apply( VJFrame *frame, VJFrame *frame2); +extern void lumakeyalpha_apply( VJFrame *frame, VJFrame *frame2, int type, int opacity ); +extern void chromamagickalpha_apply( VJFrame *frame, VJFrame *frame2, int type, int opacity ); +extern void overlaymagicalpha_apply( VJFrame *frame, VJFrame *frame2, int type, int mode ); +extern void alphanegate_apply( VJFrame *frame, int value ); extern void gaussblur_apply(VJFrame *frame, int radius, int strength, int quality ); extern void levelcorrection_apply(VJFrame *frame, int min, int max, int bmin, int bmax); -extern void masktransition_apply( VJFrame *frame, VJFrame *frame2, int width,int height, int time_index, int duration); +extern void masktransition_apply( VJFrame *frame, VJFrame *frame2, int time_index, int duration); extern void alphadampen_apply( VJFrame *frame, int b1); extern void passthrough_apply( VJFrame *frame, VJFrame *frame2); extern void alphatransition_apply( VJFrame *frame, VJFrame *frame2, int time_index, int duration, int direction, int threshold); diff --git a/veejay-current/veejay-server/libvje/transitions/3bar.c b/veejay-current/veejay-server/libvje/transitions/3bar.c index 8dffa553..f2361008 100644 --- a/veejay-current/veejay-server/libvje/transitions/3bar.c +++ b/veejay-current/veejay-server/libvje/transitions/3bar.c @@ -17,9 +17,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 , USA. */ -#include -#include -#include + +#include #include #include "3bar.h" @@ -68,13 +67,13 @@ static int bar_bot_vert = 0; void bar_apply(VJFrame *frame, VJFrame *frame2, int divider, int top_y, int bot_y, int top_x, int bot_x ) { - const int width = frame->width; - const int height = frame->height; - int top_width = width; /* frame in frame destination area */ - int top_height = height/(divider); + const unsigned int width = frame->width; + const unsigned int height = frame->height; + unsigned int top_width = width; /* frame in frame destination area */ + unsigned int top_height = height/(divider); - int bottom_width = width; /* frame in frame destionation area */ - int bottom_height = (height - top_height); + unsigned int bottom_width = width; /* frame in frame destionation area */ + unsigned int bottom_height = (height - top_height); int y,x; int yy=0; int y2 = bar_top_auto + top_y; /* destination */ diff --git a/veejay-current/veejay-server/libvje/transitions/3bar.h b/veejay-current/veejay-server/libvje/transitions/3bar.h index 9d68c7a3..cc76bc0f 100644 --- a/veejay-current/veejay-server/libvje/transitions/3bar.h +++ b/veejay-current/veejay-server/libvje/transitions/3bar.h @@ -20,42 +20,7 @@ #ifndef BAR_H #define BAR_H -#include -#include -#include - vj_effect *bar_init(int width, int height); void bar_apply(VJFrame *frame, VJFrame *frame2, int d, int x1, int x2, int t1, int b1); #endif -/* - * Linux VeeJay - * - * Copyright(C)2002 Niels Elburg - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License , or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 , USA. - */ - -#ifndef BAR_H -#define BAR_H -#include "../vj-effect.h" -#include -#include - -vj_effect *bar_init(int width, int height); -void bar_apply(uint8_t * yuv1[3], uint8_t * yuv2[3], - int width, int height, int d, int x1, int x2, int t1, int b1); -void bar_free(); -#endif diff --git a/veejay-current/veejay-server/libvje/transitions/fadecolor.c b/veejay-current/veejay-server/libvje/transitions/fadecolor.c index ab504434..11fb6e63 100644 --- a/veejay-current/veejay-server/libvje/transitions/fadecolor.c +++ b/veejay-current/veejay-server/libvje/transitions/fadecolor.c @@ -17,9 +17,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 , USA. */ -#include -#include -#include + +#include #include #include #include "fadecolor.h" @@ -56,7 +55,7 @@ vj_effect *fadecolor_init(int w,int h) void colorfade_apply(VJFrame *frame, int opacity, int color) { unsigned int i, op0, op1; - unsigned int len = frame->width * frame->height; + const int len = frame->len; uint8_t colorCb = 128, colorCr = 128; uint8_t colorY=0; const int uv_len = frame->uv_len; diff --git a/veejay-current/veejay-server/libvje/transitions/fadecolorrgb.c b/veejay-current/veejay-server/libvje/transitions/fadecolorrgb.c index 874aef83..231bf33e 100644 --- a/veejay-current/veejay-server/libvje/transitions/fadecolorrgb.c +++ b/veejay-current/veejay-server/libvje/transitions/fadecolorrgb.c @@ -17,9 +17,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 , USA. */ -#include -#include -#include + +#include #include #include "fadecolorrgb.h" diff --git a/veejay-current/veejay-server/libvje/transitions/slidingdoor.c b/veejay-current/veejay-server/libvje/transitions/slidingdoor.c index 9d895ce4..48c7b329 100644 --- a/veejay-current/veejay-server/libvje/transitions/slidingdoor.c +++ b/veejay-current/veejay-server/libvje/transitions/slidingdoor.c @@ -17,11 +17,9 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 , USA. */ -#include -#include -#include -#include + #include +#include #include "slidingdoor.h" vj_effect *slidingdoor_init(int width, int height) diff --git a/veejay-current/veejay-server/libvje/transitions/transblend.c b/veejay-current/veejay-server/libvje/transitions/transblend.c index eefe84f2..50d4a19e 100644 --- a/veejay-current/veejay-server/libvje/transitions/transblend.c +++ b/veejay-current/veejay-server/libvje/transitions/transblend.c @@ -17,11 +17,9 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 , USA. */ -#include -#include -#include -#include + #include +#include #include "transblend.h" vj_effect *transblend_init(int width, int height) @@ -69,8 +67,8 @@ void transblend_apply( VJFrame *frame, VJFrame *frame2, int type, int x, y; int p, q; int uv_width = frame->uv_width; - const int width = frame->width; - const int height = frame->height; + const unsigned int width = frame->width; + const unsigned int height = frame->height; int uvy1, uvy2, uvx1, uvx2; uint8_t *Y, *Cb, *Cr, *Y2, *Cb2, *Cr2; diff --git a/veejay-current/veejay-server/libvje/transitions/transcarot.c b/veejay-current/veejay-server/libvje/transitions/transcarot.c index 7562ab91..92a35028 100644 --- a/veejay-current/veejay-server/libvje/transitions/transcarot.c +++ b/veejay-current/veejay-server/libvje/transitions/transcarot.c @@ -17,9 +17,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 , USA. */ -#include -#include -#include + +#include #include #include "transcarot.h" @@ -147,9 +146,8 @@ static void transcarot2_apply( VJFrame *frame, VJFrame *frame2, int point_size, int reverse = 0; int i; unsigned int op0, op1; - const int width = frame->width; - const int height = frame->height; - unsigned int len = frame->len; + const unsigned int width = frame->width; + const int len = frame->len; unsigned int uv_width = frame->uv_width; int uv_dy, uv_dye, uv_row_start, uv_row_length; uint8_t *Y = frame->data[0]; diff --git a/veejay-current/veejay-server/libvje/transitions/transline.c b/veejay-current/veejay-server/libvje/transitions/transline.c index 9216a9c4..a2f7df6d 100644 --- a/veejay-current/veejay-server/libvje/transitions/transline.c +++ b/veejay-current/veejay-server/libvje/transitions/transline.c @@ -17,9 +17,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 , USA. */ -#include -#include -#include + +#include #include #include "transline.h" diff --git a/veejay-current/veejay-server/libvje/transitions/transop.c b/veejay-current/veejay-server/libvje/transitions/transop.c index 38ed2b5f..025efe81 100644 --- a/veejay-current/veejay-server/libvje/transitions/transop.c +++ b/veejay-current/veejay-server/libvje/transitions/transop.c @@ -17,9 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 , USA. */ -#include -#include -#include +#include #include #include "transop.h" @@ -77,8 +75,8 @@ void transop_apply( VJFrame *frame, VJFrame *frame2, int view_width = twidth; int view_height = theight; - const int width = frame->width; - const int height = frame->height; + const unsigned int width = frame->width; + const unsigned int height = frame->height; int sy = y1; int sx = x1; diff --git a/veejay-current/veejay-server/libvje/transitions/vbar.c b/veejay-current/veejay-server/libvje/transitions/vbar.c index d9e6fd73..7f0166ff 100644 --- a/veejay-current/veejay-server/libvje/transitions/vbar.c +++ b/veejay-current/veejay-server/libvje/transitions/vbar.c @@ -17,11 +17,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 , USA. */ -#include -#include -#include + +#include #include -#include "vbar.h" +#include "vbar.h" vj_effect *vbar_init(int width, int height) { @@ -65,11 +64,11 @@ static int bar_top_auto = 0; static int bar_bot_auto = 0; static int bar_top_vert = 0; static int bar_bot_vert = 0; -void vbar_apply(VJFrame *frame, VJFrame *frame2, int divider, int top_y, int bot_y, int top_x, int bot_x) { - - const int width = frame->width; - const int height = frame->height; - const uint32_t len = frame->len; +void vbar_apply(VJFrame *frame, VJFrame *frame2, int divider, int top_y, int bot_y, int top_x, int bot_x) +{ + const unsigned int width = frame->width; + const unsigned int height = frame->height; + const int len = frame->len; //int top_width = width; /* frame in frame destination area */ int top_width = width/divider; int bottom_width = width - top_width; diff --git a/veejay-current/veejay-server/libvje/transitions/vbar.h b/veejay-current/veejay-server/libvje/transitions/vbar.h index ddb6ab60..bdbabb65 100644 --- a/veejay-current/veejay-server/libvje/transitions/vbar.h +++ b/veejay-current/veejay-server/libvje/transitions/vbar.h @@ -20,10 +20,6 @@ #ifndef VBAR_H #define VBAR_H -#include -#include -#include - vj_effect *vbar_init(int width, int height); void vbar_apply( VJFrame *frame, VJFrame *frame2, int d, int x1, int x2, int t1, int b1); #endif diff --git a/veejay-current/veejay-server/libvje/transitions/wipe.c b/veejay-current/veejay-server/libvje/transitions/wipe.c index 8c4d28d2..727b3e0b 100644 --- a/veejay-current/veejay-server/libvje/transitions/wipe.c +++ b/veejay-current/veejay-server/libvje/transitions/wipe.c @@ -16,13 +16,11 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include -#include -#include -#include + +#include #include -#include "wipe.h" #include "transop.h" +#include "wipe.h" vj_effect *wipe_init(int w,int h) { @@ -54,8 +52,8 @@ static int g_wipe_height = 0; void wipe_apply( VJFrame *frame, VJFrame *frame2, int opacity, int inc) { - const int width = frame->width; - const int height = frame->height; + const unsigned int width = frame->width; + const unsigned int height = frame->height; /* w, h increasen */ transop_apply(frame, frame2, g_wipe_width, g_wipe_height, 0, 0, 0, 0, opacity); diff --git a/veejay-current/veejay-server/libvje/vj-effman.c b/veejay-current/veejay-server/libvje/vj-effman.c index 4de49b62..b6b19f8a 100644 --- a/veejay-current/veejay-server/libvje/vj-effman.c +++ b/veejay-current/veejay-server/libvje/vj-effman.c @@ -83,47 +83,38 @@ static void vj_effman_apply_image_effect( switch (e) { case VJ_IMAGE_EFFECT_CONSTANTBLEND: - constantblend_apply( frames[0], frames[0]->width, - frames[0]->height, arg[0], arg[1], arg[2]); + constantblend_apply( frames[0], arg[0], arg[1], arg[2]); break; case VJ_IMAGE_EFFECT_FLARE: - flare_apply( frames[0], frames[0]->width, - frames[0]->height,arg[0],arg[1],arg[2] ); + flare_apply( frames[0],arg[0],arg[1],arg[2] ); break; case VJ_IMAGE_EFFECT_PHOTOPLAY: - photoplay_apply(frames[0],frames[0]->width, - frames[0]->height,arg[0],arg[1],arg[2]); + photoplay_apply(frames[0],arg[0],arg[1],arg[2]); break; case VJ_IMAGE_EFFECT_MASKSTOP: - maskstop_apply(frames[0],frames[0]->width, - frames[0]->height,arg[0],arg[1],arg[2],arg[3]); + maskstop_apply(frames[0],arg[0],arg[1],arg[2],arg[3]); break; case VJ_IMAGE_EFFECT_CUTSTOP: - cutstop_apply(frames[0],frames[0]->width, - frames[0]->height,arg[0],arg[1],arg[2],arg[3]); + cutstop_apply(frames[0],arg[0],arg[1],arg[2],arg[3]); break; case VJ_IMAGE_EFFECT_NEIGHBOUR4: - neighbours4_apply(frames[0],frames[0]->width, - frames[0]->height,arg[0],arg[1],arg[2],arg[3]); + neighbours4_apply(frames[0],arg[0],arg[1],arg[2],arg[3]); break; case VJ_IMAGE_EFFECT_NEIGHBOUR5: - neighbours5_apply(frames[0],frames[0]->width, - frames[0]->height,arg[0],arg[1],arg[2]); + neighbours5_apply(frames[0],arg[0],arg[1],arg[2]); break; case VJ_IMAGE_EFFECT_NEIGHBOUR2: - neighbours2_apply(frames[0],frames[0]->width, - frames[0]->height,arg[0],arg[1],arg[2]); + neighbours2_apply(frames[0], arg[0], arg[1], arg[2]); break; case VJ_IMAGE_EFFECT_NEIGHBOUR: - neighbours_apply(frames[0],frames[0]->width,frames[0]->height,arg[0],arg[1],arg[2]); + neighbours_apply(frames[0], arg[0], arg[1], arg[2]); break; case VJ_IMAGE_EFFECT_NEIGHBOUR3: - neighbours3_apply(frames[0],frames[0]->width, - frames[0]->height,arg[0],arg[1],arg[2]); + neighbours3_apply(frames[0], arg[0], arg[1], arg[2]); break; case VJ_IMAGE_EFFECT_RIPPLETV: - waterrippletv_apply(frames[0],frames[0]->width,frames[0]->height,arg[0],arg[1],arg[2]); + waterrippletv_apply(frames[0],arg[0],arg[1],arg[2]); break; case VJ_IMAGE_EFFECT_PENCILSKETCH: pencilsketch_apply(frames[0],arg[0],arg[1],arg[2],arg[3]); @@ -132,7 +123,7 @@ static void vj_effman_apply_image_effect( noisepencil_apply(frames[0], arg[0], arg[1], arg[2], arg[3]); break; case VJ_IMAGE_EFFECT_CALI: - cali_apply( vj_effects[entry]->user_data,frames[0], frames[0]->width,frames[0]->height,arg[0], arg[1] ); + cali_apply( vj_effects[entry]->user_data,frames[0],arg[0], arg[1] ); break; case VJ_IMAGE_EFFECT_DIFF: diffimg_apply(frames[0], arg[0], arg[1], arg[2]); @@ -203,67 +194,64 @@ static void vj_effman_apply_image_effect( raster_apply(frames[0], arg[0], arg[1]); break; case VJ_IMAGE_EFFECT_SWIRL: - swirl_apply(frames[0],frames[0]->width,frames[0]->height,arg[0]); + swirl_apply(frames[0], arg[0]); break; case VJ_IMAGE_EFFECT_RADIALBLUR: - radialblur_apply(frames[0], frames[0]->width, frames[0]->height,arg[0],arg[1],arg[2]); + radialblur_apply(frames[0], arg[0], arg[1], arg[2]); break; case VJ_IMAGE_EFFECT_FISHEYE: - fisheye_apply(frames[0],frames[0]->width,frames[0]->height,arg[0],arg[1]); + fisheye_apply(frames[0], arg[0], arg[1]); break; case VJ_IMAGE_EFFECT_PIXELSMEAR: smear_apply(frames[0], arg[0], arg[1]); break; case VJ_IMAGE_EFFECT_UVCORRECT: - uvcorrect_apply(frames[0], frames[0]->width, frames[0]->height,arg[0],arg[1],arg[2],arg[3],arg[4],arg[5],arg[6]); + uvcorrect_apply(frames[0],arg[0],arg[1],arg[2],arg[3],arg[4],arg[5],arg[6]); break; case VJ_IMAGE_EFFECT_CHROMAPALETTE: - chromapalette_apply(frames[0],frames[0]->width,frames[0]->height,arg[0],arg[1],arg[2],arg[3],arg[4],arg[5]); + chromapalette_apply(frames[0],arg[0],arg[1],arg[2],arg[3],arg[4],arg[5]); break; case VJ_IMAGE_EFFECT_CHROMIUM: - chromium_apply( frames[0], frames[0]->width, frames[0]->height, arg[0]); + chromium_apply( frames[0], arg[0]); break; case VJ_IMAGE_EFFECT_CARTONIZE: - cartonize_apply( frames[0], frames[0]->width,frames[0]->height, - arg[0],arg[1],arg[2] ); + cartonize_apply( frames[0], arg[0], arg[1], arg[2] ); break; case VJ_IMAGE_EFFECT_VIDBLOB: - blob_apply( frames[0],frames[0]->width,frames[0]->height, - arg[0],arg[1],arg[2],arg[3] ); + blob_apply( frames[0], arg[0], arg[1], arg[2], arg[3] ); break; case VJ_IMAGE_EFFECT_VIDBOIDS: - boids_apply( frames[0],frames[0]->width,frames[0]->height, - arg[0],arg[1],arg[2],arg[3],arg[4],arg[5],arg[6],arg[7] ); + boids_apply( frames[0], arg[0],arg[1],arg[2],arg[3],arg[4],arg[5],arg[6],arg[7] ); break; case VJ_IMAGE_EFFECT_GHOST: - ghost_apply( frames[0], frames[0]->width,frames[0]->height,arg[0]); + ghost_apply( frames[0], arg[0]); break; case VJ_IMAGE_EFFECT_MORPHOLOGY: morphology_apply( frames[0], arg[0],arg[1],arg[2],arg[3] ); break; case VJ_IMAGE_EFFECT_COLMORPH: - colmorphology_apply( frames[0], frames[0]->width, frames[0]->height,arg[0],arg[1],arg[2]); + colmorphology_apply( frames[0], arg[0], arg[1], arg[2]); break; case VJ_IMAGE_EFFECT_NERVOUS: - nervous_apply( frames[0], frames[0]->width, frames[0]->height, - arg[0]); break; + nervous_apply( frames[0], arg[0]); + break; case VJ_IMAGE_EFFECT_OVERCLOCK: - overclock_apply(frames[0], frames[0]->width, frames[0]->height,arg[0],arg[1]); + overclock_apply(frames[0],arg[0],arg[1]); break; case VJ_IMAGE_EFFECT_COLORHIS: - colorhis_apply( frames[0], frames[0]->width,frames[0]->height,arg[0],arg[1],arg[2],arg[3] ); + colorhis_apply( frames[0],arg[0],arg[1],arg[2],arg[3] ); break; case VJ_IMAGE_EFFECT_AUTOEQ: - autoeq_apply(frames[0],frames[0]->width,frames[0]->height,arg[0],arg[1],arg[2]); + autoeq_apply(frames[0],arg[0],arg[1],arg[2]); break; case VJ_IMAGE_EFFECT_BALTANTV: - baltantv_apply(frames[0],frames[0]->width,frames[0]->height,arg[0],arg[1]); + baltantv_apply(frames[0], arg[0], arg[1]); break; case VJ_IMAGE_EFFECT_CHAMELEON: - chameleon_apply(frames[0],frames[0]->width,frames[0]->height,arg[0]); + chameleon_apply(frames[0], arg[0]); break; case VJ_IMAGE_EFFECT_TIMEDISTORT: - timedistort_apply(frames[0],frames[0]->width,frames[0]->height,arg[0]); + timedistort_apply(frames[0],arg[0]); break; case VJ_IMAGE_EFFECT_LENSCORRECTION: radcor_apply( frames[0], arg[0],arg[1] ,arg[2],arg[3]); @@ -279,8 +267,7 @@ static void vj_effman_apply_image_effect( break; case VJ_IMAGE_EFFECT_COLFLASH: - colflash_apply(frames[0], frames[0]->width,frames[0]->height,arg[0], - arg[1],arg[2],arg[3],arg[4] ); + colflash_apply(frames[0],arg[0],arg[1],arg[2],arg[3],arg[4] ); break; case VJ_IMAGE_EFFECT_COLORMAP: colormap_apply(frames[0], arg[0], arg[1], arg[2]); @@ -352,7 +339,7 @@ static void vj_effman_apply_image_effect( ripple_apply(frames[0], arg[0], arg[1], arg[2]); break; case VJ_IMAGE_EFFECT_BGSUBTRACT: - bgsubtract_apply( frames[0],frames[0]->width,frames[0]->height,arg[0],arg[1],arg[2],arg[3]); + bgsubtract_apply( frames[0],arg[0],arg[1],arg[2],arg[3]); break; case VJ_IMAGE_EFFECT_BGSUBTRACTGAUSS: bgsubtractgauss_apply( frames[0],arg[0],arg[1],arg[2],arg[3],arg[4],arg[5]); @@ -361,7 +348,7 @@ static void vj_effman_apply_image_effect( bathroom_apply(frames[0], arg[0], arg[1], arg[2], arg[3]); break; case VJ_IMAGE_EFFECT_RGBCHANNEL: - rgbchannel_apply(frames[0],frames[0]->width,frames[0]->height,arg[0],arg[1],arg[2]); + rgbchannel_apply(frames[0],arg[0],arg[1],arg[2]); break; case VJ_IMAGE_EFFECT_ZOOM: zoom_apply(frames[0], arg[0], arg[1], arg[2], arg[3], arg[4]); @@ -394,22 +381,22 @@ static void vj_effman_apply_image_effect( perspective_apply(frames[0],arg[0],arg[1],arg[2],arg[3],arg[4],arg[5],arg[6],arg[7],arg[8] ); break; case VJ_IMAGE_EFFECT_ALPHAFILL: - alphafill_apply( frames[0], frames[0]->width,frames[0]->height, arg[0] ); + alphafill_apply( frames[0], arg[0] ); break; case VJ_IMAGE_EFFECT_ALPHA2IMG: - alpha2img_apply( frames[0], frames[0]->width,frames[0]->height ); + alpha2img_apply( frames[0] ); break; case VJ_IMAGE_EFFECT_TOALPHA: - toalpha_apply( frames[0], frames[0]->width,frames[0]->height, arg[0] ); + toalpha_apply( frames[0], arg[0] ); break; case VJ_IMAGE_EFFECT_ALPHAFLATTEN: - alphaflatten_apply(frames[0],frames[0]->width,frames[0]->height,arg[0]); + alphaflatten_apply(frames[0], arg[0]); break; case VJ_IMAGE_EFFECT_ALPHAFEATHERMASK: - feathermask_apply(frames[0], frames[0]->width, frames[0]->height ); + feathermask_apply(frames[0] ); break; case VJ_IMAGE_EFFECT_ALPHASELECT: - alphaselect_apply(frames[0],frames[0]->width,frames[0]->height,arg[0],arg[1],arg[2],arg[3],arg[4]); + alphaselect_apply(frames[0],arg[0],arg[1],arg[2],arg[3],arg[4]); break; case VJ_IMAGE_EFFECT_ALPHASELECT2: alphaselect2_apply(frames[0],arg[0],arg[1],arg[2],arg[3],arg[4],arg[5]); @@ -418,7 +405,7 @@ static void vj_effman_apply_image_effect( pixelate_apply(frames[0],arg[0]); break; case VJ_IMAGE_EFFECT_ALPHANEGATE: - alphanegate_apply(frames[0],frames[0]->width,frames[0]->height,arg[0]); + alphanegate_apply(frames[0],arg[0]); break; case VJ_IMAGE_EFFECT_CHOKEMATTE: gaussblur_apply(frames[0], arg[0],arg[1],arg[2] ); @@ -445,25 +432,22 @@ static void vj_effman_apply_video_effect( VJFrame **frames, vjp_kf *todo_info,in switch(e) { case VJ_VIDEO_EFFECT_CHAMBLEND: - chameleonblend_apply(frames[0],frames[1], frames[0]->width,frames[0]->height,arg[0]); + chameleonblend_apply(frames[0], frames[1], arg[0]); break; case VJ_VIDEO_EFFECT_EXTDIFF: - differencemap_apply( frames[0],frames[1],frames[0]->width,frames[0]->height,arg[0],arg[1],arg[2]); + differencemap_apply( frames[0],frames[1],arg[0],arg[1],arg[2]); break; case VJ_VIDEO_EFFECT_EXTTHRESHOLD: - threshold_apply( frames[0],frames[1],frames[0]->width,frames[0]->height,arg[0],arg[1]); + threshold_apply( frames[0],frames[1],arg[0],arg[1]); break; case VJ_VIDEO_EFFECT_VIDEOWALL: - videowall_apply(frames[0],frames[1],frames[0]->width, - frames[0]->height,arg[0],arg[1],arg[2],arg[3]); + videowall_apply(frames[0],frames[1],arg[0],arg[1],arg[2],arg[3]); break; case VJ_VIDEO_EFFECT_VIDEOPLAY: - videoplay_apply(frames[0],frames[1],frames[0]->width, - frames[0]->height,arg[0],arg[1],arg[2]); + videoplay_apply(frames[0],frames[1],arg[0],arg[1],arg[2]); break; case VJ_VIDEO_EFFECT_TRIPPLICITY: - tripplicity_apply(frames[0],frames[1], - frames[0]->width,frames[0]->height, arg[0],arg[1],arg[2]); + tripplicity_apply(frames[0],frames[1], arg[0],arg[1],arg[2]); break; case VJ_VIDEO_EFFECT_COMPLEXTHRESHOLD: complexthreshold_apply(frames[0], frames[1], arg[0], arg[1], arg[2], arg[3], @@ -476,7 +460,8 @@ static void vj_effman_apply_video_effect( VJFrame **frames, vjp_kf *todo_info,in lumamagic_apply(frames[0], frames[1], arg[0], arg[1],arg[2]); break; case VJ_VIDEO_EFFECT_BINARYOVERLAY: - binaryoverlay_apply(frames[0], frames[1],frames[0]->width,frames[0]->height,arg[0] ); break; + binaryoverlay_apply(frames[0], frames[1],arg[0] ); + break; case VJ_VIDEO_EFFECT_OVERLAYMAGIC: overlaymagic_apply(frames[0], frames[1], arg[0],arg[1]); break; @@ -490,12 +475,13 @@ static void vj_effman_apply_video_effect( VJFrame **frames, vjp_kf *todo_info,in lumamask_apply(frames[0], frames[1], arg[0],arg[1],arg[2],arg[3]); break; case VJ_VIDEO_EFFECT_DISSOLVE: - dissolve_apply(frames[0],frames[1],frames[0]->width,frames[0]->height,arg[0]);break; + dissolve_apply(frames[0],frames[1],arg[0]); + break; case VJ_VIDEO_EFFECT_OPACITY: opacity_apply(frames[0], frames[1], arg[0]); break; case VJ_VIDEO_EFFECT_IRIS: - iris_apply( frames[0],frames[1], frames[0]->width,frames[0]->height,arg[0],arg[1]); + iris_apply( frames[0],frames[1],arg[0],arg[1]); break; case VJ_VIDEO_EFFECT_THRESHOLDSMOOTH: opacitythreshold_apply(frames[0], frames[1], arg[0], arg[1], arg[2]); @@ -615,46 +601,45 @@ static void vj_effman_apply_video_effect( VJFrame **frames, vjp_kf *todo_info,in arg[4], arg[5], arg[6]); break; case VJ_VIDEO_EFFECT_PICINPIC: - picinpic_apply( vj_effects[entry]->user_data,frames[0], frames[1], frames[0]->width, frames[0]->height, - arg[0], arg[1], arg[2], arg[3] ); + picinpic_apply( vj_effects[entry]->user_data,frames[0], frames[1], + arg[0], arg[1], arg[2], arg[3] ); break; case VJ_VIDEO_EFFECT_RIPPLETV: water_apply( vj_effects[entry]->user_data,frames[0],frames[1],arg[0],arg[1],arg[2],arg[3],arg[4] ); break; case VJ_VIDEO_EFFECT_RADIOACTIVE: - radioactivetv_apply( frames[0],frames[1], frames[0]->width,frames[0]->height,arg[0],arg[1],arg[2],arg[3]); + radioactivetv_apply( frames[0],frames[1],arg[0],arg[1],arg[2],arg[3]); break; case VJ_VIDEO_EFFECT_AVERAGEBLEND: - average_blend_apply(frames[0], frames[1], frames[0]->width, - frames[0]->height, arg[0]); + average_blend_apply(frames[0], frames[1], arg[0]); break; case VJ_VIDEO_EFFECT_MIXTOALPHA: - mixtoalpha_apply( frames[0],frames[1], frames[0]->width,frames[0]->height,arg[0],arg[1]); + mixtoalpha_apply( frames[0],frames[1],arg[0],arg[1]); break; case VJ_VIDEO_EFFECT_MAGICALPHA: - overlayalphamagic_apply(frames[0],frames[1],frames[0]->width,frames[0]->height,arg[0],arg[1]); + overlayalphamagic_apply(frames[0], frames[1], arg[0], arg[1]); break; case VJ_VIDEO_EFFECT_TRAVELMATTE: - travelmatte_apply(frames[0],frames[1],frames[0]->width,frames[0]->height,arg[0]); + travelmatte_apply(frames[0],frames[1],arg[0]); break; case VJ_VIDEO_EFFECT_ALPHABLEND: - alphablend_apply(frames[0],frames[1],frames[0]->width,frames[0]->height); + alphablend_apply(frames[0],frames[1]); break; case VJ_VIDEO_EFFECT_PORTERDUFF: - porterduff_apply(frames[0],frames[1],frames[0]->width,frames[0]->height,arg[0]); + porterduff_apply(frames[0], frames[1], arg[0]); break; case VJ_VIDEO_EFFECT_LUMAKEYALPHA: - lumakeyalpha_apply(frames[0],frames[1],frames[0]->width,frames[0]->height,arg[0],arg[1]); + lumakeyalpha_apply(frames[0],frames[1],arg[0],arg[1]); break; case VJ_VIDEO_EFFECT_CHROMAMAGICKALPHA: - chromamagickalpha_apply(frames[0],frames[1],frames[0]->width,frames[0]->height,arg[0],arg[1]); + chromamagickalpha_apply(frames[0],frames[1],arg[0],arg[1]); break; case VJ_VIDEO_EFFECT_MAGICOVERLAYALPHA: - overlaymagicalpha_apply(frames[0],frames[1],frames[0]->width,frames[0]->height,arg[0],arg[1]); + overlaymagicalpha_apply(frames[0],frames[1],arg[0],arg[1]); break; case VJ_VIDEO_EFFECT_MASKTRANSITION: - masktransition_apply(frames[0],frames[1],frames[0]->width,frames[0]->height,arg[0],arg[1]); + masktransition_apply(frames[0],frames[1],arg[0],arg[1]); break; case VJ_VIDEO_EFFECT_PASSTHROUGH: passthrough_apply(frames[0],frames[1]);