mirror of
https://github.com/paparazzi/paparazzi.git
synced 2026-05-31 03:57:45 +08:00
Proposed speedup edits as described in pull request comments
This commit is contained in:
@@ -121,7 +121,7 @@ void calculate_edge_histogram(struct image_t *img, int32_t edge_histogram[],
|
|||||||
for (y = 0; y < image_height; y++) {
|
for (y = 0; y < image_height; y++) {
|
||||||
sobel_sum = 0;
|
sobel_sum = 0;
|
||||||
|
|
||||||
for (c = -1; c <= 1; c++) {
|
for (c = -1; c <= 1; c+=2) {
|
||||||
idx = interlace * (image_width * y + (x + c));
|
idx = interlace * (image_width * y + (x + c));
|
||||||
|
|
||||||
sobel_sum += Sobel[c + 1] * (int32_t)img_buf[idx];
|
sobel_sum += Sobel[c + 1] * (int32_t)img_buf[idx];
|
||||||
@@ -140,7 +140,7 @@ void calculate_edge_histogram(struct image_t *img, int32_t edge_histogram[],
|
|||||||
for (x = 0; x < image_width; x++) {
|
for (x = 0; x < image_width; x++) {
|
||||||
sobel_sum = 0;
|
sobel_sum = 0;
|
||||||
|
|
||||||
for (c = -1; c <= 1; c++) {
|
for (c = -1; c <= 1; c+=2) {
|
||||||
idx = interlace * (image_width * (y + c) + x);
|
idx = interlace * (image_width * (y + c) + x);
|
||||||
|
|
||||||
sobel_sum += Sobel[c + 1] * (int32_t)img_buf[idx];
|
sobel_sum += Sobel[c + 1] * (int32_t)img_buf[idx];
|
||||||
@@ -198,7 +198,6 @@ void calculate_edge_displacement(int32_t *edge_histogram, int32_t *edge_histogra
|
|||||||
}
|
}
|
||||||
// TODO: replace with arm offset subtract
|
// TODO: replace with arm offset subtract
|
||||||
for (x = border[0]; x < border[1]; x++) {
|
for (x = border[0]; x < border[1]; x++) {
|
||||||
displacement[x] = 0;
|
|
||||||
if (!SHIFT_TOO_FAR) {
|
if (!SHIFT_TOO_FAR) {
|
||||||
for (c = -D; c <= D; c++) {
|
for (c = -D; c <= D; c++) {
|
||||||
SAD_temp[c + D] = 0;
|
SAD_temp[c + D] = 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user