Skip to content
Snippets Groups Projects

video-hdr: Rework for GstVideoMasteringDisplayInfo and GstVideoContentLightLevel struct

Merged Seungha Yang requested to merge seungha.yang/gst-plugins-base:hdr-rework into master

This commit modifies GstVideoMasteringDisplayInfo and GstVideoContentLightLevel structs so that each value is to be more like hdr_metadata_infoframe struct of linux drm header and DXGI_HDR_METADATA_HDR10 struct of Windows. So each value is no more fraction but normalized one as per CTA 861.G spec. Also the unit of each value will be consistent with H.264, H.265 specifications, hdr_metadata_infoframe struct for linux and DXGI_HDR_METADATA_HDR10 struct for Windows.

cc: @slomo @ndufresne @dabrain34

Following MRs must be merged at once with this MR.

FYI

Proposed GstVideoMasteringDisplayInfo and GstVideoContentLightLevel struct

struct _GstVideoMasteringDisplayInfoCoordinates
{
  guint16 x;
  guint16 y;
};

struct _GstVideoMasteringDisplayInfo
{
  GstVideoMasteringDisplayInfoCoordinates display_primaries[3];
  GstVideoMasteringDisplayInfoCoordinates white_point;
  guint32 max_display_mastering_luminance;
  guint32 min_display_mastering_luminance;

  /*< private >*/
  gpointer _gst_reserved[GST_PADDING];
};

struct _GstVideoContentLightLevel
{
  guint16 max_content_light_level;
  guint16 max_frame_average_light_level;

  /*< private >*/
  gpointer _gst_reserved[GST_PADDING];
};

DXGI_HDR_METADATA_HDR10 struct in dxgi1_5.h

typedef struct DXGI_HDR_METADATA_HDR10
    {
    UINT16 RedPrimary[ 2 ];
    UINT16 GreenPrimary[ 2 ];
    UINT16 BluePrimary[ 2 ];
    UINT16 WhitePoint[ 2 ];
    UINT MaxMasteringLuminance;
    UINT MinMasteringLuminance;
    UINT16 MaxContentLightLevel;
    UINT16 MaxFrameAverageLightLevel;
    } 	DXGI_HDR_METADATA_HDR10;

hdr_metadata_infoframe struct in drm_mode.h

struct hdr_metadata_infoframe {
	__u8 eotf;
	__u8 metadata_type;
	struct {
		__u16 x, y;
		} display_primaries[3];
	struct {
		__u16 x, y;
		} white_point;
	__u16 max_display_mastering_luminance;
	__u16 min_display_mastering_luminance;
	__u16 max_cll;
	__u16 max_fall;
};

AVMasteringDisplayMetadata and AVContentLightMetadata of ffmpeg

typedef struct AVMasteringDisplayMetadata {
    /**
     * CIE 1931 xy chromaticity coords of color primaries (r, g, b order).
     */
    AVRational display_primaries[3][2];

    /**
     * CIE 1931 xy chromaticity coords of white point.
     */
    AVRational white_point[2];

    /**
     * Min luminance of mastering display (cd/m^2).
     */
    AVRational min_luminance;

    /**
     * Max luminance of mastering display (cd/m^2).
     */
    AVRational max_luminance;

    /**
     * Flag indicating whether the display primaries (and white point) are set.
     */
    int has_primaries;

    /**
     * Flag indicating whether the luminance (min_ and max_) have been set.
     */
    int has_luminance;

} AVMasteringDisplayMetadata;


typedef struct AVContentLightMetadata {
    /**
     * Max content light level (cd/m^2).
     */
    unsigned MaxCLL;

    /**
     * Max average light level per frame (cd/m^2).
     */
    unsigned MaxFALL;
} AVContentLightMetadata;
Edited by Seungha Yang

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Makes sense to me otherwise

  • mentioned in merge request gstreamer-vaapi!270 (merged)

  • Seungha Yang mentioned in merge request gst-libav!65 (merged)

    mentioned in merge request gst-libav!65 (merged)

  • mentioned in merge request gst-plugins-good!520 (merged)

  • mentioned in merge request gst-plugins-bad!1113 (merged)

  • Seungha Yang added 5 commits

    added 5 commits

    • f84fc1ff...7b00e5de - 4 commits from branch gstreamer:master
    • 99595515 - video-hdr: Rework for GstVideoMasteringDisplayInfo and GstVideoContentLightLevel struct

    Compare with previous version

  • Seungha Yang resolved all threads

    resolved all threads

  • Seungha Yang changed the description

    changed the description

  • hrm...

     [259/765] /builds/seungha.yang/gst-plugins-base/cerbero-build/dist/linux_x86_64/bin/g-ir-compiler gst-libs/gst/video/GstVideo-1.0.gir --output gst-libs/gst/video/GstVideo-1.0.typelib --includedir=/builds/seungha.yang/gst-plugins-base/cerbero-build/dist/linux_x86_64/share/gir-1.0
     FAILED: gst-libs/gst/video/GstVideo-1.0.typelib 
     /builds/seungha.yang/gst-plugins-base/cerbero-build/dist/linux_x86_64/bin/g-ir-compiler gst-libs/gst/video/GstVideo-1.0.gir --output gst-libs/gst/video/GstVideo-1.0.typelib --includedir=/builds/seungha.yang/gst-plugins-base/cerbero-build/dist/linux_x86_64/share/gir-1.0
     **
     ERROR:girepository/girparser.c:343:state_switch: assertion failed: (ctx->state != newstate)
     Bail out! ERROR:girepository/girparser.c:343:state_switch: assertion failed: (ctx->state != newstate)
  • Seungha Yang added 1 commit

    added 1 commit

    • 58b849c0 - video-hdr: Rework for GstVideoMasteringDisplayInfo and GstVideoContentLightLevel struct

    Compare with previous version

  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Please register or sign in to reply
    Loading