METHOD AND SYSTEM FOR ENCODING ROTATIONS AND NORMALS IN 3D GENERATED SCENES

Abstract: A method and system (102) for encoding a video stream using a compact representation for rotations and normals (200). The method and system (102) convert rotations and normals (200) into normalized rotations and normals and then project the normalized versions onto a unit cube (215). Each rotation and normal (200) is encoded according to on which face it was projected. In addition, motion can be compactly represented by movement across the unit cube (215).

Description: TITLE OF THE INVENTION METHOD AND SYSTEM FOR ENCODING ROTATIONS AND NORMALS IN 3D GENERATED SCENES CROSS-REFERENCE TO RELATED APPLICATIONS The present application is related to the co-pending application entitled "'Method and System for Predictive Encoding of Arrays of Data." attorney docket number 2167-0106-2. serial number 09/ 205 , 191 , filed on even date herewith, also naming Julien Signes and Olivier Ondet as inventors. The contents of that co-pending application are incorporated herein by reference. BACKGROUND OF THE INVENTION Field of the Invention The present invention relates to the encoding of computer-generated images, and more particularly to the encoding of 3D scenes utilizing 3D rotations and 3D normals. Discussion of the Background The phrase "computer-generated images" encompasses an expanding area of video technology. Originally the term was often equated with simple text images or 2D images; however, the phrase now encompasses any type of digitally encoded video stream. The Motion Pictures Expert Group (MPEG) was formed to investigate the technologies required for the encoding and decoding of image streams. The resulting standard (now referred to as "MPEG-l") has served as a basis for two additional MPEG standards: MPEG-2 and MPEG-4. MPEG-4 is a standard that is ''in progress" and forms the basis for the present invention. The final cornmittee drafts are ISO IEC FCD 14496-1 MPEG-4 Systems and -2 MPEG-4 Visual, the contents of the final committee drafts are incorporated herein by reference. The draft standard departs from the single stream-based model of video and raises the focus to a series of streams that act in concert. One portion of the standard is the Binary Format for Scenes (also known as "BIFS"). This format allows the description of 3D objects and their motion and provides the ability for greater interaction with that portion of the video stream. The draft standard, however, does not directly provide a topologically coherent quantization scheme that supports a compensation process. The representation of rotations with quaternions is known to be used in 3D computing, but not in the context used in the present invention. One known use is in the Cosmo viewer in which quaternions are used internally to inteφolate between two rotations to avoid rendering artifacts. SUMMARY OF THE INVENTION Not yet available in the BIFS portion of the standard is the ability to efficiently calculate, store and decode rotations and normals. Thus, it is an object of the present invention to address this deficiency. It is another object of the present invention to provide a computer- implemented method and system for more efficiently encoding rotations in a computer-generated image stream. It is a further object of the present invention to provide a computer- implemented method and system for more efficiently encoding normals in a computer-generated image stream. This and other objects of the present invention are addressed by one or more of (1) a computer-implemented method for encoding rotations and normals. (2) a system for encoding rotations and normals, and (3) a computer program product for encoding rotations and normals. Such a system is applicable to improved storage and playback of games, virtual reality environments, and movies. Moreover, based on the improved efficiency, video streams encoded according to the present invention may be played back over lower bandwidth communications links than less efficiently encoded streams. BRIEF DECSRIPTION OF THE DRA INGS A more complete appreciation of the invention and many of the attendant advantages thereof will become readily apparent with reference to the following detailed description, particularly when considered in conjunction with the accompanying drawings, in which: Figure 1 is a schematic illustration of a computer for providing encoding and/or decoding services of the present invention; Figure 2 is an illustration of a unit sphere surrounded by a unit cube onto which normals are projected: Figure 3 is an illustration of the unit cube of Figure 2 unfolded to show the movement from the original point 205 to a new point 205'; Figure 4 is an illustration of the point 205' on the unit cube of Figure 2; and Figure 5 is an illustration of the difference between previous encodings and the encoding according to the present invention. DESCRIPTION OF THE PREFERRED EMBODIMENTS Referring now to the drawings, wherein like reference numerals designate identical or corresponding parts throughout the several views. Figure 1 is a schematic illustration of a computer system for encoding and/or decoding rotations and/or normals in scene descriptions and/or animations. A computer 100 implements the method of the present invention, wherein the computer housing 102 houses a motherboard 104 which contains a CPU 106, memory 108 (e.g., DRAM, ROM, EPROM, EEPROM. SRAM. SDRAM, and Flash RAM), and other optional special puφose logic devices (e.g.. ASICs) or configurable logic devices (e.g., GAL and reprogrammable FPGA). The computer 100 also includes plural input devices, (e.g., a keyboard 122 and mouse 124). and a display card 110 for controlling monitor 120. In addition, the computer system 100 further includes a floppy disk drive 1 14; other removable media devices (e.g.. compact disc 1 19. tape, and removable magneto- optical media (not shown)): and a hard disk 112. or other fixed, high density media drives, connected using an appropriate device bus (e.g., a SCSI bus, an Enhanced IDE bus. or a Ultra DMA bus). Also connected to the same device bus or another device bus, the computer 100 may additionally include a compact disc reader 1 18, a compact disc reader/writer unit (not shown) or a compact disc jukebox (not shown). Although compact disc 119 is shown in a CD caddy, the compact disc 1 19 can be inserted directly into CD-ROM drives which do not require caddies. In addition, a printer (not shown) also provides printed listings of encoded and/or decoded rotations and/or normals. As stated above, the system includes at least one computer readable medium. Examples of computer readable media are compact discs 1 19, hard disks 112. floppy disks, tape, magneto-optical disks. PROMs (EPROM. EEPROM, Flash EPROM), DRAM, SRAM, SDRAM, etc. Stored on any one or on a combination of computer readable media, the present invention includes software for controlling both the hardware of the computer 100 and for enabling the computer 100 to interact with a human user. Such software may include, but is not limited to, device drivers, operating systems and user applications, such as development tools. Such computer readable media further includes the computer program product of the present invention for encoding and/or decoding normals and/or rotations in scene descriptions and/or animations. The computer code mechanisms/devices of the present invention can be any inteφreted or executable code mechanism, including but not limited to scripts, inteφreters, dynamic link libraries, Java classes, and complete executable programs. As shown in Figure 2. the method of the present invention is based on a quantization process that maps normals and rotations onto a "unit" cube surrounding the unit sphere. The process enables the decoder to reconstruct the normals and rotations. Post-processing (e.g.. inteφolation, analog filtering and reconstruction) can be performed separately. For example, a normal 200, that is initially represented by a 3-dimensional unit vector, is projected as a 3D unit vector on the 3D unit sphere 210. (A rotation, that is initially represented as a 3-dimensional unit vector (for its axis) with an additional angle, gets converted into a quaternion - i.e., a 4D unit vector on the 4D unit sphere.) The normal 200 is then quantized by intersecting the normal 200 with a face of the surrounding "unit" cube 215, which yields a point on a particular face (i.e., the positive y face in the example) of the "unit" cube 215. Thus, the normal can be "compressed" by converting the 3-dimensional vector into (1) the location (+1, +2) of the point 205, (2) an orientation (e.g., 0 for x-axis, 1 for y-axis, and 2 for z-axis) of on which axis the point 205 is located, and (3) a direction (e.g., +1 or -1) of the unit vector. (The same process can be performed for a rotation, except that the direction need not be stored since the quaternions that lie in opposite directions on the unit sphere represent equivalent rotations.) Figure 2 is shown using 3 bits per component on the face. Once a normal 200 (or rotation) has been quantized, movement of the point 205 between frames in the video stream can be encoded using the topological coherence that the cubic mapping provides. In its simplest form, a compensation vector describes the movement on the present face of the point 205. However, a point 205 may also move to a different face between frames. In this case, the face index used in the quantization process enables computation of the new location. Movement of the point 205 is described in relation to Figure 3. In Figure 3, the cube of Figure 2 has been unfolded. Each of the faces is appropriately labeled in their upper left corners. The original point 205 is to be moved according to vDelta = [+6, -2] and Inverse = +1. Figure 3 shows on the unfolded cube how the original point 205 moves to become a new point 205'. Likewise, Figure 4 shows the same motion and the result on the original cube of Figure 2. As can be seen in Figure 4, the orientation has changed from the y-axis (ori=l) to the z-axis (ori=2), and the normal 200' points to the new location. The direction, however, has remained +1. Interestingly, to flip from the +y face to its opposite face (i.e., the -y face), movement can be encoded by "jumping" to that face directly by inverting the direction of the previous point by using the direction bit. Therefore, long movements around the surface of the cube can be avoided by starting on an opposite face. Although an example is provided above of movement of a point between frames, the method may be generalized as described below. Each normal is renormalized to the cube according to: ψ*} + n ~ + n. + «„ + n. + n„ + n. Rotations (axis . angle ) are written as quaternions according to: v[0] .sin(|) The normals are rotations are reduced into component form. The number of reduced components is defined to be N, where N=2 for normals, and N=3 for rotations. Accordingly, the dimension of v is then N+l. The compression and quantization process is the same for both normals and rotations and includes determining (1) the orientation. (2) the direction, and (3) the components of each normal or rotation. The orientation, k. of the unit vector v is the index i (where i is in the range of 0 to N), whose component has the largest absolute value (i.e., I v[i] I ). This integer is encoded using two bits. Having found k, the direction , dir, (where dir = 1 or -1) of the unit vector v is determined by using the sign of the component v[k]. As discussed above, this value is not written for rotations (because of the properties of quaternions). The N components of the compressed vector are computed by mapping the square on the unit sphere v 0 < — ^- < 1 > into a N dimensional square according to: Other functions other than the arctangent are possible. Any coordinate transformation function that reduces the distortion of the mapping due to the flatness of the cube's faces may be used. Essentially, the function should virtually bend the flat faces of the wrapping cube so that a given number of bits corresponds to almost the same quantization error anywhere on the underlying sphere. Moreover, although other functions in the form a*tari' (b*c) are possible, where c = v[(i+k+l) mod (Ν+l)]/v[k], as above, the added complexity of these forms increase the encoding and decoding times. Although some values such as b=0.7 give a slight increase in compression, where speed is a controlling factor, a and b are set to 1.0. The entire quantization process, however, is controlled by the number of bits, QuantNbBits, used to represent the encoded normals or rotations. When encoding, if QuantNbBits=0, the encoding process is trivial since vq[i]=0 for each i, and the values need not be coded or written at all - i.e., the values are "virtually" coded using zero bits. Otherwise, each component of v c (which lies between -1 and 1) is quantized as a signed integer as follows: vq[i] = Round(v c [ ] * 2 0uan,NbBi,s - 1 ) where Round() returns the integer part of v t . [ ] . Having calculated the components v c , the components are encoded into a face index and a location on the face. The face index is encoded as an orientation (a 2-bit, unsigned integer) and, for normals only, a direction (a 1-bit, unsigned integer (e.g., where 0 is used as -1 and 1 is used as 1)). The components themselves are then coded as unsigned or signed integers on QuantNbBits according to: 2 QuantNbBiB-l + ^r -j That is. each normal is encoded in a number of bits given by: bits = 1 (direction) + 2 (orientation) + 2 * QuantNbBits. or, more specifically when QuantNbBits = 3, as in the example, then: bits = 1 (direction) + 2 (orientation) + 2 * 3 (i.e., QuantNbBits) = 9. For rotations, the direction bit is omitted, and the number of bits for encoding is given by: bits = 2 (orientation) + 3 * QuantNbBits, or, more specifically when QuantNbBits = 3, as in the example, then: bits = 2 (orientation) + 3 * 3 (i.e., QuantNbBits) = 1 1. The decoding process works in reverse, using the same number of bits to decode the face index (including the direction and orientation). The components themselves are decoded back into signed values according to: v?'[ ] = v Λc ^ - 2^" NnbB ' ts - 1 Having converted the encoded values back into decoded values, the quantization process must be undone through an inverse quantization process. As described above, if QuantNbBits is zero, the coding process was trivial and did not actually write any bits, so the decoding process is similarly trivial and does not read any bits, and v c [i] is set to 0. However, when QuantNbBits is non-zero, the inverse quantization process is performed according to: vq'[i] v,'[ ] = j QuantNbBits-i After extracting the orientation, k, and the direction, dir, the inverse mapping can be performed according to: π.v, v'[(ι + A + l) mod(N + l)] = tan V] ) v'[k] ; = 0,...,N If the object is a rotation, v " can be either used directly or converted back from a quaternion to a Rotation (axis n . angle a ): , v'fll v'[2] v'[3] « - 2.co,- (V [0] ) ^ = -^7^ "y - fcJ i "^ ^JT If the object is a normal, v * can be used directly as the components of the decoded normal. The ability to encode and decode, however, is only a means to an end. The overall process of the present invention enables efficient compensation for motion. Accordingly, a difference between two reasonably close quantized values provides increased compression. Although the compensation process is fully specified with the integer QuantNbBits defined in the quantization process, in order to code the values output by the process, the following parameters have to be defined: CompMin: An array of integers that define the minimum bounds of the compensation vector vDelta. CompNbBits: An integer that defines the number of bits used to represent the components of the compensation vector. Each component vDelta[i] is translated by CompMin[i] and coded on CompNbBits. Thus, the actual coded value is then: vDelta[i] - CompMin[i], and the encoding process defines how to compute the compensation vector vDelta between the quantized normals or rotations vql and vq2. Similar to the encoding of the face index in the quantization process, in the compensation process, the parameters, vql and vq2 are defined by respective orientations and directions, referenced as (1) oril and dirl and (2) ori2 and dir2, respectively for vql and vq2. All of oril, dirl, ori2, and dir2 are integers. In addition, vql and vq2 both include a respective array of quantized integer components that are stored in corresponding arrays vql[] and vq2[]. Based on vql and vq2, the direction of the a compensation vector vDelta is calculated as -1 or 1 (although for rotations the value is ignored), and is refered to as an integer inverse. Then a set of compensation components is calculated and stored in an array of integers vDeltaQ. The values in vDelta are obtained according to method described below. Let the number of reduced components be N, where N=2 for normals and N=3 for rotations. Initially the variable inv=l . Then the differential orientation. dOri. and direction, dDir, between vql and vq2 are computed according to: dOri = (ori2-oril) mod (N+l) dDir = dirl *dir2 scale = max(l/2.2 twω " - 1 ). That is, the scale represents the maximum value represented on a face of the cube based on the number of bits used in quantization. However, 0 and 1 bit(s) are special cases for QuantNbBits. In the case of 0 and 1 bit(s), only the centers of the faces on the cube can be represented. Thus, coding with 0 bits (plus the direction and orientation bits) is more efficient than coding with 1 bit since 0 bits uses less space and allows coding of the same information. Moreover, the preferred embodiment of the present invention utilizes odd values for the limits of each face in order to ensure that zero can be correctly represented on each face. Although representing face values in this fashion elaves one value (e.g., -128 when QuantNbBits = 8) unused, it is preferrable to accurately represent pure directions at the expense of less efficient coding. In fact, to compensate for lower coding efficencies in general, additional layers of coding (e.g., Huffman coding) can be used on top. However, in the preferred embodiment, no additional coding is applied to recover the lost one bit since the added complexity is not offset by a significant enough gain. Then, depending on the differential orientation, dOri, each of the following two cases are considered separately. dOrt = 0 vDelta is defined by vDelta [l] = vq2 [ ] -vql [i] dOri ≠ 0 Letdist = vq2 [N-αOri , -vql [dOn-i] vDelta is then defined bv • 0 < ι< dOri • vDeltafx] = ιnv"vq2 [ι-dOrι-1] -vq[ι] i = dOri - 1 vDelta [i] ιnv*2*scale-dιst dOπ ≤ ι< N vDelta [ι] = mv*vq2 [i-dOπ] -vql [I] Since the variable inv may have changed during the calculation, the variable inverse is calculated after the fact according to: inverse = mv * dDir. Sometimes there are two ways to represent the same rotation, depending on the face from which the projected point is seen. However, this marginal non-injectivity in the quantization process may not yield exactly vq2 when vql is compensated by vDelta to create vq2\ However, vq2 and vq2' will always represent the same normal or rotation. Having calculated the compensation, the compensation must be encoded as done during quantization. For normals only, the inverse is coded on a single bit. The compensation vector's components are then translated by -CompMin and coded on CompNbBits according to: v « ι c «/ ._' =vDelta[<]-CompMin[z] The encoding process is then reversed, and the compensation vectors are decoded. The decoding process transforms the normal or rotation vql by the compensation vector vDelta to yield the quantized normal or rotation vq2. For normals only, the single bit inversion is decoded. Then, the compensation vector's components are translated by CompMin and coded on CompNbBits according to: vDeltψ] = v decotied + CompMin[;] From vDelta, the compensation process can proceed. The initial parameter, vql, includes (1) an orientationl, (2) a directionl, and (3) a set of quantized components stored in an array of integers vql [ ] . Likewise the compensation vector. vDelta, includes (1) an inverse integer labeled "inverse," and set of compensation components stored in an array of integers vDelta [ ] . The output of the compensation process is a quantized parameter vq2, defined by (1) an orientation, (2) a direction, and (3) a set of quantized components stored in an array, vq2[], of integers. The values of vq2[] are computed. Also, scale is given by: scale — max (1/2 , 2- — U- Initially an addition is performed component-by-component and stored in a temporary array according to: vqTemp [ i] = vql [ i ] + vDelta [ i ] . As always, N is the number of reduced components, where N=2 for normals and N=3 for rotations. Based on the initial calculations, further processing is performed according to which of the following three cases are true. PC17US99/26030 For every index 1, vq2 is defined by, |vqTemp[iJ < scale vq2[ ] = vqTemp[ι] orιencatιon2= orientationl dιrect;ιon2 = directionl * inverse There is one and only vq2 is rescaled as if gliding on the faces of the mapping cube. one index such that Let inv = 1 if vqTemp [ k] >=0, and -1 else |vqTemp[kJ > scale Let dOr = k+ 1 The components of vq2 are computed as follows 0 < κ N -dOri vq2[i] = ιnv*vqTemp[ ( +dOri) mod N] i = N - dOri vq2[i] = ιnv*2*scale-vqTemp[dOn-l] N -dOrκ κ N vq2[i] = inv*vqTemp [ (ι+dOrι-1) mod orιentatιcn2= (orientationl T dOri) moα(M+lj dιrect on2 =dιrectιonl * inverse * mv There are several The result is undefined. This means the encoding process should not let this case indices k such that happen, but a backup strategy could easily be designed for the decoder. |vqTemp[kJ > scale Accordingly, the present invention enables normals and rotations to be coded more efficiently. The method applied to rotations and normals is uniform, which enables an optimal system to be built for scene encoding. It is believed that the prediction / compensation process described herein combined with an appropriate quantization and entropy coding will enable a reduction in data size for video streams, as shown graphically in Figure 5. Such a reduction is expected to be by a factor of 15 or more in light of a quantization reduction of about 5 : 1 and a compensation reduction of about another 2 : 1 to 3 : 1 from the quantized state. As shown in Table 1 below, the compression of rotations and normals according to the present invention can provide significant compression of scenes as compared to VRML ASCII files representing substantially similar video streams. Table 1 As would be evident to one of ordinary skill in the art, the method and system may be practised other than explicitly set forth herein without departing from the spirit of the invention. Therefore, the specification is not intended to be limiting, and only the scope of the claims defines the limits of the invention.

Claims: Claims: 1. A computer-implemented method of encoding a video stream, the method comprising the steps of : (a) calculating an original vector representing one of a normal and a rotation; (b) calculating a normalized vector from the original vector; (c) projecting the normalized vector onto a unit cube to produce a first point on a first face of the unit cube; and (d) encoding a video stream using an index of the first face and a location of the first point on the first face. 2. The computer-implemented method according to claim 1. further comprising the steps of : (e) calculating a motion vector based on motion, along the unit cube, between the first point on the first face and a second point on a second face: and (f) encoding the video stream using the motion vector. 3. The computer-implemented method according to claim 2, wherein the first and second faces are the same face on the unit cube. 4. The computer-implemented method according to claim 2. wherein the first and second faces are different faces on the unit cube. 5. The computer-implemented method according to claim 1, further comprising the step of decoding the video stream by receiving the index of the first face and the first point and converting back to the one of a normal and a rotation. 6. The computer-implemented method according to claim 2. further comprising the step of decoding the video stream by receiving the motion vector and calculating a corresponding one of a normal and a rotation.

Inventors: ONDET OLIVER, SIGNES JULIEN, ONDET, OLIVER, SIGNES, JULIEN
Applicants: FRANCE TELECOM, ONDET OLIVER, SIGNES JULIEN, ONDET, OLIVER, SIGNES, JULIEN
Application year: 1999
Main classification: G06T
IPC codes: G06T3, G06T15, G06T17, H04N7