fprintf(stderr, " --help print usage information\n");
fprintf(stderr, " --slow-down-input slow down input to realtime (default on if no\n");
fprintf(stderr, " source URL given)");
+ fprintf(stderr, " -q, --interpolation-quality N 1 = fastest\n");
+ fprintf(stderr, " 2 = default (realtime 720p on fast embedded GPUs)\n");
+ fprintf(stderr, " 3 = good (realtime 720p on GTX 970 or so)\n");
+ fprintf(stderr, " 4 = best (not realtime on any current GPU)\n");
}
void parse_flags(int argc, char * const argv[])
static const option long_options[] = {
{ "help", no_argument, 0, OPTION_HELP },
{ "slow-down-input", no_argument, 0, OPTION_SLOW_DOWN_INPUT },
+ { "interpolation-quality", required_argument, 0, 'q' },
{ 0, 0, 0, 0 }
};
for ( ;; ) {
case OPTION_SLOW_DOWN_INPUT:
global_flags.slow_down_input = true;
break;
+ case 'q':
+ global_flags.interpolation_quality = atoi(optarg);
+ break;
case OPTION_HELP:
usage();
exit(0);
exit(1);
}
}
+
+ if (global_flags.interpolation_quality < 1 || global_flags.interpolation_quality > 4) {
+ fprintf(stderr, "Interpolation quality must be 1, 2, 3 or 4.\n");
+ usage();
+ exit(1);
+ }
}
#include "chroma_subsampler.h"
#include "context.h"
+#include "flags.h"
#include "flow.h"
#include "httpd.h"
#include "jpeg_frame_view.h"
check_error();
- compute_flow.reset(new DISComputeFlow(width, height, operating_point2));
- interpolate.reset(new Interpolate(operating_point2, /*split_ycbcr_output=*/true));
- interpolate_no_split.reset(new Interpolate(operating_point2, /*split_ycbcr_output=*/false));
+ OperatingPoint op;
+ if (global_flags.interpolation_quality == 1) {
+ op = operating_point1;
+ } else if (global_flags.interpolation_quality == 2) {
+ op = operating_point2;
+ } else if (global_flags.interpolation_quality == 3) {
+ op = operating_point3;
+ } else if (global_flags.interpolation_quality == 4) {
+ op = operating_point4;
+ } else {
+ assert(false);
+ }
+
+ compute_flow.reset(new DISComputeFlow(width, height, op));
+ interpolate.reset(new Interpolate(op, /*split_ycbcr_output=*/true));
+ interpolate_no_split.reset(new Interpolate(op, /*split_ycbcr_output=*/false));
chroma_subsampler.reset(new ChromaSubsampler);
check_error();