summaryrefslogtreecommitdiff
path: root/src/post
diff options
context:
space:
mode:
Diffstat (limited to 'src/post')
-rw-r--r--src/post/audio/audio_filters.c10
-rw-r--r--src/post/audio/audio_filters.h8
-rw-r--r--src/post/audio/dsp.h4
-rw-r--r--src/post/audio/filter.c66
-rw-r--r--src/post/audio/filter.h6
-rw-r--r--src/post/audio/stretch.c194
-rw-r--r--src/post/audio/upmix.c44
-rw-r--r--src/post/audio/upmix_mono.c56
-rw-r--r--src/post/audio/volnorm.c44
-rw-r--r--src/post/audio/window.c26
-rw-r--r--src/post/audio/window.h2
-rw-r--r--src/post/deinterlace/Makefile.am4
-rw-r--r--src/post/deinterlace/plugins/greedy.c6
-rw-r--r--src/post/deinterlace/plugins/greedy2frame_template.c32
-rw-r--r--src/post/deinterlace/plugins/greedyhmacros.h26
-rw-r--r--src/post/deinterlace/plugins/linearblend.c2
-rw-r--r--src/post/deinterlace/plugins/tomsmocomp/tomsmocompmacros.h26
-rw-r--r--src/post/deinterlace/pulldown.c10
-rw-r--r--src/post/deinterlace/speedy.c26
-rw-r--r--src/post/deinterlace/speedy.h4
-rw-r--r--src/post/deinterlace/tvtime.h2
-rw-r--r--src/post/deinterlace/xine_plugin.c200
-rw-r--r--src/post/goom/xine_goom.c120
-rw-r--r--src/post/mosaico/mosaico.c86
-rw-r--r--src/post/mosaico/switch.c38
-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
-rw-r--r--src/post/visualizations/fft.c6
-rw-r--r--src/post/visualizations/fft.h6
-rw-r--r--src/post/visualizations/fftgraph.c54
-rw-r--r--src/post/visualizations/fftscope.c42
-rw-r--r--src/post/visualizations/fooviz.c80
-rw-r--r--src/post/visualizations/oscope.c88
42 files changed, 934 insertions, 934 deletions
diff --git a/src/post/audio/audio_filters.c b/src/post/audio/audio_filters.c
index 12d48784c..eb90d38cb 100644
--- a/src/post/audio/audio_filters.c
+++ b/src/post/audio/audio_filters.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
@@ -38,7 +38,7 @@ static const post_info_t volnorm_special_info = { XINE_POST_TYPE_AUDIO_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, "upmix", XINE_VERSION_CODE, &upmix_special_info, &upmix_init_plugin },
{ PLUGIN_POST, 9, "upmix_mono", XINE_VERSION_CODE, &upmix_mono_special_info, &upmix_mono_init_plugin },
{ PLUGIN_POST, 9, "stretch", XINE_VERSION_CODE, &stretch_special_info, &stretch_init_plugin },
diff --git a/src/post/audio/audio_filters.h b/src/post/audio/audio_filters.h
index 6c064945a..c2bf88cf8 100644
--- a/src/post/audio/audio_filters.h
+++ b/src/post/audio/audio_filters.h
@@ -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
diff --git a/src/post/audio/dsp.h b/src/post/audio/dsp.h
index 237640283..8dabe4f36 100644
--- a/src/post/audio/dsp.h
+++ b/src/post/audio/dsp.h
@@ -1,5 +1,5 @@
/*=============================================================================
- *
+ *
* This software has been released under the terms of the GNU Public
* license. See http://www.gnu.org/copyleft/gpl.html for details.
*
@@ -9,7 +9,7 @@
*/
#ifndef _DSP_H
-#define _DSP_H 1
+#define _DSP_H 1
/* Implementation of routines used for DSP */
diff --git a/src/post/audio/filter.c b/src/post/audio/filter.c
index 55d75e1e4..f41d880fc 100644
--- a/src/post/audio/filter.c
+++ b/src/post/audio/filter.c
@@ -1,5 +1,5 @@
/*=============================================================================
- *
+ *
* This software has been released under the terms of the GNU Public
* license. See http://www.gnu.org/copyleft/gpl.html for details.
*
@@ -25,12 +25,12 @@
*
* n number of filter taps, where mod(n,4)==0
* w filter taps
- * x input signal must be a circular buffer which is indexed backwards
+ * x input signal must be a circular buffer which is indexed backwards
*/
inline _ftype_t fir(register unsigned int n, _ftype_t* w, _ftype_t* x)
{
register _ftype_t y; /* Output */
- y = 0.0;
+ y = 0.0;
do{
n--;
y+=w[n]*x[n];
@@ -44,7 +44,7 @@ inline _ftype_t fir(register unsigned int n, _ftype_t* w, _ftype_t* x)
* d number of filters
* xi current index in xq
* w filter taps k by n big
- * x input signal must be a circular buffers which are indexed backwards
+ * x input signal must be a circular buffers which are indexed backwards
* y output buffer
* s output buffer stride
*/
@@ -67,11 +67,11 @@ inline _ftype_t* pfir(unsigned int n, unsigned int d, unsigned int xi, _ftype_t*
at the new samples, xi current index in xq and n the length of the
filter. xq must be n*2 by k big, s is the index for in.
*/
-inline int updatepq(unsigned int n, unsigned int d, unsigned int xi, _ftype_t** xq, _ftype_t* in, unsigned int s)
+inline int updatepq(unsigned int n, unsigned int d, unsigned int xi, _ftype_t** xq, _ftype_t* in, unsigned int s)
{
register _ftype_t* txq = *xq + xi;
register int nt = n*2;
-
+
while(d-- >0){
*txq= *(txq+n) = *in;
txq+=nt;
@@ -88,26 +88,26 @@ inline int updatepq(unsigned int n, unsigned int d, unsigned int xi, _ftype_t**
n filter length must be odd for HP and BS filters
w buffer for the filter taps (must be n long)
- fc cutoff frequencies (1 for LP and HP, 2 for BP and BS)
+ fc cutoff frequencies (1 for LP and HP, 2 for BP and BS)
0 < fc < 1 where 1 <=> Fs/2
flags window and filter type as defined in filter.h
- variables are ored together: i.e. LP|HAMMING will give a
- low pass filter designed using a hamming window
+ variables are ored together: i.e. LP|HAMMING will give a
+ low pass filter designed using a hamming window
opt beta constant used only when designing using kaiser windows
-
+
returns 0 if OK, -1 if fail
*/
int design_fir(unsigned int n, _ftype_t* w, _ftype_t* fc, unsigned int flags, _ftype_t opt)
{
- unsigned int o = n & 1; /* Indicator for odd filter length */
+ unsigned int o = n & 1; /* Indicator for odd filter length */
unsigned int end = ((n + 1) >> 1) - o; /* Loop end */
unsigned int i; /* Loop index */
_ftype_t k1 = 2 * M_PI; /* 2*pi*fc1 */
_ftype_t k2 = 0.5 * (_ftype_t)(1 - o);/* Constant used if the filter has even length */
_ftype_t k3; /* 2*pi*fc2 Constant used in BP and BS design */
- _ftype_t g = 0.0; /* Gain */
- _ftype_t t1,t2,t3; /* Temporary variables */
+ _ftype_t g = 0.0; /* Gain */
+ _ftype_t t1,t2,t3; /* Temporary variables */
_ftype_t fc1,fc2; /* Cutoff frequencies */
/* Sanity check */
@@ -130,10 +130,10 @@ int design_fir(unsigned int n, _ftype_t* w, _ftype_t* fc, unsigned int flags, _f
case(KAISER):
kaiser(n,w,opt); break;
default:
- return -1;
+ return -1;
}
- if(flags & (LP | HP)){
+ if(flags & (LP | HP)){
fc1=*fc;
/* Cutoff frequency must be < 0.5 where 0.5 <=> Fs/2 */
fc1 = ((fc1 <= 1.0) && (fc1 > 0.0)) ? fc1/2 : 0.25;
@@ -143,7 +143,7 @@ int design_fir(unsigned int n, _ftype_t* w, _ftype_t* fc, unsigned int flags, _f
/*
* If the filter length is odd, there is one point which is exactly
- * in the middle. The value at this point is 2*fCutoff*sin(x)/x,
+ * in the middle. The value at this point is 2*fCutoff*sin(x)/x,
* where x is zero. To make sure nothing strange happens, we set this
* value separately.
*/
@@ -196,9 +196,9 @@ int design_fir(unsigned int n, _ftype_t* w, _ftype_t* fc, unsigned int flags, _f
t2 = sin(k3 * t1)/(M_PI * t1); /* Sinc fc2 */
t3 = sin(k1 * t1)/(M_PI * t1); /* Sinc fc1 */
g += w[end-i-1] * (t3 + t2); /* Total gain in filter */
- w[end-i-1] = w[n-end+i] = w[end-i-1] * (t2 - t3);
+ w[end-i-1] = w[n-end+i] = w[end-i-1] * (t2 - t3);
}
- }
+ }
else{ /* Band stop */
if (!o) /* Band stop filters must have odd length */
return -1;
@@ -210,7 +210,7 @@ int design_fir(unsigned int n, _ftype_t* w, _ftype_t* fc, unsigned int flags, _f
t1 = (_ftype_t)(i+1);
t2 = sin(k1 * t1)/(M_PI * t1); /* Sinc fc1 */
t3 = sin(k3 * t1)/(M_PI * t1); /* Sinc fc2 */
- w[end-i-1] = w[n-end+i] = w[end-i-1] * (t2 - t3);
+ w[end-i-1] = w[n-end+i] = w[end-i-1] * (t2 - t3);
g += 2*w[end-i-1]; /* Total gain in filter */
}
}
@@ -218,9 +218,9 @@ int design_fir(unsigned int n, _ftype_t* w, _ftype_t* fc, unsigned int flags, _f
/* Normalize gain */
g=1/g;
- for (i=0; i<n; i++)
+ for (i=0; i<n; i++)
w[i] *= g;
-
+
return 0;
}
@@ -229,7 +229,7 @@ int design_fir(unsigned int n, _ftype_t* w, _ftype_t* fc, unsigned int flags, _f
* n length of prototype filter
* k number of polyphase components
* w prototype filter taps
- * pw Parallel FIR filter
+ * pw Parallel FIR filter
* g Filter gain
* flags FWD forward indexing
* REW reverse indexing
@@ -240,10 +240,10 @@ int design_fir(unsigned int n, _ftype_t* w, _ftype_t* fc, unsigned int flags, _f
int design_pfir(unsigned int n, unsigned int k, _ftype_t* w, _ftype_t** pw, _ftype_t g, unsigned int flags)
{
int l = (int)n/k; /* Length of individual FIR filters */
- int i; /* Counters */
+ int i; /* Counters */
int j;
_ftype_t t; /* g * w[i] */
-
+
/* Sanity check */
if(l<1 || k<1 || !w || !pw)
return -1;
@@ -276,7 +276,7 @@ int design_pfir(unsigned int n, unsigned int k, _ftype_t* w, _ftype_t** pw, _fty
/* Pre-warp the coefficients of a numerator or denominator.
* Note that a0 is assumed to be 1, so there is no wrapping
- * of it.
+ * of it.
*/
void prewarp(_ftype_t* a, _ftype_t fc, _ftype_t fs)
{
@@ -303,12 +303,12 @@ void prewarp(_ftype_t* a, _ftype_t fc, _ftype_t fs)
* Arguments:
* a - s-domain numerator coefficients
* b - s-domain denominator coefficients
- * k - filter gain factor. Initially set to 1 and modified by each
+ * k - filter gain factor. Initially set to 1 and modified by each
* biquad section in such a way, as to make it the
* coefficient by which to multiply the overall filter gain
* in order to achieve a desired overall filter gain,
- * specified in initial value of k.
- * fs - sampling rate (Hz)
+ * specified in initial value of k.
+ * fs - sampling rate (Hz)
* coef - array of z-domain coefficients to be filled in.
*
* Return: On return, set coef z-domain coefficients and k to the gain
@@ -342,7 +342,7 @@ void bilinear(_ftype_t* a, _ftype_t* b, _ftype_t* k, _ftype_t fs, _ftype_t *coef
* create a filter fill in a, b, Q and fs and make space for coef and k.
*
*
- * Example Butterworth design:
+ * Example Butterworth design:
*
* Below are Butterworth polynomials, arranged as a series of 2nd
* order sections:
@@ -398,12 +398,12 @@ void bilinear(_ftype_t* a, _ftype_t* b, _ftype_t* k, _ftype_t fs, _ftype_t *coef
* a - s-domain numerator coefficients, a[1] is always assumed to be 1.0
* b - s-domain denominator coefficients
* Q - Q value for the filter
- * k - filter gain factor. Initially set to 1 and modified by each
+ * k - filter gain factor. Initially set to 1 and modified by each
* biquad section in such a way, as to make it the
* coefficient by which to multiply the overall filter gain
* in order to achieve a desired overall filter gain,
- * specified in initial value of k.
- * fs - sampling rate (Hz)
+ * specified in initial value of k.
+ * fs - sampling rate (Hz)
* coef - array of z-domain coefficients to be filled in.
*
* Note: Upon return from each call, the k argument will be set to a
@@ -419,7 +419,7 @@ int szxform(const _ftype_t* a, const _ftype_t* b, _ftype_t Q, _ftype_t fc, _ftyp
_ftype_t at[3];
_ftype_t bt[3];
- if(!a || !b || !k || !coef || (Q>1000.0 || Q< 1.0))
+ if(!a || !b || !k || !coef || (Q>1000.0 || Q< 1.0))
return -1;
memcpy(at,a,3*sizeof(_ftype_t));
diff --git a/src/post/audio/filter.h b/src/post/audio/filter.h
index 0e08aa2b9..4d756a618 100644
--- a/src/post/audio/filter.h
+++ b/src/post/audio/filter.h
@@ -1,5 +1,5 @@
/*=============================================================================
- *
+ *
* This software has been released under the terms of the GNU Public
* license. See http://www.gnu.org/copyleft/gpl.html for details.
*
@@ -37,7 +37,7 @@
#define WINDOW_MASK 0x0000001F
/* Parallel filter design */
-#define FWD 0x00000001 /* Forward indexing of polyphase filter */
+#define FWD 0x00000001 /* Forward indexing of polyphase filter */
#define REW 0x00000002 /* Reverse indexing of polyphase filter */
#define ODD 0x00000010 /* Make filter HP */
@@ -60,7 +60,7 @@ extern int szxform(const _ftype_t* a, const _ftype_t* b, _ftype_t Q, _ftype_t fc
/* Add new data to circular queue designed to be used with a FIR
* filter. xq is the circular queue, in pointing at the new sample, xi
* current index for xq and n the length of the filter. xq must be n*2
- * long.
+ * long.
*/
#define updateq(n,xi,xq,in)\
xq[xi]=(xq)[(xi)+(n)]=*(in);\
diff --git a/src/post/audio/stretch.c b/src/post/audio/stretch.c
index d4621a800..154202da4 100644
--- a/src/post/audio/stretch.c
+++ b/src/post/audio/stretch.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
@@ -70,19 +70,19 @@ static void stretchscr_set_pivot (stretchscr_t *this) {
struct timeval tv;
int64_t pts;
- double pts_calc;
+ double pts_calc;
xine_monotonic_clock(&tv, NULL);
pts_calc = (tv.tv_sec - this->cur_time.tv_sec) * this->speed_factor;
pts_calc += (tv.tv_usec - this->cur_time.tv_usec) * this->speed_factor / 1e6;
pts = this->cur_pts + pts_calc;
-/* This next part introduces a one off inaccuracy
- * to the scr due to rounding tv to pts.
+/* This next part introduces a one off inaccuracy
+ * to the scr due to rounding tv to pts.
*/
this->cur_time.tv_sec=tv.tv_sec;
this->cur_time.tv_usec=tv.tv_usec;
- this->cur_pts=pts;
+ this->cur_pts=pts;
return ;
}
@@ -94,7 +94,7 @@ static int stretchscr_set_speed (scr_plugin_t *scr, int speed) {
stretchscr_set_pivot( this );
this->xine_speed = speed;
- this->speed_factor = (double) speed * 90000.0 / XINE_FINE_SPEED_NORMAL /
+ this->speed_factor = (double) speed * 90000.0 / XINE_FINE_SPEED_NORMAL /
(*this->stretch_factor);
pthread_mutex_unlock (&this->lock);
@@ -125,7 +125,7 @@ static void stretchscr_start (scr_plugin_t *scr, int64_t start_vpts) {
this->cur_pts = start_vpts;
pthread_mutex_unlock (&this->lock);
-
+
stretchscr_set_speed (&this->scr, XINE_FINE_SPEED_NORMAL);
}
@@ -134,16 +134,16 @@ static int64_t stretchscr_get_current (scr_plugin_t *scr) {
struct timeval tv;
int64_t pts;
- double pts_calc;
+ double pts_calc;
pthread_mutex_lock (&this->lock);
xine_monotonic_clock(&tv, NULL);
-
+
pts_calc = (tv.tv_sec - this->cur_time.tv_sec) * this->speed_factor;
pts_calc += (tv.tv_usec - this->cur_time.tv_usec) * this->speed_factor / 1e6;
pts = this->cur_pts + pts_calc;
-
+
pthread_mutex_unlock (&this->lock);
return pts;
@@ -168,9 +168,9 @@ static stretchscr_t *XINE_MALLOC stretchscr_init (double *stretch_factor) {
this->scr.start = stretchscr_start;
this->scr.get_current = stretchscr_get_current;
this->scr.exit = stretchscr_exit;
-
+
pthread_mutex_init (&this->lock, NULL);
-
+
this->stretch_factor = stretch_factor;
stretchscr_set_speed (&this->scr, XINE_SPEED_PAUSE);
@@ -202,21 +202,21 @@ typedef struct stretch_parameters_s {
START_PARAM_DESCR( stretch_parameters_t )
PARAM_ITEM( POST_PARAM_TYPE_BOOL, preserve_pitch, NULL, 0, 1, 0,
"Preserve pitch" )
-PARAM_ITEM( POST_PARAM_TYPE_DOUBLE, factor, NULL, 0.5, 1.5, 0,
+PARAM_ITEM( POST_PARAM_TYPE_DOUBLE, factor, NULL, 0.5, 1.5, 0,
"Time stretch factor (<1.0 shorten duration)" )
END_PARAM_DESCR( param_descr )
/* plugin structure */
struct post_plugin_stretch_s {
post_plugin_t post;
-
+
stretchscr_t* scr;
/* private data */
stretch_parameters_t params;
xine_post_in_t params_input;
int params_changed;
-
+
int channels;
int bytes_per_frame;
@@ -228,9 +228,9 @@ struct post_plugin_stretch_s {
int num_frames; /* current # of frames on audiofrag */
int16_t last_sample[RESAMPLE_MAX_CHANNELS];
-
+
int64_t pts; /* pts for audiofrag */
-
+
pthread_mutex_t lock;
};
@@ -290,16 +290,16 @@ static int stretch_port_open(xine_audio_port_t *port_gen, xine_stream_t *stream,
post_audio_port_t *port = (post_audio_port_t *)port_gen;
post_plugin_stretch_t *this = (post_plugin_stretch_t *)port->post;
int64_t time;
-
+
_x_post_rewire(&this->post);
_x_post_inc_usage(port);
-
+
port->stream = stream;
port->bits = bits;
port->rate = rate;
port->mode = mode;
-
- /* register our own scr provider */
+
+ /* register our own scr provider */
time = port->stream->xine->clock->get_current_time(port->stream->xine->clock);
this->scr = stretchscr_init(&this->params.factor);
this->scr->scr.start(&this->scr->scr, time);
@@ -307,7 +307,7 @@ static int stretch_port_open(xine_audio_port_t *port_gen, xine_stream_t *stream,
/* force updating on stretch_port_put_buffer */
this->params_changed = 1;
-
+
return (port->original_port->open) (port->original_port, stream, bits, rate, mode);
}
@@ -320,34 +320,34 @@ static void stretch_port_close(xine_audio_port_t *port_gen, xine_stream_t *strea
port->stream->xine->clock->unregister_scr(port->stream->xine->clock, &this->scr->scr);
this->scr->scr.exit(&this->scr->scr);
}
-
+
if(this->audiofrag) {
free(this->audiofrag);
this->audiofrag = NULL;
}
-
+
if(this->outfrag) {
free(this->outfrag);
this->outfrag = NULL;
}
-
+
if(this->w) {
free(this->w);
this->w = NULL;
}
-
+
port->stream = NULL;
port->original_port->close(port->original_port, stream );
-
+
_x_post_dec_usage(port);
}
-static void stretch_process_fragment( post_audio_port_t *port,
+static void stretch_process_fragment( post_audio_port_t *port,
xine_stream_t *stream, extra_info_t *extra_info )
{
post_plugin_stretch_t *this = (post_plugin_stretch_t *)port->post;
-
+
audio_buffer_t *outbuf;
int16_t *data_out = this->outfrag;
int num_frames_in = this->num_frames;
@@ -374,52 +374,52 @@ static void stretch_process_fragment( post_audio_port_t *port,
* input chunk has two halves, A and B.
* output chunk is composed as follow:
* - some frames copied directly from A
- * - some frames copied from A merged with frames from B
+ * - some frames copied from A merged with frames from B
* weighted by an increasing factor (0 -> 1.0)
* - frames from A weighted by a decreasing factor (1.0 -> 0)
* merged with frames copied from B
* - some frames copied directly from B
*/
-
+
int merge_frames = num_frames_in - num_frames_out;
int copy_frames;
int16_t *src = this->audiofrag;
int16_t *dst = this->outfrag;
int i, j;
-
+
if( merge_frames > num_frames_out )
merge_frames = num_frames_out;
copy_frames = num_frames_out - merge_frames;
-
+
memcpy(dst, src, copy_frames/2 * this->bytes_per_frame);
dst += copy_frames/2 * this->channels;
src += copy_frames/2 * this->channels;
-
+
for( i = 0; i < merge_frames/2; i++ )
{
for( j = 0; j < this->channels; j++, src++, dst++ ) {
-
+
int32_t s = (int32_t) ((_ftype_t) src[0] +
src[merge_frames * this->channels] * this->w[i]);
*dst = CLIP_INT16(s);
}
}
-
+
for( ; i < merge_frames; i++ )
{
for( j = 0; j < this->channels; j++, src++, dst++ ) {
-
+
int32_t s = (int32_t) ((_ftype_t) src[0] * this->w[i] +
src[merge_frames * this->channels]);
*dst = CLIP_INT16(s);
}
}
-
+
src += merge_frames * this->channels;
-
+
memcpy(dst, src, (copy_frames - copy_frames/2) *
this->bytes_per_frame);
-
+
} else {
/*
* time expansion strategy
@@ -427,13 +427,13 @@ static void stretch_process_fragment( post_audio_port_t *port,
* output chunk is composed of two versions of the
* input chunk:
* - first part copied directly from input, and then
- * merged with the second (delayed) part using a
+ * merged with the second (delayed) part using a
* decreasing factor (1.0 -> 0)
* - the delayed version of the input is merged with
- * an increasing factor (0 -> 1.0) and then (when
- * factor reaches 1.0) just copied until the end.
+ * an increasing factor (0 -> 1.0) and then (when
+ * factor reaches 1.0) just copied until the end.
*/
-
+
int merge_frames = num_frames_out - num_frames_in;
int copy_frames = num_frames_out - merge_frames;
int16_t *src1 = this->audiofrag;
@@ -449,67 +449,67 @@ static void stretch_process_fragment( post_audio_port_t *port,
for( i = 0; i < merge_frames/2; i++ )
{
for( j = 0; j < this->channels; j++, src1++, src2++, dst++ ) {
-
+
int32_t s = (int32_t) ((_ftype_t) *src1 +
*src2 * this->w[i]);
*dst = CLIP_INT16(s);
}
}
-
+
for( ; i < merge_frames; i++ )
{
for( j = 0; j < this->channels; j++, src1++, src2++, dst++ ) {
-
+
int32_t s = (int32_t) ((_ftype_t) *src1 * this->w[i] +
*src2);
*dst = CLIP_INT16(s);
}
}
-
+
memcpy(dst, src2, (copy_frames - copy_frames/2) *
this->bytes_per_frame);
}
}
-
+
/* copy processed fragment into multiple audio buffers, if needed */
while( num_frames_out ) {
- outbuf = port->original_port->get_buffer(port->original_port);
-
+ outbuf = port->original_port->get_buffer(port->original_port);
+
outbuf->num_frames = outbuf->mem_size / this->bytes_per_frame;
if( outbuf->num_frames > num_frames_out )
outbuf->num_frames = num_frames_out;
-
- memcpy( outbuf->mem, data_out,
+
+ memcpy( outbuf->mem, data_out,
outbuf->num_frames * this->bytes_per_frame );
num_frames_out -= outbuf->num_frames;
data_out = (uint16_t *)((uint8_t *)data_out + outbuf->num_frames * this->bytes_per_frame);
-
+
outbuf->vpts = this->pts;
this->pts = 0;
outbuf->stream = stream;
outbuf->format.bits = port->bits;
outbuf->format.rate = port->rate;
outbuf->format.mode = port->mode;
-
+
_x_extra_info_merge( outbuf->extra_info, extra_info );
-
- port->original_port->put_buffer(port->original_port, outbuf, stream );
+
+ port->original_port->put_buffer(port->original_port, outbuf, stream );
}
-
+
this->num_frames = 0;
}
-static void stretch_port_put_buffer (xine_audio_port_t *port_gen,
+static void stretch_port_put_buffer (xine_audio_port_t *port_gen,
audio_buffer_t *buf, xine_stream_t *stream) {
-
+
post_audio_port_t *port = (post_audio_port_t *)port_gen;
post_plugin_stretch_t *this = (post_plugin_stretch_t *)port->post;
int16_t *data_in;
-
+
pthread_mutex_lock (&this->lock);
-
+
if( this->params_changed ) {
int64_t audio_step;
@@ -517,40 +517,40 @@ static void stretch_port_put_buffer (xine_audio_port_t *port_gen,
/* output whatever we have before changing parameters */
stretch_process_fragment( port, stream, buf->extra_info );
}
-
+
this->channels = _x_ao_mode2channels(port->mode);
this->bytes_per_frame = port->bits / 8 * this->channels;
-
+
audio_step = ((int64_t)90000 * (int64_t)32768) / (int64_t)port->rate;
audio_step = (int64_t) ((double)audio_step / this->params.factor);
stream->metronom->set_audio_rate(stream->metronom, audio_step);
stretchscr_set_speed(&this->scr->scr, this->scr->xine_speed);
-
+
if(this->audiofrag) {
free(this->audiofrag);
this->audiofrag = NULL;
}
-
+
if(this->outfrag) {
free(this->outfrag);
this->outfrag = NULL;
}
-
+
if(this->w) {
free(this->w);
this->w = NULL;
}
-
+
this->frames_per_frag = port->rate * AUDIO_FRAGMENT;
this->frames_per_outfrag = (int) ((double)this->params.factor * this->frames_per_frag);
if( this->frames_per_frag != this->frames_per_outfrag ) {
int wsize;
-
- this->audiofrag = malloc( this->frames_per_frag * this->bytes_per_frame );
- this->outfrag = malloc( this->frames_per_outfrag * this->bytes_per_frame );
-
+
+ this->audiofrag = malloc( this->frames_per_frag * this->bytes_per_frame );
+ this->outfrag = malloc( this->frames_per_outfrag * this->bytes_per_frame );
+
if( this->frames_per_frag > this->frames_per_outfrag )
wsize = this->frames_per_frag - this->frames_per_outfrag;
else
@@ -559,41 +559,41 @@ static void stretch_port_put_buffer (xine_audio_port_t *port_gen,
this->w = (_ftype_t*) malloc( wsize * sizeof(_ftype_t) );
triang(wsize, this->w);
}
-
+
this->num_frames = 0;
this->pts = 0;
-
+
this->params_changed = 0;
}
-
+
pthread_mutex_unlock (&this->lock);
/* just pass data through if we have nothing to do */
if( this->frames_per_frag == this->frames_per_outfrag ||
/* FIXME: we only handle 1 or 2 channels, 16 bits for now */
- (this->channels != 1 && this->channels != 2) ||
+ (this->channels != 1 && this->channels != 2) ||
port->bits != 16 ) {
-
- port->original_port->put_buffer(port->original_port, buf, stream );
-
+
+ port->original_port->put_buffer(port->original_port, buf, stream );
+
return;
}
-
+
/* update pts for our current audio fragment */
if( buf->vpts )
this->pts = buf->vpts - (this->num_frames * 90000 / port->rate);
-
+
data_in = buf->mem;
while( buf->num_frames ) {
int frames_to_copy = this->frames_per_frag - this->num_frames;
-
+
if( frames_to_copy > buf->num_frames )
frames_to_copy = buf->num_frames;
/* copy up to one fragment from input buf to our buffer */
memcpy( (uint8_t *)this->audiofrag + this->num_frames * this->bytes_per_frame,
data_in, frames_to_copy * this->bytes_per_frame );
-
+
data_in = (uint16_t *)((uint8_t *)data_in + frames_to_copy * this->bytes_per_frame);
this->num_frames += frames_to_copy;
buf->num_frames -= frames_to_copy;
@@ -603,10 +603,10 @@ static void stretch_port_put_buffer (xine_audio_port_t *port_gen,
stretch_process_fragment( port, stream, buf->extra_info );
}
}
-
+
buf->num_frames=0; /* UNDOCUMENTED, but hey, it works! Force old audio_out buffer free. */
- port->original_port->put_buffer(port->original_port, buf, stream );
-
+ port->original_port->put_buffer(port->original_port, buf, stream );
+
return;
}
@@ -630,21 +630,21 @@ static post_plugin_t *stretch_open_plugin(post_class_t *class_gen, int inputs,
xine_post_in_t *input_api;
post_audio_port_t *port;
stretch_parameters_t init_params;
-
+
if (!this || !audio_target || !audio_target[0] ) {
free(this);
return NULL;
}
-
+
_x_post_init(&this->post, 1, 0);
init_params.preserve_pitch = 1;
init_params.factor = 0.80;
-
+
pthread_mutex_init (&this->lock, NULL);
set_parameters ((xine_post_t *)&this->post, &init_params);
-
+
port = _x_post_intercept_audio_port(&this->post, audio_target[0], &input, &output);
port->new_port.open = stretch_port_open;
port->new_port.close = stretch_port_close;
@@ -682,16 +682,16 @@ static void stretch_class_dispose(post_class_t *class_gen)
void *stretch_init_plugin(xine_t *xine, void *data)
{
post_class_stretch_t *class = (post_class_stretch_t *)malloc(sizeof(post_class_stretch_t));
-
+
if (!class)
return NULL;
-
+
class->post_class.open_plugin = stretch_open_plugin;
class->post_class.get_identifier = stretch_get_identifier;
class->post_class.get_description = stretch_get_description;
class->post_class.dispose = stretch_class_dispose;
-
+
class->xine = xine;
-
+
return class;
}
diff --git a/src/post/audio/upmix.c b/src/post/audio/upmix.c
index e753f4a2a..9cf68b365 100644
--- a/src/post/audio/upmix.c
+++ b/src/post/audio/upmix.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
@@ -167,13 +167,13 @@ static int upmix_port_open(xine_audio_port_t *port_gen, xine_stream_t *stream,
_x_post_rewire(&this->post);
_x_post_inc_usage(port);
-
+
port->stream = stream;
port->bits = bits;
port->rate = rate;
port->mode = mode;
capabilities = port->original_port->get_capabilities(port->original_port);
-
+
this->channels = _x_ao_mode2channels(mode);
/* FIXME: Handle all desired output formats */
if ((capabilities & AO_CAP_MODE_5_1CHANNEL) && (capabilities & AO_CAP_FLOAT32)) {
@@ -232,7 +232,7 @@ static int upmix_frames_2to51_any_to_float( uint8_t *dst8, uint8_t *src8, int nu
float right;
float sum;
int frame;
- int src_units_per_sample=1;
+ int src_units_per_sample=1;
if (step_channel_in == 3) src_units_per_sample=step_channel_in; /* Special handling for 24 bit 3byte input */
for (frame=0;frame < num_frames; frame++) {
@@ -297,9 +297,9 @@ static int upmix_frames_2to51_any_to_float( uint8_t *dst8, uint8_t *src8, int nu
return frame;
}
-static void upmix_port_put_buffer (xine_audio_port_t *port_gen,
+static void upmix_port_put_buffer (xine_audio_port_t *port_gen,
audio_buffer_t *buf, xine_stream_t *stream) {
-
+
post_audio_port_t *port = (post_audio_port_t *)port_gen;
post_plugin_upmix_t *this = (post_plugin_upmix_t *)port->post;
int src_step_frame;
@@ -315,7 +315,7 @@ static void upmix_port_put_buffer (xine_audio_port_t *port_gen,
if ((this->channels==2) && (this->channels_out==6)) {
while (num_frames_processed < buf->num_frames) {
- this->buf = port->original_port->get_buffer(port->original_port);
+ this->buf = port->original_port->get_buffer(port->original_port);
/* this->buf->num_frames is handled after the upmix */
this->buf->vpts = buf->vpts;
if (num_frames_processed != 0) this->buf->vpts = 0;
@@ -327,7 +327,7 @@ static void upmix_port_put_buffer (xine_audio_port_t *port_gen,
this->buf->format.bits = 32; /* Upmix to floats */
this->buf->format.rate = port->rate;
this->buf->format.mode = AO_CAP_MODE_5_1CHANNEL;
- _x_extra_info_merge( this->buf->extra_info, buf->extra_info);
+ _x_extra_info_merge( this->buf->extra_info, buf->extra_info);
step_channel_in = port->bits>>3;
step_channel_out = this->buf->format.bits>>3;
dst_step_frame = this->channels_out*step_channel_out;
@@ -353,18 +353,18 @@ static void upmix_port_put_buffer (xine_audio_port_t *port_gen,
}
}
pthread_mutex_unlock (&this->lock);
-
+
num_frames_done = upmix_frames_2to51_any_to_float(data8dst, data8src, num_frames, step_channel_in, this->sub);
this->buf->num_frames = num_frames_done;
num_frames_processed+= num_frames_done;
/* pass data to original port */
- port->original_port->put_buffer(port->original_port, this->buf, stream );
+ port->original_port->put_buffer(port->original_port, this->buf, stream );
}
/* free data from origial buffer */
buf->num_frames=0; /* UNDOCUMENTED, but hey, it works! Force old audio_out buffer free. */
}
- port->original_port->put_buffer(port->original_port, buf, stream );
-
+ port->original_port->put_buffer(port->original_port, buf, stream );
+
return;
}
@@ -388,16 +388,16 @@ static post_plugin_t *upmix_open_plugin(post_class_t *class_gen, int inputs,
post_out_t *output;
xine_post_in_t *input_api;
post_audio_port_t *port;
-
+
if (!this || !audio_target || !audio_target[0] ) {
free(this);
return NULL;
}
-
+
_x_post_init(&this->post, 1, 0);
this->params.cut_off_freq = 100;
-
+
port = _x_post_intercept_audio_port(&this->post, audio_target[0], &input, &output);
port->new_port.open = upmix_port_open;
#if 0
@@ -437,16 +437,16 @@ static void upmix_class_dispose(post_class_t *class_gen)
void *upmix_init_plugin(xine_t *xine, void *data)
{
post_class_upmix_t *class = (post_class_upmix_t *)malloc(sizeof(post_class_upmix_t));
-
+
if (!class)
return NULL;
-
+
class->post_class.open_plugin = upmix_open_plugin;
class->post_class.get_identifier = upmix_get_identifier;
class->post_class.get_description = upmix_get_description;
class->post_class.dispose = upmix_class_dispose;
-
+
class->xine = xine;
-
+
return class;
}
diff --git a/src/post/audio/upmix_mono.c b/src/post/audio/upmix_mono.c
index 52b5f497b..43fe3df0d 100644
--- a/src/post/audio/upmix_mono.c
+++ b/src/post/audio/upmix_mono.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
@@ -68,11 +68,11 @@ struct post_plugin_upmix_mono_s {
/* private data */
int channels;
-
+
upmix_mono_parameters_t params;
xine_post_in_t params_input;
int params_changed;
-
+
pthread_mutex_t lock;
};
@@ -134,7 +134,7 @@ static int upmix_mono_port_open(xine_audio_port_t *port_gen, xine_stream_t *stre
_x_post_rewire(&this->post);
_x_post_inc_usage(port);
-
+
port->stream = stream;
port->bits = bits;
port->rate = rate;
@@ -142,7 +142,7 @@ static int upmix_mono_port_open(xine_audio_port_t *port_gen, xine_stream_t *stre
this->channels = _x_ao_mode2channels(mode);
capabilities = port->original_port->get_capabilities(port->original_port);
-
+
if (this->channels == 1 && (capabilities & AO_CAP_MODE_STEREO)) {
xprintf(stream->xine, XINE_VERBOSITY_LOG,
_(LOG_MODULE ": upmixing Mono to Stereo.\n"));
@@ -151,7 +151,7 @@ static int upmix_mono_port_open(xine_audio_port_t *port_gen, xine_stream_t *stre
if ( this->channels != 1)
xprintf(stream->xine, XINE_VERBOSITY_LOG,
ngettext(LOG_MODULE ": upmixing a single channel from original %d channel stream.\n",
- LOG_MODULE ": upmixing a single channel from original %d channels stream.\n",
+ LOG_MODULE ": upmixing a single channel from original %d channels stream.\n",
this->channels), this->channels);
else {
xprintf(stream->xine, XINE_VERBOSITY_LOG,
@@ -163,15 +163,15 @@ static int upmix_mono_port_open(xine_audio_port_t *port_gen, xine_stream_t *stre
return (port->original_port->open) (port->original_port, stream, bits, rate, mode);
}
-static void upmix_mono_port_put_buffer(xine_audio_port_t *port_gen,
+static void upmix_mono_port_put_buffer(xine_audio_port_t *port_gen,
audio_buffer_t *buf, xine_stream_t *stream) {
-
+
post_audio_port_t *port = (post_audio_port_t *)port_gen;
post_plugin_upmix_mono_t *this = (post_plugin_upmix_mono_t *)port->post;
-
+
pthread_mutex_lock (&this->lock);
- if (this->channels == 1)
+ if (this->channels == 1)
{
audio_buffer_t *buf0 = port->original_port->get_buffer(port->original_port);
audio_buffer_t *buf1 = port->original_port->get_buffer(port->original_port);
@@ -232,7 +232,7 @@ static void upmix_mono_port_put_buffer(xine_audio_port_t *port_gen,
/* free data from origial buffer */
buf->num_frames = 0; /* UNDOCUMENTED, but hey, it works! Force old audio_out buffer free. */
}
- else if (this->channels && this->params.channel >= 0)
+ else if (this->channels && this->params.channel >= 0)
{
audio_buffer_t *buf0 = port->original_port->get_buffer(port->original_port);
buf0->num_frames = buf->num_frames;
@@ -253,12 +253,12 @@ static void upmix_mono_port_put_buffer(xine_audio_port_t *port_gen,
uint8_t *dst0 = (uint8_t *)buf0->mem;
int cur_channel = this->params.channel;
int i, j;
-
+
if( cur_channel >= this->channels )
cur_channel = this->channels-1;
src += cur_channel * step;
-
+
for (i = 0; i < buf->num_frames; i++)
{
for (j = 0; j < this->channels; j++ )
@@ -276,11 +276,11 @@ static void upmix_mono_port_put_buffer(xine_audio_port_t *port_gen,
/* free data from origial buffer */
buf->num_frames = 0; /* UNDOCUMENTED, but hey, it works! Force old audio_out buffer free. */
}
-
+
pthread_mutex_unlock (&this->lock);
-
+
port->original_port->put_buffer(port->original_port, buf, stream);
-
+
return;
}
@@ -303,24 +303,24 @@ static post_plugin_t *upmix_mono_open_plugin(post_class_t *class_gen, int inputs
xine_post_in_t *input_api;
post_audio_port_t *port;
upmix_mono_parameters_t init_params;
-
+
if (!this || !audio_target || !audio_target[0]) {
free(this);
return NULL;
}
-
+
_x_post_init(&this->post, 1, 0);
init_params.channel = -1;
-
+
pthread_mutex_init (&this->lock, NULL);
set_parameters ((xine_post_t *)&this->post, &init_params);
-
+
port = _x_post_intercept_audio_port(&this->post, audio_target[0], &input, &output);
port->new_port.open = upmix_mono_port_open;
port->new_port.put_buffer = upmix_mono_port_put_buffer;
-
+
input_api = &this->params_input;
input_api->name = "parameters";
input_api->type = XINE_POST_DATA_PARAMETERS;
@@ -352,17 +352,17 @@ static void upmix_mono_class_dispose(post_class_t *class_gen)
void *upmix_mono_init_plugin(xine_t *xine, void *data)
{
post_class_upmix_mono_t *class = (post_class_upmix_mono_t *)malloc(sizeof(post_class_upmix_mono_t));
-
+
if (!class)
return NULL;
-
+
class->post_class.open_plugin = upmix_mono_open_plugin;
class->post_class.get_identifier = upmix_mono_get_identifier;
class->post_class.get_description = upmix_mono_get_description;
class->post_class.dispose = upmix_mono_class_dispose;
-
+
class->xine = xine;
-
+
return class;
}
diff --git a/src/post/audio/volnorm.c b/src/post/audio/volnorm.c
index 158705ef7..945fd2505 100644
--- a/src/post/audio/volnorm.c
+++ b/src/post/audio/volnorm.c
@@ -1,24 +1,24 @@
/*
* 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
*
* Volume normalization audio filter for xine. Ported by Jason Tackaberry
- * from MPlayer's af_volnorm, which is copyright 2004 by Alex Beregszaszi
+ * from MPlayer's af_volnorm, which is copyright 2004 by Alex Beregszaszi
* & Pierre Lombard.
*/
@@ -117,7 +117,7 @@ struct post_plugin_volnorm_s {
/**************************************************************************
* volnorm parameters functions
*************************************************************************/
-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_volnorm_t *this = (post_plugin_volnorm_t *)this_gen;
volnorm_parameters_t *param = (volnorm_parameters_t *)param_gen;
@@ -129,7 +129,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_volnorm_t *this = (post_plugin_volnorm_t *)this_gen;
volnorm_parameters_t *param = (volnorm_parameters_t *)param_gen;
@@ -141,12 +141,12 @@ static int get_parameters (xine_post_t *this_gen, void *param_gen)
return 1;
}
-static xine_post_api_descr_t * get_param_descr (void)
+static xine_post_api_descr_t * get_param_descr (void)
{
return &param_descr;
}
-static char * get_help (void)
+static char * get_help (void)
{
return _("Normalizes audio by maximizing the volume without distorting "
"the sound.\n"
@@ -172,14 +172,14 @@ static xine_post_api_t post_api = {
*************************************************************************/
static int volnorm_port_open(xine_audio_port_t *port_gen, xine_stream_t *stream,
- uint32_t bits, uint32_t rate, int mode)
+ uint32_t bits, uint32_t rate, int mode)
{
post_audio_port_t *port = (post_audio_port_t *)port_gen;
post_plugin_volnorm_t *this = (post_plugin_volnorm_t *)port->post;
_x_post_rewire(&this->post);
_x_post_inc_usage(port);
-
+
port->stream = stream;
port->bits = bits;
port->rate = rate;
@@ -373,10 +373,10 @@ static void method2_float(post_plugin_volnorm_t *this, audio_buffer_t *buf)
}
-static void volnorm_port_put_buffer (xine_audio_port_t *port_gen,
- audio_buffer_t *buf, xine_stream_t *stream)
+static void volnorm_port_put_buffer (xine_audio_port_t *port_gen,
+ audio_buffer_t *buf, xine_stream_t *stream)
{
-
+
post_audio_port_t *port = (post_audio_port_t *)port_gen;
post_plugin_volnorm_t *this = (post_plugin_volnorm_t *)port->post;
@@ -391,8 +391,8 @@ static void volnorm_port_put_buffer (xine_audio_port_t *port_gen,
else if (buf->format.bits == 32)
method2_float(this, buf);
}
- port->original_port->put_buffer(port->original_port, buf, stream );
-
+ port->original_port->put_buffer(port->original_port, buf, stream );
+
return;
}
@@ -416,12 +416,12 @@ static post_plugin_t *volnorm_open_plugin(post_class_t *class_gen, int inputs,
post_out_t *output;
xine_post_in_t *input_api;
post_audio_port_t *port;
-
+
if (!this || !audio_target || !audio_target[0] ) {
free(this);
return NULL;
}
-
+
_x_post_init(&this->post, 1, 0);
pthread_mutex_init (&this->lock, NULL);
@@ -468,16 +468,16 @@ static void volnorm_class_dispose(post_class_t *class_gen)
void *volnorm_init_plugin(xine_t *xine, void *data)
{
post_class_volnorm_t *class = (post_class_volnorm_t *)malloc(sizeof(post_class_volnorm_t));
-
+
if (!class)
return NULL;
-
+
class->post_class.open_plugin = volnorm_open_plugin;
class->post_class.get_identifier = volnorm_get_identifier;
class->post_class.get_description = volnorm_get_description;
class->post_class.dispose = volnorm_class_dispose;
-
+
class->xine = xine;
-
+
return class;
}
diff --git a/src/post/audio/window.c b/src/post/audio/window.c
index fdea90590..ca58152d5 100644
--- a/src/post/audio/window.c
+++ b/src/post/audio/window.c
@@ -1,5 +1,5 @@
/*=============================================================================
- *
+ *
* This software has been released under the terms of the GNU Public
* license. See http://www.gnu.org/copyleft/gpl.html for details.
*
@@ -39,7 +39,7 @@ void boxcar(int n, _ftype_t* w)
/*
* Triang a.k.a Bartlett
*
- * | (N-1)|
+ * | (N-1)|
* 2 * |k - -----|
* | 2 |
* w = 1.0 - ---------------
@@ -53,7 +53,7 @@ void triang(int n, _ftype_t* w)
_ftype_t k2 = 1/((_ftype_t)n + k1);
int end = (n + 1) >> 1;
int i;
-
+
/* Calculate window coefficients */
for (i=0 ; i<end ; i++)
w[i] = w[n-i-1] = (2.0*((_ftype_t)(i+1))-(1.0-k1))*k2;
@@ -72,7 +72,7 @@ void hanning(int n, _ftype_t* w)
{
int i;
_ftype_t k = 2*M_PI/((_ftype_t)(n+1)); /* 2*pi/(N+1) */
-
+
/* Calculate window coefficients */
for (i=0; i<n; i++)
*w++ = 0.5*(1.0 - cos(k*(_ftype_t)(i+1)));
@@ -131,22 +131,22 @@ void flattop(int n,_ftype_t* w)
int i;
_ftype_t k1 = 2*M_PI/((_ftype_t)(n-1)); /* 2*pi/(N-1) */
_ftype_t k2 = 2*k1; /* 4*pi/(N-1) */
-
+
/* Calculate window coefficients */
for (i=0; i<n; i++)
*w++ = 0.2810638602 - 0.5208971735*cos(k1*(_ftype_t)i) + 0.1980389663*cos(k2*(_ftype_t)i);
}
-/* Computes the 0th order modified Bessel function of the first kind.
- * (Needed to compute Kaiser window)
- *
+/* Computes the 0th order modified Bessel function of the first kind.
+ * (Needed to compute Kaiser window)
+ *
* y = sum( (x/(2*n))^2 )
* n
*/
#define BIZ_EPSILON 1E-21 /* Max error acceptable */
static _ftype_t besselizero(_ftype_t x)
-{
+{
_ftype_t temp;
_ftype_t sum = 1.0;
_ftype_t u = 1.0;
@@ -175,10 +175,10 @@ static _ftype_t besselizero(_ftype_t x)
* Gold (Theory and Application of DSP) under Kaiser windows for more
* about Beta. The following table from Rabiner and Gold gives some
* feel for the effect of Beta:
- *
+ *
* All ripples in dB, width of transition band = D*N where N = window
* length
- *
+ *
* BETA D PB RIP SB RIP
* 2.120 1.50 +-0.27 -30
* 3.384 2.23 0.0864 -40
@@ -195,8 +195,8 @@ void kaiser(int n, _ftype_t* w, _ftype_t b)
_ftype_t k1 = 1.0/besselizero(b);
int k2 = 1 - (n & 1);
int end = (n + 1) >> 1;
- int i;
-
+ int i;
+
/* Calculate window coefficients */
for (i=0 ; i<end ; i++){
tmp = (_ftype_t)(2*i + k2) / ((_ftype_t)n - 1.0);
diff --git a/src/post/audio/window.h b/src/post/audio/window.h
index d0a7446eb..638707809 100644
--- a/src/post/audio/window.h
+++ b/src/post/audio/window.h
@@ -1,5 +1,5 @@
/*=============================================================================
- *
+ *
* This software has been released under the terms of the GNU Public
* license. See http://www.gnu.org/copyleft/gpl.html for details.
*
diff --git a/src/post/deinterlace/Makefile.am b/src/post/deinterlace/Makefile.am
index bac6bac33..bf5b281a8 100644
--- a/src/post/deinterlace/Makefile.am
+++ b/src/post/deinterlace/Makefile.am
@@ -3,12 +3,12 @@ include $(top_srcdir)/misc/Makefile.common
SUBDIRS = plugins
-EXTRA_DIST =
+EXTRA_DIST =
xinepost_LTLIBRARIES = xineplug_post_tvtime.la
xineplug_post_tvtime_la_SOURCES = xine_plugin.c \
- deinterlace.c pulldown.c speedy.c tvtime.c
+ deinterlace.c pulldown.c speedy.c tvtime.c
xineplug_post_tvtime_la_LIBADD = $(XINE_LIB) $(LTLIBINTL) $(PTHREAD_LIBS) \
$(top_builddir)/src/post/deinterlace/plugins/libdeinterlaceplugins.la
diff --git a/src/post/deinterlace/plugins/greedy.c b/src/post/deinterlace/plugins/greedy.c
index b5fcad3e5..925779224 100644
--- a/src/post/deinterlace/plugins/greedy.c
+++ b/src/post/deinterlace/plugins/greedy.c
@@ -48,7 +48,7 @@
// upon which give the smaller comb factor, and then clip to avoid large damage
// when wrong.
//
-// I'd intended this to be part of a larger more elaborate method added to
+// I'd intended this to be part of a larger more elaborate method added to
// Blended Clip but this give too good results for the CPU to ignore here.
static void copy_scanline( uint8_t *output,
@@ -134,7 +134,7 @@ static void deinterlace_greedy_packed422_scanline_mmxext( uint8_t *output,
paddusb_r2r( mm3, mm2 ); // now = Max(L1,L3)
pcmpeqb_r2r( mm7, mm7 ); // all ffffffff
- psubusb_r2r( mm1, mm7 ); // - L1
+ psubusb_r2r( mm1, mm7 ); // - L1
paddusb_r2r( mm7, mm3 ); // add, may sat at fff..
psubusb_r2r( mm7, mm3 ); // now = Min(L1,L3)
@@ -146,7 +146,7 @@ static void deinterlace_greedy_packed422_scanline_mmxext( uint8_t *output,
paddusb_r2r( mm3, mm4 ); // now = Max(best,Min(L1,L3)
pcmpeqb_r2r( mm7, mm7 ); // all ffffffff
- psubusb_r2r( mm4, mm7 ); // - Max(best,Min(best,L3)
+ psubusb_r2r( mm4, mm7 ); // - Max(best,Min(best,L3)
paddusb_r2r( mm7, mm2 ); // add may sat at FFF..
psubusb_r2r( mm7, mm2 ); // now = Min( Max(best, Min(L1,L3), L2 )=L2 clipped
diff --git a/src/post/deinterlace/plugins/greedy2frame_template.c b/src/post/deinterlace/plugins/greedy2frame_template.c
index 1067e2cb8..7fe52519f 100644
--- a/src/post/deinterlace/plugins/greedy2frame_template.c
+++ b/src/post/deinterlace/plugins/greedy2frame_template.c
@@ -79,9 +79,9 @@
/****************************************************************************
** Field 1 | Field 2 | Field 3 | Field 4 |
-** T0 | | T1 | |
-** | M0 | | M1 |
-** B0 | | B1 | |
+** T0 | | T1 | |
+** | M0 | | M1 |
+** B0 | | B1 | |
*/
@@ -95,15 +95,15 @@
#define MASKS_DEFINED
static const int64_t __attribute__((__used__)) YMask = 0x00ff00ff00ff00ffll;
static const int64_t __attribute__((__used__)) Mask = 0x7f7f7f7f7f7f7f7fll;
- static const int64_t __attribute__((__used__)) DwordOne = 0x0000000100000001ll;
- static const int64_t __attribute__((__used__)) DwordTwo = 0x0000000200000002ll;
+ static const int64_t __attribute__((__used__)) DwordOne = 0x0000000100000001ll;
+ static const int64_t __attribute__((__used__)) DwordTwo = 0x0000000200000002ll;
static int64_t qwGreedyTwoFrameThreshold;
#endif
#include <mangle.h>
#if defined(IS_SSE)
-static void DeinterlaceGreedy2Frame_SSE(uint8_t *output, int outstride,
+static void DeinterlaceGreedy2Frame_SSE(uint8_t *output, int outstride,
deinterlace_frame_data_t *data,
int bottom_field, int second_field, int width, int height )
#elif defined(IS_3DNOW)
@@ -135,7 +135,7 @@ static void DeinterlaceGreedy2Frame_MMX(uint8_t *output, int outstride,
qwGreedyTwoFrameThreshold = GreedyTwoFrameThreshold;
qwGreedyTwoFrameThreshold += (GreedyTwoFrameThreshold2 << 8);
qwGreedyTwoFrameThreshold += (qwGreedyTwoFrameThreshold << 48) +
- (qwGreedyTwoFrameThreshold << 32) +
+ (qwGreedyTwoFrameThreshold << 32) +
(qwGreedyTwoFrameThreshold << 16);
@@ -150,7 +150,7 @@ static void DeinterlaceGreedy2Frame_MMX(uint8_t *output, int outstride,
M0 = data->f1;
T0 = data->f2;
}
-
+
if( bottom_field ) {
M1 += stride;
T1 += 0;
@@ -194,9 +194,9 @@ static void DeinterlaceGreedy2Frame_MMX(uint8_t *output, int outstride,
"movq %2, %%mm3 \n\t" // B1
"movq %3, %%mm2 \n\t" // M0
: /* no output */
- : "m" (*T1), "m" (*M1),
+ : "m" (*T1), "m" (*M1),
"m" (*B1), "m" (*M0), "m" (Mask) );
-
+
asm volatile(
/* Figure out what to do with the scanline above the one we just copied.
@@ -271,7 +271,7 @@ static void DeinterlaceGreedy2Frame_MMX(uint8_t *output, int outstride,
"pcmpgtb %3, %%mm5 \n\t"
"pand %%mm6, %%mm5 \n\t" /* get rid of sign bit */
- "pcmpgtd %5, %%mm5 \n\t"
+ "pcmpgtd %5, %%mm5 \n\t"
"pandn %5, %%mm5 \n\t"
"paddd %%mm5, %%mm4 \n\t"
@@ -307,9 +307,9 @@ static void DeinterlaceGreedy2Frame_MMX(uint8_t *output, int outstride,
"movq %%mm4, %%mm5 \n\t"
/* mm4 now is 1 where we want to weave and 0 where we want to bob */
- "pand %%mm0, %%mm4 \n\t"
- "pandn %%mm7, %%mm5 \n\t"
- "por %%mm5, %%mm4 \n\t"
+ "pand %%mm0, %%mm4 \n\t"
+ "pandn %%mm7, %%mm5 \n\t"
+ "por %%mm5, %%mm4 \n\t"
#ifdef IS_SSE
"movntq %%mm4, %0 \n\t"
#else
@@ -353,9 +353,9 @@ static void DeinterlaceGreedy2Frame_MMX(uint8_t *output, int outstride,
}
else
{
- xine_fast_memcpy(Dest, T1, stride);
+ xine_fast_memcpy(Dest, T1, stride);
}
-
+
/* clear out the MMX registers ready for doing floating point again */
asm("emms\n\t");
#endif
diff --git a/src/post/deinterlace/plugins/greedyhmacros.h b/src/post/deinterlace/plugins/greedyhmacros.h
index 5f65959c3..fd1eb2068 100644
--- a/src/post/deinterlace/plugins/greedyhmacros.h
+++ b/src/post/deinterlace/plugins/greedyhmacros.h
@@ -15,7 +15,7 @@
//
/////////////////////////////////////////////////////////////////////////////
-// Define a few macros for CPU dependent instructions.
+// Define a few macros for CPU dependent instructions.
// I suspect I don't really understand how the C macro preprocessor works but
// this seems to get the job done. // TRB 7/01
@@ -35,9 +35,9 @@
"paddusb "mmrw", "mmr1"\n\t"
#define V_PAVGB_SSE(mmr1, mmr2, mmrw, smask) "pavgb "mmr2", "mmr1"\n\t"
#define V_PAVGB_3DNOW(mmr1, mmr2, mmrw, smask) "pavgusb "mmr2", "mmr1"\n\t"
-#define V_PAVGB(mmr1, mmr2, mmrw, smask) V_PAVGB2(mmr1, mmr2, mmrw, smask, SSE_TYPE)
-#define V_PAVGB2(mmr1, mmr2, mmrw, smask, ssetyp) V_PAVGB3(mmr1, mmr2, mmrw, smask, ssetyp)
-#define V_PAVGB3(mmr1, mmr2, mmrw, smask, ssetyp) V_PAVGB_##ssetyp(mmr1, mmr2, mmrw, smask)
+#define V_PAVGB(mmr1, mmr2, mmrw, smask) V_PAVGB2(mmr1, mmr2, mmrw, smask, SSE_TYPE)
+#define V_PAVGB2(mmr1, mmr2, mmrw, smask, ssetyp) V_PAVGB3(mmr1, mmr2, mmrw, smask, ssetyp)
+#define V_PAVGB3(mmr1, mmr2, mmrw, smask, ssetyp) V_PAVGB_##ssetyp(mmr1, mmr2, mmrw, smask)
// some macros for pmaxub instruction
#define V_PMAXUB_MMX(mmr1, mmr2) \
@@ -45,9 +45,9 @@
"paddusb "mmr2", "mmr1"\n\t"
#define V_PMAXUB_SSE(mmr1, mmr2) "pmaxub "mmr2", "mmr1"\n\t"
#define V_PMAXUB_3DNOW(mmr1, mmr2) V_PMAXUB_MMX(mmr1, mmr2) // use MMX version
-#define V_PMAXUB(mmr1, mmr2) V_PMAXUB2(mmr1, mmr2, SSE_TYPE)
-#define V_PMAXUB2(mmr1, mmr2, ssetyp) V_PMAXUB3(mmr1, mmr2, ssetyp)
-#define V_PMAXUB3(mmr1, mmr2, ssetyp) V_PMAXUB_##ssetyp(mmr1, mmr2)
+#define V_PMAXUB(mmr1, mmr2) V_PMAXUB2(mmr1, mmr2, SSE_TYPE)
+#define V_PMAXUB2(mmr1, mmr2, ssetyp) V_PMAXUB3(mmr1, mmr2, ssetyp)
+#define V_PMAXUB3(mmr1, mmr2, ssetyp) V_PMAXUB_##ssetyp(mmr1, mmr2)
// some macros for pminub instruction
// V_PMINUB(mmr1, mmr2, mmr work register) mmr2 may NOT = mmrw
@@ -58,17 +58,17 @@
"psubusb "mmrw", "mmr1"\n\t"
#define V_PMINUB_SSE(mmr1, mmr2, mmrw) "pminub "mmr2", "mmr1"\n\t"
#define V_PMINUB_3DNOW(mmr1, mmr2, mmrw) V_PMINUB_MMX(mmr1, mmr2, mmrw) // use MMX version
-#define V_PMINUB(mmr1, mmr2, mmrw) V_PMINUB2(mmr1, mmr2, mmrw, SSE_TYPE)
-#define V_PMINUB2(mmr1, mmr2, mmrw, ssetyp) V_PMINUB3(mmr1, mmr2, mmrw, ssetyp)
-#define V_PMINUB3(mmr1, mmr2, mmrw, ssetyp) V_PMINUB_##ssetyp(mmr1, mmr2, mmrw)
+#define V_PMINUB(mmr1, mmr2, mmrw) V_PMINUB2(mmr1, mmr2, mmrw, SSE_TYPE)
+#define V_PMINUB2(mmr1, mmr2, mmrw, ssetyp) V_PMINUB3(mmr1, mmr2, mmrw, ssetyp)
+#define V_PMINUB3(mmr1, mmr2, mmrw, ssetyp) V_PMINUB_##ssetyp(mmr1, mmr2, mmrw)
// some macros for movntq instruction
-// V_MOVNTQ(mmr1, mmr2)
+// V_MOVNTQ(mmr1, mmr2)
#define V_MOVNTQ_MMX(mmr1, mmr2) "movq "mmr2", "mmr1"\n\t"
#define V_MOVNTQ_3DNOW(mmr1, mmr2) "movq "mmr2", "mmr1"\n\t"
#define V_MOVNTQ_SSE(mmr1, mmr2) "movntq "mmr2", "mmr1"\n\t"
-#define V_MOVNTQ(mmr1, mmr2) V_MOVNTQ2(mmr1, mmr2, SSE_TYPE)
-#define V_MOVNTQ2(mmr1, mmr2, ssetyp) V_MOVNTQ3(mmr1, mmr2, ssetyp)
+#define V_MOVNTQ(mmr1, mmr2) V_MOVNTQ2(mmr1, mmr2, SSE_TYPE)
+#define V_MOVNTQ2(mmr1, mmr2, ssetyp) V_MOVNTQ3(mmr1, mmr2, ssetyp)
#define V_MOVNTQ3(mmr1, mmr2, ssetyp) V_MOVNTQ_##ssetyp(mmr1, mmr2)
// end of macros
diff --git a/src/post/deinterlace/plugins/linearblend.c b/src/post/deinterlace/plugins/linearblend.c
index 96e56063f..c594f41dd 100644
--- a/src/post/deinterlace/plugins/linearblend.c
+++ b/src/post/deinterlace/plugins/linearblend.c
@@ -254,7 +254,7 @@ static void deinterlace_scanline_linear_blend2_mmxext( uint8_t *output,
uint8_t *b1 = data->b1;
int i;
-
+
READ_PREFETCH_2048( t1 );
READ_PREFETCH_2048( b1 );
READ_PREFETCH_2048( m0 );
diff --git a/src/post/deinterlace/plugins/tomsmocomp/tomsmocompmacros.h b/src/post/deinterlace/plugins/tomsmocomp/tomsmocompmacros.h
index a0136fd44..875ed7055 100644
--- a/src/post/deinterlace/plugins/tomsmocomp/tomsmocompmacros.h
+++ b/src/post/deinterlace/plugins/tomsmocomp/tomsmocompmacros.h
@@ -8,7 +8,7 @@
#define MyMemCopy xine_fast_memcpy
-// Define a few macros for CPU dependent instructions.
+// Define a few macros for CPU dependent instructions.
// I suspect I don't really understand how the C macro preprocessor works but
// this seems to get the job done. // TRB 7/01
@@ -28,9 +28,9 @@
"paddusb "mmrw", "mmr1"\n\t"
#define V_PAVGB_SSE(mmr1, mmr2, mmrw, smask) "pavgb "mmr2", "mmr1"\n\t"
#define V_PAVGB_3DNOW(mmr1, mmr2, mmrw, smask) "pavgusb "mmr2", "mmr1"\n\t"
-#define V_PAVGB(mmr1, mmr2, mmrw, smask) V_PAVGB2(mmr1, mmr2, mmrw, smask, SSE_TYPE)
-#define V_PAVGB2(mmr1, mmr2, mmrw, smask, ssetyp) V_PAVGB3(mmr1, mmr2, mmrw, smask, ssetyp)
-#define V_PAVGB3(mmr1, mmr2, mmrw, smask, ssetyp) V_PAVGB_##ssetyp(mmr1, mmr2, mmrw, smask)
+#define V_PAVGB(mmr1, mmr2, mmrw, smask) V_PAVGB2(mmr1, mmr2, mmrw, smask, SSE_TYPE)
+#define V_PAVGB2(mmr1, mmr2, mmrw, smask, ssetyp) V_PAVGB3(mmr1, mmr2, mmrw, smask, ssetyp)
+#define V_PAVGB3(mmr1, mmr2, mmrw, smask, ssetyp) V_PAVGB_##ssetyp(mmr1, mmr2, mmrw, smask)
// some macros for pmaxub instruction
#define V_PMAXUB_MMX(mmr1, mmr2) \
@@ -38,9 +38,9 @@
"paddusb "mmr2", "mmr1"\n\t"
#define V_PMAXUB_SSE(mmr1, mmr2) "pmaxub "mmr2", "mmr1"\n\t"
#define V_PMAXUB_3DNOW(mmr1, mmr2) V_PMAXUB_MMX(mmr1, mmr2) // use MMX version
-#define V_PMAXUB(mmr1, mmr2) V_PMAXUB2(mmr1, mmr2, SSE_TYPE)
-#define V_PMAXUB2(mmr1, mmr2, ssetyp) V_PMAXUB3(mmr1, mmr2, ssetyp)
-#define V_PMAXUB3(mmr1, mmr2, ssetyp) V_PMAXUB_##ssetyp(mmr1, mmr2)
+#define V_PMAXUB(mmr1, mmr2) V_PMAXUB2(mmr1, mmr2, SSE_TYPE)
+#define V_PMAXUB2(mmr1, mmr2, ssetyp) V_PMAXUB3(mmr1, mmr2, ssetyp)
+#define V_PMAXUB3(mmr1, mmr2, ssetyp) V_PMAXUB_##ssetyp(mmr1, mmr2)
// some macros for pminub instruction
// V_PMINUB(mmr1, mmr2, mmr work register) mmr2 may NOT = mmrw
@@ -51,17 +51,17 @@
"psubusb "mmrw", "mmr1"\n\t"
#define V_PMINUB_SSE(mmr1, mmr2, mmrw) "pminub "mmr2", "mmr1"\n\t"
#define V_PMINUB_3DNOW(mmr1, mmr2, mmrw) V_PMINUB_MMX(mmr1, mmr2, mmrw) // use MMX version
-#define V_PMINUB(mmr1, mmr2, mmrw) V_PMINUB2(mmr1, mmr2, mmrw, SSE_TYPE)
-#define V_PMINUB2(mmr1, mmr2, mmrw, ssetyp) V_PMINUB3(mmr1, mmr2, mmrw, ssetyp)
-#define V_PMINUB3(mmr1, mmr2, mmrw, ssetyp) V_PMINUB_##ssetyp(mmr1, mmr2, mmrw)
+#define V_PMINUB(mmr1, mmr2, mmrw) V_PMINUB2(mmr1, mmr2, mmrw, SSE_TYPE)
+#define V_PMINUB2(mmr1, mmr2, mmrw, ssetyp) V_PMINUB3(mmr1, mmr2, mmrw, ssetyp)
+#define V_PMINUB3(mmr1, mmr2, mmrw, ssetyp) V_PMINUB_##ssetyp(mmr1, mmr2, mmrw)
// some macros for movntq instruction
-// V_MOVNTQ(mmr1, mmr2)
+// V_MOVNTQ(mmr1, mmr2)
#define V_MOVNTQ_MMX(mmr1, mmr2) "movq "mmr2", "mmr1"\n\t"
#define V_MOVNTQ_3DNOW(mmr1, mmr2) "movq "mmr2", "mmr1"\n\t"
#define V_MOVNTQ_SSE(mmr1, mmr2) "movntq "mmr2", "mmr1"\n\t"
-#define V_MOVNTQ(mmr1, mmr2) V_MOVNTQ2(mmr1, mmr2, SSE_TYPE)
-#define V_MOVNTQ2(mmr1, mmr2, ssetyp) V_MOVNTQ3(mmr1, mmr2, ssetyp)
+#define V_MOVNTQ(mmr1, mmr2) V_MOVNTQ2(mmr1, mmr2, SSE_TYPE)
+#define V_MOVNTQ2(mmr1, mmr2, ssetyp) V_MOVNTQ3(mmr1, mmr2, ssetyp)
#define V_MOVNTQ3(mmr1, mmr2, ssetyp) V_MOVNTQ_##ssetyp(mmr1, mmr2)
// end of macros
diff --git a/src/post/deinterlace/pulldown.c b/src/post/deinterlace/pulldown.c
index 4f6247444..2218855f0 100644
--- a/src/post/deinterlace/pulldown.c
+++ b/src/post/deinterlace/pulldown.c
@@ -47,7 +47,7 @@
* Bot 2 : Drop
* Top 3 : Merge
* Bot 3 : Drop
- * Top 4 : Show
+ * Top 4 : Show
* Bot 4 : Drop
* Top 5 : Drop
* Bot 5 : Show
@@ -69,15 +69,15 @@
*
* [ ]
* [ * *] | 0 top BC
- * [* * ] | 1 BC bottom BC
+ * [* * ] | 1 BC bottom BC
*
* [ ]
* [ * *] | 0 top CC
- * [ * *] | 0 CC bottom CC
+ * [ * *] | 0 CC bottom CC
*
* [ ]
* [* * ] | 1 top DD
- * [ * *] | 0 DD bottom DD
+ * [ * *] | 0 DD bottom DD
*
*
* [* * ] | 1 top AA
@@ -608,7 +608,7 @@ int pulldown_drop( int action, int bottom_field )
if( action == PULLDOWN_SEQ_CC && !bottom_field )
ret = 0;
if( action == PULLDOWN_SEQ_DD && bottom_field )
- ret = 0;
+ ret = 0;
return ret;
}
diff --git a/src/post/deinterlace/speedy.c b/src/post/deinterlace/speedy.c
index a980780d7..32c8b03e3 100644
--- a/src/post/deinterlace/speedy.c
+++ b/src/post/deinterlace/speedy.c
@@ -116,11 +116,11 @@ void (*composite_bars_packed4444_scanline)( uint8_t *output,
uint8_t *background, int width,
int a, int luma, int cb, int cr,
int percentage );
-void (*packed444_to_nonpremultiplied_packed4444_scanline)( uint8_t *output,
+void (*packed444_to_nonpremultiplied_packed4444_scanline)( uint8_t *output,
uint8_t *input,
int width, int alpha );
void (*aspect_adjust_packed4444_scanline)( uint8_t *output,
- uint8_t *input,
+ uint8_t *input,
int width,
double pixel_aspect );
void (*packed444_to_packed422_scanline)( uint8_t *output,
@@ -622,7 +622,7 @@ static void vfilter_chroma_121_packed422_scanline_mmx( uint8_t *output, int widt
paddw_r2r( mm1, mm2 );
psllw_i2r( 6, mm2 );
- pand_r2r( mm6, mm2 );
+ pand_r2r( mm6, mm2 );
por_r2r ( mm3, mm2 );
@@ -637,7 +637,7 @@ static void vfilter_chroma_121_packed422_scanline_mmx( uint8_t *output, int widt
*output = (*t + *b + (*m << 1)) >> 2;
output+=2; t+=2; b+=2; m+=2;
}
-
+
emms();
}
#endif
@@ -661,7 +661,7 @@ static void vfilter_chroma_332_packed422_scanline_mmx( uint8_t *output, int widt
const mmx_t cmask = { 0xff00ff00ff00ff00ULL };
// Get width in bytes.
- width *= 2;
+ width *= 2;
i = width / 8;
width -= i * 8;
@@ -1939,7 +1939,7 @@ static int conv_YR_inited = 0;
static int myround(double n)
{
- if (n >= 0)
+ if (n >= 0)
return (int)(n + 0.5);
else
return (int)(n - 0.5);
@@ -1956,7 +1956,7 @@ static void init_RGB_to_YCbCr_tables(void)
* to one of each, add the following:
* + (fixed-point-factor / 2) --- for rounding later
* + (Q-offset * fixed-point-factor) --- to add the offset
- *
+ *
*/
for (i = 0; i < 256; i++) {
Y_R[i] = myround(0.299 * (double)i * 219.0 / 255.0 * (double)(1<<FP_BITS));
@@ -1988,7 +1988,7 @@ static void init_YCbCr_to_RGB_tables(void)
* to one of each, add the following:
* + (fixed-point-factor / 2) --- for rounding later
* + (Q-offset * fixed-point-factor) --- to add the offset
- *
+ *
*/
/* clip Y values under 16 */
@@ -2005,7 +2005,7 @@ static void init_YCbCr_to_RGB_tables(void)
RGB_Y[i] = myround((1.0 * (double)(235) * 255.0 / 219.0 * (double)(1<<FP_BITS))
+ (double)(1<<(FP_BITS-1)));
}
-
+
/* clip Cb/Cr values below 16 */
for (i = 0; i < 16; i++) {
R_Cr[i] = myround(1.402 * (double)(-112) * 255.0 / 224.0 * (double)(1<<FP_BITS));
@@ -2055,7 +2055,7 @@ static void rgba32_to_packed4444_rec601_scanline_c( uint8_t *output, uint8_t *in
int g = input[ 1 ];
int b = input[ 2 ];
int a = input[ 3 ];
-
+
output[ 0 ] = a;
output[ 1 ] = (Y_R[ r ] + Y_G[ g ] + Y_B[ b ]) >> FP_BITS;
output[ 2 ] = (Cb_R[ r ] + Cb_G[ g ] + Cb_B[ b ]) >> FP_BITS;
@@ -2128,7 +2128,7 @@ static void packed444_to_rgb24_rec601_reference_scanline( uint8_t *output, uint8
}
*/
-static void packed444_to_nonpremultiplied_packed4444_scanline_c( uint8_t *output,
+static void packed444_to_nonpremultiplied_packed4444_scanline_c( uint8_t *output,
uint8_t *input,
int width, int alpha )
{
@@ -2146,7 +2146,7 @@ static void packed444_to_nonpremultiplied_packed4444_scanline_c( uint8_t *output
}
static void aspect_adjust_packed4444_scanline_c( uint8_t *output,
- uint8_t *input,
+ uint8_t *input,
int width,
double pixel_aspect )
{
@@ -2259,7 +2259,7 @@ static void chroma_422_to_444_mpeg2_plane_c( uint8_t *dst, uint8_t *src, int wid
/* odd samples (21 -52 159 159 -52 21) */
dst[ i2 + 1 ] = clip255( ( 21*(src[im2]+src[ip3])
- - 52*(src[im1]+src[ip2])
+ - 52*(src[im1]+src[ip2])
+ 159*(src[i]+src[ip1]) + 128 ) >> 8 );
}
src += w;
diff --git a/src/post/deinterlace/speedy.h b/src/post/deinterlace/speedy.h
index b4ad56393..55a2a1d5b 100644
--- a/src/post/deinterlace/speedy.h
+++ b/src/post/deinterlace/speedy.h
@@ -237,7 +237,7 @@ extern void (*subpix_blit_vertical_packed422_scanline)( uint8_t *output, uint8_t
* Simple function to convert a 4:4:4 scanline to a 4:4:4:4 scanline by
* adding an alpha channel. Result is non-premultiplied.
*/
-extern void (*packed444_to_nonpremultiplied_packed4444_scanline)( uint8_t *output,
+extern void (*packed444_to_nonpremultiplied_packed4444_scanline)( uint8_t *output,
uint8_t *input,
int width, int alpha );
@@ -248,7 +248,7 @@ extern void (*packed444_to_nonpremultiplied_packed4444_scanline)( uint8_t *outpu
* aspect ratio.
*/
extern void (*aspect_adjust_packed4444_scanline)( uint8_t *output,
- uint8_t *input,
+ uint8_t *input,
int width,
double pixel_aspect );
diff --git a/src/post/deinterlace/tvtime.h b/src/post/deinterlace/tvtime.h
index 2253f264e..22d863a56 100644
--- a/src/post/deinterlace/tvtime.h
+++ b/src/post/deinterlace/tvtime.h
@@ -98,4 +98,4 @@ tvtime_t *tvtime_new_context(void);
void tvtime_reset_context( tvtime_t *this );
-#endif
+#endif
diff --git a/src/post/deinterlace/xine_plugin.c b/src/post/deinterlace/xine_plugin.c
index 7149f2bdb..d56c54d47 100644
--- a/src/post/deinterlace/xine_plugin.c
+++ b/src/post/deinterlace/xine_plugin.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
@@ -50,7 +50,7 @@ static void *deinterlace_init_plugin(xine_t *xine, void *);
static const post_info_t deinterlace_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 | PLUGIN_MUST_PRELOAD, 9, "tvtime", XINE_VERSION_CODE, &deinterlace_special_info, &deinterlace_init_plugin },
{ PLUGIN_NONE, 0, "", 0, NULL, NULL }
};
@@ -66,7 +66,7 @@ static char *enum_framerate[] = { "full", "half_top", "half_bottom", NULL };
static void *help_string;
/*
- * this is the struct used by "parameters api"
+ * this is the struct used by "parameters api"
*/
typedef struct deinterlace_parameters_s {
@@ -86,15 +86,15 @@ typedef struct deinterlace_parameters_s {
* description of params struct
*/
START_PARAM_DESCR( deinterlace_parameters_t )
-PARAM_ITEM( POST_PARAM_TYPE_INT, method, enum_methods, 0, 0, 0,
+PARAM_ITEM( POST_PARAM_TYPE_INT, method, enum_methods, 0, 0, 0,
"deinterlace method" )
PARAM_ITEM( POST_PARAM_TYPE_BOOL, enabled, NULL, 0, 1, 0,
"enable/disable" )
-PARAM_ITEM( POST_PARAM_TYPE_INT, pulldown, enum_pulldown, 0, 0, 0,
+PARAM_ITEM( POST_PARAM_TYPE_INT, pulldown, enum_pulldown, 0, 0, 0,
"pulldown algorithm" )
-PARAM_ITEM( POST_PARAM_TYPE_INT, pulldown_error_wait, NULL, 0, 0, 0,
+PARAM_ITEM( POST_PARAM_TYPE_INT, pulldown_error_wait, NULL, 0, 0, 0,
"number of frames of telecine pattern sync required before mode change" )
-PARAM_ITEM( POST_PARAM_TYPE_INT, framerate_mode, enum_framerate, 0, 0, 0,
+PARAM_ITEM( POST_PARAM_TYPE_INT, framerate_mode, enum_framerate, 0, 0, 0,
"framerate output mode" )
PARAM_ITEM( POST_PARAM_TYPE_BOOL, judder_correction, NULL, 0, 1, 0,
"make frames evenly spaced for film mode (24 fps)" )
@@ -129,7 +129,7 @@ struct post_plugin_deinterlace_s {
int tvtime_changed;
int tvtime_last_filmmode;
int vo_deinterlace_enabled;
-
+
int framecounter;
uint8_t rff_pattern;
@@ -144,10 +144,10 @@ typedef struct post_class_deinterlace_s {
deinterlace_parameters_t init_param;
} post_class_deinterlace_t;
-static void _flush_frames(post_plugin_deinterlace_t *this)
+static void _flush_frames(post_plugin_deinterlace_t *this)
{
int i;
-
+
for( i = 0; i < NUM_RECENT_FRAMES; i++ ) {
if( this->recent_frame[i] ) {
this->recent_frame[i]->free(this->recent_frame[i]);
@@ -189,7 +189,7 @@ static int set_parameters (xine_post_t *this_gen, void *param_gen) {
static int get_parameters (xine_post_t *this_gen, void *param_gen) {
post_plugin_deinterlace_t *this = (post_plugin_deinterlace_t *)this_gen;
deinterlace_parameters_t *param = (deinterlace_parameters_t *)param_gen;
-
+
param->method = this->cur_method;
param->enabled = this->enabled;
param->pulldown = this->pulldown;
@@ -202,7 +202,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;
}
@@ -309,7 +309,7 @@ static void *deinterlace_init_plugin(xine_t *xine, void *data)
if (!class)
return NULL;
-
+
class->class.open_plugin = deinterlace_open_plugin;
class->class.get_identifier = deinterlace_get_identifier;
class->class.get_description = deinterlace_get_description;
@@ -331,7 +331,7 @@ static void *deinterlace_init_plugin(xine_t *xine, void *data)
filter_deinterlace_methods( config_flags, 5 /*fieldsavailable*/ );
if( !get_num_deinterlace_methods() ) {
- xprintf(xine, XINE_VERBOSITY_LOG,
+ xprintf(xine, XINE_VERBOSITY_LOG,
_("tvtime: No deinterlacing methods available, exiting.\n"));
return NULL;
}
@@ -344,7 +344,7 @@ static void *deinterlace_init_plugin(xine_t *xine, void *data)
deinterlace_method_t *method;
method = get_deinterlace_method(i);
-
+
enum_methods[i+1] = method->short_name;
xine_buffer_strcat( help_string, "[" );
xine_buffer_strcat( help_string, method->short_name );
@@ -356,7 +356,7 @@ static void *deinterlace_init_plugin(xine_t *xine, void *data)
xine_buffer_strcat( help_string, "\n---\n" );
}
enum_methods[i+1] = NULL;
-
+
/* Some default values */
class->init_param.method = 1; /* First (plugin) method available */
@@ -364,7 +364,7 @@ static void *deinterlace_init_plugin(xine_t *xine, void *data)
class->init_param.pulldown = 1; /* vektor */
class->init_param.pulldown_error_wait = 60; /* about one second */
class->init_param.framerate_mode = 0; /* full */
- class->init_param.judder_correction = 1;
+ class->init_param.judder_correction = 1;
class->init_param.use_progressive_frame_flag = 1;
class->init_param.chroma_filter = 0;
class->init_param.cheap_mode = 0;
@@ -383,12 +383,12 @@ static post_plugin_t *deinterlace_open_plugin(post_class_t *class_gen, int input
post_out_t *output;
post_class_deinterlace_t *class = (post_class_deinterlace_t *)class_gen;
post_video_port_t *port;
-
+
if (!this || !video_target || !video_target[0]) {
free(this);
return NULL;
}
-
+
_x_post_init(&this->post, 0, 1);
this->tvtime = tvtime_new_context();
@@ -398,7 +398,7 @@ static post_plugin_t *deinterlace_open_plugin(post_class_t *class_gen, int input
pthread_mutex_init (&this->lock, NULL);
set_parameters ((xine_post_t *)&this->post, &class->init_param);
-
+
port = _x_post_intercept_video_port(&this->post, video_target[0], &input, &output);
/* replace with our own get_frame function */
port->new_port.open = deinterlace_open;
@@ -408,7 +408,7 @@ static post_plugin_t *deinterlace_open_plugin(post_class_t *class_gen, int input
port->new_port.flush = deinterlace_flush;
port->intercept_frame = deinterlace_intercept_frame;
port->new_frame->draw = deinterlace_draw;
-
+
input_api = &this->parameter_input;
input_api->name = "parameters";
input_api->type = XINE_POST_DATA_PARAMETERS;
@@ -417,11 +417,11 @@ static post_plugin_t *deinterlace_open_plugin(post_class_t *class_gen, int input
input->xine_in.name = "video";
output->xine_out.name = "deinterlaced video";
-
+
this->post.xine_post.video_input[0] = &port->new_port;
-
+
this->post.dispose = deinterlace_dispose;
-
+
return &this->post;
}
@@ -477,9 +477,9 @@ static int deinterlace_set_property(xine_video_port_t *port_gen, int property, i
pthread_mutex_unlock (&this->lock);
this->vo_deinterlace_enabled = this->enabled && (!this->cur_method);
-
- port->original_port->set_property(port->original_port,
- XINE_PARAM_VO_DEINTERLACE,
+
+ port->original_port->set_property(port->original_port,
+ XINE_PARAM_VO_DEINTERLACE,
this->vo_deinterlace_enabled);
return this->enabled;
@@ -500,14 +500,14 @@ static void deinterlace_open(xine_video_port_t *port_gen, xine_stream_t *stream)
{
post_video_port_t *port = (post_video_port_t *)port_gen;
post_plugin_deinterlace_t *this = (post_plugin_deinterlace_t *)port->post;
-
+
_x_post_rewire(&this->post);
_x_post_inc_usage(port);
port->stream = stream;
(port->original_port->open) (port->original_port, stream);
this->vo_deinterlace_enabled = !this->cur_method;
- port->original_port->set_property(port->original_port,
- XINE_PARAM_VO_DEINTERLACE,
+ port->original_port->set_property(port->original_port,
+ XINE_PARAM_VO_DEINTERLACE,
this->vo_deinterlace_enabled);
}
@@ -518,8 +518,8 @@ static void deinterlace_close(xine_video_port_t *port_gen, xine_stream_t *stream
port->stream = NULL;
_flush_frames(this);
- port->original_port->set_property(port->original_port,
- XINE_PARAM_VO_DEINTERLACE,
+ port->original_port->set_property(port->original_port,
+ XINE_PARAM_VO_DEINTERLACE,
0);
port->original_port->close(port->original_port, stream);
_x_post_dec_usage(port);
@@ -530,21 +530,21 @@ static int deinterlace_intercept_frame(post_video_port_t *port, vo_frame_t *fram
{
post_plugin_deinterlace_t *this = (post_plugin_deinterlace_t *)port->post;
int vo_deinterlace_enabled = 0;
-
+
vo_deinterlace_enabled = ( frame->format != XINE_IMGFMT_YV12 &&
frame->format != XINE_IMGFMT_YUY2 &&
this->enabled );
-
+
if( this->cur_method &&
this->vo_deinterlace_enabled != vo_deinterlace_enabled ) {
this->vo_deinterlace_enabled = vo_deinterlace_enabled;
- port->original_port->set_property(port->original_port,
- XINE_PARAM_VO_DEINTERLACE,
+ port->original_port->set_property(port->original_port,
+ XINE_PARAM_VO_DEINTERLACE,
this->vo_deinterlace_enabled);
}
-
+
return (this->enabled && this->cur_method &&
- (frame->flags & VO_INTERLACED_FLAG) &&
+ (frame->flags & VO_INTERLACED_FLAG) &&
(frame->format == XINE_IMGFMT_YV12 || frame->format == XINE_IMGFMT_YUY2) );
}
@@ -559,7 +559,7 @@ static void apply_chroma_filter( uint8_t *data, int stride, int width, int heigh
*/
for( i = 0; i < height; i++, data += stride ) {
vfilter_chroma_332_packed422_scanline( data, width,
- data,
+ data,
(i) ? (data - stride) : data,
(i < height-1) ? (data + stride) : data );
}
@@ -567,7 +567,7 @@ static void apply_chroma_filter( uint8_t *data, int stride, int width, int heigh
/* Build the output frame from the specified field. */
static int deinterlace_build_output_field(
- post_plugin_deinterlace_t *this, post_video_port_t *port,
+ post_plugin_deinterlace_t *this, post_video_port_t *port,
xine_stream_t *stream,
vo_frame_t *frame, vo_frame_t *yuy2_frame,
int bottom_field, int second_field,
@@ -576,14 +576,14 @@ static int deinterlace_build_output_field(
vo_frame_t *deinterlaced_frame;
int scaler = 1;
int force24fps;
-
+
force24fps = this->judder_correction && !this->cheap_mode &&
( this->pulldown == PULLDOWN_VEKTOR && this->tvtime->filmmode );
-
+
if( this->tvtime->curmethod->doscalerbob ) {
scaler = 2;
}
-
+
pthread_mutex_unlock (&this->lock);
deinterlaced_frame = port->original_port->get_frame(port->original_port,
frame->width, frame->height / scaler, frame->ratio, yuy2_frame->format,
@@ -596,7 +596,7 @@ static int deinterlace_build_output_field(
deinterlaced_frame->crop_bottom = frame->crop_bottom;
_x_extra_info_merge(deinterlaced_frame->extra_info, frame->extra_info);
-
+
if( skip > 0 && !this->pulldown ) {
deinterlaced_frame->bad_frame = 1;
} else {
@@ -605,60 +605,60 @@ static int deinterlace_build_output_field(
deinterlaced_frame->bad_frame = !tvtime_build_copied_field(this->tvtime,
deinterlaced_frame->base[0],
yuy2_frame->base[0], bottom_field,
- frame->width, frame->height,
+ frame->width, frame->height,
yuy2_frame->pitches[0], deinterlaced_frame->pitches[0] );
} else {
deinterlaced_frame->bad_frame = !tvtime_build_copied_field(this->tvtime,
deinterlaced_frame->base[0],
yuy2_frame->base[0], bottom_field,
- frame->width/2, frame->height,
+ frame->width/2, frame->height,
yuy2_frame->pitches[0], deinterlaced_frame->pitches[0] );
deinterlaced_frame->bad_frame += !tvtime_build_copied_field(this->tvtime,
deinterlaced_frame->base[1],
yuy2_frame->base[1], bottom_field,
- frame->width/4, frame->height/2,
+ frame->width/4, frame->height/2,
yuy2_frame->pitches[1], deinterlaced_frame->pitches[1] );
deinterlaced_frame->bad_frame += !tvtime_build_copied_field(this->tvtime,
deinterlaced_frame->base[2],
yuy2_frame->base[2], bottom_field,
- frame->width/4, frame->height/2,
+ frame->width/4, frame->height/2,
yuy2_frame->pitches[2], deinterlaced_frame->pitches[2] );
}
} else {
if( yuy2_frame->format == XINE_IMGFMT_YUY2 ) {
deinterlaced_frame->bad_frame = !tvtime_build_deinterlaced_frame(this->tvtime,
deinterlaced_frame->base[0],
- yuy2_frame->base[0],
- (this->recent_frame[0])?this->recent_frame[0]->base[0]:yuy2_frame->base[0],
+ yuy2_frame->base[0],
+ (this->recent_frame[0])?this->recent_frame[0]->base[0]:yuy2_frame->base[0],
(this->recent_frame[1])?this->recent_frame[1]->base[0]:yuy2_frame->base[0],
- bottom_field, second_field, frame->width, frame->height,
+ bottom_field, second_field, frame->width, frame->height,
yuy2_frame->pitches[0], deinterlaced_frame->pitches[0]);
} else {
deinterlaced_frame->bad_frame = !tvtime_build_deinterlaced_frame(this->tvtime,
deinterlaced_frame->base[0],
- yuy2_frame->base[0],
- (this->recent_frame[0])?this->recent_frame[0]->base[0]:yuy2_frame->base[0],
+ yuy2_frame->base[0],
+ (this->recent_frame[0])?this->recent_frame[0]->base[0]:yuy2_frame->base[0],
(this->recent_frame[1])?this->recent_frame[1]->base[0]:yuy2_frame->base[0],
- bottom_field, second_field, frame->width/2, frame->height,
+ bottom_field, second_field, frame->width/2, frame->height,
yuy2_frame->pitches[0], deinterlaced_frame->pitches[0]);
deinterlaced_frame->bad_frame += !tvtime_build_deinterlaced_frame(this->tvtime,
deinterlaced_frame->base[1],
- yuy2_frame->base[1],
- (this->recent_frame[0])?this->recent_frame[0]->base[1]:yuy2_frame->base[1],
+ yuy2_frame->base[1],
+ (this->recent_frame[0])?this->recent_frame[0]->base[1]:yuy2_frame->base[1],
(this->recent_frame[1])?this->recent_frame[1]->base[1]:yuy2_frame->base[1],
bottom_field, second_field, frame->width/4, frame->height/2,
yuy2_frame->pitches[1], deinterlaced_frame->pitches[1]);
deinterlaced_frame->bad_frame += !tvtime_build_deinterlaced_frame(this->tvtime,
deinterlaced_frame->base[2],
- yuy2_frame->base[2],
- (this->recent_frame[0])?this->recent_frame[0]->base[2]:yuy2_frame->base[2],
+ yuy2_frame->base[2],
+ (this->recent_frame[0])?this->recent_frame[0]->base[2]:yuy2_frame->base[2],
(this->recent_frame[1])?this->recent_frame[1]->base[2]:yuy2_frame->base[2],
- bottom_field, second_field, frame->width/4, frame->height/2,
+ bottom_field, second_field, frame->width/4, frame->height/2,
yuy2_frame->pitches[2], deinterlaced_frame->pitches[2]);
}
}
}
-
+
pthread_mutex_unlock (&this->lock);
if( force24fps ) {
if( !deinterlaced_frame->bad_frame ) {
@@ -670,7 +670,7 @@ static int deinterlace_build_output_field(
deinterlaced_frame->pts = 0;
deinterlaced_frame->duration = FPS_24_DURATION;
if( this->chroma_filter && !this->cheap_mode )
- apply_chroma_filter( deinterlaced_frame->base[0], deinterlaced_frame->pitches[0],
+ apply_chroma_filter( deinterlaced_frame->base[0], deinterlaced_frame->pitches[0],
frame->width, frame->height / scaler );
skip = deinterlaced_frame->draw(deinterlaced_frame, stream);
} else {
@@ -680,15 +680,15 @@ static int deinterlace_build_output_field(
deinterlaced_frame->pts = pts;
deinterlaced_frame->duration = duration;
if( this->chroma_filter && !this->cheap_mode && !deinterlaced_frame->bad_frame )
- apply_chroma_filter( deinterlaced_frame->base[0], deinterlaced_frame->pitches[0],
+ apply_chroma_filter( deinterlaced_frame->base[0], deinterlaced_frame->pitches[0],
frame->width, frame->height / scaler );
skip = deinterlaced_frame->draw(deinterlaced_frame, stream);
}
-
+
/* _x_post_frame_copy_up(frame, deinterlaced_frame); */
deinterlaced_frame->free(deinterlaced_frame);
pthread_mutex_lock (&this->lock);
-
+
return skip;
}
@@ -705,7 +705,7 @@ static int deinterlace_draw(vo_frame_t *frame, xine_stream_t *stream)
orig_frame = frame;
_x_post_frame_copy_down(frame, frame->next);
frame = frame->next;
-
+
/* update tvtime context and method */
pthread_mutex_lock (&this->lock);
if( this->tvtime_changed ) {
@@ -716,8 +716,8 @@ static int deinterlace_draw(vo_frame_t *frame, xine_stream_t *stream)
else
this->tvtime->curmethod = NULL;
- port->original_port->set_property(port->original_port,
- XINE_PARAM_VO_DEINTERLACE,
+ port->original_port->set_property(port->original_port,
+ XINE_PARAM_VO_DEINTERLACE,
!this->cur_method);
this->tvtime_changed = 0;
@@ -736,11 +736,11 @@ static int deinterlace_draw(vo_frame_t *frame, xine_stream_t *stream)
lprintf("frame flags pf: %d rff: %d tff: %d duration: %d\n",
frame->progressive_frame, frame->repeat_first_field,
frame->top_field_first, frame->duration);
-
+
/* detect special rff patterns */
this->rff_pattern = this->rff_pattern << 1;
this->rff_pattern |= !!frame->repeat_first_field;
-
+
if( ((this->rff_pattern & 0xff) == 0xaa ||
(this->rff_pattern & 0xff) == 0x55) ) {
/*
@@ -752,7 +752,7 @@ static int deinterlace_draw(vo_frame_t *frame, xine_stream_t *stream)
/* using frame->progressive_frame may help displaying still menus.
* however, it is known that some rare material set it wrong.
- *
+ *
* we also assume that repeat_first_field is progressive (it doesn't
* make much sense to display interlaced fields out of order)
*/
@@ -760,8 +760,8 @@ static int deinterlace_draw(vo_frame_t *frame, xine_stream_t *stream)
(frame->repeat_first_field || frame->progressive_frame) ) {
progressive = 1;
}
-
- if( !frame->bad_frame &&
+
+ if( !frame->bad_frame &&
(frame->flags & VO_INTERLACED_FLAG) &&
this->tvtime->curmethod ) {
@@ -773,17 +773,17 @@ static int deinterlace_draw(vo_frame_t *frame, xine_stream_t *stream)
yuy2_frame = port->original_port->get_frame(port->original_port,
frame->width, frame->height, frame->ratio, XINE_IMGFMT_YUY2, frame->flags | VO_BOTH_FIELDS);
_x_post_frame_copy_down(frame, yuy2_frame);
-
+
/* the logic for deciding upsampling to use comes from:
* http://www.hometheaterhifi.com/volume_8_2/dvd-benchmark-special-report-chroma-bug-4-2001.html
*/
- yv12_to_yuy2(frame->base[0], frame->pitches[0],
- frame->base[1], frame->pitches[1],
- frame->base[2], frame->pitches[2],
+ yv12_to_yuy2(frame->base[0], frame->pitches[0],
+ frame->base[1], frame->pitches[1],
+ frame->base[2], frame->pitches[2],
yuy2_frame->base[0], yuy2_frame->pitches[0],
- frame->width, frame->height,
+ frame->width, frame->height,
frame->progressive_frame || progressive );
-
+
} else {
yuy2_frame = frame;
yuy2_frame->lock(yuy2_frame);
@@ -793,10 +793,10 @@ static int deinterlace_draw(vo_frame_t *frame, xine_stream_t *stream)
pthread_mutex_lock (&this->lock);
/* check if frame format changed */
for(i = 0; i < NUM_RECENT_FRAMES; i++ ) {
- if( this->recent_frame[i] &&
- (this->recent_frame[i]->width != frame->width ||
- this->recent_frame[i]->height != frame->height ||
- this->recent_frame[i]->format != yuy2_frame->format ) ) {
+ if( this->recent_frame[i] &&
+ (this->recent_frame[i]->width != frame->width ||
+ this->recent_frame[i]->height != frame->height ||
+ this->recent_frame[i]->format != yuy2_frame->format ) ) {
this->recent_frame[i]->free(this->recent_frame[i]);
this->recent_frame[i] = NULL;
}
@@ -809,10 +809,10 @@ static int deinterlace_draw(vo_frame_t *frame, xine_stream_t *stream)
framerate_mode = FRAMERATE_HALF_TFF;
this->tvtime->pulldown_alg = PULLDOWN_NONE;
}
-
+
if( framerate_mode == FRAMERATE_FULL ) {
int top_field_first = frame->top_field_first;
-
+
/* if i understood mpeg2 specs correctly, top_field_first
* shall be zero for field pictures and the output order
* is the same that the fields are decoded.
@@ -824,7 +824,7 @@ static int deinterlace_draw(vo_frame_t *frame, xine_stream_t *stream)
if ( (frame->flags & VO_BOTH_FIELDS) != VO_BOTH_FIELDS ) {
top_field_first = (frame->flags & VO_TOP_FIELD) ? 1 : 0;
}
-
+
if ( top_field_first ) {
fields[0] = 0;
fields[1] = 1;
@@ -837,8 +837,8 @@ static int deinterlace_draw(vo_frame_t *frame, xine_stream_t *stream)
} else if ( framerate_mode == FRAMERATE_HALF_BFF ) {
fields[0] = 1;
}
-
-
+
+
if( progressive ) {
/* If the previous field was interlaced and this one is progressive
@@ -850,10 +850,10 @@ static int deinterlace_draw(vo_frame_t *frame, xine_stream_t *stream)
* duration is used in the calculation because the generated frame
* represents the second half of the previous frame.
*/
- if (this->recent_frame[0] && !this->recent_frame[0]->progressive_frame &&
+ if (this->recent_frame[0] && !this->recent_frame[0]->progressive_frame &&
this->tvtime->curmethod->delaysfield)
{
- skip = deinterlace_build_output_field(
+ skip = deinterlace_build_output_field(
this, port, stream,
frame, yuy2_frame,
fields[0], 0,
@@ -879,19 +879,19 @@ static int deinterlace_draw(vo_frame_t *frame, xine_stream_t *stream)
/* Build the output from the first field. */
if ( !(this->recent_frame[0] && this->recent_frame[0]->progressive_frame &&
this->tvtime->curmethod->delaysfield) ) {
- skip = deinterlace_build_output_field(
+ skip = deinterlace_build_output_field(
this, port, stream,
frame, yuy2_frame,
fields[0], 0,
frame->pts,
(framerate_mode == FRAMERATE_FULL) ? frame->duration/2 : frame->duration,
0);
- }
+ }
if( framerate_mode == FRAMERATE_FULL ) {
-
+
/* Build the output from the second field. */
- skip = deinterlace_build_output_field(
+ skip = deinterlace_build_output_field(
this, port, stream,
frame, yuy2_frame,
fields[1], 1,
@@ -901,7 +901,7 @@ static int deinterlace_draw(vo_frame_t *frame, xine_stream_t *stream)
}
}
- /* don't drop frames when pulldown mode is enabled. otherwise
+ /* don't drop frames when pulldown mode is enabled. otherwise
* pulldown detection fails (yo-yo effect has also been seen)
*/
if( this->pulldown )
@@ -909,7 +909,7 @@ static int deinterlace_draw(vo_frame_t *frame, xine_stream_t *stream)
/* store back progressive flag for frame history */
yuy2_frame->progressive_frame = progressive;
-
+
/* keep track of recent frames */
i = NUM_RECENT_FRAMES-1;
if( this->recent_frame[i] )
@@ -930,8 +930,8 @@ static int deinterlace_draw(vo_frame_t *frame, xine_stream_t *stream)
} else {
skip = frame->draw(frame, stream);
}
-
+
_x_post_frame_copy_up(orig_frame, frame);
-
+
return skip;
}
diff --git a/src/post/goom/xine_goom.c b/src/post/goom/xine_goom.c
index db7079423..72692ffe1 100644
--- a/src/post/goom/xine_goom.c
+++ b/src/post/goom/xine_goom.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
@@ -71,19 +71,19 @@ struct post_plugin_goom_s {
/* private data */
xine_video_port_t *vo_port;
post_out_t video_output;
-
+
post_class_goom_t *class;
-
+
/* private metronom for syncing the video */
metronom_t *metronom;
-
+
/* goom context */
PluginInfo *goom;
-
- int data_idx;
+
+ int data_idx;
gint16 data [2][NUMSAMPLES];
audio_buffer_t buf; /* dummy buffer just to hold a copy of audio data */
-
+
int channels;
int sample_rate;
int samples_per_frame;
@@ -99,7 +99,7 @@ struct post_plugin_goom_s {
yuv_planes_t yuv;
-
+
/* frame skipping */
int skip_frame;
};
@@ -110,12 +110,12 @@ static void *goom_init_plugin(xine_t *xine, void *);
/* plugin catalog information */
-static const post_info_t goom_special_info = {
+static const post_info_t goom_special_info = {
XINE_POST_TYPE_AUDIO_VISUALIZATION
};
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 | PLUGIN_MUST_PRELOAD, 9, "goom", XINE_VERSION_CODE, &goom_special_info, &goom_init_plugin },
{ PLUGIN_NONE, 0, "", 0, NULL, NULL }
};
@@ -144,7 +144,7 @@ static void goom_port_put_buffer (xine_audio_port_t *this, audio_buffer_t *buf,
static void fps_changed_cb(void *data, xine_cfg_entry_t *cfg) {
post_class_goom_t *class = (post_class_goom_t*) data;
-
+
if(class->ip) {
post_plugin_goom_t *this = class->ip;
@@ -160,7 +160,7 @@ static void fps_changed_cb(void *data, xine_cfg_entry_t *cfg) {
static void width_changed_cb(void *data, xine_cfg_entry_t *cfg) {
post_class_goom_t *class = (post_class_goom_t*) data;
-
+
if(class->ip) {
post_plugin_goom_t *this = class->ip;
this->width = cfg->num_value;
@@ -169,7 +169,7 @@ static void width_changed_cb(void *data, xine_cfg_entry_t *cfg) {
static void height_changed_cb(void *data, xine_cfg_entry_t *cfg) {
post_class_goom_t *class = (post_class_goom_t*) data;
-
+
if(class->ip) {
post_plugin_goom_t *this = class->ip;
this->height = cfg->num_value;
@@ -178,7 +178,7 @@ static void height_changed_cb(void *data, xine_cfg_entry_t *cfg) {
static void csc_method_changed_cb(void *data, xine_cfg_entry_t *cfg) {
post_class_goom_t *class = (post_class_goom_t*) data;
-
+
if(class->ip) {
post_plugin_goom_t *this = class->ip;
this->csc_method = cfg->num_value;
@@ -192,14 +192,14 @@ static void *goom_init_plugin(xine_t *xine, void *data)
if (!this)
return NULL;
-
+
this->class.open_plugin = goom_open_plugin;
this->class.get_identifier = goom_get_identifier;
this->class.get_description = goom_get_description;
this->class.dispose = goom_class_dispose;
this->ip = NULL;
this->xine = xine;
-
+
cfg = xine->config;
cfg->register_num (cfg, "effects.goom.fps", FPS,
@@ -212,12 +212,12 @@ static void *goom_init_plugin(xine_t *xine, void *data)
_("goom image width"),
_("The width in pixels of the image to be generated."),
10, width_changed_cb, this);
-
+
cfg->register_num (cfg, "effects.goom.height", GOOM_HEIGHT,
_("goom image height"),
_("The height in pixels of the image to be generated."),
10, height_changed_cb, this);
-
+
cfg->register_enum (cfg, "effects.goom.csc_method", 0,
goom_csc_methods,
@@ -246,34 +246,34 @@ static post_plugin_t *goom_open_plugin(post_class_t *class_gen, int inputs,
free(this);
return NULL;
}
-
+
_x_post_init(&this->post, 1, 0);
-
+
/*
* Lookup config entries.
*/
this->class = class;
class->ip = this;
this->vo_port = video_target[0];
-
+
this->metronom = _x_metronom_init(1, 0, class->xine);
lprintf("goom_open_plugin\n");
if(xine_config_lookup_entry(class->xine, "effects.goom.fps",
- &fps_entry))
+ &fps_entry))
fps_changed_cb(class, &fps_entry);
if(xine_config_lookup_entry(class->xine, "effects.goom.width",
- &width_entry))
+ &width_entry))
width_changed_cb(class, &width_entry);
if(xine_config_lookup_entry(class->xine, "effects.goom.height",
- &height_entry))
+ &height_entry))
height_changed_cb(class, &height_entry);
if(xine_config_lookup_entry(class->xine, "effects.goom.csc_method",
- &csc_method_entry))
+ &csc_method_entry))
csc_method_changed_cb(class, &csc_method_entry);
this->width_back = this->width;
@@ -285,13 +285,13 @@ static post_plugin_t *goom_open_plugin(post_class_t *class_gen, int inputs,
this->ratio = (double)this->width_back/(double)this->height_back;
this->buf.mem = NULL;
- this->buf.mem_size = 0;
+ this->buf.mem_size = 0;
port = _x_post_intercept_audio_port(&this->post, audio_target[0], &input, &output);
port->new_port.open = goom_port_open;
port->new_port.close = goom_port_close;
port->new_port.put_buffer = goom_port_put_buffer;
-
+
outputv = &this->video_output;
outputv->xine_out.name = "generated video";
outputv->xine_out.type = XINE_POST_DATA_VIDEO;
@@ -299,7 +299,7 @@ static post_plugin_t *goom_open_plugin(post_class_t *class_gen, int inputs,
outputv->xine_out.rewire = goom_rewire_video;
outputv->post = &this->post;
xine_list_push_back(this->post.output, outputv);
-
+
this->post.xine_post.audio_input[0] = &port->new_port;
this->post.dispose = goom_dispose;
@@ -322,13 +322,13 @@ static void goom_class_dispose(post_class_t *class_gen)
post_class_goom_t *this = (post_class_goom_t*) class_gen;
this->xine->config->unregister_callback(this->xine->config,
- "effects.goom.fps");
+ "effects.goom.fps");
this->xine->config->unregister_callback(this->xine->config,
- "effects.goom.width");
+ "effects.goom.width");
this->xine->config->unregister_callback(this->xine->config,
- "effects.goom.height");
+ "effects.goom.height");
this->xine->config->unregister_callback(this->xine->config,
- "effects.goom.csc_method");
+ "effects.goom.csc_method");
free(class_gen);
}
@@ -358,7 +358,7 @@ static int goom_rewire_video(xine_post_out_t *output_gen, void *data)
xine_video_port_t *old_port = *(xine_video_port_t **)output_gen->data;
xine_video_port_t *new_port = (xine_video_port_t *)data;
post_plugin_goom_t *this = (post_plugin_goom_t *)output->post;
-
+
if (!data)
return 0;
/* register our stream at the new output port */
@@ -377,12 +377,12 @@ static int goom_port_open(xine_audio_port_t *port_gen, xine_stream_t *stream,
_x_post_rewire(&this->post);
_x_post_inc_usage(port);
-
+
port->stream = stream;
port->bits = bits;
port->rate = rate;
port->mode = mode;
-
+
this->channels = _x_ao_mode2channels(mode);
this->sample_rate = rate;
this->samples_per_frame = rate / this->fps;
@@ -392,7 +392,7 @@ static int goom_port_open(xine_audio_port_t *port_gen, xine_stream_t *stream,
this->do_samples_skip = 0;
this->left_to_read = NUMSAMPLES;
-
+
(this->vo_port->open) (this->vo_port, XINE_ANON_STREAM);
this->metronom->set_master(this->metronom, stream->metronom);
@@ -407,18 +407,18 @@ static void goom_port_close(xine_audio_port_t *port_gen, xine_stream_t *stream )
free_yuv_planes(&this->yuv);
port->stream = NULL;
-
+
this->vo_port->close(this->vo_port, XINE_ANON_STREAM);
this->metronom->set_master(this->metronom, NULL);
-
+
port->original_port->close(port->original_port, stream );
-
+
_x_post_dec_usage(port);
}
-static void goom_port_put_buffer (xine_audio_port_t *port_gen,
+static void goom_port_put_buffer (xine_audio_port_t *port_gen,
audio_buffer_t *buf, xine_stream_t *stream) {
-
+
post_audio_port_t *port = (post_audio_port_t *)port_gen;
post_plugin_goom_t *this = (post_plugin_goom_t *)port->post;
vo_frame_t *frame;
@@ -431,28 +431,28 @@ static void goom_port_put_buffer (xine_audio_port_t *port_gen,
int width, height;
int current_sample = 0;
-
+
/* make a copy of buf data for private use */
if( this->buf.mem_size < buf->mem_size ) {
this->buf.mem = realloc(this->buf.mem, buf->mem_size);
this->buf.mem_size = buf->mem_size;
}
- memcpy(this->buf.mem, buf->mem,
+ memcpy(this->buf.mem, buf->mem,
buf->num_frames*this->channels*((port->bits == 8)?1:2));
this->buf.num_frames = buf->num_frames;
-
+
/* pass data to original port */
- port->original_port->put_buffer(port->original_port, buf, stream);
-
+ port->original_port->put_buffer(port->original_port, buf, stream);
+
/* we must not use original data anymore, it should have already being moved
* to the fifo of free audio buffers. just use our private copy instead.
*/
- buf = &this->buf;
+ buf = &this->buf;
j = (this->channels >= 2) ? 1 : 0;
while (current_sample < buf->num_frames) {
-
+
if (this->do_samples_skip) {
if (current_sample + this->left_to_read > buf->num_frames) {
this->left_to_read -= (buf->num_frames-current_sample);
@@ -461,14 +461,14 @@ static void goom_port_put_buffer (xine_audio_port_t *port_gen,
current_sample+=this->left_to_read;
this->left_to_read = NUMSAMPLES;
this->do_samples_skip = 0;
-
+
}
} else {
if( port->bits == 8 ) {
data8 = (int8_t *)buf->mem;
data8 += current_sample * this->channels;
-
+
/* scale 8 bit data to 16 bits and convert to signed as well */
for ( i=current_sample ; this->data_idx < NUMSAMPLES && i < buf->num_frames;
i++, this->data_idx++,data8 += this->channels) {
@@ -507,13 +507,13 @@ static void goom_port_put_buffer (xine_audio_port_t *port_gen,
frame = this->vo_port->get_frame (this->vo_port, this->width_back, this->height_back,
this->ratio, XINE_IMGFMT_YUY2,
VO_BOTH_FIELDS);
-
+
frame->extra_info->invalid = 1;
-
+
frame->duration = 90000 * this->samples_per_frame / this->sample_rate;
frame->pts = pts;
this->metronom->got_video_frame(this->metronom, frame);
-
+
if (!this->skip_frame) {
/* Try to be fast */
goom_frame = (uint8_t *)goom_update (this->goom, this->data, 0, 0, NULL, NULL);
@@ -521,13 +521,13 @@ static void goom_port_put_buffer (xine_audio_port_t *port_gen,
dest_ptr = frame -> base[0];
goom_frame_end = goom_frame + 4 * (this->width_back * this->height_back);
- if ((this->csc_method == 1) &&
+ if ((this->csc_method == 1) &&
(xine_mm_accel() & MM_ACCEL_X86_MMX)) {
int plane_ptr = 0;
while (goom_frame < goom_frame_end) {
uint8_t r, g, b;
-
+
/* don't take endianness into account since MMX is only available
* on Intel processors */
b = *goom_frame; goom_frame++;
@@ -563,7 +563,7 @@ static void goom_port_put_buffer (xine_audio_port_t *port_gen,
g2 = *goom_frame; goom_frame++;
r2 = *goom_frame; goom_frame += 2;
#endif
-
+
*dest_ptr = COMPUTE_Y(r1, g1, b1);
dest_ptr++;
*dest_ptr = COMPUTE_U(r1, g1, b1);
@@ -585,7 +585,7 @@ static void goom_port_put_buffer (xine_audio_port_t *port_gen,
}
frame->free(frame);
-
+
width = this->width;
height = this->height;
if ((width != this->width_back) || (height != this->height_back)) {
diff --git a/src/post/mosaico/mosaico.c b/src/post/mosaico/mosaico.c
index c9ac9ab4c..ec46e1ca0 100644
--- a/src/post/mosaico/mosaico.c
+++ b/src/post/mosaico/mosaico.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 mosaico plugin
*/
@@ -44,7 +44,7 @@ static void *mosaico_init_plugin(xine_t *xine, void *);
static const post_info_t mosaico_special_info = { XINE_POST_TYPE_VIDEO_COMPOSE };
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, "mosaico", XINE_VERSION_CODE, &mosaico_special_info, &mosaico_init_plugin },
{ PLUGIN_NONE, 0, "", 0, NULL, NULL }
};
@@ -84,9 +84,9 @@ struct mosaico_pip_s {
};
struct post_mosaico_s {
- post_plugin_t post;
+ post_plugin_t post;
xine_post_in_t parameter_input;
-
+
mosaico_pip_t *pip;
int64_t vpts_limit;
pthread_cond_t vpts_limit_changed;
@@ -130,7 +130,7 @@ static void *mosaico_init_plugin(xine_t *xine, void *data)
if (!this)
return NULL;
-
+
this->class.open_plugin = mosaico_open_plugin;
this->class.get_identifier = mosaico_get_identifier;
this->class.get_description = mosaico_get_description;
@@ -149,17 +149,17 @@ static post_plugin_t *mosaico_open_plugin(post_class_t *class_gen, int inputs,
xine_post_in_t *input_api;
post_out_t *output;
post_video_port_t *port;
- static xine_post_api_t post_api =
+ static xine_post_api_t post_api =
{ mosaico_set_parameters, mosaico_get_parameters, mosaico_get_param_descr, mosaico_get_help };
int i;
-
+
lprintf("mosaico open\n");
if (inputs < 2 || !this || !video_target || !video_target[0]) {
free(this);
return NULL;
}
-
+
_x_post_init(&this->post, 0, inputs);
this->pip = (mosaico_pip_t *)calloc((inputs - 1), sizeof(mosaico_pip_t));
@@ -167,7 +167,7 @@ static post_plugin_t *mosaico_open_plugin(post_class_t *class_gen, int inputs,
pthread_cond_init(&this->vpts_limit_changed, NULL);
pthread_mutex_init(&this->mutex, NULL);
-
+
/* the port for the background video */
port = _x_post_intercept_video_port(&this->post, video_target[0], &input, &output);
port->intercept_frame = mosaico_intercept_frame;
@@ -183,7 +183,7 @@ static post_plugin_t *mosaico_open_plugin(post_class_t *class_gen, int inputs,
this->pip[i].w = 150;
this->pip[i].h = 150;
asprintf(&(this->pip[i].input_name), "video in %d", i+1);
-
+
port = _x_post_intercept_video_port(&this->post, video_target[0], &input, NULL);
port->new_port.close = mosaico_close;
port->intercept_frame = mosaico_intercept_frame;
@@ -224,7 +224,7 @@ static void mosaico_class_dispose(post_class_t *class_gen)
static void mosaico_dispose(post_plugin_t *this_gen)
{
post_mosaico_t *this = (post_mosaico_t *)this_gen;
-
+
if (_x_post_dispose(this_gen)) {
int i;
for (i = 0; i < this->pip_count; i++)
@@ -246,7 +246,7 @@ static int mosaico_set_parameters(xine_post_t *this_gen, void *param_gen)
{
post_mosaico_t *this = (post_mosaico_t *)this_gen;
mosaico_parameters_t *param = (mosaico_parameters_t *)param_gen;
-
+
if (param->pip_num > this->pip_count) return 0;
this->pip[param->pip_num - 1].x = param->x;
this->pip[param->pip_num - 1].y = param->y;
@@ -259,7 +259,7 @@ static int mosaico_get_parameters(xine_post_t *this_gen, void *param_gen)
{
post_mosaico_t *this = (post_mosaico_t *)this_gen;
mosaico_parameters_t *param = (mosaico_parameters_t *)param_gen;
-
+
if (param->pip_num > this->pip_count || param->pip_num < 1)
param->pip_num = 1;
param->x = this->pip[param->pip_num - 1].x;
@@ -291,7 +291,7 @@ static void mosaico_close(xine_video_port_t *port_gen, xine_stream_t *stream)
for (pip_num = 0; pip_num < this->pip_count; pip_num++)
if (this->post.xine_post.video_input[pip_num+1] == port_gen) break;
-
+
pthread_mutex_lock(&this->mutex);
free_frame = this->pip[pip_num].frame;
this->pip[pip_num].frame = NULL;
@@ -320,11 +320,11 @@ static void frame_copy_content(vo_frame_t *to, vo_frame_t *from)
case XINE_IMGFMT_YUY2:
/* TODO: implement conversion to YV12 or implement support to paste
* frames of different types together */
- break;
-
+ break;
+
case XINE_IMGFMT_YV12:
/* Y */
- size = to->pitches[0] * to->height;
+ size = to->pitches[0] * to->height;
xine_fast_memcpy(to->base[0], from->base[0], size);
/* U */
@@ -349,7 +349,7 @@ static void frame_paste(post_mosaico_t *this, vo_frame_t *background, int pip_nu
unsigned long i, j;
if (!this->pip[pip_num].frame) return;
-
+
target_width = this->pip[pip_num].w;
target_height = this->pip[pip_num].h;
background_width = background->width;
@@ -364,8 +364,8 @@ static void frame_paste(post_mosaico_t *this, vo_frame_t *background, int pip_nu
switch (this->pip[pip_num].frame->format) {
case XINE_IMGFMT_YUY2:
/* TODO: implement YUY2 */
- break;
-
+ break;
+
case XINE_IMGFMT_YV12:
/* Y */
target_offset = 0;
@@ -382,7 +382,7 @@ static void frame_paste(post_mosaico_t *this, vo_frame_t *background, int pip_nu
pos = pos_y * background_width + pos_x;
target_width = (target_width + 1) / 2;
target_height = (target_height + 1) / 2;
-
+
/* U */
target_offset = 0;
for (j = 0; j < target_height; j++, target_offset += (background_width - target_width))
@@ -390,7 +390,7 @@ static void frame_paste(post_mosaico_t *this, vo_frame_t *background, int pip_nu
source_offset = ((i * scale_x) >> shift_x) + (((j * scale_y) >> shift_y) * source_width);
background->base[1][pos + target_offset] = this->pip[pip_num].frame->base[1][source_offset];
}
-
+
/* V */
target_offset = 0;
for (j = 0; j < target_height; j++, target_offset += (background_width - target_width))
@@ -398,7 +398,7 @@ static void frame_paste(post_mosaico_t *this, vo_frame_t *background, int pip_nu
source_offset = ((i * scale_x) >> shift_x) + (((j * scale_y) >> shift_y) * source_width);
background->base[2][pos + target_offset] = this->pip[pip_num].frame->base[2][source_offset];
}
-
+
break;
}
}
@@ -411,47 +411,47 @@ static int mosaico_draw_background(vo_frame_t *frame, xine_stream_t *stream)
int pip_num, skip;
pthread_mutex_lock(&this->mutex);
-
+
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);
-
+
this->vpts_limit = frame->vpts + frame->duration;
if (skip) {
this->skip = skip;
this->skip_vpts = frame->vpts;
} else
this->skip = 0;
-
+
pthread_mutex_unlock(&this->mutex);
pthread_cond_broadcast(&this->vpts_limit_changed);
-
+
return skip;
}
-
+
background = 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, background);
frame_copy_content(background, frame);
-
+
for (pip_num = 0; pip_num < this->pip_count; pip_num++)
frame_paste(this, background, pip_num);
-
+
skip = background->draw(background, stream);
_x_post_frame_copy_up(frame, background);
this->vpts_limit = background->vpts + background->duration;
background->free(background);
-
+
if (skip) {
this->skip = skip;
this->skip_vpts = frame->vpts;
} else
this->skip = 0;
-
+
pthread_mutex_unlock(&this->mutex);
pthread_cond_broadcast(&this->vpts_limit_changed);
-
+
return skip;
}
@@ -465,11 +465,11 @@ static int mosaico_draw(vo_frame_t *frame, xine_stream_t *stream)
for (pip_num = 0; pip_num < this->pip_count; pip_num++)
if (this->post.xine_post.video_input[pip_num+1] == frame->port) break;
_x_assert(pip_num < this->pip_count);
-
+
frame->lock(frame);
-
+
pthread_mutex_lock(&this->mutex);
-
+
/* the original output will never see this frame again */
_x_post_frame_u_turn(frame, stream);
while (frame->vpts > this->vpts_limit || !this->vpts_limit)
@@ -478,12 +478,12 @@ static int mosaico_draw(vo_frame_t *frame, xine_stream_t *stream)
free_frame = this->pip[pip_num].frame;
if (port->stream)
this->pip[pip_num].frame = frame;
-
+
if (this->skip && frame->vpts <= this->skip_vpts)
skip = this->skip;
else
skip = 0;
-
+
pthread_mutex_unlock(&this->mutex);
if (free_frame)
@@ -492,6 +492,6 @@ static int mosaico_draw(vo_frame_t *frame, xine_stream_t *stream)
/* do not keep this frame when no stream is connected to us,
* otherwise, this frame might never get freed */
frame->free(frame);
-
+
return skip;
}
diff --git a/src/post/mosaico/switch.c b/src/post/mosaico/switch.c
index a01c821b2..7cba7c998 100644
--- a/src/post/mosaico/switch.c
+++ b/src/post/mosaico/switch.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 switch video post plugin
*/
@@ -40,7 +40,7 @@ static void *switch_init_plugin(xine_t *xine, void *);
static const post_info_t switch_special_info = { XINE_POST_TYPE_VIDEO_COMPOSE };
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, "switch", XINE_VERSION_CODE, &switch_special_info, &switch_init_plugin },
{ PLUGIN_NONE, 0, "", 0, NULL, NULL }
};
@@ -67,7 +67,7 @@ struct post_class_switch_s {
struct post_switch_s {
post_plugin_t post;
xine_post_in_t parameter_input;
-
+
int64_t vpts_limit;
pthread_cond_t display_condition_changed;
int64_t skip_vpts;
@@ -105,7 +105,7 @@ static void *switch_init_plugin(xine_t *xine, void *data)
if (!this)
return NULL;
-
+
this->class.open_plugin = switch_open_plugin;
this->class.get_identifier = switch_get_identifier;
this->class.get_description = switch_get_description;
@@ -127,28 +127,28 @@ static post_plugin_t *switch_open_plugin(post_class_t *class_gen, int inputs,
static xine_post_api_t post_api =
{ switch_set_parameters, switch_get_parameters, switch_get_param_descr, switch_get_help };
int i;
-
+
lprintf("switch open\n");
if (inputs < 2 || !this || !video_target || !video_target[0]) {
free(this);
return NULL;
}
-
+
_x_post_init(&this->post, 0, inputs);
this->source_count = inputs;
this->selected_source = 1;
-
+
pthread_cond_init(&this->display_condition_changed, NULL);
pthread_mutex_init(&this->mutex, NULL);
-
+
port = _x_post_intercept_video_port(&this->post, video_target[0], &input, &output);
port->new_frame->draw = switch_draw;
port->port_lock = &this->mutex;
port->frame_lock = &this->mutex;
this->post.xine_post.video_input[0] = &port->new_port;
-
+
for (i = 1; i < inputs; i++) {
port = _x_post_intercept_video_port(&this->post, video_target[0], &input, NULL);
port->new_frame->draw = switch_draw;
@@ -156,7 +156,7 @@ static post_plugin_t *switch_open_plugin(post_class_t *class_gen, int inputs,
port->frame_lock = &this->mutex;
this->post.xine_post.video_input[i] = &port->new_port;
}
-
+
input_api = &this->parameter_input;
input_api->name = "parameters";
input_api->type = XINE_POST_DATA_PARAMETERS;
@@ -187,7 +187,7 @@ static void switch_class_dispose(post_class_t *class_gen)
static void switch_dispose(post_plugin_t *this_gen)
{
post_switch_t *this = (post_switch_t *)this_gen;
-
+
if (_x_post_dispose(this_gen)) {
pthread_cond_destroy(&this->display_condition_changed);
pthread_mutex_destroy(&this->mutex);
@@ -205,7 +205,7 @@ static int switch_set_parameters(xine_post_t *this_gen, void *param_gen)
{
post_switch_t *this = (post_switch_t *)this_gen;
switch_parameter_t *param = (switch_parameter_t *)param_gen;
-
+
if (param->select > this->source_count) return 0;
pthread_mutex_lock(&this->mutex);
this->selected_source = param->select;
@@ -218,7 +218,7 @@ static int switch_get_parameters(xine_post_t *this_gen, void *param_gen)
{
post_switch_t *this = (post_switch_t *)this_gen;
switch_parameter_t *param = (switch_parameter_t *)param_gen;
-
+
param->select = this->selected_source;
return 1;
}
@@ -241,7 +241,7 @@ static int switch_draw(vo_frame_t *frame, xine_stream_t *stream)
for (source_num = 1; source_num <= this->source_count; source_num++)
if (this->post.xine_post.video_input[source_num-1] == frame->port) break;
_x_assert(source_num <= this->source_count);
-
+
pthread_mutex_lock(&this->mutex);
/* the original output will probably never see this frame again */
_x_post_frame_u_turn(frame, stream);
@@ -268,6 +268,6 @@ static int switch_draw(vo_frame_t *frame, xine_stream_t *stream)
skip = 0;
pthread_mutex_unlock(&this->mutex);
}
-
+
return skip;
}
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);
diff --git a/src/post/visualizations/fft.c b/src/post/visualizations/fft.c
index e9a99911a..7e32dbbf6 100644
--- a/src/post/visualizations/fft.c
+++ b/src/post/visualizations/fft.c
@@ -1,18 +1,18 @@
/*
* Copyright (C) 2000-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
diff --git a/src/post/visualizations/fft.h b/src/post/visualizations/fft.h
index dff3cd7e8..651c7f15d 100644
--- a/src/post/visualizations/fft.h
+++ b/src/post/visualizations/fft.h
@@ -1,18 +1,18 @@
/*
* Copyright (C) 2000-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
diff --git a/src/post/visualizations/fftgraph.c b/src/post/visualizations/fftgraph.c
index 8bd30ed5c..c3f8ff9f9 100644
--- a/src/post/visualizations/fftgraph.c
+++ b/src/post/visualizations/fftgraph.c
@@ -1,18 +1,18 @@
/*
* Copyright (C) 2000-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
@@ -66,7 +66,7 @@ struct post_plugin_fftgraph_s {
/* private metronom for syncing the video */
metronom_t *metronom;
-
+
double ratio;
int data_idx;
@@ -92,21 +92,21 @@ static void fade(int r1, int g1, int b1,
int r2, int g2, int b2,
uint32_t *yuy2_colors, int steps) {
int i, r, g, b, y, u, v;
-
+
for (i = 0; i < steps; i++) {
r = r1 + (r2 - r1) * i / steps;
g = g1 + (g2 - g1) * i / steps;
b = b1 + (b2 - b1) * i / steps;
-
+
y = COMPUTE_Y(r, g, b);
u = COMPUTE_U(r, g, b);
v = COMPUTE_V(r, g, b);
-
+
*(yuy2_colors + i) = be2me_32((y << 24) |
(u << 16) |
(y << 8) |
v);
-
+
}
}
@@ -212,19 +212,19 @@ static int fftgraph_port_open(xine_audio_port_t *port_gen, xine_stream_t *stream
int i,j;
uint32_t *color_ptr;
uint32_t last_color, yuy2_black;
-
+
/* printf("fftgraph_port_open, port_gen=%p, stream=%p, this=%p\n", port_gen, stream, this); */
_x_post_rewire(&this->post);
_x_post_inc_usage(port);
-
+
port->stream = stream;
port->bits = bits;
port->rate = rate;
port->mode = mode;
-
+
this->ratio = (double)FFTGRAPH_WIDTH / (double)FFTGRAPH_HEIGHT;
-
+
this->channels = _x_ao_mode2channels(mode);
if( this->channels > MAXCHANNELS )
this->channels = MAXCHANNELS;
@@ -239,7 +239,7 @@ static int fftgraph_port_open(xine_audio_port_t *port_gen, xine_stream_t *stream
this->fft = fft_new(FFT_BITS);
this->cur_line = 0;
-
+
/* compute colors */
color_ptr = this->yuy2_colors;
/* black -> red */
@@ -253,7 +253,7 @@ static int fftgraph_port_open(xine_audio_port_t *port_gen, xine_stream_t *stream
40, 0, 160,
color_ptr, 256);
color_ptr += 256;
-
+
/* blue -> green */
fade(40, 0, 160,
40, 160, 70,
@@ -294,15 +294,15 @@ static void fftgraph_port_close(xine_audio_port_t *port_gen, xine_stream_t *stre
post_plugin_fftgraph_t *this = (post_plugin_fftgraph_t *)port->post;
port->stream = NULL;
-
+
fft_dispose(this->fft);
this->fft = NULL;
this->vo_port->close(this->vo_port, XINE_ANON_STREAM);
this->metronom->set_master(this->metronom, NULL);
-
+
port->original_port->close(port->original_port, stream );
-
+
_x_post_dec_usage(port);
}
@@ -329,7 +329,7 @@ static void fftgraph_port_put_buffer (xine_audio_port_t *port_gen,
/* pass data to original port */
port->original_port->put_buffer(port->original_port, buf, stream );
-
+
/* we must not use original data anymore, it should have already being moved
* to the fifo of free audio buffers. just use our private copy instead.
*/
@@ -372,8 +372,8 @@ static void fftgraph_port_put_buffer (xine_audio_port_t *port_gen,
this->ratio, XINE_IMGFMT_YUY2,
VO_BOTH_FIELDS);
frame->extra_info->invalid = 1;
-
- /* frame is marked as bad if we don't have enough samples for
+
+ /* frame is marked as bad if we don't have enough samples for
* updating the viz plugin (calculations may be skipped).
* we must keep the framerate though. */
if( this->data_idx == NUMSAMPLES ) {
@@ -385,10 +385,10 @@ static void fftgraph_port_put_buffer (xine_audio_port_t *port_gen,
frame->duration = 90000 * this->samples_per_frame / port->rate;
frame->pts = pts;
this->metronom->got_video_frame(this->metronom, frame);
-
+
this->sample_counter -= this->samples_per_frame;
- if( this->fft )
+ if( this->fft )
draw_fftgraph(this, frame);
else
frame->bad_frame = 1;
@@ -431,7 +431,7 @@ static post_plugin_t *fftgraph_open_plugin(post_class_t *class_gen, int inputs,
}
_x_post_init(&this->post, 1, 0);
-
+
this->metronom = _x_metronom_init(1, 0, class->xine);
this->vo_port = video_target[0];
@@ -475,16 +475,16 @@ static void fftgraph_class_dispose(post_class_t *class_gen)
void *fftgraph_init_plugin(xine_t *xine, void *data)
{
post_class_fftgraph_t *class = (post_class_fftgraph_t *)malloc(sizeof(post_class_fftgraph_t));
-
+
if (!class)
return NULL;
-
+
class->post_class.open_plugin = fftgraph_open_plugin;
class->post_class.get_identifier = fftgraph_get_identifier;
class->post_class.get_description = fftgraph_get_description;
class->post_class.dispose = fftgraph_class_dispose;
-
+
class->xine = xine;
-
+
return class;
}
diff --git a/src/post/visualizations/fftscope.c b/src/post/visualizations/fftscope.c
index ccff59634..286c4ac38 100644
--- a/src/post/visualizations/fftscope.c
+++ b/src/post/visualizations/fftscope.c
@@ -1,18 +1,18 @@
/*
* Copyright (C) 2000-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
@@ -53,7 +53,7 @@ typedef struct post_class_fftscope_s post_class_fftscope_t;
struct post_class_fftscope_s {
post_class_t post_class;
-
+
xine_t *xine;
};
@@ -63,10 +63,10 @@ struct post_plugin_fftscope_s {
/* private data */
xine_video_port_t *vo_port;
post_out_t video_output;
-
+
/* private metronom for syncing the video */
metronom_t *metronom;
-
+
double ratio;
int data_idx;
@@ -277,12 +277,12 @@ static int fftscope_port_open(xine_audio_port_t *port_gen, xine_stream_t *stream
_x_post_rewire(&this->post);
_x_post_inc_usage(port);
-
+
port->stream = stream;
port->bits = bits;
port->rate = rate;
port->mode = mode;
-
+
this->ratio = (double)FFT_WIDTH/(double)FFT_HEIGHT;
this->channels = _x_ao_mode2channels(mode);
@@ -315,15 +315,15 @@ static void fftscope_port_close(xine_audio_port_t *port_gen, xine_stream_t *stre
post_plugin_fftscope_t *this = (post_plugin_fftscope_t *)port->post;
port->stream = NULL;
-
+
fft_dispose(this->fft);
this->fft = NULL;
this->vo_port->close(this->vo_port, XINE_ANON_STREAM);
this->metronom->set_master(this->metronom, NULL);
-
+
port->original_port->close(port->original_port, stream );
-
+
_x_post_dec_usage(port);
}
@@ -393,8 +393,8 @@ static void fftscope_port_put_buffer (xine_audio_port_t *port_gen,
this->ratio, XINE_IMGFMT_YUY2,
VO_BOTH_FIELDS);
frame->extra_info->invalid = 1;
-
- /* frame is marked as bad if we don't have enough samples for
+
+ /* frame is marked as bad if we don't have enough samples for
* updating the viz plugin (calculations may be skipped).
* we must keep the framerate though. */
if( this->data_idx == NUMSAMPLES ) {
@@ -406,10 +406,10 @@ static void fftscope_port_put_buffer (xine_audio_port_t *port_gen,
frame->duration = 90000 * this->samples_per_frame / port->rate;
frame->pts = pts;
this->metronom->got_video_frame(this->metronom, frame);
-
+
this->sample_counter -= this->samples_per_frame;
- if( this->fft )
+ if( this->fft )
draw_fftscope(this, frame);
else
frame->bad_frame = 1;
@@ -423,7 +423,7 @@ static void fftscope_port_put_buffer (xine_audio_port_t *port_gen,
static void fftscope_dispose(post_plugin_t *this_gen)
{
post_plugin_fftscope_t *this = (post_plugin_fftscope_t *)this_gen;
-
+
if (_x_post_dispose(this_gen)) {
this->metronom->exit(this->metronom);
@@ -450,7 +450,7 @@ static post_plugin_t *fftscope_open_plugin(post_class_t *class_gen, int inputs,
free(this);
return NULL;
}
-
+
_x_post_init(&this->post, 1, 0);
this->metronom = _x_metronom_init(1, 0, class->xine);
@@ -496,16 +496,16 @@ static void fftscope_class_dispose(post_class_t *class_gen)
void *fftscope_init_plugin(xine_t *xine, void *data)
{
post_class_fftscope_t *class = (post_class_fftscope_t *)malloc(sizeof(post_class_fftscope_t));
-
+
if (!class)
return NULL;
-
+
class->post_class.open_plugin = fftscope_open_plugin;
class->post_class.get_identifier = fftscope_get_identifier;
class->post_class.get_description = fftscope_get_description;
class->post_class.dispose = fftscope_class_dispose;
-
+
class->xine = xine;
-
+
return &class->post_class;
}
diff --git a/src/post/visualizations/fooviz.c b/src/post/visualizations/fooviz.c
index c645601fc..ac85da304 100644
--- a/src/post/visualizations/fooviz.c
+++ b/src/post/visualizations/fooviz.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
@@ -60,7 +60,7 @@ struct post_plugin_fooviz_s {
/* private metronom for syncing the video */
metronom_t *metronom;
-
+
double ratio;
int data_idx;
@@ -90,7 +90,7 @@ static int fooviz_rewire_video(xine_post_out_t *output_gen, void *data)
xine_video_port_t *old_port = *(xine_video_port_t **)output_gen->data;
xine_video_port_t *new_port = (xine_video_port_t *)data;
post_plugin_fooviz_t *this = (post_plugin_fooviz_t *)output->post;
-
+
if (!data)
return 0;
/* register our stream at the new output port */
@@ -109,12 +109,12 @@ static int fooviz_port_open(xine_audio_port_t *port_gen, xine_stream_t *stream,
_x_post_rewire(&this->post);
_x_post_inc_usage(port);
-
+
port->stream = stream;
port->bits = bits;
port->rate = rate;
port->mode = mode;
-
+
this->ratio = (double)FOO_WIDTH/(double)FOO_HEIGHT;
this->channels = _x_ao_mode2channels(mode);
this->samples_per_frame = rate / FPS;
@@ -133,18 +133,18 @@ static void fooviz_port_close(xine_audio_port_t *port_gen, xine_stream_t *stream
post_plugin_fooviz_t *this = (post_plugin_fooviz_t *)port->post;
port->stream = NULL;
-
+
this->vo_port->close(this->vo_port, XINE_ANON_STREAM);
this->metronom->set_master(this->metronom, NULL);
-
+
port->original_port->close(port->original_port, stream );
-
+
_x_post_dec_usage(port);
}
-static void fooviz_port_put_buffer (xine_audio_port_t *port_gen,
+static void fooviz_port_put_buffer (xine_audio_port_t *port_gen,
audio_buffer_t *buf, xine_stream_t *stream) {
-
+
post_audio_port_t *port = (post_audio_port_t *)port_gen;
post_plugin_fooviz_t *this = (post_plugin_fooviz_t *)port->post;
vo_frame_t *frame;
@@ -153,34 +153,34 @@ static void fooviz_port_put_buffer (xine_audio_port_t *port_gen,
int samples_used = 0;
int64_t pts = buf->vpts;
int i, j;
-
+
/* make a copy of buf data for private use */
if( this->buf.mem_size < buf->mem_size ) {
this->buf.mem = realloc(this->buf.mem, buf->mem_size);
this->buf.mem_size = buf->mem_size;
}
- memcpy(this->buf.mem, buf->mem,
+ memcpy(this->buf.mem, buf->mem,
buf->num_frames*this->channels*((port->bits == 8)?1:2));
this->buf.num_frames = buf->num_frames;
-
+
/* pass data to original port */
- port->original_port->put_buffer(port->original_port, buf, stream );
-
+ port->original_port->put_buffer(port->original_port, buf, stream );
+
/* we must not use original data anymore, it should have already being moved
* to the fifo of free audio buffers. just use our private copy instead.
*/
- buf = &this->buf;
+ buf = &this->buf;
this->sample_counter += buf->num_frames;
-
+
j = (this->channels >= 2) ? 1 : 0;
do {
-
+
if( port->bits == 8 ) {
data8 = (int8_t *)buf->mem;
data8 += samples_used * this->channels;
-
+
/* scale 8 bit data to 16 bits and convert to signed as well */
for( i = samples_used; i < buf->num_frames && this->data_idx < NUMSAMPLES;
i++, this->data_idx++, data8 += this->channels ) {
@@ -190,24 +190,24 @@ static void fooviz_port_put_buffer (xine_audio_port_t *port_gen,
} else {
data = buf->mem;
data += samples_used * this->channels;
-
+
for( i = samples_used; i < buf->num_frames && this->data_idx < NUMSAMPLES;
i++, this->data_idx++, data += this->channels ) {
this->data[0][this->data_idx] = data[0];
this->data[1][this->data_idx] = data[j];
}
}
-
+
if( this->sample_counter >= this->samples_per_frame ) {
-
+
samples_used += this->samples_per_frame;
-
+
frame = this->vo_port->get_frame (this->vo_port, FOO_WIDTH, FOO_HEIGHT,
this->ratio, XINE_IMGFMT_YUY2,
VO_BOTH_FIELDS);
frame->extra_info->invalid = 1;
-
- /* frame is marked as bad if we don't have enough samples for
+
+ /* frame is marked as bad if we don't have enough samples for
* updating the viz plugin (calculations may be skipped).
* we must keep the framerate though. */
if( this->data_idx == NUMSAMPLES ) {
@@ -219,7 +219,7 @@ static void fooviz_port_put_buffer (xine_audio_port_t *port_gen,
frame->duration = 90000 * this->samples_per_frame / port->rate;
frame->pts = pts;
this->metronom->got_video_frame(this->metronom, frame);
-
+
this->sample_counter -= this->samples_per_frame;
memset(frame->base[0], this->current_yuv_byte, FOO_WIDTH * FOO_HEIGHT * 2);
@@ -256,14 +256,14 @@ static post_plugin_t *fooviz_open_plugin(post_class_t *class_gen, int inputs,
post_out_t *output;
post_out_t *outputv;
post_audio_port_t *port;
-
+
if (!this || !video_target || !video_target[0] || !audio_target || !audio_target[0] ) {
free(this);
return NULL;
}
-
+
_x_post_init(&this->post, 1, 0);
-
+
this->metronom = _x_metronom_init(1, 0, class->xine);
this->vo_port = video_target[0];
@@ -272,7 +272,7 @@ static post_plugin_t *fooviz_open_plugin(post_class_t *class_gen, int inputs,
port->new_port.open = fooviz_port_open;
port->new_port.close = fooviz_port_close;
port->new_port.put_buffer = fooviz_port_put_buffer;
-
+
outputv = &this->video_output;
outputv->xine_out.name = "generated video";
outputv->xine_out.type = XINE_POST_DATA_VIDEO;
@@ -280,9 +280,9 @@ static post_plugin_t *fooviz_open_plugin(post_class_t *class_gen, int inputs,
outputv->xine_out.rewire = fooviz_rewire_video;
outputv->post = &this->post;
xine_list_push_back(this->post.output, outputv);
-
+
this->post.xine_post.audio_input[0] = &port->new_port;
-
+
this->post.dispose = fooviz_dispose;
return &this->post;
@@ -307,17 +307,17 @@ static void fooviz_class_dispose(post_class_t *class_gen)
static void *fooviz_init_plugin(xine_t *xine, void *data)
{
post_class_fooviz_t *class = (post_class_fooviz_t *)malloc(sizeof(post_class_fooviz_t));
-
+
if (!class)
return NULL;
-
+
class->post_class.open_plugin = fooviz_open_plugin;
class->post_class.get_identifier = fooviz_get_identifier;
class->post_class.get_description = fooviz_get_description;
class->post_class.dispose = fooviz_class_dispose;
-
+
class->xine = xine;
-
+
return class;
}
@@ -325,7 +325,7 @@ static void *fooviz_init_plugin(xine_t *xine, void *data)
static const post_info_t fooviz_special_info = { XINE_POST_TYPE_AUDIO_VISUALIZATION };
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, "fooviz", XINE_VERSION_CODE, &fooviz_special_info, &fooviz_init_plugin },
{ PLUGIN_NONE, 0, "", 0, NULL, NULL }
};
diff --git a/src/post/visualizations/oscope.c b/src/post/visualizations/oscope.c
index a2c9c6961..28d1b4cbc 100644
--- a/src/post/visualizations/oscope.c
+++ b/src/post/visualizations/oscope.c
@@ -1,18 +1,18 @@
/*
* Copyright (C) 2000-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
@@ -59,13 +59,13 @@ struct post_plugin_oscope_s {
/* private metronom for syncing the video */
metronom_t *metronom;
-
+
double ratio;
int data_idx;
short data [MAXCHANNELS][NUMSAMPLES];
audio_buffer_t buf; /* dummy buffer just to hold a copy of audio data */
-
+
int channels;
int sample_counter;
int samples_per_frame;
@@ -130,7 +130,7 @@ static void draw_oscope_dots(post_plugin_oscope_t *this) {
/* draw channel scope */
for (i = 0; i < NUMSAMPLES; i++) {
- pixel_ptr =
+ pixel_ptr =
((OSCOPE_HEIGHT * (c * 2 + 1) / (2*this->channels) ) + (this->data[c][i] >> 9)) * OSCOPE_WIDTH + i;
this->yuv.y[pixel_ptr] = 0xFF;
this->yuv.u[pixel_ptr] = this->u_current;
@@ -161,7 +161,7 @@ static int oscope_rewire_video(xine_post_out_t *output_gen, void *data)
xine_video_port_t *old_port = *(xine_video_port_t **)output_gen->data;
xine_video_port_t *new_port = (xine_video_port_t *)data;
post_plugin_oscope_t *this = (post_plugin_oscope_t *)output->post;
-
+
if (!data)
return 0;
old_port->close(old_port, XINE_ANON_STREAM);
@@ -179,12 +179,12 @@ static int oscope_port_open(xine_audio_port_t *port_gen, xine_stream_t *stream,
_x_post_rewire(&this->post);
_x_post_inc_usage(port);
-
+
port->stream = stream;
port->bits = bits;
port->rate = rate;
port->mode = mode;
-
+
this->ratio = (double)OSCOPE_WIDTH/(double)OSCOPE_HEIGHT;
this->channels = _x_ao_mode2channels(mode);
@@ -210,15 +210,15 @@ static void oscope_port_close(xine_audio_port_t *port_gen, xine_stream_t *stream
this->vo_port->close(this->vo_port, XINE_ANON_STREAM);
this->metronom->set_master(this->metronom, NULL);
-
+
port->original_port->close(port->original_port, stream );
-
+
_x_post_dec_usage(port);
}
-static void oscope_port_put_buffer (xine_audio_port_t *port_gen,
+static void oscope_port_put_buffer (xine_audio_port_t *port_gen,
audio_buffer_t *buf, xine_stream_t *stream) {
-
+
post_audio_port_t *port = (post_audio_port_t *)port_gen;
post_plugin_oscope_t *this = (post_plugin_oscope_t *)port->post;
vo_frame_t *frame;
@@ -227,32 +227,32 @@ static void oscope_port_put_buffer (xine_audio_port_t *port_gen,
int samples_used = 0;
int64_t pts = buf->vpts;
int i, c;
-
+
/* make a copy of buf data for private use */
if( this->buf.mem_size < buf->mem_size ) {
this->buf.mem = realloc(this->buf.mem, buf->mem_size);
this->buf.mem_size = buf->mem_size;
}
- memcpy(this->buf.mem, buf->mem,
+ memcpy(this->buf.mem, buf->mem,
buf->num_frames*this->channels*((port->bits == 8)?1:2));
this->buf.num_frames = buf->num_frames;
-
+
/* pass data to original port */
- port->original_port->put_buffer(port->original_port, buf, stream );
-
+ port->original_port->put_buffer(port->original_port, buf, stream );
+
/* we must not use original data anymore, it should have already being moved
* to the fifo of free audio buffers. just use our private copy instead.
*/
- buf = &this->buf;
-
+ buf = &this->buf;
+
this->sample_counter += buf->num_frames;
-
+
do {
-
+
if( port->bits == 8 ) {
data8 = (int8_t *)buf->mem;
data8 += samples_used * this->channels;
-
+
/* scale 8 bit data to 16 bits and convert to signed as well */
for( i = samples_used; i < buf->num_frames && this->data_idx < NUMSAMPLES;
i++, this->data_idx++, data8 += this->channels )
@@ -261,23 +261,23 @@ static void oscope_port_put_buffer (xine_audio_port_t *port_gen,
} else {
data = buf->mem;
data += samples_used * this->channels;
-
+
for( i = samples_used; i < buf->num_frames && this->data_idx < NUMSAMPLES;
i++, this->data_idx++, data += this->channels )
for( c = 0; c < this->channels; c++)
this->data[c][this->data_idx] = data[c];
}
-
+
if( this->sample_counter >= this->samples_per_frame ) {
-
+
samples_used += this->samples_per_frame;
-
+
frame = this->vo_port->get_frame (this->vo_port, OSCOPE_WIDTH, OSCOPE_HEIGHT,
this->ratio, XINE_IMGFMT_YUY2,
VO_BOTH_FIELDS);
frame->extra_info->invalid = 1;
-
- /* frame is marked as bad if we don't have enough samples for
+
+ /* frame is marked as bad if we don't have enough samples for
* updating the viz plugin (calculations may be skipped).
* we must keep the framerate though. */
if( this->data_idx == NUMSAMPLES ) {
@@ -289,12 +289,12 @@ static void oscope_port_put_buffer (xine_audio_port_t *port_gen,
frame->duration = 90000 * this->samples_per_frame / port->rate;
frame->pts = pts;
this->metronom->got_video_frame(this->metronom, frame);
-
+
this->sample_counter -= this->samples_per_frame;
-
+
draw_oscope_dots(this);
yuv444_to_yuy2(&this->yuv, frame->base[0], frame->pitches[0]);
-
+
frame->draw(frame, XINE_ANON_STREAM);
frame->free(frame);
@@ -307,7 +307,7 @@ static void oscope_dispose(post_plugin_t *this_gen)
post_plugin_oscope_t *this = (post_plugin_oscope_t *)this_gen;
if (_x_post_dispose(this_gen)) {
-
+
this->metronom->exit(this->metronom);
if(this->buf.mem)
@@ -327,14 +327,14 @@ static post_plugin_t *oscope_open_plugin(post_class_t *class_gen, int inputs,
post_out_t *output;
post_out_t *outputv;
post_audio_port_t *port;
-
+
if (!this || !video_target || !video_target[0] || !audio_target || !audio_target[0] ) {
free(this);
return NULL;
}
-
+
_x_post_init(&this->post, 1, 0);
-
+
this->metronom = _x_metronom_init(1, 0, class->xine);
this->vo_port = video_target[0];
@@ -343,7 +343,7 @@ static post_plugin_t *oscope_open_plugin(post_class_t *class_gen, int inputs,
port->new_port.open = oscope_port_open;
port->new_port.close = oscope_port_close;
port->new_port.put_buffer = oscope_port_put_buffer;
-
+
outputv = &this->video_output;
outputv->xine_out.name = "generated video";
outputv->xine_out.type = XINE_POST_DATA_VIDEO;
@@ -351,9 +351,9 @@ static post_plugin_t *oscope_open_plugin(post_class_t *class_gen, int inputs,
outputv->xine_out.rewire = oscope_rewire_video;
outputv->post = &this->post;
xine_list_push_back(this->post.output, outputv);
-
+
this->post.xine_post.audio_input[0] = &port->new_port;
-
+
this->post.dispose = oscope_dispose;
return &this->post;
@@ -378,16 +378,16 @@ static void oscope_class_dispose(post_class_t *class_gen)
void *oscope_init_plugin(xine_t *xine, void *data)
{
post_class_oscope_t *class = (post_class_oscope_t *)malloc(sizeof(post_class_oscope_t));
-
+
if (!class)
return NULL;
-
+
class->post_class.open_plugin = oscope_open_plugin;
class->post_class.get_identifier = oscope_get_identifier;
class->post_class.get_description = oscope_get_description;
class->post_class.dispose = oscope_class_dispose;
-
+
class->xine = xine;
-
+
return &class->post_class;
}