193 |
*/ |
*/ |
194 |
inline static int DiffToLoopEnd(const float& LoopEnd, const void* Pos, const float& Pitch) { |
inline static int DiffToLoopEnd(const float& LoopEnd, const void* Pos, const float& Pitch) { |
195 |
switch (IMPLEMENTATION) { |
switch (IMPLEMENTATION) { |
|
// pure C++ implementation (thus platform independent) |
|
|
case CPP: { |
|
|
return uint((LoopEnd - *((double *)Pos)) / Pitch); |
|
|
} |
|
196 |
#if CONFIG_ASM && ARCH_X86 |
#if CONFIG_ASM && ARCH_X86 |
197 |
case ASM_X86_MMX_SSE: { |
case ASM_X86_MMX_SSE: { |
198 |
int result; |
int result; |
209 |
return result; |
return result; |
210 |
} |
} |
211 |
#endif // CONFIG_ASM && ARCH_X86 |
#endif // CONFIG_ASM && ARCH_X86 |
212 |
|
// pure C++ implementation (thus platform independent) |
213 |
|
default: { |
214 |
|
return uint((LoopEnd - *((double *)Pos)) / Pitch); |
215 |
|
} |
216 |
} |
} |
217 |
} |
} |
218 |
|
|
225 |
*/ |
*/ |
226 |
inline static int WrapLoop(const float& LoopStart, const float& LoopSize, const float& LoopEnd, void* vPos) { |
inline static int WrapLoop(const float& LoopStart, const float& LoopSize, const float& LoopEnd, void* vPos) { |
227 |
switch (IMPLEMENTATION) { |
switch (IMPLEMENTATION) { |
|
// pure C++ implementation (thus platform independent) |
|
|
case CPP: { |
|
|
double * Pos = (double *)vPos; |
|
|
if (*Pos < LoopEnd) return 0; |
|
|
*Pos = fmod(*Pos - LoopEnd, LoopSize) + LoopStart; |
|
|
return 1; |
|
|
} |
|
228 |
#if CONFIG_ASM && ARCH_X86 |
#if CONFIG_ASM && ARCH_X86 |
229 |
case ASM_X86_MMX_SSE: { |
case ASM_X86_MMX_SSE: { |
230 |
int result = 0; |
int result = 0; |
258 |
return result; |
return result; |
259 |
} |
} |
260 |
#endif // CONFIG_ASM && ARCH_X86 |
#endif // CONFIG_ASM && ARCH_X86 |
261 |
|
// pure C++ implementation (thus platform independent) |
262 |
|
default: { |
263 |
|
double * Pos = (double *)vPos; |
264 |
|
if (*Pos < LoopEnd) return 0; |
265 |
|
*Pos = fmod(*Pos - LoopEnd, LoopSize) + LoopStart; |
266 |
|
return 1; |
267 |
|
} |
268 |
} |
} |
269 |
} |
} |
270 |
|
|