Grok  7.6.0
PacketIter.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2016-2020 Grok Image Compression Inc.
3  *
4  * This source code is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU Affero General Public License, version 3,
6  * as published by the Free Software Foundation.
7  *
8  * This source code is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU Affero General Public License for more details.
12  *
13  * You should have received a copy of the GNU Affero General Public License
14  * along with this program. If not, see <http://www.gnu.org/licenses/>.
15  *
16  *
17  * This source code incorporates work covered by the BSD 2-clause license.
18  * Please see the LICENSE file in the root directory for details.
19  *
20  */
21 
22 #pragma once
23 namespace grk {
24 
36 
42  FINAL_PASS = 1
43 };
44 
45 
46 /***
47  * Packet iterator resolution
48  */
50  uint32_t pdx, pdy;
51  uint32_t pw, ph;
52 };
53 
57 struct grk_pi_comp {
58  uint32_t dx, dy;
60  uint32_t numresolutions;
62 };
63 
67 struct PacketIter {
69  bool tp_on;
71  bool *include;
73  uint64_t step_l;
75  uint64_t step_r;
77  uint64_t step_c;
79  uint32_t step_p;
81  uint32_t compno;
83  uint32_t resno;
85  uint64_t precno;
87  uint32_t layno;
89  bool first;
93  uint32_t numcomps;
97  uint32_t tx0, ty0, tx1, ty1;
99  uint32_t x, y;
101  uint32_t dx, dy;
102 };
103 
106 /* ----------------------------------------------------------------------- */
118  uint16_t tileno, J2K_T2_MODE t2_mode);
119 
128  uint16_t tile_no);
129 
140 void pi_init_encode(PacketIter *pi, CodingParams *cp, uint16_t tileno, uint32_t pino,
141  uint32_t tpnum, uint32_t tppos, J2K_T2_MODE t2_mode);
142 
151 PacketIter* pi_create_decode(grk_image *image, CodingParams *cp, uint16_t tileno);
158 void pi_destroy(PacketIter *p_pi, uint32_t nb_elements);
159 
165 bool pi_next(PacketIter *pi);
166 /* ----------------------------------------------------------------------- */
170 
171 }
grk::pi_next
bool pi_next(PacketIter *pi)
Modify the packet iterator to point to the next packet.
grk::PacketIter::tx1
uint32_t tx1
Definition: PacketIter.h:97
grk::PacketIter::step_c
uint64_t step_c
component step used to localize the packet in the include vector
Definition: PacketIter.h:77
grk::grk_pi_resolution::ph
uint32_t ph
Definition: PacketIter.h:53
grk::PacketIter::layno
uint32_t layno
layer that identify the packet
Definition: PacketIter.h:87
_grk_poc
Progression order changes.
Definition: grok.h:369
grk::PacketIter::step_p
uint32_t step_p
precinct step used to localize the packet in the include vector
Definition: PacketIter.h:79
grk::FINAL_PASS
@ FINAL_PASS
Function called in Rate allocation process.
Definition: PacketIter.h:42
grk::grk_pi_comp::numresolutions
uint32_t numresolutions
number of resolution levels
Definition: PacketIter.h:60
grk::PacketIter::ty0
uint32_t ty0
Definition: PacketIter.h:97
grk::PacketIter::comps
grk_pi_comp * comps
Components.
Definition: PacketIter.h:95
grk::grk_pi_resolution::pdx
uint32_t pdx
Definition: PacketIter.h:52
grk::grk_pi_resolution::pdy
uint32_t pdy
Definition: PacketIter.h:52
grk::grk_pi_comp::dx
uint32_t dx
Definition: PacketIter.h:58
grk::grk_pi_resolution::pw
uint32_t pw
Definition: PacketIter.h:53
grk::PacketIter::include
bool * include
specify if the packet has already been included in a previous layer
Definition: PacketIter.h:71
grk::grk_pi_comp::dy
uint32_t dy
Definition: PacketIter.h:58
grk::pi_create_decode
PacketIter * pi_create_decode(grk_image *image, CodingParams *cp, uint16_t tileno)
Create a packet iterator for Decoder.
grk::PacketIter
Packet iterator.
Definition: PacketIter.h:67
grk::PacketIter::resno
uint32_t resno
resolution that identify the packet
Definition: PacketIter.h:83
grk::PacketIter::tx0
uint32_t tx0
tile coordinates
Definition: PacketIter.h:97
grk::THRESH_CALC
@ THRESH_CALC
Definition: PacketIter.h:41
grk::J2K_T2_MODE
J2K_T2_MODE
T2 encoding mode.
Definition: PacketIter.h:40
grk::CodingParams
Coding parameters.
Definition: CodingParams.h:230
grk::PacketIter::tp_on
bool tp_on
Enabling Tile part generation.
Definition: PacketIter.h:69
grk::grk_pi_comp::resolutions
grk_pi_resolution * resolutions
Definition: PacketIter.h:61
grk::PacketIter::y
uint32_t y
Definition: PacketIter.h:99
grk
Copyright (C) 2016-2020 Grok Image Compression Inc.
Definition: BitIO.h:27
grk::PacketIter::step_r
uint64_t step_r
resolution step used to localize the packet in the include vector
Definition: PacketIter.h:75
grk::PacketIter::ty1
uint32_t ty1
Definition: PacketIter.h:97
grk::pi_initialise_encode
PacketIter * pi_initialise_encode(const grk_image *image, CodingParams *cp, uint16_t tileno, J2K_T2_MODE t2_mode)
Creates a packet iterator for encoding.
grk::pi_destroy
void pi_destroy(PacketIter *p_pi, uint32_t nb_elements)
Destroys a packet iterator array.
grk::PacketIter::numcomps
uint32_t numcomps
number of components in the image
Definition: PacketIter.h:93
grk::PacketIter::step_l
uint64_t step_l
layer step used to localize the packet in the include vector
Definition: PacketIter.h:73
grk::pi_init_encode
void pi_init_encode(PacketIter *pi, CodingParams *cp, uint16_t tileno, uint32_t pino, uint32_t tpnum, uint32_t tppos, J2K_T2_MODE t2_mode)
Modify the packet iterator for enabling tile part generation.
grk::PacketIter::precno
uint64_t precno
precinct that identify the packet
Definition: PacketIter.h:85
grk::pi_update_encoding_parameters
void pi_update_encoding_parameters(const grk_image *p_image, CodingParams *p_cp, uint16_t tile_no)
Updates the encoding parameters of the codec.
grk::PacketIter::dy
uint32_t dy
Definition: PacketIter.h:101
grk::PacketIter::x
uint32_t x
packet coordinates
Definition: PacketIter.h:99
grk::PacketIter::dx
uint32_t dx
packet subsampling factors
Definition: PacketIter.h:101
grk::grk_pi_comp
Packet iterator component.
Definition: PacketIter.h:57
grk::PacketIter::first
bool first
0 if the first packet
Definition: PacketIter.h:89
_grk_image
Image.
Definition: grok.h:880
grk::PacketIter::compno
uint32_t compno
component that identify the packet
Definition: PacketIter.h:81
grk::PacketIter::poc
grk_poc poc
progression order change information
Definition: PacketIter.h:91
grk::grk_pi_resolution
Definition: PacketIter.h:49