`
`ITU-T
`
`TELECOMMUNICATION
`STANDARDIZATION SECTOR
`OF ITU
`
`H.261
`(03/93)
`
`LINE TRANSMISSION OF NON-TELEPHONE
`SIGNALS
`
`VIDEO CODEC FOR AUDIOVISUAL
`SERVICES AT p x 64 kbits
`
`ITU-T Recommendation H.261
`
`(Previously "CCITT Recommendation")
`
`IPR2016-01710
`UNIFIED EX1028
`
`
`
`FOREWORD
`
`The ITU Telecommunication Standardization Sector (ITU-T) is a permanent organ of the International Telecom-
`munication Union. The ITU-T is responsible for studying technical, operating and tariff questions and issuing
`Recommendations on them with a view to standardizing telecommunications on a worldwide basis.
`
`The World Telecommunication Standardization Conference (WTSC), which meets every four years, established the
`topics for study by the ITU-T Study Groups which, in their turn, produce Recommendations on these topics.
`
`ITU-T Recommendation H.261 was revised by the ITU-T Study Group XV (1988-1993) and was approved by the WTSC
`(Helsinki, March 1-12, 1993).
`
`___________________
`
`NOTES
`
`As a consequence of a reform process within the International Telecommunication Union (ITU), the CCITT
`1
`ceased to exist as of 28 February 1993. In its place, the ITU Telecommunication Standardization Sector (ITU-T) was
`created as of 1 March 1993. Similarly, in this reform process, the CCIR and the IFRB have been replaced by the
`Radiocommunication Sector.
`
`In order not to delay publication of this Recommendation, no change has been made in the text to references containing
`the acronyms “CCITT, CCIR or IFRB” or their associated entities such as Plenary Assembly, Secretariat, etc. Future
`editions of this Recommendation will contain the proper terminology related to the new ITU structure.
`
`In this Recommendation, the expression “Administration” is used for conciseness to indicate both a
`2
`telecommunication administration and a recognized operating agency.
`
`All rights reserved. No part of this publication may be reproduced or utilized in any form or by any means, electronic or
`mechanical, including photocopying and microfilm, without permission in writing from the ITU.
`
` ITU 1994
`
`ª
`
`
`1
`2
`
`3
`
`Scope..............................................................................................................................................................
`Brief specification ..........................................................................................................................................
`2.1
`Video input and output .....................................................................................................................
`2.2
`Digital output and input ....................................................................................................................
`2.3
`Sampling frequency..........................................................................................................................
`2.4
`Source coding algorithm...................................................................................................................
`2.5
`Bit rate ..............................................................................................................................................
`2.6
`Symmetry of transmission.................................................................................................................
`2.7
`Error handling...................................................................................................................................
`2.8
`Multipoint operation .........................................................................................................................
`Source coder...................................................................................................................................................
`3.1
`Source format ...................................................................................................................................
`3.2
`Video source coding algorithm.........................................................................................................
`3.3
`Coding control ..................................................................................................................................
`3.4
`Forced updating ................................................................................................................................
`Video multiplex coder....................................................................................................................................
`4.1
`Data structure....................................................................................................................................
`4.2
`Video multiplex arrangement ...........................................................................................................
`4.3
`Multipoint considerations .................................................................................................................
`Transmission coder ........................................................................................................................................
`5.1
`Bit rate ..............................................................................................................................................
`5.2
`Video data buffering .........................................................................................................................
`5.3
`Video coding delay...........................................................................................................................
`5.4
`Forward error correction for coded video signal ..............................................................................
`Annex A – Inverse transform accuracy specification ..............................................................................................
`Annex B – Hypothetical reference decoder .............................................................................................................
`Annex C – Codec delay measurement method ........................................................................................................
`Annex D – Still image transmission ........................................................................................................................
`
`4
`
`5
`
`
`
`
`
`CONTENTS
`
`Page
`1
`1
`2
`2
`2
`2
`2
`3
`3
`3
`3
`3
`3
`6
`6
`7
`7
`7
`18
`19
`19
`19
`20
`20
`21
`22
`23
`24
`
`Recommendation H.261 (03/93)
`
`i
`
`
`
`
`
`Recommendation H.261
`
`
`
`
`
`VIDEO CODEC FOR AUDIOVISUAL SERVICES AT p × 64 kbit/s
`
`(Geneva, 1990; revised at Helsinki, 1993)
`
`The CCITT,
`
`considering
`
`(a)
`
`that there is significant customer demand for videophone, videoconference and other audiovisual services;
`
`that circuits to meet this demand can be provided by digital transmission using the B, H0 rates or their multiples
`(b)
`up to the primary rate or H11/H12 rates;
`
`that ISDNs are likely to be available in some countries that provide a switched transmission service at the B, H0
`(c)
`or H11/H12 rate;
`
`that the existence of different digital hierarchies and different television standards in different parts of the world
`(d)
`complicates the problems of specifying coding and transmission standards for international connections;
`
`that a number of audiovisual services are likely to appear using basic and primary rate ISDN accesses and that
`(e)
`some means of intercommunication among these terminals should be possible;
`
`that the video codec provides an essential element of the infrastructure for audiovisual services which allows
`(f)
`such intercommunication in the framework of Recommendation H.200;
`
`that Recommendation H.120 for videoconferencing using primary digital group transmission was the first in an
`(g)
`evolving series of Recommendations,
`
`appreciating
`
`that advances have been made in research and development of video coding and bit rate reduction techniques which lead
`to the use of lower bit rates down to 64 kbit/s so that this may be considered as the second in the evolving series of
`Recommendations,
`
`and noting
`
`that it is the basic objective of the CCITT to recommend unique solutions for international connections,
`
`recommends
`
`that in addition to those codecs complying to Recommendation H.120, codecs having signal processing and transmission
`coding characteristics described below should be used for international audiovisual services.
`
`NOTES
`
`1
`
`2
`
`Codecs of this type are also suitable for some television services where full broadcast quality is not required.
`
`Equipment for transcoding from and to codecs according to Recommendation H.120 is under study.
`
`1
`
`Scope
`
`This Recommendation describes the video coding and decoding methods for the moving picture component of
`audiovisual services at the rates of p ·
` 64 kbit/s, where p is in the range 1 to 30.
`
`2
`
`Brief specification
`
`An outline block diagram of the codec is given in Figure 1.
`
`Recommendation H.261 (03/93)
`
`1
`
`
`
`External control
`
`Coding control
`
`Source
`coder
`
`Video multiplex
`coder
`
`Transmission
`buffer
`
`Transmission
`coder
`
`Video
`signal
`
`a) Video coder
`
`Coded
`bit stream
`
`Source
`decoder
`
`Video multiplex
`decoder
`
`Receiving
`buffer
`
`Receiving
`decoder
`
`b) Video decoder
`
`T1502430-90/d01
`
`FIGURE 1/H.261
`Outline block diagram of the video codec
`
`
`
`
`
`
`
`2.1
`
`Video input and output
`
`To permit a single Recommendation to cover use in and between regions using 625- and 525-line television standards, the
`source coder operates on pictures based on a common intermediate format (CIF). The standards of the input and output
`television signals, which may, for example, be composite or component, analogue or digital and the methods of
`performing any necessary conversion to and from the source coding format are not subject to Recommendation.
`
`2.2
`
`Digital output and input
`
`The video coder provides a self-contained digital bit stream which may be combined with other multi-facility signals (for
`example as defined in Recommendation H.221). The video decoder performs the reverse process.
`
`2.3
`
`Sampling frequency
`
`Pictures are sampled at an integer multiple of the video line rate. This sampling clock and the digital network clock are
`asynchronous.
`
`2.4
`
`Source coding algorithm
`
`A hybrid of inter-picture prediction to utilize temporal redundancy and transform coding of the remaining signal to
`reduce spatial redundancy is adopted. The decoder has motion compensation capability, allowing optional incorporation
`of this technique in the coder.
`
`2.5
`
`Bit rate
`
`This Recommendation is primarily intended for use at video bit rates between approximately 40 kbit/s and 2 Mbit/s.
`
`2
`
`Recommendation H.261 (03/93)
`
`
`
`2.6
`
`Symmetry of transmission
`
`The codec may be used for bidirectional or unidirectional visual communication.
`
`2.7
`
`Error handling
`
`The transmitted bit-stream contains a BCH code (Bose, Chaudhuri and Hocquengham) (511,493) forward error
`correction code. Use of this by the decoder is optional.
`
`2.8
`
`Multipoint operation
`
`Features necessary to support switched multipoint operation are included.
`
`3
`
`Source coder
`
`3.1
`
`Source format
`
`The source coder operates on non-interlaced pictures occurring 30 000/1001 (approximately 29.97) times per second.
`The tolerance on picture frequency is –
` 50 ppm.
`
`Pictures are coded as luminance and two colour difference components (Y, CB and CR). These components and the codes
`representing their sampled values are as defined in CCIR Recommendation 601.
`Black = 16
`White = 235
`Zero colour difference = 128
`Peak colour difference = 16 and 240.
`
`These values are nominal ones and the coding algorithm functions with input values of 1 through to 254.
`
`Two picture scanning formats are specified.
`
`In the first format (CIF), the luminance sampling structure is 352 pels per line, 288 lines per picture in an orthogonal
`arrangement. Sampling of each of the two colour difference components is at 176 pels per line, 144 lines per picture,
`orthogonal. Colour difference samples are sited such that their block boundaries coincide with luminance block
`boundaries as shown in Figure 2. The picture area covered by these numbers of pels and lines has an aspect ratio of 4:3
`and corresponds to the active portion of the local standard video input.
`
`NOTE – The number of pels per line is compatible with sampling the active portions of the luminance and colour
`difference signals from 525- or 625-line sources at 6.75 and 3.375 MHz, respectively. These frequencies have a simple relationship to
`those in CCIR Recommendation 601.
`
`The second format, quarter-CIF (QCIF), has half the number of pels and half the number of lines stated above. All codecs
`must be able to operate using QCIF. Some codecs can also operate with CIF.
`
`Means shall be provided to restrict the maximum picture rate of encoders by having at least 0, 1, 2 or 3 non-transmitted
`pictures between transmitted ones. Selection of this minimum number and CIF or QCIF shall be by external means (for
`example via Recommendation H.221).
`
`3.2
`
`Video source coding algorithm
`
`The source coder is shown in generalized form in Figure 3. The main elements are prediction, block transformation and
`quantization.
`
`The prediction error (INTER mode) or the input picture (INTRA mode) is subdivided into 8 pel by 8 line blocks which
`are segmented as transmitted or non-transmitted. Further, four luminance blocks and the two spatially corresponding
`colour difference blocks are combined to form a macroblock as shown in Figure 10.
`
`Recommendation H.261 (03/93)
`
`3
`
`
`
`x x x x x x
`0
`0
`0
`x x x x x x
`-·-·-·-·- -·-·-·-·-·-·-·-·-·-·
`x x x x x x
`0
`0
`0
`x x x x x x
`x x x x x x
`0
`0
`0
`x x x x x x
`
`T1 50818G-92/d02
`
`Luminance sample
`
`Chrominance sample
`
`x
`0
`-·-·-·-· Block edge
`
`FIGURE 2/H.261
`Positioning of luminance and chrominance samples
`
`The criteria for choice of mode and transmitting a block are not subject to recommendation and may be varied
`dynamically as part of the coding control strategy. Transmitted blocks are transfo1med and resulting coefficients are
`quantized and variable length coded.
`
`3.2.1
`
`Prediction
`
`The prediction is inter-picture and may be augmented by motion compensation (see 3.2.2) and a spatial filter (see 3.2.3).
`
`3.2.2 Motion compensation
`
`Motion compensation (MC) is optional in the encoder. The decoder will accept one vector per macroblock. Both
`horizontal and vertical components of these motion vectors have integer values not exceeding± 15. The vector is used for
`all four luminance blocks in the macroblock. The motion vector for both colour difference blocks is derived by halving
`the component values of the macroblock vector and trnncating the magnitude parts towards zero to yield integer
`components.
`
`A positive value of the horizontal or vertical component of the motion vector signifies that the prediction is fo1med from
`pels in the previous picture which are spatially to the right or below the pels being predicted.
`
`Motion vectors are restricted such that all pels referenced by them are within the coded picture area.
`
`4
`
`Recommendation H.261
`
`(03/93)
`
`
`
`cc
`
`T
`
`Q
`
`Q-1
`
`To video
`ultiplex
`coder
`
`F
`
`p
`
`T1502441·90/d03
`
`Transform
`T
`Q Quantizer
`P
`Picture memory with motion compensated variable delay
`F
`Loop filter
`CC Coding control
`Flag for INTRA/INTER
`p
`t
`Flag for transmitted or not
`qz Quantizer indication
`q
`Quantizing index for transform coefficients
`v
`Motion vector
`Switching on/off of the loop filter
`f
`
`FIGURE 3/H.261
`
`Source coder
`
`3.2.3
`
`Loop filter
`
`The prediction process may be modified by a two-dimensional spatial filter (FIL) which operates on pels within a
`predicted 8 by 8 block.
`
`The filter is separable into one-dimensional horizontal and vertical functions. Both are non-recursive with coefficients of
`1/4, 112, 1/4 except at block edges where one of the taps would fall outside the block. In such cases the 1-D filter is
`changed to have coefficients of 0, 1, 0. Full arithmetic precision is retained with rounding to 8 bit integer values at the
`2-D filter output. Values whose fractional pa1t is one half are rounded up.
`
`The filter is switched on/off for all six blocks in a macroblock according to the macroblock type (see 4.2.3, MTYPE).
`
`Recommendation H.261
`
`(03/93)
`
`5
`
`
`
`3.2.4
`
`Transformer
`
`Transmitted blocks are first processed by a separable two-dimensional discrete cosine transform of size 8 by 8. The
`output from the inverse transform ranges from –256 to +255 after clipping to be represented with 9 bits. The transfer
`function of the inverse transform is given by:
`
`
`
`f x y( ,
`
`
`
`) =
`
`1
`
`4
`
`7
`
`(cid:229) (cid:229)
`=
`
`u
`
`7
`
`=
`
`0
`
`v
`
`0
`
`
`
`C u C v F u v( ) ( ) ( ,
`
`
`
`
`
`
`
`+p p
`) cos [ (
`
`] cos [ (
`2
`)1
`16
`x
`u
`/
`
`
`
`2
`
`y
`
`+
`
`
`
`)1
`
`v
`
`/
`
`16
`
`]
`
`with
`
`u, v, x, y = 0, 1, 2, . . ., 7
`
`where
`
`x,y = spatial coordinates in the pel domain,
`
`u,v = coordinates in the transform domain,
`
`C u( )
`
`=
`
` 1 / 2
`
` for u = 0; otherwise 1,
`
`C v( )
`
`=
`
` 1 / 2
`
` for v = 0; otherwise 1.
`NOTE – Within the block being transformed, x = 0 and y = 0 refer to the pel nearest the left and top edges of the picture,
`respectively.
`
`The arithmetic procedures for computing the transforms are not defined, but the inverse one should meet the error
`tolerance specified in Annex A.
`
`3.2.5
`
`Quantization
`
`The number of quantizers is 1 for the INTRA dc coefficient and 31 for all other coefficients. Within a macroblock the
`same quantizer is used for all coefficients except the INTRA dc one. The decision levels are not defined. The INTRA dc
`coefficient is nominally the transform value linearly quantized with a stepsize of 8 and no dead-zone. Each of the other 31
`quantizers is also nominally linear but with a central dead-zone around zero and with a step size of an even value in the
`range 2 to 62.
`
`The reconstruction levels are as defined in 4.2.4.
`
`NOTE – For the smaller quantization step sizes, the full dynamic range of the transform coefficients cannot be represented.
`
`3.2.6
`
`Clipping of reconstructed picture
`
`To prevent quantization distortion of transform coefficient amplitudes causing arithmetic overflow in the encoder and
`decoder loops, clipping functions are inserted. The clipping function is applied to the reconstructed picture which is
`formed by summing the prediction and the prediction error as modified by the coding process. This clipper operates on
`resulting pel values less than 0 or greater than 255, changing them to 0 and 255, respectively.
`
`3.3
`
`Coding control
`
`Several parameters may be varied to control the rate of generation of coded video data. These include processing prior to
`the source coder, the quantizer, block significance criterion and temporal sub-sampling. The proportions of such
`measures in the overall control strategy are not subject to recommendation.
`
`When invoked, temporal sub-sampling is performed by discarding complete pictures.
`
`3.4
`
`Forced updating
`
`This function is achieved by forcing the use of the INTRA mode of the coding algorithm. The update pattern is not
`defined. For control of accumulation of inverse transform mismatch error a macroblock should be forcibly updated at
`least once per every 132 times it is transmitted.
`
`6
`
`Recommendation H.261 (03/93)
`
`
`
`4
`
`Video multiplex coder
`
`4.1
`
`Data structure
`
`Unless specified otherwise the most significant bit is transmitted first. This is bit 1 and is the leftmost bit in the code
`tables in this Recommendation. Unless specified otherwise all unused or spare bits are set to “1”. Spare bits must not be
`used until their functions are specified by the CCITT.
`
`4.2
`
`Video multiplex arrangement
`
`The video multiplex is arranged in a hierarchical structure with four layers. From top to bottom the layers are:
`
`–
`
`–
`
`picture;
`
`Group of blocks (GOB);
`
`– Macroblock (MB);
`
`–
`
`Block.
`
`A syntax diagram of the video multiplex coder is shown in Figure 4. Abbreviations are defined in later subclauses.
`
`4.2.1
`
`Picture layer
`
`Data for each picture consists of a picture header followed by data for GOBs. The structure is shown in Figure 5. Picture
`headers for dropped pictures are not transmitted.
`
`4.2.1.1
`
`Picture start code (PSC) (20 bits)
`
`A word of 20 bits. Its value is 0000 0000 0000 0001 0000.
`
`4.2.1.2 Temporal reference (TR) (5 bits)
`
`A 5-bit number which can have 32 possible values. It is formed by incrementing its value in the previously transmitted
`picture header by one plus the number of non-transmitted pictures (at 29.97 Hz) since that last transmitted one. The
`arithmetic is performed with only the five LSBs.
`
`4.2.1.3 Type information (PTYPE) (6 bits)
`
`Information about the complete picture:
`
`Bit 1
`
`Bit 2
`
`Bit 3
`
`Bit 4
`
`Bit 5
`
`Bit 6
`
`Split screen indicator, “0” off, “1” on;
`
`Document camera indicator, “0” off, “1” on;
`
`Freeze picture release, “0” off, “1” on;
`
`Source format, “0” QCIF, “1” CIF;
`
`Optional still image mode HI_RES defined in Annex D; “0” on, “1” off;
`
`Spare.
`
`4.2.1.4 Extra insertion information (PEI) (1 bit)
`
`A bit which when set to “1” signals the presence of the following optional data field.
`
`4.2.1.5
`
`Spare information (PSPARE) (0/8/16 . . . bits)
`
`If PEI is set to “1”, then 9 bits follow consisting of 8 bits of data (PSPARE) and then another PEI bit to indicate if a
`further 9 bits follow and so on. Encoders must not insert PSPARE until specified by the CCITT. Decoders must be
`designed to discard PSPARE if PEI is set to 1. This will allow the CCITT to specify future backward compatible
`additions in PSPARE.
`
`Recommendation H.261 (03/93)
`
`7
`
`
`
`Picture layer
`
`PSC
`
`TR
`
`PTYPE
`
`PEI
`
`PSPARE
`
`GOB layer
`
`GOB layer
`
`GBSC
`
`GN
`
`GQUANT
`
`GEi
`
`GSPARE
`
`MB layer
`
`MB layer
`
`MVD
`
`MBA
`
`MQUANT
`
`MVD
`
`CBP
`
`Block layer
`
`CBP
`
`MBA stuffing
`
`T1502451-90/d04
`
`Block layer
`
`D Fixed length
`0
`
`Variable length
`
`FIGURE 4/H.261
`Syntax diagram for the video multiplex coder
`
`8
`
`Recommendation H-261
`
`(03/93)
`
`
`
`~~P_s_c~~~~T-R~~~~PTY~P-E~~~-P_E_1 ~§ PSPARE
`
`PEI § GOB data
`
`T1 514230-93/d05
`
`FIGURE 5/H.261
`Structure of pictw·e layer
`
`4.2.2
`
`Group of blocks layer
`
`Each picture is divided into groups of blocks (GOBs). A group of blocks (GOB) comprises one twelfth of the CIF or one
`third of the QCIF picture areas (see Figure 6) . A GOB relates to 176 pels by 48 lines ofY and the spatially con-esponding
`88 pels by 24 lines of each of CB and CR.
`
`Data for each group of blocks consists of a GOB header followed by data for macroblocks. The strncture is shown in
`Figure 7. Each GOB header is transmitted once betv.•een picture sta1t codes in the CIF or QCIF sequence numbered in
`Figure 6, even if no macroblock data is present in that GOB.
`
`1
`
`3
`
`5
`
`7
`
`9
`
`11
`
`2
`
`4
`
`6
`
`8
`
`10
`
`12
`
`CIF
`
`QCIF
`
`FIGURE 6/H.261
`
`Arrangement of GOBs in a pictu re
`
`GBSC
`
`GN
`
`GQUANT
`
`GEi § GSPARE
`
`GEi § MBdata
`
`T1514240·93/d06
`
`FIGURE 7/H.261
`
`Structure of gr oup of blocks layer
`
`Recommendation H.261
`
`(03/93)
`
`9
`
`
`
`4.2.2.1 Group of blocks start code (GBSC) (16 bits)
`
`A word of 16 bits, 0000 0000 0000 0001.
`
`4.2.2.2 Group number (GN) (4 bits)
`
`Four bits indicating the position of the group of blocks. The bits are the binary representation of the number in Figure 6.
`Group numbers 13, 14 and 15 are reserved for future use. Group number 0 is used in the PSC.
`
`4.2.2.3 Quantizer information (GQUANT) (5 bits)
`
`A fixed length codeword of 5 bits which indicates the quantizer to be used in the group of blocks until overridden by any
`subsequent MQUANT. The codewords are the natural binary representations of the values of QUANT (see 4.2.4) which,
`being half the step sizes, range from 1 to 31.
`
`4.2.2.4 Extra insertion information (GEI) (1 bit)
`
`A bit which when set to “1” signals the presence of the following optional data field.
`
`4.2.2.5
`
`Spare information (GSPARE) (0/8/16 . . . bits)
`
`If GEI is set to “1”, then 9 bits follow consisting of 8 bits of data (GSPARE) and then another GEI bit to indicate if a
`further 9 bits follow and so on. Encoders must not insert GSPARE until specified by the CCITT. Decoders must be
`designed to discard GSPARE if GEI is set to 1. This will allow the CCITT to specify future “backward” compatible
`additions in GSPARE.
`NOTE – Emulation of start codes may occur if the future specification of GSPARE has no restrictions on the final
`GSPARE data bits.
`
`4.2.3
`
`Macroblock layer
`
`Each GOB is divided into 33 macroblocks as shown in Figure 8. A macroblock relates to 16 pels by 16 lines of Y and the
`spatially corresponding 8 pels by 8 lines of each of CB and CR.
`
`Data for a macroblock consists of an MB header followed by data for blocks (see Figure 9). MQUANT, MVD and CBP
`are present when indicated by MTYPE.
`
`1
`
`12
`
`23
`
`2
`
`13
`
`24
`
`3
`
`14
`
`25
`
`4
`
`15
`
`26
`
`5
`
`16
`
`27
`
`6
`
`17
`
`28
`
`7
`
`18
`
`29
`
`8
`
`19
`
`30
`
`9
`
`20
`
`31
`
`10
`
`21
`
`32
`
`11
`
`22
`
`33
`
`FIGURE 8/H.261
`
`Arrangement of macroblocks in a GOB
`
`MBA
`
`MTYPE
`
`MQUANT
`
`MVD
`
`CBP
`
`Block data
`
`FIGURE 9/H.261
`
`Structure of macroblock layer
`
`10
`
`Recommendation H.261 (03/93)
`
`
`
`4.2.3.1 Macroblock address (MBA) (Variable length)
`
`A variable length codeword indicating the position of a macroblock within a group of blocks. The transmission order is as
`shown in Figure 8. For the first transmitted macroblock in a GOB, MBA is the absolute address in Figure 8. For
`subsequent macroblocks, MBA is the difference between the absolute addresses of the macroblock and the last
`transmitted macroblock. The code table for MBA is given in Table 1.
`
`An extra codeword is available in the table for bit stuffing immediately after a GOB header or a coded macroblock (MBA
`stuffing). This codeword should be discarded by decoders.
`
`The VLC for start code is also shown in Table 1.
`
`MBA is always included in transmitted macroblocks.
`
`Macroblocks are not transmitted when they contain no information for that part of the picture.
`
`TABLE 1/H.261
`
`VLC table for macroblock addressing
`
`MBA
`
`Code
`
`MBA
`
`Code
`
`17
`18
`19
`20
`21
`22
`23
`24
`25
`26
`27
`28
`29
`30
`31
`32
`33
`MBA stuffing
`Start code
`
`0000
`0000
`0000
`0000
`0000
`0000
`0000
`0000
`0000
`0000
`0000
`0000
`0000
`0000
`0000
`0000
`0000
`0000
`0000
`
`0101
`0101
`0101
`0100
`0100
`0100
`0100
`0100
`0100
`0011
`0011
`0011
`0011
`0011
`0011
`0011
`0011
`0001
`0000
`
`10
`01
`00
`11
`10
`011
`010
`001
`000
`111
`110
`101
`100
`011
`010
`001
`000
`111
`0000
`
`0001
`
`1
`0
`111
`110
`1011
`1010
`1001
`1000
`0111
`0110
`0101
`
`11
`
`10
`
`11
`010
`0011
`0010
`0001
`0001
`0000
`0000
`0000
`0000
`0000
`0000
`0000
`0000
`0000
`
`123456789
`
`10
`11
`12
`13
`14
`15
`16
`
`4.2.3.2 Type information (MTYPE) (Variable length)
`
`Variable length codewords giving information about the macroblock and which data elements are present. Macroblock
`types, included elements and VLC words are listed in Table 2.
`
`MTYPE is always included in transmitted macroblocks.
`
`4.2.3.3 Quantizer (MQUANT) (5 bits)
`
`MQUANT is present only if so indicated by MTYPE.
`
`A codeword of 5 bits signifying the quantizer to be used for this and any following blocks in the group of blocks until
`overridden by any subsequent MQUANT.
`
`Codewords for MQUANT are the same as for GQUANT.
`
`Recommendation H.261 (03/93)
`
`11
`
`
`
`TABLE 2/H.261
`
`VLC table for MTYPE
`
`Prediction
`
`MQUANT
`
`MVD
`
`CBP
`
`TCOEFF
`
`VLC
`
`Intra
`
`Intra
`
`Inter
`
`Inter
`Inter + MC
`Inter + MC
`Inter + MC
`Inter + MC + FIL
`Inter + MC + FIL
`Inter + MC + FIL
`
`x
`
`x
`
`x
`
`x
`
`x
`
`x
`
`x
`x
`
`x
`x
`
`x
`x
`x
`x
`x
`x
`
`x
`
`x
`
`x
`
`x
`
`x
`x
`
`x
`x
`
`0001
`
`0000 001
`
`1
`
`0000 1
`
`0000 0000
`0000 0001
`0000 0000
`001
`01
`0000 01
`
`1
`
`01
`
`NOTES
`1
`“x” means that the item is present in the macroblock.
`It is possible to apply the filter in a non-motion compensated macroblock by declaring it as MC + FIL but
`2
`with a zero vector.
`
`4.2.3.4 Motion vector data (MVD) (Variable length)
`
`Motion vector data is included for all MC macroblocks. MVD is obtained from the macroblock vector by subtracting the
`vector of the preceding macroblock. For this calculation the vector of the preceding macroblock is regarded as zero in the
`following three situations:
`
`1)
`
`2)
`
`evaluating MVD for macroblocks 1, 12 and 23;
`
`evaluating MVD for macroblocks in which MBA does not represent a difference of 1;
`
`3) MTYPE of the previous macroblock was not MC.
`
`MVD consists of a variable length codeword for the horizontal component followed by a variable length codeword for
`the vertical component. Variable length codes are given in Table 3.
`
`Advantage is taken of the fact that the range of motion vector values is constrained. Each VLC word represents a pair of
`difference values. Only one of the pair will yield a macroblock vector falling within the permitted range.
`
`4.2.3.5 Coded block pattern (CBP) (Variable length)
`
`CBP is present if indicated by MTYPE. The codeword gives a pattern number signifying those blocks in the macroblock
`for which at least one transform coefficient is transmitted. The pattern number is given by:
`
`32 · P1 + 16 · P2 + 8 · P3 + 4 · P4 + 2 · P5 + P6
`
`where Pn = 1 if any coefficient is present for block n, else 0. Block numbering is given in Figure 10.
`
`The codewords for CBP are given in Table 4.
`
`12
`
`Recommendation H.261 (03/93)
`
`
`
`TABLE 3/H.261
`
`VLC table for MVD
`
`MVD
`
`–16 & 16
`–15 & 17
`–14 & 18
`–13 & 19
`–12 & 20
`–11 & 21
`–10 & 22
`–9 & 23
`–8 & 24
`–7 & 25
`–6 & 26
`–5 & 27
`–4 & 28
`–3 & 29
`–2 & 30
`–1
`
`0
`
`1
`
`2 & –30
`3 & –29
`4 & –28
`5 & –27
`6 & –26
`7 & –25
`8 & –24
`9 & –23
`10 & –22
`11 & –21
`12 & –20
`13 & –19
`14 & –18
`15 & –17
`
`Code
`
`0000 0011 001
`0000 0011 011
`0000 0011 101
`0000 0011 111
`0000 0100 001
`0000 0100 011
`0000 0100 11
`0000 0101 01
`0000 0101 11
`0000 0111
`0000 1001
`0000 1011
`0000 111
`0001 1
`
`0011
`
`011
`
`1
`
`
`
`010
`
`0010
`
`0001 0
`0000 110
`0000 1010
`0000 1000
`0000 0110
`0000 0101 10
`0000 0101 00
`0000 0100 10
`0000 0100 010
`0000 0100 000
`0000 0011 110
`0000 0011 100
`0000 0011 010
`
`
`
`4.2.4
`
`Block layer
`
`A macroblock comprises four luminance blocks and one of each of the two colour difference blocks (see Figure 10).
`
`Data for a block consists of codewords for transform coefficients followed by an end of block marker (see Figure 11).
`The order of block transmission is as in Figure 10.
`
`4.2.4.1 Transform coefficients (TCOEFF)
`
`Transform coefficient data is always present for all six blocks in a macroblock when MTYPE indicates INTRA. In other
`cases MTYPE and CBP signal which blocks have coefficient data transmitted for them. The quantized transform
`coefficients are sequentially transmitted according to the sequence given in Figure 12.
`
`The most commonly occurring combinations of successive zeros (RUN) and the following value (LEVEL) are encoded
`with variable length codes. Other combinations of (RUN, LEVEL) are encoded with a 20-bit word consisting of 6 bits
`ESCAPE, 6 bits RUN and 8 bits LEVEL. For the variable length encoding there are two code tables, one being used for
`the first transmitted LEVEL in INTER, INTER+MC and INTER+MC+FIL blocks, the second for all other LEVELs
`except the first one in INTRA blocks which is fixed length coded with 8 bits.
`
`Recommendation H.261 (03/93)
`
`13
`
`
`
`TABLE 4/H.261
`
`VLC table for CBP
`
`CBP
`
`Code
`
`CBP
`
`Code
`
`35
`13
`49
`21
`41
`14
`50
`22
`42
`15
`51
`23
`43
`25
`37
`26
`38
`29
`45
`53
`57
`30
`46
`54
`58
`31
`47
`55
`59
`27
`39
`
`0001 1100
`0001 1011
`0001 1010
`0001 1001
`0001 1000
`0001 0111
`0001 0110
`0001 0101
`0001 0100
`0001 0011
`0001 0010
`0001 0001
`0001 0000
`0000 1111
`0000 1110
`0000 1101
`0000 1100
`0000 1011
`0000 1010
`0000 1001
`0000 1000
`0000 0111
`0000 0110
`0000 0101
`0000 0100
`0000 0011 1
`0000 0011 0
`0000 0010 1
`0000 0010 0
`0000 0001 1
`0000 0001 0
`
`111
`1101
`1100
`1011
`1010
`1001 1
`1001 0
`1000 1
`1000 0
`0111 1
`0111 0
`0110 1
`0110 0
`0101 1
`0101 0
`0100 1
`0100 0
`0011 11
`0011 10
`0011 01
`0011 00
`0010 111
`0010 110
`0010 101
`0010 100
`0010 011
`0010 010
`0010 001
`0010 000
`0001 1111
`0001 1110
`0001 1101
`
`60
`
`48
`
`16
`32
`12
`48
`20
`40
`28
`44
`52
`56
`1
`61
`2
`62
`24
`36
`3
`63
`
`59
`
`17
`33
`6
`10
`18
`34
`7
`11
`19
`
`1
`
`3
`
`2
`
`4
`
`Y
`
`5
`
`CB
`
`6
`
`CR
`
`FIGURE 10/H.261
`
`Arrangement of blocks in a macroblock
`
`14
`
`Recommendation H.261 (03/93)
`
`
`
`TCOEFF
`
`EOB
`
`FIGURE 11/H.261
`
`Structure of block layer
`
`1
`
`3
`
`4
`
`10
`
`11
`
`21
`
`22
`
`36
`
`2
`
`5
`
`9
`
`12
`
`20
`
`23
`
`35
`
`37
`
`6
`
`8
`
`13
`
`19
`
`24
`
`34
`
`38
`
`49
`
`7
`
`14
`
`18
`
`25
`
`33
`
`39
`
`48
`
`50
`
`15
`
`17
`
`26
`
`32
`
`40
`
`47
`
`51
`
`58
`
`16
`
`27
`
`31
`
`41
`
`46
`
`52
`
`57
`
`59
`
`28
`
`30
`
`42
`
`45
`
`53
`
`56
`
`60
`
`63
`
`29
`
`43
`
`44
`
`54
`
`55
`
`61
`
`62
`
`64
`
`Increasing cycles
`per picture width
`
`Increasing cycles
`per picture height
`
`T1514100-93/d07
`
`FIGURE 12/H.261
`Transmission order for transform coefficients
`
`
`
`
`
`
`
`Codes are given in Table 5.
`
`The most commonly occurring combinations of zero-run and the following value are encoded with variable length codes
`as listed in the table 5. End of block (EOB) is in this set. Because CBP indicates those blocks with no coefficient data,
`EOB cannot occur as the fir