132 Commits

Author SHA1 Message Date
Angie Chiang
a2b56d3e05 Refactor: Localize tmp_rd in handle_inter_mode()
Change-Id: I01cb5cd544c849be160a9441d141c01a3424d32b
2016-10-25 17:34:59 -07:00
Angie Chiang
75c2209341 Simplify interpolation filter search in handle_inter_mode()
BDRate
ext_interp  lowres -0.001%
dual_filter lowres  0.001%

Change-Id: Ic24165d554c300eaa0188ee8cb88d320b74125aa
2016-10-25 17:10:08 -07:00
Jingning Han
a1730659ec Merge "Use table fetch for block width in block_rd_txfm" into nextgenv2 2016-10-25 22:18:44 +00:00
Jingning Han
e71ad1d4a2 Merge "Refactor dist_block() function" into nextgenv2 2016-10-25 19:39:22 +00:00
Jingning Han
c598cf853f Use table fetch for block width in block_rd_txfm
Make direct use of block_size_wide to fetch data for stride.

Change-Id: I0d8491e58cf00ea73c764d218cb56408b64d9ee7
2016-10-25 10:47:46 -07:00
Jingning Han
b9c572706d Refactor dist_block() function
Support automatic scale for mapping between transform block size
and pixel block size.

Change-Id: I141b0477a85c0dcc5f99b4e5d880cfccfae6d316
2016-10-25 10:22:17 -07:00
Angie Chiang
d0aa90ed79 Remove speed feature of ext_interp experiment
This is to facilitate the refactor process

Change-Id: I6faedb29129b47abefe20821dc3f32a43db149d8
2016-10-25 09:22:35 -07:00
Angie Chiang
1b131f1c64 Refactor: handle_inter()
Make the parenthesis symmetric
Replace interpolation filter mode number by macro

Change-Id: Ic6586114c4cebe920b950e1b3adc8ebc764d4713
2016-10-25 09:22:35 -07:00
Guillaume Martres
4e4d3a075b Avoid unnecessary reencode in choose_largest_tx_size
This change is similar to the one done for choose_tx_size_from_rd in
daf841b4a10ece1b6831300d79f271d00f9d027b

It gives a 4% speed-up on bus_cif.y4m with the following settings:
--cpu-used=4 -p 1 --end-usage=q --cq-level=40 --tile-columns=0 --tile-rows=0

Change-Id: Ic54fe4a066a2c0b5f6349d80cd13de8bb8ddcabc
2016-10-25 08:56:55 -07:00
Urvang Joshi
7bc1fa194d Merge changes I2153c57e,I0e291edd into nextgenv2
* changes:
  Palette: Generate encodings automatically from tree.
  Palette + Ext-Intra: shadowed declaration fix.
2016-10-25 01:06:28 +00:00
Jingning Han
8d6eaec1d7 Merge "Refactor av1_predict_intra_block tx_size interface" into nextgenv2 2016-10-24 22:23:40 +00:00
Urvang Joshi
626591dfa1 Palette + Ext-Intra: shadowed declaration fix.
This shadowed declaration warning was generated when both experiments
are on.

Change-Id: I0e291eddeefabd68c5c3a0e5f8ac87706a82d55a
2016-10-24 14:13:55 -07:00
Jingning Han
63632447ae Merge "Add MAX_VARTX_DEPTH macro" into nextgenv2 2016-10-24 21:01:29 +00:00
Yaowu Xu
23fb2feaa5 Merge "Avoid the use of uninitialized value in ActiveMap encoding route" into nextgenv2 2016-10-24 19:21:29 +00:00
Yaowu Xu
10d9627ffe Merge "Use the actual inter prediction filter buffer in DRL" into nextgenv2 2016-10-24 18:34:29 +00:00
Jingning Han
c4c99da925 Refactor av1_predict_intra_block tx_size interface
Simplify the input arguments. Make direct use of the block size
in the unit of pixels.

