Loading libs/input/MotionPredictor.cpp +3 −2 Original line number Diff line number Diff line Loading @@ -181,7 +181,8 @@ std::unique_ptr<MotionEvent> MotionPredictor::predict(nsecs_t timestamp) { int64_t predictionTime = mBuffers->lastTimestamp(); const int64_t futureTime = timestamp + mPredictionTimestampOffsetNanos; for (int i = 0; i < predictedR.size() && predictionTime <= futureTime; ++i) { for (size_t i = 0; i < static_cast<size_t>(predictedR.size()) && predictionTime <= futureTime; ++i) { if (predictedR[i] < mModel->config().distanceNoiseFloor) { // Stop predicting when the predicted output is below the model's noise floor. // Loading @@ -198,7 +199,7 @@ std::unique_ptr<MotionEvent> MotionPredictor::predict(nsecs_t timestamp) { const TfLiteMotionPredictorSample::Point predictedPoint = convertPrediction(axisFrom, axisTo, predictedR[i], predictedPhi[i]); ALOGD_IF(isDebug(), "prediction %d: %f, %f", i, predictedPoint.x, predictedPoint.y); ALOGD_IF(isDebug(), "prediction %zu: %f, %f", i, predictedPoint.x, predictedPoint.y); PointerCoords coords; coords.clear(); coords.setAxisValue(AMOTION_EVENT_AXIS_X, predictedPoint.x); Loading libs/input/TfLiteMotionPredictor.cpp +1 −2 Original line number Diff line number Diff line Loading @@ -143,8 +143,7 @@ std::span<T> getTensorBuffer(typename std::conditional<std::is_const<T>::value, tensor->name, TfLiteTypeGetName(tensor->type), TfLiteTypeGetName(type)); LOG_ALWAYS_FATAL_IF(!tensor->data.data); return {reinterpret_cast<T*>(tensor->data.data), static_cast<typename std::span<T>::index_type>(tensor->bytes / sizeof(T))}; return std::span<T>(reinterpret_cast<T*>(tensor->data.data), tensor->bytes / sizeof(T)); } // Verifies that a tensor exists and has an underlying buffer of type T. Loading Loading
libs/input/MotionPredictor.cpp +3 −2 Original line number Diff line number Diff line Loading @@ -181,7 +181,8 @@ std::unique_ptr<MotionEvent> MotionPredictor::predict(nsecs_t timestamp) { int64_t predictionTime = mBuffers->lastTimestamp(); const int64_t futureTime = timestamp + mPredictionTimestampOffsetNanos; for (int i = 0; i < predictedR.size() && predictionTime <= futureTime; ++i) { for (size_t i = 0; i < static_cast<size_t>(predictedR.size()) && predictionTime <= futureTime; ++i) { if (predictedR[i] < mModel->config().distanceNoiseFloor) { // Stop predicting when the predicted output is below the model's noise floor. // Loading @@ -198,7 +199,7 @@ std::unique_ptr<MotionEvent> MotionPredictor::predict(nsecs_t timestamp) { const TfLiteMotionPredictorSample::Point predictedPoint = convertPrediction(axisFrom, axisTo, predictedR[i], predictedPhi[i]); ALOGD_IF(isDebug(), "prediction %d: %f, %f", i, predictedPoint.x, predictedPoint.y); ALOGD_IF(isDebug(), "prediction %zu: %f, %f", i, predictedPoint.x, predictedPoint.y); PointerCoords coords; coords.clear(); coords.setAxisValue(AMOTION_EVENT_AXIS_X, predictedPoint.x); Loading
libs/input/TfLiteMotionPredictor.cpp +1 −2 Original line number Diff line number Diff line Loading @@ -143,8 +143,7 @@ std::span<T> getTensorBuffer(typename std::conditional<std::is_const<T>::value, tensor->name, TfLiteTypeGetName(tensor->type), TfLiteTypeGetName(type)); LOG_ALWAYS_FATAL_IF(!tensor->data.data); return {reinterpret_cast<T*>(tensor->data.data), static_cast<typename std::span<T>::index_type>(tensor->bytes / sizeof(T))}; return std::span<T>(reinterpret_cast<T*>(tensor->data.data), tensor->bytes / sizeof(T)); } // Verifies that a tensor exists and has an underlying buffer of type T. Loading