Commit Graph

337 Commits

Author SHA1 Message Date
Pengchong Jin
cdc954fdc8 skip the un-necessary motion search in the first pass
This patch allows the VP9 encoder to skip the un-necessary
motion search in the first pass. It computes the motion error
of 0,0 motion using the last source frame as the reference,
and skips the further motion search if this error is small.

Borg test shows overall the patch gives PSNR gain (derf -0.001%,
yt 0.341%, hd 0.282%). Individual clips may have PSNR gain or
loss. The best PSNR performance is 7.347% and the worst is -0.662%.
The first pass encoding speedup for slideshow clips is over 30%.

Change-Id: I4cac4dbd911f277ee858e161f3ca652c771344fe
2014-06-16 10:16:27 -07:00
Yunqing Wang
feaae409c8 Merge "Revert "skip un-neccessary motion search in the first pass"" 2014-06-13 15:21:26 -07:00
Dmitry Kovalev
bcfbd2f948 Replacing RC_MODE with vpx_rc_mode.
Both enums are identical.
Change-Id: I06653f9c90a2d3a2dd5c741e75b17ee7d066a56f
2014-06-13 12:22:35 -07:00
Paul Wilkins
af8d4054d6 Revert "skip un-neccessary motion search in the first pass"
This patch appears to have introduced non-determinism and/or
mismatch from debug vs release.

This reverts commit 5daef90efc.

Change-Id: I80081e55cfeaaa821b510b58a4e6e6328003c7da
2014-06-13 18:53:36 +01:00
Paul Wilkins
3082565b8d Merge "Cleaning up accumulate_frame_motion_stats()." 2014-06-13 02:27:03 -07:00
Dmitry Kovalev
48f0935b81 Merge "Removing unused ssim_weighted_pred_err field from FIRSTPASS_STATS." 2014-06-12 14:16:18 -07:00
Dmitry Kovalev
86583b2bec Adding is_altref_enabled() function.
Change-Id: I54cdb4ce11590511e6f86bc2fd55771f1c18a20a
2014-06-12 12:13:20 -07:00
Dmitry Kovalev
eaeda536a4 Removing unused ssim_weighted_pred_err field from FIRSTPASS_STATS.
Change-Id: Ia8c7e3905ac21732cb6b8099eaf8df72c7e36b73
2014-06-12 11:28:54 -07:00
Yunqing Wang
f9d1e66f6a Merge "skip un-neccessary motion search in the first pass" 2014-06-12 09:43:47 -07:00
Pengchong Jin
5daef90efc skip un-neccessary motion search in the first pass
This patch allows the encoder to skip the
un-neccessary motion search in the first pass. It
calculates the error of the zero motion vector using
the last source frame as reference and skips the
further motion search in the first pass if the error
is small.

The encoding speedup of the first pass for slideshow
videos is over 30%. Borg test shows the overall PSNR
performance remain approximately the same (derf -0.009,
hd 0.387, yt 0.021, stdhd 0.065). Individual clips may
have either PSNR gain or loss. The worst PSNR perfomance
is from yt set, with a PSNR loss of -1.1.

Change-Id: I08b2ab110b695e4689573b2567fa531b6457616e
2014-06-12 08:55:52 -07:00
Adrian Grange
b447b9d978 Merge "Revert "Removing this_frame_stats member from TWO_PASS struct."" 2014-06-06 14:03:52 -07:00
Adrian Grange
a4f747921a Revert "Removing this_frame_stats member from TWO_PASS struct."
Use of stack frame variable "fps" beyond the lifetime of the function.

fps is sent as a paremeter to output_stats and stored in the
packet holding this encoded frame. This has scope beyond the
lifetime of the calling function.

This reverts commit 3f95a230c7

