summaryrefslogtreecommitdiffstats
path: root/libaf
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2012-08-01 17:07:35 +0200
committerwm4 <wm4@nowhere>2012-08-01 17:07:35 +0200
commitc92538dfaa5eb7e9b2773f158cbb310545116abe (patch)
tree4b1ab99a17cbead6ff1b7bf9714642540cd66ce4 /libaf
parent7175f178de72bb4f31cacd79b395a14beaf2f65a (diff)
downloadmpv-c92538dfaa5eb7e9b2773f158cbb310545116abe.tar.bz2
mpv-c92538dfaa5eb7e9b2773f158cbb310545116abe.tar.xz
Remove dead code
This was done with the help of callcatcher [1]. Only functions which are statically known to be unused are removed. Some unused functions are not removed yet, because they might be needed in the near future (such as open_output_stream for the encode branch). There is one user visible change: the --subcc option did nothing, and is removed with this commit. [1] http://www.skynet.ie/~caolan/Packages/callcatcher.html
Diffstat (limited to 'libaf')
-rw-r--r--libaf/af_format.h1
-rw-r--r--libaf/filter.c90
-rw-r--r--libaf/filter.h13
-rw-r--r--libaf/format.c45
4 files changed, 0 insertions, 149 deletions
diff --git a/libaf/af_format.h b/libaf/af_format.h
index 751e97ef3a..e5e5e15b58 100644
--- a/libaf/af_format.h
+++ b/libaf/af_format.h
@@ -111,7 +111,6 @@
#define AF_FORMAT_IS_AC3(fmt) (((fmt) & AF_FORMAT_SPECIAL_MASK) == AF_FORMAT_AC3)
-int af_str2fmt(const char *str);
int af_str2fmt_short(const char *str);
int af_fmt2bits(int format);
int af_bits2fmt(int bits);
diff --git a/libaf/filter.c b/libaf/filter.c
index c5ab039130..b272125fd8 100644
--- a/libaf/filter.c
+++ b/libaf/filter.c
@@ -46,51 +46,6 @@ inline FLOAT_TYPE af_filter_fir(register unsigned int n, const FLOAT_TYPE* w,
return y;
}
-/* C implementation of parallel FIR filter y(k)=w(k) * x(k) (where * denotes convolution)
-
- n number of filter taps, where mod(n,4)==0
- 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
- y output buffer
- s output buffer stride
-*/
-FLOAT_TYPE* af_filter_pfir(unsigned int n, unsigned int d, unsigned int xi,
- const FLOAT_TYPE** w, const FLOAT_TYPE** x, FLOAT_TYPE* y,
- unsigned int s)
-{
- register const FLOAT_TYPE* xt = *x + xi;
- register const FLOAT_TYPE* wt = *w;
- register int nt = 2*n;
- while(d-- > 0){
- *y = af_filter_fir(n,wt,xt);
- wt+=n;
- xt+=nt;
- y+=s;
- }
- return y;
-}
-
-/* Add new data to circular queue designed to be used with a parallel
- FIR filter, with d filters. xq is the circular queue, in pointing
- 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.
-*/
-int af_filter_updatepq(unsigned int n, unsigned int d, unsigned int xi,
- FLOAT_TYPE** xq, const FLOAT_TYPE* in, unsigned int s)
-{
- register FLOAT_TYPE* txq = *xq + xi;
- register int nt = n*2;
-
- while(d-- >0){
- *txq= *(txq+n) = *in;
- txq+=nt;
- in+=s;
- }
- return (++xi)&(n-1);
-}
-
/******************************************************************************
* FIR filter design
******************************************************************************/
@@ -234,51 +189,6 @@ int af_filter_design_fir(unsigned int n, FLOAT_TYPE* w, const FLOAT_TYPE* fc,
return 0;
}
-/* Design polyphase FIR filter from prototype filter
-
- n length of prototype filter
- k number of polyphase components
- w prototype filter taps
- pw Parallel FIR filter
- g Filter gain
- flags FWD forward indexing
- REW reverse indexing
- ODD multiply every 2nd filter tap by -1 => HP filter
-
- returns 0 if OK, -1 if fail
-*/
-int af_filter_design_pfir(unsigned int n, unsigned int k, const FLOAT_TYPE* w,
- FLOAT_TYPE** pw, FLOAT_TYPE g, unsigned int flags)
-{
- int l = (int)n/k; // Length of individual FIR filters
- int i; // Counters
- int j;
- FLOAT_TYPE t; // g * w[i]
-
- // Sanity check
- if(l<1 || k<1 || !w || !pw)
- return -1;
-
- // Do the stuff
- if(flags&REW){
- for(j=l-1;j>-1;j--){//Columns
- for(i=0;i<(int)k;i++){//Rows
- t=g * *w++;
- pw[i][j]=t * ((flags & ODD) ? ((j & 1) ? -1 : 1) : 1);
- }
- }
- }
- else{
- for(j=0;j<l;j++){//Columns
- for(i=0;i<(int)k;i++){//Rows
- t=g * *w++;
- pw[i][j]=t * ((flags & ODD) ? ((j & 1) ? 1 : -1) : 1);
- }
- }
- }
- return -1;
-}
-
/******************************************************************************
* IIR filter design
******************************************************************************/
diff --git a/libaf/filter.h b/libaf/filter.h
index a7c8a71c6a..aed33352c2 100644
--- a/libaf/filter.h
+++ b/libaf/filter.h
@@ -56,22 +56,9 @@
// Exported functions
FLOAT_TYPE af_filter_fir(unsigned int n, const FLOAT_TYPE* w, const FLOAT_TYPE* x);
-FLOAT_TYPE* af_filter_pfir(unsigned int n, unsigned int k,
- unsigned int xi, const FLOAT_TYPE** w,
- const FLOAT_TYPE** x, FLOAT_TYPE* y,
- unsigned int s);
-
-//int af_filter_updateq(unsigned int n, unsigned int xi,
-// FLOAT_TYPE* xq, FLOAT_TYPE* in);
-int af_filter_updatepq(unsigned int n, unsigned int k, unsigned int xi,
- FLOAT_TYPE** xq, const FLOAT_TYPE* in, unsigned int s);
-
int af_filter_design_fir(unsigned int n, FLOAT_TYPE* w, const FLOAT_TYPE* fc,
unsigned int flags, FLOAT_TYPE opt);
-int af_filter_design_pfir(unsigned int n, unsigned int k, const FLOAT_TYPE* w,
- FLOAT_TYPE** pw, FLOAT_TYPE g, unsigned int flags);
-
int af_filter_szxform(const FLOAT_TYPE* a, const FLOAT_TYPE* b, FLOAT_TYPE Q,
FLOAT_TYPE fc, FLOAT_TYPE fs, FLOAT_TYPE *k,
FLOAT_TYPE *coef);
diff --git a/libaf/format.c b/libaf/format.c
index 5d77eabeea..638485cc23 100644
--- a/libaf/format.c
+++ b/libaf/format.c
@@ -26,51 +26,6 @@
#include "af.h"
-// Convert from string to format
-int af_str2fmt(const char* str)
-{
- int format=0;
- // Scan for endianness
- if(strstr(str,"be") || strstr(str,"BE"))
- format |= AF_FORMAT_BE;
- else if(strstr(str,"le") || strstr(str,"LE"))
- format |= AF_FORMAT_LE;
- else
- format |= AF_FORMAT_NE;
-
- // Scan for special formats
- if(strstr(str,"mulaw") || strstr(str,"MULAW")){
- format |= AF_FORMAT_MU_LAW; return format;
- }
- if(strstr(str,"alaw") || strstr(str,"ALAW")){
- format |= AF_FORMAT_A_LAW; return format;
- }
- if(strstr(str,"ac3") || strstr(str,"AC3")){
- format |= AF_FORMAT_AC3 | AF_FORMAT_16BIT; return format;
- }
- if(strstr(str,"mpeg2") || strstr(str,"MPEG2")){
- format |= AF_FORMAT_MPEG2; return format;
- }
- if(strstr(str,"imaadpcm") || strstr(str,"IMAADPCM")){
- format |= AF_FORMAT_IMA_ADPCM; return format;
- }
-
- // Scan for int/float
- if(strstr(str,"float") || strstr(str,"FLOAT")){
- format |= AF_FORMAT_F; return format;
- }
- else
- format |= AF_FORMAT_I;
-
- // Scan for signed/unsigned
- if(strstr(str,"unsigned") || strstr(str,"UNSIGNED"))
- format |= AF_FORMAT_US;
- else
- format |= AF_FORMAT_SI;
-
- return format;
-}
-
int af_fmt2bits(int format)
{
if (AF_FORMAT_IS_AC3(format)) return 16;