Codebase list frei0r / e9d4dcd
Add a bunch of bug-fix patches cherry-picked from upstream VCS. Jonas Smedegaard 13 years ago
46 changed file(s) with 2213 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
0 Description: Add #ifndef around all the math macros.
1 OpenCV defines MIN and MAX. Potentially other libs can too and more.
2 Origin: upstream, http://git.dyne.org/frei0r/commit/?id=2a1524a
3 Author: Dan Dennedy <dan@dennedy.org>
4 Forwarded: yes
5 Last-Update: 2012-12-23
6
7 --- a/include/frei0r_math.h
8 +++ b/include/frei0r_math.h
9 @@ -17,38 +17,58 @@
10 */
11
12 /* Clamps a int32-range int between 0 and 255 inclusive. */
13 +#ifndef CLAMP0255
14 unsigned char CLAMP0255(int32_t a)
15 {
16 return (unsigned char)
17 ( (((-a) >> 31) & a) // 0 if the number was negative
18 | (255 - a) >> 31); // -1 if the number was greater than 255
19 }
20 +#endif
21
22 /* Provided temporary int t, returns a * b / 255 */
23 +#ifndef INT_MULT
24 #define INT_MULT(a,b,t) ((t) = (a) * (b) + 0x80, ((((t) >> 8) + (t)) >> 8))
25 +#endif
26
27 /* This version of INT_MULT3 is very fast, but suffers from some
28 slight roundoff errors. It returns the correct result 99.987
29 percent of the time */
30 +#ifndef INT_MULT3
31 #define INT_MULT3(a,b,c,t) ((t) = (a) * (b) * (c) + 0x7F5B, \
32 ((((t) >> 7) + (t)) >> 16))
33 +#endif
34
35 +#ifndef INT_BLEND
36 #define INT_BLEND(a,b,alpha,tmp) (INT_MULT((a) - (b), alpha, tmp) + (b))
37 +#endif
38
39 +#ifndef CLAMP
40 //! Clamp x at lower = l and upper = u.
41 #define CLAMP(x,l,u) ( x < l ? l : ( x > u ? u : x ) )
42 +#endif
43
44 +#ifndef ROUND
45 //! Round.
46 #define ROUND(x) ((int32_t)((x)+0.5))
47 +#endif
48
49 +#ifndef SQR
50 //! Square.
51 #define SQR(x) ((x) * (x))
52 +#endif
53
54 +#ifndef MAX255
55 //! Limit a (0->511) int to 255.
56 uint8_t MAX255(uint32_t a) { return (uint8_t) (a | ((a & 256) - ((a & 256) >> 8))); }
57 +#endif
58
59 +#ifndef MIN
60 #define MIN(x, y) ((x) < (y) ? (x) : (y));
61 +#endif
62
63 +#ifndef MAX
64 #define MAX(x, y) ((x) > (y) ? (x) : (y));
65 +#endif
66
67 #endif
0 Description: Sanitize parameters in OpenCV filters.
1 Some very low parameter values would case a crash inside OpenCV or make
2 it unresponsive (deadlock or infinite loop - did not check).
3 Origin: upstream, http://git.dyne.org/frei0r/commit/?id=b4065ce
4 Author: Dan Dennedy <dan@dennedy.org>
5 Forwarded: yes
6 Last-Update: 2012-12-23
7
8 --- a/src/filter/facebl0r/facebl0r.cpp
9 +++ b/src/filter/facebl0r/facebl0r.cpp
10 @@ -21,6 +21,7 @@
11 #include <opencv/highgui.h>
12
13 #include <frei0r.hpp>
14 +#include <frei0r_math.h>
15
16 typedef struct {
17 IplImage* hsv; //input image converted to HSV
18 @@ -133,7 +134,7 @@
19 if (!cascade) {
20 cvSetNumThreads(cvRound(threads * 100));
21 get_param_value(&classifier, FACEBL0R_PARAM_CLASSIFIER);
22 - if (classifier) {
23 + if (classifier && strcmp(classifier, "")) {
24 if ( strcmp(classifier, old_classifier) == 0) {
25 // same as before, avoid repeating error messages
26 memcpy(out, in, size * 4); // of course assuming we are RGBA only
27 @@ -154,6 +155,12 @@
28 return;
29 }
30 }
31 +
32 + // sanitize parameters
33 + recheck = CLAMP(recheck, 0.001, 1.0);
34 + search_scale = CLAMP(search_scale, 0.11, 1.0);
35 + neighbors = CLAMP(neighbors, 0.01, 1.0);
36 +
37 if( !image )
38 image = cvCreateImage( cvSize(width,height), IPL_DEPTH_8U, 4 );
39
40 --- a/src/filter/facedetect/facedetect.cpp
41 +++ b/src/filter/facedetect/facedetect.cpp
42 @@ -27,6 +27,7 @@
43 #include <ctype.h>
44 #include <opencv/cv.h>
45 #include "frei0r.hpp"
46 +#include "frei0r_math.h"
47
48 #define USE_ROI
49 #define PAD (40)
50 @@ -125,7 +126,7 @@
51 cvSetNumThreads(cvRound(threads * 100));
52 f0r_param_string classifier;
53 get_param_value(&classifier, FACEBL0R_PARAM_CLASSIFIER);
54 - if (classifier) {
55 + if (classifier && strcmp(classifier, "")) {
56 cascade = (CvHaarClassifierCascade*) cvLoad(classifier, 0, 0, 0 );
57 if (!cascade)
58 fprintf(stderr, "ERROR: Could not load classifier cascade %s\n", classifier);
59 @@ -136,7 +137,11 @@
60 return;
61 }
62 }
63 -
64 +
65 + // sanitize parameters
66 + search_scale = CLAMP(search_scale, 0.11, 1.0);
67 + neighbors = CLAMP(neighbors, 0.01, 1.0);
68 +
69 // copy input image to OpenCV
70 if( !image )
71 image = cvCreateImage(cvSize(width, height), IPL_DEPTH_8U, 4);
0 Description: Fix broken color parameters in facedetect.
1 They were all setting the first color!
2 Origin: upstream, http://git.dyne.org/frei0r/commit/?id=6c65d6a
3 Author: Dan Dennedy <dan@dennedy.org>
4 Forwarded: yes
5 Last-Update: 2012-12-23
6
7 --- a/src/filter/facedetect/facedetect.cpp
8 +++ b/src/filter/facedetect/facedetect.cpp
9 @@ -101,16 +101,16 @@
10 register_param(color[0], "Color 1", "The color of the first object");
11 f0r_param_color color1 = {0.0, 0.5, 1.0};
12 color[1] = color1;
13 - register_param(color[0], "Color 2", "The color of the second object");
14 + register_param(color[1], "Color 2", "The color of the second object");
15 f0r_param_color color2 = {0.0, 1.0, 1.0};
16 color[2] = color2;
17 - register_param(color[0], "Color 3", "The color of the third object");
18 + register_param(color[2], "Color 3", "The color of the third object");
19 f0r_param_color color3 = {0.0, 1.0, 0.0};
20 color[3] = color3;
21 - register_param(color[0], "Color 4", "The color of the fourth object");
22 + register_param(color[3], "Color 4", "The color of the fourth object");
23 f0r_param_color color4 = {1.0, 0.5, 0.0};
24 color[4] = color4;
25 - register_param(color[0], "Color 5", "The color of the fifth object");
26 + register_param(color[4], "Color 5", "The color of the fifth object");
27 srand(::time(NULL));
28 }
29
0 Description: Defish0r: fix possible /0 problem
1 Origin: upstream, http://git.dyne.org/frei0r/commit/?id=0309859
2 Author: Marko Cebokli <mc@mcpc14.site>
3 Forwarded: yes
4 Last-Update: 2012-12-23
5
6 --- a/src/filter/defish0r/interp.h
7 +++ b/src/filter/defish0r/interp.h
8 @@ -722,10 +722,10 @@
9 for (i=7;i>=0;i--)
10 {
11 x1=xx*PI;
12 - wy[7-i]=(sin(x1)/(x1))*(sin(x1*0.125)/(x1*0.125));
13 + wy[7-i]=(x1!=0)?(sin(x1)/(x1))*(sin(x1*0.125)/(x1*0.125)):1.0;
14 xxx=(float)(2*i+1)-xx;
15 x1=xxx*PI;
16 - wy[8+i]=(sin(x1)/(x1))*(sin(x1*0.125)/(x1*0.125));
17 + wy[8+i]=(x1!=0)?(sin(x1)/(x1))*(sin(x1*0.125)/(x1*0.125)):1.0;
18 xx=xx-1.0;
19 }
20 //se po x
21 @@ -733,10 +733,10 @@
22 for (i=7;i>=0;i--)
23 {
24 x1=xx*PI;
25 - wx[7-i]=(sin(x1)/(x1))*(sin(x1*0.125)/(x1*0.125));
26 + wx[7-i]=(x1!=0)?(sin(x1)/(x1))*(sin(x1*0.125)/(x1*0.125)):1.0;
27 xxx=(float)(2*i+1)-xx;
28 x1=xxx*PI;
29 - wx[8+i]=(sin(x1)/(x1))*(sin(x1*0.125)/(x1*0.125));
30 + wx[8+i]=(x1!=0)?(sin(x1)/(x1))*(sin(x1*0.125)/(x1*0.125)):1.0;
31 xx=xx-1.0;
32 }
33
34 @@ -781,10 +781,10 @@
35 for (i=7;i>=0;i--)
36 {
37 x1=xx*PI;
38 - wy[7-i]=(sin(x1)/(x1))*(sin(x1*0.125)/(x1*0.125));
39 + wy[7-i]=(x1!=0)?(sin(x1)/(x1))*(sin(x1*0.125)/(x1*0.125)):1.0;
40 xxx=(float)(2*i+1)-xx;
41 x1=xxx*PI;
42 - wy[8+i]=(sin(x1)/(x1))*(sin(x1*0.125)/(x1*0.125));
43 + wy[8+i]=(x1!=0)?(sin(x1)/(x1))*(sin(x1*0.125)/(x1*0.125)):1.0;
44 xx=xx-1.0;
45 }
46 //se po x
47 @@ -792,10 +792,10 @@
48 for (i=7;i>=0;i--)
49 {
50 x1=xx*PI;
51 - wx[7-i]=(sin(x1)/(x1))*(sin(x1*0.125)/(x1*0.125));
52 + wx[7-i]=(x1!=0)?(sin(x1)/(x1))*(sin(x1*0.125)/(x1*0.125)):1.0;
53 xxx=(float)(2*i+1)-xx;
54 x1=xxx*PI;
55 - wx[8+i]=(sin(x1)/(x1))*(sin(x1*0.125)/(x1*0.125));
56 + wx[8+i]=(x1!=0)?(sin(x1)/(x1))*(sin(x1*0.125)/(x1*0.125)):1.0;
57 xx=xx-1.0;
58 }
59
0 Description: Corners: fix possible /0 problem
1 Origin: upstream, http://git.dyne.org/frei0r/commit/?id=f73c962
2 Author: Marko Cebokli <mc@mcpc14.site>
3 Forwarded: yes
4 Last-Update: 2012-12-23
5
6 --- a/src/filter/c0rners/interp.h
7 +++ b/src/filter/c0rners/interp.h
8 @@ -722,10 +722,10 @@
9 for (i=7;i>=0;i--)
10 {
11 x1=xx*PI;
12 - wy[7-i]=(sin(x1)/(x1))*(sin(x1*0.125)/(x1*0.125));
13 + wy[7-i]=(x1!=0)?(sin(x1)/(x1))*(sin(x1*0.125)/(x1*0.125)):1.0;
14 xxx=(float)(2*i+1)-xx;
15 x1=xxx*PI;
16 - wy[8+i]=(sin(x1)/(x1))*(sin(x1*0.125)/(x1*0.125));
17 + wy[8+i]=(x1!=0)?(sin(x1)/(x1))*(sin(x1*0.125)/(x1*0.125)):1.0;
18 xx=xx-1.0;
19 }
20 //se po x
21 @@ -733,10 +733,10 @@
22 for (i=7;i>=0;i--)
23 {
24 x1=xx*PI;
25 - wx[7-i]=(sin(x1)/(x1))*(sin(x1*0.125)/(x1*0.125));
26 + wx[7-i]=(x1!=0)?(sin(x1)/(x1))*(sin(x1*0.125)/(x1*0.125)):1.0;
27 xxx=(float)(2*i+1)-xx;
28 x1=xxx*PI;
29 - wx[8+i]=(sin(x1)/(x1))*(sin(x1*0.125)/(x1*0.125));
30 + wx[8+i]=(x1!=0)?(sin(x1)/(x1))*(sin(x1*0.125)/(x1*0.125)):1.0;
31 xx=xx-1.0;
32 }
33
34 @@ -781,10 +781,10 @@
35 for (i=7;i>=0;i--)
36 {
37 x1=xx*PI;
38 - wy[7-i]=(sin(x1)/(x1))*(sin(x1*0.125)/(x1*0.125));
39 + wy[7-i]=(x1!=0)?(sin(x1)/(x1))*(sin(x1*0.125)/(x1*0.125)):1.0;
40 xxx=(float)(2*i+1)-xx;
41 x1=xxx*PI;
42 - wy[8+i]=(sin(x1)/(x1))*(sin(x1*0.125)/(x1*0.125));
43 + wy[8+i]=(x1!=0)?(sin(x1)/(x1))*(sin(x1*0.125)/(x1*0.125)):1.0;
44 xx=xx-1.0;
45 }
46 //se po x
47 @@ -792,10 +792,10 @@
48 for (i=7;i>=0;i--)
49 {
50 x1=xx*PI;
51 - wx[7-i]=(sin(x1)/(x1))*(sin(x1*0.125)/(x1*0.125));
52 + wx[7-i]=(x1!=0)?(sin(x1)/(x1))*(sin(x1*0.125)/(x1*0.125)):1.0;
53 xxx=(float)(2*i+1)-xx;
54 x1=xxx*PI;
55 - wx[8+i]=(sin(x1)/(x1))*(sin(x1*0.125)/(x1*0.125));
56 + wx[8+i]=(x1!=0)?(sin(x1)/(x1))*(sin(x1*0.125)/(x1*0.125)):1.0;
57 xx=xx-1.0;
58 }
59
0 Description: 3dflippo: plug a mem leak
1 Origin: upstream, http://git.dyne.org/frei0r/commit/?id=339ad24
2 Author: Marko Cebokli <mc@mcpc14.site>
3 Forwarded: yes
4 Last-Update: 2012-12-23
5
6 --- a/src/filter/3dflippo/3dflippo.c
7 +++ b/src/filter/3dflippo/3dflippo.c
8 @@ -442,4 +442,5 @@
9 inst->mask[pos]=ny*inst->width+nx;
10 }
11 }
12 + matfree(mat);
13 }
0 Description: Hueshift0r: use BT 709 luma coeffs
1 Origin: upstream, http://git.dyne.org/frei0r/commit/?id=899fd4d
2 Author: Marko Cebokli <mc@mcpc14.site>
3 Forwarded: yes
4 Last-Update: 2012-12-23
5
6 --- a/src/filter/hueshift0r/matrix.h
7 +++ b/src/filter/hueshift0r/matrix.h
8 @@ -10,9 +10,17 @@
9 #include <math.h>
10 #include <stdio.h>
11
12 +/*
13 +//Adobe ?? luma coeffs
14 #define RLUM (0.3086)
15 #define GLUM (0.6094)
16 #define BLUM (0.0820)
17 +*/
18 +
19 +//ITU_R BT 709 luma coeffs
20 +#define RLUM (0.2126)
21 +#define GLUM (0.7152)
22 +#define BLUM (0.0722)
23
24 #define OFFSET_R 0
25 #define OFFSET_G 1
0 Description: Test_pat_G: fix possible /0 problem
1 Origin: upstream, http://git.dyne.org/frei0r/commit/?id=9e606ce
2 Author: Marko Cebokli <mc@mcpc14.site>
3 Forwarded: yes
4 Last-Update: 2012-12-23
5
6 --- a/src/generator/test_pat/test_pat_G.c
7 +++ b/src/generator/test_pat/test_pat_G.c
8 @@ -155,6 +155,7 @@
9 unsigned char black,gray1,gray2,white;
10 int ox,oy;
11
12 +if (size<1) size=1;
13 kx=size; ky=size;
14 kx=kx/ar; //kao aspect!=1 (anamorph)
15
16 @@ -214,6 +215,8 @@
17
18 if (clr!=0) for (i=0;i<(w*h);i++) sl[i]=black; //black background
19
20 +if (size1<1) size1=1;
21 +if (size2<1) size2=1;
22 iz=h/2-size1*((h/2)/size1);
23 for (i=iz;i<h;i=i+size1) //hor. lines
24 draw_rectangle(sl,w,h,0,i-size2/2,w,size2,white);
25 @@ -233,6 +236,9 @@
26
27 if (clr!=0) for (i=0;i<(w*h);i++) sl[i]=black; //black background
28
29 +if (size1<1) size1=1;
30 +if (size2<1) size2=1;
31 +if (ar==0) ar=1.0;
32 size1=size1/ar;
33 iz=w/2-size1*((w/2)/size1);
34 for (i=iz;i<w;i=i+size1) //vert. lines
35 @@ -245,6 +251,7 @@
36 void mreza(unsigned char *sl, int w, int h, int size1, int size2, float ar)
37 {
38
39 +if (ar==0) ar=1.0;
40 hlines(sl, w, h, size1, size2, ar, 1);
41 vlines(sl, w, h, size1/ar, size2, ar, 0);
42
43 @@ -263,6 +270,9 @@
44
45 for (i=0;i<(w*h);i++) sl[i]=black; //black background
46
47 +if (size1<1) size1=1;
48 +if (size2<1) size2=1;
49 +if (ar==0) ar=1.0;
50 size1a=size1/ar; size2a=size2/ar;
51 iz=h/2-size1*((h/2)/size1);
52 jz=w/2-size1a*((w/2)/size1a);
0 Description: Saturat0r: set default in constructor
1 Origin: upstream, http://git.dyne.org/frei0r/commit/?id=f74a435
2 Author: Marko Cebokli <mc@mcpc14.site>
3 Forwarded: yes
4 Last-Update: 2012-12-23
5
6 --- a/src/filter/saturat0r/saturat0r.c
7 +++ b/src/filter/saturat0r/saturat0r.c
8 @@ -69,6 +69,7 @@
9 {
10 saturat0r_instance_t* inst = (saturat0r_instance_t*)calloc(1, sizeof(*inst));
11 inst->width = width; inst->height = height;
12 + inst->saturation=1.0/MAX_SATURATION;
13 return (f0r_instance_t)inst;
14 }
15
0 Description: Sharpness: plug memory leak
1 Origin: upstream, http://git.dyne.org/frei0r/commit/?id=2ddbaba
2 Author: Marko Cebokli <mc@mcpc14.site>
3 Forwarded: yes
4 Last-Update: 2012-12-23
5
6 --- a/src/filter/sharpness/sharpness.c
7 +++ b/src/filter/sharpness/sharpness.c
8 @@ -230,6 +230,7 @@
9 void f0r_destruct(f0r_instance_t instance)
10 {
11 inst *in;
12 +int i;
13
14 in=(inst*)instance;
15
16 @@ -239,6 +240,7 @@
17 free(in->Rplano);
18 free(in->Gplano);
19 free(in->Bplano);
20 +for (i=0;i<in->fp.msizeY;i++) free(in->fp.SC[i]);
21
22 free(instance);
23 }
0 Description: C0rneres: remove leftover printf
1 Origin: upstream, http://git.dyne.org/frei0r/commit/?id=9bf94ea
2 Author: Marko Cebokli <mc@mcpc14.site>
3 Forwarded: yes
4 Last-Update: 2012-12-23
5
6 --- a/src/filter/c0rners/c0rners.c
7 +++ b/src/filter/c0rners/c0rners.c
8 @@ -895,7 +895,6 @@
9 break;
10 case 14: //Alpha operation
11 p->op=map_value_forward(*((double*)parm), 0.0, 4.9999);
12 - printf("setting p->op: %i\n", p->op);
13 break;
14 }
15
0 Description: Pr0file: fix defaults
1 Origin: upstream, http://git.dyne.org/frei0r/commit/?id=c8d6510
2 Author: Marko Cebokli <mc@mcpc14.site>
3 Forwarded: yes
4 Last-Update: 2012-12-23
5
6 --- a/src/filter/measure/pr0file.c
7 +++ b/src/filter/measure/pr0file.c
8 @@ -317,7 +317,7 @@
9 for (i=0;i<256;i++) {fs[i]=0; str[i]=0;}
10 if ((dit&0x00000001)!=0) //marker 1 value
11 {
12 - if (m1>=0)
13 + if (m1>0)
14 {
15 forstr(data[0],1-u,0,frs);
16 sprintf(fs,"%%s Mk1=%s", frs);
17 @@ -328,7 +328,7 @@
18 }
19 if ((dit&0x00000004)!=0) //marker 2 value
20 {
21 - if (m2>=0)
22 + if (m2>0)
23 {
24 forstr(data[1],1-u,0,frs);
25 sprintf(fs,"%%s Mk2=%s", frs);
26 @@ -339,7 +339,7 @@
27 }
28 if ((dit&0x00000010)!=0) //difference marker2-marker1
29 {
30 - if ((m2>=0)&&(m1>=0))
31 + if ((m2>0)&&(m1>0))
32 {
33 forstr(data[2],1-u,0,frs);
34 sprintf(fs,"%%s D=%s", frs);
35 @@ -764,8 +764,8 @@
36 in->tilt=0.0;
37 in->len=3*width/4;
38 in->chn=3;
39 -in->m1=-1;
40 -in->m2=-1;
41 +in->m1=0;
42 +in->m2=0;
43 in->rt=1;
44 in->gt=1;
45 in->bt=1;
0 Description: Test_pat_I: add some safeguards against /0
1 Origin: upstream, http://git.dyne.org/frei0r/commit/?id=0b4044c
2 Author: Marko Cebokli <mc@mcpc14.site>
3 Forwarded: yes
4 Last-Update: 2012-12-23
5
6 --- a/src/generator/test_pat/test_pat_I.c
7 +++ b/src/generator/test_pat/test_pat_I.c
8 @@ -140,6 +140,7 @@
9 int i,j;
10 float d,st,ct,g;
11
12 +if (size==0.0) return;
13 st=sinf(tilt);
14 ct=cosf(tilt);
15 for (i=0;i<h;i++)
16 @@ -167,6 +168,7 @@
17 int i,j;
18 float d,st,ct,g;
19
20 +if (size==0.0) return;
21 st=sinf(tilt);
22 ct=cosf(tilt);
23 for (i=0;i<h;i++)
24 @@ -197,6 +199,7 @@
25 int i,j;
26 float d,st,ct,g;
27
28 +if (size==0.0) return;
29 st=sinf(tilt);
30 ct=cosf(tilt);
31 for (i=0;i<h;i++)
0 Description: Test_pat_R: add some safeguards against /0
1 Origin: upstream, http://git.dyne.org/frei0r/commit/?id=1bb4a6c
2 Author: Marko Cebokli <mc@mcpc14.site>
3 Forwarded: yes
4 Last-Update: 2012-12-23
5
6 --- a/src/generator/test_pat/test_pat_R.c
7 +++ b/src/generator/test_pat/test_pat_R.c
8 @@ -134,6 +134,8 @@
9 kx=x+wr; if (kx>w) kx=w;
10 ky=y+hr; if (ky>h) ky=h;
11
12 +if (f1==0.0) f1=1.0E-12;
13 +if (f2==0.0) f2=1.0E-12;
14 dp1=PI*f1; dp2=PI*f2; //phase steps
15 dt1=1.0/dp1; dt2=1.0/dp2;
16 a=a/2.0;
17 @@ -200,6 +202,8 @@
18 kx=x+wr; if (kx>w) kx=w;
19 ky=y+hr; if (ky>h) ky=h;
20
21 +if (f1==0.0) f1=1.0E-12;
22 +if (f2==0.0) f2=1.0E-12;
23 dp1=PI*f1; dp2=PI*f2; //phase steps
24 dt1=1.0/dp1; dt2=1.0/dp2;
25 a=a/2.0;
26 @@ -262,6 +266,11 @@
27
28 for (x=0;x<w*h;x++) sl[x]=0.0; //black background
29
30 +if ((w==0)||(h==0)) return;
31 +if (ef==0.0) ef=1.0E-12;
32 +if (sf==0.0) sf=1.0E-12;
33 +if (ef==sf) ef=ef+1E-12;
34 +
35 if (a==0)
36 draw_sweep_1(sl,w,h,w/8,h/16,6*w/8,14*h/16, sf, ef, amp, 0, lps);
37 else
38 @@ -345,6 +354,11 @@
39
40 for (x=0;x<w*h;x++) sl[x]=0.0; //black background
41
42 +if ((w==0)||(h==0)) return;
43 +if (ef==0.0) ef=1.0E-12;
44 +if (sf==0.0) sf=1.0E-12;
45 +if (ef==sf) ef=ef+1E-12;
46 +
47 if (a==0)
48 draw_sweep_2(sl,w,h,w/16,h/8,14*w/16,6*h/8, sf, ef, amp, 1, lps);
49 else
50 @@ -449,6 +463,8 @@
51
52 da=PI/2000.0;
53
54 +if (h==0) return;
55 +
56 a=a/2.0;
57 rmax=(float)h/2.1;
58 if (linp==0)
0 Description: Test_pat_I: fix problem with parameter return
1 Origin: upstream, http://git.dyne.org/frei0r/commit/?id=6197fb0
2 Author: Marko Cebokli <mc@mcpc14.site>
3 Forwarded: yes
4 Last-Update: 2012-12-23
5
6 --- a/src/generator/test_pat/test_pat_I.c
7 +++ b/src/generator/test_pat/test_pat_I.c
8 @@ -573,10 +573,10 @@
9 *p = map_value_backward(inst->pw, 1.0, 100.0);
10 break;
11 case 4: //tilt
12 - *p = map_value_backward_log(inst->tilt, -PI/2.0, PI/2.0);
13 + *p = map_value_backward(inst->tilt, -PI/2.0, PI/2.0);
14 break;
15 case 5: //negative
16 - *p = map_value_backward_log(inst->neg, 0.0, 1.0);
17 + *p = map_value_backward(inst->neg, 0.0, 1.0);
18 break;
19 }
20 }
0 Description: Test_pat_R: fix problem with parameter return
1 Origin: upstream, http://git.dyne.org/frei0r/commit/?id=e0f11e9
2 Author: Marko Cebokli <mc@mcpc14.site>
3 Forwarded: yes
4 Last-Update: 2012-12-23
5
6 --- a/src/generator/test_pat/test_pat_R.c
7 +++ b/src/generator/test_pat/test_pat_R.c
8 @@ -1026,10 +1026,10 @@
9 *p = map_value_backward(inst->linp, 0.0, 1.0);
10 break;
11 case 4: //frequency 1
12 - *p = map_value_backward_log(inst->f1, 0.0, 1.0);
13 + *p = map_value_backward(inst->f1, 0.0, 1.0);
14 break;
15 case 5: //frequency 2
16 - *p = map_value_backward_log(inst->f2, 0.0, 1.0);
17 + *p = map_value_backward(inst->f2, 0.0, 1.0);
18 break;
19 case 6: //aspect type
20 *p = map_value_backward(inst->aspt, 0.0, 6.9999);
0 Description: Light graffiti: Initializing all values to a default value
1 Origin: upstream, http://git.dyne.org/frei0r/commit/?id=dc23844
2 Author: Simon A. Eugster <simon.eu@gmail.com>
3 Forwarded: yes
4 Last-Update: 2012-12-23
5
6 --- a/src/filter/lightgraffiti/lightgraffiti.cpp
7 +++ b/src/filter/lightgraffiti/lightgraffiti.cpp
8 @@ -167,10 +167,19 @@
9 m_pSensitivity = 1;
10 m_pBackgroundWeight = 0;
11 m_pThresholdBrightness = 450;
12 + m_pThresholdDifference = 0;
13 m_pThresholdDiffSum = 0;
14 m_pDim = 0;
15 m_pSaturation = 1;
16 + m_pLowerOverexposure = 0;
17 + m_pStatsBrightness = false;
18 + m_pStatsDiff = false;
19 + m_pStatsDiffSum = false;
20 + m_pReset = false;
21 + m_pTransparentBackground = false;
22 m_pBlackReference = false;
23 + m_pLongAlpha = 0;
24 + m_pNonlinearDim = 0;
25
26 }
27
0 Description: Fix scanline0r writing beyond end of out buffer.
1 Origin: upstream, http://git.dyne.org/frei0r/commit/?id=39e4492
2 Author: Dan Dennedy <dan@dennedy.org>
3 Forwarded: yes
4 Last-Update: 2012-12-23
5
6 --- a/src/filter/scanline0r/scanline0r.cpp
7 +++ b/src/filter/scanline0r/scanline0r.cpp
8 @@ -15,7 +15,7 @@
9 for (unsigned int line=0; line < height; line+=4)
10 {
11 std::copy(in+line*width,in+(line+1)*width,out+(line*width));
12 - std::fill(out+(line+1)*width,out+(line+5)*width,0x00000000);
13 + std::fill(out+(line+1)*width,out+(line+4)*width,0x00000000);
14 }
15 }
16
0 Description: Fix memory leak on deinit of delay0r.
1 Origin: upstream, http://git.dyne.org/frei0r/commit/?id=62b9f1c
2 Author: Dan Dennedy <dan@dennedy.org>
3 Forwarded: yes
4 Last-Update: 2012-12-23
5
6 --- a/src/filter/delay0r/delay0r.cpp
7 +++ b/src/filter/delay0r/delay0r.cpp
8 @@ -14,6 +14,15 @@
9 register_param(delay,"DelayTime","the delay time");
10 }
11
12 + ~delay0r()
13 + {
14 + for (std::list< std::pair< double, unsigned int* > >::iterator i=buffer.begin(); i != buffer.end(); ++i)
15 + {
16 + delete[] i->second;
17 + i=buffer.erase(i);
18 + }
19 + }
20 +
21 virtual void update()
22 {
23 unsigned int* reusable = 0;
0 Description: Fix default value for fader param in xfade0r.
1 Origin: upstream, http://git.dyne.org/frei0r/commit/?id=63f2186
2 Author: Dan Dennedy <dan@dennedy.org>
3 Forwarded: yes
4 Last-Update: 2012-12-23
5
6 --- a/src/mixer2/xfade0r/xfade0r.cpp
7 +++ b/src/mixer2/xfade0r/xfade0r.cpp
8 @@ -7,6 +7,7 @@
9 public:
10 xfade0r(unsigned int width, unsigned int height)
11 {
12 + fader = 0.0;
13 register_param(fader,"fader","the fader position");
14 }
15
0 Description: Fix alpha channel of cluster to be same as input.
1 Origin: upstream, http://git.dyne.org/frei0r/commit/?id=0eb9f2a
2 Author: Dan Dennedy <dan@dennedy.org>
3 Forwarded: yes
4 Last-Update: 2012-12-23
5
6 --- a/src/filter/cluster/cluster.c
7 +++ b/src/filter/cluster/cluster.c
8 @@ -311,6 +311,7 @@
9 dst2[0] = cc->r;
10 dst2[1] = cc->g;
11 dst2[2] = cc->b;
12 + dst2[3] = src2[3];
13
14
15
0 Description: Fix alpha channel of plasma to be opaque as intended.
1 Origin: upstream, http://git.dyne.org/frei0r/commit/?id=22e4f73
2 Author: Dan Dennedy <dan@dennedy.org>
3 Forwarded: yes
4 Last-Update: 2012-12-23
5
6 --- a/src/generator/dem0scene/plasma.cpp
7 +++ b/src/generator/dem0scene/plasma.cpp
8 @@ -222,12 +222,12 @@
9
10 uint32_t Plasma::palette2rgb(uint8_t idx) {
11 uint32_t rgba;
12 - rgba = 0xffffffff;
13 // just for little endian
14 // TODO: big endian
15 rgba = (colors[idx].r << 16)
16 | (colors[idx].g << 8)
17 - | (colors[idx].b );
18 + | (colors[idx].b )
19 + | (0xff << 24);
20
21 return rgba;
22 }
0 Description: Fix background of tehRoxx0r to be black silence.
1 Origin: upstream, http://git.dyne.org/frei0r/commit/?id=90ee1fa
2 Author: Dan Dennedy <dan@dennedy.org>
3 Forwarded: yes
4 Last-Update: 2012-12-23
5
6 --- a/src/filter/tehroxx0r/tehRoxx0r.c
7 +++ b/src/filter/tehroxx0r/tehRoxx0r.c
8 @@ -137,6 +137,8 @@
9 step_x = (double)w / (double)small_w;
10 step_y = (double)h / (double)small_h;
11
12 + // make background black transparent
13 + memset(outframe, 0, w * h * sizeof(uint32_t));
14
15 // copy a downscaled version into the middle of the result frame
16 // (blocksize to x-blocksize and blocksize to y-blocksize)
0 Description: Test_pat_G: fix problem with parameter return
1 Origin: upstream, http://git.dyne.org/frei0r/commit/?id=0be0cec
2 Author: Marko Cebokli <mc@mcpc14.site>
3 Forwarded: yes
4 Last-Update: 2012-12-23
5
6 --- a/src/generator/test_pat/test_pat_G.c
7 +++ b/src/generator/test_pat/test_pat_G.c
8 @@ -812,7 +812,7 @@
9 *p = map_value_backward(inst->size2, 0.0, 64.0);
10 break;
11 case 3: //negative
12 - *p = map_value_backward(inst->size2, 0.0, 1.0);
13 + *p = map_value_backward(inst->neg, 0.0, 1.0);
14 break;
15 case 4: //aspect type
16 *p = map_value_backward(inst->aspt, 0.0, 6.9999);
0 Description: Alphagrad: change width parameter to double
1 Origin: upstream, http://git.dyne.org/frei0r/commit/?id=b8f2300
2 Author: Marko Cebokli <mc@mcpc14.site>
3 Forwarded: yes
4 Last-Update: 2012-12-23
5
6 --- a/src/filter/alpha0ps/alphagrad.c
7 +++ b/src/filter/alpha0ps/alphagrad.c
8 @@ -143,7 +143,7 @@
9 break;
10 case 1:
11 info->name = "Transition width";
12 - info->type = F0R_PARAM_BOOL;
13 + info->type = F0R_PARAM_DOUBLE;
14 info->explanation = "";
15 break;
16 case 2:
0 Description: Coloradj_RGB: fix bug in luma calculation
1 Origin: upstream, http://git.dyne.org/frei0r/commit/?id=63c0878
2 Author: Marko Cebokli <mc@mcpc14.site>
3 Forwarded: yes
4 Last-Update: 2012-12-23
5
6 --- a/src/filter/coloradj/coloradj_RGB.c
7 +++ b/src/filter/coloradj/coloradj_RGB.c
8 @@ -84,7 +84,7 @@
9 {
10 case 0: //rec 601
11 {
12 - l = 0.299*rr + 0.587*rr + 0.114*bb;
13 + l = 0.299*rr + 0.587*gg + 0.114*bb;
14 break;
15 }
16 case 1: //rec 709
0 Description: Set default for onecol0r's parameter
1 Origin: upstream, http://git.dyne.org/frei0r/commit/?id=63bafff
2 Author: Dan Dennedy <dan@dennedy.org>
3 Forwarded: yes
4 Last-Update: 2012-12-23
5
6 --- a/src/generator/onecol0r/onecol0r.cpp
7 +++ b/src/generator/onecol0r/onecol0r.cpp
8 @@ -28,6 +28,7 @@
9 onecol0r(unsigned int width, unsigned int height)
10 {
11 register_param(color,"Color","the color of the image");
12 + color.r = color.g = color.b = 0;
13 }
14
15 virtual void update()
16 @@ -51,5 +52,5 @@
17 frei0r::construct<onecol0r> plugin("onecol0r",
18 "image with just one color",
19 "Martin Bayer",
20 - 0,1);
21 + 0,2);
22
0 Description: Fix range of balanc0r Green Tint parameter.
1 Origin: upstream, http://git.dyne.org/frei0r/commit/?id=b467ddc
2 Author: Dan Dennedy <dan@dennedy.org>
3 Forwarded: yes
4 Last-Update: 2012-12-23
5
6 --- a/src/filter/balanc0r/balanc0r.c
7 +++ b/src/filter/balanc0r/balanc0r.c
8 @@ -562,7 +562,7 @@
9 colordistance_info->color_model = F0R_COLOR_MODEL_RGBA8888;
10 colordistance_info->frei0r_version = FREI0R_MAJOR_VERSION;
11 colordistance_info->major_version = 0;
12 - colordistance_info->minor_version = 2;
13 + colordistance_info->minor_version = 3;
14 colordistance_info->num_params = 2;
15 colordistance_info->explanation = "Adjust the white balance / color temperature";
16 }
17 @@ -655,6 +655,8 @@
18 case 1:
19 {
20 double g = *((double*)param);
21 + // convert frei0r range to natural range [1.0, 2.5]
22 + g = 1.0 + (2.5 - 1.0) * g;
23 if (g != 1.2) {
24 inst->green = g;
25 setRGBmult(inst);
26 @@ -675,7 +677,8 @@
27 *((f0r_param_color_t*)param) = inst->color;
28 break;
29 case 1:
30 - *((double*)param) = inst->green;
31 + // convert natural range [1.0, 2.5] to frei0r range [0,1]
32 + *((double*)param) = (inst->green - 1.0) / (2.5 - 1.0);
33 break;
34 }
35
0 Description: Set defaults for lissajous0r parameters
1 Origin: upstream, http://git.dyne.org/frei0r/commit/?id=f7cc65f
2 Author: Dan Dennedy <dan@dennedy.org>
3 Forwarded: yes
4 Last-Update: 2012-12-23
5
6 --- a/src/generator/lissajous0r/lissajous0r.cpp
7 +++ b/src/generator/lissajous0r/lissajous0r.cpp
8 @@ -34,6 +34,7 @@
9 public:
10 lissajous0r(unsigned int width, unsigned int height)
11 {
12 + r_x = r_y = 0.0;
13 register_param(r_x,"ratiox","x-ratio");
14 register_param(r_y,"ratioy","y-ratio");
15 }
16 @@ -72,5 +73,5 @@
17 frei0r::construct<lissajous0r> plugin("Lissajous0r",
18 "Generates Lissajous0r images",
19 "Martin Bayer",
20 - 0,1);
21 + 0,2);
22
0 Description: Light Graffiti: Fix parameter ranges.
1 Origin: upstream, http://git.dyne.org/frei0r/commit/?id=047c762
2 Author: Till Theato <root@ttill.de>
3 Forwarded: yes
4 Last-Update: 2012-12-23
5
6 --- a/src/filter/lightgraffiti/lightgraffiti.cpp
7 +++ b/src/filter/lightgraffiti/lightgraffiti.cpp
8 @@ -147,14 +147,14 @@
9 m_prevMask = std::vector<RGBFloat>(width*height, rgb0);
10 #endif
11
12 - register_param(m_pSensitivity, "sensitivity", "Sensitivity of the effect for light (higher sensitivity will lead to brighter lights)"); // [0,5]
13 - register_param(m_pBackgroundWeight, "backgroundWeight", "Describes how strong the (accumulated) background should shine through"); // [0,1]
14 - register_param(m_pThresholdBrightness, "thresholdBrightness", "Brightness threshold to distinguish between foreground and background"); // {0...765}
15 - register_param(m_pThresholdDifference, "thresholdDifference", "Threshold: Difference to background to distinguish between fore- and background"); // {0...255}
16 - register_param(m_pThresholdDiffSum, "thresholdDiffSum", "Threshold for sum of differences. Can in most cases be ignored (set to 0)."); // {0...765}
17 - register_param(m_pDim, "dim", "Dimming of the light mask"); // [0,1]
18 - register_param(m_pSaturation, "saturation", "Saturation of lights"); // [0,4] (higher values hardly meaningful)
19 - register_param(m_pLowerOverexposure, "lowerOverexposure", "Prevents some overexposure if the light source stays steady too long (varying speed)"); // {0...5}
20 + register_param(m_pSensitivity, "sensitivity", "Sensitivity of the effect for light (higher sensitivity will lead to brighter lights)");
21 + register_param(m_pBackgroundWeight, "backgroundWeight", "Describes how strong the (accumulated) background should shine through");
22 + register_param(m_pThresholdBrightness, "thresholdBrightness", "Brightness threshold to distinguish between foreground and background");
23 + register_param(m_pThresholdDifference, "thresholdDifference", "Threshold: Difference to background to distinguish between fore- and background");
24 + register_param(m_pThresholdDiffSum, "thresholdDiffSum", "Threshold for sum of differences. Can in most cases be ignored (set to 0).");
25 + register_param(m_pDim, "dim", "Dimming of the light mask");
26 + register_param(m_pSaturation, "saturation", "Saturation of lights");
27 + register_param(m_pLowerOverexposure, "lowerOverexposure", "Prevents some overexposure if the light source stays steady too long (varying speed)");
28 register_param(m_pStatsBrightness, "statsBrightness", "Display the brightness and threshold, for adjusting the brightness threshold parameter");
29 register_param(m_pStatsDiff, "statsDifference", "Display the background difference and threshold");
30 register_param(m_pStatsDiffSum, "statsDiffSum", "Display the sum of the background difference and the threshold");
31 @@ -164,13 +164,13 @@
32 register_param(m_pLongAlpha, "longAlpha", "Alpha value for moving average");
33 register_param(m_pNonlinearDim, "nonlinearDim", "Nonlinear dimming (may look more natural)");
34 m_pLongAlpha = 1/128.0;
35 - m_pSensitivity = 1;
36 + m_pSensitivity = 1 / 5.;
37 m_pBackgroundWeight = 0;
38 - m_pThresholdBrightness = 450;
39 + m_pThresholdBrightness = 450 / 765.;
40 m_pThresholdDifference = 0;
41 m_pThresholdDiffSum = 0;
42 m_pDim = 0;
43 - m_pSaturation = 1;
44 + m_pSaturation = 1 / 4.;
45 m_pLowerOverexposure = 0;
46 m_pStatsBrightness = false;
47 m_pStatsDiff = false;
48 @@ -203,6 +203,13 @@
49
50 virtual void update()
51 {
52 + double sensitivity = m_pSensitivity * 5;
53 + double thresholdBrightness = m_pThresholdBrightness * 765;
54 + double thresholdDifference = m_pThresholdDifference * 255;
55 + double thresholdDiffSum = m_pThresholdDiffSum * 765;
56 + double saturation = m_pSaturation * 4;
57 + double lowerOverexposure = m_pLowerOverexposure * 10;
58 +
59 // Copy everything to the output image.
60 // Most of the image will very likely not change at all.
61 std::copy(in, in + width*height, out);
62 @@ -757,9 +764,9 @@
63 sum = GETR(out[pixel]) + GETG(out[pixel]) + GETB(out[pixel]);
64
65 if (
66 - maxDiff > m_pThresholdDifference
67 - && temp > m_pThresholdDiffSum
68 - && sum > m_pThresholdBrightness
69 + maxDiff > thresholdDifference
70 + && temp > thresholdDiffSum
71 + && sum > thresholdBrightness
72 // If all requirements are met, then this should be a light source.
73 )
74 {
75 @@ -769,7 +776,7 @@
76 fg = CLAMP(g)/255.0;
77 fb = CLAMP(b)/255.0;
78
79 - f = (fr + fg + fb) / 3 * m_pSensitivity;
80 + f = (fr + fg + fb) / 3 * sensitivity;
81 fr *= f;
82 fg *= f;
83 fb *= f;
84 @@ -799,7 +806,7 @@
85
86 // Add the brightness of the light source to the brightness map (alpha map)
87 y = REC709Y(CLAMP(r), CLAMP(g), CLAMP(b)) / 255.0;
88 - y = y * m_pSensitivity;
89 + y = y * sensitivity;
90 m_alphaMap[4*pixel] += y;
91 #endif
92 } else {
93 @@ -837,12 +844,12 @@
94 fg = m_rgbLightMask[pixel].g;
95 fb = m_rgbLightMask[pixel].b;
96
97 - if (m_pLowerOverexposure > 0) {
98 + if (lowerOverexposure > 0) {
99 // Comparisation of plots with octave:
100 // clf;hold on;plot([0 1],[0 1],'k');plot(range,ones(length(range),1),'k');plot(range,sqrt(range));plot(range,log(1+range),'k');plot(range,log(1+range),'g');plot(range,(log(1+range)/3).^.5,'r');axis equal
101 - fr = pow( log(1+fr)/m_pLowerOverexposure, .5 );
102 - fg = pow( log(1+fg)/m_pLowerOverexposure, .5 );
103 - fb = pow( log(1+fb)/m_pLowerOverexposure, .5 );
104 + fr = pow( log(1+fr)/lowerOverexposure, .5 );
105 + fg = pow( log(1+fg)/lowerOverexposure, .5 );
106 + fb = pow( log(1+fb)/lowerOverexposure, .5 );
107 }
108
109
110 @@ -876,8 +883,8 @@
111 // Increase the saturation if the average brightness is below a certain level
112 // Do not use Rec709 Luma since we want to consider all colours to equal parts.
113 fy = (fr + fg + fb) / 3;
114 - if (fy < 1 && m_pSaturation > 0) {
115 - fsat = 1 + m_pSaturation*(1-fy);
116 + if (fy < 1 && saturation > 0) {
117 + fsat = 1 + saturation*(1-fy);
118
119 fr = fy + fsat * (fr-fy);
120 fg = fy + fsat * (fg-fy);
121 @@ -974,7 +981,7 @@
122 r = .8*sum/3;
123 g = .8*sum/3;
124 b = .8*sum/3;
125 - if (sum > m_pThresholdBrightness) {
126 + if (sum > thresholdBrightness) {
127 b = 255;
128 }
129 out[pixel] = RGBA(r,g,b,0xFF);
130 @@ -988,7 +995,7 @@
131 b = r;
132 }
133
134 - if (maxDiff > m_pThresholdDifference) {
135 + if (maxDiff > thresholdDifference) {
136 g = 255;
137 }
138 out[pixel] = RGBA(r,g,b,0xFF);
139 @@ -1003,7 +1010,7 @@
140 if (!m_pStatsBrightness) {
141 b = r;
142 }
143 - if (temp > m_pThresholdDiffSum) {
144 + if (temp > thresholdDiffSum) {
145 r = 255;
146 }
147 out[pixel] = RGBA(r,g,b,0xFF);
148 @@ -1052,5 +1059,5 @@
149 frei0r::construct<LightGraffiti> plugin("Light Graffiti",
150 "Creates light graffitis from a video by keeping the brightest spots.",
151 "Simon A. Eugster (Granjow)",
152 - 0,1,
153 + 0,2,
154 F0R_COLOR_MODEL_RGBA8888);
0 Description: Cartoon: Fix parameter ranges.
1 Origin: upstream, http://git.dyne.org/frei0r/commit/?id=39e65be
2 Author: Till Theato <root@ttill.de>
3 Forwarded: yes
4 Last-Update: 2012-12-23
5
6 --- a/src/filter/cartoon/cartoon.cpp
7 +++ b/src/filter/cartoon/cartoon.cpp
8 @@ -59,8 +59,8 @@
9
10 Cartoon(unsigned int width, unsigned int height) {
11 int c;
12 - register_param(triplevel, "triplevel", "level of trip: use high numbers, incremented by 100");
13 - register_param(diffspace, "diffspace", "difference space: a value from 0 to 256");
14 + register_param(triplevel, "triplevel", "level of trip: mapped to [0,1] asymptotical");
15 + register_param(diffspace, "diffspace", "difference space: a value from 0 to 256 (mapped to [0,1])");
16
17 geo = new ScreenGeometry();
18 geo->w = width;
19 @@ -79,8 +79,8 @@
20 powprecal[c] = c*c;
21 black = 0xFF000000;
22
23 - triplevel = 1000;
24 - diffspace = 1;
25 + triplevel = 1 - 1 / (1000 + 1);
26 + diffspace = 1 / 256.;
27
28 }
29
30 @@ -97,13 +97,14 @@
31 // Cartoonify picture, do a form of edge detect
32 int x, y, t;
33
34 + m_diffspace = diffspace * 256;
35
36 - for (x=(int)diffspace;x<geo->w-(1+(int)diffspace);x++) {
37 + for (x=m_diffspace;x<geo->w-(1+m_diffspace);x++) {
38
39 - for (y=(int)diffspace;y<geo->h-(1+(int)diffspace);y++) {
40 + for (y=m_diffspace;y<geo->h-(1+m_diffspace);y++) {
41
42 t = GetMaxContrast((int32_t*)in,x,y);
43 - if (t > triplevel) {
44 + if (t > 1 / (1 - triplevel) - 1) {
45
46 // Make a border pixel
47 *(out+x+yprecal[y]) = black;
48 @@ -129,6 +130,7 @@
49 int *yprecal;
50 uint16_t powprecal[256];
51 int32_t black;
52 + int m_diffspace;
53
54 void FlattenColor(int32_t *c);
55 long GetMaxContrast(int32_t *src,int x,int y);
56 @@ -163,23 +165,23 @@
57 long error,max=0;
58
59 /* Assumes PrePixelModify has been run */
60 - c1 = *PIXELAT(x-(int)diffspace,y,src);
61 - c2 = *PIXELAT(x+(int)diffspace,y,src);
62 + c1 = *PIXELAT(x-m_diffspace,y,src);
63 + c2 = *PIXELAT(x+m_diffspace,y,src);
64 error = GMERROR(c1,c2);
65 if (error>max) max = error;
66
67 - c1 = *PIXELAT(x,y-(int)diffspace,src);
68 - c2 = *PIXELAT(x,y+(int)diffspace,src);
69 + c1 = *PIXELAT(x,y-m_diffspace,src);
70 + c2 = *PIXELAT(x,y+m_diffspace,src);
71 error = GMERROR(c1,c2);
72 if (error>max) max = error;
73
74 - c1 = *PIXELAT(x-(int)diffspace,y-(int)diffspace,src);
75 - c2 = *PIXELAT(x+(int)diffspace,y+(int)diffspace,src);
76 + c1 = *PIXELAT(x-m_diffspace,y-m_diffspace,src);
77 + c2 = *PIXELAT(x+m_diffspace,y+m_diffspace,src);
78 error = GMERROR(c1,c2);
79 if (error>max) max = error;
80
81 - c1 = *PIXELAT(x+(int)diffspace,y-(int)diffspace,src);
82 - c2 = *PIXELAT(x-(int)diffspace,y+(int)diffspace,src);
83 + c1 = *PIXELAT(x+m_diffspace,y-m_diffspace,src);
84 + c2 = *PIXELAT(x-m_diffspace,y+m_diffspace,src);
85 error = GMERROR(c1,c2);
86 if (error>max) max = error;
87
88 @@ -189,6 +191,4 @@
89 frei0r::construct<Cartoon> plugin("Cartoon",
90 "Cartoonify video, do a form of edge detect",
91 "Dries Pruimboom, Jaromil",
92 - 2,0);
93 -
94 -
95 + 2,1);
0 Description: Curves: Fix possible crash and parameter ranges.
1 Origin: upstream, http://git.dyne.org/frei0r/commit/?id=661a7b4
2 Author: Till Theato <root@ttill.de>
3 Forwarded: yes
4 Last-Update: 2012-12-23
5
6 --- a/src/filter/curves/curves.c
7 +++ b/src/filter/curves/curves.c
8 @@ -190,7 +190,7 @@
9 curves_info->color_model = F0R_COLOR_MODEL_RGBA8888;
10 curves_info->frei0r_version = FREI0R_MAJOR_VERSION;
11 curves_info->major_version = 0;
12 - curves_info->minor_version = 2;
13 + curves_info->minor_version = 3;
14 curves_info->num_params = 16;
15 curves_info->explanation = "Adjust luminance or color channel intensity with curve level mapping";
16 }
17 @@ -216,12 +216,12 @@
18 case 2:
19 info->name = "Graph position";
20 info->type = F0R_PARAM_DOUBLE;
21 - info->explanation = "Output image corner where curve graph will be drawn (1 = TOP,LEFT; 2 = TOP,RIGHT; 3 = BOTTOM,LEFT; 4 = BOTTOM, RIGHT)";
22 + info->explanation = "Output image corner where curve graph will be drawn (0.1 = TOP,LEFT; 0.2 = TOP,RIGHT; 0.3 = BOTTOM,LEFT; 0.4 = BOTTOM, RIGHT)";
23 break;
24 case 3:
25 info->name = "Curve point number";
26 info->type = F0R_PARAM_DOUBLE;
27 - info->explanation = "Number of points to use to build curve";
28 + info->explanation = "Number of points to use to build curve (/10 to fit [0,1] parameter range). Minimum 2 (0.2), Maximum 5 (0.5). Not relevant for Bézier spline.";
29 break;
30 case 4:
31 info->name = "Luma formula";
32 @@ -268,7 +268,8 @@
33
34 void f0r_destruct(f0r_instance_t instance)
35 {
36 - free(((curves_instance_t*)instance)->bspline);
37 + if (((curves_instance_t*)instance)->bspline)
38 + free(((curves_instance_t*)instance)->bspline);
39 free(((curves_instance_t*)instance)->bsplineMap);
40 free(instance);
41 }
42 @@ -313,10 +314,10 @@
43 inst->drawCurves = *((f0r_param_double *)param);
44 break;
45 case 2:
46 - inst->curvesPosition = *((f0r_param_double *)param);
47 + inst->curvesPosition = floor(*((f0r_param_double *)param) * 10);
48 break;
49 case 3:
50 - inst->pointNumber = *((f0r_param_double *)param);
51 + inst->pointNumber = floor(*((f0r_param_double *)param) * 10);
52 break;
53 case 4:
54 inst->formula = *((f0r_param_double *)param);
55 @@ -351,10 +352,10 @@
56 *((f0r_param_double *)param) = inst->drawCurves;
57 break;
58 case 2:
59 - *((f0r_param_double *)param) = inst->curvesPosition;
60 + *((f0r_param_double *)param) = inst->curvesPosition / 10.;
61 break;
62 case 3:
63 - *((f0r_param_double *)param) = inst->pointNumber;
64 + *((f0r_param_double *)param) = inst->pointNumber / 10.;
65 break;
66 case 4:
67 *((f0r_param_double *)param) = inst->formula;
68 @@ -703,7 +704,7 @@
69 points = (double*)calloc(inst->pointNumber * 2, sizeof(double));
70 i = inst->pointNumber * 2;
71 //copy point values
72 - while(--i)
73 + while(--i > 0)
74 points[i] = inst->points[i];
75 //sort point values by X component
76 for(i = 1; i < inst->pointNumber; i++)
0 Description: Vertigo: Fix parameter range.
1 Origin: upstream, http://git.dyne.org/frei0r/commit/?id=d4d29e9
2 Author: Till Theato <root@ttill.de>
3 Forwarded: yes
4 Last-Update: 2012-12-23
5
6 --- a/src/filter/vertigo/vertigo.c
7 +++ b/src/filter/vertigo/vertigo.c
8 @@ -66,7 +66,7 @@
9 vertigoInfo->color_model = F0R_COLOR_MODEL_RGBA8888;
10 vertigoInfo->frei0r_version = FREI0R_MAJOR_VERSION;
11 vertigoInfo->major_version = 1;
12 - vertigoInfo->minor_version = 0;
13 + vertigoInfo->minor_version = 1;
14 vertigoInfo->num_params = 2;
15 vertigoInfo->explanation = "alpha blending with zoomed and rotated images";
16 }
17 @@ -143,7 +143,7 @@
18 break;
19 case 1:
20 /* zoomrate */
21 - inst->zoomrate = *((double*)param);
22 + inst->zoomrate = *((double*)param) * 5;
23 inst->tfactor = (inst->xc+inst->yc) * inst->zoomrate;
24 break;
25 }
26 @@ -163,7 +163,7 @@
27 break;
28 case 1:
29 /* zoomrate */
30 - *((double*)param) = (double) (inst->zoomrate);
31 + *((double*)param) = (double) (inst->zoomrate) / 5.;
32 break;
33 }
34 }
0 Description: Levels: Fix parameter ranges.
1 Origin: upstream, http://git.dyne.org/frei0r/commit/?id=ee7bb57
2 Author: Till Theato <root@ttill.de>
3 Forwarded: yes
4 Last-Update: 2012-12-23
5
6 --- a/src/filter/levels/levels.c
7 +++ b/src/filter/levels/levels.c
8 @@ -64,7 +64,7 @@
9 levels_instance_t->color_model = F0R_COLOR_MODEL_RGBA8888;
10 levels_instance_t->frei0r_version = FREI0R_MAJOR_VERSION;
11 levels_instance_t->major_version = 0;
12 - levels_instance_t->minor_version = 1;
13 + levels_instance_t->minor_version = 2;
14 levels_instance_t->num_params = 8;
15 levels_instance_t->explanation = "Adjust luminance or color channel intensity";
16 }
17 @@ -104,7 +104,7 @@
18 info->explanation = "White output";
19 break;
20 case 6:
21 - info->name = "Show histogram";
22 + info->name = "Show histogram";
23 info->type = F0R_PARAM_BOOL;
24 info->explanation = "Show histogram";
25 break;
26 @@ -145,7 +145,7 @@
27 switch(param_index)
28 {
29 case 0:
30 - inst->channel = *((f0r_param_double *)param);
31 + inst->channel = floor(*((f0r_param_double *)param) * 10);
32 break;
33 case 1:
34 inst->inputMin = *((f0r_param_double *)param);
35 @@ -166,7 +166,7 @@
36 inst->showHistogram = *((f0r_param_bool *)param);
37 break;
38 case 7:
39 - inst->histogramPosition = *((f0r_param_double *)param);
40 + inst->histogramPosition = floor(*((f0r_param_double *)param) * 10);
41 break;
42 }
43 }
44 @@ -180,7 +180,7 @@
45 switch(param_index)
46 {
47 case 0:
48 - *((f0r_param_double *)param) = inst->channel;
49 + *((f0r_param_double *)param) = inst->channel / 10.;
50 break;
51 case 1:
52 *((f0r_param_double *)param) = inst->inputMin;
53 @@ -201,7 +201,7 @@
54 *((f0r_param_bool *)param) = inst->showHistogram;
55 break;
56 case 7:
57 - *((f0r_param_double *)param) = inst->histogramPosition;
58 + *((f0r_param_double *)param) = inst->histogramPosition / 10.;
59 break;
60 }
61 }
62 @@ -392,4 +392,3 @@
63 }
64 }
65 }
66 -
0 Description: SOP/Sat: Fix parameter ranges.
1 Origin: upstream, http://git.dyne.org/frei0r/commit/?id=a6c266a
2 Author: Till Theato <root@ttill.de>
3 Forwarded: yes
4 Last-Update: 2012-12-23
5
6 --- a/src/filter/sopsat/sopsat.cpp
7 +++ b/src/filter/sopsat/sopsat.cpp
8 @@ -92,19 +92,19 @@
9 register_param(bPower, "bPower", "Power (Gamma) of the blue color component");
10 register_param(aPower, "aPower", "Power (Gamma) of the alpha component");
11 register_param(saturation, "saturation", "Overall saturation");
12 - rSlope = 1;
13 - gSlope = 1;
14 - bSlope = 1;
15 - aSlope = 1;
16 - rOffset = 0;
17 - gOffset = 0;
18 - bOffset = 0;
19 - aOffset = 0;
20 - rPower = 1;
21 - gPower = 1;
22 - bPower = 1;
23 - aPower = 1;
24 - saturation = 200;
25 + rSlope = 1 / 20.;
26 + gSlope = 1 / 20.;
27 + bSlope = 1 / 20.;
28 + aSlope = 1 / 20.;
29 + rOffset = (0 - (-4)) / (double)(4 - (-4));
30 + gOffset = (0 - (-4)) / (double)(4 - (-4));
31 + bOffset = (0 - (-4)) / (double)(4 - (-4));
32 + aOffset = (0 - (-4)) / (double)(4 - (-4));
33 + rPower = 1 / 20.;
34 + gPower = 1 / 20.;
35 + bPower = 1 / 20.;
36 + aPower = 1 / 20.;
37 + saturation = 1 / 10.;
38
39 // Pre-build the lookup table.
40 // For 1080p, rendering a 5-second video took
41 @@ -171,22 +171,22 @@
42 double m_sat;
43
44 void updateLUT() {
45 - double rS = rSlope;
46 - double gS = gSlope;
47 - double bS = bSlope;
48 - double aS = aSlope;
49 -
50 - double rO = rOffset;
51 - double gO = gOffset;
52 - double bO = bOffset;
53 - double aO = aOffset;
54 -
55 - double rP = rPower;
56 - double gP = gPower;
57 - double bP = bPower;
58 - double aP = aPower;
59 + double rS = rSlope * 20;
60 + double gS = gSlope * 20;
61 + double bS = bSlope * 20;
62 + double aS = aSlope * 20;
63 +
64 + double rO = -4 + rOffset * (4 - (-4));
65 + double gO = -4 + gOffset * (4 - (-4));
66 + double bO = -4 + bOffset * (4 - (-4));
67 + double aO = -4 + aOffset * (4 - (-4));
68 +
69 + double rP = rPower * 20;
70 + double gP = gPower * 20;
71 + double bP = bPower * 20;
72 + double aP = aPower * 20;
73
74 - m_sat = saturation;
75 + m_sat = saturation * 10;
76
77 for (int i = 0; i < 256; i++) {
78 // above0 avoids overflows for negative numbers.
79 @@ -212,5 +212,5 @@
80 frei0r::construct<SOPSat> plugin("SOP/Sat",
81 "Slope/Offset/Power and Saturation color corrections according to the ASC CDL (Color Decision List)",
82 "Simon A. Eugster (Granjow)",
83 - 0,1,
84 + 0,2,
85 F0R_COLOR_MODEL_RGBA8888);
0 Description: Fix compile warning on undefined operation.
1 Origin: upstream, http://git.dyne.org/frei0r/commit/?id=8f80908
2 Author: Dan Dennedy <dan@dennedy.org>
3 Forwarded: yes
4 Last-Update: 2012-12-23
5
6 --- a/src/filter/curves/curves.c
7 +++ b/src/filter/curves/curves.c
8 @@ -875,9 +875,12 @@
9 for(int j = 0; j < scale; j++) {
10 if (j % cellSize > lineWidth) { //point doesn't aly on the grid
11 int offset = ((maxYvalue - i + graphYOffset) * stride + j + graphXOffset) * 4;
12 - dst[offset] = (dst[offset++] >> 1) + 0x7F;
13 - dst[offset] = (dst[offset++] >> 1) + 0x7F;
14 - dst[offset] = (dst[offset++] >> 1) + 0x7F;
15 + dst[offset] = (dst[offset] >> 1) + 0x7F;
16 + offset++;
17 + dst[offset] = (dst[offset] >> 1) + 0x7F;
18 + offset++;
19 + dst[offset] = (dst[offset] >> 1) + 0x7F;
20 + offset++;
21 }
22 }
23 }
24 --- a/src/filter/three_point_balance/three_point_balance.c
25 +++ b/src/filter/three_point_balance/three_point_balance.c
26 @@ -263,15 +263,22 @@
27 for(int i = 0; i < inst->height; i++) {
28 int offset = (i * inst->width + j) * 4;
29 if (copyPixel) {
30 - dst[offset] = src[offset++];
31 - dst[offset] = src[offset++];
32 - dst[offset] = src[offset++];
33 + dst[offset] = src[offset];
34 + offset++;
35 + dst[offset] = src[offset];
36 + offset++;
37 + dst[offset] = src[offset];
38 + offset++;
39 } else {
40 - dst[offset] = mapRed[src[offset++]];
41 - dst[offset] = mapGreen[src[offset++]];
42 - dst[offset] = mapBlue[src[offset++]];
43 + dst[offset] = mapRed[src[offset]];
44 + offset++;
45 + dst[offset] = mapGreen[src[offset]];
46 + offset++;
47 + dst[offset] = mapBlue[src[offset]];
48 + offset++;
49 }
50 - dst[offset] = src[offset++]; // copy alpha
51 + dst[offset] = src[offset]; // copy alpha
52 + offset++;
53 }
54 }
55
0 Description: appease the compiler, add return statement
1 Origin: upstream, http://git.dyne.org/frei0r/commit/?id=9c93c22
2 Author: Robert Schweikert <rjschwei@suse.com>
3 Forwarded: yes
4 Last-Update: 2012-12-23
5
6 --- a/src/filter/curves/curves.c
7 +++ b/src/filter/curves/curves.c
8 @@ -504,6 +504,8 @@
9 double dx = x - coeffs[offset];
10 return ((coeffs[offset + 4] * dx / 6. + coeffs[offset + 3] / 2.) * dx + coeffs[offset + 2]) * dx + coeffs[offset + 1];
11 }
12 + /* This should never be reached, statement passifies the compiler*/
13 + return -1.0;
14 }
15
16 void swap(double *points, int i, int j) {
0 Description: Fix default for stroke param of facedetect.
1 Origin: upstream, http://git.dyne.org/frei0r/commit/?id=f1794f8
2 Author: Dan Dennedy <dan@dennedy.org>
3 Forwarded: yes
4 Last-Update: 2012-12-23
5
6 --- a/src/filter/facedetect/facedetect.cpp
7 +++ b/src/filter/facedetect/facedetect.cpp
8 @@ -90,7 +90,7 @@
9 register_param(smallest, "Smallest", "Minimum window size in pixels, divided by 1000");
10 scale = 1.0 / 1.5;
11 register_param(scale, "Scale", "Down scale the image prior detection");
12 - stroke = CV_FILLED;
13 + stroke = 0.0;
14 register_param(stroke, "Stroke", "Line width, divided by 100, or fill if 0");
15 antialias = false;
16 register_param(antialias, "Antialias", "Draw with antialiasing");
0 Description: Select0r: Endian proofing
1 Origin: upstream, http://git.dyne.org/frei0r/commit/?id=0fade7e
2 Author: Marko Cebokli <mc@mcpc14.site>
3 Forwarded: yes
4 Last-Update: 2012-12-23
5
6 --- a/src/filter/select0r/readme
7 +++ b/src/filter/select0r/readme
8 @@ -14,6 +14,9 @@
9 Version 0.1
10 "pre-alpha" (throw it out and see what happens... :-)
11
12 +** mar 2012
13 +Version 0.2
14 +is now endian independent
15
16
17 DESCRIPTION
18 --- a/src/filter/select0r/select0r.c
19 +++ b/src/filter/select0r/select0r.c
20 @@ -627,7 +627,7 @@
21 info->color_model=F0R_COLOR_MODEL_RGBA8888;
22 info->frei0r_version=FREI0R_MAJOR_VERSION;
23 info->major_version=0;
24 -info->minor_version=1;
25 +info->minor_version=2;
26 info->num_params=9;
27 info->explanation="Color based alpha selection";
28 }
29 @@ -836,7 +836,10 @@
30 float_rgba key;
31 triplet d,n;
32 int i;
33 -uint32_t a,t;
34 +uint32_t t;
35 +unsigned char *cin, *cout;
36 +float f1=1.0/256.0;
37 +unsigned char a1,a2;
38
39 assert(instance);
40 in=(inst*)instance;
41 @@ -853,11 +856,13 @@
42 n.z=in->nud3;
43
44 //convert to float
45 +cin=(unsigned char *)inframe;
46 for (i=0;i<in->h*in->w;i++)
47 {
48 - in->sl[i].r=((float)(inframe[i]&0x000000FF))*0.00392157;
49 - in->sl[i].g=((float)((inframe[i]&0x0000FF00)>>8))*0.00392157;
50 - in->sl[i].b=((float)((inframe[i]&0x00FF0000)>>16))*0.00392157;
51 + in->sl[i].r=f1*(float)*cin++;
52 + in->sl[i].g=f1*(float)*cin++;
53 + in->sl[i].b=f1*(float)*cin++;
54 + cin++;
55 }
56
57 //make the selection
58 @@ -882,46 +887,63 @@
59 in->sl[i].a = 1.0 - in->sl[i].a;
60
61 //apply alpha
62 +cin=(unsigned char *)inframe;
63 +cout=(unsigned char *)outframe;
64 switch (in->op)
65 {
66 case 0: //write on clear
67 for (i=0;i<in->h*in->w;i++)
68 {
69 - a=((uint32_t)(in->sl[i].a*255.0))<<24;
70 - outframe[i] = (inframe[i]&0x00FFFFFF) | a;
71 + *cout++ = *cin++; //copy R
72 + *cout++ = *cin++; //copy G
73 + *cout++ = *cin++; //copy B
74 + *cout++ = (unsigned char)(in->sl[i].a*255.0);
75 + cin++;
76 }
77 break;
78 case 1: //max
79 for (i=0;i<in->h*in->w;i++)
80 {
81 - a=((uint32_t)(in->sl[i].a*255.0))<<24;
82 - t=((inframe[i]&0xFF000000)>a) ? inframe[i]&0xFF000000 : a;
83 - outframe[i] = (inframe[i]&0x00FFFFFF) | t;
84 + *cout++ = *cin++; //copy R
85 + *cout++ = *cin++; //copy G
86 + *cout++ = *cin++; //copy B
87 + a1 = *cin++;
88 + a2 = (unsigned char)(in->sl[i].a*255.0);
89 + *cout++ = (a1>a2) ? a1 : a2;
90 }
91 break;
92 case 2: //min
93 for (i=0;i<in->h*in->w;i++)
94 {
95 - a=((uint32_t)(in->sl[i].a*255.0))<<24;
96 - t=((inframe[i]&0xFF000000)<a) ? inframe[i]&0xFF000000 : a;
97 - outframe[i] = (inframe[i]&0x00FFFFFF) | t;
98 + *cout++ = *cin++; //copy R
99 + *cout++ = *cin++; //copy G
100 + *cout++ = *cin++; //copy B
101 + a1 = *cin++;
102 + a2 = (unsigned char)(in->sl[i].a*255.0);
103 + *cout++ = (a1<a2) ? a1 : a2;
104 }
105 break;
106 case 3: //add
107 for (i=0;i<in->h*in->w;i++)
108 {
109 - a=((uint32_t)(in->sl[i].a*255.0))<<24;
110 - t=((inframe[i]&0xFF000000)>>1)+(a>>1);
111 - t = (t>0x7F800000) ? 0xFF000000 : t<<1;
112 - outframe[i] = (inframe[i]&0x00FFFFFF) | t;
113 + *cout++ = *cin++; //copy R
114 + *cout++ = *cin++; //copy G
115 + *cout++ = *cin++; //copy B
116 + a1 = *cin++;
117 + a2 = (unsigned char)(in->sl[i].a*255.0);
118 + t=(uint32_t)a1+(uint32_t)a2;
119 + *cout++ = (t<=255) ? (unsigned char)t : 255;
120 }
121 break;
122 case 4: //subtract
123 for (i=0;i<in->h*in->w;i++)
124 {
125 - a=((uint32_t)(in->sl[i].a*255.0))<<24;
126 - t= ((inframe[i]&0xFF000000)>a) ? (inframe[i]&0xFF000000)-a : 0;
127 - outframe[i] = (inframe[i]&0x00FFFFFF) | t;
128 + *cout++ = *cin++; //copy R
129 + *cout++ = *cin++; //copy G
130 + *cout++ = *cin++; //copy B
131 + a1 = *cin++;
132 + a2 = (unsigned char)(in->sl[i].a*255.0);
133 + *cout++ = (a1>a2) ? a1-a2 : 0;
134 }
135 break;
136 default:
0 Description: Select0r: use uint8_t
1 Origin: upstream, http://git.dyne.org/frei0r/commit/?id=5f719f2
2 Author: Marko Cebokli <mc@mcpc14.site>
3 Forwarded: yes
4 Last-Update: 2012-12-23
5
6 --- a/src/filter/select0r/select0r.c
7 +++ b/src/filter/select0r/select0r.c
8 @@ -837,9 +837,9 @@
9 triplet d,n;
10 int i;
11 uint32_t t;
12 -unsigned char *cin, *cout;
13 +uint8_t *cin, *cout;
14 float f1=1.0/256.0;
15 -unsigned char a1,a2;
16 +uint8_t a1,a2;
17
18 assert(instance);
19 in=(inst*)instance;
20 @@ -856,7 +856,7 @@
21 n.z=in->nud3;
22
23 //convert to float
24 -cin=(unsigned char *)inframe;
25 +cin=(uint8_t *)inframe;
26 for (i=0;i<in->h*in->w;i++)
27 {
28 in->sl[i].r=f1*(float)*cin++;
29 @@ -887,8 +887,8 @@
30 in->sl[i].a = 1.0 - in->sl[i].a;
31
32 //apply alpha
33 -cin=(unsigned char *)inframe;
34 -cout=(unsigned char *)outframe;
35 +cin=(uint8_t *)inframe;
36 +cout=(uint8_t *)outframe;
37 switch (in->op)
38 {
39 case 0: //write on clear
40 @@ -897,7 +897,7 @@
41 *cout++ = *cin++; //copy R
42 *cout++ = *cin++; //copy G
43 *cout++ = *cin++; //copy B
44 - *cout++ = (unsigned char)(in->sl[i].a*255.0);
45 + *cout++ = (uint8_t)(in->sl[i].a*255.0);
46 cin++;
47 }
48 break;
49 @@ -908,7 +908,7 @@
50 *cout++ = *cin++; //copy G
51 *cout++ = *cin++; //copy B
52 a1 = *cin++;
53 - a2 = (unsigned char)(in->sl[i].a*255.0);
54 + a2 = (uint8_t)(in->sl[i].a*255.0);
55 *cout++ = (a1>a2) ? a1 : a2;
56 }
57 break;
58 @@ -919,7 +919,7 @@
59 *cout++ = *cin++; //copy G
60 *cout++ = *cin++; //copy B
61 a1 = *cin++;
62 - a2 = (unsigned char)(in->sl[i].a*255.0);
63 + a2 = (uint8_t)(in->sl[i].a*255.0);
64 *cout++ = (a1<a2) ? a1 : a2;
65 }
66 break;
67 @@ -930,9 +930,9 @@
68 *cout++ = *cin++; //copy G
69 *cout++ = *cin++; //copy B
70 a1 = *cin++;
71 - a2 = (unsigned char)(in->sl[i].a*255.0);
72 + a2 = (uint8_t)(in->sl[i].a*255.0);
73 t=(uint32_t)a1+(uint32_t)a2;
74 - *cout++ = (t<=255) ? (unsigned char)t : 255;
75 + *cout++ = (t<=255) ? (uint8_t)t : 255;
76 }
77 break;
78 case 4: //subtract
79 @@ -942,7 +942,7 @@
80 *cout++ = *cin++; //copy G
81 *cout++ = *cin++; //copy B
82 a1 = *cin++;
83 - a2 = (unsigned char)(in->sl[i].a*255.0);
84 + a2 = (uint8_t)(in->sl[i].a*255.0);
85 *cout++ = (a1>a2) ? a1-a2 : 0;
86 }
87 break;
0 Description: host_param_test: fix string parameter
1 Origin: upstream, http://git.dyne.org/frei0r/commit/?id=6b780c3
2 Author: Marko Cebokli <mc@mcpc14.site>
3 Forwarded: yes
4 Last-Update: 2012-12-23
5
6 --- a/src/filter/host_param_test/host_param_test.c
7 +++ b/src/filter/host_param_test/host_param_test.c
8 @@ -129,7 +129,7 @@
9 break;
10 case 4:
11 {
12 - char* sval = ((char*)param);
13 + char* sval = (*(char**)param);
14 inst->svalue = (char*)realloc( inst->svalue, strlen(sval) + 1 );
15 strcpy( inst->svalue, sval );
16 break;
0 Description: fix compiler warnings
1 Origin: upstream, http://git.dyne.org/frei0r/commit/?id=7f54736
2 Author: Dan Dennedy <dan@dennedy.org>
3 Forwarded: yes
4 Last-Update: 2012-12-23
5
6 --- a/src/filter/delaygrab/delaygrab.cpp
7 +++ b/src/filter/delaygrab/delaygrab.cpp
8 @@ -245,7 +245,7 @@
9 break;
10 } // switch
11 /* Clip values */
12 - if (*curdelaymap<0) {
13 + if ((int)(*curdelaymap)<0) {
14 *curdelaymap=0;
15 } else if (*curdelaymap>(QUEUEDEPTH-1)) {
16 *curdelaymap=(QUEUEDEPTH-1);
17 --- a/src/filter/lightgraffiti/lightgraffiti.cpp
18 +++ b/src/filter/lightgraffiti/lightgraffiti.cpp
19 @@ -835,7 +835,7 @@
20 */
21 #ifdef LG_ADV
22 if (
23 - m_rgbLightMask[pixel].r != 0 || m_rgbLightMask[pixel].g != 0 || m_rgbLightMask[pixel].b != 0
24 + (m_rgbLightMask[pixel].r != 0 || m_rgbLightMask[pixel].g != 0 || m_rgbLightMask[pixel].b != 0)
25 && !m_pStatsBrightness && !m_pStatsDiff && !m_pStatsDiffSum
26 )
27 {
28 @@ -1017,6 +1017,8 @@
29 }
30 }
31 break;
32 + default:
33 + break;
34 }
35 }
36
37 --- a/src/filter/tutorial/tutorial.cpp
38 +++ b/src/filter/tutorial/tutorial.cpp
39 @@ -135,7 +135,7 @@
40
41 // Add g+b and clamp with the second lookup table
42 *out_pointer = additionTable[*in_pointer + *(in_pointer+1)];
43 - *out_pointer++; *in_pointer++;
44 + out_pointer++; in_pointer++;
45
46 // Copy the other channels
47 *out_pointer++ = *in_pointer++;
0 Description: Alpha0ps: endian proofing
1 Origin: upstream, http://git.dyne.org/frei0r/commit/?id=33b8c35
2 Author: Marko Cebokli <mc@mcpc14.site>
3 Forwarded: yes
4 Last-Update: 2012-12-23
5
6 --- a/src/filter/alpha0ps/alpha0ps.c
7 +++ b/src/filter/alpha0ps/alpha0ps.c
8 @@ -21,6 +21,10 @@
9 along with this program; if not, write to the Free Software
10 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
11
12 +
13 +
14 + 28 aug 2012 ver 0.2 endian proofing
15 +
16 */
17
18
19 @@ -50,66 +54,73 @@
20 int inv;
21
22 float *falpha,*ab;
23 +uint8_t *infr,*oufr;
24 } inst;
25
26
27 //---------------------------------------------------
28 -//RGBA8888 little endian
29 void alphagray(inst *in, const uint32_t* inframe, uint32_t* outframe)
30 {
31 -uint32_t s;
32 +uint8_t s;
33 int i;
34
35 if (in->din==0)
36 for (i=0;i<in->w*in->h;i++)
37 {
38 - s=(outframe[i]&0xFF000000)>>24;
39 - s=s+(s<<8)+(s<<16);
40 - outframe[i]=(outframe[i]&0xFF000000)|s;
41 + s=in->oufr[4*i+3];
42 + in->oufr[4*i]=s;
43 + in->oufr[4*i+1]=s;
44 + in->oufr[4*i+2]=s;
45 + in->oufr[4*i+3]=0xFF;
46 }
47 else
48 for (i=0;i<in->w*in->h;i++)
49 {
50 - s=(inframe[i]&0xFF000000)>>24;
51 - s=s+(s<<8)+(s<<16);
52 - outframe[i]=(outframe[i]&0xFF000000)+s;
53 + s=in->infr[4*i+3];
54 + in->oufr[4*i]=s;
55 + in->oufr[4*i+1]=s;
56 + in->oufr[4*i+2]=s;
57 + in->oufr[4*i+3]=0xFF;
58 }
59 }
60
61 //---------------------------------------------------
62 -//RGBA8888 little endian
63 void grayred(inst *in, const uint32_t* inframe, uint32_t* outframe)
64 {
65 -int i;
66 -uint32_t r,g,b,a,y,s;
67 +int i,rr;
68 +uint8_t r,g,b,a,y;
69
70 if (in->din==0)
71 for (i=0;i<in->w*in->h;i++)
72 {
73 - b=(inframe[i]&0x00FF0000)>>16;
74 - g=(inframe[i]&0x0000FF00)>>8;
75 - r=inframe[i]&0x000000FF;
76 - a=(outframe[i]&0xFF000000)>>24;
77 + b=in->infr[4*i+2];
78 + g=in->infr[4*i+1];
79 + r=in->infr[4*i];
80 + a=in->oufr[4*i+3];
81 y=(r>>2)+(g>>1)+(b>>2); //approx luma
82 y=64+(y>>1);
83 - r=y+(a>>1);
84 - if (r>255) r=255;
85 - s=r+(y<<8)+(y<<16);
86 - outframe[i]=(inframe[i]&0xFF000000)+s;
87 + rr=y+(a>>1);
88 + if (rr>255) rr=255;
89 + in->oufr[4*i]=rr;
90 + in->oufr[4*i+1]=y;
91 + in->oufr[4*i+2]=y;
92 + in->oufr[4*i+3]=0xFF;
93 }
94 else
95 for (i=0;i<in->w*in->h;i++)
96 {
97 - b=(inframe[i]&0x00FF0000)>>16;
98 - g=(inframe[i]&0x0000FF00)>>8;
99 - r=inframe[i]&0x000000FF;
100 - a=(inframe[i]&0xFF000000)>>24;
101 - y=(r>>2)+(g>>1)+(b>>2);
102 + b=in->infr[4*i+2];
103 + g=in->infr[4*i+1];
104 + r=in->infr[4*i];
105 + a=in->infr[4*i+3];
106 + y=(r>>2)+(g>>1)+(b>>2); //approx luma
107 y=64+(y>>1);
108 - r=y+(a<<1);
109 - if (r>255) r=255;
110 - s=r+(y<<8)+(y<<16);
111 - outframe[i]=(inframe[i]&0xFF000000)+s;
112 + rr=y+(a>>1);
113 + if (rr>255) rr=255;
114 + in->oufr[4*i]=rr;
115 + in->oufr[4*i+1]=y;
116 + in->oufr[4*i+2]=y;
117 + in->oufr[4*i+3]=0xFF;
118 }
119 }
120
121 @@ -118,7 +129,7 @@
122 {
123 int i;
124 uint32_t bk;
125 -uint32_t r,g,b,a,s;
126 +uint32_t r,g,b,a;
127
128 switch (bg)
129 {
130 @@ -138,18 +149,17 @@
131 else
132 bk=0x9B;
133 }
134 - b=(outframe[i]&0x00FF0000)>>16;
135 - g=(outframe[i]&0x0000FF00)>>8;
136 - r=outframe[i]&0x000000FF;
137 - a=(outframe[i]&0xFF000000)>>24;
138 - r=a*r+(255-a)*bk;
139 - r=r>>8;
140 - g=a*g+(255-a)*bk;
141 - g=g>>8;
142 - b=a*b+(255-a)*bk;
143 - b=b>>8;
144 - s=r+(g<<8)+(b<<16);
145 - outframe[i]=(inframe[i]&0xFF000000)+s;
146 + b=in->oufr[4*i+2];
147 + g=in->oufr[4*i+1];
148 + r=in->oufr[4*i];
149 + a=in->oufr[4*i+3];
150 + r=(a*r+(255-a)*bk)>>8;
151 + g=(a*g+(255-a)*bk)>>8;
152 + b=(a*b+(255-a)*bk)>>8;
153 + in->oufr[4*i]=r;
154 + in->oufr[4*i+1]=g;
155 + in->oufr[4*i+2]=b;
156 + in->oufr[4*i+3]=0xFF;
157 }
158 else
159 for (i=0;i<in->w*in->h;i++)
160 @@ -161,18 +171,17 @@
161 else
162 bk=0x9B;
163 }
164 - b=(inframe[i]&0x00FF0000)>>16;
165 - g=(inframe[i]&0x0000FF00)>>8;
166 - r=inframe[i]&0x000000FF;
167 - a=(inframe[i]&0xFF000000)>>24;
168 - r=a*r+(255-a)*bk;
169 - r=r>>8;
170 - g=a*g+(255-a)*bk;
171 - g=g>>8;
172 - b=a*b+(255-a)*bk;
173 - b=b>>8;
174 - s=r+(g<<8)+(b<<16);
175 - outframe[i]=(inframe[i]&0xFF000000)+s;
176 + b=in->infr[4*i+2];
177 + g=in->infr[4*i+1];
178 + r=in->infr[4*i];
179 + a=in->infr[4*i+3];
180 + r=(a*r+(255-a)*bk)>>8;
181 + g=(a*g+(255-a)*bk)>>8;
182 + b=(a*b+(255-a)*bk)>>8;
183 + in->oufr[4*i]=r;
184 + in->oufr[4*i+1]=g;
185 + in->oufr[4*i+2]=b;
186 + in->oufr[4*i+3]=0xFF;
187 }
188 }
189
190 @@ -378,7 +387,7 @@
191 info->color_model=F0R_COLOR_MODEL_RGBA8888;
192 info->frei0r_version=FREI0R_MAJOR_VERSION;
193 info->major_version=0;
194 -info->minor_version=1;
195 +info->minor_version=2;
196 info->num_params=6;
197 info->explanation="Display and manipulation of the alpha channel";
198 }
199 @@ -507,8 +516,6 @@
200 void f0r_get_param_value(f0r_instance_t instance, f0r_param_t param, int param_index)
201 {
202 inst *p;
203 -double tmpf;
204 -int tmpi;
205
206 p=(inst*)instance;
207
208 @@ -544,11 +551,13 @@
209
210 assert(instance);
211 in=(inst*)instance;
212 +in->infr=(uint8_t*)inframe;
213 +in->oufr=(uint8_t*)outframe;
214
215 //printf("update, op=%d, inv=%d disp=%d\n",in->op,in->inv,in->disp);
216
217 for (i=0;i<in->w*in->h;i++)
218 - in->falpha[i]=(inframe[i]&0xFF000000)>>24;
219 + in->falpha[i]=in->infr[4*i+3];
220
221 switch (in->op)
222 {
223 @@ -585,8 +594,11 @@
224 in->falpha[i]=255.0-in->falpha[i];
225
226 for (i=0;i<in->w*in->h;i++)
227 - outframe[i] = (inframe[i]&0x00FFFFFF) | (((uint32_t)in->falpha[i])<<24);
228 -
229 + {
230 + outframe[i] = inframe[i];
231 + in->oufr[4*i+3] = (uint8_t)in->falpha[i];
232 + }
233 +
234 switch (in->disp)
235 {
236 case 0:
237 --- a/src/filter/alpha0ps/readme
238 +++ b/src/filter/alpha0ps/readme
239 @@ -19,6 +19,9 @@
240 Version 0.1
241 "pre-alpha" (throw it out and see what happens... :-)
242
243 +** aug 2012
244 +Version 0.2
245 +Endian proofing (use uint8_t* to access image data)
246
247
248 ALPHAOPS:
0 Description: Fix undefined symbols with "raw" inlines (not extern or static).
1 This was noticed with gcc when not using -O2 or perhaps some other
2 optimizations.
3 Origin: upstream, http://git.dyne.org/frei0r/commit/?id=cbd4049
4 Author: Dan Dennedy <dan@dennedy.org>
5 Forwarded: yes
6 Last-Update: 2012-12-23
7
8 --- a/src/filter/denoise/hqdn3d.c
9 +++ b/src/filter/denoise/hqdn3d.c
10 @@ -66,7 +66,7 @@
11 //deNoise and PrecalaCoefs are from Mplayer "hqdn3d" filter
12 //by Daniel Moreno <comac@comac.darktech.org>
13
14 -inline unsigned int LowPassMul(unsigned int PrevMul, unsigned int CurrMul, int* Coef){
15 +static inline unsigned int LowPassMul(unsigned int PrevMul, unsigned int CurrMul, int* Coef){
16 // int dMul= (PrevMul&0xFFFFFF)-(CurrMul&0xFFFFFF);
17 int dMul= PrevMul-CurrMul;
18 unsigned int d=((dMul+0x10007FF)>>12);
19 --- a/src/filter/select0r/select0r.c
20 +++ b/src/filter/select0r/select0r.c
21 @@ -61,7 +61,7 @@
22 // returns square of distance
23 // r==1 is edge of subspace
24 //box shape
25 -inline float dist_box(float cx, float cy, float cz, float dx, float dy, float dz, float x, float y, float z)
26 +static inline float dist_box(float cx, float cy, float cz, float dx, float dy, float dz, float x, float y, float z)
27 {
28 float ax,ay,az,r;
29
30 @@ -75,7 +75,7 @@
31 return r;
32 }
33 //ellipsoid shape
34 -inline float dist_eli(float cx, float cy, float cz, float dx, float dy, float dz, float x, float y, float z)
35 +static inline float dist_eli(float cx, float cy, float cz, float dx, float dy, float dz, float x, float y, float z)
36 {
37 float ax,ay,az,r;
38
39 @@ -86,7 +86,7 @@
40 return r;
41 }
42 //octahedron shape
43 -inline float dist_oct(float cx, float cy, float cz, float dx, float dy, float dz, float x, float y, float z)
44 +static inline float dist_oct(float cx, float cy, float cz, float dx, float dy, float dz, float x, float y, float z)
45 {
46 float ax,ay,az,r;
47
48 @@ -98,7 +98,7 @@
49 return r;
50 }
51 //box shape, cylindrical space
52 -inline float dist_box_c(float chue, float cy, float cz, float dhue, float dy, float dz, float hue, float y, float z)
53 +static inline float dist_box_c(float chue, float cy, float cz, float dhue, float dy, float dz, float hue, float y, float z)
54 {
55 float ax,ay,az,r;
56
57 @@ -115,7 +115,7 @@
58 return r;
59 }
60 //ellipsoid shape, cylindrical space
61 -inline float dist_eli_c(float chue, float cy, float cz, float dhue, float dy, float dz, float hue, float y, float z)
62 +static inline float dist_eli_c(float chue, float cy, float cz, float dhue, float dy, float dz, float hue, float y, float z)
63 {
64 float ax,ay,az,r;
65
66 @@ -129,7 +129,7 @@
67 return r;
68 }
69 //octahedron shape, cylindrical space
70 -inline float dist_oct_c(float chue, float cy, float cz, float dhue, float dy, float dz, float hue, float y, float z)
71 +static inline float dist_oct_c(float chue, float cy, float cz, float dhue, float dy, float dz, float hue, float y, float z)
72 {
73 float ax,ay,az,r;
74
75 @@ -146,7 +146,7 @@
76
77 //----------------------------------------------------------
78 //inline RGB to ABI conversion function
79 -inline void rgb2abi(float k32, float r, float g, float b, float *a, float *bb, float *i)
80 +static inline void rgb2abi(float k32, float r, float g, float b, float *a, float *bb, float *i)
81 {
82 *a=r-0.5*g-0.5*b;
83 *bb=k32*(g-b);
84 @@ -155,7 +155,7 @@
85
86 //----------------------------------------------------------
87 //inline RGB to HCI conversion function
88 -inline void rgb2hci(float ipi2, float k32, float r, float g, float b, float *h, float *c, float *i)
89 +static inline void rgb2hci(float ipi2, float k32, float r, float g, float b, float *h, float *c, float *i)
90 {
91 float a,bb;
92 a=r-0.5*g-0.5*b;
93 @@ -167,24 +167,24 @@
94
95 //------------------------------------------------------
96 //thresholding inline functions (hard and soft)
97 -inline float thres(float a)
98 +static inline float thres(float a)
99 {
100 return (a<1.0) ? 1.0 : 0.0;
101 }
102
103 -inline float fat(float a)
104 +static inline float fat(float a)
105 {
106 a=a*a*a*a;
107 return (a<1.0) ? 1.0-a : 0.0;
108 }
109
110 -inline float norm(float a)
111 +static inline float norm(float a)
112 {
113 a=a*a;
114 return (a<1.0) ? 1.0-a : 0.0;
115 }
116
117 -inline float skiny(float a)
118 +static inline float skiny(float a)
119 {
120 return (a<1.0) ? 1.0-a : 0.0;
121 }
122 @@ -952,4 +952,4 @@
123
124 }
125
126 -//**********************************************************
127 \ No newline at end of file
128 +//**********************************************************
0 0xxx: Grabbed from upstream development.
1 1xxx: Possibly relevant for upstream adoption.
2 2xxx: Only relevant for official Debian release.
0 020110315~2a1524a.patch
1 020110315~b4065ce.patch
2 020110316~6c65d6a.patch
3 020110806~0309859.patch
4 020110806~f73c962.patch
5 020110815~339ad24.patch
6 020110815~899fd4d.patch
7 020110815~9e606ce.patch
8 020110815~f74a435.patch
9 020110816~2ddbaba.patch
10 020110816~9bf94ea.patch
11 020110816~c8d6510.patch
12 020110817~0b4044c.patch
13 020110817~1bb4a6c.patch
14 020110817~6197fb0.patch
15 020110817~e0f11e9.patch
16 020110821~dc23844.patch
17 020110822~39e4492.patch
18 020110822~62b9f1c.patch
19 020110822~63f2186.patch
20 020110823~0eb9f2a.patch
21 020110823~22e4f73.patch
22 020110823~90ee1fa.patch
23 020110825~0be0cec.patch
24 020110825~b8f2300.patch
25 020110831~63c0878.patch
26 020110903~63bafff.patch
27 020110903~b467ddc.patch
28 020110903~f7cc65f.patch
29 020110910~047c762.patch
30 020110910~39e65be.patch
31 020110910~661a7b4.patch
32 020110910~d4d29e9.patch
33 020110910~ee7bb57.patch
34 020110911~a6c266a.patch
35 020110928~8f80908.patch
36 020110928~9c93c22.patch
37 020110928~f1794f8.patch
38 020120331~0fade7e.patch
39 020120406~5f719f2.patch
40 020120406~6b780c3.patch
41 020120608~7f54736.patch
42 020120828~33b8c35.patch
43 020121014~cbd4049.patch