OpenJPH
Open-source implementation of JPEG2000 Part-15
Loading...
Searching...
No Matches
ojph_codeblock.h
Go to the documentation of this file.
1
2//***************************************************************************/
3// This software is released under the 2-Clause BSD license, included
4// below.
5//
6// Copyright (c) 2019, Aous Naman
7// Copyright (c) 2019, Kakadu Software Pty Ltd, Australia
8// Copyright (c) 2019, The University of New South Wales, Australia
9//
10// Redistribution and use in source and binary forms, with or without
11// modification, are permitted provided that the following conditions are
12// met:
13//
14// 1. Redistributions of source code must retain the above copyright
15// notice, this list of conditions and the following disclaimer.
16//
17// 2. Redistributions in binary form must reproduce the above copyright
18// notice, this list of conditions and the following disclaimer in the
19// documentation and/or other materials provided with the distribution.
20//
21// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
22// IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
23// TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
24// PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
25// HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
27// TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
28// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
29// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
30// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
31// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32//***************************************************************************/
33// This file is part of the OpenJPH software implementation.
34// File: ojph_codeblock.h
35// Author: Aous Naman
36// Date: 28 August 2019
37//***************************************************************************/
38
39
40#ifndef OJPH_CODEBLOCK_H
41#define OJPH_CODEBLOCK_H
42
43#include "ojph_defs.h"
44#include "ojph_file.h"
45#include "ojph_codeblock_fun.h"
46
47namespace ojph {
48
50 //defined elsewhere
51 class line_buf;
52 class mem_elastic_allocator;
53 class codestream;
54 struct coded_lists;
55
56 namespace local {
57
59 //defined here
60 struct precinct;
61 class subband;
62 struct coded_cb_header;
63
66 {
67 friend struct precinct;
68 enum : ui32 {
69 BUF32 = 4,
70 BUF64 = 8,
71 };
72
73 public:
74 static void pre_alloc(codestream *codestream, ui32 comp_num,
75 const size& nominal);
77 const size& nominal, const size& cb_size,
79 ui32 K_max, int tbx0);
80 void push(line_buf *line);
81 void encode(mem_elastic_allocator *elastic);
83
84 void decode();
85 void pull_line(line_buf *line);
86
87 private:
89 union {
92 };
105 bool zero_block; // true when the decoded block is all zero
106 union {
107 ui32 max_val32[8]; // supports up to 256 bits
108 ui64 max_val64[4]; // supports up to 256 bits
109 };
112 };
113
126
127 }
128}
129
130#endif // !OJPH_CODEBLOCK_H
coded_cb_header * coded_cb
void push(line_buf *line)
static void pre_alloc(codestream *codestream, ui32 comp_num, const size &nominal)
void encode(mem_elastic_allocator *elastic)
void recreate(const size &cb_size, coded_cb_header *coded_cb)
void finalize_alloc(codestream *codestream, subband *parent, const size &nominal, const size &cb_size, coded_cb_header *coded_cb, ui32 K_max, int tbx0)
codeblock_fun codeblock_functions
void pull_line(line_buf *line)
uint64_t ui64
Definition ojph_defs.h:56
uint32_t ui32
Definition ojph_defs.h:54