25 #include "libavutil/common.h"
32 dst[i] = src[i] * mul;
40 for (i = 0; i <
len; i += 8)
45 return av_clip_int16(
lrintf(*src));
56 long len,
int channels)
65 for(c=0; c<channels; c++)
66 for(i=0, j=c; i<
len; i++, j+=channels)
77 for (i = 0; i <
len; i++) {
79 dst[2*i+1] = src[1][i];
81 }
else if (channels == 1 && len < INT_MAX /
sizeof(
float)) {
82 memcpy(dst, src[0], len *
sizeof(
float));
84 for (c = 0; c < channels; c++)
85 for (i = 0, j = c; i <
len; i++, j += channels)
109 for(i=0; i<
len; i++){
110 dst[2*i] = src[0][i] / 32768.0f;
111 dst[2*i+1] = src[1][i] / 32768.0f;
114 for(c=0; c<channels; c++)
115 for(i=0, j=c; i<
len; i++, j+=channels)
116 dst[j] = src[c][i] / 32768.0f;
124 for(i=0; i<
len; i++){
125 dst[2*i] = src[0][i];
126 dst[2*i+1] = src[1][i];
129 for(c=0; c<channels; c++)
130 for(i=0, j=c; i<
len; i++, j+=channels)
static void float_to_int16_c(int16_t *dst, const float *src, long len)
void(* float_interleave)(float *dst, const float **src, unsigned int len, int channels)
Convert multiple arrays of float to an array of interleaved float.
static void int32_to_float_fmul_scalar_c(float *dst, const int32_t *src, float mul, int len)
void(* float_to_int16_interleave)(int16_t *dst, const float **src, long len, int channels)
Convert multiple arrays of float to an interleaved array of int16_t.
static av_always_inline int float_to_int16_one(const float *src)
void(* int32_to_float_fmul_array8)(struct FmtConvertContext *c, float *dst, const int32_t *src, const float *mul, int len)
Convert an array of int32_t to float and multiply by a float value from another array, stepping along the float array once for each 8 integers.
static void int32_to_float_fmul_array8_c(FmtConvertContext *c, float *dst, const int32_t *src, const float *mul, int len)
void ff_fmt_convert_init_ppc(FmtConvertContext *c, AVCodecContext *avctx)
void ff_float_interleave_c(float *dst, const float **src, unsigned int len, int channels)
av_cold void ff_fmt_convert_init_arm(FmtConvertContext *c, AVCodecContext *avctx)
void float_interleave(float *dst, const float **src, long len, int channels)
void float_interleave_noscale(float *dst, const float **src, long len, int channels)
Libavcodec external API header.
void(* float_to_int16)(int16_t *dst, const float *src, long len)
Convert an array of float to an array of int16_t.
void(* int32_to_float_fmul_scalar)(float *dst, const int32_t *src, float mul, int len)
Convert an array of int32_t to float and multiply by a float value.
main external API structure.
void ff_fmt_convert_init_x86(FmtConvertContext *c, AVCodecContext *avctx)
static void float_to_int16_interleave_c(int16_t *dst, const float **src, long len, int channels)
av_cold void ff_fmt_convert_init(FmtConvertContext *c, AVCodecContext *avctx)
void ff_fmt_convert_init_mips(FmtConvertContext *c)