diff mbox series

[FFmpeg-devel,06/10] lavc/libopenh264enc: set slice_mode option to deprecated

Message ID 1586171693-7836-7-git-send-email-linjie.fu@intel.com
State Superseded
Headers show
Series Patch set for the enhancement of libopenh264 encoder | expand

Checks

Context Check Description
andriy/ffmpeg-patchwork success Make fate finished

Commit Message

Fu, Linjie April 6, 2020, 11:14 a.m. UTC
"slice mode" seems to be unnecessary since it could be determined by
-slices/max_nal_size.

default:        SM_FIXEDSLCNUM_SLICE mode with cpu-number slices.
-slices N:      SM_FIXEDSLCNUM_SLICE mode with N slices.
-max_nal_size:  SM_SIZELIMITED_SLICE mode with limited size slices.

This could be removed later.

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

Comments

Anton Khirnov April 10, 2020, 10:27 a.m. UTC | #1
Quoting Linjie Fu (2020-04-06 13:14:49)
> "slice mode" seems to be unnecessary since it could be determined by
> -slices/max_nal_size.
> 
> default:        SM_FIXEDSLCNUM_SLICE mode with cpu-number slices.
> -slices N:      SM_FIXEDSLCNUM_SLICE mode with N slices.
> -max_nal_size:  SM_SIZELIMITED_SLICE mode with limited size slices.
> 
> This could be removed later.
> 
> Signed-off-by: Linjie Fu <linjie.fu@intel.com>
> ---

I'd say also schedule it for removal with new FF_API_ macros, otherwise
deprecated things tend to stay around for way too long.
Fu, Linjie April 10, 2020, 2:32 p.m. UTC | #2
> From: ffmpeg-devel <ffmpeg-devel-bounces@ffmpeg.org> On Behalf Of
> Anton Khirnov
> Sent: Friday, April 10, 2020 18:28
> To: FFmpeg development discussions and patches <ffmpeg-
> devel@ffmpeg.org>
> Subject: Re: [FFmpeg-devel] [PATCH 06/10] lavc/libopenh264enc: set
> slice_mode option to deprecated
> 
> Quoting Linjie Fu (2020-04-06 13:14:49)
> > "slice mode" seems to be unnecessary since it could be determined by
> > -slices/max_nal_size.
> >
> > default:        SM_FIXEDSLCNUM_SLICE mode with cpu-number slices.
> > -slices N:      SM_FIXEDSLCNUM_SLICE mode with N slices.
> > -max_nal_size:  SM_SIZELIMITED_SLICE mode with limited size slices.
> >
> > This could be removed later.
> >
> > Signed-off-by: Linjie Fu <linjie.fu@intel.com>
> > ---
> 
> I'd say also schedule it for removal with new FF_API_ macros, otherwise
> deprecated things tend to stay around for way too long.
> 
Good idea, added OPENH264_API_SLICE_MODE macros to remove this
Options after LIBAVCODEC_VERSION_MAJOR = 59.

Thanks for the suggestion.

- Linjie
diff mbox series

Patch

diff --git a/libavcodec/libopenh264enc.c b/libavcodec/libopenh264enc.c
index 01a85fb..e89cedf 100644
--- a/libavcodec/libopenh264enc.c
+++ b/libavcodec/libopenh264enc.c
@@ -40,7 +40,7 @@ 
 typedef struct SVCContext {
     const AVClass *av_class;
     ISVCEncoder *encoder;
-    int slice_mode;
+    int slice_mode;                 // deprecated
     int loopfilter;
     char *profile;
     int max_nal_size;
@@ -54,11 +54,12 @@  typedef struct SVCContext {
 
 #define OFFSET(x) offsetof(SVCContext, x)
 #define VE AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM
+#define DEPRECATED AV_OPT_FLAG_DEPRECATED
 static const AVOption options[] = {
 #if OPENH264_VER_AT_LEAST(1, 6)
-    { "slice_mode", "set slice mode", OFFSET(slice_mode), AV_OPT_TYPE_INT, { .i64 = SM_FIXEDSLCNUM_SLICE }, SM_SINGLE_SLICE, SM_RESERVED, VE, "slice_mode" },
+    { "slice_mode", "set slice mode, use slices/max_nal_size", OFFSET(slice_mode), AV_OPT_TYPE_INT, { .i64 = SM_FIXEDSLCNUM_SLICE }, SM_SINGLE_SLICE, SM_RESERVED, VE|DEPRECATED, "slice_mode" },
 #else
-    { "slice_mode", "set slice mode", OFFSET(slice_mode), AV_OPT_TYPE_INT, { .i64 = SM_AUTO_SLICE }, SM_SINGLE_SLICE, SM_RESERVED, VE, "slice_mode" },
+    { "slice_mode", "set slice mode, use slices/max_nal_size", OFFSET(slice_mode), AV_OPT_TYPE_INT, { .i64 = SM_AUTO_SLICE }, SM_SINGLE_SLICE, SM_RESERVED, VE|DEPRECATED, "slice_mode" },
 #endif
         { "fixed", "a fixed number of slices", 0, AV_OPT_TYPE_CONST, { .i64 = SM_FIXEDSLCNUM_SLICE }, 0, 0, VE, "slice_mode" },
 #if OPENH264_VER_AT_LEAST(1, 6)