Change-Id: Ifec9d90b4b4fa9605f93b4f93b8242f76f898b5f
2016-10-24 11:06:23 -07:00
Jingning Han
571189c66d Add MAX_VARTX_DEPTH macro
Change-Id: I85532cf88f91f0f0cb4d9cb4b2dbda8a181297bf
2016-10-24 10:38:43 -07:00
Jingning Han
6408895e69 Avoid the use of uninitialized value in ActiveMap encoding route
This commit resets the transform size to be the maximum possible
value. It avoids out-of-boundary writing when the ActiveMap is
turned on.

Change-Id: I8302dd9a5c9fffaea3edf9ad33f72aa111999737
2016-10-24 09:41:40 -07:00
Jingning Han
72120969bc Use the actual inter prediction filter buffer in DRL
This avoids an encoding segmentation fault in speed 5, due to the
use of uninitialized dummy inter prediction filter buffer in the
dynamic motion vector referencing scheme.

Change-Id: Icd888d46623e8abf34267838135eed8656d552e4
2016-10-24 09:32:41 -07:00
Jingning Han
94d5bfccdd Limit the transform block partition depth
Limit the recursive transform block partition depth to 2. For a
32x32 transform block unit, one can maximally go down to 8x8 transform
block size.

Change-Id: I2caa92bb2eee64762b7ecca8920259f7c50fb0aa
2016-10-21 15:44:34 -07:00
Angie Chiang
ff6d890557 Pass AV1_COMMON into get_scan
This CL will facilitate adapt_scan experiment.
In adapt_scan experiment, dynamic scan order will be stored in
AV1_COMMON

Change-Id: I4763ea931b5e1af54d4f173971befeb01a4db335
2016-10-21 11:46:19 -07:00
Yaowu Xu
c76572af16 Merge changes Icfc16070,Ied47a248,I8af087d9,I322a1366,If04580af into nextgenv2
* changes:
  Palette: Use inverse_color_order to find color index faster.
  Rewrite some loops to avoid -Wunsafe-loop-optimizations warnings.
  Remove some useless casts
  Add compiler warning flag -Wextra and fix related warnings.
  Declare some array sizes to be constants (known at compile time).
2016-10-21 17:31:42 +00:00
Yaowu Xu
98a306a1b2 Merge changes I027a4f2a,Ide91d76f into nextgenv2
* changes:
  Add complier warning -wunused.
  angle estimation: Some renames/tweaks to sync with aomedia code.
2016-10-21 17:31:22 +00:00
Yaowu Xu
b97c3a13de Merge "Fix typos" into nextgenv2 2016-10-21 14:44:35 +00:00
Yaowu Xu
d56df2f9f0 Merge "Pass AV1_COMMON into av1_cost_coeffs" into nextgenv2 2016-10-21 03:20:28 +00:00
Yaowu Xu
c287e271f2 Fix typos
In a previous commit: 5db9743fbbe500bb802b5e5f5eb4e495621e29f7, two
changes that appeared to be typos are breaking build when experiments
are enabled:

../../libvpx/configure --enable-experimental --enable-ref-mv
--enable-ext-intra --enable-ext-refs --enable-ext-interp
--enable-supertx --enable-var-tx --enable-entropy --enable-ext-inter
--enable-ext-tx  --enable-motion-var --enable-dual-filter
--enable-ext-partition --enable-ext-partition-types
--enable-loop-restoration --enable-rect-tx --enable-palette
--enable-aom-highbitdepth --enable-filter-intra --enable-internal-stats
&& make clean && make -j16

This commit fixes the issue.

Change-Id: I9ce5bbc96df326214202868cb0669bd334c86851
2016-10-20 18:19:16 -07:00
Angie Chiang
22ba7514df Pass AV1_COMMON into av1_cost_coeffs
Change-Id: I2043d635e2a7f50f84a541501f28179b797ca326
2016-10-20 17:18:18 -07:00
Urvang Joshi
967ff395b6 Palette: Use inverse_color_order to find color index faster.
Cherry-picked from aomedia/master: b1c3bb5

