| 164 | |
| 165 | #ifndef liftS |
| 166 | static av_always_inline void |
| 167 | liftS(DWTELEM *dst, DWTELEM *src, DWTELEM *ref, |
| 168 | int dst_step, int src_step, int ref_step, |
| 169 | int width, int mul, int add, int shift, |
| 170 | int highpass, int inverse){ |
| 171 | const int mirror_left= !highpass; |
| 172 | const int mirror_right= (width&1) ^ highpass; |
| 173 | const int w= (width>>1) - 1 + (highpass & width); |
| 174 | int i; |
| 175 | |
| 176 | assert(shift == 4); |
| 177 | #define LIFTS(src, ref, inv) \ |
| 178 | ((inv) ? \ |
| 179 | (src) + (((ref) + 4*(src))>>shift): \ |
| 180 | -((-16*(src) + (ref) + add/4 + 1 + (5<<25))/(5*4) - (1<<23))) |
| 181 | if(mirror_left){ |
| 182 | dst[0] = LIFTS(src[0], mul*2*ref[0]+add, inverse); |
| 183 | dst += dst_step; |
| 184 | src += src_step; |
| 185 | } |
| 186 | |
| 187 | for(i=0; i<w; i++){ |
| 188 | dst[i*dst_step] = |
| 189 | LIFTS(src[i*src_step], |
| 190 | mul*(ref[i*ref_step] + ref[(i+1)*ref_step])+add, |
| 191 | inverse); |
| 192 | } |
| 193 | |
| 194 | if(mirror_right){ |
| 195 | dst[w*dst_step] = |
| 196 | LIFTS(src[w*src_step], mul*2*ref[w*ref_step]+add, inverse); |
| 197 | } |
| 198 | } |
| 199 | static av_always_inline void |
| 200 | inv_liftS(IDWTELEM *dst, IDWTELEM *src, IDWTELEM *ref, |
| 201 | int dst_step, int src_step, int ref_step, |
no outgoing calls
no test coverage detected