© ISO/IEC 2006 — All rights reserved

ISO/IEC JTC 1/SC 29 N

Date: 2006-10-27

ISO/IEC CD 23002-2

ISO/IEC JTC 1/SC 29/WG 11

Secretariat:

Information technology — MPEG video technologies — Part 2: Fixedpoint 8x8 IDCT and DCT transforms

Élément introductif — Élément central — Partie 2: Titre de la partie

Warning

This document is not an ISO International Standard. It is distributed for review and comment. It is subject to change without notice and may not be referred to as an International Standard.

Recipients of this draft are invited to submit, with their comments, notification of any relevant patent rights of which they are aware and to provide supporting documentation.

Document type: International Standard

Document subtype:

Document stage: (30) Committee

Document language: E

D:\726986522.doc STD Version 2.1

ISO/IEC CD 23002-2

Copyright notice

This ISO document is a working draft or committee draft and is copyright-protected by ISO. While the reproduction of working drafts or committee drafts in any form for use by participants in the ISO standards development process is permitted without prior permission from ISO, neither this document nor any extract from it may be reproduced, stored or transmitted in any form for any other purpose without prior written permission from ISO.

Requests for permission to reproduce this document for the purpose of selling it should be addressed as shown below or to ISO's member body in the country of the requester:

[Indicate the full address, telephone number, fax number, telex number, and electronic mail address, as appropriate, of the Copyright Manger of the ISO member body responsible for the secretariat of the TC or

SC within the framework of which the working document has been prepared.]

Reproduction for sales purposes may be subject to royalty payments or a licensing agreement.

Violators may be prosecuted.

ii © ISO/IEC 2006 — All rights reserved

ISO/IEC CD 23002-2

Contents

Page

1 Scope ...................................................................................................................................................... 1

2 Terms and Definitions ........................................................................................................................... 1

2.1

array ........................................................................................................................................................ 1

2.2

discrete cosine transform (DCT) .......................................................................................................... 1

2.3

forward discrete cosine transform ...................................................................................................... 1

2.4

inverse discrete cosine transform (IDCT) ........................................................................................... 1

2.5

matrix ...................................................................................................................................................... 1

2.6

sample .................................................................................................................................................... 2

2.7

scalar value ............................................................................................................................................ 2

2.8

transform coefficient ............................................................................................................................. 2

3 Abbreviations and symbols ................................................................................................................. 2

3.1

Abbreviations ......................................................................................................................................... 2

3.2

Symbols .................................................................................................................................................. 2

4 Conventions ........................................................................................................................................... 2

4.1

Arithmetic operators ............................................................................................................................. 2

4.2

Logical operators .................................................................................................................................. 3

4.3

Relational operators .............................................................................................................................. 3

4.4

Bit-wise operators ................................................................................................................................. 3

4.5

Assignment operators .......................................................................................................................... 3

4.6

Mathematical functions ......................................................................................................................... 4

4.7

Range notation ...................................................................................................................................... 4

4.8

Hexadecimal notation ........................................................................................................................... 5

5 Fixed point 8x8 DCT and IDCT transform ........................................................................................... 5

5.1

Specification of fixed point 8x8 IDCT Transform (normative) .......................................................... 5

5.2

Specification of fixed point 8x8 DCT transform (informative) .......................................................... 6

© ISO/IEC 2006 — All rights reserved iii

ISO/IEC CD 23002-2

Foreword

ISO (the International Organization for Standardization) and IEC (the International Electrotechnical

Commission) form the specialized system for worldwide standardization. National bodies that are members of

ISO or IEC participate in the development of International Standards through technical committees established by the respective organization to deal with particular fields of technical activity. ISO and IEC technical committees collaborate in fields of mutual interest. Other international organizations, governmental and non-governmental, in liaison with ISO and IEC, also take part in the work. In the field of information technology, ISO and IEC have established a joint technical committee, ISO/IEC JTC 1.

International Standards are drafted in accordance with the rules given in the ISO/IEC Directives, Part 2.

The main task of the joint technical committee is to prepare International Standards. Draft International

Standards adopted by the joint technical committee are circulated to national bodies for voting. Publication as an International Standard requires approval by at least 75 % of the national bodies casting a vote.

Attention is drawn to the possibility that some of the elements of this document may be the subject of patent rights. ISO and IEC shall not be held responsible for identifying any or all such patent rights.

