~ubuntu-branches/ubuntu/vivid/oss4/vivid

« back to all changes in this revision

Viewing changes to kernel/framework/audio/grc3inc.inc

  • Committer: Bazaar Package Importer
  • Author(s): Romain Beauxis, Samuel Thibault, Romain Beauxis, Sebastien NOEL
  • Date: 2011-06-14 10:06:56 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20110614100656-cx4oc7u426zn812z
Tags: 4.2-build2004-1
[ Samuel Thibault ]
* debian/control: Add liboss4-salsa2, liboss4-salsa-dev and
  liboss4-salsa-asound2 packages, equivalent to (and will replace) those from
  the oss-libsalsa package (Closes: #589127).
* debian/patches/liboss4-salsa.patch: New patch to rename libsalsa into
  liboss4-salsa to avoid conflicts in the archive for no good reason.
* debian/rules: Make in libOSSlib and libsalsa.
* debian/liboss4-salsa-dev.install, debian/liboss4-salsa2.install,
  debian/liboss4-salsa-asound2.links, debian/liboss4-salsa-dev.links:
  Install liboss4-salsa libraries like was done in the oss-libsalsa package.
* include-alsa: Add a copy of ALSA 1.0.5 headers: Cf ALSA_1.0.* symbols in
  libsalsa, this is the roughly supported version.
* debian/copyright: Update for new include-alsa files.
* alsa.pc: New file for compatibility with libasound-dev.
* debian/control:
  - Add Vcs-Browser and Vcs-Svn fields.
  - Use linux-any instead of the list of Linux archs (Closes: #604679).
  - Make dkms dependency linux-any only.
* debian/patches/hurd_iot.patch: New patch to fix soundcard.h usage in
  libsalsa on hurd-i386.
* debian/patches/libsalsa_fixes.patch: New patch to fix some printf usages
  and ioctl declaration in libsalsa.
* debian/patches/no_EBADE.patch: New patch to cope with hurd-i386 not having
  EBADE.
* debian/patches/CFLAGS.patch: New patch to make oss4 take debian/rules
  CFLAGS into account.
* debian/patches/snd_asoundlib_version.patch: New patch to add
  snd_asoundlib_version().
* debian/patches/generic_srccconf.patch: New patch to fix source
  configuration on unknown archs.

[ Romain Beauxis ]
* Fixed README.Debian to only mention dkms' modules.
* Switch to dpkg-source 3.0 (quilt) format
* Added DM-Upload-Allowed: yes

[ Sebastien NOEL ]
* New upstream release (Closes: #595298, #619272).
* Fix typo in initscript (Closes: #627149).
* debian/control: adjust linux-headers dependencies (Closes: #628879).

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Purpose: Resampling routines for GRC3
 
3
 *
 
4
 * GRC library version 3.1
 
5
 */
 
6
/*
 
7
 *
 
8
 * This file is part of Open Sound System.
 
9
 *
 
10
 * Copyright (C) 4Front Technologies 1996-2008.
 
11
 *
 
12
 * This this source file is released under GPL v2 license (no other versions).
 
13
 * See the COPYING file included in the main directory of this source
 
14
 * distribution for the license terms and conditions.
 
15
 *
 
16
 */
 
17
 
 
18
static __inline__ int32_t SUFFIX (grc3_upsample_) (grc3state_t * grc,
 
19
                                                   TYPEIN * src,
 
20
                                                   TYPEOUT * dst, uint32_t sz,
 
21
                                                   uint32_t bufsz,
 
22
                                                   int32_t inc,
 
23
                                                   int32_t offset)
 
24
{
 
25
  GRCvreg uint32_t ptr = grc->ptr;
 
26
  uint32_t srcrate = grc->srcrate;
 
27
  uint32_t dstrate = grc->dstrate;
 
28
  GRCvreg int32_t *history = grc->historyptr;
 
29
  uint32_t filtfactor = grc->filtfactor;
 
30
  uint32_t dstsz = 0;
 
31
 
 
32
  grc->insz = sz;
 
33
 
 
34
  src += offset;
 
35
  dst += offset;
 
36
 
 
37
  while (sz > 0)
 
38
    {
 
39
      while (ptr < dstrate)
 
40
        {
 
41
          if (dstsz >= bufsz)
 
42
            goto endloop;
 
43
          OUT (dst[0],
 
44
               DOCLAMP (QSUFFIX (_conv31_)
 
45
                        (history, _grc_sat6 (ptr, filtfactor))));
 
46
          ptr += srcrate;
 
47
#ifndef INCOUT
 
48
          dst += inc;
 
49
#else
 
50
          INCOUT
 
51
#endif
 
52
            dstsz++;
 
53
        }
 
54
 
 
55
      history++;
 
56
      if (history >= (grc->history + GRC3_MAXHISTORY * 2))
 
57
        history -= GRC3_MAXHISTORY;
 
58
 
 
59
      history[0] = history[-GRC3_MAXHISTORY] = IN (((*src)));
 
60
 
 
61
      ptr -= dstrate;
 
62
 
 
63
      sz--;
 
64
#ifndef INCIN
 
65
      src += inc;
 
66
#else
 
67
      INCIN
 
68
#endif
 
69
    }
 
70
endloop:
 
71
 
 
72
  grc->ptr = ptr;
 
73
  grc->historyptr = history;
 
74
  grc->outsz = dstsz;
 
75
  grc->insz -= sz;
 
76
 
 
77
  return (int32_t) dstsz;
 
78
}
 
79
 
 
80
__inline__ int32_t SUFFIX (grc3_dnsample_) (grc3state_t * grc, TYPEIN * src,
 
81
                                            TYPEOUT * dst, uint32_t sz,
 
82
                                            uint32_t bufsz, int32_t inc,
 
83
                                            int32_t offset)
 
84
{
 
85
  GRCvreg uint32_t ptr = grc->ptr;
 
86
  uint32_t srcrate = grc->srcrate;
 
87
  uint32_t dstrate = grc->dstrate;
 
88
  uint32_t sat = grc->sat;
 
89
  GRCvreg int32_t *history = grc->historyptr;
 
90
  uint32_t filtfactor = grc->filtfactor;
 
91
  uint32_t dstsz = 0;
 
92
 
 
93
  grc->insz = sz;
 
94
 
 
95
  src += offset;
 
96
  dst += offset;
 
97
 
 
98
  while (sz > 0)
 
99
    {
 
100
      while (ptr >= srcrate)
 
101
        {
 
102
          if (dstsz >= bufsz)
 
103
            goto endloop;
 
104
          ptr -= srcrate;
 
105
          OUT (dst[0],
 
106
               DOCLAMP (QSUFFIX (_conv31d_)
 
107
                        (history, _grc_sat6 (ptr, filtfactor),
 
108
                         grc->ptr_incv)));
 
109
#ifndef INCOUT
 
110
          dst += inc;
 
111
#else
 
112
          INCOUT
 
113
#endif
 
114
            dstsz++;
 
115
        }
 
116
 
 
117
      history++;
 
118
      if (history >= (grc->history + GRC3_MAXHISTORY * 2))
 
119
        history -= GRC3_MAXHISTORY;
 
120
 
 
121
      /* TODO: for better quality multiplier is worth moving to output cascade */
 
122
      history[0] = history[-GRC3_MAXHISTORY] =
 
123
        _grc_sat31 (IN (((*src))), sat);
 
124
 
 
125
      ptr += dstrate;
 
126
 
 
127
      sz--;
 
128
#ifndef INCIN
 
129
      src += inc;
 
130
#else
 
131
      INCIN
 
132
#endif
 
133
    }
 
134
endloop:
 
135
 
 
136
  grc->ptr = ptr;
 
137
  grc->historyptr = history;
 
138
  grc->outsz = dstsz;
 
139
  grc->insz -= sz;
 
140
 
 
141
  return (int32_t) dstsz;
 
142
}
 
143
 
 
144
static __inline__ int32_t SUFFIX (grc3_resample_) (grc3state_t * grc,
 
145
                                                   void *src, void *dst,
 
146
                                                   uint32_t sz,
 
147
                                                   uint32_t bufsz,
 
148
                                                   int32_t inc,
 
149
                                                   int32_t offset)
 
150
{
 
151
  if (grc->srcrate <= grc->dstrate)
 
152
    return SUFFIX (grc3_upsample_) (grc, (TYPEIN *) src, (TYPEOUT *) dst, sz,
 
153
                                    bufsz, inc, offset);
 
154
  else
 
155
    return SUFFIX (grc3_dnsample_) (grc, (TYPEIN *) src, (TYPEOUT *) dst, sz,
 
156
                                    bufsz, inc, offset);
 
157
}
 
158
 
 
159
#undef TYPEIN
 
160
#undef TYPEOUT
 
161
#undef INCIN
 
162
#undef INCOUT
 
163
#undef SUFFIX
 
164
#undef IN
 
165
#undef OUT