21 #ifdef ENABLE_PROFILING
22 #include "../../../utils/profiler.h"
30 shader(recycleBin), output(outputStorage)
38 bool sizeChange =
false;
39 if (output && (output->getWidth() != input.
getWidth() || output->getHeight() != input.
getHeight())) {
65 if (output && (output->getWidth() != input.
getWidth() || output->getHeight() != input.
getHeight()))
74 shader.prepare(gpu,
nullptr, output);
77 for (
int i = 0; i < inputsCount; ++i)
79 shader.bindSamplerArray(
"images", 0, inputsCount);
92 #ifdef ENABLE_PROFILING
97 for (
int i = 0; i <
L1_SIZE; ++i)
100 #ifdef ENABLE_PROFILING
115 #ifdef ENABLE_PROFILING
121 for (
int i = 0; i <
L3_SIZE; ++i)
124 #ifdef ENABLE_PROFILING
135 #ifdef ENABLE_PROFILING
143 #ifdef ENABLE_PROFILING
156 #ifdef ENABLE_PROFILING
158 profiler.
report(std::cout);
170 #define STRINGIFY(...) BEATMUP_SHADER_CODE(__VA_ARGS__)
173 #include
"l1__0.glsl"
177 #include
"l1__1.glsl"
181 #include
"l1__2.glsl"
185 #include
"l1__3.glsl"
189 #include
"l1__4.glsl"
193 #include
"l1__5.glsl"
197 #include
"l1__6.glsl"
201 #include
"l1__7.glsl"
205 #include
"l1__8.glsl"
209 #include
"l1__9.glsl"
213 #include
"l1__10.glsl"
217 #include
"l1__11.glsl"
222 #include
"l2-0__0.glsl"
226 #include
"l2-0__1.glsl"
230 #include
"l2-1__0.glsl"
234 #include
"l2-1__1.glsl"
238 #include
"l2-2__0.glsl"
242 #include
"l2-2__1.glsl"
246 #include
"l2-3__0.glsl"
250 #include
"l2-3__1.glsl"
255 #include
"l3__0.glsl"
259 #include
"l3__1.glsl"
263 #include
"l3__2.glsl"
267 #include
"l3__3.glsl"
271 #include
"l3__4.glsl"
275 #include
"l3__5.glsl"
280 #include
"l4-0__0.glsl"
284 #include
"l4-0__1.glsl"
288 #include
"l4-1__0.glsl"
292 #include
"l4-1__1.glsl"
301 #include
"ycbcr_demuxer.glsl"
307 for (
int i = 0; i <
L1_SIZE; ++i)
309 for (
int i = 0; i <
L2_SIZE; ++i)
311 for (
int i = 0; i <
L3_SIZE; ++i)
313 for (
int i = 0; i <
L4_SIZE; ++i)
Makes a bitmap writable for a specific target device.
A very basic class for any image.
Context & getContext() const
static const AffineMapping IDENTITY
Basic class: task and memory management, any kind of static data.
Layer(GL::RecycleBin &recycleBin, GraphicPipeline &gpu, Storage &outputStorage, const char *sourceCode)
InternalBitmap & getOutput()
void process(Context &ctx, GraphicPipeline &gpu, GL::TextureHandler &input)
GLES20X2UpsamplingNetwork(GL::RecycleBin &recycleBin, GraphicPipeline &gpu)
~GLES20X2UpsamplingNetwork()
void process(GraphicPipeline &gpu, GL::TextureHandler &input, AbstractBitmap &output)
InternalBitmap * storage[STORAGE_SIZE]
static const int STORAGE_SIZE
Layer::Storage & nextStorage(int &i)
Stores references to GPU resources that will not be used anymore and needed to be recycled in a threa...
virtual const int getHeight() const =0
Height of the texture in pixels.
virtual const int getWidth() const =0
Width of the texture in pixels.
void setInteger(std::string name, int value)
Sets a scalar integer uniform value.
Internal low-level GPU control API.
void switchMode(Mode mode)
Switches GPU mode.
@ INFERENCE
Textures are feature maps computed in fragment shaders.
void flush()
Waits until all operations submitted to GPU are finished.
void bind(GL::TextureHandler &texture, size_t texUnit, const TextureParam param)
void process(GraphicPipeline &gpu)
Apply the shader to produce an image.
void prepare(GraphicPipeline &gpu, GL::TextureHandler *input, const TextureParam texParam, AbstractBitmap *output, const AffineMapping &mapping)
Conducts required preparations for blending.
void setSourceCode(const std::string &sourceCode)
Passes new source code to the fragment shader.
Bitmap whose memory is managed by the Beatmup engine.
const int getHeight() const
Height of the texture in pixels.
const int getWidth() const
Width of the texture in pixels.
void reshape(int width, int height)
Changes bitmap size.
Collects running time statistics of multiple tracks.
void report(std::ostream &, ReportType type=ReportType::FULL) const
@ QuadByte
4 channels of 8 bits per pixel (like RGBA), unsigned integer values
@ INTERP_LINEAR
bilinear pixel interpolation
@ INTERP_NEAREST
nearest neighbor pixel interpolation