Tom Finegan [Wed, 6 Nov 2013 18:02:31 +0000 (10:02 -0800)]
webmenc: Clean up the truly egregious style issues.
I'm sure I could do more, but I don't know how long this code has to
live. I think this at least makes the code a little easier to read and
understand.
Tom Finegan [Tue, 5 Nov 2013 18:02:18 +0000 (10:02 -0800)]
Move WebM writing support out of vpxenc.c.
This is mainly a clean up patchset. It moves the WebM writing support
out of vpxenc and into its own source file. Changes to tools_common and
vpxdec result from relocation of shared bits of code.
Jingning Han [Tue, 5 Nov 2013 02:45:45 +0000 (18:45 -0800)]
Avoid mv cost check for invalid mv values
The compound inter prediction could potentially run with initial
motion vectors of invalid value and check the mv_cost, which triggers
overheap read. This commit resolves this issue by forcing a motion
vector value check for compound inter modes of both superblock and
sub8x8 block sizes.
Dmitry Kovalev [Sat, 2 Nov 2013 01:23:06 +0000 (18:23 -0700)]
Splitting partition_probs array into two arrays.
We only update partition_probs for inter frames but they are constant
for key frames. It is not necessary to have constants inside frame
context and copy them every time. This change reduces FRAME_CONTEXT size
by at least 48 bytes.
Adrian Grange [Mon, 4 Nov 2013 20:17:54 +0000 (12:17 -0800)]
Remove unused members from VP9_COMP
Removed:
goldfreq, avg_encode_time, avg_pick_mode_time,
cpu_freq, interquantizer
member variables from VP9_COMP since they are no longer
used in the code.
Jingning Han [Sun, 3 Nov 2013 19:16:38 +0000 (11:16 -0800)]
Fix the use case of plane_block_idx in sub8x8 RD
This commit fixes the use case of plane_block_idx, which determines
the plane (Y/U/V) index based on block index. When block idx >= 4 in
sub8x8 block loop, it should be of chroma components.
Dmitry Kovalev [Fri, 1 Nov 2013 22:09:43 +0000 (15:09 -0700)]
Removing 'new' probability calculation from convert_distribution().
We don't have to calculate 'new' probability in convert_distribution()
because it is enough to calculate only 'new' counters which could be used
to calculate probability if necessary. That's why removing a lot of unused
temporary probability arrays and reducing number of get_binary_prob()
calls.
Marco Paniconi [Fri, 1 Nov 2013 18:03:03 +0000 (11:03 -0700)]
Fixes to buffer update for temporal layers.
When a frame is dropped due to |buffer_level| < 0 for a given temporal layer,
the buffer level for the upper temporal layers was not updated (in calc_pframe_target_size()).
This change fixes that.
Also, use the layer per-frame-bandwidth for updating the buffer level
of the higher layers when a frame is dropped.
Yaowu Xu [Fri, 1 Nov 2013 14:24:07 +0000 (07:24 -0700)]
Two optimizations:
1. Reduced the size memset based on eob for 32x32 transform. The reset
of non-zero coefficient should probably go into where they are read in
inverse transform functions. (TODO)
2. Removed a redundant level of indirection.
vp9_iht4x4_add() checks transform type and call vp9_iht4x4_16_add()
for tranforms other than DCT_DCT. In this case, the DCT_DCT case
has been already handled here.
Dmitry Kovalev [Thu, 31 Oct 2013 20:52:08 +0000 (13:52 -0700)]
Reducing the number of foreach_transformed_block() calls.
The change doesn't affect the bitstream. It changes the order or function
calls and affects how we reconstruct intra- and inter-blocks. Speed up is
about 1...1.5%.
For intra-blocks:
Before:
for each transform block read tokens
for each transform block do prediction
for each transform block do inverse transform
Now:
for each transform block
read tokens
do prediction
do inverse transform
For inter-blocks:
Before:
for each transform block read tokens
for each transform block do inverse transform
Now:
for each transform block
read tokens
do inverse transform
Jingning Han [Wed, 30 Oct 2013 20:52:55 +0000 (13:52 -0700)]
Enable all-zero coeff block index for sub8x8 blk
This commit makes zcoeff_blk cache the case where the entire block
is quantized to be zero (without applying zero-forcing) in the rate-
distortion optimization loop, and skip the forward DCT, quantization,
inverse DCT, and reconstruction process in the encode_block stage.
It now works for all the block sizes, including sub8x8 blocks.
Dmitry Kovalev [Wed, 30 Oct 2013 19:17:05 +0000 (12:17 -0700)]
Reducing the number of recursive calls.
Both decode_modes_sb and decode_modes_b had conditions to immediately
return at the beginning. Eliminating these conditions here and calling
these functions only to do a real work. Also unrolling loop for
PARTITION_SPLIT.
Dmitry Kovalev [Tue, 29 Oct 2013 21:50:27 +0000 (14:50 -0700)]
Fixing clang warning.
Warning was: "implicit conversion from enumeration type 'VPX_SCALING_MODE'
(aka 'enum vpx_scaling_mode_1d') to different enumeration type
'VPX_SCALING'".
Dmitry Kovalev [Tue, 29 Oct 2013 18:24:08 +0000 (11:24 -0700)]
Correct handling of show_bit in uncompressed header.
"keyframe" variable in the current code actually means that previous
frame is a keyframe because cm->frame_type has not been initialized
in read_uncompressed_header.
Yaowu Xu [Mon, 28 Oct 2013 16:02:42 +0000 (09:02 -0700)]
changed to comply with strict aliasing rule
The clamp operation may not affect the values of the final assigned mv
where compiler may make use of strict aliasing rule to optimize out the
clamp operation. This change made the code segments to better comply
the strict aliasing rule.