drivers/media/platform/mediatek/vcodec/encoder/mtk_vcodec_enc_drv.h
Source file repositories/reference/linux-study-clean/drivers/media/platform/mediatek/vcodec/encoder/mtk_vcodec_enc_drv.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/media/platform/mediatek/vcodec/encoder/mtk_vcodec_enc_drv.h- Extension
.h- Size
- 7864 bytes
- Lines
- 251
- Domain
- Driver Families
- Bucket
- drivers/media
- Inferred role
- Driver Families: implementation source
- Status
- source implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
../common/mtk_vcodec_cmn_drv.h../common/mtk_vcodec_dbgfs.h../common/mtk_vcodec_fw_priv.h../common/mtk_vcodec_util.h
Detected Declarations
struct mtk_vcodec_enc_pdatastruct mtk_enc_paramsstruct mtk_vcodec_enc_ctxstruct mtk_vcodec_enc_devenum mtk_encode_paramfunction wake_up_enc_ctx
Annotated Snippet
struct mtk_vcodec_enc_pdata {
bool uses_ext;
u64 min_bitrate;
u64 max_bitrate;
const struct mtk_video_fmt *capture_formats;
size_t num_capture_formats;
const struct mtk_video_fmt *output_formats;
size_t num_output_formats;
u8 core_id;
bool uses_34bit;
};
/*
* enum mtk_encode_param - General encoding parameters type
*/
enum mtk_encode_param {
MTK_ENCODE_PARAM_NONE = 0,
MTK_ENCODE_PARAM_BITRATE = (1 << 0),
MTK_ENCODE_PARAM_FRAMERATE = (1 << 1),
MTK_ENCODE_PARAM_INTRA_PERIOD = (1 << 2),
MTK_ENCODE_PARAM_FORCE_INTRA = (1 << 3),
MTK_ENCODE_PARAM_GOP_SIZE = (1 << 4),
};
/**
* struct mtk_enc_params - General encoding parameters
* @bitrate: target bitrate in bits per second
* @num_b_frame: number of b frames between p-frame
* @rc_frame: frame based rate control
* @rc_mb: macroblock based rate control
* @seq_hdr_mode: H.264 sequence header is encoded separately or joined
* with the first frame
* @intra_period: I frame period
* @gop_size: group of picture size, it's used as the intra frame period
* @framerate_num: frame rate numerator. ex: framerate_num=30 and
* framerate_denom=1 means FPS is 30
* @framerate_denom: frame rate denominator. ex: framerate_num=30 and
* framerate_denom=1 means FPS is 30
* @h264_max_qp: Max value for H.264 quantization parameter
* @h264_profile: V4L2 defined H.264 profile
* @h264_level: V4L2 defined H.264 level
* @force_intra: force/insert intra frame
*/
struct mtk_enc_params {
unsigned int bitrate;
unsigned int num_b_frame;
unsigned int rc_frame;
unsigned int rc_mb;
unsigned int seq_hdr_mode;
unsigned int intra_period;
unsigned int gop_size;
unsigned int framerate_num;
unsigned int framerate_denom;
unsigned int h264_max_qp;
unsigned int h264_profile;
unsigned int h264_level;
unsigned int force_intra;
};
/**
* struct mtk_vcodec_enc_ctx - Context (instance) private data.
*
* @type: type of encoder instance
* @dev: pointer to the mtk_vcodec_enc_dev of the device
* @list: link to ctx_list of mtk_vcodec_enc_dev
*
* @fh: struct v4l2_fh
* @m2m_ctx: pointer to the v4l2_m2m_ctx of the context
* @q_data: store information of input and output queue of the context
* @id: index of the context that this structure describes
* @state: state of the context
* @param_change: indicate encode parameter type
* @enc_params: encoding parameters
*
* @enc_if: hooked encoder driver interface
* @drv_handle: driver handle for specific decode/encode instance
*
* @int_cond: variable used by the waitqueue
* @int_type: type of the last interrupt
* @queue: waitqueue that can be used to wait for this context to finish
* @irq_status: irq status
*
* @ctrl_hdl: handler for v4l2 framework
* @encode_work: worker for the encoding
* @empty_flush_buf: a fake size-0 capture buffer that indicates flush. Used for encoder.
* @is_flushing: set to true if flushing is in progress.
*
* @colorspace: enum v4l2_colorspace; supplemental to pixelformat
* @ycbcr_enc: enum v4l2_ycbcr_encoding, Y'CbCr encoding
* @quantization: enum v4l2_quantization, colorspace quantization
Annotation
- Immediate include surface: `../common/mtk_vcodec_cmn_drv.h`, `../common/mtk_vcodec_dbgfs.h`, `../common/mtk_vcodec_fw_priv.h`, `../common/mtk_vcodec_util.h`.
- Detected declarations: `struct mtk_vcodec_enc_pdata`, `struct mtk_enc_params`, `struct mtk_vcodec_enc_ctx`, `struct mtk_vcodec_enc_dev`, `enum mtk_encode_param`, `function wake_up_enc_ctx`.
- Atlas domain: Driver Families / drivers/media.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.