[x265] [PATCH] slicetype: added x265_median_mv
Steve Borho
steve at borho.org
Mon Aug 12 07:17:33 CEST 2013
On Sun, Aug 11, 2013 at 11:45 PM, <gopu at multicorewareinc.com> wrote:
> # HG changeset patch
> # User ggopu
> # Date 1376282472 25200
> # Node ID 824d394ce8da4fc41aef7d4721ac0e3b06442f9a
> # Parent 4085c992877ae1f1269807cb16543baf947df04d
> slicetype: added x265_median_mv
>
pushed, thanks
>
> diff -r 4085c992877a -r 824d394ce8da source/encoder/slicetype.cpp
> --- a/source/encoder/slicetype.cpp Sun Aug 11 22:56:50 2013 +0530
> +++ b/source/encoder/slicetype.cpp Sun Aug 11 21:41:12 2013 -0700
> @@ -76,6 +76,22 @@
> int estimateCUCost(int cux, int cuy, int p0, int p1, int b, int
> do_search[2]);
> };
>
> +static inline int16_t x265_median( int16_t a, int16_t b, int16_t c )
> +{
> + int16_t t = (a-b)&((a-b)>>31);
> + a -= t;
> + b += t;
> + b -= (b-c)&((b-c)>>31);
> + b += (a-b)&((a-b)>>31);
> + return b;
> +}
> +
> +static inline void x265_median_mv( MV &dst, MV a, MV b, MV c )
> +{
> + dst.x = x265_median( a.x, b.x, c.x );
> + dst.y = x265_median( a.y, b.y, c.y );
> +}
> +
> int Lookahead::estimateFrameCost(int p0, int p1, int b, int bIntraPenalty)
> {
> int score = 0;
> @@ -183,8 +199,7 @@
> mvp = mvc[0];
> else
> {
> - //TODO x265_median_mv(mvp, mvc[0], mvc[1], mvc[2])
> - ;
> + x265_median_mv(mvp, mvc[0], mvc[1], mvc[2]);
> }
>
> *fenc_costs[i] = me.motionEstimate(i ? fref1 : fref0, mvmin,
> mvmax, mvp, numc, mvc, merange, *fenc_mvs[i]);
> _______________________________________________
> x265-devel mailing list
> x265-devel at videolan.org
> http://mailman.videolan.org/listinfo/x265-devel
>
--
Steve Borho
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/private/x265-devel/attachments/20130812/7f8bb654/attachment.html>
More information about the x265-devel
mailing list