Browse Prior Art Database

Two Value Average with Round

IP.com Disclosure Number: IPCOM000123546D
Original Publication Date: 1999-Jan-01
Included in the Prior Art Database: 2005-Apr-05
Document File: 1 page(s) / 38K

Publishing Venue

IBM

Related People

Rutter, RS: AUTHOR

Abstract

In an MPEG encoder and decoder, two or four values must be averaged with a round. The round is defined as adding the least significant bit to the sum either before or after the divide. The round is required by the MPEG standard in some places and may produce a better result in others.

This text was extracted from an ASCII text file.
This is the abbreviated version, containing approximately 79% of the total text.

Two Value Average with Round

   In an MPEG encoder and decoder, two or four values must be
averaged with a round.  The round is defined as adding the least
significant bit to the sum either before or after the divide.  The
round is required by the MPEG standard in some places and may
produce a better result in others.

   In prior implementations, this calculation was performed
in the obvious manner: SUM = (A+B); SUM = SUM + SUM(LSB); AVG = SUM /
2; where A and B are the values to be averaged and AVG is the result.
This approach requires an adder and an incrementer.

   A second averaging problem has four inputs.  It can be
realized as: SUM = (A+B+C+D); SUM = SUM + SUM(LSB-1); AVG = SUM / 4;
This approach requires three adders and an incrementer.

   The rounded two input average may be calculated without
the second add / increment.  This can be viewed as pseudo-code or as
hardware.  In code:  AVG = (A + B + 1) /2; In hardware, the least
significant bit of the sum A + B is not a required output and there
are only two inputs to the least significant bit carry-out AND
source.  The effect of a + 1 on the carry-out can be recognized by
changing the AND to an OR.  Thus, the two functions: (A + B) /2 and
(A + B + 1) /2 can be implemented with the same number of gates.
This solution requires an adder, no incrementer, and the least
significant sum bit is not calculated.

   The four addend average can be computed as: T1 = A + B;
T2 = C + D; AVG = T1' + T2' + CARRY; whe...