JP3384470B2 - Numerical value conversion device and method, and coordinate value integer conversion device and method - Google Patents

Numerical value conversion device and method, and coordinate value integer conversion device and method

Info

Publication number
JP3384470B2
JP3384470B2 JP23746894A JP23746894A JP3384470B2 JP 3384470 B2 JP3384470 B2 JP 3384470B2 JP 23746894 A JP23746894 A JP 23746894A JP 23746894 A JP23746894 A JP 23746894A JP 3384470 B2 JP3384470 B2 JP 3384470B2
Authority
JP
Japan
Prior art keywords
floating point
mantissa
integer
maximum exponent
exponent
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
JP23746894A
Other languages
Japanese (ja)
Other versions
JPH08101919A (en
Inventor
裕幸 小沢
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Sony Corp
Original Assignee
Sony Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Sony Corp filed Critical Sony Corp
Priority to JP23746894A priority Critical patent/JP3384470B2/en
Publication of JPH08101919A publication Critical patent/JPH08101919A/en
Application granted granted Critical
Publication of JP3384470B2 publication Critical patent/JP3384470B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Landscapes

  • Image Generation (AREA)

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【産業上の利用分野】本発明は、3次元コンピュータ・
グラフィックス・システムで表現力を飛躍的に向上させ
る手法であるテクスチャ・マッピング処理を行う数値変
換装置および方法、並びに座標値整数化装置および方法
に関する。
The present invention relates to a three-dimensional computer
Numeric conversion apparatus and method for performing texture mapping process is a method to significantly improve the expressive power in the graphics system, and to coordinate values rounding apparatus and method <br/>.

【0002】[0002]

【従来の技術】テクスチャ・マッピングは、コンピュー
タ・グラフィックスで三角形や四角形を描画する際に、
その表面にあらかじめ用意しておいたイメージデータを
張り付ける手法で、リアリティの高い画像を生成するも
のである。図7に例としてテクスチャ・マッピングを施
した四角形が回転しているようすを示す。
2. Description of the Related Art Texture mapping is a technique for drawing triangles and quadrangles in computer graphics.
The image data prepared in advance is attached to the surface of the image to generate a highly realistic image. As an example, FIG. 7 shows that a quadrangle subjected to texture mapping is rotated.

【0003】一般的に、テクスチャ・マッピングは、描
画時には三角形単位に行なわれ、以下のようにして処理
する。 1)三角形の各頂点に対して、テクスチャ座標(S,
T,Q)を与える。 2)三角形の内部の点のテクスチャ座標(s,t,q)
を頂点のテクスチャ座標から線形補間して求める。 3)イメージデータ上の位置(u,v)をu=s/q,
v=t/qの除算より求める。
Generally, texture mapping is performed in units of triangles at the time of drawing, and is processed as follows. 1) For each vertex of the triangle, texture coordinates (S,
T, Q) is given. 2) Texture coordinates (s, t, q) of points inside the triangle
Is linearly interpolated from the vertex texture coordinates. 3) The position (u, v) on the image data is u = s / q,
Obtained by dividing v = t / q.

【0004】一般的なコンピュータ・グラフィックス・
システムは、図8に示すようなジオメトリ部100とレ
ンダリング部101の2つから構成されるものが多い。
ジオメトリ部100では、座標変換、ライティング計
算、クリッピング処理等の幾何学的計算が行なわれ、レ
ンダリング部101ではラインの発生や三角形の塗りつ
ぶし等の処理が行なわれる。ジオメトリ部100では浮
動小数点計算を行ない、その結果を整数に変換してレン
ダリング部101へ転送し、レンダリング部101では
整数計算を行なうことが一般的である。
General computer graphics
Many systems are composed of two parts, a geometry part 100 and a rendering part 101 as shown in FIG.
The geometry unit 100 performs geometrical calculations such as coordinate conversion, lighting calculation, and clipping process, and the rendering unit 101 performs processes such as line generation and triangle filling. It is general that the geometry unit 100 performs floating point calculation, converts the result into an integer and transfers the result to the rendering unit 101, and the rendering unit 101 performs integer calculation.

【0005】このとき、転送されるデータとしては、X
YZ座標、カラー(R,G,B)、テクスチャ座標
(S,T,Q)等がある。テクスチャ座標以外のデー
タ、たとえばカラーは8ビットの整数で表現して、0≦
R,G,B≦255の範囲にすることが多く、他のデー
タも同様にnビットの整数に変換できる。
At this time, the data to be transferred is X
There are YZ coordinates, colors (R, G, B), texture coordinates (S, T, Q) and the like. Data other than texture coordinates, such as color, is represented by an 8-bit integer, and 0 ≦
In many cases, R, G, and B ≦ 255 are set, and other data can be similarly converted into an n-bit integer.

【0006】しかし、テクスチャ座標は−∞≦S,T,
Q≦∞の範囲を表現しなければならず、有限のビット長
の整数では表現できない。
However, the texture coordinates are -∞≤S, T,
The range of Q ≦ ∞ must be expressed, and cannot be expressed by an integer with a finite bit length.

