/usr/include/waili/Wavelet.h is in libwaili-dev 19990723-22.1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 | //
// Integer Wavelet Classes
//
// $Id: Wavelet.h,v 4.1.2.4.2.1 1999/07/20 16:15:45 geert Exp $
//
// Copyright (C) 1996-1999 Department of Computer Science, K.U.Leuven, Belgium
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
#ifndef WAILI_WAVELET_H
#define WAILI_WAVELET_H
#include <math.h>
#include <limits.h>
#include "Lifting.h"
// Optimization
#define LIFTING_OPTIMIZE_STEPS 1 // Use optimized lifting steps
// Unique private IDs
enum Wavelet_ID {
ID_Lazy = 0,
ID_CDF_1_1 = 1, ID_CDF_1_3 = 2, ID_CDF_1_5 = 3,
ID_CDF_2_2 = 4, ID_CDF_2_4 = 5, ID_CDF_2_6 = 6,
ID_CDF_4_2 = 7, ID_CDF_4_4 = 8, ID_CDF_4_6 = 9,
ID_CRF_13_7 = 100, ID_SWE_13_7 = 101
};
// ----------------------------------------------------------------------------
//
// Integer Wavelet Abstract Base Class
//
// ----------------------------------------------------------------------------
class Wavelet {
public:
virtual Wavelet *Clone(void) const = 0;
// Biorthogonal Cohen-Daubechies-Feauveau
static Wavelet *CreateCDF(u_int np, u_int d);
virtual void CakeWalk(Lifting &lifting) const = 0;
virtual void ICakeWalk(Lifting &lifting) const = 0;
// Filter Length
int GetGStart() const;
int GetGEnd() const;
int GetHStart() const;
int GetHEnd() const;
// Normalization
int GetShiftL(void) const;
int GetShiftH(void) const;
// Unique private IDs for different Wavelets
Wavelet_ID GetID(void) const { return ID; };
static Wavelet *CreateFromID(Wavelet_ID id);
protected:
int GStart, GEnd, HStart, HEnd;
// Normalization
int ShiftL, ShiftH;
Wavelet_ID ID;
private:
static const char *rcsid;
};
// ----------------------------------------------------------------------------
// Lazy Wavelet
// Equivalent to Biorthogonal Cohen-Daubechies-Feauveau (0, 0)
class Wavelet_Lazy : public Wavelet {
public:
Wavelet_Lazy();
Wavelet_Lazy *Clone(void) const;
// Lifting steps on Channels
void CakeWalk(Lifting &) const {};
void ICakeWalk(Lifting &) const {};
private:
static const char *rcsid;
};
// ----------------------------------------------------------------------------
// Biorthogonal Cohen-Daubechies-Feauveau (1, x)
class LiftCoef_CDF_1_x {
protected:
static const s16 D1b[2];
static const u16 D1a;
};
class LiftCoef_CDF_1_1 : public LiftCoef_CDF_1_x {
protected:
static const s16 P2b[2];
static const u16 P2a;
};
class LiftCoef_CDF_1_3 : public LiftCoef_CDF_1_x {
protected:
static const s16 P2b[4];
static const u16 P2a;
};
class LiftCoef_CDF_1_5 : public LiftCoef_CDF_1_x {
protected:
static const s16 P2b[6];
static const u16 P2a;
};
class Wavelet_CDF_1_x : public Wavelet {
protected:
Wavelet_CDF_1_x();
private:
static const char *rcsid;
};
class Wavelet_CDF_1_1 : public Wavelet_CDF_1_x,
public LiftCoef_CDF_1_1 {
public:
Wavelet_CDF_1_1();
virtual Wavelet_CDF_1_1 *Clone(void) const;
// Lifting steps on Channels
virtual void CakeWalk(Lifting &lifting) const;
virtual void ICakeWalk(Lifting &lifting) const;
};
class Wavelet_CDF_1_3 : public Wavelet_CDF_1_x,
public LiftCoef_CDF_1_3 {
public:
Wavelet_CDF_1_3();
virtual Wavelet_CDF_1_3 *Clone(void) const;
// Lifting steps on Channels
virtual void CakeWalk(Lifting &lifting) const;
virtual void ICakeWalk(Lifting &lifting) const;
};
class Wavelet_CDF_1_5 : public Wavelet_CDF_1_x,
public LiftCoef_CDF_1_5 {
public:
Wavelet_CDF_1_5();
virtual Wavelet_CDF_1_5 *Clone(void) const;
// Lifting steps on Channels
virtual void CakeWalk(Lifting &lifting) const;
virtual void ICakeWalk(Lifting &lifting) const;
};
// ----------------------------------------------------------------------------
// Biorthogonal Cohen-Daubechies-Feauveau (2, x)
class LiftCoef_CDF_2_x {
protected:
static const s16 D1b[2];
static const u16 D1a;
};
class LiftCoef_CDF_2_2 : public LiftCoef_CDF_2_x {
protected:
static const s16 P2b[2];
static const u16 P2a;
};
class LiftCoef_CDF_2_4 : public LiftCoef_CDF_2_x {
protected:
static const s16 P2b[4];
static const u16 P2a;
};
class LiftCoef_CDF_2_6 : public LiftCoef_CDF_2_x {
protected:
static const s16 P2b[6];
static const u16 P2a;
};
class Wavelet_CDF_2_x : public Wavelet {
protected:
Wavelet_CDF_2_x();
private:
static const char *rcsid;
};
class Wavelet_CDF_2_2 : public Wavelet_CDF_2_x,
public LiftCoef_CDF_2_2 {
public:
Wavelet_CDF_2_2();
virtual Wavelet_CDF_2_2 *Clone(void) const;
// Lifting steps on Channels
virtual void CakeWalk(Lifting &lifting) const;
virtual void ICakeWalk(Lifting &lifting) const;
};
class Wavelet_CDF_2_4 : public Wavelet_CDF_2_x,
public LiftCoef_CDF_2_4 {
public:
Wavelet_CDF_2_4();
virtual Wavelet_CDF_2_4 *Clone(void) const;
// Lifting steps on Channels
virtual void CakeWalk(Lifting &lifting) const;
virtual void ICakeWalk(Lifting &lifting) const;
};
class Wavelet_CDF_2_6 : public Wavelet_CDF_2_x,
public LiftCoef_CDF_2_6 {
public:
Wavelet_CDF_2_6();
virtual Wavelet_CDF_2_6 *Clone(void) const;
// Lifting steps on Channels
virtual void CakeWalk(Lifting &lifting) const;
virtual void ICakeWalk(Lifting &lifting) const;
};
// ----------------------------------------------------------------------------
// Biorthogonal Cohen-Daubechies-Feauveau (4, x)
class LiftCoef_CDF_4_x {
protected:
static const s16 P1b[2];
static const u16 P1a1;
static const u16 P1a2;
static const s16 D2b[2];
static const u16 D2a;
};
class LiftCoef_CDF_4_2 : public LiftCoef_CDF_4_x {
protected:
static const s16 P3b[2];
static const u16 P3a;
};
class LiftCoef_CDF_4_4 : public LiftCoef_CDF_4_x {
protected:
static const s16 P3b[4];
static const u16 P3a;
};
class LiftCoef_CDF_4_6 : public LiftCoef_CDF_4_x {
protected:
static const s16 P3b[6];
static const u16 P3a;
};
class Wavelet_CDF_4_x : public Wavelet {
protected:
Wavelet_CDF_4_x();
private:
static const char *rcsid;
};
class Wavelet_CDF_4_2 : public Wavelet_CDF_4_x,
public LiftCoef_CDF_4_2 {
public:
Wavelet_CDF_4_2();
virtual Wavelet_CDF_4_2 *Clone(void) const;
// Lifting steps on Channels
virtual void CakeWalk(Lifting &lifting) const;
virtual void ICakeWalk(Lifting &lifting) const;
};
class Wavelet_CDF_4_4 : public Wavelet_CDF_4_x,
public LiftCoef_CDF_4_4 {
public:
Wavelet_CDF_4_4();
virtual Wavelet_CDF_4_4 *Clone(void) const;
// Lifting steps on Channels
virtual void CakeWalk(Lifting &lifting) const;
virtual void ICakeWalk(Lifting &lifting) const;
};
class Wavelet_CDF_4_6 : public Wavelet_CDF_4_x,
public LiftCoef_CDF_4_6 {
public:
Wavelet_CDF_4_6();
virtual Wavelet_CDF_4_6 *Clone(void) const;
// Lifting steps on Channels
virtual void CakeWalk(Lifting &lifting) const;
virtual void ICakeWalk(Lifting &lifting) const;
};
// ----------------------------------------------------------------------------
// JPEG 2000
class Wavelet_CRF_13_7 : public Wavelet {
public:
Wavelet_CRF_13_7();
virtual Wavelet_CRF_13_7 *Clone(void) const;
// Lifting steps on Channels
virtual void CakeWalk(Lifting &lifting) const;
virtual void ICakeWalk(Lifting &lifting) const;
protected:
static const s16 D1b[4];
static const u16 D1a;
static const s16 P2b[4];
static const u16 P2a;
private:
static const char *rcsid;
};
class Wavelet_SWE_13_7 : public Wavelet {
public:
Wavelet_SWE_13_7();
virtual Wavelet_SWE_13_7 *Clone(void) const;
// Lifting steps on Channels
virtual void CakeWalk(Lifting &lifting) const;
virtual void ICakeWalk(Lifting &lifting) const;
protected:
static const s16 D1b[4];
static const u16 D1a;
static const s16 P2b[4];
static const u16 P2a;
private:
static const char *rcsid;
};
/////////////////////////////////////////////////////////////
#include "waili/Wavelet_bin.h"
/////////////////////////////////////////////////////////////////////////////
//
// Inline Member Functions
//
/////////////////////////////////////////////////////////////////////////////
inline int Wavelet::GetGStart(void) const
{
return(GStart);
}
inline int Wavelet::GetGEnd(void) const
{
return(GEnd);
}
inline int Wavelet::GetHStart(void) const
{
return(HStart);
}
inline int Wavelet::GetHEnd(void) const
{
return(HEnd);
}
inline int Wavelet::GetShiftL(void) const
{
return(ShiftL);
}
inline int Wavelet::GetShiftH(void) const
{
return(ShiftH);
}
inline Wavelet_Lazy::Wavelet_Lazy()
{
HStart = 0;
HEnd = 0;
GStart = 1;
GEnd = 1;
ShiftH = 0;
ShiftL = 0;
}
inline Wavelet_Lazy *Wavelet_Lazy::Clone(void) const
{
return(new Wavelet_Lazy(*this));
}
inline Wavelet_CDF_1_x::Wavelet_CDF_1_x()
{
GStart = 0;
GEnd = 1;
ShiftL = 1;
ShiftH = -1;
}
inline Wavelet_CDF_2_x::Wavelet_CDF_2_x()
{
GStart = 0;
GEnd = 2;
ShiftL = 1;
ShiftH = -1;
}
inline Wavelet_CDF_4_x::Wavelet_CDF_4_x()
{
GStart = -1;
GEnd = 3;
ShiftL = 1;
ShiftH = -1;
}
inline Wavelet_CDF_1_1::Wavelet_CDF_1_1()
{
HStart = 0;
HEnd = 1;
ID = ID_CDF_1_1;
}
inline Wavelet_CDF_1_1 *Wavelet_CDF_1_1::Clone(void) const
{
return(new Wavelet_CDF_1_1(*this));
}
inline Wavelet_CDF_1_3::Wavelet_CDF_1_3()
{
HStart = -2;
HEnd = 3;
ID = ID_CDF_1_3;
}
inline Wavelet_CDF_1_3 *Wavelet_CDF_1_3::Clone(void) const
{
return(new Wavelet_CDF_1_3(*this));
}
inline Wavelet_CDF_1_5::Wavelet_CDF_1_5()
{
HStart = -4;
HEnd = 5;
ID = ID_CDF_1_5;
}
inline Wavelet_CDF_1_5 *Wavelet_CDF_1_5::Clone(void) const
{
return(new Wavelet_CDF_1_5(*this));
}
inline Wavelet_CDF_2_2::Wavelet_CDF_2_2()
{
HStart = -2;
HEnd = 2;
ID = ID_CDF_2_2;
}
inline Wavelet_CDF_2_2 *Wavelet_CDF_2_2::Clone(void) const
{
return(new Wavelet_CDF_2_2(*this));
}
inline Wavelet_CDF_2_4::Wavelet_CDF_2_4()
{
HStart = -4;
HEnd = 4;
ID = ID_CDF_2_4;
}
inline Wavelet_CDF_2_4 *Wavelet_CDF_2_4::Clone(void) const
{
return(new Wavelet_CDF_2_4(*this));
}
inline Wavelet_CDF_2_6::Wavelet_CDF_2_6()
{
HStart = -6;
HEnd = 6;
ID = ID_CDF_2_6;
}
inline Wavelet_CDF_2_6 *Wavelet_CDF_2_6::Clone(void) const
{
return(new Wavelet_CDF_2_6(*this));
}
inline Wavelet_CDF_4_2::Wavelet_CDF_4_2()
{
HStart = -3;
HEnd = 3;
ID = ID_CDF_4_2;
}
inline Wavelet_CDF_4_2 *Wavelet_CDF_4_2::Clone(void) const
{
return(new Wavelet_CDF_4_2(*this));
}
inline Wavelet_CDF_4_4::Wavelet_CDF_4_4()
{
HStart = -5;
HEnd = 5;
ID = ID_CDF_4_4;
}
inline Wavelet_CDF_4_4 *Wavelet_CDF_4_4::Clone(void) const
{
return(new Wavelet_CDF_4_4(*this));
}
inline Wavelet_CDF_4_6::Wavelet_CDF_4_6()
{
HStart = -7;
HEnd = 7;
ID = ID_CDF_4_6;
}
inline Wavelet_CDF_4_6 *Wavelet_CDF_4_6::Clone(void) const
{
return(new Wavelet_CDF_4_6(*this));
}
inline Wavelet_CRF_13_7::Wavelet_CRF_13_7()
{
GStart = -4;
GEnd = 2;
HStart = -6;
HEnd = 6;
ID = ID_CRF_13_7;
ShiftL = 1;
ShiftH = 1;
}
inline Wavelet_CRF_13_7 *Wavelet_CRF_13_7::Clone(void) const
{
return new Wavelet_CRF_13_7(*this);
}
inline Wavelet_SWE_13_7::Wavelet_SWE_13_7()
{
GStart = -4;
GEnd = 2;
HStart = -6;
HEnd = 6;
ID = ID_SWE_13_7;
ShiftL = 1;
ShiftH = 1;
}
inline Wavelet_SWE_13_7 *Wavelet_SWE_13_7::Clone(void) const
{
return new Wavelet_SWE_13_7(*this);
}
#endif // WAILI_WAVELET_H
|