PDA

View Full Version : YUV 16 texture format?



Rice
May 28th, 2003, 17:03
Anyone has more information about the N64 YUV 16 texture binary format? How is a YUV texture stored in N64 memory?

Hacktarux
May 28th, 2003, 18:29
I don' t know what information you have about it, so i'll tell all i know about it : not very much actually and i don't fully understand it, so don't be surprised if it seems unclear or if you already know this...

The conversion is using the following equations:
R=C0*(Y-16)+C1*V
G=C0*(Y-16)+C2*U-C3*V
B=C0*(Y-16)+C4*U

On the other hand the setConvert function set various coefficients named k0 to k5 (s1.7 format). They are supposed to define a yuv/rgb conversion matrix but i don't know if it's the same thing as the Cx coefficients coz i can't see why it defines 6 constants while the equations only needs 5.

Hope it can help...

Rice
May 28th, 2003, 19:06
Hacktarux

I know these equations. I need information about how to read Y,U,V values from rdram memory (How is a YUV texture stored in memory in bits). N64 appearently stores Y,U,V in 4:2:2 or 4:1:1 formats, or other similiar binary formats. I have tried many combinations, none works.

Hacktarux
May 28th, 2003, 19:20
From what i've seen it's stored this way: U0|Y0|V0||Y1|U2|Y2|V2|Y3

Each component is a 8 bits value. It's not really a 16 bits formats but with 32 bits it defines the color of two pixels.

Rice
May 28th, 2003, 19:39
Hacktarux

I tried the binary format you gave, still not good. Can you try this example?

FF56FF74, 0022FFF3, FFDC0046, FFE5FFFF, 000FFFF8, FFFB0007 FFF30018, 00020003,
FFED0005, FFFE0004, FFFE0000, 00020000 FFFF0001, 0008FFFF, 0000FFFF, FFFC0001,
FFFEFFFF, 00000000 00010000, 00000001, 00000003, 0000FFFE, FFFF0000, 00010001
FFFF0000, 00000000, FFFF0001, 00010000, 00000000, FFFF0000 00000000, 0001FFFF,


Thanks

Rice

icepir8
May 28th, 2003, 21:15
Have you looked at this page?

http://www.fourcc.org/fccyuv.htm

Hacktarux
May 28th, 2003, 22:42
Originally posted by Rice
Hacktarux

I tried the binary format you gave, still not good. Can you try this example?

FF56FF74, 0022FFF3, FFDC0046, FFE5FFFF, 000FFFF8, FFFB0007 FFF30018, 00020003,
FFED0005, FFFE0004, FFFE0000, 00020000 FFFF0001, 0008FFFF, 0000FFFF, FFFC0001,
FFFEFFFF, 00000000 00010000, 00000001, 00000003, 0000FFFE, FFFF0000, 00010001
FFFF0000, 00000000, FFFF0001, 00010000, 00000000, FFFF0000 00000000, 0001FFFF,


Thanks

Rice

Are u sure it's using standard Kx constants ?

Rice
May 28th, 2003, 22:56
Icepir8, thanks very much for the link. It is very helpful.

Hacktarux, the texture is using kx coefficients slightly different from the standard ones. The whole 16x16 texture is as below. It is very weired that the 16x16 texture is using 16x16x3 bytes.

The texture is a 16x16 section of the Ogre Batter 64 missing background. I have already figured out how the background is rendered, but can not decode the YUV texture.

Rice

--------------------------------

002A0024, 0006FFF1, FFFD001B, FFF6FFF2, FFEFFFEE, FFFAFFFE, 00010007, FFFE0000,
0004FFFE, 0002FFFF, 00030000, FFFD0004, 0001FFFF, FFFD0001, 00010001, 00010000,
FFFE0001, FFFF0000, 00000000, 00010000, FFFF0000, FFFF0001, 0000FFFF, FFFE0002
FFFF0003, FFFF0000, 0000FFFF, 00000000, FFFFFFFF, 00000001, 00010000, FFFF0000,
001D0023, FFD8FFE7, 000F000D, FFF80011, 00030004, 0004FFFC, 0005FFFC, 00030003,
FFFFFFFF, 0001FFFE, 00030000, FFFE0000, 00010000, 0000FFFE, 00020001, FFFF0000
00000001, 0000FFFF, 00000001, 00000000, 00000001, 00000000, 0000FFFF, 00000000,
0001FFFF, 0000FFFF, 00000000, 00000000, FFFF0000, 00000000, 00010001, 00000001,
FFEE000F, FFE1FFEF, 00110003, 0002FFF8, FFF8FFFB, 00020011, 000C000C, FFEC0006
0005FFFD, FFFA0004, FFFEFFFF, FFFD0004, 00010004, 00000001, FFFF0001, 0001FFFF,
FFFE0002, 0000FFFE, FFFFFFFF, 0001FFFF, FFFF0000, 00000000, 00000001, 0000FFFF,
0002FFFF, 00000000, FFFF0001, FFFF0000, FFFF0000, 0000FFFF, 00000000, 0000FFFF
FFF60000, 0021FFEC, FFDB0001, 00040001, 000BFFFE, 00090009, FFFE0002, FFF5FFFD,
FFFCFFFF, 0006FFFF, 00050001, 00020002, FFF90006, FFFC0002, FFFF0001, FFFD0000,
FFFEFFFF, 00010003, FFFF0000, FFFFFFFF, FFFE0001, FFFF0000, FFFF0001, FFFFFFFE
0003FFFF, FFFF0000, 00010000, FFFF0000, 0000FFFF, 00010000, FFFF0000, 00000000,
FFFAFFFC, 0001FFFE, 0004FFFF, 0000FFFF, 00000001, 00000000, 0001FFFF, 00000000,
00000000, 00000001, 00000000, 00000001, 00010000, 00000000, 00000000, 00000000
00000000, 00000000, 00000000, 00000000, 00000000, 00000000, 00000000, 00000000,
00000000, 00000000, 00000000, 00000000, 00000000, 00000000, 00000000, 00000000,
0006FFFE, 00010001, FFFE0000, 00010001, 0000FFFF, 00000001, 0000FFFF, FFFF0000
0000FFFF, FFFF0000, 00000000, 0000FFFF, 00010000, 00000000, 00000000, 00000000,
00000000, 00000000, 00000000, 00000000, 00000000, 00000000, 00000000, 00000000,
00000000, 00000000, 00000000, 00000000, 00000000, 00000000, 00000000, 00000000

Azimer
June 7th, 2003, 16:04
Take a look at gDPSetConvert in the function manual. Perhaps that may help?