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