Revision 50e23ae9

View differences:

libavcodec/dsputil.c
4102 4102
    else return a;
4103 4103
}
4104 4104

  
4105
static void vector_clipf_c_opposite_sign(float *dst, float *src, float *min, float *max, int len){
4105
static void vector_clipf_c_opposite_sign(float *dst, const float *src, float *min, float *max, int len){
4106 4106
    int i;
4107 4107
    uint32_t mini = *(uint32_t*)min;
4108 4108
    uint32_t maxi = *(uint32_t*)max;
4109 4109
    uint32_t maxisign = maxi ^ (1<<31);
4110 4110
    uint32_t *dsti = (uint32_t*)dst;
4111
    uint32_t *srci = (uint32_t*)src;
4111
    const uint32_t *srci = (const uint32_t*)src;
4112 4112
    for(i=0; i<len; i+=8) {
4113 4113
        dsti[i + 0] = clipf_c_one(srci[i + 0], mini, maxi, maxisign);
4114 4114
        dsti[i + 1] = clipf_c_one(srci[i + 1], mini, maxi, maxisign);
......
4120 4120
        dsti[i + 7] = clipf_c_one(srci[i + 7], mini, maxi, maxisign);
4121 4121
    }
4122 4122
}
4123
static void vector_clipf_c(float *dst, float *src, float min, float max, int len){
4123
static void vector_clipf_c(float *dst, const float *src, float min, float max, int len){
4124 4124
    int i;
4125 4125
    if(min < 0 && max > 0) {
4126 4126
        vector_clipf_c_opposite_sign(dst, src, &min, &max, len);
libavcodec/dsputil.h
396 396
    void (*vector_fmul_window)(float *dst, const float *src0, const float *src1, const float *win, float add_bias, int len);
397 397
    /* assume len is a multiple of 8, and arrays are 16-byte aligned */
398 398
    void (*int32_to_float_fmul_scalar)(float *dst, const int *src, float mul, int len);
399
    void (*vector_clipf)(float *dst /* align 16 */, 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 400

  
401 401
    /* C version: convert floats from the range [384.0,386.0] to ints in [-32768,32767]
402 402
     * simd versions: convert floats from [-32768.0,32767.0] without rescaling and arrays are 16byte aligned */
libavcodec/x86/dsputil_mmx.c
2346 2346
    );
2347 2347
}
2348 2348

  
2349
static void vector_clipf_sse(float *dst, float *src, float min, float max,
2349
static void vector_clipf_sse(float *dst, const float *src, float min, float max,
2350 2350
                             int len)
2351 2351
{
2352 2352
    x86_reg i = (len-16)*4;

Also available in: Unified diff