ISO/IEC 23002-2 was prepared by Joint Technical Committee ISO/IEC JTC 1, Information Technology ,

Subcommittee SC 29, Coding of Audio, Picture, Multimedia and Hypermedia Information .

ISO/IEC 23002 consists of the following parts, under the general title Information technology — MPEG video technologies :

Part 1: Accuracy requirements for implementation of integer-output 8x8 Inverse Discrete Cosine

Transform

Part 2: Fixed point 8x8 IDCT and DCT transforms iv © ISO/IEC 2006 — All rights reserved

ISO/IEC CD 23002-2

Introduction

A number of visual coding related specifications (see ref. [1-6] in bibliography) include a requirement for decoders to implement an integer-output 8x8 inverse discrete cosine transform (IDCT) for the generation of inverse-transformed sample differences with a nominal range from –2

B to (2 B ) –1 for some integer number of bits B, where B is greater than or equal to 6. Conformance requirements for establishing sufficient accuracy in such an integer-output IDCT implementation are specified in [7].

This part of the International Standard specifies a particular implementation of integer-output 8x8 IDCT transform, meeting the conformance criteria [7], and additionally provides a (non-normative) specification of an integer-output 8x8 forward DCT transform based on the same factorization structure.

© ISO/IEC 2006 — All rights reserved v

COMMITTEE DRAFT ISO/IEC CD 23002-2

Information technology — MPEG video technologies — Part 2:

Fixed-point 8x8 IDCT and DCT transforms

1 Scope

This part of the International Standard specifies a particular implementation of integer-output 8x8 IDCT transform, meeting the conformance criteria [7], and additionally providing (non-normative) specification of integer-output 8x8 forward DCT transform based on the same factorization structure.

2 Terms and Definitions

For the purposes of this document, the following terms and definitions apply.

2.1 array

An indexed collection of scalar values. Square parentheses are used to indicate the indexing of arrays. For example, s [5] denotes the entry at index 5 in the array s.

2.2 discrete cosine transform (DCT)

A transformation that produces an output matrix of transform coefficients from an input matrix of samples using some approximation of the process specified in subclause 5.1 or 5.2.

2.3 forward discrete cosine transform

A discrete cosine transform . The addition of the word "forward" in the term is used when a contrast with the concept of an inverse discrete cosine transform is intended to be emphasized.

2.4 inverse discrete cosine transform (IDCT)

A transformation that produces an output matrix of samples from an input matrix of transform coefficients using some approximation of the process specified in subclause 5.3 or 5.4.

2.5 matrix

An array with a two-dimensional index. When the matrix represents samples in a spatial sampling grid, the first (left-most) component of the index is considered to be the vertical component of the index and the second

(right-most) component of the index is considered to be the horizontal component of the index. For example, entry f [3][5] in a matrix f of samples would denote the entry at vertical position 3 and horizontal position 5.

When the matrix represents transform coefficients, the first (left-most) component of the index is considered to represent a vertical frequency index and the second (right-most) component of the index is considered to represent a horizontal frequency index. For example, entry F [3][5] in a matrix F of transform coefficients would denote the entry with vertical frequency index 3 and horizontal frequency index 5.

© ISO/IEC 2006 — All rights reserved

1

ISO/IEC CD 23002-2

2.6 sample

An entry in a matrix that is the input of a discrete cosine transform or the output of an inverse discrete cosine transform.

2.7 scalar value

An integer or a real-valued number.

2.8 transform coefficient

An entry in a matrix that is the output of a forward discrete cosine transform or the input of an inverse discrete cosine transform.

3 Abbreviations and symbols

For purposes of this document, the following listed abbreviations and symbols apply.

3.1 Abbreviations

DC : referring to the entry in a matrix of transform coefficients associated with the index coordinate pair [0, 0].

DCT : discrete cosine transform

IDCT : Inverse DCT

3.2 Symbols

: Archimedes' constant 3,141 592 653 589 793 238 462 643 …

4 Conventions

4.1 Arithmetic operators

The following arithmetic operators are defined.

Addition

Subtraction (as a two-argument operator) or negation (as a unary prefix operator)

Multiplication * x y Exponentiation. Specifies x to the power of y . x y

Division. Specifies division of x by y , producing a real-valued number result.

The use of 64-bit floating-point precision for the computation of arithmetic operations is acceptable for purposes of this part of this International Standard.

