FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
libopusdec.c
Go to the documentation of this file.
1 /*
2  * Opus decoder using libopus
3  * Copyright (c) 2012 Nicolas George
4  *
5  * This file is part of FFmpeg.
6  *
7  * FFmpeg is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public
9  * License as published by the Free Software Foundation; either
10  * version 2.1 of the License, or (at your option) any later version.
11  *
12  * FFmpeg is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with FFmpeg; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20  */
21 
22 #include <opus.h>
23 #include <opus_multistream.h>
24 
25 #include "libavutil/internal.h"
26 #include "libavutil/intreadwrite.h"
27 #include "libavutil/ffmath.h"
28 
29 #include "avcodec.h"
30 #include "internal.h"
31 #include "vorbis.h"
32 #include "mathops.h"
33 #include "libopus.h"
34 
36  OpusMSDecoder *dec;
37  int pre_skip;
38 #ifndef OPUS_SET_GAIN
39  union { int i; double d; } gain;
40 #endif
41 };
42 
43 #define OPUS_HEAD_SIZE 19
44 
46 {
47  struct libopus_context *opus = avc->priv_data;
48  int ret, channel_map = 0, gain_db = 0, nb_streams, nb_coupled;
49  uint8_t mapping_arr[8] = { 0, 1 }, *mapping;
50 
51  avc->channels = avc->extradata_size >= 10 ? avc->extradata[9] : (avc->channels == 1) ? 1 : 2;
52  if (avc->channels <= 0) {
54  "Invalid number of channels %d, defaulting to stereo\n", avc->channels);
55  avc->channels = 2;
56  }
57 
58  avc->sample_rate = 48000;
61 
62  if (avc->extradata_size >= OPUS_HEAD_SIZE) {
63  opus->pre_skip = AV_RL16(avc->extradata + 10);
64  gain_db = sign_extend(AV_RL16(avc->extradata + 16), 16);
65  channel_map = AV_RL8 (avc->extradata + 18);
66  }
67  if (avc->extradata_size >= OPUS_HEAD_SIZE + 2 + avc->channels) {
69  nb_coupled = avc->extradata[OPUS_HEAD_SIZE + 1];
70  if (nb_streams + nb_coupled != avc->channels)
71  av_log(avc, AV_LOG_WARNING, "Inconsistent channel mapping.\n");
72  mapping = avc->extradata + OPUS_HEAD_SIZE + 2;
73  } else {
74  if (avc->channels > 2 || channel_map) {
75  av_log(avc, AV_LOG_ERROR,
76  "No channel mapping for %d channels.\n", avc->channels);
77  return AVERROR(EINVAL);
78  }
79  nb_streams = 1;
80  nb_coupled = avc->channels > 1;
81  mapping = mapping_arr;
82  }
83 
84  if (channel_map == 1) {
85  avc->channel_layout = avc->channels > 8 ? 0 :
87  if (avc->channels > 2 && avc->channels <= 8) {
88  const uint8_t *vorbis_offset = ff_vorbis_channel_layout_offsets[avc->channels - 1];
89  int ch;
90 
91  /* Remap channels from Vorbis order to ffmpeg order */
92  for (ch = 0; ch < avc->channels; ch++)
93  mapping_arr[ch] = mapping[vorbis_offset[ch]];
94  mapping = mapping_arr;
95  }
96  } else if (channel_map == 2) {
97  int ambisonic_order = ff_sqrt(avc->channels) - 1;
98  if (avc->channels != (ambisonic_order + 1) * (ambisonic_order + 1) &&
99  avc->channels != (ambisonic_order + 1) * (ambisonic_order + 1) + 2) {
100  av_log(avc, AV_LOG_ERROR,
101  "Channel mapping 2 is only specified for channel counts"
102  " which can be written as (n + 1)^2 or (n + 2)^2 + 2"
103  " for nonnegative integer n\n");
104  return AVERROR_INVALIDDATA;
105  }
106  if (avc->channels > 227) {
107  av_log(avc, AV_LOG_ERROR, "Too many channels\n");
108  return AVERROR_INVALIDDATA;
109  }
110  avc->channel_layout = 0;
111  } else {
112  avc->channel_layout = 0;
113  }
114 
115  opus->dec = opus_multistream_decoder_create(avc->sample_rate, avc->channels,
116  nb_streams, nb_coupled,
117  mapping, &ret);
118  if (!opus->dec) {
119  av_log(avc, AV_LOG_ERROR, "Unable to create decoder: %s\n",
120  opus_strerror(ret));
121  return ff_opus_error_to_averror(ret);
122  }
123 
124 #ifdef OPUS_SET_GAIN
125  ret = opus_multistream_decoder_ctl(opus->dec, OPUS_SET_GAIN(gain_db));
126  if (ret != OPUS_OK)
127  av_log(avc, AV_LOG_WARNING, "Failed to set gain: %s\n",
128  opus_strerror(ret));
129 #else
130  {
131  double gain_lin = ff_exp10(gain_db / (20.0 * 256));
132  if (avc->sample_fmt == AV_SAMPLE_FMT_FLT)
133  opus->gain.d = gain_lin;
134  else
135  opus->gain.i = FFMIN(gain_lin * 65536, INT_MAX);
136  }
137 #endif
138 
139  /* Decoder delay (in samples) at 48kHz */
140  avc->delay = avc->internal->skip_samples = opus->pre_skip;
141 
142  return 0;
143 }
144 
146 {
147  struct libopus_context *opus = avc->priv_data;
148 
149  opus_multistream_decoder_destroy(opus->dec);
150  return 0;
151 }
152 
153 #define MAX_FRAME_SIZE (960 * 6)
154 
155 static int libopus_decode(AVCodecContext *avc, void *data,
156  int *got_frame_ptr, AVPacket *pkt)
157 {
158  struct libopus_context *opus = avc->priv_data;
159  AVFrame *frame = data;
160  int ret, nb_samples;
161 
162  frame->nb_samples = MAX_FRAME_SIZE;
163  if ((ret = ff_get_buffer(avc, frame, 0)) < 0)
164  return ret;
165 
166  if (avc->sample_fmt == AV_SAMPLE_FMT_S16)
167  nb_samples = opus_multistream_decode(opus->dec, pkt->data, pkt->size,
168  (opus_int16 *)frame->data[0],
169  frame->nb_samples, 0);
170  else
171  nb_samples = opus_multistream_decode_float(opus->dec, pkt->data, pkt->size,
172  (float *)frame->data[0],
173  frame->nb_samples, 0);
174 
175  if (nb_samples < 0) {
176  av_log(avc, AV_LOG_ERROR, "Decoding error: %s\n",
177  opus_strerror(nb_samples));
178  return ff_opus_error_to_averror(nb_samples);
179  }
180 
181 #ifndef OPUS_SET_GAIN
182  {
183  int i = avc->channels * nb_samples;
184  if (avc->sample_fmt == AV_SAMPLE_FMT_FLT) {
185  float *pcm = (float *)frame->data[0];
186  for (; i > 0; i--, pcm++)
187  *pcm = av_clipf(*pcm * opus->gain.d, -1, 1);
188  } else {
189  int16_t *pcm = (int16_t *)frame->data[0];
190  for (; i > 0; i--, pcm++)
191  *pcm = av_clip_int16(((int64_t)opus->gain.i * *pcm) >> 16);
192  }
193  }
194 #endif
195 
196  frame->nb_samples = nb_samples;
197  *got_frame_ptr = 1;
198 
199  return pkt->size;
200 }
201 
202 static void libopus_flush(AVCodecContext *avc)
203 {
204  struct libopus_context *opus = avc->priv_data;
205 
206  opus_multistream_decoder_ctl(opus->dec, OPUS_RESET_STATE);
207  /* The stream can have been extracted by a tool that is not Opus-aware.
208  Therefore, any packet can become the first of the stream. */
209  avc->internal->skip_samples = opus->pre_skip;
210 }
211 
213  .name = "libopus",
214  .long_name = NULL_IF_CONFIG_SMALL("libopus Opus"),
215  .type = AVMEDIA_TYPE_AUDIO,
216  .id = AV_CODEC_ID_OPUS,
217  .priv_data_size = sizeof(struct libopus_context),
218  .init = libopus_decode_init,
219  .close = libopus_decode_close,
220  .decode = libopus_decode,
221  .flush = libopus_flush,
222  .capabilities = AV_CODEC_CAP_DR1,
223  .sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_FLT,
226  .wrapper_name = "libopus",
227 };
static int libopus_decode(AVCodecContext *avc, void *data, int *got_frame_ptr, AVPacket *pkt)
Definition: libopusdec.c:155
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
Definition: error.h:59
This structure describes decoded (raw) audio or video data.
Definition: frame.h:201
ptrdiff_t const GLvoid * data
Definition: opengl_enc.c:101
#define AV_LOG_WARNING
Something somehow does not look correct.
Definition: log.h:182
int size
Definition: avcodec.h:1415
static AVPacket pkt
AVCodec.
Definition: avcodec.h:3365
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_WL32 unsigned int_TMPL AV_WL24 unsigned int_TMPL AV_RL16
Definition: bytestream.h:87
AVCodec ff_libopus_decoder
Definition: libopusdec.c:212
int ff_opus_error_to_averror(int err)
Definition: libopus.c:28
enum AVSampleFormat sample_fmt
audio sample format
Definition: avcodec.h:2165
uint8_t
static int nb_streams
Definition: ffprobe.c:276
#define av_cold
Definition: attributes.h:82
#define MAX_FRAME_SIZE
Definition: libopusdec.c:153
uint8_t * extradata
some codecs need / can use extradata like Huffman tables.
Definition: avcodec.h:1602
static AVFrame * frame
uint8_t * data
Definition: avcodec.h:1414
#define av_log(a,...)
#define ff_sqrt
Definition: mathops.h:206
#define AV_RL8(x)
Definition: intreadwrite.h:398
OpusMSDecoder * dec
Definition: libopusdec.c:36
static av_always_inline double ff_exp10(double x)
Compute 10^x for floating point values.
Definition: ffmath.h:42
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Definition: log.h:176
#define AVERROR(e)
Definition: error.h:43
enum AVSampleFormat request_sample_fmt
desired sample format
Definition: avcodec.h:2230
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:186
const char * name
Name of the codec implementation.
Definition: avcodec.h:3372
uint64_t channel_layout
Audio channel layout.
Definition: avcodec.h:2208
common internal API header
#define FFMIN(a, b)
Definition: common.h:96
static av_cold int libopus_decode_init(AVCodecContext *avc)
Definition: libopusdec.c:45
Libavcodec external API header.
AVSampleFormat
Audio sample formats.
Definition: samplefmt.h:58
int sample_rate
samples per second
Definition: avcodec.h:2157
main external API structure.
Definition: avcodec.h:1502
const uint64_t ff_vorbis_channel_layouts[9]
Definition: vorbis_data.c:47
static void libopus_flush(AVCodecContext *avc)
Definition: libopusdec.c:202
int ff_get_buffer(AVCodecContext *avctx, AVFrame *frame, int flags)
Get a buffer for a frame.
Definition: decode.c:1886
int extradata_size
Definition: avcodec.h:1603
int skip_samples
Number of audio samples to skip at the start of the next decoded frame.
Definition: internal.h:183
#define OPUS_HEAD_SIZE
Definition: libopusdec.c:43
static av_const int sign_extend(int val, unsigned bits)
Definition: mathops.h:130
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
Definition: frame.h:215
internal math functions header
common internal api header.
signed 16 bits
Definition: samplefmt.h:61
void * priv_data
Definition: avcodec.h:1529
int channels
number of audio channels
Definition: avcodec.h:2158
struct AVCodecInternal * internal
Private context used for internal data.
Definition: avcodec.h:1537
static av_cold int libopus_decode_close(AVCodecContext *avc)
Definition: libopusdec.c:145
union libopus_context::@98 gain
const uint8_t ff_vorbis_channel_layout_offsets[8][8]
Definition: vorbis_data.c:25
This structure stores compressed data.
Definition: avcodec.h:1391
int delay
Codec delay.
Definition: avcodec.h:1657
int nb_samples
number of audio samples (per channel) described by this frame
Definition: frame.h:267
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() for allocating buffers and supports custom allocators.
Definition: avcodec.h:956
for(j=16;j >0;--j)
uint8_t pi<< 24) CONV_FUNC(AV_SAMPLE_FMT_S64, int64_t, AV_SAMPLE_FMT_U8,(uint64_t)((*(constuint8_t *) pi-0x80U))<< 56) CONV_FUNC(AV_SAMPLE_FMT_FLT, float, AV_SAMPLE_FMT_U8,(*(constuint8_t *) pi-0x80)*(1.0f/(1<< 7))) CONV_FUNC(AV_SAMPLE_FMT_DBL, double, AV_SAMPLE_FMT_U8,(*(constuint8_t *) pi-0x80)*(1.0/(1<< 7))) CONV_FUNC(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_S16,(*(constint16_t *) pi >>8)+0x80) CONV_FUNC(AV_SAMPLE_FMT_S64, int64_t, AV_SAMPLE_FMT_S16,(uint64_t)(*(constint16_t *) pi)<< 48) CONV_FUNC(AV_SAMPLE_FMT_FLT, float, AV_SAMPLE_FMT_S16,*(constint16_t *) pi *(1.0f/(1<< 15))) CONV_FUNC(AV_SAMPLE_FMT_DBL, double, AV_SAMPLE_FMT_S16,*(constint16_t *) pi *(1.0/(1<< 15))) CONV_FUNC(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_S32,(*(constint32_t *) pi >>24)+0x80) CONV_FUNC(AV_SAMPLE_FMT_S64, int64_t, AV_SAMPLE_FMT_S32,(uint64_t)(*(constint32_t *) pi)<< 32) CONV_FUNC(AV_SAMPLE_FMT_FLT, float, AV_SAMPLE_FMT_S32,*(constint32_t *) pi *(1.0f/(1U<< 31))) CONV_FUNC(AV_SAMPLE_FMT_DBL, double, AV_SAMPLE_FMT_S32,*(constint32_t *) pi *(1.0/(1U<< 31))) CONV_FUNC(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_S64,(*(constint64_t *) pi >>56)+0x80) CONV_FUNC(AV_SAMPLE_FMT_FLT, float, AV_SAMPLE_FMT_S64,*(constint64_t *) pi *(1.0f/(INT64_C(1)<< 63))) CONV_FUNC(AV_SAMPLE_FMT_DBL, double, AV_SAMPLE_FMT_S64,*(constint64_t *) pi *(1.0/(INT64_C(1)<< 63))) CONV_FUNC(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_FLT, av_clip_uint8(lrintf(*(constfloat *) pi *(1<< 7))+0x80)) CONV_FUNC(AV_SAMPLE_FMT_S16, int16_t, AV_SAMPLE_FMT_FLT, av_clip_int16(lrintf(*(constfloat *) pi *(1<< 15)))) CONV_FUNC(AV_SAMPLE_FMT_S32, int32_t, AV_SAMPLE_FMT_FLT, av_clipl_int32(llrintf(*(constfloat *) pi *(1U<< 31)))) CONV_FUNC(AV_SAMPLE_FMT_S64, int64_t, AV_SAMPLE_FMT_FLT, llrintf(*(constfloat *) pi *(INT64_C(1)<< 63))) CONV_FUNC(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_DBL, av_clip_uint8(lrint(*(constdouble *) pi *(1<< 7))+0x80)) CONV_FUNC(AV_SAMPLE_FMT_S16, int16_t, AV_SAMPLE_FMT_DBL, av_clip_int16(lrint(*(constdouble *) pi *(1<< 15)))) CONV_FUNC(AV_SAMPLE_FMT_S32, int32_t, AV_SAMPLE_FMT_DBL, av_clipl_int32(llrint(*(constdouble *) pi *(1U<< 31)))) CONV_FUNC(AV_SAMPLE_FMT_S64, int64_t, AV_SAMPLE_FMT_DBL, llrint(*(constdouble *) pi *(INT64_C(1)<< 63)))#defineFMT_PAIR_FUNC(out, in) staticconv_func_type *constfmt_pair_to_conv_functions[AV_SAMPLE_FMT_NB *AV_SAMPLE_FMT_NB]={FMT_PAIR_FUNC(AV_SAMPLE_FMT_U8, AV_SAMPLE_FMT_U8), FMT_PAIR_FUNC(AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_U8), FMT_PAIR_FUNC(AV_SAMPLE_FMT_S32, AV_SAMPLE_FMT_U8), FMT_PAIR_FUNC(AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_U8), FMT_PAIR_FUNC(AV_SAMPLE_FMT_DBL, AV_SAMPLE_FMT_U8), FMT_PAIR_FUNC(AV_SAMPLE_FMT_S64, AV_SAMPLE_FMT_U8), FMT_PAIR_FUNC(AV_SAMPLE_FMT_U8, AV_SAMPLE_FMT_S16), FMT_PAIR_FUNC(AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_S16), FMT_PAIR_FUNC(AV_SAMPLE_FMT_S32, AV_SAMPLE_FMT_S16), FMT_PAIR_FUNC(AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_S16), FMT_PAIR_FUNC(AV_SAMPLE_FMT_DBL, AV_SAMPLE_FMT_S16), FMT_PAIR_FUNC(AV_SAMPLE_FMT_S64, AV_SAMPLE_FMT_S16), FMT_PAIR_FUNC(AV_SAMPLE_FMT_U8, AV_SAMPLE_FMT_S32), FMT_PAIR_FUNC(AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_S32), FMT_PAIR_FUNC(AV_SAMPLE_FMT_S32, AV_SAMPLE_FMT_S32), FMT_PAIR_FUNC(AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_S32), FMT_PAIR_FUNC(AV_SAMPLE_FMT_DBL, AV_SAMPLE_FMT_S32), FMT_PAIR_FUNC(AV_SAMPLE_FMT_S64, AV_SAMPLE_FMT_S32), FMT_PAIR_FUNC(AV_SAMPLE_FMT_U8, AV_SAMPLE_FMT_FLT), FMT_PAIR_FUNC(AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_FLT), FMT_PAIR_FUNC(AV_SAMPLE_FMT_S32, AV_SAMPLE_FMT_FLT), FMT_PAIR_FUNC(AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_FLT), FMT_PAIR_FUNC(AV_SAMPLE_FMT_DBL, AV_SAMPLE_FMT_FLT), FMT_PAIR_FUNC(AV_SAMPLE_FMT_S64, AV_SAMPLE_FMT_FLT), FMT_PAIR_FUNC(AV_SAMPLE_FMT_U8, AV_SAMPLE_FMT_DBL), FMT_PAIR_FUNC(AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_DBL), FMT_PAIR_FUNC(AV_SAMPLE_FMT_S32, AV_SAMPLE_FMT_DBL), FMT_PAIR_FUNC(AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_DBL), FMT_PAIR_FUNC(AV_SAMPLE_FMT_DBL, AV_SAMPLE_FMT_DBL), FMT_PAIR_FUNC(AV_SAMPLE_FMT_S64, AV_SAMPLE_FMT_DBL), FMT_PAIR_FUNC(AV_SAMPLE_FMT_U8, AV_SAMPLE_FMT_S64), FMT_PAIR_FUNC(AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_S64), FMT_PAIR_FUNC(AV_SAMPLE_FMT_S32, AV_SAMPLE_FMT_S64), FMT_PAIR_FUNC(AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_S64), FMT_PAIR_FUNC(AV_SAMPLE_FMT_DBL, AV_SAMPLE_FMT_S64), FMT_PAIR_FUNC(AV_SAMPLE_FMT_S64, AV_SAMPLE_FMT_S64),};staticvoidcpy1(uint8_t **dst, constuint8_t **src, intlen){memcpy(*dst,*src, len);}staticvoidcpy2(uint8_t **dst, constuint8_t **src, intlen){memcpy(*dst,*src, 2 *len);}staticvoidcpy4(uint8_t **dst, constuint8_t **src, intlen){memcpy(*dst,*src, 4 *len);}staticvoidcpy8(uint8_t **dst, constuint8_t **src, intlen){memcpy(*dst,*src, 8 *len);}AudioConvert *swri_audio_convert_alloc(enumAVSampleFormatout_fmt, enumAVSampleFormatin_fmt, intchannels, constint *ch_map, intflags){AudioConvert *ctx;conv_func_type *f=fmt_pair_to_conv_functions[av_get_packed_sample_fmt(out_fmt)+AV_SAMPLE_FMT_NB *av_get_packed_sample_fmt(in_fmt)];if(!f) returnNULL;ctx=av_mallocz(sizeof(*ctx));if(!ctx) returnNULL;if(channels==1){in_fmt=av_get_planar_sample_fmt(in_fmt);out_fmt=av_get_planar_sample_fmt(out_fmt);}ctx->channels=channels;ctx->conv_f=f;ctx->ch_map=ch_map;if(in_fmt==AV_SAMPLE_FMT_U8||in_fmt==AV_SAMPLE_FMT_U8P) memset(ctx->silence, 0x80, sizeof(ctx->silence));if(out_fmt==in_fmt &&!ch_map){switch(av_get_bytes_per_sample(in_fmt)){case1:ctx->simd_f=cpy1;break;case2:ctx->simd_f=cpy2;break;case4:ctx->simd_f=cpy4;break;case8:ctx->simd_f=cpy8;break;}}if(HAVE_X86ASM &&1) swri_audio_convert_init_x86(ctx, out_fmt, in_fmt, channels);if(ARCH_ARM) swri_audio_convert_init_arm(ctx, out_fmt, in_fmt, channels);if(ARCH_AARCH64) swri_audio_convert_init_aarch64(ctx, out_fmt, in_fmt, channels);returnctx;}voidswri_audio_convert_free(AudioConvert **ctx){av_freep(ctx);}intswri_audio_convert(AudioConvert *ctx, AudioData *out, AudioData *in, intlen){intch;intoff=0;constintos=(out->planar?1:out->ch_count)*out->bps;unsignedmisaligned=0;av_assert0(ctx->channels==out->ch_count);if(ctx->in_simd_align_mask){intplanes=in->planar?in->ch_count:1;unsignedm=0;for(ch=0;ch< planes;ch++) m|=(intptr_t) in->ch[ch];misaligned|=m &ctx->in_simd_align_mask;}if(ctx->out_simd_align_mask){intplanes=out->planar?out->ch_count:1;unsignedm=0;for(ch=0;ch< planes;ch++) m|=(intptr_t) out->ch[ch];misaligned|=m &ctx->out_simd_align_mask;}if(ctx->simd_f &&!ctx->ch_map &&!misaligned){off=len &~15;av_assert1(off >=0);av_assert1(off<=len);av_assert2(ctx->channels==SWR_CH_MAX||!in->ch[ctx->channels]);if(off >0){if(out->planar==in->planar){intplanes=out->planar?out->ch_count:1;for(ch=0;ch< planes;ch++){ctx->simd_f(out-> ch ch
Definition: audioconvert.c:56