Edit

Share via


MFSampleExtensionPsnrYuv structure (mfapi.h)

Stores Peak Signal-to-Noise Ratio (PSNR) values for the Y, U, and V planes of an encoded video frame. PSNR is calculated by comparing the reconstructed frame to the original input frame.

Syntax

typedef struct _MFSampleExtensionPsnrYuv {
  FLOAT psnrY;
  FLOAT psnrU;
  FLOAT psnrV;
} MFSampleExtensionPsnrYuv;

Members

psnrY

The PSNR for the Y plane.

psnrU

The PSNR for the U plane.

psnrV

The PSNR for the V plane.

Remarks

Use IMFAttributes::SetUnknown to attach an IMFMediaBuffer containing the PSNR values to an output sample. Use IMFAttributes::GetUnknown to retrieve the IMFMediaBuffer containing the PSNR values from an output sample. The IMFMediaBuffer contains memory that matches the size of the MFSampleExtensionPsnrYuv structure.

PSNR should only be reported when the entire frame has completed encoding. If the encoder uses multiple slices, the PSNR buffer should be attached to the IMFSample of the last slice.

If the encoder only supports PSNR for the Y plane, the psnrU and psnrV fields shall be zero.

MFCreateDXGISurfaceBuffer can be used to convert a GPU resource into an IMFMediaBuffer.

Requirements

Requirement Value
Minimum supported client Windows 11, build 26100
Minimum supported server Windows Server 2025
Header mfapi.h