This commit is contained in:
2025-10-07 22:42:30 +09:00
parent 959133058b
commit 8183ff3347
2 changed files with 20 additions and 7 deletions

View File

@@ -100,6 +100,21 @@ bool PlaybackController::LoadVideo(const std::wstring& filePath)
}
LOGF_INFO("[PlaybackController] File opened successfully");
// Enable debug options for DAV1D decoder to dump first 5 frames as BMP
if (m_decoderType == VAVCORE_DECODER_DAV1D) {
VavCoreDebugOptions debugOpts = {};
debugOpts.enable_rgba_debug = true;
debugOpts.rgba_debug_count = 5; // Dump frames 0-4
debugOpts.debug_output_path = "./debug_output";
result = vavcore_set_debug_options(m_vavCorePlayer, &debugOpts);
if (result == VAVCORE_SUCCESS) {
LOGF_INFO("[PlaybackController] Debug options enabled: dump first 5 frames to ./debug_output");
} else {
LOGF_ERROR("[PlaybackController] Failed to set debug options: %d", result);
}
}
// Get video metadata
VavCoreVideoMetadata metadata;
result = vavcore_get_metadata(m_vavCorePlayer, &metadata);

View File

@@ -194,13 +194,11 @@ HRESULT YUV420PUploadBackend::CreateComputeShaderResources() {
HRESULT YUV420PUploadBackend::CompileComputeShader() {
const char* shaderSource = R"(
struct YUVtoRGBConstants {
cbuffer ConstantsBuffer : register(b0) {
float4x4 colorMatrix;
float4 offsets;
};
ConstantBuffer<YUVtoRGBConstants> g_colorConstants : register(b0);
Texture2D<float> g_yTexture : register(t0);
Texture2D<float> g_uTexture : register(t1);
Texture2D<float> g_vTexture : register(t2);
@@ -209,11 +207,11 @@ RWTexture2D<float4> g_rgbTexture : register(u0);
[numthreads(8, 8, 1)]
void main(uint3 id : SV_DispatchThreadID)
{
float y = g_yTexture[id.xy].r - g_colorConstants.offsets.r;
float u = g_uTexture[id.xy / 2].r - g_colorConstants.offsets.g;
float v = g_vTexture[id.xy / 2].r - g_colorConstants.offsets.b;
float y = g_yTexture[id.xy].r - offsets.r;
float u = g_uTexture[id.xy / 2].r - offsets.g;
float v = g_vTexture[id.xy / 2].r - offsets.b;
float3 rgb = mul(float3(y, u, v), (float3x3)g_colorConstants.colorMatrix);
float3 rgb = mul(float3(y, u, v), (float3x3)colorMatrix);
g_rgbTexture[id.xy] = float4(saturate(rgb), 1.0f);
}