Yunqing Wang [Thu, 2 Jun 2011 21:33:17 +0000 (17:33 -0400)]
Adjust bounds checking for hex search in real-time mode
Currently, hex search couldn't guarantee the motion vector(MV)
found is within the limit of maximum MV. Therefore, very large
motion vectors resulted from big motion in the video could cause
encoding artifacts. This change adjusted hex search bounds
checking to make sure the resulted motion vector won't go out
of the range. James Berry, thank you for finding the bug.
Yaowu Xu [Wed, 1 Jun 2011 18:41:05 +0000 (11:41 -0700)]
further clean up of errorperbit and sadperbit
this commit makes the usage errorperbit and sadperbit consistent for
encoding modes and passes. Removed all different magic weight factors
associated with errorperbit. Now 1/2 is used for both sadperbit16 and
sadperbit4, the /2 operation is merged into initializations of the 2
variables.
Tests on cif set show .23%, 0.18% and 0.19% gain by avg psnr, overall
psnr and ssim respectively.
Henrik Lundin [Wed, 1 Jun 2011 19:41:12 +0000 (21:41 +0200)]
Bugfix in vp8dx_set_reference
The fb_idx_ref_cnt book-keeping was in error. Added an assert to
prevent future errors in the reference count vector. Also fixed a
pointer syntax error.
remove some magic weights associated with sad_per_bit
sad_per_bit has been used for a number of motion vector search routines
with different magic weights: 1, 1/2 and 1/4. This commit remove these
magic numbers and use 1/2 for all motion search routines, also reformat
a number of source code lines to within 80 column limit.
Test on cif set shows overall effect is neutral on all metrics. <=0.01%
James Berry [Fri, 27 May 2011 18:57:25 +0000 (14:57 -0400)]
bug fix check frame buffer index before copy
in onyx_if.c update_reference_frames() make
sure that frame buffer indexes are not equal
before preforming a buffer copy. If two frames
share the same buffer the flags will already be
set correctly.
Yunqing Wang [Fri, 27 May 2011 17:31:15 +0000 (13:31 -0400)]
Use hex search for realtime mode speed>4
Test showed using hex search in realtime mode largely speed up
encoding process, and still achieves similar quality like the
diamond search we have. Therefore, removed the diamond search
option.
Yaowu Xu [Wed, 25 May 2011 23:07:37 +0000 (16:07 -0700)]
fix the mix use of errorperbit and sadperbit
error_per_bit and sad_per_bit were designed as estimates of a bit worth
of sum squared error and sum absolute difference respectively. Under
this assumption, error_per_bit should be used in combination with 2nd
order errors (variance or sum squared error) while sad_per_bit should
be used in combination with 1st order SADs in motion estimation. There
were a few places where sad_per_bit has been misused with variances,
this commit changes to use error_per_bit for those places, also changes
parameter names to properly indicate which constant is being used.
On cif set, the change has a universal gain by all metrics: 0.13% by
average/overall psnr and 0.1% by ssim.
Scott LaVarnway [Tue, 24 May 2011 17:24:52 +0000 (13:24 -0400)]
MODE_INFO size reduction
Declared the bmi in MODE_INFO as a union instead of B_MODE_INFO.
This reduced the memory footprint by 518,400 bytes for 1080
resolutions. The decoder performance improved by ~4% for the
clip used and the encoder showed very small improvements. (0.5%)
This reduction was first mentioned to me by John K. and in a
later discussion by Yaowu.
This is WIP.
John Koleszar [Thu, 19 May 2011 21:16:39 +0000 (17:16 -0400)]
cleanup: collect twopass variables
This patch collects the twopass specific memebers of VP8_COMP into a
dedicated struct. This is a first step towards isolating the two pass
rate control and aids readability by decorating these variables with
the 'twopass.' namespace. This makes it clear to the reader in what
contexts the variable will be valid, and is a hint that a section of
code might be a good candidate to move to firstpass.c in later
refactoring. There likely will be other rate control modes that need
their own specific data as well.
This notation is probably overly verbose in firstpass.c, so an
alternative would be to access this struct through a pointer like
'rc->' instead of 'cpi->firstpass.' in that file. Feel free to make
a review comment to that effect if you prefer.
Scott LaVarnway [Thu, 19 May 2011 19:03:36 +0000 (15:03 -0400)]
Using partition_info instead of blockd info for splitmv
The partition_info struct contains info just for SPLITMV,
so it should be used instead of BLOCKD. Eventually, I want
to reduce the size of B_MODE_INFO struct found in BLOCKD, so
this is the first step toward that goal.
Also, since SPLITMV is not supported in vp8_pick_inter_mode(),
the unnecessary mem copies and checks were removed. For rt
encodes, this gave a slight performance improvement.
Stefan Holmer [Mon, 2 May 2011 13:30:51 +0000 (15:30 +0200)]
Adding error-concealment to the decoder.
The error-concealer is plugged in after any motion vectors have been
decoded. It tries to estimate any missing motion vectors from the
motion vectors of the previous frame. Intra blocks with missing
residual are replaced with inter blocks with estimated motion vectors.
This feature was developed in a separate sandbox
(sandbox/holmer/error-concealment).