Compare commits

...

3 Commits

View File

@ -408,7 +408,49 @@ int32_t CSimpleMovieFrame::OpenVideo() {
const uint32_t widthByFormat[6] = { 800, 1024, 800, 1024, 800, 1024 };
const uint32_t heightByFormat[6] = { 384, 512, 512, 576, 384, 512 };
static uint32_t s_strideData[144] = { 512, 256, 0, 3200, 256, 256, 2048, 3200, 32, 256, 3072, 3200, 512, 128, 819200, 3200, 256, 128, 821248, 3200, 32, 128, 822272, 3200, 512, 512, 0, 4096, 512, 512, 2048, 4096, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 512, 512, 0, 3200, 256, 512, 2048, 3200, 32, 512, 3072, 3200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 512, 512, 0, 4096, 512, 512, 2048, 4096, 512, 64, 2097152, 4096, 512, 64, 2099200, 4096, 0, 0, 0, 0, 0, 0, 0, 0, 512, 256, 0, 3200, 256, 256, 2048, 3200, 32, 256, 3072, 3200, 512, 128, 819200, 3200, 256, 128, 821248, 3200, 32, 128, 822272, 3200, 512, 512, 0, 4096, 512, 512, 2048, 4096, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
static uint32_t s_strideData[144] = {
512, 256, 0, 3200,
256, 256, 2048, 3200,
32, 256, 3072, 3200,
512, 128, 819200, 3200,
256, 128, 821248, 3200,
32, 128, 822272, 3200,
512, 512, 0, 4096,
512, 512, 2048, 4096,
0, 0, 0, 0,
0, 0, 0, 0,
0, 0, 0, 0,
0, 0, 0, 0,
512, 512, 0, 3200,
256, 512, 2048, 3200,
32, 512, 3072, 3200,
0, 0, 0, 0,
0, 0, 0, 0,
0, 0, 0, 0,
512, 512, 0, 4096,
512, 512, 2048, 4096,
512, 64, 2097152, 4096,
512, 64, 2099200, 4096,
0, 0, 0, 0,
0, 0, 0, 0,
512, 256, 0, 3200,
256, 256, 2048, 3200,
32, 256, 3072, 3200,
512, 128, 819200, 3200,
256, 128, 821248, 3200,
32, 128, 822272, 3200,
512, 512, 0, 4096,
512, 512, 2048, 4096,
0, 0, 0, 0,
0, 0, 0, 0,
0, 0, 0, 0,
0, 0, 0, 0
};
const uint32_t imageSize = widthByFormat[this->m_textureFormat] * heightByFormat[this->m_textureFormat] * 4;
this->m_imageData = reinterpret_cast<char*>(ALLOC_ZERO(imageSize));
@ -554,25 +596,63 @@ int32_t CSimpleMovieFrame::DecodeFrame(bool update) {
return 1;
}
int32_t s_movieTextureUpdate[144] = {
0, 6, 512, 256, 0, 6, 256, 256, 0, 6, 32, 256, 0, 0, 512, 122,
0, 0, 256, 122, 0, 0, 32, 122, 0, 24, 512, 512, 0, 0, 512, 488,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 512, 480, 0,
32, 256, 480, 0, 32, 32, 480, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 512, 512, 0, 0, 512, 512, 0, 0, 512, 64, 0, 0, 512, 64, 0, 0, 0, 0,
0, 0, 0, 0, 0, 21, 512, 256, 0, 21, 256, 256, 0, 21, 32, 256, 0, 0, 512,
107, 0, 0, 256, 107, 0, 0, 32, 107, 0, 38, 512, 512, 0, 0, 512, 474, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
static int32_t s_movieTextureUpdate[] = {
0, 6, 512, 256, // Format: 0, Texture: 0
0, 6, 256, 256, // Format: 0, Texture: 1
0, 6, 32, 256, // Format: 0, Texture: 2
0, 0, 512, 122, // Format: 0, Texture: 3
0, 0, 256, 122, // Format: 0, Texture: 4
0, 0, 32, 122, // Format: 0, Texture: 5
0, 24, 512, 512, // Format: 1, Texture: 0
0, 0, 512, 488, // Format: 1, Texture: 1
0, 0, 0, 0, // Format: 1, Texture: 2
0, 0, 0, 0, // Format: 1, Texture: 3
0, 0, 0, 0, // Format: 1, Texture: 4
0, 0, 0, 0, // Format: 1, Texture: 5
0, 32, 512, 480, // Format: 2, Texture: 0
0, 32, 256, 480, // Format: 2, Texture: 1
0, 32, 32, 480, // Format: 2, Texture: 2
0, 0, 0, 0, // Format: 2, Texture: 3
0, 0, 0, 0, // Format: 2, Texture: 4
0, 0, 0, 0, // Format: 2, Texture: 5
0, 0, 512, 512, // Format: 3, Texture: 0
0, 0, 512, 512, // Format: 3, Texture: 1
0, 0, 512, 64, // Format: 3, Texture: 2
0, 0, 512, 64, // Format: 3, Texture: 3
0, 0, 0, 0, // Format: 3, Texture: 4
0, 0, 0, 0, // Format: 3, Texture: 5
0, 21, 512, 256, // Format: 4, Texture: 0
0, 21, 256, 256, // Format: 4, Texture: 1
0, 21, 32, 256, // Format: 4, Texture: 2
0, 0, 512, 107, // Format: 4, Texture: 3
0, 0, 256, 107, // Format: 4, Texture: 4
0, 0, 32, 107, // Format: 4, Texture: 5
0, 38, 512, 512, // Format: 5, Texture: 0
0, 0, 512, 474, // Format: 5, Texture: 1
0, 0, 0, 0, // Format: 5, Texture: 2
0, 0, 0, 0, // Format: 5, Texture: 3
0, 0, 0, 0, // Format: 5, Texture: 4
0, 0, 0, 0 // Format: 5, Texture: 5
};
for (uint32_t i = 0; i < textureCountByFormat[this->m_textureFormat]; ++i) {
uint32_t v9 = 4 * (i + 6 * this->m_textureFormat);
// WARNING(workaround): Uncomment the code below when GxTexUpdate will be working properly
/*
GxTexUpdate(
this->m_textures[i],
s_movieTextureUpdate[v9],
s_movieTextureUpdate[v9 + 0],
s_movieTextureUpdate[v9 + 1],
s_movieTextureUpdate[v9 + 2],
s_movieTextureUpdate[v9 + 3],
1);
*/
GxTexUpdate(this->m_textures[i], 0, 0, 0, 0, 1);
}
return 1;
@ -629,7 +709,49 @@ void CSimpleMovieFrame::Render() {
GxRsSet(GxRs_BlendingMode, 0);
GxRsSetAlphaRef();
static float s_layout[] = {0.0, 0.63999999, 0.11, -0.33000001, 0.63999999, 0.95999998, 0.11, -0.33000001, 0.95999998, 1.0, 0.11, -0.33000001, 0.0, 0.63999999, 0.33000001, 0.11, 0.63999999, 0.95999998, 0.33000001, 0.11, 0.95999998, 1.0, 0.33000001, 0.11, 0.0, 0.5, 0.333, -0.333, 0.5, 1.0, 0.333, -0.333, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.63999999, 0.41999999, -0.41999999, 0.63999999, 0.95999998, 0.41999999, -0.41999999, 0.95999998, 1.0, 0.41999999, -0.41999999, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.5, 0.32659999, -0.41999999, 0.5, 1.0, 0.32659999, -0.41999999, 0.0, 0.5, 0.41999999, 0.32659999, 0.5, 1.0, 0.41999999, 0.32659999, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.63999999, 0.11, -0.33000001, 0.63999999, 0.95999998, 0.11, -0.33000001, 0.95999998, 1.0, 0.11, -0.33000001, 0.0, 0.63999999, 0.33000001, 0.11, 0.63999999, 0.95999998, 0.33000001, 0.11, 0.95999998, 1.0, 0.33000001, 0.11, 0.0, 0.5, 0.333, -0.333, 0.5, 1.0, 0.333, -0.333, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 };
static float s_layout[] = {
0.0, 0.63999999, 0.11, -0.33000001,
0.63999999, 0.95999998, 0.11, -0.33000001,
0.95999998, 1.0, 0.11, -0.33000001,
0.0, 0.63999999, 0.33000001, 0.11,
0.63999999, 0.95999998, 0.33000001, 0.11,
0.95999998, 1.0, 0.33000001, 0.11,
0.0, 0.5, 0.333, -0.333,
0.5, 1.0, 0.333, -0.333,
0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0,
0.0, 0.63999999, 0.41999999, -0.41999999,
0.63999999, 0.95999998, 0.41999999, -0.41999999,
0.95999998, 1.0, 0.41999999, -0.41999999,
0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0,
0.0, 0.5, 0.32659999, -0.41999999,
0.5, 1.0, 0.32659999, -0.41999999,
0.0, 0.5, 0.41999999, 0.32659999,
0.5, 1.0, 0.41999999, 0.32659999,
0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0,
0.0, 0.63999999, 0.11, -0.33000001,
0.63999999, 0.95999998, 0.11, -0.33000001,
0.95999998, 1.0, 0.11, -0.33000001,
0.0, 0.63999999, 0.33000001, 0.11,
0.63999999, 0.95999998, 0.33000001, 0.11,
0.95999998, 1.0, 0.33000001, 0.11,
0.0, 0.5, 0.333, -0.333,
0.5, 1.0, 0.333, -0.333,
0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0
};
float aspectCompensation = CoordinateGetAspectCompensation();