What's new

YUV 16 texture format?

Rice

Emulator Developer
Anyone has more information about the N64 YUV 16 texture binary format? How is a YUV texture stored in N64 memory?
 

Hacktarux

Emulator Developer
Moderator
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...
 
OP
Rice

Rice

Emulator Developer
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

Emulator Developer
Moderator
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.
 
Last edited:
OP
Rice

Rice

Emulator Developer
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
 

Hacktarux

Emulator Developer
Moderator
Rice said:
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 ?
 
OP
Rice

Rice

Emulator Developer
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

Emulator Developer
Moderator
Take a look at gDPSetConvert in the function manual. Perhaps that may help?
 

Top