diff mbox series

[FFmpeg-devel,v6,4/5] lavc/libopenh264enc: prompt slice number changing inside libopenh264

Message ID 1588129250-30726-4-git-send-email-linjie.fu@intel.com
State Accepted
Headers show
Series [FFmpeg-devel,v6,1/5] lavc/libopenh264enc: Add qmin/qmax support
Related show

Checks

Context Check Description
andriy/default pending
andriy/make success Make finished
andriy/make_fate success Make fate finished

Commit Message

Fu, Linjie April 29, 2020, 3 a.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 | 2 ++
 1 file changed, 2 insertions(+)

Comments

Martin Storsjö April 29, 2020, 8:54 a.m. UTC | #1
On Wed, 29 Apr 2020, Linjie Fu wrote:

> 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 | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/libavcodec/libopenh264enc.c b/libavcodec/libopenh264enc.c
> index dc3bd53..29269f9 100644
> --- a/libavcodec/libopenh264enc.c
> +++ b/libavcodec/libopenh264enc.c
> @@ -244,6 +244,8 @@ FF_ENABLE_DEPRECATION_WARNINGS
>     param.sSpatialLayers[0].sSliceCfg.uiSliceMode               = s->slice_mode;
>     param.sSpatialLayers[0].sSliceCfg.sSliceArgument.uiSliceNum = avctx->slices;
> #endif
> +    if (avctx->slices == 0 && s->slice_mode == SM_FIXEDSLCNUM_SLICE)
> +        av_log(avctx, AV_LOG_WARNING, "Slice count will be set automatically\n");
>
>     if (s->slice_mode == SM_SIZELIMITED_SLICE) {
>         if (s->max_nal_size) {
> -- 
> 2.7.4

LGTM

// Martin
diff mbox series

Patch

diff --git a/libavcodec/libopenh264enc.c b/libavcodec/libopenh264enc.c
index dc3bd53..29269f9 100644
--- a/libavcodec/libopenh264enc.c
+++ b/libavcodec/libopenh264enc.c
@@ -244,6 +244,8 @@  FF_ENABLE_DEPRECATION_WARNINGS
     param.sSpatialLayers[0].sSliceCfg.uiSliceMode               = s->slice_mode;
     param.sSpatialLayers[0].sSliceCfg.sSliceArgument.uiSliceNum = avctx->slices;
 #endif
+    if (avctx->slices == 0 && s->slice_mode == SM_FIXEDSLCNUM_SLICE)
+        av_log(avctx, AV_LOG_WARNING, "Slice count will be set automatically\n");
 
     if (s->slice_mode == SM_SIZELIMITED_SLICE) {
         if (s->max_nal_size) {