The Linux Kernel

6.6.32

Quick search

Contents

  • A guide to the Kernel Development Process
  • Submitting patches: the essential guide to getting your code into the kernel
  • Code of conduct
  • Kernel Maintainer Handbook
  • All development-process docs
  • Core API Documentation
  • Driver implementer’s API guide
    • Driver Model
    • Driver Basics
    • Device drivers infrastructure
    • ioctl based interfaces
    • Early Userspace
    • CPU and Device Power Management
    • The Common Clk Framework
    • Bus-Independent Device Accesses
    • Buffer Sharing and Synchronization (dma-buf)
    • Device links
    • Component Helper for Aggregate Drivers
    • Message-based devices
    • InfiniBand and Remote DMA (RDMA) Interfaces
    • Managing Ownership of the Framebuffer Aperture
    • Frame Buffer Library
    • Voltage and current regulator API
    • Reset controller API
    • Industrial I/O
    • Input Subsystem
    • Linux USB API
    • Firewire (IEEE 1394) driver Interface Guide
    • The Linux PCI driver implementer’s API guide
    • Compute Express Link
    • Serial Peripheral Interface (SPI)
    • I2C and SMBus Subsystem
    • IPMB Driver for a Satellite MC
    • The Linux IPMI Driver
    • I3C subsystem
    • Generic System Interconnect Subsystem
    • Device Frequency Scaling
    • High Speed Synchronous Serial Interface (HSI)
    • Error Detection And Correction (EDAC) Devices
    • SCSI Interfaces Guide
    • libATA Developer’s Guide
    • target and iSCSI Interfaces Guide
    • The Common Mailbox Framework
    • MTD NAND Driver Programming Interface
    • Parallel Port Devices
    • 16x50 UART Driver
    • Pulse-Width Modulation (PWM)
    • Intel(R) Management Engine Interface (Intel(R) MEI)
    • Memory Technology Device (MTD)
    • MMC/SD/SDIO card support
    • Non-Volatile Memory Device (NVDIMM)
    • W1: Dallas’ 1-wire bus
    • The Linux RapidIO Subsystem
    • Writing s390 channel device drivers
    • VME Device Drivers
    • Linux 802.11 Driver Developer’s Guide
    • The Userspace I/O HOWTO
    • Linux Firmware API
    • PINCTRL (PIN CONTROL) subsystem
    • General Purpose Input/Output (GPIO)
    • RAID
    • Media subsystem kernel internal API
      • 1. Media Subsystem Profile
      • 2. Video4Linux devices
      • 3. Digital TV (DVB) devices
      • 4. Remote Controller devices
      • 5. Media Controller devices
      • 6. CEC Kernel Support
      • 7. Pixel data transmitter and receiver drivers
      • 8. Writing camera sensor drivers
      • 9. Media driver-specific documentation
    • Miscellaneous Devices
    • Near Field Communication
    • DMAEngine documentation
    • Linux kernel SLIMbus support
    • SoundWire Documentation
    • Thermal
    • FPGA Subsystem
    • ACPI Support
    • Auxiliary Bus
    • Kernel driver lp855x
    • Kernel Connector
    • Console Drivers
    • Dell Systems Management Base Driver
    • EISA bus support
    • ISA Drivers
    • ISA Plug & Play support by Jaroslav Kysela <perex@suse.cz>
    • The io_mapping functions
    • Ordering I/O writes to memory-mapped addresses
    • Generic Counter Interface
    • Memory Controller drivers
    • MEN Chameleon Bus
    • NTB Drivers
    • NVMEM Subsystem
    • PARPORT interface documentation
    • PPS - Pulse Per Second
    • PTP hardware clock infrastructure for Linux
    • Generic PHY Framework
    • Pulse Width Modulation (PWM) interface
    • PLDM Firmware Flash Update Library
    • Overview of the pldmfw library
    • rfkill - RF kill switch support
    • Support for Serial devices
    • SM501 Driver
    • Surface System Aggregator Module (SSAM)
    • Linux Switchtec Support
    • Sync File API Guide
    • TTY
    • VFIO Mediated devices
    • VFIO - “Virtual Function I/O”
    • Acceptance criteria for vfio-pci device specific driver variants
    • Virtio
    • Xilinx FPGA
    • Xillybus driver for generic FPGA interface
    • Writing Device Drivers for Zorro Devices
    • The Linux Hardware Timestamping Engine (HTE)
    • WMI Driver API
  • Kernel subsystem documentation
  • Locking in the kernel
  • Linux kernel licensing rules
  • How to write kernel documentation
  • Development tools for the kernel
  • Kernel Testing Guide
  • Kernel Hacking Guides
  • Linux Tracing Technologies
  • fault-injection
  • Kernel Livepatching
  • Rust
  • The Linux kernel user’s and administrator’s guide
  • The kernel build system
  • Reporting issues
  • User-space tools
  • The Linux kernel user-space API guide
  • The Linux kernel firmware guide
  • Open Firmware and Devicetree
  • CPU Architectures
  • Unsorted Documentation
  • Translations

