Skip to content

Instantly share code, notes, and snippets.

View deepch's full-sized avatar
🎲
build not bombs

Andrey Semochkin deepch

🎲
build not bombs
View GitHub Profile
@deepch
deepch / ffmpeg_surfaces.patch
Created July 9, 2018 01:29 — forked from Snawoot/ffmpeg_surfaces.patch
Lower surfaces usage for nvenc encoding process
diff --git a/libavcodec/nvenc.c b/libavcodec/nvenc.c
index a3a2ef5..1691d15 100644
--- a/libavcodec/nvenc.c
+++ b/libavcodec/nvenc.c
@@ -1157,7 +1157,7 @@ static av_cold int nvenc_setup_surfaces(AVCodecContext *avctx)
NvencContext *ctx = avctx->priv_data;
int i, res;
int num_mbs = ((avctx->width + 15) >> 4) * ((avctx->height + 15) >> 4);
- ctx->nb_surfaces = FFMAX((num_mbs >= 8160) ? 32 : 48,
+ ctx->nb_surfaces = FFMAX((num_mbs >= 8160) ? 8 : 12,