【0007】このため、図9(a)に示すように、ジオ
メトリ部100aではテクスチャ座標を浮動小数点数の
まま転送し、レンダリング部101aにおいてテクスチ
ャ・マッピングの計算を浮動小数点計算によって行なう
方法があるが、浮動小数点演算器は整数演算器に比べて
回路規模が大きく、また回路が複雑であるため、小規模
で高速なシステムを構成するのが困難であるという問題
があった。また、図9(b)に示すように、ジオメトリ
部100bでテクスチャ座標の範囲に制限を加えて有限
のビット長の整数にしてレンダリング部101bに転送
する方法もあるが、張り付けるイメージデータの大きさ
にも制限を与えるとともに、テクスチャ座標の値が小さ
い場合には有効なビット長も小さくなるので精度も悪く
なるという問題があった。
For this reason, as shown in FIG. 9A, there is a method in which the geometry part 100a transfers the texture coordinates as floating point numbers and the rendering part 101a performs the texture mapping calculation by floating point calculation. Since the floating point arithmetic unit has a larger circuit scale than the integer arithmetic unit and the circuit is complicated, there is a problem that it is difficult to configure a small-scale and high-speed system. As shown in FIG. 9B, there is also a method of limiting the texture coordinate range in the geometry section 100b and converting the texture coordinate range into an integer with a finite bit length, and transferring the integer to the rendering section 101b. There is also a problem in that the accuracy is deteriorated because the effective bit length also becomes small when the texture coordinate value is small, in addition to the limitation.

【0008】[0008]

【発明が解決しようとする課題】すなわち、テクスチャ
・マッピングを行なう際、ジオメトリ部100で計算し
たテクスチャ座標が有限のビット長の整数で表現できな
いため、テクスチャ座標を浮動小数点数のまま転送し、
レンダリング部101において浮動小数点計算を行なう
方法があるが、回路規模が大きくなり、また回路が複雑
であるため、小規模で高速なシステムを構成するのが困
難である。
That is, when texture mapping is performed, the texture coordinates calculated by the geometry unit 100 cannot be expressed by an integer having a finite bit length. Therefore, the texture coordinates are transferred as floating point numbers,
Although there is a method of performing floating point calculation in the rendering unit 101, it is difficult to configure a small-scale and high-speed system because the circuit scale is large and the circuit is complicated.

【0009】また、テクスチャ座標の範囲に制限を加え
て有限のビット長の整数にして転送する方法もあるが、
張り付けるイメージデータの大きさにも制限を与えると
ともに、精度も悪化する。
There is also a method in which the range of texture coordinates is limited and an integer having a finite bit length is transferred.
The size of the image data to be pasted is also limited, and the accuracy also deteriorates.

【0010】本発明は、上記事情に鑑みてなされたもの
であり、小規模でありながらテクスチャ座標に制限を加
えることなく、また精度も悪化させることのない数値変
換装置および方法を提供することを目的とする。
The present invention has been made in view of the above circumstances, and it is an object of the present invention to provide a numerical conversion device and method that are small in scale, do not impose restrictions on texture coordinates, and do not deteriorate accuracy. To aim.

【0011】[0011]

【課題を解決するための手段】本発明の数値変換装置
は、複数の浮動小数点数を保持する浮動小数点保持手段
と、浮動小数点保持手段内の浮動小数点数から最大の指
数を検出する最大指数検出手段と、最大指数検出手段が
検出した最大の指数と浮動小数点保持手段内の各々の浮
動小数点数の指数との差分を求めて差分をシフト量とし
て仮数をシフトする仮数シフト手段と、仮数シフト手段
でシフトされた仮数を符号化する符号化手段とを備え、
最大の指数を基準値とし、差分が相対値として、各々の
浮動小数点数の相対的な大きさを保持したまま整数に変
換することを特徴とする。本発明の数値変換方法は、
動小数点保持手段が、複数の浮動小数点数を保持する浮
動小数点保持ステップと、最大指数検出手段が、浮動小
数点保持手段内の浮動小数点数から最大の指数を検出す
る最大指数検出ステップと、仮数シフト手段が、最大指
数検出ステップの処理が検出した最大の指数と浮動小数
点保持手段内の各々の浮動小数点数の指数との差分を求
めて差分をシフト量として仮数をシフトする仮数シフト
ステップと、符号化手段が、仮数シフトステップの処理
でシフトされた仮数を符号化する符号化ステップとを含
み、最大の指数を基準値とし、差分が相対値として、各
々の浮動小数点数の相対的な大きさを保持したまま整数
に変換することを特徴とする。
A numerical conversion device of the present invention comprises a floating point holding means for holding a plurality of floating point numbers, and a maximum exponent detection for detecting a maximum exponent from a floating point number in the floating point holding means. Means, a mantissa shift means for obtaining a difference between the maximum exponent detected by the maximum exponent detection means and the exponent of each floating point number in the floating point holding means, and shifting the mantissa using the difference as a shift amount, and a mantissa shift means. And encoding means for encoding the mantissa shifted by
It is characterized in that the maximum exponent is used as a reference value and the difference is used as a relative value, and is converted into an integer while retaining the relative size of each floating point number. Numeric conversion method of the present invention, floating
The moving point holding means holds a floating point holding step for holding a plurality of floating point numbers, the maximum exponent detecting means detects a maximum exponent from the floating point numbers in the floating point holding means , and a mantissa shift. means a mantissa shift steps of the process of the maximum index detecting step shifts the mantissa of the difference as a shift amount obtaining a difference between each of the floating point exponent of the floating-point holding unit and the maximum exponent detected, code The encoding means includes an encoding step of encoding the mantissa shifted in the mantissa shift step, the maximum exponent being a reference value, and the difference being a relative value, the relative size of each floating point number. It is characterized by converting to an integer while holding.

【0012】[0012]

