MythTV master
filters.cpp
Go to the documentation of this file.
1/* filter.c version 0.7
2* contient les filtres applicable a un buffer
3* creation : 01/10/2000
4* -ajout de sinFilter()
5* -ajout de zoomFilter()
6* -copie de zoomFilter() en zoomFilterRGB(), gérant les 3 couleurs
7* -optimisation de sinFilter (utilisant une table de sin)
8* -asm
9* -optimisation de la procedure de génération du buffer de transformation
10* la vitesse est maintenant comprise dans [0..128] au lieu de [0..100]
11*/
12
13//#define _DEBUG_PIXEL;
14
15#include <algorithm>
16#include <array>
17#include <cinttypes>
18#include <cmath>
19#include <cstdio>
20#include <cstdlib>
21
22#include "filters.h"
23#include "goom_tools.h"
24#include "graphic.h"
26#include "libmythbase/mythconfig.h"
27
28static constexpr int8_t EFFECT_DISTORS { 4 };
29static constexpr int8_t EFFECT_DISTORS_SL { 2 };
30
31extern volatile guint32 resolx;
32extern volatile guint32 c_resoly;
33
34void c_zoom (unsigned int *expix1, unsigned int *expix2, unsigned int prevX, unsigned int prevY, const signed int *brutS, const signed int *brutD);
35
36/* Prototype to keep gcc from spewing warnings */
37static void select_zoom_filter (void);
38
39#if HAVE_MMX
40
41static int zf_use_xmmx = 0;
42static int zf_use_mmx = 0;
43
44static void select_zoom_filter (void) {
45 static int s_firsttime = 1;
46 if (s_firsttime){
48 zf_use_xmmx = 1;
49 printf ("Extended MMX detected. Using the fastest method !\n");
50 }
51 else if (zoom_filter_mmx_supported()) {
52 zf_use_mmx = 1;
53 printf ("MMX detected. Using fast method !\n");
54 }
55 else {
56 printf ("Too bad ! No MMX detected.\n");
57 }
58 s_firsttime = 0;
59 }
60}
61
62#else /* !HAVE_MMX */
63
64static void select_zoom_filter (void) {
65 static int firsttime = 1;
66 if (firsttime) {
67 printf ("No MMX support compiled in\n");
68 firsttime = 0;
69 }
70}
71
72#endif /* HAVE_MMX */
73
74
76
77unsigned int *coeffs = nullptr, *freecoeffs = nullptr;
78
79signed int *brutS = nullptr, *freebrutS = nullptr; // source
80signed int *brutD = nullptr, *freebrutD = nullptr; // dest
81signed int *brutT = nullptr, *freebrutT = nullptr; // temp (en cours de génération)
82
83// TODO : virer
84guint32 *expix1 = nullptr; // pointeur exporte vers p1
85guint32 *expix2 = nullptr; // pointeur exporte vers p2
86// fin TODO
87
89
90unsigned int prevX = 0, prevY = 0;
91
92static std::array<int,0x10000> sintable;
93static int vitesse = 127;
94static char theMode = AMULETTE_MODE;
95static bool waveEffect = false;
96static bool hypercosEffect = false;
97static int vPlaneEffect = 0;
98static int hPlaneEffect = 0;
99static char noisify = 2;
100static int middleX, middleY;
101
102//static unsigned char sqrtperte = 16 ;
103
105//static int buffratio = 0;
106int buffratio = 0;
107
108static constexpr uint8_t BUFFPOINTNB { 16 };
109static constexpr int32_t BUFFPOINTMASK { 0xffff };
110//static constexpr uint8_t BUFFINCR { 0xff };
111
112static constexpr int8_t sqrtperte { 16 };
113// faire : a % sqrtperte <=> a & pertemask
114static constexpr int8_t PERTEMASK { 0xf };
115// faire : a / sqrtperte <=> a >> PERTEDEC
116static constexpr uint8_t PERTEDEC { 4 };
117
118static int *firedec = nullptr;
119
120
121// retourne x>>s , en testant le signe de x
122static inline int ShiftRight(int x,int s) {return (x<0) ? -((-x)>>s) : (x>>s); }
123
126
127/* Prototypes to keep gcc from spewing warnings */
128void generatePrecalCoef (void);
129void calculatePXandPY (int x, int y, int *px, int *py);
130void setPixelRGB (Uint * buffer, Uint x, Uint y, Color c);
131void setPixelRGB_ (Uint * buffer, Uint x, Color c);
132inline void getPixelRGB (const Uint * buffer, Uint x, Uint y, Color * c);
133void getPixelRGB_ (const Uint * buffer, Uint x, Color * c);
134
135void
137{
138 static int s_firstime = 1;
139
140 if (s_firstime) {
141 s_firstime = 0;
142
143 for (int coefh = 0; coefh < 16; coefh++) {
144
145 for (int coefv = 0; coefv < 16; coefv++) {
146 int i = 0;
147 int diffcoeffh = sqrtperte - coefh;
148 int diffcoeffv = sqrtperte - coefv;
149
150 // coeffs[myPos] = ((px >> PERTEDEC) + prevX * (py >> PERTEDEC)) <<
151 // 2;
152 if (!(coefh || coefv))
153 i = 255;
154 else {
155 int i1 = diffcoeffh * diffcoeffv;
156 int i2 = coefh * diffcoeffv;
157 int i3 = diffcoeffh * coefv;
158 int i4 = coefh * coefv;
159 if (i1)
160 i1--;
161 if (i2)
162 i2--;
163 if (i3)
164 i3--;
165 if (i4)
166 i4--;
167
168 i = (i1) | (i2 << 8) | (i3 << 16) | (i4 << 24);
169 }
170 precalCoef[coefh][coefv] = i;
171 }
172 }
173 }
174}
175
176/*
177 calculer px et py en fonction de x,y,middleX,middleY et theMode
178 px et py indique la nouvelle position (en sqrtperte ieme de pixel)
179 (valeur * 16)
180 */
181/*inline*/ void
182calculatePXandPY (int x, int y, int *px, int *py)
183{
184 if (theMode == WATER_MODE) {
185 static int s_wave = 0;
186 static int s_wavesp = 0;
187
188 int yy = y + (RAND () % 4) - (RAND () % 4) + (s_wave / 10);
189 yy = std::max(yy, 0);
190 if (yy >= (int)c_resoly)
191 yy = c_resoly - 1;
192
193 *px = (x << 4) + firedec[yy] + (s_wave / 10);
194 *py = (y << 4) + 132 - ((vitesse < 131) ? vitesse : 130);
195
196 // NOLINTNEXTLINE(misc-redundant-expression)
197 s_wavesp += (RAND () % 3) - (RAND () % 3);
198 if (s_wave < -10)
199 s_wavesp += 2;
200 if (s_wave > 10)
201 s_wavesp -= 2;
202 s_wave += (s_wavesp / 10) + (RAND () % 3) - (RAND () % 3);
203 if (s_wavesp > 100)
204 s_wavesp = (s_wavesp * 9) / 10;
205 }
206 else {
207 int dist = 0;
208 int fvitesse = vitesse << 4;
209
210 if (noisify) {
211 // NOLINTNEXTLINE(misc-redundant-expression)
212 x += (RAND () % noisify) - (RAND () % noisify);
213 // NOLINTNEXTLINE(misc-redundant-expression)
214 y += (RAND () % noisify) - (RAND () % noisify);
215 }
216 int vx = (x - middleX) << 9;
217 int vy = (y - middleY) << 9;
218
219 if (hPlaneEffect)
220 vx += hPlaneEffect * (y - middleY);
221 // else vx = (x - middleX) << 9 ;
222
223 if (vPlaneEffect)
224 vy += vPlaneEffect * (x - middleX);
225 // else vy = (y - middleY) << 9 ;
226
227 if (waveEffect) {
228 fvitesse *=
229 1024 +
230 ShiftRight (sintable[(unsigned short) ((dist * 0xffff) + EFFECT_DISTORS)], 6);
231 fvitesse /= 1024;
232 }
233
234 if (hypercosEffect) {
235 vx += ShiftRight (sintable[(-vy + dist) & 0xffff], 1);
236 vy += ShiftRight (sintable[(vx + dist) & 0xffff], 1);
237 }
238
239 int vx9 = ShiftRight (vx, 9);
240 int vy9 = ShiftRight (vy, 9);
241 dist = (vx9 * vx9) + (vy9 * vy9);
242
243 switch (theMode) {
244 case WAVE_MODE:
245 fvitesse *=
246 1024 +
247 ShiftRight (sintable[(unsigned short) (dist * 0xffff * EFFECT_DISTORS)], 6);
248 fvitesse>>=10;
249 break;
251 fvitesse += (dist >> (10-EFFECT_DISTORS_SL));
252 break;
253 case AMULETTE_MODE:
254 fvitesse -= (dist >> (4 - EFFECT_DISTORS_SL));
255 break;
256 case SCRUNCH_MODE:
257 fvitesse -= (dist >> (10 - EFFECT_DISTORS_SL));
258 break;
259 case HYPERCOS1_MODE:
260 vx = vx + ShiftRight (sintable[(-vy + dist) & 0xffff], 1);
261 vy = vy + ShiftRight (sintable[(vx + dist) & 0xffff], 1);
262 break;
263 case HYPERCOS2_MODE:
264 vx =
265 vx + ShiftRight (sintable[(-ShiftRight (vy, 1) + dist) & 0xffff], 0);
266 vy =
267 vy + ShiftRight (sintable[(ShiftRight (vx, 1) + dist) & 0xffff], 0);
268 fvitesse = 128 << 4;
269 break;
270 case YONLY_MODE:
271 fvitesse *= 1024 + ShiftRight (sintable[vy & 0xffff], 6);
272 fvitesse >>= 10;
273 break;
274 case SPEEDWAY_MODE:
275 fvitesse -= (ShiftRight(vy,10-EFFECT_DISTORS_SL));
276 break;
277 }
278
279 fvitesse = std::max(fvitesse, -3024);
280
281 int ppx = 0;
282 int ppy = 0;
283 if (vx < 0) { // pb avec decalage sur nb negatif
284 ppx = -(-(vx * fvitesse) >> 16);
285 /* 16 = 9 + 7 (7 = nb chiffre virgule de vitesse * (v = 128 => immobile)
286 * * * * * 9 = nb chiffre virgule de vx) */
287 } else {
288 ppx = ((vx * fvitesse) >> 16);
289 }
290
291 if (vy < 0)
292 ppy = -(-(vy * fvitesse) >> 16);
293 else
294 ppy = ((vy * fvitesse) >> 16);
295
296 *px = (middleX << 4) + ppx;
297 *py = (middleY << 4) + ppy;
298 }
299}
300
301//#define _DEBUG
302
303/*inline*/ void
304setPixelRGB (Uint * buffer, Uint x, Uint y, Color c)
305{
306 // buffer[ y*WIDTH + x ] = (c.r<<16)|(c.v<<8)|c.b
307#ifdef _DEBUG_PIXEL
308 if (x + y * resolx >= resolx * resoly) {
309 fprintf (stderr, "setPixel ERROR : hors du tableau... %i, %i\n", x, y);
310 // exit (1) ;
311 }
312#endif
313
314 buffer[(y * resolx) + x] =
315 (c.b << (BLEU * 8)) | (c.v << (VERT * 8)) | (c.r << (ROUGE * 8));
316}
317
318
319/*inline*/ void
320setPixelRGB_ (Uint * buffer, Uint x, Color c)
321{
322#ifdef _DEBUG
323 if (x >= resolx * c_resoly) {
324 printf ("setPixel ERROR : hors du tableau... %i\n", x);
325 // exit (1) ;
326 }
327#endif
328
329 buffer[x] = (c.r << (ROUGE * 8)) | (c.v << (VERT * 8)) | c.b << (BLEU * 8);
330}
331
332
333
334inline void
335getPixelRGB (const Uint * buffer, Uint x, Uint y, Color * c)
336{
337#ifdef _DEBUG
338 if (x + y * resolx >= resolx * c_resoly) {
339 printf ("getPixel ERROR : hors du tableau... %i, %i\n", x, y);
340 // exit (1) ;
341 }
342#endif
343
344 /* ATTENTION AU PETIT INDIEN */
345 unsigned int i = *(buffer + (x + y * resolx));
346 c->b = (i >> (BLEU * 8)) & 0xff;
347 c->v = (i >> (VERT * 8)) & 0xff;
348 c->r = (i >> (ROUGE * 8)) & 0xff;
349}
350
351
352/*inline*/ void
353getPixelRGB_ (const Uint * buffer, Uint x, Color * c)
354{
355 unsigned char *tmp8 = nullptr;
356
357#ifdef _DEBUG
358 if (x >= resolx * c_resoly) {
359 printf ("getPixel ERROR : hors du tableau... %i\n", x);
360 // exit (1) ;
361 }
362#endif
363
364#ifdef __BIG_ENDIAN__
365 c->b = *(unsigned char *) (tmp8 = (unsigned char *) (buffer + x));
366 c->r = *(unsigned char *) (++tmp8);
367 c->v = *(unsigned char *) (++tmp8);
368 c->b = *(unsigned char *) (++tmp8);
369
370#else
371 /* ATTENTION AU PETIT INDIEN */
372 c->b = *(tmp8 = (unsigned char *) (buffer + x));
373 c->v = *(++tmp8);
374 c->r = *(++tmp8);
375 // *c = (Color) buffer[x+y*WIDTH] ;
376#endif
377}
378
379
380void c_zoom (unsigned int *lexpix1, unsigned int *lexpix2,
381 unsigned int lprevX, unsigned int lprevY,
382 const signed int *lbrutS, const signed int *lbrutD)
383{
384 Color couleur {};
385// unsigned int coefv, coefh;
386
387 unsigned int ax = (lprevX - 1) << PERTEDEC;
388 unsigned int ay = (lprevY - 1) << PERTEDEC;
389
390 int bufsize = lprevX * lprevY * 2;
391 int bufwidth = lprevX;
392
393 lexpix1[0]=lexpix1[lprevX-1]=lexpix1[(lprevX*lprevY)-1]=lexpix1[(lprevX*lprevY)-lprevX]=0;
394
395 for (int myPos = 0; myPos < bufsize; myPos += 2) {
396 Color col1 {};
397 Color col2 {};
398 Color col3 {};
399 Color col4 {};
400 int brutSmypos = lbrutS[myPos];
401
402 int myPos2 = myPos + 1;
403
404 int px = brutSmypos + (((lbrutD[myPos] - brutSmypos) * buffratio) >> BUFFPOINTNB);
405 brutSmypos = lbrutS[myPos2];
406 int py = brutSmypos + (((lbrutD[myPos2] - brutSmypos) * buffratio) >> BUFFPOINTNB);
407
408 px = std::max(px, 0);
409 py = std::max(py, 0);
410
411 int pos = ((px >> PERTEDEC) + (lprevX * (py >> PERTEDEC)));
412 // coef en modulo 15
413 int lcoeffs = precalCoef[px & PERTEMASK][py & PERTEMASK];
414
415 if ((py >= (int)ay) || (px >= (int)ax)) {
416 pos = lcoeffs = 0;
417 }
418
419 getPixelRGB_ (lexpix1, pos, &col1);
420 getPixelRGB_ (lexpix1, pos + 1, &col2);
421 getPixelRGB_ (lexpix1, pos + bufwidth, &col3);
422 getPixelRGB_ (lexpix1, pos + bufwidth + 1, &col4);
423
424 int c1 = lcoeffs;
425 int c2 = (c1 & 0x0000ff00) >> 8;
426 int c3 = (c1 & 0x00ff0000) >> 16;
427 int c4 = (c1 & 0xff000000) >> 24;
428 c1 = c1 & 0xff;
429
430 couleur.r = (col1.r * c1) + (col2.r * c2) + (col3.r * c3) + (col4.r * c4);
431 if (couleur.r > 5)
432 couleur.r -= 5;
433 couleur.r >>= 8;
434
435 couleur.v = (col1.v * c1) + (col2.v * c2) + (col3.v * c3) + (col4.v * c4);
436 if (couleur.v > 5)
437 couleur.v -= 5;
438 couleur.v >>= 8;
439
440 couleur.b = (col1.b * c1) + (col2.b * c2) + (col3.b * c3) + (col4.b * c4);
441 if (couleur.b > 5)
442 couleur.b -= 5;
443 couleur.b >>= 8;
444
445 setPixelRGB_ (lexpix2, myPos >> 1, couleur);
446 }
447}
448
449/*===============================================================*/
450void
451zoomFilterFastRGB (Uint * pix1, Uint * pix2, ZoomFilterData * zf, Uint resx, Uint resy, int switchIncr, float switchMult)
452{
453 [[maybe_unused]] static unsigned char s_pertedec = 8;
454 static char s_firstTime = 1;
455
456 static constexpr int8_t INTERLACE_INCR { 16 };
457 //static constexpr int8_t INTERLACE_ADD { 9 };
458 //static constexpr int8_t INTERLACE_AND { 0xf };
459 static int s_interlaceStart = -2;
460
461 expix1 = pix1;
462 expix2 = pix2;
463
465 if ((prevX != resx) || (prevY != resy)) {
466 prevX = resx;
467 prevY = resy;
468
469 if (brutS)
470 free (freebrutS);
471 brutS = nullptr;
472 if (brutD)
473 free (freebrutD);
474 brutD = nullptr;
475 if (brutT)
476 free (freebrutT);
477 brutT = nullptr;
478
479 middleX = resx / 2;
480 middleY = resy - 1;
481 s_firstTime = 1;
482 if (firedec)
483 free (firedec);
484 firedec = nullptr;
485 }
486
487 if (s_interlaceStart != -2)
488 zf = nullptr;
489
491 if (zf) {
492 static bool s_reverse = false; // vitesse inversé..(zoom out)
493 s_reverse = zf->reverse;
494 vitesse = zf->vitesse;
495 if (s_reverse)
496 vitesse = 256 - vitesse;
497 s_pertedec = zf->pertedec;
498 middleX = zf->middleX;
499 middleY = zf->middleY;
500 theMode = zf->mode;
505 noisify = zf->noisify;
506 }
507
509 if (s_firstTime || zf) {
510
511 // generation d'une table de sinus
512 if (s_firstTime) {
513 s_firstTime = 0;
516
517 freebrutS = (signed int *) calloc ((resx * resy * 2) + 128, sizeof(signed int));
518 brutS = (signed int *) ((1 + ((uintptr_t) (freebrutS)) / 128) * 128);
519
520 freebrutD = (signed int *) calloc ((resx * resy * 2) + 128, sizeof(signed int));
521 brutD = (signed int *) ((1 + ((uintptr_t) (freebrutD)) / 128) * 128);
522
523 freebrutT = (signed int *) calloc ((resx * resy * 2) + 128, sizeof(signed int));
524 brutT = (signed int *) ((1 + ((uintptr_t) (freebrutT)) / 128) * 128);
525
527 {
528 int yperte = 0;
529 int yofs = 0;
530
531 for (Uint y = 0; y < resy; y++, yofs += resx) {
532 int xofs = yofs << 1;
533 int xperte = 0;
534
535 for (Uint x = 0; x < resx; x++) {
536 brutS[xofs++] = xperte;
537 brutS[xofs++] = yperte;
538 xperte += sqrtperte;
539 }
540 yperte += sqrtperte;
541 }
542 buffratio = 0;
543 }
544
545 for (uint16_t us = 0; us < 0xffff; us++) {
546 sintable[us] =
547 roundf(1024 * sinf ((float) us * 360
548 / ((float)sintable.size() - 1)
549 * 3.141592F / 180));
550 }
551
552 {
553 firedec = (int *) malloc (prevY * sizeof (int));
554
555 for (int loopv = prevY; loopv != 0;) {
556 static int s_decc = 0;
557 static int s_spdc = 0;
558 static int s_accel = 0;
559
560 loopv--;
561 firedec[loopv] = s_decc;
562 s_decc += s_spdc / 10;
563 // NOLINTNEXTLINE(misc-redundant-expression)
564 s_spdc += (RAND () % 3) - (RAND () % 3);
565
566 if (s_decc > 4)
567 s_spdc -= 1;
568 if (s_decc < -4)
569 s_spdc += 1;
570
571 if (s_spdc > 30)
572 s_spdc = s_spdc - (RAND () % 3) + (s_accel / 10);
573 if (s_spdc < -30)
574 s_spdc = s_spdc + (RAND () % 3) + (s_accel / 10);
575
576 if (s_decc > 8 && s_spdc > 1)
577 s_spdc -= (RAND () % 3) - 2;
578
579 if (s_decc < -8 && s_spdc < -1)
580 s_spdc += (RAND () % 3) + 2;
581
582 if (s_decc > 8 || s_decc < -8)
583 s_decc = s_decc * 8 / 9;
584
585 // NOLINTNEXTLINE(misc-redundant-expression)
586 s_accel += (RAND () % 2) - (RAND () % 2);
587 if (s_accel > 20)
588 s_accel -= 2;
589 if (s_accel < -20)
590 s_accel += 2;
591 }
592 }
593 }
594
595 s_interlaceStart = 0;
596 }
597 // generation du buffer de trans
598 if (s_interlaceStart==-1) {
599
600 /* sauvegarde de l'etat actuel dans la nouvelle source */
601
602 Uint y = prevX * prevY * 2;
603 for (Uint x = 0; x < y; x += 2) {
604 int brutSmypos = brutS[x];
605 int x2 = x + 1;
606
607 brutS[x] =
608 brutSmypos + (((brutD[x] - brutSmypos) * buffratio) >> BUFFPOINTNB);
609 brutSmypos = brutS[x2];
610 brutS[x2] =
611 brutSmypos +
612 (((brutD[x2] - brutSmypos) * buffratio) >> BUFFPOINTNB);
613 }
614 buffratio = 0;
615
616 signed int * tmp = brutD;
617 brutD=brutT;
618 brutT=tmp;
619 tmp = freebrutD;
622 s_interlaceStart = -2;
623 }
624
625 if (s_interlaceStart>=0) {
626 int maxEnd = (s_interlaceStart+INTERLACE_INCR);
627 /* creation de la nouvelle destination */
628 Uint y = (Uint)s_interlaceStart;
629 for ( ; (y < (Uint)prevY) && (y < (Uint)maxEnd); y++) {
630 Uint premul_y_prevX = y * prevX * 2;
631 for (Uint x = 0; x < prevX; x++) {
632 int px = 0;
633 int py = 0;
634
635 calculatePXandPY (x, y, &px, &py);
636
637 brutT[premul_y_prevX] = px;
638 brutT[premul_y_prevX + 1] = py;
639 premul_y_prevX += 2;
640 }
641 }
642 s_interlaceStart += INTERLACE_INCR;
643 if (y >= prevY-1) s_interlaceStart = -1;
644 }
645
646 if (switchIncr != 0) {
647 buffratio += switchIncr;
648 buffratio = std::min(buffratio, BUFFPOINTMASK);
649 }
650
651 if (switchMult != 1.0F) {
652 buffratio =
653 (int) (((float) BUFFPOINTMASK * (1.0F - switchMult)) +
654 ((float) buffratio * switchMult));
655 }
656
659
660#if HAVE_MMX
661 if (zf_use_xmmx) {
664 } else if (zf_use_mmx) {
667 } else {
669 }
670#else
672#endif
673}
674
675void
676pointFilter (Uint * pix1, Color c, float t1, float t2, float t3, float t4, Uint cycle)
677{
678 Uint x = (Uint) ((int) (resolx/2) + (int) (t1 * cosf ((float) cycle / t3)));
679 Uint y = (Uint) ((int) (c_resoly/2) + (int) (t2 * sinf ((float) cycle / t4)));
680
681 if ((x > 1) && (y > 1) && (x < resolx - 2) && (y < c_resoly - 2)) {
682 setPixelRGB (pix1, x + 1, y, c);
683 setPixelRGB (pix1, x, y + 1, c);
684 setPixelRGB (pix1, x + 1, y + 1, WHITE);
685 setPixelRGB (pix1, x + 2, y + 1, c);
686 setPixelRGB (pix1, x + 1, y + 2, c);
687 }
688}
static int * firedec
Definition: filters.cpp:118
static std::array< int, 0x10000 > sintable
Definition: filters.cpp:92
void getPixelRGB(const Uint *buffer, Uint x, Uint y, Color *c)
Definition: filters.cpp:335
static bool hypercosEffect
Definition: filters.cpp:96
void calculatePXandPY(int x, int y, int *px, int *py)
Definition: filters.cpp:182
signed int * brutD
Definition: filters.cpp:80
static char noisify
Definition: filters.cpp:99
static constexpr int8_t PERTEMASK
Definition: filters.cpp:114
static bool waveEffect
Definition: filters.cpp:95
signed int * brutT
Definition: filters.cpp:81
static constexpr int8_t EFFECT_DISTORS_SL
Definition: filters.cpp:29
static void select_zoom_filter(void)
Definition: filters.cpp:64
static int vitesse
Definition: filters.cpp:93
static constexpr uint8_t BUFFPOINTNB
Definition: filters.cpp:108
void c_zoom(unsigned int *expix1, unsigned int *expix2, unsigned int prevX, unsigned int prevY, const signed int *brutS, const signed int *brutD)
Definition: filters.cpp:380
void getPixelRGB_(const Uint *buffer, Uint x, Color *c)
Definition: filters.cpp:353
guint32 * expix2
Definition: filters.cpp:85
guint32 * expix1
Definition: filters.cpp:84
static int vPlaneEffect
Definition: filters.cpp:97
guint32 mmx_zoom_size
Definition: filters.cpp:75
static char theMode
Definition: filters.cpp:94
signed int * freebrutD
Definition: filters.cpp:80
volatile guint32 resolx
Definition: goom_core.cpp:56
guint32 zoom_width
Definition: filters.cpp:88
static constexpr int8_t sqrtperte
Definition: filters.cpp:112
static int middleX
Definition: filters.cpp:100
void zoomFilterFastRGB(Uint *pix1, Uint *pix2, ZoomFilterData *zf, Uint resx, Uint resy, int switchIncr, float switchMult)
Definition: filters.cpp:451
unsigned int * coeffs
Definition: filters.cpp:77
unsigned int prevY
Definition: filters.cpp:90
unsigned int * freecoeffs
Definition: filters.cpp:77
unsigned int prevX
Definition: filters.cpp:90
static constexpr int32_t BUFFPOINTMASK
Definition: filters.cpp:109
GoomCoefficients precalCoef
modif d'optim by Jeko : precalcul des 4 coefs résultant des 2 pos
Definition: filters.cpp:125
void generatePrecalCoef(void)
Definition: filters.cpp:136
int buffratio
modif by jeko : fixedpoint : buffration = (16:16) (donc 0<=buffration<=2^16)
Definition: filters.cpp:106
void setPixelRGB_(Uint *buffer, Uint x, Color c)
Definition: filters.cpp:320
signed int * freebrutT
Definition: filters.cpp:81
void setPixelRGB(Uint *buffer, Uint x, Uint y, Color c)
Definition: filters.cpp:304
static constexpr int8_t EFFECT_DISTORS
Definition: filters.cpp:28
signed int * brutS
Definition: filters.cpp:79
static int middleY
Definition: filters.cpp:100
static int ShiftRight(int x, int s)
Definition: filters.cpp:122
static int hPlaneEffect
Definition: filters.cpp:98
signed int * freebrutS
Definition: filters.cpp:79
static constexpr uint8_t PERTEDEC
Definition: filters.cpp:116
volatile guint32 c_resoly
Definition: goom_core.cpp:56
void pointFilter(Uint *pix1, Color c, float t1, float t2, float t3, float t4, Uint cycle)
Definition: filters.cpp:676
#define YONLY_MODE
Definition: filters.h:37
#define CRYSTAL_BALL_MODE
Definition: filters.h:31
#define HYPERCOS2_MODE
Definition: filters.h:36
#define AMULETTE_MODE
Definition: filters.h:33
#define WAVE_MODE
Definition: filters.h:30
#define WATER_MODE
Definition: filters.h:34
#define SCRUNCH_MODE
Definition: filters.h:32
#define SPEEDWAY_MODE
Definition: filters.h:38
#define HYPERCOS1_MODE
Definition: filters.h:35
static guint32 cycle
Definition: goom_core.cpp:27
guint32 resoly
Definition: goom_core.cpp:56
static guint32 * tmp
Definition: goom_core.cpp:26
static int RAND(void)
Definition: goom_tools.h:29
#define VERT
Definition: goomconfig.h:12
#define ROUGE
position des composantes
Definition: goomconfig.h:10
#define guint32
Definition: goomconfig.h:33
#define BLEU
Definition: goomconfig.h:11
const Color WHITE
Definition: graphic.cpp:4
unsigned int Uint
Definition: graphic.h:4
unsigned short uint16_t
Definition: iso6937tables.h:3
static int x2
Definition: mythsocket.cpp:51
Definition: graphic.h:7
unsigned short b
Definition: graphic.h:8
unsigned short v
Definition: graphic.h:8
unsigned short r
Definition: graphic.h:8
bool hypercosEffect
Definition: filters.h:23
unsigned char pertedec
Definition: filters.h:13
bool waveEffect
Definition: filters.h:22
int vPlaneEffect
Definition: filters.h:20
char noisify
Definition: filters.h:25
bool reverse
Definition: filters.h:16
int hPlaneEffect
Definition: filters.h:19
void zoom_filter_mmx(int prevX, int prevY, const unsigned int *expix1, unsigned int *expix2, const int *brutS, const int *brutD, int buffratio, const GoomCoefficients &precalCoef)
int zoom_filter_mmx_supported()
void zoom_filter_xmmx(int prevX, int prevY, unsigned int *expix1, unsigned int *expix2, const int *brutS, const int *brutD, int buffratio, GoomCoefficients &precalCoef)
int zoom_filter_xmmx_supported()
std::array< std::array< int, 16 >, 16 > GoomCoefficients
Definition: zoom_filters.h:3