Commit Graph

295 Commits

Author SHA1 Message Date
Daniel Kang
1099f368e3 clamp_mv_min_max -> vp8_clamp_mv_min_max
It's now used in more places

Change-Id: I63f8e1d827404e0b4f203bdb1df361e565d0779d
2012-08-07 16:41:58 -07:00
Daniel Kang
a513af4baa More refactoring and cosmetics to rdopt.c
Change-Id: I7803d719ead238189e75c52701c3bb6c1552f4b5
2012-08-07 16:41:55 -07:00
Daniel Kang
342040a6a6 Reorganiziation of the RD loop to make more sense.
Change-Id: Ia1e3b0ff9b70747b3725391de59f230edab767d7
2012-08-07 16:41:51 -07:00
Daniel Kang
4e7ce15351 Minor cosmetic changes to rdopt.c.
Change-Id: Ib7b972486ccbbcb82fa4c05a5f6d7f8aaec32155
2012-08-07 16:41:14 -07:00
Daniel Kang
78d33cad9a Combine vp8_block_error_c and vp8_submb_error_c.
Change-Id: I58792bac6c7e5a524a6dcdb5241ef18bcc0c3a45
2012-08-07 15:38:12 -07:00
Yaowu Xu
8b2f57d0b8 a new way of determining reference motion vector
Using surrounding reconstructed pixels from left and above to select
best matching mv to use as reference motion vector for mv encoding.

Test results:
       AVGPSNR  GLBPSNR VPXSSIM
Derf:  1.107%   1.062%  0.992%
Std-hd:1.209%   1.176%  1.029%

Change-Id: I8f10e09ee6538c05df2fb9f069abcaf1edb3fca6
2012-08-07 11:25:57 -07:00
Jingning Han
66f440f1ee Refactoring hybrid transform coding
The forward and inverse hybrid transforms are now performed using
single function modules, where the dimension is sent as argument.

Added an inline function clip8b to clip the reconstruction pixels
into range of 0-255.

Change-Id: Id7d870b3e1aefc092721c80c0af6f641eb5f3747
2012-08-06 17:26:21 -07:00
Daniel Kang
106815f830 Remove code to set transform size.
It's reset in calling functions.

Change-Id: Ia5df086de615aac6feb3c911fe298626a002b850
2012-08-06 16:39:05 -07:00
Daniel Kang
6630895daf Combine cost_coeffs functions.
Change-Id: I3421d07fdcf2148d75c8dbfc8c44bc2d96a3a8f6
2012-08-06 16:22:15 -07:00
Daniel Kang
9921b55b22 Merge token_costs into a single table.
Change-Id: Id1ea2d543f12d4589df7038d5fb7bac1fee4da11
2012-08-06 15:55:54 -07:00
Daniel Kang
680af9acd5 More refactoring of RD cost to make later changes easier.
Change-Id: Ia6a290a6a53fdb88c971bea2de47ac73dcb7a364
2012-08-06 15:55:54 -07:00
Daniel Kang
02f3aaf76c Minor refactoring of RD cost functions.
Change-Id: I876955b1d577321b5cd3f71e3fb2c4083ad5111b
2012-08-06 15:55:54 -07:00
Deb Mukherjee
2af5473a90 Merging in high_precision_mv experiment
Merged in the high_precision_mv experiment to make it easier
to work on new mv encoding strategies. Also removed
coef_update_probs3().

Change-Id: I82d3b0bb642419fe05dba82528bc9ba010e90924
2012-08-03 13:38:49 -07:00
Jingning Han
fcbff9ee04 Replacing the 8x8 DCT with 8x8 ADST/DCT for I8x8
Fixed the code review comments.

Under the htrans8x8 experiment the 8X8 DCT in the
I8X8 mode is replaced with a combination of 8X8 ADST and
DCT.

Overall coding gains with the htrans8x8 experiment are:
derf:   0.486
std-hd: 1.040
hd:     1.063
yt:     0.506

Note that part of the gain comes from bigger transforms
(8x8 instead of 4x4) and part comes from replacing the DCT
wth the ADST.

Change-Id: I92ca6bbfce11b4165d612b81d9adfad4d010c775
2012-08-03 12:02:07 -07:00
Daniel Kang
fed8a1837f 16x16 DCT blocks.
Set on all 16x16 intra/inter modes

