Revision f25ba8b3 libavcodec/resample2.c

View differences:

libavcodec/resample2.c
42 42
#define FELEM_MAX INT16_MAX
43 43
#define FELEM_MIN INT16_MIN
44 44
#else
45
#define FILTER_SHIFT 24
45
#define FILTER_SHIFT 22
46 46

  
47 47
#define FELEM int32_t
48 48
#define FELEM2 int64_t
......
193 193
        }else{
194 194
#ifdef LINEAR
195 195
            int64_t v=0;
196
            int sub_phase= (frac<<12) / c->src_incr;
196
            int sub_phase= (frac<<8) / c->src_incr;
197 197
            for(i=0; i<c->filter_length; i++){
198
                int64_t coeff= filter[i]*(FELEM2)(4096 - sub_phase) + filter[i + c->filter_length]*(FELEM2)sub_phase;
198
                int64_t coeff= filter[i]*(256 - sub_phase) + filter[i + c->filter_length]*sub_phase;
199 199
                v += src[sample_index + i] * coeff;
200 200
            }
201
            val= v>>12;
201
            val= v>>8;
202 202
#else
203 203
            for(i=0; i<c->filter_length; i++){
204 204
                val += src[sample_index + i] * (FELEM2)filter[i];

Also available in: Unified diff