Add Y2R::GetStandardCoefficientParams

This commit is contained in:
wheremyfoodat 2023-11-01 22:49:50 +02:00
parent 5a2e554a6c
commit 171733870d
2 changed files with 33 additions and 1 deletions

View file

@ -1,4 +1,5 @@
#pragma once
#include <array>
#include <optional>
#include "helpers.hpp"
#include "kernel_types.hpp"
@ -50,6 +51,15 @@ class Y2RService {
Block8x8 = 1, // Output buffer's pixels are morton swizzled. Used when outputting to a GPU texture.
};
// https://github.com/citra-emu/citra/blob/ac9d72a95ca9a60de8d39484a14aecf489d6d016/src/core/hle/service/cam/y2r_u.cpp#L33
using CoefficientSet = std::array<s16, 8>;
static constexpr std::array<CoefficientSet, 4> standardCoefficients{{
{{0x100, 0x166, 0xB6, 0x58, 0x1C5, -0x166F, 0x10EE, -0x1C5B}}, // ITU_Rec601
{{0x100, 0x193, 0x77, 0x2F, 0x1DB, -0x1933, 0xA7C, -0x1D51}}, // ITU_Rec709
{{0x12A, 0x198, 0xD0, 0x64, 0x204, -0x1BDE, 0x10F2, -0x229B}}, // ITU_Rec601_Scaling
{{0x12A, 0x1CA, 0x88, 0x36, 0x21C, -0x1F04, 0x99C, -0x2421}}, // ITU_Rec709_Scaling
}};
InputFormat inputFmt;
OutputFormat outputFmt;
Rotation rotation;
@ -88,6 +98,7 @@ class Y2RService {
void setSpacialDithering(u32 messagePointer);
void setStandardCoeff(u32 messagePointer);
void setTemporalDithering(u32 messagePointer);
void getStandardCoefficientParams(u32 messagePointer);
void startConversion(u32 messagePointer);
void stopConversion(u32 messagePointer);