RawSpeed
fast raw decoding library
Loading...
Searching...
No Matches
CrwDecompressor.h
Go to the documentation of this file.
1/*
2 RawSpeed - RAW file decoder.
3
4 Copyright (C) 2009-2014 Klaus Post
5 Copyright (C) 2014 Pedro CĂ´rte-Real
6 Copyright (C) 2018 Roman Lebedev
7
8 This library is free software; you can redistribute it and/or
9 modify it under the terms of the GNU Lesser General Public
10 License as published by the Free Software Foundation; either
11 version 2 of the License, or (at your option) any later version.
12
13 This library is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 Lesser General Public License for more details.
17
18 You should have received a copy of the GNU Lesser General Public
19 License along with this library; if not, write to the Free Software
20 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21*/
22
23#pragma once
24
25#include "adt/Array1DRef.h"
26#include "adt/Optional.h"
29#include "common/RawImage.h"
31#include <array>
32#include <cstdint>
33
34namespace rawspeed {
35
37 using crw_hts = std::array<PrefixCodeDecoder<>, 2>;
38
41
44
45public:
46 CrwDecompressor(RawImage img, uint32_t dec_table_,
49
50 void decompress();
51
52private:
53 static PrefixCodeDecoder<> makeDecoder(const uint8_t* ncpl,
54 const uint8_t* values);
55 static crw_hts initHuffTables(uint32_t table);
56
57 inline static void decodeBlock(std::array<int16_t, 64>* diffBuf,
58 const crw_hts& mHuff, BitStreamerJPEG& bs);
59};
60
61} // namespace rawspeed
std::array< PrefixCodeDecoder<>, 2 > crw_hts
CrwDecompressor(RawImage img, uint32_t dec_table_, Array1DRef< const uint8_t > input, Optional< Array1DRef< const uint8_t > > lowbitInput)
static void decodeBlock(std::array< int16_t, 64 > *diffBuf, const crw_hts &mHuff, BitStreamerJPEG &bs)
static crw_hts initHuffTables(uint32_t table)
Array1DRef< const uint8_t > input
static PrefixCodeDecoder makeDecoder(const uint8_t *ncpl, const uint8_t *values)
Optional< Array1DRef< const uint8_t > > lowbitInput
PrefixCodeLUTDecoder< CodeTag, PrefixCodeLookupDecoder< CodeTag > > PrefixCodeDecoder