[FFmpeg-devel] [PATCH v1 5/5] avcodec/v210enc: define DEFINE_V210_ENCODE_FUNC to remove duplicate code

Michael Niedermayer michael at niedermayer.cc
Fri Aug 30 21:11:17 EEST 2019


On Wed, Aug 28, 2019 at 11:45:16PM +0800, lance.lmwang at gmail.com wrote:
> From: Limin Wang <lance.lmwang at gmail.com>
> 
> Signed-off-by: Limin Wang <lance.lmwang at gmail.com>
> ---
>  libavcodec/v210enc.c | 171 +++++++++++++++++++++------------------------------
>  1 file changed, 69 insertions(+), 102 deletions(-)
> 
> diff --git a/libavcodec/v210enc.c b/libavcodec/v210enc.c
> index 2400538..b40c7ae 100644
> --- a/libavcodec/v210enc.c
> +++ b/libavcodec/v210enc.c
> @@ -89,15 +89,77 @@ FF_ENABLE_DEPRECATION_WARNINGS
>      return 0;
>  }
>  
> +#define DEFINE_V210_ENCODE_FUNC(nbits, depth)                                 \
> +static void v210_enc_##depth(AVCodecContext *avctx,                           \
> +        uint8_t *dst, const AVFrame *pic)                                     \

puting this in a seperate file which is included twice would avoid
the rather large mutiline macro
also that would match how such functions for multiple depths are
handled in other codecs

thx

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

The smallest minority on earth is the individual. Those who deny 
individual rights cannot claim to be defenders of minorities. - Ayn Rand
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20190830/5d7b6642/attachment.sig>


More information about the ffmpeg-devel mailing list