This Page

  • Show Source

2.30. V4L2 JPEG header related functions and data structures¶

struct v4l2_jpeg_reference¶

reference into the JPEG buffer

Definition:

struct v4l2_jpeg_reference {
    u8 *start;
    size_t length;
};

Members

start

pointer to the start of the referenced segment or table

length

size of the referenced segment or table

Description

Wnen referencing marker segments, start points right after the marker code, and length is the size of the segment parameters, excluding the marker code.

struct v4l2_jpeg_frame_component_spec¶

frame component-specification

Definition:

struct v4l2_jpeg_frame_component_spec {
    u8 component_identifier;
    u8 horizontal_sampling_factor;
    u8 vertical_sampling_factor;
    u8 quantization_table_selector;
};

Members

component_identifier

C[i]

horizontal_sampling_factor

H[i]

vertical_sampling_factor

V[i]

quantization_table_selector

quantization table destination selector Tq[i]

struct v4l2_jpeg_frame_header¶

JPEG frame header

Definition:

struct v4l2_jpeg_frame_header {
    u16 height;
    u16 width;
    u8 precision;
    u8 num_components;
    struct v4l2_jpeg_frame_component_spec component[V4L2_JPEG_MAX_COMPONENTS];
    enum v4l2_jpeg_chroma_subsampling subsampling;
};

Members

height

Y

width

X

precision

P

num_components

Nf

component

component-specification, see v4l2_jpeg_frame_component_spec

subsampling

decoded subsampling from component-specification

struct v4l2_jpeg_scan_component_spec¶

scan component-specification

Definition:

struct v4l2_jpeg_scan_component_spec {
    u8 component_selector;
    u8 dc_entropy_coding_table_selector;
    u8 ac_entropy_coding_table_selector;
};

Members

component_selector

Cs[j]

dc_entropy_coding_table_selector

Td[j]

ac_entropy_coding_table_selector

Ta[j]

struct v4l2_jpeg_scan_header¶

JPEG scan header

Definition:

struct v4l2_jpeg_scan_header {
    u8 num_components;
    struct v4l2_jpeg_scan_component_spec component[V4L2_JPEG_MAX_COMPONENTS];
};

Members

num_components

Ns

component

component-specification, see v4l2_jpeg_scan_component_spec

enum v4l2_jpeg_app14_tf¶

APP14 transform flag According to Rec. ITU-T T.872 (06/2012) 6.5.3 APP14 segment is for color encoding, it contains a transform flag, which may have values of 0, 1 and 2 and are interpreted as follows:

Constants

V4L2_JPEG_APP14_TF_CMYK_RGB

CMYK for images encoded with four components RGB for images encoded with three components

V4L2_JPEG_APP14_TF_YCBCR

an image encoded with three components using YCbCr

V4L2_JPEG_APP14_TF_YCCK

an image encoded with four components using YCCK

V4L2_JPEG_APP14_TF_UNKNOWN

indicate app14 is not present

struct v4l2_jpeg_header¶

parsed JPEG header

Definition:

struct v4l2_jpeg_header {
    struct v4l2_jpeg_reference sof;
    struct v4l2_jpeg_reference sos;
    unsigned int num_dht;
    struct v4l2_jpeg_reference dht[V4L2_JPEG_MAX_TABLES];
    unsigned int num_dqt;
    struct v4l2_jpeg_reference dqt[V4L2_JPEG_MAX_TABLES];
    struct v4l2_jpeg_frame_header frame;
    struct v4l2_jpeg_scan_header *scan;
    struct v4l2_jpeg_reference *quantization_tables;
    struct v4l2_jpeg_reference *huffman_tables;
    u16 restart_interval;
    size_t ecs_offset;
    enum v4l2_jpeg_app14_tf app14_tf;
};

Members

sof

pointer to frame header and size

sos

pointer to scan header and size

num_dht

