#include "beforeProcess.h" #include double __get_us(struct timeval t) { return (t.tv_sec * 1000000 + t.tv_usec); } unsigned char *load_data(FILE *fp, size_t ofst, size_t sz) { unsigned char *data; int ret; data = NULL; if (NULL == fp) { return NULL; } ret = fseek(fp, ofst, SEEK_SET); if (ret != 0) { printf("blob seek failure.\n"); return NULL; } data = (unsigned char *)malloc(sz); if (data == NULL) { printf("buffer malloc failure.\n"); return NULL; } ret = fread(data, 1, sz, fp); return data; } int saveFloat(const char *file_name, float *output, int element_size) { FILE *fp; fp = fopen(file_name, "w"); for (int i = 0; i < element_size; i++) { fprintf(fp, "%.6f\n", output[i]); } fclose(fp); return 0; }