Features:
- Butterfly fDCT/iDCT
- Loop filter does not filter internal edges with 16x16
- Optimize coefficient function
- Update coefficient probability function
- RD
- Entropy stats
- 16x16 is a config option

Have not tested with experiments.

hd:     2.60%
std-hd: 2.43%
yt:     1.32%
derf:   0.60%

Change-Id: I96fb090517c30c5da84bad4fae602c3ec0c58b1c
2012-08-02 17:33:10 -07:00
Ronald S. Bultje
d15b07d8c6 A few more conversions from 32-bit to 64-bit RD calculations.
Change-Id: Ida01bb8f4b35fde24b0f096329d326833f1fdc7e
2012-08-02 11:01:48 -07:00
Ronald S. Bultje
a4ad3809e2 Make RDCOST() results 64-bit.
This prevents various integer overflows that several of us have been
seeing in the past few days.

Change-Id: If0020613a608e13d311b7838796c7ad53cb97255
2012-08-02 10:26:11 -07:00
Jingning Han
c7846ebc34 Use 8x8 DCT transform for I8X8 prediction mode
Apply 2D-DCT transform of dimension 8x8 to encode prediction
residuals of I8X8 mode.
Brought back block type 3 probability context model for 8x8 tokens,
which is used for the coefficients of Y blocks in I8x8 modes. The
coefficient costs estimate of I8X8 mode in rate-distortion is also
changed appropriately.
Performance results:
derf:   0.246
yt:     0.114
std-hd: 0.730
hd:     0.670

Change-Id: If1d970eeb4e1827c9f0d2c5b27d33089b347ea27
2012-08-02 09:09:17 -07:00
Deb Mukherjee
5259744145 Adds support for switchable interpolation filters.
Allows for swtiching/setting interpolation filters at the MB
level. A frame level flag indicates whether to use a specifc
filter for the entire frame or to signal the interpolation
filter for each MB. When switchable filters are used, the
encoder chooses between 8-tap and 8-tap sharp filters. The
code currently has options to explore other variations as well,
which will be cleaned up subsequently.

One issue with the framework is that encoding is slow. I
tried to do some tricks to speed things up but it is still slow.
Decoding speed should not be affected since the number of
filter taps remain unchanged.

With the current version, we are up 0.5% on derf on average but
some videos city/mobile improve by close to 4 and 2% respectively.
If we did a full-search by turning the SEARCH_BEST_FILTER flag
on, the results are somewhat better.

The framework can be combined with filtered prediction, and I
seek feedback regarding that.

Rebased.

Change-Id: I8f632cb2c111e76284140a2bd480945d6d42b77a
2012-07-30 11:33:43 -07:00
Deb Mukherjee
9984a155d6 Merges several experiments
The following five experiments are merged:

newentropy
newupdate
adaptive_entropy (also includes a couple of parameter changes
                  that improves results a little
                  in common/entropymode.c and encoder/modecosts.c
                  that were not merged from the internal branch)
newintramodes
expanded_coef_context

Change-Id: I8a142a831786ee9dc936f22be1d42a8bced7d270
2012-07-27 12:12:39 -07:00
Jingning Han
9824230fe3 Adds hybrid transform
Adds ADST/DCT hybrid transform coding for Intra4x4 mode.
The ADST is applied to directions in which the boundary
pixels are used for prediction, while DCT applied to
directions without corresponding boundary prediction.

Adds enum TX_TYPE in b_mode_infor to indicate the transform
type used.

Make coding style consistent with google style.
Fixed the commented issues.

Experimental results in terms of bit-rate reduction:
derf:   0.731%
yt:     0.982%
std-hd: 0.459%
hd:     0.725%

Will be looking at 8x8 transforms next.

Change-Id: I46dbd7b80dbb3e8856e9c34fbc58cb3764a12fcf
2012-07-19 13:02:57 -07:00
Yaowu Xu
11e23e673d cleanup experiments in configure
this commit removes a number of experiment options from configure
script. the associated experiments are already fully merged, the
options in configure script have no effect at all.

Change-Id: I8054ccaee0a04610162ed76ac9e59c4538217113
2012-07-17 22:34:07 -07:00
John Koleszar
c6b9039fd9 Restyle code
Approximate the Google style guide[1] so that that there's a written
document to follow and tools to check compliance[2].

