Project
Loading...
Searching...
No Matches
Codecs.h
Go to the documentation of this file.
1// Copyright 2019-2026 CERN and copyright holders of ALICE O2.
2// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3// All rights not expressly granted are reserved.
4//
5// This software is distributed under the terms of the GNU General Public
6// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7//
8// In applying this license CERN does not waive the privileges and immunities
9// granted to it by virtue of its status as an Intergovernmental Organization
10// or submit itself to any jurisdiction.
11
12#ifndef O2_FRAMEWORK_AODNATIVE_CODECS_H_
13#define O2_FRAMEWORK_AODNATIVE_CODECS_H_
14
15#include <cstddef>
16#include <cstdint>
17#include <memory>
18#include <span>
19#include <string>
20#include <vector>
21
22namespace o2::aod::native
23{
24
31{
32 public:
33 PayloadDecompressor(std::span<const uint8_t> src, uint32_t objLen, std::string const& file, uint64_t fileOffset);
37
40 void read(uint8_t* dst, size_t n);
44 void readPrefix(uint8_t* dst, size_t n);
46 size_t produced() const { return mProduced; }
47
48 private:
49 struct Codec;
50 void nextChunk();
51 size_t produceFromChunk(uint8_t* dst, size_t n);
52 size_t zstdPrefix(uint8_t* dst, size_t n);
53
54 std::span<const uint8_t> mSrc;
55 uint32_t mObjLen;
56 std::string const& mFile;
57 uint64_t mFileOffset;
58 size_t mSrcPos = 0;
59 size_t mProduced = 0;
60 // Current chunk
61 char mTag[2] = {0, 0};
62 std::span<const uint8_t> mChunkIn;
63 size_t mChunkOut = 0; // uncompressed size of the current chunk
64 size_t mChunkDone = 0; // produced from the current chunk
65 std::unique_ptr<Codec> mCodec;
66 std::vector<uint8_t> mScratch; // LZ4 chunk decoded ahead of a partial read, or the last zstd blocks of a prefix
67 bool mPrefixOnly = false;
68};
69
72size_t decompressBounded(std::span<const uint8_t> src, uint32_t objLen, uint8_t* dst, size_t maxOut,
73 std::string const& file = "<memory>", uint64_t fileOffset = 0);
74
76uint64_t xxh64(std::span<const uint8_t> data);
77
78} // namespace o2::aod::native
79
80#endif // O2_FRAMEWORK_AODNATIVE_CODECS_H_
configStandalone Light OpenGL display display_light Apply smoothing to points Enable Z buffer Highlight links Highlight seeds Highlight sector tracks Highlight final tracks Show individual Show related Highlight grid Show only individual collision Color clusters belonging to track objects Set line Enable drawing TPC data Enable drawing TOF data Enable drawing magnetic field Set field line step count Invert colors configStandalone Heavy OpenGL display display_heavy Show tracks with ITS contribution Show tracks with TOF contribution Enable propagation of loopers Show clusters at nominal x of pad row for early transformed data Split CE tracks when they cross the central Mark clusters Mark adjacent clusters Hide rejected tracks Apply filter on tracks to be displayed Separate increase X h configStandalone Camera window renderer OpenGL display display_camera Orient the camera such that the y axis is always upwards Full Screen MultiSample Anti Downsampling Anti Enable Vertical Sync Target frame or if the backend cannot limit to the refresh Use OpenGL indirect draws to reduce number of draw calls Display h configStandalone Vulkan display display_vulkan Have uniform buffers in host accessible device memory h configStandalone Internal display display_internal Number of updates the Qt GUI may send ahead of the last one the display has before it waits for the display Opacity of the console background Number of console lines the history is shortened to this when it reaches twice the size Time in seconds an info message fades out after setInfoTime h OpenGL display display Font size Do not use Freetype for font Renderer for event Frontend to use for event ROOT macros used as track filter Console script file
Timeframe settings Average distance in cm of events merged into Randomize distance around average distance of merged events Simulate correct bunch interactions instead of placing only the average number of events A value[n] sets TFlen for[n] collisions in Number of bunches per trainsort Number of bunch trains Instantaneous interaction rate Do not simulate border Total number of collisions to be placed in the interior of all time Do not select random but walk over array of events in stride steps h Event generator settings h configStandalone Use CPU for GPU Force usage of the specified GPU device no CPU fallback Continue processing after an error First event to Number of events to Number of iterations to Number of iterations to Number of initial iterations excluded from const char Directory with events to Events directory is and not inside events Show standalone event Run event generator maximum time bin of continuous for triggered for automatic continuous for automatic continuous triggered uint64_t
PayloadDecompressor(PayloadDecompressor const &)=delete
PayloadDecompressor & operator=(PayloadDecompressor const &)=delete
size_t produced() const
Bytes produced so far.
Definition Codecs.h:46
void read(uint8_t *dst, size_t n)
Definition Codecs.cxx:289
void readPrefix(uint8_t *dst, size_t n)
Definition Codecs.cxx:280
GLdouble n
Definition glcorearb.h:1982
GLenum GLenum dst
Definition glcorearb.h:1767
size_t decompressBounded(std::span< const uint8_t > src, uint32_t objLen, uint8_t *dst, size_t maxOut, std::string const &file="<memory>", uint64_t fileOffset=0)
Definition Codecs.cxx:310
uint64_t xxh64(std::span< const uint8_t > data)
XXH64 with seed 0, as used for the LZ4 chunk checksum.
Definition Codecs.cxx:319