diff options
Diffstat (limited to 'src/post/planar')
-rw-r--r-- | src/post/planar/Makefile.am | 4 | ||||
-rw-r--r-- | src/post/planar/boxblur.c | 62 | ||||
-rw-r--r-- | src/post/planar/denoise3d.c | 50 | ||||
-rw-r--r-- | src/post/planar/eq.c | 42 | ||||
-rw-r--r-- | src/post/planar/eq2.c | 54 | ||||
-rw-r--r-- | src/post/planar/expand.c | 78 | ||||
-rw-r--r-- | src/post/planar/fill.c | 44 | ||||
-rw-r--r-- | src/post/planar/invert.c | 36 | ||||
-rw-r--r-- | src/post/planar/noise.c | 62 | ||||
-rw-r--r-- | src/post/planar/planar.c | 10 | ||||
-rw-r--r-- | src/post/planar/pp.c | 50 | ||||
-rw-r--r-- | src/post/planar/unsharp.c | 58 |
12 files changed, 275 insertions, 275 deletions
diff --git a/src/post/planar/Makefile.am b/src/post/planar/Makefile.am index f706e4a7b..039da4fc4 100644 --- a/src/post/planar/Makefile.am +++ b/src/post/planar/Makefile.am @@ -2,8 +2,8 @@ include $(top_builddir)/misc/Makefile.plugins include $(top_srcdir)/misc/Makefile.common AM_CFLAGS = $(VISIBILITY_FLAG) -AM_CPPFLAGS = -AM_LDFLAGS = +AM_CPPFLAGS = +AM_LDFLAGS = noinst_LTLIBRARIES = libpost_planar_asm.la libpost_planar_asm_la_SOURCES = eq.c eq2.c noise.c diff --git a/src/post/planar/boxblur.c b/src/post/planar/boxblur.c index 182d088c4..ea3085ffd 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 ¶m_descr; } @@ -141,7 +141,7 @@ void *boxblur_init_plugin(xine_t *xine, void *data) if (!class) return NULL; - + class->open_plugin = boxblur_open_plugin; class->identifier = "boxblur"; class->description = N_("box blur filter from mplayer"); @@ -160,14 +160,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; @@ -178,7 +178,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; @@ -187,18 +187,18 @@ 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; } 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); @@ -243,7 +243,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--){ @@ -267,9 +267,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); } @@ -277,7 +277,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++){ @@ -326,25 +326,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 c87f5f078..793a377c7 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 ¶m_descr; } @@ -181,7 +181,7 @@ void *denoise3d_init_plugin(xine_t *xine, void *data) if (!class) return NULL; - + class->open_plugin = denoise3d_open_plugin; class->identifier = "denoise3d"; class->description = N_("3D Denoiser (variable lowpass filter)"); @@ -200,14 +200,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; @@ -219,7 +219,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; @@ -228,20 +228,20 @@ 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; } 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); @@ -273,10 +273,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) { @@ -334,15 +334,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); @@ -382,7 +382,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 4e2460bb8..dcf9b47fb 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 ¶m_descr; } @@ -233,7 +233,7 @@ void *eq_init_plugin(xine_t *xine, void *data) if (!class) return NULL; - + class->open_plugin = eq_open_plugin; class->identifier = "eq"; class->description = N_("soft video equalizer"); @@ -252,7 +252,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; @@ -260,7 +260,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 @@ -270,14 +270,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; @@ -285,11 +285,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; } @@ -355,15 +355,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); @@ -389,7 +389,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 aeffcd4ae..a3e1acac1 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 ¶m_descr; } @@ -414,7 +414,7 @@ void *eq2_init_plugin(xine_t *xine, void *data) if (!class) return NULL; - + class->open_plugin = eq2_open_plugin; class->identifier = "eq2"; class->description = N_("Software video equalizer"); @@ -433,12 +433,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)); @@ -452,13 +452,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; @@ -467,13 +467,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; } @@ -547,15 +547,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); @@ -585,7 +585,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 3cecaf47d..513def84f 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; @@ -111,8 +111,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 */ @@ -128,15 +128,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 *)xine_xmalloc(sizeof(post_class_t)); - + if (!class) return NULL; - + class->open_plugin = expand_open_plugin; class->identifier = "expand"; class->description = N_("add black borders to top and bottom of video to expand it to 4:3 aspect ratio"); class->dispose = default_post_class_dispose; - + return class; } @@ -152,46 +152,46 @@ 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; } 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); } @@ -219,12 +219,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; } @@ -252,7 +252,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: @@ -260,7 +260,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; @@ -321,8 +321,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; @@ -330,27 +330,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 */ @@ -395,7 +395,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; } @@ -405,7 +405,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; } @@ -416,7 +416,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: @@ -431,6 +431,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 5aacfd679..c79033a72 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 @@ -46,15 +46,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 *)xine_xmalloc(sizeof(post_class_t)); - + if (!class) return NULL; - + class->open_plugin = fill_open_plugin; class->identifier = "fill"; class->description = N_("crops left and right of video to fill 4:3 aspect ratio"); class->dispose = default_post_class_dispose; - + return class; } @@ -67,25 +67,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; } @@ -96,33 +96,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; } @@ -130,13 +130,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 17f237fd7..462b8fa7b 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 */ @@ -47,15 +47,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 *)xine_xmalloc(sizeof(post_class_t)); - + if (!class) return NULL; - + class->open_plugin = invert_open_plugin; class->identifier = "invert"; class->description = N_("inverts the colours of every video frame"); class->dispose = default_post_class_dispose; - + return class; } @@ -68,23 +68,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; } @@ -106,18 +106,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; @@ -138,10 +138,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 3c6fd70dd..015925138 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 @@ -317,7 +317,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, @@ -331,15 +331,15 @@ static const char *const enum_quality[] = {"fixed", "temporal", "averaged tempor * 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 ) @@ -356,7 +356,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; @@ -378,7 +378,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; @@ -397,7 +397,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 ¶m_descr; } @@ -452,7 +452,7 @@ void *noise_init_plugin(xine_t *xine, void *data) if (!class) return NULL; - + class->open_plugin = noise_open_plugin; class->identifier = "noise"; class->description = N_("Adds noise"); @@ -480,12 +480,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(¶ms, 0, sizeof(noise_parameters_t)); @@ -495,11 +495,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; @@ -508,13 +508,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, ¶ms); - + return &this->post; } @@ -544,7 +544,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); @@ -554,26 +554,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 35177230a..e2bd65846 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, 10, "expand", XINE_VERSION_CODE, &expand_special_info, &expand_init_plugin }, { PLUGIN_POST, 10, "fill", XINE_VERSION_CODE, &fill_special_info, &fill_init_plugin }, { PLUGIN_POST, 10, "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 64ebadfe9..b985b47aa 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 @@ -44,7 +44,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 { @@ -57,9 +57,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 ) @@ -106,7 +106,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 ¶m_descr; } @@ -157,7 +157,7 @@ void *pp_init_plugin(xine_t *xine, void *data) if (!class) return NULL; - + class->open_plugin = pp_open_plugin; class->identifier = "pp"; class->description = N_("plugin for ffmpeg libpostprocess"); @@ -177,14 +177,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"); @@ -195,18 +195,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; @@ -215,11 +215,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; } @@ -263,9 +263,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], @@ -279,12 +279,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 ) { @@ -304,15 +304,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 506f19f4c..ffa6a39df 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 ¶m_descr; } @@ -267,7 +267,7 @@ void *unsharp_init_plugin(xine_t *xine, void *data) if (!class) return NULL; - + class->open_plugin = unsharp_open_plugin; class->identifier = "unsharp"; class->description = N_("unsharp mask & gaussian blur"); @@ -286,14 +286,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; @@ -303,11 +303,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; @@ -316,13 +316,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; } @@ -381,15 +381,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); @@ -417,7 +417,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; @@ -432,7 +432,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); |