Skip to content
This repository was archived by the owner on May 20, 2024. It is now read-only.

Commit a259736

Browse files
committed
Release v2021.5.0
New in This Release ------------------- * Updated API version dependency to 2.4 * Improved warnings for incompatible parameters * Numerous minor bugs fixed Issues and Limitations ---------------------- * Decode input bitstream buffer size must be large enough to hold several frames. Buffer sizes that are too small may cause issues. The necessary minimum size is stream dependent but enough for 10 frames is a conservative estimate. * AVC/H.264 encode is disabled due to licensing restrictions. To enable it, refer to the instructions to [Optionally enable H.264 encode](https://github.com/oneapi-src/oneVPL-cpu#optionally-enable-h264-encode). * A subset of parameters and functions from the specification are implemented. For more information on mandatory and optional APIs and features, see the [oneVPL specification](https://spec.oneapi.com/versions/latest/elements/oneVPL/source/VPL_summary.html#mandatory-optional-apis-and-features). * For the Windows* release, Visual C++* Redistributable for Visual Studio* 2015 or higher is required. Without this, an error reporting a missing MSVCP140.dll will be generated. * MFX_BITSTREAM_EOS from the input bitstream dataFlag is ignored by MFXVideoDECODE_DecodeFrameAsync().
1 parent 19f2e5a commit a259736

32 files changed

+1015
-430
lines changed

.clang-format

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ ConstructorInitializerAllOnOneLineOrOnePerLine: true
5353
ConstructorInitializerIndentWidth: 8
5454
ContinuationIndentWidth: 4
5555
Cpp11BracedListStyle: false
56-
DerivePointerAlignment: true
56+
DerivePointerAlignment: false
5757
DisableFormat: false
5858
FixNamespaceComments: true
5959
ForEachMacros:
@@ -88,7 +88,7 @@ PenaltyBreakString: 1000
8888
PenaltyBreakTemplateDeclaration: 10
8989
PenaltyExcessCharacter: 1000000
9090
PenaltyReturnTypeOnItsOwnLine: 200
91-
PointerAlignment: Left
91+
PointerAlignment: Right
9292
RawStringFormats:
9393
- Language: Cpp
9494
Delimiters:

INSTALL.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ Add `gpl` to the build commands to enable H.264 encode capability.
8787
For Linux:
8888
8989
```
90-
script/bootstrap gpl
90+
source script/bootstrap gpl
9191
script/build gpl
9292
script/install
9393
```
@@ -110,9 +110,9 @@ script\install
110110
111111
The bootstrap and build scripts accept additional options. See the -h flag for more details.
112112
113-
To build in debug mode:
113+
To build in debug mode in Linux:
114114
```
115-
script/bootstrap --config Debug
115+
source script/bootstrap --config Debug
116116
script/build --config Debug
117117
script/install
118118
```

cmake/CompileOptions.cmake

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,30 @@ if(CMAKE_BUILD_TYPE STREQUAL "Debug")
1414
endif(UNIX)
1515
endif()
1616

17+
if(ENABLE_WARNING_AS_ERROR)
18+
message(STATUS "Warnings as errors enabled")
19+
set(MFX_DEPRECATED_OFF 1)
20+
endif()
21+
22+
if(DEFINED ENV{MFX_DEPRECATED_OFF})
23+
set(MFX_DEPRECATED_OFF 1)
24+
endif()
25+
26+
if(MFX_DEPRECATED_OFF)
27+
message(STATUS "Deprecation warnings disabled")
28+
add_definitions(-DMFX_DEPRECATED_OFF)
29+
endif()
30+
1731
if(MSVC)
1832
add_link_options("/DYNAMICBASE")
1933
if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "8")
2034
add_link_options("/HIGHENTROPYVA")
2135
endif()
2236
add_link_options("/LARGEADDRESSAWARE")
2337
add_link_options("/NXCOMPAT")
38+
if(ENABLE_WARNING_AS_ERROR)
39+
add_compile_options("/WX")
40+
endif()
2441
add_compile_options("/GS")
2542
if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "4")
2643
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /D \"SAFESEH:NO\"")
@@ -36,4 +53,7 @@ else()
3653
add_compile_options("-fstack-protector-strong")
3754
set(CMAKE_CXX_FLAGS "-z relro -z now -z noexecstack")
3855
add_compile_options("-Wall")
56+
if(ENABLE_WARNING_AS_ERROR)
57+
add_compile_options("-Werror")
58+
endif()
3959
endif()

cpu/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ if(POLICY CMP0074)
4141
cmake_policy(SET CMP0074 OLD)
4242
endif()
4343

