drivers/media/platform/allegro-dvt/nal-hevc.c
Source file repositories/reference/linux-study-clean/drivers/media/platform/allegro-dvt/nal-hevc.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/media/platform/allegro-dvt/nal-hevc.c- Extension
.c- Size
- 28549 bytes
- Lines
- 885
- Domain
- Driver Families
- Bucket
- drivers/media
- Inferred role
- Driver Families: exported/initcall integration point
- Status
- integration 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.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/kernel.hlinux/types.hlinux/string.hlinux/v4l2-controls.hlinux/device.hlinux/export.hlinux/log2.hnal-hevc.hnal-rbsp.h
Detected Declarations
enum nal_unit_typefunction nal_hevc_write_start_code_prefixfunction nal_hevc_read_start_code_prefixfunction nal_hevc_write_filler_datafunction nal_hevc_read_filler_datafunction nal_hevc_rbsp_profile_tier_levelfunction nal_hevc_rbsp_vpsfunction nal_hevc_rbsp_sub_layer_hrd_parametersfunction nal_hevc_rbsp_hrd_parametersfunction nal_hevc_rbsp_vui_parametersfunction nal_hevc_rbsp_spsfunction nal_hevc_rbsp_ppsfunction nal_hevc_write_vpsfunction nal_hevc_read_vpsfunction nal_hevc_write_spsfunction nal_hevc_read_spsfunction nal_hevc_write_ppsfunction nal_hevc_read_ppsfunction nal_hevc_write_fillerfunction nal_hevc_read_fillerexport nal_hevc_write_vpsexport nal_hevc_read_vpsexport nal_hevc_write_spsexport nal_hevc_read_spsexport nal_hevc_write_ppsexport nal_hevc_read_ppsexport nal_hevc_write_fillerexport nal_hevc_read_filler
Annotated Snippet
if (DIV_ROUND_UP(rbsp->pos, 8) > rbsp->size) {
rbsp->error = -EINVAL;
return;
}
p++;
rbsp->pos += 8;
}
}
static void nal_hevc_rbsp_profile_tier_level(struct rbsp *rbsp,
struct nal_hevc_profile_tier_level *ptl)
{
unsigned int i;
unsigned int max_num_sub_layers_minus_1 = 0;
rbsp_bits(rbsp, 2, &ptl->general_profile_space);
rbsp_bit(rbsp, &ptl->general_tier_flag);
rbsp_bits(rbsp, 5, &ptl->general_profile_idc);
for (i = 0; i < 32; i++)
rbsp_bit(rbsp, &ptl->general_profile_compatibility_flag[i]);
rbsp_bit(rbsp, &ptl->general_progressive_source_flag);
rbsp_bit(rbsp, &ptl->general_interlaced_source_flag);
rbsp_bit(rbsp, &ptl->general_non_packed_constraint_flag);
rbsp_bit(rbsp, &ptl->general_frame_only_constraint_flag);
if (ptl->general_profile_idc == 4 ||
ptl->general_profile_compatibility_flag[4] ||
ptl->general_profile_idc == 5 ||
ptl->general_profile_compatibility_flag[5] ||
ptl->general_profile_idc == 6 ||
ptl->general_profile_compatibility_flag[6] ||
ptl->general_profile_idc == 7 ||
ptl->general_profile_compatibility_flag[7] ||
ptl->general_profile_idc == 8 ||
ptl->general_profile_compatibility_flag[8] ||
ptl->general_profile_idc == 9 ||
ptl->general_profile_compatibility_flag[9] ||
ptl->general_profile_idc == 10 ||
ptl->general_profile_compatibility_flag[10]) {
rbsp_bit(rbsp, &ptl->general_max_12bit_constraint_flag);
rbsp_bit(rbsp, &ptl->general_max_10bit_constraint_flag);
rbsp_bit(rbsp, &ptl->general_max_8bit_constraint_flag);
rbsp_bit(rbsp, &ptl->general_max_422chroma_constraint_flag);
rbsp_bit(rbsp, &ptl->general_max_420chroma_constraint_flag);
rbsp_bit(rbsp, &ptl->general_max_monochrome_constraint_flag);
rbsp_bit(rbsp, &ptl->general_intra_constraint_flag);
rbsp_bit(rbsp, &ptl->general_one_picture_only_constraint_flag);
rbsp_bit(rbsp, &ptl->general_lower_bit_rate_constraint_flag);
if (ptl->general_profile_idc == 5 ||
ptl->general_profile_compatibility_flag[5] ||
ptl->general_profile_idc == 9 ||
ptl->general_profile_compatibility_flag[9] ||
ptl->general_profile_idc == 10 ||
ptl->general_profile_compatibility_flag[10]) {
rbsp_bit(rbsp, &ptl->general_max_14bit_constraint_flag);
rbsp_bits(rbsp, 32, &ptl->general_reserved_zero_33bits);
rbsp_bits(rbsp, 33 - 32, &ptl->general_reserved_zero_33bits);
} else {
rbsp_bits(rbsp, 32, &ptl->general_reserved_zero_34bits);
rbsp_bits(rbsp, 34 - 2, &ptl->general_reserved_zero_34bits);
}
} else if (ptl->general_profile_idc == 2 ||
ptl->general_profile_compatibility_flag[2]) {
rbsp_bits(rbsp, 7, &ptl->general_reserved_zero_7bits);
rbsp_bit(rbsp, &ptl->general_one_picture_only_constraint_flag);
rbsp_bits(rbsp, 32, &ptl->general_reserved_zero_35bits);
rbsp_bits(rbsp, 35 - 32, &ptl->general_reserved_zero_35bits);
} else {
rbsp_bits(rbsp, 32, &ptl->general_reserved_zero_43bits);
rbsp_bits(rbsp, 43 - 32, &ptl->general_reserved_zero_43bits);
}
if ((ptl->general_profile_idc >= 1 && ptl->general_profile_idc <= 5) ||
ptl->general_profile_idc == 9 ||
ptl->general_profile_compatibility_flag[1] ||
ptl->general_profile_compatibility_flag[2] ||
ptl->general_profile_compatibility_flag[3] ||
ptl->general_profile_compatibility_flag[4] ||
ptl->general_profile_compatibility_flag[5] ||
ptl->general_profile_compatibility_flag[9])
rbsp_bit(rbsp, &ptl->general_inbld_flag);
else
rbsp_bit(rbsp, &ptl->general_reserved_zero_bit);
rbsp_bits(rbsp, 8, &ptl->general_level_idc);
if (max_num_sub_layers_minus_1 > 0)
rbsp_unsupported(rbsp);
}
static void nal_hevc_rbsp_vps(struct rbsp *rbsp, struct nal_hevc_vps *vps)
{
unsigned int i, j;
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/types.h`, `linux/string.h`, `linux/v4l2-controls.h`, `linux/device.h`, `linux/export.h`, `linux/log2.h`, `nal-hevc.h`.
- Detected declarations: `enum nal_unit_type`, `function nal_hevc_write_start_code_prefix`, `function nal_hevc_read_start_code_prefix`, `function nal_hevc_write_filler_data`, `function nal_hevc_read_filler_data`, `function nal_hevc_rbsp_profile_tier_level`, `function nal_hevc_rbsp_vps`, `function nal_hevc_rbsp_sub_layer_hrd_parameters`, `function nal_hevc_rbsp_hrd_parameters`, `function nal_hevc_rbsp_vui_parameters`.
- Atlas domain: Driver Families / drivers/media.
- Implementation status: integration 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.