133 Commits

Author SHA1 Message Date
Jingning Han
6515afc6b9 Merge "Add min_tx_size variable to recursive transform block partition system" into nextgenv2 2016-11-08 19:14:33 +00:00
Yaowu Xu
f6e958b604 Merge "Fix the bug that PVQ commit broke dering" into nextgenv2 2016-11-08 18:00:53 +00:00
Angie Chiang
13ea019574 Merge changes Ib9428dc9,Ide04717a,If1dba7d8,I6da97880 into nextgenv2
* changes:
  Merge rd_stats only when it is valid
  Let parentheses in handle_inter_mode be symmetric
  Add RD_STATS into MB_MODE_INFO
  Add txb_coeff_cost_map
2016-11-08 17:42:04 +00:00
Jingning Han
e67b38aa7c Add min_tx_size variable to recursive transform block partition system
Replace max_tx_size with min_tx_size for transform type decision.

Change-Id: I64e39923a67903d52b381bd93eaac33b3400a201
2016-11-08 09:36:54 -08:00
Yushin Cho
48f84dbd1c Fix the bug that PVQ commit broke dering
Since PVQ's max block size equals to the max transform size,
daala's definition of OD_BSIZE_MAX was changed from 5 down to 4 to
use AV1's max trasform size 32x32. However, dering also uses
OD_BSIZE_MAX and assumes its value is 5, which caused dering
not working.

Change-Id: I9d82bb24adc7d57552a8e0a8a7e798e77d96fd4b
2016-11-08 08:15:57 -08:00
Yaowu Xu
00a0e010f7 Merge "New experiment: Perceptual Vector Quantization from Daala" into nextgenv2 2016-11-07 16:00:32 +00:00
Yushin Cho
77bba8d30a New experiment: Perceptual Vector Quantization from Daala
PVQ replaces the scalar quantizer and coefficient coding with a new
design originally developed in Daala. It currently depends on the
Daala entropy coder although it could be adapted to work with another
entropy coder if needed:
./configure --enable-experimental --enable-daala_ec --enable-pvq

The version of PVQ in this commit is adapted from the following
revision of Daala:
fb51c1ade6

More information about PVQ:
- https://people.xiph.org/~jm/daala/pvq_demo/
- https://jmvalin.ca/papers/spie_pvq.pdf

The following files are copied as-is from Daala with minimal
adaptations, therefore we disable clang-format on those files
to make it easier to synchronize the AV1 and Daala codebases in the future:
 av1/common/generic_code.c
 av1/common/generic_code.h
 av1/common/laplace_tables.c
 av1/common/partition.c
 av1/common/partition.h
 av1/common/pvq.c
 av1/common/pvq.h
 av1/common/state.c
 av1/common/state.h
 av1/common/zigzag.h
 av1/common/zigzag16.c
 av1/common/zigzag32.c
 av1/common/zigzag4.c
 av1/common/zigzag64.c
 av1/common/zigzag8.c
 av1/decoder/decint.h
 av1/decoder/generic_decoder.c
 av1/decoder/laplace_decoder.c
 av1/decoder/pvq_decoder.c
 av1/decoder/pvq_decoder.h
 av1/encoder/daala_compat_enc.c
 av1/encoder/encint.h
 av1/encoder/generic_encoder.c
 av1/encoder/laplace_encoder.c
 av1/encoder/pvq_encoder.c
 av1/encoder/pvq_encoder.h

Known issues:
- Lossless mode is not supported, '--lossless=1' will give the same result as
'--end-usage=q --cq-level=1'.
- High bit depth is not supported by PVQ.

Change-Id: I1ae0d6517b87f4c1ccea944b2e12dc906979f25e
2016-11-06 22:18:01 -08:00
Angie Chiang
9a44f5fbc8 Add RD_STATS into MB_MODE_INFO
With RD_STATS in MB_MODE_INFO, we will be able to compare the results
from rate-distortion loop and the results from bitstream packing.

