Description
Defines the structure for video stream decoding.
Structure Definition
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15 | struct VdecConfig {
uint32_t width = 0;
uint32_t height = 0;
MxbaseStreamFormat inputVideoFormat = MXBASE_STREAM_FORMAT_H264_MAIN_LEVEL;
MxbasePixelFormat outputImageFormat = MXBASE_PIXEL_FORMAT_YUV_SEMIPLANAR_420;
uint32_t channelId = 0;
uint32_t deviceId = 0;
pthread_t threadId = 0;
DecodeCallBackFunction callbackFunc = nullptr;
uint32_t outMode = 0;
uint32_t videoChannel = 0;
uint32_t skipInterval = 0;
uint32_t cscMatrix = 0;
void* userData = nullptr;
};
|
Parameters
Parameter
|
Input/Output
|
Description
|
width
|
Input
|
Image width.
|
height
|
Input
|
Image height.
|
inputVideoFormat
|
Input
|
Format of the input image.
|
outputImageFormat
|
Input
|
Format of the output image.
|
channelId
|
Input
|
ID of a decoding channel.
|
deviceId
|
Input
|
Device ID.
|
threadId
|
Input
|
ID of a callback thread.
|
callbackFunc
|
Input
|
Callback function.
The structure is as follows:
APP_ERROR (*DecodeCallBackFunction)(std::shared_ptr<void> buffer, DvppDataInfo& dvppDataInfo, void* userData)
- buffer: output data after decoding.
- dvppDataInfo: output data information after decoding.
- userData: user-defined data pointer.
|
outMode
|
Input
|
Frame output mode. The value can be 0 or 1. The default value is 0.
- 0: delayed frame output mode. The VDEC starts to output the decoding result only after receiving multiple frames in the stream.
- 1: real-time frame output mode. VDEC starts to output the decoding result in real time after receiving one frame in the stream. Only H.264/H.265 standard streams with simple reference relationships are supported (no long-term reference frames or B-frames).
|
videoChannel
|
Input
|
Reserved.
|
skipInterval
|
Input
|
Frame skipping parameter.
|
cscMatrix
|
Input
|
CSC option. Only Atlas inference products support this API.
- HI_CSC_MATRIX_BT601_WIDE = 0: CSC matrix based on the BT.601 Wide standard. The parameter values are as follows:
| # YUV-to-RGB conversion:
# | R | | 1.000 0.000 1.402 | | Y - 0 |
# | G | = | 1.000 -0.344 -0.714 | * | U - 128 |
# | B | | 1.000 1.772 0.000 | | V - 128 |
# RGB-to-YUV conversion:
# | Y | |-0.5 | | 0.299 0.587 0.114 | | R |
# | U | = |127.5 | + | -0.168 -0.331 0.500 | * | G |
# | V | |127.5 | | 0.500 -0.419 -0.081 | | B |
|
- HI_CSC_MATRIX_BT601_NARROW = 1: CSC matrix based on the BT.601 Narrow standard. The parameter values are as follows:
| # YUV-to-RGB conversion:
# | R | | 1.16438 0.00000 1.59602 | | Y - 16 |
# | G | = | 1.16438 -0.39176 -0.81297 | * | U - 128 |
# | B | | 1.16438 2.01723 0.00000 | | V - 128 |
# RGB-to-YUV conversion:
# | Y | |16 | | 0.25679 0.51564 0.10014 | | R |
# | U | = |128| + | -0.14491 -0.29099 0.43922 | * | G |
# | V | |128| | 0.42941 -0.36779 -0.07143 | | B |
|
- HI_CSC_MATRIX_BT709_WIDE = 2: CSC matrix based on the BT.709 Wide standard. The parameter values are as follows:
| # YUV-to-RGB conversion:
# | R | | 1.00000 0.00000 1.57480 | | Y - 0 |
# | G | = | 1.00000 -0.18732 -0.46812 | * | U - 128 |
# | B | | 1.00000 1.85560 0.00000 | | V - 128 |
# RGB-to-YUV conversion:
# | Y | |0 | | 0.21260 0.71520 0.07220 | | R |
# | U | = |128| + | -0.11457 -0.38543 0.50000 | * | G |
# | V | |128| | 0.50000 -0.45415 -0.04585 | | B |
|
- HI_CSC_MATRIX_BT709_NARROW = 3: CSC matrix based on the BT.709 Narrow standard. The parameter values are as follows:
| # YUV-to-RGB conversion:
# | R | | 1.16438 0.00000 1.79274 | | Y - 16 |
# | G | = | 1.16438 -0.21325 -0.53291 | * | U - 128 |
# | B | | 1.16438 2.11240 0.00000 | | V - 128 |
# RGB-to-YUV conversion:
# | Y | |16 | | 0.18259 0.62825 0.06342 | | R |
# | U | = |128| + | -0.09840 -0.33857 0.43922 | * | G |
# | V | |128| | 0.42941 -0.39894 -0.04027 | | B |
|
- HI_CSC_MATRIX_BT2020_WIDE = 4: CSC matrix based on the BT.2020 Wide standard. The parameter values are as follows:
| # YUV-to-RGB conversion:
# | R | | 1.00000 0.00000 1.47460 | | Y - 0 |
# | G | = | 1.00000 -0.16455 -0.57135 | * | U - 128 |
# | B | | 1.00000 1.88140 0.00000 | | V - 128 |
# RGB-to-YUV conversion:
# | Y | |0 | | 0.26270 0.67800 0.05930 | | R |
# | U | = |128| + | -0.13963 -0.36037 0.50000 | * | G |
# | V | |128| | 0.50000 -0.45979 -0.04021 | | B |
|
- HI_CSC_MATRIX_BT2020_NARROW = 5: CSC matrix based on the BT.2020 Narrow standard. The parameter values are as follows:
| # YUV-to-RGB conversion:
# | R | | 1.16438 0.00000 1.67868 | | Y - 16 |
# | G | = | 1.16438 -0.18733 -0.65042 | * | U - 128 |
# | B | | 1.16438 2.14177 0.00000 | | V - 128 |
# RGB-to-YUV conversion:
# | Y | |16 | | 0.22564 0.59558 0.05209 | | R |
# | U | = |128| + | -0.11992 -0.31656 0.43922 | * | G |
# | V | |128| | 0.42941 -0.40389 -0.03533 | | B |
|
|
userData
|
Input
|
User-defined data.
|