diff options
| author | Carl Hetherington <cth@carlh.net> | 2021-11-21 14:32:45 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2021-11-25 00:55:02 +0100 |
| commit | 72ee4688cbaef0832eb44dee78063bbc0df97bf8 (patch) | |
| tree | bcc4d4325961936366458f749fb14f145d98a6f9 /src/lib/j2k_encoder_fastvideo_backend.h | |
| parent | d930131bac027fb37af01c2326f5a76ebc23fef7 (diff) | |
Add fastvideo J2K encoding backend.
Diffstat (limited to 'src/lib/j2k_encoder_fastvideo_backend.h')
| -rw-r--r-- | src/lib/j2k_encoder_fastvideo_backend.h | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/src/lib/j2k_encoder_fastvideo_backend.h b/src/lib/j2k_encoder_fastvideo_backend.h new file mode 100644 index 000000000..0e5ccb3be --- /dev/null +++ b/src/lib/j2k_encoder_fastvideo_backend.h @@ -0,0 +1,63 @@ +/* + Copyright (C) 2021 Carl Hetherington <cth@carlh.net> + + This file is part of DCP-o-matic. + + DCP-o-matic is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + DCP-o-matic is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with DCP-o-matic. If not, see <http://www.gnu.org/licenses/>. + +*/ + + +#ifndef DCPOMATIC_J2K_ENCODER_FASTVIDEO_BACKEND_H +#define DCPOMATIC_J2K_ENCODER_FASTVIDEO_BACKEND_H + + +#include "j2k_encoder_backend.h" +#include <dcp/util.h> +#include <fastvideo_encoder_j2k.h> +#include <fastvideo_sdk.h> +#include <boost/thread.hpp> + + +class Barrier; + + +class J2KEncoderFastvideoBackend : public J2KEncoderBackend +{ +public: + J2KEncoderFastvideoBackend (Barrier& barrier); + ~J2KEncoderFastvideoBackend (); + + std::vector<dcp::ArrayData> encode (std::vector<DCPVideo> const& video) override; + + int quantity () const override { + return 1; + } + +private: + void setup (dcp::Size size); + + Barrier& _barrier; + bool _setup_done = false; + fastImportFromHostHandle_t _adapter; + fastDeviceSurfaceBufferHandle_t _src_buffer; + fastEncoderJ2kHandle_t _encoder; + uint16_t* _xyz_buffer; + int _xyz_buffer_stride; +}; + + +#endif + + |
