- Posts: 6
- Joined: Fri Feb 15, 2019 12:52 am
- Real Name: Michael Price
The BMDSwitcherPixelFormat::bmdSwitcherPixelFormat10BitYUVA is documented as follows
Says 8 bytes but has 6 values. Is there padding? The name is enum value contains YUV, but the explanatory sentence has Cb and Cr values. Below are the values I'm getting back assuming a char size byte and casting the result as an (int).
There are 2 stills created in Photoshop the first is RGB(0,0,0) and the 2nd is RGB(255,255,255) uploaded with the BM PS tool.
Here is the code:
When the frame is targeting the black still output is:
White Still:
These number seem no nonsensical. I would expect everything to be zero except the padding byte for black still and everything to be zero except matching large Y (indicating the luminance upper bound) values in the white still.
Any ideas?
BMDSwitcherPixelFormat::bmdSwitcherPixelFormat10BitYUVA
Eight bytes per two pixels, a0, cb, y0, a1, cr, y1.
Says 8 bytes but has 6 values. Is there padding? The name is enum value contains YUV, but the explanatory sentence has Cb and Cr values. Below are the values I'm getting back assuming a char size byte and casting the result as an (int).
There are 2 stills created in Photoshop the first is RGB(0,0,0) and the 2nd is RGB(255,255,255) uploaded with the BM PS tool.
Here is the code:
- Code: Select all
//Grab the frame above ^
auto pixelF = frame->GetPixelFormat();
switch (pixelF) {
case bmdSwitcherPixelFormat8BitARGB:
puts("Four bytes per pixel, alpha, red, green, blue.");
break;
case bmdSwitcherPixelFormat8BitXRGB:
puts("Four bytes per pixel, padding, red, green, blue.");
break;
case bmdSwitcherPixelFormat8BitYUV:
puts("Four bytes per two pixels, cb, y0, cr, y1.");
break;
case bmdSwitcherPixelFormat10BitYUVA:
puts("Eight bytes per two pixels, a0, cb, y0, a1, cr, y1.");
break;
}
char* frameData = nullptr;
frame->GetBytes((void**)&frameData);
for(int i = 0; i < 8; i++){
std::cout << (int)frameData[i] << "\n";
}
When the frame is targeting the black still output is:
- Code: Select all
Eight bytes per two pixels, a0, cb, y0, a1, cr, y1.
58
-104
0
64
58
-104
0
64
White Still:
- Code: Select all
Eight bytes per two pixels, a0, cb, y0, a1, cr, y1.
58
-105
-1
-87
58
-104
3
-87
These number seem no nonsensical. I would expect everything to be zero except the padding byte for black still and everything to be zero except matching large Y (indicating the luminance upper bound) values in the white still.
Any ideas?