Skip to content
Snippets Groups Projects
Commit 0568eff5 authored by Yifan Zhao's avatar Yifan Zhao
Browse files

Added an argument to cam_model in hpvm-cava

parent 2c80d818
No related branches found
No related tags found
No related merge requests found
...@@ -53,6 +53,7 @@ typedef struct __attribute__((__packed__)) { ...@@ -53,6 +53,7 @@ typedef struct __attribute__((__packed__)) {
} RootIn; } RootIn;
typedef enum _argnum { typedef enum _argnum {
CAM_MODEL,
RAW_IMAGE_BIN, RAW_IMAGE_BIN,
OUTPUT_IMAGE_BIN, OUTPUT_IMAGE_BIN,
NUM_REQUIRED_ARGS, NUM_REQUIRED_ARGS,
...@@ -67,7 +68,7 @@ typedef struct _arguments { ...@@ -67,7 +68,7 @@ typedef struct _arguments {
} arguments; } arguments;
static char prog_doc[] = "\nCamera pipeline on gem5-Aladdin.\n"; static char prog_doc[] = "\nCamera pipeline on gem5-Aladdin.\n";
static char args_doc[] = "path/to/raw-image-binary path/to/output-image-binary"; static char args_doc[] = "path/to/cam-model path/to/raw-image-binary path/to/output-image-binary";
static struct argp_option options[] = { static struct argp_option options[] = {
{"num-inputs", 'n', "N", 0, "Number of input images"}, {"num-inputs", 'n', "N", 0, "Number of input images"},
{0}, {0},
...@@ -724,14 +725,14 @@ int main(int argc, char *argv[]) { ...@@ -724,14 +725,14 @@ int main(int argc, char *argv[]) {
*transform_out, *gamut_out; *transform_out, *gamut_out;
float *TsTw, *ctrl_pts, *weights, *coefs, *tone_map, *l2_dist; float *TsTw, *ctrl_pts, *weights, *coefs, *tone_map, *l2_dist;
TsTw = get_TsTw("cam_models/NikonD7000/", wb_index); TsTw = get_TsTw(args.args[CAM_MODEL], wb_index);
float *trans = transpose_mat(TsTw, CHAN_SIZE, CHAN_SIZE); float *trans = transpose_mat(TsTw, CHAN_SIZE, CHAN_SIZE);
free(TsTw); free(TsTw);
TsTw = trans; TsTw = trans;
ctrl_pts = get_ctrl_pts("cam_models/NikonD7000/", num_ctrl_pts); ctrl_pts = get_ctrl_pts(args.args[CAM_MODEL], num_ctrl_pts);
weights = get_weights("cam_models/NikonD7000/", num_ctrl_pts); weights = get_weights(args.args[CAM_MODEL], num_ctrl_pts);
coefs = get_coefs("cam_models/NikonD7000/", num_ctrl_pts); coefs = get_coefs(args.args[CAM_MODEL], num_ctrl_pts);
tone_map = get_tone_map("cam_models/NikonD7000/"); tone_map = get_tone_map(args.args[CAM_MODEL]);
input_scaled = (float *)malloc_aligned(bytes_fimage); input_scaled = (float *)malloc_aligned(bytes_fimage);
result_scaled = (float *)malloc_aligned(bytes_fimage); result_scaled = (float *)malloc_aligned(bytes_fimage);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment