From 826c21b045b09d6e28b313b3c57cd62800febb16 Mon Sep 17 00:00:00 2001 From: Comma Device Date: Fri, 20 Nov 2020 18:03:06 +0000 Subject: [PATCH] fix some lack of cache awareness in yuvframe2tensor --- selfdrive/modeld/models/dmonitoring.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/selfdrive/modeld/models/dmonitoring.cc b/selfdrive/modeld/models/dmonitoring.cc index 6be44c926f..80e6a3e60b 100644 --- a/selfdrive/modeld/models/dmonitoring.cc +++ b/selfdrive/modeld/models/dmonitoring.cc @@ -118,8 +118,8 @@ DMonitoringResult dmonitoring_eval_frame(DMonitoringModelState* s, void* stream_ float *net_input_buf = get_buffer(s->net_input_buf, yuv_buf_len); // one shot conversion, O(n) anyway // yuvframe2tensor, normalize - for (int r = 0; r < MODEL_HEIGHT/2; r++) { - for (int c = 0; c < MODEL_WIDTH/2; c++) { + for (int c = 0; c < MODEL_WIDTH/2; c++) { + for (int r = 0; r < MODEL_HEIGHT/2; r++) { // Y_ul net_input_buf[(c*MODEL_HEIGHT/2) + r] = input_lambda(resized_buf[(2*r*resized_width) + (2*c)]); // Y_ur