comparison i386/snowdsp_mmx.c @ 3223:8f048c3295ff libavcodec

altivec support for snow
author lu_zero
date Mon, 27 Mar 2006 12:51:19 +0000
parents b77b5e7072d6
children ba26b176dcf8
comparison
equal deleted inserted replaced
3222:38ee2f1d386d 3223:8f048c3295ff
18 */ 18 */
19 19
20 #include "../avcodec.h" 20 #include "../avcodec.h"
21 #include "../snow.h" 21 #include "../snow.h"
22 #include "mmx.h" 22 #include "mmx.h"
23
24 static void always_inline snow_interleave_line_header(int * i, int width, DWTELEM * low, DWTELEM * high){
25 (*i) = (width) - 2;
26
27 if (width & 1){
28 low[(*i)+1] = low[((*i)+1)>>1];
29 (*i)--;
30 }
31 }
32
33 static void always_inline snow_horizontal_compose_lift_lead_out(int i, DWTELEM * dst, DWTELEM * src, DWTELEM * ref, int width, int w, int lift_high, int mul, int add, int shift){
34 for(; i<w; i++){
35 dst[i] = src[i] - ((mul * (ref[i] + ref[i + 1]) + add) >> shift);
36 }
37
38 if((width^lift_high)&1){
39 dst[w] = src[w] - ((mul * 2 * ref[w] + add) >> shift);
40 }
41 }
42
43 static void always_inline snow_horizontal_compose_liftS_lead_out(int i, DWTELEM * dst, DWTELEM * src, DWTELEM * ref, int width, int w){
44 for(; i<w; i++){
45 dst[i] = src[i] - (((-(ref[i] + ref[(i+1)])+W_BO) - 4 * src[i]) >> W_BS);
46 }
47
48 if(width&1){
49 dst[w] = src[w] - (((-2 * ref[w] + W_BO) - 4 * src[w]) >> W_BS);
50 }
51 }
52 23
53 void ff_snow_horizontal_compose97i_sse2(DWTELEM *b, int width){ 24 void ff_snow_horizontal_compose97i_sse2(DWTELEM *b, int width){
54 const int w2= (width+1)>>1; 25 const int w2= (width+1)>>1;
55 // SSE2 code runs faster with pointers aligned on a 32-byte boundary. 26 // SSE2 code runs faster with pointers aligned on a 32-byte boundary.
56 DWTELEM temp_buf[(width>>1) + 4]; 27 DWTELEM temp_buf[(width>>1) + 4];