[FFmpeg-devel] [PATCH 5/5] avcodec/vc1_mc: move median4() to mathops.h
Michael Niedermayer
michaelni at gmx.at
Mon Feb 16 11:42:04 CET 2015
On Sat, Feb 14, 2015 at 11:38:40PM +0800, zhaoxiu.zeng wrote:
> 在 2015/2/14 23:18, Paul B Mahol 写道:
> > On 2/14/15, zhaoxiu.zeng <zhaoxiu.zeng at gmail.com> wrote:
> >> From 2f68090470ce1f4eb738e7a4af80c78a7b5d461a Mon Sep 17 00:00:00 2001
> >> From: Zeng Zhaoxiu <zhaoxiu.zeng at gmail.com>
> >> Date: Sat, 14 Feb 2015 21:11:18 +0800
> >> Subject: [PATCH 5/5] avcodec/vc1_mc: move median4() to mathops.h
> >>
> >> ---
> >> libavcodec/mathops.h | 14 ++++++++++++++
> >> libavcodec/vc1_mc.c | 11 -----------
> >> 2 files changed, 14 insertions(+), 11 deletions(-)
> >>
> >> diff --git a/libavcodec/mathops.h b/libavcodec/mathops.h
> >> index 87fca0c..87d110b 100644
> >> --- a/libavcodec/mathops.h
> >> +++ b/libavcodec/mathops.h
> >> @@ -121,6 +121,20 @@ static inline av_const int mid_pred(int a, int b, int
> >> c)
> >> }
> >> #endif
> >>
> >> +#ifndef median4
> >> +#define median4 median4
> >> +static inline av_const int median4(int a, int b, int c, int d)
> >> +{
> >> + if (a < b) {
> >> + if (c < d) return (FFMIN(b, d) + FFMAX(a, c)) / 2;
> >> + else return (FFMIN(b, c) + FFMAX(a, d)) / 2;
> >> + } else {
> >> + if (c < d) return (FFMIN(a, d) + FFMAX(b, c)) / 2;
> >> + else return (FFMIN(a, c) + FFMAX(b, d)) / 2;
> >> + }
> >> +}
> >> +#endif
> >> +
> >> #ifndef sign_extend
> >> static inline av_const int sign_extend(int val, unsigned bits)
> >> {
> >> diff --git a/libavcodec/vc1_mc.c b/libavcodec/vc1_mc.c
> >> index 15840fa..74f34a3 100644
> >> --- a/libavcodec/vc1_mc.c
> >> +++ b/libavcodec/vc1_mc.c
> >> @@ -279,17 +279,6 @@ void ff_vc1_mc_1mv(VC1Context *v, int dir)
> >> }
> >> }
> >>
> >> -static inline int median4(int a, int b, int c, int d)
> >> -{
> >> - if (a < b) {
> >> - if (c < d) return (FFMIN(b, d) + FFMAX(a, c)) / 2;
> >> - else return (FFMIN(b, c) + FFMAX(a, d)) / 2;
> >> - } else {
> >> - if (c < d) return (FFMIN(a, d) + FFMAX(b, c)) / 2;
> >> - else return (FFMIN(a, c) + FFMAX(b, d)) / 2;
> >> - }
> >> -}
> >> -
> >> /** Do motion compensation for 4-MV macroblock - luminance block
> >> */
> >> void ff_vc1_mc_4mv_luma(VC1Context *v, int n, int dir, int avg)
> >> --
> >> 2.1.0
> >>
> >> _______________________________________________
> >> ffmpeg-devel mailing list
> >> ffmpeg-devel at ffmpeg.org
> >> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> >>
> >
> > why?
>
> We may provide the architecture related optimization.
patch applied
thanks
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
Observe your enemies, for they first find out your faults. -- Antisthenes
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20150216/1ed40fb9/attachment.asc>
More information about the ffmpeg-devel
mailing list