【作用】本発明では、検出された最大の指数が基準値と
され、算出された差分を相対値として、各々の浮動小数
点数の相対的な大きさが保持されたまま整数に変換され
ることで、テクスチャ座標に制限を加えることなく、ま
た精度も悪化させることもなく、小規模に構成すること
を可能とする。
In the present invention, the maximum detected exponent is used as a reference value, and the calculated difference is used as a relative value to be converted into an integer while holding the relative size of each floating point number. Thus, it is possible to configure on a small scale without limiting the texture coordinates and without deteriorating the accuracy.

【0013】[0013]

【実施例】実施例として、IEEE32ビット浮動小数
点で与えられたテクスチャ座標を32ビットの整数に変
換する場合を以下に述べる。
DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS As an embodiment, the case of converting texture coordinates given by IEEE 32-bit floating point into a 32-bit integer will be described below.

【0014】本実施例の数値変換装置は、図1に示すよ
うに、浮動小数点保持手段としての浮動小数点レジスタ
10a乃至10i、最大指数検出手段としての最大指数
検出装置11、仮数シフト手段としての仮数シフト装置
12a乃至12i、符号化手段としての符号化装置13
a乃至13iより構成され、浮動小数点レジスタ10a
乃至10iに保持される浮動小数点数を、最大指数検出
装置11において前記の浮動小数点レジスタ10a乃至
10iに保持される浮動小数点数の最大指数を検出し、
仮数シフト装置12a乃至12iにおいて前記の最大指
数と各々の指数との差分で仮数をシフトし、符号化装置
13a乃至13iにおいて符号化を行ない、相対的大き
さを保持する整数に変換する装置である。
As shown in FIG. 1, the numerical conversion apparatus of this embodiment has floating point registers 10a to 10i as floating point holding means, maximum exponent detecting apparatus 11 as maximum exponent detecting means, and mantissa as mantissa shift means. Shift devices 12a to 12i, encoding device 13 as encoding means
a to 13i, and a floating point register 10a
To 10i, the maximum exponent detection device 11 detects the maximum exponent of the floating point numbers held in the floating point registers 10a to 10i,
In the mantissa shift devices 12a to 12i, the mantissa is shifted according to the difference between the maximum exponent and each exponent, the encoding devices 13a to 13i perform encoding, and convert the integers to hold the relative size. .

【0015】ここで、浮動小数点数で与えられたテクス
チャ座標の相対的大きさを保持する整数に変換するのは
以下の理由による。
Here, the reason why the relative size of the texture coordinates given by the floating point number is converted into an integer holding the texture coordinate is as follows.

【0016】すなわち、三角形の3頂点のテクスチャ座
標を(S1,T1,Q1)、(S2,T2,Q2)、
(S3,T3,Q3)、この頂点データを線形補間して
得られる三角形内部のある点のテクスチャ座標を(s,
t,q)とすると、3頂点のテクスチャ座標を各々α倍
して(αS1,αT1,αQ1)、(αS2,αT2,
αQ2)、(αS3,αT3,αQ3)とした場合の前
記と同一点の三角形内部の点のテクスチャ座標もα倍さ
れて(αs,αt,αq)となる。
That is, the texture coordinates of the three vertices of the triangle are (S1, T1, Q1), (S2, T2, Q2),
(S3, T3, Q3), the texture coordinates of a point inside the triangle obtained by linearly interpolating this vertex data are (s,
t, q), the texture coordinates of the three vertices are multiplied by α (αS1, αT1, αQ1), and (αS2, αT2,
When αQ2) and (αS3, αT3, αQ3) are set, the texture coordinates of a point inside the same triangle as described above are also multiplied by α to become (αs, αt, αq).

【0017】一方、求めるイメージデータ上の位置
(u,v)は、u=s/q,v=t/qであるから、頂
点のテクスチャ座標をα倍した場合も、u=αs/αq
=s/q,v=αt/αq=t/qとなり結果的に同じ
位置が求められる。このことは、頂点に与えるテクスチ
ャ座標はその相対的な大きさが保持されていれば良いこ
とを示している。
On the other hand, since the position (u, v) on the image data to be obtained is u = s / q and v = t / q, u = αs / αq even when the texture coordinate of the vertex is multiplied by α.
= S / q, v = αt / αq = t / q, and consequently the same position is obtained. This indicates that the texture coordinates given to the vertices have only to retain their relative sizes.

【0018】浮動小数点レジスタ10a乃至10iは、
浮動小数点数を保持する32ビットの記憶装置で、図2
に示すように、格納されているデータは、1ビットの符
号SIGN(i)、8ビットの指数EXP(i)、23
ビットの仮数MAN(i)より構成される。
The floating point registers 10a-10i are
A 32-bit storage device that holds floating point numbers
As shown in, the stored data is 1-bit code SIGN (i), 8-bit exponent EXP (i), 23
It consists of a mantissa MAN (i) of bits.

【0019】最大指数検出装置11は、9つの浮動小数
点レジスタ10a乃至10iの浮動小数点数のうち最大
の指数を検出する装置で、図3(a)または(b)に示
すように8つの最大値選択装置30a乃至30hで構成
される。最大値選択装置30a乃至30hは、2つの入
力のうち大きい方を選択する装置で、これをトーナメン
ト方式に8つ接続することにより、最大指数MAXEX
Pを検出する。
The maximum exponent detecting device 11 is a device for detecting the maximum exponent of the floating-point numbers of the nine floating-point registers 10a to 10i. As shown in FIG. It is composed of the selection devices 30a to 30h. The maximum value selection devices 30a to 30h are devices that select the larger one of the two inputs, and by connecting eight of them to the tournament method, the maximum index MAXEX
Detect P.