[1]: http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml
[2]: http://google-styleguide.googlecode.com/svn/trunk/cpplint/cpplint.py

Change-Id: Idf40e3d8dddcc72150f6af127b13e5dab838685f
2012-07-17 11:46:03 -07:00
Ronald S. Bultje
6c0b21c075 Use 8x8 transform for all 16x16 intra prediction modes in keyframes.
Also use the 8x8 transform in the RD loop.

Change-Id: If1a25aa15d3f64e05c9a31875e309d8cd5bc812d
2012-07-16 12:22:36 -07:00
Christian Duvivier
5a5ced3e79 Get rid of some cast.
Change-Id: Iff5ccf2400bcb7b78c7b70f289ea65c982efddd5
2012-06-29 15:15:00 -07:00
Christian Duvivier
c5b70370dc Fix warnings.
Change-Id: I6dd27a0ea661e6f10a55d7841021b66ae4fc72ae
2012-06-29 14:46:11 -07:00
Adrian Grange
bbc926dca2 Added Prediction Filter to Mode Selection
Added the ability to optionally filter the prediction data
when inter modes are selected (excludes SPLITMV, for now).

The mode selection loop considers both the filtered and
non-filtered prediction data when choosing mode. The filter
can be turned on/off at the frame-level, or signaled for
each MB.

Change-Id: I1b783c71d95a361ab36c761b07e8a6b06bc36822
2012-06-27 14:51:41 -07:00
Deb Mukherjee
f3dff40255 Continued adaptive entropy coding
Incorporates mv_ref, mbsplit and second_mv into the adaptive
entropy framework. The mv_ref framework has been modified from
before.

Adds some clean-ups and fixes.

Results with the adaptive entropy experiment are currently up by
+1.93% on derf; +2.33% std-hd and +1.87% yt-hd.

Fixed a nasty intermittent bug.

Change-Id: I4b1ac9f9483b48432597595195bfec05f31d1e39
2012-06-25 18:09:54 -07:00
Christian Duvivier
e0a338c428 Fix a bunch of warnings.
Change-Id: I883b4f63559c1cf66a25016e946b1b1ae98a20da
2012-06-18 17:30:36 -07:00
Ronald S. Bultje
0b8a95a0b2 Rewrite reference frame costing in the RD loop.
I now see I didn't write a very long description, so let's do it
here then. We took a pretty big quality hit (0.1-0.2%) from my
recent fix of the inversion of arguments to vp8_cost_bit() in the
RD reference frame costing. I looked into it and basically the
costing prevented us from switching reference frames. This is of
course silly, since each frame codes its own prob_intra_coded, so
using last frame cost indications as a limiting factor can never
be right.

Here, I've rewritten that code to estimate costings based partially
on statistics from progress on current frame encoding. Overall,
this gives us a ~0.2%-0.3% improvement over what we had previously
before my argument-inversion-fix, and thus about ~0.4% over current
git (on derf-set), and a little more (0.5-1.0%) on HD/STD-HD/YT.

Change-Id: I79ebd4ccec4d6edbf0e152d9590d103ba2747775
2012-05-15 15:32:44 -07:00
Deb Mukherjee
c5ddb7f016 Adds new Directional Intra prediction modes.
Adds 6 directional intra predictiom modes for 16x16 and 8x8 blocks.

Change-Id: I25eccc0836f28d8d74922e4e9231568a648b47d1
2012-05-15 08:54:50 -07:00
Yaowu Xu
54cf1d9ad3 a number of fixes to entropy stats collection
1. block types
There are only three types of blocks for 8x8 transformed MBs, i.e. Y
block with DC does not exist for 8x8 transformed MBs as all MB using
8x8 transform have 2nd order haar transform. This commit introduced
a new macro BLOCK_TYPES_8X8 to reflect such fact.

2. context counters
This commit also fixed the mixed of context_counters between 4x4 and
8x8 transformed MBs. The mixed use of the counters leads me to think
the existing the context probabilities were not properly generated
from 8x8 transformed MBs.

3. redundant collecting in recoding
The commit also corrected the code that accumulates entropy stats by
making sure stats only collected for final packing, not during the
recode loop

