| 47 | } |
| 48 | |
| 49 | OF_DEVICE_FUNC double GetAreaPixel(const double scale, const int64_t dst_index, bool align_corners, |
| 50 | bool cubic = false) { |
| 51 | if (align_corners) { |
| 52 | return scale * dst_index; |
| 53 | } else { |
| 54 | double src_idx = scale * (dst_index + 0.5) - 0.5; |
| 55 | return (!cubic && src_idx < 0) ? static_cast<double>(0) : src_idx; |
| 56 | } |
| 57 | } |
| 58 | |
| 59 | template<typename T> |
| 60 | struct BilinearParam { |
no outgoing calls
no test coverage detected