Bouffalo SDK  1.0
Bouffalolab Software Development Kit
MJPEG
Collaboration diagram for MJPEG:

Modules

 mjpeg format definition
 
 mjpeg interrupt status definition
 
 mjpeg interrupt clear definition
 
 mjpeg feature control cmd definition
 

Data Structures

struct  bflb_mjpeg_config_s
 MJPEG configuration structure. More...
 

Macros

#define MJPEG_MAX_FRAME_COUNT   4
 

Functions

void bflb_mjpeg_init (struct bflb_device_s *dev, const struct bflb_mjpeg_config_s *config)
 Initialize mjpeg. More...
 
void bflb_mjpeg_start (struct bflb_device_s *dev)
 Start mjpeg compression with camera. More...
 
void bflb_mjpeg_stop (struct bflb_device_s *dev)
 Stop mjpeg compression with camera. More...
 
void bflb_mjpeg_sw_run (struct bflb_device_s *dev, uint8_t frame_count)
 Start mjpeg compression without camera. More...
 
void bflb_mjpeg_kick_run (struct bflb_device_s *dev, uint16_t kick_count)
 Start mjpeg kick mode compression without camera. More...
 
void bflb_mjpeg_kick_stop (struct bflb_device_s *dev)
 Stop mjpeg kick mode compression without camera. More...
 
void bflb_mjpeg_kick (struct bflb_device_s *dev)
 kick one times compression without camera. More...
 
void bflb_mjpeg_tcint_mask (struct bflb_device_s *dev, bool mask)
 Enable or disable mjpeg one frame compression completion interrupt. More...
 
void bflb_mjpeg_errint_mask (struct bflb_device_s *dev, bool mask)
 Enable or disable mjpeg error interrupt. More...
 
uint32_t bflb_mjpeg_get_intstatus (struct bflb_device_s *dev)
 Get mjpeg interrupt status. More...
 
void bflb_mjpeg_int_clear (struct bflb_device_s *dev, uint32_t int_clear)
 Clear mjpeg interrupt status. More...
 
uint8_t bflb_mjpeg_get_frame_count (struct bflb_device_s *dev)
 Get number of frame count that has compressed. More...
 
void bflb_mjpeg_pop_one_frame (struct bflb_device_s *dev)
 Drop one frame that has compressed. More...
 
uint32_t bflb_mjpeg_get_frame_info (struct bflb_device_s *dev, uint8_t **pic)
 Get one frame information. More...
 
void bflb_mjpeg_calculate_quantize_table (uint8_t quality, uint16_t *input_table, uint16_t *output_table)
 Calculate jpeg quantize table. More...
 
void bflb_mjpeg_fill_quantize_table (struct bflb_device_s *dev, uint16_t *input_yy, uint16_t *input_uv)
 Fill quantize table into mjpeg register. More...
 
void bflb_mjpeg_fill_jpeg_header_tail (struct bflb_device_s *dev, uint8_t *header, uint32_t header_len)
 Fill jpeg header into mjpeg register and enable hardware auto adding jpeg tail. More...
 
void bflb_mjpeg_set_yuv420sp_cam_input (struct bflb_device_s *dev, uint8_t yy, uint8_t uv)
 Set mjpeg input when uses camera with yuv402sp. More...
 
int bflb_mjpeg_feature_control (struct bflb_device_s *dev, int cmd, size_t arg)
 Control mjpeg feature. More...
 
void bflb_mjpeg_update_input_output_buff (struct bflb_device_s *dev, void *input_buf0, void *input_buf1, void *output_buff, size_t output_buff_size)
 Control mjpeg feature. More...
 

Detailed Description

Macro Definition Documentation

◆ MJPEG_MAX_FRAME_COUNT

#define MJPEG_MAX_FRAME_COUNT   4

Definition at line 55 of file bflb_mjpeg.h.

Function Documentation

◆ bflb_mjpeg_calculate_quantize_table()

void bflb_mjpeg_calculate_quantize_table ( uint8_t  quality,
uint16_t *  input_table,
uint16_t *  output_table 
)

Calculate jpeg quantize table.

Parameters
[in]qualityimage quality
[in]input_tablepointer to save input table
[in]output_tablepointer to save output table

◆ bflb_mjpeg_errint_mask()

void bflb_mjpeg_errint_mask ( struct bflb_device_s dev,
bool  mask 
)

Enable or disable mjpeg error interrupt.

Parameters
[in]devdevice handle
[in]masktrue means disable, false means enable

◆ bflb_mjpeg_feature_control()

int bflb_mjpeg_feature_control ( struct bflb_device_s dev,
int  cmd,
size_t  arg 
)

Control mjpeg feature.

Parameters
[in]devdevice handle
[in]cmdfeature command
[in]arguser data
Returns
A negated errno value on failure.