Change-Id: If1dba7d87126577a6f369ac087d4517f7cebb0c5
2016-11-06 12:21:34 -08:00
Debargha Mukherjee
5f305854e6 Increase gm precision from 16 to 32 bit ints
Change-Id: I7117a6c14dc8438e4225b50bd2d3ebbaa7f850cc
2016-11-05 16:50:08 -07:00
Jingning Han
713b56121a Merge "Clean up write_tx_type()" into nextgenv2 2016-11-04 23:03:53 +00:00
Jingning Han
05abee1530 Merge "Factor out common tx_type writing codes from inter/intra frame" into nextgenv2 2016-11-04 23:03:38 +00:00
Angie Chiang
75f45814ba Separate coefficient cost of U/V planes in write_modes_b()
Change-Id: Ie3082db5b0fead8c322b2aeede4eff7cd723ea12
2016-11-04 11:12:44 -07:00
Angie Chiang
d402282f69 Add token cost comparison in write_modes_b()
This is just partial implementation
Compare token cost of pack_mb_tokens/pack_txb_tokens with token cost
from rate-distortion loop. If there is any difference, dump out mode
info.

Change-Id: I46b373ee2522c5047f799f36baf7cec5fbc06f06
2016-11-04 11:09:24 -07:00
Jingning Han
641b1ad5ad Clean up write_tx_type()
Remove repeated mbmi->tx_size calls.

Change-Id: I3e4e03b69b2efffd860cc1ea34e150f4257bf081
2016-11-04 10:36:20 -07:00
Jingning Han
2a4da9476b Factor out common tx_type writing codes from inter/intra frame
Change-Id: Id2626bd19db2504756d9a1dee709c2d08c79f771
2016-11-04 10:33:12 -07:00
Jingning Han
98d6a1f247 Properly schedule the transform block recursion order
This commit replaces the offset based block index calculation with
incremental based one. It does not change the coding statistics.

Change-Id: I3789294eb45416bd0823e773ec30f05ed41ba0dc
2016-11-04 09:06:49 -07:00
Jingning Han
f64062f36f Make bit-stream support rectangular tx_size
Allow the transform size writing, reading, and the reconstruction
process to support rectangular transform block size coding.

Change-Id: I57393c73ec60835a088d785ca838d7e3d7eb29a4
2016-11-02 16:24:20 -07:00
Jingning Han
746e2220b5 Merge "Rework transform block partition context model" into nextgenv2 2016-11-02 01:18:13 +00:00
Jingning Han
c8b8936fdc Rework transform block partition context model
This commit allows the partition context model to account for the
maximum transform block size of the coding block.

Change-Id: I22b91e85fff70faa974afd362ce327d3f2eda81d
2016-11-01 15:00:04 -07:00
Yaowu Xu
8af861bbf1 Fix merge issues related --enable-ec-adapt
1. Avoid compiler warnings.
2. Enable prob_diff_update() required by update_txfm_probs().

Change-Id: I9081b645c55a8432bdaeb600e9ba901c0d0d96f5
2016-11-01 12:36:04 -07:00
Jingning Han
e29fc1daef Merge "Refactor max_blocks_wide/high computation" into nextgenv2 2016-10-31 22:20:16 +00:00
Jingning Han
6511159787 Merge "Replace get_tx2d_size() with direct tx_size_2d[] table access" into nextgenv2 2016-10-31 22:19:59 +00:00
Jingning Han
6491b97350 Merge "Support rectangular tx_size in recursive txfm syntax coding" into nextgenv2 2016-10-31 22:19:46 +00:00
Steinar Midtskogen
5d56f4d69a Reverse order of CLPF and dering
Low latency:
PSNR YCbCr:     -0.15%      0.11%      0.12%
   PSNRHVS:     -0.25%
      SSIM:     -0.26%
    MSSSIM:     -0.26%
 CIEDE2000:     -0.03%

High latency:
PSNR YCbCr:     -0.18%      0.18%      0.07%
   PSNRHVS:     -0.20%
      SSIM:     -0.21%
    MSSSIM:     -0.21%
 CIEDE2000:     -0.03%

Change-Id: Ieb86d9ba353220de6454bdc15cea825944b6385b
2016-10-31 12:50:11 -07:00
Jingning Han
f65b870e27 Refactor max_blocks_wide/high computation
Factor common codes that show up in multiple places.

