static void inplace_lift(int *dst, int width, int *coeffs, int n, int shift, int start, int inverse){
static void inplace_lift(DWTELEM *dst, int width, int *coeffs, int n, int shift, int start, int inverse){
static void inplace_lift(int *dst, int width, int *coeffs, int n, int shift, int start, int inverse){    int x, i;        for(x=start; x<width; x+=2){        int64_t sum=0;        for(i=0; i<n; i++){            int x2= x + 2*i - n + 1;            if     (x2<     0) x2= -x2;            else if(x2>=width) x2= 2*width-x2-2;            sum += coeffs[i]*(int64_t)dst[x2];        }        if(inverse) dst[x] -= (sum + (1<<shift)/2)>>shift;        else        dst[x] += (sum + (1<<shift)/2)>>shift;    }}