This file is indexed.

/usr/include/bse/bseresampler.hh is in libbse-dev 0.7.4-4.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
/* BseResampler - FPU and SSE optimized FIR Resampling code
 * Copyright (C) 2006 Stefan Westerfeld
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library 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
 * Lesser General Public License for more details.
 *
 * A copy of the GNU Lesser General Public License should ship along
 * with this library; if not, see http://www.gnu.org/copyleft/.
 */
#ifndef __BSE_RESAMPLER_HH__
#define __BSE_RESAMPLER_HH__

#include <glib.h>

G_BEGIN_DECLS

typedef struct BseResampler2 BseResampler2;

typedef enum /*< skip >*/
{
  BSE_RESAMPLER2_MODE_UPSAMPLE,
  BSE_RESAMPLER2_MODE_DOWNSAMPLE
} BseResampler2Mode;

typedef enum /*< skip >*/
{
  BSE_RESAMPLER2_PREC_LINEAR = 1,     /* linear interpolation */
  BSE_RESAMPLER2_PREC_48DB = 8,
  BSE_RESAMPLER2_PREC_72DB = 12,
  BSE_RESAMPLER2_PREC_96DB = 16,
  BSE_RESAMPLER2_PREC_120DB = 20,
  BSE_RESAMPLER2_PREC_144DB = 24
} BseResampler2Precision;

BseResampler2* bse_resampler2_create        (BseResampler2Mode      mode,
                                             BseResampler2Precision precision);
void           bse_resampler2_destroy       (BseResampler2         *resampler);
void	       bse_resampler2_process_block (BseResampler2         *resampler,
                                             const float           *input,
                                             unsigned int           n_input_samples,
					     float                 *output);
guint	       bse_resampler2_order         (BseResampler2         *resampler);
double	       bse_resampler2_delay         (BseResampler2         *resampler);

/* precision <-> bits conversion */
BseResampler2Precision	bse_resampler2_find_precision_for_bits (guint		       bits);
const char*		bse_resampler2_precision_name	       (BseResampler2Precision precision);

G_END_DECLS

#ifdef __cplusplus
#include <vector>

namespace Bse {
namespace Resampler {

/**
 * Interface for factor 2 resampling classes
 */
class Resampler2 {
public:
  /**
   * creates a resampler instance fulfilling a given specification
   */
  static Resampler2* create (BseResampler2Mode      mode,
			     BseResampler2Precision precision);
  /**
   * finds a precision which is appropriate for at least the specified number of bits
   */
  static BseResampler2Precision find_precision_for_bits (guint bits);
  /**
   * returns a human-readable name for a given precision
   */
  static const char  *precision_name (BseResampler2Precision precision);
  /**
   * virtual destructor for abstract class
   */
  virtual	      ~Resampler2();
  /**
   * resample a data block
   */
  virtual void	      process_block (const float *input, unsigned int n_input_samples, float *output) = 0;
  /**
   * return FIR filter order
   */
  virtual guint	      order() const = 0;
  /**
   * Return the delay introduced by the resampler. This delay is guaranteed to
   * be >= 0.0, and for factor 2 resampling always a multiple of 0.5 (1.0 for
   * upsampling).
   *
   * The return value can also be thought of as index into the output signal,
   * where the first input sample can be found.
   *
   * Beware of fractional delays, for instance for downsampling, a delay() of
   * 10.5 means that the first input sample would be found by interpolating
   * output[10] and output[11], and the second input sample equates output[11].
   */
  virtual double      delay() const = 0;
protected:
  static const double halfband_fir_linear_coeffs[2];
  static const double halfband_fir_48db_coeffs[16];
  static const double halfband_fir_72db_coeffs[24];
  static const double halfband_fir_96db_coeffs[32];
  static const double halfband_fir_120db_coeffs[42];
  static const double halfband_fir_144db_coeffs[52];
  
  /* Creates implementation from filter coefficients and Filter implementation class
   *
   * Since up- and downsamplers use different (scaled) coefficients, its possible
   * to specify a scaling factor. Usually 2 for upsampling and 1 for downsampling.
   */
  template<class Filter> static inline Resampler2*
  create_impl_with_coeffs (const double *d,
	                   guint         order,
	                   double        scaling)
  {
    float taps[order];
    for (guint i = 0; i < order; i++)
      taps[i] = d[i] * scaling;
    
    Resampler2 *filter = new Filter (taps);
    g_assert (order == filter->order());
    return filter;
  }
  /* creates the actual implementation; specifying USE_SSE=true will use
   * SSE instructions, USE_SSE=false will use FPU instructions
   *
   * Don't use this directly - it's only to be used by
   * bseblockutils.cc's anonymous Impl classes.
   */
  template<bool USE_SSE> static inline Resampler2*
  create_impl (BseResampler2Mode      mode,
	       BseResampler2Precision precision);
};

} /* namespace Resampler */

} /* namespace Bse */

#endif /* __cplusplus */

#endif /* __BSE_RESAMPLER_HH__ */