Change-Id: Icfc16070160fd9763abb1dbf5545103e62b4b9ff
2016-10-20 15:54:33 -07:00
Urvang Joshi
da70e7b0fa angle estimation: Some renames/tweaks to sync with aomedia code.
Change-Id: Ide91d76fafe79b2b310ffd5afb7cd5b26b681f78
2016-10-20 14:57:34 -07:00
hui su
5db9743fbb Seperate FILTER_INTRA from EXT_INTRA experiment
Prepare for the av1/nextgenv2 merge.

Coding gain (%):

               lowres     midres
ext-intra       0.69       0.97
filter-intra    0.67       0.83
both            1.05       1.48

Change-Id: Ia24d6fafb3e484c4f92192e0b7eee5e39f4f4ee6
2016-10-19 21:40:49 -07:00
Urvang Joshi
66b1fcc924 Merge changes I3922dea2,I3bab2848,I21f7478a,Ida5de713,Ib9f0eefe, ... into nextgenv2
* changes:
  Fix warnings reported by -Wshadow: Part4: main directory
  Fix warnings reported by -Wshadow: Part3: test/ directory
  Fix warnings reported by -Wshadow: Part2b: more from av1 directory
  Fix warnings reported by -Wshadow: Part2: av1 directory
  Fix warnings reported by -Wshadow: Part1b: scan_order struct and variable
  Fix warnings reported by -Wshadow: Part1: aom_dsp directory
  Move STAT_TYPE enum to source file.
  Code cleanup: mainly rd_pick_partition and methods called from there.
2016-10-19 18:25:52 +00:00
Urvang Joshi
4145bf05ae Fix warnings reported by -Wshadow: Part4: main directory
Now that all warnings are taken care of, add warning flag -Wshadow to
configure.

Note: Enabling this flag for C++ generates some useless warnings about
some function parameters shadowing class member function names. So, only
enabling this warning for C code.

Cherry-picked from aomedia/master: b96cbc4

Change-Id: I3922dea2e6976b16519c4aa4d1bd395c198134f1
2016-10-19 07:56:53 -07:00
Sarah Parker
5572486ed7 Merge "Adjust gm costing so GLOBAL_ZERO is treated as regular zeromv" into nextgenv2 2016-10-19 00:44:12 +00:00
Urvang Joshi
368fbc955d Fix warnings reported by -Wshadow: Part2b: more from av1 directory
From code only part of nextgenv2 (and not aomedia)

Change-Id: I21f7478a59d525dff23747efe5238ded16b743d2
2016-10-18 17:22:44 -07:00
Urvang Joshi
454280dabf Fix warnings reported by -Wshadow: Part2: av1 directory
While we are at it:
- Rename some variables to more meaningful names
- Reuse some common consts from a header instead of redefining them.

Cherry-picked from aomedia/master: 863b0499

Change-Id: Ida5de713156dc0126a27f90fdd36d29a398a3c88
2016-10-18 17:22:34 -07:00
Urvang Joshi
03f6fdcfca Fix warnings reported by -Wshadow: Part1b: scan_order struct and variable
- Change struct name to all caps SCAN_ORDER to be locally consistent.
- Rename struct pointers to 'scan_order' instead of hard to read short
  names 'so' and 'sc'.

Cherry-picked from aomedia/master: 30abc082

Change-Id: Ib9f0eefe28fa97d23d642b77d7dc8e5f8613177d
2016-10-18 17:22:23 -07:00
Urvang Joshi
526484482a Code cleanup: mainly rd_pick_partition and methods called from there.
- Const correctness
- Refactoring
- Make variables local when possible etc
- Remove -Wcast-qual to allow explicitly casting away const.

Cherry-picked from aomedia/master: c27fcccc
And then a number of more const correctness changes to make sure other
experiments build OK.

Change-Id: I77c18d99d21218fbdc9b186d7ed3792dc401a0a0
2016-10-18 17:21:27 -07:00
Sarah Parker
ae51dd820d Adjust gm costing so GLOBAL_ZERO is treated as regular zeromv
Change-Id: I1b41146ae844c985566f5f9fdaeb5d4a4a5927b6
2016-10-18 16:18:23 -07:00
Guillaume Martres
470efbcf01 Remove rd_variance_adjustment
This function is called after `super_block_yrd` and assumes that the dst
buffer is correct but that is no longer always the case after
daf841b4a10ece1b6831300d79f271d00f9d027b since we don't call
`txfm_rd_in_plane` after the RDO loop in `choose_tx_size_from_rd`.
We could fix this by always saving and restoring the dst buffer but
removing `rd_variance_adjustment` is a better solution:
- Getting the dst buffer always right is tricky as demonstrated by the
  fact that it is wrong now, even if we fix it now we could break it later
  and not notice