【0020】仮数シフト装置12a乃至12iは、最大
指数MAXEXPと各指数EXP(i)の差分を求め
て、それをシフト量SFTM(i)として各仮数MAN
(i)を元とするデータSTFS(i)を右シフトする
ことにより符号なし31ビット整数を生成する装置で、
図4(a)に示すように、引算器40、最上位ビット生
成装置41、シフト装置42より構成される。
The mantissa shift devices 12a to 12i find the difference between the maximum exponent MAXEXP and each exponent EXP (i) and use it as the shift amount SFTM (i) for each mantissa MAN.
A device for generating an unsigned 31-bit integer by right-shifting data STFS (i) based on (i),
As shown in FIG. 4A, it is composed of a subtractor 40, a most significant bit generation device 41, and a shift device 42.

【0021】引算器40では、MAXEXP−EXP
(i)を計算して、シフト量SFTM(i)を求める。
最上位ビット生成装置41は、省略されていた仮数の暗
黙の最上位ビットMSB(i)を求める装置である。最
上位ビットは通常は1であるが、指数が0の場合には特
別なケースとして0になるので、EXP(i)が0であ
るかを判定して、0であればMSB(i)を0にし、そ
れ以外はMSB(i)を1にする。シフト装置42で
は、MSB(i)、MAN(i)より構成されるデータ
SFTS(i)を、SFTM(i)で右シフトを行な
い、符号なし31ビット整数SFT(i)を求める。シ
フトされるデータSFTS(i)は、例えば図4(b)
に示すように、ビット30には最上位ビット生成装置4
1で求めたMSB(i)が、ビット29〜7には各仮数
MAN(i)が、残りのビット6〜0に0が入る、符号
なし31ビット整数である。
In the subtractor 40, MAXEXP-EXP is used.
(I) is calculated to obtain the shift amount SFTM (i).
The most significant bit generation device 41 is a device for obtaining the implicit most significant bit MSB (i) of the omitted mantissa. The most significant bit is usually 1, but when the exponent is 0, it becomes 0 as a special case, so it is determined whether EXP (i) is 0, and if 0, MSB (i) is determined. Set to 0, otherwise set MSB (i) to 1. In the shift device 42, the data SFTS (i) composed of MSB (i) and MAN (i) is right-shifted by SFTM (i) to obtain an unsigned 31-bit integer SFT (i). The shifted data SFTS (i) is, for example, as shown in FIG.
As shown in FIG.
The MSB (i) obtained in 1 is an unsigned 31-bit integer in which the mantissa MAN (i) is in bits 29 to 7 and 0 is in the remaining bits 6 to 0.

【0022】仮数シフト装置12a乃至12iの動作例
としてMAXEXP、EXP(i)、MAN(i)が以
下の値である場合を示す(数値は2進数)。 MAXEXP=00110000 EXP(i)=00101000 MAN(i)=01001010010100101001010 引算器40においてSFTM(i)が計算され、 SFTM(i)=MAXEXP−EXP(i) =00001000(十進数で8)
As an operation example of the mantissa shift devices 12a to 12i, the case where MAXEXP, EXP (i), and MAN (i) have the following values (numerical values are binary numbers) is shown. MAXEXP = 00110000 EXP (i) = 00101000 MAN (i) = 01001010010100101001010 SFTM (i) is calculated in the subtractor 40, and SFTM (i) = MAXEXP-EXP (i) = 00001000 (8 in decimal)

【0023】次に、最上位ビット生成装置41におい
て、EXP(i)が0でないので、 MSB(i)=1 シフト装置42において、シフトされるデータSFTS
(i)は、 SFTS(i)=|MSB(i)| MAN(i) |0000000 =| 1 |01001010010100101001010|0000000 =1010010100101001010010100000000 となり、SFTS(i)をSFTM(i)(8ビット)
で右シフトしてSFT(i)が求められる。 SFT(i)=0000000010100101001010010100101
Next, in the most significant bit generator 41, since EXP (i) is not 0, MSB (i) = 1 shift device 42 shifts the data SFTS.
(I) is SFTS (i) = | MSB (i) | MAN (i) | 0000000 = | 1 | 01001010010100101001010 | 0000000 = 1010010100101001010010100000000, and SFTS (i) is SFTM (i) (8 bits).
Then, SFT (i) is obtained by right shifting. SFT (i) = 0000000010100101001010010100101

【0024】また、もし変換する浮動小数点数がMAX
EXPを持つものだとすると、EXP(i)=MAXE
XPより、SFTM(i)=MAXEXP−EXP
(i)=0となり、シフト量が0になるので、 SFT(i)=1010010100101001010010100000000 となる。
If the floating point number to be converted is MAX
If it has EXP, EXP (i) = MAXE
From XP, SFTM (i) = MAXEXP-EXP
Since (i) = 0 and the shift amount becomes 0, SFT (i) = 1010010100101001010010100000000.

【0025】このように、最大指数をもつ浮動小数点数
は整数化されるとき、最上位に必ず1がたち、有効ビッ
ト長すべてが使われることになる。
As described above, when a floating-point number having the maximum exponent is converted into an integer, 1 is always set at the highest level, and all effective bit lengths are used.

【0026】符号化装置43は、各符号SIGN(i)
により、仮数シフト装置12a乃至12iが生成した符
号なし31ビット整数SFT(i)の符号化を行ない、
符号付き32ビット整数FIX(i)に変換する装置
で、図5に示すように、マイナス化装置50、選択装置
51より構成される。
The encoding device 43 uses each code SIGN (i).
The unsigned 31-bit integer SFT (i) generated by the mantissa shift units 12a to 12i is encoded by
This is a device for converting into a signed 32-bit integer FIX (i), and comprises a minus device 50 and a selection device 51, as shown in FIG.

