2,599
edits
Efernandez (talk | contribs) (→Format) |
Efernandez (talk | contribs) |
||
Line 67: | Line 67: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
With the gpu backend create an input and output buffers in GPU memory with the input video/image | With the gpu backend create an input and output buffers in GPU memory with the input video/image resolution and format. | ||
<syntaxhighlight lang=cpp> | <syntaxhighlight lang=cpp> | ||
std::shared_ptr<rd::io::IBuffer> input_gpu = backend->getBuffer(input_resolution, input_format); | std::shared_ptr<rd::io::IBuffer> input_gpu = backend->getBuffer(input_resolution, input_format); | ||
std::shared_ptr<rd::io::IBuffer> output = backend->getBuffer(input_resolution, input_format); | std::shared_ptr<rd::io::IBuffer> output = backend->getBuffer(input_resolution, input_format); | ||
</syntaxhighlight> | </syntaxhighlight> | ||
The CPU input buffer must be | The CPU input buffer must be moved to GPU memory when using GPU, to accomplish this, use the <code>copyFromHost</code> method to upload the input buffer to GPU memory. | ||
<syntaxhighlight lang=cpp> | <syntaxhighlight lang=cpp> |