Change-Id: I0a72213a151f74bdad926d59f86f0a28d00968fc
2016-10-31 12:39:36 -07:00
Jingning Han
7e9929736c Replace get_tx2d_size() with direct tx_size_2d[] table access
Change-Id: I20040cdb5d9fdbf6c50082e5e17b4cfbd1926b13
2016-10-31 12:39:33 -07:00
Jingning Han
42a0fb369d Support rectangular tx_size in recursive txfm syntax coding
Change-Id: I40aa342ffa5b6effe8b124b94783e5f0bd2f2a81
2016-10-31 12:38:07 -07:00
Yaowu Xu
1aceffa06c Fix compiling issues with --enable-ec-adapt
Change-Id: I52e2c84ce43d36f78806c54b214f9e5b07c5f0f5
2016-10-31 09:13:53 -07:00
Nathan E. Egge
baaaa16186 Centralize EC_MULTISYMBOL error checking.
The EC_ADAPT experiment cannot work unless EC_MULTISYMBOL is also
 enabled.
This patch replaces all individual checks with a centralized check in
 both the bitreader.h and bitwriter.h.

Change-Id: I418852d95c5012cc074ed65cd24997e08bc2aadd
2016-10-29 22:26:27 -07:00
Thomas Davies
6519bebf34 EC_ADAPT: refactor and fix MinArfFreq unit tests.
Ensure that cdfs are synced with pdfs after every
forward update.

Change-Id: I5677f78300156c8622f1728d7a343ff6c3a4ea64
2016-10-29 22:21:32 -07:00
Thomas Davies
09ebbfb39f EC_ADAPT: send updates for the correct nodes.
EOB and ZERO token are not currently adapted.

Change-Id: Ie7d657b71fcb157b09e40874fb06a8b7cd95cc70
2016-10-29 17:05:40 -07:00
Alex Converse
aca9feba82 Add ec_multisymbol for common daala_ec and rans code
The new ec_multisymbol experiment supersedes the rans experiment and is
used for multisymbol features that can be backed by either daala_ec or
rans.

This experiment is automatically enabled by ec_adapt and will try to
enable daala_ec or ans (in that order).

Change-Id: Ie75b4002b7a9d7f5f7b4d130c1aacb3dbe97e54f
2016-10-29 17:05:40 -07:00
Thomas
9ac5508f32 Add EC_ADAPT experiment for symbol-adaptive entropy coding.
This experiment performs symbol-by-symbol statistics
adaptation for non-binary symbols. It requires DAALA_EC or
RANS and ANS to be enabled. The adaptation is currently
based on a simple recursive filter and is taken from
Daala. It has an adaptation rate dependent on alphabet size,
taken from Daala. It applies wherever non-binary symbols
are encoded using Cumulative Probability Functions rather
than trees.

Where symbols are adapted, forward updates in the compressed
header are removed.

In the case of RANS coefficient token values are adapted,
with the exception of the zero token which remains a
binary symbol. In the case of DAALA_EC other values
such as inter and intra modes are adapted as CDFs are
provided in those cases.

The experiment is configured with:

./configure --enable-experimental --enable-daala-ec --enable-ec-adapt

or

./configure --enable-experimental --enable-ans --enable-rans \
    --enable-ec-adapt

EC_ADAPT is not currently compatible with tiles.

BDR results on Objective-1-fast give a small loss:

PSNR YCbCr:      0.51%      0.49%      0.48%
PSNRHVS:      0.50%
SSIM:      0.50%
MSSSIM:      0.51%
CIEDE2000:      0.50%

Change-Id: I3888718e42616f3fd87144de7f125228446ac984
2016-10-29 16:57:48 -07:00
Yaowu Xu
d64eaf138e Merge "Tile groups: ensure each tile in a TG has a length." into nextgenv2 2016-10-28 21:26:32 +00:00
Yaowu Xu
edd3f9c418 Merge "Fix update_delta_q_probs compile warning" into nextgenv2 2016-10-28 21:26:23 +00:00
Yaowu Xu
efd5725242 Merge "Encode and decode multiple tile groups" into nextgenv2 2016-10-28 21:26:11 +00:00
Thomas Davies
8fe64a3a23 Tile groups: ensure each tile in a TG has a length.
This ensures TGs can be decoded even if the whole
frame has not been received and the frame length
is not known.

