summaryrefslogtreecommitdiff
path: root/libavcodec/nvenc.h
diff options
context:
space:
mode:
authorBen Chang <benc@nvidia.com>2017-04-25 14:57:56 -0700
committerTimo Rothenpieler <timo@rothenpieler.org>2017-04-26 21:57:54 +0200
commit8de3458a07376b0a96772e586b6dba5e93432f52 (patch)
tree1349f65fd1d08cdc1f1dc7372cf4027b8a2d3af4 /libavcodec/nvenc.h
parent78a5fc4579deb63e1e6b93cd4d6e2ec2dceff931 (diff)
downloadffmpeg-8de3458a07376b0a96772e586b6dba5e93432f52.tar.gz
avcodec/nvenc: surface allocation reduction
This patch aims to reduce the number of input/output surfaces NVENC allocates per session. Previous default sets allocated surfaces to 32 (unless there is user specified param or lookahead involved). Having large number of surfaces consumes extra video memory (esp for higher resolution encoding). The patch changes the surfaces calculation for default, B-frames, lookahead scenario respectively. The other change involves surface selection. Previously, if a session allocates x surfaces, only x-1 surfaces are used (due to combination of output delay and lock toggle logic). To prevent unused surfaces, changing surface rotation to using predefined fifo. Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
Diffstat (limited to 'libavcodec/nvenc.h')
-rw-r--r--libavcodec/nvenc.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/nvenc.h b/libavcodec/nvenc.h
index 7dec5cc685..763647b283 100644
--- a/libavcodec/nvenc.h
+++ b/libavcodec/nvenc.h
@@ -44,7 +44,6 @@ typedef struct NvencSurface
NV_ENC_OUTPUT_PTR output_surface;
NV_ENC_BUFFER_FORMAT format;
int size;
- int lockCount;
} NvencSurface;
typedef struct NvencDynLoadFunctions
@@ -110,6 +109,7 @@ typedef struct NvencContext
int nb_surfaces;
NvencSurface *surfaces;
+ AVFifoBuffer *unused_surface_queue;
AVFifoBuffer *output_surface_queue;
AVFifoBuffer *output_surface_ready_queue;
AVFifoBuffer *timestamp_list;