This commit is contained in:
猪小乐 2023-06-16 02:02:57 +00:00
parent 2ab8d6c2dc
commit 84b7b414f7

View File

@ -1035,6 +1035,7 @@ int main (int argc, char *argv[])
if (!min_split) { if (!min_split) {
min_split = 1; min_split = 1;
} }
buffer_opt = parse_int(buffer_optimize, "buffer-opt", NULL);
mark_forced = parse_int(mark_forced_string, "forced", NULL); mark_forced = parse_int(mark_forced_string, "forced", NULL);
/* TODO: Sanity check video_format and frame_rate. */ /* TODO: Sanity check video_format and frame_rate. */
@ -1072,9 +1073,6 @@ int main (int argc, char *argv[])
print_usage(); print_usage();
return 1; return 1;
} }
in_img = calloc(s_info->i_width * s_info->i_height * 4 + 16 * 2, sizeof(char)); /* allocate + 16 for alignment, and + n * 16 for over read/write */
old_img = calloc(s_info->i_width * s_info->i_height * 4 + 16 * 2, sizeof(char)); /* see above */
out_buf = calloc(s_info->i_width * s_info->i_height * 4 + 16 * 2, sizeof(char));
/* Check minimum size */ /* Check minimum size */
if (s_info->i_width < 8 || s_info->i_height < 8) if (s_info->i_width < 8 || s_info->i_height < 8)
@ -1083,14 +1081,15 @@ int main (int argc, char *argv[])
return 1; return 1;
} }
in_img = calloc(s_info->i_width * s_info->i_height * 4 + 16 * 2, sizeof(char)); /* allocate + 16 for alignment, and + n * 16 for over read/write */
old_img = calloc(s_info->i_width * s_info->i_height * 4 + 16 * 2, sizeof(char)); /* see above */
out_buf = calloc(s_info->i_width * s_info->i_height * 4 + 16 * 2, sizeof(char));
/* Align buffers */ /* Align buffers */
in_img = in_img + (short)(16 - ((long)in_img % 16)); in_img = in_img + (short)(16 - ((long)in_img % 16));
old_img = old_img + (short)(16 - ((long)old_img % 16)); old_img = old_img + (short)(16 - ((long)old_img % 16));
out_buf = out_buf + (short)(16 - ((long)out_buf % 16)); out_buf = out_buf + (short)(16 - ((long)out_buf % 16));
/* Set up buffer (non-)optimization */
buffer_opt = parse_int(buffer_optimize, "buffer-opt", NULL);
pic.b = out_buf; pic.b = out_buf;
pic.w = s_info->i_width; pic.w = s_info->i_width;
pic.h = s_info->i_height; pic.h = s_info->i_height;