Jingning Han [Wed, 22 Jun 2016 00:47:30 +0000 (17:47 -0700)]
Sub8x8 block chroma component inter prediction
Handle the sub8x8 chroma component at the unit of 2x2/4x2/2x4 level
and use the motion vector inherited from the luma component. This
improves the coding performance:
The av1_mv_class0_tree is a balanced tree with two leafs and can
simply be coded as a boolean with probability class0[0].
If CLASS0_SIZE is ever changed from 1, this change will need to be
reverted.
When building with --enable-daala_ec, the tx_type for intra blocks can be
coded using the CDFs that are updated once per frame.
This patch converts a tx_type symbol to be coded with aom_write_symbol()
and aom_read_symbol() that was missed in f3e8e267.
Yaowu Xu [Thu, 20 Oct 2016 22:30:11 +0000 (22:30 +0000)]
Merge changes I7d6394e4,Ia8ce1464,If20e8637,Ia9adc46b,I651db25b into nextgenv2
* changes:
Define SIMD_INLINE using AOM_FORCE_INLINE
AOM_FORCE_INLINE: fix always_inline attribute
Free memory allocated by daala_ec encoder.
Move clpf_sse4_1.c to clpf_sse4.c in agreement with convention
sync avg_test.cc with aom/master
Urvang Joshi [Thu, 20 Oct 2016 21:51:01 +0000 (14:51 -0700)]
Encoder/Decoder mismatch fix: need a separate copy of eob_counts.
The bug was introduced here:
https://chromium-review.googlesource.com/#/c/399975/4/av1/encoder/bitstream.c
In that patch, I had removed 2nd declaration of a variable of the same
name. But it turns out that the two variables actually had a different
type (even though the name was same).
Now, we keep both variables, but rename one of them -- that fixes the
mismatch. While we are at it, made both variables local as well.
The fix can be verified as follows:
../../libvpx/configure --enable-experimental --enable-supertx
--enable-var-tx --enable-entropy --enable-internal-stats && make clean
&& make -j16
Angie Chiang [Thu, 20 Oct 2016 18:20:40 +0000 (11:20 -0700)]
Add adapt_scan APIs and some helping functions
av1_init_scan_order
initialize data structures related to adaptive scan order
av1_update_scan_prob
update nonzero probabilities from nonzero counts
av1_augment_prob
embed r + c and coeff_idx info with nonzero probabilities.
When sorting the nonzero probabilities, if there is a tie,
the coefficient with smaller r + c will be scanned first
av1_update_sort_order
apply quick sort on nonzero probabilities to obtain a sort order
av1_update_scan_order
apply topological sort on the nonzero probabilities sorting order to
guarantee each to-be-scanned coefficient's upper and left coefficient
will be scanned before the to-be-scanned coefficient.
av1_update_neighbors
For each coeff_idx in scan[], update its above and left neighbors in
neighbors[] accordingly.
Zoe Liu [Wed, 19 Oct 2016 00:12:11 +0000 (17:12 -0700)]
Sync with aom branch for ext-refs
Plus a small code clean up. The experiment of EXT_REFS, compared against
the baseline, using Overall PSNR, now obtains a gain on lowres as:
Avg: -5.818; BDRate: -5.653
Compared against the previous EXT_REFS results on lowres, a tiny gain is
obtained as:
Avg: -0.047, BDRate: -0.063
(1) 780952 Add encoder first pass support to bi-prediction in EXT_REFS
(2) f91498 Add pred prob handling for new references in EXT_REFS
(3) e91472 Add decoder support for bi-direct prediction in EXT_REFS
(4) 0dbac9 Add encoder support to new references in EXT_REFS
(5) ad70cc Remove hard-coded number for EXT_REFS
(6) 9c1e2f Add the use of new reference frames at encoder in EXT_REFS
(7) 6d4fde Add the experiment flag of EXT_REFS
Peter de Rivaz [Thu, 20 Oct 2016 15:21:20 +0000 (16:21 +0100)]
Fix for AV1.TestTell
The tell functions return an unsigned integer.
This causes the AV1.TestTell test case to fail because
-1 is greater than 20 when treated as an unsigned integer.
Urvang Joshi [Wed, 19 Oct 2016 18:25:52 +0000 (18:25 +0000)]
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.
Change return type of tell and tell_frac to uint32_t.
The bit accounting functions aom_reader_tell() and aom_reader_tell_frac()
return the number of bits and 1/8th bits respectively.
This patch changes the return type from ptrdiff_t which is signed to
uint32_t which is unsigned.
The size_t type is not used since we only care about the number of bits
or 1/8 bits per entropy coder context and we don't expect to code more
than 512 megabits per tile.
Urvang Joshi [Mon, 17 Oct 2016 21:53:33 +0000 (14:53 -0700)]
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.
Peter de Rivaz [Wed, 19 Oct 2016 10:43:11 +0000 (11:43 +0100)]
Fix for var_tx context update
The tx_partition_set_contexts function changes tx_size even
for blocks coded with a rectangular transform.
This causes an internal rd inconsistency when using all of
CONFIG_VAR_TX, CONFIG_RECT_TX, CONFIG_EXT_TX.
Michael Bebenita [Thu, 25 Aug 2016 21:40:54 +0000 (14:40 -0700)]
Bit accounting.
This patch adds bit account infrastructure to the bit reader API.
When configured with --enable-accounting, every bit reader API
function records the number of bits necessary to decoding a symbol.
Accounting symbol entries are collected in global accounting data
structure, that can be used to understand exactly where bits are
spent (http://aomanalyzer.org). The data structure is cleared and
reused each frame to reduce memory usage. When configured without
--enable-accounting, bit accounting does not incur any runtime
overhead.
All aom_read_xxx functions now have an additional string parameter
that specifies the symbol name. By default, the ACCT_STR macro is
used (which expands to __func__). For more precise accounting,
these should be replaced with more descriptive names.
Currently the RD loop traverses 4X8 blocks in inverted N order while
the bitstream stores blocks smaller than 8x8 in Z order. This causes a
discrepancy where the RD loop reads uninitialized data while
performing intra prediction. As a temporary fix simply disable the
use of the extended right edge for 4X8 blocks, until the bitstream can
be changed to match the logical structure of the blocks.
Urvang Joshi [Fri, 14 Oct 2016 22:53:39 +0000 (15:53 -0700)]
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'.
Sarah Parker [Tue, 11 Oct 2016 19:29:07 +0000 (12:29 -0700)]
Fix ransac random generator seeding
Ransac's get_rand_indices originally used rand_r seeded with the
same value every time, producing the same random sequence at every
iteration. This causes the global motion parameters to be slightly
less accurate because ransac cannot improve the model fit after
the first attempt.
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: