Coverage Report

Created: 2026-11-23 06:49

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/gstreamer/subprojects/gst-plugins-base/gst-libs/gst/audio/audio-resampler-macros.h
Line
Count
Source
1
/* GStreamer
2
 * Copyright (C) <2015> Wim Taymans <wim.taymans@gmail.com>
3
 *
4
 * This library is free software; you can redistribute it and/or
5
 * modify it under the terms of the GNU Library General Public
6
 * License as published by the Free Software Foundation; either
7
 * version 2 of the License, or (at your option) any later version.
8
 *
9
 * This library is distributed in the hope that it will be useful,
10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12
 * Library General Public License for more details.
13
 *
14
 * You should have received a copy of the GNU Library General Public
15
 * License along with this library; if not, write to the
16
 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
17
 * Boston, MA 02110-1301, USA.
18
 */
19
20
#ifndef __GST_AUDIO_RESAMPLER_MACROS_H__
21
#define __GST_AUDIO_RESAMPLER_MACROS_H__
22
23
#include <string.h>
24
25
#include "audio-resampler-private.h"
26
27
45.8M
#define PRECISION_S16 15
28
2.40G
#define PRECISION_S32 31
29
30
#define DECL_GET_TAPS_FULL_FUNC(type)                           \
31
gpointer                                                        \
32
get_taps_##type##_full (GstAudioResampler * resampler,          \
33
    gint *samp_index, gint *samp_phase, type icoeff[4])
34
35
DECL_GET_TAPS_FULL_FUNC (gint16);
36
DECL_GET_TAPS_FULL_FUNC (gint32);
37
DECL_GET_TAPS_FULL_FUNC (gfloat);
38
DECL_GET_TAPS_FULL_FUNC (gdouble);
39
40
41
#define DECL_GET_TAPS_INTERPOLATE_FUNC(type, inter)             \
42
gpointer                                                        \
43
get_taps_##type##_##inter (GstAudioResampler * resampler,       \
44
    gint *samp_index, gint *samp_phase, type icoeff[4])         \
45
46
DECL_GET_TAPS_INTERPOLATE_FUNC (gint16, linear);
47
DECL_GET_TAPS_INTERPOLATE_FUNC (gint32, linear);
48
DECL_GET_TAPS_INTERPOLATE_FUNC (gfloat, linear);
49
DECL_GET_TAPS_INTERPOLATE_FUNC (gdouble, linear);
50
51
DECL_GET_TAPS_INTERPOLATE_FUNC (gint16, cubic);
52
DECL_GET_TAPS_INTERPOLATE_FUNC (gint32, cubic);
53
DECL_GET_TAPS_INTERPOLATE_FUNC (gfloat, cubic);
54
DECL_GET_TAPS_INTERPOLATE_FUNC (gdouble, cubic);
55
56
57
#define DECL_RESAMPLE_FUNC(type,inter,channels,arch)                    \
58
void                                                                    \
59
resample_ ##type## _ ##inter## _ ##channels## _ ##arch (GstAudioResampler * resampler,      \
60
    gpointer in[], gsize in_len,  gpointer out[], gsize out_len,        \
61
    gsize * consumed)
62
63
#define MAKE_RESAMPLE_FUNC(type,inter,channels,arch)            \
64
2.64k
DECL_RESAMPLE_FUNC (type, inter, channels, arch)                \
65
2.64k
{                                                               \
66
2.64k
  gint c, di = 0;                                               \
67
2.64k
  gint n_taps = resampler->n_taps;                              \
68
2.64k
  gint blocks = resampler->blocks;                              \
69
2.64k
  gint ostride = resampler->ostride;                            \
70
2.64k
  gint taps_stride = resampler->taps_stride;                    \
71
2.64k
  gint samp_index = 0;                                          \
72
2.64k
  gint samp_phase = 0;                                          \
73
2.64k
                                                                \
74
6.89k
  for (c = 0; c < blocks; c++) {                                \
75
4.25k
    type *ip = in[c];                                           \
76
4.25k
    type *op = ostride == 1 ? out[c] : (type *)out[0] + c;      \
77
4.25k
                                                                \
78
4.25k
    samp_index = resampler->samp_index;                         \
79
4.25k
    samp_phase = resampler->samp_phase;                         \
80
4.25k
                                                                \
81
1.21G
    for (di = 0; di < out_len; di++) {                          \
82
1.21G
      type *ipp, icoeff[4], *taps;                              \
83
1.21G
                                                                \
84
1.21G
      ipp = &ip[samp_index * channels];                         \
85
1.21G
                                                                \
86
1.21G
      taps = get_taps_ ##type##_##inter                         \
87
1.21G
              (resampler, &samp_index, &samp_phase, icoeff);    \
88
1.21G
      inner_product_ ##type##_##inter##_##channels##_##arch     \
89
1.21G
              (op, ipp, taps, n_taps, icoeff, taps_stride);     \
90
1.21G
      op += ostride;                                            \
91
1.21G
    }                                                           \
92
4.25k
    if (in_len > samp_index)                                    \
93
4.25k
      memmove (ip, &ip[samp_index * channels],                  \
94
3.84k
          (in_len - samp_index) * sizeof(type) * channels);     \
95
4.25k
  }                                                             \
96
2.64k
  *consumed = samp_index - resampler->samp_index;               \
97
2.64k
                                                                \
98
2.64k
  resampler->samp_index = 0;                                    \
99
2.64k
  resampler->samp_phase = samp_phase;                           \
100
2.64k
}
audio-resampler.c:resample_gint16_nearest_1_c
Line
Count
Source
64
628
DECL_RESAMPLE_FUNC (type, inter, channels, arch)                \
65
628
{                                                               \
66
628
  gint c, di = 0;                                               \
67
628
  gint n_taps = resampler->n_taps;                              \
68
628
  gint blocks = resampler->blocks;                              \
69
628
  gint ostride = resampler->ostride;                            \
70
628
  gint taps_stride = resampler->taps_stride;                    \
71
628
  gint samp_index = 0;                                          \
72
628
  gint samp_phase = 0;                                          \
73
628
                                                                \
74
1.56k
  for (c = 0; c < blocks; c++) {                                \
75
940
    type *ip = in[c];                                           \
76
940
    type *op = ostride == 1 ? out[c] : (type *)out[0] + c;      \
77
940
                                                                \
78
940
    samp_index = resampler->samp_index;                         \
79
940
    samp_phase = resampler->samp_phase;                         \
80
940
                                                                \
81
40.2M
    for (di = 0; di < out_len; di++) {                          \
82
40.2M
      type *ipp, icoeff[4], *taps;                              \
83
40.2M
                                                                \
84
40.2M
      ipp = &ip[samp_index * channels];                         \
85
40.2M
                                                                \
86
40.2M
      taps = get_taps_ ##type##_##inter                         \
87
40.2M
              (resampler, &samp_index, &samp_phase, icoeff);    \
88
40.2M
      inner_product_ ##type##_##inter##_##channels##_##arch     \
89
40.2M
              (op, ipp, taps, n_taps, icoeff, taps_stride);     \
90
40.2M
      op += ostride;                                            \
91
40.2M
    }                                                           \
92
940
    if (in_len > samp_index)                                    \
93
940
      memmove (ip, &ip[samp_index * channels],                  \
94
750
          (in_len - samp_index) * sizeof(type) * channels);     \
95
940
  }                                                             \
96
628
  *consumed = samp_index - resampler->samp_index;               \
97
628
                                                                \
98
628
  resampler->samp_index = 0;                                    \
99
628
  resampler->samp_phase = samp_phase;                           \
100
628
}
audio-resampler.c:resample_gint32_nearest_1_c
Line
Count
Source
64
159
DECL_RESAMPLE_FUNC (type, inter, channels, arch)                \
65
159
{                                                               \
66
159
  gint c, di = 0;                                               \
67
159
  gint n_taps = resampler->n_taps;                              \
68
159
  gint blocks = resampler->blocks;                              \
69
159
  gint ostride = resampler->ostride;                            \
70
159
  gint taps_stride = resampler->taps_stride;                    \
71
159
  gint samp_index = 0;                                          \
72
159
  gint samp_phase = 0;                                          \
73
159
                                                                \
74
407
  for (c = 0; c < blocks; c++) {                                \
75
248
    type *ip = in[c];                                           \
76
248
    type *op = ostride == 1 ? out[c] : (type *)out[0] + c;      \
77
248
                                                                \
78
248
    samp_index = resampler->samp_index;                         \
79
248
    samp_phase = resampler->samp_phase;                         \
80
248
                                                                \
81
3.17M
    for (di = 0; di < out_len; di++) {                          \
82
3.17M
      type *ipp, icoeff[4], *taps;                              \
83
3.17M
                                                                \
84
3.17M
      ipp = &ip[samp_index * channels];                         \
85
3.17M
                                                                \
86
3.17M
      taps = get_taps_ ##type##_##inter                         \
87
3.17M
              (resampler, &samp_index, &samp_phase, icoeff);    \
88
3.17M
      inner_product_ ##type##_##inter##_##channels##_##arch     \
89
3.17M
              (op, ipp, taps, n_taps, icoeff, taps_stride);     \
90
3.17M
      op += ostride;                                            \
91
3.17M
    }                                                           \
92
248
    if (in_len > samp_index)                                    \
93
248
      memmove (ip, &ip[samp_index * channels],                  \
94
207
          (in_len - samp_index) * sizeof(type) * channels);     \
95
248
  }                                                             \
96
159
  *consumed = samp_index - resampler->samp_index;               \
97
159
                                                                \
98
159
  resampler->samp_index = 0;                                    \
99
159
  resampler->samp_phase = samp_phase;                           \
100
159
}
audio-resampler.c:resample_gfloat_nearest_1_c
Line
Count
Source
64
141
DECL_RESAMPLE_FUNC (type, inter, channels, arch)                \
65
141
{                                                               \
66
141
  gint c, di = 0;                                               \
67
141
  gint n_taps = resampler->n_taps;                              \
68
141
  gint blocks = resampler->blocks;                              \
69
141
  gint ostride = resampler->ostride;                            \
70
141
  gint taps_stride = resampler->taps_stride;                    \
71
141
  gint samp_index = 0;                                          \
72
141
  gint samp_phase = 0;                                          \
73
141
                                                                \
74
441
  for (c = 0; c < blocks; c++) {                                \
75
300
    type *ip = in[c];                                           \
76
300
    type *op = ostride == 1 ? out[c] : (type *)out[0] + c;      \
77
300
                                                                \
78
300
    samp_index = resampler->samp_index;                         \
79
300
    samp_phase = resampler->samp_phase;                         \
80
300
                                                                \
81
17.7M
    for (di = 0; di < out_len; di++) {                          \
82
17.7M
      type *ipp, icoeff[4], *taps;                              \
83
17.7M
                                                                \
84
17.7M
      ipp = &ip[samp_index * channels];                         \
85
17.7M
                                                                \
86
17.7M
      taps = get_taps_ ##type##_##inter                         \
87
17.7M
              (resampler, &samp_index, &samp_phase, icoeff);    \
88
17.7M
      inner_product_ ##type##_##inter##_##channels##_##arch     \
89
17.7M
              (op, ipp, taps, n_taps, icoeff, taps_stride);     \
90
17.7M
      op += ostride;                                            \
91
17.7M
    }                                                           \
92
300
    if (in_len > samp_index)                                    \
93
300
      memmove (ip, &ip[samp_index * channels],                  \
94
184
          (in_len - samp_index) * sizeof(type) * channels);     \
95
300
  }                                                             \
96
141
  *consumed = samp_index - resampler->samp_index;               \
97
141
                                                                \
98
141
  resampler->samp_index = 0;                                    \
99
141
  resampler->samp_phase = samp_phase;                           \
100
141
}
audio-resampler.c:resample_gdouble_nearest_1_c
Line
Count
Source
64
241
DECL_RESAMPLE_FUNC (type, inter, channels, arch)                \
65
241
{                                                               \
66
241
  gint c, di = 0;                                               \
67
241
  gint n_taps = resampler->n_taps;                              \
68
241
  gint blocks = resampler->blocks;                              \
69
241
  gint ostride = resampler->ostride;                            \
70
241
  gint taps_stride = resampler->taps_stride;                    \
71
241
  gint samp_index = 0;                                          \
72
241
  gint samp_phase = 0;                                          \
73
241
                                                                \
74
658
  for (c = 0; c < blocks; c++) {                                \
75
417
    type *ip = in[c];                                           \
76
417
    type *op = ostride == 1 ? out[c] : (type *)out[0] + c;      \
77
417
                                                                \
78
417
    samp_index = resampler->samp_index;                         \
79
417
    samp_phase = resampler->samp_phase;                         \
80
417
                                                                \
81
7.80M
    for (di = 0; di < out_len; di++) {                          \
82
7.80M
      type *ipp, icoeff[4], *taps;                              \
83
7.80M
                                                                \
84
7.80M
      ipp = &ip[samp_index * channels];                         \
85
7.80M
                                                                \
86
7.80M
      taps = get_taps_ ##type##_##inter                         \
87
7.80M
              (resampler, &samp_index, &samp_phase, icoeff);    \
88
7.80M
      inner_product_ ##type##_##inter##_##channels##_##arch     \
89
7.80M
              (op, ipp, taps, n_taps, icoeff, taps_stride);     \
90
7.80M
      op += ostride;                                            \
91
7.80M
    }                                                           \
92
417
    if (in_len > samp_index)                                    \
93
417
      memmove (ip, &ip[samp_index * channels],                  \
94
356
          (in_len - samp_index) * sizeof(type) * channels);     \
95
417
  }                                                             \
96
241
  *consumed = samp_index - resampler->samp_index;               \
97
241
                                                                \
98
241
  resampler->samp_index = 0;                                    \
99
241
  resampler->samp_phase = samp_phase;                           \
100
241
}
Unexecuted instantiation: audio-resampler.c:resample_gint16_full_1_c
Unexecuted instantiation: audio-resampler.c:resample_gint32_full_1_c
Unexecuted instantiation: audio-resampler.c:resample_gfloat_full_1_c
Unexecuted instantiation: audio-resampler.c:resample_gdouble_full_1_c
Unexecuted instantiation: audio-resampler.c:resample_gint16_linear_1_c
Unexecuted instantiation: audio-resampler.c:resample_gint32_linear_1_c
Unexecuted instantiation: audio-resampler.c:resample_gfloat_linear_1_c
Unexecuted instantiation: audio-resampler.c:resample_gdouble_linear_1_c
Unexecuted instantiation: audio-resampler.c:resample_gint16_cubic_1_c
Unexecuted instantiation: audio-resampler.c:resample_gint32_cubic_1_c
Unexecuted instantiation: audio-resampler.c:resample_gfloat_cubic_1_c
Unexecuted instantiation: audio-resampler.c:resample_gdouble_cubic_1_c
resample_gfloat_full_1_sse
Line
Count
Source
64
182
DECL_RESAMPLE_FUNC (type, inter, channels, arch)                \
65
182
{                                                               \
66
182
  gint c, di = 0;                                               \
67
182
  gint n_taps = resampler->n_taps;                              \
68
182
  gint blocks = resampler->blocks;                              \
69
182
  gint ostride = resampler->ostride;                            \
70
182
  gint taps_stride = resampler->taps_stride;                    \
71
182
  gint samp_index = 0;                                          \
72
182
  gint samp_phase = 0;                                          \
73
182
                                                                \
74
509
  for (c = 0; c < blocks; c++) {                                \
75
327
    type *ip = in[c];                                           \
76
327
    type *op = ostride == 1 ? out[c] : (type *)out[0] + c;      \
77
327
                                                                \
78
327
    samp_index = resampler->samp_index;                         \
79
327
    samp_phase = resampler->samp_phase;                         \
80
327
                                                                \
81
160M
    for (di = 0; di < out_len; di++) {                          \
82
160M
      type *ipp, icoeff[4], *taps;                              \
83
160M
                                                                \
84
160M
      ipp = &ip[samp_index * channels];                         \
85
160M
                                                                \
86
160M
      taps = get_taps_ ##type##_##inter                         \
87
160M
              (resampler, &samp_index, &samp_phase, icoeff);    \
88
160M
      inner_product_ ##type##_##inter##_##channels##_##arch     \
89
160M
              (op, ipp, taps, n_taps, icoeff, taps_stride);     \
90
160M
      op += ostride;                                            \
91
160M
    }                                                           \
92
327
    if (in_len > samp_index)                                    \
93
327
      memmove (ip, &ip[samp_index * channels],                  \
94
327
          (in_len - samp_index) * sizeof(type) * channels);     \
95
327
  }                                                             \
96
182
  *consumed = samp_index - resampler->samp_index;               \
97
182
                                                                \
98
182
  resampler->samp_index = 0;                                    \
99
182
  resampler->samp_phase = samp_phase;                           \
100
182
}
Unexecuted instantiation: resample_gfloat_linear_1_sse
resample_gfloat_cubic_1_sse
Line
Count
Source
64
59
DECL_RESAMPLE_FUNC (type, inter, channels, arch)                \
65
59
{                                                               \
66
59
  gint c, di = 0;                                               \
67
59
  gint n_taps = resampler->n_taps;                              \
68
59
  gint blocks = resampler->blocks;                              \
69
59
  gint ostride = resampler->ostride;                            \
70
59
  gint taps_stride = resampler->taps_stride;                    \
71
59
  gint samp_index = 0;                                          \
72
59
  gint samp_phase = 0;                                          \
73
59
                                                                \
74
170
  for (c = 0; c < blocks; c++) {                                \
75
111
    type *ip = in[c];                                           \
76
111
    type *op = ostride == 1 ? out[c] : (type *)out[0] + c;      \
77
111
                                                                \
78
111
    samp_index = resampler->samp_index;                         \
79
111
    samp_phase = resampler->samp_phase;                         \
80
111
                                                                \
81
77.9k
    for (di = 0; di < out_len; di++) {                          \
82
77.8k
      type *ipp, icoeff[4], *taps;                              \
83
77.8k
                                                                \
84
77.8k
      ipp = &ip[samp_index * channels];                         \
85
77.8k
                                                                \
86
77.8k
      taps = get_taps_ ##type##_##inter                         \
87
77.8k
              (resampler, &samp_index, &samp_phase, icoeff);    \
88
77.8k
      inner_product_ ##type##_##inter##_##channels##_##arch     \
89
77.8k
              (op, ipp, taps, n_taps, icoeff, taps_stride);     \
90
77.8k
      op += ostride;                                            \
91
77.8k
    }                                                           \
92
111
    if (in_len > samp_index)                                    \
93
111
      memmove (ip, &ip[samp_index * channels],                  \
94
111
          (in_len - samp_index) * sizeof(type) * channels);     \
95
111
  }                                                             \
96
59
  *consumed = samp_index - resampler->samp_index;               \
97
59
                                                                \
98
59
  resampler->samp_index = 0;                                    \
99
59
  resampler->samp_phase = samp_phase;                           \
100
59
}
resample_gint16_full_1_sse2
Line
Count
Source
64
176
DECL_RESAMPLE_FUNC (type, inter, channels, arch)                \
65
176
{                                                               \
66
176
  gint c, di = 0;                                               \
67
176
  gint n_taps = resampler->n_taps;                              \
68
176
  gint blocks = resampler->blocks;                              \
69
176
  gint ostride = resampler->ostride;                            \
70
176
  gint taps_stride = resampler->taps_stride;                    \
71
176
  gint samp_index = 0;                                          \
72
176
  gint samp_phase = 0;                                          \
73
176
                                                                \
74
439
  for (c = 0; c < blocks; c++) {                                \
75
263
    type *ip = in[c];                                           \
76
263
    type *op = ostride == 1 ? out[c] : (type *)out[0] + c;      \
77
263
                                                                \
78
263
    samp_index = resampler->samp_index;                         \
79
263
    samp_phase = resampler->samp_phase;                         \
80
263
                                                                \
81
14.8M
    for (di = 0; di < out_len; di++) {                          \
82
14.8M
      type *ipp, icoeff[4], *taps;                              \
83
14.8M
                                                                \
84
14.8M
      ipp = &ip[samp_index * channels];                         \
85
14.8M
                                                                \
86
14.8M
      taps = get_taps_ ##type##_##inter                         \
87
14.8M
              (resampler, &samp_index, &samp_phase, icoeff);    \
88
14.8M
      inner_product_ ##type##_##inter##_##channels##_##arch     \
89
14.8M
              (op, ipp, taps, n_taps, icoeff, taps_stride);     \
90
14.8M
      op += ostride;                                            \
91
14.8M
    }                                                           \
92
263
    if (in_len > samp_index)                                    \
93
263
      memmove (ip, &ip[samp_index * channels],                  \
94
263
          (in_len - samp_index) * sizeof(type) * channels);     \
95
263
  }                                                             \
96
176
  *consumed = samp_index - resampler->samp_index;               \
97
176
                                                                \
98
176
  resampler->samp_index = 0;                                    \
99
176
  resampler->samp_phase = samp_phase;                           \
100
176
}
Unexecuted instantiation: resample_gint16_linear_1_sse2
resample_gint16_cubic_1_sse2
Line
Count
Source
64
105
DECL_RESAMPLE_FUNC (type, inter, channels, arch)                \
65
105
{                                                               \
66
105
  gint c, di = 0;                                               \
67
105
  gint n_taps = resampler->n_taps;                              \
68
105
  gint blocks = resampler->blocks;                              \
69
105
  gint ostride = resampler->ostride;                            \
70
105
  gint taps_stride = resampler->taps_stride;                    \
71
105
  gint samp_index = 0;                                          \
72
105
  gint samp_phase = 0;                                          \
73
105
                                                                \
74
278
  for (c = 0; c < blocks; c++) {                                \
75
173
    type *ip = in[c];                                           \
76
173
    type *op = ostride == 1 ? out[c] : (type *)out[0] + c;      \
77
173
                                                                \
78
173
    samp_index = resampler->samp_index;                         \
79
173
    samp_phase = resampler->samp_phase;                         \
80
173
                                                                \
81
4.85M
    for (di = 0; di < out_len; di++) {                          \
82
4.85M
      type *ipp, icoeff[4], *taps;                              \
83
4.85M
                                                                \
84
4.85M
      ipp = &ip[samp_index * channels];                         \
85
4.85M
                                                                \
86
4.85M
      taps = get_taps_ ##type##_##inter                         \
87
4.85M
              (resampler, &samp_index, &samp_phase, icoeff);    \
88
4.85M
      inner_product_ ##type##_##inter##_##channels##_##arch     \
89
4.85M
              (op, ipp, taps, n_taps, icoeff, taps_stride);     \
90
4.85M
      op += ostride;                                            \
91
4.85M
    }                                                           \
92
173
    if (in_len > samp_index)                                    \
93
173
      memmove (ip, &ip[samp_index * channels],                  \
94
173
          (in_len - samp_index) * sizeof(type) * channels);     \
95
173
  }                                                             \
96
105
  *consumed = samp_index - resampler->samp_index;               \
97
105
                                                                \
98
105
  resampler->samp_index = 0;                                    \
99
105
  resampler->samp_phase = samp_phase;                           \
100
105
}
resample_gdouble_full_1_sse2
Line
Count
Source
64
149
DECL_RESAMPLE_FUNC (type, inter, channels, arch)                \
65
149
{                                                               \
66
149
  gint c, di = 0;                                               \
67
149
  gint n_taps = resampler->n_taps;                              \
68
149
  gint blocks = resampler->blocks;                              \
69
149
  gint ostride = resampler->ostride;                            \
70
149
  gint taps_stride = resampler->taps_stride;                    \
71
149
  gint samp_index = 0;                                          \
72
149
  gint samp_phase = 0;                                          \
73
149
                                                                \
74
412
  for (c = 0; c < blocks; c++) {                                \
75
263
    type *ip = in[c];                                           \
76
263
    type *op = ostride == 1 ? out[c] : (type *)out[0] + c;      \
77
263
                                                                \
78
263
    samp_index = resampler->samp_index;                         \
79
263
    samp_phase = resampler->samp_phase;                         \
80
263
                                                                \
81
185M
    for (di = 0; di < out_len; di++) {                          \
82
185M
      type *ipp, icoeff[4], *taps;                              \
83
185M
                                                                \
84
185M
      ipp = &ip[samp_index * channels];                         \
85
185M
                                                                \
86
185M
      taps = get_taps_ ##type##_##inter                         \
87
185M
              (resampler, &samp_index, &samp_phase, icoeff);    \
88
185M
      inner_product_ ##type##_##inter##_##channels##_##arch     \
89
185M
              (op, ipp, taps, n_taps, icoeff, taps_stride);     \
90
185M
      op += ostride;                                            \
91
185M
    }                                                           \
92
263
    if (in_len > samp_index)                                    \
93
263
      memmove (ip, &ip[samp_index * channels],                  \
94
263
          (in_len - samp_index) * sizeof(type) * channels);     \
95
263
  }                                                             \
96
149
  *consumed = samp_index - resampler->samp_index;               \
97
149
                                                                \
98
149
  resampler->samp_index = 0;                                    \
99
149
  resampler->samp_phase = samp_phase;                           \
100
149
}
Unexecuted instantiation: resample_gdouble_linear_1_sse2
resample_gdouble_cubic_1_sse2
Line
Count
Source
64
146
DECL_RESAMPLE_FUNC (type, inter, channels, arch)                \
65
146
{                                                               \
66
146
  gint c, di = 0;                                               \
67
146
  gint n_taps = resampler->n_taps;                              \
68
146
  gint blocks = resampler->blocks;                              \
69
146
  gint ostride = resampler->ostride;                            \
70
146
  gint taps_stride = resampler->taps_stride;                    \
71
146
  gint samp_index = 0;                                          \
72
146
  gint samp_phase = 0;                                          \
73
146
                                                                \
74
372
  for (c = 0; c < blocks; c++) {                                \
75
226
    type *ip = in[c];                                           \
76
226
    type *op = ostride == 1 ? out[c] : (type *)out[0] + c;      \
77
226
                                                                \
78
226
    samp_index = resampler->samp_index;                         \
79
226
    samp_phase = resampler->samp_phase;                         \
80
226
                                                                \
81
96.3M
    for (di = 0; di < out_len; di++) {                          \
82
96.3M
      type *ipp, icoeff[4], *taps;                              \
83
96.3M
                                                                \
84
96.3M
      ipp = &ip[samp_index * channels];                         \
85
96.3M
                                                                \
86
96.3M
      taps = get_taps_ ##type##_##inter                         \
87
96.3M
              (resampler, &samp_index, &samp_phase, icoeff);    \
88
96.3M
      inner_product_ ##type##_##inter##_##channels##_##arch     \
89
96.3M
              (op, ipp, taps, n_taps, icoeff, taps_stride);     \
90
96.3M
      op += ostride;                                            \
91
96.3M
    }                                                           \
92
226
    if (in_len > samp_index)                                    \
93
226
      memmove (ip, &ip[samp_index * channels],                  \
94
226
          (in_len - samp_index) * sizeof(type) * channels);     \
95
226
  }                                                             \
96
146
  *consumed = samp_index - resampler->samp_index;               \
97
146
                                                                \
98
146
  resampler->samp_index = 0;                                    \
99
146
  resampler->samp_phase = samp_phase;                           \
100
146
}
resample_gint32_full_1_sse41
Line
Count
Source
64
334
DECL_RESAMPLE_FUNC (type, inter, channels, arch)                \
65
334
{                                                               \
66
334
  gint c, di = 0;                                               \
67
334
  gint n_taps = resampler->n_taps;                              \
68
334
  gint blocks = resampler->blocks;                              \
69
334
  gint ostride = resampler->ostride;                            \
70
334
  gint taps_stride = resampler->taps_stride;                    \
71
334
  gint samp_index = 0;                                          \
72
334
  gint samp_phase = 0;                                          \
73
334
                                                                \
74
811
  for (c = 0; c < blocks; c++) {                                \
75
477
    type *ip = in[c];                                           \
76
477
    type *op = ostride == 1 ? out[c] : (type *)out[0] + c;      \
77
477
                                                                \
78
477
    samp_index = resampler->samp_index;                         \
79
477
    samp_phase = resampler->samp_phase;                         \
80
477
                                                                \
81
430M
    for (di = 0; di < out_len; di++) {                          \
82
430M
      type *ipp, icoeff[4], *taps;                              \
83
430M
                                                                \
84
430M
      ipp = &ip[samp_index * channels];                         \
85
430M
                                                                \
86
430M
      taps = get_taps_ ##type##_##inter                         \
87
430M
              (resampler, &samp_index, &samp_phase, icoeff);    \
88
430M
      inner_product_ ##type##_##inter##_##channels##_##arch     \
89
430M
              (op, ipp, taps, n_taps, icoeff, taps_stride);     \
90
430M
      op += ostride;                                            \
91
430M
    }                                                           \
92
477
    if (in_len > samp_index)                                    \
93
477
      memmove (ip, &ip[samp_index * channels],                  \
94
477
          (in_len - samp_index) * sizeof(type) * channels);     \
95
477
  }                                                             \
96
334
  *consumed = samp_index - resampler->samp_index;               \
97
334
                                                                \
98
334
  resampler->samp_index = 0;                                    \
99
334
  resampler->samp_phase = samp_phase;                           \
100
334
}
Unexecuted instantiation: resample_gint32_linear_1_sse41
resample_gint32_cubic_1_sse41
Line
Count
Source
64
325
DECL_RESAMPLE_FUNC (type, inter, channels, arch)                \
65
325
{                                                               \
66
325
  gint c, di = 0;                                               \
67
325
  gint n_taps = resampler->n_taps;                              \
68
325
  gint blocks = resampler->blocks;                              \
69
325
  gint ostride = resampler->ostride;                            \
70
325
  gint taps_stride = resampler->taps_stride;                    \
71
325
  gint samp_index = 0;                                          \
72
325
  gint samp_phase = 0;                                          \
73
325
                                                                \
74
830
  for (c = 0; c < blocks; c++) {                                \
75
505
    type *ip = in[c];                                           \
76
505
    type *op = ostride == 1 ? out[c] : (type *)out[0] + c;      \
77
505
                                                                \
78
505
    samp_index = resampler->samp_index;                         \
79
505
    samp_phase = resampler->samp_phase;                         \
80
505
                                                                \
81
256M
    for (di = 0; di < out_len; di++) {                          \
82
256M
      type *ipp, icoeff[4], *taps;                              \
83
256M
                                                                \
84
256M
      ipp = &ip[samp_index * channels];                         \
85
256M
                                                                \
86
256M
      taps = get_taps_ ##type##_##inter                         \
87
256M
              (resampler, &samp_index, &samp_phase, icoeff);    \
88
256M
      inner_product_ ##type##_##inter##_##channels##_##arch     \
89
256M
              (op, ipp, taps, n_taps, icoeff, taps_stride);     \
90
256M
      op += ostride;                                            \
91
256M
    }                                                           \
92
505
    if (in_len > samp_index)                                    \
93
505
      memmove (ip, &ip[samp_index * channels],                  \
94
505
          (in_len - samp_index) * sizeof(type) * channels);     \
95
505
  }                                                             \
96
325
  *consumed = samp_index - resampler->samp_index;               \
97
325
                                                                \
98
325
  resampler->samp_index = 0;                                    \
99
325
  resampler->samp_phase = samp_phase;                           \
100
325
}
101
102
#define DECL_RESAMPLE_FUNC_STATIC(type,inter,channels,arch)     \
103
static DECL_RESAMPLE_FUNC (type, inter, channels, arch)
104
105
#define MAKE_RESAMPLE_FUNC_STATIC(type,inter,channels,arch)     \
106
static MAKE_RESAMPLE_FUNC (type, inter, channels, arch)
107
108
#if defined(_MSC_VER) && !defined(__i386__) && !defined(__x86_64__)
109
#if defined(_M_IX86)
110
#define __i386__ 1
111
#elif defined(_M_X64) && !defined(_M_ARM64EC)
112
#define __x86_64__ 1
113
#endif
114
#endif /* _MSC_VER */
115
116
#if !defined(__SSE__) && defined(_MSC_VER)
117
#if (defined(_M_X64) || (defined(_M_IX86_FP) && _M_IX86_FP >= 1)) && !defined(_M_ARM64EC)
118
  #define __SSE__ 1
119
#endif
120
#endif
121
122
#if !defined(__SSE2__) && defined(_MSC_VER)
123
#if (defined(_M_X64) || (defined(_M_IX86_FP) && _M_IX86_FP >= 2)) && !defined(_M_ARM64EC)
124
  #define __SSE2__ 1
125
#endif
126
#endif
127
128
#if !defined(__SSE4_1__) && defined(_MSC_VER)
129
#if (defined(_M_X64) || (defined(_M_IX86_FP) && _M_IX86_FP >= 2)) && !defined(_M_ARM64EC)
130
  #define __SSE4_1__ 1
131
#endif
132
#endif
133
134
#endif /* __GST_AUDIO_RESAMPLER_MACROS_H__ */