【0027】マイナス化装置50は、入力した正のデー
タを負のデータに変換する装置で、SFT(i)入力に
対して−SFT(i)を生成する。選択装置51は、S
IGN(i)が0ならばSFT(i)を、SIGN
(i)が1ならば−SFT(i)を選択し、符号ビット
として最上位ビット(ビット31)にSIGN(i)を
付加して、32ビットの符号付き整数FIX(i)を生
成する。符号化装置43の例を以下に示す。
The minus device 50 is a device for converting input positive data into negative data, and generates -SFT (i) for SFT (i) input. The selection device 51 uses S
If IGN (i) is 0, SFT (i) is set to SIGN
If (i) is 1, -SFT (i) is selected, and SIGN (i) is added to the most significant bit (bit 31) as a sign bit to generate a 32-bit signed integer FIX (i). An example of the encoding device 43 is shown below.

【0028】 FIX(i)=0000000010100101001010010100101 入力 (1)SIGN(i)=0の場合 FIX(i) =|SIGN(i)|SFT(i)| =00000000010100101001010010l00101 (2)SICN(i)=1の場合 FIX(i) =|SIGN(i)|−SFT(i)| =11l1111110l01101011010ll01011011[0028] FIX (i) = 0000000010100101001010010100101 input (1) When SIGN (i) = 0 FIX (i) = | SIGN (i) | SFT (i) | = 00000000010100101001010010l00101 (2) When SICN (i) = 1 FIX (i) = | SIGN (i) | -SFT (i) | = 11l1111110l01101011010ll01011011

【0029】以上の実施例により、浮動小数点数で与え
られたテクスチャ座標は、それらの相対的な大きさを保
持したまま整数に変換できる。また、どのような大きさ
の浮動小数点数を与えても、最も大きな指数をもつ浮動
小数点数が整数化したときに有効ビット長すべてが使用
されるように変換されるので、精度良く変換されること
になる。
According to the above-described embodiment, the texture coordinates given by the floating point number can be converted into an integer while keeping their relative sizes. Even if you give a floating-point number of any size, it will be converted so that all the effective bit lengths will be used when the floating-point number with the largest exponent is converted to an integer, so it will be converted accurately. It will be.

【0030】また、上述の座標値整数化装置を使用する
ことにより、図6に示すようなレンダリング装置60を
構成することが可能になる。
Further, by using the coordinate value integerizing device described above, it is possible to construct the rendering device 60 as shown in FIG.