◆ bflb_mjpeg_fill_jpeg_header_tail()

void bflb_mjpeg_fill_jpeg_header_tail ( struct bflb_device_s dev,
uint8_t *  header,
uint32_t  header_len 
)

Fill jpeg header into mjpeg register and enable hardware auto adding jpeg tail.

Parameters
[in]devdevice handle
[in]headerpointer to jpeg header
[in]header_lenjpeg header length

◆ bflb_mjpeg_fill_quantize_table()

void bflb_mjpeg_fill_quantize_table ( struct bflb_device_s dev,
uint16_t *  input_yy,
uint16_t *  input_uv 
)

Fill quantize table into mjpeg register.

Parameters
[in]devdevice handle
[in]input_yyyy quantize table
[in]input_uvuv quantize table

◆ bflb_mjpeg_get_frame_count()

uint8_t bflb_mjpeg_get_frame_count ( struct bflb_device_s dev)

Get number of frame count that has compressed.

Parameters
[in]devdevice handle
Returns
compressed frame count

◆ bflb_mjpeg_get_frame_info()

uint32_t bflb_mjpeg_get_frame_info ( struct bflb_device_s dev,
uint8_t **  pic 
)

Get one frame information.

Parameters
[in]devdevice handle
[in]picpointer to save frame address.
Returns
frame length

◆ bflb_mjpeg_get_intstatus()

uint32_t bflb_mjpeg_get_intstatus ( struct bflb_device_s dev)

Get mjpeg interrupt status.

Parameters
[in]devdevice handle
Returns
interrupt status

◆ bflb_mjpeg_init()

void bflb_mjpeg_init ( struct bflb_device_s dev,
const struct bflb_mjpeg_config_s config 
)

Initialize mjpeg.

Parameters
[in]devdevice handle
[in]configpointer to save mjpeg config

◆ bflb_mjpeg_int_clear()

void bflb_mjpeg_int_clear ( struct bflb_device_s dev,
uint32_t  int_clear 
)

Clear mjpeg interrupt status.

Parameters
[in]devdevice handle
[in]int_clearclear value

◆ bflb_mjpeg_kick()

void bflb_mjpeg_kick ( struct bflb_device_s dev)

kick one times compression without camera.

Parameters
[in]devdevice handle

◆ bflb_mjpeg_kick_run()

void bflb_mjpeg_kick_run ( struct bflb_device_s dev,
uint16_t  kick_count 
)

Start mjpeg kick mode compression without camera.

Parameters
[in]devdevice handle
[in]kick_countkick block horizontal count to compress

◆ bflb_mjpeg_kick_stop()

void bflb_mjpeg_kick_stop ( struct bflb_device_s dev)

Stop mjpeg kick mode compression without camera.

Parameters
[in]devdevice handle

◆ bflb_mjpeg_pop_one_frame()

void bflb_mjpeg_pop_one_frame ( struct bflb_device_s dev)

Drop one frame that has compressed.

Parameters
[in]devdevice handle

◆ bflb_mjpeg_set_yuv420sp_cam_input()

void bflb_mjpeg_set_yuv420sp_cam_input ( struct bflb_device_s dev,
uint8_t  yy,
uint8_t  uv 
)

Set mjpeg input when uses camera with yuv402sp.

Parameters
[in]devdevice handle
[in]yycamera id for yy
[in]uvcamera id for uv

◆ bflb_mjpeg_start()

void bflb_mjpeg_start ( struct bflb_device_s dev)

Start mjpeg compression with camera.

Parameters
[in]devdevice handle

◆ bflb_mjpeg_stop()

void bflb_mjpeg_stop ( struct bflb_device_s dev)

Stop mjpeg compression with camera.

Parameters
[in]devdevice handle

◆ bflb_mjpeg_sw_run()

void bflb_mjpeg_sw_run ( struct bflb_device_s dev,
uint8_t  frame_count 
)

Start mjpeg compression without camera.

Parameters
[in]devdevice handle
[in]frame_countframe count to compress

◆ bflb_mjpeg_tcint_mask()

void bflb_mjpeg_tcint_mask ( struct bflb_device_s dev,
bool  mask 
)

Enable or disable mjpeg one frame compression completion interrupt.

Parameters
[in]devdevice handle
[in]masktrue means disable, false means enable

◆ bflb_mjpeg_update_input_output_buff()

void bflb_mjpeg_update_input_output_buff ( struct bflb_device_s dev,
void *  input_buf0,
void *  input_buf1,
void *  output_buff,
size_t  output_buff_size 
)

Control mjpeg feature.

Parameters
[in]devdevice handle
[in]input_buf0input buffer 0
[in]input_buf1input buffer 1
[in]output_buffoutput buffer
[in]output_buff_sizesize of output buffer
Returns
A negated errno value on failure.