Change-Id: Icd8e14b3d7dd733590ada12e619b9dce95b6b0f5
2014-06-06 12:51:56 -07:00
Dmitry Kovalev
6cf3d68fe5 Cleaning up accumulate_frame_motion_stats().
Change-Id: I9986f3fd23c5e0677068af768eae0def3db9782f
2014-06-03 10:36:29 -07:00
Dmitry Kovalev
ebd4e47aa6 Merge "Moving first pass related functions to vp9_firstpasss.c." 2014-06-03 10:05:38 -07:00
Paul Wilkins
d009c2360e Merge "Re-factor some duplicate code." 2014-05-30 06:14:06 -07:00
Paul Wilkins
15600eb8b8 Merge "Removing this_frame_stats member from TWO_PASS struct." 2014-05-28 08:07:50 -07:00
Paul Wilkins
39c91d84ed Re-factor some duplicate code.
Change-Id: I89a1dbea39c50c7633f746d9c93fec3a289f1b42
2014-05-28 14:15:45 +01:00
Dmitry Kovalev
3f95a230c7 Removing this_frame_stats member from TWO_PASS struct.
Change-Id: Id8877fad1f1e88b145e7c40c43174109b9c4f373
2014-05-27 17:09:28 -07:00
Paul Wilkins
f085d128f7 Remove brightness weighting in two pass.
This code dates from the ancient past and
applied an error score weighting based on pixel
brightness. This not seem to be providing any
benefit metrics wise and could be making some
visual issues in dark frames worse.

The field is left in place in the FIRSTPASS_STATS data
structure in this patch, pending changes to unit tests that
use a pre-defined first pass file.

Change-Id: Id50f04205230234858e7548ce523f11acaf3567d
2014-05-27 13:27:49 +01:00
Paul Wilkins
1edbaeb09d Further first pass allocation changes.
Further changes to first pass allocation for gf/arf groups.
Three variables removed from TWO_PASS structure as only
now used locally. Dont adjust gf_group_bits in the post
encode update as this will no longer have any effect.

Change-Id: Iff89b225db923fc856f5d2aedbc899f1d7d68b55
2014-05-23 20:21:25 +01:00
Paul Wilkins
03eb06212a Re-factor bit allocation in first pass.
Restructuring to allocate the bits for each frame in
a GF group at the time the group is defined.

At the moment the allocation closely mirrors what
we had before.

Also changes the default rate adjustment method to
LONG_TERM_VBR_CORRECTION.

Change-Id: Ie5793c46c6b9c888cead5d8790792efd7d60b7c1
2014-05-23 18:01:54 +01:00
Dmitry Kovalev
d1ad3b678b Merge "Adding several consts to assign_std_frame_bits()." 2014-05-22 19:26:39 -07:00
Dmitry Kovalev
639e16ee00 Merge "Cleaning up vp9_init_second_pass()." 2014-05-22 14:49:33 -07:00
Dmitry Kovalev
59948cc343 Merge "Cleaning up calculate_section_intra_ratio()." 2014-05-22 13:49:28 -07:00
Dmitry Kovalev
f738895099 Merge "Cleaning up calc_frame_boost()." 2014-05-22 13:05:23 -07:00
Dmitry Kovalev
b2be554351 Cleaning up vp9_init_second_pass().
modified_error_total from TWO_PASS struct is not required anymore.

Change-Id: I0e07cac1e6d1b6a78418116be725bcd72bfbd847
2014-05-22 13:04:43 -07:00
Dmitry Kovalev
0a6e42c241 Adding several consts to assign_std_frame_bits().
Change-Id: I6c27c60f7192b1b397f01882ab68a68cdf767534
2014-05-22 12:17:18 -07:00
Dmitry Kovalev
6e6f5881d8 Merge "Cleaning up calculate_modified_err()." 2014-05-22 12:09:48 -07:00
Dmitry Kovalev
da39b6a1af Cleaning up calc_frame_boost().
Change-Id: I3ba9374de96dc31fb4e736742603ef988d8aaa5f
2014-05-22 12:07:14 -07:00
Dmitry Kovalev
b8a65127ae Cleaning up calculate_section_intra_ratio().
Addition of reset_fpf_position() call fixes previous issue with this patch.

Change-Id: I356186d5a1032297a147194e81e9c7db252d14a6
2014-05-22 11:38:02 -07:00
Paul Wilkins
74a919a239 Revert "Cleaning up calculate_section_intra_ratio()."
Breaks rate control completely.

This reverts commit 9067b293b3.

