Mercurial > libavcodec.hg
comparison dsputil.c @ 7564:7cf793954871 libavcodec
simd int->float
20% faster ac3 if downmixing, 15% if not
author | lorenm |
---|---|
date | Wed, 13 Aug 2008 23:35:40 +0000 |
parents | 8390efaa0c03 |
children | 1fbfce20cb79 |
comparison
equal
deleted
inserted
replaced
7563:8390efaa0c03 | 7564:7cf793954871 |
---|---|
3946 dst[i] = s0*wj - s1*wi + add_bias; | 3946 dst[i] = s0*wj - s1*wi + add_bias; |
3947 dst[j] = s0*wi + s1*wj + add_bias; | 3947 dst[j] = s0*wi + s1*wj + add_bias; |
3948 } | 3948 } |
3949 } | 3949 } |
3950 | 3950 |
3951 static void int32_to_float_fmul_scalar_c(float *dst, const int *src, float mul, int len){ | |
3952 int i; | |
3953 for(i=0; i<len; i++) | |
3954 dst[i] = src[i] * mul; | |
3955 } | |
3956 | |
3951 static av_always_inline int float_to_int16_one(const float *src){ | 3957 static av_always_inline int float_to_int16_one(const float *src){ |
3952 int_fast32_t tmp = *(const int32_t*)src; | 3958 int_fast32_t tmp = *(const int32_t*)src; |
3953 if(tmp & 0xf0000){ | 3959 if(tmp & 0xf0000){ |
3954 tmp = (0x43c0ffff - tmp)>>31; | 3960 tmp = (0x43c0ffff - tmp)>>31; |
3955 // is this faster on some gcc/cpu combinations? | 3961 // is this faster on some gcc/cpu combinations? |
4487 #endif | 4493 #endif |
4488 c->vector_fmul = vector_fmul_c; | 4494 c->vector_fmul = vector_fmul_c; |
4489 c->vector_fmul_reverse = vector_fmul_reverse_c; | 4495 c->vector_fmul_reverse = vector_fmul_reverse_c; |
4490 c->vector_fmul_add_add = ff_vector_fmul_add_add_c; | 4496 c->vector_fmul_add_add = ff_vector_fmul_add_add_c; |
4491 c->vector_fmul_window = ff_vector_fmul_window_c; | 4497 c->vector_fmul_window = ff_vector_fmul_window_c; |
4498 c->int32_to_float_fmul_scalar = int32_to_float_fmul_scalar_c; | |
4492 c->float_to_int16 = ff_float_to_int16_c; | 4499 c->float_to_int16 = ff_float_to_int16_c; |
4493 c->float_to_int16_interleave = ff_float_to_int16_interleave_c; | 4500 c->float_to_int16_interleave = ff_float_to_int16_interleave_c; |
4494 c->add_int16 = add_int16_c; | 4501 c->add_int16 = add_int16_c; |
4495 c->sub_int16 = sub_int16_c; | 4502 c->sub_int16 = sub_int16_c; |
4496 c->scalarproduct_int16 = scalarproduct_int16_c; | 4503 c->scalarproduct_int16 = scalarproduct_int16_c; |