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

James Almer jamrial at gmail.com
Tue Mar 31 18:46:21 EEST 2020


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().


More information about the ffmpeg-devel mailing list