Commit 217a4736 authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Delete galaktos plugin.

This hasn't work for quite some time and we have projectM module.
Moreover, noone complained.
parent cc1d1e62
......@@ -29,6 +29,7 @@ Visualisation:
Removed modules:
* csri
* galaktos
Changes between 0.9.9a and 1.0.0:
---------------------------------
......
......@@ -721,7 +721,7 @@ AC_CHECK_LIB(m,cos,[
VLC_ADD_LIBS([adjust wave ripple psychedelic gradient a52tofloat32 dtstofloat32 x264 goom visual panoramix rotate noise grain scene],[-lm])
])
AC_CHECK_LIB(m,pow,[
VLC_ADD_LIBS([avcodec avformat swscale postproc ffmpegaltivec stream_out_transrate i420_rgb faad twolame equalizer spatializer param_eq libvlccore freetype mod mpc dmo quicktime realaudio realvideo galaktos opengl],[-lm])
VLC_ADD_LIBS([avcodec avformat swscale postproc ffmpegaltivec stream_out_transrate i420_rgb faad twolame equalizer spatializer param_eq libvlccore freetype mod mpc dmo quicktime realaudio realvideo opengl],[-lm])
])
AC_CHECK_LIB(m,sqrt,[
VLC_ADD_LIBS([headphone_channel_mixer normvol speex mono colorthres extract],[-lm])
......@@ -4694,23 +4694,6 @@ then
VLC_ADD_PLUGIN([visual])
fi
dnl
dnl OpenGL visualisation plugin
dnl
AC_ARG_ENABLE(galaktos,
[ --enable-galaktos OpenGL visualisation plugin (default disabled)])
if test "${enable_galaktos}" = "yes"
then
AC_CHECK_HEADERS(GL/gl.h GL/glu.h, [
VLC_ADD_PLUGIN([galaktos])
if test "${SYS}" != "mingw32"; then
VLC_ADD_LIBS([galaktos],[${X_LIBS} -lGL -lGLU])
else
VLC_ADD_LIBS([galaktos],[-lopengl32])
fi
])
fi
dnl
dnl goom visualization plugin
dnl
......@@ -5455,7 +5438,6 @@ AC_CONFIG_FILES([
modules/video_output/x11/Makefile
modules/visualization/Makefile
modules/visualization/visual/Makefile
modules/visualization/galaktos/Makefile
])
dnl Generate makefiles
......
......@@ -116,7 +116,6 @@ $Id$
* folder: folder meta data and art finder
* freetype: Utility to put text on video using freetype2
* ftp : FTP input module
* galaktos: a visualization module that outputs OpenGL
* gapi: PocketPC Video output
* gaussianblur: gaussian blur video filter
* gestures: mouse gestures control plugin
......
SUBDIRS = visual galaktos
SUBDIRS = visual
SOURCES_goom = goom.c
SOURCES_projectm = projectm.cpp
SOURCES_galaktos = plugin.c plugin.h \
main.c main.h \
preset.c preset.h preset_types.h \
beat_detect.c beat_detect.h \
builtin_funcs.h common.h compare.h expr_types.h \
fatal.h idle_preset.h interface_types.h per_point_types.h \
param.c param.h param_types.h \
engine_vars.c engine_vars.h \
parser.c parser.h \
eval.c eval.h \
init_cond.c init_cond.h init_cond_types.h \
PCM.c PCM.h \
fftsg.c fftsg.h \
per_frame_eqn.c per_frame_eqn.h per_frame_eqn_types.h \
splaytree.c splaytree.h splaytree_types.h \
custom_shape.c custom_shape.h custom_shape_types.h \
func.c func.h func_types.h \
per_pixel_eqn.c per_pixel_eqn.h per_pixel_eqn_types.h \
tree_types.c tree_types.h \
custom_wave.c custom_wave.h custom_wave_types.h \
video_init.c video_init.h
/*****************************************************************************
* PCM.c:
*****************************************************************************
* Copyright (C) 2004 the VideoLAN team
* $Id$
*
* Authors: Cyril Deguet <asmax@videolan.org>
* code from projectM http://xmms-projectm.sourceforge.net
*
* This program 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.
*
* This program 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-1301, USA.
*****************************************************************************/
//PCM.c - Sound data handler
//
//by Peter Sperl
//
//Takes sound data from wherever and hands it back out.
//Returns PCM Data or spectrum data, or the derivative of the PCM data
#include <stdlib.h>
#include <stdio.h>
#include <inttypes.h>
#include "fftsg.h"
double **PCMd; //data structure to store PCM data PCM[channels][maxsamples]
int maxsamples; //size of PCM buffer
int start; //where to add data next
int *ip; //working space for FFT routines
double *w; //lookup table for FFT routines
int new; //how many new samples
//initPCM(int samples)
//
//Initializes the PCM buffer to
// number of samples specified.
void initPCM(int samples)
{
int i;
//Allocate memory for PCM data buffer
PCMd = (double **)malloc(2 * sizeof(double *));
PCMd[0] = (double *)malloc(samples * sizeof(double));
PCMd[1] = (double *)malloc(samples * sizeof(double));
maxsamples=samples;
new=0;
//Initialize buffers to 0
for (i=0;i<samples;i++)
{
PCMd[0][i]=0;
PCMd[1][i]=0;
}
start=0;
//Allocate FFT workspace
w= (double *)malloc(maxsamples*sizeof(double));
ip= (int *)malloc(maxsamples*sizeof(int));
ip[0]=0;
}
//The only current addPCM function, can support more
//
//Takes in a 2x512 array of PCM samples
//and stores them
void addPCM(int16_t PCMdata[2][512])
{
int i,j;
int samples=512;
for(i=0;i<samples;i++)
{
j=i+start;
PCMd[0][j%maxsamples]=(PCMdata[0][i]/16384.0);
PCMd[1][j%maxsamples]=(PCMdata[1][i]/16384.0);
}
// printf("Added %d samples %d %d %f\n",samples,start,(start+samples)%maxsamples,PCM[0][start+10]);
start+=samples;
start=start%maxsamples;
new+=samples;
if (new>maxsamples) new=maxsamples;
}
//puts sound data requested at provided pointer
//
//samples is number of PCM samples to return
//freq = 0 gives PCM data
//freq = 1 gives FFT data
//smoothing is the smoothing coefficient
//returned values are normalized from -1 to 1
void getPCM(double *PCMdata, int samples, int channel, int freq, double smoothing, int derive)
{
int i,index;
index=start-1;
if (index<0) index=maxsamples+index;
PCMdata[0]=PCMd[channel][index];
for(i=1;i<samples;i++)
{
index=start-1-i;
if (index<0) index=maxsamples+index;
PCMdata[i]=(1-smoothing)*PCMd[channel][index]+smoothing*PCMdata[i-1];
}
//return derivative of PCM data
if(derive)
{
for(i=0;i<samples-1;i++)
{
PCMdata[i]=PCMdata[i]-PCMdata[i+1];
}
PCMdata[samples-1]=0;
}
//return frequency data instead of PCM (perform FFT)
if (freq) rdft(samples, 1, PCMdata, ip, w);
}
//getPCMnew
//
//Like getPCM except it returns all new samples in the buffer
//the actual return value is the number of samples, up to maxsamples.
//the passed pointer, PCMData, must bee able to hold up to maxsamples
int getPCMnew(double *PCMdata, int channel, int freq, double smoothing, int derive, int reset)
{
int i,index;
index=start-1;
if (index<0) index=maxsamples+index;
PCMdata[0]=PCMd[channel][index];
for(i=1;i<new;i++)
{
index=start-1-i;
if (index<0) index=maxsamples+index;
PCMdata[i]=(1-smoothing)*PCMd[channel][index]+smoothing*PCMdata[i-1];
}
//return derivative of PCM data
if(derive)
{
for(i=0;i<new-1;i++)
{
PCMdata[i]=PCMdata[i]-PCMdata[i+1];
}
PCMdata[new-1]=0;
}
//return frequency data instead of PCM (perform FFT)
// if (freq) rdft(samples, 1, PCMdata, ip, w);
i=new;
if (reset) new=0;
return i;
}
//Free stuff
void freePCM()
{
free(PCMd[0]);
free(PCMd[1]);
free(PCMd);
free(ip);
free(w);
}
void initPCM(int maxsamples);
void addPCM(int16_t [2][512]);
void getPCM(double *data, int samples, int channel, int freq, double smoothing, int derive);
void freePCM();
int getPCMnew(double *PCMdata, int channel, int freq, double smoothing, int derive,int reset);
/*****************************************************************************
* beat_detect.c: basic beat detection algorithm
*****************************************************************************
* Copyright (C) 2004 the VideoLAN team
* $Id$
*
* Authors: Cyril Deguet <asmax@videolan.org>
* code from projectM http://xmms-projectm.sourceforge.net
*
* This program 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.
*
* This program 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-1301, USA.
*****************************************************************************/
//
//by Peter Sperl
//
//Takes sound data from wherever and returns beat detection values
//Uses statistical Energy-Based methods. Very simple
//
//Some stuff was taken from Frederic Patin's beat-detection article, you'll find it online
#include <stdlib.h>
#include <stdio.h>
#include "engine_vars.h"
double beat_buffer[32][80],beat_instant[32],beat_history[32];
double *beat_val,*beat_att,*beat_variance;
int beat_buffer_pos;
double vol_buffer[80],vol_instant,vol_history;
void initBeatDetect()
{
int x,y;
vol_instant=0;
vol_history=0;
for (y=0;y<80;y++)
{
vol_buffer[y]=0;
}
beat_buffer_pos=0;
beat_val=(double *)malloc(32*sizeof(double));
beat_att=(double *)malloc(32*sizeof(double));
beat_variance=(double *)malloc(32*sizeof(double));
for (x=0;x<32;x++)
{
beat_instant[x]=0;
beat_history[x]=0;
beat_val[x]=1.0;
beat_att[x]=1.0;
beat_variance[x]=0;
for (y=0;y<80;y++)
{
beat_buffer[x][y]=0;
}
}
}
void getBeatVals(double *vdataL,double *vdataR, double *vol)
{
int linear=0;
int x,y;
vol_instant=0;
for ( x=0;x<16;x++)
{
beat_instant[x]=0;
for ( y=linear*2;y<(linear+8+x)*2;y++)
{
beat_instant[x]+=((vdataL[y]*vdataL[y])+(vdataR[y]*vdataR[y]))*(1.0/(8+x));
vol_instant+=((vdataL[y]*vdataL[y])+(vdataR[y]*vdataR[y]))*(1.0/512.0);
}
linear=y/2;
beat_history[x]-=(beat_buffer[x][beat_buffer_pos])*.0125;
beat_buffer[x][beat_buffer_pos]=beat_instant[x];
beat_history[x]+=(beat_instant[x])*.0125;
beat_val[x]=(beat_instant[x])/(beat_history[x]);
beat_att[x]+=(beat_instant[x])/(beat_history[x]);
}
vol_history-=(vol_buffer[beat_buffer_pos])*.0125;
vol_buffer[beat_buffer_pos]=vol_instant;
vol_history+=(vol_instant)*.0125;
double temp2=0;
mid=0;
for(x=1;x<10;x++)
{
mid+=(beat_instant[x]);
temp2+=(beat_history[x]);
}
mid=mid/(1.5*temp2);
temp2=0;
treb=0;
for(x=10;x<16;x++)
{
treb+=(beat_instant[x]);
temp2+=(beat_history[x]);
}
treb=treb/(1.5*temp2);
*vol=vol_instant/(1.5*vol_history);
bass=(beat_instant[0])/(1.5*beat_history[0]);
treb_att=.6 * treb_att + .4 * treb;
mid_att=.6 * mid_att + .4 * mid;
bass_att=.6 * bass_att + .4 * bass;
//printf("%f %f %f %f\n",bass,mid,treb,*vol);
// *vol=(beat_instant[3])/(beat_history[3]);
beat_buffer_pos++;
if( beat_buffer_pos>79)beat_buffer_pos=0;
}
void freeBeatDetect()
{
free(beat_att);
free(beat_val);
free(beat_variance);
}
void initBeatDetect();
void getBeatVals(double *vdataL,double *vdataR,double *vol);
void freeBeatDetect();
/*****************************************************************************
* builtin_funcs.c:
*****************************************************************************
* Copyright (C) 2004 the VideoLAN team
* $Id$
*
* Authors: Cyril Deguet <asmax@videolan.org>
* code from projectM http://xmms-projectm.sourceforge.net
*
* This program 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.
*
* This program 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-1301, USA.
*****************************************************************************/
#include <math.h>
#include <stdlib.h>
#include <stdio.h>
/* Values to optimize the sigmoid function */
#define R 32767
#define RR 65534
static inline double int_wrapper(double * arg_list) {
return floor(arg_list[0]);
}
static inline double sqr_wrapper(double * arg_list) {
return pow(2, arg_list[0]);
}
static inline double sign_wrapper(double * arg_list) {
return -arg_list[0];
}
static inline double min_wrapper(double * arg_list) {
if (arg_list[0] > arg_list[1])
return arg_list[1];
return arg_list[0];
}
static inline double max_wrapper(double * arg_list) {
if (arg_list[0] > arg_list[1])
return arg_list[0];
return arg_list[1];
}
/* consult your AI book */
static inline double sigmoid_wrapper(double * arg_list) {
return (RR / (1 + exp( -(((double)(arg_list[0])) * arg_list[1]) / R) - R));
}
static inline double bor_wrapper(double * arg_list) {
return (double)((int)arg_list[0] || (int)arg_list[1]);
}
static inline double band_wrapper(double * arg_list) {
return (double)((int)arg_list[0] && (int)arg_list[1]);
}
static inline double bnot_wrapper(double * arg_list) {
return (double)(!(int)arg_list[0]);
}
static inline double if_wrapper(double * arg_list) {
if ((int)arg_list[0] == 0)
return arg_list[2];
return arg_list[1];
}
static inline double rand_wrapper(double * arg_list) {
double l;
// printf("RAND ARG:(%d)\n", (int)arg_list[0]);
l = (double)((rand()) % ((int)arg_list[0]));
//printf("VAL: %f\n", l);
return l;
}
static inline double equal_wrapper(double * arg_list) {
return (arg_list[0] == arg_list[1]);
}
static inline double above_wrapper(double * arg_list) {
return (arg_list[0] > arg_list[1]);
}
static inline double below_wrapper(double * arg_list) {
return (arg_list[0] < arg_list[1]);
}
static inline double sin_wrapper(double * arg_list) {
return (sin (arg_list[0]));
}
static inline double cos_wrapper(double * arg_list) {
return (cos (arg_list[0]));
}
static inline double tan_wrapper(double * arg_list) {
return (tan(arg_list[0]));
}
static inline double asin_wrapper(double * arg_list) {
return (asin (arg_list[0]));
}
static inline double acos_wrapper(double * arg_list) {
return (acos (arg_list[0]));
}
static inline double atan_wrapper(double * arg_list) {
return (atan (arg_list[0]));
}
static inline double atan2_wrapper(double * arg_list) {
return (atan2 (arg_list[0], arg_list[1]));
}
static inline double pow_wrapper(double * arg_list) {
return (pow (arg_list[0], arg_list[1]));
}
static inline double exp_wrapper(double * arg_list) {
return (exp(arg_list[0]));
}
static inline double abs_wrapper(double * arg_list) {
return (fabs(arg_list[0]));
}
static inline double log_wrapper(double *arg_list) {
return (log (arg_list[0]));
}
static inline double log10_wrapper(double * arg_list) {
return (log10 (arg_list[0]));
}