/src/jasper/src/libjasper/jpc/jpc_t1cod.h
Line | Count | Source |
1 | | /* |
2 | | * Copyright (c) 1999-2000 Image Power, Inc. and the University of |
3 | | * British Columbia. |
4 | | * Copyright (c) 2001-2002 Michael David Adams. |
5 | | * All rights reserved. |
6 | | */ |
7 | | |
8 | | /* __START_OF_JASPER_LICENSE__ |
9 | | * |
10 | | * JasPer License Version 2.0 |
11 | | * |
12 | | * Copyright (c) 2001-2006 Michael David Adams |
13 | | * Copyright (c) 1999-2000 Image Power, Inc. |
14 | | * Copyright (c) 1999-2000 The University of British Columbia |
15 | | * |
16 | | * All rights reserved. |
17 | | * |
18 | | * Permission is hereby granted, free of charge, to any person (the |
19 | | * "User") obtaining a copy of this software and associated documentation |
20 | | * files (the "Software"), to deal in the Software without restriction, |
21 | | * including without limitation the rights to use, copy, modify, merge, |
22 | | * publish, distribute, and/or sell copies of the Software, and to permit |
23 | | * persons to whom the Software is furnished to do so, subject to the |
24 | | * following conditions: |
25 | | * |
26 | | * 1. The above copyright notices and this permission notice (which |
27 | | * includes the disclaimer below) shall be included in all copies or |
28 | | * substantial portions of the Software. |
29 | | * |
30 | | * 2. The name of a copyright holder shall not be used to endorse or |
31 | | * promote products derived from the Software without specific prior |
32 | | * written permission. |
33 | | * |
34 | | * THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS |
35 | | * LICENSE. NO USE OF THE SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER |
36 | | * THIS DISCLAIMER. THE SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS |
37 | | * "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING |
38 | | * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A |
39 | | * PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN NO |
40 | | * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL |
41 | | * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING |
42 | | * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, |
43 | | * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION |
44 | | * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. NO ASSURANCES ARE |
45 | | * PROVIDED BY THE COPYRIGHT HOLDERS THAT THE SOFTWARE DOES NOT INFRINGE |
46 | | * THE PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OF ANY OTHER ENTITY. |
47 | | * EACH COPYRIGHT HOLDER DISCLAIMS ANY LIABILITY TO THE USER FOR CLAIMS |
48 | | * BROUGHT BY ANY OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL |
49 | | * PROPERTY RIGHTS OR OTHERWISE. AS A CONDITION TO EXERCISING THE RIGHTS |
50 | | * GRANTED HEREUNDER, EACH USER HEREBY ASSUMES SOLE RESPONSIBILITY TO SECURE |
51 | | * ANY OTHER INTELLECTUAL PROPERTY RIGHTS NEEDED, IF ANY. THE SOFTWARE |
52 | | * IS NOT FAULT-TOLERANT AND IS NOT INTENDED FOR USE IN MISSION-CRITICAL |
53 | | * SYSTEMS, SUCH AS THOSE USED IN THE OPERATION OF NUCLEAR FACILITIES, |
54 | | * AIRCRAFT NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL |
55 | | * SYSTEMS, DIRECT LIFE SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH |
56 | | * THE FAILURE OF THE SOFTWARE OR SYSTEM COULD LEAD DIRECTLY TO DEATH, |
57 | | * PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH |
58 | | * RISK ACTIVITIES"). THE COPYRIGHT HOLDERS SPECIFICALLY DISCLAIM ANY |
59 | | * EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES. |
60 | | * |
61 | | * __END_OF_JASPER_LICENSE__ |
62 | | */ |
63 | | |
64 | | /* |
65 | | * $Id$ |
66 | | */ |
67 | | |
68 | | #ifndef JPC_T1COD_H |
69 | | #define JPC_T1COD_H |
70 | | |
71 | | /******************************************************************************\ |
72 | | * Includes. |
73 | | \******************************************************************************/ |
74 | | |
75 | | #include "jpc_fix.h" |
76 | | #include "jpc_mqcod.h" |
77 | | #include "jpc_tsfb.h" |
78 | | #include "jasper/jas_math.h" |
79 | | |
80 | | /******************************************************************************\ |
81 | | * Constants. |
82 | | \******************************************************************************/ |
83 | | |
84 | | /* The number of bits used to index into various lookup tables. */ |
85 | 3.25G | #define JPC_NMSEDEC_BITS 7 |
86 | 3.25G | #define JPC_NMSEDEC_FRACBITS (JPC_NMSEDEC_BITS - 1) |
87 | | |
88 | | /* |
89 | | * Segment types. |
90 | | */ |
91 | | |
92 | | enum jpc_segtype { |
93 | | /** Invalid. */ |
94 | | JPC_SEG_INVALID, |
95 | | |
96 | | /* MQ. */ |
97 | | JPC_SEG_MQ, |
98 | | |
99 | | /* Raw. */ |
100 | | JPC_SEG_RAW, |
101 | | }; |
102 | | |
103 | | /* The nominal word size. */ |
104 | | #define JPC_PREC 32 |
105 | | |
106 | | /* Tier-1 coding pass types. */ |
107 | | enum jpc_passtype { |
108 | | JPC_SIGPASS, /*< significance */ |
109 | | JPC_REFPASS, /*< refinement */ |
110 | | JPC_CLNPASS, /*< cleanup */ |
111 | | }; |
112 | | |
113 | | /* |
114 | | * Per-sample state information for tier-1 coding. |
115 | | */ |
116 | | |
117 | | /* The northeast neighbour has been found to be significant. */ |
118 | 8.47G | #define JPC_NESIG 0x0001 |
119 | | /* The southeast neighbour has been found to be significant. */ |
120 | 8.45G | #define JPC_SESIG 0x0002 |
121 | | /* The southwest neighbour has been found to be significant. */ |
122 | 8.45G | #define JPC_SWSIG 0x0004 |
123 | | /* The northwest neighbour has been found to be significant. */ |
124 | 8.47G | #define JPC_NWSIG 0x0008 |
125 | | /* The north neighbour has been found to be significant. */ |
126 | 9.05G | #define JPC_NSIG 0x0010 |
127 | | /* The east neighbour has been found to be significant. */ |
128 | 9.05G | #define JPC_ESIG 0x0020 |
129 | | /* The south neighbour has been found to be significant. */ |
130 | 9.04G | #define JPC_SSIG 0x0040 |
131 | | /* The west neighbour has been found to be significant. */ |
132 | 9.05G | #define JPC_WSIG 0x0080 |
133 | | /* The significance mask for 8-connected neighbours. */ |
134 | | #define JPC_OTHSIGMSK \ |
135 | 8.17G | (JPC_NSIG | JPC_NESIG | JPC_ESIG | JPC_SESIG | JPC_SSIG | JPC_SWSIG | JPC_WSIG | JPC_NWSIG) |
136 | | /* The significance mask for 4-connected neighbours. */ |
137 | 585M | #define JPC_PRIMSIGMSK (JPC_NSIG | JPC_ESIG | JPC_SSIG | JPC_WSIG) |
138 | | |
139 | | /* The north neighbour is negative in value. */ |
140 | 731M | #define JPC_NSGN 0x0100 |
141 | | /* The east neighbour is negative in value. */ |
142 | 731M | #define JPC_ESGN 0x0200 |
143 | | /* The south neighbour is negative in value. */ |
144 | 724M | #define JPC_SSGN 0x0400 |
145 | | /* The west neighbour is negative in value. */ |
146 | 731M | #define JPC_WSGN 0x0800 |
147 | | /* The sign mask for 4-connected neighbours. */ |
148 | 585M | #define JPC_SGNMSK (JPC_NSGN | JPC_ESGN | JPC_SSGN | JPC_WSGN) |
149 | | |
150 | | /* This sample has been found to be significant. */ |
151 | 13.5G | #define JPC_SIG 0x1000 |
152 | | /* The sample has been refined. */ |
153 | 2.13G | #define JPC_REFINE 0x2000 |
154 | | /* This sample has been processed during the significance pass. */ |
155 | 12.3G | #define JPC_VISIT 0x4000 |
156 | | |
157 | | /* The number of aggregation contexts. */ |
158 | 10.7M | #define JPC_NUMAGGCTXS 1 |
159 | | /* The number of zero coding contexts. */ |
160 | 10.7M | #define JPC_NUMZCCTXS 9 |
161 | | /* The number of magnitude contexts. */ |
162 | 10.7M | #define JPC_NUMMAGCTXS 3 |
163 | | /* The number of sign coding contexts. */ |
164 | 10.7M | #define JPC_NUMSCCTXS 5 |
165 | | /* The number of uniform contexts. */ |
166 | 1.22M | #define JPC_NUMUCTXS 1 |
167 | | |
168 | | /* The context ID for the first aggregation context. */ |
169 | 537M | #define JPC_AGGCTXNO 0 |
170 | | /* The context ID for the first zero coding context. */ |
171 | 10.7M | #define JPC_ZCCTXNO (JPC_AGGCTXNO + JPC_NUMAGGCTXS) |
172 | | /* The context ID for the first magnitude context. */ |
173 | 10.7M | #define JPC_MAGCTXNO (JPC_ZCCTXNO + JPC_NUMZCCTXS) |
174 | | /* The context ID for the first sign coding context. */ |
175 | 10.7M | #define JPC_SCCTXNO (JPC_MAGCTXNO + JPC_NUMMAGCTXS) |
176 | | /* The context ID for the first uniform context. */ |
177 | 10.7M | #define JPC_UCTXNO (JPC_SCCTXNO + JPC_NUMSCCTXS) |
178 | | /* The total number of contexts. */ |
179 | 1.22M | #define JPC_NUMCTXS (JPC_UCTXNO + JPC_NUMUCTXS) |
180 | | |
181 | | /******************************************************************************\ |
182 | | * External data. |
183 | | \******************************************************************************/ |
184 | | |
185 | | /* These lookup tables are used by various macros/functions. */ |
186 | | /* Do not access these lookup tables directly. */ |
187 | | extern uint_least8_t jpc_zcctxnolut[]; |
188 | | extern bool jpc_spblut[]; |
189 | | extern uint_least8_t jpc_scctxnolut[]; |
190 | | extern uint_least8_t jpc_magctxnolut[]; |
191 | | extern jpc_fix_t jpc_refnmsedec[]; |
192 | | extern jpc_fix_t jpc_signmsedec[]; |
193 | | extern jpc_fix_t jpc_refnmsedec0[]; |
194 | | extern jpc_fix_t jpc_signmsedec0[]; |
195 | | |
196 | | /* The initial settings for the MQ contexts. */ |
197 | | extern jpc_mqctx_t jpc_mqctxs[]; |
198 | | |
199 | | /******************************************************************************\ |
200 | | * Functions and macros. |
201 | | \******************************************************************************/ |
202 | | |
203 | | /* Arithmetic shift right (with ability to shift left also). */ |
204 | | JAS_ATTRIBUTE_CONST |
205 | | static inline jpc_fix_t JPC_ASR(jpc_fix_t x, int n) |
206 | 1.08G | { |
207 | 1.08G | return n >= 0 |
208 | 1.08G | ? x >> n |
209 | 1.08G | : x << -n; |
210 | 1.08G | } Unexecuted instantiation: jpc_dec.c:JPC_ASR Unexecuted instantiation: jpc_enc.c:JPC_ASR Unexecuted instantiation: jpc_t1cod.c:JPC_ASR Unexecuted instantiation: jpc_t1dec.c:JPC_ASR Line | Count | Source | 206 | 1.08G | { | 207 | 1.08G | return n >= 0 | 208 | 1.08G | ? x >> n | 209 | 1.08G | : x << -n; | 210 | 1.08G | } |
Unexecuted instantiation: jpc_t2dec.c:JPC_ASR Unexecuted instantiation: jpc_t2enc.c:JPC_ASR Unexecuted instantiation: jpc_cod.c:JPC_ASR |
211 | | |
212 | | /* Get the zero coding context. */ |
213 | | JAS_ATTRIBUTE_CONST |
214 | | static inline uint_least8_t JPC_GETZCCTXNO(unsigned f, enum jpc_tsfb_orient orient) |
215 | 977M | { |
216 | 977M | return jpc_zcctxnolut[((unsigned)orient << 8) | (f & JPC_OTHSIGMSK)]; |
217 | 977M | } Unexecuted instantiation: jpc_dec.c:JPC_GETZCCTXNO Unexecuted instantiation: jpc_enc.c:JPC_GETZCCTXNO Unexecuted instantiation: jpc_t1cod.c:JPC_GETZCCTXNO jpc_t1dec.c:JPC_GETZCCTXNO Line | Count | Source | 215 | 314M | { | 216 | 314M | return jpc_zcctxnolut[((unsigned)orient << 8) | (f & JPC_OTHSIGMSK)]; | 217 | 314M | } |
jpc_t1enc.c:JPC_GETZCCTXNO Line | Count | Source | 215 | 663M | { | 216 | 663M | return jpc_zcctxnolut[((unsigned)orient << 8) | (f & JPC_OTHSIGMSK)]; | 217 | 663M | } |
Unexecuted instantiation: jpc_t2dec.c:JPC_GETZCCTXNO Unexecuted instantiation: jpc_t2enc.c:JPC_GETZCCTXNO Unexecuted instantiation: jpc_cod.c:JPC_GETZCCTXNO |
218 | | |
219 | | /* Get the sign prediction bit. */ |
220 | | JAS_ATTRIBUTE_CONST |
221 | | static inline bool JPC_GETSPB(unsigned f) |
222 | 292M | { |
223 | 292M | return jpc_spblut[(f & (JPC_PRIMSIGMSK | JPC_SGNMSK)) >> 4]; |
224 | 292M | } Unexecuted instantiation: jpc_dec.c:JPC_GETSPB Unexecuted instantiation: jpc_enc.c:JPC_GETSPB Unexecuted instantiation: jpc_t1cod.c:JPC_GETSPB Line | Count | Source | 222 | 128M | { | 223 | 128M | return jpc_spblut[(f & (JPC_PRIMSIGMSK | JPC_SGNMSK)) >> 4]; | 224 | 128M | } |
Line | Count | Source | 222 | 164M | { | 223 | 164M | return jpc_spblut[(f & (JPC_PRIMSIGMSK | JPC_SGNMSK)) >> 4]; | 224 | 164M | } |
Unexecuted instantiation: jpc_t2dec.c:JPC_GETSPB Unexecuted instantiation: jpc_t2enc.c:JPC_GETSPB Unexecuted instantiation: jpc_cod.c:JPC_GETSPB |
225 | | |
226 | | /* Get the sign coding context. */ |
227 | | JAS_ATTRIBUTE_CONST |
228 | | static inline uint_least8_t JPC_GETSCCTXNO(unsigned f) |
229 | 292M | { |
230 | 292M | return jpc_scctxnolut[(f & (JPC_PRIMSIGMSK | JPC_SGNMSK)) >> 4]; |
231 | 292M | } Unexecuted instantiation: jpc_dec.c:JPC_GETSCCTXNO Unexecuted instantiation: jpc_enc.c:JPC_GETSCCTXNO Unexecuted instantiation: jpc_t1cod.c:JPC_GETSCCTXNO jpc_t1dec.c:JPC_GETSCCTXNO Line | Count | Source | 229 | 128M | { | 230 | 128M | return jpc_scctxnolut[(f & (JPC_PRIMSIGMSK | JPC_SGNMSK)) >> 4]; | 231 | 128M | } |
jpc_t1enc.c:JPC_GETSCCTXNO Line | Count | Source | 229 | 164M | { | 230 | 164M | return jpc_scctxnolut[(f & (JPC_PRIMSIGMSK | JPC_SGNMSK)) >> 4]; | 231 | 164M | } |
Unexecuted instantiation: jpc_t2dec.c:JPC_GETSCCTXNO Unexecuted instantiation: jpc_t2enc.c:JPC_GETSCCTXNO Unexecuted instantiation: jpc_cod.c:JPC_GETSCCTXNO |
232 | | |
233 | | /* Get the magnitude context. */ |
234 | | JAS_ATTRIBUTE_CONST |
235 | | static inline uint_least8_t JPC_GETMAGCTXNO(unsigned f) |
236 | 1.02G | { |
237 | 1.02G | return jpc_magctxnolut[(f & JPC_OTHSIGMSK) | (((f & JPC_REFINE) != 0) << 11)]; |
238 | 1.02G | } Unexecuted instantiation: jpc_dec.c:JPC_GETMAGCTXNO Unexecuted instantiation: jpc_enc.c:JPC_GETMAGCTXNO Unexecuted instantiation: jpc_t1cod.c:JPC_GETMAGCTXNO jpc_t1dec.c:JPC_GETMAGCTXNO Line | Count | Source | 236 | 111M | { | 237 | 111M | return jpc_magctxnolut[(f & JPC_OTHSIGMSK) | (((f & JPC_REFINE) != 0) << 11)]; | 238 | 111M | } |
jpc_t1enc.c:JPC_GETMAGCTXNO Line | Count | Source | 236 | 918M | { | 237 | 918M | return jpc_magctxnolut[(f & JPC_OTHSIGMSK) | (((f & JPC_REFINE) != 0) << 11)]; | 238 | 918M | } |
Unexecuted instantiation: jpc_t2dec.c:JPC_GETMAGCTXNO Unexecuted instantiation: jpc_t2enc.c:JPC_GETMAGCTXNO Unexecuted instantiation: jpc_cod.c:JPC_GETMAGCTXNO |
239 | | |
240 | | /* Get the normalized MSE reduction for significance passes. */ |
241 | | JAS_ATTRIBUTE_CONST |
242 | | static inline jpc_fix_t JPC_GETSIGNMSEDEC(jpc_fix_t x, int bitpos) |
243 | 164M | { |
244 | 164M | return bitpos > JPC_NMSEDEC_FRACBITS |
245 | 164M | ? jpc_signmsedec[JPC_ASR(x, bitpos - JPC_NMSEDEC_FRACBITS) & JAS_ONES(JPC_NMSEDEC_BITS)] |
246 | 164M | : jpc_signmsedec0[JPC_ASR(x, bitpos - JPC_NMSEDEC_FRACBITS) & JAS_ONES(JPC_NMSEDEC_BITS)]; |
247 | 164M | } Unexecuted instantiation: jpc_dec.c:JPC_GETSIGNMSEDEC Unexecuted instantiation: jpc_enc.c:JPC_GETSIGNMSEDEC Unexecuted instantiation: jpc_t1cod.c:JPC_GETSIGNMSEDEC Unexecuted instantiation: jpc_t1dec.c:JPC_GETSIGNMSEDEC jpc_t1enc.c:JPC_GETSIGNMSEDEC Line | Count | Source | 243 | 164M | { | 244 | 164M | return bitpos > JPC_NMSEDEC_FRACBITS | 245 | 164M | ? jpc_signmsedec[JPC_ASR(x, bitpos - JPC_NMSEDEC_FRACBITS) & JAS_ONES(JPC_NMSEDEC_BITS)] | 246 | 164M | : jpc_signmsedec0[JPC_ASR(x, bitpos - JPC_NMSEDEC_FRACBITS) & JAS_ONES(JPC_NMSEDEC_BITS)]; | 247 | 164M | } |
Unexecuted instantiation: jpc_t2dec.c:JPC_GETSIGNMSEDEC Unexecuted instantiation: jpc_t2enc.c:JPC_GETSIGNMSEDEC Unexecuted instantiation: jpc_cod.c:JPC_GETSIGNMSEDEC |
248 | | |
249 | | /* Get the normalized MSE reduction for refinement passes. */ |
250 | | JAS_ATTRIBUTE_CONST |
251 | | static inline jpc_fix_t JPC_GETREFNMSEDEC(jpc_fix_t x, int bitpos) |
252 | 918M | { |
253 | 918M | return bitpos > JPC_NMSEDEC_FRACBITS |
254 | 918M | ? jpc_refnmsedec[JPC_ASR(x, bitpos - JPC_NMSEDEC_FRACBITS) & JAS_ONES(JPC_NMSEDEC_BITS)] |
255 | 918M | : jpc_refnmsedec0[JPC_ASR(x, bitpos - JPC_NMSEDEC_FRACBITS) & JAS_ONES(JPC_NMSEDEC_BITS)]; |
256 | 918M | } Unexecuted instantiation: jpc_dec.c:JPC_GETREFNMSEDEC Unexecuted instantiation: jpc_enc.c:JPC_GETREFNMSEDEC Unexecuted instantiation: jpc_t1cod.c:JPC_GETREFNMSEDEC Unexecuted instantiation: jpc_t1dec.c:JPC_GETREFNMSEDEC jpc_t1enc.c:JPC_GETREFNMSEDEC Line | Count | Source | 252 | 918M | { | 253 | 918M | return bitpos > JPC_NMSEDEC_FRACBITS | 254 | 918M | ? jpc_refnmsedec[JPC_ASR(x, bitpos - JPC_NMSEDEC_FRACBITS) & JAS_ONES(JPC_NMSEDEC_BITS)] | 255 | 918M | : jpc_refnmsedec0[JPC_ASR(x, bitpos - JPC_NMSEDEC_FRACBITS) & JAS_ONES(JPC_NMSEDEC_BITS)]; | 256 | 918M | } |
Unexecuted instantiation: jpc_t2dec.c:JPC_GETREFNMSEDEC Unexecuted instantiation: jpc_t2enc.c:JPC_GETREFNMSEDEC Unexecuted instantiation: jpc_cod.c:JPC_GETREFNMSEDEC |
257 | | |
258 | | /* Update the per-sample state information. */ |
259 | | static inline void JPC_UPDATEFLAGS4(jpc_fix_t *fp, unsigned rowstep, bool s, bool vcausalflag) |
260 | 294M | { |
261 | 294M | jpc_fix_t *np = fp - rowstep; |
262 | 294M | jpc_fix_t *sp = fp + rowstep; |
263 | 294M | if (vcausalflag) { |
264 | 14.6M | sp[-1] |= JPC_NESIG; |
265 | 14.6M | sp[1] |= JPC_NWSIG; |
266 | 14.6M | if (s) { |
267 | 7.18M | *sp |= JPC_NSIG | JPC_NSGN; |
268 | 7.18M | fp[-1] |= JPC_ESIG | JPC_ESGN; |
269 | 7.18M | fp[1] |= JPC_WSIG | JPC_WSGN; |
270 | 7.48M | } else { |
271 | 7.48M | *sp |= JPC_NSIG; |
272 | 7.48M | fp[-1] |= JPC_ESIG; |
273 | 7.48M | fp[1] |= JPC_WSIG; |
274 | 7.48M | } |
275 | 280M | } else { |
276 | 280M | np[-1] |= JPC_SESIG; |
277 | 280M | np[1] |= JPC_SWSIG; |
278 | 280M | sp[-1] |= JPC_NESIG; |
279 | 280M | sp[1] |= JPC_NWSIG; |
280 | 280M | if (s) { |
281 | 138M | *np |= JPC_SSIG | JPC_SSGN; |
282 | 138M | *sp |= JPC_NSIG | JPC_NSGN; |
283 | 138M | fp[-1] |= JPC_ESIG | JPC_ESGN; |
284 | 138M | fp[1] |= JPC_WSIG | JPC_WSGN; |
285 | 141M | } else { |
286 | 141M | *np |= JPC_SSIG; |
287 | 141M | *sp |= JPC_NSIG; |
288 | 141M | fp[-1] |= JPC_ESIG; |
289 | 141M | fp[1] |= JPC_WSIG; |
290 | 141M | } |
291 | 280M | } |
292 | 294M | } Unexecuted instantiation: jpc_dec.c:JPC_UPDATEFLAGS4 Unexecuted instantiation: jpc_enc.c:JPC_UPDATEFLAGS4 Unexecuted instantiation: jpc_t1cod.c:JPC_UPDATEFLAGS4 jpc_t1dec.c:JPC_UPDATEFLAGS4 Line | Count | Source | 260 | 130M | { | 261 | 130M | jpc_fix_t *np = fp - rowstep; | 262 | 130M | jpc_fix_t *sp = fp + rowstep; | 263 | 130M | if (vcausalflag) { | 264 | 14.6M | sp[-1] |= JPC_NESIG; | 265 | 14.6M | sp[1] |= JPC_NWSIG; | 266 | 14.6M | if (s) { | 267 | 7.18M | *sp |= JPC_NSIG | JPC_NSGN; | 268 | 7.18M | fp[-1] |= JPC_ESIG | JPC_ESGN; | 269 | 7.18M | fp[1] |= JPC_WSIG | JPC_WSGN; | 270 | 7.48M | } else { | 271 | 7.48M | *sp |= JPC_NSIG; | 272 | 7.48M | fp[-1] |= JPC_ESIG; | 273 | 7.48M | fp[1] |= JPC_WSIG; | 274 | 7.48M | } | 275 | 115M | } else { | 276 | 115M | np[-1] |= JPC_SESIG; | 277 | 115M | np[1] |= JPC_SWSIG; | 278 | 115M | sp[-1] |= JPC_NESIG; | 279 | 115M | sp[1] |= JPC_NWSIG; | 280 | 115M | if (s) { | 281 | 60.7M | *np |= JPC_SSIG | JPC_SSGN; | 282 | 60.7M | *sp |= JPC_NSIG | JPC_NSGN; | 283 | 60.7M | fp[-1] |= JPC_ESIG | JPC_ESGN; | 284 | 60.7M | fp[1] |= JPC_WSIG | JPC_WSGN; | 285 | 60.7M | } else { | 286 | 54.9M | *np |= JPC_SSIG; | 287 | 54.9M | *sp |= JPC_NSIG; | 288 | 54.9M | fp[-1] |= JPC_ESIG; | 289 | 54.9M | fp[1] |= JPC_WSIG; | 290 | 54.9M | } | 291 | 115M | } | 292 | 130M | } |
jpc_t1enc.c:JPC_UPDATEFLAGS4 Line | Count | Source | 260 | 164M | { | 261 | 164M | jpc_fix_t *np = fp - rowstep; | 262 | 164M | jpc_fix_t *sp = fp + rowstep; | 263 | 164M | if (vcausalflag) { | 264 | 0 | sp[-1] |= JPC_NESIG; | 265 | 0 | sp[1] |= JPC_NWSIG; | 266 | 0 | if (s) { | 267 | 0 | *sp |= JPC_NSIG | JPC_NSGN; | 268 | 0 | fp[-1] |= JPC_ESIG | JPC_ESGN; | 269 | 0 | fp[1] |= JPC_WSIG | JPC_WSGN; | 270 | 0 | } else { | 271 | 0 | *sp |= JPC_NSIG; | 272 | 0 | fp[-1] |= JPC_ESIG; | 273 | 0 | fp[1] |= JPC_WSIG; | 274 | 0 | } | 275 | 164M | } else { | 276 | 164M | np[-1] |= JPC_SESIG; | 277 | 164M | np[1] |= JPC_SWSIG; | 278 | 164M | sp[-1] |= JPC_NESIG; | 279 | 164M | sp[1] |= JPC_NWSIG; | 280 | 164M | if (s) { | 281 | 78.0M | *np |= JPC_SSIG | JPC_SSGN; | 282 | 78.0M | *sp |= JPC_NSIG | JPC_NSGN; | 283 | 78.0M | fp[-1] |= JPC_ESIG | JPC_ESGN; | 284 | 78.0M | fp[1] |= JPC_WSIG | JPC_WSGN; | 285 | 86.2M | } else { | 286 | 86.2M | *np |= JPC_SSIG; | 287 | 86.2M | *sp |= JPC_NSIG; | 288 | 86.2M | fp[-1] |= JPC_ESIG; | 289 | 86.2M | fp[1] |= JPC_WSIG; | 290 | 86.2M | } | 291 | 164M | } | 292 | 164M | } |
Unexecuted instantiation: jpc_t2dec.c:JPC_UPDATEFLAGS4 Unexecuted instantiation: jpc_t2enc.c:JPC_UPDATEFLAGS4 Unexecuted instantiation: jpc_cod.c:JPC_UPDATEFLAGS4 |
293 | | |
294 | | /* Initialize the lookup tables used by the codec. */ |
295 | | void jpc_initluts(void); |
296 | | |
297 | | void jpc_initmqctxs(void); |
298 | | |
299 | | /* Get the nominal gain associated with a particular band. */ |
300 | | JAS_ATTRIBUTE_CONST |
301 | | unsigned JPC_NOMINALGAIN(unsigned qmfbid, unsigned numlvls, unsigned lvlno, enum jpc_tsfb_orient orient); |
302 | | |
303 | | /* Get the coding pass type. */ |
304 | | JAS_ATTRIBUTE_CONST |
305 | | enum jpc_passtype JPC_PASSTYPE(unsigned passno); |
306 | | |
307 | | /* Get the segment type. */ |
308 | | JAS_ATTRIBUTE_CONST |
309 | | enum jpc_segtype JPC_SEGTYPE(unsigned passno, unsigned firstpassno, bool bypass); |
310 | | |
311 | | /* Get the number of coding passess in the segment. */ |
312 | | JAS_ATTRIBUTE_CONST |
313 | | unsigned JPC_SEGPASSCNT(unsigned passno, unsigned firstpassno, unsigned numpasses, bool bypass, |
314 | | bool termall); |
315 | | |
316 | | /* Is the coding pass terminated? */ |
317 | | JAS_ATTRIBUTE_CONST |
318 | | bool JPC_ISTERMINATED(unsigned passno, unsigned firstpassno, unsigned numpasses, bool termall, |
319 | | bool lazy); |
320 | | |
321 | | #endif |