[FFmpeg-devel] [PATCH 7/7] lavc/libopenh264enc: separate svc_encode_init() into several functions

Fu, Linjie linjie.fu at intel.com
Tue Mar 31 18:58:58 EEST 2020


> From: ffmpeg-devel <ffmpeg-devel-bounces at ffmpeg.org> On Behalf Of
> James Almer
> Sent: Tuesday, March 31, 2020 23:46
> To: ffmpeg-devel at ffmpeg.org
> Subject: Re: [FFmpeg-devel] [PATCH 7/7] lavc/libopenh264enc: separate
> svc_encode_init() into several functions
> 
> On 3/31/2020 12:33 PM, Linjie Fu wrote:
> > Separate the initialization procedure into different functions.
> >
> > Make it more readable and easier to be extended.
> >
> > Signed-off-by: Linjie Fu <linjie.fu at intel.com>
> > ---
> >  libavcodec/libopenh264enc.c | 302 +++++++++++++++++++++++++++-----
> ------------
> >  1 file changed, 186 insertions(+), 116 deletions(-)
> >
> > diff --git a/libavcodec/libopenh264enc.c b/libavcodec/libopenh264enc.c
> > index 692aba9..ab54454 100644
> > --- a/libavcodec/libopenh264enc.c
> > +++ b/libavcodec/libopenh264enc.c
> > @@ -85,6 +85,11 @@ static const AVOption options[] = {
> >      { NULL }
> >  };
> >
> > +static av_cold int svc_encode_init_profile(AVCodecContext *avctx,
> SEncParamExt *param);
> > +static av_cold int svc_encode_init_rate_control(AVCodecContext *avctx,
> SEncParamExt *param);
> > +static av_cold int svc_encode_init_spatial_layer(AVCodecContext *avctx,
> SEncParamExt *param);
> > +static av_cold int svc_encode_init_params(AVCodecContext *avctx,
> SEncParamExt *param);
> 
> Why use forward declarations? Just put the functions right above
> svc_encode_init().

It's seems to be easier/clearer for review the diffs, otherwise this would be mixed
up.

- Linjie


More information about the ffmpeg-devel mailing list