中文网站
  Advanced Search
Read the latest Blogs from IT professionals in the field. Read and write community created documents. Need IT help? Ask our staff. Connect with your peers. Check our Tech Shop for posters, books and software tools. Home

H.263: Video Coding and Decoding (CODEC)

The H.263, by the International Telecommunications Union (ITU), supports video compression (coding) for video-conferencing and video-telephony applications. H.263 was developed to stream video at bandwidths as low as 20K to 24K bit/sec and was based on the H.261 codec. As a general rule, H.263 requires half the bandwidth to achieve the same video quality as in the H.261. As a result, H.263 has largely replaced H.261. H.263 uses RTP to transport video streams.

The coding algorithm of H.263 is similar to that used by H.261, however with some improvements and changes to improve performance and error recovery. Half pixel precision is used for motion compensation whereas H.261 used full pixel precision and a loop filter. Some parts of the hierarchical structure of the datastream are now optional, so the codec can be configured for a lower datarate or better error recovery. There are now four optional negotiable options included to improve performance: Unrestricted Motion Vectors, Syntax-based arithmetic coding, Advance prediction, and forward and backward frame prediction similar to MPEG called P-B frames.

H.263 supports five resolutions. In addition to QCIF and CIF that were supported by H.261 there is SQCIF, 4CIF, and 16CIF. SQCIF is approximately half the resolution of QCIF. 4CIF and 16CIF are 4 and 16 times the resolution of CIF respectively. The support of 4CIF and 16CIF means the codec could then compete with other higher bitrate video coding standards such as the MPEG standards.

The differences between the H.261 and H.263 coding algorithms are listed as follows:

Picture format Luminance pixels Luminance lines H.261 support H.263 support Uncompressed bit rate (Mbit/s)
10 frames/s 30 frames/s
Grey Color Grey Color
SQCIF 128 96   Yes 1.0 1.5 3.0 4.4
QCIF 176 144 Yes Yes 2.0 3.0 6.1 9.1
CIF 352 288 Optional Optional 8.1 12.2 24.3 36.5
4CIF 704 576   Optional 32.4 48.7 97.3 146.0
16CIF 1408 1152   Optional 129.8 194.6 389.3 583.9

Protocol Structure

Three formats (mode A, mode B and mode C) are defined for the H.263 payload header. In mode A, an H.263 payload header of four bytes is present before the actual compressed H.263 video bitstream. It allows fragmentation at GOB boundaries. In mode B, an 8-byte H.263 payload header is used and each packet starts at MB boundaries without the PB-frames option. Finally, a 12-byte H.263 payload header is defined in mode C to support fragmentation at MB boundaries for frames that are coded with the PB-frames option.

The format of the header for mode A is shown in the following illustration:

1 2 5 8 11 12 13 14 15 16
F P SBIT EBIT SRC I U S A R
R (cont.) DBQ TRB TR
  • F - Flag bit indicates the mode of the payload header. Values are as follows:
    • 0 - mode A.
    • 1 - mode B or mode C depending on P bit.
  • l P - P bit specifies the optional PB-frames mode.
  • l SBIT - Start bit position specifies number of most significant bits that are ignored in the first data byte.
  • l EBIT - End bit position specifies number of least significant bits that are ignored in the last data byte.
  • l SRC - Source format (bit 6,7 and 8 in PTYPE in the standard H.263 compressed bitstream) specifies the resolution of the current picture.
  • l I - Picture coding type (bit 9 in PTYPE in the standard H.263 compressed bitstream).
  • l U - Set to 1 if the Unrestricted Motion Vector option (bit 10 in PTYPE in the standard H.263 compressed bitstream) was set to 1 in the current picture header, otherwise 0.
  • l S - Set to 1 if the Syntax-based Arithmetic Coding option (bit 11 in PTYPE in the standard H.263 compressed bitstream) was set to 1 for the current picture header, otherwise 0.
  • l A - Set to 1 if the Advanced Prediction option (bit 12 in PTYPE in the standard H.263 compressed bitstream) was set to 1 for current picture header, otherwise 0.
  • l R - Reserved, set to zero.
  • l DBQ - Differential quantization parameter used to calculate quantizer for the B frame based on quantizer for the P frame, when PB-frames option is used. The value should be the same as DBQUANT in the standard H.263 compressed bitstream. Set to zero if PB-frames option is not used.
  • l TRB - Temporal Reference for the B frame in the standard H.263 compressed bitstream. Set to zero if PB-frames option is not used.
  • l TR - Temporal Reference for the P frame in the standard H.263 compressed bitstream. Set to zero if the PB-frames option is not used.

The format of the header for mode B is shown here:

1 2 5 8 11 16
F P SBIT EBIT SRC QUANT
GOBN MBR R
I U S A HMV1 VMV1 HMV2 VMV2
  • F, P, SBIT, EBIT, SRC, I, U, S and A are defined the same as in mode A.
  • l QUANT - Quantization value for the first MB coded at the starting of the packet. Set to 0 if the packet begins with a GOB header.
  • l GOBN - GOB number in effect at the start of the packet. GOB number is specified differently for different resolutions.
  • l MBA - The address within the GOB of the first MB in the packet, counting from zero in scan order. For example, the third MB in any GOB is given MBA=2.
  • l R - Reserved, set to zero.
  • l HMV1, VMV1 - Horizontal and vertical motion vector predictors for the first MB in this packet. When four motion vectors are used for the current MB with advanced prediction option, they are the motion vector predictors for block number 1 in the MB. Each 7-bit field encodes a motion vector predictor in half pixel resolution as a 2"s complement number.
  • l HMV2, VMV2 - Horizontal and vertical motion vector predictors for block number 3 in the first MB in this packet when four motion vectors are used with the advanced prediction option. This is needed because block number 3 in the MB needs different motion vector predictors from other blocks in the MB. These two fields are not used when the MB only has one motion vector. Each 7 bits field encodes a motion vector predictor in half pixel resolution as a 2"s complement number.
1 2 5 8 11 16
F P SBIT EBIT SRC QUANT
GOBN MBR R
1 U S A HMV1 VMV1 HMV2 VMV2
RR
RR(c) DBR TRB TR

F, P, SBIT, EBIT, SRC, I, U, S, A, DBQ, TRB and TR are defined the same as in mode A. QUANT, GOBN, MBA, HMV1, VMV1, HMV2, VNV2 are defined the same as in mode B.

RR - Reserved, set to zero (19 bits).

Related protocols: RTSP, RTP, RTCP, H.323, H.245, H.261

Sponsor Source: H.231 is an ITU-T (http://www.itu.int/ITU-T/) standard.

Reference:
http://www.javvin.com/protocol/rfc2190.pdf: RTP Payload Format for H.263 Video Streams
http://www.h323forum.org/papers/: H.323 papers and documents