Showing the changes to codec/decoder/core/src/mc.cpp (1 of 225 files). Show all
Unified · Split
| @@ -46,711 +46,624 @@ · 45 unmodified lines | |||
| 46 | namespace WelsDec { | 46 | namespace WelsDec { |
| 47 | 47 | ||
| 48 | /*------------------weight for chroma fraction pixel interpolation------------------*/ | 48 | /*------------------weight for chroma fraction pixel interpolation------------------*/ |
| 49 | //iA = (8 - dx) * (8 - dy); | 49 | //iA = (8 - dx) * (8 - dy); |
| 50 | //iB = dx * (8 - dy); | 50 | //iB = dx * (8 - dy); |
| 51 | //iC = (8 - dx) * dy; | 51 | //iC = (8 - dx) * dy; |
| 52 | //iD = dx * dy | 52 | //iD = dx * dy |
| 53 | static const uint8_t g_kuiABCD[8][8][4] = //g_kA[dy][dx], g_kB[dy][dx], g_kC[dy][dx], g_kD[dy][dx] | 53 | static const uint8_t g_kuiABCD[8][8][4] = { //g_kA[dy][dx], g_kB[dy][dx], g_kC[dy][dx], g_kD[dy][dx] |
| 54 | { | 54 | { |
| 55 | { | 55 | {64, 0, 0, 0}, {56, 8, 0, 0}, {48, 16, 0, 0}, {40, 24, 0, 0}, |
| 56 | {64, 0, 0, 0},{56, 8, 0, 0},{48, 16, 0, 0},{40, 24, 0, 0}, | 56 | {32, 32, 0, 0}, {24, 40, 0, 0}, {16, 48, 0, 0}, {8, 56, 0, 0} |
| 57 | {32, 32, 0, 0},{24, 40, 0, 0},{16, 48, 0, 0},{8, 56, 0, 0} | 57 | }, |
| 58 | }, | 58 | { |
| 59 | { | 59 | {56, 0, 8, 0}, {49, 7, 7, 1}, {42, 14, 6, 2}, {35, 21, 5, 3}, |
| 60 | {56, 0, 8, 0},{49, 7, 7, 1},{42, 14, 6, 2},{35, 21, 5, 3}, | 60 | {28, 28, 4, 4}, {21, 35, 3, 5}, {14, 42, 2, 6}, {7, 49, 1, 7} |
| 61 | {28, 28, 4, 4},{21, 35, 3, 5},{14, 42, 2, 6},{7, 49, 1, 7} | 61 | }, |
| 62 | }, | 62 | { |
| 63 | { | 63 | {48, 0, 16, 0}, {42, 6, 14, 2}, {36, 12, 12, 4}, {30, 18, 10, 6}, |
| 64 | {48, 0, 16, 0},{42, 6, 14, 2},{36, 12, 12, 4},{30, 18, 10, 6}, | 64 | {24, 24, 8, 8}, {18, 30, 6, 10}, {12, 36, 4, 12}, {6, 42, 2, 14} |
| 65 | {24, 24, 8, 8},{18, 30, 6, 10},{12, 36, 4, 12},{6, 42, 2, 14} | 65 | }, |
| 66 | }, | 66 | { |
| 67 | { | 67 | {40, 0, 24, 0}, {35, 5, 21, 3}, {30, 10, 18, 6}, {25, 15, 15, 9}, |
| 68 | {40, 0, 24, 0},{35, 5, 21, 3},{30, 10, 18, 6},{25, 15, 15, 9}, | 68 | {20, 20, 12, 12}, {15, 25, 9, 15}, {10, 30, 6, 18}, {5, 35, 3, 21} |
| 69 | {20, 20, 12, 12},{15, 25, 9, 15},{10, 30, 6, 18},{5, 35, 3, 21} | 69 | }, |
| 70 | }, | 70 | { |
| 71 | { | 71 | {32, 0, 32, 0}, {28, 4, 28, 4}, {24, 8, 24, 8}, {20, 12, 20, 12}, |
| 72 | {32, 0, 32, 0},{28, 4, 28, 4},{24, 8, 24, 8},{20, 12, 20, 12}, | 72 | {16, 16, 16, 16}, {12, 20, 12, 20}, {8, 24, 8, 24}, {4, 28, 4, 28} |
| 73 | {16, 16, 16, 16},{12, 20, 12, 20},{8, 24, 8, 24},{4, 28, 4, 28} | 73 | }, |
| 74 | }, | 74 | { |
| 75 | { | 75 | {24, 0, 40, 0}, {21, 3, 35, 5}, {18, 6, 30, 10}, {15, 9, 25, 15}, |
| 76 | {24, 0, 40, 0},{21, 3, 35, 5},{18, 6, 30, 10},{15, 9, 25, 15}, | 76 | {12, 12, 20, 20}, {9, 15, 15, 25}, {6, 18, 10, 30}, {3, 21, 5, 35} |
| 77 | {12, 12, 20, 20},{9, 15, 15, 25},{6, 18, 10, 30},{3, 21, 5, 35} | 77 | }, |
| 78 | }, | 78 | { |
| 79 | { | 79 | {16, 0, 48, 0}, {14, 2, 42, 6}, {12, 4, 36, 12}, {10, 6, 30, 18}, |
| 80 | {16, 0, 48, 0},{14, 2, 42, 6},{12, 4, 36, 12},{10, 6, 30, 18}, | 80 | {8, 8, 24, 24}, {6, 10, 18, 30}, {4, 12, 12, 36}, {2, 14, 6, 42} |
| 81 | {8, 8, 24, 24},{6, 10, 18, 30},{4, 12, 12, 36},{2, 14, 6, 42} | 81 | }, |
| 82 | }, | 82 | { |
| 83 | { | 83 | {8, 0, 56, 0}, {7, 1, 49, 7}, {6, 2, 42, 14}, {5, 3, 35, 21}, |
| 84 | {8, 0, 56, 0},{7, 1, 49, 7},{6, 2, 42, 14},{5, 3, 35, 21}, | 84 | {4, 4, 28, 28}, {3, 5, 21, 35}, {2, 6, 14, 42}, {1, 7, 7, 49} |
| 85 | {4, 4, 28, 28},{3, 5, 21, 35},{2, 6, 14, 42},{1, 7, 7, 49} | 85 | } |
| 86 | } | ||
| 87 | }; | 86 | }; |
| 88 | 87 | ||
| 89 | typedef void_t (*PWelsMcWidthHeightFunc)(uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, int32_t iWidth, int32_t iHeight); | 88 | typedef void_t (*PWelsMcWidthHeightFunc) (uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, |
| 89 | int32_t iWidth, int32_t iHeight); | ||
| 90 | 90 | ||
| 91 | //***************************************************************************// | 91 | //***************************************************************************// |
| 92 | // C code implementation // | 92 | // C code implementation // |
| 93 | //***************************************************************************// | 93 | //***************************************************************************// |
| 94 | static inline void_t McCopyWidthEq2_c(uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, int32_t iHeight) | 94 | static inline void_t McCopyWidthEq2_c (uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, |
| 95 | { | 95 | int32_t iHeight) { |
| 96 | int32_t i; | 96 | int32_t i; |
| 97 | for (i = 0; i < iHeight; i++)// iWidth == 2 only for chroma | 97 | for (i = 0; i < iHeight; i++) { // iWidth == 2 only for chroma |
| 98 | { | 98 | ST16 (pDst, LD16 (pSrc)); |
| 99 | ST16(pDst, LD16(pSrc)); | 99 | pDst += iDstStride; |
| 100 | pDst += iDstStride; | 100 | pSrc += iSrcStride; |
| 101 | pSrc += iSrcStride; | 101 | } |
| 102 | } | 102 | } |
| 103 | } | 103 | |
| 104 | 104 | static inline void_t McCopyWidthEq4_c (uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, | |
| 105 | static inline void_t McCopyWidthEq4_c(uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, int32_t iHeight) | 105 | int32_t iHeight) { |
| 106 | { | 106 | int32_t i; |
| 107 | int32_t i; | 107 | for (i = 0; i < iHeight; i++) { |
| 108 | for (i = 0; i < iHeight; i++) | 108 | ST32 (pDst, LD32 (pSrc)); |
| 109 | { | 109 | pDst += iDstStride; |
| 110 | ST32(pDst, LD32(pSrc)); | 110 | pSrc += iSrcStride; |
| 111 | pDst += iDstStride; | 111 | } |
| 112 | pSrc += iSrcStride; | 112 | } |
| 113 | } | 113 | |
| 114 | } | 114 | static inline void_t McCopyWidthEq8_c (uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, |
| 115 | 115 | int32_t iHeight) { | |
| 116 | static inline void_t McCopyWidthEq8_c(uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, int32_t iHeight) | 116 | int32_t i; |
| 117 | { | 117 | for (i = 0; i < iHeight; i++) { |
| 118 | int32_t i; | 118 | ST64 (pDst, LD64 (pSrc)); |
| 119 | for (i = 0; i < iHeight; i++) | 119 | pDst += iDstStride; |
| 120 | { | 120 | pSrc += iSrcStride; |
| 121 | ST64(pDst, LD64(pSrc)); | 121 | } |
| 122 | pDst += iDstStride; | 122 | } |
| 123 | pSrc += iSrcStride; | 123 | |
| 124 | } | 124 | static inline void_t McCopyWidthEq16_c (uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, |
| 125 | } | 125 | int32_t iHeight) { |
| 126 | 126 | int32_t i; | |
| 127 | static inline void_t McCopyWidthEq16_c(uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, int32_t iHeight) | 127 | for (i = 0; i < iHeight; i++) { |
| 128 | { | 128 | ST64 (pDst , LD64 (pSrc)); |
| 129 | int32_t i; | 129 | ST64 (pDst + 8, LD64 (pSrc + 8)); |
| 130 | for (i = 0; i < iHeight; i++) | 130 | pDst += iDstStride; |
| 131 | { | 131 | pSrc += iSrcStride; |
| 132 | ST64(pDst , LD64(pSrc)); | 132 | } |
| 133 | ST64(pDst+8, LD64(pSrc+8)); | ||
| 134 | pDst += iDstStride; | ||
| 135 | pSrc += iSrcStride; | ||
| 136 | } | ||
| 137 | } | 133 | } |
| 138 | 134 | ||
| 139 | //--------------------Luma sample MC------------------// | 135 | //--------------------Luma sample MC------------------// |
| 140 | 136 | ||
| 141 | static inline int32_t HorFilterInput16bit_c(int16_t* pSrc) | 137 | static inline int32_t HorFilterInput16bit_c (int16_t* pSrc) { |
| 142 | { | 138 | int32_t iPix05 = pSrc[-2] + pSrc[3]; |
| 143 | int32_t iPix05 = pSrc[-2] + pSrc[3]; | 139 | int32_t iPix14 = pSrc[-1] + pSrc[2]; |
| 144 | int32_t iPix14 = pSrc[-1] + pSrc[2]; | 140 | int32_t iPix23 = pSrc[ 0] + pSrc[1]; |
| 145 | int32_t iPix23 = pSrc[ 0] + pSrc[1]; | ||
| 146 | |||
| 147 | return (iPix05 - ((iPix14<<2)+iPix14) + (iPix23<<4) + (iPix23<<2)); | ||
| 148 | } | ||
| 149 | // h: iOffset=1 / v: iOffset=iSrcStride | ||
| 150 | static inline int32_t FilterInput8bitWithStride_c(uint8_t* pSrc, const int32_t kiOffset) | ||
| 151 | { | ||
| 152 | const int32_t kiOffset1 = kiOffset; | ||
| 153 | const int32_t kiOffset2 = (kiOffset << 1); | ||
| 154 | const int32_t kiOffset3 = kiOffset + kiOffset2; | ||
| 155 | const uint32_t kuiPix05 = *(pSrc - kiOffset2) + *(pSrc + kiOffset3); | ||
| 156 | const uint32_t kuiPix14 = *(pSrc - kiOffset1) + *(pSrc + kiOffset2); | ||
| 157 | const uint32_t kuiPix23 = *(pSrc ) + *(pSrc + kiOffset1); | ||
| 158 | 141 | ||
| 159 | return (kuiPix05 - ((kuiPix14<<2)+kuiPix14) + (kuiPix23<<4) + (kuiPix23<<2)); | 142 | return (iPix05 - ((iPix14 << 2) + iPix14) + (iPix23 << 4) + (iPix23 << 2)); |
| 160 | } | 143 | } |
| 161 | 144 | // h: iOffset=1 / v: iOffset=iSrcStride | |
| 162 | static inline void_t PixelAvg_c(uint8_t* pDst, int32_t iDstStride, uint8_t* pSrcA, int32_t iSrcAStride, | 145 | static inline int32_t FilterInput8bitWithStride_c (uint8_t* pSrc, const int32_t kiOffset) { |
| 163 | uint8_t* pSrcB, int32_t iSrcBStride, int32_t iWidth, int32_t iHeight) | 146 | const int32_t kiOffset1 = kiOffset; |
| 164 | { | 147 | const int32_t kiOffset2 = (kiOffset << 1); |
| 165 | int32_t i, j; | 148 | const int32_t kiOffset3 = kiOffset + kiOffset2; |
| 166 | for (i = 0; i < iHeight; i++) | 149 | const uint32_t kuiPix05 = * (pSrc - kiOffset2) + * (pSrc + kiOffset3); |
| 167 | { | 150 | const uint32_t kuiPix14 = * (pSrc - kiOffset1) + * (pSrc + kiOffset2); |
| 168 | for (j = 0; j < iWidth; j++) | 151 | const uint32_t kuiPix23 = * (pSrc) + * (pSrc + kiOffset1); |
| 169 | { | 152 | |
| 170 | pDst[j] = (pSrcA[j] + pSrcB[j] + 1) >> 1; | 153 | return (kuiPix05 - ((kuiPix14 << 2) + kuiPix14) + (kuiPix23 << 4) + (kuiPix23 << 2)); |
| 171 | } | 154 | } |
| 172 | pDst += iDstStride; | 155 | |
| 173 | pSrcA += iSrcAStride; | 156 | static inline void_t PixelAvg_c (uint8_t* pDst, int32_t iDstStride, uint8_t* pSrcA, int32_t iSrcAStride, |
| 174 | pSrcB += iSrcBStride; | 157 | uint8_t* pSrcB, int32_t iSrcBStride, int32_t iWidth, int32_t iHeight) { |
| 175 | } | 158 | int32_t i, j; |
| 176 | } | 159 | for (i = 0; i < iHeight; i++) { |
| 177 | static inline void_t McCopy_c(uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, int32_t iWidth, int32_t iHeight) | 160 | for (j = 0; j < iWidth; j++) { |
| 178 | { | 161 | pDst[j] = (pSrcA[j] + pSrcB[j] + 1) >> 1; |
| 179 | if (iWidth == 16) | 162 | } |
| 180 | McCopyWidthEq16_c(pSrc,iSrcStride,pDst,iDstStride,iHeight); | 163 | pDst += iDstStride; |
| 181 | else if(iWidth == 8) | 164 | pSrcA += iSrcAStride; |
| 182 | McCopyWidthEq8_c(pSrc,iSrcStride,pDst,iDstStride,iHeight); | 165 | pSrcB += iSrcBStride; |
| 183 | else if(iWidth == 4) | 166 | } |
| 184 | McCopyWidthEq4_c(pSrc,iSrcStride,pDst,iDstStride,iHeight); | 167 | } |
| 185 | else //here iWidth == 2 | 168 | static inline void_t McCopy_c (uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, int32_t iWidth, |
| 186 | McCopyWidthEq2_c(pSrc,iSrcStride,pDst,iDstStride,iHeight); | 169 | int32_t iHeight) { |
| 187 | } | 170 | if (iWidth == 16) |
| 188 | 171 | McCopyWidthEq16_c (pSrc, iSrcStride, pDst, iDstStride, iHeight); | |
| 189 | static inline void_t McHorVer20_c(uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, int32_t iWidth, int32_t iHeight) | 172 | else if (iWidth == 8) |
| 190 | { | 173 | McCopyWidthEq8_c (pSrc, iSrcStride, pDst, iDstStride, iHeight); |
| 191 | int32_t i, j; | 174 | else if (iWidth == 4) |
| 192 | for (i = 0; i < iHeight; i++) | 175 | McCopyWidthEq4_c (pSrc, iSrcStride, pDst, iDstStride, iHeight); |
| 193 | { | 176 | else //here iWidth == 2 |
| 194 | for (j = 0; j < iWidth; j++) | 177 | McCopyWidthEq2_c (pSrc, iSrcStride, pDst, iDstStride, iHeight); |
| 195 | { | 178 | } |
| 196 | pDst[j] = WELS_CLIP1((FilterInput8bitWithStride_c(pSrc+j,1)+16)>>5); | 179 | |
| 197 | } | 180 | static inline void_t McHorVer20_c (uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, int32_t iWidth, |
| 198 | pDst += iDstStride; | 181 | int32_t iHeight) { |
| 199 | pSrc += iSrcStride; | 182 | int32_t i, j; |
| 200 | } | 183 | for (i = 0; i < iHeight; i++) { |
| 201 | } | 184 | for (j = 0; j < iWidth; j++) { |
| 202 | 185 | pDst[j] = WELS_CLIP1 ((FilterInput8bitWithStride_c (pSrc + j, 1) + 16) >> 5); | |
| 203 | static inline void_t McHorVer02_c(uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, int32_t iWidth, int32_t iHeight) | 186 | } |
| 204 | { | 187 | pDst += iDstStride; |
| 205 | int32_t i, j; | 188 | pSrc += iSrcStride; |
| 206 | for (i = 0; i < iHeight; i++) | 189 | } |
| 207 | { | 190 | } |
| 208 | for (j = 0; j < iWidth; j++) | 191 | |
| 209 | { | 192 | static inline void_t McHorVer02_c (uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, int32_t iWidth, |
| 210 | pDst[j] = WELS_CLIP1((FilterInput8bitWithStride_c(pSrc+j, iSrcStride)+16)>>5); | 193 | int32_t iHeight) { |
| 211 | } | 194 | int32_t i, j; |
| 212 | pDst += iDstStride; | 195 | for (i = 0; i < iHeight; i++) { |
| 213 | pSrc += iSrcStride; | 196 | for (j = 0; j < iWidth; j++) { |
| 214 | } | 197 | pDst[j] = WELS_CLIP1 ((FilterInput8bitWithStride_c (pSrc + j, iSrcStride) + 16) >> 5); |
| 215 | } | 198 | } |
| 216 | 199 | pDst += iDstStride; | |
| 217 | static inline void_t McHorVer22_c(uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, int32_t iWidth, int32_t iHeight) | 200 | pSrc += iSrcStride; |
| 218 | { | 201 | } |
| 219 | int16_t iTmp[16+5] = {0}; //16 | 202 | } |
| 220 | int32_t i, j, k; | 203 | |
| 221 | 204 | static inline void_t McHorVer22_c (uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, int32_t iWidth, | |
| 222 | for (i = 0; i < iHeight; i++) | 205 | int32_t iHeight) { |
| 223 | { | 206 | int16_t iTmp[16 + 5] = {0}; //16 |
| 224 | for (j = 0; j < iWidth + 5; j++) | 207 | int32_t i, j, k; |
| 225 | { | 208 | |
| 226 | iTmp[j] = FilterInput8bitWithStride_c(pSrc-2+j, iSrcStride); | 209 | for (i = 0; i < iHeight; i++) { |
| 227 | } | 210 | for (j = 0; j < iWidth + 5; j++) { |
| 228 | for (k = 0; k < iWidth; k++) | 211 | iTmp[j] = FilterInput8bitWithStride_c (pSrc - 2 + j, iSrcStride); |
| 229 | { | 212 | } |
| 230 | pDst[k] = WELS_CLIP1((HorFilterInput16bit_c(&iTmp[2+k])+512)>>10); | 213 | for (k = 0; k < iWidth; k++) { |
| 231 | } | 214 | pDst[k] = WELS_CLIP1 ((HorFilterInput16bit_c (&iTmp[2 + k]) + 512) >> 10); |
| 232 | pSrc += iSrcStride; | 215 | } |
| 233 | pDst += iDstStride; | 216 | pSrc += iSrcStride; |
| 234 | } | 217 | pDst += iDstStride; |
| 235 | } | 218 | } |
| 236 | 219 | } | |
| 237 | /////////////////////luma MC////////////////////////// | 220 | |
| 238 | static inline void_t McHorVer01_c(uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, int32_t iWidth, int32_t iHeight) | 221 | /////////////////////luma MC////////////////////////// |
| 239 | { | 222 | static inline void_t McHorVer01_c (uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, int32_t iWidth, |
| 240 | uint8_t uiTmp[256] = { 0 }; | 223 | int32_t iHeight) { |
| 241 | McHorVer02_c(pSrc, iSrcStride, uiTmp, 16, iWidth, iHeight); | 224 | uint8_t uiTmp[256] = { 0 }; |
| 242 | PixelAvg_c(pDst, iDstStride, pSrc, iSrcStride, uiTmp, 16, iWidth, iHeight); | 225 | McHorVer02_c (pSrc, iSrcStride, uiTmp, 16, iWidth, iHeight); |
| 243 | } | 226 | PixelAvg_c (pDst, iDstStride, pSrc, iSrcStride, uiTmp, 16, iWidth, iHeight); |
| 244 | static inline void_t McHorVer03_c(uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, int32_t iWidth, int32_t iHeight) | 227 | } |
| 245 | { | 228 | static inline void_t McHorVer03_c (uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, int32_t iWidth, |
| 246 | uint8_t uiTmp[256] = { 0 }; | 229 | int32_t iHeight) { |
| 247 | McHorVer02_c(pSrc, iSrcStride, uiTmp, 16, iWidth, iHeight); | 230 | uint8_t uiTmp[256] = { 0 }; |
| 248 | PixelAvg_c(pDst, iDstStride, pSrc+iSrcStride, iSrcStride, uiTmp, 16, iWidth, iHeight); | 231 | McHorVer02_c (pSrc, iSrcStride, uiTmp, 16, iWidth, iHeight); |
| 249 | } | 232 | PixelAvg_c (pDst, iDstStride, pSrc + iSrcStride, iSrcStride, uiTmp, 16, iWidth, iHeight); |
| 250 | static inline void_t McHorVer10_c(uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, int32_t iWidth, int32_t iHeight) | 233 | } |
| 251 | { | 234 | static inline void_t McHorVer10_c (uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, int32_t iWidth, |
| 252 | uint8_t uiTmp[256] = { 0 }; | 235 | int32_t iHeight) { |
| 253 | McHorVer20_c(pSrc, iSrcStride, uiTmp, 16, iWidth, iHeight); | 236 | uint8_t uiTmp[256] = { 0 }; |
| 254 | PixelAvg_c(pDst, iDstStride, pSrc, iSrcStride, uiTmp, 16,iWidth, iHeight); | 237 | McHorVer20_c (pSrc, iSrcStride, uiTmp, 16, iWidth, iHeight); |
| 255 | } | 238 | PixelAvg_c (pDst, iDstStride, pSrc, iSrcStride, uiTmp, 16, iWidth, iHeight); |
| 256 | static inline void_t McHorVer11_c(uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, int32_t iWidth, int32_t iHeight) | 239 | } |
| 257 | { | 240 | static inline void_t McHorVer11_c (uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, int32_t iWidth, |
| 258 | uint8_t uiHorTmp[256] = { 0 }; | 241 | int32_t iHeight) { |
| 259 | uint8_t uiVerTmp[256] = { 0 }; | 242 | uint8_t uiHorTmp[256] = { 0 }; |
| 260 | McHorVer20_c(pSrc, iSrcStride, uiHorTmp, 16, iWidth, iHeight); | 243 | uint8_t uiVerTmp[256] = { 0 }; |
| 261 | McHorVer02_c(pSrc, iSrcStride, uiVerTmp, 16, iWidth, iHeight); | 244 | McHorVer20_c (pSrc, iSrcStride, uiHorTmp, 16, iWidth, iHeight); |
| 262 | PixelAvg_c(pDst, iDstStride, uiHorTmp, 16, uiVerTmp, 16, iWidth, iHeight); | 245 | McHorVer02_c (pSrc, iSrcStride, uiVerTmp, 16, iWidth, iHeight); |
| 263 | } | 246 | PixelAvg_c (pDst, iDstStride, uiHorTmp, 16, uiVerTmp, 16, iWidth, iHeight); |
| 264 | static inline void_t McHorVer12_c(uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, int32_t iWidth, int32_t iHeight) | 247 | } |
| 265 | { | 248 | static inline void_t McHorVer12_c (uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, int32_t iWidth, |
| 266 | uint8_t uiVerTmp[256] = { 0 }; | 249 | int32_t iHeight) { |
| 267 | uint8_t uiCtrTmp[256] = { 0 }; | 250 | uint8_t uiVerTmp[256] = { 0 }; |
| 268 | McHorVer02_c(pSrc, iSrcStride, uiVerTmp, 16, iWidth, iHeight); | 251 | uint8_t uiCtrTmp[256] = { 0 }; |
| 269 | McHorVer22_c(pSrc, iSrcStride, uiCtrTmp, 16, iWidth, iHeight); | 252 | McHorVer02_c (pSrc, iSrcStride, uiVerTmp, 16, iWidth, iHeight); |
| 270 | PixelAvg_c(pDst, iDstStride, uiVerTmp, 16, uiCtrTmp, 16, iWidth, iHeight); | 253 | McHorVer22_c (pSrc, iSrcStride, uiCtrTmp, 16, iWidth, iHeight); |
| 271 | } | 254 | PixelAvg_c (pDst, iDstStride, uiVerTmp, 16, uiCtrTmp, 16, iWidth, iHeight); |
| 272 | static inline void_t McHorVer13_c(uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, int32_t iWidth, int32_t iHeight) | 255 | } |
| 273 | { | 256 | static inline void_t McHorVer13_c (uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, int32_t iWidth, |
| 274 | uint8_t uiHorTmp[256] = { 0 }; | 257 | int32_t iHeight) { |
| 275 | uint8_t uiVerTmp[256] = { 0 }; | 258 | uint8_t uiHorTmp[256] = { 0 }; |
| 276 | McHorVer20_c(pSrc+iSrcStride, iSrcStride, uiHorTmp, 16, iWidth, iHeight); | 259 | uint8_t uiVerTmp[256] = { 0 }; |
| 277 | McHorVer02_c(pSrc, iSrcStride, uiVerTmp, 16, iWidth, iHeight); | 260 | McHorVer20_c (pSrc + iSrcStride, iSrcStride, uiHorTmp, 16, iWidth, iHeight); |
| 278 | PixelAvg_c(pDst, iDstStride, uiHorTmp, 16, uiVerTmp, 16, iWidth, iHeight); | 261 | McHorVer02_c (pSrc, iSrcStride, uiVerTmp, 16, iWidth, iHeight); |
| 279 | } | 262 | PixelAvg_c (pDst, iDstStride, uiHorTmp, 16, uiVerTmp, 16, iWidth, iHeight); |
| 280 | static inline void_t McHorVer21_c(uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, int32_t iWidth, int32_t iHeight) | 263 | } |
| 281 | { | 264 | static inline void_t McHorVer21_c (uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, int32_t iWidth, |
| 282 | uint8_t uiHorTmp[256] = { 0 }; | 265 | int32_t iHeight) { |
| 283 | uint8_t uiCtrTmp[256] = { 0 }; | 266 | uint8_t uiHorTmp[256] = { 0 }; |
| 284 | McHorVer20_c(pSrc, iSrcStride, uiHorTmp, 16, iWidth, iHeight); | 267 | uint8_t uiCtrTmp[256] = { 0 }; |
| 285 | McHorVer22_c(pSrc, iSrcStride, uiCtrTmp, 16, iWidth, iHeight); | 268 | McHorVer20_c (pSrc, iSrcStride, uiHorTmp, 16, iWidth, iHeight); |
| 286 | PixelAvg_c(pDst, iDstStride, uiHorTmp, 16, uiCtrTmp, 16, iWidth, iHeight); | 269 | McHorVer22_c (pSrc, iSrcStride, uiCtrTmp, 16, iWidth, iHeight); |
| 287 | } | 270 | PixelAvg_c (pDst, iDstStride, uiHorTmp, 16, uiCtrTmp, 16, iWidth, iHeight); |
| 288 | static inline void_t McHorVer23_c(uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, int32_t iWidth, int32_t iHeight) | 271 | } |
| 289 | { | 272 | static inline void_t McHorVer23_c (uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, int32_t iWidth, |
| 290 | uint8_t uiHorTmp[256] = { 0 }; | 273 | int32_t iHeight) { |
| 291 | uint8_t uiCtrTmp[256] = { 0 }; | 274 | uint8_t uiHorTmp[256] = { 0 }; |
| 292 | McHorVer20_c(pSrc+iSrcStride, iSrcStride, uiHorTmp, 16, iWidth, iHeight); | 275 | uint8_t uiCtrTmp[256] = { 0 }; |
| 293 | McHorVer22_c(pSrc, iSrcStride, uiCtrTmp, 16, iWidth, iHeight); | 276 | McHorVer20_c (pSrc + iSrcStride, iSrcStride, uiHorTmp, 16, iWidth, iHeight); |
| 294 | PixelAvg_c(pDst, iDstStride, uiHorTmp, 16, uiCtrTmp, 16, iWidth, iHeight); | 277 | McHorVer22_c (pSrc, iSrcStride, uiCtrTmp, 16, iWidth, iHeight); |
| 295 | } | 278 | PixelAvg_c (pDst, iDstStride, uiHorTmp, 16, uiCtrTmp, 16, iWidth, iHeight); |
| 296 | static inline void_t McHorVer30_c(uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, int32_t iWidth, int32_t iHeight) | 279 | } |
| 297 | { | 280 | static inline void_t McHorVer30_c (uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, int32_t iWidth, |
| 298 | uint8_t uiHorTmp[256] = { 0 }; | 281 | int32_t iHeight) { |
| 299 | McHorVer20_c(pSrc, iSrcStride, uiHorTmp, 16, iWidth, iHeight); | 282 | uint8_t uiHorTmp[256] = { 0 }; |
| 300 | PixelAvg_c(pDst, iDstStride, pSrc+1, iSrcStride, uiHorTmp, 16, iWidth, iHeight); | 283 | McHorVer20_c (pSrc, iSrcStride, uiHorTmp, 16, iWidth, iHeight); |
| 301 | } | 284 | PixelAvg_c (pDst, iDstStride, pSrc + 1, iSrcStride, uiHorTmp, 16, iWidth, iHeight); |
| 302 | static inline void_t McHorVer31_c(uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, int32_t iWidth, int32_t iHeight) | 285 | } |
| 303 | { | 286 | static inline void_t McHorVer31_c (uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, int32_t iWidth, |
| 304 | uint8_t uiHorTmp[256] = { 0 }; | 287 | int32_t iHeight) { |
| 305 | uint8_t uiVerTmp[256] = { 0 }; | 288 | uint8_t uiHorTmp[256] = { 0 }; |
| 306 | McHorVer20_c(pSrc, iSrcStride, uiHorTmp, 16, iWidth, iHeight); | 289 | uint8_t uiVerTmp[256] = { 0 }; |
| 307 | McHorVer02_c(pSrc+1, iSrcStride, uiVerTmp, 16, iWidth, iHeight); | 290 | McHorVer20_c (pSrc, iSrcStride, uiHorTmp, 16, iWidth, iHeight); |
| 308 | PixelAvg_c(pDst, iDstStride, uiHorTmp, 16, uiVerTmp, 16, iWidth, iHeight); | 291 | McHorVer02_c (pSrc + 1, iSrcStride, uiVerTmp, 16, iWidth, iHeight); |
| 309 | } | 292 | PixelAvg_c (pDst, iDstStride, uiHorTmp, 16, uiVerTmp, 16, iWidth, iHeight); |
| 310 | static inline void_t McHorVer32_c(uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, int32_t iWidth, int32_t iHeight) | 293 | } |
| 311 | { | 294 | static inline void_t McHorVer32_c (uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, int32_t iWidth, |
| 312 | uint8_t uiVerTmp[256] = { 0 }; | 295 | int32_t iHeight) { |
| 313 | uint8_t uiCtrTmp[256] = { 0 }; | 296 | uint8_t uiVerTmp[256] = { 0 }; |
| 314 | McHorVer02_c(pSrc+1, iSrcStride, uiVerTmp, 16, iWidth, iHeight); | 297 | uint8_t uiCtrTmp[256] = { 0 }; |
| 315 | McHorVer22_c(pSrc, iSrcStride, uiCtrTmp, 16, iWidth, iHeight); | 298 | McHorVer02_c (pSrc + 1, iSrcStride, uiVerTmp, 16, iWidth, iHeight); |
| 316 | PixelAvg_c(pDst, iDstStride, uiVerTmp, 16, uiCtrTmp, 16, iWidth, iHeight); | 299 | McHorVer22_c (pSrc, iSrcStride, uiCtrTmp, 16, iWidth, iHeight); |
| 317 | } | 300 | PixelAvg_c (pDst, iDstStride, uiVerTmp, 16, uiCtrTmp, 16, iWidth, iHeight); |
| 318 | static inline void_t McHorVer33_c(uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, int32_t iWidth, int32_t iHeight) | 301 | } |
| 319 | { | 302 | static inline void_t McHorVer33_c (uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, int32_t iWidth, |
| 320 | uint8_t uiHorTmp[256] = { 0 }; | 303 | int32_t iHeight) { |
| 321 | uint8_t uiVerTmp[256] = { 0 }; | 304 | uint8_t uiHorTmp[256] = { 0 }; |
| 322 | McHorVer20_c(pSrc+iSrcStride, iSrcStride, uiHorTmp, 16, iWidth, iHeight); | 305 | uint8_t uiVerTmp[256] = { 0 }; |
| 323 | McHorVer02_c(pSrc+1, iSrcStride, uiVerTmp, 16, iWidth, iHeight); | 306 | McHorVer20_c (pSrc + iSrcStride, iSrcStride, uiHorTmp, 16, iWidth, iHeight); |
| 324 | PixelAvg_c(pDst, iDstStride, uiHorTmp, 16, uiVerTmp, 16, iWidth, iHeight); | 307 | McHorVer02_c (pSrc + 1, iSrcStride, uiVerTmp, 16, iWidth, iHeight); |
| 325 | } | 308 | PixelAvg_c (pDst, iDstStride, uiHorTmp, 16, uiVerTmp, 16, iWidth, iHeight); |
| 326 | 309 | } | |
| 327 | void_t McLuma_c(uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, | 310 | |
| 328 | int16_t iMvX, int16_t iMvY, int32_t iWidth, int32_t iHeight) | 311 | void_t McLuma_c (uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, |
| 329 | //pSrc has been added the offset of mv | 312 | int16_t iMvX, int16_t iMvY, int32_t iWidth, int32_t iHeight) |
| 330 | { | 313 | //pSrc has been added the offset of mv |
| 331 | PWelsMcWidthHeightFunc pWelsMcFunc[4][4] = //[x][y] | 314 | { |
| 332 | { | 315 | PWelsMcWidthHeightFunc pWelsMcFunc[4][4] = { //[x][y] |
| 333 | {McCopy_c, McHorVer01_c, McHorVer02_c, McHorVer03_c}, | 316 | {McCopy_c, McHorVer01_c, McHorVer02_c, McHorVer03_c}, |
| 334 | {McHorVer10_c, McHorVer11_c, McHorVer12_c, McHorVer13_c}, | 317 | {McHorVer10_c, McHorVer11_c, McHorVer12_c, McHorVer13_c}, |
| 335 | {McHorVer20_c, McHorVer21_c, McHorVer22_c, McHorVer23_c}, | 318 | {McHorVer20_c, McHorVer21_c, McHorVer22_c, McHorVer23_c}, |
| 336 | {McHorVer30_c, McHorVer31_c, McHorVer32_c, McHorVer33_c}, | 319 | {McHorVer30_c, McHorVer31_c, McHorVer32_c, McHorVer33_c}, |
| 337 | }; | 320 | }; |
| 338 | 321 | ||
| 339 | pWelsMcFunc[iMvX&0x03][iMvY&0x03](pSrc, iSrcStride, pDst, iDstStride, iWidth, iHeight); | 322 | pWelsMcFunc[iMvX & 0x03][iMvY & 0x03] (pSrc, iSrcStride, pDst, iDstStride, iWidth, iHeight); |
| 340 | } | 323 | } |
| 341 | 324 | ||
| 342 | static inline void_t McChromaWithFragMv_c( uint8_t *pSrc, int32_t iSrcStride, uint8_t *pDst, int32_t iDstStride, int16_t iMvX, int16_t iMvY, int32_t iWidth, int32_t iHeight ) | 325 | static inline void_t McChromaWithFragMv_c (uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, |
| 343 | { | 326 | int16_t iMvX, int16_t iMvY, int32_t iWidth, int32_t iHeight) { |
| 344 | int32_t i, j; | 327 | int32_t i, j; |
| 345 | int32_t iA, iB, iC, iD; | 328 | int32_t iA, iB, iC, iD; |
| 346 | uint8_t* pSrcNext = pSrc + iSrcStride; | 329 | uint8_t* pSrcNext = pSrc + iSrcStride; |
| 347 | const uint32_t kuiABCD = *((uint32_t *)g_kuiABCD[iMvY&0x07][iMvX&0x07]); | 330 | const uint32_t kuiABCD = * ((uint32_t*)g_kuiABCD[iMvY & 0x07][iMvX & 0x07]); |
| 348 | iA = (kuiABCD ) & 0xff; | 331 | iA = (kuiABCD) & 0xff; |
| 349 | iB = (kuiABCD >> 8) & 0xff; | 332 | iB = (kuiABCD >> 8) & 0xff; |
| 350 | iC = (kuiABCD >> 16) & 0xff; | 333 | iC = (kuiABCD >> 16) & 0xff; |
| 351 | iD = (kuiABCD >> 24) & 0xff; | 334 | iD = (kuiABCD >> 24) & 0xff; |
| 352 | for (i = 0; i < iHeight; i++) | 335 | for (i = 0; i < iHeight; i++) { |
| 353 | { | 336 | for (j = 0; j < iWidth; j++) { |
| 354 | for (j = 0; j < iWidth; j++) | 337 | pDst[j] = (iA * pSrc[j] + iB * pSrc[j + 1] + iC * pSrcNext[j] + iD * pSrcNext[j + 1] + 32) >> 6; |
| 355 | { | 338 | } |
| 356 | pDst[j] = (iA * pSrc[j] + iB * pSrc[j+1] + iC * pSrcNext[j] + iD * pSrcNext[j+1] + 32) >> 6; | 339 | pDst += iDstStride; |
| 357 | } | 340 | pSrc = pSrcNext; |
| 358 | pDst += iDstStride; | 341 | pSrcNext += iSrcStride; |
| 359 | pSrc = pSrcNext; | 342 | } |
| 360 | pSrcNext += iSrcStride; | 343 | } |
| 361 | } | 344 | |
| 362 | } | 345 | void_t McChroma_c (uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, |
| 363 | 346 | int16_t iMvX, int16_t iMvY, int32_t iWidth, int32_t iHeight) | |
| 364 | void_t McChroma_c(uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, | 347 | //pSrc has been added the offset of mv |
| 365 | int16_t iMvX, int16_t iMvY, int32_t iWidth, int32_t iHeight) | 348 | { |
| 366 | //pSrc has been added the offset of mv | 349 | const int32_t kiD8x = iMvX & 0x07; |
| 367 | { | 350 | const int32_t kiD8y = iMvY & 0x07; |
| 368 | const int32_t kiD8x = iMvX&0x07; | 351 | if (0 == kiD8x && 0 == kiD8y) |
| 369 | const int32_t kiD8y = iMvY&0x07; | 352 | McCopy_c (pSrc, iSrcStride, pDst, iDstStride, iWidth, iHeight); |
| 370 | if (0 == kiD8x && 0 == kiD8y) | 353 | else |
| 371 | McCopy_c(pSrc, iSrcStride, pDst, iDstStride, iWidth, iHeight); | 354 | McChromaWithFragMv_c (pSrc, iSrcStride, pDst, iDstStride, iMvX, iMvY, iWidth, iHeight); |
| 372 | else | ||
| 373 | McChromaWithFragMv_c(pSrc, iSrcStride, pDst, iDstStride, iMvX, iMvY, iWidth, iHeight); | ||
| 374 | } | 355 | } |
| 375 | 356 | ||
| 376 | #if defined(X86_ASM) | 357 | #if defined(X86_ASM) |
| 377 | //***************************************************************************// | 358 | //***************************************************************************// |
| 378 | // SSE2 implement // | 359 | // SSE2 implement // |
| 379 | //***************************************************************************// | 360 | //***************************************************************************// |
| 380 | static inline void_t McHorVer22WidthEq8_sse2( uint8_t *pSrc, int32_t iSrcStride, uint8_t *pDst, int32_t iDstStride, int32_t iHeight ) | 361 | static inline void_t McHorVer22WidthEq8_sse2 (uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, |
| 381 | { | 362 | int32_t iHeight) { |
| 382 | ENFORCE_STACK_ALIGN_2D(int16_t, iTap, 21, 8, 16) | 363 | ENFORCE_STACK_ALIGN_2D (int16_t, iTap, 21, 8, 16) |
| 383 | McHorVer22Width8HorFirst_sse2(pSrc-2, iSrcStride, (uint8_t *)iTap,16,iHeight+5); | 364 | McHorVer22Width8HorFirst_sse2 (pSrc - 2, iSrcStride, (uint8_t*)iTap, 16, iHeight + 5); |
| 384 | McHorVer22VerLast_sse2((uint8_t *)iTap,16, pDst, iDstStride, 8, iHeight); | 365 | McHorVer22VerLast_sse2 ((uint8_t*)iTap, 16, pDst, iDstStride, 8, iHeight); |
| 385 | } | 366 | } |
| 386 | 367 | ||
| 387 | static inline void_t McHorVer02WidthEq16_sse2( uint8_t *pSrc, int32_t iSrcStride, uint8_t *pDst, int32_t iDstStride, int32_t iHeight ) | 368 | static inline void_t McHorVer02WidthEq16_sse2 (uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, |
| 388 | { | 369 | int32_t iHeight) { |
| 389 | McHorVer02WidthEq8_sse2( pSrc, iSrcStride, pDst, iDstStride, iHeight ); | 370 | McHorVer02WidthEq8_sse2 (pSrc, iSrcStride, pDst, iDstStride, iHeight); |
| 390 | McHorVer02WidthEq8_sse2( &pSrc[8], iSrcStride, &pDst[8], iDstStride, iHeight ); | 371 | McHorVer02WidthEq8_sse2 (&pSrc[8], iSrcStride, &pDst[8], iDstStride, iHeight); |
| 391 | } | 372 | } |
| 392 | 373 | ||
| 393 | static inline void_t McHorVer22WidthEq16_sse2( uint8_t *pSrc, int32_t iSrcStride, uint8_t *pDst, int32_t iDstStride, int32_t iHeight ) | 374 | static inline void_t McHorVer22WidthEq16_sse2 (uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, |
| 394 | { | 375 | int32_t iHeight) { |
| 395 | McHorVer22WidthEq8_sse2( pSrc, iSrcStride, pDst, iDstStride, iHeight ); | 376 | McHorVer22WidthEq8_sse2 (pSrc, iSrcStride, pDst, iDstStride, iHeight); |
| 396 | McHorVer22WidthEq8_sse2( &pSrc[8], iSrcStride, &pDst[8], iDstStride, iHeight ); | 377 | McHorVer22WidthEq8_sse2 (&pSrc[8], iSrcStride, &pDst[8], iDstStride, iHeight); |
| 397 | } | 378 | } |
| 398 | 379 | ||
| 399 | static inline void_t McCopy_sse2(uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, int32_t iWidth, int32_t iHeight) | 380 | static inline void_t McCopy_sse2 (uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, int32_t iWidth, |
| 400 | { | 381 | int32_t iHeight) { |
| 401 | if (iWidth == 16) | 382 | if (iWidth == 16) |
| 402 | McCopyWidthEq16_sse2(pSrc,iSrcStride,pDst,iDstStride,iHeight); | 383 | McCopyWidthEq16_sse2 (pSrc, iSrcStride, pDst, iDstStride, iHeight); |
| 403 | else if(iWidth == 8) | 384 | else if (iWidth == 8) |
| 404 | McCopyWidthEq8_mmx(pSrc,iSrcStride,pDst,iDstStride,iHeight); | 385 | McCopyWidthEq8_mmx (pSrc, iSrcStride, pDst, iDstStride, iHeight); |
| 405 | else if(iWidth ==4) | 386 | else if (iWidth == 4) |
| 406 | McCopyWidthEq4_mmx(pSrc,iSrcStride,pDst,iDstStride,iHeight); | 387 | McCopyWidthEq4_mmx (pSrc, iSrcStride, pDst, iDstStride, iHeight); |
| 407 | else | 388 | else |
| 408 | McCopyWidthEq2_c(pSrc,iSrcStride,pDst,iDstStride,iHeight); | 389 | McCopyWidthEq2_c (pSrc, iSrcStride, pDst, iDstStride, iHeight); |
| 409 | } | 390 | } |
| 410 | 391 | ||
| 411 | static inline void_t McHorVer20_sse2(uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, int32_t iWidth, int32_t iHeight) | 392 | static inline void_t McHorVer20_sse2 (uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, |
| 412 | { | 393 | int32_t iWidth, int32_t iHeight) { |
| 413 | if (iWidth == 16) | 394 | if (iWidth == 16) |
| 414 | McHorVer20WidthEq16_sse2(pSrc,iSrcStride,pDst,iDstStride,iHeight); | 395 | McHorVer20WidthEq16_sse2 (pSrc, iSrcStride, pDst, iDstStride, iHeight); |
| 415 | else if(iWidth == 8) | 396 | else if (iWidth == 8) |
| 416 | McHorVer20WidthEq8_sse2(pSrc,iSrcStride,pDst,iDstStride,iHeight); | 397 | McHorVer20WidthEq8_sse2 (pSrc, iSrcStride, pDst, iDstStride, iHeight); |
| 417 | else | 398 | else |
| 418 | McHorVer20WidthEq4_mmx(pSrc,iSrcStride,pDst,iDstStride,iHeight); | 399 | McHorVer20WidthEq4_mmx (pSrc, iSrcStride, pDst, iDstStride, iHeight); |
| 419 | } | 400 | } |
| 420 | 401 | ||
| 421 | static inline void_t McHorVer02_sse2(uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, int32_t iWidth, int32_t iHeight) | 402 | static inline void_t McHorVer02_sse2 (uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, |
| 422 | { | 403 | int32_t iWidth, int32_t iHeight) { |
| 423 | if (iWidth == 16) | 404 | if (iWidth == 16) |
| 424 | McHorVer02WidthEq16_sse2(pSrc,iSrcStride,pDst,iDstStride,iHeight); | 405 | McHorVer02WidthEq16_sse2 (pSrc, iSrcStride, pDst, iDstStride, iHeight); |
| 425 | else if(iWidth == 8) | 406 | else if (iWidth == 8) |
| 426 | McHorVer02WidthEq8_sse2(pSrc,iSrcStride,pDst,iDstStride,iHeight); | 407 | McHorVer02WidthEq8_sse2 (pSrc, iSrcStride, pDst, iDstStride, iHeight); |
| 427 | else | 408 | else |
| 428 | McHorVer02_c(pSrc,iSrcStride,pDst,iDstStride, 4, iHeight); | 409 | McHorVer02_c (pSrc, iSrcStride, pDst, iDstStride, 4, iHeight); |
| 429 | } | 410 | } |
| 430 | 411 | ||
| 431 | static inline void_t McHorVer22_sse2(uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, int32_t iWidth, int32_t iHeight) | 412 | static inline void_t McHorVer22_sse2 (uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, |
| 432 | { | 413 | int32_t iWidth, int32_t iHeight) { |
| 433 | if (iWidth == 16) | 414 | if (iWidth == 16) |
| 434 | McHorVer22WidthEq16_sse2(pSrc,iSrcStride,pDst,iDstStride,iHeight); | 415 | McHorVer22WidthEq16_sse2 (pSrc, iSrcStride, pDst, iDstStride, iHeight); |
| 435 | else if(iWidth == 8) | 416 | else if (iWidth == 8) |
| 436 | McHorVer22WidthEq8_sse2(pSrc,iSrcStride,pDst,iDstStride,iHeight); | 417 | McHorVer22WidthEq8_sse2 (pSrc, iSrcStride, pDst, iDstStride, iHeight); |
| 437 | else | 418 | else |
| 438 | McHorVer22_c(pSrc,iSrcStride,pDst,iDstStride,4, iHeight); | 419 | McHorVer22_c (pSrc, iSrcStride, pDst, iDstStride, 4, iHeight); |
| 439 | } | 420 | } |
| 440 | 421 | ||
| 441 | static inline void_t McHorVer01_sse2(uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, int32_t iWidth, int32_t iHeight) | 422 | static inline void_t McHorVer01_sse2 (uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, |
| 442 | { | 423 | int32_t iWidth, int32_t iHeight) { |
| 443 | FORCE_STACK_ALIGN_1D( uint8_t, pTmp, 256, 16 ); | 424 | FORCE_STACK_ALIGN_1D (uint8_t, pTmp, 256, 16); |
| 444 | if (iWidth == 16) | 425 | if (iWidth == 16) { |
| 445 | { | 426 | McHorVer02WidthEq16_sse2 (pSrc, iSrcStride, pTmp, 16, iHeight); |
| 446 | McHorVer02WidthEq16_sse2(pSrc, iSrcStride, pTmp, 16, iHeight); | 427 | PixelAvgWidthEq16_sse2 (pDst, iDstStride, pSrc, iSrcStride, pTmp, 16, iHeight); |
| 447 | PixelAvgWidthEq16_sse2(pDst, iDstStride, pSrc, iSrcStride, pTmp, 16, iHeight); | 428 | } else if (iWidth == 8) { |
| 448 | } | 429 | McHorVer02WidthEq8_sse2 (pSrc, iSrcStride, pTmp, 16, iHeight); |
| 449 | else if(iWidth == 8) | 430 | PixelAvgWidthEq8_mmx (pDst, iDstStride, pSrc, iSrcStride, pTmp, 16, iHeight); |
| 450 | { | 431 | } else { |
| 451 | McHorVer02WidthEq8_sse2(pSrc, iSrcStride, pTmp, 16, iHeight); | 432 | McHorVer02_c (pSrc, iSrcStride, pTmp, 16, 4, iHeight); |
| 452 | PixelAvgWidthEq8_mmx(pDst, iDstStride, pSrc, iSrcStride, pTmp, 16, iHeight); | 433 | PixelAvgWidthEq4_mmx (pDst, iDstStride, pSrc, iSrcStride, pTmp, 16, iHeight); |
| 453 | } | 434 | } |
| 454 | else | 435 | } |
| 455 | { | 436 | static inline void_t McHorVer03_sse2 (uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, |
| 456 | McHorVer02_c(pSrc, iSrcStride, pTmp, 16, 4, iHeight); | 437 | int32_t iWidth, int32_t iHeight) { |
| 457 | PixelAvgWidthEq4_mmx(pDst, iDstStride, pSrc, iSrcStride, pTmp, 16, iHeight); | 438 | FORCE_STACK_ALIGN_1D (uint8_t, pTmp, 256, 16); |
| 458 | } | 439 | if (iWidth == 16) { |
| 459 | } | 440 | McHorVer02WidthEq16_sse2 (pSrc, iSrcStride, pTmp, 16, iHeight); |
| 460 | static inline void_t McHorVer03_sse2(uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, int32_t iWidth, int32_t iHeight) | 441 | PixelAvgWidthEq16_sse2 (pDst, iDstStride, pSrc + iSrcStride, iSrcStride, pTmp, 16, iHeight); |
| 461 | { | 442 | } else if (iWidth == 8) { |
| 462 | FORCE_STACK_ALIGN_1D( uint8_t, pTmp, 256, 16 ); | 443 | McHorVer02WidthEq8_sse2 (pSrc, iSrcStride, pTmp, 16, iHeight); |
| 463 | if (iWidth == 16) | 444 | PixelAvgWidthEq8_mmx (pDst, iDstStride, pSrc + iSrcStride, iSrcStride, pTmp, 16, iHeight); |
| 464 | { | 445 | } else { |
| 465 | McHorVer02WidthEq16_sse2(pSrc, iSrcStride, pTmp, 16, iHeight); | 446 | McHorVer02_c (pSrc, iSrcStride, pTmp, 16, 4, iHeight); |
| 466 | PixelAvgWidthEq16_sse2(pDst, iDstStride, pSrc+iSrcStride, iSrcStride, pTmp, 16, iHeight); | 447 | PixelAvgWidthEq4_mmx (pDst, iDstStride, pSrc + iSrcStride, iSrcStride, pTmp, 16, iHeight); |
| 467 | } | 448 | } |
| 468 | else if(iWidth == 8) | 449 | } |
| 469 | { | 450 | static inline void_t McHorVer10_sse2 (uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, |
| 470 | McHorVer02WidthEq8_sse2(pSrc, iSrcStride, pTmp, 16, iHeight); | 451 | int32_t iWidth, int32_t iHeight) { |
| 471 | PixelAvgWidthEq8_mmx(pDst, iDstStride, pSrc+iSrcStride, iSrcStride, pTmp, 16, iHeight); | 452 | FORCE_STACK_ALIGN_1D (uint8_t, pTmp, 256, 16); |
| 472 | } | 453 | if (iWidth == 16) { |
| 473 | else | 454 | McHorVer20WidthEq16_sse2 (pSrc, iSrcStride, pTmp, 16, iHeight); |
| 474 | { | 455 | PixelAvgWidthEq16_sse2 (pDst, iDstStride, pSrc, iSrcStride, pTmp, 16, iHeight); |
| 475 | McHorVer02_c(pSrc, iSrcStride, pTmp, 16, 4, iHeight); | 456 | } else if (iWidth == 8) { |
| 476 | PixelAvgWidthEq4_mmx(pDst, iDstStride, pSrc+iSrcStride, iSrcStride, pTmp, 16, iHeight); | 457 | McHorVer20WidthEq8_sse2 (pSrc, iSrcStride, pTmp, 16, iHeight); |
| 477 | } | 458 | PixelAvgWidthEq8_mmx (pDst, iDstStride, pSrc, iSrcStride, pTmp, 16, iHeight); |
| 478 | } | 459 | } else { |
| 479 | static inline void_t McHorVer10_sse2(uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, int32_t iWidth, int32_t iHeight) | 460 | McHorVer20WidthEq4_mmx (pSrc, iSrcStride, pTmp, 16, iHeight); |
| 480 | { | 461 | PixelAvgWidthEq4_mmx (pDst, iDstStride, pSrc, iSrcStride, pTmp, 16, iHeight); |
| 481 | FORCE_STACK_ALIGN_1D( uint8_t, pTmp, 256, 16 ); | 462 | } |
| 482 | if (iWidth == 16) | 463 | } |
| 483 | { | 464 | static inline void_t McHorVer11_sse2 (uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, |
| 484 | McHorVer20WidthEq16_sse2(pSrc, iSrcStride, pTmp, 16, iHeight); | 465 | int32_t iWidth, int32_t iHeight) { |
| 485 | PixelAvgWidthEq16_sse2(pDst, iDstStride, pSrc, iSrcStride, pTmp, 16, iHeight); | 466 | FORCE_STACK_ALIGN_1D (uint8_t, pHorTmp, 256, 16); |
| 486 | } | 467 | FORCE_STACK_ALIGN_1D (uint8_t, pVerTmp, 256, 16); |
| 487 | else if(iWidth == 8) | 468 | if (iWidth == 16) { |
| 488 | { | 469 | McHorVer20WidthEq16_sse2 (pSrc, iSrcStride, pHorTmp, 16, iHeight); |
| 489 | McHorVer20WidthEq8_sse2(pSrc, iSrcStride, pTmp, 16, iHeight); | 470 | McHorVer02WidthEq16_sse2 (pSrc, iSrcStride, pVerTmp, 16, iHeight); |
| 490 | PixelAvgWidthEq8_mmx(pDst, iDstStride, pSrc, iSrcStride, pTmp, 16, iHeight); | 471 | PixelAvgWidthEq16_sse2 (pDst, iDstStride, pHorTmp, 16, pVerTmp, 16, iHeight); |
| 491 | } | 472 | } else if (iWidth == 8) { |
| 492 | else | 473 | McHorVer20WidthEq8_sse2 (pSrc, iSrcStride, pHorTmp, 16, iHeight); |
| 493 | { | 474 | McHorVer02WidthEq8_sse2 (pSrc, iSrcStride, pVerTmp, 16, iHeight); |
| 494 | McHorVer20WidthEq4_mmx(pSrc, iSrcStride, pTmp, 16, iHeight); | 475 | PixelAvgWidthEq8_mmx (pDst, iDstStride, pHorTmp, 16, pVerTmp, 16, iHeight); |
| 495 | PixelAvgWidthEq4_mmx(pDst, iDstStride, pSrc, iSrcStride, pTmp, 16, iHeight); | 476 | } else { |
| 496 | } | 477 | McHorVer20WidthEq4_mmx (pSrc, iSrcStride, pHorTmp, 16, iHeight); |
| 497 | } | 478 | McHorVer02_c (pSrc, iSrcStride, pVerTmp, 16, 4, iHeight); |
| 498 | static inline void_t McHorVer11_sse2(uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, int32_t iWidth, int32_t iHeight) | 479 | PixelAvgWidthEq4_mmx (pDst, iDstStride, pHorTmp, 16, pVerTmp, 16, iHeight); |
| 499 | { | 480 | } |
| 500 | FORCE_STACK_ALIGN_1D( uint8_t, pHorTmp, 256, 16 ); | 481 | } |
| 501 | FORCE_STACK_ALIGN_1D( uint8_t, pVerTmp, 256, 16 ); | 482 | static inline void_t McHorVer12_sse2 (uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, |
| 502 | if (iWidth == 16) | 483 | int32_t iWidth, int32_t iHeight) { |
| 503 | { | 484 | FORCE_STACK_ALIGN_1D (uint8_t, pVerTmp, 256, 16); |
| 504 | McHorVer20WidthEq16_sse2(pSrc, iSrcStride, pHorTmp, 16, iHeight); | 485 | FORCE_STACK_ALIGN_1D (uint8_t, pCtrTmp, 256, 16); |
| 505 | McHorVer02WidthEq16_sse2(pSrc, iSrcStride, pVerTmp, 16, iHeight); | 486 | if (iWidth == 16) { |
| 506 | PixelAvgWidthEq16_sse2 (pDst, iDstStride, pHorTmp, 16, pVerTmp, 16, iHeight); | 487 | McHorVer02WidthEq16_sse2 (pSrc, iSrcStride, pVerTmp, 16, iHeight); |
| 507 | } | 488 | McHorVer22WidthEq16_sse2 (pSrc, iSrcStride, pCtrTmp, 16, iHeight); |
| 508 | else if(iWidth == 8) | 489 | PixelAvgWidthEq16_sse2 (pDst, iDstStride, pVerTmp, 16, pCtrTmp, 16, iHeight); |
| 509 | { | 490 | } else if (iWidth == 8) { |
| 510 | McHorVer20WidthEq8_sse2(pSrc, iSrcStride, pHorTmp, 16, iHeight); | 491 | McHorVer02WidthEq8_sse2 (pSrc, iSrcStride, pVerTmp, 16, iHeight); |
| 511 | McHorVer02WidthEq8_sse2(pSrc, iSrcStride, pVerTmp, 16, iHeight); | 492 | McHorVer22WidthEq8_sse2 (pSrc, iSrcStride, pCtrTmp, 16, iHeight); |
| 512 | PixelAvgWidthEq8_mmx(pDst, iDstStride, pHorTmp, 16, pVerTmp, 16, iHeight); | 493 | PixelAvgWidthEq8_mmx (pDst, iDstStride, pVerTmp, 16, pCtrTmp, 16, iHeight); |
| 513 | } | 494 | } else { |
| 514 | else | 495 | McHorVer02_c (pSrc, iSrcStride, pVerTmp, 16, 4, iHeight); |
| 515 | { | 496 | McHorVer22_c (pSrc, iSrcStride, pCtrTmp, 16, 4, iHeight); |
| 516 | McHorVer20WidthEq4_mmx(pSrc, iSrcStride, pHorTmp, 16, iHeight); | 497 | PixelAvgWidthEq4_mmx (pDst, iDstStride, pVerTmp, 16, pCtrTmp, 16, iHeight); |
| 517 | McHorVer02_c (pSrc, iSrcStride, pVerTmp, 16, 4, iHeight); | 498 | } |
| 518 | PixelAvgWidthEq4_mmx (pDst, iDstStride, pHorTmp, 16, pVerTmp, 16, iHeight); | 499 | } |
| 519 | } | 500 | static inline void_t McHorVer13_sse2 (uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, |
| 520 | } | 501 | int32_t iWidth, int32_t iHeight) { |
| 521 | static inline void_t McHorVer12_sse2(uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, int32_t iWidth, int32_t iHeight) | 502 | FORCE_STACK_ALIGN_1D (uint8_t, pHorTmp, 256, 16); |
| 522 | { | 503 | FORCE_STACK_ALIGN_1D (uint8_t, pVerTmp, 256, 16); |
| 523 | FORCE_STACK_ALIGN_1D( uint8_t, pVerTmp, 256, 16 ); | 504 | if (iWidth == 16) { |
| 524 | FORCE_STACK_ALIGN_1D( uint8_t, pCtrTmp, 256, 16 ); | 505 | McHorVer20WidthEq16_sse2 (pSrc + iSrcStride, iSrcStride, pHorTmp, 16, iHeight); |
| 525 | if (iWidth == 16) | 506 | McHorVer02WidthEq16_sse2 (pSrc, iSrcStride, pVerTmp, 16, iHeight); |
| 526 | { | 507 | PixelAvgWidthEq16_sse2 (pDst, iDstStride, pHorTmp, 16, pVerTmp, 16, iHeight); |
| 527 | McHorVer02WidthEq16_sse2(pSrc, iSrcStride, pVerTmp, 16, iHeight); | 508 | } else if (iWidth == 8) { |
| 528 | McHorVer22WidthEq16_sse2(pSrc, iSrcStride, pCtrTmp, 16, iHeight); | 509 | McHorVer20WidthEq8_sse2 (pSrc + iSrcStride, iSrcStride, pHorTmp, 16, iHeight); |
| 529 | PixelAvgWidthEq16_sse2 (pDst, iDstStride, pVerTmp, 16, pCtrTmp, 16, iHeight); | 510 | McHorVer02WidthEq8_sse2 (pSrc, iSrcStride, pVerTmp, 16, iHeight); |
| 530 | } | 511 | PixelAvgWidthEq8_mmx (pDst, iDstStride, pHorTmp, 16, pVerTmp, 16, iHeight); |
| 531 | else if(iWidth == 8) | 512 | } else { |
| 532 | { | 513 | McHorVer20WidthEq4_mmx (pSrc + iSrcStride, iSrcStride, pHorTmp, 16, iHeight); |
| 533 | McHorVer02WidthEq8_sse2(pSrc, iSrcStride, pVerTmp, 16, iHeight); | 514 | McHorVer02_c (pSrc, iSrcStride, pVerTmp, 16, 4 , iHeight); |
| 534 | McHorVer22WidthEq8_sse2(pSrc, iSrcStride, pCtrTmp, 16, iHeight); | 515 | PixelAvgWidthEq4_mmx (pDst, iDstStride, pHorTmp, 16, pVerTmp, 16, iHeight); |
| 535 | PixelAvgWidthEq8_mmx(pDst, iDstStride, pVerTmp, 16, pCtrTmp, 16, iHeight); | 516 | } |
| 536 | } | 517 | } |
| 537 | else | 518 | static inline void_t McHorVer21_sse2 (uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, |
| 538 | { | 519 | int32_t iWidth, int32_t iHeight) { |
| 539 | McHorVer02_c (pSrc, iSrcStride, pVerTmp, 16, 4, iHeight); | 520 | FORCE_STACK_ALIGN_1D (uint8_t, pHorTmp, 256, 16); |
| 540 | McHorVer22_c (pSrc, iSrcStride, pCtrTmp, 16, 4, iHeight); | 521 | FORCE_STACK_ALIGN_1D (uint8_t, pCtrTmp, 256, 16); |
| 541 | PixelAvgWidthEq4_mmx(pDst, iDstStride, pVerTmp, 16, pCtrTmp, 16, iHeight); | 522 | if (iWidth == 16) { |
| 542 | } | 523 | McHorVer20WidthEq16_sse2 (pSrc, iSrcStride, pHorTmp, 16, iHeight); |
| 543 | } | 524 | McHorVer22WidthEq16_sse2 (pSrc, iSrcStride, pCtrTmp, 16, iHeight); |
| 544 | static inline void_t McHorVer13_sse2(uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, int32_t iWidth, int32_t iHeight) | 525 | PixelAvgWidthEq16_sse2 (pDst, iDstStride, pHorTmp, 16, pCtrTmp, 16, iHeight); |
| 545 | { | 526 | } else if (iWidth == 8) { |
| 546 | FORCE_STACK_ALIGN_1D( uint8_t, pHorTmp, 256, 16 ); | 527 | McHorVer20WidthEq8_sse2 (pSrc, iSrcStride, pHorTmp, 16, iHeight); |
| 547 | FORCE_STACK_ALIGN_1D( uint8_t, pVerTmp, 256, 16 ); | 528 | McHorVer22WidthEq8_sse2 (pSrc, iSrcStride, pCtrTmp, 16, iHeight); |
| 548 | if (iWidth ==16) | 529 | PixelAvgWidthEq8_mmx (pDst, iDstStride, pHorTmp, 16, pCtrTmp, 16, iHeight); |
| 549 | { | 530 | } else { |
| 550 | McHorVer20WidthEq16_sse2(pSrc+iSrcStride, iSrcStride, pHorTmp, 16, iHeight); | 531 | McHorVer20WidthEq4_mmx (pSrc, iSrcStride, pHorTmp, 16, iHeight); |
| 551 | McHorVer02WidthEq16_sse2(pSrc, iSrcStride, pVerTmp, 16, iHeight); | 532 | McHorVer22_c (pSrc, iSrcStride, pCtrTmp, 16, 4, iHeight); |
| 552 | PixelAvgWidthEq16_sse2 (pDst, iDstStride, pHorTmp, 16, pVerTmp, 16, iHeight); | 533 | PixelAvgWidthEq4_mmx (pDst, iDstStride, pHorTmp, 16, pCtrTmp, 16, iHeight); |
| 553 | } | 534 | } |
| 554 | else if(iWidth == 8) | 535 | } |
| 555 | { | 536 | static inline void_t McHorVer23_sse2 (uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, |
| 556 | McHorVer20WidthEq8_sse2(pSrc+iSrcStride, iSrcStride, pHorTmp, 16, iHeight); | 537 | int32_t iWidth, int32_t iHeight) { |
| 557 | McHorVer02WidthEq8_sse2(pSrc, iSrcStride, pVerTmp, 16, iHeight); | 538 | FORCE_STACK_ALIGN_1D (uint8_t, pHorTmp, 256, 16); |
| 558 | PixelAvgWidthEq8_mmx(pDst, iDstStride, pHorTmp, 16, pVerTmp, 16, iHeight); | 539 | FORCE_STACK_ALIGN_1D (uint8_t, pCtrTmp, 256, 16); |
| 559 | } | 540 | if (iWidth == 16) { |
| 560 | else | 541 | McHorVer20WidthEq16_sse2 (pSrc + iSrcStride, iSrcStride, pHorTmp, 16, iHeight); |
| 561 | { | 542 | McHorVer22WidthEq16_sse2 (pSrc, iSrcStride, pCtrTmp, 16, iHeight); |
| 562 | McHorVer20WidthEq4_mmx(pSrc+iSrcStride, iSrcStride, pHorTmp, 16, iHeight); | 543 | PixelAvgWidthEq16_sse2 (pDst, iDstStride, pHorTmp, 16, pCtrTmp, 16, iHeight); |
| 563 | McHorVer02_c (pSrc, iSrcStride, pVerTmp, 16, 4 ,iHeight); | 544 | } else if (iWidth == 8) { |
| 564 | PixelAvgWidthEq4_mmx(pDst, iDstStride, pHorTmp, 16, pVerTmp, 16, iHeight); | 545 | McHorVer20WidthEq8_sse2 (pSrc + iSrcStride, iSrcStride, pHorTmp, 16, iHeight); |
| 565 | } | 546 | McHorVer22WidthEq8_sse2 (pSrc, iSrcStride, pCtrTmp, 16, iHeight); |
| 566 | } | 547 | PixelAvgWidthEq8_mmx (pDst, iDstStride, pHorTmp, 16, pCtrTmp, 16, iHeight); |
| 567 | static inline void_t McHorVer21_sse2(uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, int32_t iWidth, int32_t iHeight) | 548 | } else { |
| 568 | { | 549 | McHorVer20WidthEq4_mmx (pSrc + iSrcStride, iSrcStride, pHorTmp, 16, iHeight); |
| 569 | FORCE_STACK_ALIGN_1D( uint8_t, pHorTmp, 256, 16 ); | 550 | McHorVer22_c (pSrc, iSrcStride, pCtrTmp, 16, 4, iHeight); |
| 570 | FORCE_STACK_ALIGN_1D( uint8_t, pCtrTmp, 256, 16 ); | 551 | PixelAvgWidthEq4_mmx (pDst, iDstStride, pHorTmp, 16, pCtrTmp, 16, iHeight); |
| 571 | if (iWidth == 16) | 552 | } |
| 572 | { | 553 | } |
| 573 | McHorVer20WidthEq16_sse2(pSrc, iSrcStride, pHorTmp, 16, iHeight); | 554 | static inline void_t McHorVer30_sse2 (uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, |
| 574 | McHorVer22WidthEq16_sse2(pSrc, iSrcStride, pCtrTmp, 16, iHeight); | 555 | int32_t iWidth, int32_t iHeight) { |
| 575 | PixelAvgWidthEq16_sse2(pDst, iDstStride, pHorTmp, 16, pCtrTmp, 16, iHeight); | 556 | FORCE_STACK_ALIGN_1D (uint8_t, pHorTmp, 256, 16); |
| 576 | } | 557 | if (iWidth == 16) { |
| 577 | else if(iWidth == 8) | 558 | McHorVer20WidthEq16_sse2 (pSrc, iSrcStride, pHorTmp, 16, iHeight); |
| 578 | { | 559 | PixelAvgWidthEq16_sse2 (pDst, iDstStride, pSrc + 1, iSrcStride, pHorTmp, 16, iHeight); |
| 579 | McHorVer20WidthEq8_sse2(pSrc, iSrcStride, pHorTmp, 16, iHeight); | 560 | } else if (iWidth == 8) { |
| 580 | McHorVer22WidthEq8_sse2(pSrc, iSrcStride, pCtrTmp, 16, iHeight); | 561 | McHorVer20WidthEq8_sse2 (pSrc, iSrcStride, pHorTmp, 16, iHeight); |
| 581 | PixelAvgWidthEq8_mmx(pDst, iDstStride, pHorTmp, 16, pCtrTmp, 16, iHeight); | 562 | PixelAvgWidthEq8_mmx (pDst, iDstStride, pSrc + 1, iSrcStride, pHorTmp, 16, iHeight); |
| 582 | } | 563 | } else { |
| 583 | else | 564 | McHorVer20WidthEq4_mmx (pSrc, iSrcStride, pHorTmp, 16, iHeight); |
| 584 | { | 565 | PixelAvgWidthEq4_mmx (pDst, iDstStride, pSrc + 1, iSrcStride, pHorTmp, 16, iHeight); |
| 585 | McHorVer20WidthEq4_mmx(pSrc, iSrcStride, pHorTmp, 16, iHeight); | 566 | } |
| 586 | McHorVer22_c (pSrc, iSrcStride, pCtrTmp, 16, 4, iHeight); | 567 | } |
| 587 | PixelAvgWidthEq4_mmx(pDst, iDstStride, pHorTmp, 16, pCtrTmp, 16, iHeight); | 568 | static inline void_t McHorVer31_sse2 (uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, |
| 588 | } | 569 | int32_t iWidth, int32_t iHeight) { |
| 589 | } | 570 | FORCE_STACK_ALIGN_1D (uint8_t, pHorTmp, 256, 16); |
| 590 | static inline void_t McHorVer23_sse2(uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, int32_t iWidth, int32_t iHeight) | 571 | FORCE_STACK_ALIGN_1D (uint8_t, pVerTmp, 256, 16); |
| 591 | { | 572 | if (iWidth == 16) { |
| 592 | FORCE_STACK_ALIGN_1D( uint8_t, pHorTmp, 256, 16 ); | 573 | McHorVer20WidthEq16_sse2 (pSrc, iSrcStride, pHorTmp, 16, iHeight); |
| 593 | FORCE_STACK_ALIGN_1D( uint8_t, pCtrTmp, 256, 16 ); | 574 | McHorVer02WidthEq16_sse2 (pSrc + 1, iSrcStride, pVerTmp, 16, iHeight); |
| 594 | if (iWidth == 16) | 575 | PixelAvgWidthEq16_sse2 (pDst, iDstStride, pHorTmp, 16, pVerTmp, 16, iHeight); |
| 595 | { | 576 | } else if (iWidth == 8) { |
| 596 | McHorVer20WidthEq16_sse2(pSrc+iSrcStride, iSrcStride, pHorTmp, 16, iHeight); | 577 | McHorVer20WidthEq8_sse2 (pSrc, iSrcStride, pHorTmp, 16, iHeight); |
| 597 | McHorVer22WidthEq16_sse2(pSrc, iSrcStride, pCtrTmp, 16, iHeight); | 578 | McHorVer02WidthEq8_sse2 (pSrc + 1, iSrcStride, pVerTmp, 16, iHeight); |
| 598 | PixelAvgWidthEq16_sse2(pDst, iDstStride, pHorTmp, 16, pCtrTmp, 16, iHeight); | 579 | PixelAvgWidthEq8_mmx (pDst, iDstStride, pHorTmp, 16, pVerTmp, 16, iHeight); |
| 599 | } | 580 | } else { |
| 600 | else if(iWidth == 8) | 581 | McHorVer20WidthEq4_mmx (pSrc, iSrcStride, pHorTmp, 16, iHeight); |
| 601 | { | 582 | McHorVer02_c (pSrc + 1, iSrcStride, pVerTmp, 16, 4, iHeight); |
| 602 | McHorVer20WidthEq8_sse2(pSrc+iSrcStride, iSrcStride, pHorTmp, 16, iHeight); | 583 | PixelAvgWidthEq4_mmx (pDst, iDstStride, pHorTmp, 16, pVerTmp, 16, iHeight); |
| 603 | McHorVer22WidthEq8_sse2(pSrc, iSrcStride, pCtrTmp, 16, iHeight); | 584 | } |
| 604 | PixelAvgWidthEq8_mmx(pDst, iDstStride, pHorTmp, 16, pCtrTmp, 16, iHeight); | 585 | } |
| 605 | } | 586 | static inline void_t McHorVer32_sse2 (uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, |
| 606 | else | 587 | int32_t iWidth, int32_t iHeight) { |
| 607 | { | 588 | FORCE_STACK_ALIGN_1D (uint8_t, pVerTmp, 256, 16); |
| 608 | McHorVer20WidthEq4_mmx(pSrc+iSrcStride, iSrcStride, pHorTmp, 16, iHeight); | 589 | FORCE_STACK_ALIGN_1D (uint8_t, pCtrTmp, 256, 16); |
| 609 | McHorVer22_c (pSrc, iSrcStride, pCtrTmp, 16, 4, iHeight); | 590 | if (iWidth == 16) { |
| 610 | PixelAvgWidthEq4_mmx(pDst, iDstStride, pHorTmp, 16, pCtrTmp, 16, iHeight); | 591 | McHorVer02WidthEq16_sse2 (pSrc + 1, iSrcStride, pVerTmp, 16, iHeight); |
| 611 | } | 592 | McHorVer22WidthEq16_sse2 (pSrc, iSrcStride, pCtrTmp, 16, iHeight); |
| 612 | } | 593 | PixelAvgWidthEq16_sse2 (pDst, iDstStride, pVerTmp, 16, pCtrTmp, 16, iHeight); |
| 613 | static inline void_t McHorVer30_sse2(uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, int32_t iWidth, int32_t iHeight) | 594 | } else if (iWidth == 8) { |
| 614 | { | 595 | McHorVer02WidthEq8_sse2 (pSrc + 1, iSrcStride, pVerTmp, 16, iHeight); |
| 615 | FORCE_STACK_ALIGN_1D( uint8_t, pHorTmp, 256, 16 ); | 596 | McHorVer22WidthEq8_sse2 (pSrc, iSrcStride, pCtrTmp, 16, iHeight); |
| 616 | if (iWidth == 16) | 597 | PixelAvgWidthEq8_mmx (pDst, iDstStride, pVerTmp, 16, pCtrTmp, 16, iHeight); |
| 617 | { | 598 | } else { |
| 618 | McHorVer20WidthEq16_sse2(pSrc, iSrcStride, pHorTmp, 16, iHeight); | 599 | McHorVer02_c (pSrc + 1, iSrcStride, pVerTmp, 16, 4, iHeight); |
| 619 | PixelAvgWidthEq16_sse2(pDst, iDstStride, pSrc+1, iSrcStride, pHorTmp, 16, iHeight); | 600 | McHorVer22_c (pSrc, iSrcStride, pCtrTmp, 16, 4, iHeight); |
| 620 | } | 601 | PixelAvgWidthEq4_mmx (pDst, iDstStride, pVerTmp, 16, pCtrTmp, 16, iHeight); |
| 621 | else if(iWidth == 8) | 602 | } |
| 622 | { | 603 | } |
| 623 | McHorVer20WidthEq8_sse2(pSrc, iSrcStride, pHorTmp, 16, iHeight); | 604 | static inline void_t McHorVer33_sse2 (uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, |
| 624 | PixelAvgWidthEq8_mmx(pDst, iDstStride, pSrc+1, iSrcStride, pHorTmp, 16, iHeight); | 605 | int32_t iWidth, int32_t iHeight) { |
| 625 | } | 606 | FORCE_STACK_ALIGN_1D (uint8_t, pHorTmp, 256, 16); |
| 626 | else | 607 | FORCE_STACK_ALIGN_1D (uint8_t, pVerTmp, 256, 16); |
| 627 | { | 608 | if (iWidth == 16) { |
| 628 | McHorVer20WidthEq4_mmx(pSrc, iSrcStride, pHorTmp, 16, iHeight); | 609 | McHorVer20WidthEq16_sse2 (pSrc + iSrcStride, iSrcStride, pHorTmp, 16, iHeight); |
| 629 | PixelAvgWidthEq4_mmx(pDst, iDstStride, pSrc+1, iSrcStride, pHorTmp, 16, iHeight); | 610 | McHorVer02WidthEq16_sse2 (pSrc + 1, iSrcStride, pVerTmp, 16, iHeight); |
| 630 | } | 611 | PixelAvgWidthEq16_sse2 (pDst, iDstStride, pHorTmp, 16, pVerTmp, 16, iHeight); |
| 631 | } | 612 | } else if (iWidth == 8) { |
| 632 | static inline void_t McHorVer31_sse2(uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, int32_t iWidth, int32_t iHeight) | 613 | McHorVer20WidthEq8_sse2 (pSrc + iSrcStride, iSrcStride, pHorTmp, 16, iHeight); |
| 633 | { | 614 | McHorVer02WidthEq8_sse2 (pSrc + 1, iSrcStride, pVerTmp, 16, iHeight); |
| 634 | FORCE_STACK_ALIGN_1D( uint8_t, pHorTmp, 256, 16 ); | 615 | PixelAvgWidthEq8_mmx (pDst, iDstStride, pHorTmp, 16, pVerTmp, 16, iHeight); |
| 635 | FORCE_STACK_ALIGN_1D( uint8_t, pVerTmp, 256, 16 ); | 616 | } else { |
| 636 | if (iWidth == 16) | 617 | McHorVer20WidthEq4_mmx (pSrc + iSrcStride, iSrcStride, pHorTmp, 16, iHeight); |
| 637 | { | 618 | McHorVer02_c (pSrc + 1, iSrcStride, pVerTmp, 16, 4, iHeight); |
| 638 | McHorVer20WidthEq16_sse2(pSrc, iSrcStride, pHorTmp, 16, iHeight); | 619 | PixelAvgWidthEq4_mmx (pDst, iDstStride, pHorTmp, 16, pVerTmp, 16, iHeight); |
| 639 | McHorVer02WidthEq16_sse2(pSrc+1, iSrcStride, pVerTmp, 16, iHeight); | 620 | } |
| 640 | PixelAvgWidthEq16_sse2(pDst, iDstStride, pHorTmp, 16, pVerTmp, 16, iHeight); | 621 | } |
| 641 | } | 622 | |
| 642 | else if(iWidth == 8) | 623 | void_t McLuma_sse2 (uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, |
| 643 | { | 624 | int16_t iMvX, int16_t iMvY, int32_t iWidth, int32_t iHeight) |
| 644 | McHorVer20WidthEq8_sse2(pSrc, iSrcStride, pHorTmp, 16, iHeight); | 625 | //pSrc has been added the offset of mv |
| 645 | McHorVer02WidthEq8_sse2(pSrc+1, iSrcStride, pVerTmp, 16, iHeight); | 626 | { |
| 646 | PixelAvgWidthEq8_mmx(pDst, iDstStride, pHorTmp, 16, pVerTmp, 16, iHeight); | 627 | PWelsMcWidthHeightFunc pWelsMcFunc[4][4] = { //[x][y] |
| 647 | } | 628 | {McCopy_sse2, McHorVer01_sse2, McHorVer02_sse2, McHorVer03_sse2}, |
| 648 | else | 629 | {McHorVer10_sse2, McHorVer11_sse2, McHorVer12_sse2, McHorVer13_sse2}, |
| 649 | { | 630 | {McHorVer20_sse2, McHorVer21_sse2, McHorVer22_sse2, McHorVer23_sse2}, |
| 650 | McHorVer20WidthEq4_mmx(pSrc, iSrcStride, pHorTmp, 16, iHeight); | 631 | {McHorVer30_sse2, McHorVer31_sse2, McHorVer32_sse2, McHorVer33_sse2}, |
| 651 | McHorVer02_c(pSrc+1, iSrcStride, pVerTmp, 16, 4, iHeight); | 632 | }; |
| 652 | PixelAvgWidthEq4_mmx(pDst, iDstStride, pHorTmp, 16, pVerTmp, 16, iHeight); | 633 | |
| 653 | } | 634 | pWelsMcFunc[iMvX & 0x03][iMvY & 0x03] (pSrc, iSrcStride, pDst, iDstStride, iWidth, iHeight); |
| 654 | } | 635 | } |
| 655 | static inline void_t McHorVer32_sse2(uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, int32_t iWidth, int32_t iHeight) | 636 | |
| 656 | { | 637 | void_t McChroma_sse2 (uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, |
| 657 | FORCE_STACK_ALIGN_1D( uint8_t, pVerTmp, 256, 16 ); | 638 | int16_t iMvX, int16_t iMvY, int32_t iWidth, int32_t iHeight) { |
| 658 | FORCE_STACK_ALIGN_1D( uint8_t, pCtrTmp, 256, 16 ); | 639 | static const PMcChromaWidthExtFunc kpMcChromaWidthFuncs[2] = { |
| 659 | if (iWidth ==16) | 640 | McChromaWidthEq4_mmx, |
| 660 | { | 641 | McChromaWidthEq8_sse2 |
| 661 | McHorVer02WidthEq16_sse2(pSrc+1, iSrcStride, pVerTmp, 16, iHeight); | 642 | }; |
| 662 | McHorVer22WidthEq16_sse2(pSrc, iSrcStride, pCtrTmp, 16, iHeight); | 643 | const int32_t kiD8x = iMvX & 0x07; |
| 663 | PixelAvgWidthEq16_sse2(pDst, iDstStride, pVerTmp, 16, pCtrTmp, 16, iHeight); | 644 | const int32_t kiD8y = iMvY & 0x07; |
| 664 | } | 645 | if (kiD8x == 0 && kiD8y == 0) { |
| 665 | else if(iWidth == 8) | 646 | McCopy_sse2 (pSrc, iSrcStride, pDst, iDstStride, iWidth, iHeight); |
| 666 | { | 647 | return; |
| 667 | McHorVer02WidthEq8_sse2(pSrc+1, iSrcStride, pVerTmp, 16, iHeight); | 648 | } |
| 668 | McHorVer22WidthEq8_sse2(pSrc, iSrcStride, pCtrTmp, 16, iHeight); | 649 | if (iWidth != 2) { |
| 669 | PixelAvgWidthEq8_mmx(pDst, iDstStride, pVerTmp, 16, pCtrTmp, 16, iHeight); | 650 | kpMcChromaWidthFuncs[iWidth >> 3] (pSrc, iSrcStride, pDst, iDstStride, g_kuiABCD[kiD8y][kiD8x], iHeight); |
| 670 | } | 651 | } else |
| 671 | else | 652 | McChromaWithFragMv_c (pSrc, iSrcStride, pDst, iDstStride, iMvX, iMvY, iWidth, iHeight); |
| 672 | { | ||
| 673 | McHorVer02_c(pSrc+1, iSrcStride, pVerTmp, 16, 4, iHeight); | ||
| 674 | McHorVer22_c(pSrc, iSrcStride, pCtrTmp, 16, 4, iHeight); | ||
| 675 | PixelAvgWidthEq4_mmx(pDst, iDstStride, pVerTmp, 16, pCtrTmp, 16, iHeight); | ||
| 676 | } | ||
| 677 | } | ||
| 678 | static inline void_t McHorVer33_sse2(uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, int32_t iWidth, int32_t iHeight) | ||
| 679 | { | ||
| 680 | FORCE_STACK_ALIGN_1D( uint8_t, pHorTmp, 256, 16 ); | ||
| 681 | FORCE_STACK_ALIGN_1D( uint8_t, pVerTmp, 256, 16 ); | ||
| 682 | if (iWidth == 16) | ||
| 683 | { | ||
| 684 | McHorVer20WidthEq16_sse2(pSrc+iSrcStride, iSrcStride, pHorTmp, 16, iHeight); | ||
| 685 | McHorVer02WidthEq16_sse2(pSrc+1, iSrcStride, pVerTmp, 16, iHeight); | ||
| 686 | PixelAvgWidthEq16_sse2(pDst, iDstStride, pHorTmp, 16, pVerTmp, 16, iHeight); | ||
| 687 | } | ||
| 688 | else if(iWidth == 8) | ||
| 689 | { | ||
| 690 | McHorVer20WidthEq8_sse2(pSrc+iSrcStride, iSrcStride, pHorTmp, 16, iHeight); | ||
| 691 | McHorVer02WidthEq8_sse2(pSrc+1, iSrcStride, pVerTmp, 16, iHeight); | ||
| 692 | PixelAvgWidthEq8_mmx(pDst, iDstStride, pHorTmp, 16, pVerTmp, 16, iHeight); | ||
| 693 | } | ||
| 694 | else | ||
| 695 | { | ||
| 696 | McHorVer20WidthEq4_mmx(pSrc+iSrcStride, iSrcStride, pHorTmp, 16, iHeight); | ||
| 697 | McHorVer02_c (pSrc+1, iSrcStride, pVerTmp, 16, 4, iHeight); | ||
| 698 | PixelAvgWidthEq4_mmx(pDst, iDstStride, pHorTmp, 16, pVerTmp, 16, iHeight); | ||
| 699 | } | ||
| 700 | } | ||
| 701 | |||
| 702 | void_t McLuma_sse2(uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, | ||
| 703 | int16_t iMvX, int16_t iMvY, int32_t iWidth, int32_t iHeight) | ||
| 704 | //pSrc has been added the offset of mv | ||
| 705 | { | ||
| 706 | PWelsMcWidthHeightFunc pWelsMcFunc[4][4] = //[x][y] | ||
| 707 | { | ||
| 708 | {McCopy_sse2, McHorVer01_sse2, McHorVer02_sse2, McHorVer03_sse2}, | ||
| 709 | {McHorVer10_sse2, McHorVer11_sse2, McHorVer12_sse2, McHorVer13_sse2}, | ||
| 710 | {McHorVer20_sse2, McHorVer21_sse2, McHorVer22_sse2, McHorVer23_sse2}, | ||
| 711 | {McHorVer30_sse2, McHorVer31_sse2, McHorVer32_sse2, McHorVer33_sse2}, | ||
| 712 | }; | ||
| 713 | |||
| 714 | pWelsMcFunc[iMvX&0x03][iMvY&0x03](pSrc, iSrcStride, pDst, iDstStride, iWidth, iHeight); | ||
| 715 | } | ||
| 716 | |||
| 717 | void_t McChroma_sse2( uint8_t *pSrc, int32_t iSrcStride, uint8_t *pDst, int32_t iDstStride, | ||
| 718 | int16_t iMvX, int16_t iMvY, int32_t iWidth, int32_t iHeight ) | ||
| 719 | { | ||
| 720 | static const PMcChromaWidthExtFunc kpMcChromaWidthFuncs[2] = | ||
| 721 | { | ||
| 722 | McChromaWidthEq4_mmx, | ||
| 723 | McChromaWidthEq8_sse2 | ||
| 724 | }; | ||
| 725 | const int32_t kiD8x = iMvX&0x07; | ||
| 726 | const int32_t kiD8y = iMvY&0x07; | ||
| 727 | if (kiD8x ==0 && kiD8y ==0) | ||
| 728 | { | ||
| 729 | McCopy_sse2(pSrc, iSrcStride, pDst, iDstStride, iWidth, iHeight); | ||
| 730 | return; | ||
| 731 | } | ||
| 732 | if (iWidth != 2) | ||
| 733 | { | ||
| 734 | kpMcChromaWidthFuncs[iWidth>>3](pSrc, iSrcStride, pDst, iDstStride, g_kuiABCD[kiD8y][kiD8x], iHeight); | ||
| 735 | } | ||
| 736 | else | ||
| 737 | McChromaWithFragMv_c(pSrc, iSrcStride, pDst, iDstStride, iMvX, iMvY, iWidth, iHeight); | ||
| 738 | } | 653 | } |
| 739 | 654 | ||
| 740 | 655 | ||
| 741 | #endif //X86_ASM | 656 | #endif //X86_ASM |
| 742 | 657 | ||
| 743 | void_t InitMcFunc(SMcFunc *pMcFunc, int32_t iCpu) | 658 | void_t InitMcFunc (SMcFunc* pMcFunc, int32_t iCpu) { |
| 744 | { | 659 | pMcFunc->pMcLumaFunc = McLuma_c; |
| 745 | pMcFunc->pMcLumaFunc = McLuma_c; | 660 | pMcFunc->pMcChromaFunc = McChroma_c; |
| 746 | pMcFunc->pMcChromaFunc = McChroma_c; | 661 | |
| 747 | |||
| 748 | #if defined (X86_ASM) | 662 | #if defined (X86_ASM) |
| 749 | if ( iCpu & WELS_CPU_SSE2 ) | 663 | if (iCpu & WELS_CPU_SSE2) { |
| 750 | { | 664 | pMcFunc->pMcLumaFunc = McLuma_sse2; |
| 751 | pMcFunc->pMcLumaFunc = McLuma_sse2; | 665 | pMcFunc->pMcChromaFunc = McChroma_sse2; |
| 752 | pMcFunc->pMcChromaFunc = McChroma_sse2; | 666 | } |
| 753 | } | ||
| 754 | #endif //(X86_ASM) | 667 | #endif //(X86_ASM) |
| 755 | } | 668 | } |
| 756 | 669 | ||