drivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_h264_req_common.c
Source file repositories/reference/linux-study-clean/drivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_h264_req_common.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_h264_req_common.c- Extension
.c- Size
- 10523 bytes
- Lines
- 323
- 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
vdec_h264_req_common.h
Detected Declarations
function mtk_vdec_h264_get_ref_listfunction mtk_vdec_h264_fill_dpb_infofunction mtk_vdec_h264_copy_sps_paramsfunction mtk_vdec_h264_copy_pps_paramsfunction mtk_vdec_h264_copy_slice_hd_paramsfunction mtk_vdec_h264_copy_scaling_matrixfunction mtk_vdec_h264_copy_decode_paramsfunction mtk_vdec_h264_dpb_entry_matchfunction mtk_vdec_h264_update_dpbfunction for_each_set_bitfunction mtk_vdec_h264_get_mv_buf_sizefunction mtk_vdec_h264_find_start_code
Annotated Snippet
if (!(dpb->flags & V4L2_H264_DPB_ENTRY_FLAG_ACTIVE)) {
h264_dpb_info[index].reference_flag = 0;
continue;
}
vb = vb2_find_buffer(vq, dpb->reference_ts);
if (!vb) {
dev_err(&ctx->dev->plat_dev->dev,
"Reference invalid: dpb_index(%d) reference_ts(%lld)",
index, dpb->reference_ts);
continue;
}
/* 1 for short term reference, 2 for long term reference */
if (!(dpb->flags & V4L2_H264_DPB_ENTRY_FLAG_LONG_TERM))
h264_dpb_info[index].reference_flag = 1;
else
h264_dpb_info[index].reference_flag = 2;
vb2_v4l2 = container_of(vb, struct vb2_v4l2_buffer, vb2_buf);
h264_dpb_info[index].field = vb2_v4l2->field;
h264_dpb_info[index].y_dma_addr =
vb2_dma_contig_plane_dma_addr(vb, 0);
if (ctx->q_data[MTK_Q_DATA_DST].fmt->num_planes == 2)
h264_dpb_info[index].c_dma_addr =
vb2_dma_contig_plane_dma_addr(vb, 1);
else
h264_dpb_info[index].c_dma_addr =
h264_dpb_info[index].y_dma_addr +
ctx->picinfo.fb_sz[0];
}
}
void mtk_vdec_h264_copy_sps_params(struct mtk_h264_sps_param *dst_param,
const struct v4l2_ctrl_h264_sps *src_param)
{
GET_MTK_VDEC_PARAM(chroma_format_idc);
GET_MTK_VDEC_PARAM(bit_depth_luma_minus8);
GET_MTK_VDEC_PARAM(bit_depth_chroma_minus8);
GET_MTK_VDEC_PARAM(log2_max_frame_num_minus4);
GET_MTK_VDEC_PARAM(pic_order_cnt_type);
GET_MTK_VDEC_PARAM(log2_max_pic_order_cnt_lsb_minus4);
GET_MTK_VDEC_PARAM(max_num_ref_frames);
GET_MTK_VDEC_PARAM(pic_width_in_mbs_minus1);
GET_MTK_VDEC_PARAM(pic_height_in_map_units_minus1);
GET_MTK_VDEC_FLAG(separate_colour_plane_flag,
V4L2_H264_SPS_FLAG_SEPARATE_COLOUR_PLANE);
GET_MTK_VDEC_FLAG(qpprime_y_zero_transform_bypass_flag,
V4L2_H264_SPS_FLAG_QPPRIME_Y_ZERO_TRANSFORM_BYPASS);
GET_MTK_VDEC_FLAG(delta_pic_order_always_zero_flag,
V4L2_H264_SPS_FLAG_DELTA_PIC_ORDER_ALWAYS_ZERO);
GET_MTK_VDEC_FLAG(frame_mbs_only_flag,
V4L2_H264_SPS_FLAG_FRAME_MBS_ONLY);
GET_MTK_VDEC_FLAG(mb_adaptive_frame_field_flag,
V4L2_H264_SPS_FLAG_MB_ADAPTIVE_FRAME_FIELD);
GET_MTK_VDEC_FLAG(direct_8x8_inference_flag,
V4L2_H264_SPS_FLAG_DIRECT_8X8_INFERENCE);
}
void mtk_vdec_h264_copy_pps_params(struct mtk_h264_pps_param *dst_param,
const struct v4l2_ctrl_h264_pps *src_param)
{
GET_MTK_VDEC_PARAM(num_ref_idx_l0_default_active_minus1);
GET_MTK_VDEC_PARAM(num_ref_idx_l1_default_active_minus1);
GET_MTK_VDEC_PARAM(weighted_bipred_idc);
GET_MTK_VDEC_PARAM(pic_init_qp_minus26);
GET_MTK_VDEC_PARAM(chroma_qp_index_offset);
GET_MTK_VDEC_PARAM(second_chroma_qp_index_offset);
GET_MTK_VDEC_FLAG(entropy_coding_mode_flag,
V4L2_H264_PPS_FLAG_ENTROPY_CODING_MODE);
GET_MTK_VDEC_FLAG(pic_order_present_flag,
V4L2_H264_PPS_FLAG_BOTTOM_FIELD_PIC_ORDER_IN_FRAME_PRESENT);
GET_MTK_VDEC_FLAG(weighted_pred_flag,
V4L2_H264_PPS_FLAG_WEIGHTED_PRED);
GET_MTK_VDEC_FLAG(deblocking_filter_control_present_flag,
V4L2_H264_PPS_FLAG_DEBLOCKING_FILTER_CONTROL_PRESENT);
GET_MTK_VDEC_FLAG(constrained_intra_pred_flag,
V4L2_H264_PPS_FLAG_CONSTRAINED_INTRA_PRED);
GET_MTK_VDEC_FLAG(redundant_pic_cnt_present_flag,
V4L2_H264_PPS_FLAG_REDUNDANT_PIC_CNT_PRESENT);
GET_MTK_VDEC_FLAG(transform_8x8_mode_flag,
V4L2_H264_PPS_FLAG_TRANSFORM_8X8_MODE);
GET_MTK_VDEC_FLAG(scaling_matrix_present_flag,
V4L2_H264_PPS_FLAG_SCALING_MATRIX_PRESENT);
}
void mtk_vdec_h264_copy_slice_hd_params(struct mtk_h264_slice_hd_param *dst_param,
Annotation
- Immediate include surface: `vdec_h264_req_common.h`.
- Detected declarations: `function mtk_vdec_h264_get_ref_list`, `function mtk_vdec_h264_fill_dpb_info`, `function mtk_vdec_h264_copy_sps_params`, `function mtk_vdec_h264_copy_pps_params`, `function mtk_vdec_h264_copy_slice_hd_params`, `function mtk_vdec_h264_copy_scaling_matrix`, `function mtk_vdec_h264_copy_decode_params`, `function mtk_vdec_h264_dpb_entry_match`, `function mtk_vdec_h264_update_dpb`, `function for_each_set_bit`.
- 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.