Commit Graph

106 Commits

Author SHA1 Message Date
Guillaume Martres
ff3aada6cb Add missing calls to emms in the adaptive quantization code
Also avoid using floating-point operations when adaptive quantization is
disabled.

Change-Id: I54936d7afb661df049cdb3ecd246d04ac2a9d8d3
2013-10-17 14:04:41 -07:00
Guillaume Martres
5b984b36ca Use a separate MODE_INFO stream for each tile column
This should make parallel tiles decoding easier to implement.

Change-Id: I6226456dd11f275fa991e4a7a930549da6675915
2013-10-16 16:24:48 -07:00
Guillaume Martres
acf0d56f0b Get rid of "this_mi", use "mi_8x8[0]" everywhere instead
The only case where they were intentionally pointing to different
structures was in mbgraph, and this didn't have the expected behavior
because both of these pointers are used interchangeably through the code

Change-Id: I979251782f90885fe962305bcc845bc05907f80c
2013-10-16 16:24:03 -07:00
Guillaume Martres
e55f60240a Implement variance-based adaptive quantization
This should be similar to what x264 does with --aq-mode 1.
It works well with clips like parkjoy and touhou
(http://x264.nl/developers/Dark_Shikari/LosslessTouhou.mkv).
At low bitrates, the segmentation signaling overhead may negate the
benefits of this feature.

(PGW) Default changed to feature OFF to allow provisional merge.
Change-Id: I938abf9bb487e1d4ad3b0264ea03d9826275c70b
2013-10-16 11:55:13 +01:00
Jingning Han
03fe08ca30 Deprecate the use of PARTITION_INFO from encoder
Use b_mode_info to store the inter prediction mode of sub8x8 block,
in replacement of the use of partition_info. Remove redundant buffer
update for partition_info. For bus_cif at 2000 kbps, this seem to make
speed 0 about 1% faster.

Change-Id: Id1b3be45e75a24fb4b42335ac480c23e440978f6
2013-10-09 09:23:52 -07:00
Jim Bankoski
92519a005a Merge "cpplint problems resolved with vp9_firstpass.c" 2013-10-07 09:16:46 -07:00
Jim Bankoski
30dee8adfc cpplint problems resolved with vp9_firstpass.c
Change-Id: Ic7b7014a0d857585bfd4baaea1d5c27ffe355642
2013-10-05 17:10:54 -07:00
Guillaume Martres
014a2c17df Fix first pass for non-square blocks
Change-Id: Ic049f0a6ce190f33859118e7b8cfcfe305979102
2013-10-04 12:04:15 -07:00
Yaowu Xu
35c5d79e6b Limit mv search range for first pass and mbgraph
Both first pass and mbgraph search use block size 16x16 for motion
estimation. This commit put a limit of motion vector range. The
effective range allows the entire 16x16 with required subpel
interpolation input to be completely outside image border, but
not any further away from image border.

Change-Id: Id70a5ed08be49e70959f064859d72adc7d775d08
2013-09-24 13:47:29 -07:00
Deb Mukherjee
d11221f433 Improves constant qual, constrained qual turned on
Adds modeled functions to decide the qp for altref frames in constant q
mode similar to other functions in use in bitrate mode.

Also turns on the constrained quality mode (end-usage=2) option which
was turned off before. Basic testing shows the mode works in principle,
to cap bitrate to the target-bitrate specified, while allowing lower
bitrate depending on the cq-level specified. The mode will need to be
improved over time.

Results for constant quality vs bitrate control mode:
derfraw300/fullderfraw: +3.0% at constant quality over bitrate control.
fullstdhdraw: +4.341%
stdhdraw250: +5.361%

Change-Id: If5027c9ec66c8e88d33e47062c6cb84a07b1cda9
2013-09-22 23:04:50 -07:00
Yaowu Xu
014acfa2af fix integer overflow errors
Change-Id: I76f440a917832c02d7a727697b225bac66b99f56
2013-09-19 08:14:26 -07:00
Scott LaVarnway
ac6093d179 New mode_info_context storage -- undo revert
mode_info_context was stored as a grid of MODE_INFO structs.
The grid now constists of pointers to MODE_INFO structs.  The
MODE_INFO structs are now stored as a stream (decoder only),
eliminating unnecessary copies and is a little more cache
friendly.

Change-Id: I031d376284c6eb98a38ad5595b797f048a6cfc0d
2013-09-11 13:45:44 -04:00
Yunqing Wang
939791a129 Modify encode breakout for static frames
Thank Paul for the suggestions. While turning on static-thresh
for static-image videos, a big jump on bitrate was seen. In this
patch, we detected static frames in the video using first-pass
stats. For different cases, disable encode breakout or reduce
encode breakout threshold to limit the skipping.

More modification need be done to break incorrect partition
picking pattern for static frames while skipping happens.

Change-Id: Ia25f47041af0f04e229c70a0185e12b0ffa6047f
2013-09-10 09:06:03 -07:00
James Zern
c1913c9cf4 Merge "Revert "New mode_info_context storage"" 2013-09-09 14:38:01 -07:00
James Zern
54a03e20dd Revert "New mode_info_context storage"
This reverts commit dae17734ec

Encode crashes, leaks and increases integer overflow errors.

Change-Id: I595aa2649bb8d0b6552ff91652837a74c103fda2
2013-09-09 13:37:01 -07:00
Jim Bankoski
e378566060 Merge "New mode_info_context storage" 2013-09-08 07:16:25 -07:00
Deb Mukherjee
e378a89bd6 Support a constant quality mode in VP9
Adds a new end-usage option for constant quality encoding in vpx. This
first version implemented for VP9, encodes all regular inter frames
using the quality specified in the --cq-level= option, while encoding
all key frames and golden/altref frames at a quality better than that.

The current performance on derfraw300 is +0.910% up from bitrate control,
but achieved without multiple recode loops per frame.

The decision for qp for each altref/golden/key frame will be improved
in subsequent patches based on better use of stats from the first pass.
Further, the qp for regular inter frames may also be varied around the
provided cq-level.

Change-Id: I6c4a2a68563679d60e0616ebcb11698578615fb3
2013-09-06 10:30:53 -07:00
Scott LaVarnway
dae17734ec New mode_info_context storage
mode_info_context was stored as a grid of MODE_INFO structs.
The grid now constists of a pointer to a MODE_INFO struct and
a "in the image" flag.  The MODE_INFO structs are now stored
as a stream, eliminating unnecessary copies and is a little
more cache friendly.

For the test clips used, the decoder performance improved
by ~4.3% (1080p) and ~9.7% (720p).

Patch Set 2: Re-encoded clips with latest. Now ~1.7% (1080p)
and 5.9% (720p).

Change-Id: I846f29e88610fce2523ca697a9a9ef2a182e9256
2013-09-06 12:33:34 -04:00
Dmitry Kovalev
851a2fd72c Renaming txfm_size to tx_size.
Change-Id: I752e374867d459960995b24d197301d65ad535e3
2013-08-27 19:47:53 -07:00
Dmitry Kovalev
26e5b5e25d Removing unused or redundant arguments from *_args structures.
Redundant dst, pre[2] from build_inter_predictors_args, unused cm from
encode_b_args.

Change-Id: I2c476cd328c5c0cca4c78ba451ca6ba2a2c37e2d
2013-08-16 12:51:20 -07:00
Dmitry Kovalev
6f4fa44c42 Using { 0 } for initialization instead of memset.
Change-Id: I4fad357465022d14bfc7e13b348c6da267587314
2013-08-15 11:37:56 -07:00
Dmitry Kovalev
d007446b3f Replacing long block size enum values with shorter ones (2).
Change-Id: I428c4d42212b757112e3acfe5b81314cfbb5fd6b
2013-08-05 10:51:02 -07:00
Dmitry Kovalev
ce8dedc353 Cleanup: removing unused function arguments.
Change-Id: I27471768980fc631916069f24bc7c482a5c9ca17
2013-08-01 13:41:38 -07:00
Dmitry Kovalev
7131cb0e3d General cleanups.
Removing unused constants, macros, and function declarations. Using
ROUND_POWER_OF_TWO macro, vp9_zero, vp9_copy where possible. Moving
#include from *.h to *.c. Merging for loops for motion vectors.

Change-Id: Ic3bf841764a2bb177128bb3a6d7aa8f68229cd13
2013-07-25 14:13:48 -07:00
Ronald S. Bultje
5ebe503f04 Merge scale_factors and scale_factors_uv.
This prevents a duplicate memcpy of a 128-byte struct every time
set_scale_factors() is called (which is a lot), thus leading to a
decrease from 3.7 MB to 1.85 MB of struct copying per 64x64 block
RD/partition loop.

Overall, this decreases encoding time of the first 50 frames of bus
@ 1500kbps (speed 0) from 1min5.9 to 1min4.9, i.e. about a 1.5%
overall speedup. We can likely get more gains by removing the copy
of the other struct (and replacing it with an indexing) as well.

Change-Id: I3dceb7e79f71e6fe911b11cc994cf89a869dde7a
2013-07-18 14:10:56 -07:00
James Zern
9581eb6e8a use consistent framerate naming
s/frame_rate/framerate/g

Change-Id: I6fc3e088e419c5f46e3a9390dd8a2cad2677a2fc
2013-07-16 14:12:47 -07:00
Deb Mukherjee
94c481f9f1 Some minor cleanups for efficiency
Implements some of the helper functions more efficiently with
lookups rathers than branches. Modeling function is consolidated
to reduce some computations.

Also merged the two enums BLOCK_SIZE_TYPES and BlockSize into
one because there is no need to keep them separate (even though
the semantics are a little different).

No bitstream or output change.

About 0.5% speedup

Change-Id: I7d71a66e8031ddb340744dc493f22976052b8f9f
2013-07-12 10:22:56 -07:00
Dmitry Kovalev
f72e072555 Refactoring setup_pre_planes function.
Removing set_refs, adding set_ref function.

Change-Id: I5635c478b106ae4e57d317f1c83d929644307e63
2013-07-03 17:42:01 -07:00
Dmitry Kovalev
1ac0540296 Removing vp9_mbpitch.c, moving vp9_setup_block_dptrs to vp9_block.h.
Change-Id: Ia547a5dd7650b771fd00edd673ab9f920270731c
2013-07-01 17:28:08 -07:00
Jingning Han
bd9bac0391 Remove empty function vp9_build_block_offsets
This function is empty, hence is removed.

Change-Id: Ia9d01710806bffe0398a6dc9405f8a5a81b27d74
2013-06-26 14:55:47 -07:00
Jim Bankoski
f954490bbf disable speed > 1 speed corrections in firstpass
need to rework these

Change-Id: I17dc2c88d2faadd2f8fb117c52c25f04ea2e9856
2013-06-20 09:34:03 -07:00
Ronald S. Bultje
3993d30922 Merge "Fix firstpass if framesize is not a multiple of 16." into experimental 2013-06-08 17:40:17 -07:00
Ronald S. Bultje
073c7d5eec Fix firstpass if framesize is not a multiple of 16.
Change-Id: Iec41736c2b6140715f90f40de5ae6cf52497a9b8
2013-06-08 13:32:05 -07:00
Jingning Han
c0167cbbc2 Fix mv range border in pixels
WIP: trying to resolve the mismatch issue in extending frame
dimension into multiples of 8.

Change-Id: I24e7638ab3c50e21e6969c1eeed4f607d6f11f65
2013-06-07 15:49:30 -07:00
Ronald S. Bultje
6ef805eb9d Change ref frame coding.
Code intra/inter, then comp/single, then the ref frame selection.
Use contextualization for all steps. Don't code two past frames
in comp pred mode.

Change-Id: I4639a78cd5cccb283023265dbcc07898c3e7cf95
2013-06-06 17:28:09 -07:00
Dmitry Kovalev
3b9ec31eaf Replacing memcpy with struct assignment.
Change-Id: Ib557cc6351404b9e178e95a545883eb3666f11f0
2013-05-31 16:00:32 -07:00
Ronald S. Bultje
1efa79d32f Remove i4x4_pred.
It remains as a local define in rdopt.c so we can distinguish between
split and non-split modes in the RD loop, but disappears outside that
scope in the codec.

Change-Id: I98c18fe5ab7e4fbd1d6620ec5695e2ea20513ce9
2013-05-30 16:44:58 -07:00
John Koleszar
16ac5a5cde Remove vp9_extend_mb_row()
This code is no longer needed for correct intra prediction.

Change-Id: I822d1a8b0ad0a00e7c4c6e7b2931790c39d1267d
2013-05-16 11:56:00 -07:00
John Koleszar
418564e7d0 Add vp9_extend_frame_borders
Adds a subsampling aware border extension function. This may be reworked
soon to support more than 3 planes.

Change-Id: I76b81901ad10bb1e678dd4f0d22740ca6c76c43b
2013-05-15 20:58:26 -07:00
Jingning Han
9e49ba05f4 Fix first-pass encoding test
Always initialize the mode_info with sb_type of BLOCK_SIZE_MB16X16
for the first-pass encoding test.

Change-Id: Ic86393eeef981bdd523a5b44cfac3f0b24c068b7
2013-05-15 14:15:21 -07:00
Dmitry Kovalev
ce70ad5967 Merge "Code cleanup inside vp9_firstpass.c." into experimental 2013-05-13 21:46:14 -07:00
John Koleszar
64667d5af7 Merge "Subsampling aware allocs and bitstream" into experimental 2013-05-10 16:55:00 -07:00
John Koleszar
da58436f43 Subsampling aware allocs and bitstream
Make framebuffer allocations according to the chroma subsamping
factors in use. A bit is placed in the raw part of the frame header for
each of the two subsampling factors. This will be moved in a future
commit to make them part of the TBD feature set bits, probably only set
on keyframes, etc.

Change-Id: I59ed38d3a3c0d4af3c7c277617de28d04a001853
2013-05-09 17:50:12 -07:00
John Koleszar
236ec08cd0 Make firstpass encode Y-only
The chroma planes are not used during the first pass encode,
but the vp9_encode_sb() function was operating on them anyway.
This was causing the use of uninitialized memory.

Change-Id: I5ebafcd3d5e34ed91a8336dad159b573995a939f
2013-05-09 10:46:40 -07:00
Dmitry Kovalev
dc5418050a Code cleanup inside vp9_firstpass.c.
Change-Id: Ia2814402e3c2ec97c24c536c05f0f526fe1a431c
2013-05-08 18:13:46 -07:00
Dmitry Kovalev
b05247df95 Removing vp9_swap_yv12_buffer function and corresponding files.
Adding static swap_yv12 function to vp9_firstpass.c.

Change-Id: I7da9caab9720498db4a74c627901bf37816ed06c
2013-05-07 16:49:22 -07:00
Jingning Han
c0504a9b24 Merge "Merge SB8X8 into the codebase" into experimental 2013-05-07 09:23:47 -07:00
Jingning Han
776c1482a3 Merge SB8X8 into the codebase
Pull sb8x8 out of experimental list. verified via borg run tests.
Fixed unit test failures.

Change-Id: I12a4bbd17395930580c048ab68becad1ffe46e76
2013-05-07 09:08:25 -07:00
Scott LaVarnway
9c7d06e6f3 Merge "Removed vp9_setup_intra_recon()" into experimental 2013-05-07 08:24:26 -07:00
John Koleszar
6462eebbdd Remove heap alloc of FIRSTPASS_STATS
There is only one instance of these structures, no need for them
to be allocated separately on the heap.

Change-Id: I1333cc92d06bbe21be643c2b2f0e3936f0264cac
2013-05-06 14:36:08 -07:00