When an order of operations is not indicated explicitly by use of parenthesis, the following rules apply

2

© ISO/IEC 2006 — All rights reserved

ISO/IEC CD 23002-2

– multiplication and division operations are considered to take place before addition and subtraction

– multiplication and division operations in sequence are evaluated sequentially from left to right

– addition and subtraction operations in sequence are evaluated sequentially from left to right

4.2 Logical operators

A logical operator is defined as follows c ? d : e If the condition c is TRUE, evaluates to the value of d ; otherwise, evaluates to the value of e.

4.3 Relational operators

The following relational operators are defined.

 

Equal to

Less than

Greater than



Less than or equal to



Greater than or equal to

The relational operators return the value TRUE if the expressed condition is fulfilled and otherwise return the value FALSE.

4.4 Bit-wise operators

The following bit-wise operators are defined.

& Bit-wise "and". When operating on integer arguments, operates on two's complement representations of the integer values. When operating on a binary argument that contains fewer bits than another argument, the shorter argument is extended by adding more significant bits equal to 0.

4.5 Assignment operators

An assignment operator is defined as follows. c

 d

Assigns the variable c equal to the value of d .

© ISO/IEC 2006 — All rights reserved

3

ISO/IEC CD 23002-2

The assignment operator is considered to take effect after all other operations in an equation have been completed.

4.6 Mathematical functions

The following mathematical functions are defined. x is the square root of an argument x. abs( x )

 x x

;

; x

 x

0

0 clip3( x , y , z ) =

 x y z

;

;

;

z

 z

 x y

otherwise

cos( x ) the trigonometric cosine function operating on an argument x in units of radians. floor( x ) the greatest integer less than or equal to x . max( x , y ) =

 x y

;

; x x



 y y round( x ) = sign( x ) * floor( abs( x ) + 0.5 + ε ) where ε = 0

[Ed. Note: The issue of the rounding method to be specified when performing integer rounding of the result of the forward and inverse transformed data is a subject of investigation toward finalization in the

AHG work on the IDCT CfP. The desire is to achieve results equivalent to those that would be obtained from infinite-precision arithmetic (compensating for minor differences in floating-point implementation of cosine function approximation and other mathematical results).] sign( x )

1

1

;

; x

 x

0

0

The use of 64-bit floating-point precision for the computation of mathematical functions is acceptable for purposes of this part of this International Standard.

4.7 Range notation

The following notation is used to specify a range of values.

4

© ISO/IEC 2006 — All rights reserved

ISO/IEC CD 23002-2

x = y .. z x takes on integer values starting from y to z inclusive, with x , y , and z being integer numbers.

4.8 Hexadecimal notation

Hexadecimal notation, indicated by prefixing the hexadecimal number by "0x", may be used when the number of bits used to represent an integer value is an integer multiple of 4. For example, 0x41 represents an eightbit string having only its second-most-significant and its least-significant bits equal to 1.

5 Fixed point 8x8 DCT and IDCT transform

5.1 Specification of fixed point 8x8 IDCT Transform (normative)

The underlying 8-point factorization adopted in this algorithm is presented in Figure 1. It is based on a variant of C. Loeffler, A. Ligtenberg, and G. S. Moschytz [8] factorization, converted to a scaled form by moving factors 2 in paths of coefficients 3 and 5 outside the transform.

X

0

X

4

 x x x

2

1

0

X

2

X

6

X

7

 x x

3

4

2

2

X

X

X

3

5

1

 

 

2

2 sin

3

/ 8

 sin

3

/ 8

 

  cos

/ 16

 sin

/ 16

 

  cos sin

3

3

/

/ 16

16

 x x

6 x

7

5

Figure 1 — 8-point IDCT factorization

In order to compute two-dimensional (2D) 8x8 transform, 2D scaling process is applied first, followed by a series of 8-point 1D transforms, applied for all rows, and then for all columns in the 8x8 matrix.

The scaling process consists of point-wise integer multiplications of input coefficients by corresponding factors in the following matrix:

© ISO/IEC 2006 — All rights reserved

5

ISO/IEC CD 23002-2

S =

A B C D A D C B

B E F G B G F E

C F H I C I H F

D G I J D J I G

A B C D A D C B

D G I J D J I G

C F H I C I H F

B E F G B G F E

The numerical values of parameters A-J of this matrix and example multiplier-less algorithms for computing products are presented in Table 1.

