104 int values, sign, base;
116 grad_range[1] =
get_bits(gb, 6) + 1;
122 if (grad_range[0] >= grad_range[1] || grad_range[1] > 47)
125 if (grad_value[0] > 31 || grad_value[1] > 31)
131 values = grad_value[1] - grad_value[0];
132 sign = 1 - 2*(values < 0);
133 base = grad_value[0] + sign;
134 scale = (
FFABS(values) - 1) / 31.0
f;
135 curve = s->
alloc_curve[grad_range[1] - grad_range[0] - 1];
138 b->
gradient[i] = grad_value[i >= grad_range[0]];
140 for (
int i = grad_range[0]; i < grad_range[1]; i++)
141 b->
gradient[i] = base + sign*((
int)(scale*curve[i - grad_range[0]]));
228 for (
int i = 0; i <= stereo; i++) {
231 for (
int j = 0; j <
count; j++) {
242 int channel_idx,
int first_in_pkt)
244 static const int mode_map[2][4] = { { 0, 1, 2, 3 }, { 0, 2, 3, 4 } };
245 const int mode = mode_map[channel_idx][
get_bits(gb, 2)];
249 if (first_in_pkt && (mode == 4 || ((mode == 3) && !channel_idx))) {
275 const int base = len < 5 ?
get_bits(gb, 5) : 0;
293 for (
int i = 0; i < unit_cnt; i++) {
309 const int base =
get_bits(gb, 5) - (1 << (5 - 1));
316 for (
int i = 1; i < unit_cnt; i++) {
321 for (
int i = 0; i < unit_cnt; i++)
355 for (
int i = 0; i < 12; i++)
357 avg = (avg + 6) / 12;
365 if ((cur - min >= 3 || 2*cur - prev - next >= 3))
395 if (prec <= max_prec) {
402 for (
int j = 0; j <
groups; j++) {
405 for (
int k = 0; k < huff->
value_cnt; k++) {
413 for (
int j = 0; j <
bands; j++)
432 for (
int j = start; j <
end; j++)
449 for (
int j = start; j <
end; j++) {
473 for (
int j = start; j <
end; j++)
474 dst[j] = sign*src[j];
481 for (
int i = 0; i <= stereo; i++) {
488 for (
int k = start; k <
end; k++)
498 for (
int i = 0; i <
count; i += 2) {
501 c->
coeffs[start + i + 0] = tmp[0];
502 c->
coeffs[start + i + 1] = tmp[1];
506 for (
int i = 0; i <
count; i++)
507 c->
coeffs[start + i] /= maxval;
511 const int s_unit,
const int e_unit)
513 for (
int i = s_unit; i < e_unit; i++) {
516 for (
int j = start; j <
end; j++)
517 c->
coeffs[j] *= sf[i - s_unit];
524 const int g_units[4] = {
528 FFMAX(g_units[2], 22),
531 const int g_bins[4] = {
541 for (
int ch = 0;
ch <= stereo;
ch++) {
545 for (
int i = 0; i < 3; i++)
546 for (
int j = 0; j < (g_bins[i + 1] - g_bins[i + 0]); j++)
547 c->
coeffs[g_bins[i] + j] = c->
coeffs[g_bins[i] - j - 1];
551 float sf[6] = { 0.0f };
552 const int l = g_units[3] - g_units[0] - 1;
585 for (
int i = g_units[0]; i < g_units[3]; i++)
593 const float g_sf[2] = {
598 for (
int i = 0; i < 2; i++)
599 for (
int j = g_bins[i + 0]; j < g_bins[i + 1]; j++)
607 for (
int i = g_bins[0]; i < g_bins[3]; i++) {
615 const float g_sf[3] = { 0.7079468f*m, 0.5011902f*m, 0.3548279f*m };
617 for (
int i = 0; i < 3; i++)
618 for (
int j = g_bins[i + 0]; j < g_bins[i + 1]; j++)
628 int frame_idx,
int block_idx)
636 const int precision = reuse_params ? 8 : 4;
652 for (
int j = start; j <
end; j++)
662 if (first_in_pkt && reuse_params) {
669 int stereo_band, ext_band;
683 stereo_band =
get_bits(gb, 4) + min_band_count;
694 ext_band =
get_bits(gb, 4) + min_band_count;
695 if (ext_band < b->band_count) {
726 for (
int i = 0; i <= stereo; i++) {
747 for (
int i = 0; i <= stereo; i++) {
751 const ptrdiff_t
offset = wsize*frame_idx*
sizeof(float);
752 float *dst = (
float *)(frame->
extended_data[dst_idx] + offset);
757 memcpy(c->
prev_win, s->
temp + (wsize >> 1),
sizeof(
float)*wsize >> 1);
764 int *got_frame_ptr,
AVPacket *avpkt)
779 for (
int i = 0; i <
frames; i++) {
800 for (
int i = 0; i <= stereo; i++) {
811 for (
int i = 1; i < 7; i++)
813 for (
int i = 2; i < 6; i++)
815 for (
int i = 0; i < 2; i++)
816 for (
int j = 0; j < 8; j++)
817 for (
int k = 0; k < 4; k++)
830 int version, block_config_idx, superframe_idx, alloc_c_len;
857 block_config_idx =
get_bits(&gb, 3);
858 if (block_config_idx > 5) {
876 if (superframe_idx & 1) {
892 for (
int i = 0; i < (1 << s->
frame_log2); i++) {
894 const float sidx = ( i + 0.5f) / len;
895 const float eidx = (len - i - 0.5f) / len;
898 s->
imdct_win[i] = s_c / ((s_c * s_c) + (e_c * e_c));
903 for (
int i = 1; i <= alloc_c_len; i++)
904 for (
int j = 0; j < i; j++)
908 for (
int i = 1; i < 7; i++) {
916 for (
int i = 2; i < 6; i++) {
921 for (
int j = 0; j < nums; j++)
925 hf->
codes, 2, 2, sym,
sizeof(*sym),
sizeof(*sym), 0);
929 for (
int i = 0; i < 2; i++) {
930 for (
int j = 0; j < 8; j++) {
931 for (
int k = 0; k < 4; k++) {
#define FF_CODEC_CAP_INIT_CLEANUP
The codec allows calling the close function for deallocation even if the init function returned a fai...
static const uint8_t at9_tab_sri_max_bands[]
const char const char void * val
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
AVCodec ff_atrac9_decoder
This structure describes decoded (raw) audio or video data.
static void apply_band_extension(ATRAC9Context *s, ATRAC9BlockData *b, const int stereo)
ptrdiff_t const GLvoid * data
static void flush(AVCodecContext *avctx)
static unsigned int get_bits(GetBitContext *s, int n)
Read 1-25 bits.
static void dequantize(ATRAC9Context *s, ATRAC9BlockData *b, ATRAC9ChannelData *c)
static void skip_bits_long(GetBitContext *s, int n)
Skips the specified number of bits.
static av_cold int init(AVCodecContext *avctx)
int ff_init_vlc_sparse(VLC *vlc_arg, int nb_bits, int nb_codes, const void *bits, int bits_wrap, int bits_size, const void *codes, int codes_wrap, int codes_size, const void *symbols, int symbols_wrap, int symbols_size, int flags)
static void read_coeffs_coarse(ATRAC9Context *s, ATRAC9BlockData *b, ATRAC9ChannelData *c, GetBitContext *gb)
int block_align
number of bytes per packet if constant and known or 0 Used by some WAV based audio codecs...
static void decode(AVCodecContext *dec_ctx, AVPacket *pkt, AVFrame *frame, FILE *outfile)
static const float at9_band_ext_scales_m4[]
static const HuffmanCodebook at9_huffman_coeffs[][8][4]
static double cb(void *priv, double x, double y)
static const int at9_tab_samplerates[]
void(* vector_fmul_window)(float *dst, const float *src0, const float *src1, const float *win, int len)
Overlap/add with window function.
#define FF_CODEC_CAP_INIT_THREADSAFE
The codec does not modify any global variables in the init function, allowing to call the init functi...
ATRAC9ChannelData channel[2]
enum AVSampleFormat sample_fmt
audio sample format
static const OptionGroupDef groups[]
static av_cold int end(AVCodecContext *avctx)
uint8_t * extradata
some codecs need / can use extradata like Huffman tables.
#define DECLARE_ALIGNED(n, t, v)
Declare a variable that is aligned in memory.
bitstream reader API header.
static void fill_with_noise(ATRAC9Context *s, ATRAC9ChannelData *c, int start, int count)
static int read_scalefactors(ATRAC9Context *s, ATRAC9BlockData *b, ATRAC9ChannelData *c, GetBitContext *gb, int channel_idx, int first_in_pkt)
void av_bmg_get(AVLFG *lfg, double out[2])
Get the next two numbers generated by a Box-Muller Gaussian generator using the random numbers issued...
static void apply_scalefactors(ATRAC9Context *s, ATRAC9BlockData *b, const int stereo)
static const uint8_t at9_tab_sf_weights[][32]
int32_t q_coeffs_coarse[256]
static void calc_precision(ATRAC9Context *s, ATRAC9BlockData *b, ATRAC9ChannelData *c)
static int atrac9_decode_block(ATRAC9Context *s, GetBitContext *gb, ATRAC9BlockData *b, AVFrame *frame, int frame_idx, int block_idx)
static const float at9_quant_step_fine[]
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
static void read_coeffs_fine(ATRAC9Context *s, ATRAC9BlockData *b, ATRAC9ChannelData *c, GetBitContext *gb)
av_cold AVFloatDSPContext * avpriv_float_dsp_alloc(int bit_exact)
Allocate a float DSP context.
#define init_vlc(vlc, nb_bits, nb_codes,bits, bits_wrap, bits_size,codes, codes_wrap, codes_size,flags)
static const uint8_t at9_tab_band_q_unit_map[]
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
const uint8_t at9_q_unit_to_codebookidx[]
int flags
AV_CODEC_FLAG_*.
static int parse_band_ext(ATRAC9Context *s, ATRAC9BlockData *b, GetBitContext *gb, int stereo)
const char * name
Name of the codec implementation.
static void calc_codebook_idx(ATRAC9Context *s, ATRAC9BlockData *b, ATRAC9ChannelData *c)
static const uint8_t offset[127][2]
uint64_t channel_layout
Audio channel layout.
enum ATRAC9BlockType type[5]
#define AV_CODEC_FLAG_BITEXACT
Use only bitexact stuff (except (I)DCT).
int32_t scalefactors_prev[31]
static const float at9_band_ext_scales_m0[][5][32]
#define FFABS(a)
Absolute value, Note, INT_MIN / INT64_MIN result in undefined behavior as they are not representable ...
static const float at9_scalefactor_c[]
static av_always_inline int get_vlc2(GetBitContext *s, VLC_TYPE(*table)[2], int bits, int max_depth)
Parse a vlc code.
#define FF_ARRAY_ELEMS(a)
static int parse_gradient(ATRAC9Context *s, ATRAC9BlockData *b, GetBitContext *gb)
static av_cold int atrac9_decode_init(AVCodecContext *avctx)
int sample_rate
samples per second
static int init_get_bits8(GetBitContext *s, const uint8_t *buffer, int byte_size)
Initialize GetBitContext.
main external API structure.
static const float bands[]
int ff_get_buffer(AVCodecContext *avctx, AVFrame *frame, int flags)
Get a buffer for a frame.
void(* imdct_half)(struct FFTContext *s, FFTSample *output, const FFTSample *input)
static void apply_intensity_stereo(ATRAC9Context *s, ATRAC9BlockData *b, const int stereo)
static unsigned int get_bits1(GetBitContext *s)
static const uint8_t at9_q_unit_to_coeff_cnt[]
static void skip_bits1(GetBitContext *s)
static void skip_bits(GetBitContext *s, int n)
#define AV_CODEC_CAP_SUBFRAMES
Codec can output multiple frames per AVPacket Normally demuxers return one frame at a time...
uint8_t alloc_curve[48][48]
static av_cold int atrac9_decode_close(AVCodecContext *avctx)
av_cold void av_lfg_init(AVLFG *c, unsigned int seed)
static const uint8_t at9_tab_band_ext_group[][3]
static const uint8_t at9_tab_band_ext_cnt[][6]
static av_const int sign_extend(int val, unsigned bits)
static const float at9_band_ext_scales_m2[]
static void scale_band_ext_coeffs(ATRAC9ChannelData *c, float sf[6], const int s_unit, const int e_unit)
static const float at9_quant_step_coarse[]
static int atrac9_decode_frame(AVCodecContext *avctx, void *data, int *got_frame_ptr, AVPacket *avpkt)
static const HuffmanCodebook at9_huffman_sf_unsigned[]
common internal api header.
const ATRAC9BlockConfig * block_config
channel
Use these values when setting the channel map with ebur128_set_channel().
static const uint8_t at9_tab_sri_frame_log2[]
static const float at9_band_ext_scales_m3[][2]
static const HuffmanCodebook at9_huffman_sf_signed[]
VLC_TYPE(* table)[2]
code, bits
static const uint8_t * align_get_bits(GetBitContext *s)
static const struct twinvq_data tab
static const ATRAC9BlockConfig at9_block_layout[]
static const uint8_t at9_tab_b_dist[]
static void atrac9_decode_flush(AVCodecContext *avctx)
uint8_t ** extended_data
pointers to the data planes/channels.
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_RL32
This structure stores compressed data.
void ff_free_vlc(VLC *vlc)
mode
Use these values in ebur128_init (or'ed).
int nb_samples
number of audio samples (per channel) described by this frame
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() for allocating buffers and supports custom allocators.
static const int at9_q_unit_to_coeff_idx[]
int32_t q_coeffs_fine[256]
static const uint8_t at9_tab_band_ext_lengths[][6][4]
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