JPEGDEC APIs

[中文]

Important

The JPEGDEC API v1.0 is the lastest stable JPEGDEC APIs. All new applications should use JPEGDEC API v1.0. This component is software decode not hardware decode

JPEGDEC API Categories

Most of JPEGDEC APIs can be categoried as:

  • JPEGDEC APIs

    The common APIs are prefixed with bk_jpeg_dec_sw, e.g. bk_jpeg_dec_sw_init() etc.

JPEGDEC APIs:

API Reference

Header File

Functions

bk_err_t bk_jpeg_dec_sw_init(void *jd_in, uint32_t len)

JPEG_DEC APIs Version 1.0.

Init the jpeg_dec

This API init the jpeg_dec

  • config jpeg_dec image resoult, and simple_rate

  • malloc buffer for jpeg_dec

Attention

1. only for software jpeg_dec

Parameters
  • jd_in – inter buffer

  • len – buffer length

Returns

  • BK_OK: succeed

  • other: errors.

bk_err_t bk_jpeg_dec_sw_deinit(void)

Deinit the jpeg_dec.

This API deinit the jpeg_dec

  • clear all configure for jpeg_dec

  • free buffer for jpeg_dec

Attention

1. only for software jpeg_dec

Returns

  • BK_OK: succeed

  • other: errors.

bk_err_t bk_jpeg_dec_sw_start(uint8_t decode_type, uint8_t *src_buf, uint8_t *dst_buf, uint32_t jpeg_size, uint32_t outbuf_size, sw_jpeg_dec_res_t *result)

jpeg_decoder_fun

This API jpeg_decoder_fun

  • jpeg_prepare for jpeg_dec

  • start jpeg_dec

Attention

1. only for software jpeg_dec

Attention

2. outbuf_size only work for decode_type=0, decode by frame, and outbuf size must 2 times for decode 16line

Parameters
  • decode_type – 0:decode by line, one time decode 16line; 1:decode by frame

  • src_buf – jpeg image address

  • dst_buf – decode output buffer address

  • outbuf_size – decode output buffer size

  • result – decode image info

Returns

  • BK_OK: succeed

  • other: errors.

bk_err_t bk_jpeg_dec_sw_start_line(void)

start line jpeg decode sw

This API is used to decode go on

Attention

1. only for software jpeg_dec by line

Returns

  • BK_OK: succeed

  • other: errors.

bk_err_t bk_jpeg_get_img_info(uint32_t frame_size, uint8_t *src_buf, sw_jpeg_dec_res_t *result)

jpeg_decoder_fun

This API is used to get img width and size

Attention

1. only for software jpeg_dec

Parameters
  • frame_size – input image size

  • src_buf – jpeg image address

  • result – decode image info

Returns

  • BK_OK: succeed

  • other: errors.

void bk_jpeg_dec_sw_register_finish_callback(void *cb)

jpegdec register finish icallback_func

This API jpeg_decoder_fun, the callback function wiil execute when decode success

Attention

1. only for software jpeg_dec

Parameters

cb – finish jpeg_dec callback function

Returns

bk_err_t bk_jpeg_dec_sw_start_one_time(uint8_t decode_type, uint8_t *src_buf, uint8_t *dst_buf, uint32_t jpeg_size, uint32_t outbuf_size, sw_jpeg_dec_res_t *result, uint8_t scale, JD_FORMAT_OUTPUT format, media_rotate_t rotate_angle, uint8_t *work_buffer, uint8_t *rotate_buffer)

jpeg_decoder_fun

This API jpeg_decoder_fun

  • jpeg_prepare for jpeg_dec

  • start jpeg_dec

Attention

1. only for software jpeg_dec

Attention

2. outbuf_size only work for decode_type=0, decode by frame, and outbuf size must 2 times for decode 16line

Parameters
  • decode_type – 0:decode by line, one time decode 16line; 1:decode by frame

  • src_buf – jpeg image address

  • dst_buf – decode output buffer address

  • outbuf_size – decode output buffer size

  • result – decode image info

  • scaling – of decode image

  • format – of decode image

  • rotate_angle – of decode image

  • work_buffer – inter workbuffer

  • rotate_buffer – rotate need buffer

Returns

  • BK_OK: succeed

  • other: errors.

API Typedefs