On Sun, Feb 04, 2018 at 05:51:13AM +0700, Muhammad Faiz wrote: > Precalculate and constify ff_square_tab. > > Signed-off-by: Muhammad Faiz <mfc...@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
signature.asc
Description: PGP signature
_______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel