Content deleted Content added
m task, replaced: IEEE Trans. Image Processing → IEEE Trans. Image Process. |
m →External links: HTTP to HTTPS for SourceForge |
||
(40 intermediate revisions by 19 users not shown) | |||
Line 1:
{{Short description|Technique used in signal processing and data compression}}
A '''discrete cosine transform''' ('''DCT''') expresses a finite sequence of [[data points]] in terms of a sum of [[cosine]] functions oscillating at different [[frequency|frequencies]]. The DCT, first proposed by [[Nasir Ahmed (engineer)|Nasir Ahmed]] in 1972, is a widely used transformation technique in [[signal processing]] and [[data compression]]. It is used in most [[digital media]], including [[digital images]] (such as [[JPEG]] and [[HEIF]]), [[digital video]] (such as [[MPEG]] and {{nowrap|[[H.26x]]}}), [[digital audio]] (such as [[Dolby Digital]], [[MP3]] and [[Advanced Audio Coding|AAC]]), [[digital television]] (such as [[SDTV]], [[HDTV]] and [[Video on demand|VOD]]), [[digital radio]] (such as [[AAC+]] and [[DAB+]]), and [[speech coding]] (such as [[AAC-LD]], [[Siren (codec)|Siren]] and [[Opus (audio format)|Opus]]). DCTs are also important to numerous other applications in [[science and engineering]], such as [[digital signal processing]], [[telecommunication]] devices, reducing [[network bandwidth]] usage, and [[spectral method]]s for the numerical solution of [[partial differential equations]].
Line 7 ⟶ 6:
There are eight standard DCT variants, of which four are common.
The most common variant of discrete cosine transform is the type-II DCT, which is often called simply ''the DCT''. This was the original DCT as first proposed by Ahmed. Its inverse, the type-III DCT, is correspondingly often called simply ''the inverse DCT'' or ''the IDCT''. Two related transforms are the [[discrete sine transform]] (DST), which is equivalent to a DFT of real and [[odd function]]s, and the [[modified discrete cosine transform]] (MDCT), which is based on a DCT of overlapping data. Multidimensional DCTs (MD DCTs) are developed to extend the concept of DCT to multidimensional signals. A variety of fast algorithms have been developed to reduce the computational complexity of implementing DCT. One of these is the integer DCT (IntDCT),<ref name="Stankovic"/> an [[integer]] approximation of the standard DCT,<ref name="Britanak2010" />{{rp|pages= [https://books.google.com/books?id=iRlQHcK-r_kC&pg=PA141 ix, xiii, 1, 141–304]}} used in several [[ISO/IEC]] and [[ITU-T]] international standards.<ref name="Stankovic"/><ref name="Britanak2010"/>
DCT compression, also known as block compression, compresses data in sets of discrete DCT blocks.<ref name="Alikhani"/> DCT blocks sizes including 8x8 [[pixels]] for the standard DCT, and varied integer DCT sizes between 4x4 and 32x32 pixels.<ref name="Stankovic"/><ref name="apple"/> The DCT has a strong ''energy compaction'' property,<ref name="pubDCT"/><ref name="pubRaoYip"/> capable of achieving high quality at high [[data compression ratio]]s.<ref name="Barbero"/><ref name="Lea">{{cite journal|last1=Lea|first1=William|date=1994|title=Video on demand: Research Paper 94/68|url=https://researchbriefings.parliament.uk/ResearchBriefing/Summary/RP94-68|journal=[[House of Commons Library]]|access-date=20 September 2019}}</ref> However, blocky [[compression artifacts]] can appear when heavy DCT compression is applied.
== History ==
The DCT was first conceived by [[Nasir Ahmed (engineer)|Nasir Ahmed
Since its introduction in 1974, there has been significant research on the DCT.<ref name="t81"/> In 1977, Wen-Hsiung Chen published a paper with C. Harrison Smith and Stanley C. Fralick presenting a fast DCT algorithm.<ref name="A Fast Computational Algorithm for">{{cite journal |last1=Chen |first1=Wen-Hsiung |last2=Smith |first2=C. H. |last3=Fralick |first3=S. C. |title=A Fast Computational Algorithm for the Discrete Cosine Transform |journal=[[IEEE Transactions on Communications]] |date=September 1977 |volume=25 |issue=9 |pages=1004–1009 |doi=10.1109/TCOM.1977.1093941}}</ref><ref name="t81"/> Further developments include a 1978 paper by M. J. Narasimha and A. M. Peterson, and a 1984 paper by B. G. Lee.<ref name="t81"/> These research papers, along with the original 1974 Ahmed paper and the 1977 Chen paper, were cited by the [[Joint Photographic Experts Group]] as the basis for [[JPEG]]'s lossy image compression algorithm in 1992.<ref name="t81"/><ref name="chen">{{cite journal |last1=Smith |first1=C. |last2=Fralick |first2=S. |title=A Fast Computational Algorithm for the Discrete Cosine Transform |journal=IEEE Transactions on Communications |date=1977 |volume=25 |issue=9 |pages=1004–1009 |doi=10.1109/TCOM.1977.1093941 |issn=0090-6778}}</ref>
Line 60 ⟶ 59:
**[[Image processing]] — [[digital image processing]],<ref name="Stankovic"/> [[image analysis]], [[content-based image retrieval]], [[corner detection]], directional block-wise [[Sparse approximation|image representation]], [[edge detection]], [[image enhancement]], [[image fusion]], [[image segmentation]], [[interpolation]], [[image noise]] level estimation, mirroring, rotation, [[Just-noticeable difference|just-noticeable distortion]] (JND) profile, [[spatiotemporal]] masking effects, [[foveated imaging]]<ref name="Ochoa"/>
**[[Image quality]] assessment — DCT-based quality degradation metric (DCT QM)<ref name="Ochoa"/>
**[[Image reconstruction]] — directional [[image texture|textures]] auto inspection,
*[[Medical technology]]
**[[Electrocardiography]] (ECG) — [[vectorcardiography]] (VCG)<ref name="Ochoa"/>
Line 139 ⟶ 138:
|-
| [[AV1]]<ref name="AV1">{{cite web |url=https://aomediacodec.github.io/av1-spec/av1-spec.pdf |title=AV1 Bitstream & Decoding Process Specification |author=Peter de Rivaz |author2=Jack Haughton |date=2018 |publisher=[[Alliance for Open Media]] |access-date=2022-01-14}}</ref> ||2018|| An open source format based on VP10 ([[VP9]]'s internal successor), [[Daala]] and [[Thor (video codec)|Thor]]; used by content providers such as [[YouTube]]<ref name="YT AV1 Beta Playlist">{{cite web |url=https://www.youtube.com/playlist?list=PLyqf6gJt7KuHBmeVzZteZUlNUQAVLwrZS |title=AV1 Beta Launch Playlist |author=YouTube Developers |website=[[YouTube]] |date=15 September 2018 |access-date=14 January 2022 |quote=The first videos to receive YouTube's AV1 transcodes.}}</ref><ref name="YT AV1">{{cite web |url=https://www.ghacks.net/2018/09/13/how-to-enable-av1-support-on-youtube/ |title=How to enable AV1 support on YouTube |last=Brinkmann |first=Martin |date=13 September 2018 |access-date=14 January 2022}}</ref> and [[Netflix]].<ref name="Netflix AV1 Android">{{cite web |url=https://netflixtechblog.com/netflix-now-streaming-av1-on-android-d5264a515202 |title=Netflix Now Streaming AV1 on Android |author=Netflix Technology Blog |date=5 February 2020 |access-date=14 January 2022}}</ref><ref name="Netflix AV1 TV">{{cite web |url=https://netflixtechblog.com/bringing-av1-streaming-to-netflix-members-tvs-b7fc88e42320 |title=Bringing AV1 Streaming to Netflix Members' TVs |author=Netflix Technology Blog |date=9 November 2021 |access-date=14 January 2022}}</ref>
|}
===MDCT audio standards===
Line 147 ⟶ 146:
{| class="wikitable"
|-
! Audio compression standard
! Year ! Common applications
|-
| [[Dolby Digital]] (AC-3)<ref name="Luo" /><ref name="Britanak2011" />
Line 199:
|-
| [[Dolby AC-4]]<ref name="Dolby AC-4" />
| rowspan="2" |
| rowspan="2" | [[ATSC 3.0]], [[ultra-high-definition television]] (UHD TV)
|-
Line 211:
!Common applications
|-
|[[AAC-LD]] (LD-MDCT)<ref name="Schnell" />
|[[AAC-LD]] (LD-MDCT)<ref>{{cite conference |last1=Schnell |first1=Markus |last2=Schmidt |first2=Markus |last3=Jander |first3=Manuel |last4=Albert |first4=Tobias |last5=Geiger |first5=Ralf |last6=Ruoppila |first6=Vesa |last7=Ekstrand |first7=Per |last8=Bernhard |first8=Grill |date=October 2008 |title=MPEG-4 Enhanced Low Delay AAC - A New Standard for High Quality Communication |url=https://www.iis.fraunhofer.de/content/dam/iis/de/doc/ame/conference/AES-125-Convention_AAC-ELD-NewStandardForHighQualityCommunication_AES7503.pdf |conference=125th AES Convention |publisher=[[Audio Engineering Society]] |access-date=20 October 2019 |website=[[Fraunhofer IIS]]}}</ref>▼
|1999
|[[Mobile telephony]], [[voice-over-IP]] (VoIP), [[iOS]], [[FaceTime]]<ref name="AppleInsider standards 1"/>
|-
|[[Siren (codec)|Siren]]<ref name="Hersent" />
|[[Siren (codec)|Siren]]<ref name="Hersent">{{cite book |last1=Hersent |first1=Olivier |last2=Petit |first2=Jean-Pierre |last3=Gurle |first3=David |title=Beyond VoIP Protocols: Understanding Voice Technology and Networking Techniques for IP Telephony |date=2005 |publisher=[[John Wiley & Sons]] |isbn=9780470023631 |page=55 |url=https://books.google.com/books?id=SMvNToRs-DgC&pg=PA55}}</ref>▼
|1999
|[[VoIP]], [[wideband audio]], [[G.722.1]]
|-
|[[G.722.1]]<ref name="Lutzky" />
|[[G.722.1]]<ref>{{cite conference |last1=Lutzky |first1=Manfred |last2=Schuller |first2=Gerald |last3=Gayer |first3=Marc |last4=Krämer |first4=Ulrich |last5=Wabnik |first5=Stefan |title=A guideline to audio codec delay |url=https://www.iis.fraunhofer.de/content/dam/iis/de/doc/ame/conference/AES-116-Convention_guideline-to-audio-codec-delay_AES116.pdf |website=[[Fraunhofer IIS]] |conference=116th AES Convention |publisher=[[Audio Engineering Society]] |date=May 2004 |access-date=24 October 2019}}</ref>▼
|1999
|VoIP, wideband audio, [[G.722]]
|-
|[[G.729.1]]<ref name="Nagireddi" />
|[[G.729.1]]<ref name="Nagireddi">{{cite book|url=https://books.google.com/books?id=5AneeZFE71MC&pg=PA69|title=VoIP Voice and Fax Signal Processing|last1=Nagireddi|first1=Sivannarayana|date=2008|publisher=[[John Wiley & Sons]]|isbn=9780470377864|page=69}}</ref>▼
|2006
|[[G.729]], VoIP, wideband audio,<ref name="Nagireddi" /> [[mobile telephony]]
Line 231:
|[[Wideband audio]]
|-
|[[G.718]]<ref name="ITU-T" />
|[[G.718]]<ref>{{Cite web|url=https://www.itu.int/ITU-T/workprog/wp_item.aspx?isn=344|title=ITU-T Work Programme|website=ITU}}</ref>▼
|2008
|VoIP, wideband audio, mobile telephony
Line 239:
|[[Teleconferencing]], [[videoconferencing]], [[voice mail]]
|-
|[[CELT]]<ref name="Terriberry" />
|[[CELT]]<ref name="presentation">{{cite AV media |first=Timothy B. |last=Terriberry |title=Presentation of the CELT codec |url=http://people.xiph.org/~greg/video/linux_conf_au_CELT_2.ogv |time=65 minutes |access-date=2019-10-19 |archive-date=2011-08-07 |archive-url=https://web.archive.org/web/20110807182250/http://people.xiph.org/~greg/video/linux_conf_au_CELT_2.ogv |url-status=dead }}, also {{cite web|url=http://www.celt-codec.org/presentations/misc/lca-celt.pdf|title=CELT codec presentation slides}}</ref>▼
|2011
|VoIP,<ref name="ekiga" /><ref name="FreeSWITCH" /> mobile telephony
|VoIP,<ref name="ekiga">{{cite web|url=http://blog.ekiga.net/?p=112|title=Ekiga 3.1.0 available|access-date=2019-10-19|archive-date=2011-09-30|archive-url=https://web.archive.org/web/20110930034502/http://blog.ekiga.net/?p=112|url-status=dead}}</ref><ref name="AutoV5-14">{{Cite web|url=https://signalwire.com/freeswitch|title=☏ FreeSWITCH|website=SignalWire}}</ref> mobile telephony▼
|-
|[[Enhanced Voice Services]] (EVS)<ref name="EVS" />
|[[Enhanced Voice Services]] (EVS)<ref>{{cite web|url=https://www.iis.fraunhofer.de/content/dam/iis/de/doc/ame/wp/FraunhoferIIS_Technical-Paper_EVS.pdf|title=Enhanced Voice Services (EVS) Codec|date=March 2017|publisher=[[Fraunhofer IIS]]|access-date=19 October 2019}}</ref>▼
|2014
|Mobile telephony, VoIP, wideband audio
|}
===
{{See also|ZPEG}}
Multidimensional DCTs (MD DCTs) have several applications, mainly 3-D DCTs such as the 3-D DCT-II, which has several new applications like Hyperspectral Imaging coding systems,<ref name="appDCT">{{Citation |first1=G. P. |last1=Abousleman |first2=M. W. |last2=Marcellin |first3=B. R. |last3=Hunt |title=Compression of hyperspectral imagery using 3-D DCT and hybrid DPCM/DCT |journal=IEEE Trans. Geosci. Remote Sens. |date=January 1995 |volume=33 |issue=1 |pages=26–34 |doi=10.1109/36.368225|bibcode=1995ITGRS..33...26A }}</ref> variable temporal length 3-D DCT coding,<ref name="app2DCT">{{Citation |first1=Y. |last1=Chan |first2=W. |last2=Siu |title= Variable temporal-length 3-D discrete cosine transform coding |journal=IEEE Trans. Image Process
===Digital signal processing===
DCT plays an important role in [[digital signal processing]] specifically [[data compression]]. The DCT is widely implemented in [[digital signal processors]] (DSP), as well as digital signal processing software. Many companies have developed DSPs based on DCT technology. DCTs are widely used for applications such as [[encoding]], decoding, video, audio, [[multiplexing]], control signals, [[signaling]], and [[analog-to-digital conversion]]. DCTs are also commonly used for [[high-definition television]] (HDTV) encoder/decoder [[integrated circuit|chips]].<ref name="Stankovic"/>▼
▲The DCT is widely implemented in [[digital signal processors]] (DSP), as well as digital signal processing software. Many companies have developed DSPs based on DCT technology. DCTs are widely used for applications such as [[encoding]], decoding, video, audio, [[multiplexing]], control signals, [[signaling]], and [[analog-to-digital conversion]]. DCTs are also commonly used for [[high-definition television]] (HDTV) encoder/decoder [[integrated circuit|chips]].<ref name="Stankovic"/>
===Compression artifacts===
A common issue with DCT compression in [[digital media]] are blocky [[compression artifacts]],<ref name="Katsaggelos">{{cite book |last1=Katsaggelos |first1=Aggelos K. |last2=Babacan |first2=S. Derin |last3=Chun-Jen |first3=Tsai |title=The Essential Guide to Image Processing |date=2009 |publisher=[[Academic Press]] |isbn=9780123744579 |pages=349–383|chapter=Chapter 15 - Iterative Image Restoration}}</ref> caused by DCT blocks.<ref name="Alikhani">{{cite web |last1=Alikhani |first1=Darya |title=Beyond resolution: Rosa Menkman's glitch art |url=http://postmatter.merimedia.com/articles/archive-2012-2016/2015/51-rosa-menkman/ |website=POSTmatter |date=April 1, 2015 |access-date=19 October 2019 |archive-date=19 October 2019 |archive-url=https://web.archive.org/web/20191019082218/http://postmatter.merimedia.com/articles/archive-2012-2016/2015/51-rosa-menkman/ |url-status=dead }}</ref>
DCT blocks are often used in [[glitch art]].<ref name="Alikhani"/> The artist [[Rosa Menkman]] makes use of DCT-based compression artifacts in her glitch art,<ref name="Menkman">{{cite book |last1=Menkman |first1=Rosa |title=The Glitch Moment(um) |url=https://networkcultures.org/_uploads/NN%234_RosaMenkman.pdf |publisher=Institute of Network Cultures |isbn=978-90-816021-6-7 |date=October 2011 |access-date=19 October 2019}}</ref> particularly the DCT blocks found in most [[digital media]] formats such as [[JPEG]] digital images and [[MP3]]
▲A common issue with DCT compression in [[digital media]] are blocky [[compression artifacts]],<ref name="Katsaggelos">{{cite book |last1=Katsaggelos |first1=Aggelos K. |last2=Babacan |first2=S. Derin |last3=Chun-Jen |first3=Tsai |title=The Essential Guide to Image Processing |date=2009 |publisher=[[Academic Press]] |isbn=9780123744579 |pages=349–383|chapter=Chapter 15 - Iterative Image Restoration}}</ref> caused by DCT blocks.<ref name="Alikhani">{{cite web |last1=Alikhani |first1=Darya |title=Beyond resolution: Rosa Menkman's glitch art |url=http://postmatter.merimedia.com/articles/archive-2012-2016/2015/51-rosa-menkman/ |website=POSTmatter |date=April 1, 2015 |access-date=19 October 2019 |archive-date=19 October 2019 |archive-url=https://web.archive.org/web/20191019082218/http://postmatter.merimedia.com/articles/archive-2012-2016/2015/51-rosa-menkman/ |url-status=dead }}</ref> The DCT algorithm can cause block-based artifacts when heavy compression is applied. Due to the DCT being used in the majority of digital image and [[video coding standards]] (such as the [[JPEG]], {{nowrap|[[H.26x]]}} and [[MPEG]] formats), DCT-based blocky compression artifacts are widespread in [[digital media]]. In a DCT algorithm, an image (or frame in an image sequence) is divided into square blocks which are processed independently from each other, then the DCT of these blocks is taken, and the resulting DCT coefficients are [[Quantization (signal processing)|quantized]]. This process can cause blocking artifacts, primarily at high [[data compression ratio]]s.<ref name="Katsaggelos"/> This can also cause the "[[mosquito noise]]" effect, commonly found in [[digital video]] (such as the MPEG formats).<ref>{{cite web |title=Mosquito noise |url=https://www.pcmag.com/encyclopedia/term/55914/mosquito-noise |website=[[PC Magazine]] |access-date=19 October 2019}}</ref>
▲DCT blocks are often used in [[glitch art]].<ref name="Alikhani"/> The artist [[Rosa Menkman]] makes use of DCT-based compression artifacts in her glitch art,<ref name="Menkman">{{cite book |last1=Menkman |first1=Rosa |title=The Glitch Moment(um) |url=https://networkcultures.org/_uploads/NN%234_RosaMenkman.pdf |publisher=Institute of Network Cultures |isbn=978-90-816021-6-7 |date=October 2011 |access-date=19 October 2019}}</ref> particularly the DCT blocks found in most [[digital media]] formats such as [[JPEG]] digital images and [[MP3]] [[digital audio]].<ref name="Alikhani"/> Another example is ''Jpegs'' by German photographer [[Thomas Ruff]], which uses intentional [[JPEG]] artifacts as the basis of the picture's style.<ref>{{cite book|chapter=jpegs|first=Thomas|last=Ruff|title=Aperture|date=May 31, 2009|page=132|publisher=Aperture |isbn=9781597110938}}</ref><ref>{{cite web|url=http://jmcolberg.com/weblog/2009/04/review_jpegs_by_thomas_ruff/|title=Review: jpegs by Thomas Ruff|first=Jörg|last=Colberg|date=April 17, 2009}}</ref>
==Informal overview==
Like any Fourier-related transform,
The Fourier-related transforms that operate on a function over a finite [[___domain of a function|___domain]], such as the DFT or DCT or a [[Fourier series]], can be thought of as implicitly defining an ''extension'' of that function outside the ___domain. That is, once you write a function <math>f(x)</math> as a sum of sinusoids, you can evaluate that sum at any <math>x</math>, even for <math>x</math> where the original <math>f(x)</math> was not specified. The DFT, like the Fourier series, implies a [[periodic function|periodic]] extension of the original function. A DCT, like a [[
[[Image:DCT-symmetries.svg|thumb|right|350px|Illustration of the implicit even/odd extensions of DCT input data, for ''N''=11 data points (red dots), for the four most common types of DCT (types I-IV). Note the subtle differences at the interfaces between the data and the extensions: in DCT-II and DCT-IV both the end points are replicated in the extensions but not in DCT-I or DCT-III (and a zero point is inserted at the sign reversal extension in DCT-III).]]
However, because DCTs operate on ''finite'', ''discrete'' sequences, two issues arise that do not apply for the continuous cosine transform. First, one has to specify whether the function is even or odd at ''both'' the left and right boundaries of the ___domain (i.e. the min-''n'' and max-''n'' boundaries in the definitions below, respectively). Second, one has to specify around ''what point'' the function is even or odd. In particular, consider a sequence ''abcd'' of four equally spaced data points, and say that we specify an even ''left'' boundary. There are two sensible possibilities: either the data are even about the sample ''a'', in which case the even extension is ''dcbabcd'', or the data are even about the point ''halfway'' between ''a'' and the previous point, in which case the even extension is ''dcbaabcd'' (''a'' is repeated).
Each boundary can be either even or odd (2 choices per boundary) and can be symmetric about a data point or the point halfway between two data points (2 choices per boundary), for a total of 2 × 2 × 2 × 2 = 16 possibilities. These choices lead to all the standard variations of DCTs and also [[discrete sine transform]]s (DSTs). Half of these possibilities, those where the ''left'' boundary is even, correspond to the 8 types of DCT; the other half are the 8 types of DST.
These different boundary conditions strongly affect the applications of the transform and lead to uniquely useful properties for the various DCT types. Most directly, when using Fourier-related transforms to solve [[partial differential equation]]s by [[spectral method]]s, the boundary conditions are directly specified as a part of the problem being solved. Or, for the
In particular, it is well known that any [[Classification of discontinuities|discontinuities]] in a function reduce the [[rate of convergence]] of the Fourier series
== Formal definition ==
Line 287 ⟶ 283:
:<math>X_k
= \frac{1}{2} (x_0 + (-1)^k x_{N-1})
+ \sum_{n=1}^{N-2} x_n \cos \left[\, \
\qquad \text{ for } ~ k = 0,\ \ldots\ N-1 ~.</math>
Some authors further multiply the <math>x_0 </math> and <math> x_{N-1} </math> terms by <math> \sqrt{2\,}\
The DCT-I is exactly equivalent (up to an overall scale factor of 2), to a
Note, however, that the DCT-I is not defined for <math>
Thus, the DCT-I corresponds to the boundary conditions: <math>
=== DCT-II ===
Line 303 ⟶ 299:
\qquad \text{ for } ~ k = 0,\ \dots\ N-1 ~.</math>
The DCT-II is probably the most commonly used form, and is often simply referred to as
This transform is exactly equivalent (up to an overall scale factor of 2) to a
Some authors further multiply the <math>
The DCT-II implies the boundary conditions: <math>
=== DCT-III ===
Line 317 ⟶ 313:
\qquad \text{ for } ~ k = 0,\ \ldots\ N-1 ~.</math>
Because it is the inverse of DCT-II up to a scale factor (see below), this form is sometimes simply referred to as
Some authors divide the <math>x_0</math> term by <math>\sqrt{2}</math> instead of by 2 (resulting in an overall <math>x_0/\sqrt{2}</math> term) and multiply the resulting matrix by an overall scale factor of <math display="inline"> \sqrt{2/N}</math> (see above for the corresponding change in DCT-II), so that the DCT-II and DCT-III are transposes of one another. This makes the DCT-III matrix [[orthogonal matrix|orthogonal]], but breaks the direct correspondence with a real-even
The DCT-III implies the boundary conditions: <math>x_n</math> is even around <math>n = 0</math> and odd around <math>n = N ;</math> <math>X_k</math> is even around <math>k = -1/2</math> and even around <math>k = N - 1/2.</math>
Line 332 ⟶ 328:
A variant of the DCT-IV, where data from different transforms are ''overlapped'', is called the [[modified discrete cosine transform]] (MDCT).<ref>{{harvnb|Malvar|1992}}</ref>
The DCT-IV implies the boundary conditions: <math>
=== DCT V-VIII ===
DCTs of types I–IV treat both boundaries consistently regarding the point of symmetry: they are even/odd around either a data point for both boundaries or halfway between two data points for both boundaries. By contrast, DCTs of types V-VIII imply boundaries that are even/odd around a data point for one boundary and halfway between two data points for the other boundary.
In other words, DCT types I–IV are equivalent to real-even
However, these variants seem to be rarely used in practice. One reason, perhaps, is that [[Fast Fourier transform|FFT]] algorithms for odd-length DFTs are generally more complicated than [[Fast Fourier transform|FFT]] algorithms for even-length DFTs (e.g. the simplest radix-2 algorithms are only for even lengths), and this increased intricacy carries over to the DCTs as described below.
Line 346 ⟶ 342:
Using the normalization conventions above, the inverse of DCT-I is DCT-I multiplied by 2/(''N'' − 1). The inverse of DCT-IV is DCT-IV multiplied by 2/''N''. The inverse of DCT-II is DCT-III multiplied by 2/''N'' and vice versa.<ref name="pubRaoYip"/>
Like for the
== Multidimensional DCTs ==
Line 510 ⟶ 506:
Specialized DCT algorithms, on the other hand, see widespread use for transforms of small, fixed sizes such as the {{nobr| 8 × 8 }} DCT-II used in [[JPEG]] compression, or the small DCTs (or MDCTs) typically used in audio compression. (Reduced code size may also be a reason to use a specialized DCT for embedded-device applications.)
In fact, even the DCT algorithms using an ordinary FFT are sometimes equivalent to pruning the redundant operations from a larger FFT of real-symmetric data, and they can even be optimal from the perspective of arithmetic counts. For example, a type-II DCT is equivalent to a DFT of size <math>~ 4N ~</math> with real-even symmetry whose even-indexed elements are zero. One of the most common methods for computing this via an FFT (e.g. the method used in [[FFTPACK]] and [[Fastest Fourier Transform in the West|FFTW]]) was described by {{harvtxt|Narasimha|Peterson|1978}} and {{harvtxt|Makhoul|1980}}, and this method in hindsight can be seen as one step of a radix-4 decimation-in-time Cooley–Tukey algorithm applied to the "logical" real-even DFT corresponding to the DCT-II.{{efn|
The radix-4 step reduces the size <math>~ 4N ~</math> DFT to four size <math>~ N ~</math> DFTs of real data, two of which are zero, and two of which are equal to one another by the even symmetry. Hence giving a single size <math>~ N ~</math> FFT of real data plus <math>~ \mathcal{O}(N) ~</math> [[butterfly (FFT algorithm)|butterflies]], once the trivial and / or duplicate parts are eliminated and / or merged.
}}
Line 517 ⟶ 513:
}}).
A recent reduction in the operation count to <math>~ \tfrac{17}{9} N \log_2 N + \mathcal{O}(N)</math> also uses a real-data FFT.<ref>{{cite journal |doi=10.1016/j.sigpro.2008.01.004 |title=Type-II/III DCT/DST algorithms with reduced number of arithmetic operations |journal=Signal Processing |volume=88 |issue=6 |pages=1553–1564 |year=2008 |last1=Shao |first1=Xuancheng |last2=Johnson |first2=Steven G. |arxiv=cs/0703150 |bibcode=2008SigPr..88.1553S |s2cid=986733}}</ref> So, there is nothing intrinsically bad about computing the DCT via an FFT from an arithmetic perspective – it is sometimes merely a question of whether the corresponding FFT algorithm is optimal. (As a practical matter, the function-call overhead in invoking a separate FFT routine might be significant for small <math>~ N ~,</math> but this is an implementation rather than an algorithmic question since it can be solved by unrolling or inlining.)
==Example of IDCT==
[[File:DCT filter comparison.png|thumb|right|An example showing eight different filters applied to a test image (top left) by multiplying its DCT spectrum (top right) with each filter.]]
Consider this {{resx|8x8}} [[grayscale image]] of capital letter A.
[[File:letter-a-8x8.png|frame|center|Original size, scaled 10x (nearest neighbor), scaled 10x (bilinear).]]
Line 554 ⟶ 550:
== References ==
{{reflist
<ref name="Ahmed">{{cite journal |last=Ahmed |first=Nasir |author-link=N. Ahmed |title=How I Came Up With the Discrete Cosine Transform |journal=[[Digital Signal Processing (journal)|Digital Signal Processing]] |date=January 1991 |volume=1 |issue=1 |pages=4–5 |doi=10.1016/1051-2004(91)90086-Z |bibcode=1991DSP.....1....4A |url=https://www.
<ref name="Stankovic">{{cite journal | last1 = Stanković | first1 = Radomir S. | last2 = Astola | first2 = Jaakko T. |title = Reminiscences of the Early Work in DCT: Interview with K.R. Rao | journal = Reprints from the Early Days of Information Sciences | publisher = Tampere International Center for Signal Processing | date = 2012 | volume = 60 | url = https://ethw.org/w/images/1/19/Report-60.pdf | access-date = 2021-12-30 | archive-url = https://web.archive.org/web/20211230214050/https://ethw.org/w/images/1/19/Report-60.pdf | archive-date = 2021-12-30 | url-status = live | issn = 1456-2774 | isbn = 978-9521528187 | via = [[Engineering and Technology History Wiki|ETHW]] | df = dmy-all}}</ref>
Line 592 ⟶ 588:
<ref name="Bleidt">{{cite journal |last1=Bleidt |first1=R. L. |last2=Sen |first2=D. |last3=Niedermeier |first3=A. |last4=Czelhan |first4=B. |last5=Füg |first5=S. |display-authors=etal |title=Development of the MPEG-H TV Audio System for ATSC 3.0 |journal=IEEE Transactions on Broadcasting |date=2017 |volume=63 |issue=1 |pages=202–236 |doi=10.1109/TBC.2017.2661258 |s2cid=30821673 |url=https://www.iis.fraunhofer.de/content/dam/iis/en/doc/ame/Conference-Paper/BleidtR-IEEE-2017-Development-of-MPEG-H-TV-Audio-System-for-ATSC-3-0.pdf}}</ref>
▲
▲
▲
▲
▲
▲
▲
<ref name="FreeSWITCH">{{Cite web|url=https://signalwire.com/freeswitch|title=☏ FreeSWITCH|website=SignalWire}}</ref>
▲
}}
Line 600 ⟶ 614:
* {{Cite journal | last1 = Sorensen | first1 = H. | last2 = Jones | first2 = D. | last3 = Heideman | first3 = M. | last4 = Burrus | first4 = C. | title = Real-valued fast Fourier transform algorithms | doi = 10.1109/TASSP.1987.1165220 | journal = IEEE Transactions on Acoustics, Speech, and Signal Processing | volume = 35 | issue = 6 | pages = 849–863| date=June 1987 | citeseerx = 10.1.1.205.4523 }}
* {{Cite journal |last1=Plonka |first1=G. |author1-link= Gerlind Plonka |last2=Tasche|first2=M. |title=Fast and numerically stable algorithms for discrete cosine transforms |journal=Linear Algebra and Its Applications |volume=394 |issue=1 |pages=309–345 |date=January 2005 |doi=10.1016/j.laa.2004.07.015 |doi-access=free }}
* {{Cite journal | last1 = Duhamel | first1 = P. | last2 = Vetterli | first2 = M. | doi = 10.1016/0165-1684(90)90158-U | title = Fast fourier transforms: A tutorial review and a state of the art | journal = Signal Processing | volume = 19 | issue = 4 | pages = 259–299| date=April 1990 | bibcode = 1990SigPr..19..259D | url = http://infoscience.epfl.ch/record/59946 | type = Submitted manuscript }}
* {{Cite journal | last1 = Ahmed | first1 = N. | author-link1 = N. Ahmed| doi = 10.1016/1051-2004(91)90086-Z | title = How I came up with the discrete cosine transform | journal = Digital Signal Processing | volume = 1 | issue = 1| pages = 4–9 | date=January 1991 | bibcode = 1991DSP.....1....4A | url = https://www.scribd.com/doc/52879771/DCT-History-How-I-Came-Up-with-the-Discrete-Cosine-Transform}}
* {{Cite journal | last1 = Feig | first1 = E. | last2 = Winograd | first2 = S. | doi = 10.1109/78.157218 | title = Fast algorithms for the discrete cosine transform | journal = IEEE Transactions on Signal Processing | volume = 40 | issue = 9 | pages = 2174–2193| date=September 1992b | bibcode = 1992ITSP...40.2174F }}
* {{Citation |last1=Malvar |first1=Henrique |title=Signal Processing with Lapped Transforms |publisher=Artech House |___location=Boston |year=1992 |isbn=978-0-89006-467-2}}
Line 619 ⟶ 633:
* Takuya Ooura: General Purpose FFT Package, [http://www.kurims.kyoto-u.ac.jp/~ooura/fft.html FFT Package 1-dim / 2-dim]. Free C & FORTRAN libraries for computing fast DCTs (types II–III) in one, two or three dimensions, power of 2 sizes.
* Tim Kientzle: Fast algorithms for computing the 8-point DCT and IDCT, [http://drdobbs.com/parallel/184410889 Algorithm Alley].
* [
{{Compression Methods|state=expanded}}
Line 632 ⟶ 646:
[[Category:Data compression]]
[[Category:Image compression]]
[[Category:H.26x]]
[[Category:JPEG]]
|