Yaowu Xu [Fri, 21 Oct 2016 17:31:42 +0000 (17:31 +0000)]
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).
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.
Rewrite some loops to avoid -Wunsafe-loop-optimizations warnings.
For example, loops of the form:
"for (i = 0; i < 1 + max_value; ++i) ..." or
"for (i = 0; i <= max_value; ++i) ..." are possibly infinite loops,
theoretically speaking (even if practically, they aren't).
So, compiler cannot optimize those loops.
When possible, I rewrote such loops to be finite even theoretically.
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
Yi Luo [Mon, 17 Oct 2016 18:18:50 +0000 (11:18 -0700)]
Fix the overflow of av1_fht32x32() in 2D DCT_DCT
- Use range check function to avoid DCT_DCT overflow.
We need to re-develop the column txfm side scaling/rounding. Now,
we prefer to maintain the current BDRate level.
- Encoder user level time reduction <1% owing to av1_fht32x32_avx2.
- Add MemCheck unit test and fdct32() unit test.
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'.