hui su [Wed, 15 Jun 2016 18:39:41 +0000 (11:39 -0700)]
Add a hardware compatibility feature
This commit adds an encoder workaround to support better
compatibility with a non-compliant hardware vp9 profile 2 decoder.
The known issue with this decoder is:
The decoder assumes a wrong value, 127 instead of the correct
value of 511 and 2047, for any assumed top-left corner pixel in
UV planes for 10 and 12 bit, respectively. Such assumed
top-left corner pixel is used for INTRA prediction when a real
decoded/reconstructed pixel is not avalable, e.g. when it is
located inside the row above the top row or inside the column
left to the leftest column of a video image.
Jingning Han [Sat, 18 Jun 2016 00:36:39 +0000 (17:36 -0700)]
Refactor optimize_b for speed performance
This commit refactors the trellis coefficient optimization process.
It saves multiplications used to generate the final dequantized
coefficients. It removes two memset operations on quantized
and dequantized coefficient sets. This improves the unit speed
by 10%.
Johann [Fri, 10 Jun 2016 21:59:26 +0000 (14:59 -0700)]
Parse codec options in order of occurrence.
Each time a codec is enabled or disabled with the umbrella
--enable-vpN flag, set the encoder and decoder configurations as well.
This was done as a post-processing step but doing that lost the order of
the arguments.
Tom Finegan [Wed, 15 Jun 2016 20:42:59 +0000 (13:42 -0700)]
Output frames in first pass for VPX_DL_REALTIME.
Since combining VPX_DL_REALTIME with VPX_RC_FIRST_PASS is basically
nonsense, ignore the user's pass setting when this happens and
behave as if the requested encode is a single pass encode.
Johann [Mon, 13 Jun 2016 18:51:21 +0000 (11:51 -0700)]
VP8_COMP: make frames_since_golden signed
This value is signed in vp9/10
Cleans warning in Android build:
comparison of integers of different signs: 'unsigned int' and 'int'
if (cpi->frames_since_golden == (cpi->current_gf_interval >> 1))
~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Johann [Thu, 16 Jun 2016 21:17:28 +0000 (14:17 -0700)]
vp8: correct function return types
left_above_mv and above_block_mv return as_int
as_int is defined as uint32_t in vp8/common/mv.h
Cleans up -Wextra warnings:
signed and unsigned type in conditional expression
this_mv->as_int = col ? d[-1].bmi.mv.as_int : left_block_mv(mic, i);
^
this_mv->as_int = row ? d[-4].bmi.mv.as_int : above_block_mv(mic, i, mis);
^
left_mv.as_int = col ? d[-1].bmi.mv.as_int :
^
Johann [Sat, 11 Jun 2016 01:09:04 +0000 (18:09 -0700)]
vp8_change_config: fix unsigned/signed comparison
Use ~15 instead of 0x..F0
Cleans warning in Android build:
comparison of integers of different signs: 'unsigned int' and 'int'
if (((cm->Width + 15) & 0xfffffff0) !=
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
comparison of integers of different signs: 'unsigned int' and 'int'
((cm->Height + 15) & 0xfffffff0) !=
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
Marco [Wed, 15 Jun 2016 21:20:32 +0000 (14:20 -0700)]
vp9: Adjustments to nonrd-pickmode for vbr
For VBR: (1) allow newmv mode for golden ref to
select interpolation filter (as in last ref case), and
(2) don't use the more aggressive tx-skip testing logic for large blocks.
Only affects 1 pass real-time vbr mode (speed >= 5).
PSNR/SSIM metrics on ytlive set are all positive, ~0.5-2% gain.
JackyChen [Wed, 15 Jun 2016 17:14:14 +0000 (10:14 -0700)]
vp9: Add bias to last frame in choose_partitioning.
This change is only for real-time mode if short_circuit_low_temp_var
is on. Add bias to last frame in choosing ref frame for partitioning,
when y_sad and y_sad_g are close. It speeds up real-time encoding by
0.5% on some clips with less than 0.1% overall PSNR drop on rtc test set.
Johann [Sat, 11 Jun 2016 01:00:34 +0000 (18:00 -0700)]
Match prev_ to number_of_layers
Defined as unsigned in VP8_CONFIG
Cleans warning in Android build:
comparison of integers of different signs: 'unsigned int' and 'int'
if (cpi->oxcf.number_of_layers != prev_number_of_layers)
~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~
Change-Id: I969e64cd2bfda6e61c564476dbd35b892b177646
Johann [Sat, 11 Jun 2016 01:17:18 +0000 (18:17 -0700)]
Active map and ROI map use unsigned rows/cols
The vpx_roi_map_t and vpx_active_map_t structures use unsigned rows
and cols but VP8_COMMON uses signed values for mb_rows and mb_cols.
Cleans warning in Android build:
comparison of integers of different signs: 'int' and 'unsigned int'
if (cpi->common.mb_rows != rows || cpi->common.mb_cols != cols)
~~~~~~~~~~~~~~~~~~~ ^ ~~~~
comparison of integers of different signs: 'int' and 'unsigned int'
if (cpi->common.mb_rows != rows || cpi->common.mb_cols != cols)
~~~~~~~~~~~~~~~~~~~ ^ ~~~~
comparison of integers of different signs: 'unsigned int' and 'int'
if (rows == cpi->common.mb_rows && cols == cpi->common.mb_cols)
~~~~ ^ ~~~~~~~~~~~~~~~~~~~
comparison of integers of different signs: 'unsigned int' and 'int'
if (rows == cpi->common.mb_rows && cols == cpi->common.mb_cols)
Johann [Mon, 13 Jun 2016 18:56:42 +0000 (11:56 -0700)]
Make new_qc signed
Mode is signed
Cleans warning in Android build:
comparison of integers of different signs: 'int' and 'unsigned int'
if (ctx->oxcf.Mode != new_qc)
~~~~~~~~~~~~~~ ^ ~~~~~~
JackyChen [Mon, 6 Jun 2016 23:30:14 +0000 (16:30 -0700)]
vp9: Encoding cycle reduction for speed 8.
1. Skip golden non-zeromv and newmv-last for bsize >= 16x16 if the
temporal variance obtained from choose_partitioning is very low.
2. Skip horz and vert INTRA mode for speed 8.
This change works best on the clips with little noise and with some
motion (e.g. gips_motion which has > 5% speed up). PSNR drop is 1.78%
on rtc test set, no obvious visual quality regression found.
James Zern [Thu, 9 Jun 2016 00:33:34 +0000 (17:33 -0700)]
fdct8x8_test: fix unsigned overflow
the difference between src and dst will be signed, the error will be
unsigned.
quiets -fsanitize=integer:
unsigned integer overflow: 4294967295 * 4294967295
James Zern [Thu, 9 Jun 2016 00:29:02 +0000 (17:29 -0700)]
fdct4x4_test: fix unsigned overflow
the difference between src and dst will be signed, the error will be
unsigned.
quiets -fsanitize=integer:
unsigned integer overflow: 4294967295 * 4294967295
Marco [Wed, 8 Jun 2016 20:03:29 +0000 (13:03 -0700)]
vp9: Use nonrd_pick_partition on scene-cut, for speed 5 vbr mode.
On scene-cut detected frames (i.e., high_source_sad = 1), use
nonrd_pick_partition (over choose_part + select_part), as
the nonrd_pick partitioning is generally better.
Small positive increase in metrics on ytlive set (~0.5 - 1%).
Negligle overall speed decrease, as its only used on scene-cut frames.
Marco [Mon, 6 Jun 2016 18:42:09 +0000 (11:42 -0700)]
vp9: Small ajustment to settings gf_interval, 1 pass vbr.
Add a max condition and lower the min value.
No change in behavior (metrics for yt live set) for the
default min/max_gf_interval=4/16 settings.
Small positive change when min/max_gf_interval=7/16
(for 60fps clips on ytlive set).