drivers/staging/media/sunxi/cedrus/cedrus_vp8.c
Source file repositories/reference/linux-study-clean/drivers/staging/media/sunxi/cedrus/cedrus_vp8.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/staging/media/sunxi/cedrus/cedrus_vp8.c- Extension
.c- Size
- 30697 bytes
- Lines
- 883
- Domain
- Driver Families
- Bucket
- drivers/staging
- 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.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/delay.hlinux/types.hmedia/videobuf2-dma-contig.hcedrus.hcedrus_hw.hcedrus_regs.h
Detected Declarations
function read_bitsfunction get_delta_qfunction process_segmentation_infofunction process_ref_lf_delta_infofunction process_ref_frame_infofunction cedrus_irq_clearfunction cedrus_read_headerfunction cedrus_vp8_update_probsfunction cedrus_vp8_irq_statusfunction cedrus_vp8_irq_clearfunction cedrus_vp8_irq_disablefunction cedrus_vp8_setupfunction cedrus_vp8_startfunction cedrus_vp8_stopfunction cedrus_vp8_trigger
Annotated Snippet
if (read_bits(dev, 1, VP8_PROB_HALF)) {
read_bits(dev, 7, VP8_PROB_HALF);
read_bits(dev, 1, VP8_PROB_HALF);
}
for (i = 0; i < 4; i++)
if (read_bits(dev, 1, VP8_PROB_HALF)) {
read_bits(dev, 6, VP8_PROB_HALF);
read_bits(dev, 1, VP8_PROB_HALF);
}
}
if (update)
for (i = 0; i < 3; i++)
if (read_bits(dev, 1, VP8_PROB_HALF))
read_bits(dev, 8, VP8_PROB_HALF);
}
static void process_ref_lf_delta_info(struct cedrus_dev *dev)
{
if (read_bits(dev, 1, VP8_PROB_HALF)) {
int i;
for (i = 0; i < 4; i++)
if (read_bits(dev, 1, VP8_PROB_HALF)) {
read_bits(dev, 6, VP8_PROB_HALF);
read_bits(dev, 1, VP8_PROB_HALF);
}
for (i = 0; i < 4; i++)
if (read_bits(dev, 1, VP8_PROB_HALF)) {
read_bits(dev, 6, VP8_PROB_HALF);
read_bits(dev, 1, VP8_PROB_HALF);
}
}
}
static void process_ref_frame_info(struct cedrus_dev *dev)
{
u8 refresh_golden_frame = read_bits(dev, 1, VP8_PROB_HALF);
u8 refresh_alt_ref_frame = read_bits(dev, 1, VP8_PROB_HALF);
if (!refresh_golden_frame)
read_bits(dev, 2, VP8_PROB_HALF);
if (!refresh_alt_ref_frame)
read_bits(dev, 2, VP8_PROB_HALF);
read_bits(dev, 1, VP8_PROB_HALF);
read_bits(dev, 1, VP8_PROB_HALF);
}
static void cedrus_irq_clear(struct cedrus_dev *dev)
{
cedrus_write(dev, VE_H264_STATUS,
VE_H264_STATUS_INT_MASK);
}
static void cedrus_read_header(struct cedrus_dev *dev,
const struct v4l2_ctrl_vp8_frame *slice)
{
int i, j;
if (V4L2_VP8_FRAME_IS_KEY_FRAME(slice)) {
read_bits(dev, 1, VP8_PROB_HALF);
read_bits(dev, 1, VP8_PROB_HALF);
}
if (read_bits(dev, 1, VP8_PROB_HALF))
process_segmentation_info(dev);
read_bits(dev, 1, VP8_PROB_HALF);
read_bits(dev, 6, VP8_PROB_HALF);
read_bits(dev, 3, VP8_PROB_HALF);
if (read_bits(dev, 1, VP8_PROB_HALF))
process_ref_lf_delta_info(dev);
read_bits(dev, 2, VP8_PROB_HALF);
/* y_ac_qi */
read_bits(dev, 7, VP8_PROB_HALF);
/* Parses y_dc_delta, y2_dc_delta, etc. */
for (i = 0; i < QUANT_DELTA_COUNT; i++)
get_delta_q(dev);
if (!V4L2_VP8_FRAME_IS_KEY_FRAME(slice))
process_ref_frame_info(dev);
Annotation
- Immediate include surface: `linux/delay.h`, `linux/types.h`, `media/videobuf2-dma-contig.h`, `cedrus.h`, `cedrus_hw.h`, `cedrus_regs.h`.
- Detected declarations: `function read_bits`, `function get_delta_q`, `function process_segmentation_info`, `function process_ref_lf_delta_info`, `function process_ref_frame_info`, `function cedrus_irq_clear`, `function cedrus_read_header`, `function cedrus_vp8_update_probs`, `function cedrus_vp8_irq_status`, `function cedrus_vp8_irq_clear`.
- Atlas domain: Driver Families / drivers/staging.
- Implementation status: source implementation candidate.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
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.