[host] hdr: encode legacy captures as HDR10

Convert FP16 scRGB captures to BT.2020 PQ before storing them in the
10-bit wire format. Preserve linear-light downsampling, publish the real
SDR white level and display metadata, and advance the format version when
those properties change.
This commit is contained in:
Geoffrey McRae
2026-07-19 18:37:10 +10:00
parent 4abbf33e9f
commit c190aaf579
7 changed files with 324 additions and 224 deletions

View File

@@ -84,8 +84,17 @@ typedef struct CaptureFrame
bool truncated; // true if the frame data is truncated
bool hdr; // true if the frame format is HDR
bool hdrPQ; // true if the frame format is PQ transformed
bool hdrMetadata; // true if the HDR static metadata is valid
CaptureRotation rotation; // output rotation of the frame
uint16_t hdrDisplayPrimary[3][2];
uint16_t hdrWhitePoint[2];
uint32_t hdrMaxDisplayLuminance;
uint32_t hdrMinDisplayLuminance;
uint32_t hdrMaxContentLightLevel;
uint32_t hdrMaxFrameAverageLightLevel;
uint32_t sdrWhiteLevel;
uint32_t damageRectsCount;
FrameDamageRect damageRects[KVMFR_MAX_DAMAGE_RECTS];
}