~ubuntu-branches/debian/lenny/fpc/lenny

« back to all changes in this revision

Viewing changes to fpcsrc/packages/base/pasjpeg/jdct.pas

  • Committer: Bazaar Package Importer
  • Author(s): Mazen Neifer, Torsten Werner, Mazen Neifer
  • Date: 2008-05-17 17:12:11 UTC
  • mfrom: (3.1.9 intrepid)
  • Revision ID: james.westby@ubuntu.com-20080517171211-9qi33xhd9evfa0kg
Tags: 2.2.0-dfsg1-9
[ Torsten Werner ]
* Add Mazen Neifer to Uploaders field.

[ Mazen Neifer ]
* Moved FPC sources into a version dependent directory from /usr/share/fpcsrc
  to /usr/share/fpcsrc/${FPCVERSION}. This allow installing more than on FPC
  release.
* Fixed far call issue in compiler preventing building huge binearies.
  (closes: #477743)
* Updated building dependencies, recomennded and suggested packages.
* Moved fppkg to fp-utils as it is just a helper tool and is not required by
  compiler.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
Unit Jdct;
 
2
 
 
3
{ Orignal: jdct.h; Copyright (C) 1994-1996, Thomas G. Lane. }
 
4
 
 
5
{ This include file contains common declarations for the forward and
 
6
  inverse DCT modules.  These declarations are private to the DCT managers
 
7
  (jcdctmgr.c, jddctmgr.c) and the individual DCT algorithms.
 
8
  The individual DCT algorithms are kept in separate files to ease
 
9
  machine-dependent tuning (e.g., assembly coding). }
 
10
 
 
11
interface
 
12
 
 
13
{$I jconfig.inc}
 
14
 
 
15
uses
 
16
  jmorecfg;
 
17
 
 
18
 
 
19
{ A forward DCT routine is given a pointer to a work area of type DCTELEM[];
 
20
  the DCT is to be performed in-place in that buffer.  Type DCTELEM is int
 
21
  for 8-bit samples, INT32 for 12-bit samples.  (NOTE: Floating-point DCT
 
22
  implementations use an array of type FAST_FLOAT, instead.)
 
23
  The DCT inputs are expected to be signed (range +-CENTERJSAMPLE).
 
24
  The DCT outputs are returned scaled up by a factor of 8; they therefore
 
25
  have a range of +-8K for 8-bit data, +-128K for 12-bit data.  This
 
26
  convention improves accuracy in integer implementations and saves some
 
27
  work in floating-point ones.
 
28
  Quantization of the output coefficients is done by jcdctmgr.c. }
 
29
 
 
30
 
 
31
{$ifdef BITS_IN_JSAMPLE_IS_8}
 
32
type
 
33
  DCTELEM = int;                { 16 or 32 bits is fine }
 
34
{$else}
 
35
type                            { must have 32 bits }
 
36
  DCTELEM = INT32;
 
37
{$endif}
 
38
type
 
39
  jTDctElem = 0..(MaxInt div SizeOf(DCTELEM))-1;
 
40
  DCTELEM_FIELD = array[jTDctElem] of DCTELEM;
 
41
  DCTELEM_FIELD_PTR = ^DCTELEM_FIELD;
 
42
  DCTELEMPTR = ^DCTELEM;
 
43
 
 
44
type
 
45
  forward_DCT_method_ptr = procedure(var data : array of DCTELEM);
 
46
  float_DCT_method_ptr = procedure(var data : array of FAST_FLOAT);
 
47
 
 
48
 
 
49
{ An inverse DCT routine is given a pointer to the input JBLOCK and a pointer
 
50
  to an output sample array.  The routine must dequantize the input data as
 
51
  well as perform the IDCT; for dequantization, it uses the multiplier table
 
52
  pointed to by compptr->dct_table.  The output data is to be placed into the
 
53
  sample array starting at a specified column.  (Any row offset needed will
 
54
  be applied to the array pointer before it is passed to the IDCT code.)
 
55
  Note that the number of samples emitted by the IDCT routine is
 
56
  DCT_scaled_size * DCT_scaled_size. }
 
57
 
 
58
 
 
59
{ typedef inverse_DCT_method_ptr is declared in jpegint.h }
 
60
 
 
61
 
 
62
{ Each IDCT routine has its own ideas about the best dct_table element type. }
 
63
 
 
64
 
 
65
type
 
66
  ISLOW_MULT_TYPE = MULTIPLIER;  { short or int, whichever is faster }
 
67
 
 
68
{$ifdef BITS_IN_JSAMPLE_IS_8}
 
69
type
 
70
  IFAST_MULT_TYPE = MULTIPLIER;  { 16 bits is OK, use short if faster }
 
71
const
 
72
  IFAST_SCALE_BITS = 2;         { fractional bits in scale factors }
 
73
{$else}
 
74
type
 
75
  IFAST_MULT_TYPE = INT32;      {  need 32 bits for scaled quantizers }
 
76
const
 
77
  IFAST_SCALE_BITS = 13;        { fractional bits in scale factors }
 
78
{$endif}
 
79
type
 
80
  FLOAT_MULT_TYPE = FAST_FLOAT; { preferred floating type }
 
81
 
 
82
const
 
83
  RANGE_MASK = (MAXJSAMPLE * 4 + 3); { 2 bits wider than legal samples }
 
84
 
 
85
type
 
86
  jTMultType = 0..(MaxInt div SizeOf(ISLOW_MULT_TYPE))-1;
 
87
  ISLOW_MULT_TYPE_FIELD = array[jTMultType] of ISLOW_MULT_TYPE;
 
88
  ISLOW_MULT_TYPE_FIELD_PTR = ^ISLOW_MULT_TYPE_FIELD;
 
89
  ISLOW_MULT_TYPE_PTR = ^ISLOW_MULT_TYPE;
 
90
 
 
91
  jTFloatType = 0..(MaxInt div SizeOf(FLOAT_MULT_TYPE))-1;
 
92
  FLOAT_MULT_TYPE_FIELD = array[jTFloatType] of FLOAT_MULT_TYPE;
 
93
  FLOAT_MULT_TYPE_FIELD_PTR = ^FLOAT_MULT_TYPE_FIELD;
 
94
  FLOAT_MULT_TYPE_PTR = ^FLOAT_MULT_TYPE;
 
95
 
 
96
  jTFastType = 0..(MaxInt div SizeOf(IFAST_MULT_TYPE))-1;
 
97
  IFAST_MULT_TYPE_FIELD = array[jTFastType] of IFAST_MULT_TYPE;
 
98
  IFAST_MULT_TYPE_FIELD_PTR = ^IFAST_MULT_TYPE_FIELD;
 
99
  IFAST_MULT_TYPE_PTR = ^IFAST_MULT_TYPE;
 
100
 
 
101
type
 
102
  jTFastFloat = 0..(MaxInt div SizeOf(FAST_FLOAT))-1;
 
103
  FAST_FLOAT_FIELD = array[jTFastFloat] of FAST_FLOAT;
 
104
  FAST_FLOAT_FIELD_PTR = ^FAST_FLOAT_FIELD;
 
105
  FAST_FLOAT_PTR = ^FAST_FLOAT;
 
106
 
 
107
implementation
 
108
 
 
109
end.