Change-Id: I029f09f8f60bd0c3240cc392ff5c6d05435e322c
2012-05-08 14:13:22 -07:00
Deb Mukherjee
813c6c3925 Expanding the coefficient encoding contexts
This patch expands the set of prev contexts used for video coding
from 3 to 4.

There is a small improvement of the order of 0.08% for derf and
0.15% on the HD set. The tests were rerun after the various merges
last week. There are two columns in each test - the first are the
results with the mbskip change, and the second with expanded contexts
added on top of that.

Derf:
http://www.corp.google.com/~debargha/vp8_results/explibvpx_newentropy_expcontext.html

HD:
http://www.corp.google.com/~debargha/vp8_results/explibvpx_hd_newentropy_expcontext.html

Rebased.

Broke up 80 char lines.

Change-Id: I82d2e72d054e530cbf5ce9aa0e6d85c582965675
2012-05-04 07:11:38 -07:00
Ronald S. Bultje
0f68789c24 Fix inversion of probability and value in calls to vp8_cost_bit().
Change-Id: I9f1686249ac812f7b9b872eabe3970d1dfb25e56
2012-04-30 16:33:07 -07:00
Yaowu Xu
a16608aba0 Merge QIMODE experiment
This commit merge the QI mode experiment. As the experiment affects
the encoding of intra coding modes on key frame only, the overall
effect of the experiment on encoding tests is insignificant.

Change-Id: I9e4e3933adface88867ad429cee3986e529c511d
2012-04-25 14:18:25 -07:00
Ronald S. Bultje
2210767c3f Hide some code behind CONFIG_COMP_INTRA_PRED.
Change-Id: I7c0597dede20cc71145c053f76bd99aaf759d144
2012-04-20 15:27:47 -07:00
Yaowu Xu
ecc28cdaa3 added reset of rate estimates for each mode
This is to prevent the evaluation of a mode from using values left
over from a mode evaluated prior in the loop.

Change-Id: Ife2c6ceb76d2f7365fd262515d3ae48229033c2d
2012-04-20 09:17:58 -07:00
Ronald S. Bultje
18433aef17 Compound prediction for splitmv macroblocks.
Change-Id: I0af3395500b1cb0ed629249eb6636a0c9322cb18
2012-04-18 14:05:39 -07:00
Adrian Grange
fa589adc5f Added save coding context & modified MV bounds
Added code to save the coding context in vp8_rd_pick_inter_mode
when the coding mode is forced to ARF(0,0).

Also, modified the MV bounds computation to comply with the
change in MV border from 32 to 64 pixels.

Change-Id: I96963a6f5f4d04ce84c807ae11e0635177c3ad6c
2012-04-13 10:26:49 -07:00
Yaowu Xu
636b2f385e a set of minor fixes
This commit tries to address an issue related to the oddity shown on
HD _mobcal clip, where some rather ugly blocks shown in the second
frame at low-mid bit rates if the third frame is not made a key frame
by he encoder. The fixes include: 1)  made calls to sad_16x16 to be
consistent with function prototype. 2) remove the error bias to intra
and golden in mbgraph search. 3) changed the error accumulation on
inter_segment encoding to avoid potential out-of-range. 1) has no
effect on encoding results.

Encoding test show that the overall effect of the commit helps about
.2%(HD) to .3%(cif)

Change-Id: I930975a2d0c06252f01c39e0a02351529774e30b
2012-04-12 13:41:54 +01:00
Yaowu Xu
d56acae660 changed function prototype for macro_block_yrd
This commit has made macro_block_yrd_8x8 and macro_block_yrd_8x8 to
take same parameters. It also removed a few unnecessary shifts that
has the potential to create out-of-range distortion values.

Change-Id: I4ec5afb307c3685c2a67a07c2850f0927d214455
2012-04-12 11:40:18 +01:00
Paul Wilkins
f2ec452fbc Changes to costing of skip.
Update the costing of skip in the recode loop and rd code.

Change-Id: I2e5ebbd7ddf201212b32441321e12626cd0423e9
2012-04-11 14:37:48 +01:00
Paul Wilkins
a3392d5718 T8x8 zbin and rate control changes.
Some adjustments to zbin for t8x8.
Changes to rules for sizing forced key frames.
Some extra stats output in tmp.stt.

Approximate  gain on YT-hd set 0.5%

