1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

Merge commit 'cad739dace55e3446ef7180de688173cd19fb000'

* commit 'cad739dace55e3446ef7180de688173cd19fb000':
  lavc: Add per-thread surfaces in get_hw_frame_parameters()

Merged-by: Mark Thompson <sw@jkqxz.net>
This commit is contained in:
Mark Thompson 2018-02-12 22:22:30 +00:00
commit 9471122a1b
2 changed files with 5 additions and 8 deletions

View File

@ -1186,10 +1186,6 @@ int ff_decode_get_hw_frames_ctx(AVCodecContext *avctx,
// We guarantee 4 base work surfaces. The function above guarantees 1
// (the absolute minimum), so add the missing count.
frames_ctx->initial_pool_size += 3;
// Add an additional surface per thread is frame threading is enabled.
if (avctx->active_thread_type & FF_THREAD_FRAME)
frames_ctx->initial_pool_size += avctx->thread_count;
}
ret = av_hwframe_ctx_init(avctx->hw_frames_ctx);
@ -1236,6 +1232,11 @@ int avcodec_get_hw_frames_parameters(AVCodecContext *avctx,
// available then add them here.
if (avctx->extra_hw_frames > 0)
frames_ctx->initial_pool_size += avctx->extra_hw_frames;
// If frame threading is enabled then an extra surface per thread
// is also required.
if (avctx->active_thread_type & FF_THREAD_FRAME)
frames_ctx->initial_pool_size += avctx->thread_count;
}
*out_frames_ref = frames_ref;

View File

@ -614,10 +614,6 @@ int ff_dxva2_common_frame_params(AVCodecContext *avctx,
else
num_surfaces += 2;
/* add extra surfaces for frame threading */
if (avctx->active_thread_type & FF_THREAD_FRAME)
num_surfaces += avctx->thread_count;
frames_ctx->sw_format = avctx->sw_pix_fmt == AV_PIX_FMT_YUV420P10 ?
AV_PIX_FMT_P010 : AV_PIX_FMT_NV12;
frames_ctx->width = FFALIGN(avctx->coded_width, surface_alignment);