[FFmpeg-devel] [FFmpeg-cvslog] avcodec/hevcdsp: optimize pixel comparison in sao_edge_filter

Clément Bœsch u at pkh.me
Mon Feb 16 22:46:57 CET 2015


On Mon, Feb 16, 2015 at 09:48:25PM +0100, James Almer wrote:
> ffmpeg | branch: master | James Almer <jamrial at gmail.com> | Mon Feb 16 16:53:31 2015 -0300| [22596383f3b8c7cd8a06570957face3875a73d3b] | committer: James Almer
> 
> avcodec/hevcdsp: optimize pixel comparison in sao_edge_filter
> 
> GCC 4.9.2 on a Core i5-4200U @ 1.60GHz, Linux x86_64
> 
> Before
> 715487 decicycles in sao_edge_filter_8, 262144 runs, 0 skips
> 
> After
> 672104 decicycles in sao_edge_filter_8, 262144 runs, 0 skips
> 
> Reviewed-by: Michael Niedermayer <michaelni at gmx.at>
> Signed-off-by: James Almer <jamrial at gmail.com>
> 
> > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=22596383f3b8c7cd8a06570957face3875a73d3b
> ---
> 
>  libavcodec/hevcdsp_template.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/libavcodec/hevcdsp_template.c b/libavcodec/hevcdsp_template.c
> index 9ce7bf2..aeb142c 100644
> --- a/libavcodec/hevcdsp_template.c
> +++ b/libavcodec/hevcdsp_template.c
> @@ -325,7 +325,7 @@ static void FUNC(sao_band_filter_0)(uint8_t *_dst, uint8_t *_src,
>      }
>  }
>  
> -#define CMP(a, b) ((a) > (b) ? 1 : ((a) == (b) ? 0 : -1))
> +#define CMP(a, b) ((a > b) - (a < b))
>  

You probably want to keep a and b protected.

-- 
Clément B.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 473 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20150216/ffdd3de6/attachment.asc>


More information about the ffmpeg-devel mailing list