hi_mpi_venc_create_chn

Description

Creates an encoding channel.

The Ascend 310 AI Processor does not support this API in the current version.

The Ascend 910 AI Processor does not support this API in the current version.

Restrictions

Prototype

hi_s32 hi_mpi_venc_create_chn(hi_venc_chn chn, const hi_venc_chn_attr *attr)

Parameters

Parameter

Input/Output

Description

chn

Input

Encoding channel ID.

The value range of the encoding channel ID is [0, 256). The maximum number of channels is 256.

attr

Input

Pointer to the encoding channel attributes.

Returns

See Also

For the API call sequence, see JPEGE and VENC.

References

Table 1 Encoding channel width and height

W/H (Pixel)

H.264

H.265

JPEG

MIN_WIDTH

128

128

32

MAX_WIDTH

4096

4096

8192

MIN_HEIGHT

128

128

32

MAX_HEIGHT

4096

4096

8192

MIN_ALIGN

2

2

2

Table 2 Restrictions on encoder attributes

Encode Protocol

Encode Mode

Stream Buffer Allocation

Stream Fetching Mode

Encode Profile

H.264

Frame

  • When mini_buf_mode = 0: Buffer allocation ≥ max_pic_width x max_pic_height x 3/4
  • When mini_buf_mode = 1:

    Buffer allocation ≥ 32 x 1024 bytes

Frame/Slice

Baseline

Main Profile

High Profile

JPEG

Frame

  • When mini_buf_mode = 0: Minimum buffer allocation for the YUV420 format = Source image width 16-aligned x Source image height 16-aligned x 3/2. Minimum buffer allocation for the YUV422 Packed format = Source image width 16-aligned x Source image height 16-aligned x 2
  • When mini_buf_mode = 1: Buffer allocation ≥ 32 x 1024 bytes

Frame/Ecs

Baseline

H.265

Frame

  • When mini_buf_mode = 0: Buffer allocation ≥ max_pic_width x max_pic_height x 3/4
  • When mini_buf_mode = 1: Buffer allocation ≥ 32 x 1024 bytes

Frame/Slice

Main profile

Main 10 Profile (not supported currently)

  • When mini_buf_mode = 0: Buffer allocation ≥ max_pic_width x max_pic_height x (3/4) x (5/4)
  • When mini_buf_mode = 1:

    Buffer allocation ≥ 32 x 1024 bytes

Frame/Slice

Main 10 profile (not supported currently)

Table 3 Restrictions on RC attributes

RC Mode

GOP

StatTime (s)

FrmRate (src_frame_rate/dst_frame_rate)

CBR

≥ 1

≥ 1

src_frame_rate ≥ dst_frame_rate

VBR

≥ 1

≥ 1

src_frame_rate ≥ dst_frame_rate

AVBR

≥ 1

≥ 1

src_frame_rate ≥ dst_frame_rate

FIXQP

≥ 1

≥ 1

src_frame_rate ≥ dst_frame_rate

QPMAP

≥ 1

≥ 1

src_frame_rate ≥ dst_frame_rate

Table 4 Typical average bit rate settings

Image Size/Bit Rate Level

1080p (1920 x 1080)

4K (3840 x 2160)

Low bit rate

2 Mbit/s

8 Mbit/s

Mid bit rate

2–8 Mbit/s

8–30 Mbit/s

High bit rate

> 8 Mbit/s

> 30 Mbit/s