mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-07-27 09:15:00 +02:00
22 lines
411 B
C++
22 lines
411 B
C++
#pragma once
|
|
|
|
// WARNING : Do not use these with floating point data, especially not float16...
|
|
|
|
template <class T>
|
|
inline void delta(T *data, int length) {
|
|
T prev = data[0];
|
|
for (int i = 1; i < length; i++) {
|
|
T temp = data[i] - prev;
|
|
prev = data[i];
|
|
data[i] = temp;
|
|
}
|
|
}
|
|
|
|
template <class T>
|
|
inline void dedelta(T *data, int length) {
|
|
for (int i = 1; i < length; i++) {
|
|
data[i] += data[i - 1];
|
|
}
|
|
}
|
|
|