Skip to content

Commit 8f5a645

Browse files
committed
Add Interface for AV1 B-frame Support
1 parent 8e271da commit 8f5a645

File tree

3 files changed

+64
-0
lines changed

3 files changed

+64
-0
lines changed

amf/doc/AMF_Video_Encode_AV1_API.md

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -597,6 +597,8 @@ This command encodes `400` frames through D3D renderer and creates an output fil
597597
| TILES_PER_FRAME | amf_int64 |
598598
| LTR_MODE | amf_int64 |
599599
| MAX_NUM_REFRAMES | amf_int64 |
600+
| MAX_CONSECUTIVE_BPICTURES | amf_int64 |
601+
| ADAPTIVE_MINIGOP | amf_bool |
600602
| ENCODING_LATENCY_MODE | amf_int64 |
601603
| FRAMESIZE | AMFSize |
602604
| ALIGNMENT_MODE | amf_int64 |
@@ -727,6 +729,34 @@ Maximum number of reference frames.
727729

728730
---
729731

732+
**Name:**
733+
`AMF_VIDEO_ENCODER_AV1_MAX_CONSECUTIVE_BPICTURES`
734+
735+
**Values:**
736+
`0`...`0` or `127`
737+
738+
**Default Value:**
739+
`0` or `127`
740+
741+
**Description:**
742+
Maximum number of consecutive B Pictures. The default value is determined by `AMF_VIDEO_ENCODER_AV1_CAP_BFRAMES`. If `AMF_VIDEO_ENCODER_AV1_CAP_BFRAMES` is true, the default value is 127; otherwise, it is 0.
743+
744+
---
745+
746+
**Name:**
747+
`AMF_VIDEO_ENCODER_AV1_ADAPTIVE_MINIGOP`
748+
749+
**Values:**
750+
`true`, `false`
751+
752+
**Default Value:**
753+
`false`
754+
755+
**Description:**
756+
Disable/Enable Adaptive MiniGOP, can enable with PA enabled.
757+
758+
---
759+
730760
**Name:**
731761
`AMF_VIDEO_ENCODER_AV1_ENCODING_LATENCY_MODE`
732762

@@ -1187,6 +1217,7 @@ Enable high motion quality boost mode to pre-analyze the motion of the video and
11871217
| CDEF_MODE | amd_int64 |
11881218
| INTRA_REFRESH_MODE | amf_int64 |
11891219
| INTRAREFRESH_STRIPES | amf_int64 |
1220+
| B_PIC_PATTERN | amf_int64 |
11901221

11911222
<p align="center">
11921223
Table 6. Encoder picture-control parameters
@@ -1311,6 +1342,20 @@ Valid only when intra refresh is enabled.
13111342

13121343
---
13131344

1345+
**Name:**
1346+
`AMF_VIDEO_ENCODER_AV1_B_PIC_PATTERN`
1347+
1348+
**Values:**
1349+
`0`...`127`
1350+
1351+
**Default Value:**
1352+
`0`
1353+
1354+
**Description:**
1355+
Sets the number of consecutive B-pictures in a GOP. BPicturesPattern = `0` indicates that B-pictures are not used.
1356+
1357+
---
1358+
13141359
| Name (Prefix “AMF_VIDEO_ENCODER_AV1_”) |Type |
13151360
| :------------------------------------- | :-------- |
13161361
| QUALITY_PRESET | amf_int64 |
@@ -2014,6 +2059,7 @@ Returns reconstructed picture as an `AMFSurface` attached to the output buffer a
20142059
| SUPPORT_TILE_OUTPUT | amf_bool |
20152060
| WIDTH_ALIGNMENT_FACTOR | amf_int64 |
20162061
| HEIGHT_ALIGNMENT_FACTOR | amf_int64 |
2062+
| BFRAMES | amf_bool |
20172063

20182064
<p align="center">
20192065
Table 14. Encoder capabilities exposed in AMFCaps interface
@@ -2174,6 +2220,18 @@ This is used for querying the av1 picture height alignment factor
21742220

21752221
---
21762222

2223+
**Name:**
2224+
`AMF_VIDEO_ENCODER_AV1_CAP_BFRAMES`
2225+
2226+
**Values:**
2227+
`true`, `false`
2228+
2229+
2230+
**Description:**
2231+
This is used for querying av1 b frame support
2232+
2233+
---
2234+
21772235
### Table A-4. Encoder statistics feedback
21782236

21792237
| Statistic Name (prefix "AMF_VIDEO_ENCODER_AV1") | Type |

amf/doc/AMF_Video_Encode_AV1_API.pdf

73.1 KB
Binary file not shown.

amf/public/include/components/VideoEncoderAV1.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -356,11 +356,17 @@ enum AMF_VIDEO_ENCODER_AV1_OUTPUT_BUFFER_TYPE_ENUM
356356
#define AMF_VIDEO_ENCODER_AV1_CAP_MAX_NUM_TEMPORAL_LAYERS L"Av1CapMaxNumTemporalLayers" // amf_int64; default = N/A; The cap of maximum number of temporal layers
357357
#define AMF_VIDEO_ENCODER_AV1_CAP_MAX_NUM_LTR_FRAMES L"Av1CapMaxNumLTRFrames" // amf_int64; default = N/A; The cap of maximum number of LTR frames. This value is calculated based on current value of AMF_VIDEO_ENCODER_AV1_MAX_NUM_TEMPORAL_LAYERS.
358358
#define AMF_VIDEO_ENCODER_AV1_CAP_SUPPORT_TILE_OUTPUT L"AV1SupportTileOutput" // amf_bool; if tile output is supported
359+
#define AMF_VIDEO_ENCODER_AV1_CAP_BFRAMES L"AV1BFrames" // amf_bool; if b frames are supported for AV1
359360

360361
#define AMF_VIDEO_ENCODER_AV1_CAP_SUPPORT_SMART_ACCESS_VIDEO L"Av1EncoderSupportSmartAccessVideo" // amf_bool; returns true if system supports SmartAccess Video
361362
#define AMF_VIDEO_ENCODER_AV1_CAP_WIDTH_ALIGNMENT_FACTOR L"Av1WidthAlignmentFactor" // amf_int64; default = 1; The encoder capability for width alignment
362363
#define AMF_VIDEO_ENCODER_AV1_CAP_HEIGHT_ALIGNMENT_FACTOR L"Av1HeightAlignmentFactor" // amf_int64; default = 1; The encoder capability for height alignment
363364

364365
#define AMF_VIDEO_ENCODER_AV1_MULTI_HW_INSTANCE_ENCODE L"Av1MultiHwInstanceEncode" // amf_bool; flag to enable AV1 multi VCN encode.
365366

367+
// properties for Picture Management (VCN5 feature)
368+
#define AMF_VIDEO_ENCODER_AV1_MAX_CONSECUTIVE_BPICTURES L"Av1MaxConsecutiveBPictures" // amf_int64; default 0 or 127, determined by AMF_VIDEO_ENCODER_AV1_CAP_BFRAMES. Maximum number of consecutive B frames for B frame encoding
369+
#define AMF_VIDEO_ENCODER_AV1_B_PIC_PATTERN L"Av1BPicturesPattern" // amf_int64; default 0. Number of B frames for B frame encoding
370+
#define AMF_VIDEO_ENCODER_AV1_ADAPTIVE_MINIGOP L"Av1AdaptiveMiniGop" // amf_bool; default false. Adaptive miniGOP size for B frame encoding
371+
366372
#endif //#ifndef AMF_VideoEncoderAV1_h

0 commit comments

Comments
 (0)