For 'left' array indices -1 onwards are valid (left[-1] == above[-1] ==
the top-left reference pixel).
So, make sure that 'base2' is in that range too.
Change-Id: If5118d97d4ef85f6520363bd648bfe6948c1211f
Previously, the projected positions of chroma pixels would effectively
undergo double rounding, since we round both when calculating x4 / y4
and when calculating the filter index. Further, the two roundings
were different: x4 / y4 used ROUND_POWER_OF_TWO_SIGNED, whereas
the filter index uses ROUND_POWER_OF_TWO.
It is slightly more accurate (and faster) to replace the first
rounding by a shift; this is motivated by the fact that
ROUND_POWER_OF_TWO(x >> a, b) == ROUND_POWER_OF_TWO(x, a + b)
Change-Id: Ia52b05745168d0aeb05f0af4c75ff33eee791d82
Add an SSE4 version of compute_cross_correlation() from
corner_match.c. This function is about 3.4x the speed of
the scalar code; determine_correspondence as a whole is about
2.5-3x the speed it was previously.
BUG=aomedia:487
Change-Id: I707b7cfd5c513c025d3ee7fb6a5f1fa335ecd495
As the block sizes are powers of two, we can index into the weights
array as sm_weights_array[bs] now.
This uses 2 * MAX_BLOCK_DIM memory, instead of NUM_BLOCK_DIMS *
MAX_BLOCK_DIM earlier.
Change-Id: I55bcedc188b8ed7def719c4d002c1fe2ec5e1b7f
EC_ADAPT stores the count at the last position. As such, the CDF_SIZE
macro adds 1 to the array size. This resolves valgrind warnings about
jumps on uninitialized variables.
Change-Id: I58d607a57756cb166a9ae5c4565537ce202183fd
This causes the HBD operating path to be compiled by default, allowing
default builds to handle all AV1 profiles, instead of only Profile 0.
This doesn't change the current behaviour of the code.
This will help ensuring the HBD operating path continues to compile.
BUG=aomedia:460
Change-Id: I8774b9586b1da479ce3882df482ac3cd3048a9d5
This resolves the performance issue in ext-partition. The
compression performance is up from 0.9% loss to 0.4% gains in
midres.
Change-Id: I0dfeee828dbc114842c72361683271487108c593
Supporting Emscripten requires modification of all uses of the
target_link_libraries() function to match the form
of the target_link_libraries() call in Emscripten.cmake.
The AOM_LIB_LINK_TYPE variable has been added to allow for
flexibility on the libaom side when using toolchains that
behave similarly to Emscripten.cmake wrt
target_link_libaries().
To use CMake for an Emscripten build, first install Emscripten, then:
$ cmake path/to/aom -DCMAKE_TOOLCHAIN_FILE=path/to/Emscripten.cmake -DAOM_TARGET_CPU=generic
BUG=aomedia:76,aomedia:468
Change-Id: I22c7df7912ecfdbc2a52180086b205cc8dcfc0c6
Also fix a mismatch for resizing with ext-refs enabled.
There are various preconditions which need to be true for it to
be valid to set cm->use_prev_frame_mvs = 1, including that the
sizes of this frame and cm->prev_frame must be equal.
With ext-refs enabled, we would sometimes decide to change
cm->prev_frame to point to the LAST_FRAME reference, without
re-checking the preconditions. If the LAST_FRAME was smaller
than the current frame, this could lead to reading garbage off the
end of its mv array, and eventually to an encode/decode mismatch.
We fix this by rewriting the preconditions as checks on
cm->prev_frame directly (rather than using cm->last_width and
cm->last_height), and by testing the preconditions after any
possible adjustment.
This should not affect the bitstream unless ext-refs is enabled,
but may affect the bitstream with ext-refs even if resizing is
not used.
BUG=aomedia:521
Change-Id: I7dfd9ba82cdf77acc2e27e0c9f3aee21d6afeb54
- Found this bug when increasing unit test number to 10000.
- Unit test is therefore also updated.
Change-Id: I938e96f6ebd35ae1bd8affebf8665e1da49a324b
Use 2x2 inter prediction for chroma component. This improves the
compression performance by 0.6% for lowres.
Change-Id: If9d98e49cee63f40085b179652bfacc31ff462ea
Adds three new helpers and changes one other. The intention of this is
to make the triggering and function of resizing simpler. The new process
is to resize to the next state and then update the current state to
match. The new helpers reflect this change and make the overall flow
simpler.
resize_pending is now a helper instead of a member, so it doesn't need
to be raised manually. A resize is pending when the numerator or
denominator of the next resize state is different from the current one.
resize_pending could be 1 (scale down), 0 (no change), or -1 (return to
original resolution if 1-pass CBR), but now it can only be 1 or 0. To
return to the original resolution just set the scale to 1:1. This
reduces complexity with no change in functionality.
resize_unscaled just returns 1 if the current numerator and denominator
are equal. This makes some if conditions cleaner.
resize_step makes the current scale equal to the next scale. This
signifies that a resize is complete and will cause resize_pending to be
false until the next state is changed. This is the end of the new
resizing procedure.
av1_calculate_coded_size has been changed to calculate the next size
instead of the current size. The current state can't be updated until
the resize is complete because if it were, the resize_pending state
would drop and the resize wouldn't finish. This just means the next
resolution is the target resolution until the resize is complete.
Change-Id: I5d5855cc83f532d3a8b1f8853ba70a0d43221fbf
The element of "idx" in the data structure of RefBuffer is a
connection between AV1_COMMON::RefBuffer and
AV1_COMMON::BufferPool::RefCntBuffer.
It is being used currently in many places in both the encoder and the
decoder. "idx" is not only used to track whether a reference buffer is
alive, but also serve as the connection to RefCntBuffer which contains
info that RefBuffer itself cannot access.
Change-Id: I5ccdb9c2afe840d04a025da359a704f5fc216ddd