The VCU software reads the total available encoder buffer size from LogiCORE registers (the values can be in the GUI, after the settings) along with the value of maximum number of cores based on the settings you select (resolution and fps). The memory allocated by the software is calculated using the total encoder buffer size divided by the maximum number of cores. If this value is inadequate, no channel is created.
The 4kp30 encoder buffer requires lesser space than the 4kp60 because it uses two cores and four cores, respectively. Two tiles are encoded in parallel for 4kp30 whereas for 4kp60, four tiles are encoded in parallel. To allocate encoder buffer, the most demanding use case is entered in the Vivado IDE, which computes and provides the maximum number of cores used in that use case (4 for 4K60) to the driver. For each core, the firmware allocates a static encoder buffer size equal to the total size divided by the maximum number of cores. When a channel is started, the firmware computes the required number of cores (for example, two cores for 4K30) and tries to use the available encoder buffer size for these cores.
The following example uses these values: HEVC, 4:2:0 8-bit, B-frames, Low MV range, and single stream. The requirement of encoder buffer is 696 KB for 4kp60 and 504 KB for 4kp30.
- Set the GUI settings to: 4:2:0 8-bit, B-frames, Low MV range, and 4Kp60. The VCU software gets the available encoder buffer size = 696 KB, max-number-of-cores = 4.
- Running the 4kp30 use case with same design might not work. A channel creation error might occur because 4kp30 requires two encoder cores and therefore, the available encoder buffer size is calculated as 696/2=348 Kb but 348 Kb is not enough to run the 4kp30 use case.
- The same use case works if you override the setting number-cores=4, in the software or the application, because the encoder buffer attached to each core is used in that case.
Based on the use case, the two options to configure are:
- Two 4Kp30 streams are defined in the GUI as the case with highest usage.
- Number of cores for each 4Kp30 must be forced to four (this forces time sharing for the four cores and change the scheduling of the two channels while reducing the total amount of encoder buffer).
The first option is preferred to avoid exposing core management and to avoid additional encoding constraints. The second option might be preferred if the PL memory optimization is an important requirement. The following table shows the possible combinations:
Use Case | Codec | L2 Cache (KB) | Comments |
---|---|---|---|
1080p60 | AVC/HEVC | 228 | 1 enc core |
1080p60 - 4 streams | AVC/HEVC | 912 | 1 enc core per stream |
4kp30 - 1 stream | AVC | 453 | 2 enc cores |
4kp30 - 1 stream | HEVC | 504 | 2 enc cores |
4kp30 - 2 streams | AVC | 906 | 2 enc cores per stream |
4kp30 - 2 streams | HEVC | 1008 | 2 enc cores per stream |
4kp60 - 1 stream | AVC | 582 | 4 enc cores |
4kp60 - 1 stream | HEVC | 696 | 4 enc cores |
- The automatic computation of the required size becomes cumbersome if you want to
support multiple use cases that do not have the same max-number-of-cores, but in
basic cases (for example, 4x1080p60 or 2x4k30 or 1x4k60), the worst case encoder
buffer size and the worst case max-number-of-cores must be provided. Choose
multi-stream use case in GUI to avoid such failures. Note: You cannot set the value of num-cores to maximum in the sub-frame latency mode. It is recommended that you leave num-cores calculation as Auto to VCU firmware and adjust GUI settings to support multiple use cases.