[x265] [PATCH] motion: skip ME search if any of mvc sad cost iszero

Steve Borho steve at borho.org
Tue Jun 30 18:48:57 CEST 2015


On 06/30, gopu at multicorewareinc.com wrote:
> # HG changeset patch
> # User Gopu Govindaswamy <gopu at multicorewareinc.com>
> # Date 1435654760 -19800
> #      Tue Jun 30 14:29:20 2015 +0530
> # Node ID 0ef6f4e9d38f31d8f831f1f0b9f4321060c50072
> # Parent  483c85f83f076732d8d196286218bbe7112c1c2c
> motion: skip ME search if any of mvc sad cost iszero
> 
> this is an output changing commit and effects on the performance and quality
> are below and the output not changing the many of the clips, output changed only
> for animation clips

most of the fps changes are within the noise tolerance, and it seems the
majority are a perf loss. it's not clear that this is a win.

> preset    clip                          fps     bitrate psnr    ssim
> -----------------------------------------------------------------------
> veryslow  ducks_take_off_420_720p50.y4m	1.42	6022.29	30.715	0.867116
> slow      ducks_take_off_420_720p50.y4m	7.88	6038.35	30.639	0.864627
> medium    ducks_take_off_420_720p50.y4m	25.67	6030.1	30.299	0.854118
> veryfast  ducks_take_off_420_720p50.y4m	47.55	5974.51	29.951	0.840581
> ultrafast ducks_take_off_420_720p50.y4m	94.23	6051.15	30.003	0.837419
> 
> veryslow  ParkScene_1920x1080_24.y4m	0.66	5616.22	40.114	0.952311
> slow      ParkScene_1920x1080_24.y4m	4.44	5609.29	39.729	0.949371
> medium    ParkScene_1920x1080_24.y4m	13.02	5602.15	39.325	0.945948
> veryfast  ParkScene_1920x1080_24.y4m	24.76	5818.85	38.76	0.941318
> ultrafast ParkScene_1920x1080_24.y4m	47.85	5823.47	38.142	0.929729
> 
> veryslow  crowd_run_1080p50.y4m	        0.72	5929.62	30.622	0.812728
> slow      crowd_run_1080p50.y4m	        4.32	5933.85	30.274	0.802236
> medium    crowd_run_1080p50.y4m	        13.54	5935.61	29.93	0.79162
> veryfast  crowd_run_1080p50.y4m	        25.28	6046.02	29.299	0.765605
> ultrafast crowd_run_1080p50.y4m	        44.94	6028.35	29.004	0.743116
> 
> veryslow  big_buck_bunny_360p24_2.y4m	1.57	7140.71	62.736	0.999442
> slow      big_buck_bunny_360p24_2.y4m	10.48	7192.88	61.439	0.999278
> medium    big_buck_bunny_360p24_2.y4m	31.46	7339.4	60.11	0.999082
> veryfast  big_buck_bunny_360p24_2.y4m	94.43	7277.49	59.119	0.998966
> ultrafast big_buck_bunny_360p24_2.y4m	200.4	7202.79	57.864	0.998493
> 
> veryslow  sintel_trailer_2k_480p24.y4m	1.18	7546.32	66.034	0.998991
> slow      sintel_trailer_2k_480p24.y4m	6.56	7567.34	64.141	0.998634
> medium    sintel_trailer_2k_480p24.y4m	26.85	7647.86	63.023	0.998453
> veryfast  sintel_trailer_2k_480p24.y4m	57.52	8158.63	62.861	0.998296
> ultrafast sintel_trailer_2k_480p24.y4m	120.99	6247.39	60.81	0.997574
> 
> After the code change
> --------------------------
> 
> veryslow  ducks_take_off_420_720p50.y4m	1.39	6022.29	30.715	0.867116
> slow      ducks_take_off_420_720p50.y4m	7.84	6038.35	30.639	0.864627
> medium    ducks_take_off_420_720p50.y4m	25.8	6030.1	30.299	0.854118
> veryfast  ducks_take_off_420_720p50.y4m	48.09	5974.51	29.951	0.840581
> ultrafast ducks_take_off_420_720p50.y4m	96.04	6051.15	30.003	0.837419
> 
> veryslow  ParkScene_1920x1080_24.y4m	0.66	5616.22	40.114	0.952311
> slow      ParkScene_1920x1080_24.y4m	4.42	5609.29	39.729	0.949371
> medium    ParkScene_1920x1080_24.y4m	13	5602.15	39.325	0.945948
> veryfast  ParkScene_1920x1080_24.y4m	24.84	5818.85	38.76	0.941318
> ultrafast ParkScene_1920x1080_24.y4m	44.52	5823.47	38.142	0.929729
> 
> veryslow  crowd_run_1080p50.y4m	        0.73	5929.62	30.622	0.812728
> slow      crowd_run_1080p50.y4m	        4.3	5933.85	30.274	0.802236
> medium    crowd_run_1080p50.y4m	        13.75	5935.61	29.93	0.79162
> veryfast  crowd_run_1080p50.y4m	        25.28	6046.02	29.299	0.765605
> ultrafast crowd_run_1080p50.y4m	        43.97	6028.35	29.004	0.743116
> 
> veryslow  big_buck_bunny_360p24_2.y4m	1.56	7141.57	62.735	0.999442
> slow      big_buck_bunny_360p24_2.y4m	10.56	7193.6	61.438	0.999278
> medium    big_buck_bunny_360p24_2.y4m	33.68	7340.76	60.103	0.999078
> veryfast  big_buck_bunny_360p24_2.y4m	95.28	7278.47	59.12	0.998965
> ultrafast big_buck_bunny_360p24_2.y4m	202.43	7202.73	57.864	0.998493
> 
> veryslow  sintel_trailer_2k_480p24.y4m	1.21	7547.26	65.998	0.998989
> slow      sintel_trailer_2k_480p24.y4m	6.58	7567.07	64.115	0.998633
> medium    sintel_trailer_2k_480p24.y4m	26.8	7649.54	63.009	0.998454
> veryfast  sintel_trailer_2k_480p24.y4m	57.47	8158.09	62.862	0.998297
> ultrafast sintel_trailer_2k_480p24.y4m	121.14	6247.54	60.81	0.997574
> 
> diff -r 483c85f83f07 -r 0ef6f4e9d38f source/encoder/motion.cpp
> --- a/source/encoder/motion.cpp	Mon Jun 29 12:18:38 2015 -0700
> +++ b/source/encoder/motion.cpp	Tue Jun 30 14:29:20 2015 +0530
> @@ -646,7 +646,17 @@
>          MV m = mvc[i].clipped(qmvmin, qmvmax);
>          if (m.notZero() && m != pmv && m != bestpre) // check already measured
>          {
> -            int cost = subpelCompare(ref, m, sad) + mvcost(m);
> +            int cost = subpelCompare(ref, m, sad);
> +            // skip ME Search if any of MVC sad cost is zero
> +            if (!cost)
> +            {
> +                x265_emms();
> +                outQMv = m;
> +                return mvcost(m);
> +            }
> +            else
> +                cost += mvcost(m);
> +
>              if (cost < bprecost)
>              {
>                  bprecost = cost;
> _______________________________________________
> x265-devel mailing list
> x265-devel at videolan.org
> https://mailman.videolan.org/listinfo/x265-devel

-- 
Steve Borho


More information about the x265-devel mailing list