aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/nvenc.c
diff options
context:
space:
mode:
authorTimo Rothenpieler <timo@rothenpieler.org>2022-11-01 15:35:54 +0100
committerTimo Rothenpieler <timo@rothenpieler.org>2022-11-01 17:42:54 +0100
commit12733c0cbd49077d3aac48007f674f14d1e15ccd (patch)
treed3dc63ab291ac8b6c73d4062ce61d4d9ad139a13 /libavcodec/nvenc.c
parent2537fdc510ba2b5eca3e5c7a2b6d773498daa418 (diff)
downloadffmpeg-12733c0cbd49077d3aac48007f674f14d1e15ccd.tar.gz
avcodec/nvenc: remove unused slice offset querying
Diffstat (limited to 'libavcodec/nvenc.c')
-rw-r--r--libavcodec/nvenc.c26
1 files changed, 0 insertions, 26 deletions
diff --git a/libavcodec/nvenc.c b/libavcodec/nvenc.c
index 11bd21f365..3c6fce391d 100644
--- a/libavcodec/nvenc.c
+++ b/libavcodec/nvenc.c
@@ -2060,38 +2060,16 @@ static int process_output_surface(AVCodecContext *avctx, AVPacket *pkt, NvencSur
NvencDynLoadFunctions *dl_fn = &ctx->nvenc_dload_funcs;
NV_ENCODE_API_FUNCTION_LIST *p_nvenc = &dl_fn->nvenc_funcs;
- uint32_t slice_mode_data;
- uint32_t *slice_offsets = NULL;
NV_ENC_LOCK_BITSTREAM lock_params = { 0 };
NVENCSTATUS nv_status;
int res = 0;
enum AVPictureType pict_type;
- switch (avctx->codec->id) {
- case AV_CODEC_ID_H264:
- slice_mode_data = ctx->encode_config.encodeCodecConfig.h264Config.sliceModeData;
- break;
- case AV_CODEC_ID_H265:
- slice_mode_data = ctx->encode_config.encodeCodecConfig.hevcConfig.sliceModeData;
- break;
- default:
- av_log(avctx, AV_LOG_ERROR, "Unknown codec name\n");
- res = AVERROR(EINVAL);
- goto error;
- }
- slice_offsets = av_mallocz(slice_mode_data * sizeof(*slice_offsets));
-
- if (!slice_offsets) {
- res = AVERROR(ENOMEM);
- goto error;
- }
-
lock_params.version = NV_ENC_LOCK_BITSTREAM_VER;
lock_params.doNotWait = 0;
lock_params.outputBitstream = tmpoutsurf->output_surface;
- lock_params.sliceOffsets = slice_offsets;
nv_status = p_nvenc->nvEncLockBitstream(ctx->nvencoder, &lock_params);
if (nv_status != NV_ENC_SUCCESS) {
@@ -2162,16 +2140,12 @@ static int process_output_surface(AVCodecContext *avctx, AVPacket *pkt, NvencSur
if (res < 0)
goto error2;
- av_free(slice_offsets);
-
return 0;
error:
timestamp_queue_dequeue(ctx->timestamp_list);
error2:
- av_free(slice_offsets);
-
return res;
}