[FFmpeg-devel] [PATCH] avcodec/me_cmp: remove ff_me_cmp_init_static()

Michael Niedermayer michael at niedermayer.cc
Sun Feb 4 15:47:21 EET 2018


On Sun, Feb 04, 2018 at 05:51:13AM +0700, Muhammad Faiz wrote:
> Precalculate and constify ff_square_tab.
> 
> Signed-off-by: Muhammad Faiz <mfcc64 at gmail.com>
> ---
>  libavcodec/me_cmp.c          | 51 +++++++++++++++++++++++++++++++++-----------
>  libavcodec/me_cmp.h          |  4 +---
>  libavcodec/mpegvideo_enc.c   |  2 +-
>  libavcodec/mpegvideoencdsp.c |  2 +-
>  libavcodec/snowenc.c         |  2 +-
>  libavcodec/utils.c           | 13 -----------
>  6 files changed, 43 insertions(+), 31 deletions(-)
> 
> diff --git a/libavcodec/me_cmp.c b/libavcodec/me_cmp.c
> index 5e34a11593..67a5bb5c71 100644
> --- a/libavcodec/me_cmp.c
> +++ b/libavcodec/me_cmp.c
> @@ -22,6 +22,7 @@
>  
>  #include "libavutil/attributes.h"
>  #include "libavutil/internal.h"
> +#include "libavutil/thread.h"
>  #include "avcodec.h"
>  #include "copy_block.h"
>  #include "simple_idct.h"
> @@ -29,13 +30,47 @@
>  #include "mpegvideo.h"
>  #include "config.h"
>  
> -uint32_t ff_square_tab[512] = { 0, };
> +/* (i - 256) * (i - 256) */
> +const uint32_t ff_square_tab[512] = {

Is the first element used ?
If not (and i suspect so) then uint16_t could be used

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

Observe your enemies, for they first find out your faults. -- Antisthenes
-------------- 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/20180204/6d5c914a/attachment.sig>


More information about the ffmpeg-devel mailing list