Change-Id: If24837fcc3b5c46554751be792e91100de73e8d6
2016-10-28 13:01:40 -07:00
Jingning Han
be44c5f46f Fix update_delta_q_probs compile warning
Change-Id: Ifb93970ed876ed61259b2f8da739171857c97fda
2016-10-28 13:01:40 -07:00
Thomas Davies
80188d1546 Encode and decode multiple tile groups
This is a manual adaptation of the following commit from aom/master:
ce12003d60a1c8d6c65ed07ba165c34062fcbcbd

The original commit message:

A tile group is a set of tiles in scan order.

Each tile group has a version of uncompressed and compressed headers,
identical apart from tile group parameters.
Encoding probability updates takes account of the number of
headers to control overheads.

The decoder supports arbitrary numbers of tile groups with
arbitrary number of tiles. The number of tiles in a TG is
signalled in the uncompressed header for that TG.

The encoder currently only supports a fixed number
of TGs (3, when error resilient mode is on) of equal size
(except possibly for the last one).

The average BDR performnce with 3 tile groups versus
anchor with error resilient mode and up to 16 tiles is:

NR YCbCr:      3.02%      3.04%      3.05%
PSNRHVS:      3.09%
SSIM:      3.06%
MSSSIM:      3.05%
CIEDE2000:      3.04%

Change-Id: I9b97c5ed733103b9160a3a5d4370de5322c00c0b
2016-10-28 11:52:13 -07:00
David Barker
f8935c9c92 Fix clpf and dering signalling when used with ext-partition-types
Previously, when ext-partition-types and either clpf or dering were
enabled, the signalling for clpf/dering would not be encoded or decoded,
as the code to do so was inside a #if !CONFIG_EXT_PARTITION_TYPES block.
This caused many tests (eg, AV1/EndToEndTestLarge.EndToEndPSNRTest/0)
to fail with encode/decode mismatches.

Change-Id: If1742deb1812877813b2c3e93a048430f9a504ba
2016-10-27 13:19:01 +00:00
Jingning Han
4e1737af64 Add depth to tx_size mapper to bit-stream coding
It serves as a helper function to integrate various transform coding
options.

Change-Id: I64e7d0c88ea10137fa1ff1072d865eb0054c2a25
2016-10-26 15:45:19 +00:00
Jingning Han
c83ef8b946 Merge "Refactor transform size coding" into nextgenv2 2016-10-26 01:12:04 +00:00
Jingning Han
aae72a69c3 Refactor transform size coding
Introduce the transform block partition depth macro definition.

Change-Id: I218dc77a77c8e967da4d270d4ec0d7691b712a5f
2016-10-25 15:42:30 -07:00
Yaowu Xu
dece603fdf Merge "Use constrained tokenset with --enable-daala_ec." into nextgenv2 2016-10-25 19:40:51 +00:00
Yaowu Xu
1f112841d2 Merge "Refactor extrabits packing" into nextgenv2 2016-10-25 17:14:57 +00:00
Yaowu Xu
d8dc1fc522 Merge "Linearize extrabits writing." into nextgenv2 2016-10-25 17:14:44 +00:00
Nathan E. Egge
46e8490498 Use constrained tokenset with --enable-daala_ec.
Change-Id: Ia09edf92bf9f7ecacc65c232ac6e656cde236634
2016-10-25 10:13:22 -07:00
Angie Chiang
6305abe114 Refactor: Add macro LOG_SWITCHABLE_FILTERS
Change-Id: I7593ff2f8949d8bc26ca1c8577faaefb09640b59
2016-10-25 09:22:35 -07:00
Alex Converse
d8fdfaa4da Refactor extrabits packing
- Eliminate the awkward _av1 suffix/infix in local variable names.
- Lift bitdepth selection out of the token loop.

Change-Id: I26d3397464f7808e0481a804033a93ca4f01f5d5
2016-10-25 08:59:08 -07:00
Alex Converse
81fd890773 Linearize extrabits writing.
The decoder is already linear so changing these tables would just create
a mismatch.

Change-Id: Ib888c0dc273e089c38298f569bb35b6e4c32dd60
2016-10-25 08:59:08 -07:00