Revision fe2ff6d2 libavcodec/dsputil.c

View differences:

libavcodec/dsputil.c
3867 3867
    return p;
3868 3868
}
3869 3869

  
3870
static void int32_to_float_fmul_scalar_c(float *dst, const int *src, float mul, int len){
3871
    int i;
3872
    for(i=0; i<len; i++)
3873
        dst[i] = src[i] * mul;
3874
}
3875

  
3876 3870
static inline uint32_t clipf_c_one(uint32_t a, uint32_t mini,
3877 3871
                   uint32_t maxi, uint32_t maxisign)
3878 3872
{
......
3918 3912
    }
3919 3913
}
3920 3914

  
3921
static av_always_inline int float_to_int16_one(const float *src){
3922
    return av_clip_int16(lrintf(*src));
3923
}
3924

  
3925
static void ff_float_to_int16_c(int16_t *dst, const float *src, long len){
3926
    int i;
3927
    for(i=0; i<len; i++)
3928
        dst[i] = float_to_int16_one(src+i);
3929
}
3930

  
3931
static void ff_float_to_int16_interleave_c(int16_t *dst, const float **src, long len, int channels){
3932
    int i,j,c;
3933
    if(channels==2){
3934
        for(i=0; i<len; i++){
3935
            dst[2*i]   = float_to_int16_one(src[0]+i);
3936
            dst[2*i+1] = float_to_int16_one(src[1]+i);
3937
        }
3938
    }else{
3939
        for(c=0; c<channels; c++)
3940
            for(i=0, j=c; i<len; i++, j+=channels)
3941
                dst[j] = float_to_int16_one(src[c]+i);
3942
    }
3943
}
3944

  
3945 3915
static int32_t scalarproduct_int16_c(const int16_t * v1, const int16_t * v2, int order, int shift)
3946 3916
{
3947 3917
    int res = 0;
......
4437 4407
    c->vector_fmul_reverse = vector_fmul_reverse_c;
4438 4408
    c->vector_fmul_add = vector_fmul_add_c;
4439 4409
    c->vector_fmul_window = vector_fmul_window_c;
4440
    c->int32_to_float_fmul_scalar = int32_to_float_fmul_scalar_c;
4441 4410
    c->vector_clipf = vector_clipf_c;
4442
    c->float_to_int16 = ff_float_to_int16_c;
4443
    c->float_to_int16_interleave = ff_float_to_int16_interleave_c;
4444 4411
    c->scalarproduct_int16 = scalarproduct_int16_c;
4445 4412
    c->scalarproduct_and_madd_int16 = scalarproduct_and_madd_int16_c;
4446 4413
    c->scalarproduct_float = scalarproduct_float_c;

Also available in: Unified diff