number of entries in dht

dht

pointers to huffman tables and sizes

num_dqt

number of entries in dqt

dqt

pointers to quantization tables and sizes

frame

parsed frame header

scan

pointer to parsed scan header, optional

quantization_tables

references to four quantization tables, optional

huffman_tables

references to four Huffman tables in DC0, DC1, AC0, AC1 order, optional

restart_interval

number of MCU per restart interval, Ri

ecs_offset

buffer offset in bytes to the entropy coded segment

app14_tf

transform flag from app14 data

Description

When this structure is passed to v4l2_jpeg_parse_header, the optional scan, quantization_tables, and huffman_tables pointers must be initialized to NULL or point at valid memory.

int v4l2_jpeg_parse_header(void *buf, size_t len, struct v4l2_jpeg_header *out)¶

locate marker segments and optionally parse headers

Parameters

void *buf

address of the JPEG buffer, should start with a SOI marker

size_t len

length of the JPEG buffer

struct v4l2_jpeg_header *out

returns marker segment positions and optionally parsed headers

Description

The out->scan_header pointer must be initialized to NULL or point to a valid v4l2_jpeg_scan_header structure. The out->huffman_tables and out->quantization_tables pointers must be initialized to NULL or point to a valid array of 4 v4l2_jpeg_reference structures each.

Returns 0 or negative error if parsing failed.

int v4l2_jpeg_parse_frame_header(void *buf, size_t len, struct v4l2_jpeg_frame_header *frame_header)¶

parse frame header

Parameters

void *buf

address of the frame header, after the SOF0 marker

size_t len

length of the frame header

struct v4l2_jpeg_frame_header *frame_header

returns the parsed frame header

Description

Returns 0 or negative error if parsing failed.

int v4l2_jpeg_parse_scan_header(void *buf, size_t len, struct v4l2_jpeg_scan_header *scan_header)¶

parse scan header

Parameters

void *buf

address of the scan header, after the SOS marker

size_t len

length of the scan header

struct v4l2_jpeg_scan_header *scan_header

returns the parsed scan header

Description

Returns 0 or negative error if parsing failed.

int v4l2_jpeg_parse_quantization_tables(void *buf, size_t len, u8 precision, struct v4l2_jpeg_reference *q_tables)¶

parse quantization tables segment

Parameters

void *buf

address of the quantization table segment, after the DQT marker

size_t len

length of the quantization table segment

u8 precision

sample precision (P) in bits per component

struct v4l2_jpeg_reference *q_tables

returns four references into the buffer for the four possible quantization table destinations

Description

Returns 0 or negative error if parsing failed.

int v4l2_jpeg_parse_huffman_tables(void *buf, size_t len, struct v4l2_jpeg_reference *huffman_tables)¶

parse huffman tables segment

Parameters

void *buf

address of the Huffman table segment, after the DHT marker

size_t len

length of the Huffman table segment

struct v4l2_jpeg_reference *huffman_tables

returns four references into the buffer for the four possible Huffman table destinations, in the order DC0, DC1, AC0, AC1

Description

Returns 0 or negative error if parsing failed.

void v4l2_jpeg_get_reference_quantization_tables(const u8 **ref_luma_qt, const u8 **ref_chroma_qt)¶

Get reference quantization tables as defined in ITU-T.81

Parameters

const u8 **ref_luma_qt

Output variable pointing to luma quantization table

const u8 **ref_chroma_qt

Output variable pointing to chroma quantization table

void v4l2_jpeg_get_zig_zag_scan(const u8 **ref_zigzag)¶

Get zigzag scan table as defined in ITU-T.81

Parameters

const u8 **ref_zigzag

Output variable pointing to zigzag scan table

void v4l2_jpeg_get_reference_huffman_tables(const u8 **ref_luma_dc_ht, const u8 **ref_luma_ac_ht, const u8 **ref_chroma_dc_ht, const u8 **ref_chroma_ac_ht)¶

Get reference huffman tables as defined in ITU-T.81

Parameters

const u8 **ref_luma_dc_ht

Output variable pointing to huffman table for luma DC

const u8 **ref_luma_ac_ht

Output variable pointing to huffman table for luma AC

const u8 **ref_chroma_dc_ht

Output variable pointing to huffman table for chroma DC

const u8 **ref_chroma_ac_ht

Output variable pointing to huffman table for chroma AC

©The kernel development community. | Powered by Sphinx 3.4.3 & Alabaster 0.7.12 | Page source