The invention relates to a programmable data processing apparatus, and in particular to a programmable data processing apparatus having a bit-plane extraction operation for processing data such as video data.
In the video domain pixels are typically represented by one or several bytes of data. For example, in the default format used for MPEG video encoding, a pixel is stored by saving its luminance component as a byte. The chrominance part of the pixel is stored as two bytes, but these values are shared for several pixels at the same time. If the luminance part is considered, for example, the byte consists of 8 individual bits, and is referred to as a “bit-plane”.
A dominant part of MPEG video encoding consists of motion estimation, which can be computed very efficiently when carried out on a bit-plane basis. The “sum-of-absolute-differences” operation, when executed on a bit-plane basis, involves an exclusive-or operation only, followed by counting the bits of the result value, the latter often being supported as a single instruction in a DSP processor. During a pre-processing step, the bit-plane has to be extracted from the video stream. Such a pre-processing step may involve, for example, extracting a particular bit from each byte in a 32 bit value containing four packed bytes. To perform the bit-plane extraction operation in software involves the following operations (shown in pseudo C) to obtain a 4-bit result value, r.
The result, r=bpext(x,y)
where,
x=32 bit value containing four packed bytes
y=integer number between 0 and 7 referring to the bit to be extracted
A bit-plane extraction operation may comprise the following operations:
The bit-plane extraction operation shown above will now be described in greater detail with reference to
The pixel data may be arranged in “big endian” format or “little endian” format. In the big endian format the bytes are arranged with the most significant byte first, while in the little endian format the bytes are arranged with the least significant byte first. Therefore, depending on the endianness of the pixel data, or indeed for other reasons, it may be desirable to reverse the resulting bits.
An implementation example of how to reverse the bits is shown below:
The instruction code shown above selects individual bits and shifts them to their reversed locations, so that bit 0 becomes bit 3 ((r&1)<<3), bit 1 becomes bit 2 ((r&2)<<1), etc., and these bits are again ORed together.
It is noted that the example above shows how to select just a single bit from packed data. However, more than one bit can also be extracted, for example, selecting two bits per byte or data element, and concatenating these bits into an eight bit result value.
It will be appreciated that, to perform the bit-plane extraction operation described above on a programmable data processor, the bit-plane extraction operation involves the execution of several (non-dedicated) operations. This has disadvantages both in terms of performance and power consumption.
The aim of the present invention is therefore to provide a programmable data processing apparatus having a bit-plane extraction operation that does not have the disadvantages mentioned above.
According to a first aspect of the present invention, there is provided a programmable data processing apparatus for processing data, the data processing including the task of performing a bit-plane extraction operation on packed data bits, the packed data bits comprising a plurality of data elements, each data element having a plurality of data bits, the apparatus comprising:
extracting means for selectively extracting a data bit from each of the data elements, and
concatenating means for concatenating the extracted data bits to provide a result value, wherein the result value is further processed by the programmable data processing apparatus.
According to another aspect of the invention, there is provided a method of performing a bit-plane extraction operation on packed data bits in a programmable data processor, the packed data bits comprising a plurality of data elements, each data element having a plurality of data bits, the method comprising the steps of providing dedicated hardware means for selectively extracting a data bit from each data element, and concatenating the extracted data bits to provide a result value for further processing by the programmable data processor.
For a better understanding of the invention, and to show more clearly how the invention may be carried into effect, reference will now be made, by way of example only, to the following drawings in which:
a and 2b describe a bit-plane extraction operation according to the present invention, with or without bit-reversing the result, respectively;
According to the present invention, dedicated hardware is provided for performing the bit-plane extraction operation.
Referring to
b shows a similar bit-plane extraction apparatus, if the result does need to be bit-reversed, whereby the extracted data bits are reversed in the result value 7, such that r3=d1, r2=c1, r1=b1, r0=a1. In other words, in the embodiment shown in
As shown above, the hardware can be configured to provide a result value that is not bit-reversed (ie as shown in
Alternatively, the hardware can be configured to selectively provide the result in the normal or bit-reversed formats. For example, bit-reversal can be set as a parameter, so that the apparatus can return a result 5 or a bit-reversed result 7, as described later in the application. The parameter may be controlled by software, or configured beforehand in hardware, depending on whether or not bit-reversal of the result is required for a particular application.
In
One of the multiplexers, 41a, is shown in greater detail in
As described above, the parameter “c” can either be controlled by software (thus allowing the bit-reversal to be controlled dynamically), or set in hardware depending on the particular data processing application.
It will be appreciated that the invention described above provides a bit-plane extraction operation and apparatus that is more efficient than the prior art. In addition to improving performance, the bit-plane extraction method and apparatus also consumes less power than the operations performed in the prior art.
In practice, several results are combined into a single 32 bit value. For example, if one result corresponds to 4 bits, eight results can be combined into 32 bits. The sum-of-absolute-differences between two such values can then be computed by XORing the two 32 bit values, and counting the “1” bits of the result. According to the prior art, combining results would involve shifting a previous result, and ORing the current result into this value.
Using software, this involves the following operations:
where
x: 32 bit value containing four packed bytes
y: integer number between 0 and 7 referring to the bit to be extracted
z: 32 bit value containing previous result
However, according to another aspect of the invention,
The invention described above provides a programmable data processing apparatus having a bit-plane extraction means that can be used in a pre-processing step of a sum-of-absolute-differences operation. It is noted, however, that the invention is not limited to this use, and it will be appreciated that the bit-plane extraction operation can be used for other data processing operations where one or more bits need to be extracted from a plurality of bytes. Furthermore, the data bits do not necessarily need to be extracted from different bytes, for example where image data is represented by 12 bits per component.
Although the invention has been described in relation to extracting 4 bits, it is noted that, for processors with a wider data-path, for instance 64 bits, the instruction may be extended to retrieve 8 bits at once.
Also, although the preferred embodiment shows the use of multiplexers, it will be appreciated that other logic circuits providing the same function can also be used.
It should also be noted that the above-mentioned embodiments illustrate rather than limit the invention, and that those skilled in the art will be capable of designing many alternative embodiments without departing from the scope of the invention as defined by the appended claims. In the claims, any reference signs placed in parentheses shall not be construed as limiting the claims. The word “comprising” and “comprises”, and the like, does not exclude the presence of elements or steps other than those listed in any claim or the specification as a whole. The singular reference of an element does not exclude the plural reference of such elements and vice-versa. The invention may be implemented by means of hardware comprising several distinct elements, and by means of a suitably programmed computer. In a claim enumerating several means, several of these means may be embodied by one and the same item of hardware. The mere fact that certain measures are recited in mutually different dependent claims does not indicate that a combination of these measures cannot be used to advantage.
Number | Date | Country | Kind |
---|---|---|---|
04102749 | Jun 2004 | EP | regional |
Filing Document | Filing Date | Country | Kind | 371c Date |
---|---|---|---|---|
PCT/IB2005/051883 | 6/8/2005 | WO | 00 | 4/21/2008 |
Publishing Document | Publishing Date | Country | Kind |
---|---|---|---|
WO2005/124534 | 12/29/2005 | WO | A |
Number | Name | Date | Kind |
---|---|---|---|
5479166 | Read et al. | Dec 1995 | A |
6317824 | Thakkar et al. | Nov 2001 | B1 |
20030035476 | Ohyama et al. | Feb 2003 | A1 |
20030156637 | Van Der Schaar | Aug 2003 | A1 |
20040247156 | Otsuki | Dec 2004 | A1 |
20050271285 | Kimura et al. | Dec 2005 | A1 |
20070110165 | Park et al. | May 2007 | A1 |
20070160299 | Kajiwara et al. | Jul 2007 | A1 |
20070165713 | Van Der Vleuten et al. | Jul 2007 | A1 |
Number | Date | Country |
---|---|---|
992882 | Apr 2000 | EP |
2842670 | Jan 2004 | FR |
57-207942 | Dec 1982 | JP |
60-159935 | Aug 1985 | JP |
63-052236 | Mar 1988 | JP |
63-298623 | Dec 1988 | JP |
01-099123 | Apr 1989 | JP |
01-132135 | May 1989 | JP |
05-334042 | Dec 1993 | JP |
Entry |
---|
Written opinion of the International Search Authority for PCT/IB2005/051883 (Dec. 20, 2006). |
Danny Cohen, “On Holy Wars and a Plea for Peace”, —Computer—, Oct. 1981, at 48-54. |
Itoh International Patent Office, Official Office Action in corresponding Japanese Patent Application No. 2007-516101, mailing date Aug. 4, 2009 (8 pages). |
Number | Date | Country | |
---|---|---|---|
20080253442 A1 | Oct 2008 | US |