ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
Loading...
Searching...
No Matches
ra8_camera_codec_jpeg_sw.h File Reference

RGB888-to-JPEG software codec backend for ra8_camera. More...

#include <stdint.h>
#include "ra8_camera.h"
#include "ra8_err.h"
Include dependency graph for ra8_camera_codec_jpeg_sw.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  ra8_camera_codec_jpeg_sw_cfg_t
 Configuration and caller-owned RGB workspace for software JPEG. More...
struct  ra8_camera_codec_jpeg_sw_state_t
 Caller-owned private state for the software JPEG backend. More...

Functions

ra8_err_t ra8_camera_codec_jpeg_sw_init (ra8_camera_codec_t *codec, ra8_camera_codec_jpeg_sw_state_t *state, const ra8_camera_codec_jpeg_sw_cfg_t *cfg)
 Bind the software baseline-JPEG encoder backend.

Detailed Description

RGB888-to-JPEG software codec backend for ra8_camera.

Tag
[Ring 4 / Service] {World: NS}

Wraps ra8_jpeg_sw_encode behind the generic camera codec seam. Input may be RGB888 or packed UYVY422. Each input is nearest-neighbour sampled to configured output geometry in a caller-owned packed-RGB workspace; UYVY is converted with BT.601 limited-range coefficients. Encoded bytes are written to the output buffer supplied on each encode call.

Since
0.1.0

Definition in file ra8_camera_codec_jpeg_sw.h.

Function Documentation

◆ ra8_camera_codec_jpeg_sw_init()

ra8_err_t ra8_camera_codec_jpeg_sw_init ( ra8_camera_codec_t * codec,
ra8_camera_codec_jpeg_sw_state_t * state,
const ra8_camera_codec_jpeg_sw_cfg_t * cfg )
nodiscard

Bind the software baseline-JPEG encoder backend.

Parameters
[out]codecCaller-owned codec handle to bind.
[out]stateCaller-owned backend state to populate.
[in]cfgOutput geometry, quality, and RGB workspace.
Returns
ra8_err_t Error code.
Return values
k_ra8_okCodec bound.
k_ra8_err_null_ptrAn argument or cfg->rgb_workspace was NULL.
k_ra8_err_invalid_argQuality or output geometry was invalid.
k_ra8_err_invalid_sizeRGB workspace was too small.
Precondition
codec and state out-live every codec operation.
No other call mutates them while encoding.
Postcondition
On success RGB888 and UYVY422 inputs can be encoded as JPEG.
On error codec and state are unchanged.
Note
Independent state objects are thread-safe; ra8_jpeg_sw_encode is re-entrant.
Since
0.1.0

Definition at line 250 of file ra8_camera_codec_jpeg_sw.c.

References ra8_camera_codec_jpeg_sw_state_t::cfg, ra8_camera_codec_t::ctx, ra8_camera_codec_t::iface, k_ra8_err_invalid_arg, k_ra8_err_invalid_size, k_ra8_err_null_ptr, k_ra8_jpeg_sw_quality_max, k_ra8_jpeg_sw_quality_min, k_ra8_ok, ra8_camera_codec_jpeg_sw_cfg_t::output_height, ra8_camera_codec_jpeg_sw_cfg_t::output_width, ra8_camera_codec_jpeg_sw_cfg_t::quality, ra8_camera_codec_jpeg_sw_cfg_t::rgb_workspace, ra8_camera_codec_jpeg_sw_cfg_t::rgb_workspace_capacity, and s_jpeg_sw_codec_iface.

Referenced by c6_cam_camera_init().