【0031】すなわち、図6において、座標値整数化装
置61は、上述の浮動小数点数から整数に変換する装置
で、浮動小数点テクスチャ座標(Sf,Tf,Qf)を
整数テクスチャ座標(Si,Ti,Qi)に変換する装
置である。補間装置62は、座標整数化装置61によっ
て変換された三角形の頂点の整数テクスチャ座標(S
i,Ti,Qi)から三角形内部の整数テクスチャ座標
(s,t,q)を補間を行なって求める装置である。除
算装置63は補間装置62で求めた三角形内部の整数テ
クスチャ座標(s,t,q)からu=s/q,v=t/
qの除算を行なってイメージデータ上の位置を求める装
置である。
That is, in FIG. 6, the coordinate value integer conversion device 61 is a device for converting the above floating point number into an integer, and converts the floating point texture coordinates (Sf, Tf, Qf) into integer texture coordinates (Si, Ti, It is a device for converting into Qi). The interpolating device 62 converts the integer texture coordinates (S of the vertex of the triangle converted by the coordinate integer converting device 61 (S
It is a device that interpolates integer texture coordinates (s, t, q) inside the triangle from i, Ti, Qi). The divider 63 calculates u = s / q, v = t / from the integer texture coordinates (s, t, q) inside the triangle obtained by the interpolator 62.
This is a device for dividing q to obtain a position on image data.

【0032】このレンダリング装置60は、浮動小数点
テクスチャ座標を最適な整数に変換するので、変換後の
計算を精度を悪化させることなく、回路規模の大きな浮
動小数点計算装置ではなく回路規模の小さな整数計算装
置で構成できる。
Since the rendering device 60 converts the floating-point texture coordinates into the optimum integer, it does not deteriorate the accuracy of the calculation after the conversion, and the floating-point calculation device does not have a large circuit scale, but a small-scale integer calculation. It can be configured with a device.

【0033】[0033]

【発明の効果】以上説明したように本発明によれば、検
出された最大の指数を基準値とし、算出された差分を相
対値として、各々の浮動小数点数の相対的な大きさを保
持したまま整数に変換するので、テクスチャ座標に制限
を加えることなく、また精度も悪化させることもなく、
小規模に構成することができるという効果がある。
As described above , according to the present invention , the detected maximum exponent is used as a reference value, and the calculated difference is used as a relative value to hold the relative size of each floating point number. Since it is converted to an integer as it is, without limiting the texture coordinates and without degrading the accuracy,
The effect is that it can be configured on a small scale.

【図面の簡単な説明】[Brief description of drawings]

【図1】本発明の数値変換装置の一実施例の構成を示す
構成図である。
FIG. 1 is a configuration diagram showing a configuration of an embodiment of a numerical conversion device of the present invention.

【図2】図1の浮動小数点レジスタに格納されるデータ
の構成を示す構成図である。
FIG. 2 is a configuration diagram showing a configuration of data stored in a floating point register in FIG.

【図3】図1の最大指数検出装置の構成を示す構成図で
ある。
FIG. 3 is a configuration diagram showing a configuration of the maximum index detection device of FIG.

【図4】図1の仮数シフト装置の構成を示す構成図であ
る。
FIG. 4 is a configuration diagram showing the configuration of the mantissa shift device of FIG.

【図5】図1の符号化装置の構成を示す構成図である。5 is a configuration diagram showing a configuration of the encoding device in FIG. 1. FIG.

【図6】図1の整数化変換装置を使用したレンダリング
装置の構成を示す構成図である。
6 is a configuration diagram showing a configuration of a rendering device using the integer conversion device of FIG. 1. FIG.

【図7】テクスチャ・マッピングの概念を説明する図で
ある。
FIG. 7 is a diagram illustrating the concept of texture mapping.

【図8】グラフィックス・システムの一般例を説明する
図である。
FIG. 8 is a diagram illustrating a general example of a graphics system.

【図9】従来例の数値変換装置の構成を示す構成図であ
る。
FIG. 9 is a configuration diagram showing a configuration of a conventional numerical value conversion device.

【符号の説明】[Explanation of symbols]

10a乃至10i 浮動小数点レジスタ 11 最大指数検出装置 12a乃至12i 仮数シフト装置 13a乃至13i 符号化装置 30a乃至30h 最大値選択装置 40 引算器 41 最上位ビット生成装置 42 シフト装置 50 マイナス装置 51 選択装置 61 座標整数化装置 62 補間装置 63 除算装置 10a to 10i floating point registers 11 Maximum index detector 12a to 12i Mantissa shift device 13a to 13i Encoding device 30a to 30h maximum value selection device 40 subtractor 41 highest bit generator 42 shift device 50 minus device 51 Selector 61 Coordinate integer conversion device 62 Interpolator 63 divider

Claims (7)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】 浮動小数点数を整数に変換する数値変換
装置において、 複数の浮動小数点数を保持する浮動小数点保持手段と、 前記浮動小数点保持手段内の浮動小数点数から最大の指
数を検出する最大指数検出手段と、 前記最大指数検出手段が検出した前記最大の指数と前記
浮動小数点保持手段内の各々の前記浮動小数点数の指数
との差分を求めて前記差分をシフト量として仮数をシフ
トする仮数シフト手段と、 前記仮数シフト手段でシフトされた仮数を符号化する符
号化手段とを備え、 前記最大の指数を基準値とし、前記差分が相対値とし
て、各々の前記浮動小数点数の相対的な大きさを保持し
たまま整数に変換することを特徴とする数値変換装置。
1. A numerical conversion device for converting a floating point number into an integer, a floating point holding means for holding a plurality of floating point numbers, and a maximum for detecting a maximum exponent from the floating point number in the floating point holding means. An exponent detecting unit, and a mantissa for shifting the mantissa using the difference as a shift amount by obtaining a difference between the maximum exponent detected by the maximum exponent detecting unit and the exponent of each floating point number in the floating point holding unit. Shift means, and encoding means for encoding the mantissa shifted by the mantissa shift means, the maximum exponent as a reference value, the difference as a relative value, relative to each of the floating point number A numerical conversion device characterized by converting to an integer while maintaining the size.
【請求項2】 複数の浮動小数点数を保持する浮動小数
点保持手段と、 前記浮動小数点保持手段内の浮動小数点数から最大の指
数を検出する最大指数検出手段と、 前記最大指数検出手段が検出した前記最大の指数と前記
浮動小数点保持手段内の各々の前記浮動小数点数の指数
との差分を求めて前記差分をシフト量として仮数をシフ
トする仮数シフト手段と、 前記仮数シフト手段でシフトされた仮数を符号化する符
号化手段とを備え、 前記最大の指数を基準値とし、前記差分が相対値とし
て、各々の前記浮動小数点数の相対的な大きさを保持し
たまま整数に変換すると共に、 複数の浮動小数点同次座標を入力し、すべての座標値の
相対的な大きさを保ったまま整数に変換し、正規化後の
値が等価な整数同次座標を出力することを特徴とする座
標値整数化装置。
2. A floating point holding means for holding a plurality of floating point numbers, a maximum exponent detecting means for detecting a maximum exponent from the floating point numbers in the floating point holding means, and a maximum exponent detecting means for detecting the maximum exponent. A mantissa shift unit that shifts the mantissa using the difference as a shift amount by obtaining a difference between the maximum exponent and the exponent of each floating point number in the floating point holding unit; and a mantissa shifted by the mantissa shift unit. Encoding means for encoding, the maximum exponent as a reference value, the difference as a relative value, while the relative size of each of the floating point number is converted into an integer while holding, The floating-point homogeneous coordinates of are input, converted to integers while maintaining the relative sizes of all coordinate values, and output the integer homogeneous coordinates whose normalized values are equivalent. Integer apparatus.
【請求項3】 複数の浮動小数点数を保持する浮動小数
点保持手段と、 前記浮動小数点保持手段内の浮動小数点数から最大の指
数を検出する最大指数検出手段と、 前記最大指数検出手段が検出した前記最大の指数と前記
浮動小数点保持手段内の各々の前記浮動小数点数の指数
との差分を求めて前記差分をシフト量として仮数をシフ
トする仮数シフト手段と、 前記仮数シフト手段でシフトされた仮数を符号化する符
号化手段とを備え、 前記最大の指数を基準値とし、前記差分が相対値とし
て、各々の前記浮動小数点の数相対的な大きさを保持し
たまま整数に変換すると共に、 複数の浮動小数点同次座標を入力し、複数の同次座標の
すべての座標値の相対的な大きさを保ったまま整数に変
換し、正規化後の値が等価でかつ補間可能な複数の整数
同次座標を出力することを特徴とする座標値整数化装
置。
3. Floating point holding means for holding a plurality of floating point numbers, maximum exponent detecting means for detecting a maximum exponent from the floating point numbers in the floating point holding means, and maximum exponent detecting means A mantissa shift unit that shifts the mantissa using the difference as a shift amount by obtaining a difference between the maximum exponent and the exponent of each floating point number in the floating point holding unit; and a mantissa shifted by the mantissa shift unit. Encoding means for encoding, the maximum exponent as a reference value, the difference as a relative value, while converting the floating point number relative magnitude of each of the floating point is converted into an integer, Floating-point homogeneous coordinates are input and converted into integers while maintaining the relative size of all coordinate values of multiple homogeneous coordinates, and the normalized values are equivalent and interpolable multiple integers Coordinates integer unit and outputs the coordinates.
【請求項4】 前記複数の浮動小数点同次座標は、多角
形の頂点のテクスチャ座標であって、 テクスチャ座標を整数計算で補間する補間手段を有する
ことを特徴とする請求項3に記載の座標値整数化装置。
4. The coordinate according to claim 3, wherein the plurality of floating-point homogeneous coordinates are texture coordinates of vertices of a polygon, and the interpolation means interpolates the texture coordinates by integer calculation. Value integerizer.
【請求項5】 浮動小数点数を整数に変換する数値変換
装置の数値変換方法において、浮動小数点保持手段が、 複数の浮動小数点数を保持する
浮動小数点保持ステップと、最大指数検出手段が、 前記浮動小数点保持手段内の浮動
小数点数から最大の指数を検出する最大指数検出ステッ
プと、仮数シフト手段が、 前記最大指数検出ステップの処理が
検出した前記最大の指数と前記浮動小数点保持手段内の
各々の前記浮動小数点数の指数との差分を求めて前記差
分をシフト量として仮数をシフトする仮数シフトステッ
プと、符号化手段が、 前記仮数シフトステップの処理でシフト
された仮数を符号化する符号化ステップとを含み、 前記最大の指数を基準値とし、前記差分が相対値とし
て、各々の前記浮動小数点数の相対的な大きさを保持し
たまま整数に変換することを特徴とする数値変換方法。
5. A numerical conversion method of a numerical conversion device for converting a floating point number into an integer, wherein a floating point holding means holds a floating point number for holding a plurality of floating point numbers, and a maximum exponent detecting means comprises the floating point holding means. and the maximum index detection step of detecting a maximum exponent floating-point numbers in the decimal holding means, the mantissa shift means, and said maximum exponent detecting said maximum exponent processing is detected in step of each of said floating point holding means A mantissa shift step of obtaining a difference between the exponent of the floating point number and the mantissa using the difference as a shift amount; and an encoding step of encoding means encoding the mantissa shifted in the process of the mantissa shift step. The maximum exponent as a reference value, the difference as a relative value, while holding the relative size of each of the floating point numbers. Numeric conversion method characterized by converting a few.
【請求項6】 浮動小数点保持手段が、複数の浮動小数
点数を保持する浮動小数点保持ステップと、最大指数検出手段が、 前記浮動小数点保持手段内の浮動
小数点数から最大の指数を検出する最大指数検出ステッ
プと、仮数シフト手段が、 前記最大指数検出ステップの処理が
検出した前記最大の指数と前記浮動小数点保持手段内の
各々の前記浮動小数点数の指数との差分を求めて前記差
分をシフト量として仮数をシフトする仮数シフトステッ
プと、符号化手段が、 前記仮数シフトステップの処理でシフト
された仮数を符号化する符号化ステップとを含み、 前記最大の指数を基準値とし、前記差分が相対値とし
て、各々の前記浮動小数点数の相対的な大きさを保持し
たまま整数に変換すると共に、 複数の浮動小数点同次座標を入力し、すべての座標値の
相対的な大きさを保ったまま整数に変換し、正規化後の
値が等価な整数同次座標を出力することを特徴とする座
標値整数化方法。
6. A floating point holding step in which the floating point holding means holds a plurality of floating point numbers, and a maximum exponent detecting step in which the maximum exponent detecting means detects the maximum exponent from the floating point numbers in the floating point holding means . The detection step and the mantissa shift means obtain the difference between the maximum exponent detected by the processing of the maximum exponent detection step and the exponent of each floating point number in the floating point holding means , and shift the difference. As a mantissa shift step for shifting the mantissa, and an encoding means , including an encoding step for encoding the mantissa shifted in the process of the mantissa shift step, the maximum exponent as a reference value, the difference is relative As a value, while converting the relative size of each floating point number into an integer while retaining the relative size, input multiple floating point homogeneous coordinates and Coordinates integer method characterized by relative size to an integer while maintaining the target values, the values of the normalized outputs the integer equivalent of homogeneous coordinates.
【請求項7】 浮動小数点保持手段が、複数の浮動小数
点数を保持する浮動小数点保持ステップと、最大指数検出手段が、 前記浮動小数点保持手段内の浮動
小数点数から最大の指数を検出する最大指数検出ステッ
プと、仮数シフト手段が、 前記最大指数検出ステップの処理が
検出した前記最大の指数と前記浮動小数点保持手段内の
各々の前記浮動小数点数の指数との差分を求めて前記差
分をシフト量として仮数をシフトする仮数シフトステッ
プと、符号化手段が、 前記仮数シフトステップの処理でシフト
された仮数を符号化する符号化ステップとを含み、 前記最大の指数を基準値とし、前記差分が相対値とし
て、各々の前記浮動小数点数の相対的な大きさを保持し
たまま整数に変換すると共に、 複数の浮動小数点同次座標を入力し、複数の同次座標の
すべての座標値の相対的な大きさを保ったまま整数に変
換し、正規化後の値が等価でかつ補間可能な複数の整数
同次座標を出力することを特徴とする座標値整数化方
法。
7. A floating point holding step in which the floating point holding means holds a plurality of floating point numbers, and a maximum exponent detecting step in which the maximum exponent detecting means detects the maximum exponent from the floating point numbers in the floating point holding means . The detection step and the mantissa shift means obtain the difference between the maximum exponent detected by the processing of the maximum exponent detection step and the exponent of each floating point number in the floating point holding means , and shift the difference. As a mantissa shift step for shifting the mantissa, and an encoding means , including an encoding step for encoding the mantissa shifted in the process of the mantissa shift step, the maximum exponent as a reference value, the difference is relative as a value, and converts the integer while maintaining the relative size of each of the floating-point number, enter multiple floating point homogeneous coordinates, a plurality of the A coordinate value integer that is converted to an integer while maintaining the relative size of all coordinate values, and outputs multiple integer homogeneous coordinates whose normalized values are equivalent and interpolable. Method.
JP23746894A 1994-09-30 1994-09-30 Numerical value conversion device and method, and coordinate value integer conversion device and method Expired - Fee Related JP3384470B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP23746894A JP3384470B2 (en) 1994-09-30 1994-09-30 Numerical value conversion device and method, and coordinate value integer conversion device and method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP23746894A JP3384470B2 (en) 1994-09-30 1994-09-30 Numerical value conversion device and method, and coordinate value integer conversion device and method

Publications (2)

Publication Number Publication Date
JPH08101919A JPH08101919A (en) 1996-04-16
JP3384470B2 true JP3384470B2 (en) 2003-03-10

Family

ID=17015782

Family Applications (1)

Application Number Title Priority Date Filing Date
JP23746894A Expired - Fee Related JP3384470B2 (en) 1994-09-30 1994-09-30 Numerical value conversion device and method, and coordinate value integer conversion device and method

Country Status (1)

Country Link
JP (1) JP3384470B2 (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS5127916A (en) * 1974-09-03 1976-03-09 Matsushita Electric Ind Co Ltd
GB2323189B (en) * 1997-03-14 2001-11-21 Nokia Mobile Phones Ltd Processing multi-bit signals representing floating-point numbers
WO2001042903A1 (en) * 1999-12-07 2001-06-14 Hitachi, Ltd. Data processing apparatus and data processing system
JP4086459B2 (en) * 2000-11-13 2008-05-14 Necエレクトロニクス株式会社 Fixed-point data generation method and fixed-point data generation circuit
JP5935613B2 (en) 2012-09-14 2016-06-15 富士通株式会社 Receiver and soft decision data processing method
JP6225687B2 (en) * 2013-02-18 2017-11-08 富士通株式会社 Data processing apparatus and data processing method
US20160019027A1 (en) * 2014-07-15 2016-01-21 Qualcomm Incorporated Vector scaling instructions for use in an arithmetic logic unit

Also Published As

Publication number Publication date
JPH08101919A (en) 1996-04-16

Similar Documents

Publication Publication Date Title
US7755634B1 (en) System, method and computer program product for branching during programmable vertex processing
US7330864B2 (en) System and method for using native floating point microprocessor instructions to manipulate 16-bit floating point data representations
US5862066A (en) Methods and apparatus for fast check of floating point zero or negative zero
JP3583474B2 (en) Multiplier
US20080263122A1 (en) Multi-function floating point arithmetic pipeline
TWI389028B (en) Multipurpose multiply-add functional unit
KR910004640B1 (en) Image size converter
JP3384470B2 (en) Numerical value conversion device and method, and coordinate value integer conversion device and method
JP2006227939A (en) Arithmetic unit
US6728739B1 (en) Data calculating device and method for processing data in data block form
US6260054B1 (en) Reciprocal generator using piece-wise-linear segments of varying width with floating-point format
US20040267853A1 (en) Method and apparatus for implementing power of two floating point estimation
JP4300001B2 (en) Clipping device
AU615784B2 (en) Method and apparatus for implementing adaptive forward differencing using integer arithmetic
US6891538B1 (en) Dual mode device and method for generating vector cross products or dot products
US7636095B2 (en) Pixel delta interpolation method and apparatus
US5850227A (en) Bit map stretching using operand routing and operation selective multimedia extension unit
US20060001670A1 (en) Rendering process apparatus capable of improving processing speed of overall graphic system
JPH03144782A (en) Three-dimensional processor
JP2007128180A (en) Arithmetic processing unit
JP3613466B2 (en) Data arithmetic processing apparatus and data arithmetic processing program
JPH11328438A (en) Method and device for high-efficiency floating-point z buffering
JP2009282684A (en) Floating decimal arithmetic unit and dda arithmetic processing method
JP4411230B2 (en) COLOR CONVERSION DEVICE, ITS CONTROL METHOD, AND PROGRAM
JP4244444B2 (en) Data processing device, division circuit, and image processing device

Legal Events

Date Code Title Description
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20021128

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20071227

Year of fee payment: 5

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20081227

Year of fee payment: 6

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20091227

Year of fee payment: 7

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20091227

Year of fee payment: 7

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20101227

Year of fee payment: 8

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20111227

Year of fee payment: 9

LAPS Cancellation because of no payment of annual fees