Additionally, after scaling multiplications are performed, the DC coefficient is modified by adding 4096 to its value. This offset ensures proper rounding at the end of the transform.

The row- and column- 1D transforms are performed as directed by the factorization in Figure 1, and where approximations of multiplications by constants

 and

 are computed using fixed-point algorithms described in Table 1.

Finally, after row- and column- 1D transforms are applied, all coefficients are shifted right by 13.

Table 1 — Constant factors and multiplier-less decompositions used in the fixed-point algorithm

Factor

A

B

C

D

E

F

G

H

I

J











Value

1024

867

1278

1226

734

1082

1038

1595

1530

1468

Algorithms: x=x*[ A,…,J   y=x*[

 x<<10; x2=x+(x<<1), x3=x2<<3, x4=x2+x3, x=x2+(x4<<5); x2=x+(x<<2), x=-(x<<1)+(x2<<8); x2=x+(x<<3), x3=x2+(x2<<4), x=(x<<1)+(x3<<3); x2=x<<1, x3=x+x2, x5=-x+(x3<<3), x=-x2+(x5<<5); x2=x+(x<<4), x3=(x<<1)+(x<<2), x=-x3+(x2<<6) x2=(x<<4), x3=x2-(x<<1), x=x3+(x2<<6); x2=x+(x<<2), x3=x2+(x2<<2), x=-x2+(x3<<6); x2=(x<<1)+(x<<2), x=(x2<<8)–x2; x2=x<<2, x3=((x2-x)<<3)-x, x=-x2+(x3<<6);

111/256

67/64 x2=x>>4, x3=x+x2, x4=x-(x3>>3), x=x4>>1; y=x3-(x2>>2);

18981/16384 x2=x>>2, x3=x+x2, x4=x+(x3>>3),

59/256 y=x2-(x3>>6); x=x4+(x4>>9);

16091/16384 x2=x+(x>>4), x3=x2+(x>>2), y=x3>>1,

21/32 x5=x2+(y>>3), x=x-(x5>>6);

Complexity of scaled 1D transform:

Total complexity of 2D scaling:

Complexity of 2D transform without scaling:

Complexity of a complete 2D transform:

Complexity

Adds Shifts

3

3

3

2

0

3

2

3

2

3

3 4

4

3

4

3

1

3

3

3

3

3

4

4

4

5

48

156

26

200

768 416

924+1 616+64

Times used

8

4

8

8

4

8

8

4

8

4

2

2

2

All right shifts used in the algorithm are arithmetic (sign bit preserving) shifts.

In order to prevent overflows all arithmetic operations involved in computation of 1d transforms shall have at least 26-bits of precision. All arithmetic operations involved in computation of scaling shall have at least 24bits of precision.

5.2 Specification of fixed point 8x8 DCT transform (informative)

[The text of this informative section is to be finalized and provided in FCD of the standard]

6

© ISO/IEC 2006 — All rights reserved

ISO/IEC CD 23002-2

Bibliography

[1] ITU-T Rec. T.81 (1992) | ISO/IEC 10918-1:1994, Information technology — Digital compression and coding of continuous-tone still images: Requirements and guidelines

[2] ISO/IEC 11172-2:1993, Information technology — Coding of moving picture and associated audio for digital storage media at up to about 1,5 Mbits/s — Part 2: Video

[3] ITU-T Rec. H.262 (2000) | ISO/IEC 13818-2:2000, Information technology — Generic coding of moving pictures and associated audio information: Video

[4] ISO/IEC 14496-2:2004, Information technology — Coding of audiovisual objects — Part 2: Visual

[5] ITU-T Recommendation H.261 (1993), Video codec for audiovisual services at px64 kbit/s

[6] ITU-T Recommendation H.263 (2000), Video coding for low bit rate communication

[7] ISO/IEC FCD 11172-6: Information technology — Coding of moving pictures and associated audio for digital storage media at up to about 1,5 Mbit/s — Part 6: Specification of accuracy requirements for implementation of integer-output 8x8 inverse discrete cosine transform.

[8] C. Loeffler, A. Ligtenberg, and G. S. Moschytz, “Practical fast 1-D DCT algorithms with 11 multiplications,” Proc. IEEE International Conference on Acoustic, Speech, and Signal Proc.

(ICASSP), vol. 2, pp. 988-991, Feb. 1989.

© ISO/IEC 2006 — All rights reserved

7