comparison dsputil.h @ 10219:87ae4a167138 libavcodec

Add some dsputil functions useful for AAC decoder
author mru
date Tue, 22 Sep 2009 00:48:41 +0000
parents db033d1fbf44
children 4d1b9ca628fc
comparison
equal deleted inserted replaced
10218:84a9a55135f4 10219:87ae4a167138
395 /* assume len is a multiple of 4, and arrays are 16-byte aligned */ 395 /* assume len is a multiple of 4, and arrays are 16-byte aligned */
396 void (*vector_fmul_window)(float *dst, const float *src0, const float *src1, const float *win, float add_bias, int len); 396 void (*vector_fmul_window)(float *dst, const float *src0, const float *src1, const float *win, float add_bias, int len);
397 /* assume len is a multiple of 8, and arrays are 16-byte aligned */ 397 /* assume len is a multiple of 8, and arrays are 16-byte aligned */
398 void (*int32_to_float_fmul_scalar)(float *dst, const int *src, float mul, int len); 398 void (*int32_to_float_fmul_scalar)(float *dst, const int *src, float mul, int len);
399 void (*vector_clipf)(float *dst /* align 16 */, const float *src /* align 16 */, float min, float max, int len /* align 16 */); 399 void (*vector_clipf)(float *dst /* align 16 */, const float *src /* align 16 */, float min, float max, int len /* align 16 */);
400 /**
401 * Multiply a vector of floats by a scalar float. Source and
402 * destination vectors must overlap exactly or not at all.
403 * @param dst result vector, 16-byte aligned
404 * @param src input vector, 16-byte aligned
405 * @param mul scalar value
406 * @param len length of vector, multiple of 4
407 */
408 void (*vector_fmul_scalar)(float *dst, const float *src, float mul,
409 int len);
410 /**
411 * Multiply a vector of floats by concatenated short vectors of
412 * floats and by a scalar float. Source and destination vectors
413 * must overlap exactly or not at all.
414 * [0]: short vectors of length 2, 8-byte aligned
415 * [1]: short vectors of length 4, 16-byte aligned
416 * @param dst output vector, 16-byte aligned
417 * @param src input vector, 16-byte aligned
418 * @param sv array of pointers to short vectors
419 * @param mul scalar value
420 * @param len number of elements in src and dst, multiple of 4
421 */
422 void (*vector_fmul_sv_scalar[2])(float *dst, const float *src,
423 const float **sv, float mul, int len);
424 /**
425 * Multiply short vectors of floats by a scalar float, store
426 * concatenated result.
427 * [0]: short vectors of length 2, 8-byte aligned
428 * [1]: short vectors of length 4, 16-byte aligned
429 * @param dst output vector, 16-byte aligned
430 * @param sv array of pointers to short vectors
431 * @param mul scalar value
432 * @param len number of output elements, multiple of 4
433 */
434 void (*sv_fmul_scalar[2])(float *dst, const float **sv,
435 float mul, int len);
436 /**
437 * Calculate the scalar product of two vectors of floats.
438 * @param v1 first vector, 16-byte aligned
439 * @param v2 second vector, 16-byte aligned
440 * @param len length of vectors, multiple of 4
441 */
442 float (*scalarproduct_float)(const float *v1, const float *v2, int len);
443 /**
444 * Calculate the sum and difference of two vectors of floats.
445 * @param v1 first input vector, sum output, 16-byte aligned
446 * @param v2 second input vector, difference output, 16-byte aligned
447 * @param len length of vectors, multiple of 4
448 */
449 void (*butterflies_float)(float *restrict v1, float *restrict v2, int len);
400 450
401 /* C version: convert floats from the range [384.0,386.0] to ints in [-32768,32767] 451 /* C version: convert floats from the range [384.0,386.0] to ints in [-32768,32767]
402 * simd versions: convert floats from [-32768.0,32767.0] without rescaling and arrays are 16byte aligned */ 452 * simd versions: convert floats from [-32768.0,32767.0] without rescaling and arrays are 16byte aligned */
403 void (*float_to_int16)(int16_t *dst, const float *src, long len); 453 void (*float_to_int16)(int16_t *dst, const float *src, long len);
404 void (*float_to_int16_interleave)(int16_t *dst, const float **src, long len, int channels); 454 void (*float_to_int16_interleave)(int16_t *dst, const float **src, long len, int channels);