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

Hendrik Leppkes h.leppkes at gmail.com
Sun Feb 4 17:35:52 EET 2018


On Sun, Feb 4, 2018 at 2:47 PM, Michael Niedermayer
<michael at niedermayer.cc> wrote:
> 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

Any changes to the table and the change to making it static should
really be separate changes though.

- Hendrik


More information about the ffmpeg-devel mailing list