Skip some mode SAD calculation in non-RD mode
Skip some mode SAD calculation in non-RD mode

This commit checks if the motion vector associated with the current
mode has been computed in previous mode tests. If possible, skip the
redundant reference block generation and SAD calculation in the
non-RD mode decision process.

For test sequence pedestrian_area 1080p, the runtime goes from
24261 ms to 23770 ms. This does not change compression performance.
The speed-up is mostly around places with consistent motion.

Change-Id: I97be63c6a2d07c57be26b3c600fbda3803adddda

iniwf/webm.libvpx,shacklettbp/aom,running770/libvpx,jdm/libvpx,Maria1099/webm.libvpx,hsueceumd/test_hui,matanbs/vp982,gshORTON/webm.libvpx,mwgoldsmith/vpx,n4t/libvpx,smarter/aom,goodleixiao/vpx,matanbs/webm.libvpx,lyx2014/libvpx_c,charup/https---github.com-webmproject-libvpx-,kalli123/webm.libvpx,Distrotech/libvpx,mwgoldsmith/vpx,openpeer/libvpx_new,lyx2014/libvpx_c,thdav/aom,goodleixiao/vpx,jdm/libvpx,matanbs/webm.libvpx,matanbs/vp982,matanbs/webm.libvpx,Suvarna1488/webm.libvpx,n4t/libvpx,thdav/aom,iniwf/webm.libvpx,GrokImageCompression/aom,shacklettbp/aom,mwgoldsmith/libvpx,kleopatra999/webm.libvpx,gshORTON/webm.libvpx,stewnorriss/libvpx,smarter/aom,Laknot/libvpx,kim42083/webm.libvpx,abwiz0086/webm.libvpx,jmvalin/aom,mwgoldsmith/vpx,luctrudeau/aom,shyamalschandra/libvpx,kleopatra999/webm.libvpx,lyx2014/libvpx_c,ittiamvpx/libvpx,ShiftMediaProject/libvpx,abwiz0086/webm.libvpx,Maria1099/webm.libvpx,ittiamvpx/libvpx,Suvarna1488/webm.libvpx,charup/https---github.com-webmproject-libvpx-,WebRTC-Labs/libvpx,matanbs/webm.libvpx,matanbs/vp982,mwgoldsmith/libvpx,altogother/webm.libvpx,openpeer/libvpx_new,Suvarna1488/webm.libvpx,felipebetancur/libvpx,abwiz0086/webm.libvpx,Acidburn0zzz/webm.libvpx,ittiamvpx/libvpx,kim42083/webm.libvpx,openpeer/libvpx_new,jacklicn/webm.libvpx,Acidburn0zzz/webm.libvpx,mbebenita/aom,altogother/webm.libvpx,ittiamvpx/libvpx,shacklettbp/aom,liqianggao/libvpx,felipebetancur/libvpx,running770/libvpx,charup/https---github.com-webmproject-libvpx-,kalli123/webm.libvpx,mbebenita/aom,felipebetancur/libvpx,jmvalin/aom,smarter/aom,pcwalton/libvpx,smarter/aom,liqianggao/libvpx,ittiamvpx/libvpx,VTCSecureLLC/libvpx,mbebenita/aom,WebRTC-Labs/libvpx,mwgoldsmith/vpx,VTCSecureLLC/libvpx,luctrudeau/aom,Laknot/libvpx,felipebetancur/libvpx,zofuthan/libvpx,Topopiccione/libvpx,reimaginemedia/webm.libvpx,reimaginemedia/webm.libvpx,mbebenita/aom,ShiftMediaProject/libvpx,GrokImageCompression/aom,jmvalin/aom,gshORTON/webm.libvpx,luctrudeau/aom,kleopatra999/webm.libvpx,shacklettbp/aom,pcwalton/libvpx,running770/libvpx,shyamalschandra/libvpx,WebRTC-Labs/libvpx,luctrudeau/aom,shacklettbp/aom,pcwalton/libvpx,stewnorriss/libvpx,iniwf/webm.libvpx,GrokImageCompression/aom,Distrotech/libvpx,jacklicn/webm.libvpx,hsueceumd/test_hui,webmproject/libvpx,thdav/aom,gshORTON/webm.libvpx,WebRTC-Labs/libvpx,webmproject/libvpx,altogother/webm.libvpx,charup/https---github.com-webmproject-libvpx-,kalli123/webm.libvpx,Acidburn0zzz/webm.libvpx,Maria1099/webm.libvpx,Laknot/libvpx,VTCSecureLLC/libvpx,Topopiccione/libvpx,shareefalis/libvpx,webmproject/libvpx,shyamalschandra/libvpx,felipebetancur/libvpx,stewnorriss/libvpx,altogother/webm.libvpx,smarter/aom,kim42083/webm.libvpx,openpeer/libvpx_new,ittiamvpx/libvpx,mbebenita/aom,matanbs/vp982,mbebenita/aom,smarter/aom,kalli123/webm.libvpx,Topopiccione/libvpx,ittiamvpx/libvpx-1,thdav/aom,iniwf/webm.libvpx,thdav/aom,jacklicn/webm.libvpx,ittiamvpx/libvpx-1,hsueceumd/test_hui,goodleixiao/vpx,lyx2014/libvpx_c,pcwalton/libvpx,mwgoldsmith/libvpx,Laknot/libvpx,VTCSecureLLC/libvpx,kim42083/webm.libvpx,shyamalschandra/libvpx,reimaginemedia/webm.libvpx,shareefalis/libvpx,running770/libvpx,n4t/libvpx,zofuthan/libvpx,ittiamvpx/libvpx-1,ShiftMediaProject/libvpx,mbebenita/aom,jacklicn/webm.libvpx,abwiz0086/webm.libvpx,ittiamvpx/libvpx-1,liqianggao/libvpx,pcwalton/libvpx,running770/libvpx,kim42083/webm.libvpx,Maria1099/webm.libvpx,matanbs/webm.libvpx,zofuthan/libvpx,Acidburn0zzz/webm.libvpx,Suvarna1488/webm.libvpx,luctrudeau/aom,reimaginemedia/webm.libvpx,jacklicn/webm.libvpx,Suvarna1488/webm.libvpx,jdm/libvpx,Laknot/libvpx,webmproject/libvpx,shyamalschandra/libvpx,altogother/webm.libvpx,lyx2014/libvpx_c,matanbs/webm.libvpx,altogother/webm.libvpx,liqianggao/libvpx,GrokImageCompression/aom,stewnorriss/libvpx,matanbs/vp982,kim42083/webm.libvpx,jdm/libvpx,VTCSecureLLC/libvpx,charup/https---github.com-webmproject-libvpx-,gshORTON/webm.libvpx,shareefalis/libvpx,goodleixiao/vpx,zofuthan/libvpx,Topopiccione/libvpx,stewnorriss/libvpx,stewnorriss/libvpx,kleopatra999/webm.libvpx,hsueceumd/test_hui,openpeer/libvpx_new,kleopatra999/webm.libvpx,GrokImageCompression/aom,webmproject/libvpx,GrokImageCompression/aom,VTCSecureLLC/libvpx,liqianggao/libvpx,matanbs/vp982,Suvarna1488/webm.libvpx,mwgoldsmith/vpx,goodleixiao/vpx,jmvalin/aom,Distrotech/libvpx,Topopiccione/libvpx,Acidburn0zzz/webm.libvpx,hsueceumd/test_hui,felipebetancur/libvpx,Acidburn0zzz/webm.libvpx,shacklettbp/aom,iniwf/webm.libvpx,shareefalis/libvpx,mwgoldsmith/vpx,n4t/libvpx,jacklicn/webm.libvpx,jdm/libvpx,Distrotech/libvpx,reimaginemedia/webm.libvpx,Topopiccione/libvpx,ittiamvpx/libvpx-1,Laknot/libvpx,openpeer/libvpx_new,zofuthan/libvpx,mbebenita/aom,mwgoldsmith/libvpx,shareefalis/libvpx,Maria1099/webm.libvpx,thdav/aom,kalli123/webm.libvpx,jmvalin/aom,lyx2014/libvpx_c,luctrudeau/aom,reimaginemedia/webm.libvpx,mbebenita/aom,ShiftMediaProject/libvpx,ShiftMediaProject/libvpx,jmvalin/aom,liqianggao/libvpx,zofuthan/libvpx,abwiz0086/webm.libvpx,n4t/libvpx,running770/libvpx,WebRTC-Labs/libvpx,webmproject/libvpx,mwgoldsmith/libvpx,charup/https---github.com-webmproject-libvpx-,Distrotech/libvpx,Distrotech/libvpx,mwgoldsmith/libvpx,shareefalis/libvpx,Maria1099/webm.libvpx,pcwalton/libvpx,jdm/libvpx,hsueceumd/test_hui,goodleixiao/vpx,gshORTON/webm.libvpx,iniwf/webm.libvpx,kalli123/webm.libvpx,ittiamvpx/libvpx-1,matanbs/vp982,shyamalschandra/libvpx,kleopatra999/webm.libvpx,abwiz0086/webm.libvpx