44-
find_package(VPL 2.2 REQUIRED COMPONENTS api)
44+
find_package(VPL 2.4 REQUIRED COMPONENTS api)
4545
message(STATUS "Found VPL (version ${VPL_VERSION})")
4646
target_link_libraries(${TARGET} PUBLIC VPL::api)
4747

cpu/src/cpu_common.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ uint32_t AVPixelFormat2MFXFourCC(int format) {
3535
return MFX_FOURCC_RGB4;
3636
case AV_PIX_FMT_YUV420P:
3737
return MFX_FOURCC_I420;
38+
default:
39+
return 0;
3840
}
3941
return 0;
4042
}
@@ -63,6 +65,8 @@ mfxU32 AVCodecID_to_MFXCodecId(AVCodecID CodecId) {
6365
return MFX_CODEC_JPEG;
6466
case AV_CODEC_ID_AV1:
6567
return MFX_CODEC_AV1;
68+
default:
69+
return 0;
6670
}
6771
return 0;
6872
}

cpu/src/cpu_common.h

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -52,15 +52,15 @@ extern "C" {
5252
#include <iostream>
5353
class TraceObject {
5454
public:
55-
explicit TraceObject(const char* name) : m_name(name) {
55+
explicit TraceObject(const char *name) : m_name(name) {
5656
std::cout << "### entering " << name << std::endl;
5757
}
5858
~TraceObject() {
5959
std::cout << "### leaving " << m_name << std::endl;
6060
}
6161

6262
protected:
63-
const char* m_name;
63+
const char *m_name;
6464
};
6565

6666
#define VPL_TRACE(_NAME) TraceObject trace_object(_NAME)
@@ -106,15 +106,15 @@ uint32_t AVPixelFormat2MFXFourCC(int format);
106106
AVCodecID MFXCodecId_to_AVCodecID(mfxU32 CodecId);
107107
mfxU32 AVCodecID_to_MFXCodecId(AVCodecID CodecId);
108108

109-
std::shared_ptr<AVFrame> GetAVFrameFromMfxSurface(mfxFrameSurface1* surface,
110-
mfxFrameAllocator* allocator);
109+
std::shared_ptr<AVFrame> GetAVFrameFromMfxSurface(mfxFrameSurface1 *surface,
110+
mfxFrameAllocator *allocator);
111111

112112
// copy image data from AVFrame to mfxFrameSurface1
113-
mfxStatus AVFrame2mfxFrameSurface(mfxFrameSurface1* surface,
114-
AVFrame* frame,
115-
mfxFrameAllocator* allocator);
113+
mfxStatus AVFrame2mfxFrameSurface(mfxFrameSurface1 *surface,
114+
AVFrame *frame,
115+
mfxFrameAllocator *allocator);
116116

117-
mfxStatus CheckFrameInfoCommon(mfxFrameInfo* info, mfxU32 codecId);
118-
mfxStatus CheckFrameInfoCodecs(mfxFrameInfo* info, mfxU32 codecId);
119-
mfxStatus CheckVideoParamCommon(mfxVideoParam* in);
117+
mfxStatus CheckFrameInfoCommon(mfxFrameInfo *info, mfxU32 codecId);
118+
mfxStatus CheckFrameInfoCodecs(mfxFrameInfo *info, mfxU32 codecId);
119+
mfxStatus CheckVideoParamCommon(mfxVideoParam *in);
120120
#endif // CPU_SRC_CPU_COMMON_H_

cpu/src/cpu_decode.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,18 @@
1010
#include "src/cpu_workstream.h"
1111

1212
CpuDecode::CpuDecode(CpuWorkstream *session)
13-
: m_session(session),
14-
m_avDecCodec(nullptr),
13+
: m_avDecCodec(nullptr),
1514
m_avDecContext(nullptr),
1615
m_avDecParser(nullptr),
1716
m_avDecPacket(nullptr),
1817
m_avDecFrameOut(nullptr),
1918
m_swsContext(nullptr),
2019
m_param(),
2120
m_decSurfaces(),
22-
m_frameOrder(0),
21+
m_bFrameBuffered(false),
2322
m_bStreamInfo(false),
24-
m_bFrameBuffered(false) {}
23+
m_session(session),
24+
m_frameOrder(0) {}
2525

2626
mfxStatus CpuDecode::ValidateDecodeParams(mfxVideoParam *par, bool canCorrect) {
2727
bool fixedIncompatible = false;
@@ -166,10 +166,10 @@ mfxStatus CpuDecode::InitDecode(mfxVideoParam *par, mfxBitstream *bs) {
166166
AVCodecID cid = MFXCodecId_to_AVCodecID(par->mfx.CodecId);
167167
RET_IF_FALSE(cid, MFX_ERR_INVALID_VIDEO_PARAM);
168168

169+
mfxStatus valSts = MFX_ERR_NONE;
169170
if (!bs) {
170-
mfxStatus sts = ValidateDecodeParams(par, false);
171-
if (sts != MFX_ERR_NONE)
172-
return sts;
171+
valSts = ValidateDecodeParams(par, false);
172+
RET_ERROR(valSts);
173173
}
174174

175175
m_avDecCodec = avcodec_find_decoder(cid);
@@ -231,7 +231,7 @@ mfxStatus CpuDecode::InitDecode(mfxVideoParam *par, mfxBitstream *bs) {
231231
GetVideoParam(par);
232232
}
233233

234-
return MFX_ERR_NONE;
234+
return valSts;
235235
}
236236

237237
CpuDecode::~CpuDecode() {

cpu/src/cpu_decode.h

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -15,44 +15,44 @@ class CpuWorkstream;
1515

1616
class CpuDecode {
1717
public:
18-
explicit CpuDecode(CpuWorkstream* session);
18+
explicit CpuDecode(CpuWorkstream *session);
1919
~CpuDecode();
2020

21-
static mfxStatus DecodeQuery(mfxVideoParam* in, mfxVideoParam* out);
22-
static mfxStatus DecodeQueryIOSurf(mfxVideoParam* par, mfxFrameAllocRequest* request);
21+
static mfxStatus DecodeQuery(mfxVideoParam *in, mfxVideoParam *out);
22+
static mfxStatus DecodeQueryIOSurf(mfxVideoParam *par, mfxFrameAllocRequest *request);
2323

24-
mfxStatus InitDecode(mfxVideoParam* par, mfxBitstream* bs);
25-
mfxStatus DecodeFrame(mfxBitstream* bs,
26-
mfxFrameSurface1* surface_work,
27-
mfxFrameSurface1** surface_out);
28-
mfxStatus GetVideoParam(mfxVideoParam* par);
29-
mfxStatus GetDecodeSurface(mfxFrameSurface1** surface);
24+
mfxStatus InitDecode(mfxVideoParam *par, mfxBitstream *bs);
25+
mfxStatus DecodeFrame(mfxBitstream *bs,
26+
mfxFrameSurface1 *surface_work,
27+
mfxFrameSurface1 **surface_out);
28+
mfxStatus GetVideoParam(mfxVideoParam *par);
29+
mfxStatus GetDecodeSurface(mfxFrameSurface1 **surface);
3030

31-
mfxStatus CheckVideoParamDecoders(mfxVideoParam* in);
32-
mfxStatus IsSameVideoParam(mfxVideoParam* newPar, mfxVideoParam* oldPar);
31+
mfxStatus CheckVideoParamDecoders(mfxVideoParam *in);
32+
mfxStatus IsSameVideoParam(mfxVideoParam *newPar, mfxVideoParam *oldPar);
3333

3434
private:
35-
static mfxStatus ValidateDecodeParams(mfxVideoParam* par, bool canCorrect);
36-
AVFrame* ConvertJPEGOutputColorSpace(AVFrame* avframe, AVPixelFormat target_pixfmt);
37-
const AVCodec* m_avDecCodec;
38-
AVCodecContext* m_avDecContext;
39-
AVCodecParserContext* m_avDecParser;
40-
AVPacket* m_avDecPacket;
41-
AVFrame* m_avDecFrameOut;
42-
struct SwsContext* m_swsContext;
35+
static mfxStatus ValidateDecodeParams(mfxVideoParam *par, bool canCorrect);
36+
AVFrame *ConvertJPEGOutputColorSpace(AVFrame *avframe, AVPixelFormat target_pixfmt);
37+
const AVCodec *m_avDecCodec;
38+
AVCodecContext *m_avDecContext;
39+
AVCodecParserContext *m_avDecParser;
40+
AVPacket *m_avDecPacket;
41+
AVFrame *m_avDecFrameOut;
42+
struct SwsContext *m_swsContext;
4343

4444
mfxVideoParam m_param;
4545
std::unique_ptr<CpuFramePool> m_decSurfaces;
4646
bool m_bFrameBuffered;
4747
bool m_bStreamInfo;
4848

49-
CpuWorkstream* m_session;
49+
CpuWorkstream *m_session;
5050

5151
mfxU32 m_frameOrder;
5252

5353
/* copy not allowed */
54-
CpuDecode(const CpuDecode&);
55-
CpuDecode& operator=(const CpuDecode&);
54+
CpuDecode(const CpuDecode &);
55+
CpuDecode &operator=(const CpuDecode &);
5656
};
5757

5858
#endif // CPU_SRC_CPU_DECODE_H_

0 commit comments

Comments
 (0)