diff mbox series

[FFmpeg-devel,5/7] lavc/libopenh264enc: prompt slice number changing according to cpus

Message ID 1585668770-29906-1-git-send-email-linjie.fu@intel.com
State Superseded
Headers show
Series [FFmpeg-devel,1/7] lavc/libopenh264enc: Add default qmin/qmax support
Related show


Context Check Description
andriy/ffmpeg-patchwork pending
andriy/ffmpeg-patchwork success Applied patch
andriy/ffmpeg-patchwork success Configure finished
andriy/ffmpeg-patchwork success Make finished
andriy/ffmpeg-patchwork success Make fate finished

Commit Message

Fu, Linjie March 31, 2020, 3:32 p.m. UTC
Libopenh264enc would set the slice according to the number of cpu cores
if uiSliceNum equals to 0 (auto) in SM_FIXEDSLCNUM_SLICE mode.

Prompt a warning for user to catch this.

Signed-off-by: Linjie Fu <linjie.fu@intel.com>
 libavcodec/libopenh264enc.c | 3 +++
 1 file changed, 3 insertions(+)
diff mbox series


diff --git a/libavcodec/libopenh264enc.c b/libavcodec/libopenh264enc.c
index 56703a4..019093c 100644
--- a/libavcodec/libopenh264enc.c
+++ b/libavcodec/libopenh264enc.c
     param.sSpatialLayers[0].sSliceCfg.uiSliceMode               = s->slice_mode;
     param.sSpatialLayers[0].sSliceCfg.sSliceArgument.uiSliceNum = avctx->slices;
+    if (avctx->slices == 0 && s->slice_mode == SM_FIXEDSLCNUM_SLICE)
+        av_log(avctx, AV_LOG_WARNING, "Auto slice number, "
+               "default to use the number of CPU cores: %d\n", av_cpu_count());
     if (s->slice_mode == SM_SIZELIMITED_SLICE) {
         if (s->max_nal_size) {