Change-Id: I8f89e209cf7bd607f7de5c4872adcd57a9c5c72b
2014-05-22 14:30:41 +01:00
Dmitry Kovalev
7b3136c8d7 Moving first pass related functions to vp9_firstpasss.c.
Change-Id: I7ce717badf098d1dad14cb6677c0f811057f4bb1
2014-05-21 12:45:32 -07:00
Dmitry Kovalev
3971967c0b Merge "Cleaning up calculate_section_intra_ratio()." 2014-05-21 10:35:01 -07:00
Dmitry Kovalev
9067b293b3 Cleaning up calculate_section_intra_ratio().
Change-Id: I3258b789ce8c59fdfeaaca1acb9638b565e82a2a
2014-05-20 19:24:01 -07:00
Dmitry Kovalev
3b62aa4825 Cleaning up vp9_twopass_postencode_update().
Change-Id: Id79138f2dd472ee95c784b0eb2781d4037c51dd8
2014-05-20 14:44:02 -07:00
Dmitry Kovalev
f82ae7980b Cleaning up calculate_modified_err().
Change-Id: I87bb1876f8a04ef28cb7135b657815e12f2f31cb
2014-05-20 14:22:10 -07:00
Minghai Shang
7af3440268 [spatial svc] Remove some restrictions that are needed to improve the quality
Change-Id: I76a48b03388a8c5cc74b871deb836cd92263b306
2014-05-20 11:16:45 -07:00
Paul Wilkins
e9ed051c83 Merge "Cosmetic clean up." 2014-05-20 02:34:56 -07:00
Dmitry Kovalev
a822a2a566 Merge "Removing unused fields from twopass_rc struct." 2014-05-19 10:27:47 -07:00
Paul Wilkins
f07a96fdc1 Cosmetic clean up.
Use type TWO_PASS instead of "struct twopass".

Change-Id: I9d92920893bd436537b2ca19e9c9d355cca56c7c
2014-05-19 11:14:02 +01:00
Dmitry Kovalev
b043c3e081 Merge "Moving PC_TREE from MACROBLOCK to VP9_COMP." 2014-05-16 22:46:45 -07:00
Dmitry Kovalev
51545f5753 Moving PC_TREE from MACROBLOCK to VP9_COMP.
Because PC_TREE is encoder-level data, not MACROBLOCK-level data.

Change-Id: I4f620c0781acd3a2744860610117e74948e0b2b5
2014-05-16 10:17:13 -07:00
Dmitry Kovalev
79ba41903f Removing MACROBLOCKD dependency from loop filter.
Change-Id: I9ef40f3d95ab8f94f69e92ea25678a40956bc1ce
2014-05-16 09:48:26 -07:00
Yaowu Xu
7fc5e74232 Reuse precalculated result
Change-Id: Iff9efff6c9cb41f833cee40eae014bd4489a87d0
2014-05-15 18:40:13 -07:00
Yaowu Xu
21bb6ddb57 vp9_firstpass.c: clean -wextra warnings
Change-Id: Ic488fe6edbc119f475763d72a85809499df60106
2014-05-15 11:29:15 -07:00
Dmitry Kovalev
3181290ee8 Removing unused fields from twopass_rc struct.
Change-Id: Iaece070e9d1305ac3d8df9d3431fefa6e20ac0ec
2014-05-15 11:12:45 -07:00
Paul Wilkins
6122ca87a3 Simplify 2 pass KF bitrate allocation
Simplify the calculation of KF bitrate in similar way
to previous patch for GF/arf.

This has no impact on derf or std hd sets but gives a
small net gain of ~0.1% for yt and yt-hd sets.

Change-Id: Ida64ac1428d9c2a62adb67056fadbf0180eff030
2014-05-14 12:41:42 +01:00
Paul Wilkins
d677ea1f81 Further two pass clean up.
The variation in boost calculation for gf and arf groups
is not significant enough to justify the extra complexity.
Also removed some other spurious code that no longer
has much material impact.

The handling of the rare case, where the boost bits
number is less than the number of bits a that would
be allocated if a frame was not boosted, will be dealt
with in a subsequent patch.

This change actually helps on all sets a little by
~0.1% - 0.2% with slightly bigger gains on SSIM.

Change-Id: Id42c1ac22a80a8c4993cfa0e51bc733eb9ed4f75
2014-05-14 12:29:36 +01:00
Paul Wilkins
702e25839e Clean up of firstpass.c
Re-factor duplicate code.
Add two pass check for use of section_intra_rating as
it is un-initialised in the 1 pass and rt case.

Change-Id: I93120796f07961b8a21fb26e1a9f0d3d13949994
2014-05-12 12:32:42 +01:00
Paul Wilkins
00d54aa331 First pass clean up.
One of a series of changes to clean up two pass
allocation as precursor to support for multiple arf
or boosted frames per GF/ARF group.

This change pulls out the calculation of the total bits
allocated to a GF/ARF group into a function, to aid
readability and reduce the line count for define_gf_group().

This change should have no material impact on output.

Change-Id: I716fba08e26f9ddde3257e7d9b188453791883a3
2014-05-12 12:31:02 +01:00