Commit 1049c792 authored by Andy Wingo Wingo's avatar Andy Wingo Wingo
Browse files

removal of //-style comments don't link plugins to core libs -- the versioning...

removal of //-style comments don't link plugins to core libs -- the versioning is done internally to the plugins with...

Original commit message from CVS:
* removal of //-style comments
* don't link plugins to core libs -- the versioning is done internally to the plugins with the plugin_info struct,
and symbol resolution is lazy, so we can always know if a plugin can be loaded by the plugin_info data. in theory.
parent 1ee4a020
......@@ -10,7 +10,7 @@ BUILT_SOURCES = \
libgstidentity2_la_SOURCES = gst-identity2.gob $(GOB_FILES_ID)
libgstidentity2_la_CFLAGS = $(GST_CFLAGS)
libgstidentity2_la_LIBADD = $(GST_LIBS)
libgstidentity2_la_LIBADD =
%.c %.h %-private.h: %.gob
gob $<
......
......@@ -4,7 +4,7 @@ plugin_LTLIBRARIES = libgstalsa.la
libgstalsa_la_SOURCES = gstalsa.c
libgstalsa_la_CFLAGS = $(GST_CFLAGS) $(ALSA_CFLAGS)
libgstalsa_la_LIBADD = $(GST_LIBS) $(ALSA_LIBS)
libgstalsa_la_LIBADD = $(ALSA_LIBS)
libgstalsa_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
noinst_HEADERS = gstalsa.h
......
......@@ -57,7 +57,7 @@ static GstPad* gst_alsa_request_new_pad (GstElement *element, GstPadTemplate *te
static void gst_alsa_set_property(GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec);
static void gst_alsa_get_property(GObject *object, guint prop_id, GValue *value, GParamSpec *pspec);
static GstElementStateReturn gst_alsa_change_state(GstElement *element);
//static GstPadNegotiateReturn gst_alsa_negotiate(GstPad *pad, GstCaps **caps, gpointer *user_data);
/*static GstPadNegotiateReturn gst_alsa_negotiate(GstPad *pad, GstCaps **caps, gpointer *user_data); */
static GstCaps* gst_alsa_caps (GstAlsa *this);
......@@ -305,7 +305,7 @@ gst_alsa_init(GstAlsa *this)
gst_element_add_pad(GST_ELEMENT(this), GST_ALSA_PAD(this->pads)->pad);
//gst_pad_set_negotiate_function(GST_ALSA_PAD(this->pads)->pad, gst_alsa_negotiate);
/*gst_pad_set_negotiate_function(GST_ALSA_PAD(this->pads)->pad, gst_alsa_negotiate); */
gst_element_set_loop_function(GST_ELEMENT(this), gst_alsa_loop);
}
......@@ -358,7 +358,7 @@ gst_alsa_request_new_pad (GstElement *element, GstPadTemplate *templ, const gcha
pad->channel = channel;
pad->pad = gst_pad_new_from_template (templ, newname);
gst_element_add_pad (GST_ELEMENT (this), pad->pad);
//gst_pad_set_negotiate_function(pad->pad, gst_alsa_negotiate);
/*gst_pad_set_negotiate_function(pad->pad, gst_alsa_negotiate); */
if (this->data_interleaved && this->pads) {
gst_element_remove_pad (GST_ELEMENT (this), GST_ALSA_PAD(this->pads)->pad);
......@@ -369,7 +369,7 @@ gst_alsa_request_new_pad (GstElement *element, GstPadTemplate *templ, const gcha
this->pads = g_list_append(this->pads, pad);
// FIXME: allow interleaved access (for hw:N,M access on consumer hardware)
/* FIXME: allow interleaved access (for hw:N,M access on consumer hardware) */
if (this->data_interleaved) {
this->channels = pad->channel + 1;
......@@ -623,7 +623,7 @@ gst_alsa_caps (GstAlsa *this)
"channels", GST_PROPS_INT ((this->data_interleaved ? this->channels : 1)),
NULL);
} else {
// we'll just have to assume int, i don't feel like checking
/* we'll just have to assume int, i don't feel like checking */
if (this->format == SND_PCM_FORMAT_MU_LAW) {
law = 1;
width = 8;
......@@ -727,12 +727,12 @@ gst_alsa_negotiate(GstPad *pad, GstCaps **caps, gpointer *user_data)
this = GST_ALSA(gst_pad_get_parent(pad));
// we decide
/* we decide */
if (user_data == NULL) {
*caps = NULL;
return GST_PAD_NEGOTIATE_TRY;
}
// have we got caps?
/* have we got caps? */
else if (*caps) {
if (this->handle == NULL)
if (!gst_alsa_open_audio(this))
......@@ -748,7 +748,7 @@ gst_alsa_negotiate(GstPad *pad, GstCaps **caps, gpointer *user_data)
if (GST_FLAG_IS_SET(this, GST_ALSA_OPEN))
gst_alsa_close_audio(this);
// FIXME send out another caps if nego fails
/* FIXME send out another caps if nego fails */
if (!gst_alsa_open_audio(this))
return GST_PAD_NEGOTIATE_FAIL;
......@@ -817,7 +817,7 @@ gst_alsa_loop (GstElement *element)
xrun_detected = FALSE;
this->avail = snd_pcm_avail_update (this->handle);
// g_print ("snd_pcm_avail_update() = %d\n", this->avail);
/* g_print ("snd_pcm_avail_update() = %d\n", this->avail); */
if (this->avail < 0) {
if (this->avail == -EPIPE) {
......@@ -871,7 +871,7 @@ gst_alsa_src_process (GstAlsa *this, snd_pcm_uframes_t frames)
GstAlsaPad *pad = NULL;
GstCaps *caps;
gint unit;
// gint i=0;
/* gint i=0; */
static gboolean caps_set = FALSE;
......@@ -894,14 +894,14 @@ gst_alsa_src_process (GstAlsa *this, snd_pcm_uframes_t frames)
unit = this->sample_bytes * (this->data_interleaved ? this->channels : 1);
while (frames) {
// g_print ("(%d) frames to process: %d\n", i++, frames);
/* g_print ("(%d) frames to process: %d\n", i++, frames); */
l = this->pads;
while (l) {
pad = GST_ALSA_PAD(l);
if (!pad->buf) {
pad->buf = g_malloc(this->period_frames * unit);
// g_print ("created buffer %p of size %d\n", pad->buf, this->period_frames * unit);
/* g_print ("created buffer %p of size %d\n", pad->buf, this->period_frames * unit); */
}
/*
g_print ("pad->buf = %p, offset = %d\n", pad->buf, pad->offset);
......@@ -930,8 +930,8 @@ gst_alsa_src_process (GstAlsa *this, snd_pcm_uframes_t frames)
}
l = l->next;
}
frames -= MIN(frames, this->period_frames - pad->offset); // shouldn't
// matter which pad, in theory (tm)
frames -= MIN(frames, this->period_frames - pad->offset); /* shouldn't */
/* matter which pad, in theory (tm) */
}
return TRUE;
......@@ -1272,7 +1272,7 @@ gst_alsa_stop_audio(GstAlsa *this)
static void
gst_alsa_close_audio(GstAlsa *this)
{
// gint err;
/* gint err; */
g_return_if_fail(this != NULL);
g_return_if_fail(this->handle != NULL);
......@@ -1304,7 +1304,7 @@ gst_alsa_get_channel_addresses (GstAlsa *this)
GST_DEBUG(0, "got %d mmap'd frames\n", (int)this->avail);
// g_print ("snd_pcm_mmap_begin() sets avail = %d\n", this->avail);
/* g_print ("snd_pcm_mmap_begin() sets avail = %d\n", this->avail); */
l = this->pads;
while (l) {
......@@ -1366,7 +1366,7 @@ gst_alsa_sink_silence_on_channel (GstAlsa *this, guint32 chn, guint32 nframes)
} else {
memset (this->access_addr[chn], 0, nframes * this->sample_bytes);
}
// mark_channel_done (chn);
/* mark_channel_done (chn); */
}
/* taken directly from paul davis' memops.cc */
......
......@@ -4,7 +4,7 @@ plugin_LTLIBRARIES = libgstcdparanoia.la
libgstcdparanoia_la_SOURCES = gstcdparanoia.c
libgstcdparanoia_la_CFLAGS = $(GST_CFLAGS)
libgstcdparanoia_la_LIBADD = $(GST_LIBS) $(CDPARANOIA_LIBS)
libgstcdparanoia_la_LIBADD = $(CDPARANOIA_LIBS)
libgstcdparanoia_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
noinst_HEADERS = gstcdparanoia.h
......@@ -4,10 +4,10 @@ plugin_LTLIBRARIES = libgstgnomevfssrc.la libgstgnomevfssink.la
libgstgnomevfssrc_la_SOURCES = gstgnomevfssrc.c
libgstgnomevfssrc_la_CFLAGS = $(GST_CFLAGS) $(GNOME_VFS_CFLAGS)
libgstgnomevfssrc_la_LIBADD = $(GST_LIBS) $(GNOME_VFS_LIBS)
libgstgnomevfssrc_la_LIBADD = $(GNOME_VFS_LIBS)
libgstgnomevfssrc_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
libgstgnomevfssink_la_SOURCES = gstgnomevfssink.c
libgstgnomevfssink_la_CFLAGS = $(GST_CFLAGS) $(GNOME_VFS_CFLAGS)
libgstgnomevfssink_la_LIBADD = $(GST_LIBS) $(GNOME_VFS_LIBS)
libgstgnomevfssink_la_LIBADD = $(GNOME_VFS_LIBS)
libgstgnomevfssink_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
......@@ -224,7 +224,7 @@ static void gst_gnomevfssrc_set_property(GObject *object, guint prop_id, const G
} else {
/* otherwise set the new filename */
location = g_value_get_string (value);
/* if it's not a proper uri, default to file:// -- this
/* if it's not a proper uri, default to file: -- this
* is a crude test */
if (!strchr (location, ':'))
if (*location == '/')
......
......@@ -5,7 +5,7 @@ plugin_LTLIBRARIES = libgstvorbis.la
libgstvorbis_la_SOURCES = vorbis.c vorbisenc.c vorbisdec.c
libgstvorbis_la_CFLAGS = $(GST_CFLAGS) $(VORBIS_CFLAGS)
## AM_PATH_VORBIS also sets VORBISENC_LIBS
libgstvorbis_la_LIBADD = $(GST_LIBS) $(VORBIS_LIBS) $(VORBISENC_LIBS)
libgstvorbis_la_LIBADD = $(VORBIS_LIBS) $(VORBISENC_LIBS)
libgstvorbis_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
noinst_HEADERS = vorbisenc.h vorbisdec.h
......@@ -7,6 +7,6 @@ libgstaudio_la_SOURCES = audio.c
libgstaudioincludedir = $(includedir)/gst/audio
libgstaudioinclude_HEADERS = audio.h
libgstaudio_la_LIBADD = $(GST_LIBS)
libgstaudio_la_LIBADD =
libgstaudio_la_CFLAGS = $(GST_CFLAGS) -finline-functions -ffast-math
libgstaudio_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
......@@ -131,7 +131,7 @@ gst_audio_highest_sample_value (GstPad* pad)
GstCaps *caps = NULL;
caps = GST_PAD_CAPS (pad);
// FIXME : Please change this to a better warning method !
/* FIXME : Please change this to a better warning method ! */
if (caps == NULL)
printf ("WARNING: gstaudio: could not get caps of pad !\n");
width = gst_caps_get_int (caps, "width");
......
......@@ -27,6 +27,6 @@ ieeetest_LDFLAGS = $(GST_LIBS)
noinst_HEADERS = dct.h
libgstidct_la_LIBADD = $(GST_LIBS)
libgstidct_la_LIBADD =
libgstidct_la_CFLAGS = $(GST_CFLAGS) -finline-functions -ffast-math
libgstidct_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
......@@ -117,7 +117,7 @@ main(int argc, char **argv)
gst_trace_read_tsc(&tscstart);
gst_idct_convert(idct, testout);
gst_trace_read_tsc(&tscstop);
//printf("time %llu, %llu %lld\n", tscstart, tscstop, tscstop-tscstart);
/*printf("time %llu, %llu %lld\n", tscstart, tscstop, tscstop-tscstart); */
if (tscstop - tscstart < tscmin) tscmin = tscstop-tscstart;
if (tscstop - tscstart > tscmax) tscmax = tscstop-tscstart;
......
This diff is collapsed.
......@@ -13,7 +13,7 @@ endif
endif
libgstresample_la_SOURCES = dtos.c functable.c resample.c resample.h
libgstresample_la_LIBADD = $(GST_LIBS)
libgstresample_la_LIBADD =
libgstresample_la_CFLAGS = $(GST_CFLAGS) -ffast-math $(ARCHCFLAGS)
libgstresample_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
......
......@@ -23,13 +23,13 @@
#include <stdio.h>
#include <stdlib.h>
//#include <ml.h>
/*#include <ml.h> */
#include <resample.h>
#define short_to_double_table
//#define short_to_double_altivec
/*#define short_to_double_altivec */
#define short_to_double_unroll
#ifdef short_to_double_table
......
......@@ -124,12 +124,12 @@ double functable_eval(functable_t *t,double x)
w0 = (x - 2 * x2 + x3) * t->offset;
w1 = (-x2 + x3) * t->offset;
//printf("i=%d x=%g f0=%g f1=%g w0=%g w1=%g\n",i,x,f0,f1,w0,w1);
/*printf("i=%d x=%g f0=%g f1=%g w0=%g w1=%g\n",i,x,f0,f1,w0,w1); */
w = t->fx[i] * f0 + t->fx[i + 1] * f1 +
t->fdx[i] * w0 + t->fdx[i + 1] * w1;
//w = t->fx[i] * (1-x) + t->fx[i+1] * x;
/*w = t->fx[i] * (1-x) + t->fx[i+1] * x; */
return w;
}
......@@ -266,37 +266,37 @@ void functable_fir2_altivec(functable_t *t, float *r0, float *r1,
sum0 = 0;
sum1 = 0;
for(j=0;j<len;j++){
// t->fx, t->fdx needs to be multiplexed by n
// we need 5 consecutive floats, which fit into 2 vecs
// load v0, t->fx[i]
// load v1, t->fx[i+n]
// v2 = v0 (not correct)
// v3 = (v0>>32) || (v1<<3*32) (not correct)
//
// load v4, t->dfx[i]
// load v5, t->dfx[i+n]
// v6 = v4 (not correct)
// v7 = (v4>>32) || (v5<<3*32) (not correct)
//
// v8 = splat(f0)
// v9 = splat(f1)
// v10 = splat(w0)
// v11 = splat(w1)
//
// v12 = v2 * v8
// v12 += v3 * v9
// v12 += v6 * v10
// v12 += v7 * v11
/* t->fx, t->fdx needs to be multiplexed by n */
/* we need 5 consecutive floats, which fit into 2 vecs */
/* load v0, t->fx[i] */
/* load v1, t->fx[i+n] */
/* v2 = v0 (not correct) */
/* v3 = (v0>>32) || (v1<<3*32) (not correct) */
/* */
/* load v4, t->dfx[i] */
/* load v5, t->dfx[i+n] */
/* v6 = v4 (not correct) */
/* v7 = (v4>>32) || (v5<<3*32) (not correct) */
/* */
/* v8 = splat(f0) */
/* v9 = splat(f1) */
/* v10 = splat(w0) */
/* v11 = splat(w1) */
/* */
/* v12 = v2 * v8 */
/* v12 += v3 * v9 */
/* v12 += v6 * v10 */
/* v12 += v7 * v11 */
w = t->fx[i] * f0 + t->fx[i + 1] * f1 +
t->fdx[i] * w0 + t->fdx[i + 1] * w1;
// v13 = data[j*2]
// v14 = data[j*2+4]
// v15 = deinterlace_high(v13,v14)
// v16 = deinterlace_low(v13,v14)
// (sum0) v17 += multsum(v13,v15)
// (sum1) v18 += multsum(v14,v16)
/* v13 = data[j*2] */
/* v14 = data[j*2+4] */
/* v15 = deinterlace_high(v13,v14) */
/* v16 = deinterlace_low(v13,v14) */
/* (sum0) v17 += multsum(v13,v15) */
/* (sum1) v18 += multsum(v14,v16) */
sum0 += data[j*2] * w;
sum1 += data[j*2+1] * w;
......
......@@ -243,7 +243,7 @@ void resample_bilinear(resample_t * r)
b = r->i_start;
for (i = 0; i < r->i_samples; i++) {
b += r->i_inc;
//printf("in %d\n",i_ptr[0]);
/*printf("in %d\n",i_ptr[0]); */
if(b>=2){
printf("not expecting b>=2\n");
}
......@@ -252,7 +252,7 @@ void resample_bilinear(resample_t * r)
acc1 += (1.0 - (b-r->i_inc)) * i_ptr[1];
o_ptr[0] = rint(acc0);
//printf("out %d\n",o_ptr[0]);
/*printf("out %d\n",o_ptr[0]); */
o_ptr[1] = rint(acc1);
o_ptr += 2;
o_count++;
......@@ -319,8 +319,8 @@ void resample_sinc_slow(resample_t * r)
c1 = 0;
for (j = 0; j < r->filter_length; j++) {
weight = (x==0)?1:(sinx/x);
//printf("j %d sin %g cos %g\n",j,sinx,cosx);
//printf("j %d sin %g x %g sinc %g\n",j,sinx,x,weight);
/*printf("j %d sin %g cos %g\n",j,sinx,cosx); */
/*printf("j %d sin %g x %g sinc %g\n",j,sinx,x,weight); */
c0 += weight * GETBUF((start + j), 0);
c1 += weight * GETBUF((start + j), 1);
t = cosx * cosd - sinx * sind;
......@@ -368,11 +368,11 @@ void resample_sinc(resample_t * r)
for (i = 0; i < r->o_samples; i++) {
a = r->o_start + i * r->o_inc;
start = floor(a - r->halftaps);
//printf("%d: a=%g start=%d end=%d\n",i,a,start,start+r->filter_length-1);
/*printf("%d: a=%g start=%d end=%d\n",i,a,start,start+r->filter_length-1); */
center = a;
//x = M_PI * (start - center) * r->o_inc;
//d = M_PI * r->o_inc;
//x = (start - center) * r->o_inc;
/*x = M_PI * (start - center) * r->o_inc; */
/*d = M_PI * r->o_inc; */
/*x = (start - center) * r->o_inc; */
x0 = (start - center) * r->o_inc;
d = r->o_inc;
c0 = 0;
......@@ -439,20 +439,20 @@ static void resample_sinc_ft(resample_t * r)
double *ptr;
signed short *o_ptr;
int i;
//int j;
/*int j; */
double c0, c1;
//double a;
/*double a; */
double start_f, start_x;
int start;
double center;
//double weight;
/*double weight; */
double x, d;
double scale;
int n = 4;
scale = r->i_inc; // cutoff at 22050
//scale = 1.0; // cutoff at 24000
//scale = r->i_inc * 0.5; // cutoff at 11025
scale = r->i_inc; /* cutoff at 22050 */
/*scale = 1.0; // cutoff at 24000 */
/*scale = r->i_inc * 0.5; // cutoff at 11025 */
if(!ft){
ft = malloc(sizeof(*ft));
......@@ -472,7 +472,7 @@ static void resample_sinc_ft(resample_t * r)
functable_init(ft);
//printf("len=%d offset=%g start=%g\n",ft->len,ft->offset,ft->start);
/*printf("len=%d offset=%g start=%g\n",ft->len,ft->offset,ft->start); */
}
ptr = r->buffer;
......@@ -484,18 +484,18 @@ static void resample_sinc_ft(resample_t * r)
start_x -= start_f;
start = start_f;
for (i = 0; i < r->o_samples; i++) {
//start_f = floor(center - r->halftaps);
//printf("%d: a=%g start=%d end=%d\n",i,a,start,start+r->filter_length-1);
/*start_f = floor(center - r->halftaps); */
/*printf("%d: a=%g start=%d end=%d\n",i,a,start,start+r->filter_length-1); */
x = start_f - center;
d = 1;
c0 = 0;
c1 = 0;
//#define slow
/*#define slow */
#ifdef slow
for (j = 0; j < r->filter_length; j++) {
weight = functable_eval(ft,x)*scale;
//weight = sinc(M_PI * scale * x)*scale*r->i_inc;
//weight *= window_func(x / r->halftaps);
/*weight = sinc(M_PI * scale * x)*scale*r->i_inc; */
/*weight *= window_func(x / r->halftaps); */
c0 += weight * ptr[(start + j + r->filter_length)*2 + 0];
c1 += weight * ptr[(start + j + r->filter_length)*2 + 1];
x += d;
......
......@@ -9,11 +9,11 @@
#define AMP 16000
#define I_RATE 48000
#define O_RATE 44100
//#define O_RATE 24000
/*#define O_RATE 24000 */
//#define test_func(x) 1
//#define test_func(x) sin(2*M_PI*(x)*10)
//#define test_func(x) sin(2*M_PI*(x)*(x)*1000)
/*#define test_func(x) 1 */
/*#define test_func(x) sin(2*M_PI*(x)*10) */
/*#define test_func(x) sin(2*M_PI*(x)*(x)*1000) */
#define test_func(x) sin(2*M_PI*(x)*(x)*12000)
short i_buf[I_RATE*2*2];
......@@ -53,7 +53,7 @@ struct timeval start_time;
void start_timer(void)
{
gettimeofday(&start_time,NULL);
//printf("start %ld.%06ld\n",start_time.tv_sec,start_time.tv_usec);
/*printf("start %ld.%06ld\n",start_time.tv_sec,start_time.tv_usec); */
}
void end_timer(void)
......@@ -62,7 +62,7 @@ void end_timer(void)
double diff;
gettimeofday(&end_time,NULL);
//printf("end %ld.%06ld\n",end_time.tv_sec,end_time.tv_usec);
/*printf("end %ld.%06ld\n",end_time.tv_sec,end_time.tv_usec); */
diff = (end_time.tv_sec - start_time.tv_sec) +
1e-6*(end_time.tv_usec - start_time.tv_usec);
......@@ -81,7 +81,7 @@ void test_res1(void)
for(i=0;i<I_RATE;i++){
i_buf[i*2+0] = rint(AMP * test_func((double)i/I_RATE));
//i_buf[i*2+1] = rint(AMP * test_func((double)i/I_RATE));
/*i_buf[i*2+1] = rint(AMP * test_func((double)i/I_RATE)); */
i_buf[i*2+1] = (i<1000)?AMP:0;
}
......@@ -90,10 +90,10 @@ void test_res1(void)
r->i_rate = I_RATE;
r->o_rate = O_RATE;
//r->method = RESAMPLE_SINC_SLOW;
/*r->method = RESAMPLE_SINC_SLOW; */
r->method = RESAMPLE_SINC;
r->channels = 2;
//r->verbose = 1;
/*r->verbose = 1; */
r->filter_length = 64;
r->get_buffer = get_buffer;
......@@ -115,7 +115,7 @@ void test_res1(void)
for(i=0;i<O_RATE;i++){
f = AMP*test_func((double)i/O_RATE);
//f = rint(AMP*test_func((double)i/O_RATE));
/*f = rint(AMP*test_func((double)i/O_RATE)); */
fprintf(out,"%d %d %d %g %g\n",i,
o_buf[2*i+0],o_buf[2*i+1],
f,o_buf[2*i+0]-f);
......@@ -127,7 +127,7 @@ void test_res1(void)
n22k=0;
for(i=0;i<O_RATE;i++){
f = AMP*test_func((double)i/O_RATE);
//f = rint(AMP*test_func((double)i/O_RATE));
/*f = rint(AMP*test_func((double)i/O_RATE)); */
x = o_buf[2*i+0]-f;
if(((0.5*i)/O_RATE*I_RATE)<10000){
sum10k += x*x;
......@@ -219,8 +219,8 @@ double sinc_poly(double x)
- x2 * INV3FAC
+ x2 * x2 * INV5FAC
- x2 * x2 * x2 * INV7FAC;
//+ x2 * x2 * x2 * x2 * INV9FAC
//- x2 * x2 * x2 * x2 * x2 * INV11FAC;
/*+ x2 * x2 * x2 * x2 * INV9FAC */
/*- x2 * x2 * x2 * x2 * x2 * INV11FAC; */
}
void test_res4(void)
......@@ -297,10 +297,10 @@ void test_res7(void)
r->i_rate = I_RATE;
r->o_rate = O_RATE;
//r->method = RESAMPLE_SINC_SLOW;
/*r->method = RESAMPLE_SINC_SLOW; */
r->method = RESAMPLE_SINC;
r->channels = 1;
//r->verbose = 1;
/*r->verbose = 1; */
r->filter_length = 64;
r->get_buffer = get_buffer;
......@@ -322,7 +322,7 @@ void test_res7(void)
for(i=0;i<O_RATE;i++){
f = AMP*test_func((double)i/O_RATE);
//f = rint(AMP*test_func((double)i/O_RATE));
/*f = rint(AMP*test_func((double)i/O_RATE)); */
fprintf(out,"%d %d %d %g %g\n",i,
o_buf[i],0,
f,o_buf[i]-f);
......@@ -334,7 +334,7 @@ void test_res7(void)
n22k=0;
for(i=0;i<O_RATE;i++){
f = AMP*test_func((double)i/O_RATE);
//f = rint(AMP*test_func((double)i/O_RATE));
/*f = rint(AMP*test_func((double)i/O_RATE)); */
x = o_buf[i]-f;
if(((0.5*i)/O_RATE*I_RATE)<10000){
sum10k += x*x;
......
......@@ -7,6 +7,6 @@ libgstriff_la_SOURCES = riffparse.c riffencode.c riffutil.c
libgstriffincludedir = $(includedir)/gst/riff
libgstriffinclude_HEADERS = riff.h
libgstriff_la_LIBADD = $(GST_LIBS)
libgstriff_la_LIBADD =
libgstriff_la_CFLAGS = $(GST_CFLAGS) -funroll-all-loops -finline-functions -ffast-math
libgstriff_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
......@@ -20,7 +20,7 @@
#include <riff.h>
//#define debug(format,args...) g_print(format,##args)
/*#define debug(format,args...) g_print(format,##args) */
#define debug(format,args...)
......@@ -69,33 +69,33 @@ gint gst_riff_next_buffer(GstRiff *riff,GstBuffer *buf,gulong off) {
GST_BUFFER_DATA(buf) = riff->dataleft;
GST_BUFFER_SIZE(buf) = newsize;
off -= riff->dataleft_size;
//last -= riff->dataleft_size;
/*last -= riff->dataleft_size; */
riff->dataleft = NULL;
}
if (off == 0) {
guint32 *words = (guin32 *)GST_BUFFER_DATA(buf);
// don't even try to parse the head if it's not there FIXME
/* don't even try to parse the head if it's not there FIXME */
if (last < 12) {
riff->state = GST_RIFF_ENOTRIFF;
return riff->state;
}
//g_print("testing is 0x%08lx '%s'\n",words[0],gst_riff_id_to_fourcc(words[0]));
/*g_print("testing is 0x%08lx '%s'\n",words[0],gst_riff_id_to_fourcc(words[0])); */
/* verify this is a valid RIFF file, first of all */
if (GUINT32_FROM_LE (words[0]) != GST_RIFF_TAG_RIFF) {
riff->state = GST_RIFF_ENOTRIFF;
return riff->state;
}
riff->form = GUINT32_FROM_LE (words[2]);
//g_print("form is 0x%08lx '%s'\n",words[2],gst_riff_id_to_fourcc(words[2]));
/*g_print("form is 0x%08lx '%s'\n",words[2],gst_riff_id_to_fourcc(words[2])); */
riff->nextlikely = 12; /* skip 'RIFF', length, and form */
// all OK here
/* all OK here */
riff->incomplete_chunk = NULL;
}
// if we have an incomplete chunk from the previous buffer
/* if we have an incomplete chunk from the previous buffer */
if (riff->incomplete_chunk) {
guint leftover;
debug("have incomplete chunk %08x filled\n", riff->incomplete_chunk_size);
......@@ -135,14 +135,14 @@ gint gst_riff_next_buffer(GstRiff *riff,GstBuffer *buf,gulong off) {
while ((riff->nextlikely+12) <= last) {
guin32 *words = (guin32 *)((guchar *)GST_BUFFER_DATA(buf) + riff->nextlikely - off );
// loop over all of the chunks to check which one is finished
/* loop over all of the chunks to check wh