intel / intel/vpl-gpu-rt

improve oneVPL's user experience

Open
#271 1 comment 0 reactions 1 assignee Claimed by @Jexu View on GitHub
Decode Feature Request
Dominant language
C++
Stars
157
Forks
104
PR merge metrics
No merged PRs in 30d

Description

## System information
- GPU platform enabling for new feature: NV
- Host machine if it's discrete card: NV
- libva/libva-utils/gmmlib/media-driver/VPL runtime version you are using? NV
- Are you willing to contribute it?(Yes/No) No

## Feature Information
### Describe the feature and expected behavior
Compared with NVDEC API, MSDK needs to parse bitstream and determine whether it needs to attach SPS, PPS and other data.
This is a little cumbersome for developers, and it is difficult to get started.

### Customer usage and impact for this feature
int NvDecoder::Decode(const uint8_t *pData, int nSize, int nFlags, int64_t nTimestamp)
{
m_nDecodedFrame = 0;
m_nDecodedFrameReturned = 0;
CUVIDSOURCEDATAPACKET packet = { 0 };
packet.payload = pData;
packet.payload_size = nSize;
packet.flags = nFlags | CUVID_PKT_TIMESTAMP;
packet.timestamp = nTimestamp;
if (!pData || nSize == 0) {
packet.flags |= CUVID_PKT_ENDOFSTREAM;
}
NVDEC_API_CALL(cuvidParseVideoData(m_hParser, &packet));

return m_nDecodedFrame;
}

The video bitstream `pData` is fed into parser using NVDECODE API cuvidParseVideoData() directly.

Application must register a function to handle any sequence
change. Parser triggers `pfnSequenceCallback` callback for initial sequence header or when it encounters a video format change.

Parser triggers `pfnDecodePicture` callback when bitstream data for one frame is
ready. In case of field pictures, there may be two decode calls per one display call since two fields make up one frame.

Parser triggers `pfnDisplayPicture` callback when a frame in display order is ready.

bool MFXFrameConstructor::PrepareFrame(const uint8_t* data, uint32_t size, uint64_t pts) {
bool ret = true;
MFX_ZERO_MEMORY(mBitstream);

switch (mFrameType) {
case MFX_FRAME_AVC:
ret = PrepareAVCFrame(data, size, pts);
break;
case MFX_FRAME_HEVC:
ret = PrepareHEVCFrame(data, size, pts);
break;
default:
MC_LOG("Unsupported codec!");
ret = false;
break;
}

return ret;
}
```

Compared with NVDEC API, MSDK needs to parse bitstream and determine whether it needs to attach SPS, PPS and other data.
This is a little cumbersome for developers, and it is difficult to get started.

**Additional context**
Add any other context or screenshots about the feature request here.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.