summaryrefslogtreecommitdiff
path: root/src/post/planar
diff options
context:
space:
mode:
Diffstat (limited to 'src/post/planar')
-rw-r--r--src/post/planar/boxblur.c62
-rw-r--r--src/post/planar/denoise3d.c50
-rw-r--r--src/post/planar/eq.c42
-rw-r--r--src/post/planar/eq2.c54
-rw-r--r--src/post/planar/expand.c78
-rw-r--r--src/post/planar/fill.c44
-rw-r--r--src/post/planar/invert.c36
-rw-r--r--src/post/planar/noise.c62
-rw-r--r--src/post/planar/planar.c10
-rw-r--r--src/post/planar/pp.c54
-rw-r--r--src/post/planar/unsharp.c58
11 files changed, 275 insertions, 275 deletions
diff --git a/src/post/planar/boxblur.c b/src/post/planar/boxblur.c
index 517cec489..ceeba3b40 100644
--- a/src/post/planar/boxblur.c
+++ b/src/post/planar/boxblur.c
@@ -1,18 +1,18 @@
/*
* Copyright (C) 2000-2004 the xine project
- *
+ *
* This file is part of xine, a free video player.
- *
+ *
* xine is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
- *
+ *
* xine is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
@@ -36,7 +36,7 @@ void *boxblur_init_plugin(xine_t *xine, void *);
typedef struct post_plugin_boxblur_s post_plugin_boxblur_t;
/*
- * this is the struct used by "parameters api"
+ * this is the struct used by "parameters api"
*/
typedef struct boxblur_parameters_s {
@@ -51,13 +51,13 @@ typedef struct boxblur_parameters_s {
* description of params struct
*/
START_PARAM_DESCR( boxblur_parameters_t )
-PARAM_ITEM( POST_PARAM_TYPE_INT, luma_radius, NULL, 0, 10, 0,
+PARAM_ITEM( POST_PARAM_TYPE_INT, luma_radius, NULL, 0, 10, 0,
"radius of luma blur" )
-PARAM_ITEM( POST_PARAM_TYPE_INT, luma_power, NULL, 0, 10, 0,
+PARAM_ITEM( POST_PARAM_TYPE_INT, luma_power, NULL, 0, 10, 0,
"power of luma blur" )
-PARAM_ITEM( POST_PARAM_TYPE_INT, chroma_radius, NULL, -1, 10, 0,
+PARAM_ITEM( POST_PARAM_TYPE_INT, chroma_radius, NULL, -1, 10, 0,
"radius of chroma blur (-1 = same as luma)" )
-PARAM_ITEM( POST_PARAM_TYPE_INT, chroma_power, NULL, -1, 10, 0,
+PARAM_ITEM( POST_PARAM_TYPE_INT, chroma_power, NULL, -1, 10, 0,
"power of chroma blur (-1 = same as luma)" )
END_PARAM_DESCR( param_descr )
@@ -96,7 +96,7 @@ static int get_parameters (xine_post_t *this_gen, void *param_gen) {
return 1;
}
-
+
static xine_post_api_descr_t * get_param_descr (void) {
return &param_descr;
}
@@ -144,7 +144,7 @@ void *boxblur_init_plugin(xine_t *xine, void *data)
if (!class)
return NULL;
-
+
class->open_plugin = boxblur_open_plugin;
class->get_identifier = boxblur_get_identifier;
class->get_description = boxblur_get_description;
@@ -163,14 +163,14 @@ static post_plugin_t *boxblur_open_plugin(post_class_t *class_gen, int inputs,
xine_post_in_t *input_api;
post_out_t *output;
post_video_port_t *port;
-
+
if (!this || !video_target || !video_target[0]) {
free(this);
return NULL;
}
-
+
_x_post_init(&this->post, 0, 1);
-
+
this->params.luma_radius = 2;
this->params.luma_power = 1;
this->params.chroma_radius = -1;
@@ -181,7 +181,7 @@ static post_plugin_t *boxblur_open_plugin(post_class_t *class_gen, int inputs,
port = _x_post_intercept_video_port(&this->post, video_target[0], &input, &output);
port->intercept_frame = boxblur_intercept_frame;
port->new_frame->draw = boxblur_draw;
-
+
input_api = &this->params_input;
input_api->name = "parameters";
input_api->type = XINE_POST_DATA_PARAMETERS;
@@ -190,11 +190,11 @@ static post_plugin_t *boxblur_open_plugin(post_class_t *class_gen, int inputs,
input->xine_in.name = "video";
output->xine_out.name = "boxblured video";
-
+
this->post.xine_post.video_input[0] = &port->new_port;
-
+
this->post.dispose = boxblur_dispose;
-
+
return &this->post;
}
@@ -217,7 +217,7 @@ static void boxblur_class_dispose(post_class_t *class_gen)
static void boxblur_dispose(post_plugin_t *this_gen)
{
post_plugin_boxblur_t *this = (post_plugin_boxblur_t *)this_gen;
-
+
if (_x_post_dispose(this_gen)) {
pthread_mutex_destroy(&this->lock);
free(this);
@@ -262,7 +262,7 @@ static inline void blur(uint8_t *dst, uint8_t *src, int w, int radius, int dstSt
static inline void blur2(uint8_t *dst, uint8_t *src, int w, int radius, int power, int dstStep, int srcStep){
uint8_t temp[2][4096];
uint8_t *a= temp[0], *b=temp[1];
-
+
if(radius){
blur(a, src, w, radius, 1, srcStep);
for(; power>2; power--){
@@ -286,9 +286,9 @@ static inline void blur2(uint8_t *dst, uint8_t *src, int w, int radius, int powe
static void hBlur(uint8_t *dst, uint8_t *src, int w, int h, int dstStride, int srcStride, int radius, int power){
int y;
-
+
if(radius==0 && dst==src) return;
-
+
for(y=0; y<h; y++){
blur2(dst + y*dstStride, src + y*srcStride, w, radius, power, 1, 1);
}
@@ -296,7 +296,7 @@ static void hBlur(uint8_t *dst, uint8_t *src, int w, int h, int dstStride, int s
static void vBlur(uint8_t *dst, uint8_t *src, int w, int h, int dstStride, int srcStride, int radius, int power){
int x;
-
+
if(radius==0 && dst==src) return;
for(x=0; x<w; x++){
@@ -345,25 +345,25 @@ static int boxblur_draw(vo_frame_t *frame, xine_stream_t *stream)
pthread_mutex_lock (&this->lock);
- chroma_radius = (this->params.chroma_radius != -1) ? this->params.chroma_radius :
+ chroma_radius = (this->params.chroma_radius != -1) ? this->params.chroma_radius :
this->params.luma_radius;
- chroma_power = (this->params.chroma_power != -1) ? this->params.chroma_power :
+ chroma_power = (this->params.chroma_power != -1) ? this->params.chroma_power :
this->params.luma_power;
cw = yv12_frame->width/2;
ch = yv12_frame->height/2;
- hBlur(out_frame->base[0], yv12_frame->base[0], yv12_frame->width, yv12_frame->height,
+ hBlur(out_frame->base[0], yv12_frame->base[0], yv12_frame->width, yv12_frame->height,
out_frame->pitches[0], yv12_frame->pitches[0], this->params.luma_radius, this->params.luma_power);
- hBlur(out_frame->base[1], yv12_frame->base[1], cw,ch,
+ hBlur(out_frame->base[1], yv12_frame->base[1], cw,ch,
out_frame->pitches[1], yv12_frame->pitches[1], chroma_radius, chroma_power);
- hBlur(out_frame->base[2], yv12_frame->base[2], cw,ch,
+ hBlur(out_frame->base[2], yv12_frame->base[2], cw,ch,
out_frame->pitches[2], yv12_frame->pitches[2], chroma_radius, chroma_power);
- vBlur(out_frame->base[0], out_frame->base[0], yv12_frame->width, yv12_frame->height,
+ vBlur(out_frame->base[0], out_frame->base[0], yv12_frame->width, yv12_frame->height,
out_frame->pitches[0], out_frame->pitches[0], this->params.luma_radius, this->params.luma_power);
- vBlur(out_frame->base[1], out_frame->base[1], cw,ch,
+ vBlur(out_frame->base[1], out_frame->base[1], cw,ch,
out_frame->pitches[1], out_frame->pitches[1], chroma_radius, chroma_power);
- vBlur(out_frame->base[2], out_frame->base[2], cw,ch,
+ vBlur(out_frame->base[2], out_frame->base[2], cw,ch,
out_frame->pitches[2], out_frame->pitches[2], chroma_radius, chroma_power);
pthread_mutex_unlock (&this->lock);
diff --git a/src/post/planar/denoise3d.c b/src/post/planar/denoise3d.c
index 21b58dbf9..2073151b4 100644
--- a/src/post/planar/denoise3d.c
+++ b/src/post/planar/denoise3d.c
@@ -1,18 +1,18 @@
/*
* Copyright (C) 2000-2004 the xine project
- *
+ *
* This file is part of xine, a free video player.
- *
+ *
* xine is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
- *
+ *
* xine is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
@@ -44,7 +44,7 @@ typedef struct post_plugin_denoise3d_s post_plugin_denoise3d_t;
/*
- * this is the struct used by "parameters api"
+ * this is the struct used by "parameters api"
*/
typedef struct denoise3d_parameters_s {
@@ -58,11 +58,11 @@ typedef struct denoise3d_parameters_s {
* description of params struct
*/
START_PARAM_DESCR( denoise3d_parameters_t )
-PARAM_ITEM( POST_PARAM_TYPE_DOUBLE, luma, NULL, 0, 10, 0,
+PARAM_ITEM( POST_PARAM_TYPE_DOUBLE, luma, NULL, 0, 10, 0,
"spatial luma strength" )
-PARAM_ITEM( POST_PARAM_TYPE_DOUBLE, chroma, NULL, 0, 10, 0,
+PARAM_ITEM( POST_PARAM_TYPE_DOUBLE, chroma, NULL, 0, 10, 0,
"spatial chroma strength" )
-PARAM_ITEM( POST_PARAM_TYPE_DOUBLE, time, NULL, 0, 10, 0,
+PARAM_ITEM( POST_PARAM_TYPE_DOUBLE, time, NULL, 0, 10, 0,
"temporal strength" )
END_PARAM_DESCR( param_descr )
@@ -129,7 +129,7 @@ static int get_parameters (xine_post_t *this_gen, void *param_gen) {
return 1;
}
-
+
static xine_post_api_descr_t * get_param_descr (void) {
return &param_descr;
}
@@ -184,7 +184,7 @@ void *denoise3d_init_plugin(xine_t *xine, void *data)
if (!class)
return NULL;
-
+
class->open_plugin = denoise3d_open_plugin;
class->get_identifier = denoise3d_get_identifier;
class->get_description = denoise3d_get_description;
@@ -203,14 +203,14 @@ static post_plugin_t *denoise3d_open_plugin(post_class_t *class_gen, int inputs,
xine_post_in_t *input_api;
post_out_t *output;
post_video_port_t *port;
-
+
if (!this || !video_target || !video_target[0]) {
free(this);
return NULL;
}
_x_post_init(&this->post, 0, 1);
-
+
this->params.luma = PARAM1_DEFAULT;
this->params.chroma = PARAM2_DEFAULT;
this->params.time = PARAM3_DEFAULT;
@@ -222,7 +222,7 @@ static post_plugin_t *denoise3d_open_plugin(post_class_t *class_gen, int inputs,
port->new_port.close = denoise3d_close;
port->intercept_frame = denoise3d_intercept_frame;
port->new_frame->draw = denoise3d_draw;
-
+
input_api = &this->params_input;
input_api->name = "parameters";
input_api->type = XINE_POST_DATA_PARAMETERS;
@@ -231,13 +231,13 @@ static post_plugin_t *denoise3d_open_plugin(post_class_t *class_gen, int inputs,
input->xine_in.name = "video";
output->xine_out.name = "denoise3d video";
-
+
this->post.xine_post.video_input[0] = &port->new_port;
-
+
this->post.dispose = denoise3d_dispose;
set_parameters ((xine_post_t *)this, &this->params);
-
+
return &this->post;
}
@@ -260,7 +260,7 @@ static void denoise3d_class_dispose(post_class_t *class_gen)
static void denoise3d_dispose(post_plugin_t *this_gen)
{
post_plugin_denoise3d_t *this = (post_plugin_denoise3d_t *)this_gen;
-
+
if (_x_post_dispose(this_gen)) {
pthread_mutex_destroy(&this->lock);
free(this);
@@ -292,10 +292,10 @@ static int denoise3d_intercept_frame(post_video_port_t *port, vo_frame_t *frame)
#define LowPass(Prev, Curr, Coef) (((Prev)*Coef[Prev - Curr] + (Curr)*(65536-(Coef[Prev - Curr]))) / 65536)
-static void deNoise(unsigned char *Frame,
- unsigned char *FramePrev,
- unsigned char *FrameDest,
- unsigned char *LineAnt,
+static void deNoise(unsigned char *Frame,
+ unsigned char *FramePrev,
+ unsigned char *FrameDest,
+ unsigned char *LineAnt,
int W, int H, int sStride, int pStride, int dStride,
int *Horizontal, int *Vertical, int *Temporal)
{
@@ -353,15 +353,15 @@ static int denoise3d_draw(vo_frame_t *frame, xine_stream_t *stream)
yv12_frame = port->original_port->get_frame(port->original_port,
frame->width, frame->height, frame->ratio, XINE_IMGFMT_YV12, frame->flags | VO_BOTH_FIELDS);
-
+
_x_post_frame_copy_down(frame, yv12_frame);
-
+
yuy2_to_yv12(frame->base[0], frame->pitches[0],
yv12_frame->base[0], yv12_frame->pitches[0],
yv12_frame->base[1], yv12_frame->pitches[1],
yv12_frame->base[2], yv12_frame->pitches[2],
frame->width, frame->height);
-
+
} else {
yv12_frame = frame;
yv12_frame->lock(yv12_frame);
@@ -401,7 +401,7 @@ static int denoise3d_draw(vo_frame_t *frame, xine_stream_t *stream)
pthread_mutex_unlock (&this->lock);
skip = out_frame->draw(out_frame, stream);
-
+
_x_post_frame_copy_up(frame, out_frame);
out_frame->free(out_frame);
diff --git a/src/post/planar/eq.c b/src/post/planar/eq.c
index 45bc43463..73607b8a1 100644
--- a/src/post/planar/eq.c
+++ b/src/post/planar/eq.c
@@ -1,18 +1,18 @@
/*
* Copyright (C) 2000-2004 the xine project
- *
+ *
* This file is part of xine, a free video player.
- *
+ *
* xine is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
- *
+ *
* xine is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
@@ -47,7 +47,7 @@ static void process_MMX(unsigned char *dest, int dstride, unsigned char *src, in
brvec[0] = brvec[1] = brvec[2] = brvec[3] = brightness;
contvec[0] = contvec[1] = contvec[2] = contvec[3] = contrast;
-
+
while (h--) {
asm volatile (
"movq (%5), %%mm3 \n\t"
@@ -125,7 +125,7 @@ void *eq_init_plugin(xine_t *xine, void *);
typedef struct post_plugin_eq_s post_plugin_eq_t;
/*
- * this is the struct used by "parameters api"
+ * this is the struct used by "parameters api"
*/
typedef struct eq_parameters_s {
@@ -138,9 +138,9 @@ typedef struct eq_parameters_s {
* description of params struct
*/
START_PARAM_DESCR( eq_parameters_t )
-PARAM_ITEM( POST_PARAM_TYPE_INT, brightness, NULL, -100, 100, 0,
+PARAM_ITEM( POST_PARAM_TYPE_INT, brightness, NULL, -100, 100, 0,
"brightness" )
-PARAM_ITEM( POST_PARAM_TYPE_INT, contrast, NULL, -100, 100, 0,
+PARAM_ITEM( POST_PARAM_TYPE_INT, contrast, NULL, -100, 100, 0,
"contrast" )
END_PARAM_DESCR( param_descr )
@@ -179,7 +179,7 @@ static int get_parameters (xine_post_t *this_gen, void *param_gen) {
return 1;
}
-
+
static xine_post_api_descr_t * get_param_descr (void) {
return &param_descr;
}
@@ -236,7 +236,7 @@ void *eq_init_plugin(xine_t *xine, void *data)
if (!class)
return NULL;
-
+
class->open_plugin = eq_open_plugin;
class->get_identifier = eq_get_identifier;
class->get_description = eq_get_description;
@@ -255,7 +255,7 @@ static post_plugin_t *eq_open_plugin(post_class_t *class_gen, int inputs,
xine_post_in_t *input_api;
post_out_t *output;
post_video_port_t *port;
-
+
if (!this || !video_target || !video_target[0]) {
free(this);
return NULL;
@@ -263,7 +263,7 @@ static post_plugin_t *eq_open_plugin(post_class_t *class_gen, int inputs,
process = process_C;
#if defined(ARCH_X86) || defined(ARCH_X86_64)
- if( xine_mm_accel() & MM_ACCEL_X86_MMX )
+ if( xine_mm_accel() & MM_ACCEL_X86_MMX )
process = process_MMX;
#endif
@@ -273,14 +273,14 @@ static post_plugin_t *eq_open_plugin(post_class_t *class_gen, int inputs,
this->params.contrast = 0;
pthread_mutex_init (&this->lock, NULL);
-
+
port = _x_post_intercept_video_port(&this->post, video_target[0], &input, &output);
port->new_port.get_property = eq_get_property;
port->new_port.set_property = eq_set_property;
port->intercept_frame = eq_intercept_frame;
port->new_frame->draw = eq_draw;
- input_api = &this->params_input;
+ input_api = &this->params_input;
input_api->name = "parameters";
input_api->type = XINE_POST_DATA_PARAMETERS;
input_api->data = &post_api;
@@ -288,11 +288,11 @@ static post_plugin_t *eq_open_plugin(post_class_t *class_gen, int inputs,
input->xine_in.name = "video";
output->xine_out.name = "eqd video";
-
+
this->post.xine_post.video_input[0] = &port->new_port;
-
+
this->post.dispose = eq_dispose;
-
+
return &this->post;
}
@@ -374,15 +374,15 @@ static int eq_draw(vo_frame_t *frame, xine_stream_t *stream)
yv12_frame = port->original_port->get_frame(port->original_port,
frame->width, frame->height, frame->ratio, XINE_IMGFMT_YV12, frame->flags | VO_BOTH_FIELDS);
-
+
_x_post_frame_copy_down(frame, yv12_frame);
-
+
yuy2_to_yv12(frame->base[0], frame->pitches[0],
yv12_frame->base[0], yv12_frame->pitches[0],
yv12_frame->base[1], yv12_frame->pitches[1],
yv12_frame->base[2], yv12_frame->pitches[2],
frame->width, frame->height);
-
+
} else {
yv12_frame = frame;
yv12_frame->lock(yv12_frame);
@@ -408,7 +408,7 @@ static int eq_draw(vo_frame_t *frame, xine_stream_t *stream)
pthread_mutex_unlock (&this->lock);
skip = out_frame->draw(out_frame, stream);
-
+
_x_post_frame_copy_up(frame, out_frame);
out_frame->free(out_frame);
diff --git a/src/post/planar/eq2.c b/src/post/planar/eq2.c
index 1a301fdab..542ea7bad 100644
--- a/src/post/planar/eq2.c
+++ b/src/post/planar/eq2.c
@@ -1,18 +1,18 @@
/*
* Copyright (C) 2000-2008 the xine project
- *
+ *
* This file is part of xine, a free video player.
- *
+ *
* xine is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
- *
+ *
* xine is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
@@ -114,7 +114,7 @@ void affine_1d_MMX (eq2_param_t *par, unsigned char *dst, unsigned char *src,
int pel;
short brvec[4];
short contvec[4];
-
+
contrast = (int) (par->c * 256 * 16);
brightness = ((int) (100.0 * par->b + 100.0) * 511) / 200 - 128 - contrast / 32;
@@ -269,7 +269,7 @@ void *eq2_init_plugin(xine_t *xine, void *);
typedef struct post_plugin_eq2_s post_plugin_eq2_t;
/*
- * this is the struct used by "parameters api"
+ * this is the struct used by "parameters api"
*/
typedef struct eq2_parameters_s {
@@ -288,19 +288,19 @@ typedef struct eq2_parameters_s {
* description of params struct
*/
START_PARAM_DESCR( eq2_parameters_t )
-PARAM_ITEM( POST_PARAM_TYPE_DOUBLE, gamma, NULL, 0, 5, 0,
+PARAM_ITEM( POST_PARAM_TYPE_DOUBLE, gamma, NULL, 0, 5, 0,
"gamma" )
-PARAM_ITEM( POST_PARAM_TYPE_DOUBLE, brightness, NULL, -1, 1, 0,
+PARAM_ITEM( POST_PARAM_TYPE_DOUBLE, brightness, NULL, -1, 1, 0,
"brightness" )
-PARAM_ITEM( POST_PARAM_TYPE_DOUBLE, contrast, NULL, 0, 2, 0,
+PARAM_ITEM( POST_PARAM_TYPE_DOUBLE, contrast, NULL, 0, 2, 0,
"contrast" )
-PARAM_ITEM( POST_PARAM_TYPE_DOUBLE, saturation, NULL, 0, 2, 0,
+PARAM_ITEM( POST_PARAM_TYPE_DOUBLE, saturation, NULL, 0, 2, 0,
"saturation" )
-PARAM_ITEM( POST_PARAM_TYPE_DOUBLE, rgamma, NULL, 0, 5, 0,
+PARAM_ITEM( POST_PARAM_TYPE_DOUBLE, rgamma, NULL, 0, 5, 0,
"rgamma" )
-PARAM_ITEM( POST_PARAM_TYPE_DOUBLE, ggamma, NULL, 0, 5, 0,
+PARAM_ITEM( POST_PARAM_TYPE_DOUBLE, ggamma, NULL, 0, 5, 0,
"ggamma" )
-PARAM_ITEM( POST_PARAM_TYPE_DOUBLE, bgamma, NULL, 0, 5, 0,
+PARAM_ITEM( POST_PARAM_TYPE_DOUBLE, bgamma, NULL, 0, 5, 0,
"bgamma" )
END_PARAM_DESCR( param_descr )
@@ -312,7 +312,7 @@ struct post_plugin_eq2_s {
/* private data */
eq2_parameters_t params;
xine_post_in_t params_input;
-
+
vf_eq2_t eq2;
pthread_mutex_t lock;
@@ -352,7 +352,7 @@ static int get_parameters (xine_post_t *this_gen, void *param_gen) {
return 1;
}
-
+
static xine_post_api_descr_t * get_param_descr (void) {
return &param_descr;
}
@@ -417,7 +417,7 @@ void *eq2_init_plugin(xine_t *xine, void *data)
if (!class)
return NULL;
-
+
class->open_plugin = eq2_open_plugin;
class->get_identifier = eq2_get_identifier;
class->get_description = eq2_get_description;
@@ -436,12 +436,12 @@ static post_plugin_t *eq2_open_plugin(post_class_t *class_gen, int inputs,
xine_post_in_t *input_api;
post_out_t *output;
post_video_port_t *port;
-
+
if (!this || !video_target || !video_target[0]) {
free(this);
return NULL;
}
-
+
_x_post_init(&this->post, 0, 1);
memset(&this->eq2, 0, sizeof(this->eq2));
@@ -455,13 +455,13 @@ static post_plugin_t *eq2_open_plugin(post_class_t *class_gen, int inputs,
this->eq2.bgamma = this->params.bgamma = 1.0;
pthread_mutex_init(&this->lock, NULL);
-
+
port = _x_post_intercept_video_port(&this->post, video_target[0], &input, &output);
port->new_port.get_property = eq2_get_property;
port->new_port.set_property = eq2_set_property;
port->intercept_frame = eq2_intercept_frame;
port->new_frame->draw = eq2_draw;
-
+
input_api = &this->params_input;
input_api->name = "parameters";
input_api->type = XINE_POST_DATA_PARAMETERS;
@@ -470,13 +470,13 @@ static post_plugin_t *eq2_open_plugin(post_class_t *class_gen, int inputs,
input->xine_in.name = "video";
output->xine_out.name = "eqd video";
-
+
this->post.xine_post.video_input[0] = &port->new_port;
-
+
this->post.dispose = eq2_dispose;
set_parameters ((xine_post_t *)this, &this->params);
-
+
return &this->post;
}
@@ -566,15 +566,15 @@ static int eq2_draw(vo_frame_t *frame, xine_stream_t *stream)
yv12_frame = port->original_port->get_frame(port->original_port,
frame->width, frame->height, frame->ratio, XINE_IMGFMT_YV12, frame->flags | VO_BOTH_FIELDS);
-
+
_x_post_frame_copy_down(frame, yv12_frame);
-
+
yuy2_to_yv12(frame->base[0], frame->pitches[0],
yv12_frame->base[0], yv12_frame->pitches[0],
yv12_frame->base[1], yv12_frame->pitches[1],
yv12_frame->base[2], yv12_frame->pitches[2],
frame->width, frame->height);
-
+
} else {
yv12_frame = frame;
yv12_frame->lock(yv12_frame);
@@ -604,7 +604,7 @@ static int eq2_draw(vo_frame_t *frame, xine_stream_t *stream)
pthread_mutex_unlock (&this->lock);
skip = out_frame->draw(out_frame, stream);
-
+
_x_post_frame_copy_up(frame, out_frame);
out_frame->free(out_frame);
diff --git a/src/post/planar/expand.c b/src/post/planar/expand.c
index 52bc2b37a..cc189118f 100644
--- a/src/post/planar/expand.c
+++ b/src/post/planar/expand.c
@@ -1,23 +1,23 @@
/*
* Copyright (C) 2003 the xine project
- *
+ *
* This file is part of xine, a free video player.
- *
+ *
* xine is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
- *
+ *
* xine is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
*
- * $Id:
+ * $Id:
*
* expand video filter by James Stembridge 24/05/2003
* improved by Michael Roitzsch
@@ -58,7 +58,7 @@
* bars to the left and right of the image and will then set up cropping
* to efficiently remove the black border around the 4:3 image, which the
* plugin would produce otherwise for this case.
- */
+ */
/* plugin class initialization function */
@@ -85,9 +85,9 @@ END_PARAM_DESCR(expand_param_descr)
typedef struct post_expand_s {
post_plugin_t post;
-
+
xine_post_in_t parameter_input;
-
+
int enable_automatic_shift;
int overlay_y_offset;
double aspect;
@@ -114,8 +114,8 @@ static int expand_get_parameters(xine_post_t *this_gen, void *param_g
static char *expand_get_help (void);
/* replaced video port functions */
-static vo_frame_t *expand_get_frame(xine_video_port_t *port_gen, uint32_t width,
- uint32_t height, double ratio,
+static vo_frame_t *expand_get_frame(xine_video_port_t *port_gen, uint32_t width,
+ uint32_t height, double ratio,
int format, int flags);
/* replaced vo_frame functions */
@@ -131,15 +131,15 @@ static int32_t expand_overlay_add_event(video_overlay_manager_t *this_gen
void *expand_init_plugin(xine_t *xine, void *data)
{
post_class_t *class = (post_class_t *)malloc(sizeof(post_class_t));
-
+
if (!class)
return NULL;
-
+
class->open_plugin = expand_open_plugin;
class->get_identifier = expand_get_identifier;
class->get_description = expand_get_description;
class->dispose = expand_class_dispose;
-
+
return class;
}
@@ -155,39 +155,39 @@ static post_plugin_t *expand_open_plugin(post_class_t *class_gen, int inputs,
post_video_port_t *port;
static xine_post_api_t post_api =
{ expand_set_parameters, expand_get_parameters, expand_get_param_descr, expand_get_help };
-
+
if (!this || !video_target || !video_target[0]) {
free(this);
return NULL;
}
-
+
_x_post_init(&this->post, 0, 1);
-
+
this->enable_automatic_shift = 0;
this->overlay_y_offset = 0;
this->aspect = 4.0 / 3.0;
this->centre_cut_out_mode = 0;
this->cropping_active = 0;
-
+
port = _x_post_intercept_video_port(&this->post, video_target[0], &input, &output);
port->new_port.get_frame = expand_get_frame;
port->new_frame->draw = expand_draw;
port->intercept_ovl = expand_intercept_ovl;
port->new_manager->add_event = expand_overlay_add_event;
-
+
input_param = &this->parameter_input;
input_param->name = "parameters";
input_param->type = XINE_POST_DATA_PARAMETERS;
input_param->data = &post_api;
xine_list_push_back(this->post.input, input_param);
-
+
input->xine_in.name = "video";
output->xine_out.name = "expanded video";
-
+
this->post.xine_post.video_input[0] = &port->new_port;
-
+
this->post.dispose = expand_dispose;
-
+
return &this->post;
}
@@ -210,7 +210,7 @@ static void expand_class_dispose(post_class_t *class_gen)
static void expand_dispose(post_plugin_t *this_gen)
{
post_expand_t *this = (post_expand_t *)this_gen;
-
+
if (_x_post_dispose(this_gen))
free(this);
}
@@ -238,12 +238,12 @@ static int expand_get_parameters(xine_post_t *this_gen, void *param_gen)
{
post_expand_t *this = (post_expand_t *)this_gen;
expand_parameters_t *param = (expand_parameters_t *)param_gen;
-
+
param->enable_automatic_shift = this->enable_automatic_shift;
param->overlay_y_offset = this->overlay_y_offset;
param->aspect = this->aspect;
param->centre_cut_out_mode = this->centre_cut_out_mode;
-
+
return 1;
}
@@ -271,7 +271,7 @@ static int is_pixel_black(vo_frame_t *frame, int x, int y)
if (x >= frame->width) x = frame->width - 1;
if (y < 0) y = 0;
if (y >= frame->height) y = frame->height - 1;
-
+
switch (frame->format)
{
case XINE_IMGFMT_YV12:
@@ -279,7 +279,7 @@ static int is_pixel_black(vo_frame_t *frame, int x, int y)
Cr = *(frame->base[ 1 ] + frame->pitches[ 1 ] * y / 2 + x / 2);
Cb = *(frame->base[ 2 ] + frame->pitches[ 2 ] * y / 2 + x / 2);
break;
-
+
case XINE_IMGFMT_YUY2:
Y = *(frame->base[ 0 ] + frame->pitches[ 0 ] * y + x * 2 + 0);
x &= ~1;
@@ -340,8 +340,8 @@ static int expand_draw(vo_frame_t *frame, xine_stream_t *stream)
}
-static vo_frame_t *expand_get_frame(xine_video_port_t *port_gen, uint32_t width,
- uint32_t height, double ratio,
+static vo_frame_t *expand_get_frame(xine_video_port_t *port_gen, uint32_t width,
+ uint32_t height, double ratio,
int format, int flags)
{
post_video_port_t *port = (post_video_port_t *)port_gen;
@@ -349,27 +349,27 @@ static vo_frame_t *expand_get_frame(xine_video_port_t *port_gen, uint32_t width,
vo_frame_t *frame;
uint32_t new_height, top_bar_height;
int i, end;
-
+
_x_post_rewire(&this->post);
-
+
if (ratio <= 0.0) ratio = (double)width / (double)height;
-
+
/* Calculate height of expanded frame */
new_height = (double)height * ratio / this->aspect;
new_height = (new_height + 1) & ~1;
top_bar_height = (new_height - height) / 2;
top_bar_height = (top_bar_height + 1) & ~1;
-
+
this->top_bar_height = top_bar_height;
if (new_height > height &&
(format == XINE_IMGFMT_YV12 || format == XINE_IMGFMT_YUY2)) {
frame = port->original_port->get_frame(port->original_port,
width, new_height, this->aspect, format, flags);
-
+
_x_post_inc_usage(port);
frame = _x_post_intercept_video_frame(frame, port);
-
+
/* paint black bars in the top and bottom of the frame and hide these
* from the decoders by modifying the pointers to and
* the size of the drawing area */
@@ -414,7 +414,7 @@ static vo_frame_t *expand_get_frame(xine_video_port_t *port_gen, uint32_t width,
width, height, ratio, format, flags);
/* no need to intercept this one, we are not going to do anything with it */
}
-
+
return frame;
}
@@ -424,7 +424,7 @@ static int expand_intercept_ovl(post_video_port_t *port)
post_expand_t *this = (post_expand_t *)port->post;
if (this->centre_cut_out_mode && this->cropping_active) return 0;
-
+
/* we always intercept overlay manager */
return 1;
}
@@ -435,7 +435,7 @@ static int32_t expand_overlay_add_event(video_overlay_manager_t *this_gen, void
video_overlay_event_t *event = (video_overlay_event_t *)event_gen;
post_video_port_t *port = _x_post_ovl_manager_to_port(this_gen);
post_expand_t *this = (post_expand_t *)port->post;
-
+
if (event->event_type == OVERLAY_EVENT_SHOW) {
switch (event->object.object_type) {
case 0:
@@ -450,6 +450,6 @@ static int32_t expand_overlay_add_event(video_overlay_manager_t *this_gen, void
event->object.overlay->y += this->top_bar_height;
}
}
-
+
return port->original_manager->add_event(port->original_manager, event_gen);
}
diff --git a/src/post/planar/fill.c b/src/post/planar/fill.c
index 98c572777..dd8b83c82 100644
--- a/src/post/planar/fill.c
+++ b/src/post/planar/fill.c
@@ -12,7 +12,7 @@
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
@@ -49,15 +49,15 @@ static int fill_draw(vo_frame_t *frame, xine_stream_t *stream);
void *fill_init_plugin(xine_t *xine, void *data)
{
post_class_t *class = (post_class_t *)malloc(sizeof(post_class_t));
-
+
if (!class)
return NULL;
-
+
class->open_plugin = fill_open_plugin;
class->get_identifier = fill_get_identifier;
class->get_description = fill_get_description;
class->dispose = fill_class_dispose;
-
+
return class;
}
@@ -70,25 +70,25 @@ static post_plugin_t *fill_open_plugin(post_class_t *class_gen, int inputs,
post_in_t *input;
post_out_t *output;
post_video_port_t *port;
-
+
if (!this || !video_target || !video_target[0]) {
free(this);
return NULL;
}
-
+
_x_post_init(this, 0, 1);
-
+
port = _x_post_intercept_video_port(this, video_target[0], &input, &output);
port->new_port.get_frame = fill_get_frame;
port->new_frame->draw = fill_draw;
-
+
input->xine_in.name = "video";
output->xine_out.name = "cropped video";
-
+
this->xine_post.video_input[0] = &port->new_port;
-
+
this->dispose = fill_dispose;
-
+
return this;
}
@@ -114,33 +114,33 @@ static void fill_dispose(post_plugin_t *this)
}
-static vo_frame_t *fill_get_frame(xine_video_port_t *port_gen, uint32_t width,
- uint32_t height, double ratio,
+static vo_frame_t *fill_get_frame(xine_video_port_t *port_gen, uint32_t width,
+ uint32_t height, double ratio,
int format, int flags)
{
post_video_port_t *port = (post_video_port_t *)port_gen;
post_plugin_t *this = port->post;
vo_frame_t *frame;
-
+
_x_post_rewire(this);
-
+
if (ratio <= 0.0) ratio = (double)width / (double)height;
-
+
if ((ratio > 4.0/3.0) &&
(format == XINE_IMGFMT_YV12 || format == XINE_IMGFMT_YUY2)) {
frame = port->original_port->get_frame(port->original_port,
width, height, 4.0/3.0, format, flags);
-
+
_x_post_inc_usage(port);
frame = _x_post_intercept_video_frame(frame, port);
-
+
frame->ratio = ratio;
} else {
frame = port->original_port->get_frame(port->original_port,
width, height, ratio, format, flags);
/* no need to intercept this one, we are not going to do anything with it */
}
-
+
return frame;
}
@@ -148,13 +148,13 @@ static vo_frame_t *fill_get_frame(xine_video_port_t *port_gen, uint32_t width,
static int fill_draw(vo_frame_t *frame, xine_stream_t *stream)
{
int skip, new_width;
-
+
new_width = (4.0*frame->width) / (3.0*frame->ratio);
-
+
frame->crop_left += (frame->width - new_width) / 2;
frame->crop_right += (frame->width + 1 - new_width) / 2;
frame->ratio = 4.0/3.0;
-
+
_x_post_frame_copy_down(frame, frame->next);
skip = frame->next->draw(frame->next, stream);
_x_post_frame_copy_up(frame, frame->next);
diff --git a/src/post/planar/invert.c b/src/post/planar/invert.c
index d1f0c8d4e..820221cf5 100644
--- a/src/post/planar/invert.c
+++ b/src/post/planar/invert.c
@@ -1,23 +1,23 @@
/*
* Copyright (C) 2000-2004 the xine project
- *
+ *
* This file is part of xine, a free video player.
- *
+ *
* xine is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
- *
+ *
* xine is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
*/
-
+
/*
* simple video inverter plugin
*/
@@ -50,15 +50,15 @@ static int invert_draw(vo_frame_t *frame, xine_stream_t *stream);
void *invert_init_plugin(xine_t *xine, void *data)
{
post_class_t *class = (post_class_t *)malloc(sizeof(post_class_t));
-
+
if (!class)
return NULL;
-
+
class->open_plugin = invert_open_plugin;
class->get_identifier = invert_get_identifier;
class->get_description = invert_get_description;
class->dispose = invert_class_dispose;
-
+
return class;
}
@@ -71,23 +71,23 @@ static post_plugin_t *invert_open_plugin(post_class_t *class_gen, int inputs,
post_in_t *input;
post_out_t *output;
post_video_port_t *port;
-
+
if (!this || !video_target || !video_target[0]) {
free(this);
return NULL;
}
-
+
_x_post_init(this, 0, 1);
-
+
port = _x_post_intercept_video_port(this, video_target[0], &input, &output);
port->intercept_frame = invert_intercept_frame;
port->new_frame->draw = invert_draw;
input->xine_in.name = "video";
output->xine_out.name = "inverted video";
this->xine_post.video_input[0] = &port->new_port;
-
+
this->dispose = invert_dispose;
-
+
return this;
}
@@ -125,18 +125,18 @@ static int invert_draw(vo_frame_t *frame, xine_stream_t *stream)
post_video_port_t *port = (post_video_port_t *)frame->port;
vo_frame_t *inverted_frame;
int size, i, skip;
-
+
if (frame->bad_frame) {
_x_post_frame_copy_down(frame, frame->next);
skip = frame->next->draw(frame->next, stream);
_x_post_frame_copy_up(frame, frame->next);
return skip;
}
-
+
inverted_frame = port->original_port->get_frame(port->original_port,
frame->width, frame->height, frame->ratio, frame->format, frame->flags | VO_BOTH_FIELDS);
_x_post_frame_copy_down(frame, inverted_frame);
-
+
switch (inverted_frame->format) {
case XINE_IMGFMT_YUY2:
size = inverted_frame->pitches[0] * inverted_frame->height;
@@ -157,10 +157,10 @@ static int invert_draw(vo_frame_t *frame, xine_stream_t *stream)
for (i = 0; i < size; i++)
inverted_frame->base[2][i] = 0xff - frame->base[2][i];
break;
- }
+ }
skip = inverted_frame->draw(inverted_frame, stream);
_x_post_frame_copy_up(frame, inverted_frame);
inverted_frame->free(inverted_frame);
-
+
return skip;
}
diff --git a/src/post/planar/noise.c b/src/post/planar/noise.c
index f639fce76..0f1fe98f7 100644
--- a/src/post/planar/noise.c
+++ b/src/post/planar/noise.c
@@ -1,18 +1,18 @@
/*
* Copyright (C) 2000-2006 the xine project
- *
+ *
* This file is part of xine, a free video player.
- *
+ *
* xine is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
- *
+ *
* xine is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
@@ -315,7 +315,7 @@ void *noise_init_plugin(xine_t *xine, void *);
typedef struct post_plugin_noise_s post_plugin_noise_t;
/*
- * this is the struct used by "parameters api"
+ * this is the struct used by "parameters api"
*/
typedef struct noise_parameters_s {
int luma_strength, chroma_strength,
@@ -329,15 +329,15 @@ static char *enum_quality[] = {"fixed", "temporal", "averaged temporal", NULL};
* description of params struct
*/
START_PARAM_DESCR( noise_parameters_t )
-PARAM_ITEM( POST_PARAM_TYPE_INT, luma_strength, NULL, 0, 100, 0,
+PARAM_ITEM( POST_PARAM_TYPE_INT, luma_strength, NULL, 0, 100, 0,
"Amount of noise to add to luma channel" )
-PARAM_ITEM( POST_PARAM_TYPE_INT, chroma_strength, NULL, 0, 100, 0,
+PARAM_ITEM( POST_PARAM_TYPE_INT, chroma_strength, NULL, 0, 100, 0,
"Amount of noise to add to chroma channel" )
-PARAM_ITEM( POST_PARAM_TYPE_INT, quality, enum_quality, 0, 0, 0,
+PARAM_ITEM( POST_PARAM_TYPE_INT, quality, enum_quality, 0, 0, 0,
"Quality level of noise" )
-PARAM_ITEM( POST_PARAM_TYPE_INT, type, enum_types, 0, 0, 0,
+PARAM_ITEM( POST_PARAM_TYPE_INT, type, enum_types, 0, 0, 0,
"Type of noise" )
-PARAM_ITEM( POST_PARAM_TYPE_BOOL, pattern, NULL, 0, 1, 0,
+PARAM_ITEM( POST_PARAM_TYPE_BOOL, pattern, NULL, 0, 1, 0,
"Mix random noise with a (semi)regular pattern" )
END_PARAM_DESCR( param_descr )
@@ -354,7 +354,7 @@ struct post_plugin_noise_s {
};
-static int set_parameters (xine_post_t *this_gen, void *param_gen)
+static int set_parameters (xine_post_t *this_gen, void *param_gen)
{
post_plugin_noise_t *this = (post_plugin_noise_t *)this_gen;
noise_parameters_t *param = (noise_parameters_t *)param_gen;
@@ -376,7 +376,7 @@ static int set_parameters (xine_post_t *this_gen, void *param_gen)
return 1;
}
-static int get_parameters (xine_post_t *this_gen, void *param_gen)
+static int get_parameters (xine_post_t *this_gen, void *param_gen)
{
post_plugin_noise_t *this = (post_plugin_noise_t *)this_gen;
noise_parameters_t *param = (noise_parameters_t *)param_gen;
@@ -395,7 +395,7 @@ static int get_parameters (xine_post_t *this_gen, void *param_gen)
pthread_mutex_unlock (&this->lock);
return 1;
}
-
+
static xine_post_api_descr_t *get_param_descr (void) {
return &param_descr;
}
@@ -453,7 +453,7 @@ void *noise_init_plugin(xine_t *xine, void *data)
if (!class)
return NULL;
-
+
class->open_plugin = noise_open_plugin;
class->get_identifier = noise_get_identifier;
class->get_description = noise_get_description;
@@ -481,12 +481,12 @@ static post_plugin_t *noise_open_plugin(post_class_t *class_gen, int inputs,
post_out_t *output;
post_video_port_t *port;
noise_parameters_t params;
-
+
if (!this || !video_target || !video_target[0]) {
free(this);
return NULL;
}
-
+
_x_post_init(&this->post, 0, 1);
memset(&params, 0, sizeof(noise_parameters_t));
@@ -496,11 +496,11 @@ static post_plugin_t *noise_open_plugin(post_class_t *class_gen, int inputs,
params.quality = 2;
pthread_mutex_init(&this->lock, NULL);
-
+
port = _x_post_intercept_video_port(&this->post, video_target[0], &input, &output);
port->intercept_frame = noise_intercept_frame;
port->new_frame->draw = noise_draw;
-
+
input_api = &this->params_input;
input_api->name = "parameters";
input_api->type = XINE_POST_DATA_PARAMETERS;
@@ -509,13 +509,13 @@ static post_plugin_t *noise_open_plugin(post_class_t *class_gen, int inputs,
input->xine_in.name = "video";
output->xine_out.name = "filtered video";
-
+
this->post.xine_post.video_input[0] = &port->new_port;
-
+
this->post.dispose = noise_dispose;
set_parameters ((xine_post_t *)this, &params);
-
+
return &this->post;
}
@@ -559,7 +559,7 @@ static int noise_draw(vo_frame_t *frame, xine_stream_t *stream)
vo_frame_t *out_frame;
int skip;
- if (frame->bad_frame ||
+ if (frame->bad_frame ||
(this->params[0].strength == 0 && this->params[1].strength == 0)) {
_x_post_frame_copy_down(frame, frame->next);
skip = frame->next->draw(frame->next, stream);
@@ -569,26 +569,26 @@ static int noise_draw(vo_frame_t *frame, xine_stream_t *stream)
frame->lock(frame);
out_frame = port->original_port->get_frame(port->original_port,
- frame->width, frame->height, frame->ratio, frame->format,
+ frame->width, frame->height, frame->ratio, frame->format,
frame->flags | VO_BOTH_FIELDS);
_x_post_frame_copy_down(frame, out_frame);
pthread_mutex_lock (&this->lock);
if (frame->format == XINE_IMGFMT_YV12) {
- noise(out_frame->base[0], frame->base[0],
- out_frame->pitches[0], frame->pitches[0],
+ noise(out_frame->base[0], frame->base[0],
+ out_frame->pitches[0], frame->pitches[0],
frame->width, frame->height, &this->params[0]);
- noise(out_frame->base[1], frame->base[1],
- out_frame->pitches[1], frame->pitches[1],
+ noise(out_frame->base[1], frame->base[1],
+ out_frame->pitches[1], frame->pitches[1],
frame->width/2, frame->height/2, &this->params[1]);
- noise(out_frame->base[2], frame->base[2],
- out_frame->pitches[2], frame->pitches[2],
+ noise(out_frame->base[2], frame->base[2],
+ out_frame->pitches[2], frame->pitches[2],
frame->width/2, frame->height/2, &this->params[1]);
} else {
// Chroma strength is ignored for YUY2.
- noise(out_frame->base[0], frame->base[0],
- out_frame->pitches[0], frame->pitches[0],
+ noise(out_frame->base[0], frame->base[0],
+ out_frame->pitches[0], frame->pitches[0],
frame->width * 2, frame->height, &this->params[0]);
}
diff --git a/src/post/planar/planar.c b/src/post/planar/planar.c
index e1c9681ab..112ebdf0d 100644
--- a/src/post/planar/planar.c
+++ b/src/post/planar/planar.c
@@ -1,18 +1,18 @@
/*
* Copyright (C) 2000-2004 the xine project
- *
+ *
* This file is part of xine, a free video player.
- *
+ *
* xine is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
- *
+ *
* xine is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
@@ -59,7 +59,7 @@ extern void *noise_init_plugin(xine_t *xine, void *);
static const post_info_t noise_special_info = { XINE_POST_TYPE_VIDEO_FILTER };
const plugin_info_t xine_plugin_info[] EXPORTED = {
- /* type, API, "name", version, special_info, init_function */
+ /* type, API, "name", version, special_info, init_function */
{ PLUGIN_POST, 9, "expand", XINE_VERSION_CODE, &expand_special_info, &expand_init_plugin },
{ PLUGIN_POST, 9, "fill", XINE_VERSION_CODE, &fill_special_info, &fill_init_plugin },
{ PLUGIN_POST, 9, "invert", XINE_VERSION_CODE, &invert_special_info, &invert_init_plugin },
diff --git a/src/post/planar/pp.c b/src/post/planar/pp.c
index 1ce45e381..c9db99f2c 100644
--- a/src/post/planar/pp.c
+++ b/src/post/planar/pp.c
@@ -1,18 +1,18 @@
/*
* Copyright (C) 2000-2004 the xine project
- *
+ *
* This file is part of xine, a free video player.
- *
+ *
* xine is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
- *
+ *
* xine is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
@@ -43,7 +43,7 @@ void *pp_init_plugin(xine_t *xine, void *);
typedef struct post_plugin_pp_s post_plugin_pp_t;
/*
- * this is the struct used by "parameters api"
+ * this is the struct used by "parameters api"
*/
typedef struct pp_parameters_s {
@@ -56,9 +56,9 @@ typedef struct pp_parameters_s {
* description of params struct
*/
START_PARAM_DESCR( pp_parameters_t )
-PARAM_ITEM( POST_PARAM_TYPE_INT, quality, NULL, 0, PP_QUALITY_MAX, 0,
+PARAM_ITEM( POST_PARAM_TYPE_INT, quality, NULL, 0, PP_QUALITY_MAX, 0,
"postprocessing quality" )
-PARAM_ITEM( POST_PARAM_TYPE_CHAR, mode, NULL, 0, 0, 0,
+PARAM_ITEM( POST_PARAM_TYPE_CHAR, mode, NULL, 0, 0, 0,
"mode string (overwrites all other options except quality)" )
END_PARAM_DESCR( param_descr )
@@ -105,18 +105,18 @@ static int get_parameters (xine_post_t *this_gen, void *param_gen) {
return 1;
}
-
+
static xine_post_api_descr_t * get_param_descr (void) {
return &param_descr;
}
static char * get_help (void) {
- char *help1 =
+ char *help1 =
_("FFmpeg libpostprocess plugin.\n"
"\n"
"Parameters\n"
"\n");
-
+
char *help2 =
_("\n"
"* libpostprocess (C) Michael Niedermayer\n"
@@ -161,7 +161,7 @@ void *pp_init_plugin(xine_t *xine, void *data)
if (!class)
return NULL;
-
+
class->open_plugin = pp_open_plugin;
class->get_identifier = pp_get_identifier;
class->get_description = pp_get_description;
@@ -181,14 +181,14 @@ static post_plugin_t *pp_open_plugin(post_class_t *class_gen, int inputs,
post_out_t *output;
post_video_port_t *port;
uint32_t cpu_caps;
-
+
if (!this || !video_target || !video_target[0]) {
free(this);
return NULL;
}
_x_post_init(&this->post, 0, 1);
-
+
this->params.quality = 3;
strcpy(this->params.mode, "de");
@@ -199,18 +199,18 @@ static post_plugin_t *pp_open_plugin(post_class_t *class_gen, int inputs,
this->pp_flags |= PP_CPU_CAPS_MMX;
if(cpu_caps & MM_ACCEL_X86_MMXEXT)
this->pp_flags |= PP_CPU_CAPS_MMX2;
- if(cpu_caps & MM_ACCEL_X86_3DNOW)
+ if(cpu_caps & MM_ACCEL_X86_3DNOW)
this->pp_flags |= PP_CPU_CAPS_3DNOW;
this->pp_mode = NULL;
this->pp_context = NULL;
pthread_mutex_init (&this->lock, NULL);
-
+
port = _x_post_intercept_video_port(&this->post, video_target[0], &input, &output);
port->intercept_frame = pp_intercept_frame;
port->new_frame->draw = pp_draw;
-
+
input_api = &this->params_input;
input_api->name = "parameters";
input_api->type = XINE_POST_DATA_PARAMETERS;
@@ -219,11 +219,11 @@ static post_plugin_t *pp_open_plugin(post_class_t *class_gen, int inputs,
input->xine_in.name = "video";
output->xine_out.name = "pped video";
-
+
this->post.xine_post.video_input[0] = &port->new_port;
-
+
this->post.dispose = pp_dispose;
-
+
return &this->post;
}
@@ -283,9 +283,9 @@ static int pp_draw(vo_frame_t *frame, xine_stream_t *stream)
yv12_frame = port->original_port->get_frame(port->original_port,
frame->width, frame->height, frame->ratio, XINE_IMGFMT_YV12, frame->flags | VO_BOTH_FIELDS);
-
+
_x_post_frame_copy_down(frame, yv12_frame);
-
+
yuy2_to_yv12(frame->base[0], frame->pitches[0],
yv12_frame->base[0], yv12_frame->pitches[0],
yv12_frame->base[1], yv12_frame->pitches[1],
@@ -299,12 +299,12 @@ static int pp_draw(vo_frame_t *frame, xine_stream_t *stream)
out_frame = port->original_port->get_frame(port->original_port,
frame->width, frame->height, frame->ratio, XINE_IMGFMT_YV12, frame->flags | VO_BOTH_FIELDS);
-
+
_x_post_frame_copy_down(frame, out_frame);
pthread_mutex_lock (&this->lock);
- if( !this->pp_context ||
+ if( !this->pp_context ||
this->frame_width != yv12_frame->width ||
this->frame_height != yv12_frame->height ) {
@@ -324,15 +324,15 @@ static int pp_draw(vo_frame_t *frame, xine_stream_t *stream)
}
if(!this->pp_mode)
- this->pp_mode = pp_get_mode_by_name_and_quality(this->params.mode,
+ this->pp_mode = pp_get_mode_by_name_and_quality(this->params.mode,
this->params.quality);
if(this->pp_mode)
- pp_postprocess(yv12_frame->base, yv12_frame->pitches,
- out_frame->base, out_frame->pitches,
+ pp_postprocess(yv12_frame->base, yv12_frame->pitches,
+ out_frame->base, out_frame->pitches,
(frame->width+7)&(~7), frame->height,
NULL, 0,
- this->pp_mode, this->pp_context,
+ this->pp_mode, this->pp_context,
0 /*this->av_frame->pict_type*/);
pthread_mutex_unlock (&this->lock);
diff --git a/src/post/planar/unsharp.c b/src/post/planar/unsharp.c
index 6fac727ce..dbf723577 100644
--- a/src/post/planar/unsharp.c
+++ b/src/post/planar/unsharp.c
@@ -1,18 +1,18 @@
/*
* Copyright (C) 2000-2004 the xine project
- *
+ *
* This file is part of xine, a free video player.
- *
+ *
* xine is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
- *
+ *
* xine is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
@@ -64,7 +64,7 @@ static void unsharp( uint8_t *dst, uint8_t *src, int dstStride, int srcStride, i
uint32_t **SC = fp->SC;
uint32_t SR[MAX_MATRIX_SIZE-1], Tmp1, Tmp2;
- uint8_t* src2 = src;
+ uint8_t* src2 = src;
int32_t res;
int x, y, z;
@@ -77,7 +77,7 @@ static void unsharp( uint8_t *dst, uint8_t *src, int dstStride, int srcStride, i
if( !fp->amount ) {
if( src == dst )
return;
- if( dstStride == srcStride )
+ if( dstStride == srcStride )
xine_fast_memcpy( dst, src, srcStride*height );
else
for( y=0; y<height; y++, dst+=dstStride, src+=srcStride )
@@ -104,7 +104,7 @@ static void unsharp( uint8_t *dst, uint8_t *src, int dstStride, int srcStride, i
if( x>=stepsX && y>=stepsY ) {
uint8_t* srx = src - stepsY*srcStride + x - stepsX;
uint8_t* dsx = dst - stepsY*dstStride + x - stepsX;
-
+
res = (int32_t)*srx + ( ( ( (int32_t)*srx - (int32_t)((Tmp1+halfscale) >> scalebits) ) * amount ) >> 16 );
*dsx = res>255 ? 255 : res<0 ? 0 : (uint8_t)res;
}
@@ -123,7 +123,7 @@ void *unsharp_init_plugin(xine_t *xine, void *);
typedef struct post_plugin_unsharp_s post_plugin_unsharp_t;
/*
- * this is the struct used by "parameters api"
+ * this is the struct used by "parameters api"
*/
typedef struct unsharp_parameters_s {
@@ -141,17 +141,17 @@ typedef struct unsharp_parameters_s {
* description of params struct
*/
START_PARAM_DESCR( unsharp_parameters_t )
-PARAM_ITEM( POST_PARAM_TYPE_INT, luma_matrix_width, NULL, 3, 11, 0,
+PARAM_ITEM( POST_PARAM_TYPE_INT, luma_matrix_width, NULL, 3, 11, 0,
"width of the matrix (must be odd)" )
-PARAM_ITEM( POST_PARAM_TYPE_INT, luma_matrix_height, NULL, 3, 11, 0,
+PARAM_ITEM( POST_PARAM_TYPE_INT, luma_matrix_height, NULL, 3, 11, 0,
"height of the matrix (must be odd)" )
-PARAM_ITEM( POST_PARAM_TYPE_DOUBLE, luma_amount, NULL, -2, 2, 0,
+PARAM_ITEM( POST_PARAM_TYPE_DOUBLE, luma_amount, NULL, -2, 2, 0,
"relative amount of sharpness/blur (=0 disable, <0 blur, >0 sharpen)" )
-PARAM_ITEM( POST_PARAM_TYPE_INT, chroma_matrix_width, NULL, 3, 11, 0,
+PARAM_ITEM( POST_PARAM_TYPE_INT, chroma_matrix_width, NULL, 3, 11, 0,
"width of the matrix (must be odd)" )
-PARAM_ITEM( POST_PARAM_TYPE_INT, chroma_matrix_height, NULL, 3, 11, 0,
+PARAM_ITEM( POST_PARAM_TYPE_INT, chroma_matrix_height, NULL, 3, 11, 0,
"height of the matrix (must be odd)" )
-PARAM_ITEM( POST_PARAM_TYPE_DOUBLE, chroma_amount, NULL, -2, 2, 0,
+PARAM_ITEM( POST_PARAM_TYPE_DOUBLE, chroma_amount, NULL, -2, 2, 0,
"relative amount of sharpness/blur (=0 disable, <0 blur, >0 sharpen)" )
END_PARAM_DESCR( param_descr )
@@ -205,7 +205,7 @@ static int get_parameters (xine_post_t *this_gen, void *param_gen) {
return 1;
}
-
+
static xine_post_api_descr_t * get_param_descr (void) {
return &param_descr;
}
@@ -270,7 +270,7 @@ void *unsharp_init_plugin(xine_t *xine, void *data)
if (!class)
return NULL;
-
+
class->open_plugin = unsharp_open_plugin;
class->get_identifier = unsharp_get_identifier;
class->get_description = unsharp_get_description;
@@ -289,14 +289,14 @@ static post_plugin_t *unsharp_open_plugin(post_class_t *class_gen, int inputs,
xine_post_in_t *input_api;
post_out_t *output;
post_video_port_t *port;
-
+
if (!this || !video_target || !video_target[0]) {
free(this);
return NULL;
}
_x_post_init(&this->post, 0, 1);
-
+
this->params.luma_matrix_width = 5;
this->params.luma_matrix_height = 5;
this->params.luma_amount = 0.0;
@@ -306,11 +306,11 @@ static post_plugin_t *unsharp_open_plugin(post_class_t *class_gen, int inputs,
this->params.chroma_amount = 0.0;
pthread_mutex_init (&this->lock, NULL);
-
+
port = _x_post_intercept_video_port(&this->post, video_target[0], &input, &output);
port->intercept_frame = unsharp_intercept_frame;
port->new_frame->draw = unsharp_draw;
-
+
input_api = &this->params_input;
input_api->name = "parameters";
input_api->type = XINE_POST_DATA_PARAMETERS;
@@ -319,13 +319,13 @@ static post_plugin_t *unsharp_open_plugin(post_class_t *class_gen, int inputs,
input->xine_in.name = "video";
output->xine_out.name = "unsharped video";
-
+
this->post.xine_post.video_input[0] = &port->new_port;
-
+
set_parameters ((xine_post_t *)this, &this->params);
-
+
this->post.dispose = unsharp_dispose;
-
+
return &this->post;
}
@@ -399,15 +399,15 @@ static int unsharp_draw(vo_frame_t *frame, xine_stream_t *stream)
yv12_frame = port->original_port->get_frame(port->original_port,
frame->width, frame->height, frame->ratio, XINE_IMGFMT_YV12, frame->flags | VO_BOTH_FIELDS);
-
+
_x_post_frame_copy_down(frame, yv12_frame);
-
+
yuy2_to_yv12(frame->base[0], frame->pitches[0],
yv12_frame->base[0], yv12_frame->pitches[0],
yv12_frame->base[1], yv12_frame->pitches[1],
yv12_frame->base[2], yv12_frame->pitches[2],
frame->width, frame->height);
-
+
} else {
yv12_frame = frame;
yv12_frame->lock(yv12_frame);
@@ -435,7 +435,7 @@ static int unsharp_draw(vo_frame_t *frame, xine_stream_t *stream)
stepsY = fp->msizeY/2;
for( z=0; z<2*stepsY; z++ )
fp->SC[z] = malloc( sizeof(*(fp->SC[z])) * (frame->width+2*stepsX) );
-
+
fp = &this->priv.chromaParam;
stepsX = fp->msizeX/2;
stepsY = fp->msizeY/2;
@@ -450,7 +450,7 @@ static int unsharp_draw(vo_frame_t *frame, xine_stream_t *stream)
pthread_mutex_unlock (&this->lock);
skip = out_frame->draw(out_frame, stream);
-
+
_x_post_frame_copy_up(frame, out_frame);
out_frame->free(out_frame);