summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThibaut Mattern <tmattern@users.sourceforge.net>2003-01-28 21:57:30 +0000
committerThibaut Mattern <tmattern@users.sourceforge.net>2003-01-28 21:57:30 +0000
commit699cd1ced66dc1ae4b72afc45352c486b9a6a7b1 (patch)
tree3ddaa4de359986c0a49fee6615669148f45146fe
parentf56a12a85f48a02880ed1d073567d2d2c3e8bddb (diff)
downloadxine-lib-699cd1ced66dc1ae4b72afc45352c486b9a6a7b1.tar.gz
xine-lib-699cd1ced66dc1ae4b72afc45352c486b9a6a7b1.tar.bz2
- Patch from Jeff Smith (remove warnings)
- Last ppc asm code from Guillaume Borios (not used yet) - Add callbacks to config entries. Each change takes effect immediately (including resolution and fps) ;) CVS patchset: 4026 CVS date: 2003/01/28 21:57:30
-rw-r--r--src/post/goom/filters.c5
-rw-r--r--src/post/goom/goom_core.c11
-rw-r--r--src/post/goom/goom_tools.h2
-rw-r--r--src/post/goom/ifs.c4
-rw-r--r--src/post/goom/lines.c8
-rw-r--r--src/post/goom/ppc_zoom_ultimate.s236
-rw-r--r--src/post/goom/xine_goom.c155
-rw-r--r--src/post/goom/zoom_filter_mmx.c1
8 files changed, 281 insertions, 141 deletions
diff --git a/src/post/goom/filters.c b/src/post/goom/filters.c
index c54681740..e2aad6466 100644
--- a/src/post/goom/filters.c
+++ b/src/post/goom/filters.c
@@ -395,7 +395,6 @@ c_zoom ()
{
int myPos, myPos2;
Color couleur;
- unsigned int coefv, coefh;
unsigned int ax = (prevX - 1) << PERTEDEC, ay = (prevY - 1) << PERTEDEC;
@@ -466,7 +465,6 @@ zoomFilterFastRGB (Uint * pix1,
Uint resx, Uint resy, int switchIncr, float switchMult)
{
register Uint x, y;
- unsigned int *temp = brutD;
static char reverse = 0; /* vitesse inversé..(zoom out) */
static unsigned char pertedec = 8;
@@ -617,9 +615,6 @@ zoomFilterFastRGB (Uint * pix1,
/* generation du buffer de trans */
{
- int yprevx = 0;
- unsigned int ax = (prevX - 1) << PERTEDEC, ay = (prevY - 1) << PERTEDEC;
-
/* sauvegarde de l'etat actuel dans la nouvelle source */
y = prevX * prevY * 2;
for (x = 0; x < y; x += 2) {
diff --git a/src/post/goom/goom_core.c b/src/post/goom/goom_core.c
index 9e1fd33ce..65ab270c2 100644
--- a/src/post/goom/goom_core.c
+++ b/src/post/goom/goom_core.c
@@ -1,3 +1,4 @@
+#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "goom_core.h"
@@ -8,10 +9,6 @@
/*#define VERBOSE */
-#ifdef VERBOSE
-#include <stdio.h>
-#endif
-
#define STOP_SPEED 128
#define TIME_BTW_CHG 300
@@ -159,8 +156,6 @@ goom_update (gint16 data[2][512],
static float switchMult = 1.0f;
static int switchIncr = SWITCHINCR;
- static int lastgoom = 0;
-
static char goomlimit = 2; /* sensibilité du goom */
static ZoomFilterData zfd = {
127, 8, 16,
@@ -831,7 +826,7 @@ goom_draw_text (guint32 * buf,
return ;
if (center) {
- unsigned char *tmp = str;
+ unsigned const char *tmp = str;
float lg = -charspace;
while (*tmp != '\0')
@@ -963,4 +958,4 @@ void goom_setAsmUse (int useIt)
int goom_getAsmUse ()
{
return use_asm;
-} \ No newline at end of file
+}
diff --git a/src/post/goom/goom_tools.h b/src/post/goom/goom_tools.h
index 9ed16d6fc..2bd74b95b 100644
--- a/src/post/goom/goom_tools.h
+++ b/src/post/goom/goom_tools.h
@@ -16,7 +16,7 @@ extern unsigned short rand_pos;
rand_tab [rand_pos++] = rand () ;
#define RAND()\
- (rand_tab[rand_pos = rand_pos + 1])
+ (rand_tab[rand_pos = (rand_pos + 1) % NB_RAND])
#define RAND_CLOSE()\
free (rand_tab);\
diff --git a/src/post/goom/ifs.c b/src/post/goom/ifs.c
index c7e843d09..40037b6b7 100644
--- a/src/post/goom/ifs.c
+++ b/src/post/goom/ifs.c
@@ -467,10 +467,10 @@ draw_ifs ( /* ModeInfo * mi */ int *nbpt)
FRACTAL *F;
if (Root == NULL)
- return;
+ return NULL;
F = Root; /* [ */ /*MI_SCREEN(mi)*/ /* 0]; */
if (F->Buffer1 == NULL)
- return;
+ return NULL;
u = (DBL) (F->Count) * (DBL) (F->Speed) / 1000.0;
uu = u * u;
diff --git a/src/post/goom/lines.c b/src/post/goom/lines.c
index 28c25d57e..7cda48ef4 100644
--- a/src/post/goom/lines.c
+++ b/src/post/goom/lines.c
@@ -22,7 +22,7 @@ static void
draw_line (int *data, int x1, int y1, int x2, int y2, int col, int screenx,
int screeny)
{
- int x, y, dx, dy, yy, xx, am, tmp;
+ int x, y, dx, dy, yy, xx;
int *p;
/* DATA32 *p; */
@@ -260,8 +260,6 @@ void
goom_lines_set_res (GMLine * gml, int rx, int ry)
{
if (gml != NULL) {
- int i;
-
gml->screenX = rx;
gml->screenY = ry;
@@ -355,10 +353,6 @@ goom_lines_init (int rx, int ry,
int IDsrc, float paramS, int coulS,
int IDdest, float paramD, int coulD)
{
- int i;
- unsigned char *color;
- unsigned char power = 4;
-
GMLine *l = (GMLine *) malloc (sizeof (GMLine));
l->points = (GMUnitPointer *) malloc (512 * sizeof (GMUnitPointer));
diff --git a/src/post/goom/ppc_zoom_ultimate.s b/src/post/goom/ppc_zoom_ultimate.s
index 171f9674a..f52d2a831 100644
--- a/src/post/goom/ppc_zoom_ultimate.s
+++ b/src/post/goom/ppc_zoom_ultimate.s
@@ -1,11 +1,10 @@
-.data
.text
-.section regular,__DATA
+;.section text,__TEXT
.globl _ppc_zoom ;// name of the function to call by C program
; notes :
; this routine dynamically computes and applies a zoom filter
-; do not use r0, r1, r2 and r13
+; do not use r0, r1, r2 and r3
; registers are not saved so the call to this function must be the last thing done in the calling C function
; parameters :
@@ -16,6 +15,7 @@
; r7 <=> unsigned int * brutS
; r8 <=> unsigned int * brutD
; r9 <=> unsigned int buffratio
+; r10 <=> int [16][16] precalccoeffs
; globals after init
; r3 <=> frompixmap - 1 byte needed for preincremental fetch (replaces r3)
@@ -27,33 +27,65 @@
; r30 <=> brutS - 1 byte needed for preincremental fetch (replaces r7)
; r31 <=> brutD - 1 byte needed for preincremental fetch (replaces r8)
+; free reg
+; r13
+; r18
+
+
+_ppc_zoom: ; symbole global sur lequel on va linker
+
+; avant tout, on va sauver les registres
+stw r13,-76(r1)
+stw r14,-72(r1)
+stw r15,-68(r1)
+stw r16,-64(r1)
+stw r17,-60(r1)
+stw r18,-56(r1)
+stw r19,-52(r1)
+stw r20,-48(r1)
+stw r21,-44(r1)
+stw r22,-40(r1)
+stw r23,-36(r1)
+stw r24,-32(r1)
+stw r25,-28(r1)
+stw r26,-24(r1)
+stw r27,-20(r1)
+stw r28,-16(r1)
+stw r29,-12(r1)
+stw r30,-8(r1)
+stw r31,-4(r1)
-_ppc_zoom:
-
; init
-li r16,0xFF
-mullw r17,r5,r6 ; number of pixels to compute
+dcbt 0,r8
+li r14,0 ; valeur par defaut si out of range : 0 (Noir)
+mr r11,r10
+lis r16,0xFF
+mullw r17,r5,r6 ; calcul du nombre de pixels a faire
+dcbt 0,r7
subi r30,r8,4
mulli r15,r5,4
-slwi r16,r16,16
+srawi r19,r15,2
+ori r16,r16,0xFF
subi r5,r5,1
subi r6,r6,1
-mtspr ctr,r17 ; number of pixels to compute
+mtspr ctr,r17 ; on met le nombre de pixels a faire dans le compteur de la boucle
subi r31,r7,4
subi r4,r4,4
-ori r16,r16,0xFF
mulli r5,r5,16
mulli r6,r6,16
+li r13,32
-
-boucle:
-
-; computes dynamically the position to fetch
-lwzu r8,4(r30) ; px2
+;pre init for loop
lwzu r17,4(r31) ; px
+lwzu r8,4(r30) ; px2
lwzu r10,4(r30) ; py2
+
+1:
+
lwzu r29,4(r31) ; py
+
+; computes dynamically the position to fetch
sub r8,r8,r17
sub r10,r10,r29
mullw r8,r8,r9
@@ -64,86 +96,118 @@ add r17,r17,r8
add r29,r29,r10
-; if px>ax or py>ay or px<0 or py <0 goto outofrange
-cmpw cr1,r17,r5
-bgt- cr1,outofrange
-cmpwi cr1,r17,0
-blt- cr1,outofrange
-cmpw cr1,r29,r6
-bgt- cr1,outofrange
-cmpwi cr1,r29,0
-blt- cr1,outofrange
+; if px>ax or py>ay goto outofrange
+cmpl cr1,0,r17,r5
-; computes the attenuation coeffs
-andi. r8,r17,0x0F ;coefh
+; computes the attenuation coeffs and the original point address
andi. r10,r29,0x0F ;coefv
-subfic r18,r8,15 ;diffcoefh
-subfic r7,r10,15 ;diffcoefv
-mullw r21,r18,r7 ; coeff
-mullw r22,r8,r7 ; coeff << 8
-mullw r23,r18,r10 ; coeff << 16
-mullw r24,r8,r10 ; coeff << 24
-
+cmpl cr2,0,r29,r6
+andi. r8,r17,0x0F ;coefh
+srawi r29,r29,4 ; pos computing
+bgt- cr1,Loutofrange
+srawi r17,r17,4 ; pos computing
+mulli r10,r10,4
+bgt- cr2,Loutofrange
+mullw r29, r29,r19 ; pos computing
+
+; NOTA : notation des couches : 00112233 (AARRVVBB)
+
+mulli r8,r8,4*16
+add r17,r17,r29 ; pos computing
+add r10,r10,r8
+slwi r17,r17,2 ; pos computing
+add r10,r10,r11
+dcbt 0,r10
+add r17,r17,r3 ; pos computing
+lwz r10,0(r10) ; chargement des coefs
+dcbt 0,r17
+andi. r21,r10,0xFF ; isolation du coef1
+srwi r10,r10,8 ; isolation du coeff2 etape 1/2
+lwz r25,0(r17) ; chargement de col1 ->r25
+andi. r22,r10,0xFF ; isolation du coef2 etape 2/2
+srwi r10,r10,8 ; isolation du coef3 etape 1/2
+and r8, r25,r16 ; masquage de col1 couches 1 & 3 : 0x00XX00XX
+lwz r26,4(r17) ; chargement de col2 ->r26
+andi. r23,r10,0xFF ; isolation du coef3 etape 2/2
+mullw r8, r8, r21 ; application du coef1 sur col1 couches 1 & 3
+srwi r10,r10,8 ; isolation du coef4 etape 1/2
+andi. r25,r25,0xFF00 ; masquage de col1 couche 2 : 0x0000XX00
+add r17,r17,r15 ; ajout d'une ligne pour chargement futur de col3
+dcbt 0,r17
+andi. r24,r10,0xFF ; isolation du coef4 etape 2/2
-; calcul de l adresse du point d origine
-srawi r17,r17,4 ; pertedec
-srawi r29,r29,4 ; pertedec
-srwi r7,r15,2
-mullw r29, r29,r7
-add r17,r17,r29
-slwi r17,r17,2
-add r17,r17,r3
; computes final pixel color
-lwz r25,0(r17) ; chargement de col1 ->r25
-and r8, r25,r16
-lwz r26,4(r17) ; chargement de col2 ->r26
-mullw r8, r8, r21
-andi. r18, r25,0xFF00
-add r17,r17,r15
-and r10, r26,r16
-mullw r18, r18, r21
+and r10,r26,r16 ; masquage de col2 couches 1 & 3 : 0x00XX00XX
lwz r27,0(r17) ; chargement de col3 ->r27
-mullw r10, r10, r22
-andi. r29, r26, 0xFF00
+mullw r25,r25,r21 ; application du coef1 sur col1 couche 2
+mullw r10,r10,r22 ; application du coef2 sur col2 couches 1 & 3
+andi. r29,r26,0xFF00 ; masquage de col2 couche 2 : 0x0000XX00
lwz r28,4(r17) ; chargement de col4 ->r28
-add r8, r8,r10
-mullw r29, r29, r22
-and r10, r27,r16
-add r18, r18, r29
-mullw r10, r10, r23
-andi. r29, r27, 0xFF00
-add r8, r8,r10
-mullw r29, r29, r23
-and r10, r28,r16
-add r18, r18, r29
-mullw r10, r10, r24
-andi. r29, r28, 0xFF00
-add r8, r8,r10
-mullw r29, r29, r24
-
-srawi r7,r8,8
-add r18, r18, r29
-and r7, r7,r16
-
-srawi r18, r18, 8
-andi. r18,r18,0xFF00
-or r7, r18, r7
-
-b end ;goto end
-
-
-; if out of range
-outofrange:
-li r7,0
-
-end:
-stwu r7, 4(r4)
-
+add r8 ,r8 ,r10 ; ajout de col1 & col2 couches 1 & 3
+mullw r29,r29,r22 ; application du coef2 sur col2 couche 2
+and r10,r27,r16 ; masquage de col3 couches 1 & 3 : 0x00XX00XX
+add r25,r25,r29 ; ajout de col1 & col2 couche 2
+mullw r10,r10,r23 ; application du coef3 sur col3 couches 1 & 3
+andi. r29,r27,0xFF00 ; masquage de col3 couche 2 : 0x0000XX00
+add r8 ,r8 ,r10 ; ajout de col3 à (col1 + col2) couches 1 & 3
+mullw r29,r29,r23 ; application du coef3 sur col3 couche 2
+and r10,r28,r16 ; masquage de col4 couches 1 & 3 : 0x00XX00XX
+add r25,r25,r29 ; ajout de col 3 à (col1 + col2) couche 2
+mullw r10,r10,r24 ; application du coef4 sur col4 couches 1 & 3
+andi. r28,r28,0xFF00 ; masquage de col4 couche 2 : 0x0000XX00
+add r8 ,r8 ,r10 ; ajout de col4 à (col1 + col2 + col3) couches 1 & 3
+lwzu r17,4(r31) ; px
+dcbt 0,r31
+mullw r28,r28,r24 ; application du coef4 sur col4 couche 2
+
+srawi r7, r8, 8 ; (somme des couches 1 & 3) >> 8
+add r25,r25,r28 ; ajout de col 4 à (col1 + col2 + col3) couche 2
+lwzu r8,4(r30) ; px2
+and r7, r7, r16 ; masquage de la valeur résiduelle dans le résultat des couches 1 & 3
-bdnz+ boucle
+srawi r25, r25, 8 ; (somme des couches 2) >> 8
+lwzu r10,4(r30) ; py2
+andi. r25,r25,0xFF00 ; masquage de la valeur résiduelle dans le résultat des couches 2
+or r7, r25, r7 ; association des couches (1 & 3) et 2
+stwu r7,4(r4) ; stockage du résultat final
+bdnz+ 1boucle ; itération suivante si besoin
+b Lend;goto end ; sinon sortie de boucle pour fin
-blr
+; if out of range
+Loutofrange:
+stwu r14,4(r4)
+dcbtst r13,r4 ;touch for store
+lwzu r8,4(r30) ; px2
+lwzu r10,4(r30) ; py2
+lwzu r17,4(r31) ; px
+bdnz+ 1boucle
+
+
+Lend: ; Fin de la routine, on restore les registres utilisés entre 13 et 31
+
+lwz r14,-76(r1)
+lwz r14,-72(r1)
+lwz r15,-68(r1)
+lwz r16,-64(r1)
+lwz r17,-60(r1)
+lwz r18,-56(r1)
+lwz r19,-52(r1)
+lwz r20,-48(r1)
+lwz r21,-44(r1)
+lwz r22,-40(r1)
+lwz r23,-36(r1)
+lwz r24,-32(r1)
+lwz r25,-28(r1)
+lwz r26,-24(r1)
+lwz r27,-20(r1)
+lwz r28,-16(r1)
+lwz r29,-12(r1)
+lwz r30,-8(r1)
+lwz r31,-4(r1)
+
+
+blr ; et on retourne \ No newline at end of file
diff --git a/src/post/goom/xine_goom.c b/src/post/goom/xine_goom.c
index b2b86da86..0e6921d0e 100644
--- a/src/post/goom/xine_goom.c
+++ b/src/post/goom/xine_goom.c
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: xine_goom.c,v 1.22 2003/01/25 11:44:19 tmattern Exp $
+ * $Id: xine_goom.c,v 1.23 2003/01/28 21:57:41 tmattern Exp $
*
* GOOM post plugin.
*
@@ -36,6 +36,9 @@
#include "goom_config.h"
#include "goom_core.h"
+/*
+#define LOG
+*/
#define NUMSAMPLES 512
#define FPS 10
@@ -56,10 +59,8 @@ typedef struct post_class_goom_s post_class_goom_t;
struct post_class_goom_s {
post_class_t class;
- int width, height;
- int fps;
- int use_asm;
- int csc_method;
+ post_plugin_goom_t *ip;
+ xine_t *xine;
};
struct post_plugin_goom_s {
@@ -81,6 +82,11 @@ struct post_plugin_goom_s {
int sample_rate;
int sample_counter;
int samples_per_frame;
+ int width, height;
+ int width_back, height_back;
+ int fps;
+ int use_asm;
+ int csc_method;
yuv_planes_t yuv;
};
@@ -129,6 +135,53 @@ static void goom_port_close(xine_audio_port_t *this, xine_stream_t *stream );
static void goom_port_put_buffer (xine_audio_port_t *this, audio_buffer_t *buf, xine_stream_t *stream);
+static void fps_changed_cb(void *data, xine_cfg_entry_t *cfg) {
+ post_class_goom_t *class = (post_class_goom_t*) data;
+
+ if(class->ip) {
+ post_plugin_goom_t *this = class->ip;
+ this->fps = cfg->num_value;
+ this->samples_per_frame = this->sample_rate / this->fps;
+ }
+}
+
+static void width_changed_cb(void *data, xine_cfg_entry_t *cfg) {
+ post_class_goom_t *class = (post_class_goom_t*) data;
+
+ if(class->ip) {
+ post_plugin_goom_t *this = class->ip;
+ this->width = cfg->num_value;
+ }
+}
+
+static void height_changed_cb(void *data, xine_cfg_entry_t *cfg) {
+ post_class_goom_t *class = (post_class_goom_t*) data;
+
+ if(class->ip) {
+ post_plugin_goom_t *this = class->ip;
+ this->height = cfg->num_value;
+ }
+}
+
+static void use_asm_changed_cb(void *data, xine_cfg_entry_t *cfg) {
+ post_class_goom_t *class = (post_class_goom_t*) data;
+
+ if(class->ip) {
+ post_plugin_goom_t *this = class->ip;
+ this->use_asm = cfg->num_value;
+ goom_setAsmUse(this->use_asm);
+ }
+}
+
+static void csc_method_changed_cb(void *data, xine_cfg_entry_t *cfg) {
+ post_class_goom_t *class = (post_class_goom_t*) data;
+
+ if(class->ip) {
+ post_plugin_goom_t *this = class->ip;
+ this->csc_method = cfg->num_value;
+ }
+}
+
static void *goom_init_plugin(xine_t *xine, void *data)
{
post_class_goom_t *this = (post_class_goom_t *)malloc(sizeof(post_class_goom_t));
@@ -141,41 +194,42 @@ static void *goom_init_plugin(xine_t *xine, void *data)
this->class.get_identifier = goom_get_identifier;
this->class.get_description = goom_get_description;
this->class.dispose = goom_class_dispose;
+ this->ip = NULL;
+ this->xine = xine;
cfg = xine->config;
- this->fps = cfg->register_num (cfg, "post.goom_fps", FPS,
+ cfg->register_num (cfg, "post.goom_fps", FPS,
_("Frames per second to generate with Goom"),
- NULL, 10, NULL, NULL);
+ NULL, 10, fps_changed_cb, this);
- this->width = cfg->register_num (cfg, "post.goom_width", GOOM_WIDTH,
+ cfg->register_num (cfg, "post.goom_width", GOOM_WIDTH,
_("Goom image width in pixels"),
- NULL, 20, NULL, NULL);
+ NULL, 20, width_changed_cb, this);
- this->height = cfg->register_num (cfg, "post.goom_height", GOOM_HEIGHT,
+ cfg->register_num (cfg, "post.goom_height", GOOM_HEIGHT,
_("Goom image height in pixels"),
- NULL, 20, NULL, NULL);
+ NULL, 20, height_changed_cb, this);
- this->use_asm = 0;
#ifdef ARCH_X86
if (xine_mm_accel() & MM_ACCEL_X86_MMX) {
- this->use_asm = cfg->register_bool (cfg, "post.goom_use_asm", 1,
- _("Use Goom asm optimizations"),
- NULL, 10, NULL, NULL);
+ cfg->register_bool (cfg, "post.goom_use_asm", 1,
+ _("Use Goom asm optimizations"),
+ NULL, 10, use_asm_changed_cb, this);
}
#endif
#ifdef ARCH_PPC
- this->use_asm = cfg->register_bool (cfg, "post.goom_use_asm", 1,
- _("Use Goom asm optimizations"),
- NULL, 10, NULL, NULL);
+ cfg->register_bool (cfg, "post.goom_use_asm", 1,
+ _("Use Goom asm optimizations"),
+ NULL, 10, use_asm_changed_cb, this);
#endif
- this->csc_method = cfg->register_enum (cfg, "post.goom_csc_method", 0,
- (char **)goom_csc_methods,
- _("Colorspace conversion method used by Goom"),
- NULL, 20, NULL, NULL);
+ cfg->register_enum (cfg, "post.goom_csc_method", 0,
+ (char **)goom_csc_methods,
+ _("Colorspace conversion method used by Goom"),
+ NULL, 20, csc_method_changed_cb, this);
return &this->class;
}
@@ -186,10 +240,12 @@ static post_plugin_t *goom_open_plugin(post_class_t *class_gen, int inputs,
xine_video_port_t **video_target)
{
post_plugin_goom_t *this = (post_plugin_goom_t *)malloc(sizeof(post_plugin_goom_t));
+ post_class_goom_t *class = (post_class_goom_t*) class_gen;
xine_post_in_t *input = (xine_post_in_t *)malloc(sizeof(xine_post_in_t));
post_goom_out_t *output = (post_goom_out_t *)malloc(sizeof(post_goom_out_t));
post_goom_out_t *outputv = (post_goom_out_t *)malloc(sizeof(post_goom_out_t));
post_audio_port_t *port;
+ xine_cfg_entry_t fps_entry, width_entry, height_entry, use_asm_entry, csc_method_entry;
if (!this || !input || !output || !outputv || !video_target || !video_target[0] ||
!audio_target || !audio_target[0] ) {
@@ -200,10 +256,36 @@ static post_plugin_t *goom_open_plugin(post_class_t *class_gen, int inputs,
return NULL;
}
- this->class = (post_class_goom_t *) class_gen;
+ /*
+ * Lookup config entries.
+ */
+ class->ip = this;
+ printf("goom: goom_open_plugin\n");
+
+ if(xine_config_lookup_entry(class->xine, "post.goom_fps",
+ &fps_entry))
+ fps_changed_cb(class, &fps_entry);
+
+ if(xine_config_lookup_entry(class->xine, "post.goom_width",
+ &width_entry))
+ width_changed_cb(class, &width_entry);
+
+ if(xine_config_lookup_entry(class->xine, "post.goom_height",
+ &height_entry))
+ height_changed_cb(class, &height_entry);
+
+ if(xine_config_lookup_entry(class->xine, "post.goom_use_asm",
+ &use_asm_entry))
+ use_asm_changed_cb(class, &use_asm_entry);
+
+ if(xine_config_lookup_entry(class->xine, "post.goom_csc_method",
+ &csc_method_entry))
+ csc_method_changed_cb(class, &csc_method_entry);
+
+ this->width_back = this->width;
+ this->height_back = this->height;
+ goom_init (this->width_back, this->height_back, 0);
- goom_init (this->class->width, this->class->height, 0);
- goom_setAsmUse(this->class->use_asm);
this->sample_counter = 0;
this->stream = NULL;
this->vo_port = video_target[0];
@@ -351,11 +433,11 @@ static int goom_port_open(xine_audio_port_t *port_gen, xine_stream_t *stream,
this->bits = bits;
this->mode = mode;
this->channels = mode_channels(mode);
- this->samples_per_frame = rate / this->class->fps;
+ this->samples_per_frame = rate / this->fps;
this->sample_rate = rate;
this->stream = stream;
this->data_idx = 0;
- init_yuv_planes(&this->yuv, this->class->width, this->class->height);
+ init_yuv_planes(&this->yuv, this->width, this->height);
return port->original_port->open(port->original_port, stream, bits, rate, mode );
}
@@ -386,6 +468,7 @@ static void goom_port_put_buffer (xine_audio_port_t *port_gen,
uint64_t vpts = buf->vpts;
int i, j;
uint8_t *dest_ptr;
+ int width, height;
/* make a copy of buf data for private use */
if( this->buf.mem_size < buf->mem_size ) {
@@ -436,10 +519,10 @@ static void goom_port_put_buffer (xine_audio_port_t *port_gen,
this->data_idx = 0;
samples_used += this->samples_per_frame;
-
+
goom_frame = (uint8_t *)goom_update (this->data, 0, 0, NULL, NULL);
- frame = this->vo_port->get_frame (this->vo_port, this->class->width, this->class->height,
+ frame = this->vo_port->get_frame (this->vo_port, this->width_back, this->height_back,
XINE_VO_ASPECT_SQUARE, XINE_IMGFMT_YUY2,
VO_BOTH_FIELDS);
@@ -450,9 +533,9 @@ static void goom_port_put_buffer (xine_audio_port_t *port_gen,
/* Try to be fast */
dest_ptr = frame -> base[0];
- goom_frame_end = goom_frame + 4 * (this->class->width * this->class->height);
+ goom_frame_end = goom_frame + 4 * (this->width_back * this->height_back);
- if ((this->class->csc_method == 1) &&
+ if ((this->csc_method == 1) &&
(xine_mm_accel() & MM_ACCEL_X86_MMX)) {
int plane_ptr = 0;
@@ -508,6 +591,16 @@ static void goom_port_put_buffer (xine_audio_port_t *port_gen,
frame->draw(frame, stream);
frame->free(frame);
+
+ width = this->width;
+ height = this->height;
+ if ((width != this->width_back) || (height != this->height_back)) {
+ goom_close();
+ goom_init (this->width, this->height, 0);
+ this->width_back = width;
+ this->height_back = height;
+ }
+
}
} while( this->sample_counter >= this->samples_per_frame );
}
diff --git a/src/post/goom/zoom_filter_mmx.c b/src/post/goom/zoom_filter_mmx.c
index a7a5ffd8f..eb364ac86 100644
--- a/src/post/goom/zoom_filter_mmx.c
+++ b/src/post/goom/zoom_filter_mmx.c
@@ -26,7 +26,6 @@ void zoom_filter_mmx (int prevX, int prevY,
for (loop=0; loop<bufsize; loop++)
{
- int couleur;
int px,py;
int pos;
int coeffs;