#include <libavformat/avio.h>
}
-#include <jpeglib.h>
-#include <unistd.h>
-
#include "chroma_subsampler.h"
#include "context.h"
+#include "flags.h"
#include "flow.h"
#include "httpd.h"
#include "jpeg_frame_view.h"
#include "ycbcr_converter.h"
#include <epoxy/glx.h>
+#include <jpeglib.h>
+#include <unistd.h>
using namespace std;
for (unsigned y = 0; y < height; y += 8) {
for (unsigned yy = 0; yy < 8; ++yy) {
yptr[yy] = const_cast<JSAMPROW>(&y_data[(y + yy) * width]);
- cbptr[yy] = const_cast<JSAMPROW>(&cb_data[(y + yy) * width/2]);
- crptr[yy] = const_cast<JSAMPROW>(&cr_data[(y + yy) * width/2]);
+ cbptr[yy] = const_cast<JSAMPROW>(&cb_data[(y + yy) * width / 2]);
+ crptr[yy] = const_cast<JSAMPROW>(&cr_data[(y + yy) * width / 2]);
}
jpeg_write_raw_data(&cinfo, data, /*num_lines=*/8);
check_error();
glNamedBufferStorage(resource.pbo, width * height * 4, nullptr, GL_MAP_READ_BIT | GL_MAP_PERSISTENT_BIT);
check_error();
- resource.pbo_contents = glMapNamedBufferRange(resource.pbo, 0, width * height * 4, GL_MAP_READ_BIT | GL_MAP_PERSISTENT_BIT);
+ resource.pbo_contents = glMapNamedBufferRange(resource.pbo, 0, width * height * 4, GL_MAP_READ_BIT | GL_MAP_PERSISTENT_BIT);
interpolate_resources.push_back(resource);
}
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();
qf.type = QueuedFrame::ORIGINAL;
qf.output_pts = output_pts;
qf.stream_idx = stream_idx;
- qf.input_first_pts = input_pts;
+ qf.input_first_pts = input_pts;
unique_lock<mutex> lock(queue_lock);
frame_queue.push_back(qf);
chroma_subsampler->subsample_chroma(qf.cbcr_tex, 1280, 720, resources.cb_tex, resources.cr_tex);
}
-
// We could have released qf.flow_tex here, but to make sure we don't cause a stall
// when trying to reuse it for the next frame, we can just as well hold on to it
// and release it only when the readback is done.
}
return buf_size;
}
-