Skip to content

Commit 3fd7efe

Browse files
Christa03mav-intel
authored andcommitted
Update encode programming guide for new API
1 parent 017f2e9 commit 3fd7efe

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

doc/spec/source/programming_guide/VPL_prg_encoding.rst

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,14 @@ The following pseudo code shows the encoding procedure:
271271
Encoder Quality Information
272272
---------------------------
273273

274+
Video encoder supports outputting quality information. Currently, it only
275+
reports the mean squared error (MSE).
276+
277+
- The application uses the :cpp:struct:`mfxExtQualityInfoMode` structure with
278+
``mfxQualityInfoMode = MFX_QUALITY_INFO_LEVEL_FRAME`` to initiate the request.
279+
- The application uses the :cpp:struct:`mfxExtQualityInfoOutput` structure to obtain the
280+
MSE result.
281+
274282
The following pseudo code shows an example of gathering encoder quality information:
275283

276284
.. literalinclude:: ../snippets/prg_encoding.c
@@ -279,10 +287,28 @@ The following pseudo code shows an example of gathering encoder quality informat
279287
:end-before: /*end9*/
280288
:lineno-start: 1
281289

290+
Note the following key points about the example:
291+
292+
- The application must attach the :cpp:struct:`mfxExtQualityInfoMode` structure to the
293+
:cpp:struct:`mfxVideoParam` structure and call the :cpp:func:`MFXVideoENCODE_Query` to
294+
check the support status of the request. The function returns
295+
:cpp:enumerator:`mfxStatus::MFX_ERR_NONE` if support is successful, or issues a warning
296+
:cpp:enumerator:`mfxStatus::MFX_WRN_INCOMPATIBLE_VIDEO_PARAM` if not supported, and
297+
sets :cpp:struct:`mfxExtQualityInfoMode` to
298+
``mfxQualityInfoMode = MFX_QUALITY_INFO_DISABLE``.
299+
- The application uses the :cpp:func:`MFXVideoENCODE_Init` to initialize the encoder.
300+
- The application can attach the :cpp:struct:`mfxExtQualityInfoOutput` structure to
301+
the encoded bitstream structure before calling
302+
:cpp:func:`MFXVideoENCODE_EncodeFrameAsync` function.
303+
- The application must use the :cpp:func:`MFXVideoCORE_SyncOperation` function to
304+
synchronize the encoding operation before retrieving the encoded bitstream and MSE
305+
result.
306+
282307
------------------------
283308
AV1 Screen Content Tools
284309
------------------------
285310

311+
AV1 video encoder supports Palette Prediction and Intra Block Copy mode.
286312
The following pseudo code shows an example of encoding with AV1 Screen Content tools:
287313

288314
.. literalinclude:: ../snippets/prg_encoding.c
@@ -291,6 +317,22 @@ The following pseudo code shows an example of encoding with AV1 Screen Content t
291317
:end-before: /*end10*/
292318
:lineno-start: 1
293319

320+
Note the following key points about the example:
321+
322+
- The application must attach the :cpp:struct:`mfxExtAV1ScreenContentTools` structure to
323+
the :cpp:struct:`mfxVideoParam` structure and call the :cpp:func:`MFXVideoENCODE_Query`
324+
to check the support status of the request. The function returns
325+
:cpp:enumerator:`mfxStatus::MFX_ERR_NONE` if support is successful, issues a warning
326+
:cpp:enumerator:`mfxStatus::MFX_WRN_INCOMPATIBLE_VIDEO_PARAM` due to platform
327+
limitations and updates the :cpp:struct:`mfxExtAV1ScreenContentTools` structure values
328+
to the default, or returns the error :cpp:enumerator:`mfxStatus::MFX_ERR_UNSUPPORTED` if
329+
not support.
330+
- The application uses the :cpp:func:`MFXVideoENCODE_Init` to initialize the encoder.
331+
- The application calls the :cpp:func:`MFXVideoENCODE_EncodeFrameAsync` function to
332+
perform the encoding operation.
333+
- The application must use the :cpp:func:`MFXVideoCORE_SyncOperation` function to
334+
synchronize the encoding operation before retrieving the encoded bitstream.
335+
294336
----------------------
295337
Alpha Channel Encoding
296338
----------------------

0 commit comments

Comments
 (0)