nvenc: Reduce the number of pre-allocated device memory
authorSeungha Yang <seungha.yang@navercorp.com>
Wed, 11 Sep 2019 05:56:00 +0000 (14:56 +0900)
committerMatthew Waters <matthew@centricular.com>
Wed, 11 Sep 2019 11:44:03 +0000 (11:44 +0000)
commitaf77988b9f50c7bcbae08b2e8688f11c7b57db97
treec4359a271f925e3c27ce5d2210541d46e15b8037
parent2b7050120ee78f091f59d0c8022e4c243a08bf6b
nvenc: Reduce the number of pre-allocated device memory

The hard-coded upper bound 32 (or 48 depending on resolution) might waste
GPU memory and high resolution encoding causes OUT-OF-MEMORY allocation error
quite easily. This commit calculates the number of required pre-allocated
device memory based on encoding options and it can reduce the amount of device memory
used by nvenc.
sys/nvcodec/gstnvbaseenc.c