69 const int N_COMP = bs.
getI32();
70 const int X_S_F = bs.
getI32();
71 const int Y_S_F = bs.
getI32();
72 const std::tuple<
int ,
int ,
int > format = {
73 N_COMP, X_S_F, Y_S_F};
75 const int frame_w = bs.
getI32();
76 const int frame_h = bs.
getI32();
80 const auto numSlices = bs.
get<slice_type>();
81 const auto sliceWidth = bs.
get<slice_type>();
82 const auto lastSliceWidth = bs.
get<slice_type>();
87 const unsigned num_recips = bs.
getU32();
89 const unsigned num_unique_hts = bs.
getU32();
90 std::vector<rawspeed::PrefixCodeDecoderImpl<>> uniqueHts;
91 std::generate_n(std::back_inserter(uniqueHts), num_unique_hts, [&bs]() {
95 std::vector<const rawspeed::PrefixCodeDecoderImpl<>*> hts;
96 std::generate_n(std::back_inserter(hts), num_recips, [&bs, &uniqueHts]() {
97 if (
unsigned uniq_ht_idx = bs.
getU32(); uniq_ht_idx < uniqueHts.size())
98 return &uniqueHts[uniq_ht_idx];
99 ThrowRSE(
"Unknown unique huffman table");
103 std::vector<uint16_t> initPred;
104 initPred.reserve(num_recips);
105 std::generate_n(std::back_inserter(initPred), num_recips,
109 rawspeed::PrefixCodeDecoderImpl<>>::PerComponentRecipe>
111 rec.reserve(num_recips);
113 std::back_inserter(rec), num_recips,
114 [&rec, hts, initPred]()
116 rawspeed::PrefixCodeDecoderImpl<>>::PerComponentRecipe {
118 return {*hts[i], initPred[i]};
122 mRaw, format, frame, slicing, rec,
125 (void)d.decompress();