linux/drivers/media/platform/allegro-dvt/nal-hevc.h

/* SPDX-License-Identifier: GPL-2.0 */
/*
 * Copyright (C) 2019 Pengutronix, Michael Tretter <[email protected]>
 *
 * Convert NAL units between raw byte sequence payloads (RBSP) and C structs.
 */

#ifndef __NAL_HEVC_H__
#define __NAL_HEVC_H__

#include <linux/errno.h>
#include <linux/kernel.h>
#include <linux/types.h>
#include <linux/v4l2-controls.h>
#include <linux/videodev2.h>

struct nal_hevc_profile_tier_level {};

/*
 * struct nal_hevc_vps - Video parameter set
 *
 * C struct representation of the video parameter set NAL unit as defined by
 * Rec. ITU-T H.265 (02/2018) 7.3.2.1 Video parameter set RBSP syntax
 */
struct nal_hevc_vps {};

#define N_HRD_PARAMS
struct nal_hevc_sub_layer_hrd_parameters {};

struct nal_hevc_hrd_parameters {};

/*
 * struct nal_hevc_vui_parameters - VUI parameters
 *
 * C struct representation of the VUI parameters as defined by Rec. ITU-T
 * H.265 (02/2018) E.2.1 VUI parameters syntax.
 */
struct nal_hevc_vui_parameters {};

/*
 * struct nal_hevc_sps - Sequence parameter set
 *
 * C struct representation of the video parameter set NAL unit as defined by
 * Rec. ITU-T H.265 (02/2018) 7.3.2.2 Sequence parameter set RBSP syntax
 */
struct nal_hevc_sps {};

struct nal_hevc_pps {};

/**
 * nal_hevc_profile() - Get profile_idc for v4l2 hevc profile
 * @profile: the profile as &enum v4l2_mpeg_video_hevc_profile
 *
 * Convert the &enum v4l2_mpeg_video_hevc_profile to profile_idc as specified
 * in Rec. ITU-T H.265 (02/2018) A.3.
 *
 * Return: the profile_idc for the passed level
 */
static inline int nal_hevc_profile(enum v4l2_mpeg_video_hevc_profile profile)
{}

/**
 * nal_hevc_tier() - Get tier_flag for v4l2 hevc tier
 * @tier: the tier as &enum v4l2_mpeg_video_hevc_tier
 *
 * Convert the &enum v4l2_mpeg_video_hevc_tier to tier_flag as specified
 * in Rec. ITU-T H.265 (02/2018) A.4.1.
 *
 * Return: the tier_flag for the passed tier
 */
static inline int nal_hevc_tier(enum v4l2_mpeg_video_hevc_tier tier)
{}

/**
 * nal_hevc_level() - Get level_idc for v4l2 hevc level
 * @level: the level as &enum v4l2_mpeg_video_hevc_level
 *
 * Convert the &enum v4l2_mpeg_video_hevc_level to level_idc as specified in
 * Rec. ITU-T H.265 (02/2018) A.4.1.
 *
 * Return: the level_idc for the passed level
 */
static inline int nal_hevc_level(enum v4l2_mpeg_video_hevc_level level)
{}

static inline int nal_hevc_full_range(enum v4l2_quantization quantization)
{}

static inline int nal_hevc_color_primaries(enum v4l2_colorspace colorspace)
{}

static inline int nal_hevc_transfer_characteristics(enum v4l2_colorspace colorspace,
						    enum v4l2_xfer_func xfer_func)
{}

static inline int nal_hevc_matrix_coeffs(enum v4l2_colorspace colorspace,
					 enum v4l2_ycbcr_encoding ycbcr_encoding)
{}

ssize_t nal_hevc_write_vps(const struct device *dev,
			   void *dest, size_t n, struct nal_hevc_vps *vps);
ssize_t nal_hevc_read_vps(const struct device *dev,
			  struct nal_hevc_vps *vps, void *src, size_t n);

ssize_t nal_hevc_write_sps(const struct device *dev,
			   void *dest, size_t n, struct nal_hevc_sps *sps);
ssize_t nal_hevc_read_sps(const struct device *dev,
			  struct nal_hevc_sps *sps, void *src, size_t n);

ssize_t nal_hevc_write_pps(const struct device *dev,
			   void *dest, size_t n, struct nal_hevc_pps *pps);
ssize_t nal_hevc_read_pps(const struct device *dev,
			  struct nal_hevc_pps *pps, void *src, size_t n);

ssize_t nal_hevc_write_filler(const struct device *dev, void *dest, size_t n);
ssize_t nal_hevc_read_filler(const struct device *dev, void *src, size_t n);

#endif /* __NAL_HEVC_H__ */