- Perceptual weighting is a good idea but `rd_variance_adjustment` is the
  wrong approach as it weights both the rate and the distortion:
  to get meaningful units you should only weight the distortion,
  weighting rate means that we pretend some bits cost less than other
  bits, this is not the case. The distortion weighting approach is
  implemented by Daala in `od_compute_dist` and we plan to experiment
  with this in AV1 too.
- Removing `rd_variance_adjustment` improves coding efficiency on all
  metrics, here are the results for objective-1-fast using the Low
  Latency settings:

      PSNR Y:     -0.14%
     PSNRHVS:     -0.17%
        SSIM:     -0.12%
      MSSSIM:     -0.12%
   CIEDE2000:     -0.07%

Change-Id: I74b26b568ee65f56521646b8f30dd53bcd29fce3
2016-10-18 14:40:15 -07:00
Zoe Liu
a6a6dd509d A small bug fix in ext-refs on the RD mode selection
Change-Id: I25f14fec8e806cdf98d904488aaf200169def34d
2016-10-18 13:03:12 -07:00
Hui Su
eafb2e62ac Skip 4x4 transform if maximum possible transform is 32x32
On average no compression performance changes. Encoding speed is
increased by 10~20% on some test clips in the derf set.

Change-Id: I9856caaa260303f6f6259686671bed7d51012277
2016-10-18 11:26:11 -07:00
Jingning Han
3f16725ff2 Take out some early termination speed features
Drop some speed features used in speed 2 and above, during the
algorithm development process. This helps simplify the codebase.

Change-Id: I3b2f5560d90b00d2d8fd57c2cb36f6ddd3f228e4
2016-10-18 11:26:11 -07:00
Yaowu Xu
8f7b1d3db9 Merge "Move a statement to match order in aom/master" into nextgenv2 2016-10-18 17:58:33 +00:00
Yaowu Xu
ee775b13e2 Move a statement to match order in aom/master
Change-Id: Ic11eae36c9c62a20699197847aa3ef9562d4ad7e
2016-10-18 10:00:21 -07:00
Debargha Mukherjee
d8ff1986d4 Merge "Fix for var_tx entropy context with rect_tx" into nextgenv2 2016-10-18 16:03:37 +00:00
Peter de Rivaz
46fcb05fde Fix for var_tx entropy context with rect_tx
This computation should match the code in encode_block
to increase the accuracy of the rd optimization.

Change-Id: Ibc9d9ab6d88d0c0f3af62e9cc233216aba48a57e
2016-10-18 15:38:01 +01:00
Peter de Rivaz
b85a5a7eac Correction to costing rect_tx
When built with var_tx and ext_tx, select_tx_size_fix_type is used
to compute the cost for using a particular tx_type.
The code indexes the array inter_tx_type_costs at the wrong location
resulting in a zero cost for signalling tx_type for rect_tx blocks.

Change-Id: Iba38be3a0d822109f778f0600b242dfb40359766
2016-10-18 11:55:36 +01:00
Yaowu Xu
007fd85007 Merge "Bug fix in super_block_uvrd()." into nextgenv2 2016-10-18 00:49:28 +00:00
Yue Chen
3fcf53e381 Merge "Refactor motion estimation in MOTION_VAR experiment" into nextgenv2 2016-10-18 00:32:00 +00:00
Yue Chen
e9638ccfff Refactor motion estimation in MOTION_VAR experiment
To get ready for pulling AV1 to nextgenv2. Refactoring is done to
make the code structures similar, especially for the motion search
part.

Change-Id: I5d7636394408d97de55394d668540f5627827983
2016-10-17 12:48:10 -07:00