RawSpeed
fast raw decoding library
Loading...
Searching...
No Matches
SamsungV2Decompressor.h
Go to the documentation of this file.
1/*
2 RawSpeed - RAW file decoder.
3
4 Copyright (C) 2017 Roman Lebedev
5
6 This library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Lesser General Public
8 License as published by the Free Software Foundation; either
9 version 2 of the License, or (at your option) any later version.
10
11 This library is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Lesser General Public License for more details.
15
16 You should have received a copy of the GNU Lesser General Public
17 License along with this library; if not, write to the Free Software
18 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19*/
20
21#pragma once
22
25#include "io/ByteStream.h"
26#include <array>
27#include <cstdint>
28
29namespace rawspeed {
30
31class RawImage;
32
33// Decoder for third generation compressed SRW files (NX1)
35public:
36 enum struct OptFlags : uint8_t;
37
38private:
40 int width;
41 int height;
44
46
47 int motion;
48 int scale;
49 std::array<std::array<int, 2>, 3> diffBitsMode;
50
51 static inline __attribute__((always_inline)) int16_t
52 getDiff(BitStreamerMSB32& pump, uint32_t len);
53
54 inline __attribute__((always_inline)) std::array<uint16_t, 16>
55 prepareBaselineValues(BitStreamerMSB32& pump, int row, int col);
56
57 inline __attribute__((always_inline)) std::array<uint32_t, 4>
58 decodeDiffLengths(BitStreamerMSB32& pump, int row);
59
60 inline __attribute__((always_inline)) std::array<int, 16>
61 decodeDifferences(BitStreamerMSB32& pump, int row);
62
63 inline __attribute__((always_inline)) void
64 processBlock(BitStreamerMSB32& pump, int row, int col);
65
66 void decompressRow(int row);
67
68public:
69 SamsungV2Decompressor(const RawImage& image, ByteStream bs, unsigned bit);
70
71 void decompress();
72};
73
74} // namespace rawspeed
__attribute__((always_inline)) std __attribute__((always_inline)) std __attribute__((always_inline)) std __attribute__((always_inline)) void processBlock(BitStreamerMSB32 &pump
__attribute__((always_inline)) std __attribute__((always_inline)) std __attribute__((always_inline)) std int int col
static __attribute__((always_inline)) int16_t getDiff(BitStreamerMSB32 &pump
std::array< std::array< int, 2 >, 3 > diffBitsMode
__attribute__((always_inline)) std __attribute__((always_inline)) std __attribute__((always_inline)) std int row
SamsungV2Decompressor(const RawImage &image, ByteStream bs, unsigned bit)