There are still issues in sizing key frames and gf/arf frames
when the image is largely static. These in part relate to
problems with cost estimates in the recode loop.

Change-Id: I6f0159dc8a8faeab4115a19c668d442491619a68
2012-04-11 13:13:28 +01:00
Adrian Grange
9daf3154db Superblock encoding order
This is the first patch to add superblock (32x32) coding
order capabilities. It does not yet do any mode selection
at the SB level, that will follow in a further patch.

This patch encodes rows of SBs rather than
MBs, each SB contains 2x2 MBs.

Two intra prediction modes have been disabled since they
require reconstructed data for the above-right MB which
may not have been encoded yet (e.g. for the bottom right
MB in each SB).

Results on the one test clip I have tried (720p GIPS clip)
suggest that it is somewhere around 0.2dB worse than the
baseline version, so there may be bugs.

It has been tested with no experiments enabled and with
the following 3 experiments enabled:
  --enable-enhanced_interp
  --enable-high_precision_mv
  --enable-sixteenth_subpel_uv
in each case the decode buffer matches the recon buffer
(using "cmp" to compare the dumped/decoded frames).
Note: Testing these experiments individually created
errors.

Some problems were found with other experiments but it
is unclear what state these experiments are in:
  --enable-comp_intra_pred
  --enable-newentropy
  --enable-uvintra

This code has not been extensively tested yet, so there
is every likelihood that further bugs remain. I also
intend to do some code cleanup & refactoring in tandem
with the next patch that adds the 32x32 modes.

Change-Id: I1eba7f740a70b3510df58db53464535ef881b4d9
2012-04-11 10:40:57 +01:00
Deb Mukherjee
57d953479b Adding contextual coding of mb_skip_coeff flag.
Using contextual coding of the mkb_skip_coeff flag using the
values of this flag from the left and above. There is a small
improvement of about 0.15% on Derf:
http://www.corp.google.com/~debargha/vp8_results/mbskipcontext.html

Refactored to use pred_common.c by adding a new context type.

Results on HD set (about 0.66% improvement):
http://www.corp.google.com/~debargha/vp8_results/mbskipcontext_hd.html

Incliding missing refactoring to use the pred_common utilities.

Change-Id: I95373382d429b5a59610d77f69a0fea2be628278
2012-03-21 03:55:44 -07:00
Paul Wilkins
68033ca472 Snapshot candidate
Pulled out super block code for the snapshot as this
is not quite ready and will need an extensive re-merge.

Change-Id: I436369b511257447a7b0ea064016cb63f5011849
2012-03-07 11:24:33 +00:00
Jim Bankoski
157f15e1d3 Imported a change from stable branch
https://gerrit.chromium.org/gerrit/#change,17319 fixes cost estimating
to take skip_eob into account. No quality difference seen on derf set
tests, but about .4% gain on STD_HD set.

Change-Id: Ic5fe6d35ee021e664a6fcd28037b8432a0e470ca
2012-03-06 12:20:34 -08:00
Ronald S. Bultje
c3f5b2931b Use per-MB compound intra prediction.
This gives a modest gain on derf overall, although at low bitrates the
cost is still too high, so this can be improved further.

Patch 2. Re-base and fix 80 column issues

Change-Id: Ida2f9fa3fe75370669f6a27b37108dc602231c63
2012-03-05 15:23:10 +00:00
Yaowu Xu
6898e8b7ab Changed how UV r/d estimates are done for Intra Modes
The commit changed to compute UV intra RD estimates for 4x4 and 8x8
separately to be used in mode decision for MB modes associated with
the appropriate transform size respectively. Now finally after many
other changes related 8x8 quantizer zbin boost and zbin_mode_boost,
this change overall helps the HD(with 8x8) by around ~.13%.
(avg .13%  glb .13% ssim .17%)

The commit also has a few changes for eliminating compiler warnings.

Change-Id: Ibab35dad44820c87e6b44799c66f8d519cc37344
2012-03-05 13:16:41 +00:00
Yaowu Xu
eaa955ba98 Fixed zbin_mode_boost initialization
The commit added the correct Zbin_mode_boost initialization based on
Intra Mode before using rate distortion to pick UV intra mode.

Change-Id: I8e57878ff356a06672f6fa2431be860bf9b9a5c7
2012-03-05 13:10:49 +00:00