Compare commits

...

5316 Commits

Author SHA1 Message Date
Jerome Jiang
0ae1628f7e vp9: fix multiple run for vp9 datarate tests using one bitrate.
Change-Id: I1458bf25fadc23e8be5a9532a153d7129a53accf
2018-04-16 14:31:49 -07:00
Jerome Jiang
d46f614ca9 Merge "vp9: refactor vp9 datarate test for better sharding." 2018-04-15 07:03:16 +00:00
Jerome Jiang
a6ff396576 vp9: refactor vp9 datarate test for better sharding.
Change-Id: Icfaf29e1ca847ba9e3748700c9e09383ce8d1f65
2018-04-13 22:39:30 -07:00
Jerome Jiang
2acb7fc1d3 Clean up is_two_pass_svc.
Change-Id: I9e92616471be380d3ba4e2b85399d7eb9f687d2f
2018-04-13 15:36:39 -07:00
Jerome Jiang
3cc90a6d18 Merge "vp9 svc: Refactor svc datarate test for better sharding." 2018-04-13 03:40:50 +00:00
Jerome Jiang
baefd61752 Merge "Silence warning when built with --enable-internal-stats." 2018-04-13 03:40:20 +00:00
Jerome Jiang
546a210259 Silence warning when built with --enable-internal-stats.
Change-Id: I3a600a9baf2b8e46c109f4ec2b5bd6bafda4bf58
2018-04-12 15:07:03 -07:00
Jerome Jiang
a08f27150d vp9 svc: Refactor svc datarate test for better sharding.
Wrap denoiser tests under config flags.

Change-Id: I6175c3c9d8b5b079ad35a55553383145db58a10f
2018-04-12 14:40:45 -07:00
Paul Wilkins
768b018d18 Merge "Add extra case to wq_err_divisor()" 2018-04-12 10:42:50 +00:00
James Zern
c9a459216d vpx_image: remove unused image formats
libvpx only emits:
VPX_IMG_FMT_{I420,I422,I440,I444,I42016,I42216,I44016,I44416}
and additionally supports YV12 as input.

interleaved yuv, rgb and alpha formats are unused.

Change-Id: Ie2ab1099e950c6e696f475d46882f5c47a174042
2018-04-09 16:25:50 -07:00
Marco Paniconi
be5df60801 Merge "vp9-svc: Make constrained_layer_drop default for svc." 2018-04-09 18:05:51 +00:00
Jerome Jiang
30a5cd80e2 Merge "Fix settings for num of tiles in samples & tests." 2018-04-09 17:03:59 +00:00
Marco Paniconi
0ea4e229a7 vp9-svc: Make constrained_layer_drop default for svc.
Switch the order of constrained and layer drop mode,
and keep constrained_layer_drop as the default.
Update the svc datarate tests.

Change-Id: I764270f7b4964b87b0cd3da6c2f96a628f212a30
2018-04-09 09:53:28 -07:00
Jerome Jiang
be4561248d Fix settings for num of tiles in samples & tests.
The control is set by log2 of number of threads (such that the number of
tiles is the same of number of threads).

Thus it should be log2(num_threads) instead of (num_threads >> 1).

Change-Id: I2ccec5557e660048dad3e561534e1c74fc8eec1f
2018-04-06 12:52:53 -07:00
Marco Paniconi
7255ff9b85 vp9-svc: Hybrid search on spatial layers whose base is key.
For spatial layers whose base is a key frame, i.e., when
svc.layer_context[cpi->svc.temporal_layer_id].is_key_frame = 1,
allow for hybrid search, similar to what we do on key frames.

For small blocks (<= 8x8) rd-based intra search will be used,
otherwise non-rd pick mode is used.

Feature is controlled by nonrd_keyframe, which is set to 1
for now on non-base spatial layers, so this change has
currently no effect.

Small change only when inter-layer prediction is off, as we now
call vp9_pick_intra_mode instead of vp9_pick_inter_mode on key frame.
But this change is very small/insignificant.

Change-Id: I5372470f720812926ebbe6c4ce68c04336ce0bdd
2018-04-06 11:36:48 -07:00
Johann Koenig
cfc6dc8db3 Merge "remove support for yuv 411" 2018-04-06 15:26:59 +00:00
Marco Paniconi
4934e52e43 Revert "vp9-svc: Fix to first superframe when inter_layer is off."
This reverts commit 5cc8df5bcfe49fbfca21ee57401c7807c048751b.

Reason for revert: <INSERT REASONING HERE>
We need to do this on all key frames in the stream (not just the first one). Will make another cleaner change for this.

Original change's description:
> vp9-svc: Fix to first superframe when inter_layer is off.
> 
> When the application selects the setting INTER_LAYER_PRED_OFF
> each spatial stream should be decodeable separately.
> For this we need to force key frames on all spatial layers
> on the first superframe.
> 
> In order to maintain the quality at the beginning of the stream
> the active_worst for spatial layer of the second superframe is set
> to the last_QP of the correspondng spatial layer of the first superframe.
> Also make sure nonrd_keyframe is set for non-base spatial layers.
> 
> Change only affects SVC mode wit number_spatial_layers > 1 and
> svc->disable_inter_layer_pred == INTER_LAYER_PRED_OFF.
> And only affects first and second frame of sequence.
> 
> Change-Id: I8ee9a0873ab1d3a02515774571f719617771ad41

TBR=marpan@google.com,builds@webmproject.org,jianj@google.com

Change-Id: If73d9f3932224fc6751e773763adf7e8ee67d17f
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
2018-04-06 05:41:56 +00:00
Marco Paniconi
5cc8df5bcf vp9-svc: Fix to first superframe when inter_layer is off.
When the application selects the setting INTER_LAYER_PRED_OFF
each spatial stream should be decodeable separately.
For this we need to force key frames on all spatial layers
on the first superframe.

In order to maintain the quality at the beginning of the stream
the active_worst for spatial layer of the second superframe is set
to the last_QP of the correspondng spatial layer of the first superframe.
Also make sure nonrd_keyframe is set for non-base spatial layers.

Change only affects SVC mode wit number_spatial_layers > 1 and
svc->disable_inter_layer_pred == INTER_LAYER_PRED_OFF.
And only affects first and second frame of sequence.

Change-Id: I8ee9a0873ab1d3a02515774571f719617771ad41
2018-04-05 21:25:55 -07:00
Marco Paniconi
a4e453f668 vp9-svc: Fix to disable cyclic refresh on key superframes.
Cyclic refresh is disabled on key frames, but we did not
disable it for for spatial layers whose base is a key frame
(i.e., on a key-superframe).

This fix means generally somewhat lower frame-level QP will be
used for those spatial layers whose base is a key frame,
which will generally mean little better quality for the
key-superframes.

Change-Id: Idf090651aa2f5856fb6696c89198a9f6d5d50280
2018-04-05 15:58:36 -07:00
Johann
ac4dc51027 update codereview.settings
Using pdfium as a reference:
https://pdfium.googlesource.com/pdfium/+/master/codereview.settings

Change-Id: I30874cf9f1d575325c32342146137a1952db91ba
2018-04-05 12:18:38 -07:00
Johann
000c276ffa ios configure: quiet shell warning
Generating file lists on a non-mac with:
--target=x86-iphonsimulator-gcc --enable-external-build
the lack of xcrun would cause a warning to print:
libvpx/build/make/configure.sh: line 1397: [: : integer expression expected

Change-Id: I4623b6c5b65296bc71986cd042823f4be9427b42
2018-04-04 11:53:11 -07:00
Marco Paniconi
9336197663 Merge "vp9-svc: Fix in choose_partitioning for different scaling." 2018-04-04 05:59:00 +00:00
Marco Paniconi
742e93f030 Merge "Fix to svc sample enocoder for visual studio build." 2018-04-04 02:15:56 +00:00
Marco Paniconi
c9b6c5d5ad vp9-svc: Fix in choose_partitioning for different scaling.
In the SVC encoder LAST ref frame should be the last temporal
reference at the same resolution. This is the case for the default/fixed
patterns, but may not be the case for arbitrary pattern in flexible mode.

Add check that the LAST reference frame has same resolution as the current frame.
If the reference scale for LAST is different from current treat the current
frame as key frame just for the purpose of superblock partitioning.
This avoids potential segfault in vp9_int_pro_motion_estimation() for different
scaled reference.

Change-Id: I4276ff616de46cd4e12c73316f85ae313f170242
2018-04-03 16:21:44 -07:00
Linfeng Zhang
47f22fc5fb rm CONVERT_TO_SHORTPTR in vpx_highbd_comp_avg_pred
BUG=webm:1388

Change-Id: I1d0dd9af52a1461e3e2b2d60e8c4b6b74c3b90b0
2018-04-03 15:36:41 -07:00
Marco Paniconi
cb63aefa45 Fix to svc sample enocoder for visual studio build.
Fix to sample encoder, for visual studio buid failure:
conversion from 'uint64_t' to 'int'.

Change-Id: I385ab8482e1ee97da9872437f8286d9071e38e0e
2018-04-03 15:09:09 -07:00
Johann
b2c6e1410f remove support for yuv 411
Previously we attempted to convert 411 input. Remove support
because malformed 411 input can cause the conversion to crash.

BUG=webm:1386

Change-Id: I3d41465a94867ee7f8eaa43fb76beb41f8fa644b
2018-04-02 15:37:26 -07:00
Marco Paniconi
ee37046f1b vp9-svc: Fix to svc sample encoder for write_out.
When writing out stream for spatial layer N,
make sure to include all spatial layers up to N.

Fixes an issue with the streams when frame dropping occurs.

Change-Id: I1e20b7dac6b94dcda751043541dd8a12f7df6d8c
2018-04-02 12:57:35 -07:00
Johann Koenig
99fa889f91 Merge "helper script for sanitizer testing" 2018-04-02 18:30:28 +00:00
Linfeng Zhang
c3ba5c521e Merge changes I5704bd66,I4d548e97
* changes:
  Shrink size of mode_map in struct TileDataEnc
  Update sad4d x86 functions
2018-04-02 16:05:05 +00:00
James Zern
eae638db15 Merge "vp9_datarate_test: relax over shoot constraints" 2018-03-31 00:49:11 +00:00
Jerome Jiang
c706c02291 Merge "VP9 SVC: Write bitstream for each spatial layer in sample." 2018-03-30 23:57:21 +00:00
James Zern
2b9c017cf0 vp9_datarate_test: relax over shoot constraints
in BasicRateTargetingVBRLagZero and
BasicRateTargetingVBRLagNonZeroFrameParDecOff after:
e0b28ad69 Add extra case to wq_err_divisor()

BUG=webm:1512

Change-Id: Id181613cc191ff2a2281deffe141efb982501edf
2018-03-30 16:44:41 -07:00
Jerome Jiang
1d6f930517 VP9 SVC: Write bitstream for each spatial layer in sample.
Added control for denoiser in the sample SVC encoder.

Change-Id: I8e62aa2fc13a943eb110cb33e419e912a898bbc7
2018-03-30 15:31:35 -07:00
Jerome Jiang
01b19a1c3e Code cleanup for datarate tests.
Add/Remove static to functions. Name change.

Change-Id: I5de3efc23cd151fe8e70fe67a7a11acfcfa707dc
2018-03-30 10:47:41 -07:00
Jerome Jiang
4127799a91 Split datarate_test.cc to vp8, vp9, svc ones.
As we add more tests to datarate_test.cc, it's growing bigger and hard
to find specific test.

Split it to vp8, vp9 and svc ones.

Change-Id: Ie8c302010cf304a95554bee19d87ddc90498d0fb
2018-03-29 16:40:20 -07:00
James Zern
d636fe53af Merge "test: use testing::*tuple instead of std::tr1" 2018-03-29 19:01:34 +00:00
Marco Paniconi
81e78a1d5f Merge "vp9-svc: Fix in pickmode for key frames." 2018-03-29 18:49:26 +00:00
Jerome Jiang
d467bbe11e Merge "VP9 SVC: Add enum type for framedrop_mode." 2018-03-29 18:44:35 +00:00
Jerome Jiang
70b86af22e VP9 SVC: Add enum type for framedrop_mode.
Change-Id: I3d4697b00729553e0860762b9264e29b8a89b9d4
2018-03-29 10:49:06 -07:00
Johann
20521c394c helper script for sanitizer testing
source tools/set_analyzer_env.sh <sanitizer>
will set the compiler, flag, and sanitizer variables necessary to build
and run a variety of sanitizers.

Change-Id: I5dd2ae947cb337d5ccf2a11e9fe87991bc8ba0c8
2018-03-29 06:58:30 -07:00
paulwilkins
e0b28ad696 Add extra case to wq_err_divisor()
Add extra case for 360P and smaller.
This hurts a little in psnr for the derf cif set but helps a little
in terms of average rate accuracy. Most clips come in a little
smaller with this patch.

No impact on larger formats.

Change-Id: I5056246cb53b90f961ff9ea5813937f33778aa4c
2018-03-29 12:52:15 +01:00
xiwei gu
5476ab095f Merge "vp9: [loongson] optimize vpx_convolve8 with mmi." 2018-03-29 01:05:33 +00:00
Marco Paniconi
fe72ba15ac vp9-svc: Fix in pickmode for key frames.
For the fixed/default SVC patterns, GOLDEN is the
spatial reference, except on key frames, where LAST
is labeled as the spatial reference.

The current code was assuming GOLDEN is always the
spatial reference for the purpose of selecting the
subpel motion (due to the downsampling filter).

Fix is make sure flag_svc_subpel is set and used
with spatial_ref, which is labeled as the proper
spatial reference before entering mode check.

Some quality improvement on key frames.
Change-Id: Id236bcd47055b035731cc910ed84449d7e29f50c
2018-03-28 16:57:08 -07:00
Marco Paniconi
382afcab98 Merge "vp9-svc: Modify logic for frame dropping with spatial layers." 2018-03-28 21:29:35 +00:00
Marco Paniconi
e358cf0a43 vp9-svc: Modify logic for frame dropping with spatial layers.
In the constrained framedrop mode for svc: modify the buffer check
condition relative to (non-zero) dropmark to include uppper spatial layers,
in addition to the current spatial layer.

But keep the single layer check if the buffer goes below zero, since
in this case (buffer underflow) we should force drop of that layer
regardless of upper layers.

Change-Id: Id277f0b4a3ae6275effdd5f5f0c80e3229c17424
2018-03-28 13:00:00 -07:00
Linfeng Zhang
cd83802885 Shrink size of mode_map in struct TileDataEnc
To reduce the memcpy() cycles in vp9_rd_pick_inter_mode_sb().
The maximum value of mode_map is (MAX_MODES - 1) = 29.

Change-Id: I5704bd66838ea0b075f0afb001f5cbebfd3f1602
2018-03-28 12:50:31 -07:00
Linfeng Zhang
39de45d3cc Update sad4d x86 functions
Speed change is marginal.

Change-Id: I4d548e9763ce43bd546f19132202f7a8509a32bf
2018-03-28 12:49:12 -07:00
James Zern
db49a22cfa test: use testing::*tuple instead of std::tr1
googletest imports tuple into testing to allow for compatibility across
c++ versions where tuple may be in std::tr1 or std. fixes deprecation
warnings under visual studio 2017

Change-Id: Id78b372d5478b12d8c8f63fd3f2166fec25aa8be
2018-03-28 12:45:35 -07:00
Linfeng Zhang
debd86ec82 Merge "Add speed test in SADx4Test" 2018-03-28 19:39:37 +00:00
Linfeng Zhang
8edd5051aa Add speed test in SADx4Test
Change-Id: I42dd3df8c13c0a6d08ce28e27e8917b5d831fc1a
2018-03-28 11:13:28 -07:00
gxw
25d9adb74b vp9: [loongson] optimize vpx_convolve8 with mmi.
1. vpx_convolve8_vert_mmi
2. vpx_convolve8_horiz_mmi
3. vpx_convolve8_mmi
4. vpx_convolve8_avg_mmi
5. vpx_convolve8_avg_vert_mmi

Change-Id: I41a6b3b4f327d6b67d282e0163cfa0aee8648abe
2018-03-28 18:11:16 +00:00
Marco Paniconi
872e34ae8d vp9-svc: Add check in datarate unittests for frame-dropping.
Add verfication for constrained svc framedrop mode: check that
if a given spatial is dropped, all uppper layers must be dropped.

Change-Id: I9b4821b23c95d1d9d0c031a41af19984647ec5dc
2018-03-28 10:30:59 -07:00
Marco Paniconi
7b9984b386 vp9-svc: Add logic to enable for constrained framedrop.
Add the logic for the constrained framdrop mode for SVC.

Add test case in datarate unittests.
Also lower target bitrates in the tests to better test
frame dropper.

Change-Id: I8ee1b8cb56d835c233ad1fbe0fc1456cb2e7291f
2018-03-27 15:02:12 -07:00
Johann Koenig
239511fad8 Merge "third_part/googletest: update to release-1.8.0-742-g7857975" 2018-03-27 01:08:12 +00:00
Marco Paniconi
223f9e3671 vp9-svc: Allow for setting frame drop thresholds per layer.
Add encoder control to set the frame drop thresholds per
spatial layer, and add a frame drop mode: 0 = per-layer drop,
and 1 = constrained drop mode (a drop on a given layer forces
drops to all upper layers).

Default is mode 0 (per-layer dropping).
Implementation for mode 1 will come in subsequent change.

If the control is not used, then the spatial layer frame
drop thresholds (water mark) are all equal and set to the value
given by the encoder config (oxcf->drop_frames_water_mark).

Bump up the ABI version.

Change-Id: Id038d4181b86fa98b3d44d026f96d5f344d81629
2018-03-26 13:56:55 -07:00
Johann
aa5e9c6a7c third_part/googletest: update to release-1.8.0-742-g7857975
Address std::tr1::tuple warnings:
https://github.com/google/googletest/issues/1111

The unsigned overflow fix has been superseded by:
https://github.com/google/googletest/pull/1180

Change-Id: I92dc0ba08a4d0d63f5e5b2da7b64f4a4642ed9ab
2018-03-26 11:29:11 -07:00
Johann
9037a05041 msvs build: only fix_file_list when it is broken
Clears a warning when generating VS project files with older versions of
bash:
declare: -n: invalid option

Change-Id: Id0c0bc17dc5a1599f7d2d73e3cc9259a45540f3f
2018-03-26 09:39:24 -07:00
Paul Wilkins
2b800d9394 Merge "Adjustment to initial q range estimate and kf boost." 2018-03-24 11:27:12 +00:00
Martin Storsjö
f4b1eca53e Merge "Restore emms usage on x86_64 after 726b021a12c1b" 2018-03-23 22:04:43 +00:00
Martin Storsjo
a6fdfda44c Restore emms usage on x86_64 after 726b021a12c1b
Even on x86_64, emms has to be called if the x87 state has
been clobbered - the calling code (either within libvpx or
in a caller outside of libvpx) may be using the x87 instructions,
even though use of them isn't all that common on x86_64.

This fixes builds with clang for mingw/x86_64.

Change-Id: I1f6072835590b862bad156f17331ba65c813ddd9
2018-03-23 19:57:46 +00:00
Martin Storsjö
343ef23db0 Merge "thumb: Remove a brittle, ugly and unused arm->thumb conversion" 2018-03-23 19:54:01 +00:00
Martin Storsjö
9c9de8a8ce Merge changes from topic "llvm-mingw"
* changes:
  configure: Add an arm64-win64-gcc target
  test: Check for ARCH_X86_64 in addition to _WIN64
  configure: Add an armv7-win32-gcc target
  ads2gas: Add a -noelf option
2018-03-23 19:49:40 +00:00
Johann Koenig
99e1784525 Revert "remove fldcw/fstcw from Win64 builds"
This reverts commit 60a3cb9ad840377d46286bfd703c30a4a4ee56e2.

Reason for revert: x87 instruction usage might not be as
clear cut as I would like. At the very least, llvm mingw
builds appear to having issues with emms.

Original change's description:
> remove fldcw/fstcw from Win64 builds
>
> _MCW_PC (Precision control) is not supported on x64:
> https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/control87-controlfp-control87-2
>
> The x87 FPU is not used on Win64 or ARM so setting the x87 control word
> is not necessary. The SSE/SSE2 and ARM FPUs don't have a precision
> control - the precision is embedded in each instruction - so the need to
> set the control word is also gone.

BUG=webm:1500

Change-Id: I25bcfa96bc9c860f6c7e03315d75fa6fd1d88ec5
2018-03-23 11:09:15 -07:00
Johann Koenig
1000e07609 Merge "remove fldcw/fstcw from Win64 builds" 2018-03-23 13:23:58 +00:00
Johann
60a3cb9ad8 remove fldcw/fstcw from Win64 builds
_MCW_PC (Precision control) is not supported on x64:
https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/control87-controlfp-control87-2

The x87 FPU is not used on Win64 or ARM so setting the x87 control word
is not necessary. The SSE/SSE2 and ARM FPUs don't have a precision
control - the precision is embedded in each instruction - so the need to
set the control word is also gone.

BUG=webm:1500

Change-Id: I014513282a7dc320d1cdeaec48249d98a66bf09f
2018-03-23 06:22:39 -07:00
Martin Storsjo
8af243cfba configure: Add an arm64-win64-gcc target
This configuration doesn't require any extra custom settings, since
it only uses neon intrinsics that are handled automatically by the
compiler (no external assembly).

Change-Id: I35415c68f483a430c0672e060a7bbd09a3469512
2018-03-23 13:42:01 +02:00
Martin Storsjo
e9ea629b13 test: Check for ARCH_X86_64 in addition to _WIN64
_WIN64 is also defined when targeting windows on aarch64.

Change-Id: I42b84e14079c19d0ba9362a06d8c6e7287644373
2018-03-23 13:41:35 +02:00
Martin Storsjo
b08a0b07d4 configure: Add an armv7-win32-gcc target
This builds for windows on arm, with llvm-mingw. The target triplet
is named -gcc since that's how similar existing targets are named,
even though it technically runs clang (via frontends named
"$CROSS-gcc").

Assemble using $CC -c since there's no standalone assembler
available (except perhaps llvm-mc).

Change-Id: I2c9a319730afef73f811bad79f488dcdc244ab0d
2018-03-23 13:25:35 +02:00
Martin Storsjo
2cc5c8f97c ads2gas: Add a -noelf option
This allows skipping elf specific features from the output.

Change-Id: I739299ba41286ca10415e056b4ffd561be5e0350
2018-03-23 13:23:16 +02:00
Martin Storsjo
3abdb1ca65 thumb: Remove a brittle, ugly and unused arm->thumb conversion
The relevant code that this conversion handled was removed in
c26a9ecaa21f4.

Change-Id: Iee40f95134e609c291c7c4e06bc50dcb895bc5e3
2018-03-23 13:16:57 +02:00
James Zern
c13aaf7a3e Merge changes Ied91c7ef,If2dcc6e2,Ib7397e71,Ib6392c79
* changes:
  Fix implicit-fallthrough warnings
  Fix dangling-else warnings
  Fix a strict-overflow warning
  Rename several static NEON iht functions
2018-03-23 03:56:50 +00:00
Jerome Jiang
4bff5bca92 Merge "vp9 svc frame drop: enable adaptive rd for row mt." 2018-03-23 01:41:21 +00:00
Jerome Jiang
1ae97b4a4d vp9 svc frame drop: enable adaptive rd for row mt.
adaptive_rd_threshold_mt is set to 1 when speed >= 7 for SVC.
QVGA in SVC uses speed 5 which set adaptive_rd_threshold_mt to 0.
If VGA or HD is dropped for the last super frame, the flag is still 0
when the encoder is destroyed. Thus memory won't be released.

Change the bitrate threshold in datarate test.

Change-Id: I55352cc0b030568d38eb735d99c2fa29058d3690
2018-03-22 17:11:05 -07:00
Linfeng Zhang
920f4ab8f8 Fix implicit-fallthrough warnings
Compiler -- gcc (Debian 7.3.0-5) 7.3.0

Change-Id: Ied91c7ef3d25c3ef44a1f667656176e2709b4f44
2018-03-22 11:44:05 -07:00
Linfeng Zhang
c101a5f5c4 Fix dangling-else warnings
Compiler -- gcc (Debian 7.3.0-5) 7.3.0

Change-Id: If2dcc6e215a2990cde575f0e744ce0c7a44a15f1
2018-03-22 11:44:01 -07:00
Linfeng Zhang
5192ce92b8 Fix a strict-overflow warning
Compiler -- gcc (Debian 7.3.0-5) 7.3.0

./libvpx/vp9/encoder/vp9_denoiser.c:374:9: assuming signed overflow
does not occur when assuming that (X + c) < X is always false
[-Wstrict-overflow]
         for (j = 0; j < xmis; j++) {

Change-Id: Ib7397e718ff717bdabc088fc4c6e1771381fb522
2018-03-22 11:42:25 -07:00
Linfeng Zhang
a09acf7e19 Rename several static NEON iht functions
Change-Id: Ib6392c79d0269a43dbe180a89f2571482d98844d
2018-03-22 11:13:12 -07:00
Marco Paniconi
3cb9c5ffe9 vp9-svc: Fix to sample encoder
Get the correct computation of number of input
layers to account for frame drops.

Change-Id: I39637381e1981b53c930da67a5c525191de6907d
2018-03-21 16:47:59 -07:00
James Zern
62c4747532 Merge "vp9_highbd_iht8x8_add_neon: rm unused functions" 2018-03-21 17:52:47 +00:00
Jerome Jiang
1f82e06122 VP9 SVC: Add control to disable inter layer prediction.
Add VP9E_SET_SVC_INTER_LAYER_PRED to disable inter layer (spatial)
prediction.
0: prediction on
1: prediction off for all frames
2: prediction off for non key frames

Bump up ABI version.

Change-Id: I5ab2a96b47e6bef202290fe726bed5f99bd4951f
2018-03-20 19:28:12 -07:00
Marco Paniconi
4a20caef78 Merge "vp9-svc: Improve frame dropper for spatial layers." 2018-03-20 21:46:36 +00:00
Marco Paniconi
126a3718fc vp9-svc: Improve frame dropper for spatial layers.
SVC frame dropper: modify the logic to allow for individual
spatial layers to drop. This removes the constraint that all
upper spatial layers must drop when a given spatial layer drops.

Add a flag to the pkt to indicate whether a spatial layer is
encoded or dropped. This is needed for applications that enable
this feature (frame dropping for SVC).

For a current spatial layer, if its previous spatial layer is
dropped, then disable certain features for that layer:
inter-layer prediction, base_mv, partition_reuse, copy partition.

Also add the constraint to never drop a spatial layer if its
base layer is a key frame.

Updates to sample encoder (vp9_spatial_svc_encoder) and the
SVC datarate unittests to properly handle frame dropping.

Bump up ABI version.
Change-Id: I7d14ccf67b8d014a7abfce5ba3989fc623e94067
2018-03-20 10:34:45 -07:00
Johann
7a9a46fb53 visual studio: add yasm instructions
Change-Id: Ied2a1fc0e1d1a2245d63f267669add8889dd0cec
2018-03-20 10:08:45 -07:00
Johann Koenig
8b263798d0 Merge "x86 android: default on realtime-only" 2018-03-20 17:06:18 +00:00
Johann Koenig
c5630b9e6c Merge "build: remove stale .git files" 2018-03-20 17:06:05 +00:00
Johann Koenig
52da0428be Merge "reland "use intrinsics for 'emms'"" 2018-03-20 17:05:17 +00:00
Johann
907e966adf build: remove stale .git files
These were used for an older style of Visual Studio configurations.

Change-Id: I51f07b30ad51c4da0c5caf1ede36cdb69b2d2b19
2018-03-19 17:36:38 -07:00
Johann
726b021a12 reland "use intrinsics for 'emms'"
Only target 32bit builds. Visual Studio does not define _mm_empty for
64bit configurations.

Rename emms.asm and remove from 32 bit builds to avoid empty file
warnings.

Don't check register state on 64bit builds.

BUG=webm:1500

This reverts commit 60beb781c140b61c1957abd2a6717d2e9a831933.

Change-Id: I5ac4cf6c67249ff24f7da19792144de20527bfce
2018-03-19 17:11:55 -07:00
Jerome Jiang
4038632fab Merge "VP8: Fix out of range index for mvcost." 2018-03-19 19:00:55 +00:00
James Zern
0dad4e2997 vp9_highbd_iht8x8_add_neon: rm unused functions
their use was removed in:
d8424d289 Fix a bug in vp9_highbd_iht8x8_64_add_neon

Change-Id: I041800f3fb34ffbb7cfa7401370c5a5ceeab01c6
2018-03-18 18:24:41 -07:00
James Zern
0f9521f0a8 CopyFrameTest: reduce max size for 32-bit targets
avoids potential OOM when allocating 3 buffers for 16383x16383; 3840 is
used as a replacement
this test was missed in:
215bddf32 vpx_scale_test: reduce max size for 32-bit targets

Change-Id: I515adf5999c6ef1724394ccd62d677134bd35e6d
2018-03-18 15:15:07 -07:00
Jerome Jiang
ca28740570 VP8: Fix out of range index for mvcost.
Clamp index between 0 and MVvals.

Bit exact for speed -8, -6 and -4 on RTC set.

BUG=b/72510002

Change-Id: I61bdb02a0924e157b3c1980f74fbbfe5ce51bc44
2018-03-17 04:04:10 +00:00
James Zern
215bddf324 vpx_scale_test: reduce max size for 32-bit targets
avoids potential OOM when allocating 3 buffers for 16383x16383; 3840 is
used as a replacement

Change-Id: I92116ab69b10db6820fc651d3626bd9699700208
2018-03-16 17:47:56 -07:00
paulwilkins
da7a7089c6 Adjustment to initial q range estimate and kf boost.
Adjustment to initial active based on image size.
Add extra breakout case for kf boost loop.
Small adjustment to q delta calculation for key frames.

Net % improvements for all standard tests sets (-ve values) measured
using c-bvr mode.

(Overall PSNR, SSIM, PSNR-HVS)
Low Res:  -0.223	-0.229	-0.107
Mid Res:  -0.175	0.008	-0.180
High Res: -0.131	0.106	-0.206
NFlix 2K:   -0.390	-0.271	-0.489
NFlix 4K:   -1.370	-0.825	-1.590

Change-Id: I06a39de43594e1a99bb0cb281af15cdb8058a8ed
2018-03-16 12:24:54 +00:00
Marco Paniconi
2640f25072 vp9-svc: Frame dropper for SVC.
If a given spatial layer decides to drop, due to the
buffer/overshoot conditions for that layer, then drop
that current spatial layer and all spatial layers above.

In the current implementation the svc frame counter
(and hence the pattern for the non-flexible SVC case)
are updated on frame drops.

Also add last spatial layer encoded to the pkt.
This is useful for RTC applications that enable
frame dropping for SVC.

Update to the SVC datarate tests:
enabled frame dropper on all SVC datarate tests, and
made a fix to properly set the temporal_layer_id, which
works now even on frame drops.

Change-Id: If828c193f3cb6b1839803fd52fe9fbbda5b5a039
2018-03-15 21:04:59 -07:00
James Zern
d07a5bfbf8 Merge "libs.mk,vcxproj generation: split srcs in invocation" 2018-03-16 03:52:02 +00:00
James Zern
b986ba84b3 Merge "Revert "vp9_loopfilter.c: zero lfl_uv"" 2018-03-16 02:11:52 +00:00
James Zern
e97804c67d Revert "vp9_loopfilter.c: zero lfl_uv"
This reverts commit 13d0955b250bcb7eac99034e7b1677d3d026b569.

Reason for revert:
this should be investigated further to ensure the memset is really
necessary outside of the static analysis pass.

Original change's description:
> vp9_loopfilter.c: zero lfl_uv
> 
> The initialization depends on cm and mi_row which static
> analysis does not approve of.
> 
> Clears a static analysis warning:
> warning: The right operand of '+' is a garbage value
> const loop_filter_thresh *lfi = lfthr + *lfl;
> 
> Change-Id: I8c863ced2b1e9a7e10103b7281098f20941a6ca2

TBR=johannkoenig@google.com,marpan@google.com,builds@webmproject.org,jianj@google.com

Change-Id: Icadb6438fbcddba747622f06f2eadebdb333edf6
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
2018-03-15 21:43:29 +00:00
Johann Koenig
b24e377008 Merge changes I5501d0d6,I8c863ced,I19895d06,Ifa39353d,I09bd209b
* changes:
  vp9_resize.c: assert vp9_highbd_resize_plane conditions
  vp9_loopfilter.c: zero lfl_uv
  vp8 rdopt.c: zero rd.[rate_uv|distortion_uv]
  vp8 mfqe: zero map[]
  temporal svc: zero layer_target_bitrate
2018-03-15 21:16:43 +00:00
Johann Koenig
f3adb45914 Merge "remove spatial svc experiment" 2018-03-15 19:26:16 +00:00
Linfeng Zhang
5dfb01bb30 Merge "Add vp9_highbd_iht16x16_256_add_neon()" 2018-03-15 19:21:36 +00:00
James Zern
944e83ad32 libs.mk,vcxproj generation: split srcs in invocation
this avoids truncation under mingw which would result in link failures

BUG=webm:1434

Change-Id: I6eb45d94f02966532b3cdf02860a5bf2e5d3efef
2018-03-15 11:58:54 -07:00
Linfeng Zhang
ddb3d7a8a1 Merge changes I9e0bf2c7,I695b4090
* changes:
  Fix a bug in vp9_highbd_iht8x8_64_add_neon
  Fix a bug in vp9_highbd_iht4x4_16_add_neon()
2018-03-15 18:05:08 +00:00
Marco Paniconi
881c8ec816 vp9-svc: Bugfix to dyanmic enabling/disabling of layers.
Fix a bug when middle and top spatial layer are skip encoded
(disabled) and then re-enabled again, during the sequence.

Issue is that pending_frame_count in the packing may
be incremented on middle layer, even though that layer is skipped
(not encoded and hence zero size). Fix is to add size check.

Modified existing unitest to reproduce the issue.

Change-Id: I86d806a112d468e06b04fbf7c46ae07db9e0ad93
2018-03-14 17:31:59 -07:00
Johann
a3f09c03b8 vp9_resize.c: assert vp9_highbd_resize_plane conditions
Clears static analysis warnings similar to the low bitdepth version:
commit c4367b9b51782969d3b37ead6694d19ef9bfb58c
Author: James Zern <jzern@google.com>
Date:   Wed Mar 18 14:34:30 2015 -0700

    vp9_resize_plane: quiet some static analysis warnings

Change-Id: I5501d0d6ad7c7720d746d53ec07078cb9051d0d7
2018-03-14 16:42:14 -07:00
Johann
0e97e70496 remove spatial svc experiment
Change-Id: Ifda11caaf992d10f2d93d6cd1d07b79b6047be05
2018-03-14 22:00:28 +00:00
Johann Koenig
5c5dc73320 Merge "spatial svc: set window_size to 15" 2018-03-14 22:00:08 +00:00
Johann
13d0955b25 vp9_loopfilter.c: zero lfl_uv
The initialization depends on cm and mi_row which static
analysis does not approve of.

Clears a static analysis warning:
warning: The right operand of '+' is a garbage value
const loop_filter_thresh *lfi = lfthr + *lfl;

Change-Id: I8c863ced2b1e9a7e10103b7281098f20941a6ca2
2018-03-14 14:22:08 -07:00
Johann
f9a13a1786 vp8 rdopt.c: zero rd.[rate_uv|distortion_uv]
These values are not consistently set before calling update_best_mode.

In vp9_rdopt.c they are individual values instead of a struct and are
zero'd at declaration.

Clears a static analysis warning:
warning: The right operand of '-' is a garbage value
RDCOST(x->rdmult, x->rddiv, (rd->rate2 - rd->rate_uv - other_cost),

warning: The right operand of '-' is a garbage value
(rd->distortion2 - rd->distortion_uv));

Change-Id: I19895d062e7c0ac67937126ebc5dcb0afd3a2931
2018-03-14 13:56:39 -07:00
Johann
1f41c0d37f vp8 mfqe: zero map[]
The loop appears to set map[i] with the intention of running
the 'j' loop up to that point. However, without zero'ing map[]
first the behavior is unpredictable.

Fixes a static analysis warning:
warning: Branch condition evaluates to a garbage value
for (j = 0; j < 4 && map[j]; ++j) {

Change-Id: Ifa39353d8aa5cc47b467a7d3d8cdd3b5319fd997
2018-03-14 13:56:39 -07:00
Johann
8276005eba temporal svc: zero layer_target_bitrate
These values are set in main() from user input. Ensure
they are cleared out first.

Clears a static analysis warning:
warning: The right operand of '*' is a garbage value
1000.0 * rc->layer_target_bitrate[0] / rc->layer_framerate[0];

Change-Id: I09bd209be5aff31b87597a24d37a9673fa99381b
2018-03-14 13:56:39 -07:00
Johann Koenig
60beb781c1 Revert "use intrinsics for 'emms'"
This reverts commit 118a57045bf5b49ab7c2f7f930543b9217fd422e.

Reason for revert: Fails on Visual Studio builds:

vpxmdd.lib(vpx_ports_emms_mmx.obj) : error LNK2019: unresolved
external symbol _m_empty referenced in function
vpx_clear_system_state

Original change's description:
> use intrinsics for 'emms'
> 
> BUG=webm:1500
> 
> Change-Id: I3235d8c2abc01dd3a35e14c5cbcfe20283ff8fb2

Change-Id: Ia9c40bc103c57cced83353249c55218eaf2f0b0c
2018-03-14 20:26:44 +00:00
Marco Paniconi
ae856e4012 Merge "vp9-svc: Fix to update layer counters when layer is skipped." 2018-03-14 20:13:34 +00:00
Johann
6b2cc75622 spatial svc: set window_size to 15
Static analysis does not recognize that output_rc_stat guards
the usage of window_size. Clears this warning:
The right operand of '>' is a garbage value
if (frame_cnt > (unsigned int)rc.window_size) {

set_rate_control_stats sets window_size to 15. Zeroing it
just introduces another static analysis warning.

Change-Id: Ieee7b81a385f986e42189101cfa39279e519b368
2018-03-14 19:30:38 +00:00
Marco Paniconi
f50ad31ec1 vp9-svc: Fix to update layer counters when layer is skipped.
Update layer counters when layer is skipped,
for any spatial layer.

Change-Id: Ie37c4a16ccafdef3390b651dec473beb5d926896
2018-03-14 11:51:01 -07:00
Johann
f0a3979063 spatial svc: zero sizes
This should be taken care of by parse_superframe_index but
the static analysis is not recognizing it because it depends
on 'marker' which is read from the bitstream.

Clears a static analysis warning:
The right operand of '*' is a garbage value
rc.layer_encoding_bitrate[layer] += 8.0 * sizes[sl];

Change-Id: I8ee48a98f907bc7b46869fd27a351f33e2e7de71
2018-03-13 18:22:50 -07:00
Johann
b0d57f682d spatial svc: remove vpx_svc_get_message
Print error messages as they are encountered. This was the default
behavior.

Removes a static analysis warning regarding the use of strncat:
Null pointer argument in call to string length function

As this is the only use of strncat in the library, remove it and the
associated public function.

Change-Id: Id55305c5a4d65f11da88c3a2203ff824200f526f
2018-03-13 17:58:24 -07:00
Linfeng Zhang
9351f96069 Add vp9_highbd_iht16x16_256_add_neon()
BUG=webm:1403

Change-Id: I2293c11666786be276909d48ee78dacb40a89e25
2018-03-13 17:39:23 -07:00
Linfeng Zhang
d8424d2890 Fix a bug in vp9_highbd_iht8x8_64_add_neon
This bug was introduced in 29b6a30c.

BUG=webm:1403

Change-Id: I9e0bf2c7a01d8ff1c714c12236f7985b772b0540
2018-03-13 17:38:29 -07:00
Johann
6f9163db95 spatial svc: remove unused locals
Clears static analysis warning:
Value stored to 'tl' is never read

Change-Id: If047a74f508288c63d5b83ed0f3ad34f791f9312
2018-03-13 17:12:35 -07:00
Johann Koenig
c257d608fc Merge "use intrinsics for 'emms'" 2018-03-13 23:51:08 +00:00
Linfeng Zhang
88dc0d6062 Fix a bug in vp9_highbd_iht4x4_16_add_neon()
This bug was introduced in 36363304.

BUG=webm:1403

Change-Id: I695b409047e41ab7e0460981524310d78753751a
2018-03-13 16:10:00 -07:00
Johann
7b278e3072 spatial svc: rescope sl
sl was passed to set_frame_flags_bypass_mode, triggering
an uninitialized variable warning. Inside the function it
is only used as a local variable.

Change-Id: If743626e9e10fd41d135e3b4ad6196dc4dc90172
2018-03-13 14:38:05 -07:00
Johann
118a57045b use intrinsics for 'emms'
BUG=webm:1500

Change-Id: I3235d8c2abc01dd3a35e14c5cbcfe20283ff8fb2
2018-03-13 13:17:28 -07:00
Johann
fc1302cd8b x86 android: default on realtime-only
Like the arm-based target, set realtime-only on by default.

BUG=webm:873

Change-Id: I2e04cfc43390953435e985716a25f32b8d4fadda
2018-03-12 15:20:28 -07:00
Johann
95a71057f0 autodetect macOS High Sierra
Add darwin17 target

Change-Id: I349a2f6a0396c59269f567a03ae813e3e59ccefa
2018-03-12 14:54:48 -07:00
Johann Koenig
7b5a57449b Merge "vp8 temporal_filter: ignore return value" 2018-03-12 20:56:30 +00:00
Johann
025b138679 vp8 temporal_filter: ignore return value
Clears up static clang analysis warning regarding a dead store.

Change-Id: I6a90e6fd5f2775d933c46c7553811635bd2def21
2018-03-12 19:52:11 +00:00
Marco Paniconi
312745cac4 vp9-svc: Update layer frame counters when layer is skipped.
When an enhancement spatial layer is skipped, we should check
for updating the layer frame counters.

Change-Id: Ib79d0955c62fb465f59ef2f9ac45240ae2614d7b
2018-03-12 12:21:10 -07:00
Marco Paniconi
3223a3f892 vp9-SVC: Fix to choose_partition when LAST ref is NULL.
This causes assert to trigger in choose_partitioning().
This can happen in some cases when enhancement layers
are enabled midway during the stream.

Change-Id: I69c3c8b4b1e3f1c7d8d7294d633ca5ddca148e8b
2018-03-12 09:13:25 -07:00
James Zern
c12398fe81 Merge "vpx_scale_test: add w/h output to alloc failure" 2018-03-08 21:13:09 +00:00
Paul Wilkins
7987f35391 Merge "Change to KF frame boost calculation." 2018-03-08 13:34:15 +00:00
James Zern
6ed4c253a9 vpx_scale_test: add w/h output to alloc failure
Change-Id: Ib5df91d9fcd7fe973a2f7d8e73a204259beddc07
2018-03-07 23:07:51 -08:00
James Zern
0bee6de332 Merge changes If96fd6f1,I84b27337
* changes:
  Fix a bug in vp9_iht16x16_256_add_neon()
  Fix a bug in vp9_iht8x8_64_add_neon()
2018-03-08 03:41:27 +00:00
Johann
7195a2eaa4 add worst-case frame size cap
The largest frame is currently in choose_partitioning:
warning: stack frame size of 44156 bytes in function 'choose_partitioning'

but adding HBD amplifies other things:
warning: stack frame size of 51480 bytes in function 'dec_build_inter_predictors'

Add some padding for sanitizer and variances between compilers.

BUG=webm:1498

Change-Id: I0d94d4f94d25dafafca9d7484881c2ce5f8de371
2018-03-05 20:09:43 -08:00
Linfeng Zhang
d18477b449 Fix a bug in vp9_iht16x16_256_add_neon()
This bug was introduced in 88c23864.

BUG=webm:1403

Change-Id: If96fd6f102be6b9bda866e55e574257287746f4a
2018-03-05 16:14:35 -08:00
Linfeng Zhang
c244a86234 Fix a bug in vp9_iht8x8_64_add_neon()
This bug was introduced in b14b616d.

BUG=webm:1403

Change-Id: I84b2733734982e52b66548850d61758c772b5494
2018-03-05 15:33:37 -08:00
Johann
e0b88b5c00 move vp8 encodeopt to block_error_sse2
The file contains sse2 implementations related to various block error
functions. Update the .mk file to include it only when sse2 is
requested.

BUG=webm:1500

Change-Id: I67b766faed425fd7a96db8541b13c69670b65fec
2018-03-04 12:38:07 -08:00
James Zern
c6fcb9bb94 disable vp9_highbd_iht{4x4_16,8x8_64}_add_neon
these causes test vector failures

BUG=webm:1403

Change-Id: I08218f0bf26651eb367ece4feec6d704e0189bd8
2018-03-03 14:14:30 -08:00
James Zern
0685ec767c disable vp9_iht8x8_64_add_neon
this causes test vector failures

BUG=webm:1403

Change-Id: I7d37a05fbf4641ea352c947053aa4eaeb7f5c318
2018-03-03 14:14:12 -08:00
James Zern
ac07cc89f1 disable vp9_iht16x16_256_add_neon
this causes test vector failures

BUG=webm:1403

Change-Id: Ifdb5b270c5cc70be5689e4fbda2ada3724cc65c3
2018-03-03 12:58:24 -08:00
Marco Paniconi
5ac63d15dc vp9-svc: Disable partition_reuse unless 2x2 scale.
For SVC, if any of the layer scale ratios are not
2x2, then disable the partiton_reuse, which assumes
2x2 scaling between layers.

Change-Id: I8b3163de0826052bbb1bfe03554a074c89510558
2018-03-02 10:56:16 -08:00
Marco Paniconi
4d8958d8dd vp9-svc: Fix to downsampling filter phase_shift.
Set phase_shift = 0 if the scale factors are
above 3/4. Removes artifact for scale factors
close to 1.

phase_shift = 8 is to get an averaging filter
(decimated pixel aligns to 8/16, midway between source pixels),
and only makes sense for scale factors multiples of
2 (1/2, 1/4,...).

Removes artifact for high scaling ratios.

Change-Id: Id0a85869d6c6156dda0032c697ded2de78fad6bd
2018-03-02 08:55:18 -08:00
James Zern
6cc33c1626 iadst16x16_256_add_half1d: fix array size
t[] is indexed from 0..11

Change-Id: I7d0021f1795c6608354c8770843ea9dfdea66f97
2018-02-28 23:49:39 -08:00
paulwilkins
29fbddec83 Change to KF frame boost calculation.
This change is targeted mainly at higher resolutions where typically
the average error per MB is much smaller.  hence this patch replaces
a fixed error per MB factor with a tiered value.

It also adds in a fixed offset value that acts as a minimum return score.

Note also minor fix to debug stats output.

The results are overall beneficial (-ve) on our test sets, most notably for
higher definition formats (see below - overall psnr, ssim, psnr hvs)

low res:    0.184	-0.262	-0.166
mid res:   0.094	  0.075	  0.049
hd res:    -0.752	-0.300	-0.800
NF 2K:    -0.353	 1.095	-0.302
NF 4K:    -1.245	-0.578	-1.205

The most notable negative case is pierseaside 2K which appears to be worse by
8-10% (which has a big impact on the overall gain for the NF 2K set). Closer
inspection reveals that the drop does not relate to the key frame boost
per se as in both cases the key frame substantially undershoots its target. Rather
this is a side effect relating to the initial Q range allowed for the key frame and
a poor initial complexity estimate. This will hopefully be improved in a later
patch.

Change-Id: I4773ebe554782f4024c047c3c392c763a3fe843b
2018-02-28 20:56:53 +00:00
Linfeng Zhang
932835677f Merge "Add vp9_iht16x16_256_add_neon()" 2018-02-28 18:26:39 +00:00
James Zern
7aa588debd Merge "datarate_test: correct last_pts_ref_ type" 2018-02-27 22:15:05 +00:00
Linfeng Zhang
88c2386447 Add vp9_iht16x16_256_add_neon()
BUG=webm:1403

Change-Id: I1413cc3dfcb62143ba04fe9b0f8d8b010fdf69b6
2018-02-27 10:13:20 -08:00
James Zern
09ce3177bb datarate_test: correct last_pts_ref_ type
use vpx_codec_pts_t to match last_pts_; this quiets a conversion warning
under visual studio

Change-Id: I3f1c146fc13f2edfb515d76730a9ef063846bf69
2018-02-26 23:03:02 -08:00
Linfeng Zhang
3c6dc743aa Fix a bug in create_s16x4_neon()
This bug exposes when 2nd argument is negative, and the higher 32 bits
would be all 1s.

Change-Id: I189ee8cd3753fde00a34847e7a37cde2caa4ba72
2018-02-26 17:49:24 -08:00
Linfeng Zhang
8de0404ed9 Merge "Clean test/dct_test.cc with testing::Combine" 2018-02-24 01:24:32 +00:00
Linfeng Zhang
90d54a15fb Clean test/dct_test.cc with testing::Combine
Change-Id: I910fd34e4a06a73568b597ccb194c8395c2e6d08
2018-02-23 15:54:47 -08:00
Linfeng Zhang
167594414f Merge "Add vp9_highbd_iht8x8_16_add_neon()" 2018-02-23 01:42:59 +00:00
Jerome Jiang
acac262663 Merge "VP9 SVC: Datarate test for dynamic bitrate change." 2018-02-23 00:21:56 +00:00
Jerome Jiang
e3c6d30294 VP9 SVC: Datarate test for dynamic bitrate change.
Change-Id: Ie1cd990dcb19a4cc18de4a2e487791f399c4b3cb
2018-02-22 15:05:03 -08:00
Kyle Siefring
dccb8b45bb Merge "Fold adds in 16->32-bit converts in SSE2/AVX2 fDCT" 2018-02-21 23:12:07 +00:00
Linfeng Zhang
29b6a30cd9 Add vp9_highbd_iht8x8_16_add_neon()
BUG=webm:1403

Change-Id: I11efb652f1aee371c71eee2d29e33793e4736832
2018-02-20 17:21:31 -08:00
Johann
c1435e321c remove deprecated 'register' keyword
Will be removed in C++17:
http://en.cppreference.com/w/cpp/language/storage_duration

Change-Id: Iadce5e2b974c707799fa939f3ff1c420fb79a871
2018-02-20 14:49:02 -08:00
Jerome Jiang
93da1ba2dc Merge "VP9 ROI test clean up regarding bool type flag." 2018-02-12 23:26:07 +00:00
Jerome Jiang
1a7b256f06 vp9_cx_iface: Remove else when returning from the other branch.
Change-Id: I2fc15ec25cc5587cafc6621176d0a6d7c376fc7c
2018-02-12 11:01:29 -08:00
Jerome Jiang
03e043e06c VP9 ROI test clean up regarding bool type flag.
Clean up code to make use_roi_ flag a bool.

Change-Id: I5b606ca19f8543840259d1cc79fe3301a2a70d30
2018-02-12 10:36:14 -08:00
Kyle Siefring
811b2e412e Fold adds in 16->32-bit converts in SSE2/AVX2 fDCT
Changes in the function size in bytes (in lieu of performance metrics)
                   Before    After    Diff
vpx_fdct32x32_avx2  29564 -> 28334   -1230
vpx_fdct32x32_sse2  38053 -> 36309   -1744

Change-Id: Ie0b3e6ed7c3f2e9ea45f9d6a1ce1e27d068cee6b
2018-02-10 14:25:24 -05:00
Jerome Jiang
edc9a46876 VP9 ROI: reset use_roi_ in datarate test.
Change-Id: I51765ce6c3c8e8646852c4da47b12a0198892c52
2018-02-10 08:39:43 -08:00
Jerome Jiang
4410d729d1 VP9 ROI: Fix errors in example encoder.
Fix some errors in the vpx_temporal_svc_encoder.

Change-Id: Id93f449364dcf72c826ca931df3c8c3d3b80100f
2018-02-09 14:47:00 -08:00
Jerome Jiang
11b55a0614 Merge "Reland "Add ROI support for VP9."" 2018-02-09 19:01:52 +00:00
Jerome Jiang
46adbc4af8 Reland "Add ROI support for VP9."
Extended ROI struct suitable for VP9.
ROI input from user is passed into internal struct and applied on every frame
(except key frame).

Enabled usage of all 4 VP9 segment features (delta_qp, delta_lf, skip,
ref_frame) via the ROI map input.
Made changes to nonrd_pickmode for the ref_frame feature.

Only works for realtime speed >= 5.
AQ_MODE needs to be turned off for ROI to take effect.

Change example in the sample encoder: vpx_temporal_svc_encoder.c to be suitable
for VP9.
Add datarate test.

Bump up ABI version.

BUG=webm:1470

Change-Id: I663b8c89862328646f4cc6119752b66efc5dc9ac
2018-02-09 10:55:46 -08:00
Jerome Jiang
efaaf387fc Merge "Revert "Add ROI support for VP9."" 2018-02-09 18:54:55 +00:00
Jerome Jiang
62b013abe8 Revert "Add ROI support for VP9."
This reverts commit 4e5b4b58483e1f38e37acd49b809d725b4f66c26.

Reason for revert: Commit message inaccurate.

Original change's description:
> Add ROI support for VP9.
> 
> Extended ROI struct suitable for VP9.
> ROI input from user is passed into internal struct and applied on every frame
> (except key frame).
> 
> Enabled usage of all 4 VP9 segment features (delta_qp, delta_lf, skip,
> ref_frame) via the ROI map input.
> Made changes to nonrd_pickmode for the ref_frame feature.
> 
> Only works for realtime speed >= 5.
> AQ_MODE needs to be turned off for ROI to take effect.
> 
> Change example in the sample encoder: vpx_temporal_svc_encoder.c to be suitable
> for VP9.
> Add datarate test.
> 
> Bump up ABI version.
> 
> BUG=webm:1470
> 
> Change-Id: I7e0cf6890649adb98a5fda2efb6ae1fa511c7fc9

TBR=yaowu@google.com,jzern@google.com,marpan@google.com,builds@webmproject.org,jianj@google.com

Change-Id: I000dbd81e0c67cb8a0dcde4013ee9bf7afb038f0
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webm:1470
2018-02-09 18:53:54 +00:00
Jerome Jiang
c930ea7dcd Merge "Add ROI support for VP9." 2018-02-09 16:58:55 +00:00
paulwilkins
2fa333c2ae Improved coding on slide show content.
This patch adds in detection of slide show key frame groups.
The detection assumes extremely  low or 0 motion for all frames
in the key frame group.

If this case is detected the boost level is set to a very high value
and the min Q to a lower value for the key frame itself.
Alt refs and golden frames are disabled to save bits (up to a limiting
maximum interval currently set to 240 frames).

In test samples that I created, this patch gave rise to a substantial
improvement in overall psnr and a drop in data rate. In some cases the
average psnr fell, however, with the boost and minQ values set as they are.

This is to be expected because previously a relatively poor key frame
could be followed by progressively better alt refs. For example a key
frame at q7.5 but subsequent alt refs improving it to lossless. Given that
average psnr tends to be dominated by the best frames, a ramp like this
from q7.5 to lossless may give a better average psnr than, for example,
coding the entire sequence at q2.5. Overall psnr, however, will be much
better in the latter case.  The option exists to boost the key frame further
which would  insure much better results for all metrics, but at the expense
of smaller bitrate savings. Given that these samples tend to have very
good quality anyway this seems like a bad trade off.

For slides displayed for several seconds, bitrate savings of >= 20% are likely
and much larger gains are possible in some cases.

Change-Id: Ib4b61e153c55d3f2f561153da13fdb56f397a52b
2018-02-09 15:13:25 +00:00
Marco
4e5b4b5848 Add ROI support for VP9.
Extended ROI struct suitable for VP9.
ROI input from user is passed into internal struct and applied on every frame
(except key frame).

Enabled usage of all 4 VP9 segment features (delta_qp, delta_lf, skip,
ref_frame) via the ROI map input.
Made changes to nonrd_pickmode for the ref_frame feature.

Only works for realtime speed >= 5.
AQ_MODE needs to be turned off for ROI to take effect.

Change example in the sample encoder: vpx_temporal_svc_encoder.c to be suitable
for VP9.
Add datarate test.

Bump up ABI version.

BUG=webm:1470

Change-Id: I7e0cf6890649adb98a5fda2efb6ae1fa511c7fc9
2018-02-08 16:30:56 -08:00
paulwilkins
b78dad3ffa Adjust MAXRATE_1080P.
This value was originally set in response to requests from the hardware
team before levels were properly defined for VP9.

Even if a level is not specified for an encode, it imposes a maximum
frame size for videos of dimensions <= 1080P.  For larger formats the
limit was set at 250 bits per MB.

This patch modifies the limit to be more in line with the requirements
specified for level 4 (max rate for a 4 frame group of 16 Mbits).  If a lower
level is specified at encode time and this mandates a smaller maximum frame
size then the level requirement will still take precedence.

Increasing this value allows for some slide shows or very low motion clips
to code a better quality key frame.

Change-Id: Ic08e0e09c8a918077152190c59732b9a1c049787
2018-02-08 12:31:09 +00:00
Paul Wilkins
1acc25f11b Merge "Fix file input pointer bug in allocate_gf_group_bits()." 2018-02-08 10:57:44 +00:00
Linfeng Zhang
0f3edc6625 Update iadst NEON functions
Use scalar multiply. No impact on clang, but improves gcc compiling.

BUG=webm:1403

Change-Id: I4922e7e033d9e93282c754754100850e232e1529
2018-02-08 07:23:55 +00:00
Linfeng Zhang
d8497e1fcd Clean vp9_highbd_iht4x4_16_add_neon()
Extract common code.

Change-Id: I422150ada1c6915f0ce39b912149994eb3bb3f12
2018-02-07 10:39:52 -08:00
paulwilkins
c104f4cbdc Fix file input pointer bug in allocate_gf_group_bits().
The stats input pointer, when passed in, already points to the
frame after the golden frame so should not be advanced here.

This fix has a small mostly positive effect on results in our test sets
(tested using corpus vbr settings) and gives a gain of almost 0.5%
in overall psnr (plus slightly smaller gains on other metrics) for the
4K set.

The bug also caused a crash in calculate_group_score() in another
patch which allows coding of slides in a slide show as a single
long KF group without ARFs or GFs.

Change-Id: I57a3a24baf442ce55dbc91fba05e056697c63a6f
2018-02-06 14:02:33 +00:00
Linfeng Zhang
82e9c30334 Update tx_type switch code in idct
Change-Id: Ia244bfd4b4eb9d703653792bc4f64c6f5358ae19
2018-02-05 13:42:26 -08:00
Linfeng Zhang
3636330490 Add vp9_highbd_iht4x4_16_add_neon()
BUG=webm:1403

Change-Id: Id9833e985fb70958cf4bde38f8e6303ed83c12f9
2018-02-05 13:42:16 -08:00
James Zern
0fe4371cc0 Merge "inv_txfm_vsx.c: make code c90 compatible" 2018-02-02 18:41:46 +00:00
Jerome Jiang
ac54d233b6 Merge "Fix issue for 0 target bitrate in multi-res build." 2018-02-02 05:32:55 +00:00
Jerome Jiang
519fed01c2 Fix issue for 0 target bitrate in multi-res build.
For encoding with --enable-multi-res-encoding, with 1 layer, when the
target bitrate is set 0, under these conditions null pointer
will be de-referenced. Fix is to check
cpi->oxcf.mr_total_resolutions > 1. Also added NULL pointer check.
This issue causes crash for asan build in chromium clusterfuzz.

BUG=805863

Change-Id: I9cd25af631395bc9fede3a12fb68af4021eb15f8
2018-02-01 20:17:54 -08:00
James Zern
73d1236384 inv_txfm_vsx.c: make code c90 compatible
move for loop declarations to function scope

Change-Id: I84d92a1a6ca6c5ac30aacb0f55d87ca3aef4c98f
2018-02-01 19:40:28 -08:00
James Zern
534e9af53b Merge "vp9_scale_test: parameterize filter type" 2018-02-01 20:44:48 +00:00
Paul Wilkins
79c14b83e9 Merge "Further change to code detecting slide transitions." 2018-02-01 10:21:38 +00:00
James Zern
14b21b84e3 vp9_scale_test: parameterize filter type
this allows the test to be sharded more efficiently and speeds up the
run when built with slower configs, e.g., asan.

Change-Id: If6d863b76871e3934704a1079bbf17f4886932c7
2018-01-31 23:38:47 -08:00
Marco
cb16652598 vp9-svc: Add condition on allocation for scaled_temp.
scaled_temp frame is used as an intermediate buffer for
2 stage down-sampling: two stages of 1/2 down-sampling
for a target of 1/4x1/4. This is used in 3 layer SVC
to avoid duplicate frame downsampling (on middle layer).

As this allocation is only needed/used when the
number_spatial_layers > 2, add this condition to avoid
unneeded allocation for 1 and 2 spatial SVC.

Change-Id: If342466644f685c1ea3ca5344b581793e5136c09
2018-01-31 15:19:27 -08:00
Marco
2c950e131c vp9-svc: Fix to initialize downsampling filters.
For 3 spatial layers with 1/2 downsampling, the
downsampling filter for the middle layer was not
set for the very first frame, so it was defaulting
to the subsample filter (no averaging/phase = 0).

Its not set due to the two stage scaling that is
done for 1/4 on base layer, during which the intermediate
1/2 result is saved for the middle layer.

Fix for now is to set the default downsampling filter
to Bilinear (averaging/non-zero phase) for all layers on
init (vp9_init_layer_context):.

Change-Id: Ic7407810b34c621e7e7420682508d45478bdffcf
2018-01-31 13:49:16 -08:00
paulwilkins
41d3331d42 Further change to code detecting slide transitions.
Eliminate false positives in previous patch.

The previous patch did a good job of detecting slide transitions but
in discussions a number of situations were identified that might trigger
harmful false positives. This risk seems to be born out by some testing
on a wider YT set done by yclin@.

This patch adds an additional clause that requires that the best case
inter and intra error for the frame are very similar,meaning it is almost
as easy to code a key frame as an inter frame. This will certainly prevent
the false positive conditions that Jim and I discussed and even if one
does occur it should not be very damaging.

The down side is that this clause may mean that we still miss some
real slide transitions, especially if the images are small and similar.  If this
proves to be the case then some further adjustment of the threshold may be
required. However, in the specific problem sample provided we do  trap every
transition correctly.

Change-Id: I7e5e79e52dc09bc47917565bf00cc44e5cddd44c
2018-01-31 17:44:46 +00:00
Marco Paniconi
efa786d464 vp9 svc: Make top layer non-ref: for 2 TL case
Only affects 2 temporal layer case.
Modified the flags for 2 temporal layers to make
top layer (top spatial, top temporal) a non-reference
frame, conistent with the 3 TL case.

Add mismatch check to the datarate test of changing
svc pattern on the fly, which is test for 2 temporal
layers.

This re-applies the change: 254e2f5501d,
that was reverted in: 658eb1d675.

Change-Id: Ib5fd4a7a0312c0c05329ae75baac480af34b4694
2018-01-31 09:17:43 -08:00
Marco Paniconi
658eb1d675 Merge "Revert "vp9 svc: fix to make top layer frame non-ref"" 2018-01-31 16:49:42 +00:00
Marco Paniconi
7edd1a6cea Revert "vp9 svc: fix to make top layer frame non-ref"
This reverts commit 254e2f5501d000ca66bc65c5f44bb6a882d4167c.

Reason for revert: <INSERT REASONING HERE>

Original change's description:
> vp9 svc: fix to make top layer frame non-ref
> 
> Add mismatch check to the datarate test of changing svc pattern on the
> fly.
> 
> Change-Id: I6a878736de44e6a40c077ed6430aabd7fadabdd9

TBR=marpan@google.com,builds@webmproject.org,jianj@google.com

Change-Id: Ibcb600438098f8dc380fe7e1de90cb81fc367468
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
2018-01-31 16:49:16 +00:00
Johann Koenig
848d6004a4 Merge "Fix warning about bitwise 'not' on boolean" 2018-01-31 14:25:13 +00:00
Johann Koenig
fdb64ec289 Merge "vp8 bool: verify buffer size" 2018-01-31 14:23:49 +00:00
Johann
8001c5c7a8 Fix warning about bitwise 'not' on boolean
cherry-picked from libaom:
commit cf26ee5ad2b9da79fa68c33b7d22ff53c66d6509
Author: Sebastien Alaiwan <sebastien.alaiwan@allegrodvt.com>
Date: Wed, 4 Oct 2017 10:09:13 +0200

BUG=webm:1491

Change-Id: I36c6e83ed716649f3d9ee10ce3aa9bb847cac2d9
2018-01-30 14:47:38 -08:00
Johann
c59c84fc74 vp8 bool: verify buffer size
In the process of fixing a ubsan warning:
  commit 738b829b8cdf079a5fa48c74a28a177c9567d212
  Fix incorrect size reading
the inferred check of start < end was removed. This causes fuzzed files
to get a little further and segfault in vp8dx_start_decode.

Change-Id: I316e23058753ba42dbcc46d27eb575f51c8a9e9a
2018-01-30 12:20:06 -08:00
Marco Paniconi
de3a7e2630 Merge "vp9 svc: fix to make top layer frame non-ref" 2018-01-30 16:56:42 +00:00
Johann Koenig
8f952bada7 Merge "Fix doc comment mismatch in vpx_frame_buffer.h" 2018-01-30 15:32:22 +00:00
Jerome Jiang
254e2f5501 vp9 svc: fix to make top layer frame non-ref
Add mismatch check to the datarate test of changing svc pattern on the
fly.

Change-Id: I6a878736de44e6a40c077ed6430aabd7fadabdd9
2018-01-29 18:38:46 -08:00
Linfeng Zhang
5eca3c23c3 Merge "Update vp9_iht8x8_64_add_neon()" 2018-01-30 01:20:41 +00:00
Jerome Jiang
e14e9c9964 Merge "Datarate test for usage of SVC_SET_REF_FRAME_CONFIG" 2018-01-30 00:01:46 +00:00
Linfeng Zhang
b14b616d96 Update vp9_iht8x8_64_add_neon()
Change-Id: Ie70ed8b9273df5e1fd06bc93cb469e80630941d2
2018-01-29 15:17:08 -08:00
Brion Vibber
ddf40ec156 Fix doc comment mismatch in vpx_frame_buffer.h
When compiling an app using libvpx in Xcode 9.2, a warning is
thrown in vpx_frame_buffer.h:

  "Parameter 'new_size' not found in the function declaration"

Switching it to 'min_size' to match the comment text and the
callback type definition prototype resolves it.

Change-Id: I7a3e4a857c2007c2d0d390e22054d7bc85068aa1
2018-01-29 15:13:09 -08:00
Jerome Jiang
9a96b18f03 Datarate test for usage of SVC_SET_REF_FRAME_CONFIG
Change-Id: Iea7fc1b6cea84826eb45b1f01bd923323c2c9a6f
2018-01-29 14:41:41 -08:00
Linfeng Zhang
77108f5001 Merge changes Ica8dbe5f,I8f4e0fc6
* changes:
  Update vp9_iht4x4_16_add_neon()
  Clean dct_const_round_shift() related neon code
2018-01-29 20:16:47 +00:00
Johann
7e75e8a622 Merge remote-tracking branch 'origin/mandarinduck' into HEAD
The following changes were not carried back from the release branch:
  commit f87a4594fbd0b19071a2befebf52d3f5fabd1a9e
  Revert "Add frame width & height to frame pkt. Add test."

  commit c5dc3373dbd442ea299bacf276c4258fa7ce0559
  work around pic issue with gcc 6

BUG=webm:1490

Change-Id: Id3e15983d5565680c05a0c454544003a615a4d7f
2018-01-29 11:57:00 -08:00
Linfeng Zhang
903bc150da Update vp9_iht4x4_16_add_neon()
Change-Id: Ica8dbe5f8167e5d370d89d233c598b70bba123b7
2018-01-29 10:25:24 -08:00
Linfeng Zhang
884d1681f8 Clean dct_const_round_shift() related neon code
Change-Id: I8f4e0fc6ecb77b623519f2dd3cd2886f89218ddd
2018-01-29 10:23:24 -08:00
Linfeng Zhang
2654afc16c Merge "cosmetic: clean idct neon functions" 2018-01-29 17:34:11 +00:00
Johann Koenig
ea1d0a6b53 Merge "Fix incorrect size reading" 2018-01-27 01:42:58 +00:00
Johann
738b829b8c Fix incorrect size reading
Cherry pick from vp9:

commit 85770264ac891505730dcd5092d1993a62c74060
Guard against incorrect size values moving *data past data_end.

Check read length against the difference of the buffers.

Change-Id: I5e8679ddd447c4d73deb80be5ec94841a92c5fcd
2018-01-26 15:51:50 -08:00
Jerome Jiang
3fa713caee Merge "vp9 svc: Update temporal_layering_mode in config change." 2018-01-26 22:45:39 +00:00
Jerome Jiang
cc91abb325 vp9 svc: Update temporal_layering_mode in config change.
temporal_layering_mode can be changed on the fly.

BUG=webm:1488

Change-Id: I223fd4085184e41878ddf0f9244d2e3d07636ae3
2018-01-26 13:38:04 -08:00
Marco
a9bbff1049 vp9-svc: Adjust logic on intra mode search.
For SVC, on spatial enhancement layer, intra
search was disabled unless best reference frame
is golden (i.e., spatial/inter-layer prediction),
except for some other conditions (lower layer is key
or golden is not an allowed reference).

Fix is to add the base temporal layer condition,
so intra search will not be force-disabled for base
temporal layer frames.

This improves metrics (-1-2%) for SVC 3 and 2 layer config.
Some small encode time is expected, but since condition
only affect base temporal layers (i.e., every 4 frames
for 3 layers), increase is small.

Change-Id: I10b824faef99560dfdeeb02ba8bf8e3e1eea6255
2018-01-25 19:11:42 -08:00
Marco
067457339b vp9-svc: Add QP dependency to thresh_svc_skip_golden.
In nonrd-pickmode: the golden/spatial reference for inter-layer
prediction may be skipped in the mode testing. Add QP dependency
to reduce the threshold for skipping (i.e., check it more often)
at high QP, if the lower layer was encoded at lower QP relative
to the current layer.

At high QP, a better quality lower resolution is more likely to
provide good spatial (inter-layer) prediction.

avgPSNR/SSIM metrics up by ~1% (all clips positive gain or neutral).
Some decrease in encode time (~1-2%) expected at lower bitrates,
for 3 layer SVC.

Change-Id: I9ee0f62d4b10d4ebd30165d378ecfa4399ae5ef1
2018-01-25 09:00:58 -08:00
Marco Paniconi
d069f4c29d Merge "vp9: Fix to vp9_svc sample encoder for bypass mode." 2018-01-24 23:56:48 +00:00
Johann Koenig
cee96c7d85 Merge "remove obsolete doxygen tags" 2018-01-24 23:44:12 +00:00
Marco
43caed4e42 vp9: Fix to vp9_svc sample encoder for bypass mode.
This fix makes it bitexact to the default SVC pattern,
for the example 2 temporal layer case.

Change-Id: I4df2063b70f7aecbfc7082f29c8439e05f6db8ac
2018-01-24 15:21:59 -08:00
Scott LaVarnway
15b261d854 Merge "BUG FIX: sse2 subpel variance is not PIC compliant" 2018-01-24 22:54:42 +00:00
Johann
3bfadfcd62 remove obsolete doxygen tags
warning: Tag `XML_SCHEMA' at line 941 of file `doxyfile' has become obsolete.

warning: Tag `XML_DTD' at line 947 of file `doxyfile' has become obsolete.

Change-Id: I85e39c4fb154569b8d7f68bdf362408983e9bd4f
2018-01-24 14:40:46 -08:00
Johann
f80be22a10 Release 1.7.0 Mandarin Duck
Change-Id: I186440f3643a85694f45400393efb661f6d012fc
2018-01-24 14:25:44 -08:00
Linfeng Zhang
6248f0c91f cosmetic: clean idct neon functions
Change-Id: I9c7c52567850aded0437b13ba1260e94441bc49d
2018-01-24 13:55:15 -08:00
Marco Paniconi
3b85a5beb7 Merge "vp9-svc: Re-adjust some aq-mode=3 control parameters." 2018-01-24 20:29:10 +00:00
Scott LaVarnway
cb9f4dc105 BUG FIX: sse2 subpel variance is not PIC compliant
BUG=webm:1464

Change-Id: Ibc15bac54aaf509365bed5892a26a29972ad3540
2018-01-24 05:58:54 -08:00
Scott LaVarnway
b9e44842fc Merge "vp9_quantize_fp_avx2()" 2018-01-24 13:58:08 +00:00
Marco
7c69136494 vp9-svc: Re-adjust some aq-mode=3 control parameters.
Remove an adjustment to two cyclic refresh (aq-mode= 3)
parameters for SVC. The adjustment was to reduce the
delta-qp on second segment, and reduce the motion threshold.
This was done early on in the SVC encoder development,
in the latest codebase removing this adjustment yields
some improvements in metrics.

The avgPSNR/SSIM metrics increase on average by ~1%
(most clip positive gain), for 3 and 2 layer SVC.

Change-Id: I7a4d5114f16b2a1df383dbe6b3fe02940e29e6cc
2018-01-23 20:14:00 -08:00
Johann Koenig
742ae4b24d Merge "update .clang-format for v5.0.0" 2018-01-24 04:03:23 +00:00
James Zern
81d66e2cc6 vpx_codec_enc_init_multi: fix segfault w/vp9
vp9 does not support multi-res encoding, the request should not crash.

+ encode_api_test: unconditionally expose multi-res test

vpx_codec_enc_init_multi should fail independent of
CONFIG_MULTI_RES_ENCODING if not for the same reason.

Change-Id: I44fc58ef70ee4e0e482cb6a5736885f4cb2a8517
(cherry picked from commit 004fb91416e355986dc098883791becf39ffc1f7)
2018-01-23 18:14:23 -08:00
Jerome Jiang
9f36419bf2 Fix crash invalid params for vp8 multres. Add test.
Fix is from the patch in the issue.
Release memories allocated before early exit.

BUG=webm:1482

Change-Id: I64952af99c58241496e03fa55da09fd129a07c77
(cherry picked from commit 5b6ae020b6a972b67b59b3dbf7cf9cbd3140a80d)
2018-01-23 18:14:14 -08:00
James Zern
d1e9635402 Merge "vpx_codec_enc_init_multi: fix segfault w/vp9" 2018-01-24 02:12:00 +00:00
Jerome Jiang
dcbe6750e1 Merge "Fix frame sizes in pkt to support spatial layers." 2018-01-24 01:12:44 +00:00
Shiyou Yin
6ee88546c0 Merge "vp8: [loongson] fix bug of type conflict." 2018-01-24 01:06:42 +00:00
James Zern
004fb91416 vpx_codec_enc_init_multi: fix segfault w/vp9
vp9 does not support multi-res encoding, the request should not crash.

+ encode_api_test: unconditionally expose multi-res test

vpx_codec_enc_init_multi should fail independent of
CONFIG_MULTI_RES_ENCODING if not for the same reason.

Change-Id: I44fc58ef70ee4e0e482cb6a5736885f4cb2a8517
2018-01-23 15:52:03 -08:00
Johann
7e14e0f109 update .clang-format for v5.0.0
Change-Id: Id43e8ce9cf3790b728683acc9686e246ccaa90cf
2018-01-23 13:41:22 -08:00
Linfeng Zhang
231012fdab Add vp9_highbd_iht16x16_256_add_sse4_1()
BUG=webm:1413

Change-Id: I8d7eeae1bd219eb848c1a86071046a477f7a91af
2018-01-23 11:24:42 -08:00
Linfeng Zhang
8fd648c78a Merge "Add "vpx_" prefix to 2 idct x86 functions" 2018-01-23 18:28:59 +00:00
Jerome Jiang
b8159fab38 Merge "Fix crash invalid params for vp8 multres. Add test." 2018-01-23 17:25:28 +00:00
Linfeng Zhang
8f50e06012 Add "vpx_" prefix to 2 idct x86 functions
Change-Id: I4f3052d8748e16b06e9155f8daf22f867dfaa7a3
2018-01-23 09:17:38 -08:00
Linfeng Zhang
6fea41abee Merge "Add vp9_highbd_iht8x8_64_add_sse4_1()" 2018-01-23 17:04:20 +00:00
Shiyou Yin
d344ab03cc vp8: [loongson] fix bug of type conflict.
In commit 577d4fa79, int8_t was used to replace char. This will result in a
compilation error, for int8_t was typedefined to signed char, but not char.

Change-Id: I5c9837e01b0b58688a7741f5c9a99a76ca887e4a
2018-01-23 14:28:55 +08:00
Jerome Jiang
2c2fea2c5b Fix frame sizes in pkt to support spatial layers.
Add test for svc frame sizes in pkt.

BUG=webm:1485

Change-Id: I983dc229e526d72d22360d7f3016d8358d6beae7
2018-01-22 21:05:39 -08:00
Jerome Jiang
5b6ae020b6 Fix crash invalid params for vp8 multres. Add test.
Fix is from the patch in the issue.
Release memories allocated before early exit.

BUG=webm:1482

Change-Id: I64952af99c58241496e03fa55da09fd129a07c77
2018-01-22 20:30:45 -08:00
Johann Koenig
3761254119 Merge changes from topic "clang-format"
* changes:
  clang-format v5.0.0 vp9/
  remove spurious comments
  clang-format v5.0.0 vp8/
  clang-format v5.0.0 vpx_dsp/
  clang-format v5.0.0 mem_ops.h
  clang-format v5.0.0 vpx_util/vpx_atomic.h
  clang-format v5.0.0 y4minput.c
  clang-format v5.0.0 vpxenc.c
  clang-format v5.0.0 examples/
  clang-format v5.0.0 test/
2018-01-22 19:38:42 +00:00
Linfeng Zhang
9874ec07bd Add vp9_highbd_iht8x8_64_add_sse4_1()
BUG=webm:1413

Change-Id: Id9038226902b2d793fc6c17ac81bb104c1a18988
2018-01-18 15:49:44 -08:00
Scott LaVarnway
c7449b482c vp9_quantize_fp_avx2()
Started from vp9_quantize_fp_sse2 and tweaked to use avx2.

Change-Id: Ic2da50cc9d73896c7ef2f3cd3db5b1c5d7795b8b
2018-01-18 13:33:30 -08:00
Johann
281f68a81f clang-format v5.0.0 vp9/
Remove trailing commas to keep multiple elements on one line.

Add blank lines to prevent comments from being treated as blocks.

clang-format guards for struct with a comment in the middle.

Change-Id: I3bcb8313ae8aaf69179249a13b4087b1272cdbc0
2018-01-18 12:37:58 -08:00
Johann
68cc1dc422 remove spurious comments
These don't appear to make any sense given their context. The
commit log also does not reveal anything.

Discovered due to spurious clang-format indenting:
https://bugs.llvm.org/show_bug.cgi?id=35930

Change-Id: I732a66056ba4c05e3e132a2f236fe10f7a282900
2018-01-18 12:37:58 -08:00
Johann
f95bf1db50 clang-format v5.0.0 vp8/
Allow*OnASingleLine appears to no longer apply to
typedef structs.

Adjust closing parenthesis/opening brace on functions.

Remove trailing commas to keep multiple elements on one line.

Change-Id: I6e535a8ddb15c9b3de8216ce8ddb2a18241af46c
2018-01-18 12:37:58 -08:00
Johann
97acbbb701 clang-format v5.0.0 vpx_dsp/
Remove comments above #define statements because they get
indented unnecessarily.
https://bugs.llvm.org/show_bug.cgi?id=35930

Add blank lines to prevent comments from being treated as
blocks.

Change-Id: I04dce21b2a10e13b8dc07411a0019c098f6dd705
2018-01-18 12:37:50 -08:00
Marco
9debbc2ec7 vp8: Fix to multi-res-encoder for skipping streams.
For the vp8 simulcast/multi-res-encoder:

Add flags to keep track of the disabling/skipping of
streams for the multi-res-encoder. And if the lower spatial
stream is skipped for a given stream, disable the motion
vector reuse for that stream.

Also remove the condition of forcing same frame type
across all streams.

This fix allows for the skipping/disabling of the base
or middle layer streams.

Change-Id: Idfa94b32b6d2256932f6602cde19579b8e50a8bd
2018-01-18 11:56:42 -08:00
Johann Koenig
740883897a Merge "Revert "Add frame width & height to frame pkt. Add test."" into mandarinduck 2018-01-17 20:17:33 +00:00
Johann
f87a4594fb Revert "Add frame width & height to frame pkt. Add test."
This reverts commit bd1d995cd38b4e31a01356079f1d94067273eb28.

Remove the feature from the release as it requires additional work.

BUG=webm:1485

Change-Id: I1a01ac2525703af97a456a3eed85718306c0f734
2018-01-17 11:28:24 -08:00
Vignesh Venkatasubramanian
eedda5f924 vp8dx.h: Add macro for skipping loop filter
Without this applications cannot use the vpx_codec_control macro
for VP9_SET_SKIP_LOOP_FILTER. The tests only cover the underscored
version vpx_codec_control_().

Change-Id: I3e6c1888307b76636fdc1a8deae70b5c14238163
(cherry picked from commit 373e08f921e5bfd5a96963fabbbbe16ec793d44e)
2018-01-16 18:27:42 -08:00
Vignesh Venkatasubramanian
373e08f921 vp8dx.h: Add macro for skipping loop filter
Without this applications cannot use the vpx_codec_control macro
for VP9_SET_SKIP_LOOP_FILTER. The tests only cover the underscored
version vpx_codec_control_().

Change-Id: I3e6c1888307b76636fdc1a8deae70b5c14238163
2018-01-16 15:42:43 -08:00
paulwilkins
7d19739949 Fix bug in use of zoom metric as part of arf breakout.
The in/out (or zoom metrics) in accumulate_frame_motion_stats()
are in effect a % of the blocks that have a motion vector pointing
either towards or away from the center. As such they are already
normalized in terms of image size and the thresholds against which
these are tested should be image size independent.

In practice a zoom either in or out is an indicator for a shorter group
length so the abs value is more important as a breakout clause.

This patch fixes the threshold test. Clips without noticeable zoom show
no effect but some  with strong zooms such as "station" show a big
gain (5-10%). Average psnr-hvs gain on hdres set was 0.292%

Change-Id: I4f97a72b0e273e4e844ade15285749c32cd81c1c
(cherry picked from commit 0226ce79e9389ccf7d10ed7acacba6840ad911c9)
2018-01-16 11:21:29 -08:00
Paul Wilkins
f915e6d4af Merge "Add zoom break out for kf boost loop." 2018-01-12 18:45:28 +00:00
Paul Wilkins
733820c509 Merge "Fix kf detection in some slide shows." 2018-01-12 18:45:13 +00:00
Johann
eb20d6f64c clang-format v5.0.0 mem_ops.h
Remove trailing empty line to keep the comment from being indented.
https://bugs.llvm.org/show_bug.cgi?id=35930

Change-Id: I6c51f7afb4cc47f03a190b4c90e29e4ff1e0c689
2018-01-12 09:15:22 -08:00
Johann
b4fb99220b clang-format v5.0.0 vpx_util/vpx_atomic.h
Allow*OnASingleLine appears to no longer apply to
typedef structs.

Change-Id: If10db1c30c74ee31dad1a0b1926964e850f15fd2
2018-01-12 09:15:19 -08:00
Johann
fd7de8362d clang-format v5.0.0 y4minput.c
Remove trailing empty line to keep the comment from being indented.
https://bugs.llvm.org/show_bug.cgi?id=35930

Change-Id: If0f0862623b3fa3ae49e850edbbed52c2b4c6672
2018-01-12 09:15:15 -08:00
Johann
b87250c56e clang-format v5.0.0 vpxenc.c
Treat the formatted string as one distinct parameter to fprintf

Change-Id: I62cfd5657c4cefc6b3fa45247ba9f33515a292b1
2018-01-12 09:15:12 -08:00
Johann
e1c69544b1 clang-format v5.0.0 examples/
Attempts to group () expression on their own line.

Change-Id: I404f9dd1a91aaa2100925c90162bcdefbead5ad2
2018-01-12 09:15:10 -08:00
Johann
8f25c3ff8f clang-format v5.0.0 test/
Remove trailing commas to keep multiple elements on one line.

Remove trailing empty lines to keep comments from being indented.
https://bugs.llvm.org/show_bug.cgi?id=35930

Change-Id: I0a66dde95f2a304f13cb85a2e9197afca20051e8
2018-01-12 09:14:56 -08:00
Scott LaVarnway
8c0cd2bd76 Merge "Add quantize_fp_32x32_nz_c()" 2018-01-11 23:05:33 +00:00
Marco Paniconi
2879e0d2cc Merge "vp9: Skip encoding of enhancement layers on the fly." 2018-01-11 22:08:49 +00:00
Johann
f5b2dd2a66 adopt some clang 5.0.0 formatting
At least the changes that don't conflict with 4.0.1

Change-Id: I9b6a7c14dadc0738cd0f628a10ece90fc7ee89fd
2018-01-11 12:35:24 -08:00
Marco
f8639b1554 vp9: Skip encoding of enhancement layers on the fly.
For SVC: if an enhancement layer (spatial_layer > 0)
has 0 bandwidth, skip/drop the encoding of the layer.
This allows the application to dynamically disable
higher layers for SVC.

Add flag to signal the skip encoding, this is needed
to modify the packing of the superframe when the top
layer is skipped/dropped.

Also moved some updates (current_video_frame counter and
the last_avg_frame_bandwidth) to the postencode_update_drop_frame().

Added datarate unittest for dynamically going from 3 to 2
and then back to 3 spatial layers.

Change-Id: Idaccdb4aca25ba1d822ed1b4219f94e2e8640d43
2018-01-11 10:38:30 -08:00
Vlad Tsyrklevich
1633786bfb [CFI] Remove function pointer casts
Control Flow Integrity [1] indirect call checking verifies that function
pointers only call valid functions with a matching type signature. This
change eliminates some function pointer casts that I missed in my last
CL https://crrev.com/c/780144.

BUG=chromium:776905

[1] https://www.chromium.org/developers/testing/control-flow-integrity

Change-Id: I1c7adbdfffa4fe0b62e993bfb31d06e64b022d66
2018-01-10 16:38:26 -08:00
Paul Wilkins
bbdbee429f Merge "Fix bug in use of zoom metric as part of arf breakout." 2018-01-10 17:33:00 +00:00
paulwilkins
32f86ce276 Add zoom break out for kf boost loop.
Adds a breakout threshold to key frame boost loop.

This reduces the boost somewhat in cases where there is a
significant zoom component. In tests most clips no effect
but a sizable gain for some clips like station.

Change-Id: I8b7a4d57f7ce5f4e3faab3f5688f7e4d61679b9a
2018-01-10 17:26:32 +00:00
paulwilkins
bb4052b873 Fix kf detection in some slide shows.
This fix improves detection of key frames in slide shows.

In particular it helps if the slides are pictures of varying formats
as in a sample provided by yclin@.

This change does not impact any of the clips in our standard tests
but for the example slide show test clip helped global psnr by
several db and resolved a serious visual quality issue.

Change-Id: Iaeeeed55dc0bb50aeacd4996ed660ced06374603
2018-01-10 15:07:38 +00:00
Johann
c5dc3373db work around pic issue with gcc 6
Enable pic when building sse2 or higher optimizations.

BUG=webm:1464

Change-Id: I36c6e83ed716649f3d9ee10ce3aa9bb847cac2d9
2018-01-09 12:46:45 -08:00
Linfeng Zhang
e20ca4fead Add vp9_highbd_iht4x4_16_add_sse4_1()
BUG=webm:1413

Change-Id: I14930d0af24370a44ab359de5bba5512eef4e29f
2018-01-08 10:14:20 -08:00
Linfeng Zhang
7a41610581 Update dct_test.cc
Make 8-bit functions testing available in high bitdepth.

Change-Id: Ic030c75aa4c6b649c52426abb4bb2122882de0fe
2018-01-08 10:07:38 -08:00
Linfeng Zhang
b25b2ca455 Merge "Update iadst4_sse2()" 2018-01-08 17:15:45 +00:00
Marco Paniconi
bed28a55f5 Merge "vp9-svc: Use eightap_smooth for downsampling at low resol." 2018-01-05 19:01:31 +00:00
Marco
321f295632 vp9-svc: Use eightap_smooth for downsampling at low resol.
Switch from bilinear to eighttap_smooth for frame-level
downsampling at low resolutions (<= 320x240).

avgPSNR/SSIM metrics increase from ~0.5-2% (all clips positive gain),
for 2 and 3 spatial layer SVC, with 3 temporal layers.
Small/negligible increase in encoding time (< 1%).

Change-Id: I758472fc4fddd51d87f13c9d1a1cd4986ef5d41f
2018-01-05 10:17:08 -08:00
paulwilkins
0226ce79e9 Fix bug in use of zoom metric as part of arf breakout.
The in/out (or zoom metrics) in accumulate_frame_motion_stats()
are in effect a % of the blocks that have a motion vector pointing
either towards or away from the center. As such they are already
normalized in terms of image size and the thresholds against which
these are tested should be image size independent.

In practice a zoom either in or out is an indicator for a shorter group
length so the abs value is more important as a breakout clause.

This patch fixes the threshold test. Clips without noticeable zoom show
no effect but some  with strong zooms such as "station" show a big
gain (5-10%). Average psnr-hvs gain on hdres set was 0.292%

Change-Id: I4f97a72b0e273e4e844ade15285749c32cd81c1c
2018-01-05 13:19:35 +00:00
Marco
55db4f033f vp9: Increase convergence speed of noise estimation.
Increase the recursive average factor from 15/16 to 3/4
to make the noise estimation respond faster.

Small/neglible change on low noise content, but better
denoising for noisy content.
Also encoder speedup of ~2-3% observed on some noisy clips.

Change-Id: I9dd02fe961ca24b411fe4c2732f814bf1e9a7f9f
2018-01-04 14:29:27 -08:00
Linfeng Zhang
867b593caa Update iadst4_sse2()
Change-Id: I21ff81df0d6898170a3b80b3b5220f9f3ac7f4e8
2017-12-28 16:47:57 -08:00
Scott LaVarnway
fe5d87aaeb Add quantize_fp_32x32_nz_c()
This c version uses the shortcuts found in the
vp9_quantize_fp_32x32_ssse3 function.

Change-Id: I2e983adb00064e070b7f2b1ac088cc58cf778137
2017-12-26 06:11:21 -08:00
Scott LaVarnway
8a4336ed2e Add vp9_quantize_fp_nz_c() -- 2
This c version uses the shortcuts found in the x86
vp9_quantize_fp functions.

The test was updated to use the correct quant/round range.

Change-Id: Ie5871f710d9eb39047d8d9f48b907c0633e1f830
2017-12-21 15:26:36 -08:00
James Zern
1a7bf0d1f9 Merge "vp9_quantize_ssse3_x86_64: fix out of bounds write" 2017-12-21 23:02:32 +00:00
Ralph Giles
117893a717 Don't force inlining for msvc targets.
INLINE is defined as __forceinline for vs* configs, but is the
normal, compiler-discretion inline for gcc/clang configs. This
makes many functions very large when building for windows targets,
much larger than they are elsewhere.

Use '__inline' as a consistent definition to get consistent function
sizes. Although Visual Studio documentation says that 'inline' is
only available in C+ code. This is probably incorrect, since Visual
Studio 2017 accepts C99 'inline' even when passed /TC. Nevertheless,
this commit uses the recommended '__inline' for consistency.

Thanks to David Major for the diagnosis.

Change-Id: Ib0b31a3afcea77822c84fe3c6cd452add66d825a
2017-12-21 13:55:18 -08:00
James Zern
84a7263d4c vp9_quantize_ssse3_x86_64: fix out of bounds write
eob is a pointer to a uint16_t. previously the code would store 64-bits
causing a crash or test failure with the right stack layout.

Change-Id: Ibd653baf323db114f2444951b9d8b00c596bf15a
2017-12-21 16:53:14 -05:00
James Zern
7a245adb18 Revert "Add vp9_quantize_fp_nz_c()"
This reverts commit 86842855d30d6ca6befdcf5108003e027d90daa9.

SSSE3/VP9QuantizeTest.EOBCheck/1 fails on Mac and the build breaks under
visual studio due to a #if within another macro.

Change-Id: I475095a04aafcc714fade2b24e4df7b682be2cd1
2017-12-21 06:05:19 -08:00
Scott LaVarnway
de50e8052c Merge "Add vp9_quantize_fp_nz_c()" 2017-12-20 23:15:11 +00:00
James Zern
1a9c7bee88 Merge "lpf_test: correct threshold ranges" 2017-12-20 20:22:34 +00:00
Marco
9ca9c12dbd vp9-svc: Add layer bitrate targeting to SVC datarate tests.
Modify and update the SVC datarate unittests to verify the
rate targeting for each spatial-temporal layer.
The current tests were only verifying the rate targeting
of the full SVC stream, not individual layers.
Also re-enabled a test that was disabled.

This is a stronger verification of the layered rate control
for SVC for 1 pass CBR encoding.

Added PostEncodeFrameHook, needed to get the layer_id and
update the layer buffer level.

Change-Id: I9fd54ad474686b20a6de3250d587e2cec194a56f
2017-12-19 19:48:47 -08:00
Scott LaVarnway
86842855d3 Add vp9_quantize_fp_nz_c()
This c version uses the shortcuts found in the x86
vp9_quantize_fp functions.

The test was updated to use the correct quant/round range.

Change-Id: I5d19f8af2fddda8e50910249eafb740acb29415b
2017-12-19 12:48:45 -08:00
Marco
a2127236ae vp9: Reset buffer level on large bitrate changes.
For a large change in the target avg_frame_bandwidth,
via the update in change_config()), reset the buffer_level
to optimal_level.

This fix prevents possible frame drops, where for example,
encoder suddenly goes from lower to higher bitrate.

Change-Id: I2f844c41d04c01240e85f574e59d2b9075c7eb6d
2017-12-19 09:57:21 -08:00
James Zern
5203b40a2a lpf_test: correct threshold ranges
the random number generator creates values from [0, range) add 1 to all
and make hev more realistic by mirroring its calculation of level >> 4,
i.e., [0, 3]

Change-Id: Ic19be5d7ba668deb17c96f143b739116a4b5d21c
2017-12-18 23:17:45 -08:00
Shiyou Yin
08a668af32 vp8: [loongson] optimize loopfilter v2.
Optimize function vp8_mbloop_filter_vertical_edge_mmi and
function vp8_mbloop_filter_horizontal_edge_mmi.
Make full use of memory loading delay slot and reduce unnecessary
instructions.

Change-Id: I61da2c3a44c06044225461f46bf487d83cba6c16
2017-12-15 17:06:47 +08:00
Shiyou Yin
09519a55c7 Merge "vp8: [loongson] optimize sixtab predict v2." 2017-12-15 00:53:21 +00:00
Johann Koenig
7970cc02df Merge "add copyright to rtcd files" 2017-12-14 23:44:30 +00:00
Johann Koenig
d95ddc7c71 Merge "mark generated version header" 2017-12-14 23:44:04 +00:00
Johann
e4b3f03c64 add copyright to rtcd files
Allows them to pass the license check in chromium.

BUG=chromium:98319

Change-Id: Iefc1706152a549d8c4ae774c917596bf1c9492d8
2017-12-14 22:50:08 +00:00
Johann Koenig
7d1bf5d12a Merge "remove unused tools" 2017-12-14 21:19:59 +00:00
Johann Koenig
9f8433ffe2 Merge "fix typo in boilerplate" 2017-12-14 21:19:47 +00:00
Johann
920ba82409 remove unused tools
all_builds.py has been more or less replaced by Jenkins.

author_first_release.sh is unused.

ftfy.sh has been obviated by having the whole tree clang-format clean.

Change-Id: I741315ad9042e6e901f07410e93f28371db703b2
2017-12-14 20:34:14 +00:00
Johann
fe4de1ff63 mark generated version header
Allows it to pass the license check in chromium.

BUG=chromium:98319

Change-Id: I5ba9c8c81ab9eb4168df09db9d2eab846e99e981
2017-12-14 11:58:10 -08:00
Johann
6746ba6d01 fix typo in boilerplate
The extra 'e' was causing the chromium license check to flag this file.

BUG=chromium:98319

Change-Id: Ic875ba66370298bf998438d14ff5f7e760293706
2017-12-14 11:54:16 -08:00
Johann
05e6e9ac83 mark generated rtcd headers
Allows them to pass the license check in chromium.

BUG=chromium:98319

Change-Id: Ib37bf45bdac8cf1edc62037dea17b734a5e37fa7
2017-12-14 11:48:46 -08:00
Shiyou Yin
f2ad523461 vp8: [loongson] optimize sixtab predict v2.
1. Delete unnecessary zero setting process.
2. Optimize the method of calculating SSE in vpx_varianceWxH.

Change-Id: I8bab801416e7f4958c28c6d080e3cf785a50f82b
2017-12-14 16:29:58 +08:00
Marco
c58f01724c vp9: Update to SVC datarate tests.
With recent fixes to rate control for SVC the
buffer underrun in the tests does not happen,
so comment and TODO can be removed.

Also, in some of these SVC tests, replace the HD clip
with the corresponding VGA clip, which has > 400 frames.
For the (niklas) HD clip: it has only 60 frames but the
test was running up to 300 frames. Fixed it to 60 frames.

Keep some tests with the HD clip, needed for the 4 thread
and 5 level scaling test.

Change-Id: I0a2356a908e8b2271c7a422eb8b15c0d56eec968
2017-12-13 14:07:52 -08:00
Marco Paniconi
028429310a Merge "vp9: Reset rc flags on some configuration changes." 2017-12-13 21:03:40 +00:00
Marco
e9ad5d2aee vp9: Cleanup/remove TODO comment.
Change-Id: I2bd43e996909ad688b7e00b81ee19a5fc4df460b
2017-12-13 11:30:09 -08:00
Marco
a40fa1f95d vp9: Reset rc flags on some configuration changes.
For large dynamic changes in target avg_frame_bandwidth, or
a change in resolution, via the update in change_config()),
reset the under/overshoot flags (rc_1_frame, rc_2_frame)
to prevent constraining the QP for the first few frames
following the change.

For SVC use the spatial stream avg_frame_bandwidth in
reset condition.

For the avg_frame_bandwidth condition, use fairly large
threshold (~50%) for now in reset.

This allows for better/faster QP response if, for example,
application dynamically changes bitrate by large amount.

Change-Id: Ib6e3761732d956949d79c9247e50dba744a535c0
2017-12-13 10:41:38 -08:00
Paul Wilkins
94eaecaa91 Merge "Bug fix for second reference stats." 2017-12-12 11:56:10 +00:00
Jerome Jiang
f9ecdc35ec Merge "vp9 svc: Allow denoising next to highest resolution." 2017-12-12 05:27:11 +00:00
Jerome Jiang
c1e511fd82 vp9 svc: Allow denoising next to highest resolution.
Denoise 2 spatial layes at most.

Add noise sensitivity level 2 for vp9 such that applications can control
whether to denoise the second highest spatial layer.

Add tests to cover this case.

Change-Id: Ic327d14b29adeba3f0dae547629f43b98d22997f
2017-12-11 15:20:19 -08:00
Jerome Jiang
a1689ed16b Merge "Fix build warnings for gcc 6.3" 2017-12-11 18:27:17 +00:00
paulwilkins
f1ce050f44 Bug fix for second reference stats.
Immediately following a key frame the trailing second reference
error in the first pass stats will be based on a reference frame from
the prior key frame group and will thus usually be much larger.

This fix eliminates that effect (which typically triggers a short arf
group immediately after a key frame). It also changes the accounting
for the first frame in each new arf group.

This change gives large gains on a couple of clips that contain mid
sequence key frames (e.g. 6% on 1080P tennis). Overall there was
a net gain in PSNR and PSNR-HVS ~(0.05- 0.4%) and mixed results for
SSIM (+/- 0.2%).

Change-Id: I8e00538ac2c0b5c2e7e637903cac329ce5c2a375
2017-12-08 10:05:36 +00:00
Jerome Jiang
2a602f745d Fix build warnings for gcc 6.3
Clean up some alias.

BUG=webm:1465

Change-Id: I99e186162db9f9e15375fef01564692434eda619
2017-12-07 13:42:10 -08:00
Jerome Jiang
14dbdd95e6 Merge "Add frame width & height to frame pkt. Add test." 2017-12-06 22:37:15 +00:00
Jerome Jiang
bd1d995cd3 Add frame width & height to frame pkt. Add test.
Used to return correct frame width and height when dynamic resizing happens.

BUG=webm:1474

Change-Id: Ia2043f7e1635b3821848a67b9b134f47f14b0f3a
2017-12-06 13:55:18 -08:00
Marco
3562d6b0a2 vp9-svc: Set downsampling filter for VGA layer.
Downsampling filter for SVC was set to subsample (phase 0)
for HD -> VGA, and bilinear averaging (phase 8) for VGA -> QVGA.
This change makes it bilinear averaging for HD -> VGA.

Given the recent commit 9f9d4f8, quality is improved with
this change: avgPSNR/SSIM up ~1-3% on HD clips in RTC set.
Speed decrease of ~1% for 3 layer SVC.

Change-Id: If834a320e372b8b922a6bf7cab4227703b1beae6
2017-12-06 12:01:24 -08:00
Marco Paniconi
575c1933ea Merge "vp9: Nonrd-pickmode: move some early exits up." 2017-12-06 19:18:51 +00:00
Hui Su
2e44f16443 Merge "Add max luma picture width/height constraint in VP9 level" 2017-12-06 18:46:19 +00:00
Marco
33953f310e vp9: Nonrd-pickmode: move some early exits up.
Move the early exit checks on usable_ref_frame and
skip_ref_find_pref up before the check on flag_svc_subpel.
The code under flag_svc_subpel requires frame_mv to be set
for the golden/spatial reference, which is only set if the
both those exits don't pass.

No change in behavior.

Change-Id: Id304276c745eeb389ff85fa2dcf510d5976bc413
2017-12-06 10:18:44 -08:00
Marco
9f9d4f8dc9 vp9-svc: Allow for nonzero motion on spatial reference.
For nonrd pickmode on a given spatial layer, the spatial
(golden) reference was always only using zeromv for prediction.
In this patch if the downsampling filter used for generating
the lower spatial layer is an averaging filter (nonzero phase),
we allow for subpel motion on the spatial (golden) reference to
compensate for the shift. This is done by forcing the testing of
nonzero motion mode to compensate for spatial downsampling shift.

Improvement for cases where the downsampling is averaging filter.
In the current code this is only done for generating
resolutions <= QVGA.

Improvement for avgPSNR/SSIM on RTC set for speed 7: ~1.2%.
Gain is larger (~2-3%) for VGA clips with 2 spatial layers.
~1% speed slowdown for 3 layer SVC on mac.

Change-Id: I9ec4fa20a38947934fc650594596c25280c3b289
2017-12-05 22:41:07 -08:00
Shiyou Yin
90ce21e519 Merge "vpx_dsp: [loongson] optimize variance v2." 2017-12-04 01:30:06 +00:00
Hui Su
07b12aad77 Add max luma picture width/height constraint in VP9 level
BUG=b/65412009

Change-Id: I9e1478dcbd2ef9e97f5f8fb5a1c733b5f5cdf396
2017-12-01 16:29:40 -08:00
Johann
e83d00f584 filter out asm includes
Don't add include files to the archive. Avoids build failures for
Windows such as:
the input file 'libvpx_g.a(x86_abi_support.asm.o)' has no sections

Change-Id: If9c8e70c0ec913b7ad7dd6a08d4fa19011114ad2
2017-12-01 15:03:51 -08:00
Johann
bdbecea1ba explicitly label .text sections
nasm should infer .text but does not for windows:
https://bugzilla.nasm.us/show_bug.cgi?id=3392451

Change-Id: Ib195465e5f33405f5ff61c4cf88aa2a72640cacb
2017-12-01 14:33:04 -08:00
Johann
65df957df6 nasm defaults to -Ox
No need to specify default behaviour. The original change introducing nasm:
7be093ea4d
mentions requiring 2.0.9, which was the first release to default to this behaviour:
http://www.nasm.us/doc/nasmdoc2.html
"The -Ox mode is recommended for most uses, and is the default since NASM 2.09."

Change-Id: Ia914c4deede5aa447277b5189bb4fcf7e54c338d
2017-12-01 14:33:04 -08:00
Johann Koenig
401e00792f Merge "pass 'win64' instead of 'x64' to the assembler" 2017-12-01 22:07:03 +00:00
Johann
460dbc01b5 pass 'win64' instead of 'x64' to the assembler
nasm does not accept x64

yasm has accepted (and appears to prefer) win64 at least as far back as
1.0.0:
http://yasm.tortall.net/releases/Release1.0.0.html

Change-Id: Ied881b1df0570da256b1bd7e131e7817e47f768f
2017-12-01 10:58:54 -08:00
Marco
8d0e7ac29a vp9-svc: Set num_inter_modes in non-rd pickmode.
Set num_inter_modes based on ref_mode_set_svc, which is
smaller set than ref_mode_set (which may use alt-ref).

No change in behavior.

Change-Id: I31169bb09028db230552c6fca0a86959d1ade692
2017-12-01 10:30:45 -08:00
Shiyou Yin
298f5ca47d vpx_dsp: [loongson] optimize variance v2.
1. Delete unnecessary zero setting process.
2. Optimize the method of calculating SSE in vpx_varianceWxH.

Change-Id: I58890c6a2ed1543379acb48e03e620c144f6515f
2017-12-01 13:44:48 +08:00
Kaustubh Raste
8099220e6c Merge "mips msa optimize vpx_scaled_2d function" 2017-12-01 01:24:25 +00:00
Marco Paniconi
c22ab8ab9f Merge "Nonrd-pickmode: avoid duplicate computation of UV predictor." 2017-12-01 00:23:52 +00:00
James Zern
9dbefc4b57 Merge "decouple spatial-svc from encoder abi" 2017-12-01 00:22:34 +00:00
Marco
2e701f7c29 Nonrd-pickmode: avoid duplicate computation of UV predictor.
Avoids duplicate computation of UV predictor.

Bit-exact when static_threshold is zero.
Small/neutral difference on RTC set with nonzero static_threshold
(since UV predictor won't be skipped with this change).

Small speed gain, ~1-2%, at speed 8.

Change-Id: Iba8d22a307768b391e29d63c9826aac5a4d9c285
2017-11-30 12:41:58 -08:00
James Zern
5044779e77 decouple spatial-svc from encoder abi
this is only meant for testing. along with --enable-experimental
--enable-spatial-svc require VPX_TEST_SPATIAL_SVC to be defined rather
than bumping the encoder ABI.

Change-Id: I7f34d9f60300fa31ccf22e1a4aa619392c391b2e
2017-11-30 10:52:25 -08:00
Marco
b409863c48 Fix to copy partition.
Update the prev_partition on early exits in
choose_partitioning().

Change-Id: I382ffcab8e647c00b14283d15c3dd11bb0ac6f50
2017-11-30 10:27:34 -08:00
Shiyou Yin
392e0188f6 Merge changes Icd9c866b,I81717e47
* changes:
  vp8: [loongson] optimize regular quantize v2.
  vp8: [loongson] optimize vp8_short_fdct4x4_mmi v2.
2017-11-30 00:53:50 +00:00
Shiyou Yin
8d70aef05f Merge "vpx: [loongson] fix bug in var_filter_block2d_bil_16x" 2017-11-30 00:53:37 +00:00
Jingning Han
9116e3d957 Merge "Add PSNR Cb and Cr metric to opsnr.stt" 2017-11-29 22:56:47 +00:00
Marco Paniconi
3437fe484a Merge "vp9-svc: Don't allow encode_breakout on golden ref." 2017-11-29 22:41:31 +00:00
Marco
49f51af4c9 vp9-svc: Don't allow encode_breakout on golden ref.
For 1 pass cbr SVC: GOLDEN is the spatial reference,
better not to check for encoder_breakout on this reference.

Small positive ~0.075% (mostly neutral) gain in avgPSNR/SSIM metrics.
No observed change in encoder speed.

Change-Id: Ib337f16d6771105bf06384c6a23ad047fc690418
2017-11-29 13:58:43 -08:00
Marco
0e94522338 vp9-svc: Clean conditon for allowing copy_partition.
Make condition explicit on non_reference_frame.

No change in behavior.

Change-Id: Iec5068bccd93c7c7be67634c5c090580b2dbb20d
2017-11-29 13:19:09 -08:00
Kyle Siefring
3ae909b0f9 Merge "Remove unnecessary includes of emmintrin_compat.h" 2017-11-29 19:14:45 +00:00
Kyle Siefring
a60da3a2eb Remove unnecessary includes of emmintrin_compat.h
Change-Id: Ie60381a0c6ee01f828cd364a43f01517f4cb03e9
2017-11-29 11:48:24 -05:00
Shiyou Yin
d49bf26b1c vp8: [loongson] optimize regular quantize v2.
1. Optimize the memset with mmi.
2. Optimize macro REGULAR_SELECT_EOB.

Change-Id: Icd9c866b0e6aef08874b2f123e9b0e09919445ff
2017-11-29 17:06:00 +08:00
Kaustubh Raste
339f4dcaee mips msa optimize vpx_scaled_2d function
Change-Id: I638507b360c71489ab0e87bd558d2719ad995333
2017-11-29 13:27:04 +05:30
Shiyou Yin
9966cc8d12 vp8: [loongson] optimize vp8_short_fdct4x4_mmi v2.
Optimize the calculate process of a,b,c,d.

Change-Id: I81717e47bc988ace1412d478513e7dd3cb6b0cc9
2017-11-29 12:58:37 +08:00
James Zern
c5f5f4ed17 vpx{enc,dec}: add --help
only output short usage to stderr on error, with --help use stdout

Change-Id: I7089f3bca829817e14b14c766f4f3eaee6f54e5c
2017-11-28 20:49:54 -08:00
Jingning Han
9bd3f1e30d Add PSNR Cb and Cr metric to opsnr.stt
Change-Id: I24e1741c00f9514647c7db2758a7ababd4e96932
2017-11-28 20:03:59 -08:00
Shiyou Yin
a0ca2a4079 vpx: [loongson] fix bug in var_filter_block2d_bil_16x
Which cause failed case:
1. MMI/VpxSubpelVarianceTest.Ref/6
2. MMI/VpxSubpelVarianceTest.Ref/7
3. MMI/VpxSubpelVarianceTest.ExtremeRef/6
4. MMI/VpxSubpelVarianceTest.ExtremeRef/7

Change-Id: I122ca20089e14ac324edd61295cf8f506e06afc8
2017-11-29 10:26:43 +08:00
Marco
f0b4868625 vp9-svc: Fix condition for setting downsampling filter.
Use (width * height) for setting downsampling filter type.

Change-Id: If4acfde7ff9339e0584155f8a4d15b2f134211f2
2017-11-28 16:28:29 -08:00
Johann
bd990cad72 quantize x86: dedup some parts
Change-Id: I9f95f47bc7ecbb7980f21cbc3a91f699624141af
2017-11-27 13:09:21 -08:00
Marco
cbe62b9c2d vp9-svc: Fix to the layer buffer settings.
For the case when the number of temporal layers > 1,
the buffer levels (starting/optimal_buffer_level,
and maximum_buffer_size) were not scaled properly.

In vp9_update_layer_context_change_config():
when setting the layer-buffer levels, fix is to scale
the layer-target_bandwidth by the target_bandwidth
(which is the full stream bandwidth) instead of the
spatial_layer_target.

This is needed because prior to the call
vp9_update_layer_context_change_config(), set_rc_buffer_sizes()
is called which sets the buffer levels based on target bandwidth
(which is the full bandwidth for the SVC stream).

This fix properly sets the layer-buffer levels based on the
layer-bandwidth, and leads to better rate targeting.

Small/neutral change in avgPSNR/SSIM metrics on RTC set.

Change-Id: Ic0f4f7f3487c37b9a9adb4781ae5edfed7140a57
2017-11-26 22:17:48 -08:00
Peter Collingbourne
9639641cd4 Merge "[CFI] Remove function pointer casts" 2017-11-21 18:42:40 +00:00
Jerome Jiang
50fc0d896b Merge "vp8 simulcast: fix compile warnings." 2017-11-21 01:22:46 +00:00
Vlad Tsyrklevich
bc29863b96 [CFI] Remove function pointer casts
Control Flow Integrity [1] indirect call checking verifies that function
pointers only call valid functions with a matching type signature. This
change eliminates function pointer casts to make libvpx CFI-safe.

[1] https://www.chromium.org/developers/testing/control-flow-integrity

Change-Id: I7e08522d195a43c88cda06fa20414426c8c4372c
2017-11-20 16:36:29 -08:00
Jerome Jiang
f49360d740 vp8 simulcast: fix compile warnings.
Clean up some prints.

Change-Id: I199350e34a8b6fbff9601fcbd11ec68d24da5073
2017-11-20 16:18:31 -08:00
Kyle Siefring
dd4cc5b596 Merge "Optimize AVX2 get16x16var and get32x16var functions" 2017-11-20 22:37:57 +00:00
Jerome Jiang
0cc23242b0 Merge "vp9 svc: fix a few compile warnings." 2017-11-20 18:52:58 +00:00
Marco
559166acfe vp9-svc: Enbale scale partition reference frames.
For reference frames: enable scale partition for
superblocks with low source sad or if bsize on lower-resoln
is at least 32x32.

Keep feature disabled for base temporal layer.

Small regression in avgPNSR/SSIM metrics, ~0.5-1%.
Speedup ~2-3% on mac for SVC (3 spatial/3 temporal layers) at speed 7.

Change-Id: I5987eb7763845b680059128b538bb5188be0cca5
2017-11-17 14:52:20 -08:00
Jerome Jiang
8b7a6ca60a vp9 svc: fix a few compile warnings.
Change-Id: I4cb878600038066513ab73f3658990d1245ff2fb
2017-11-17 14:40:05 -08:00
Kyle Siefring
07a0bf038f Optimize AVX2 get16x16var and get32x16var functions
Change-Id: If8b91aaa883c01107f0ea3468139fa24cfb301d2
2017-11-17 13:55:49 -05:00
Paul Wilkins
849b3c238d Merge "Disable allow_partition_search_skip for speed 2." 2017-11-17 10:34:56 +00:00
Paul Wilkins
c66eeab30e Merge "Code cleanup." 2017-11-17 10:34:46 +00:00
Paul Wilkins
55eacca945 Merge "Remove decay_accumulator clause from alt ref breakout." 2017-11-17 10:34:37 +00:00
Paul Wilkins
4bd2a59e9b Merge "Add clause to alt ref group breakout." 2017-11-17 10:34:26 +00:00
Jerome Jiang
ea14a1a965 Merge "vp9: Fix mem rel for non-ref for external buffer." 2017-11-17 00:31:16 +00:00
paulwilkins
44473e7eb9 Disable allow_partition_search_skip for speed 2.
When allow_partition_search_skip  is set the two pass code
can optionally skip the partition search in the rd loop if the image
appears static (based on selection of 0,0 motion).

Unfortunately 0,0 motion does not necessarily mean that there are
no meaningful changes or that motion or intra modes will not be selected
in the second pass.

Disabling "allow_partition_search_skip" may hurt the encode speed a little
for a small number of clips but can have a big impact on compression.
The most notable example of this in our test sets is "bridge_close_cif"
where this change gives a gains of 18%, 12% and 16% in opsnr, ssim and
psnr-hvs.

Change-Id: I765e288b5c0cd82bce00a148e7653a21e9203024
2017-11-16 16:17:57 +00:00
Jerome Jiang
1aea1675c0 vp9 svc: Rework/fix scale partitioning on boundary.
Enable partition copy on boundary and scale blocks along the boundary.
Rename copy_partition_svc to scale_partition_svc.

Do not copy if the block crosses the boundary.

Change-Id: I37a04d48f11b15c4ea67facd7631193ec2f62150
2017-11-15 20:34:58 -08:00
Johann
3e3a568616 fwd txfm ssse3: use GLOBAL() for loading constants
Fixes a build issue when relocation is not allowed:
relocation R_X86_64_32 against '.rodata' can not be used when making a shared object

Change-Id: Ica3e90c926847bc384e818d7854f0030f4d69aa0
2017-11-15 13:01:44 -08:00
paulwilkins
05302360c9 Code cleanup.
Removal of parameters to and code in calc_frame_boost() that is no
longer required.

No change to results from previous patch.

Change-Id: Ic92da35613fdc247d22fddf24d09679fc5329017
2017-11-15 17:07:28 +00:00
paulwilkins
03c1a827ac Remove decay_accumulator clause from alt ref breakout.
The decay accumulator clause covers similar ground to the
new clause that tests the accumulated second reference error
so it has been removed to reduce complexity.

Change-Id: I4ec1cce32d72bd4ee463ad7def2831a68447d525
2017-11-15 16:58:05 +00:00
paulwilkins
607e45f420 Add clause to alt ref group breakout.
Add a clause to the breakout test for alt ref groups that
examines the size of the accumulated second reference
frame error compared to the cost of intra coding.

This clause causes a reduction in the average group length for many
clips. Alongside the change to the group length the minimum
boost is increased.

On balance the results are positive for psnr and psnr-hvs
but is negative for ssim/fast ssim for the smaller image formats.

Strong gains on some harder clips (eg ducks take off (midres) ~20%,
husky (lowres) 6-17%. Most of the negative cases are lower motion
clips. Subsequent patch hopefully will help with those.

Change-Id: Ic1f5dbb9153d5089e58b1540470e799f91a65dc4
2017-11-15 16:40:12 +00:00
Marco
b3c93d60c2 vp9-svc: Fix flag for usage of reuse-lowres partition
Fix/cleaup the conditioning for usage of the reuse-lowres
partition feature.

Replace the non-reference condition with the top temporal
layer, and put this condition in the speed feature.

This prevents doing update_partition_svc() on every
VGA frame, instead it will now only do update for VGA in
the top temporal layer frames.

Also this makes it easier to test/enable this feature
for lower layer temporal frames.

Change-Id: Ia897afbc6fe5c84c5693e310bcaa6a87ce017be5
2017-11-14 20:08:10 -08:00
Scott LaVarnway
8d471fcee2 tiny_ssim.c : clang compile error fix
Change-Id: Ic10ba580fd5da7d6ff7fa0f33db72fb0c1a97801
2017-11-14 04:38:00 -08:00
James Bankoski
7839fb98a8 Merge "add 10 and 12 bit to tiny_ssim" 2017-11-14 00:15:24 +00:00
Jerome Jiang
9df11a7c52 Merge "vp9 svc: Change conditions on VPX_ENCODER_ABI_VERSION." 2017-11-13 21:04:41 +00:00
Jerome Jiang
0d2555bd2e vp9 svc: Change conditions on VPX_ENCODER_ABI_VERSION.
VPX_ENCODER_ABI_VERSION was bumped up in 93e83f.

Change-Id: Id5707f9f9db56fa96549bc8f54e1cfa04e7fa4cd
2017-11-13 11:05:20 -08:00
Jim Bankoski
becab42eee add 10 and 12 bit to tiny_ssim
Change-Id: I92e4dba2d1682a0d77ad9a214ec4312b1cf4d42e
2017-11-13 10:56:42 -08:00
paulwilkins
a73cee2870 New content type to improve grain retention.
For new VP9 only content type adjust  the rate distortion and ARF
filter based on the relative spatial variance of the source and
reconstruction.

In regards to the RD loop the method favors modes where the
reconstruction variance is similar to the source variance. However it
is currently only applied to regions where the source variance is quite
low.

For very low variance blocks it applies a further bias against intra
coding and large prediction block sizes (the later in particular limit
the usefulness of the loop filter).

The final part of this change is to lower the strength of the ARF
filter for blocks where the source has very low spatial variance, to
encourage some low amplitude texture or noise to pass through
the filter.

This change improves the retention of film grain and fine noise /
texture in spatially flat regions, but as expected causes a significant
drop in PSNR on many clips. This is to be expected because similar
but misaligned noise or texture will give a lower PSNR than a flat
noise free reconstruction. However, it is worth noting that most clips
show a strong gain in FAST SSIM.

The features are enabled on the vpxenc command line by setting
--tune-content=film.

VPX_ENCODER_ABI_VERSION bumped for this change and cvbr.

Change-Id: I26a4e4edfa3dc5cacead82fa701fe7a9118ccd0a
2017-11-13 16:57:23 +00:00
paulwilkins
55fc4d95af Small parameter clean up.
Removed three parameters that are no longer needed in calls
to calc_arf_boost() and associated minor changes.

No impact on encode results.

Change-Id: Ieaf31d0d2e1990b99cf69647170145a1bbfbb9fb
2017-11-13 16:53:57 +00:00
Paul Wilkins
2eddfb46a9 Merge "Fix to frames considered in arf boost calculation." 2017-11-13 16:36:43 +00:00
Paul Wilkins
f5817fa612 Merge "CVBR command line option." 2017-11-13 16:32:39 +00:00
Scott LaVarnway
8e6022844f vpx: [x86] add vpx_satd_avx2()
SSE2 instrinsic vs AVX2 intrinsic speed gains:
blocksize   16: ~1.33
blocksize   64: ~1.51
blocksize  256: ~3.03
blocksize 1024: ~3.71

Change-Id: I79b28cba82d21f9dd765e79881aa16d24fd0cb58
2017-11-10 12:24:12 -08:00
Scott LaVarnway
8c7213bc00 Merge "vpx: [x86] add vp9_block_error_fp_avx2()" 2017-11-10 00:45:47 +00:00
Marco Paniconi
1ff68ec035 Merge "vp9-svc: Avoid minmax variance for non-reference frames." 2017-11-10 00:30:04 +00:00
Marco
6c0011a255 vp9-svc: Avoid minmax variance for non-reference frames.
For choose_partitioning (speed >= 6): avoid computation
of minmax variance for non-reference frames in SVC.

Existing condition only avoided this for speed >= 8.
Combine that existing logic with non-reference condition.

Small speedup (~0.5-1%) for 3 layer SVC,
neutral change on avgPSNR/SSIM metrics.

Change-Id: I3e9f3a1af0647b15e475cf170d9402908d672ee5
2017-11-09 16:27:27 -08:00
James Zern
10cb17aec0 Merge "runtime error fix: bitdepth_conversion_avx2.h" 2017-11-10 00:15:03 +00:00
Jerome Jiang
6246d8aa76 vp9: Fix mem rel for non-ref for external buffer.
Release frame buffers for non-ref when the decoder is destroyed.

Enable the non ref test.

BUG=b/68819248

Change-Id: Id87ef3b0a62318f9812e927cd957c05c859047fa
2017-11-09 15:47:21 -08:00
Jerome Jiang
0665b09661 Merge "vp9: SVC feature to use partition from lower resolution." 2017-11-09 23:28:44 +00:00
Jerome Jiang
fdb054a05d vp9: SVC feature to use partition from lower resolution.
For SVC with 3 spatial layers:
Add feature to copy/upscale partition from middle spatial layer
to the upper/highest resolution, when superblock sad is not high.

Enabled for speed >= 7 and only for non-reference frames.

Speedup ~3-4%, small loss in avgPNSR/SSIM of ~1%.

Change-Id: I7f0a2716c0fde28bade0f86159d11b7e31d6ab8d
2017-11-09 14:16:50 -08:00
Scott LaVarnway
2387024f41 runtime error fix: bitdepth_conversion_avx2.h
Change-Id: I7364a157de39eb7137b599808474b8d46d19d376
2017-11-09 12:26:43 -08:00
Johann Koenig
bdb8b3ad86 Merge "fail early on oversize frames" 2017-11-09 19:50:04 +00:00
Scott LaVarnway
62ab5e99c1 vpx: [x86] add vp9_block_error_fp_avx2()
SSE2 asm vs AVX2 intrinsics speed gains:
blocksize   16: ~1.00
blocksize   64: ~1.17
blocksize  256: ~1.67
blocksize 1024: ~1.81

Change-Id: I2a86db239cf57e3ff617890ccb2d236aba83ad5e
2017-11-09 05:02:31 -08:00
paulwilkins
d6e29868ac Fix to frames considered in arf boost calculation.
For a chosen interval "i" the existing arf boost calculation examined frames
+/- (i-1) frames from the current location in the second pass.

This change checks to make sure that the forward search does not extend
beyond the next key frame in the event that the distance to the next key
frame is < (i - 1).

Small metrics gains on all our  test sets but these are localized to a few clips
(e.g. midres set psnr-hvs sintel -2.59% but overall average was only -0.185%)

Change-Id: I26fc9ce582b6d58fa1113a238395e12ad3123cf6
2017-11-09 10:46:10 +00:00
Jerome Jiang
adbb4c4d32 Merge "vp9: Add nonref frame buffer test." 2017-11-09 04:41:10 +00:00
Jerome Jiang
a68bbcff29 vp9: Add nonref frame buffer test.
The new test will run a SVC bitstream which has non ref frames.
It checks the number of buffer acquired and released to make sure all
external frame buffers are released.

Add a new test bitstream:
vp90-2-22-svc_1280x720_1.webm
which has 400 frames in total, and 1 spatial layer and 2 temporal layers.
There is one non ref frame every other frame.

Disabled for now. Will be enabled with the fix.

BUG=b/68819248

Change-Id: I0515336fd9809a9e1fceba90e4dce53dabaf53a5
2017-11-08 18:41:33 -08:00
Johann Koenig
cf8039c25f Merge "Support building AVX-512 and implement sadx4 for AVX-512" 2017-11-08 16:28:40 +00:00
paulwilkins
93e83fd7cf CVBR command line option.
Added command line control of Corpus VBR.

The new corpus vbr mode is a variant of standard
VBR (end-usage=0) where the complexity distribution
mid point is passed in rather than calculated for a specific
clip or chunk.

The new variant is enabled by setting a new command line
parameter --corpus-complexity to a zero value. Omitting
this parameter or setting it to 0 will cause the codec to use
standard vbr mode.

The correct value for a given corpus needs to be derived
experimentally using a training set such that the average
rate for the corpus is close to the target value.

For example our using our low res test set with upper and lower
vbr limits of 50%-150% and a corpus complexity value of 650
gives a similar average data rate across the set to using standard
vbr. However, with the corpus mode easier clips will be allocated
fewer bits and harder clips more bits rather than having the same
rate target for all.

Change-Id: I03f0fc8c6fb0ee32dc03720fea6a3f1949118589
2017-11-08 10:41:04 +00:00
Marco
6fbc354c97 Nonrd_pickmode: avoid computing UV cost when early_term is set.
For nonrd_pickmode: if early_term is set there should be
no need to include UV in rdcost (when color_sensitivity is set).

Neutral change on RTC and RTC_derf metrics, for speed >= 5.
No change for ytlive metrics.

Very small speed gain (~0.5%) on some clips with strong color content.

Change-Id: Ifc00928ecd935fc71e94935ceef0ae7481249f07
2017-11-06 10:22:14 -08:00
Kyle Siefring
b383a17fa4 Support building AVX-512 and implement sadx4 for AVX-512
The added AVX-512 support requires the subset of AVX-512 added in Skylake-X.

Change-Id: I39666b00d10bf96d06c709823663eb09b89265b7
2017-11-03 13:37:23 -04:00
Marco
eb7d431cb5 Compound prediction mode for nonrd pickmode.
Allow for compound prediction mode in nonrd_pickmode for ZEROMV.
For real-time encoding, 1 pass with non-zero lag-in-frames.

Added speed feature to control the feature.
Enabled for speed >=6 for now, under VBR mode.

avgPSNR/SSIM metrics positive on ytlive set, for speed 6:
some clips up by ~3-5%, some clips neutral gain, average gain
across clips is ~1%.

Small/negligible decrease in speed.

Change-Id: I7a60c7596e69b9a928410c5ee2f9141eecd8613d
2017-11-03 10:13:05 -07:00
Johann
5fe82459ec fail early on oversize frames
Even though frame_size is calculated in uint64_t, it winds up in an int
size value.

This was exposed with the msan test because the memset is called with
(int)frame_size, leading to a segfault.

Change-Id: I7fd930360dca274adb8f3e43e5e6785204808861
2017-11-03 09:49:13 -07:00
Jerome Jiang
3ba9a2c8b2 Merge "vp9: Move allocation of vt2 after early exits." 2017-11-01 16:58:01 +00:00
Jerome Jiang
34805d6d0d vp9: Move allocation of vt2 after early exits.
Remove the memory deallocation on the early exits.

Change-Id: I00b4a814ae6705105ecab89644d055ca3311d9f4
2017-10-31 17:04:04 -07:00
Jerome Jiang
0c84b9b703 Merge "vp9: Reduce stack usage of choose_partitioning." 2017-10-31 21:42:18 +00:00
Jerome Jiang
18b470f486 vp9: Reduce stack usage of choose_partitioning.
Move vt2 to heap.
Reduce the stack usage from ~87K to ~44K.

BUG=b/68362457

Change-Id: I8f5f93712934d59a8cc4564378172d409a736a2e
2017-10-31 13:10:27 -07:00
Jerome Jiang
c77822615e Merge "vp9: Reduce stack usage of choose_partioning." 2017-10-30 23:39:41 +00:00
Jerome Jiang
cc47231187 vp9: Reduce stack usage of choose_partioning.
Change type of sum_square_error from int64_t to uint32_t.
Change type of sum_error from int64_t to int32_t.

This reduces the stack usage from ~131K to ~87K.

BUG=b/68362457

Change-Id: I147d7c7b226bceb4f0817bb86848e1fa9d9ac149
2017-10-30 13:53:20 -07:00
James Zern
acb9460929 vp8: correct if/else '{' placement
swap '{' and c-style comments removing a few redundant ones along the
way; covers most leftovers from the clang-tidy run against an
x86_64-linux config.

Change-Id: I67a45596f80a12389faca49c5be440875092a7df
2017-10-27 12:27:10 -07:00
Scott LaVarnway
3bf02ad74a vpx: hadamard: use ptrdiff_t instead of int for stride
Eliminates the following instruction for the x86 (64 bit)
intrinsic code:

movslq %esi,%rax

Change-Id: I8f5ebd40726f998708a668b0f52ea7a0576befae
2017-10-26 11:41:48 -07:00
Kyle Siefring
037e596f04 Merge "Optimize convolve8 SSSE3 and AVX2 intrinsics" 2017-10-24 19:22:36 +00:00
Kyle Siefring
ae35425ae6 Optimize convolve8 SSSE3 and AVX2 intrinsics
Changed the intrinsics to perform summation similiar to the way the assembly does.

The new code diverges from the assembly by preferring unsaturated additions.

Results for haswell

SSSE3
Horiz/Vert  Size  Speedup
Horiz       x4    ~32%
Horiz       x8    ~6%
Vert        x8    ~4%

AVX2
Horiz/Vert  Size  Speedup
Horiz       x16   ~16%
Vert        x16   ~14%

BUG=webm:1471

Change-Id: I7ad98ea688c904b1ba324adf8eb977873c8b8668
2017-10-24 10:39:48 -04:00
Scott LaVarnway
e0aa6b24aa Merge "vpx: [x86] vpx_hadamard_16x16_avx2() highbitdepth fix" 2017-10-23 22:02:59 +00:00
Marco
0738d90169 vp9-svc: Allow for adapt_rd_thresh with row-mt.
Set adaptive_row_thresh_mt = 1 at speed >= 7,
for svc when multi-threading is used with row-mt.
This allow the adaptive_rd_thresh feature to be used
in the nonrd-pickmode.

~1-2% speedup for SVC encoding with small quality
loss (< 0.6%) on RTC set.

Change-Id: Iab9878dff117bccdaef3e4d0645165db9808cdfc
2017-10-23 11:47:18 -07:00
Scott LaVarnway
512bf4e029 vpx: [x86] vpx_hadamard_16x16_avx2() highbitdepth fix
Use an intermediate buffer before storing to coeffs when
highbitdepth is enabled.

Change-Id: I101981a1995f1108ad107c55c37d6e09eadb404b
2017-10-23 08:49:32 -07:00
Scott LaVarnway
4906cea027 vpx: [x86] vpx_hadamard_16x16_avx2() improvements
~10% performance gain.  Fixed the cosmetics noted in the
previous commit.

Change-Id: Iddf475f34d0d0a3e356b2143682aeabac459ed13
2017-10-20 08:55:06 -07:00
Scott LaVarnway
b58259ab55 Merge "vpx: [x86] add vpx_hadamard_16x16_avx2()" 2017-10-19 23:32:10 +00:00
Paul Wilkins
199971d606 Merge "Corpus VBR tweak for undershoot." 2017-10-19 10:07:45 +00:00
Paul Wilkins
0c493cbe2b Merge "Increase precision of some debug stats output for corpus VBR." 2017-10-19 10:07:30 +00:00
Paul Wilkins
d8c34a2552 Merge "Prevent double application of min rate in two pass." 2017-10-19 10:06:33 +00:00
Scott LaVarnway
55c126a5d7 vpx: [x86] add vpx_hadamard_16x16_avx2()
This version is ~1.91x faster than the sse2 version.  When
highbitdepth is enabled, it is ~1.74x.

Change-Id: I2b0e92ede9f55c6259ca07bf1f8c8a5d0d0955bd
2017-10-18 18:00:00 -07:00
Jerome Jiang
401e6d48bf Merge "Add datarate test for vp8 ROI." 2017-10-18 19:39:26 +00:00
Jerome Jiang
bd6d82e881 Add datarate test for vp8 ROI.
BUG=webm:1470

Change-Id: Icbc848837e64eacc49491dcc26b4c5802af2ee13
2017-10-18 11:19:59 -07:00
Jerome Jiang
ec2fced451 Merge "vp8: Enable use of ROI map." 2017-10-18 18:16:44 +00:00
Kyle Siefring
b3a36f7946 Merge "Refactor x86/vpx_subpixel_8t_intrin_avx2.c" 2017-10-18 16:19:52 +00:00
Shiyou Yin
df15220a89 Merge "vp8: [loongson] optimize idct with mmi" 2017-10-18 00:55:36 +00:00
Jerome Jiang
dbb8926b86 vp8: Enable use of ROI map.
Disable cyclic refresh if ROI is used and add flag to properly handle
the static_thresh deltas.
Remove the ROI test for cyclic refresh (it's allowed but disabled if ROI
is used).
Add an example in vpx_temporal_svc_encoder.c. Turned off by default.

BUG=webm:1470

Change-Id: Ief9ba1d7f967bc00511b412b491c3f70943bfbda
2017-10-17 15:23:03 -07:00
Linfeng Zhang
9336e01621 Merge changes I17fff122,Ic149e3cb
* changes:
  Add 4 to 3 scaling SSSE3 optimization
  Test extreme inputs in frame scale functions
2017-10-17 16:03:29 +00:00
Linfeng Zhang
0d2e95193b Merge "Generalize CheckScalingFiltering in ConvolveTest" 2017-10-17 16:03:07 +00:00
Kyle Siefring
55805e2786 Refactor x86/vpx_subpixel_8t_intrin_avx2.c
Change-Id: I6539111dfb35a43028e9755785b2e9ea31854305
2017-10-17 11:57:40 -04:00
Shiyou Yin
577d4fa792 vp8: [loongson] optimize idct with mmi
1. vp8_dequant_idct_add_y_block_mmi
2. vp8_dequant_idct_add_uv_block_mmi

Change-Id: I9987147be2685ac79d4b045d1d56f6709ee1223c
2017-10-17 03:27:31 +00:00
Linfeng Zhang
580d32240f Add 4 to 3 scaling SSSE3 optimization
Note this change will trigger the different C version on SSSE3 and
generate different scaled output.

Its speed is 2x compared with the version calling vpx_scaled_2d_ssse3().

Change-Id: I17fff122cd0a5ac8aa451d84daa606582da8e194
2017-10-16 15:42:42 -07:00
Marco
a9248457b1 Adjust threshold in gf_boost for 1 pass vbr
Small inncrease the sad_thresh1, avoids some false
detection of possible scene changes within lag.

Small improvement in few clips on ytlive, otherwise neutral change.

Change-Id: Ia79b53bb657bbce65a7aac7d20666b6373d5af8b
2017-10-13 15:33:51 -07:00
Paul Wilkins
12df840777 Merge "Further Corpus VBR change." 2017-10-13 15:59:58 +00:00
Paul Wilkins
eaa593d293 Merge "Corpus Wide VBR test implementation." 2017-10-13 15:59:45 +00:00
paulwilkins
8842ee0b0d Corpus VBR tweak for undershoot.
In cases of strong undershoot adjust Q range down faster.

Change-Id: I84982beceb3c9b6dc50e52e4a6e891c7dd395d03
2017-10-13 10:27:15 +01:00
Shiyou Yin
3e2770de4f Merge "vp8: [loongson] optimize dct with mmi" 2017-10-13 00:37:57 +00:00
Marco Paniconi
28d1c0535d Merge "Adjust to scene detection for 1 pass vbr." 2017-10-12 19:36:33 +00:00
Marco
a673b4f4af Adjust to scene detection for 1 pass vbr.
Expose the threshold for setting key frame on cut,
and increase it for speed 5.
Also small adjustment to min_thresh.

No change in overall metrics or fps.
Small quality improvement and lower encode time on scene cuts.

Change-Id: I36e06ff3b26b6c29aede39c23fce454525fc9026
2017-10-12 10:59:23 -07:00
Jerome Jiang
175b36cb6d Merge "vp9: use nonrd pick_intra for small blocks on keyframes." 2017-10-12 17:29:27 +00:00
Kyle Siefring
caa116c9be Merge changes I38783d97,If5160c0c
* changes:
  Extend 16 wide AVX2 convolve8 code to support averaging.
  Add AVX2 version of vpx_convolve8_avg.
2017-10-12 16:12:38 +00:00
paulwilkins
2b247ae91c Increase precision of some debug stats output for corpus VBR.
Change-Id: I75841797cc0c215781b5b36e3a3e9f4b0e35ba63
2017-10-12 10:07:21 +01:00
Jerome Jiang
288890cd43 vp9: use nonrd pick_intra for small blocks on keyframes.
Keyframe encoding is more than 2x faster.
Disabled on Speed 8.

Change-Id: I2157318b6ac8253fa5398322c72d98cd7fa9b2b6
2017-10-11 21:38:01 -07:00
Shiyou Yin
f70de09f2a vp8: [loongson] optimize dct with mmi
1. vp8_short_fdct4x4_mmi
2. vp8_short_fdct8x4_mmi
3. vp8_short_walsh4x4_mmi

Change-Id: I89a7df25cfd09fae309fac257ad8b6a3dc1c8acb
2017-10-12 08:50:04 +08:00
Shiyou Yin
bc4098a8e9 Merge "vp8: [loongson] optimize quantize with mmi" 2017-10-12 00:33:17 +00:00
Marco
72c69e14ad Adjust threshold in datarate tests for 1 pass VBR
Small increase in threshold for the 1 pass VBR datarate tests.
Needed due to commit:
<017257a Adjustment to scene detection and key frame>

Change-Id: I28b3bd7db2192a8cc2bccc3cb0e3b8dbb910ca16
2017-10-11 11:48:36 -07:00
Linfeng Zhang
1fa3ec3023 Test extreme inputs in frame scale functions
Change-Id: Ic149e3cb59be2ee0f98a3fcfd83226ad5ea30c99
2017-10-11 11:35:19 -07:00
paulwilkins
416b7051d7 Prevent double application of min rate in two pass.
The initial allocation of bits in the two pass code to each frame
should be within the min max limits on the command line. However,
when forming an ARF group the cost of the ARF is shared by frames
in that group such that the residual bits for a frame could drop below
the min value. This change prevents the minimum being re-applied
after the cost of the ARF has been deducted as this may otherwise
cause low rate sections to overshoot their target.

Test runs comparing to a baseline run with min and max section pct
0-2000% vs one closer to the YT use case (50-150%) suggest that
this fix not only results in better rate control but also gives a better
rd outcome.

For example the HD set vs 0-2000% baseline (opsnr, ssim).
Old code (50-150):  +0.751, +1.099
New code(50-150): +0.241, -0.009

Change-Id: I715da7b130bf53ba8aa609532aa9e18b84f5e2ef
2017-10-11 18:00:44 +01:00
Shiyou Yin
e8ed2bb762 vp8: [loongson] optimize quantize with mmi
1. vp8_fast_quantize_b_mmi
2. vp8_regular_quantize_b_mmi

Change-Id: Ic6e21593075f92c1004acd67184602d2aa5d5646
2017-10-11 16:45:58 +08:00
Linfeng Zhang
16166bfdaa Add 4 to 1 scaling x86 optimization
Change-Id: I51c190f0a88685867df36912522e67bdae58a673
2017-10-10 16:24:06 -07:00
Jerome Jiang
dcfae2cc64 Merge "Fix alignment in vpx_image without external allocation." 2017-10-10 23:02:05 +00:00
Jerome Jiang
33c598990b Fix alignment in vpx_image without external allocation.
This restores behaviors prior to
<40c8fde Fix image width alignment. Enable ImageSizeSetting test.>.

BUG=b/64710201

Change-Id: I559557afe80d5ff5ea6ac24021561715068e7786
2017-10-10 14:26:17 -07:00
Linfeng Zhang
54f7d68c5c Generalize CheckScalingFiltering in ConvolveTest
Let it test extreme inputs and all filter types.
In the future ConvolveTest should test regular 8-bit functions in
high bitdepth mode.

Change-Id: I1042564d1d390589ca203070fe332c6da3315d75
2017-10-10 14:12:43 -07:00
Marco
017257a317 Adjustment to scene detection and key frame.
For 1 pass vbr: use higher threshold on avg_sad
and force key frame under scene cut detection if
above the threshold. Allow it for speed >= 6 for now,
since it does not use the full nonrd_pickmode partition
(as in speed 5).

Improves quality somewhat on scene cut frames.
Neutral on overall metrics and fps for speed 6 on
ytlive set.

Change-Id: I12626f7627419ca14f9d0d249df86c7104438162
2017-10-10 11:20:05 -07:00
Linfeng Zhang
963cc22cef Merge changes I9d4c1af5,I882da3a0
* changes:
  Rename some inline functions in NEON scaling
  Generalize 2:1 vp9_scale_and_extend_frame_ssse3()
2017-10-10 17:29:50 +00:00
paulwilkins
06d231c9fa Further Corpus VBR change.
Change to the bit allocation within a GF/ARF group.

Normal VBR and CQ mode allocate bits to a GF/ARF group based of the mean
complexity score of the frames in that group but then share bits evenly between
the "normal" frames in that group regardless of the individual frame complexity
scores (with the exception of the middle and last frames).

This patch alters the behavior for the experimental "Corpus VBR" mode such that
the allocation is always based on the individual complexity scores.

Change-Id: I5045a143eadeb452302886cc5ccffd0906b75708
2017-10-10 10:41:35 +01:00
paulwilkins
741bd6df4f Corpus Wide VBR test implementation.
This patch makes further changes to support an experimental
corpus wide VBR mode that uses a corpus complexity
number as the midpoint of the distribution used to allocate bits
within a clip, rather than some average error score derived from the
clip itself.

At the moment the midpoint number is hard wired for testing and
the mode is enabled or disabled through a #ifdef.  Ultimately this
would need to be controlled by command line parameters.

Change-Id: I9383b76ac9fc646eb35a5d2c5b7d8bc645bfa873
2017-10-10 10:40:44 +01:00
Kyle Siefring
1b2f92ee8e Extend 16 wide AVX2 convolve8 code to support averaging.
Also adds vpx_convolve8_avg_horiz_avx2.

Change-Id: I38783d972ac26bec77610e9e15a0a058ed498cbf
2017-10-09 19:10:03 -04:00
Linfeng Zhang
27d21a3d13 Rename some inline functions in NEON scaling
Change-Id: I9d4c1af53d57f72fc716bacbe3b0965719c045ac
2017-10-09 11:23:00 -07:00
Linfeng Zhang
e1ae3772da Merge "Update vp9_scale_and_extend_frame_ssse3()" 2017-10-09 16:20:00 +00:00
Kyle Siefring
9ca06bcdd2 Add AVX2 version of vpx_convolve8_avg.
vpx_convolve8_avg works by first running a normal horizontal filter then a
vertical filter averages at the end.

The added vpx_convolve8_avg_avx2 calls pre-existing AVX2 code for the
horizontal step.

vpx_convolve8_avg_vert_avx2 is also added, but only uses ssse3 code.

Change-Id: If5160c0c8e778e10de61ee9bf42ee4be5975c983
2017-10-07 23:37:48 -04:00
James Zern
807248ec81 Merge "ppc: Add vpx_idct32x32_1024_add_vsx" 2017-10-07 19:08:26 +00:00
Marco Paniconi
5bc4c37a89 Merge "Revert "Speed >=5 real-time: add TM intra mode for high_source_sad."" 2017-10-06 22:41:34 +00:00
Marco Paniconi
bcbc6ed82d Revert "Speed >=5 real-time: add TM intra mode for high_source_sad."
This reverts commit 9311ef18b4b4eff0da3adf9d702a34f489a270ff.

Reason for revert:
Notice small regression in some clips.
Will revisit in another change.

Original change's description:
> Speed >=5 real-time: add TM intra mode for high_source_sad.
> 
> Small/neutral change in metrics or speed for ytlive.
> Some improvement in quality on frames with big content change.
> 
> Change-Id: Ib3b0703a5f28ea6710e90324436e27598ab7384d

TBR=marpan@google.com,builds@webmproject.org,jianj@google.com

Change-Id: I9d8ec5195bb05ddf329d325699355185affb9b13
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
2017-10-06 22:14:56 +00:00
Marco
e405eb06b1 Adjust threshold in scene detection
For 1 pass vbr: increase min_thresh slightly, and also add
condition on golden/arf update for using full nonrd_pick_partition.

Reduces possible false detection for scene cut detection.

Neutral/small change in metrics or speed for speed 5.

Change-Id: I388f4d9a56e3cc763e0148338c1bc0381e58ad76
2017-10-06 11:08:56 -07:00
Marco Paniconi
7af6c6c9ca Merge "Speed >=5 real-time: add TM intra mode for high_source_sad." 2017-10-06 06:29:46 +00:00
Marco
9311ef18b4 Speed >=5 real-time: add TM intra mode for high_source_sad.
Small/neutral change in metrics or speed for ytlive.
Some improvement in quality on frames with big content change.

Change-Id: Ib3b0703a5f28ea6710e90324436e27598ab7384d
2017-10-05 23:07:03 -07:00
James Zern
d2fb834ebd Merge "vpx_codec.h: namespace local defines" 2017-10-06 05:30:16 +00:00
James Zern
e8ed030da3 vpx_codec.h: namespace local defines
add VPX_ to UNUSED/*DEPRECATED to avoid conflicts with other headers.

Change-Id: Ie16bdac3575bc1af57a05d37e65b994370585377
2017-10-05 15:12:20 -07:00
James Zern
107eb6a9d4 vp9_ethread_test: abort early/add more detailed output
in the case compare_fp_stats fails report the 2 values and their index

Change-Id: I927a832b7a1e24c392961093b7caee1134223def
2017-10-05 15:02:51 -07:00
Marco Paniconi
e095bcce44 Merge "Adjust threshold for adapt_partition for speed 6." 2017-10-05 03:28:06 +00:00
Marco
18262a8576 Adjust threshold for adapt_partition for speed 6.
Lower SAD threshold to select non_rd pickmode partition
at superblock level more often.
Small gain in metrics, small/negligible decrease in speed.

Change-Id: I0f728236b91a604e4ca7e02039adc54d5985c4dc
2017-10-04 18:04:09 -07:00
Marco Paniconi
014976c251 Merge "Avoid nonrd_pick_partition for speed >= 6." 2017-10-04 23:36:27 +00:00
Marco
4bc1fc58b6 Avoid nonrd_pick_partition for speed >= 6.
For 1 pass vbr speed >= 6: when REFERENCE_PARTITION is selected,
avoid doing the full nonrd_pickmode based partition.
No change in overall metrics or speed.
Reduces encode times on scene cuts by 10-20%.

Change-Id: I0310b1610cc1c83793a509e0a9059840e8f18308
2017-10-04 15:31:54 -07:00
Marco Paniconi
6a42bdd25f Merge "Modify early exit for alt_ref in nonrd_pickmode." 2017-10-04 19:38:49 +00:00
Linfeng Zhang
127864deb3 Generalize 2:1 vp9_scale_and_extend_frame_ssse3()
Change-Id: I882da3a04884d5fabd4cd591c28682cbb2d76aa5
2017-10-04 12:35:39 -07:00
Linfeng Zhang
b809442521 Update vp9_scale_and_extend_frame_ssse3()
Change-Id: I22622faebfcc36f7a4d1f37e3800ae8ab87c8cd4
2017-10-04 12:32:30 -07:00
Marco
77e51e2035 Modify early exit for alt_ref in nonrd_pickmode.
For 1 pass vbr mode:
On no-show_frame/ARF: instead of skipping alt_ref_frame
completely in mode testing, allow for checking (0, 0) on alt_ref.

Small gain in metrics, ~0.18%, no change in speed.

Change-Id: I32a3c24faca64ab70dd5091071a0dc301db7dd1e
2017-10-04 11:53:39 -07:00
Linfeng Zhang
9a71811d98 Merge changes Id6a8c549,Ib1e0650b,Ic369dd86
* changes:
  Refactor x86/vpx_subpixel_8t_intrin_ssse3.c
  Add vpx_dsp/x86/mem_sse2.h
  Add transpose_8bit_{4x4,8x8}() x86 optimization
2017-10-04 16:15:14 +00:00
Jerome Jiang
ffa3a3c441 Merge "Fix image width alignment. Enable ImageSizeSetting test." 2017-10-04 14:48:03 +00:00
Marco
98dbf31c87 Enable arf usage for speed >= 6, 1 pass vbr.
For speed 6 on ytlive set:
On average, speed slowdown ~5%, quality gain ~2%.

Change-Id: Ia18237cc1d52c54d7e2cb3c71f571cf37ef61b44
2017-10-03 17:18:33 -07:00
Marco
ab2bd340ac vp9: 1 pass vbr: Limit qpdelta on high_source_sad.
For 1 pass vbr: when significant content/scene change is detected
(high_source_sad = 1) reduce/turnoff the additional qdelta on the
active_worst_quality. This helps somewhat to reduce the occurrence
of large frame sizes and large encode times.
Allow it only when use_altef_onepass is enabled.

Neutral/no change on metrics.

Change-Id: I1dd97dd2ab892d65f707b841b27a5de300b714ea
2017-10-03 16:27:17 -07:00
James Zern
66b6b87471 Merge "vpx: fix nasm build errors" 2017-10-03 21:47:49 +00:00
Scott LaVarnway
bc4bc9b622 vpx: fix nasm build errors
BUG=webm:1462,766721

Change-Id: Icfa536a8e38623636b96c396e3c94889bfde7a98
2017-10-03 20:02:21 +00:00
Linfeng Zhang
6543213e87 Refactor x86/vpx_subpixel_8t_intrin_ssse3.c
Change-Id: Id6a8c549709a3c516ed5d7b719b05117c5ef8bac
2017-10-03 13:02:05 -07:00
Linfeng Zhang
0f756a307d Add vpx_dsp/x86/mem_sse2.h
Add some load and store sse2 inline functions.

Change-Id: Ib1e0650b5a3d8e2b3736ab7c7642d6e384354222
2017-10-03 12:59:05 -07:00
Marco
c8678fb7f3 Use adapt_partition for ARF in 1 pass.
For speed 6 real-time mode: use adapt_partition
on ARF frame instead of REFERENCE_PARTITION (which is slower).
This requires enabling compute_source_sad_onepass for no-show_frames.

Speedup of ~3-5% on some clips that heavily use ARF,
small loss (~0.2%) in quality on ytlive set.

Change-Id: Ib50acc97df06458244a6ac55d2bd882c30012536
2017-10-03 11:49:55 -07:00
Linfeng Zhang
67c38c92e7 Add transpose_8bit_{4x4,8x8}() x86 optimization
Change-Id: Ic369dd86b3b81686f68fbc13ad34ab8ea8846878
2017-10-03 10:00:30 -07:00
Marco Paniconi
fe7b869104 Merge "ARF in 1 pass vbr: modify skip ref_frame in nonrd_pickmode." 2017-10-03 03:01:14 +00:00
Marco
33e10dfa7e ARF in 1 pass vbr: modify skip ref_frame in nonrd_pickmode.
Speedup of ~2-3% on 1080p clips speed 6.
Neutral/negligible loss in metrics on ytlive.

Change-Id: I7ac47a4d8b58c566920bae29a94a0e8d59c36dee
2017-10-02 19:04:03 -07:00
Linfeng Zhang
0e55b0b0a7 Add 4 to 3 scaling NEON optimization
Speed comparing with the one calling vpx_scaled_2d_neon()
  ~1.7 x in general
  ~2.8x for BILINEAR filter

BUG=webm:1419

Change-Id: I8f0a54c2013e61ea086033010f97c19ecf47c7c6
2017-10-02 15:04:09 -07:00
Linfeng Zhang
2c560c3c22 Specialize 4 to 3 frame scaling in C
Scale 3x3 block instead of 16x16 block in each loop. Disabled by
default.

Benefits:
1. Reduced number of different phase_scaler from 16 to 3.
   Optimization code will be smaller and faster.
2. Maximum phase_scaler drifting will be reduced from 5/16 to 1/24.
   (The drifting is 1/(3*16) in each step.)

BUG=webm:1419

Change-Id: I59a1f7496d89a1b090498c935d30cfcf1d0c282b
2017-10-02 11:56:15 -07:00
Scott LaVarnway
3c700052be Merge "vpxdsp: [x86] add highbd_d135_predictor functions" 2017-10-02 15:00:19 +00:00
Alexandra Hájková
fb7fc1dbda ppc: Add vpx_idct32x32_1024_add_vsx
Change-Id: I55cd0a1569ccc47a53d0ecf751aac259d510e10d
2017-09-30 19:31:20 +00:00
Marco
c8f6e7b99e Fix partition selection in speed features for arf overlay frame.
For real-time mode. Move the switch to fixed partition
for is_src_frame_alt_ref so all speeds may use it
if use_altref_onepass is set.

Improves metrics by ~2% for ytlive set at speed 4
(where use_altref_onepass is currently used).

Change-Id: I033240386598c9dbd0364da89ccbcca64bc663ee
2017-09-29 15:02:28 -07:00
Marco
f2c3d0a7a3 Enable use_altref_onepass for speed 4 real-time mode.
Used for VBR mode with lag-in-frames > 0.
On ytlive set at speed 4: ~3% average gain.

Change-Id: I45dad1700bf8be9d8f177815dc062774f6f2f0de
2017-09-29 10:56:14 -07:00
Scott LaVarnway
3bbd62ed27 vpxdsp: [x86] add highbd_d135_predictor functions
C vs SSE2 speed gains:
_4x4 : ~1.81x

C vs SSSE3 speed gains:
_8x8 : ~1.96x
_16x16 : ~1.88x
_32x32 : ~2.02x

BUG=webm:1411

Change-Id: Iefaf8b39afbbfe34c1ad1d21e3a003b20f1f61e0
2017-09-29 08:56:38 -07:00
Scott LaVarnway
4cae64c32c vpxdsp: [x86] add highbd_d117_predictor functions
C vs SSE2 speed gains:
_4x4 : ~2.04x

C vs SSSE3 speed gains:
_8x8 : ~2.82x
_16x16 : ~5.93x
_32x32 : ~2.79x

BUG=webm:1411

Change-Id: I31d949695991c067dac89d91e0bed3e666c94993
2017-09-28 14:45:28 -07:00
Jerome Jiang
5a40c8fde1 Fix image width alignment. Enable ImageSizeSetting test.
BUG=b/64710201

Change-Id: I5465f6c6481d3c9a5e00fcab024cf4ae562b6b01
2017-09-28 11:25:24 -07:00
Marco
a2ef180dd0 Set rc->high_source_sad = 0 before scene detection.
Only has effect when sf->use_altref_onepass is enabled,
as in that case scene detection is skipped for non-show frame
and so high_source_sad does not get reset to 0.

No change in metrics or speed.

Change-Id: I421f066d239341449c18826089e1810b9fc5967f
2017-09-28 10:49:45 -07:00
Marco Paniconi
3b8cc214ef Merge "vp9: Modification to adapt the ARF usage for 1 pass vbr" 2017-09-28 16:52:28 +00:00
Marco
03e8f13337 vp9: Modification to adapt the ARF usage for 1 pass vbr
Add stats for past ARF usage, and use it to disable
ARF usage based on some conditions.

Overall improvement on ytlive set, reduces the regression
on the problem clips for this feature.

Only affects when sf->use_altref_onepass is enabled
(currently off by default).

Change-Id: I66267f227ea132dc86acb730e9882f85bead2cdb
2017-09-28 09:10:30 -07:00
Marco
c493ea1a6b Add use_svc condition to the scene detection in 1 pass.
Scene detection is not currently used in SVC 1 pass code.
Speedup of ~0.4%.

Change-Id: I0ab769300919de710cd2da1402014fa3f22a1f86
2017-09-27 14:51:46 -07:00
Marco Paniconi
786b124e20 Merge "Revert "Remove the speed condition on scene detection in 1 pass code."" 2017-09-27 20:42:48 +00:00
Scott LaVarnway
80992a746c Merge "vpxdsp: [x86] add highbd_d153_predictor functions" 2017-09-27 20:40:21 +00:00
Marco Paniconi
8d438dc313 Revert "Remove the speed condition on scene detection in 1 pass code."
This reverts commit 535b7b915ae5574db2f95632243cc5bee865f02e.

This is actually used in CBR to reset the rate control if high source sad is detected.

Original change's description:
> Remove the speed condition on scene detection in 1 pass code.
> 
> Scene detection is used for VBR mode and for screen_content mode.
> 
> It was also enabled for CBR mode via the speed condition,
> but currently the analysis in the scene detection is not used
> in CRB mode (similar computations are done locally at superblock level
> when the source_sad feature is enabled).
> 
> For 1 pass code.
> No change in behavior. Small speed gain, ~0.5%.
> 
> Change-Id: I59991d7ef2af320bea7af4b907596e057affa42f

TBR=marpan@google.com,builds@webmproject.org,jianj@google.com

Change-Id: Ib4e6b02047f75632503e7b0fc870af97fa9291c3
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
2017-09-27 19:42:48 +00:00
James Zern
690fa6bb6e Merge "fix signed integer overflow of idct" 2017-09-27 19:39:11 +00:00
James Zern
6175f285a9 Merge "vp9_dx_iface: Stop using iter parameter incorrectly" 2017-09-27 18:37:20 +00:00
Linfeng Zhang
dbbbd44304 fix signed integer overflow of idct
Exposed by fuzz test in high bitdepth.
The bug is introduced in commit 64653fa.

BUG=webm:1466

Change-Id: Idd77d5c6a60efb9241471611ce1aba0646cb6ff5
2017-09-27 11:17:54 -07:00
Scott LaVarnway
19c45ccd43 vpxdsp: [x86] add highbd_d153_predictor functions
C vs SSE2 speed gains:
_4x4 : ~1.95x

C vs SSSE3 speed gains:
_8x8 : ~3.30x
_16x16 : ~5.67x
_32x32 : ~3.87x

BUG=webm:1411

Change-Id: Ib483989b25614aa89b635e8c087d0879a5d71904
2017-09-27 11:01:11 -07:00
Marco
535b7b915a Remove the speed condition on scene detection in 1 pass code.
Scene detection is used for VBR mode and for screen_content mode.

It was also enabled for CBR mode via the speed condition,
but currently the analysis in the scene detection is not used
in CRB mode (similar computations are done locally at superblock level
when the source_sad feature is enabled).

For 1 pass code.
No change in behavior. Small speed gain, ~0.5%.

Change-Id: I59991d7ef2af320bea7af4b907596e057affa42f
2017-09-27 10:32:54 -07:00
Vignesh Venkatasubramanian
530e60143a vp9_dx_iface: Stop using iter parameter incorrectly
'iter' parameter is being checked for NULL in every call to
decoder_get_frame which is quite pointless because it is always
going to be NULL unless the application changed it. The code works
as described only because vp9_get_raw_frame returns -1 on all
subsequent calls after the first.

Change-Id: Ic736b9e8fe36fc1430fc11d6a9b292be02497248
2017-09-27 09:59:39 -07:00
Linfeng Zhang
d203a91a09 Merge "Add vpx_scaled_2d_neon()" 2017-09-27 16:12:48 +00:00
Jerome Jiang
878464150b Merge "Add unit test to expose vp8 bug when width is set odd." 2017-09-27 01:26:59 +00:00
Shiyou Yin
f12e786c54 Merge "vp8: [loongson] optimize copymen with mmi" 2017-09-27 00:49:28 +00:00
Jerome Jiang
767503504f Add unit test to expose vp8 bug when width is set odd.
BUG=b/64710201

Change-Id: Ia518af5494a42e80949cf1165244fbed59606cf7
2017-09-26 17:40:13 -07:00
Marco
819c5b365d Remove the speed condition in setting compute_source_sad.
The speed condition is not needed, feature can used for any
speed in 1 pass code.

Change-Id: I878ef3f63a075302eda48c0343fa243c80aab9ba
2017-09-26 15:48:34 -07:00
Marco
d5094cfde8 Replace flag USE_ALTREF_FOR_ONE_PASS with speed feature.
To be used for 1 pass VBR.
Off by default in speed features.

Change-Id: I5d6110d6d191990db526fe68ec9715379a4d1754
2017-09-26 11:16:50 -07:00
Marco Paniconi
9e52d3910b Merge "SVC: Add setting for max_intra_rate_pct in sample encoder." 2017-09-26 16:28:30 +00:00
Linfeng Zhang
9d0d13e939 Add vpx_scaled_2d_neon()
BUG=webm:1419

Change-Id: I39c8033734562efc0ac0e28e7f06fa05130f9b96
2017-09-26 09:22:39 -07:00
Linfeng Zhang
28762341ac Merge changes Ib9105462,Idfac00ed,If8d8a0e2
* changes:
  cosmetics: NEON scaling code
  Refactor convolve NEON code
  Refactor convolve code
2017-09-26 16:10:46 +00:00
Shiyou Yin
73102d1ed2 vp8: [loongson] optimize copymen with mmi
1. vp8_copy_mem16x16_mmi
2. vp8_copy_mem8x8_mmi
3. vp8_copy_mem8x4_mmi

Change-Id: I3de29a11fa7402df0e48bbb944440b1e66498a65
2017-09-26 08:40:11 +08:00
Marco
23eccb3ca7 SVC: Add setting for max_intra_rate_pct in sample encoder.
Set it as default to 900.

Change-Id: Id2d990925dccff1f6762411c66ea95973440c92f
2017-09-25 13:39:18 -07:00
Scott LaVarnway
a059dc0986 Merge "vpxdsp: [x86] add highbd_d45_predictor functions" 2017-09-25 11:34:14 +00:00
Scott LaVarnway
cf82f7276e vpxdsp: [x86] add highbd_d45_predictor functions
C vs SSSE3 speed gains:
_4x4 : ~2.45x
_8x8 : ~10.61x
_16x16 : ~11.34x
_32x32 : ~6.36x

BUG=webm:1411

Change-Id: Ic91389a4f1a8ad093f498afe53765b897fb9be09
2017-09-22 05:20:12 -07:00
James Zern
691585f6b8 Merge changes If59743aa,Ib046fe28,Ia2345752
* changes:
  Remove the unnecessary cast of (int16_t)cospi_{1...31}_64
  Remove the unnecessary upcasts of (int)cospi_{1...31}_64
  Change cospi_{1...31}_64 from tran_high_t to tran_coef_t
2017-09-22 07:35:55 +00:00
Andrew Lewis
10bab1ec29 Merge "Comma-separate VP9 encoder tmp.stt output" 2017-09-21 08:50:53 +00:00
Marco Paniconi
0b08f8892f Merge "vp9: Modify pickmode early exit for ARF in 1pass." 2017-09-21 01:33:12 +00:00
Marco
42373b21ce vp9: Modify pickmode early exit for ARF in 1pass.
Add the condition frames_since_golden > 0 to the
early exit check for ARF usage in nonrd_pickmode.
This improves quality of first frame following ARF, where
frame_since_golden = 0.

Small/neutral gain in metrics for speed 6, neutral change in speed.

Only affects when USE_ALTREF_FOR_ONE_PASS is enabled.

Change-Id: I82e73e6ff6fc849e5ca5448563cb8a0515fe0cdc
2017-09-20 15:02:37 -07:00
Linfeng Zhang
d586cdb4d4 Remove the unnecessary cast of (int16_t)cospi_{1...31}_64
BUG=webm:1450

Change-Id: If59743aafe99226e0ec67ab5d20678ce25f53ab8
2017-09-20 14:13:26 -07:00
Linfeng Zhang
76a3d3fcc5 Remove the unnecessary upcasts of (int)cospi_{1...31}_64
BUG=webm:1450

Change-Id: Ib046fe28caec5b9ebdc9d0152df7c54ff4266858
2017-09-20 14:13:26 -07:00
Linfeng Zhang
64653fa133 Change cospi_{1...31}_64 from tran_high_t to tran_coef_t
The unnecessary upcast to (int) will be cleaned later.

BUG=webm:1450

Change-Id: Ia234575206d5a74540526924b06ed3939322d063
2017-09-20 14:13:26 -07:00
James Zern
f7b276c26b Merge "Bug fix: fadst4() in vp9/encoder/vp9_dct.c" 2017-09-20 21:12:45 +00:00
Linfeng Zhang
24afb5d036 Bug fix: fadst4() in vp9/encoder/vp9_dct.c
A new bug was introduced in a80bdfd "Change sinpi_{1,2,3,4}_9 from
tran_high_t to int16_t". Reverted the change in this file.

BUG=webm:1450

Failed test C/TransHT.AccuracyCheck/26.

Change-Id: Id001f57aad811803ef7d367d2b2bc008d8499991
2017-09-20 12:27:29 -07:00
Marco Paniconi
f407b30490 Merge "vp9: Modify simple_block_yrd condition for SVC" 2017-09-20 16:42:31 +00:00
Scott LaVarnway
b85e391ac8 Merge "vpxdsp: [x86] add highbd_d63_predictor functions" 2017-09-20 11:39:28 +00:00
James Zern
15bea62176 temporal_filter_apply_sse2.asm: add ':' to label
quiets nasm warning:
label alone on a line without a colon might be in error

BUG=webm:1462

Change-Id: I660407ca60e8c9a810dba9d76afb65852029a29c
2017-09-19 18:59:11 -07:00
Linfeng Zhang
7c0529728a cosmetics: NEON scaling code
Change-Id: Ib91054622c1f09c4ca523bc6837d7d8ab9f03618
2017-09-19 16:39:17 -07:00
Linfeng Zhang
f357335c38 Refactor convolve NEON code
Rename a couple of hbd static functions.
Move the position of NEON function convolve8_4().

Change-Id: Idfac00edf2e99cdd8e0a73b9f895402f60be6349
2017-09-19 16:28:36 -07:00
Linfeng Zhang
bf8bdae913 Refactor convolve code
Extract a couple of static functions into their caller functions.

Change-Id: If8d8a0e217fba6b402d2a79ede13b5b444ff08a0
2017-09-19 16:28:31 -07:00
Scott LaVarnway
bc86e2c6a2 vpxdsp: [x86] add highbd_d63_predictor functions
C vs SSE2 speed gains:
_4x4 : ~2.94x

C vs SSSE3 speed gains:
_8x8 : ~8.69x
_16x16 : ~6.32x
_32x32 : ~5.33x

BUG=webm:1411

Change-Id: I2c35b527eac2229f17aaa9d118fb601e7195efe4
2017-09-19 15:47:22 -07:00
Marco
aaa6cdcc2e vp9: Modify simple_block_yrd condition for SVC
Modify simple_block_yrd condition in nonrd_pickmode for SVC:
allow it to be used also on base temporal_layer, only when
spatial_layer > 1 and block size < 32x32.

Speed up of about ~2% for 3 layer SVC, with little/negligible
loss in quality.

Change-Id: I7734bdae51cf51f22b96f6b2b27da20ea1d84344
2017-09-19 15:39:05 -07:00
Marco Paniconi
2a7c0e1c4b Merge "Add datarate test for frame_parallel_decoding mode off." 2017-09-19 22:31:08 +00:00
Marco
cd463c7acb vp9: Fix condition for limiting ARF 1 pass vbr.
Fix the setting to frames_till_gf_update_due, and
adjust the limit value.
Only affects when USE_ALTREF_FOR_ONE_PASS is enabled.

Neutral change to metrics and speed for ytlive.

Change-Id: I266d9a00b36221bc8602fa2746d4e8a8f7d4dfae
2017-09-19 11:12:37 -07:00
Marco Paniconi
310e388423 Merge "vp9: Adjustments for ARF usage in 1 pass vbr." 2017-09-19 16:29:19 +00:00
Marco
ebb015a539 vp9: Adjustments for ARF usage in 1 pass vbr.
Only when USE_ALT_REF_ONE_PASS is enabled (off by default).
Force fixed partition to 64x64 when is_src_alt_ref_frame is true,
and don't force early exit for some modes in nonrd_pickmode
for ARF noshow frames.

Small gain ~0.2% on ytlive metrics for speed 6.
Neutral speed difference.

Change-Id: I27eb6622d0453c09a06ccdc3b16368762474d11d
2017-09-18 18:46:41 -07:00
Linfeng Zhang
a80bdfd081 Change sinpi_{1,2,3,4}_9 from tran_high_t to int16_t
Add "typedef int16_t tran_coef_t;"

BUG=webm:1450

Change-Id: I67866f104898d1dda8989e1abdaf6983fe324154
2017-09-18 09:26:03 -07:00
Linfeng Zhang
9d278465b5 Merge "cosmetics: vp9_rtcd_defs.pl" 2017-09-18 16:23:33 +00:00
Shiyou Yin
2aacfa1acd Merge "vp8: [loongson] optimize dequantize with mmi" 2017-09-15 23:53:40 +00:00
Marco
ad31fe36a8 Add datarate test for frame_parallel_decoding mode off.
Add datarate test, for both VBR and CBR mode, with the
frame_parallel_decoding mode disabled (and error_resilience off).

Change-Id: I54feec3248a68ecff4bef8d9a31bb1616fab77df
2017-09-15 11:38:38 -07:00
Paul Wilkins
65f1c90652 Merge "Fix bug in intra mode rd penalty." 2017-09-15 15:43:29 +00:00
Kaustubh Raste
08fda52e18 Merge "mips msa clean-up msa macros" 2017-09-15 01:27:02 +00:00
James Zern
90ed0d2f73 Merge "vp9_scale_test: add C config" 2017-09-15 00:27:58 +00:00
James Zern
c12b39626f Merge "Revert "Specialize 4 to 3 scaling in vp9_scale_and_extend_frame_c()"" 2017-09-15 00:27:41 +00:00
Hui Su
293734b755 Merge "VP9 level targeting: add a new AUTO mode" 2017-09-14 21:02:38 +00:00
James Zern
c24d911847 vp9_scale_test: add C config
Change-Id: I9dfe8255d1c096d246bf9719729f57dbae779ffc
2017-09-14 13:08:04 -07:00
James Zern
baf658ec4c Revert "Specialize 4 to 3 scaling in vp9_scale_and_extend_frame_c()"
This reverts commit afee58f2c4159172f5340f2c7d3e8041cfa0eb91.

This causes ~8x slowdown in 4:3 in the C-code

Change-Id: I60a7ead12dc4ec1548b1b12cfe4b0be42ef04e0e
2017-09-14 13:07:21 -07:00
Hui Su
c3a6943c16 VP9 level targeting: add a new AUTO mode
In the new AUTO mode, restrict the minimum alt-ref interval and max column
tiles adaptively based on picture size, while not applying any rate control
constraints.

This mode aims to produce encodings that fit into levels corresponding to
the source picture size, with minimum compression quality lost. However, the
bitstream is not guaranteed to be level compatible, e.g., the average bitrate
may exceed level limit.

BUG=b/64451920

Change-Id: I02080b169cbbef4ab2e08c0df4697ce894aad83c
2017-09-14 16:20:29 +00:00
Shiyou Yin
b81de66171 vp8: [loongson] optimize dequantize with mmi
1. vp8_dequantize_b_mmi
2. vp8_dequant_idct_add_mmi

Change-Id: I505f8afb7a444173392b325906e6a4f420f00709
2017-09-14 20:56:06 +08:00
Shiyou Yin
5b558592f5 vp8: [loongson] optimize idctllm with mmi
1. vp8_short_idct4x4llm_mmi
2. vp8_short_inv_walsh4x4_mmi
3. vp8_dc_only_idct_add_mmi

Change-Id: I616923681e79d78607a4988608fc39df77b093f4
2017-09-14 16:51:11 +08:00
Kaustubh Raste
4ca8f8f5e2 mips msa clean-up msa macros
Removed inline for GP load-store in case of (__mips_isa_rev >= 6)
Created one define LD_V for vector load and ST_V for vector store

Change-Id: Ifec3570fa18346e39791b0dd622892e5c18bd448
2017-09-14 12:29:19 +05:30
Linfeng Zhang
535dee0fb6 cosmetics: vp9_rtcd_defs.pl
Change-Id: I1bf57824e07fa4f8b3b5574984117f2bd7a1c086
2017-09-13 12:13:55 -07:00
Linfeng Zhang
0726dd97d3 Merge "Specialize 4 to 3 scaling in vp9_scale_and_extend_frame_c()" 2017-09-13 17:21:45 +00:00
Andrew Lewis
949730e2dc Comma-separate VP9 encoder tmp.stt output
Also add column headings so that the output can still be parsed if the
set of headers changes later.

Change-Id: I4beaf266521e093db4acf5f715b18fdfb7e3d1cd
2017-09-13 16:26:40 +01:00
Johann Koenig
ed3a80cb5e Merge "Revert "Revert "quantize avx: copy 32x32 implementation""" 2017-09-13 14:44:53 +00:00
Kaustubh Raste
83e59914e5 Merge "Optimize mips msa vp9 average mc functions" 2017-09-13 06:02:49 +00:00
Shiyou Yin
fa01426ade Merge "vp8: [loongson] optimize loopfilter with mmi" 2017-09-13 01:05:46 +00:00
Johann
eb4238ac70 Revert "Revert "quantize avx: copy 32x32 implementation""
This reverts commit 8c42237bb200253931c49e2c530838f3a877dd65.

Because ssse3 code is used for the reference, the qcoeff and dqcoeff
reference buffers must be aligned.

Original change's description:
> quantize avx: copy 32x32 implementation
>
> Ensure avx and ssse3 stay in sync by testing them against each other.
>
> Change-Id: I699f3b48785c83260825402d7826231f475f697c

Change-Id: Ieeef11b9406964194028b0d81d84bcb63296ae06
2017-09-12 14:25:38 -07:00
Linfeng Zhang
afee58f2c4 Specialize 4 to 3 scaling in vp9_scale_and_extend_frame_c()
Scale 3x3 block instead of 16x16 block in each loop.

Benefits:
1. Reduced number of different phase_scaler from 16 to 3. Optimization code
   will be smaller and faster.
2. The maximum phase_scaler drifting will be reduced from 5/16 to 1/24.
   (The drifting is 1/(3*16) in each step.)

BUG=webm:1419

Change-Id: Ibb9242a629ddb03e1ff93b859bece738255e698c
2017-09-12 12:05:16 -07:00
Kaustubh Raste
30f1ff94e0 Optimize mips msa vp9 average mc functions
Load the specific destination loads instead of vector load

Change-Id: I65ca13ae8f608fad07121fef848e2a18f54171fe
2017-09-12 16:12:11 +05:30
Scott LaVarnway
c39cd9235e Merge "vpxdsp: [x86] add highbd_d207_predictor functions" 2017-09-11 22:32:23 +00:00
Linfeng Zhang
a9bbe53dbb Add 4 to 1 scaling NEON optimization
BUG=webm:1419

Change-Id: If82a93935d2453e61b7647aae70983db1740bec7
2017-09-11 10:17:28 -07:00
Scott LaVarnway
d6c9bbc2b6 vpxdsp: [x86] add highbd_d207_predictor functions
C vs SSE2 speed gains:
_4x4 : ~2.31x

C vs SSSE3 speed gains:
_8x8 : ~4.73x
_16x16 : ~10.88x
_32x32 : ~4.80x

BUG=webm:1411

Change-Id: I0bac29db261079181ddabc6814bd62c463109caf
2017-09-11 07:36:24 -07:00
Shiyou Yin
761f2f5cb4 vp8: [loongson] optimize loopfilter with mmi
1. vp8_loop_filter_horizontal_edge_mmi
2. vp8_loop_filter_vertical_edge_mmi
3. vp8_mbloop_filter_horizontal_edge_mmi
4. vp8_mbloop_filter_vertical_edge_mmi
5. vp8_loop_filter_simple_horizontal_edge_mmi
6. vp8_loop_filter_simple_vertical_edge_mmi

Change-Id: Ie34bbff3a16cff64e39a50798afd2b7dac9bcdc3
2017-09-11 11:08:09 +08:00
James Zern
fb40b5d7a7 intrapred: sync highbd_d63_predictor w/d63_
8/16/32: ~6%/~18%/~33% faster

previously:
7012ba639 vp9_reconintra: simplify d63_predictor

BUG=webm:1411

Change-Id: Ie775f3a4f7fd74df44754e65686d826a51c2cdc2
2017-09-08 19:28:01 -07:00
James Zern
9dfa76f948 vpx_mem: make vpx_memset16 inline
Change-Id: Ibb2cab930c95836e6d6e66300c33e7d08e4474d4
2017-09-08 19:11:46 -07:00
James Zern
5c95fd921e intrapred: sync highbd_d45_predictor w/d45_
8/16/32:: ~19%/~54%/~75.5% faster

previously:
acc481eaa vp9_reconintra: simplify d45_predictor

BUG=webm:1411

Change-Id: Ie8340b0c5070ae640f124733f025e4e749b660d8
2017-09-08 19:09:07 -07:00
James Zern
9a2dd7e67e Merge changes I9ec438aa,I99c954ff
* changes:
  Update convolve functions' assertions
  Add 2 to 1 scaling NEON optimization
2017-09-08 19:23:40 +00:00
paulwilkins
0657f4732c Fix bug in intra mode rd penalty.
The intra mode rd penalty was implemented as a rate penalty.
Code was added to scale the penalty according to block size but
this was not done correctly for the SB level or sub 8x8.

The code did a weird double scaling in regard to bit depth that
has been removed. Given that it is a rate penalty the bit depth
should not matter.

This bug fix improves average metrics  on our standard test
sets by about 0.1%

Change-Id: I7cf81b66aad0cda389fe234f47beba01c7493b1e
2017-09-08 15:10:53 +01:00
James Zern
d7caee2170 vpx_scale_test.h: remove #if from inside macro
fixes visual studio error

Change-Id: I86206f17ca951b15e247c1b92561847d8c21ec7a
2017-09-08 00:06:25 -07:00
Shiyou Yin
43cbdc216d Merge "vp8: [loongson] optimize sixtap predict with mmi" 2017-09-08 00:59:31 +00:00
Shiyou Yin
2c7b7424c5 Merge "vpxdsp: [loongson] optimize sad functions with mmi" 2017-09-08 00:55:14 +00:00
Linfeng Zhang
ef41c6286d Update convolve functions' assertions
So that 4 to 1 frame scaling can call them.

Change-Id: I9ec438aa63b923ba164ad3c59d7ecfa12789eab5
2017-09-07 12:33:58 -07:00
Linfeng Zhang
71b38a144e Add 2 to 1 scaling NEON optimization
BUG=webm:1419

Change-Id: I99c954ffa50a62ccff2c4ab54162916141826d9b
2017-09-07 12:33:50 -07:00
Linfeng Zhang
3ec20445b2 Refactor convolve8 NEON functions
Change-Id: I4ac576875c91fee7cb150d298fae4a2c156d374c
2017-09-06 15:55:17 -07:00
Linfeng Zhang
d5d2cbcc75 Add ScaleFrameTest
Move class VpxScaleBase to new file test/vpx_scale_test.h.
Add new file test/vp9_scale_test.cc with ScaleFrameTest.

BUG=webm:1419

Change-Id: Iec2098eafcef99b94047de525e5da47bcab519c1
2017-09-06 15:54:58 -07:00
Linfeng Zhang
7219f31904 Merge "Remove get_filter_base() and get_filter_offset() in convolve" 2017-09-06 22:39:15 +00:00
Scott LaVarnway
0e95039bd9 Merge "vpxdsp: [x86] add highbd_dc_128_predictor functions" 2017-09-06 21:53:32 +00:00
Peter Boström
6822fb2f09 Remove support for stdatomic.h.
This header doesn't build on g++ v6 as it's a C and not C++ header
(_Atomic is not a keyword in C++11). Since the C and C++ invocations
cannot be guaranteed to point to the same underlying atomic_int
implementation, remove support for them and use compiler intrinsics
instead.

BUG=webm:1461

Change-Id: Ie1cd6759c258042efc87f51f036b9aa53e4ea9d5
2017-09-06 11:59:50 -04:00
Linfeng Zhang
d331e7a1c0 Remove get_filter_base() and get_filter_offset() in convolve
so that the convolve functions are independent of table alignment.

Change-Id: Ieab132a30d72c6e75bbe9473544fbe2cf51541ee
2017-09-05 15:22:36 -07:00
Scott LaVarnway
bc4bcca3fd vpxdsp: [x86] add highbd_dc_128_predictor functions
C vs SSE2 speed gains:
_4x4 : ~7.64x
_8x8 : ~16.60x
_16x16 : ~8.15x
_32x32 : ~5.05x

BUG=webm:1411

Change-Id: If165d419711cfda901bd428a05ca1560a009e62e
2017-09-05 07:57:42 -07:00
Shiyou Yin
0095213790 vp8: [loongson] optimize sixtap predict with mmi
1. vp8_sixtap_predict16x16_mmi
2. vp8_sixtap_predict8x8_mmi
3. vp8_sixtap_predict8x4_mmi
4. vp8_sixtap_predict4x4_mmi

Change-Id: I186669d1a1d998a0f3ba3a548e25eee8b52c251b
2017-09-02 19:08:20 +00:00
Shiyou Yin
f4150163a2 vpxdsp: [loongson] optimize sad functions with mmi
1. vpx_sadWxH_c
2. vpx_sadWxH_avg_c
3. vpx_sadWxHx3_c
4. vpx_sadWxHx8_c
5. vpx_sadWxHx4d_c

Change-Id: Ie13161e3d73a052ea6ea7bac9cfadf55598fea7a
2017-09-02 15:11:32 +00:00
James Zern
d49a1a5329 test,Android.mk: export gtest include path
fixes test file builds

Change-Id: Iaa725ad95d56cf77d9fef8994981a80102e9a966
2017-09-01 19:44:12 -07:00
clang-format
7587a97551 apply clang-format
Change-Id: If4c3e8a396d0fcb304f407b44e28cac3219f038c
2017-09-01 01:24:03 -07:00
James Zern
053bd263eb .clang-format: update to 4.0.1
based on Google style with the following differences:

3a4
> # Generated with clang-format 4.0.1
13c14
< AllowShortCaseLabelsOnASingleLine: false
---
> AllowShortCaseLabelsOnASingleLine: true
23c24
< BraceWrapping:
---
> BraceWrapping:
43c44
< ConstructorInitializerAllOnOneLineOrOnePerLine: true
---
> ConstructorInitializerAllOnOneLineOrOnePerLine: false
46,47c47,48
< Cpp11BracedListStyle: true
< DerivePointerAlignment: true
---
> Cpp11BracedListStyle: false
> DerivePointerAlignment: false
51c52
< IncludeCategories:
---
> IncludeCategories:
78c79
< PointerAlignment: Left
---
> PointerAlignment: Right
80c81
< SortIncludes:    true
---
> SortIncludes:    false

Change-Id: Ibc0ef87a516b8eae88d426dfdd7624be57e7b87c
2017-09-01 01:24:03 -07:00
Peter Boström
be2ba48cac Merge "Prevent data race from low-pass filter." 2017-09-01 05:37:51 +00:00
James Zern
334e9abb0b Merge "inv_txfm_vsx: fix loads in high-bitdepth" 2017-09-01 03:09:49 +00:00
Peter Boström
9ab4d9df38 Prevent data race from low-pass filter.
Makes main thread wait for the filter level to be picked to avoid a race
between the LPF thread and update_reference_frames(). This also
re-enables the failing tests under thread_sanitizer where this data race
was detected.

BUG=webm:1460

Change-Id: I7f5797142ea0200394309842ce3e91a480be4fbc
2017-08-31 18:37:55 -07:00
Peter Boström
03191f738e Merge "Add atomics to vp8 synchronization primitives." 2017-09-01 01:36:22 +00:00
Peter Boström
d42e876164 Add atomics to vp8 synchronization primitives.
Fixes issue on iPad Pro 10.5 (and probably other places) where threads
are not properly synchronized. On x86 this data race was benign as load
and store instructions are atomic, they were being atomic in practice as
the program hasn't been observed to be miscompiled.

Such guarantees are not made outside x86, and real problems manifested
where libvpx reliably reproduced a broken bitstream for even just the
initial keyframe. This was detected in WebRTC where this device started
using multithreading (as its CPU count is higher than earlier devices,
where the problem did not manifest as single-threading was used in
practice).

This issue was not detected under thread-sanitizer bots as mutexes were
conditionally used under this platform to simulate the protected read
and write semantics that were in practice provided on x86 platforms.

This change also removes several mutexes, so encoder/decoder state is
lighter-weight after this change and we do not need to initialize so
many mutexes (this was done even on non-thread-sanitizer platforms where
they were unused).

Change-Id: If41fcb0d99944f7bbc8ec40877cdc34d672ae72a
2017-08-31 17:55:57 -07:00
Scott LaVarnway
ab5704f02c Merge "vpxdsp: [x86] add highbd_dc_left_predictor functions" 2017-08-31 21:34:27 +00:00
Jerome Jiang
20973508da Merge "vp9: Skip testing duplicate zero mv in nonrd-pickmode." 2017-08-31 17:16:19 +00:00
Jerome Jiang
ebf3ae1a29 vp9: Skip testing duplicate zero mv in nonrd-pickmode.
Neutral on rtc set for speed 8. Neutral on ytlive for speed 5.

Saves some computation cycles but no speed gain observed on Pixel.

Change-Id: I34c4642cd543aa89c5b9c4bff6b7113577c64c91
2017-08-31 17:13:31 +00:00
James Zern
f8f64c309b inv_txfm_vsx: fix loads in high-bitdepth
vec_vsx_ld -> load_tran_low

Change-Id: Id3144cdd528d2d406a515e5812e2ea9e4db64bf1
2017-08-30 23:47:56 -07:00
Jerome Jiang
297c110dcb Merge "Revert "Re-enable disabled tests under TSan."" 2017-08-31 01:52:42 +00:00
Jerome Jiang
d7ba519b9f Revert "Re-enable disabled tests under TSan."
This reverts commit df9ce12259a4e866feeb580d2e0cf9648f60d3b5.

Reason for revert: 

Re-enabled tests still fail tsan in high bitdepth.

Original change's description:
> Re-enable disabled tests under TSan.
> 
> These tests point to an already-fixed bug, this should no longer have a
> data race.
> 
> BUG=webm:1049
> 
> Change-Id: Iaedc5db8df99362bdc501b70ff7fdebf8756fdb8

TBR=jzern@google.com,pbos@chromium.org,builds@webmproject.org

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: webm:1049
Change-Id: I232f1f7726bf795b301abfb2e07cad6756642e53
2017-08-30 23:44:21 +00:00
Scott LaVarnway
c39a05ff61 vpxdsp: [x86] add highbd_dc_left_predictor functions
C vs SSE2 speed gains:
_4x4 : ~6.49x
_8x8 : ~10.82x
_16x16 : ~7.61x
_32x32 : ~5.29x

BUG=webm:1411

Change-Id: Ibc30c50cb7139049bf05298010803499e6ef949b
2017-08-30 09:29:06 -07:00
Scott LaVarnway
2d0c11093e Merge "vpxdsp: [x86] add highbd_dc_top_predictor functions" 2017-08-30 11:25:07 +00:00
Scott LaVarnway
f783e3a75d vpxdsp: [x86] add highbd_dc_top_predictor functions
C vs SSE2 speed gains:
_4x4 : ~7.39x
_8x8 : ~11.36x
_16x16 : ~8.68x
_32x32 : ~4.33x

BUG=webm:1411

Change-Id: I7f1487cd1531d4e7f0fbb4596fed3bfb72a59d58
2017-08-29 12:53:30 -07:00
Jerome Jiang
fed52670a2 Merge "vp9: Speed 8: Enable skip_encode_sb" 2017-08-29 16:45:09 +00:00
Peter Boström
2f5fb37dac Merge "Re-enable disabled tests under TSan." 2017-08-29 15:42:39 +00:00
Scott LaVarnway
81f45ff798 Merge "vpxdsp: [x86] add highbd_h_predictor functions" 2017-08-29 14:05:13 +00:00
Scott LaVarnway
30d9a1916c vpxdsp: [x86] add highbd_h_predictor functions
C vs SSE2 speed gains:
_4x4 : ~8.12x
_8x8 : ~9.71x
_16x16 : ~8.21x
_32x32 : ~5.0x

BUG=webm:1422

Change-Id: I5e8a1ed4db7b8dc539b3e2a728b0b34d8b4b1993
2017-08-28 17:31:18 -07:00
Jerome Jiang
7c10251f22 vp9: Speed 8: Enable skip_encode_sb
Neutral in borg tests.

Some clips show 3-4% speed gain on 2 threads on Pixel.

Change-Id: Ic959f34e44892a854551de6e9a3d9ec819ffed00
2017-08-28 17:05:48 -07:00
Peter Boström
df9ce12259 Re-enable disabled tests under TSan.
These tests point to an already-fixed bug, this should no longer have a
data race.

BUG=webm:1049

Change-Id: Iaedc5db8df99362bdc501b70ff7fdebf8756fdb8
2017-08-28 16:24:38 -07:00
Jerome Jiang
64c55576b7 vp9: Remove resolution condition for using source_sad in speed 6.
Rev d147771 fixed the test failure. So remove the resolution condition
for using source_sad in speed 6.

BUG=webm:1452

Change-Id: I1efba97e1ef5bd4de5f886299f6fcb907187abcd
2017-08-28 12:49:54 -07:00
Marco Paniconi
255241c6d0 Merge "vp9: Speed 6 adapt_partition for live/vbr usage." 2017-08-25 22:00:08 +00:00
Marco Paniconi
43b9e785ba Merge "vp9: SVC: Modify mv search condition in speed features." 2017-08-25 21:46:35 +00:00
Marco
a0de2692fc vp9: Speed 6 adapt_partition for live/vbr usage.
Enable adapt_partition for vbr mode for speed 6.
This allows the usage of the pickmode-based partition
(used in speed 5), but only selectively for superblocks
with high source sad, otherwise the faster variance based
partition scheme is used.

For speed 6 on ytlive set: avgPSNR/SSIM metrics up by ~0.6%,
several clips up by ~1.5%. Small/negligible decrease in speed.

Change-Id: I12f3efef6b3e059391de330fdbe5a44c2587f1f8
2017-08-25 11:36:34 -07:00
Marco Paniconi
3e069846b9 Merge "Revert "quantize avx: copy 32x32 implementation"" 2017-08-25 18:20:31 +00:00
Marco
a74593b30c vp9: SVC: Modify mv search condition in speed features.
For SVC at speed >= 7: only use the improved mv search
on base spatial layer, if top layer resolution is above 640x360.

~2.3% speedup
Small/negligible loss in avgPSNR metrics on rtc set.

Change-Id: Iaef75a57ebf1c248931bc1aa28d20b7fecac1851
2017-08-25 10:12:38 -07:00
Marco Paniconi
8c42237bb2 Revert "quantize avx: copy 32x32 implementation"
This reverts commit f60d1dcd3de46f72bafc5eeef481bd1a4e203301.

Reason for revert: <INSERT REASONING HERE>
Failures in AVX/VP9QuantizeTest in nightly tests.
Original change's description:
> quantize avx: copy 32x32 implementation
> 
> Ensure avx and ssse3 stay in sync by testing them against each other.
> 
> Change-Id: I699f3b48785c83260825402d7826231f475f697c

TBR=slavarnway@google.com,johannkoenig@google.com,builds@webmproject.org

Change-Id: Ibd38636212269328317dd0721be9d25452113d1c
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
2017-08-25 16:56:08 +00:00
Shiyou Yin
ece1989fa2 Merge "vpx_dsp:loongson optimize vpx_varianceWxH_c,vpx_sub_pixel_varianceWxH_c and vpx_sub_pixel_avg_varianceWxH_c with mmi." 2017-08-25 06:44:02 +00:00
Marco Paniconi
34e48d6115 Merge "vp9: Adjust 16x16 splot threshold for variance partition" 2017-08-24 22:26:43 +00:00
Tom Finegan
ccae8da7c6 Make sure diff is present at configure time.
This avoids an endless build loop at vpx_version.h
creation time when diff is not present.

Change-Id: I16ae386dbdaf14f9a2b85e4c5d1aaa6c08f52a45
2017-08-24 12:11:48 -07:00
Johann Koenig
6c21650c0e Merge "quantize avx: copy 32x32 implementation" 2017-08-24 18:55:03 +00:00
Shiyou Yin
9e4647c7ab vpx_dsp:loongson optimize vpx_varianceWxH_c,vpx_sub_pixel_varianceWxH_c and vpx_sub_pixel_avg_varianceWxH_c with mmi.
Change-Id: Ia576a721df6312329b599c31cfe1fb1267a9f174
2017-08-25 01:58:49 +08:00
Marco
d14777157e vp9: Adjust 16x16 splot threshold for variance partition
For speeds < 7, increase threshold that controls the split
of 16x16->8x8 blocks, for resolutions 720p and higher.

Minor change for speed 5 (since it uses reference partition scheme
which only uses variance partition as first step).
For speed 6: ~0.5% increase in avgPSNR/SSIM metrics on ytlvie set.
No change in speed.

Change-Id: I5126580973201538d8ca26a9256b93c4d11d685b
2017-08-24 10:44:05 -07:00
Johann Koenig
258122fdc6 Merge "quantize test: skip block was removed" 2017-08-24 17:43:10 +00:00
Johann
f60d1dcd3d quantize avx: copy 32x32 implementation
Ensure avx and ssse3 stay in sync by testing them against each other.

Change-Id: I699f3b48785c83260825402d7826231f475f697c
2017-08-24 10:42:34 -07:00
Johann
1787e7dbe0 quantize ssse3: copy implementation to intrinsics
Still does not pass tests. Does match the previous assembly, although
saving the sign before multiplying is dubious.

Change-Id: Ia163f18c755aba542d6e93f7bf7343184660df5a
2017-08-24 07:47:51 -07:00
Johann
92aafefa1e quantize test: skip block was removed
Change-Id: I1d93698bc27529b0544d79dd7b9fe37afa51ef87
2017-08-24 07:21:42 -07:00
Johann Koenig
2dc0a5132d Merge "quantize test: set threshold for 32x32" 2017-08-24 14:04:29 +00:00
Shiyou Yin
d080c92524 Merge "vpx_dsp:loongson optimize vpx_mseWxH_c(case 16x16,16X8,8X16,8X8) with mmi." 2017-08-24 00:55:11 +00:00
Marco Paniconi
30c261b1eb Merge "vp9: SVC: Skip NEWMV for small blocks for (0, 0) base_mv." 2017-08-23 23:09:33 +00:00
Johann
e89344d61a quantize test: set threshold for 32x32
Change-Id: I77be617c7d7c64929dd51c6077322f4f8ad23897
2017-08-23 15:59:11 -07:00
Johann Koenig
f53b656207 Merge "quantize avx: copy implementation to intrinsics" 2017-08-23 21:14:13 +00:00
Marco
c9ff7b6637 vp9: SVC: Skip NEWMV for small blocks for (0, 0) base_mv.
For SVC encoding:
average speedup ~1.5%, with small ~0.57 loss in avgPSNR metrics.

Change-Id: Icebce6f6ef4e819d7dfcf8db898c583167351de4
2017-08-23 13:08:27 -07:00
Scott LaVarnway
1aad50c092 Merge "vpx_dsp: get32x32var_avx2() cleanup" 2017-08-23 19:59:25 +00:00
Johann Koenig
dfafd10ef5 Merge "quantize neon: round dqcoeff towards zero" 2017-08-23 19:20:53 +00:00
Johann
7c27872164 quantize avx: copy implementation to intrinsics
Adds an early exit based on ptest. Slightly slower than ssse3 in the
full case because of the extra check, but potentially faster if lots of
rows can be skipped.

Very close in speed to the assembly.

Can run in 32 bit, unlike the assembly. Allows reworking the function
prototype to use structs.

Change-Id: If80e2b9ba059370a4cad3c973196e82a97b4330e
2017-08-23 09:19:16 -07:00
Johann
2a5aa98a35 quantize neon: round dqcoeff towards zero
Add 1 if negative to get dqcoeff to round towards zero.

10-15% faster than converting to positive before shifting.

Change-Id: I01a62fd0c9bca786b6885b318bd447bb9229903d
2017-08-23 08:05:50 -07:00
Johann
e83d99d7b8 quantize fp: neon implementation
About 4x faster when values are below the dequant threshold and 10x
faster if everything needs to be calculated.

Both numbers would improve if the division for dqcoeff could be
simplified.

BUG=webm:1426

Change-Id: I8da67c1f3fcb4abed8751990c1afe00bc841f4b2
2017-08-23 08:01:30 -07:00
Shiyou Yin
59e065b6ed vpx_dsp:loongson optimize vpx_mseWxH_c(case 16x16,16X8,8X16,8X8) with mmi.
Change-Id: I2c782d18d9004414ba61b77238e0caf3e022d8f2
2017-08-23 15:14:15 +08:00
Marco Paniconi
0207f17144 Merge "vp9: Condition lighting change detection on CBR mode." 2017-08-22 22:52:05 +00:00
Johann Koenig
103e4e50a8 Merge changes I53f8a160,I48f282bf
* changes:
  quantize ssse3: copy style from sse2
  quantize sse2: copy opts from ssse3
2017-08-22 22:27:56 +00:00
Marco
a31461c853 vp9: Condition lighting change detection on CBR mode.
This feature is used for the CBR RTC encoding mode
at speed >= 6. This change will exclude it for VBR mode.

For speed 6 live encoding (VBR):
avgPSNR/SSIM metrics on ytlive set up by ~1% (few clips up by 2/3%).
No change in speed.

Change-Id: I1a0dd94c334f7df309ab5a48d477d7e25355b798
2017-08-22 14:59:37 -07:00
Johann
b9c1dcc5fa quantize ssse3: copy style from sse2
Change-Id: I53f8a160e640c674ea035fc112e207b6dca42598
2017-08-22 14:25:27 -07:00
Johann Koenig
7f2993f5e4 Merge "quantize: capture skip block early" 2017-08-22 20:03:02 +00:00
Johann
75752ab7c0 quantize sse2: copy opts from ssse3
Simplify eob calculations based on ssse3 implementation.

General clean up and re-scoping.

Change-Id: I48f282bf9bd28ee9bc2c7a6779be9d45b5a3a3ee
2017-08-22 13:01:44 -07:00
Johann Koenig
ab27b68693 Merge changes Icfb70687,I9a963e99,Ie8ac00ef,I1272917c
* changes:
  quantize: ignore skip_block in arm
  quantize: ignore skip_block in x86
  quantize fp: ignore skip_block in arm
  quantize fp: ignore skip_block in x86
2017-08-22 19:19:14 +00:00
Johann
7a178a5631 quantize: capture skip block early
This should probably be handled before vp9_regular_quantize_b_4x4 even
gets called.

Fixes an assert resulting from removing skip_block from the quantize
functions.

BUG=webm:1459

Change-Id: I7f52b53f959b4654b3d4517ebda31a678f4d0fde
2017-08-22 12:10:55 -07:00
James Zern
419ce36294 Merge "ppc: Add vpx_idct16x16_256_add_vsx" 2017-08-22 00:48:39 +00:00
Shiyou Yin
bff5aa9827 Merge "vpx_dsp:loongson optimize vpx_subtract_block_c (case 4x4,8x8,16x16) with mmi." 2017-08-22 00:37:23 +00:00
Johann
2c56bb97f2 quantize: ignore skip_block in arm
Change-Id: Icfb70687476b2edb25d255793ba325b261d40584
2017-08-21 14:37:50 -07:00
Johann
c02fdd0258 quantize: ignore skip_block in x86
Change-Id: I9a963e99f08761f0c8d6a305619270b2f1c4edf8
2017-08-21 14:37:03 -07:00
Johann
b527b47312 quantize fp: ignore skip_block in arm
Change-Id: Ie8ac00efa826eead2a227726a1add816e04ff147
2017-08-21 14:34:48 -07:00
Johann
7b13d99b98 quantize fp: ignore skip_block in x86
Change-Id: I1272917c49cf6e6710e52c36535b2fc8c8dced78
2017-08-21 14:33:41 -07:00
Johann
661efeca97 quantize test: test _fp_ version of quantize
None of the x86 optimizations pass the tests.

Change-Id: Ic67f2ba1977b657e68f2a13b0711fc5fcbafd909
2017-08-21 12:29:41 -07:00
Johann
13eed991f9 Remove skip_block from quantize
This condition is handled before this code is reached. The ssse3 version
of the function has always crashed when attempting to handle the
skip_block condition.

Add assert() and comments regarding the usage of skip_block.

Removing the parameter is a fairly involved process so leave it be for
the moment.

Change-Id: Ib299f6fc6589d7ee102262cc74a7aeb60110bc5a
2017-08-21 09:49:04 -07:00
Scott LaVarnway
eab3f5e0cc vpx_dsp: get32x32var_avx2() cleanup
renamed to get32x16var_avx2()

BUG=webm:1404

Change-Id: Icb8f3986c9c9c646e13a69430db7235fc7e1a036
2017-08-18 13:44:09 -07:00
Scott LaVarnway
2c5478e383 Merge "vpx_dsp: vpx_get16x16var_avx2() cleanup" 2017-08-18 20:30:59 +00:00
Scott LaVarnway
2f7497f341 vpx_dsp: vpx_get16x16var_avx2() cleanup
BUG=webm:1404

Change-Id: I88aceb07f4db4870a06eee21d87296974ce3221a
2017-08-18 12:23:49 -07:00
Johann Koenig
1426f04e91 Merge "quantize: normalize intermediate types" 2017-08-18 16:00:28 +00:00
Shiyou Yin
7d82e57f5b vpx_dsp:loongson optimize vpx_subtract_block_c (case 4x4,8x8,16x16) with mmi.
Change-Id: Ia120ad1064d0b6106d9685cf075bdab373eef19e
2017-08-18 09:06:49 +08:00
James Zern
bb15fd51be highbd_idct32x32*,idct32_34_4x32_quarter_1_2: fix typo
135 -> 34

fixes unused function warnings for highbd_idct32_34_4x32_quarter_[12]

Change-Id: I4f50ff6ea514200af93dd59ff94c7f9717409682
2017-08-17 15:37:38 -07:00
Johann
7f602d6114 quantize: normalize intermediate types
Despite abs_coeff being a positive value, all the other implementations
treat it as signed which simplifies restoring the sign.

HBD builds cast qcoeff to avoid a visual studio warning. Match
vp9_quantize.c style of casting the entire expression.

Change-Id: I62b539b8df05364df3d7644311e325288da7c5b5
2017-08-17 12:34:28 -07:00
James Zern
e038d1610e inv_txfm_sse2.h: correct idct*/iadst* prototypes
fixes mismatch between prototypes and definitions

Change-Id: Ib5e7dfcce244dbb8401815be2cdd183d96792652
2017-08-16 23:06:09 -07:00
Paul Wilkins
f64e14047d Merge "Prevent parameters that can cause invalid ARF groups." 2017-08-16 18:25:57 +00:00
Paul Wilkins
372336d1e5 Merge "Fix corrupt arf groups due to low "lag_in_frames"" 2017-08-16 18:25:29 +00:00
Linfeng Zhang
f95686895b Merge changes I08b562b6,Ia275940a,I51106e90
* changes:
  Add vpx_highbd_idct32x32_{34, 135, 1024}_add_{sse2, sse4_1}
  Update highbd idct x86 optimizations.
  Update 32x32 idct sse2 and ssse3 optimizations.
2017-08-16 16:36:37 +00:00
paulwilkins
b814e2d898 Prevent parameters that can cause invalid ARF groups.
Having a very low "lag_in_frames" value could cause the encoder to create
incorrect / corrupt ARF groups including displayed frames that update the
ARF buffer and false overlay frames that are coded at low rate but are not
actually overlays of a real ARF frame.

This is linked to a reported unit test "slow down" where the chosen parameters
(lag of 3 frames) gave rise to such "broken" ARF group(s).

See also BUG=webm:1454

Change-Id: If52d0236243ed5552537d1ea9ed3fed8c867232c
2017-08-16 14:33:59 +01:00
paulwilkins
48110d0f79 Fix corrupt arf groups due to low "lag_in_frames"
Having a very small value for "lag_in_frames" can result in
corrupt arf groups including displayed frames that update
the arf buffer and fake overlay frames that are not in fact
overlays of real arfs but are nevertheless starved of bits.

Leaving lag_in_frames at the default of 25 for these 5 frame two
pass VBR tests should now give rise to a valid ARF coding pattern
as follows:-  K(ey), A(rf), N(ormal), N, N, O(verlay).

This change is part of a response to BUG=webm:1454 where broken
arf groups interacted badly with a change that corrects for large rate
misses. However, it may still in some cases increase encode time by
virtue of the fact that the unit test now codes a correct coding pattern
with "hidden" ARF frames.

Change-Id: Ifd0246a4c1d0be247247c754024d7a4ed5f66a6b
2017-08-16 14:07:24 +01:00
Paul Wilkins
0472382dbe Merge "Fix for encoder slowdown (for speeds >= 3)" 2017-08-16 13:01:38 +00:00
paulwilkins
e15be3025b Fix for encoder slowdown (for speeds >= 3)
Some clips in nightly unit test exhibiting significant encoder slowdown which
appears to bisect to Change-Id: I692311a709ccdb6003e705103de9d05b59bf840a.

The above change allowed for emergency iterations of the recode loop and
adjustment of the Q range if there is a large rate miss.

This patch disables the above adaptation for cases of cpu_speed >= 3 or more
specifically where cpi->sf.recode_loop >= ALLOW_RECODE_KFARFGF.

For speeds >= 3 the code does not currently run a dummy bit pack operation
inside the recode loop. Without this dummy pack operation there is no up to
date estimate of the current frame's size to use as a basis for assessing the
requirement for a recode. In practice it was using the previous frames size (or 0
for the first frame) which could cause odd behavior.

If we require the emergency rate correction added in  Change-Id: I6923.. for
the higher speed settings it will be necessary to enable the dummy pack
which will in turn hurt encode speed.

BUG=webm:1454

Change-Id: I4fb3c6062ca9508325a6f31582f8e80f1a9b126f
2017-08-16 10:56:52 +01:00
Jerome Jiang
6b9c691daf Merge "Clean up writing YUV files for debug purpose." 2017-08-15 18:28:54 +00:00
Marco Paniconi
14437d0fa6 Merge "vp9: Denoiser fix: use correct bsize for skin detection." 2017-08-15 17:53:08 +00:00
Jerome Jiang
a153080b55 Clean up writing YUV files for debug purpose.
Change legacy vp8/9_write_yuv_frame to vpx_write_yuv_files.
Delete some flags that can be enabled during build.

To enable writing denoised YUV, use the following command line:
CFLAGS='-DOUTPUT_YUV_DENOISED' ./configure
--enable-vp9-temporal-denoising

For skinmap, use CFLAGS='-DOUTPUT_YUV_SKINMAP'

Change-Id: I236974ac8b3cf279d20c4dc7f6162d8b480b6528
2017-08-15 10:44:03 -07:00
Johann Koenig
c59d1a4dc7 Merge changes I1f1edeaa,I89313cac
* changes:
  quantize: silence unsigned overflow warning
  quantize test: quiet overflow warning
2017-08-15 17:37:59 +00:00
Marco
e9ccc6fe79 vp9: Denoiser fix: use correct bsize for skin detection.
Change-Id: I9d201fa3a4b00ebd147b57ed519fab8d59b0a802
2017-08-15 10:02:19 -07:00
Johann
77ed4414d6 quantize: silence unsigned overflow warning
The result of the xor operation is unsigned. If coeff was negative,
this results in an unsigned value - INT_MIN.

Change-Id: I1f1edeaa6de1f4c68b848e8a82a666d390b749f0
2017-08-15 09:48:24 -07:00
Scott LaVarnway
7e8357d664 Merge "vp9: strip temporal filter code" 2017-08-15 15:35:33 +00:00
Johann
08cb7b5c68 quantize test: quiet overflow warning
Promote the result of RandRange to signed

Change-Id: I89313cace3bcbe9af96946bef00b6857fc48b128
2017-08-15 08:28:09 -07:00
Paul Wilkins
ca393c9726 Merge "Patch relating to Issue 1456." 2017-08-15 14:57:56 +00:00
Paul Wilkins
5009302bce Merge "Enable emergency fast Q adaptation for VBR test case." 2017-08-15 14:57:22 +00:00
Linfeng Zhang
d72e20b123 Add vpx_highbd_idct32x32_{34, 135, 1024}_add_{sse2, sse4_1}
BUG=webm:1412

Change-Id: I08b562b60fa85fbc2fec1c15c323a3444b44618f
2017-08-14 17:05:22 -07:00
Linfeng Zhang
69775d2f40 Update highbd idct x86 optimizations.
BUG=webm:1412

Change-Id: Ia275940af7d7d8637e9a851a9e39d655bfbe4069
2017-08-14 16:59:50 -07:00
Linfeng Zhang
3f05a70c41 Update 32x32 idct sse2 and ssse3 optimizations.
Change-Id: I51106e90344035452621c49a6e1be7d5276b6c70
2017-08-14 16:59:31 -07:00
Scott LaVarnway
fa85cf131c vp9: strip temporal filter code
when CONFIG_REALTIME_ONLY is enabled.

BUG=webm:1446

Change-Id: Id547783ec75383966c40ab5cf6abb4a0f7984f52
2017-08-14 14:27:53 -07:00
Johann Koenig
ff184e482a Merge changes I4b4beab1,I02f74dec
* changes:
  quantize test: check skip_block
  quantize test: use negative input
2017-08-14 20:52:52 +00:00
Johann Koenig
45b39750d6 Merge "temporal filter test: adjust inputs and runtime" 2017-08-14 20:46:22 +00:00
Jerome Jiang
2caff16151 vp9 svc: Fix the stats output when sl = 1.
Actual frame size and bitrate is all 0 when using SVC sample encoder
with sl = 1 because the stats are set in parse_superframe_index which
will not caculate properly when sl = 1 since there is no superframe.

Use pkt->data.frame.sz instead when sl = 1.

Change-Id: I93f5e98a4c779e32b007e1564ba5396af9e34ad6
2017-08-14 12:00:00 -07:00
Scott LaVarnway
1ab60466ec Merge "vp9: strip mb graph code" 2017-08-14 18:01:44 +00:00
Johann
c06d6649c5 temporal filter test: adjust inputs and runtime
Use input with a narrow range because the filter only applies when the
frames are similar.

Run CompareReferenceRandom more times. Especially before narrowing the
input range, the filter frequently did not apply.

Change-Id: Ie249bedf6d0d33dfa5884611cb1835788e418b38
2017-08-14 17:24:11 +00:00
James Zern
746c0eab3b disable SSSE3/VP9QuantizeTest* in hbd builds
this test fails with the configuration similar to the assembly prior to:
d52cb5972 quantize: copy ssse3 optimizations to intrinsics

BUG=webm:1458

Change-Id: Idc5c0b84c0598259fc49609a9f0756de531d3baf
2017-08-14 09:31:14 -07:00
Scott LaVarnway
e702b68b6c vp9: strip mb graph code
when CONFIG_REALTIME_ONLY is enabled.

BUG=webm:1446

Change-Id: I4b1b8e9a456830ba1b1bd3a8882e038d37ee7903
2017-08-11 12:59:40 -07:00
Johann
e022ce84ac Rename vp8 quantize file
BUG=webm:1457

Change-Id: Ie8fae018ad8417724fde087055b90228850d631d
2017-08-11 10:44:36 -07:00
Jerome Jiang
d48be6ad73 Merge "vp9 SVC: Fix the denoiser frame buffer management." 2017-08-11 00:54:35 +00:00
Jerome Jiang
0f8ebddec4 vp9 SVC: Fix the denoiser frame buffer management.
Change the denoiser frame buffer management for SVC to more generally
handle the layer patterns in SVC (where last is not always refreshed).

This change is only for SVC with denoising and is bitexact.

Change-Id: Ic2b146a924cdf6e7114609158afa3d4880fe3fae
2017-08-10 16:56:46 -07:00
Linfeng Zhang
15193ce51f Merge "Clean highbd idct x86 code with inline functions" 2017-08-10 20:25:18 +00:00
Johann Koenig
9bb8ce5efb Merge "neon: vpx_quantize_b_32x32" 2017-08-10 15:42:49 +00:00
Johann Koenig
0b393ae505 Merge "quantize: copy ssse3 optimizations to intrinsics" 2017-08-10 15:42:20 +00:00
paulwilkins
db8fa86a6c Patch relating to Issue 1456.
Testing of 4k videos encoded with a fixed arbitrary chunking interval
uncovered a bug where by if a chunk ends 1 frame before a real scene cut,
the next chunk may be encoded with two consecutive key frames at the start
with the first being assigned 0 bits.

This fix insures that where there is a key frame group of length 1 it is
at least assigned 1 frames worth of bits not 0.

See also patch Change-Id: I692311a709ccdb6003e705103de9d05b59bf840a
which by virtue of allowing fast adaptation  of Q made this bug more visible.

BUG=webm:1456

Change-Id: Ic9e016cb66d489b829412052273238975dc6f6ab
2017-08-09 16:34:43 +01:00
Linfeng Zhang
39da7fb786 Clean highbd idct x86 code with inline functions
Created inline functions highbd_butterfly_cospi16_sse2()
and highbd_butterfly_cospi16_sse4_1()

BUG=webm:1412

Change-Id: Icbc53a73712b6207379872a5e88d0a4d09e2322a
2017-08-08 17:53:28 -07:00
Marco Paniconi
68805583e9 Merge "vp9: Partition logic adjustment for speed 6 feature." 2017-08-08 23:08:10 +00:00
Johann
357adb68b2 quantize test: check skip_block
Not all sizes were tested previously. Only 4x4 and 32x32

Change-Id: I4b4beab1b92a810a097a7306de04cc9e0e260315
2017-08-08 14:21:58 -07:00
Johann
1092cc7f1a quantize test: use negative input
coeff contains signed values.

Change-Id: I02f74decf30379a28122169ab3e844d0f3bd7d23
2017-08-08 14:19:56 -07:00
Johann
93166c5e51 neon: vpx_quantize_b_32x32
With skip block the neon is about twice as fast as C.

The neon has no shortcut for coeff < zbin so it always takes the
same amount of time. Even if the C can take the shortcut, it is over
twice as fast in neon. If it can't, that gap increases to over 10x.

BUG=webm:1426

Change-Id: I400722146c1b5a5f6289f67d85fd642463d2bfc6
2017-08-08 14:05:18 -07:00
Johann
d52cb59729 quantize: copy ssse3 optimizations to intrinsics
Fairly minor differences from sse2. pabsw and psignw are the big gains.
Also re-uses some values in eob calculation to avoid an extra pcmp.

Fixes test failures in HBD and OS X builds.

Allows using it in 32bit builds, where it is about 40% faster than sse2.

Substantially faster than the assembly for skip_block. 10-20% faster the
rest of the time.

Change-Id: If783bb3567e561e47667e10133b9c84414a334e2
2017-08-08 12:22:14 -07:00
Marco
427de67e63 vp9: Partition logic adjustment for speed 6 feature.
When adapt_partition_source_sad is enabled (currently only at
speed 6 for resoln <= 360p): use lower subsize (8x8 instead of 16x16)
for nonrd_select_partition on 32X32 blocks.

And force avoiding rectangular partition checks in
nonrd_pick_partition for speed >= 6.

Small increase ~0.5 in metrics for speed 6 on rtc_derf,
no change in speed.

Change-Id: Id751bc8f7573634571b2d6f5e29627cd5cebccae
2017-08-08 11:31:27 -07:00
Linfeng Zhang
853165ba39 Update 32x32 idct sse2 funcs, add partial case 135
Change-Id: I2b9add83f6fd8f9138fed3bec04a59877a237a6a
2017-08-07 17:37:02 -07:00
Linfeng Zhang
d670678f26 Rename highbd_multiplication_and_add_xx() to highbd_butterfly_xx()
in idct x86 code

Change-Id: I5159499a73a5c1b680516f6ca9c3d84f00c35083
2017-08-04 15:33:37 -07:00
Linfeng Zhang
fa829e0e5a Replace multiplication_and_add() with butterfly() in idct x86 code
Change-Id: I266e45a3d75a5357c7d6e6f20ab5c6fdbfe4982e
2017-08-04 15:33:34 -07:00
Linfeng Zhang
c9fb719ee1 Update butterfly() in idct x86 optimizations.
Change-Id: Ic73e03bab9fdc085146f52094014db4af36ad701
2017-08-04 15:33:28 -07:00
Linfeng Zhang
7f20c3ac44 Add vpx_highbd_idct16x16_{10, 38, 256}_add_sse4_1
BUG=webm:1412

Change-Id: I8877c986b4042f7b8e33f5674c86700675a0e4ca
2017-08-04 15:31:17 -07:00
Linfeng Zhang
22b6dc9fdf Update for loop increment of idct x86 functions
Change-Id: Ided7895eaf41d5bc9d64fe536a17f5a078da68d4
2017-08-04 15:29:19 -07:00
Linfeng Zhang
0c61331244 Update high bitdepth 16x16 idct x86 code
Prepare for high bitdepth 16x16 idct sse4.1 code.
Just functions moving and renaming.

BUG=webm:1412

Change-Id: Ie056fe4494b1f299491968beadcef990e2ab714a
2017-08-04 15:12:33 -07:00
Johann Koenig
cbb83ba4aa Merge "quantize test: consolidate sizes" 2017-08-04 20:34:50 +00:00
Johann
9578a84205 quantize test: consolidate sizes
Pass a max txfm size parameter and combine the base quantize
test with the 32x32 test.

Change-Id: I72ddf020fe6888e864ea9f3642ee2d9a8e48a04b
2017-08-04 12:45:32 -07:00
Scott LaVarnway
c42517568d vpx_dsp: merge avx2 variance files
BUG=webm:1404

Change-Id: Ieb8f85c3811b05df78722cb41eeb1166966ceec4
2017-08-04 07:49:30 -07:00
Kaustubh Raste
39e8b8dac6 Fix mips dspr2 6 tap filter clobber list
Change-Id: Ib7c07e6ce00a5c7e59113b16e6661a8369f9e646
2017-08-04 10:56:56 +05:30
Linfeng Zhang
e921c7ba8d Merge "Rewrite vpx_idct16x16_{10,256}_add_sse2() and add case 38 function" 2017-08-04 01:16:35 +00:00
Scott LaVarnway
f6c6f37e0c Merge "vpx_dsp: Use correct check for halfpel in" 2017-08-03 23:17:09 +00:00
Linfeng Zhang
563d58ab84 Rewrite vpx_idct16x16_{10,256}_add_sse2() and add case 38 function
BUG=webm:1412

Change-Id: I945f0fb6807b8948747243794dc7352b959221f7
2017-08-03 13:59:47 -07:00
Linfeng Zhang
6624f20785 Merge changes I76727df0,I66297d78,I1d000c6b
* changes:
  Extract inlined 16x16 idct sse2 code into header file
  Add transpose_32bit_8x4() sse2 optimization
  Update x86 idct optimization
2017-08-03 20:51:02 +00:00
Scott LaVarnway
8334a48d3a vpx_dsp: Use correct check for halfpel in
vpx_sub_pixel_variance32xh_avx2() and
vpx_sub_pixel_avg_variance32xh_avx2

see:
17fae3a Change to use correct check for halfpel

Change-Id: Ib0741c5c2fd011e9650ca62b76009f1b59fdbe4c
2017-08-03 06:57:40 -07:00
paulwilkins
76d77aa013 Enable emergency fast Q adaptation for VBR test case.
Enable fast adaptation of Q when there is a large overshoot
for the  #ifdef AGGRESSIVE_VBR test case.

AGGRESSIVE_VBR  is not currently enabled by default.

Change-Id: I7240bb6589795964b6b0b66df4468e4f21504e0f
2017-08-03 12:06:07 +01:00
Yunqing Wang
6843e7c7f3 Merge "Force the bit exactness in the first pass" 2017-08-03 00:03:10 +00:00
Linfeng Zhang
15a47db730 Extract inlined 16x16 idct sse2 code into header file
Will be called by high bitdepth functions.

Change-Id: I76727df00941b5a27adceaba8347f275475fcd8c
2017-08-02 16:17:43 -07:00
Linfeng Zhang
8c0ab7607e Add transpose_32bit_8x4() sse2 optimization
Change-Id: I66297d78b38db718cfe3ebb8ea972f5a72c17955
2017-08-02 16:15:58 -07:00
Yunqing Wang
bfd0f41f9b Force the bit exactness in the first pass
Originally, for the purpose of keeping a fast first pass, the first-pass
stats between row_mt_mode = 0 and row_mt_mode = 1 are not bit exact, but
that difference is very small that doesn't cause a mismatch between the
final bitstreams. However, if the encoder changes, this minor difference
may cause a mismatch. Thus, this patch always forces the first pass to
be bit exact.

BUG=webm:1453

Change-Id: I2b67cf529dee81f660f9d9e7fe9a60ea3c7b12b8
2017-08-02 15:58:39 -07:00
Johann Koenig
787970a625 Merge "quantize test: add speed comparison" 2017-08-02 21:16:35 +00:00
Marco
b9577e07fc vp8: Drop due to overshoot for non-screen content.
For 1 pass CBR mode:
Apply the logic for dropping (and re-adjusting rate control)
due to large overshoot to the case of non-screen content when
drop_frames_allowed is enabled.

For the non-screen content case: add additional condition that
rate correction factor is close to minimum state, and flag to
constrain the frequency of the dropping.

Also handle the case of temporal layers and multi-res encoding.
Add some flags/counters to the layer context for temporal layers.
For multi-res: drop due to overshoot is checked on lowest stream,
and if overshoot is detected we force drops on all upper streams
for that frame.

This feature is to avoid large frame sizes on big content
changes following low content period.

No change in behavior for screen_content_mode = 2.

Change-Id: I797ab236cbbf3b15cad439e9a227fbebced632e6
2017-08-02 13:12:48 -07:00
Scott LaVarnway
698e56f26c Merge "vpxdsp: variance_impl_avx2.c cleanup" 2017-08-02 19:08:10 +00:00
Johann
1059b5cc52 quantize test: add speed comparison
Test some possible scenarios.

Change-Id: I1a612e7153b31756be66390ceea55877856d5a33
2017-08-02 09:33:35 -07:00
Scott LaVarnway
632fe8286a vpxdsp: variance_impl_avx2.c cleanup
BUG=webm:1404

Change-Id: I8d8498009e5ef7bf1137e4ff16ec81738a020b02
2017-08-02 05:57:39 -07:00
shiyou yin
0e87b16022 Merge "loongson mmi configuration patch." 2017-08-02 01:08:43 +00:00
Linfeng Zhang
6738ad7aaf Update x86 idct optimization
Move constant coefficients preparation into inline function.

Change-Id: I1d000c6b161794c8828ff70768439b767e2afea1
2017-08-01 14:40:12 -07:00
Linfeng Zhang
c0490b52b1 Merge "Rewrite vpx_highbd_idct8x8_{12,64}_add_sse2" 2017-08-01 21:39:39 +00:00
Johann Koenig
847394fe77 Merge "neon: vpx_quantize_b" 2017-08-01 16:44:31 +00:00
Paul Wilkins
3be14200fc Merge "Respond more rapidly to excessive local overshoot." 2017-08-01 08:58:36 +00:00
Marco Paniconi
c22b17dcef Merge "vp9: Adjust noise estimation for 360p." 2017-08-01 02:48:13 +00:00
Marco
5d6c1c2d8f vp9: Adjust noise estimation for 360p.
Change-Id: Ib76875232491b14f7114061e8e913e87004427a0
2017-07-31 17:12:58 -07:00
Linfeng Zhang
bf14d468c1 Rewrite vpx_highbd_idct8x8_{12,64}_add_sse2
This replaces commit aa1c4cd, which has a bug and was reverted in
commit 3c73e58.

The bug is caused by rounding -step1[5] in highbd_idct8x8_12_half1d().

Change-Id: I37b3a5f0d91815f2dc570209091dc6626fd178a8
2017-07-31 16:36:13 -07:00
James Zern
78e2da3e42 Merge "highbd_inv_txfm_sse4: make << of neg. val a multiply" 2017-07-31 22:43:41 +00:00
Johann
2d6b5df657 neon: vpx_quantize_b
With skip block or coeff < zbin it is about twice as fast as C.

If most coeff values are > zbin it is about 10-15x as fast as C.

BUG=webm:1426

Change-Id: I5d3c007b014a372d5ef0882b39bb48983b4131c7
2017-07-31 10:38:46 -07:00
YinShiyou
2758de5cb2 loongson mmi configuration patch.
enable loongson mmi optimization: ../configure --enable-mmi

Change-Id: I7792c3adeac1d5b573917d7857bba6c1cc05fea5
2017-07-31 17:29:36 +00:00
Marco Paniconi
ebb023deb6 Merge "Revert "Revert "vp9: Speed feature to adapt partition based on source_sad.""" 2017-07-31 14:58:15 +00:00
Marco
999bd6ea84 vp9: Fix denoising condition when pickmode partition is used.
When the superblock partition is based on the nonrd-pickmode,
we need to avoid the denoising. Current condition was based on
the speed level. This change is to make the condition at the
superblock level, as the switch in partitioning may be done at
sb level based on source_sad (e.g., in speed 6).

Change-Id: I12ece4f60b93ed34ee65ff2d6cdce1213c36de04
2017-07-30 23:16:38 -07:00
Jerome Jiang
f027908ad0 Revert "Revert "vp9: Speed feature to adapt partition based on source_sad.""
This reverts commit c9266b85476aadf078238b7bde3c36bf7953e11c.

Disable source_sad when resolution > 1080P. The test should
pass now.

BUG=webm:1452

Change-Id: I72dde88e66590ff9e41da5e5dd83f5550a83f082
2017-07-30 19:49:31 -07:00
James Zern
78155b7ed5 highbd_inv_txfm_sse4: make << of neg. val a multiply
left shifting a negative value is undefined; quiets a ubsan warning.
this is applied to a constant, no change in the generated code.

Change-Id: I595f0ff7904ef025e07bb80234293d958dc9f254
2017-07-30 12:48:28 -07:00
James Zern
facb124941 Merge "Revert "vp9: Speed feature to adapt partition based on source_sad."" 2017-07-30 03:26:10 +00:00
James Zern
c9266b8547 Revert "vp9: Speed feature to adapt partition based on source_sad."
This reverts commit 064fc570ff8399536563e3846500fd99b273b034.

This causes an assertion failure in vp9_mcomp.c when running
gtest_filter=VP9/MotionVectorTestLarge.OverallTest/41:
`mv->col >= -((1 << (11 + 1 + 2)) - 1) && mv->col < ((1 << (11 + 1 + 2))
- 1)'

Change-Id: I449e777bf18b661cb3f1d82253610c55c51687f6
2017-07-29 11:36:58 -07:00
James Zern
d35b627340 Revert "Rewrite vpx_highbd_idct8x8_{12,64}_add_sse2"
This reverts commit aa1c4cd140007ea5b4be99732fbb23d1fd8cf2b5.

This fails the following tests with extreme input coefficients:
SSE2/InvTrans8x8DCT.CompareReference/0
SSE2/InvTrans8x8DCT.CompareReference/2

previously the optimized path was skipped in this range

Change-Id: I9af015a46eba96208834a219fafd651d37556a80
2017-07-29 11:12:27 -07:00
Marco Paniconi
5d0bef4763 Merge "vp9: Adjust logic in source sad for screen content." 2017-07-29 01:46:58 +00:00
Marco Paniconi
e48dfcead1 Merge "vp9: Speed feature to adapt partition based on source_sad." 2017-07-29 01:45:19 +00:00
Jerome Jiang
ac211fe23e vp9: Adjust logic in source sad for screen content.
Change-Id: I917d106f4c95ea44e413e23881f6303982e1a6a3
2017-07-28 17:25:41 -07:00
Marco
064fc570ff vp9: Speed feature to adapt partition based on source_sad.
Move the source_sad feature to speed 6 (from speed 7), and
add speed feature to switch from the variance-based partition
to reference_partition (which uses nonrd-pickmode for bsize selection)
if source_sad is high.

Currently used only for speed 6 for resoln <= 360p.
About 4-5% improvement on 360p in RTC set.
Some speed slowdown, but still ~30% faster than speed 5.

Change-Id: Ib0330ee5fe9fdd2608aed91359a2a339d967491c
2017-07-29 00:20:26 +00:00
Urvang Joshi
7105e66d19 Remove the DP version of vp9_optimize_b().
The greedy version was already enabled by default here:
https://chromium-review.googlesource.com/c/546848/

And the speed+compression gains from greedy version were already
mentioned here:
https://chromium-review.googlesource.com/c/531675/

Change-Id: Iad9f7d03490c845ad1e230af028c9d39edddca97
2017-07-28 23:12:57 +00:00
Linfeng Zhang
75653b7032 Merge changes Ia0e20f5f,I28150789,I35df041b,I221dff34
* changes:
  Update vpx_idct16x16_10_add_sse2()
  Add vpx_idct16x16_38_add_sse2()
  Rewrite vpx_highbd_idct8x8_{12,64}_add_sse2
  Refactor highbd idct 4x4 and 8x8 x86 functions
2017-07-28 22:43:00 +00:00
James Zern
3c73e587d1 Revert "quantize ssse3: declare all variables"
This reverts commit 03f5e300d69d368290305e19cc66bac8b0ea1ff8.

This causes test failures under OSX:
SSSE3/VP9QuantizeTest.EOBCheck/0
SSSE3/VP9QuantizeTest.OperationCheck/0

Change-Id: I122732717ead1f7af5b04c529a6948e382e5e59b
2017-07-28 01:22:16 -07:00
Linfeng Zhang
5232e35bc2 Update vpx_idct16x16_10_add_sse2()
Change-Id: Ia0e20f5fa47382af5785221eebb05212b40bd35c
2017-07-27 18:03:25 -07:00
Linfeng Zhang
7f4acf8700 Add vpx_idct16x16_38_add_sse2()
Change-Id: I28150789feadc0b63d2fadc707e48971b41f9898
2017-07-27 18:02:43 -07:00
Linfeng Zhang
aa1c4cd140 Rewrite vpx_highbd_idct8x8_{12,64}_add_sse2
BUG=webm:1412

Change-Id: I35df041b757d42278ac7a5cdbd909e8ffcee1455
2017-07-27 18:02:36 -07:00
Linfeng Zhang
9c43d81bc2 Refactor highbd idct 4x4 and 8x8 x86 functions
BUG=webm:1412

Change-Id: I221dff34dd5f71b390b5e043d0a137ccb0a01dec
2017-07-27 18:01:03 -07:00
Johann Koenig
a83e1f1d53 Merge "quantize ssse3: declare all variables" 2017-07-27 21:18:35 +00:00
Jerome Jiang
905b8ec27f Merge "vp8: Remove isolated skin & non skin blocks." 2017-07-27 20:24:08 +00:00
Jerome Jiang
56d95b77f5 vp8: Remove isolated skin & non skin blocks.
Neutral on RTC metrics and speed on Pixel.

Change-Id: I26b907483fe133e6e4c1009d147631f0d0e0f2fb
2017-07-26 14:44:36 -07:00
James Zern
1c666465af inv_txfm_{sse2,ssse3}: clear conversion warnings
visual studio reports tran_high_t (int64) -> short in calls to
_mm_set1_epi16

Change-Id: Icb8d1baee77ad3d45edb1477a443d3e648f0b745
2017-07-25 20:13:49 -07:00
James Zern
62682ac8ad highbd_idct*_sse*.c: clear conversion warnings
visual studio reports tran_high_t (int64) -> int in calls to
_mm_setr_epi32

Change-Id: Ic2247c8e3800991202151790d78bd94c4f4aed05
2017-07-25 20:11:09 -07:00
James Zern
85736e616e vpx_variance16x16_sse2: correct cast order
allow the right shift to operate on 64-bits, this matches the rest of
the implementations

previously:
b0f1ae147 vpx_get16x16var_avx2: correct cast order

Change-Id: I632ee5e418f3f9b30e79ecd05588eb172b0783aa
2017-07-25 16:45:40 -07:00
Alexandra Hájková
666c543f7b ppc: Add vpx_idct16x16_256_add_vsx
Change-Id: Ibc3f7965423fd91179f8d8e77c7ae3e6d7f80572
2017-07-25 12:34:15 +00:00
James Zern
b0f1ae1475 vpx_get16x16var_avx2: correct cast order
allow the right shift to operate on 64-bits, this matches the rest of
the implementations

missed in:
6acd061aa variance_avx2: sync variance functions with c-code

Change-Id: Icae436b881251ccb9f9ed64fcbf8d358c58a4617
2017-07-24 16:29:44 -07:00
James Zern
8836e46ffd set_var_thresh_from_histogram: prevent negative variance
For 8-bit the subtrahend is small enough to fit into uint32_t.

For 10/12-bit apply:
63a37d16f Prevent negative variance

previously:
47b9a0912 Resolve -Wshorten-64-to-32 in highbd variance.
c0241664a Resolve -Wshorten-64-to-32 in variance.

Change-Id: I181c85f0b9a03da37c2e8b89482d48aa3dbc0aee
2017-07-22 13:27:32 -07:00
Marco
8c7a60e04d vp8: Fix compile warning in vp8_multi_resolution_encoder.c
Change-Id: I49c960179dfc1902aa5e5c99915789878c06bc3d
2017-07-20 14:19:43 -07:00
Johann Koenig
e8bd534c42 Merge "quantize test: promote RandRange() result to signed" 2017-07-20 19:46:05 +00:00
Johann Koenig
0c30b75f40 Merge "quantize test: lowbd functions do not pass in highbd" 2017-07-20 19:45:59 +00:00
Jerome Jiang
494188505b Merge "vp9: Removed unused skin detection function." 2017-07-20 16:58:01 +00:00
Johann
af08fbb444 quantize test: promote RandRange() result to signed
Avoid unsigned overflow warning:
unsigned integer overflow: 19974 - 32703 cannot be represented in type
'unsigned int'

Change-Id: Ifebee014342e4c6f3b53306c0cad6ae0b465ac12
2017-07-20 08:17:48 -07:00
Johann
c782f27ead quantize test: lowbd functions do not pass in highbd
qcoeff output looks OK but dqcoeff is no good.

BUG=webm:1448

Change-Id: I07211db8a8b74f1f45fdd059852e2de0e5ee18fd
2017-07-20 08:17:48 -07:00
Johann Koenig
4702bb26be Merge "quantize test: eob is output" 2017-07-20 15:17:26 +00:00
Johann Koenig
e1809501d0 Merge "Earmark extra space for VSX." 2017-07-19 21:35:57 +00:00
Jerome Jiang
9dd992b6f0 Merge "Roll libwebm: Fix android build failure with NDK r15b." 2017-07-19 21:30:21 +00:00
Johann
bde2e4aa36 quantize test: eob is output
eob values are generated by the function.

Change-Id: I8ce92100e83022bff99888a5a7e6ef378c49fda3
2017-07-19 14:17:19 -07:00
Han Shen
b72d3e8a25 Earmark extra space for VSX.
Backend specific optimization for PPC VSX reads 16 bytes, whereas arm neon /
sse2 only reads <= 8 bytes. Although the extra bytes read are actually never
used, this is not a warrant for groping around.  Fixed by allocating more when
building for VSX. This is reported by asan.

Also note - PPC does have assembly that loads 64-bit content from memory - lxsdx
loads one 64-bit doubleword (whereas lxvd2x loads two 64-bit doubleword) from
memory. However, we only have "vec_vsx_ld" builtins that mapped to lxvd2x, no
builtins to lxsdx. The only way to access lxsdx is through inline assembly,
which does not fit well in the origin paradigm.

Refer:
  vsx:
    vpx_tm_predictor_4x4_vsx @ third_party/libvpx/git_root/vpx_dsp/ppc/intrapred_vsx.c
  neon:
    vpx_tm_predictor_4x4_neon @ third_party/libvpx/git_root/vpx_dsp/arm/intrapred_neon_asm.asm
  sse2:
    tm_predictor_4x4 @ third_party/libvpx/git_root/vpx_dsp/x86/intrapred_sse2.asm

BUG=b/63112600

Tested:
  asan tests passed.

Change-Id: I5f74b56e35c05b67851de8b5530aece213f2ce9d
2017-07-19 13:59:32 -07:00
Johann Koenig
89a116f4cb Merge "variance: call C comp_avg_pred" 2017-07-19 20:34:13 +00:00
Jerome Jiang
8ad9338e2e Roll libwebm: Fix android build failure with NDK r15b.
BUG=webm:1447

Change-Id: I8defe45cb94eb9c209ba72ce446786f24c14c0b8
2017-07-18 16:52:46 -07:00
Jerome Jiang
4526644615 vp9: Removed unused skin detection function.
Change-Id: I6702b7b11aa4ac9aac5fd54deef4377cdcb29c64
2017-07-18 14:52:04 -07:00
Jerome Jiang
59e461db1f Merge "vp9: Allocate alt-ref in denoiser for SVC." 2017-07-18 21:30:04 +00:00
Jerome Jiang
babef23a5f Merge "vp9: Remove isolated skin & non-skin blocks." 2017-07-18 20:48:32 +00:00
Johann Koenig
56d3f1573a Merge changes I62c2e313,Ibd7a0337,I94e1d886
* changes:
  quantize test: test sse2 and avx optimizations
  quantize test: extend arrays
  quantize test: restrict and correct input
2017-07-18 20:42:39 +00:00
Johann
4b9a848bb3 variance: call C comp_avg_pred
Keep optimized code out of the reference implementation. This matches
the style of the other sub calls.

Change-Id: I3da6acd4f2c647b029c420e22ac9410a18259689
2017-07-18 20:22:53 +00:00
Jerome Jiang
fd216268ad vp9: Allocate alt-ref in denoiser for SVC.
When SVC is used, allocate alt-ref in denoiser.

Change-Id: I1b17221b55b9444cd23b97d481b54ff8d296d857
2017-07-18 13:22:47 -07:00
Johann
03f5e300d6 quantize ssse3: declare all variables
Copy missing line from avx implementation.

Change-Id: I9755c5b4d4034867de6fa9f741c24bf49dce3a27
2017-07-18 12:32:57 -07:00
Johann
101981b736 quantize test: test sse2 and avx optimizations
ssse3 does not pass either of the tests.

avx 32x32 does not pass.

Change-Id: I62c2e31336fd2327327afaa0da896ad79a3def44
2017-07-18 12:08:16 -07:00
Jerome Jiang
adbfc4308a vp9: Remove isolated skin & non-skin blocks.
0.007% regression on rtc and 0.004% gain on rtc_derf.
1 thread on QVGA,VGA and HD has ~0.2% speed regression while 2 threads has
~0.2% speed gain on Google Pixel.

Change-Id: Ia4a6ec904df670d7001e35e070b01e34149d23dc
2017-07-18 11:29:14 -07:00
Johann
c7ebe82253 quantize test: extend arrays
Officially the quant structures are 8 elements, with one dc element and
7 repeated ac elements. The low bit depth optimizations take advantage
of this to fill the xmm registers. The high bit depth version manually
duplicates the values.

If all the optimizations were unified, the structure sizes could be
greatly reduced.

Change-Id: Ibd7a0337a7832ce2a1a05ee433c310077e1059ae
2017-07-18 09:55:47 -07:00
Johann
cb61ba02f4 quantize test: restrict and correct input
Use only valid values for quantize inputs. These were determined by
looping over vp9_init_quantizer and looking for max and min values.

This allows extending the test to the low bit depth functions which were
not designed to handle all possible inputs but only valid inputs.

Change-Id: I94e1d8863a49ac227845b65c6b50130e10e6319e
2017-07-18 09:40:45 -07:00
Marco
817f68cdcf vp9: Disable usage of sb_use_mv_part for SVC.
To fix valgrind issueis with SVC tests.
SVC encoding uses prune_evenmore which is causing uinit value.

Will re-enable later when issue is resolved.

Change-Id: I257ff878cf78197ddd813db056582a4d5fe94f44
2017-07-18 09:28:56 -07:00
Marco
ad56371343 vp9: Fix to setting content_state for real-time mode.
When content_state_sb is set to LowVarHighSumdiff, don't reset
it to VeryHighSad. Visually better on clips with strong lighting changes.

Small/negligible change in RTC metrics and speed.

Change-Id: I20c383e3c4cf8d1149de5f9260449c0b7cf7c6aa
2017-07-17 16:21:25 -07:00
Marco
0c9e2f4c15 vp9: Reuse motion from choose_partitioning in NEWMV search.
When int_pro_motion_estimation is done for superblock in
choose_partitioning, use it to avoid the full_pixel_search
for NEWMV mode, if bsize is >= 32X32.

For speed > 7.
Small/neutral change on RTC metrics.
~1-2% speedup on arm on high motion clip.

Change-Id: I3cfe6833ff4bf75d4afa83eaf058ad45729de85b
2017-07-17 13:15:48 -07:00
James Zern
9223b947ca Merge "fix 'make exampletest' w/CONFIG_REALTIME_ONLY" 2017-07-15 18:37:10 +00:00
Jerome Jiang
682135fa60 vp9: Compute skin only for blocks eligible for noise estimation.
Change-Id: Iddcb83a5968db57cfd312c5bc44b2a226a2a3264
2017-07-14 15:14:30 -07:00
Marco
666e394d41 vp9: Adjust minmax threshold for variance partitioning.
Only affects speed 7. Improvement on high motion clips.

Change-Id: Ibddb68fed9c63207df29ffd790f9205b1cecf687
2017-07-13 21:19:37 -07:00
Johann
e3fa4ae8e3 quantize test: use Buffer
Although the low bitdepth functions are identical (excepting the need
for larger intermediate values) they do not pass these tests. This
improves the error output to aid debugging.

Simplify buffer usage with Buffer and removing unnecessarily aligned
variables.

eob is a single element and never written using aligned instructions.

BUG=webm:1426

Change-Id: Ic95789a135cf1e8a3846d85270f2b818f6ec7e35
2017-07-13 15:54:48 -07:00
James Zern
960466939d fix 'make exampletest' w/CONFIG_REALTIME_ONLY
for tests that aren't explicitly testing 2-pass behavior use --passes=1
with this configuration

Change-Id: I6a1520ecc65d0f626486604310af29dacb9f197f
2017-07-13 10:47:20 -07:00
James Zern
b578d59623 Merge "remove vp9_firstpass.c w/CONFIG_REALTIME_ONLY" 2017-07-12 23:30:04 +00:00
Johann Koenig
e0d79bc7b5 Merge "sad4d neon: 64x[32,64]" 2017-07-12 20:15:00 +00:00
Marco Paniconi
f6586b8bf8 Merge "vp9: Fix to SVC and denoising for fixed pattern case." 2017-07-12 19:13:05 +00:00
Johann Koenig
3158752980 Merge changes Ibf5e61dc,I44b48512,I7de2500c,I5081b5ce
* changes:
  sad4d neon: 32x[16,32,64]
  sad4d neon: 16x[8,16,32]
  sad4d neon: 8x[4,8,16]
  sad4d neon: 4x4, 4x8
2017-07-12 15:01:30 +00:00
Johann
e381753926 sad4d neon: 64x[32,64]
Rewrite 64x64.

BUG=webm:1425

Change-Id: I336bf5a3aa4b783389c10b16a50f0f559346ecbf
2017-07-12 13:26:39 +00:00
Johann
e1bde306c8 sad4d neon: 32x[16,32,64]
Rewrite 32x32. Use half the accumulator registers.

BUG=webm:1425

Change-Id: Ibf5e61dc4ba15056102aef8495f4a02c668c5d13
2017-07-12 13:25:18 +00:00
Johann
807ce8fb1e sad4d neon: 16x[8,16,32]
Rewrite 16x16. Use half the accumulator registers.

BUG=webm:1425

Change-Id: I44b48512b1e3629505d83c2645e800f53878ccc2
2017-07-12 13:25:11 +00:00
Johann
8152b0904d sad4d neon: 8x[4,8,16]
BUG=webm:1425

Change-Id: I7de2500cca4b621f21478c4b0333c56d76dbc9a4
2017-07-12 13:25:03 +00:00
Johann
dd4347e9ec sad4d neon: 4x4, 4x8
BUG=webm:1425

Change-Id: I5081b5ce131821d590c53ac1206a94f50cb8b468
2017-07-12 03:38:03 +00:00
Urvang Joshi
1dee320446 Merge "Remove the token state array from greedy optimize_b." 2017-07-12 00:08:56 +00:00
James Zern
df18412f32 remove vp9_firstpass.c w/CONFIG_REALTIME_ONLY
BUG=webm:1446

Change-Id: I6e0ea9342c715d354c641109737172afa649b85b
2017-07-11 13:10:16 -07:00
Urvang Joshi
5322a31b18 Remove the token state array from greedy optimize_b.
Reduces memory usage, and speeds up encoding for some difficult clips.
No impact on output or metrics.

Ported from aomedia patch:
https://aomedia-review.googlesource.com/c/14501

Change-Id: I26ec69af8336f9e80da486a1cfbfc89a3596954d
2017-07-11 13:05:29 -07:00
James Bankoski
7d5afa227a Merge "Reintroduce fix for max qindex calculation of a gf interval" 2017-07-11 19:47:16 +00:00
Jerome Jiang
1a4d8f2033 Merge "vp9: Move skinmap computation into multithreading loop." 2017-07-11 19:44:22 +00:00
Jim Bankoski
689ad89e86 Reintroduce fix for max qindex calculation of a gf interval
This reintroduces the fix:
  https://chromium-review.googlesource.com/c/422807/
and later reverted here:
  https://chromium-review.googlesource.com/c/447843/

BUG=webm:1355

This time behind a compile time flag :

configure --disable-always_adjust_bpm
configure --enable-always_adjust_bpm

This should make side by side testing easier and let users of the
lib pick which way they want to go.

Change-Id: I7d7b37b83015dc001810af84c132cbc1e71ba8d6
2017-07-11 18:40:26 +00:00
Marco
3818a3723b vp9: Fix to SVC and denoising for fixed pattern case.
For fixed pattern SVC: keep track of denoised last_frame buffer
for base temporal layer, and if alt_ref is updated on middle/upper
temporal layers, force an update to denoised last_frame buffer.
This allows for improved denoising on top temporal layers.

Change-Id: Icbd08566027d4d2eabc024d3b7a0d959d2f8c18b
2017-07-11 11:27:04 -07:00
Jerome Jiang
3d6b0cb825 vp9: Move skinmap computation into multithreading loop.
Change-Id: Iebc9dd293d8b1449c0674c0295349297e9b90646
2017-07-10 17:18:15 -07:00
Johann
66a96fd3de avg_neon: fix 4x4, update 8x8
4x4 was failing with a bus error. Most likely due to clang alignment
hints on 32bit loads.

Change-Id: Ib191ce0e6239fc55d85f10e4dbe15876e5052edb
2017-07-10 15:29:34 -07:00
Johann
87610ac45e neon: consolidate horizontal adds
Change-Id: Iaf9e88ff636ccf8f0ef310869c6827f3f205cca8
2017-07-10 15:29:13 -07:00
Johann Koenig
4b78c6e6f7 Merge "remove vp9_full_sad_search" 2017-07-10 20:42:40 +00:00
Jerome Jiang
125a532b34 Merge "vp9: Remove alt-ref from denoiser." 2017-07-10 20:03:51 +00:00
Johann
109faffe9b remove vp9_full_sad_search
This code is unused in vp9. Only vp8 still contains references to
vpx_sad_NxMx[3|8] and only for sizes 16x16, 16x8, 8x16, 8x8 and 4x4.

Remove the remaining sizes and all the highbitdepth versions.

BUG=webm:1425

Change-Id: If6a253977c8e0c04599e25cbeb45f71a94f563e8
2017-07-10 11:20:35 -07:00
Jerome Jiang
2ac7c549e9 vp9: Remove alt-ref from denoiser.
Denoiser is used in real-time mode which does not use alt-ref.
Reduce memory usage when denoiser is enabled.

Change-Id: I54ba3bcaeeb1818bbdf718ef90e97d4897ff793d
2017-07-10 10:56:03 -07:00
Johann Koenig
4e16f70703 Merge changes Id84d9780,Iaa6ea75b,I3362e0dd,I0020a49e,Ia42e4f36, ...
* changes:
  sad neon: avg for 64x[32,64]
  sad neon: macroize 64xN definitions
  sad neon: avg for 32x[16,32,64]
  sad neon: macroize 32xN definitions
  sad neon: avg for 16x[8,16,32]
  sad neon: macroize 16xN definitions
2017-07-07 21:01:23 +00:00
James Zern
5d6060b62f Merge "cosmetics,vp9/: normalize inv/fwd_txfm naming" 2017-07-07 19:15:02 +00:00
Johann Koenig
6c375b9cd0 Merge "fdct neon: 32x32_rd" 2017-07-07 14:05:51 +00:00
Johann
e4e08556db sad neon: avg for 64x[32,64]
BUG=webm:1425

Change-Id: Id84d97807a6a0fbcc889c4dfe11929d54f85493d
2017-07-07 07:04:04 -07:00
Johann
6ae8f8dbe8 sad neon: macroize 64xN definitions
Change-Id: Iaa6ea75b10e75784f31b1e08637eecf0dcb5cff9
2017-07-07 07:04:04 -07:00
Johann
67cffc1ef6 sad neon: avg for 32x[16,32,64]
BUG=webm:1425

Change-Id: I3362e0dded3b46ca032caa7f44db42f324bc596d
2017-07-07 07:04:04 -07:00
Johann
b0d15713be sad neon: macroize 32xN definitions
Change-Id: I0020a49e77d27514375a03095d5821dc0aa7d128
2017-07-07 07:04:04 -07:00
Johann
527e0c9b1c sad neon: avg for 16x[8,16,32]
BUG=webm:1425

Change-Id: Ia42e4f36547c5fe12114fb58379e34bce82eb2f2
2017-07-07 07:04:04 -07:00
Johann
3c18acf452 sad neon: macroize 16xN definitions
Change-Id: I5aea6ffbfa48eb1970afe3be54f0bba275d7fa58
2017-07-07 07:04:04 -07:00
Johann Koenig
9b253f9f0a Merge changes I7b36a57e,If2ab51e3,Ifc685a96
* changes:
  sad neon: macroize 8xN definitions
  sad neon: avg for 8x[4,8,16]
  sad neon: avg for 4x4 and 4x8
2017-07-07 14:03:13 +00:00
Marco Paniconi
2075af4b16 Merge "vp9: Nonrd mode: use content_state_sb for high motion." 2017-07-07 03:00:59 +00:00
James Zern
80b83c73ba cosmetics,vp9/: normalize inv/fwd_txfm naming
+ vpx_dsp/, test/

itxfm -> inv_txfm, ftxfm -> fwd_txfm

Change-Id: I3aacdb65143576d64cfe5c9b14dd358c17c1fe7e
2017-07-06 18:35:44 -07:00
James Zern
777ca80f0a Merge changes from topic 'rm-dec-frame-parallel'
* changes:
  vp9: remove FrameWorkerData & vp9_dthread.h
  vp9: remove (un)lock_buffer_pool
2017-07-06 23:31:30 +00:00
James Zern
a15c6a7ebf vp8cx,cosmetics: correct VP9_SET_TILE_COLUMNS docs
this has been set to max since:
f5c36a5ce VP9: turn on tile-columns and frame-parallel-mode by default
~v1.4.0

Change-Id: Ic796fc05abe73a58700ec50e3f8e72d3462898ec
2017-07-06 16:24:35 -07:00
Marco
8c3f18efa1 vp9: Nonrd mode: use content_state_sb for high motion.
In the content_state for a superblock is set to HighSad,
use that to bias some decisions in variance partition and
nonrd pickmde: use int_pro_motion for sad computation in
choose_partitioning, and set large_block in pickmode based
on the content_state_sb.

Only affects speed >= 7.

Immprovement for high motion content.
Small gain (~1%) in RTC metrics.
Speedup of ~5 for high motion clip on android (speed 8, 1 thread).

Change-Id: I5774c4854f012b89c8e969f6129b60988c2ce11c
2017-07-06 15:05:19 -07:00
James Zern
26a9a4cd64 vp8cx,cosmetics: correct VP9_SET_FRAME_PARALLEL_DECODING docs
this has been on by default since:
f5c36a5ce VP9: turn on tile-columns and frame-parallel-mode by default
~v1.4.0

Change-Id: I52017ab0157feaf429dce3d9e1af8a53bb5c1b65
2017-07-06 10:40:18 -07:00
Johann
d6423b3166 sad neon: macroize 8xN definitions
Change-Id: I7b36a57e893c1795a37ba7994995bec7ff021409
2017-07-06 07:51:59 -07:00
Johann
63bdc574e5 sad neon: avg for 8x[4,8,16]
BUG=webm:1425

Change-Id: If2ab51e3050e078b0011b174efe41fcb65a15f44
2017-07-06 07:43:09 -07:00
Johann
6bac3f80ee sad neon: avg for 4x4 and 4x8
BUG=webm:1425

Change-Id: Ifc685a96cb34f7fd9243b4c674027480564b84fb
2017-07-06 07:12:47 -07:00
Johann
75b00592c7 fdct neon: 32x32_rd
About 40% faster than the non-rd version.

BUG=webm:1424

Change-Id: Ia99d14eb9532302eeaab8cd3e503395b0374b5a2
2017-07-06 06:30:50 -07:00
James Zern
5227b8200b vp9: remove FrameWorkerData & vp9_dthread.h
the file was empty after the struct removal. the only remaining use was
within vp9_dx_iface, but the wrapper became unnecessary after the
removal of frame_parallel_decode.

BUG=webm:1395

Change-Id: I515ab585d701e77d388d12b2802d844c424f9bcd
2017-07-05 22:32:00 -07:00
James Zern
48c4a038eb vp9: remove (un)lock_buffer_pool
there is no threaded access to this pool after the removal of
frame_parallel_decode

BUG=webm:1395

Change-Id: I710769b87102edc898c59eb9a2e7a91d8c49107f
2017-07-05 21:07:00 -07:00
James Zern
af3cab7b24 Merge changes from topic 'rm-dec-frame-parallel'
* changes:
  vp9_onyxc_int,RefCntBuffer: rm unused members
  remove vp9_dthread.c
  vp9: reduce FRAME_BUFFERS by 3
2017-07-06 04:06:30 +00:00
James Zern
4ffd8350be Merge changes from topic 'rm-dec-frame-parallel'
* changes:
  VP9_COMMON: rm frame_parallel_decode
  VP9Decoder: rm frame_parallel_decode
  vp9_dx: rm worker thread creation
2017-07-05 23:53:22 +00:00
James Zern
0d245d42c4 Merge "test_vector_test,vp8: correct thread range" 2017-07-05 22:33:51 +00:00
Yaowu Xu
f2b1dc529f Merge "Further refactoring of mod error calculation." 2017-07-05 21:43:50 +00:00
Yaowu Xu
e3cafbc8df Merge "Fix incorrect index test in GF group rate assignment." 2017-07-05 21:43:43 +00:00
James Zern
24d0391efb Merge "googletest: suppress unsigned overflow in the LCG" 2017-07-05 21:19:44 +00:00
Johann Koenig
9a05f9771a Merge "test/buffer.h: move range checking to compiler" 2017-07-05 21:15:13 +00:00
James Zern
a22bb9809e Merge "dct_partial_test: cover vpx_fdct8x8_1_msa in hbd" 2017-07-05 21:08:46 +00:00
Hui Su
3e08a88854 Merge "level tests: allow level undershoot" 2017-07-05 20:47:20 +00:00
James Zern
23d60be414 dct_partial_test: cover vpx_fdct8x8_1_msa in hbd
this was enabled in:
5ac88162b partial fdct test

Change-Id: Ibae2031ec1308fe3a3b84a1ce6e7bacda3a7cb82
2017-07-05 13:01:41 -07:00
James Zern
a6531cbc54 Merge changes from topic 'missing-proto'
* changes:
  fwd_txfm_msa.c: add missing vpx_dsp_rtcd.h
  vpx_convolve_*_msa.c: add missing vpx_dsp_rtcd.h
  loopfilter_*_msa.c: add missing vpx_dsp_rtcd.h
2017-07-05 20:00:25 +00:00
Johann Koenig
b6321025cd Merge "partial fdct neon: maintain neon registers" 2017-07-05 19:12:38 +00:00
Johann
da2ad47d66 test/buffer.h: move range checking to compiler
Pass low/high values as type T. Out of range values should be caught by
static analysis instead.

Change-Id: I0a3ee8820af05f4c791ab097626174e2206fa6d5
2017-07-05 11:21:18 -07:00
paulwilkins
5b44ef0c50 Respond more rapidly to excessive local overshoot.
This patch attempts to address a bug reported for 4K video.
https://b.corp.google.com/issues/62215394

In this instance a perfect storm of a moderate complexity section
followed by a much easier section where a CGI overlay helped to
suppress film grain noise, followed by a much harder and very grainy
section at the end, cause a massive local rate spike that pushed a chunk
over the upper allowed rate limit.

This patch detects cases where the rate for a frame is much higher than
expected and allows, in this special case, for rapid adjustment of the active
Q range.

For the example chunk in the bug report the target rate was 18Mb/s and the
observed rate was over 37 Mb/s with a surge for the last few frames to over
100Mb/s. This patch brings the overall chunk rate right back down to ~18.2 Mbit/s
and  almost completely eliminates the rate spike at the end. (See graphs appended
to bug report)

Also see  I108da7ca42f3bc95c5825dd33c9d84583227dac1 which fixes a bug
unearthed during testing of this patch and also has a bearing on high rate
encodes such as 4K.

This patch does have a negative impact on some metrics. Most notably there are
clips in our standard test set where it hurts global psnr (though in many cases it
conversely helps SSIM, FAST SSIM and PSNR-HVS). It is also worth noting that
the clips (and data rates) where there is a big metric impact, are almost all cases
where there is currently a significant overshoot vs the target rate and overall rate
accuracy is greatly improved.

Change-Id: I692311a709ccdb6003e705103de9d05b59bf840a
2017-07-05 16:51:52 +01:00
paulwilkins
a1af335f44 Further refactoring of mod error calculation.
Further refactoring to support alternative error distributions.

Change-Id: I0f7fa3fd6f3baa4b0a1e53c6aa3be63966e97b82
2017-07-05 16:49:37 +01:00
paulwilkins
b0459ec8ea Fix incorrect index test in GF group rate assignment.
Correct test for middle frame in the group.

Change-Id: I1ee49fa33968eb3c4a01d6a27a60bb1409e3e68c
2017-07-05 16:45:36 +01:00
James Zern
7d526c1654 Merge "buffer.h: incorrect RandRange results" 2017-07-02 03:48:53 +00:00
Johann
6cb3178192 buffer.h: incorrect RandRange results
'low' was promoted to unsigned, triggering a ubsan warning

Change-Id: Id49340079d39c105da93cf13e96cf852a93a94ba
2017-07-01 20:01:22 -07:00
James Zern
fb135ff050 Merge changes I4ed1312f,Id2673eec
* changes:
  ppc: Add vpx_idct8x8_64_add_vsx
  ppc: Add vpx_idct4x4_16_add_vsx
2017-07-02 02:38:39 +00:00
Alexandra Hájková
c757d6dde4 ppc: Add vpx_idct8x8_64_add_vsx
Change-Id: I4ed1312f365509e0595dcc09890ecb050f6f2069
2017-07-01 12:55:47 -07:00
Alexandra Hájková
d8c277030c ppc: Add vpx_idct4x4_16_add_vsx
Change-Id: Id2673eece32027fb245919c7a5c81994a4a19fd8
2017-07-01 12:32:18 -07:00
Alex Converse
f7645138d4 googletest: suppress unsigned overflow in the LCG
Local application of:
https://github.com/google/googletest/pull/1066

Suppress unsigned overflow instrumentation in the LCG

The rest of the (covered) codebase is already integer overflow clean.

TESTED=gtest_shuffle_test goes from fail to pass with -fsanitize=integer

Change-Id: I8a6db02a7c274160adb08b7dfd528b87b5b53050
2017-07-01 12:24:32 -07:00
James Zern
3dd993e4be highbd_idct8x8_add_sse4: make << of neg. val a multiply
left shifting a negative value is undefined; quiets a ubsan warning.
this is applied to a constant, no change in the generated code.

Change-Id: Ia17a7672d4832463decbc4afd6cd42974d02698e
2017-07-01 11:56:56 -07:00
Johann
3ae458f2f3 partial fdct neon: maintain neon registers
Finish the calulations in neon registers. This avoids a potentially
expensive move from neon to gp and allows at least clang to store
directly to memory.

BUG=webm:1424

Change-Id: Idef25eec95f7610947167818e9194bde8b00d282
2017-07-01 09:29:38 -07:00
James Zern
a876d04072 fwd_txfm_msa.c: add missing vpx_dsp_rtcd.h
+ only expose compatible functions in high-bitdepth build

quiets -Wmissing-prototypes warnings

Change-Id: I8ef7db08a34c5c54b5cde6e732c0d70f4287c89a
2017-06-30 18:53:30 -07:00
James Zern
8710c6d884 vpx_convolve_*_msa.c: add missing vpx_dsp_rtcd.h
quiets -Wmissing-prototypes warnings

Change-Id: I1ab5b8ae4a62f54e0f9eb3fc81371c9b99972c30
2017-06-30 18:50:56 -07:00
James Zern
329dabf57e loopfilter_*_msa.c: add missing vpx_dsp_rtcd.h
+ make some functions static

quiets -Wmissing-prototypes warnings

Change-Id: I2130e06142e71a004a1eb30e173feba4f6fe68a0
2017-06-30 18:50:52 -07:00
James Zern
27e37e1a8a fwd_txfm_msa.c: correct vpx_fdct8x8_1_msa prototype
this makes the function compatible with high-bitdepth and fixes test
failures since:
5ac88162b partial fdct test

Change-Id: Ib630694608237f0c515948942e05dbea259ba338
2017-06-30 18:50:47 -07:00
James Zern
af3ab45867 test_vector_test,vp8: correct thread range
testing::Range does not include the end parameter in the set of values.
also adjust the start to 2 as the single threaded case is already
covered in another instantiation

Change-Id: Iae3bf3ed4363dd434eccfa5ad4e3c5e553fbee60
2017-06-30 16:21:06 -07:00
James Zern
5a8e4110c7 Merge "gen_msvs_sln: fix solution version for 2015/17" 2017-06-30 22:05:32 +00:00
James Zern
37e03b1d13 Merge "cosmetics,vp9/encoder: s/txm/txfm/" 2017-06-30 21:57:16 +00:00
Jerome Jiang
f781cc8a46 Merge "vp9: Adjust condition for checking intra mode." 2017-06-30 21:55:00 +00:00
Marco
2290898ac7 vp9: Adjust condition for checking intra mode.
For nonrd_pickmode: add condition for checking
intra mode if the sb content state is VeryHighSad.

Reduces artifacts when sudden change in content.

Metrics on RTC/RTC_derf neutral (small gain).
No speed loss observed.

Change-Id: I07006d28fd2dc06c1d06b07630102b0fece50c40
2017-06-30 14:52:00 -07:00
Linfeng Zhang
1e3a93e72e Merge changes I5d038b4f,I9d00d1dd,I0722841d,I1f640db7
* changes:
  Add vpx_highbd_idct8x8_{12, 64}_add_sse4_1
  sse2: Add transpose_32bit_4x4x2() and update transpose_32bit_4x4()
  Refactor highbd idct 4x4 sse4.1 code and add highbd_inv_txfm_sse4.h
  Refactor vpx_idct8x8_12_add_ssse3() and add inv_txfm_ssse3.h
2017-06-30 20:49:19 +00:00
James Zern
70b7713059 gen_msvs_sln: fix solution version for 2015/17
these are rewritten to 12; 15 causes the open to fail under vs2017

Change-Id: I9c3fd38b632180fa10f1713d4a5d9d15aefd8569
2017-06-30 12:36:46 -07:00
James Zern
303cb3106b vp9_onyxc_int,RefCntBuffer: rm unused members
the last frame_worker_owner, row and col references were removed in:
131bd06e6 remove vp9_dthread.c

BUG=webm:1395

Change-Id: Ia7fb2e8782b12a58d2a2263849d20a8abf06aef6
2017-06-30 12:03:07 -07:00
James Zern
bc837b223b VP9_COMMON: rm frame_parallel_decode
this has been 0 since the removal of frame_parallel_decode in
vp9_dx_iface.

BUG=webm:1395

Change-Id: I3a562b2c6b82050064d2b2ccb18a3e77c700b2da
2017-06-30 12:03:07 -07:00
James Zern
78fe5ca360 remove vp9_dthread.c
and the related prototypes in vp9_dthread.h. the last references were
removed in:
09dabc58d VP9_COMMON: rm frame_parallel_decode

vp9_dx_iface.c still uses FrameWorkerData

BUG=webm:1395

Change-Id: Ica8e98ae776fc0105f1fbbed9e0a729808980810
2017-06-30 12:03:07 -07:00
James Zern
ba76b662af VP9Decoder: rm frame_parallel_decode
this has been 0 since the removal of frame_parallel_decode in
vp9_dx_iface.

BUG=webm:1395

Change-Id: I3f579766ecfa4777395b99686738e1c5610f86ef
2017-06-30 12:03:07 -07:00
James Zern
fb134e759a vp9: reduce FRAME_BUFFERS by 3
the additional buffers are unneeded with the removal of
frame_parallel_decode

BUG=webm:1395

Change-Id: Id9ec4cb6462af5d07a0d3cf939bd216db27d9d9e
2017-06-30 12:03:07 -07:00
James Zern
86d51dfbf5 vp9_dx: rm worker thread creation
creating a thread associated with the sole worker isn't necessary when
only execute() is being used after the removal of frame_parallel_decode.

BUG=webm:1395

Change-Id: I2255ce72607321e5708bc82a632dc6825d4eff5c
2017-06-30 12:03:07 -07:00
James Zern
469986f963 Merge changes from topic 'rm-dec-frame-parallel'
* changes:
  vp9_dx,vpx_codec_alg_priv: rm *worker_id*
  vp9_dx,vpx_codec_alg_priv: rm *cache*
  vp9_dx,vpx_codec_alg_priv: rm frame_parallel_decode
2017-06-30 19:02:05 +00:00
Johann
c2044fda1d buffer.h: use stride_ instead of stride()
Change-Id: Ib51231349bf0ff3e23672762dc7bfa49b5fe4083
2017-06-30 07:37:20 -07:00
Johann
ce5b17f9ad testing: ranges for random values
Add a method to acm_random.h to generate ranges of values

Add a way to call that method to buffer.h

Adjust dct_[partial_]test.cc to use it.

Change-Id: I8c23ae9d27612c28f050b0e44c41cb4ad2494086
2017-06-30 07:25:30 -07:00
Johann Koenig
89d3dc043e Merge changes Id5beb35d,I2945fe54,Ib0f3cfd6,I78a2eba8
* changes:
  partial fdct neon: add 32x32_1
  partial fdct neon: add 16x16_1
  partial fdct neon: add 4x4_1
  partial fdct neon: move 8x8_1 and enable hbd tests
2017-06-30 01:00:07 +00:00
Linfeng Zhang
c338f3635e Add vpx_highbd_idct8x8_{12, 64}_add_sse4_1
BUG=webm:1412

Change-Id: I5d038b4fa842ce2f6b9bd5c8c44c70647bda9591
2017-06-29 17:19:34 -07:00
Linfeng Zhang
ee5cb8d87f sse2: Add transpose_32bit_4x4x2() and update transpose_32bit_4x4()
BUG=webm:1412

Change-Id: I9d00d1ddbd724fd5f825fd974c4cf46a9bca6cb3
2017-06-29 17:18:01 -07:00
Linfeng Zhang
0fa59a4baf Refactor highbd idct 4x4 sse4.1 code and add highbd_inv_txfm_sse4.h
Also clean highbd_inv_txfm_sse2.h

BUG=webm:1412

Change-Id: I0722841d824ce602874019bd9779b10d49d10c0b
2017-06-29 17:17:43 -07:00
Linfeng Zhang
9ac78ae35f Refactor vpx_idct8x8_12_add_ssse3() and add inv_txfm_ssse3.h
BUG=webm:1412

Change-Id: I1f640db71ad4c644b7521305a781f2218eb1ba9d
2017-06-29 17:13:28 -07:00
James Zern
e3c8f2f152 vp9_dx,vpx_codec_alg_priv: rm *worker_id*
+ available_threads

these are unused with the removal of frame_parallel_decode

BUG=webm:1395

Change-Id: I59c5075542a5a74d4a539c213682f566b005f5a6
2017-06-29 16:21:50 -07:00
James Zern
dcdb013b55 vp9_dx,vpx_codec_alg_priv: rm *cache*
these fields are unused with the removal of frame_parallel_decode

BUG=webm:1395

Change-Id: Ia3821f7fb81d17b20033b094e5265b1030ee4030
2017-06-29 16:21:50 -07:00
James Zern
ab76f1f224 vp9_dx,vpx_codec_alg_priv: rm frame_parallel_decode
this field has been 0 since:
01d23109a vp9: make VPX_CODEC_USE_FRAME_THREADING a no-op

BUG=webm:1395

Change-Id: I15448e9401e15329b54c6878dda033b17be5ec6b
2017-06-29 16:21:50 -07:00
James Zern
67d7a6df2d Merge changes from topic 'rm-dec-frame-parallel'
* changes:
  rm vp9_frame_parallel_test.cc
  test_vector_test: rm ref to VPX_CODEC_USE_FRAME_THREADING
2017-06-29 23:21:18 +00:00
James Zern
e5bdab98e9 rm vp9_frame_parallel_test.cc
VPX_CODEC_USE_FRAME_THREADING was made a no-op in:
01d23109a vp9: make VPX_CODEC_USE_FRAME_THREADING a no-op

and the tests in this file have been disabled since:
6ab0870d4 disable VP9MultiThreadedFrameParallel tests

BUG=webm:1395

Change-Id: I2c7a250acb65cf9522cf8a7bb724bb92070e41c6
2017-06-29 15:15:56 -07:00
James Zern
508ef2a6e3 test_vector_test: rm ref to VPX_CODEC_USE_FRAME_THREADING
this was made a no-op in:
01d23109a vp9: make VPX_CODEC_USE_FRAME_THREADING a no-op

and the test hitting this branch has been disabled since:
6ab0870d4 disable VP9MultiThreadedFrameParallel tests

rename the test to VP9MultiThreaded to exercise the tile-based threading

BUG=webm:1395

Change-Id: I35564a75eb5a7d7f7ccb923133b1b07295201f4c
2017-06-29 15:15:48 -07:00
James Zern
8d1bda93f4 cosmetics,vp9/encoder: s/txm/txfm/
txfm is more commonly used as an abbreviation through the codebase

Change-Id: I86fd90ef132468f9da270091c05daa1f5a49ece2
2017-06-29 15:08:47 -07:00
James Zern
bd77931421 dct_partial_test,fwd_txfm: change << to *
left shift of a negative number is undefined in C; quiets a ubsan
warning

Change-Id: Ib1624ad5326ac8e0eead9348468ef7fe5d4df9a4
2017-06-29 14:42:03 -07:00
Jerome Jiang
74dc640565 vp9: Remove avg2x2 in skin detection and clean up.
Change-Id: I6510e36866138f8ac4cb82c207e58e0b9522e499
2017-06-29 03:06:23 +00:00
Johann
9fe510c12a partial fdct neon: add 32x32_1
Always return an int32_t. Since it needs to be moved to a register for
shifting, this doesn't really penalize the smaller transforms.

The values could potentially be summed and shifted in place.

BUG=webm:1424

Change-Id: Id5beb35d79c7574ebd99285fc4182788cf2bb972
2017-06-28 15:37:44 -07:00
Johann
f310ddc470 partial fdct neon: add 16x16_1
For the 8x8_1, the highbd output fit nicely in the existing function. 12
bit input will overflow this implementation of 16x16_1.

BUG=webm:1424

Change-Id: I2945fe5478b18f996f1a5de80110fa30f3f4e7ec
2017-06-28 15:37:44 -07:00
Johann
4959dd3eb3 partial fdct neon: add 4x4_1
BUG=webm:1424

Change-Id: Ib0f3cfd6116fc1f5a99acb8bfd76e25b90177ffc
2017-06-28 15:37:44 -07:00
Johann
cf75ab6ccd partial fdct neon: move 8x8_1 and enable hbd tests
The function was originally written with HBD in mind. Enable it and
configure the tests.

BUG=webm:1424

Change-Id: I78a2eba8d4d9d59db98a344ba0840d4a60ebe9a1
2017-06-28 15:37:43 -07:00
Johann Koenig
81e25512c3 Merge changes Ib454762d,I966650df,Ie126553e,I068f06c6,Icb72a94e
* changes:
  sad neon: rewrite 64x64 and add 64x32
  sad neon: rewrite 32x32, add 32x16 and 32x64
  sad neon: rewrite 16x8, 16x16, add 16x32
  sad neon: rewrite 8x8 and 8x16
  sad neon: rewrite 4x4 and add 4x8
2017-06-28 22:37:00 +00:00
Johann Koenig
d91af5f905 Merge "buffer.h: Only allow Init() to be called once." 2017-06-28 22:36:05 +00:00
Johann Koenig
35f8515c3f Merge "partial fdct test" 2017-06-28 22:34:53 +00:00
Johann
5ac88162b9 partial fdct test
Test the _1 variant of the fdct, which simply sums the block and applies
a modifying shift based on the block size.

BUG=webm:1424

Change-Id: Ic80d6008abba0c596b575fa0484d5b5855321468
2017-06-28 20:32:20 +00:00
Johann
ad011aaab8 sad neon: rewrite 64x64 and add 64x32
BUG=webm:1425

Change-Id: Ib454762d1c61b05a98324fe81ad58c9e09784717
2017-06-28 12:21:34 -07:00
Johann
77a648885c sad neon: rewrite 32x32, add 32x16 and 32x64
BUG=webm:1425

Change-Id: I966650df7e3face93e1e771634d1cc5458a35f85
2017-06-28 12:20:27 -07:00
Johann
469643757f sad neon: rewrite 16x8, 16x16, add 16x32
BUG=webm:1425

Change-Id: Ie126553e5fffcdfaf3d82a85b368ac10ce9ab082
2017-06-28 12:16:00 -07:00
Johann
e40e78be24 sad neon: rewrite 8x8 and 8x16
BUG=webm:1425

Change-Id: I068f06c67b841f09ea07c04ada0c2f1706102138
2017-06-28 12:15:57 -07:00
Johann
46d8660ce3 sad neon: rewrite 4x4 and add 4x8
The previous implementation loaded 8 values (discarding half)

BUG=webm:1425

Change-Id: Icb72a94e2557a4ee2db7091266ab58fd92f72158
2017-06-28 11:14:59 -07:00
Jerome Jiang
8582d33a0d Merge "vp9: compute skinmap only once before encoding." 2017-06-28 18:01:46 +00:00
Johann
e0330c4810 buffer.h: Only allow Init() to be called once.
Change-Id: I041c8b6f314802833c5287a176dbfeec9461b08e
2017-06-28 10:59:39 -07:00
Marco
88d11f473c vp9: Speed >= 8: Remove logic on reducing subpel.
Existing logic was only affecting resolutions above 720p.
Needs more testing for reducing subpel for speed >= 8.

No change on RTC metrics.

Change-Id: I2f4bf9f25891614aafa9a86aa5a5063a3ccfce4d
2017-06-27 20:27:02 -07:00
James Zern
515fed8f38 Merge "highbd_quantize_fp_32x32: normalize abs_qcoeff type" 2017-06-27 23:30:17 +00:00
Jerome Jiang
a220b931f5 vp9: compute skinmap only once before encoding.
This could save some cycles since skin detection is used in multiple
places in vp9.

1~2% speed up on ARM.

Change-Id: I86b731945f85215bbb0976021cd0f2040ff2687c
2017-06-27 16:16:02 -07:00
hui su
d4595de5db level tests: allow level undershoot
Obtaining a level that is lower than the target should be tolerated.

Change-Id: I90a55ee6d7142e9f6cc525ebbd1e0501defcbe28
2017-06-26 15:17:04 -07:00
Linfeng Zhang
0bb31a46a4 Update vpx_idct8x8_12_add_ssse3()
Change-Id: I0f38801c391db87ddae168602a786a062cd34b1d
2017-06-26 14:57:41 -07:00
Linfeng Zhang
39972d999d Merge "Update load_input_data() in x86" 2017-06-26 21:48:50 +00:00
Jerome Jiang
ddae8f7632 Merge "vp8: Clean up skinmap debugging codes." 2017-06-26 21:32:52 +00:00
Linfeng Zhang
a76b6b232c Update load_input_data() in x86
Split to load_input_data4() and load_input_data8().
Use pack with signed saturation instruction for high bitdepth.

Change-Id: Icda3e0129a6fdb4a51d1cafbdc652ae3a65f4e06
2017-06-26 13:38:33 -07:00
James Zern
f749905d0a roll libwebm snapshot
git log --no-merges --oneline 9732ae9..a97c484
9096786 mkvparser: fix float conversion warning
84e8257 disable -Wdeprecated-declarations in legacy code
a98f495 AddGenericFrame: fix memory leak on failure
da131dd AddCuePoint: fix memory leak on failure
b0cea9c Add(Audio|Video)Track: fix memory leak on failure
5261a67 webm_info: check vp9 ParseUncompressedHeader return
85f7e2e webm_info,PrintVP9Info: validate alt ref sizes
9b97ca1 vp9_header_parser_tests: check parser return
300d6d8 CuePoint::Find: check Track pointer
50c44bb webm_info,OutputCues: fix indexing of tracks
a0d27f0 mkvparser,Block::Parse: remove incorrect assert
784fc1b vttdemux,CloseFiles: check file pointer before closing
b4522c1 .gitattributes: force mkv/webm to be treated as binary
a118f3d Add test for projection parse failures.
d398479 Add test for primary chromaticity parse failures.
9bbec4c Fix permissions on test file.
2cef4d5 mkvparser:Parse: s/FLT_MIN/-FLT_MAX/
35a3c88 mkvmuxer: Turn off estimate_file_duration_ by default
5a41830 mkvparser: Avoid double free when Chromaticity parse fails.
67e3ffa mkvparser: Avoid casts of values too large for float in
Projection elements.
87bcddf vttdemux::ChapterAtomParser: check for NULL display string
a534a24 Update .gitignore
a0d67d0 mkvmuxer: Fix hard-coded data size in EbmlElementSize
c36112c mkvparser: #include sys/type.h
686664e Fix cmake generation warnings on Windows.
2b2c196 cmake: Fix required flag check.
166e40f Cmake refactor.
9fb774a Add missing include in webm2pes.cc.
4956b2d mkvmuxer: Force new clusters when audio queue gets too long.
54f1559 cmake: Cache results of CXX flag tests.
81c73fc mkvparser: Avoid alloc failures in SeekHead::Parse.

Change-Id: Ib81b1772ec81e7af3852dcfef2d312416f6db53d
2017-06-26 18:38:47 +00:00
Linfeng Zhang
ec4afbf74a Merge "Add vpx_highbd_idct4x4_16_add_sse4_1()" 2017-06-24 01:15:14 +00:00
Urvang Joshi
30eeb4dc32 Merge "Enable greedy version of optimize_b() in VP9 by default." 2017-06-24 00:58:24 +00:00
Linfeng Zhang
6ff5de68dd Merge "Cosmetics, 8x8 idct SSE2 optimization" 2017-06-24 00:51:08 +00:00
Urvang Joshi
4bb99ee27e Enable greedy version of optimize_b() in VP9 by default.
Improvements were already mentioned in the previous patch:
https://chromium-review.googlesource.com/#/c/531675/

Change-Id: I4906ab1c61c25a815bdeb986016fad6dcb69eb71
2017-06-23 17:04:58 -07:00
James Zern
ee1fcb0e69 Merge "variance_test: move Subpel* from tuples to TestParams" 2017-06-23 22:48:40 +00:00
Marco Paniconi
8ad23a072a Merge "vp9: Use scene detection for CBR mode." 2017-06-23 21:59:32 +00:00
Linfeng Zhang
8253a27904 Add vpx_highbd_idct4x4_16_add_sse4_1()
BUG=webm:1412

Change-Id: Ie33482409351a01be4e89466b0441834eb1e905a
2017-06-23 14:30:12 -07:00
Linfeng Zhang
b8a4b5dd8d Cosmetics, 8x8 idct SSE2 optimization
Change-Id: Id21fa94fd323e36cd19a2d890bf4a0cafb7d964d
2017-06-23 14:30:12 -07:00
Jerome Jiang
b0c4d87ac7 vp8: Clean up skinmap debugging codes.
Use the computed skinmap.

Change-Id: I8aabb5922ef5190ec85b9e01807cb79b4803b925
2017-06-23 14:05:33 -07:00
James Zern
0d1c782306 Merge "datarate_test: rename thread -> Thread in test name" 2017-06-23 20:00:51 +00:00
James Zern
54bcd98314 variance_test: move Subpel* from tuples to TestParams
this normalizes these tests with the regular variance ones both in
implementation and test list output

Change-Id: I387aea81456f94b8223b8fb2a28cab94bc1aa9d5
2017-06-23 12:54:18 -07:00
Marco
18805eee6c vp9: Use scene detection for CBR mode.
Use the scene detection for CBR mode, and use it to reset the
rate control if large source sad is detected and rate
correctioni fact/QP is at minimum state.

Avoids large frame sizes after big content change following
low content period.

Only affects CBR mode for 1 pass at speeds 5, 6, 7.
Change-Id: I56dd853478cd5849b32db776e9221e258998d874
2017-06-23 11:44:50 -07:00
Jerome Jiang
e187b27438 Merge "vp8: Compute skinmap only once before encoding." 2017-06-23 17:17:02 +00:00
James Zern
88a302e743 Merge changes from topic 'missing-proto'
* changes:
  onyxd_int.h: add missing prototypes
  onyxd.h: add vp8dx_references_buffer prototype
  vp[89],vpx_dsp: add missing includes
  vp8,encodeframe.h: correct prototypes
  vp8: add temporal_filter.h
  add picklpf.h
  add ethreading.h
  vp8,bitstream.h: add missing prototypes
  vp8: remove vp8_fast_quantize_b_mmx
  vp8,loopfilter_filters: make some functions static
  vp9_ratectrl: make adjust_gf_boost_lag_one_pass_vbr static
  vp9_encodeframe: make scale_part_thresh_sumdiff static
  vp9_alt_ref_aq: correct vp9_alt_ref_aq_create proto
  tiny_ssim: make some functions static
2017-06-23 05:44:24 +00:00
James Zern
a377f99088 onyxd_int.h: add missing prototypes
vp8cx_init_de_quantizer, vp8_mb_init_dequantizer
quiets -Wmissing-prototypes

Change-Id: Ib63d14caf0144eff31a75b7cdb667b7e1f9d83ae
2017-06-22 20:20:23 -07:00
Johann Koenig
794a5ad713 Merge "fdct32x32 neon implementation" 2017-06-23 01:58:00 +00:00
Jerome Jiang
b28fc490aa vp8: Compute skinmap only once before encoding.
Get ready for other uses (i.e. cyclic refresh).
Then use it when needed.

Change-Id: Id0519a9921045e5fb7f3badb54e9f04e903f28f9
2017-06-22 17:12:15 -07:00
Marco Paniconi
4f917912b9 Merge "vp9: Add high source sad to content state." 2017-06-22 22:18:48 +00:00
Linfeng Zhang
c5f9de573f Merge changes I783c5f4f,I365f8e53,I5dac0e98
* changes:
  Clean vpx_idct16x16_256_add_sse2()
  Update vpx_idct{8x8,16x16,32x32}_1_add_sse2()
  Clean 32x32 full idct sse2 and ssse3 code
2017-06-22 21:42:23 +00:00
Paul Wilkins
92145006c3 Merge "Fix int overflow in rate control for high bit rates." 2017-06-22 16:30:40 +00:00
Johann
e67660cf37 fdct32x32 neon implementation
Almost 3x faster in constrained loop testing. Over 10x faster in HBD
builds.

BUG=webm:1424

Change-Id: I2b7f8453e1d4ada63cde729d8115d684c4a71ff9
2017-06-22 06:40:17 -07:00
paulwilkins
efe1982e63 Fix int overflow in rate control for high bit rates.
Fix misplaced cast that caused an overflow and incorrect rate adaptation
behavior for high data rates. This in particular will have affected 4k encodes
but could also have come into play for some higher rate 1080p cases.

In our standard test sets the quality impact is small though several high rate
clips show improved rate accuracy. This can also impact the number of recode
loop hits and on one problem 4k  clip the encode time for speeds 0 and 1 was
reduced by >25%

Change-Id: I108da7ca42f3bc95c5825dd33c9d84583227dac1
2017-06-22 10:34:21 +01:00
Marco
d7515b1187 vp9: Add high source sad to content state.
Use it to limit NEWMV early exit in nonrd pickmode

Small change in RTC metrics, has some improvement
for high motion clips.
Change-Id: I1d89fd955e1b3486d5fb07f4472eeeecd553f67f
2017-06-21 20:57:17 -07:00
Marco Paniconi
33a9394eb1 Merge "vp9: Adjustments for aq-mode and pickmode for speed >= 8." 2017-06-22 03:27:47 +00:00
James Zern
dd88bd87db datarate_test: rename thread -> Thread in test name
this is consistent with other threaded tests and ensures gtest_filters
meant to operate on these pick them up

Change-Id: I99ce53720553a22c4b9905a2882273c2be2c031b
2017-06-21 20:05:31 -07:00
James Zern
828a1fa6de Merge "vp8_dx_iface: clear -Wclobbered warnings" 2017-06-22 02:01:11 +00:00
James Zern
7c0788b07f onyxd.h: add vp8dx_references_buffer prototype
quiets -Wmissing-prototypes

Change-Id: I6bee535f3fb67e54a390266d787a5a92127aeadc
2017-06-21 19:00:15 -07:00
James Zern
44418c659f vp[89],vpx_dsp: add missing includes
quiets -Wmissing-prototypes

Change-Id: I841cfc019d592f2bc6b3fec5818051a31f4c53b5
2017-06-21 19:00:15 -07:00
James Zern
b24ed95f44 vp8,encodeframe.h: correct prototypes
+ add missing include
quiets -Wmissing-prototypes

Change-Id: I64af0368ba3d7f1d4de22a5887b631bb2cf15b8a
2017-06-21 19:00:15 -07:00
James Zern
b093d998fc vp8: add temporal_filter.h
quiets -Wmissing-prototypes

Change-Id: Iffa77467720affe030de5335e9335232b9e70af1
2017-06-21 19:00:15 -07:00
James Zern
eb8226b903 add picklpf.h
quiets -Wmissing-prototypes

Change-Id: Ic24164aa1f86fe99a493a633d64606e6f44ecdc1
2017-06-21 19:00:14 -07:00
James Zern
864bc77e7a add ethreading.h
quiets -Wmissing-prototypes in encodeframe.c

Change-Id: Ic216d0bdd6130eac44f2183639a715b2f1088ebe
2017-06-21 19:00:14 -07:00
James Zern
d5d6a609d0 vp8,bitstream.h: add missing prototypes
quiets -Wmissing:prototypes

Change-Id: I835a80eddca2b16280780e18558c321df3272c43
2017-06-21 19:00:14 -07:00
James Zern
1d86383512 vp8: remove vp8_fast_quantize_b_mmx
and vp8_fast_quantize_b_impl_mmx; this was never enabled in rtcd
an sse2 version exists so there isn't much reason to keep a mmx
implementation around.

Change-Id: I8b3ee7f46ba194ffa0d0a6225a0f299f2a4dea90
2017-06-21 19:00:14 -07:00
James Zern
18335f193d vp8,loopfilter_filters: make some functions static
quiets -Wmissing-prototypes

Change-Id: Ie5b00537f64a05e68a38dc558463691523988994
2017-06-21 19:00:14 -07:00
James Zern
07f847873b vp9_ratectrl: make adjust_gf_boost_lag_one_pass_vbr static
quiets -Wmissing-prototypes

Change-Id: I72d899c2d8de1ddc52d90ac081f2629374b3a6e9
2017-06-21 19:00:14 -07:00
James Zern
9a329b5285 vp9_encodeframe: make scale_part_thresh_sumdiff static
quiets -Wmissing-prototypes

Change-Id: I696223d75860edba13c6b6f38c1f8db353a6f812
2017-06-21 19:00:14 -07:00
James Zern
3f296533f6 vp9_alt_ref_aq: correct vp9_alt_ref_aq_create proto
quiets -Wmissing-prototypes

Change-Id: Ib2d4f294f1982739bb2ac98155e789e040d309a1
2017-06-21 19:00:04 -07:00
James Zern
9e1d2de67c highbd_quantize_fp_32x32: normalize abs_qcoeff type
use an int to quiet an unsigned rollover warning similar to:
25110f283 Fix an ubsan warning: vp9_quantizer.c

Change-Id: Iedecb79a17249bc18f10c0920f88cf704920f12b
2017-06-21 18:56:10 -07:00
Marco
21afafa31a vp9: Put skin detection usage around cpi flag.
Skin detection usage in choose_partitioning should be
around the cpi->use_skin_detection.

Change-Id: I6986179af9ce94c60c0974d66c311fc07cc04cfe
2017-06-21 17:32:56 -07:00
Marco
8cf6f78fce vp9: Adjustments for aq-mode and pickmode for speed >= 8.
Adjust the threshold for turning off cyclic refresh for high motion,
and avoid testing golden in nonrd pickmode for speed >= 8 if
golden refresh was long ago.

No change/neutral on RTC metrics.
Change-Id: I40959b8d9637f3553e7458bbabd8c6024c2c09c0
2017-06-21 16:01:24 -07:00
James Zern
fbba31e241 vp8_dx_iface: clear -Wclobbered warnings
with gcc 6.x

Change-Id: Ib2070421603a6777892d4ea01f4b0921696f38b3
2017-06-21 15:09:58 -07:00
Johann Koenig
355432b0d2 Merge "dct tests: align InvAccuracyCheck buffers" 2017-06-21 21:16:23 +00:00
Linfeng Zhang
466b667ff3 Clean vpx_idct16x16_256_add_sse2()
Remove macro IDCT16 which is redundant with idct16_8col().

Change-Id: I783c5f4fda038a22d5ee5c2b22e8c2cdfb38432c
2017-06-21 13:47:15 -07:00
Linfeng Zhang
42522ce0b7 Update vpx_idct{8x8,16x16,32x32}_1_add_sse2()
Change-Id: I365f8e53d9ccd028cef0f561d4de9e5916278609
2017-06-21 13:47:05 -07:00
Linfeng Zhang
2b43a1ee18 Clean 32x32 full idct sse2 and ssse3 code
vpx_idct32x32_1024_add_ssse3() is actually a sse2 function and faster
than vpx_idct32x32_1024_add_sse2(). Replace the slow one. All are
code relocations, no new code.

Change-Id: I5dac0e98cc411a4ce05660406921118986638d19
2017-06-21 13:46:49 -07:00
Hui Su
96ec8a425b Merge "VP9 level targeting: properly handle max_gf_interval" 2017-06-21 20:38:45 +00:00
Johann
1c48915233 dct tests: align InvAccuracyCheck buffers
'in' is used for the reference fdct. 'coeff' is input to the idct being
tested and 'dst[16]' is output

Fixes a segfault on unaligned memory access on x86.

Change-Id: I3691b1380ed49986897dd89a63ce63a80a0e0962
2017-06-21 11:47:00 -07:00
James Zern
0aa3677d9d fix build, rm ref to vpx_idct8x8_64_add_ssse3
this was deleted in:
98967645a Remove vpx_idct8x8_64_add_ssse3()

but this was merged in:
9e03eedf6 Merge changes Ib26dd515,Ie60dabc3

after:
a92991133 Merge "dct tests: run all possible sizes in one test"

which added a new reference

Change-Id: I8da4a6c80d27b237a378ff15eead1daab89e7e25
2017-06-20 19:46:45 -07:00
Linfeng Zhang
9e03eedf62 Merge changes Ib26dd515,Ie60dabc3
* changes:
  Clean 8x8 idct x86 optimization
  Remove vpx_idct8x8_64_add_ssse3()
2017-06-21 00:38:25 +00:00
hui su
d96ed96c0f VP9 level targeting: properly handle max_gf_interval
Don't overide max_gf_interval if it's not specified. It will
be assigned with a default value in vp9_rc_set_gf_interval_range().

BUG=b/62803416

Change-Id: Ide46ce00279ed076865fc54ce98c55a994f0c798
2017-06-20 16:29:04 -07:00
Marco
492d52b9cc vp9: Adjust key-frame pars in vpx_temporal_svc_encoder.
Sample encoder change: reduce max-intra-rate to 1000 and
buf-initial to 600. Paramaters affect target size of key frame.

Change-Id: I2be6bc2927f5fa74e19e1efa3fb574d23a503300
2017-06-20 12:22:03 -07:00
Marco
ae3a173352 vp9: Adjust key-frame pars in vpx_temporal_svc_encoder.
Sample encoder change: reduce max-intra-rate to 1500 and
buf-initial to 700. Paramaters affect target size of key frame.

Change-Id: I01e238378b63eeef28dfc2178baadffcd3cc7561
2017-06-20 09:08:13 -07:00
Johann Koenig
a929911339 Merge "dct tests: run all possible sizes in one test" 2017-06-20 15:04:25 +00:00
Marco Paniconi
737aa5c9e4 Merge "vp9: SVC: Rework the usage of base_mv for SVC." 2017-06-20 03:08:32 +00:00
Marco
b55240057f vp9: Adjust key-frame pars in vpx_temporal_svc_encoder.
Adjust some parameters in sample encoder: vpx_temporal_svc_encoder.
Parameters adjusted to set lower QP for initial key frame,
and allow for larger target size on subsequent key frames.

Change-Id: I092ad968e5b51b9f495dadb6ee96e810663c910e
2017-06-19 18:29:39 -07:00
Marco Paniconi
782aacc3d3 Merge "vp9: Speed >= 8: Adjust resolution threshold for subpel." 2017-06-19 23:45:35 +00:00
Johann
4ebb9a36f1 dct tests: run all possible sizes in one test
Modify fdct4x4_test.cc to support all size combinations. This does not
add any new tests and in fact fails a few. There were minimal changes
made to the tests so it's not entirely surprising that some of the
larger 12 bit transforms are failing since it was initially only used
for 4x4.

In follow up patches the tests in fdct8x8_test.cc, dct16x16_test.cc and
dct32x32_test.cc will be evaluated and moved to dct_test.cc.

BUG=webm:1424

Change-Id: I72a23430f457d7fae8c91e706adc0e77c25abc8f
2017-06-19 15:39:35 -07:00
James Zern
ed56ddfef8 Merge "libs.mk: retry partial testdata download" 2017-06-19 22:15:06 +00:00
James Zern
ada640a508 libs.mk: retry partial testdata download
attempt retry on transient failures uncaught by --retry

Change-Id: I7cd8846ff88daf0f521af9ee182e30bfd79f51f3
2017-06-19 14:40:39 -07:00
Marco
ff7fb4b280 vp9: Speed >= 8: Adjust resolution threshold for subpel.
Get some quality gain on RTC metrics (~7%), with
~5-8% speed slowdown.

Change-Id: I0d02942a77074424ee0326b6e110ddff09f2df5e
2017-06-19 13:58:08 -07:00
Jerome Jiang
bf41a982b4 Merge "Enable 8x8 skin detection for vp8." 2017-06-19 16:42:14 +00:00
Marco
112cd95507 vp9: SVC: Rework the usage of base_mv for SVC.
Set the base_mv_aggressive for temporal enhancement layers (TL > 0).
Under the aggressive mode, skip the NEWMV depending on the
SSE of the base_mv. Also reduce the subpel motion to 1/2 under
aggressive mode if base_mv is good.

Speedup ~3% with small/negligible loss in quality on RTC.
Affects speed >= 6.

Change-Id: I89341b279cad6da2a04b76d5e726016191dacdb8
2017-06-18 22:35:46 -07:00
James Zern
31d6ba9a54 tiny_ssim: make some functions static
quiets -Wmissing-prototypes

Change-Id: If2e77c921b2fba456ed8d94119773e360d90b878
2017-06-16 15:36:32 -07:00
James Zern
038522e4a0 Merge "configure: test for -Wparentheses-equality" 2017-06-16 20:07:52 +00:00
Jerome Jiang
a36017e007 Enable 8x8 skin detection for vp8.
If 2 or more 8x8 blocks are identified as skin, the macroblock will be
labeled as skin.

Change-Id: I596542c81a2df9e96270cab39d920bbfeb02bc6e
2017-06-15 20:53:03 -07:00
James Zern
27c2185954 configure: test for -Wparentheses-equality
Change-Id: I36de79c58461907deaea70d6131da9119bc0bc69
2017-06-15 16:05:20 -07:00
Linfeng Zhang
c7e4917e97 Clean 8x8 idct x86 optimization
Create load_buffer_8x8() and write_buffer_8x8().

Change-Id: Ib26dd515d734a5402971c91de336ab481b213fdf
2017-06-15 14:30:00 -07:00
Linfeng Zhang
98967645a1 Remove vpx_idct8x8_64_add_ssse3()
It's almost identical with vpx_idct8x8_64_add_sse2(), except little
difference in instructions order.

Change-Id: Ie60dabc35eaa6ebae7c755e6cff00a710aad284f
2017-06-15 14:09:33 -07:00
Urvang Joshi
a4ea7e131b VP9: Add greedy version of av1_optimize_b().
This was ported from the greedy version in AV1, written by Dake He
(dkhe@google.com).
See:
https://aomedia.googlesource.com/aom/+/master/av1/encoder/encodemb.c#137

Greedy version is disabled by default, but can be picked by setting
USE_GREEDY_OPTIMIZE_B to 1.
To be enabled by default later.

This is both faster and better in terms of compression.

Compression Improvement:
------------------------
lowres: -0.119
midres: -0.064
hdres:  -0.405

Speed Improvement:
------------------
(Based on encode time of 3 videos of different difficulties at
3 different target bitrates)
With --cpu-used=0: 0.38% to 5.55% faster
With --cpu-used=1: 0.24% to 2.79% faster
With --cpu-used=2: 0.29% to 1.46% faster

Change-Id: Ia7a23b3b244ad8eb253ac9e43cd03c5e021d2635
2017-06-15 11:19:08 -07:00
Linfeng Zhang
8d391a111a Merge changes Ibf9d120b,I341399ec,Iaa5dd63b,Id59865fd
* changes:
  Update high bitdepth load_input_data() in x86
  Clean array_transpose_{4X8,16x16,16x16_2) in x86
  Remove array_transpose_8x8() in x86
  Convert 8x8 idct x86 macros to inline functions
2017-06-15 17:57:50 +00:00
Marco Paniconi
8b48f68c0d Merge "vp8: Adjust the pred_err threhsold for drop on overshoot." 2017-06-14 15:59:55 +00:00
Linfeng Zhang
6da6a23291 Update high bitdepth load_input_data() in x86
BUG=webm:1412

Change-Id: Ibf9d120b80c7d3a7637e79e123cf2f0aae6dd78c
2017-06-13 16:53:53 -07:00
Linfeng Zhang
d6eeef9ee6 Clean array_transpose_{4X8,16x16,16x16_2) in x86
Change-Id: I341399ecbde37065375ea7e63511a26bfc285ea0
2017-06-13 16:50:44 -07:00
Linfeng Zhang
9c72e85e4c Remove array_transpose_8x8() in x86
Duplicate of transpose_16bit_8x8()

Change-Id: Iaa5dd63b5cccb044974a65af22c90e13418e311f
2017-06-13 16:50:44 -07:00
Linfeng Zhang
cbb991b6b8 Convert 8x8 idct x86 macros to inline functions
Change-Id: Id59865fd6c453a24121ce7160048d67875fc67ce
2017-06-13 16:50:43 -07:00
James Zern
4f9d852759 vp8_skin_detection: add 'vp8_' prefix to public fns
BUG=webm:1438

Change-Id: I5feb31c254d02e116e624cfe702e73ba5a1f7aca
2017-06-12 20:13:28 -07:00
James Zern
98666368ee rename vp8/common/skin_detection.[hc] -> vp8_*
some build systems have trouble with duplicate basenames.
vpx_dsp/skin_detection.[hc] were added in:
658e85425 Merge skin detection code in vp8/9.

BUG=webm:1438

Change-Id: Ieaa70b40bda409ec23e6d179b47a930ac6243b05
2017-06-12 20:13:23 -07:00
Marco
b6e1bdfc76 vp8: Adjust the pred_err threhsold for drop on overshoot.
Change-Id: Ica2a09ac87160936b6f7bd01f167f464ea3ac41c
2017-06-12 09:54:16 -07:00
Hui Su
21e1661b54 Merge "vp9 level targeting: more strict constraint on min_gf_interval" 2017-06-12 16:38:02 +00:00
Jerome Jiang
a46bc0268b Merge "Remove duplication on vp8/9_write_yuv_frame." 2017-06-10 04:50:19 +00:00
Marco
e540ca7155 vp9: SVC: Use prune_evenemore only for non_reference.
Set subpel prune_evenmore only for non_reference frames,
instead of all TL > 0 frames. Gain some quality back at
cost of small speed loss (~1-2%).

Change only effects SVC encoding at speed >= 7.

Change-Id: I5b9f51e51dccfd7050521a66996176b0415ca3f9
2017-06-09 17:52:20 -07:00
Jerome Jiang
ff2d220d21 Remove duplication on vp8/9_write_yuv_frame.
Change-Id: Ib3546032a27c715bf509c0e24d26a189bc829da8
2017-06-09 17:08:26 -07:00
Johann Koenig
6dcd9b37ea Merge "idct_test: don't use std::nothrow anymore" 2017-06-09 20:42:39 +00:00
Johann Koenig
8aa4ee1f10 Merge "buffer.h: allow declaring an alignment" 2017-06-09 20:42:21 +00:00
Johann Koenig
65f4299d65 Merge "Remove some dead code. Coverity CID 1310058" 2017-06-09 20:41:57 +00:00
Johann
92373a5bb2 idct_test: don't use std::nothrow anymore
But still check for NULL before calling Init()

Change-Id: I2bf2887e1064c9103d29c542d20365c0aea75d76
2017-06-09 11:09:06 -07:00
Johann
5aee8ea752 buffer.h: allow declaring an alignment
x86 simd register operations generally prefer and may require 16 byte
alignment.

Change-Id: I73ce577a90dc66af60743c5727c36f23200950ba
2017-06-09 11:03:15 -07:00
Sylvestre Ledru
c12d1d9b98 Remove some dead code. Coverity CID 1310058
Change-Id: I1186cf1dd8cde42f5970928f43edfc852298289d
2017-06-09 17:56:38 +00:00
James Zern
b3a262dff3 Merge "vp8_decode_frame: fix oob read on truncated key frame" 2017-06-08 23:17:50 +00:00
James Zern
45daecb4f7 vp8_decode_frame: fix oob read on truncated key frame
the check for error correction being disabled was overriding the data
length checks. this avoids returning incorrect information (width /
height) for the decoded frame which could result in inconsistent sizes
returned in to an application causing it to read beyond the bounds of
the frame allocation.

BUG=webm:1443
BUG=b/62458770

Change-Id: I063459674e01b57c0990cb29372e0eb9a1fbf342
2017-06-08 23:16:04 +00:00
Johann
e50ea014c3 Revert "buffer.h: use size_t"
This reverts commit f08581c1d010ea95b8cfae686b5c0a64b32519f9.

type conversion warnings abound.

Change-Id: I41d4c0e7a388e1008bdbc55fefda4bbca3f89f00
2017-06-08 10:20:21 -07:00
Jerome Jiang
943f9ee25c Merge "Merge skin detection code in vp8/9." 2017-06-08 16:36:00 +00:00
Johann Koenig
903375a48a Merge "fdct16x16 neon optimization" 2017-06-08 15:19:36 +00:00
Jerome Jiang
658e854252 Merge skin detection code in vp8/9.
BUG=webm:1438

Change-Id: Ie3dc034c7dbb498a0b088a767b1936ddeed4df14
2017-06-07 21:20:34 -07:00
hui su
21d2273efa vp9 level targeting: more strict constraint on min_gf_interval
min_gf_interval should be no less than min_altref_distance + 1,
as the encoder may produce bitstream with alt-ref distance being
min_gf_interval - 1.

BUG=b/38450599

Change-Id: Ifb733daa643ebc668d1b23e1ce92db94b66dabe8
2017-06-07 17:40:25 -07:00
Johann
eae7cf2368 fdct16x16 neon optimization
Roughly 2x speedup. Since the only change for HBD is to store(), the
improvement appears to hold there as well.

BUG=webm:1424

Change-Id: I15b813d50deb2e47b49a6b0705945de748e83c19
2017-06-07 14:59:55 -07:00
Marco Paniconi
9cea3a3c4e Merge "vp9: SVC: Enable simple_block_yrd for temporal layers." 2017-06-07 21:12:14 +00:00
Johann Koenig
0c4f74d129 Merge changes Iade45f69,I18d90658,Ieca3f1ef
* changes:
  buffer.h: add num_elements_
  buffer.h: zero-init all values
  buffer.h: use size_t
2017-06-07 19:20:16 +00:00
Marco
14d4718043 vp9: SVC: Enable simple_block_yrd for temporal layers.
Enable simple_block_yrd for temporal enhancement layers (TL > 0).
And remove block size condiiton for SVC mode.
Only affects speed >= 7 SVC.

Speedup ~3-4%.
avgPSNR regression on RTC for (3 spatial, 3 temporal) layers: ~1%.

Change-Id: Iff4fc191623b71c69cd373e7c0823385e7ac67ed
2017-06-07 11:41:50 -07:00
Johann
902d63759e buffer.h: add num_elements_
raw_size_ was being incorrectly computed and used

Change-Id: Iade45f69964c567ffb258880f26006a96ae5a30d
2017-06-07 11:31:20 -07:00
Johann
4a37e3e2a0 buffer.h: zero-init all values
Change-Id: I18d90658bcd4365d49adcadd6954090b3b399aa8
2017-06-07 11:27:26 -07:00
Johann
f08581c1d0 buffer.h: use size_t
Change-Id: Ieca3f1ef23cd1d7b844ea3ecb054007ed280b04f
2017-06-07 11:24:27 -07:00
Marco
13b02a8efe vp9: SVC: Enable row-mt in sample encoder.
Change-Id: I4b51043cb3f5955efe947fe4685aed4a21adb8bd
2017-06-07 10:32:44 -07:00
James Zern
ff42e04f9c Merge "ppc: Add vpx_sadnxmx4d_vsx for n,m = {8, 16, 32 ,64}" 2017-06-06 23:52:39 +00:00
Marco Paniconi
27b34a109d Merge "vp9: SVC: Adjust some speed settings for SVC speed >= 7." 2017-06-06 23:07:45 +00:00
Marco
7d2f5f8e9d vp9: SVC: Adjust some speed settings for SVC speed >= 7.
Keep the 1/4subpel for all frames, use SUBPEL_TREE_PRUNED_EVENMORE
for all temporal enhancement layer frames.

Change-Id: Ibc681acbb6fc75b7b3c57fc483fcb11d591dfc9a
2017-06-06 15:30:24 -07:00
Johann
de4cb716ee buffer.h: split out init
Change-Id: Idfbd2e01714ca9d00525c5aeba78678b43fb0287
2017-06-06 15:02:50 -07:00
Johann
8659764a07 buffer.h: Use T for values
Change-Id: I2da4110e843b6e361028b921c24b6ca2ea9077d9
2017-06-06 12:05:14 -07:00
Jerome Jiang
cf07d85809 Initialize cost_list all to INT_MAX.
It is initialized to be { INT_MAX, 0, ... } in ffe0f9b.
No effect on encoders.
Make it consistent with other initializations.

BUG=webm:1440

Change-Id: Ie2a180d93626b55914c8c4255e466a1986d2b922
2017-06-06 10:42:37 -07:00
James Zern
6df142e2ab vp9_mcomp,get_cost_surf_min: quiet conversion warning
visual studio will warn if a 32-bit shift is implicitly converted to 64.
in this case integer storage is enough for the result.
since:
f3a9ae5ba Fix ubsan failure in vp9_mcomp.c.

Change-Id: I7e0e199ef8d3c64e07b780c8905da8c53c1d09fc
2017-06-05 22:52:58 -07:00
Jerome Jiang
968a5d6bc2 Merge "Fix valgrind failure on uninitialized variables." 2017-06-06 03:47:31 +00:00
James Zern
4753c23983 Merge "ppc: Add vpx_sad64/32/16x64/32/16_avg_vsx" 2017-06-06 02:19:41 +00:00
Jerome Jiang
ffe0f9b7fb Fix valgrind failure on uninitialized variables.
BUG=webm:1440

Change-Id: I7074e42bdfa8dd25f11bbb3f2ab1b41d6f4c12e4
2017-06-05 13:09:29 -07:00
Jerome Jiang
f3a9ae5baa Fix ubsan failure in vp9_mcomp.c.
Change-Id: Iff1dea1fe9d4ea1d3fc95ea736ddf12f30e6f48d
2017-06-02 21:37:13 -07:00
Marco
e30781ff80 vp9: SVC: Force subpel search off under certain conditions.
For SVC 1 pass non-rd mode:
Force subpel seach off for SVC for non-reference frames
under motion threshold.

Add flag to svc context to indicate if the frame is not used
as a reference.

Little/no quaity loss, ~2% speedup.

Change-Id: Ic433c44b514d19d08b28f80ff05231dc943b28e9
2017-06-01 20:48:52 -07:00
Marco Paniconi
ff637d1903 Merge "vp9: Speed >8: Set subpel_search_method for low motion." 2017-06-01 23:57:19 +00:00
Marco
8c6fa5c5e3 vp9: Speed >8: Set subpel_search_method for low motion.
Speed >=8: for resolutions above CIF, and for low motion content,
set subpel_search_method to SUBPEL_TREE_PRUNED_EVENMORE.

Small speed gain (~2%) on vga clips,
RTC metrics up by ~2-3% on average.

Change-Id: Ie26ba0264589652f92dfe74308740debf94cf0cc
2017-06-01 16:16:13 -07:00
Jerome Jiang
68f035026f vp8 skin detection: Fix visual studio build failure.
Change-Id: I510b755550ebbfa2aaf9b974920d7f1c6454a845
2017-06-01 13:46:46 -07:00
Jerome Jiang
e254969df2 Fix corruption in skin map debugging output yuv.
For both vp8 and vp9.

BUG=webm:1437

Change-Id: Ifd06f68a876ade91cc2cc27c574c4641b77cce28
2017-06-01 16:59:43 +00:00
Jerome Jiang
f1a300acc4 vp8: Clean up skin detection.
Use only the average of center 2x2 pixels in vp8.

Change-Id: I2b23ff19a90827226273e0fca49e90c734eda59b
2017-05-31 14:57:10 -07:00
Johann Koenig
755b3daf90 Merge "comp_avg_pred neon: used by sub pixel avg variance" 2017-05-31 18:17:28 +00:00
Jerome Jiang
32d8992147 Merge "Write skin map of vp8 skin detection for debug." 2017-05-31 16:37:07 +00:00
Linfeng Zhang
30ea3ef283 Merge "Update vpx_highbd_idct4x4_16_add_sse2()" 2017-05-31 15:56:20 +00:00
Johann
f695b30ac2 comp_avg_pred neon: used by sub pixel avg variance
BUG=webm:1423

Change-Id: I33de537f238f58f89b7a6c1c2d6e8110de4b8804
2017-05-30 22:47:34 +00:00
Jerome Jiang
c39526da8a Write skin map of vp8 skin detection for debug.
Change-Id: Ica1b4e918aa759cd0ce65920f9d88452bbf9e3b4
2017-05-30 10:30:05 -07:00
Linfeng Zhang
45048dc9dc Update vpx_highbd_idct4x4_16_add_sse2()
BUG=webm:1412

Change-Id: I26e4b34ae9bc1ae80c24f56d740d737a95f1ab84
2017-05-30 09:25:30 -07:00
Johann Koenig
b9649d2407 Merge "comp_avg_pred: alignment" 2017-05-30 16:21:05 +00:00
Johann Koenig
48c0e13286 Merge "remove DECLARE_ALIGNED from neon code" 2017-05-30 15:58:17 +00:00
Johann
ea8b4a450d comp_avg_pred: alignment
x86 requires 16 byte alignment for some vector loads/stores.

arm does not have the same requirement.

The asserts are still in avg_pred_sse2.c. This just removes them from
the common code.

Change-Id: Ic5175c607a94d2abf0b80d431c4e30c8a6f731b6
2017-05-30 07:46:43 -07:00
Jerome Jiang
a5ab38093f Merge "Fix vp8 race when build --enable-vp9-highbitdepth." 2017-05-30 05:47:44 +00:00
Johann
42ce25821d remove DECLARE_ALIGNED from neon code
Unlike x86 neon only requires type alignment when loading into vectors.

Change-Id: I7bbbe4d51f78776e499ce137578d8c0effdbc02f
2017-05-26 10:41:57 -07:00
Johann Koenig
2693b89c19 Merge "subpel variance neon: reduce stack usage" 2017-05-26 17:25:47 +00:00
Johann Koenig
47174d60c8 Merge "Use vdup instead of vmov" 2017-05-26 17:25:24 +00:00
Jerome Jiang
0afa2dad76 Fix vp8 race when build --enable-vp9-highbitdepth.
Split vp8/vp9 implementations on yv12_copy_frame_c.
Remove high-bitdepth codes from vp8_yv12_extend_frame_borders_c.
Clean up vp8 codes usage in vp9.

BUG=webm:1435

Change-Id: Ic68e79e9d71e1b20ddfc451fb8dcf2447861236d
2017-05-26 09:45:01 -07:00
Marco
146005a911 vp9: SVC: Fix to condiiton on using source_sad.
Fix the condition on usage of source_sad for temporal layers.
FIx allows it to be used for the case of 1 temporal layer.

Change-Id: I02b1b0ade67a7889d1b93cee66d27c0951131fc3
2017-05-26 08:46:50 -07:00
Marco Paniconi
9ec9415fd9 Merge "vp9: Use source_sad only on top temporal enhancement layer." 2017-05-26 05:24:06 +00:00
Marco Paniconi
4be18ab295 Merge "vp9: SVC: Enable copy partition for SVC speed >= 7." 2017-05-26 05:23:47 +00:00
Marco
ea914456af vp9: Use source_sad only on top temporal enhancement layer.
For 1 pass CBR SVC mode.

Change-Id: Ic026740f9d0ec5eee7c5845be9c5b15884fec48d
2017-05-25 16:32:05 -07:00
Jerome Jiang
327c9bb1da Refactor: Move vp8 skin detection to new files.
Change-Id: If760f28cbbf22beac1cc9bd1546f13831e9dd3f0
2017-05-25 16:12:27 -07:00
Marco
747cf7a505 vp9: SVC: Enable copy partition for SVC speed >= 7.
Adjust the max_copied_frame setting for temporal layers.
Keep the same setting for non-SVC at speed 8.
This change also enables copy_partiton for non-SVC at speed 7,
but with smaller value of max_copied_frame (=2).

~2% speedup for SVC speed 7, 3 layers, with little/no quality loss.

Change-Id: Ic65ac9aad764ec65a35770d263424b2393ec6780
2017-05-25 12:21:46 -07:00
Johann
f3c97ed32e subpel variance neon: reduce stack usage
Unlike x86, arm does not impose additional alignment restrictions on
vector loads. For incoming values to the first pass, it uses vld1_u32()
which typically does impose a 4 byte alignment. However, as the first
pass operates on user-supplied values we must prepare for unaligned
values anyway (and have, see mem_neon.h).

But for the local temporary values there is no stride and the load will
use vld1_u8 which does not require 4 byte alignment.

There are 3 temporary structures. In the C, one is uint16_t. The arm
saturates between passes but still passes tests. If this becomes an
issue new functions will be needed.

Change-Id: I3c9d4701bfeb14b77c783d0164608e621bfecfb1
2017-05-24 13:28:13 -07:00
Johann
d204c4bf01 Use vdup instead of vmov
Change-Id: Idb6248c1429b55176bb3e9f4e8365ea0ed2be62a
2017-05-24 11:38:15 -07:00
Johann Koenig
de1a9c77a7 Merge changes Iaab2b9a1,Idfb458d3
* changes:
  sub pel avg variance neon: 4x block sizes
  sub pel variance neon: 4x block sizes
2017-05-24 18:33:53 +00:00
Johann Koenig
b11a37f540 Merge changes I31fa6ef8,I228c6f29
* changes:
  sub pel avg variance neon: add neon optimizations
  sub pel variance neon: normalize variable names
2017-05-24 18:32:02 +00:00
James Zern
f0279ceb92 Merge "partial_idct_test,InitInput: fix rollover in mult" 2017-05-24 16:27:21 +00:00
James Zern
566f6d75bd partial_idct_test,InitInput: fix rollover in mult
promote coeff to signed 64-bit to avoid exceeding integer bounds when
squaring the value

Change-Id: If77bef6bc0a6a4c39ca3013e5e2ddb426a1c6e1f
2017-05-24 15:27:38 +02:00
Alexandra Hájková
8bf6eaf433 ppc: Add vpx_sadnxmx4d_vsx for n,m = {8, 16, 32 ,64}
Change-Id: I547d0099e15591655eae954e3ce65fdf3b003123
2017-05-24 13:27:09 +00:00
Linfeng Zhang
6444958f62 Update inv_txfm_sse2.h and inv_txfm_sse2.c
Extract shared code into inline functions.

Change-Id: Iee1e5a4bc6396aeed0d301163095c9b21aa66b2f
2017-05-23 14:54:46 -07:00
Linfeng Zhang
36f1b183e4 Update InitInput() in test/partial_idct_test.cc
Make it work in high bit depth.

BUG=webm:1412

Change-Id: Ic5cfd410a69709f01e2924774356a108a349d273
2017-05-23 14:24:23 -07:00
Gregor Jasny
bcfd9c9750 Add support for Visual Studio 2017
BUG=webm:1428

Change-Id: Iba98aef1159724d106cf39b94d7b69843d76cd48
2017-05-23 11:32:27 +02:00
Johann
f6fcd3410d sub pel avg variance neon: 4x block sizes
BUG=webm:1423

Change-Id: Iaab2b9a183fdb54aae5f717aba95d90dc36a9e3b
2017-05-22 14:40:05 -07:00
Johann
188d58eaa9 sub pel variance neon: 4x block sizes
Add optimizations for blocks of width 4

BUG=webm:1423

Change-Id: Idfb458d36db3014d48fbfbe7f5462aa6eb249938
2017-05-22 14:40:01 -07:00
Johann
9b0d306a2f sub pel avg variance neon: add neon optimizations
These are missing an optimized version of vpx_comp_avg_pred

BUG=webm:1423

Change-Id: I31fa6ef842e98f7ff3ea079ffed51ae33178e2ed
2017-05-22 13:58:43 -07:00
Johann
e0d294c3af sub pel variance neon: normalize variable names
match vpx_dsp/variance.c variable names

Change-Id: I228c6f296c183af147b079b7c8bcdf97bd09cf3a
2017-05-22 13:58:43 -07:00
Linfeng Zhang
27beada6d0 Merge "Add vpx_highbd_idct{4x4,8x8,16x16}_1_add_sse2" 2017-05-22 20:58:18 +00:00
Johann
67ac68e399 variance neon: assert overflow conditions
Change-Id: I12faca82d062eb33dc48dfeb39739b25112316cd
2017-05-22 11:25:06 -07:00
Linfeng Zhang
c167345ffb Add vpx_highbd_idct{4x4,8x8,16x16}_1_add_sse2
BUG=webm:1412

Change-Id: Ia338a6057d36f9ed7eaa9cbd4dfbf0c3cbdc6468
2017-05-22 11:24:21 -07:00
Johann
d217c87139 neon variance: special case 4x
The sub pixel variance uses a temp buffer which guarantees width ==
stride. Take advantage of this with the 4x and avoid the very costly
lane loads.

Change-Id: Ia0c97eb8c29dc8dfa6e51a29dff9b75b3c6726f1
2017-05-22 10:51:31 -07:00
Johann Koenig
e7cac13016 Merge changes Ib8dd96f7,Ie9854b77
* changes:
  neon variance: process 4x blocks
  use memcpy for unaligned neon stores
2017-05-22 17:48:33 +00:00
Marco Paniconi
b3bf91bdc6 Merge "vp9: Adjustments to cyclic refresh for high motion." 2017-05-22 06:27:30 +00:00
Marco
2adc0443dd vp9: Adjustments to cyclic refresh for high motion.
For aq-mode=3: refactor the condition for turning off
the refresh. Add some adjustments for high motion content.

No/little change in RTC metrics, only affects high motion case.

Change-Id: I7da8eabfb0e61db014be4562806f72ee5ef4a43b
2017-05-21 22:21:44 -07:00
Marco
ff9395eb3b vp9: Speed >= 8: Modify condition for low-resoln.
No change on RTC metrics.

Change-Id: I5abc573cb56572188d900645d13ba479f55a1ea0
2017-05-21 22:14:38 -07:00
Johann Koenig
b5055002d7 Merge "neon 4 byte helper functions" 2017-05-19 17:11:30 +00:00
Johann Koenig
3c603eadb4 Merge "neon fdct: 4x4 implementation" 2017-05-19 17:08:58 +00:00
Paul Wilkins
a7977ece93 Merge "Changes to modified error." 2017-05-19 12:24:32 +00:00
Marco
1205e3207e vp9: SVC: Modify condition to allow for copy partition.
When temporal layers are used, only allow for copy partition
on the top temporal enhancement layer frames.

Change-Id: I5472abdc0f9f6c8dafa75a7a84c615e08ae22af8
2017-05-18 14:19:31 -07:00
Jerome Jiang
6b6ff9c969 Merge "vp9: Make copy partition work for SVC and dynamic resize." 2017-05-18 19:37:30 +00:00
Marco
2ba4729ef8 vp9: Make copy partition work for SVC and dynamic resize.
Only affects speed 8.

Make changes to copy partition to fix a bug in setting microblock
offset. Avg PSNR shows 0.02% gain on rtc_derf and 0.08% loss on rtc.

Change-Id: I61c3e5914dde645331344388e7437e5638acd4f3
2017-05-18 11:33:56 -07:00
paulwilkins
5680b4517f Changes to modified error.
The modified error was a derivative of the "coded_error"
that was used to allocate bits between different frames on the
assumption that the allocation should be linear in terms of this
modified error.  I.e. a frame with double the modified error score
should all things being equal get double the number of bits. The
code also included upper and lower caps derived from input
VBR parameters.

This patch improves the initial calculation of the clip mean error
(now called "mean_mod_score" as it is no longer a prediction error)
used as the midpoint for the rate distribution function and normalizes
the output "modified scores" scores such that 1.0 indicates a frame
in the middle of the distribution.  The VBR upper and lower caps are
then applied directly to a  frame's normalized score.

This refactoring is intended to make it easier to drop in alternative
distribution functions or to base the rate allocation on a corpus wide
midpoint (rather than the clip mean).

Change-Id: I4fb09de637e93566bfc4e022b2e7d04660817195
2017-05-18 12:56:02 +01:00
Johann
7b742da63e neon variance: process 4x blocks
Continue processing sets of 16 values. Plenty of improvement for 4x8
(doubles the speed) but only about 30% for 4x4.

BUG=webm:1422

Change-Id: Ib8dd96f75d474f0348800271d11e58356b620905
2017-05-17 17:35:01 -07:00
Johann
2057d3ef75 use memcpy for unaligned neon stores
Advise the compiler that the store is eventually going to a uint8_t
buffer. This helps avoid getting alignment hints which would cause the
memory access to fail.

Originally added as a workaround for clang:
https://bugs.llvm.org//show_bug.cgi?id=24421

Change-Id: Ie9854b777cfb2f4baaee66764f0e51dcb094d51e
2017-05-17 12:11:31 -07:00
Marco Paniconi
a2dfbbd7d6 Merge "vp9: Modify ChangingDropFrameThresh unittest." 2017-05-17 18:42:51 +00:00
Linfeng Zhang
13918a9ccc Merge "Update partial idct testing code" 2017-05-17 17:53:03 +00:00
Yaowu Xu
bde2c04fb7 Merge "Experiment. Store first pass errors as per MB values." 2017-05-17 17:38:15 +00:00
Marco
4733df333f vp9: Modify ChangingDropFrameThresh unittest.
Add another (lower) bitrate to the test, to cover
frame drop behavior at low bitrate range.

Change-Id: Iaad003974159daf3d2d65ef3a6575a3e72e498d6
2017-05-17 09:38:21 -07:00
Linfeng Zhang
3210ca6d60 Update partial idct testing code
Add PartialIDctTest::PrintDiff() to help debugging.
In RunQuantCheck, try all combinations of +/-mask_ input for 4x4 idct.
Update PartialIDctTest::InitInput().

Change-Id: I13fd163954a4c1a3a6cfeb5e4a4d3d0e7ff901f4
2017-05-17 09:28:32 -07:00
Johann
105503b839 neon fdct: 4x4 implementation
Approximately twice as fast as C implementation.

BUG=webm:1424

Change-Id: I3c0307fb08ddc23df42545cd089a78e2ed5c9d3f
2017-05-17 07:38:18 -07:00
paulwilkins
42e5073f94 Experiment. Store first pass errors as per MB values.
Most existing first pass stats are stored in a form normalized to a
macro-block scale. However the error scores for intra / inter etc were
stored as frame level values but mainly used as MB level values.

This change  fixes that. Normalized per MB values make comparisons
between different formats easier and in any case this is usually what is
wanted.

An change in results should be limited to slight differences in rounding.

*** Change after patch 8 +2 requiring new approval.

Final pre-submit testing showed  one 4K clip with above expected change.
Investigation showed this was due to a value used to test for ultra low intra
complexity in key frame detection. This was a per frame not per MB value but
also did not scale with frame size. Replacement with a small per MB value
(based on original per frame value and cif frame size) resolved the KF detection
problem.

Also converted kf_group_error_left to a double in line with other error values
to reduce rounding problems in KF group bit allocation

All clips and sets now show nominal (or 0) change as expected.

Change-Id: Ic2d57980398c99ade2b7380e3e6ca6b32186901f
2017-05-17 12:00:18 +01:00
Linfeng Zhang
18e8baa5c0 Add transpose_32bit_4x4() and rename transpose_4x4() for vpx_dsp/x86
Change-Id: Ib57377f6cf6573c04720d3cc5dea4285362b4220
2017-05-16 17:46:37 -07:00
Johann Koenig
31cb852a90 Merge "Revert "Add visibility="protected" attribute for global variables referenced in asm files."" 2017-05-16 23:39:37 +00:00
Johann Koenig
2300e16675 Revert "Add visibility="protected" attribute for global variables referenced in asm files."
This reverts commit 0d88e15454b632d92404dd6a7181c58d9985e2a2.

Reason for revert: chromium builds are failing to locate vpx_rv during dlopen()

dlopen failed: cannot locate symbol "vpx_rv" referenced by "libstandalonelibwebviewchromium.so"

Original change's description:
> Add visibility="protected" attribute for global variables referenced in asm files.
>
> During aosp builds with binutils-2.27, we're seeing linker error
> messages of this form:
> libvpx.a(subpixel_mmx.o): relocation R_386_GOTOFF against preemptible
> symbol vp8_bilinear_filters_x86_8 cannot be used when making a shared
> object
>
> subpixel_mmx.o is assembled from "vp8/common/x86/subpixel_mmx.asm".
> Other messages refer to symbol references from deblock_sse2.o and
> subpixel_sse2.o, also assembled from asm files.
>
> This change marks such symbols as having "protected" visibility. This
> satisfies the linker as the symbols are not preemptible from outside
> the shared library now, which I think is the original intent anyway.
>
> Change-Id: I2817f7a5f43041533d65ebf41aefd63f8581a452
>

TBR=jzern@google.com,johannkoenig@google.com,rahulchaudhry@chromium.org,builds@webmproject.org

Change-Id: I0c2ea375aa7ef5fda15b9d9e23e654bb315c941b
2017-05-16 15:54:33 -07:00
Marco Paniconi
baef5486bf Merge "Revert "Revert "vp8: Real-time mode: reduce mode_check_freq thresh for speed 10.""" 2017-05-16 22:50:29 +00:00
Marco Paniconi
13d4a0d011 Revert "Revert "vp8: Real-time mode: reduce mode_check_freq thresh for speed 10.""
This reverts commit 3704807805895850671261fa4470f1ce41dd2ac9.

Reason for revert: <INSERT REASONING HERE>
Does not look to be the cause of the test failures.

Original change's description:
> Revert "vp8: Real-time mode: reduce mode_check_freq thresh for speed 10."
> 
> This reverts commit 4a7424adba7a65766a92635dc67b6e7d94646693.
> 
> Reason for revert: <INSERT REASONING HERE>
> Possibly causing test failures in roll into chromium.
> 
> Original change's description:
> > vp8: Real-time mode: reduce mode_check_freq thresh for speed 10.
> > 
> > Reduces quality regression at speed 10 for real-time mode.
> > 
> > Change-Id: I9f624bea9ca262dab32ce9de7d6d91175d6becc8
> > 
> 
> TBR=marpan@google.com,builds@webmproject.org,jianj@google.com
> # Not skipping CQ checks because original CL landed > 1 day ago.
> 
> Change-Id: I1defcb74e78a5a3bd29b7d1b21a96a79fa26a457
> 

TBR=marpan@google.com,builds@webmproject.org,jianj@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Change-Id: I13d86a2a68b8aa8c0c7465e6e58cff0e00bc7862
2017-05-16 22:50:19 +00:00
Marco Paniconi
b9987a7c25 Merge "Revert "vp8: Real-time mode: reduce mode_check_freq thresh for speed 10."" 2017-05-16 22:48:39 +00:00
Marco Paniconi
3704807805 Revert "vp8: Real-time mode: reduce mode_check_freq thresh for speed 10."
This reverts commit 4a7424adba7a65766a92635dc67b6e7d94646693.

Reason for revert: <INSERT REASONING HERE>
Possibly causing test failures in roll into chromium.

Original change's description:
> vp8: Real-time mode: reduce mode_check_freq thresh for speed 10.
> 
> Reduces quality regression at speed 10 for real-time mode.
> 
> Change-Id: I9f624bea9ca262dab32ce9de7d6d91175d6becc8
> 

TBR=marpan@google.com,builds@webmproject.org,jianj@google.com
# Not skipping CQ checks because original CL landed > 1 day ago.

Change-Id: I1defcb74e78a5a3bd29b7d1b21a96a79fa26a457
2017-05-16 22:48:13 +00:00
Johann Koenig
dac3b59721 Merge "'protected' visibility unsupported on macho" 2017-05-15 21:21:45 +00:00
Johann
7498fe2e54 neon 4 byte helper functions
When data is guaranteed to be aligned, use helper functions which
assert that requirement.

Change-Id: Ic4b188593aea0799d5bd8eda64f9858a1592a2a3
2017-05-15 13:42:31 -07:00
Johann
3fbc371e99 'protected' visibility unsupported on macho
Mac builds must not specify 'protected' visibility. Then only support
'default' and 'hidden'.

https://developer.apple.com/library/content/documentation/DeveloperTools/Conceptual/CppRuntimeEnv/Articles/SymbolVisibility.html

Change-Id: I94eccfaa29af0ddcc4a5c1c0e14cf63ef7146462
2017-05-15 11:29:22 -07:00
Johann Koenig
8739a182c8 Merge "move neon load/stores to a new file" 2017-05-15 18:15:27 +00:00
Johann
1088b4f87c move neon load/stores to a new file
Move the tran_low_t helper functions to a new file. Additional
load/store functions will be added here.

Change-Id: I52bf652c344c585ea2f3e1230886be93f5caefc3
2017-05-15 08:29:43 -07:00
Marco
4a7424adba vp8: Real-time mode: reduce mode_check_freq thresh for speed 10.
Reduces quality regression at speed 10 for real-time mode.

Change-Id: I9f624bea9ca262dab32ce9de7d6d91175d6becc8
2017-05-14 18:19:06 -07:00
Alexandra Hájková
bcbc3929ae ppc: Add vpx_sad64/32/16x64/32/16_avg_vsx
Change-Id: Ic9639b1331d8c5cbc207c2a036891ff0137fc56f
2017-05-13 13:13:15 +00:00
Jerome Jiang
6b9d130214 Merge "vp9: speed 8: Fix seg fault in partition copy when drop frames." 2017-05-13 03:20:49 +00:00
Cheng Chen
4c0655f26b Merge "Speed up encoding by skipping altref recode" 2017-05-13 01:29:59 +00:00
Jerome Jiang
1fcd5cca3c vp9: speed 8: Fix seg fault in partition copy when drop frames.
BUG=webm:1433

Change-Id: I4f3984ef28660d3218d48007d7c977bdbdaf8af6
2017-05-12 15:57:23 -07:00
Rahul Chaudhry
0d88e15454 Add visibility="protected" attribute for global variables referenced in asm files.
During aosp builds with binutils-2.27, we're seeing linker error
messages of this form:
libvpx.a(subpixel_mmx.o): relocation R_386_GOTOFF against preemptible
symbol vp8_bilinear_filters_x86_8 cannot be used when making a shared
object

subpixel_mmx.o is assembled from "vp8/common/x86/subpixel_mmx.asm".
Other messages refer to symbol references from deblock_sse2.o and
subpixel_sse2.o, also assembled from asm files.

This change marks such symbols as having "protected" visibility. This
satisfies the linker as the symbols are not preemptible from outside
the shared library now, which I think is the original intent anyway.

Change-Id: I2817f7a5f43041533d65ebf41aefd63f8581a452
2017-05-12 11:11:16 -07:00
Marco Paniconi
9a66582604 Merge "vp9: Use INTERP_FILTER for filter_type in vp9_rtcd_defs.pl" 2017-05-12 17:02:50 +00:00
James Zern
ac8f58f6ab Merge changes I1b54a7a5,I3028bdad,I59788cd9
* changes:
  ppc: Add get_mb_ss_vsx
  ppc: Add get4x4sse_cs_vsx
  ppc: Add comp_avg_pred_vsx
2017-05-12 15:24:59 +00:00
Luca Barbato
143b21e362 ppc: Add get_mb_ss_vsx
Change-Id: I1b54a7a5bb642e4b836d786ea1ae506eed025e3f
2017-05-12 17:23:00 +02:00
Luca Barbato
6d225eb5f9 ppc: Add get4x4sse_cs_vsx
Change-Id: I3028bdadf653665d18e781d28e9625f62804b3d8
2017-05-12 17:23:00 +02:00
Luca Barbato
a7f8bd451b ppc: Add comp_avg_pred_vsx
Change-Id: I59788cd98231e707239c2ad95ae54f67cfe24e10
2017-05-12 17:22:55 +02:00
Alexandra Hájková
f48532e271 ppc: Add vpx_sad64x32/64_vsx
Change-Id: I84e3705fa52f75cb91b2bab4abf5cc77585ee3e2
2017-05-12 16:10:16 +02:00
Alexandra Hájková
0b15bf1e54 ppc Add vpx_sad32x16/32/64_vsx
Change-Id: I3c4f9d595275669580413a71b3c3c810e7ddcacd
2017-05-12 16:10:11 +02:00
James Zern
a12ea1d5e9 Merge "ppc: Add vpx_sad16x8/16/32_vsx" 2017-05-12 13:33:51 +00:00
Marco Paniconi
629279a45c Merge "vp9: Adjust speed features for speed 8 at low resoln." 2017-05-12 00:35:40 +00:00
Marco Paniconi
c64667c338 Merge "vp9: SVC: Increase the partiiton and acskip thresholds" 2017-05-11 23:37:32 +00:00
Marco Paniconi
37cdd3bfc2 Merge "vp9; Adjust noise estimation thresholds." 2017-05-11 21:58:40 +00:00
Marco
c5c31b9eb6 vp9: SVC: Increase the partiiton and acskip thresholds
Increase the partition and acskip thresholds for temporal
enhancement layers.

~1-2% speedup, with negligible loss in quality.

Change-Id: Id527398a05855298ad9ddac10ada972482415627
2017-05-11 12:28:19 -07:00
Marco
c5a4376aed vp9: SVC: allow for setting the interp_filter in non-rd pickmode.
For SVC 1 pass non-rd pickmode, the interpolation filter for the
upsampling of the golden (spatial) reference was not being explicitly
set and instead was takin gwhatever value was set in the previous
mode/block (which would be either EIGHTTAP or EIGHTAP_SMOOTH).

Fix it to the default EIGHTTAP for now, to be updated/selected
adaptively in a later change.

Minor adjustmemt to rate targeting thresholds in datarate unittests.

Change-Id: I52085048674072c6cfb7163e11e9a2658d773826
2017-05-11 11:45:09 -07:00
Paul Wilkins
3caaf21c5b Merge "Tuning of factor used to calculate Q range in two pass." 2017-05-11 18:25:45 +00:00
Jerome Jiang
d35541fe29 Merge "vp9: Fix ubsan failure in denoiser." 2017-05-11 16:38:59 +00:00
paulwilkins
9a7625652c Tuning of factor used to calculate Q range in two pass.
A more detailed explanation of the experimentation
leading to this change can be found in:-

https://docs.google.com/a/google.com/document/d/13lsYhxgPyxUHvEess6wg9nikaonIZKY9Ak_Lpafv5Mo/edit?usp=sharing

This change gives gains across all our standard test sets for
overall psnr, ssim, fast ssim and psnr-HVS.

Values expressed as % reduction in bitrate.

Low res set     -0.257, -0.192, -0.173, -0.101
Mid res set     -0.233, -0.336, -0.367, -0.139
High res set    -0.999, -1.039, -1.111, -0.567
NetFlix 2K set -0.734, -0.174, -0.389, -0.820
Netflix 4K set  -0.814, -0.485, -0.796, -0.839

Change-Id: Ie981fb3c895c9dfcfc8682640d201a86375db5c8
2017-05-11 16:19:59 +01:00
Cheng Chen
76567d84ce Speed up encoding by skipping altref recode
Speed up for speed 0.
Reduce 10+% of encoding time for hdres in speed 0,
with less than 0.1% PSNR loss.
Compute total difference of previous and current frame context probability
model. If the diff is less than the threshold, skip recoding the frame.

Borg test (positive number means performance loss):
		lowres    midres    hdres
PSNR:		0.030     0.032     0.065

Local speed test: bitrate set at 1200
		blue_sky  pedestrian  rush_hour
Encoding time:	 -10.0%     -16.5%      -16.5%

Change-Id: I4e2d200ea3115d48b2c3e890143596b31b8ef9e9
2017-05-10 22:15:01 -07:00
Marco Paniconi
f7e767d8ee Merge "vp9: SVC: Fix setting in sample encoder." 2017-05-10 23:51:44 +00:00
Marco
2f11a65c99 vp9; Adjust noise estimation thresholds.
Change-Id: Ia41a11df18e5a58d2b8bbecd11c249d357de2a8f
2017-05-10 16:48:10 -07:00
Marco
eaa6715b02 vp9: SVC: Fix setting in sample encoder.
For 1 spatial layer case, scaling_num/den was not set properly.

Change-Id: I139bf70c6dffde89eed24e435bcb5d98d2029bcd
2017-05-10 16:19:23 -07:00
Jerome Jiang
597d1f4c03 vp9: Fix ubsan failure in denoiser.
Fix the overflow for subtraction between two unsigned integers.

BUG=webm:1432

Change-Id: I7b665e93ba5850548810eff23258782c4f5ee15a
2017-05-10 13:43:17 -07:00
Linfeng Zhang
8477a66fc8 Merge "Update specializations of idct functions" 2017-05-10 20:31:13 +00:00
Alexandra Hájková
cc7f0c0f3e ppc: Add vpx_sad16x8/16/32_vsx
Change-Id: I60619d28fffd9809f93b1af510a50e1aa02519a9
2017-05-10 19:57:30 +00:00
Linfeng Zhang
764b3b8090 Update specializations of idct functions
Introduced append situation in Commit 0178d97 which could be
confusing. Clean a little bit and add some comments.

Change-Id: I69ad336f805aca7ce9d45515b8cd237423fadbb2
2017-05-10 12:51:18 -07:00
Jerome Jiang
2574573fea vp9: Wrap threshold tuning for HD only when denoiser is enabled.
Fixes a speed regression.

Change-Id: I23d942e4af17fa81fe4a366c7369b3ad537e59b0
2017-05-10 12:15:41 -07:00
Marco
d3aebeee4e vp9: Use INTERP_FILTER for filter_type in vp9_rtcd_defs.pl
Change-Id: I259d152c62864b365490368051f3c3b7d7f2f1c5
2017-05-10 12:06:44 -07:00
Johann Koenig
d713ec3c46 Merge changes I92eb4312,Ibb2afe4e
* changes:
  subpel variance neon: add mixed sizes
  sub pixel variance neon: use generic variance
2017-05-10 18:19:52 +00:00
Marco Paniconi
db2fad7516 Merge "vp9: Adjustment to noise estimation." 2017-05-10 17:11:18 +00:00
Marco Paniconi
fcd6e4a1c2 Merge "vp9: SVC: Add option to set downsampling filter type." 2017-05-10 17:10:52 +00:00
Marco
1b59964162 vp9: Adjustment to noise estimation.
When the noise estimate is forced off due to large motion,
reset the counter and set smaller window for next estimate.

Change-Id: Ifa4ec95396134173a00d48353ad52f1b6a40c217
2017-05-10 09:39:08 -07:00
Marco
4e23998fb4 vp9: SVC: Add option to set downsampling filter type.
Add option in SVC to set the filter type and phase for
the frame level downsampling filters.

For 3 spatial layers: set downsampling filter type to bilinear
and set phase to 8, for lowest spatial layer.

Change-Id: Id81f4b1ba93db19c1cd37b6a46d1281a2c61bc43
2017-05-09 17:22:44 -07:00
Linfeng Zhang
870cf4356c Update test/partial_idct_test.cc
Makes more sense to call the corresponding partial idct C function
instead of the full idct C function as the reference.

Change-Id: Ibb7681dd063edd6307ba582c10c26c4c6a4b78c6
2017-05-09 13:07:47 -07:00
Linfeng Zhang
f532504864 Clean 32x32 idct C code
Change-Id: I73b8104a9e7a70ffe827c1b7ff43618f24f5d7bd
2017-05-09 11:05:51 -07:00
Linfeng Zhang
ecd1eb2162 Update 4x4 idct sse2 functions
It's a bit faster to call idct4_sse2() in vpx_idct4x4_16_add_sse2()

Change-Id: I1513be7a895cd2fc190f4a8297c240b17de0f876
2017-05-08 16:16:52 -07:00
Marco Paniconi
8053dba5a1 Merge "vp9: SVC: Modify conditon for setting downsample filter type." 2017-05-08 21:45:58 +00:00
Marco
9586d5e682 vp9: SVC: Modify conditon for setting downsample filter type.
Base the condition on the resolution of the spatial layer.
And remove restriction on scaling factor.

Change-Id: Iad00177ce364279d85661654bff00ce7f48a672e
2017-05-08 14:13:49 -07:00
Johann
f7d1486f48 neon variance: process 16 values at a time
Read in a Q register. Works on blocks of 16 and larger.

Improvement of about 20% for 64x64. The smaller blocks are faster, but
don't have quite the same level of improvement. 16x32 is only about 5%

BUG=webm:1422

Change-Id: Ie11a877c7b839e66690a48117a46657b2ac82d4b
2017-05-08 18:48:55 +00:00
Johann Koenig
1814463864 Merge changes Id602909a,Ib0e85608
* changes:
  neon variance: process two rows of 8 at a time
  neon variance: add small missing sizes
2017-05-08 17:34:20 +00:00
Linfeng Zhang
2c3a2ad6f1 Merge changes I0cfe4117,I3581d80d,Ida62c941
* changes:
  Split dsp/x86/inv_txfm_sse2.c
  Update highbd idct functions arguments to use uint16_t dst
  Clean CONVERT_TO_BYTEPTR/SHORTPTR in idct
2017-05-08 16:15:57 +00:00
Marco Paniconi
f4653c1efc Merge "vp9: SVC: Set downsample filtertype for lowest spatial layer." 2017-05-06 02:31:00 +00:00
Marco
9b729748ac vp9: SVC: Set downsample filtertype for lowest spatial layer.
For lowest spatial layer, in 3 layer SVC, set the
downsampling filtertype to get averaging filter.
Needed for reducing aliasing on low-res layer,
small increase in overall encoder time.

Change-Id: Ia31460123bd91b72eca49b46dd924b9f226d4563
2017-05-05 19:29:09 -07:00
Jerome Jiang
3453c8d6c4 Merge "vp9: Neon optimization for denoiser. Add unit tests." 2017-05-06 01:28:32 +00:00
Jerome Jiang
83a2bfd7dc Merge "Change target bitrate thresh in denoiser test." 2017-05-06 01:28:15 +00:00
Jerome Jiang
fff358fb06 Change target bitrate thresh in denoiser test.
An intended behavior change disabling exhaustive searches in speed
feature causes VP9/DatarateTestVP9LargeDenoiser.4threads test failure.
Change the threshold to make it pass.

BUG=webm:1429

Change-Id: Ibcbe2314c6b2525799894f5d7204fc8eb4ec2a1e
2017-05-05 16:50:19 -07:00
Jerome Jiang
069eedb3a0 vp9: Neon optimization for denoiser. Add unit tests.
Denoiser on Neon is 5x faster than C code.

BUG=webm:1420

Change-Id: I805ab64f809ff2137354116be6213e7ec29c1dcb
2017-05-05 16:40:52 -07:00
Marco Paniconi
a082c562d0 Merge "vp9: Adjust some thresholds for noise estimation." 2017-05-05 20:02:41 +00:00
Marco
34cce144d8 vp9: Adjust some thresholds for noise estimation.
Adjust thresholds for noise estimation, for resolutions above VGA.
Tends to push cleaner/low noise clips to LowLow state.

No change in RTC metrics.

Change-Id: I739ca6b797d0a60ccd1c6c6a2775269b1f007e5e
2017-05-05 12:00:12 -07:00
Johann Koenig
38f440120c Merge "fdct 8x8 neon: minor comment cleanup" 2017-05-05 18:22:45 +00:00
Jerome Jiang
af69ed20c4 vp9: Enable noise estimation on low res.
Set noise level to kLowLow for high motion low res clips.
Change the normalization in noise metric for low res.
Reduce the initial time-window for all resolutions.

Change-Id: Iaed39dbb50b205cd9c735dc5b84822304fb01987
2017-05-04 15:38:23 -07:00
Johann
2346a6da4a subpel variance neon: add mixed sizes
Add support for everything except block sizes of 4.

Performance is better but numbers will improve again when the variance
optimizations land.

BUG=webm:1423

Change-Id: I92eb4312b20be423fa2fe6fdb18167a604ff4d80
2017-05-04 15:30:01 -07:00
Johann
19e1ec8359 sub pixel variance neon: use generic variance
When a neon version is available it will be called. This allows
decoupling the variance implementations and has no real downside. For
most configurations, the call will be #define'd to the neon
implementation.

Change-Id: Ibb2afe4e156c5610e89488504d366b3e6d1ba712
2017-05-04 15:30:01 -07:00
Johann
462e29703c fdct 8x8 neon: minor comment cleanup
Simplify HBD/non distinction in test.

Document why transpose_neon.h is not used

Change-Id: I17659414206ddbb8c2f1ef0d9f4a17f1745d5a52
2017-05-04 15:14:23 -07:00
Johann
d6a7489dd5 neon variance: process two rows of 8 at a time
When the width is equal to 8, process two rows at a time. This doubles
the speed of 8x4 and improves 8x8 by about 20%.

8x16 was using this technique already, but still improved a little bit
with the rewrite.

Also use this for vpx_get8x8var_neon

BUG=webm:1422

Change-Id: Id602909afcec683665536d11298b7387ac0a1207
2017-05-04 08:59:46 -07:00
Johann
cb9133c72f neon variance: add small missing sizes
Some of the mixed sizes were missing. They can be implemented trivially
using the existing helper function.

When comparing the previous 16x8 and 8x16 implementations, the helper
function is about 10% faster than the 16x8 version. The 8x16 is very
close, but the existing version appears to be faster.

BUG=webm:1422

Change-Id: Ib0e856083c1893e1bd399373c5fbcd6271a7f004
2017-05-04 08:59:42 -07:00
Yi Luo
a24e1e8027 Merge "High bit depth inter prediction horizontal/vertical filters AVX2" 2017-05-04 15:43:21 +00:00
Linfeng Zhang
2231669a83 Split dsp/x86/inv_txfm_sse2.c
Spin out highbd idct functions.

BUG=webm:1412

Change-Id: I0cfe4117c00039b6778c59c022eee79ad089a2af
2017-05-03 15:43:02 -07:00
Linfeng Zhang
d5de63d2be Update highbd idct functions arguments to use uint16_t dst
BUG=webm:1388

Change-Id: I3581d80d0389b99166e70987d38aba2db6c469d5
2017-05-03 13:59:16 -07:00
Linfeng Zhang
081b39f2b7 Clean CONVERT_TO_BYTEPTR/SHORTPTR in idct
BUG=webm:1388

Change-Id: Ida62c941f2b836d6c9e27b427a7d5008ab6dc112
2017-05-03 13:58:31 -07:00
Hui Su
5048d6e7ee Merge "vp9 level: add tentative max cpb values for high levels" 2017-05-03 20:51:03 +00:00
Hui Su
f701a44305 Merge "Adjust alt-ref selection in define_gf_group()" 2017-05-03 20:50:29 +00:00
Yi Luo
a3452996a1 High bit depth inter prediction horizontal/vertical filters AVX2
User level speed improvement on i7-6700, cpu-used=1,
  x86_64 Linux, bitrate, 1080p, 8Mbps, 4K, 16Mbps:
- Decoder:
  1080p: ~4%
  4K: ~5%
- Encoder:
  1080p: ~1%
  4K: ~3%

Change-Id: I51b48f9c5de0d62487d5a11aa579c97bd03dd640
2017-05-03 12:18:01 -07:00
Linfeng Zhang
a10a5cb356 Merge changes I8bb660de,Ica51d780,I6037525d
* changes:
  Clean specializes of idct functions
  Clean add_protos of highbd idct functions
  Clean add_protos of idct functions
2017-05-03 19:17:55 +00:00
James Zern
5599e4275a Merge changes Ia5293d94,I90d481d3,Ia509d622,I54549b03,I89b635d6
* changes:
  ppc: Add convolve8_vsx and convolve8_avg_vsx
  ppc: Add convolve8_avg_vert_vsx
  ppc: Add convolve8_vert
  ppc: Add convolve8_horiz_avg
  ppc: Add convolve8_horiz
2017-05-03 03:31:19 +00:00
Luca Barbato
e2ad89092d ppc: Add convolve8_vsx and convolve8_avg_vsx
Change-Id: Ia5293d948003a7fff5a7cbad6e83d8a72717c857
2017-05-02 20:27:47 -07:00
Luca Barbato
e6ca81ee67 ppc: Add convolve8_avg_vert_vsx
Only the generic one again, speedups for 8x8 and larger blocks to
come later.

Change-Id: I90d481d3a602d1e277ead8f3934eca126b86b72d
2017-05-02 20:27:42 -07:00
Luca Barbato
a65f1771ad ppc: Add convolve8_vert
Only the generic one again, speedups for 8x8 and larger blocks
to come later.

Change-Id: Ia509d6225984b4930ec03928c9bcbf51486da99f
2017-05-02 20:27:33 -07:00
Luca Barbato
77772350f3 ppc: Add convolve8_horiz_avg
The 8x8 and larger blocks cases can be sped up further.

Change-Id: I54549b03ac6c7a4e3f485738b100c3cac7ac2e15
2017-05-02 20:27:28 -07:00
Luca Barbato
08edb85bd0 ppc: Add convolve8_horiz
The 8x8 and larger blocks cases can be sped up further.

Change-Id: I89b635d6b01c59f523f2d54b1284ed32916c5046
2017-05-02 20:27:16 -07:00
Linfeng Zhang
0178d974e5 Clean specializes of idct functions
Change-Id: I8bb660de47b5f97263ec381dc428db96e9c9a4b2
2017-05-02 18:01:19 -07:00
Linfeng Zhang
4412996d59 Clean add_protos of highbd idct functions
Change-Id: Ica51d780b92b316ce9112740c56cdf7670816371
2017-05-02 17:59:38 -07:00
Linfeng Zhang
a7a57d9756 Clean add_protos of idct functions
Change-Id: I6037525d92ec172810edab720389eb1865ed3b1a
2017-05-02 17:58:40 -07:00
Johann Koenig
240a5a15ef Merge "block error sse2: sum in 32 bits when possible" 2017-05-02 14:16:47 +00:00
Johann
cd94d5f68e block error avx2: rename variables
Change-Id: I2b8a9253f2c3d1fd85304c2970ebe70213870fe9
2017-05-01 17:54:29 -07:00
Johann Koenig
b1a31f8066 Merge "block error avx2: sum in 32 bits when possible" 2017-05-02 00:52:59 +00:00
Marco Paniconi
1e112bce37 Merge "vp9: SVC: Early exit on golden ref in non-rd pickmode." 2017-05-01 21:04:52 +00:00
Linfeng Zhang
e8655d49f5 Merge "Clean vp9_highbd_build_inter_predictor() and highbd_inter_predictor()" 2017-05-01 19:54:40 +00:00
Johann Koenig
3d33a462b3 Merge "move vp9_error_intrin_avx2.c" 2017-05-01 19:52:36 +00:00
Kyle Siefring
760c214519 block error avx2: sum in 32 bits when possible
Add 31bit pairs before unpacking in x86 block error code

AVX2 code provides a very minor performance improvement.

BUG=webm:1210

Change-Id: I4c82308eaf65741dca2f5c6db9be9c85f905073a
2017-05-01 12:51:33 -07:00
James Zern
ee3df31d74 Merge "vpx_scale_test: fix segfault on alloc failure" 2017-05-01 19:22:22 +00:00
Marco
ae0215f945 vp9: SVC: Early exit on golden ref in non-rd pickmode.
For SVC 1 pass real-time: add condition to skip the
golden (spatial) reference mode in non-rd pickmode.
Condition is to skip golden if the sse of zeromv-last mode
is below threshold. And change order in ref_mode_set_svc
to make sure golden zeromv is tested after last-nearest.

Speedup ~3-4% with little/negligible quality loss.

Change-Id: I6cbe314a93210454ba2997945f714015f1b2fca3
2017-05-01 10:36:54 -07:00
Kyle Siefring
8394990b27 block error sse2: sum in 32 bits when possible
Add 31bit pairs before unpacking in x86 block error code

BUG=webm:1210

Change-Id: I5ca8c7f7775585a17fe09d6bbfc25e1f2955eb0a
2017-05-01 09:59:18 -07:00
Johann
2ff01aa1e4 move vp9_error_intrin_avx2.c
There is only one avx2 implementation. Drop '_intrin'

Change-Id: I887a0d27d58567eaad49f749f127eca61313f312
2017-05-01 09:13:01 -07:00
James Zern
2930903d51 vpx_scale_test: fix segfault on alloc failure
check the return of ResetImage() before continuing

Change-Id: Iff0b038f7b9761113b8cf33a511a5306640d1273
2017-04-29 13:12:53 -07:00
Luca Barbato
d51d3934f5 ppc: Add convolve_avg
Change-Id: Ib203c444c708f42072e38301ee3db97b5b53d014
2017-04-29 15:47:25 +02:00
Luca Barbato
63860ba7b8 ppc: Add convolve_copy
Change-Id: Ie26d6dbe090e711d84bac01ba7da270db983f405
2017-04-29 15:47:25 +02:00
Johann Koenig
ef5918098d Merge "Use uint32_t for accumulator" 2017-04-28 18:32:09 +00:00
Jerome Jiang
ce2e278059 Merge "vp9: Fix condition for disabling adaptive_rd_thresh." 2017-04-28 18:10:36 +00:00
Jerome Jiang
04de501229 vp9: Fix condition for disabling adaptive_rd_thresh.
Add speed constrains for disabling adaptive_rd_thresh when
row_mt_bit_exact is set.

Change-Id: I2445115c2f9a2e46b8a0966031a0fea488d4964e
2017-04-28 10:26:20 -07:00
Jerome Jiang
bea27a5809 Merge "Generalize vp9 sse2 denoiser test for other platforms." 2017-04-28 15:45:52 +00:00
Johann
657f3e9f14 Use uint32_t for accumulator
Be specific about the data type size.

Use convenience macro vp9_zero_array.

Change-Id: I5fadf7dbd408befb73820d85db0be4832e8cfcbd
2017-04-28 06:36:59 -07:00
Johann Koenig
94ebdba71d Merge "vp9 temporal filter: sse4 implementation" 2017-04-28 13:22:41 +00:00
Jerome Jiang
26aebd77b8 Generalize vp9 sse2 denoiser test for other platforms.
Renamed to vp9_denoiser_test.

Change-Id: I0d8f4c94bcb81a60949a13d9fe839cee95d03f77
2017-04-27 22:47:41 -07:00
Yaowu Xu
0e8fea6c13 Merge "VP9: enable trellis for high bitdepth intra" 2017-04-28 00:16:56 +00:00
James Zern
ef15d38df0 Merge "webm_read_frame: avoid NULL dereference" 2017-04-27 21:47:10 +00:00
Johann
6dfeea6592 vp9 temporal filter: sse4 implementation
Approximates division using multiply and shift.

Speeds up both sizes (8x8 and 16x16) by 30 times.

Fix the call sites to use the RTCD function.

Delete sse2 and mips implementation. They were based on a previous
implementation of the filter. It was changed in Dec 2015:
ece4fd5d2247c9512b31a93dd593de567beaf928

BUG=webm:1378

Change-Id: I0818e767a802966520b5c6e7999584ad13159276
2017-04-26 22:03:05 -07:00
Jerome Jiang
43e0e082d1 vp9: Don't force disabling of adaptive_rd_thresh for realtime.
Don't force disabling of adaptive_rd_thresh for realtime when
row_mt_bit_exact is set.

Row based adaptive rd is made usable in CL
454882(https://chromium-review.googlesource.com/c/454882) for REALTIME.

Change-Id: Ief023414f0fd6eb86f299dd46ae58f4436875af5
2017-04-26 13:17:57 -07:00
Yunqing Wang
b68f14d0ed Merge "Make the row based multi-threaded encoder deterministic" 2017-04-26 16:12:14 +00:00
Linfeng Zhang
54c4e0f7a5 Merge "Update highbd convolve functions arguments to use uint16_t src/dst" 2017-04-26 15:50:46 +00:00
Marco Paniconi
004fab120a Merge "vp9: SVC: Adjust some speed settings for temporal layers." 2017-04-26 15:45:06 +00:00
Peter de Rivaz
66117b97c5 VP9: enable trellis for high bitdepth intra
BUG=webm:1409

Change-Id: I5236595aac1c09386c60ffe8ad621e01422ed5a7
2017-04-26 11:43:01 +01:00
hui su
d01c9febe9 vp9 level: add tentative max cpb values for high levels
Add tentative max cpb size values for levels 5.2 and up. Otherwise
encoding will fail when targeting for these levels.

Change-Id: Ib7e0ba4b9836ea1ac900b6822543812843d48463
2017-04-25 18:03:55 -07:00
hui su
8069f31076 Adjust alt-ref selection in define_gf_group()
107de19698 changes the encoder alt-ref selection behavior. Assuming
min_gf_interval = max_gf_interval = 4, the frame order would be
frm_1  arf_1  frm_2  frm_3  frm_4  frm_5  arf_2 before 107de19698;
frm_1  arf_1  frm_2  frm_3  frm_4  arf_2  frm_5 after 107de19698.

This patch reverts such alt-ref placement change.

Change-Id: I93a4a65036575151286f004d455d4fcea88a1550
2017-04-25 18:03:47 -07:00
Jerome Jiang
15ee8a8c45 Merge "Fix the decoder seg fault when frame is corrupted." 2017-04-26 00:09:29 +00:00
Jerome Jiang
997e54ea43 Merge "vp9: speed >= 8: Skip uv variance in model_rd_sb_y_large" 2017-04-26 00:09:22 +00:00
Marco
c614164cb6 vp9: SVC: Adjust some speed settings for temporal layers.
Make some speed setting changes for temporal enhancement layers,
and remove the switch in subpel_force_stop for the aggressive_base_mv
in non-rd pickmode.

Gain some 2-3% speed with little/negligible quality loss.

Change-Id: I3e2a7f80ff45f38c0a6ceb01b34dbca2f53edbf0
2017-04-25 16:27:01 -07:00
Jerome Jiang
69b0242e9a vp9: speed >= 8: Skip uv variance in model_rd_sb_y_large
For speed >= 8 and color_sensitivity not set, skip the transform
skipping test in UV planes.
Add a new condition to check noise level to skip chroma check
for speed >= 8 if y_sad is high.

1~2% speedup on ARM for speed 8.

Borg tests show neutral results in both rtc and rtc_derf.

Change-Id: Idecd3ff6e28c97757a43bb6f3a7082c85f72109c
2017-04-25 16:21:36 -07:00
Linfeng Zhang
4758d20227 Clean vp9_highbd_build_inter_predictor() and highbd_inter_predictor()
BUG=webm:1388

Change-Id: I7ee32e0c08f0fb41712a8cc640b2c5bba872421d
2017-04-25 14:32:20 -07:00
Linfeng Zhang
51dc998f3a Update highbd convolve functions arguments to use uint16_t src/dst
BUG=webm:1388

Change-Id: I6912de2639895d817ce850da8ea9f6c8fe21da42
2017-04-25 14:22:19 -07:00
James Zern
0be513e8e8 webm_read_frame: avoid NULL dereference
block may be NULL with block_entry_eos or from return of GetBlock()

Change-Id: Ia0dd3ffa46305ee70efcdc55c05c2ad24efc993b
2017-04-25 12:34:23 -07:00
Marco
92ec0674fd vp9; Reduce artifact in non-rd pickmode for lighting changes.
Add a low-variance high-sumdiff to the superblock content state
and use it to limit the mv and bias some decisions in non-rd pickmode.
Only affects speed >= 6.

Reduces artifact for lighting changes.
Small/no difference in metrics on RTC set.

Change-Id: Ic84b2379fe0ae3fa71ae826ee6bae3eaf551a25b
2017-04-24 17:08:43 -07:00
Yunqing Wang
10a497bd38 Make the row based multi-threaded encoder deterministic
This patch followed allow_exhaustive_searches feature modification and
continued to modify the encoder to achieve the determinism in the row
based multi-threaded encoding. While row-mt = 1 and using multiple
threads, the adaptive feature in encoder was disabled, which gave
BDRate gain(at speed 1, -0.6% ~ -0.7%; at speed 2, -0.46% ~ -0.59%),
but some encoder speed losses(7% ~ 10% at speed 1 and 3% ~ 6% at
speed 2). These speed losses were acceptable considering the speed
gains obtained from row-mt.

Change-Id: I60d87a25346ebc487a864b57d559f560b7e398bb
2017-04-24 16:28:27 -07:00
Yunqing Wang
c530208ae3 Merge "Make allow_exhaustive_searches feature no longer adaptive" 2017-04-24 17:41:10 +00:00
Marco Paniconi
b35f64241f Merge "vp9: SVC: fix condition for partition/skip threshold when denoising." 2017-04-21 21:28:17 +00:00
Yunqing Wang
bca4564683 Make allow_exhaustive_searches feature no longer adaptive
A previous patch turned on allow_exhaustive_searches feature only for
FC_GRAPHICS_ANIMATION content. This patch further modified the feature
by removing the exhaustive search limit, and made it no longer adaptive.
As a result, the 2 counts that recorded the number of motion searches
were removed, which helped achieve the determinism in the row based
multi-threading encoding. Tests showed that this patch didn't cause
the encoder much slower.

Used exhaustive_searches_thresh for this speed feature, and removed
allow_exhaustive_searches. Also, refactored the speed feature code
to follow the general speed feature setting style.

Change-Id: Ib96b182c4c8dfff4c1ab91d2497cc42bb9e5a4aa
2017-04-21 11:14:02 -07:00
Jerome Jiang
58fe1bde59 Merge "vp9: Non-rd pickmode: Avoid computation duplication." 2017-04-21 00:51:47 +00:00
Marco
5de0e9ed08 vp9: SVC: fix condition for partition/skip threshold when denoising.
The more aggressive settings should only be used when denoise_svc
condition is satisfied (which means top spatial layer).

Change-Id: Ia8e3515b27f31bf21b1976ca80a2fa826daece3a
2017-04-20 16:36:55 -07:00
Jerome Jiang
7ae1e321a1 vp9: Non-rd pickmode: Avoid computation duplication.
In non-rd pickmode (speed >= 5), avoid duplication of computations in
model_rd_for_sb_y when the speed feature use_simple_block_yrd is
enabled (or for high bitdepth build under certain conditions).

QVGA, VGA and HD have 1.23%, 2.68% and 1.7% speedup on ARM for speed 8,
respectively.

Encoding results are bitexact for speed >= 5.

Change-Id: I3f9130810c21439f5ad7e159e21cb2243dcd05f1
2017-04-20 16:20:59 -07:00
Jerome Jiang
25c1bada72 Fix the decoder seg fault when frame is corrupted.
BUG=webm:1399

Change-Id: I1e006e0260d9b56a4d2273659ca19b86c69c474b
2017-04-20 14:55:42 -07:00
Marco
29938b3a5a vp9: 1 pass SVC: Fix comment and condition for up-sampling reference.
No change in behavior.

Change-Id: I218fb30289091da623acb23324027435b8510d0e
2017-04-20 14:21:05 -07:00
Yunqing Wang
30ef50b522 Merge "Only allow allow_exhaustive_searches for FC_GRAPHICS_ANIMATION content" 2017-04-20 19:57:46 +00:00
Marco Paniconi
17559cd8b5 Merge "vp9: Re-enable SVC datarate tests." 2017-04-20 19:53:20 +00:00
Marco
85ca2e8a8b vp9: Re-enable SVC datarate tests.
Re-enable the SVC tests, wrap the non-zero expectation
in GetMismatchFrames around #if CONFIG_VP9_DECODER.

Change-Id: I0e8a2d78b868c32f18fe597540f397d3a1b303b5
2017-04-20 12:08:08 -07:00
Marco
3134a52d26 vp9: SVC: Redefine the source downsample filter choice.
Rename the source downsampling filter, and define it
per spatial layers. Used 1 pass CBR SVC.

Change-Id: I8135f2ab89c535c53429b9c58b586f746bb668c7
2017-04-20 10:17:13 -07:00
Luca Barbato
8975436466 ppc: Add the intra predictor tests
Change-Id: Idea15b916044ab3d8e74519337880a484ecfd87e
2017-04-19 20:21:40 -07:00
Luca Barbato
914b160fb5 ppc: h predictor 8x8
Slightly faster with the current compiler.

Change-Id: Iae225fac08395eb430c97a2abec69c60f5cf5c47
2017-04-19 19:57:51 -07:00
Luca Barbato
0b9be93205 ppc: d63 predictor 8x8
10x faster.

Change-Id: I7cedbf4df2ce7df5b6f1108b11815d088fdb9ba8
2017-04-19 19:57:51 -07:00
Luca Barbato
ee9325b0bd ppc: tm predictor 4x4
Slightly faster.

Change-Id: I0ca43f309b3d9b50435d69bd5be64b53a99bd191
2017-04-19 19:57:51 -07:00
Luca Barbato
2904eb5800 ppc: h predictor 4x4
2x faster.

Change-Id: I0583dec353299c6797401b646099f18db4e0420d
2017-04-19 19:57:51 -07:00
Luca Barbato
58245d7050 ppc: dc predictor 8x8
Slightly faster, the other dc predictors cannot be faster since
the computation speedup is overwhelmed by the time spent reading
dst to write just the 8x8 part.

Change-Id: I94a0b50500adf8b7b6bb919dbf5c7adf5b9fba66
2017-04-19 19:57:51 -07:00
Luca Barbato
6b4a65e8b1 ppc: d45 predictor 8x8
11x faster.

Change-Id: I5b8f39213ee1f5260724fc254e3fb5c462435798
2017-04-19 19:57:51 -07:00
Luca Barbato
92e33c7b31 ppc: d63 predictor 32x32
About 10x faster.

Change-Id: If7d0645f75c5d7deb9751edd0bf47e2f9068e9e7
2017-04-19 19:57:51 -07:00
Luca Barbato
a5469a00a8 ppc: d63 predictor 16x16
About 18x faster.

Change-Id: Id043bf76c011e03e992085bb5e20f330d3e98cd4
2017-04-19 19:57:51 -07:00
Luca Barbato
cc868da526 ppc: d45 predictor 32x32
About 12x faster.

Change-Id: I22c150256aefb4941861ab1f6c17d554fb694bed
2017-04-19 19:57:51 -07:00
Luca Barbato
7a7dc9e624 ppc: d45 predictor 16x16
About 16x faster.

Change-Id: Ie5469fb32d5fd11bb6cb06318cea475d8a5b00b9
2017-04-19 19:57:51 -07:00
Luca Barbato
c08baa2900 ppc: dc predictor 32x32
10x and 5x faster.

Change-Id: I7913c58c768334d818f541a5e219f1035791eeaf
2017-04-19 19:57:47 -07:00
Luca Barbato
22ca468c7c ppc: dc top and left predictor 32x32
6x faster.

Change-Id: I717995b4056e5579c68191d11b495372971fe1ae
2017-04-19 19:49:31 -07:00
Luca Barbato
ad9dea1f6d ppc: dc top and left predictor 16x16
13x faster.

Change-Id: I1771ac39fda599153f933cb3f0506c9f97a6cbe6
2017-04-19 19:49:31 -07:00
Luca Barbato
d68d37872c ppc: dc_128 predictor 32x32
6x faster.

Change-Id: I1da8f51b4262871cb98f0aa03ccda41b0ac2b08b
2017-04-19 19:49:31 -07:00
Luca Barbato
f9d20e6df2 ppc: dc_128 predictor 16x16
20x faster.

Change-Id: I05f0deb2d38ae7966eae6b71fbc0aa51880e5709
2017-04-19 19:49:31 -07:00
Luca Barbato
0d9417de4a ppc: tm predictor 32x32
About 8x faster.

Change-Id: I9bad827ccbdf47ec95406e961c74ac2ff45f80cf
2017-04-19 19:49:26 -07:00
James Zern
a81f037f15 Merge changes I1f5a3752,I95123051,I3bb724e0,Ie81077fa,Ic80f3c05, ...
* changes:
  ppc: tm predictor 16x16
  ppc: tm predictor 8x8
  ppc: horizontal predictor 32x32
  ppc: horizontal predictor 16x16
  ppc: vertical intrapred 16x16 and 32x32
  configure: Workaround clang not enabling altivec on -mvsx
  configure: Match power*64* as ppc64
2017-04-20 02:45:45 +00:00
Yunqing Wang
e96e49c2f9 Only allow allow_exhaustive_searches for FC_GRAPHICS_ANIMATION content
The allow_exhaustive_searches feature improves the encoding quality
of FC_GRAPHICS_ANIMATION content a lot. For non-FC_GRAPHICS_ANIMATION
content, the quality test result is almost neutral. This patch makes
this feature to be used only for FC_GRAPHICS_ANIMATION content.

The motivation of doing that is to make this feature no longer adaptive,
which will be implemented in the following patch.

Change-Id: Ic911df6dd757402b6480789cc247801e99840369
2017-04-20 00:03:27 +00:00
Linfeng Zhang
fbbdba3b04 Merge changes I9e18a73b,Ie47c8cd4
* changes:
  Clean CONVERT_TO_BYTEPTR/SHORTPTR in convolve
  Create CAST_TO_BYTEPTR/SHORTPTR
2017-04-19 23:55:58 +00:00
Linfeng Zhang
bf8a49abbd Clean CONVERT_TO_BYTEPTR/SHORTPTR in convolve
Replace by CAST_TO_BYTEPTR/SHORTPTR.
The rule is: if a short ptr is casted to a byte ptr, any offset
operation on the byte ptr must be doubled. We do this by casting to
short ptr first, adding offset, then casting back to byte ptr.

BUG=webm:1388

Change-Id: I9e18a73ba45ddae58fc9dae470c0ff34951fe248
2017-04-19 12:13:49 -07:00
Marco Paniconi
977356a72b Merge "vp9: Add phase to get averaging filter for 1:2 downsampling." 2017-04-19 15:27:55 +00:00
Marco
f34be01190 vp9: Fix the disabling of a SVC 3TL datarate test.
Change-Id: Ib42d23ab5ee39ab3c85e1d9a84e36249e59fe74e
2017-04-19 08:01:44 -07:00
Marco
348bdc0195 vp9: Add phase to get averaging filter for 1:2 downsampling.
The scaling filter with zero shift will give sub-sampling for
2x downsampling. Allow for a phase shift to get an averaging filter.

Usage is for source scaling in 1 pass SVC mode for 1:2 downscale.
Reduces aliasing in downsampled image.

Keep the phase to 0/off for now.

Change-Id: Ic547ea0748d151b675f877527e656407fcf4d51e
2017-04-18 16:56:15 -07:00
Luca Barbato
479443a570 ppc: tm predictor 16x16
About 10x faster.

Change-Id: I1f5a3752d346459df3b45f92963208bf3e520f06
2017-04-19 01:48:10 +02:00
Luca Barbato
c8f5a55df4 ppc: tm predictor 8x8
About 5x faster.

Change-Id: I951230517f49c0dca9ac9eac2efa8916a303b85a
2017-04-19 01:48:09 +02:00
Luca Barbato
7b0e12934e ppc: horizontal predictor 32x32
About 5x faster.

Change-Id: I3bb724e07baffd901aa2d0f65060ba48882cc9b8
2017-04-19 01:48:09 +02:00
Luca Barbato
a7a2d1653b ppc: horizontal predictor 16x16
About 10x faster.

Change-Id: Ie81077fa32ad214cdb46bdcb0be4e9e2c7df47c2
2017-04-19 01:48:09 +02:00
Luca Barbato
7ad1faa6f8 ppc: vertical intrapred 16x16 and 32x32
Change-Id: Ic80f3c050cfbe7697e81a311b4edaaa597b85cab
2017-04-19 01:48:09 +02:00
Luca Barbato
a39b723eb3 configure: Workaround clang not enabling altivec on -mvsx
The flag `-mvsx` implies `-maltivec`.

Change-Id: I7544553eba131a533467b387f8bf329d57f5af5c
2017-04-19 01:48:04 +02:00
Luca Barbato
3252e6b63d configure: Match power*64* as ppc64
Change-Id: Ie640dff50a5db935bb57c5a2570b423ce8946f2c
2017-04-19 01:47:56 +02:00
Linfeng Zhang
a02f391cbe Create CAST_TO_BYTEPTR/SHORTPTR
They will replace CONVERT_TO_BYTEPTR/SHORTPTR module by module.

BUG=webm:1388

Change-Id: Ie47c8cd4897696481b9cbbf9e2d439dc22dc85ec
2017-04-18 14:48:11 -07:00
Marco
15afee1938 vp9: Disable some SVC tests for now.
Disable the 1 pass CBR SVC tests with temporal_layers > 1.
Issue with the commit 863f860, which will cause encoder/decoder
mismatch due to skipping encoder loopfilter for non-reference frames.

Will re-enable the tests when fixed.

Change-Id: I74918a0045a17976b069c4be63fbeb921974df0d
2017-04-18 09:51:42 -07:00
Marco
ad2e3598d2 vp9: Add key_frame condition to is_reference check for loopfilter.
This condiiton is not needed as key_frame should set the refresh
of the reference frames, but good to have for clarity in condition.

Change-Id: Icf9838e7e4f0ff5cf0a9562ae3b5d6c7e6f78702
2017-04-17 15:18:46 -07:00
Johann Koenig
a6095333a7 Merge "re-enable vpx_comp_avg_pred_sse2" 2017-04-17 22:07:34 +00:00
Marco Paniconi
9aa429a66d Revert "Revert "vp9: Avoid encoder loopfilter for non-reference frames.""
This reverts commit e9b7f98c56b3b9c99a60eb41b83bf8346b3ad25f.

Reason for revert:
Commit d578bdad fixes the issue (encoder/decoder mismatch
in 3TL datarate test) that causes the original revert.

Original change's description:
> Revert "vp9: Avoid encoder loopfilter for non-reference frames."
>
> This reverts commit 863f860bfcf3bdc26eeecb299aa481d0f63d11ac.
>
> This causes encoder / decoder mismatches in various
> VP9/DatarateTestVP9Large.BasicRateTargeting3TemporalLayers tests
>
> BUG=webm:1408
>
> Change-Id: Ic200c39d7ed9c0b0247ef562f5d6f7b2625f7e14
>

TBR=jzern@google.com,marpan@google.com,builds@webmproject.org,jianj@google.com
BUG=webm:1408

Change-Id: Ifeb81460856d1d56482d4e0477a70ee98f8bfaa6
2017-04-17 11:02:02 -07:00
Marco
d578bdad02 vp9: Datarate test: modify frame flags for 3 TL.
Modify the frame flags to update the ARF on top layer,
for the tests:
VP9/DatarateTestVP9Large.BasicRateTargeting3TemporalLayers
VP9/DatarateTestVP9Large.BasicRateTargeting3TemporalLayersFrameDropping

This is needed to fix the encode/decoder mismatches caused by 863f860,
and removed in the revert e9b7f98.

Change-Id: I6b9fecfdd17315fc0179e29949338c77636026c0
2017-04-17 09:33:20 -07:00
Johann
9fa24f03b5 re-enable vpx_comp_avg_pred_sse2
Buffers on 32 bit x86 builds only guaranteed 8 byte alignment. Fixed
with "AvgPred test: use aligned buffers" and "sad avg: align
intermediate buffer"

Also re-enable asserts on the C version.

BUG=webm:1390

Change-Id: I93081f1b0002a352bb0a3371ac35452417fa8514
2017-04-17 08:40:43 -07:00
Johann Koenig
9e19102972 Merge "AvgPred test: use aligned buffers" 2017-04-17 15:36:41 +00:00
Johann
069b772915 sad avg: align intermediate buffer
comp_avg_pred has started declaring a requirement for aligned buffers.

BUG=webm:1390

Change-Id: Idaf6667498ea343e8d49b32bc9d8b9d0aa43ef5c
2017-04-17 14:26:33 +00:00
James Zern
4ba20da8b1 Merge "Add AVX2 optimization to copy/avg functions" 2017-04-15 00:26:08 +00:00
Yi Luo
aa5a941992 Add AVX2 optimization to copy/avg functions
Change-Id: Ibcef70e4fead74e2c2909330a7044a29381a8074
2017-04-14 16:50:10 -07:00
Johann Koenig
7178e68bbe Merge "Disable vpx_comp_avg_pred_sse2" 2017-04-14 22:01:39 +00:00
Johann
e3b2710b04 AvgPred test: use aligned buffers
BUG=webm:1390

Change-Id: Idb6d1ce119a09c5e7c9f3c58bbbae3de63463d1d
2017-04-14 12:49:56 -07:00
James Zern
e9b7f98c56 Revert "vp9: Avoid encoder loopfilter for non-reference frames."
This reverts commit 863f860bfcf3bdc26eeecb299aa481d0f63d11ac.

This causes encoder / decoder mismatches in various
VP9/DatarateTestVP9Large.BasicRateTargeting3TemporalLayers tests

BUG=webm:1408

Change-Id: Ic200c39d7ed9c0b0247ef562f5d6f7b2625f7e14
2017-04-14 11:50:06 -07:00
Marco
5f39262dcc vp9: Adjust speed features for speed 8 at low resoln.
For low resolutions (<= CIF): use quarter-pixel and simple_block_yrd.

~5% gain on RTC_derf.
~6-7% slowdown on ARM.

Change-Id: I4439ebd1116b9decac04786503f978840b68a60c
2017-04-14 11:35:47 -07:00
Marco Paniconi
b937f1c839 Merge "vp9: SVC: fix to allow use_base_mv to be used for 3 layers." 2017-04-14 17:12:58 +00:00
Johann
eaa7cdf05d Disable vpx_comp_avg_pred_sse2
Failures on windows:
unknown file: error: SEH exception with code 0xc0000005 thrown in the
test body.

Alignment check errors on linux:
test_libvpx: ../libvpx/vpx_dsp/variance.c:230: void
vpx_comp_avg_pred_c(uint8_t *, const uint8_t *, int, int, const uint8_t
*, int): Assertion `((intptr_t)comp_pred & 0xf) == 0' failed.

BUG=webm:1390

Change-Id: I5eed5381c0f1a8fe594a128eb415e77232f544ea
2017-04-14 08:43:06 -07:00
Johann Koenig
bdb593ab20 Merge "vpx_comp_avg_pred: sse2 optimization" 2017-04-14 04:10:56 +00:00
Marco
adb9b4eddf vp9: SVC: fix to allow use_base_mv to be used for 3 layers.
Allow use_base_mv to be used for 3 spatial layers where
base is 4x4 scale from the top layer.

Change-Id: If6641baf8b8e4d0fd5dc67619d873c6d75065f43
2017-04-13 20:43:43 -07:00
Marco Paniconi
f0ccaff553 Merge "vp9: Avoid encoder loopfilter for non-reference frames." 2017-04-14 00:45:42 +00:00
Marco
6bff6cb5a9 vp9: 1 pass VBR: Fix to rate control at low min-q.
Fix to avoid getting stuck at very low Q even
though content is changing, which can happen for --min-q=0.

Fix is to more aggressively increase active_worst_quality
when detecting significant rate_deviation at very low Q.

Change will only affect 1 pass VBR for --min-q < 4, so no
change in ytlive metrics for --min-q >= 4.

Change-Id: I4dd77dd7c08a30a4390da0ff2c8bda6fccfa76d7
2017-04-13 11:44:35 -07:00
Marco
863f860bfc vp9: Avoid encoder loopfilter for non-reference frames.
Useful for SVC, where the top layer enhancement frames may
not update any reference buffers, as is the case for the
patterns in the 1 pass CBR SVC when #temporal_layers > 1.

~3% encoder speedup for SVC patterns with temporal layers
in 1 pass CBR mode.

Updated the SVC datarate tests for the mismatch frames.
Set the frame-dropper off in some tests with #temporal_layers > 1
so we can correctly set #mismatch frames. Adjusted rate target
threshold for tests where frame-dropper was turned off.

Change-Id: Ia0c142f02100be0fed61cd2049691be9c59d6793
2017-04-13 09:51:55 -07:00
Johann
28a8622143 vpx_comp_avg_pred: sse2 optimization
Provides over 15x speedup for width > 8.

Due to smaller loads and shifting for width == 8 it gets about 8x
speedup.

For width == 4 it's only about 4x speedup because there is a lot of
shuffling and shifting to get the data properly situated.

BUG=webm:1390

Change-Id: Ice0b3dbbf007be3d9509786a61e7f35e94bdffa8
2017-04-13 08:44:52 -07:00
Yunqing Wang
f22b828d68 Fix an integer overflow in vp9_mcomp.c
The MV unit test revealed an integer overflow issue in vp9_mcomp.c.
This was caused if the MV was very large. In mv_err_cost(), when
mv->row = 8184, mv->col = 8184 and ref_mv is 0, mv_cost = 34363
and error_per_bit = 132412, causing the overflow.

BUG=webm:1406

Change-Id: I35f8299f22f9bee39cd9153d7b00d0993838845e
2017-04-10 18:09:50 -07:00
Jerome Jiang
2420f44342 Merge "vp9: speed >= 8: Adjust speed settings on ARM." 2017-04-11 00:45:21 +00:00
Jerome Jiang
f16f08e55b vp9: speed >= 8: Adjust speed settings on ARM.
Set adaptive_rd_thresh to 2 when simple block yrd is not used.

Fix regression caused by computing y sad without
int_pro_motion_estimation on low res motion clips.

Overall 0.07% quality loss on rtc_derf.

Change only affects low res on speed 8.

Change-Id: Ic6a188a56529f1034d6431005fb4b0e24e8a7e27
2017-04-11 00:26:56 +00:00
Marco
6557baf336 vp9: 1 pass CBR: avoid nonrd_pick_partition on segment.
For speed 5, 1 pass CBR: Don't use the nonrd_pick_partition
on the segment, rather use choose_partitioning followed by
nonrd_select_partition (as is done on base segment).

Little/no quality loss on RTC and RTC_derf (< 0.3%),
speedup of at least 5%.

Change-Id: I5273d5f950e60adf5e437b4ca8c4f63964641e83
2017-04-10 15:02:49 -07:00
Marco Paniconi
ff1fef9607 Merge "vp9: Fix to noise estimation for temporal denoising." 2017-04-07 17:13:22 +00:00
Yunqing Wang
f496032686 Merge "VP9 motion vector unit test" 2017-04-07 16:46:22 +00:00
Marco
349c3118bd vp9: Fix to noise estimation for temporal denoising.
If the noise estimation is avoided due to large motion,
the last_source for denoising should still be updated.

Change-Id: I67155ea7dbe9ac2785978e64a27bdafd7d57aac0
2017-04-07 09:23:30 -07:00
Marco
18b54ef468 vp9: Adjust consec_zeromv threshold for aq-mode=3.
To reduce refresh on partial super-blocks on boundary,
for noisy input. Reduces some artifacts on noisy input.

Change-Id: I10b5808a296874e08c7f378b3df58466591d8dbe
Edit
2017-04-07 08:54:09 -07:00
James Zern
04e9456567 Merge changes from topic 'Wshorten'
* changes:
  configure: enable -Wshorten-64-to-32 for hbd
  vp9_encodeframe: resolve -Wshorten-64-to-32 in hbd
  Resolve -Wshorten-64-to-32 in highbd variance.
2017-04-07 07:32:14 +00:00
Jerome Jiang
6af42f5102 Merge "Fix compile warnings with enable-internal-stats flag." 2017-04-07 03:34:55 +00:00
Jerome Jiang
b82b574e76 Fix compile warnings with enable-internal-stats flag.
BUG=webm:1402

Change-Id: Ibe9ecb1b559a4b989f6ccedbd097e369f6edde1e
2017-04-06 14:00:01 -07:00
Marco
3227a9be5f vp9; Move the denoising condition for speed 5.
Move the condition for effectively disabling the denoising
for speed 5 into the vp9_denoiser_denoise().

This is cleaner, and also moving the condition into vp9_denoiser_denoise
will keep the denoiser buffer updated with the current source.
This allows for more consistent behavior if speed is changed midstream.

Change-Id: Ia001f591c56e454bf724c3ae73c024badb183ef8
2017-04-06 11:03:04 -07:00
Jerome Jiang
c9fbb1881a Merge "vp9: speed 8: Compute y sad without int_pro_motion_estimation." 2017-04-06 02:57:16 +00:00
Jerome Jiang
705fc9f107 Merge "Refactor: Clean memory allocation for copy partition." 2017-04-06 02:57:08 +00:00
Yunqing Wang
1aa46abbdf VP9 motion vector unit test
To prevent the motion vector out of range bug, added a motion vector unit
test in VP9. In the 4k video encoding, always forced to use extreme motion
vectors and also encouraged to use INTER modes. In the decoding, checked if
the motion vector was valid, and also checked the encoder/decoder mismatch.

The tests showed that this unit test could reveal the issue we saw before.

Change-Id: I0a880bd847dad8a13f7fd2012faf6868b02fa3b4
2017-04-06 00:50:56 +00:00
James Zern
7ac3acf762 configure: enable -Wshorten-64-to-32 for hbd
Change-Id: I4041f3fc4aabc7a2251c44c75a477b659284c3cf
2017-04-05 17:34:06 -07:00
James Zern
b3e2eb14c5 vp9_encodeframe: resolve -Wshorten-64-to-32 in hbd
vp9_high_get_sby_perpixel_variance the variance operated on in is
already in 32-bits

Change-Id: I97006eb9c08dbd0f88ee35e1a1ca205737508296
2017-04-05 17:34:06 -07:00
James Zern
47b9a09120 Resolve -Wshorten-64-to-32 in highbd variance.
For 8-bit the subtrahend is small enough to fit into uint32_t.

This is the same that was done for:
c0241664a Resolve -Wshorten-64-to-32 in variance.

For 10/12-bit apply:
63a37d16f Prevent negative variance

Change-Id: Iab35e3f3f269035e17c711bd6cc01272c3137e1d
2017-04-05 17:34:02 -07:00
Jerome Jiang
288d73c861 vp9: speed 8: Compute y sad without int_pro_motion_estimation.
Little change in overall PSNR in rtc. 2-4% speedup on VGA on ARM.

Change-Id: I3395806d7afd456deacd4077c330adca13ab0645
2017-04-05 17:25:47 -07:00
Marco Paniconi
511a207444 Merge "vp9: Temporal denoising: avoid denoising for speed <= 5." 2017-04-06 00:25:45 +00:00
Marco
2136de9374 vp9: Temporal denoising: avoid denoising for speed <= 5.
Temporal denoiser runs in non-rd pickmode, so it is only used
for speed >= 5. Regression exists for speed 5, due to use of
reference_partition (which use non-rd pickmode for partitioning).
Avoid denoising for now at speed 5.

Change-Id: I74a74d2e1404d7cfd33dcf4ec06dd2e503256cf0
2017-04-05 16:43:39 -07:00
Jerome Jiang
58ba880b94 Refactor: Clean memory allocation for copy partition.
Move the memory allocation from setting speed features.

Change-Id: I2e89dfaeb46daee63effe5a5df62feed732aa990
2017-04-05 15:33:24 -07:00
Linfeng Zhang
6fc2e57c2c Update 32x32 high bitdepth idct NEON optimization
Preparation of CONVERT_TO_BYTEPTR/SHORTPTR clean up.

BUG=webm:1388

Change-Id: I928d30a5698023bb90888d783cf81c51ec183760
2017-04-05 15:28:11 -07:00
Jerome Jiang
fb60204d4c vp9: Remove legacy comments for avg_source_sad.
Change-Id: Ia6e8614535a097f17f37fc382cef8e22e03b70f6
2017-04-04 16:28:27 -07:00
Marco
8097b49997 vp9: Adjust condition of golden update with cyclic refresh.
Base the low_content_frame metric on the motion vectors,
and adjust the logic for preventing golden update.

Small change in behavior: small positive gain (~0.2-1%) on clips
with high activity.

Change-Id: I0b861c8e9666cd82b45cde5ee57ee8a1e5ab453c
2017-04-04 09:55:24 -07:00
Marco
6b3f4bc794 vp9: 1 pass CBR: cleanup to cyclic refresh.
Code cleanup: merged two functions that were doing postencode
update for cylic refresh, remove some unused code and fix comments.

No change in behavior.

Change-Id: I9be0d7e346d34dec29bf4e5bb380a7bf81c8480a
2017-04-03 16:37:45 -07:00
Yunqing Wang
41fac44707 Merge "Fix for out of range motion vector bug in sub-pel motion estimation" 2017-04-03 18:27:57 +00:00
Marco Paniconi
9d403d6f48 Merge "vp9: SVC: Fix issue with artifact for svc-denoising." 2017-04-03 16:23:25 +00:00
Ranjit Kumar Tulabandu
bf15ca1091 Fix for out of range motion vector bug in sub-pel motion estimation
BUG=webm:1397

(yunqingwang)
To verify that this patch wouldn't cause much performance change,
the Borg tests were run. Here was the result:
       avg_psnr   overall_psnr  ssim
hdres: -0.002     0.006         0.013
midres:   0         0             0
lowres:   0         0             0

Change-Id: Iae395ae7b741e0513cf5bab9dcace110b792a67d
2017-04-03 16:16:49 +00:00
Yunqing Wang
002cf38837 Merge "Enhance the row mt sync read to accept the sync_range greater than 1" 2017-04-03 15:59:51 +00:00
Yunqing Wang
f1600db3e4 Enhance the row mt sync read to accept the sync_range greater than 1
The row mt sync read uses sync_range = 1, and wouldn't work if we want
to use a sync_range that is greater than 1. To make it work, this sync
read code is modified. Pass in col instead of col - 1 to make it
consistent with other row mt code in VP9, and then add 1 in "while"
codition.

Change-Id: I4a0e487190ac5d47b8216368da12d80fec779c1a
2017-03-31 10:48:38 -07:00
Marco
c824eda6cc vp9: SVC: Fix issue with artifact for svc-denoising.
Issue/bug happens for denoising with spatial layers, where
the golden (spatial) reference is used in pickmode, but
denoising is only done wrt to last (temporal).

Fix is to make sure set_ref_ptrs is set before build predictors
in denoiser.

Change-Id: I793cf441341edf7c4a88b8ab1e1b22b3cb0eb508
2017-03-31 10:05:32 -07:00
James Zern
8e7c5a3c8d Merge changes from topic 'rm-dec-frame-parallel'
* changes:
  vpxdec: silently ignore -frame-parallel
  vp9: make VPX_CODEC_USE_FRAME_THREADING a no-op
2017-03-30 19:07:44 +00:00
James Zern
6fed5692d2 vpxdec: silently ignore -frame-parallel
BUG=webm:1395

Change-Id: Ibf47cc931e51b71e49067c6d7b7a39ab57c11c96
2017-03-29 23:39:12 -07:00
James Zern
01d23109ab vp9: make VPX_CODEC_USE_FRAME_THREADING a no-op
this is unmaintained and due to be removed

BUG=webm:1395

Change-Id: Iaffa6aa057c820fd1a182b93ebb45d4286e1306e
2017-03-29 23:38:49 -07:00
James Zern
7fde349b25 rtcd,unit tests: fix ppc64 build
match ppc* in rtcd to ensure vsx is included

Change-Id: I331a5d35e7160eeb69ebd14b98ba03ec5be6c600
2017-03-29 22:51:22 -07:00
Marco
fc83fcb7c4 vp9: SVC: fix to allow output of denoised result.
Change-Id: Iaf55cfb5e9621d074eb33d6a32f184e4777968f8
2017-03-29 14:02:54 -07:00
Marco
32b3d2f174 vp9: 1 pass SVC: Modify condition for intra-mode search.
Temporary override to condition for disallowing intra-search in SVC,
since golden (spatial) reference is currently suppressed due to
artifact issue.

Change-Id: I28ed7fdddc9fcdbcc0a4175a247a3ecc94c11767
2017-03-29 09:24:50 -07:00
James Zern
fe432cacf8 Merge "rate_hist: add parameter validation" 2017-03-29 02:41:07 +00:00
James Zern
ddd75573a7 Merge changes from topic 'sync-highbd-intrapred'
* changes:
  intrapred: sync highbd_d135_predictor w/d135_
  intrapred: specialize highbd 4x4 predictors
  intrapred: rename d63f to d63e
  remove CONFIG_MISC_FIXES
2017-03-29 02:39:21 +00:00
James Zern
3cc57e67a9 Merge ".mailmap: add an additional entry for Yaowu Xu" 2017-03-29 01:56:57 +00:00
Johann Koenig
eec92e8a5b Merge "vpx_comp_avg_pred: add test" 2017-03-28 21:50:01 +00:00
Johann
6e99ed72a5 vpx_comp_avg_pred: add test
BUG=webm:1389

Change-Id: I23cd65f1939db026958ccb5d70b8c5cc9aa5bc51
2017-03-28 14:11:14 -07:00
Marco
0169a985d9 vp9: Speed >= 8: avoid chrome check under some condition.
For non-rd variance partition, avoid the chrome check
unless y_sad is below some threshold.

Small decrease in avgPSNR (~0.3) on RTC set.
Small/negligible decrease on RTC_derf.

Change-Id: I7af44235af514058ccf9a4f10bb737da9d720866
2017-03-27 13:18:21 -07:00
Marco
66c6b4d6fc vp9: 1 pass: Move source sad computation into encodeframe loop.
Refactor to split the 1 passs source sad computation into scene
detection (currently used for VBR and screen-content mode), and
superblock based source sad computation (used in non-rd CBR mode).

This allows the source sad computation for CBR mode to be
multi-threaded.

No change in compression.

Change-Id: I112f2918613ccbd37c1771d852606d3af18c1388
2017-03-27 11:11:05 -07:00
James Zern
aefc1088a2 intrapred: sync highbd_d135_predictor w/d135_
previously:
05437805f intrapred/d135: flatten border results before storing

BUG=webm:1316

Change-Id: I3b8bd89117ad7f2f4560b57f7c148da781e86f85
2017-03-24 20:45:44 -07:00
James Zern
67cde46dd7 intrapred: specialize highbd 4x4 predictors
d207/d63/d45/d117/d135/d153

~9-45% better depending on the predictor on 32-bit ARM, similar range on
x86-64

this matches the non-highbitdepth implementation

BUG=webm:1316

Change-Id: Iddebdf7c58c6f31c47cae04da95c6e5318200e4c
2017-03-24 20:45:36 -07:00
James Zern
e05f4cf8f4 intrapred: rename d63f to d63e
this is consistent with he/ve/d45e

Change-Id: I75641ae5667430b0ecd370db86fff6e666cb577d
2017-03-24 20:41:39 -07:00
James Zern
d45617c702 remove CONFIG_MISC_FIXES
this belonged to vp10 with the changes now migrated to av1.

Change-Id: Ie30ead3e7b71f465bc14136e1b6f156ea978c43f
2017-03-24 20:41:39 -07:00
Marco
07ad5a15c2 vp9: Fix to condition on using source_sad for 1 pass real-time.
Make the source_sad feature work properly for cases of VBR or
screen_content with SVC.

Added unittest for SVC with screen-content on.

Change-Id: Iba5254fd8833fb11da521e00cc1317ec81d3f89b
2017-03-24 10:21:47 -07:00
James Zern
4ffdf60b85 rate_hist: add parameter validation
tolerate a NULL hist being passed as a result of invalid parameters
passed to init_rate_histogram(). this fixes a divide by zero in
init_rate_histogram() with an invalid fps.

BUG=webm:1383

Change-Id: Id203e0f3b18d67a4a09aaf206abcce4708f966ec
2017-03-23 14:50:00 -07:00
Johann Koenig
10164407fb Merge "vp9 temporal filter: additional test" 2017-03-23 18:38:36 +00:00
Alex Converse
d7b220b467 Merge changes Ie989e60c,Ifc110b12
* changes:
  Backport "Optimize the use case of token_cost table" to VP9
  Drop vp9_get_token_extracost
2017-03-23 18:05:13 +00:00
Marco Paniconi
d856157388 Merge "vp9: Non-rd partition: avoid unneeded call to chrome_check" 2017-03-23 14:17:48 +00:00
Kaustubh Raste
8ee9b855a0 Merge "Fix mips msa fwd xform mismatch" 2017-03-23 07:44:16 +00:00
Marco
4863e07c01 vp9: Non-rd partition: avoid unneeded call to chrome_check
Since y_sad is not computed yet (on the early exit due to source_sad),
no need to check for setting color_sensitiviy.

Only affects speed >=8. No change in behavior.

Change-Id: I3a6f2d20fed38d8b8ec51b75bcacf9a21f2db916
2017-03-22 22:40:28 -07:00
James Zern
f16ea6a6eb Merge "vp9_rdopt: correct size to vpx_sum_squares_2d_i16" 2017-03-23 00:53:22 +00:00
Marco Paniconi
ff0e0a76e8 Merge "vp9: Adjust some speed settings for speed 8." 2017-03-22 22:56:17 +00:00
Marco
4d50991320 vp9: Adjust some speed settings for speed 8.
Allow for simple_block_rd for VGA resoln, and reduce
adaptive_rd_thresh to 1.

On average no loss on RTC set, ~4% speedup on mac.

Change-Id: Ib549c4061c853776062b5e34040f839d470fbebc
2017-03-22 15:16:15 -07:00
Jerome Jiang
dcd6c87b80 Merge "vp9: Enable adaptive_rd_threshold for row mt for realtime speed 8." 2017-03-22 22:02:24 +00:00
Johann
83dd9b36f4 vp9 temporal filter: additional test
Change tests to reflect use. Input sizes will be 8 or 16 (but not
necessarily square).

filter_weight is capped at 2 and filter_strength at 6

Speed test, disabled by default.

Change-Id: Idfde9d6c4b7d93aaf0e641b0f4862c15e2a2af7a
2017-03-22 19:37:04 +00:00
Johann Koenig
c099d6be1c Merge "vp9 temporal filter: add const to function prototype" 2017-03-22 19:36:40 +00:00
James Zern
e097bb1d39 Merge "idct_neon: prefix non-static functions w/'vpx_'" 2017-03-22 19:30:11 +00:00
James Zern
5661cd8ff4 vp9_rdopt: correct size to vpx_sum_squares_2d_i16
the current implementations expect pixel size, not the block type

BUG=webm:1392

Change-Id: Ib91e9f30a1f56e13566b1fb76f089dae9bb50cdc
2017-03-22 12:04:33 -07:00
James Zern
f91c3bb3ab idct_neon: prefix non-static functions w/'vpx_'
Change-Id: I94fcdeae18468e6ef0cb7119b8142d982a048031
2017-03-22 11:49:23 -07:00
Johann
36d732c22b vp9 temporal filter: add const to function prototype
The input frames are not modified.

Change-Id: Ideb810e3c5afeb4dbdc4c7d54024c43a8129ad39
2017-03-22 18:14:21 +00:00
Kaustubh Raste
e45c1f55b4 Fix mips msa fwd xform mismatch
Change-Id: I32a6df11463144aa1a562256ee7d57a41fd678d6
2017-03-22 14:01:03 +05:30
Jerome Jiang
20c2892693 vp9: Enable adaptive_rd_threshold for row mt for realtime speed 8.
Change it to row based array to avoid the slow down cause by sync.
row-mt on, speed 8, 2 threads: ~4% speedup for VGA on ARM benefited
from adaptive_rd_threshold.

Change-Id: I887e65a53af20a6c4f48d293daaee09dab3512cf
2017-03-21 18:49:47 -07:00
Marco Paniconi
2fac50fa0e Merge "vp9: Modify datarate tests to cover denoising with multi-threading." 2017-03-21 23:44:05 +00:00
Jerome Jiang
74f4c5cd12 Merge "Fix the data race caused by vp9 denoiser." 2017-03-21 23:27:48 +00:00
Marco
4ddde47d8c vp9: Modify datarate tests to cover denoising with multi-threading.
Change-Id: I6ed48a630edf9923c25a05deaca50e0afec43918
2017-03-21 15:57:33 -07:00
Jerome Jiang
dbed479d79 Fix the data race caused by vp9 denoiser.
BUG=webm:1391

Change-Id: I9669ae62fe9c695d4c6f9973094cb0f39bed51c7
2017-03-21 15:46:25 -07:00
Yi Luo
cb9b277b2f Merge "Make butterfly_self() signature consistent with butterfly()" 2017-03-21 22:32:20 +00:00
Yunqing Wang
1935dfb294 Code refactoring in the partition search
Computed the partition search early termination score in a separate
function.

Change-Id: I1894b517ff179a38b1c05e054d373ac4b7f4cbb4
2017-03-21 10:00:44 -07:00
Yi Luo
266868a40b Make butterfly_self() signature consistent with butterfly()
- Refer to patch: 48fca113d inv_txfm_ssse3,butterfly: fix win32 abi
  compatibility.
- Change four butterfly() calls to butterfly_self(), to simplify the
  operations.

Change-Id: Ib2a8cfe6cddcaf0a59e6e6270d8380055ea42ef3
2017-03-21 09:36:35 -07:00
James Zern
6f13620761 .mailmap: add an additional entry for Yaowu Xu
Change-Id: I26b928848a7e72ff5ca25001ed6991c95f5992a5
2017-03-20 22:39:40 -07:00
James Zern
e0b4c4d1ae Merge "Add vpx_highbd_idct32x32_1024_add_neon()" 2017-03-21 03:27:35 +00:00
James Zern
6d71d33d55 Merge "Add vpx_highbd_idct32x32_34_add_neon()" 2017-03-21 03:02:51 +00:00
Marco Paniconi
05c7259525 Merge "vp9: Nonrd variance partition: improve split to 16x16." 2017-03-21 00:17:35 +00:00
Yunqing Wang
bf43b4c4b4 Merge "Record the sum of tx block eobs in the partition block" 2017-03-20 23:20:12 +00:00
Marco
3135b85423 vp9: Nonrd variance partition: improve split to 16x16.
Add additional condition to split to 16x16, for resolutions <= 360p,
reduces dragging artifact near moving boundary.

Small/no change on RTC metrics.

Change-Id: I314694f2166435d918f74e7ab42f002b07f40dae
2017-03-20 15:44:46 -07:00
Marco Paniconi
8dc1523057 Merge "vp9: Use sb content measure to bias against golden." 2017-03-20 21:35:12 +00:00
Marco
06c8713e89 vp9: Use sb content measure to bias against golden.
For each superblock, keep track of how far from current frame
was the last significant content change, and use that (along
with GF distance), to turnoff GF search in non-rd pickmode.

Only enabled for speed >= 8.

avgPNSR on RTC/RTC_derf down by ~0.9/1.2.
Speedup on mac: ~3-5%.
Speedup on arm: 3.6% for VGA and 4.4% for HD.

Change-Id: Ic3f3d6a2af650aca6ba0064d2b1db8d48c035ac7
2017-03-20 12:42:26 -07:00
Johann Koenig
d642dd4311 Merge "temporal filter test: update types" 2017-03-20 19:05:55 +00:00
Yunqing Wang
9c2552a1c1 Record the sum of tx block eobs in the partition block
The sum of tx bloxk eobs is needed in the machine learning based partition
early termination. The eobs are first accumulated during tx search, and
then the value associated with the best tx_size is copied to ctx for later
use.

After the sum of eobs are calculated correctly, re-enabled
ml_partition_search_early_termination speed feature.

Re-did the quality/speed test to check the impact of the fix.

1. Borg test BDRATE result:
4k set:     PSNR: +0.183%; SSIM: +0.100%;
hdres set:  PSNR: +0.168%; SSIM: +0.256%;
midres set: PSNR: +0.186%; SSIM: +0.326%;

2.Average speed gain result:
4k clips: 21%;
hd clips: 26%;
midres clips: 15%.

The result is in line with the original result.

Change-Id: I4209a95c89be03b4cbfb6a95b16885f89feddbda
2017-03-20 17:12:15 +00:00
Jingning Han
ca9bedd538 Backport "Optimize the use case of token_cost table" to VP9
cherry picked from nextgenv2 90ea281f29df747282e56d3068a3ddbdde30cdd0

Change-Id: Ie989e60c6479ac3251cadaac9c7e795ccba52f4e
2017-03-17 16:54:22 -07:00
Alex Converse
ab71181545 Drop vp9_get_token_extracost
vp9_get_token_cost does the same thing with one fewer lookup.

Change-Id: Ifc110b12403cb1a04a3f91357ab435c67b4815d6
2017-03-17 16:53:09 -07:00
James Zern
36533e8c5a Merge "inv_txfm_sse2: clear conversion warning in hbd build" 2017-03-17 21:48:20 +00:00
Johann
775569473d temporal filter test: update types
Use 'int' for w/h since it is that way everywhere else.

Pass Buffer pointers

Change-Id: I9eef6890af657baba171c6bcfcc85fc976173399
2017-03-17 13:22:28 -07:00
Johann Koenig
9675affae0 Merge "test: add vp9_temporal_filter_apply test" 2017-03-17 18:18:06 +00:00
Alex Converse
0842daa24e Merge "vp9_optimize_b: Combine extrabits cost with token lookup" 2017-03-17 16:18:21 +00:00
James Zern
5da2e500d7 inv_txfm_sse2: clear conversion warning in hbd build
tran_high -> tran_low in return from dct_const_round_shift()

Change-Id: I2fe06c4b604823b1d1fe40a487017c3c2819a440
2017-03-17 01:16:38 -07:00
Linfeng Zhang
27530d484e Add vpx_highbd_idct32x32_1024_add_neon()
BUG=webm:1301

Change-Id: Ib90af0c1712e56b301d0e981dbe9a641e15e36ca
2017-03-17 00:27:46 -07:00
Linfeng Zhang
50b13f75b8 Add vpx_highbd_idct32x32_34_add_neon()
BUG=webm:1301

Change-Id: I74dd16c6c64e7bb71aa991cedccddf0663ef5e06
2017-03-17 00:27:46 -07:00
James Zern
2882778310 Merge "Add vpx_highbd_idct32x32_135_add_neon()" 2017-03-17 07:26:52 +00:00
Linfeng Zhang
65e9fb65e8 Add vpx_highbd_idct32x32_135_add_neon()
BUG=webm:1301

Change-Id: I58c2d65d385080711c3666d6d8f9d241dac7b21a
2017-03-16 22:37:55 -07:00
James Zern
68efc64b72 Merge "Clean vpx_idct32x32_1024_add_neon()" 2017-03-17 05:24:58 +00:00
Marco
02975a604c vp9: Fix speed 8 condition for enabling copy_partition.
Change-Id: I2c090e6ba853a30fef1957b620853315f9471753
2017-03-16 17:08:37 -07:00
Alex Converse
3a6ec9ea72 vp9_optimize_b: Combine extrabits cost with token lookup
About 0.6% fewer cycles spent in vp9_optimize_b.

Change-Id: I2ae62a78374c594ed81d4e3100a5848e2f6f2c4e
2017-03-16 17:03:22 -07:00
Gabriel Marin
976ddb61d3 Add a vector form of routine vp9_model_rd_from_var_lapndz
Add routine vp9_model_rd_from_var_lapndz_vec and call it from model_rd_for_sb
to model the rate and distortion for MAX_MB_PLANE Laplacian sources in
parallel. The caller ensures that all sources have non-zero variance.

Measured a 18% to 25% reduction in retired instructions, and 17% to 24%
reduction in instruction execution cost with different compilers for the
Laplacian modeling.

No change in behavior.

TEST=Verified that encoded files match bit for bit, with and without this
change.
BUG=b/33678225

Change-Id: I6b76947f21c659a349adb896e13e99f6e3f951e6
2017-03-16 22:19:44 +00:00
Marco Paniconi
83ba1880bf Merge "vp9: Fixes in non-rd pickmode for denoising with SVC." 2017-03-16 21:53:38 +00:00
Johann Koenig
eeeb71ed97 Merge "Remove ppc-linux-gcc target" 2017-03-16 21:53:17 +00:00
Johann Koenig
cd3d7cf4ac Merge "Add Hadamard for Power8" 2017-03-16 21:52:15 +00:00
Marco
bc7d4935bb vp9: Fixes in non-rd pickmode for denoising with SVC.
Don't denoise spatial layer frames whose base layer is a key frame.

Disallow golden reference for SVC with denoising on frames
that will be denoised (highest layer), as this removes bad artifact.
Will re-enable when issue is resolved.

Change-Id: I87a6597812330500966458172acfce54af65f70f
2017-03-16 12:59:41 -07:00
Marco
ba8bfaafa7 vpx_codec.h: include vpx/*.h -> ./*.h
This matches the other includes and also fixes a compile issue in
chromium.

Change-Id: I45e00a1454f7ed948aa3b96b04cc5946b1d02985
2017-03-16 16:55:56 +00:00
Jerome Jiang
bf40776aa4 Merge "Refactor: Change cpi->resize_state to enum values." 2017-03-16 16:43:42 +00:00
Marco Paniconi
ec73bf53a5 Merge "vp8: Fix compiler warning in vp8 pickinter.c" 2017-03-16 05:13:38 +00:00
Rafael de Lucena Valle
405b94c661 Add Hadamard for Power8
Change-Id: I3b4b043c1402b4100653ace4869847e030861b18
Signed-off-by: Rafael de Lucena Valle <rafaeldelucena@gmail.com>
2017-03-15 23:46:18 -03:00
Marco Paniconi
cd47c1942e Merge "vp9: Fix some issues with denoiser and SVC." 2017-03-16 02:42:55 +00:00
Marco
a340c64a79 vp9: Fix some issues with denoiser and SVC.
Fix the update of the denoiser buffer when the base
spatial layer is a key frame. And allow for better/lower
QP on high spatial layers when their base layer is key frame.

Change-Id: I96b2426f1eaa43b8b8d4c31a68b0c6d68c3024a2
2017-03-15 17:19:17 -07:00
Jerome Jiang
b5f7f7737a Refactor: Change cpi->resize_state to enum values.
Change-Id: Iab1409b0fc1175bc5a14afc4749a08c536c98c41
2017-03-15 17:16:17 -07:00
Marco
2c8430e223 vp9: Turn off ml_partition_search_early_termination.
Fails on nightly ubsan, valgrind tests.
Enabled on commit:6701014

Change-Id: Ied3f5cb38e39cba54ac134f4514107cdfdfce159
2017-03-15 15:00:38 -07:00
Marco
deea4ede59 vp8: Fix compiler warning in vp8 pickinter.c
Change-Id: I0e5714538fe53d885a2201d808846901ae8fc288
2017-03-15 11:50:14 -07:00
Linfeng Zhang
e54231d613 Clean vpx_idct32x32_1024_add_neon()
Change-Id: I05921e16d6a3e4e7e5b00a90624735050a186636
2017-03-15 11:24:31 -07:00
Yi Luo
8440cc4817 Merge "Improve idct32x32_1024_add SSSE3 intrinsics performance" 2017-03-15 02:32:52 +00:00
Linfeng Zhang
d9a9a4ffea Merge "Fix overflow issue in 32x32 idct NEON intrinsics" 2017-03-15 00:38:17 +00:00
Jerome Jiang
27d5a57072 Merge "vp9: Using source sad for speedup for dynamic resizing." 2017-03-15 00:03:52 +00:00
Linfeng Zhang
c756eb01c8 Fix overflow issue in 32x32 idct NEON intrinsics
Similar issue as Change bc1c18e.

The PartialIDctTest.ResultsMatch test on vpx_idct32x32_135_add_neon()
in high bit-depth mode exposes 16-bit overflow in final stage of pass
2, when changing the test number from 1,000 to 1,000,000.

Change to use saturating add/sub for vpx_idct32x32_34_add_neon(),
vpx_idct32x32_135_add_neon and vpx_idct32x32_1024_add_neon() in high
bit-depth mode.

Change-Id: Iaec0e9aeab41a3fdb4e170d7e9b3ad1fda922f6f
2017-03-14 16:59:14 -07:00
Jerome Jiang
2fa7092808 Merge "vp9: Enable row multithreading for SVC in real-time mode." 2017-03-14 23:29:46 +00:00
Jerome Jiang
02463273c9 vp9: Using source sad for speedup for dynamic resizing.
Only for speed >= 7.

Change-Id: I3ac85fbb4023cf7e6f8333806b345b0174382a09
2017-03-14 15:47:19 -07:00
Yi Luo
fedcf83f33 Improve idct32x32_1024_add SSSE3 intrinsics performance
- Function level speed improves ~12%.

Change-Id: I9b7dbddabf08c7d0f6b25264e6074d5ccbe39290
2017-03-14 14:04:08 -07:00
James Zern
1b91f41935 Merge "vp9/encoder: fix segfault on win32 using vs < 2015" 2017-03-14 19:21:42 +00:00
Yunqing Wang
c3e290963d Merge "Apply machine learning-based early termination in VP9 partition search" 2017-03-14 18:07:05 +00:00
Marco Paniconi
78a6946904 Merge "vp9: Speed >= 8: Enable simple_block_yrd speed feature." 2017-03-14 17:50:17 +00:00
Marco
c0c789ab50 vp9: Adjust copy partition threshold, for speed 8.
Reduce it from 5 to 4, small/no change in metrics or speed.
Small reduction in dragging artifact near moving head.

Change-Id: Ic3bc5ca67c70bf0c89fc2ed14454840a28ae5b6a
2017-03-14 09:18:53 -07:00
Marco
c216c8d6f2 vp9: Speed >= 8: Enable simple_block_yrd speed feature.
Enable speed feature for resolutions > VGA.
avgPSNR on RTC down by ~1.7%.
Speedup on ARM: ~5%.

Change-Id: I7a3fe5f7425aa8df3f4a2eced1afa355bc0d4c95
2017-03-14 09:10:28 -07:00
Johann
a14a987c82 test: add vp9_temporal_filter_apply test
Add an independent implementation of the filter.

BUG=webm:1379

Change-Id: I309c459b493c3011273b78b127a786bb23c59f9c
2017-03-13 15:26:26 -07:00
Marco Paniconi
507204316a Merge "vp9: Fix to source_sad feature for SVC." 2017-03-13 19:18:31 +00:00
Linfeng Zhang
b0bfcc368c Merge "Add vpx_highbd_idct32x32_135_add_c()" 2017-03-13 18:49:01 +00:00
Marco
f0a22b23fe vp9: Fix to source_sad feature for SVC.
Allow speed feature sf->use_source_sad to be used
on highest spatial layer for SVC.

Change-Id: I260eb0478902764f49f83e43b17024fe86ff3b22
2017-03-13 11:00:40 -07:00
Yunqing Wang
670101439f Apply machine learning-based early termination in VP9 partition search
This patch was based on Yang Xian's intern project code. Further modifications
were done.
1. Moved machine-learning related parameters into the context structure.
2. Corrected the calculation of sum_eobs.
3. Removed unused parameters and calculations.
4. Made it work with multiple tiles.
5. Added a speed feature for the machine-learning based partition search
early termination.
6. Re-organized the code.

The patch was rebased to the top-of-tree.

Borg test BDRATE result:
4k set:     PSNR: +0.144%; SSIM: +0.043%;
hdres set:  PSNR: +0.149%; SSIM: +0.269%;
midres set: PSNR: +0.127%; SSIM: +0.257%;

Average speed gain result:
4k clips: 22%;
hd clips: 23%;
midres clips: 15%.

Change-Id: I0220e93a8277e6a7ea4b2c34b605966e3b1584ac
2017-03-13 09:54:18 -07:00
Marco Paniconi
b39f7c3364 Merge "vp9: Fix condition for intra search in non-rd pickmode." 2017-03-13 06:11:13 +00:00
Marco
8c18df7fcd vp9: Fix condition for intra search in non-rd pickmode.
Fixes an issue when the LAST and golden is not used as a reference,
in which case its possible no encoding mode is set (since intra may be
skipped under certain codtions). Fix is to make sure intra is searched
if no inter mode is checked.

Issue can happen for temporal layer pattern#7 in vpx_temporal_svc_encoder.c

Change-Id: I5ab4999b2f9dbd739044888e0916b5ec491d966b
2017-03-12 22:30:39 -07:00
James Zern
48fca113d1 inv_txfm_ssse3,butterfly: fix win32 abi compatibility
only the first 3 parameters can be aligned to 16 as required by __m128i,
make them all pointers for consistency.

since:
07c48ccfe Improve idct32x32_34_add SSSE3 intrinsics performance

BUG=webm:1384

Change-Id: I0324f701e723a27cb470036a180693ba8829d01d
2017-03-10 19:57:17 -08:00
James Zern
c09b290cea vp9/encoder: fix segfault on win32 using vs < 2015
shift the bsse[] member of the macroblock struct to the front to avoid
an incorrect offset (0) to the upper half of bsse[0] which leads to a
negative resulting in a crash. restrict this to visual studio versions
before 2015 (the bug was observed with 2013, fixed in 2015) to avoid any
potential cache impact on other platforms.

https://connect.microsoft.com/VisualStudio/feedback/details/2396360/bad-structure-offset-in-32-bit-code

BUG=webm:1054

Change-Id: I40f68a1d421ccc503cc712192263bab4f7dde076
2017-03-10 17:37:17 -08:00
Marco Paniconi
0af189c00d Merge "vp9: Sample encoder vpx_temporal_svc_encoder: enable row-mt" 2017-03-10 18:26:06 +00:00
Marco
169c846575 vp9: Sample encoder vpx_temporal_svc_encoder: enable row-mt
Enable row-mt in the sample encoder vpx_temporal_svc_encoder.c,
under certain condiitons.

Change-Id: Ic103ee81a9d80be5bf6e5778cc21fc3199db909d
2017-03-10 10:11:39 -08:00
Yi Luo
018290a344 Merge "Improve idct32x32_135_add SSSE3 intrinsics performance" 2017-03-10 17:14:30 +00:00
Marco
ffb3c50da1 vp9: Enable row multithreading for SVC in real-time mode.
Enable row-mt for SVC for real-time mode, speed >=5.

Add the controls to the sample encoders, but keep it off for now.
Add the control and enable it for the 1 pass CBR unittests.

For speed 7, 3 layer SVC, 2 threads, row-mt enabled gives about ~5% speedup.

Change-Id: Ie8e77323c17263e3e7a7b9858aec12a3a93ec0c1
2017-03-10 01:01:07 +00:00
Yi Luo
327add990f Improve idct32x32_135_add SSSE3 intrinsics performance
- Split the inv txfm into three parts to avoid stack spillover.
- Function level speed improves ~12%.
- Use function and macro to remove some repeated code.

Change-Id: I14f5f072334fd766808cb52bf648df792e7379ee
2017-03-09 16:17:54 -08:00
Johann Koenig
f951881e8c Merge "ppc: include ppc.h for ppc_simd_caps()" 2017-03-09 23:12:37 +00:00
James Zern
cb60e66085 Merge "move vp9_scale_and_extend_frame_c to vp9_frame_scale.c" 2017-03-09 22:51:08 +00:00
Johann
94655569fe Remove ppc-linux-gcc target
Change-Id: Iec2430966f54e2e5ba79f6bb703f47adde46479f
2017-03-09 11:33:33 -08:00
Johann
ccd23215ed ppc: include ppc.h for ppc_simd_caps()
Change-Id: Idc829eb066cf4e905d062cb9c08424e0f1b7e1a7
2017-03-09 09:26:45 -08:00
James Zern
2f31a16445 move vp9_scale_and_extend_frame_c to vp9_frame_scale.c
this is similar to the x86 configuration and helps mitigate an issue
with a circular dependency between this function and the ssse3 variant
causing an outsized increase in binary size (~300K for chrome)
chrome.dll:
.text 255B000 -> 252B000
.data 7B000 -> 75000
-221184 bytes

BUG=chromium:697956

Change-Id: Ic95b142ecd62dd4f1795788aa27dd8fab59b708c
2017-03-08 21:13:50 -08:00
Marco Paniconi
04aa9e28d5 Merge "vp9: Enable two speed features for SVC real-time mode." 2017-03-09 03:58:14 +00:00
Marco
ea3c817ac2 vp9: Enable two speed features for SVC real-time mode.
Enable short_circuit_low_temp_var and limit_newmv_early_exit
for SVC, 1 pass CBR mode.

Change-Id: I77df2b2c6cc40657bb8ea76e19dfc2fdaad6389e
2017-03-08 16:13:59 -08:00
Marco
97b6a6f037 vp9: Add control to vpx_temporal_svc_encoder for row-mt.
Keep it off as default for now.

Change-Id: Ia2518a8ce96c9735c3fe67215dde25a35e8620af
2017-03-08 16:03:44 -08:00
Jerome Jiang
834f26c3b9 Merge "Shift speed 2 from non-large VP9 tests to large ones." 2017-03-08 23:14:27 +00:00
Johann Koenig
42a1b310e1 Merge "Add support for POWER8/VSX" 2017-03-08 22:38:21 +00:00
Yunqing Wang
6a86492adf Merge "Make the partition search early termination feature to be frame size dependent" 2017-03-08 22:31:30 +00:00
Yunqing Wang
099e9bf1ff Make the partition search early termination feature to be frame size dependent
The 2 thresholds(i.e. partition_search_breakout_dist_thr and
partition_search_breakout_rate_thr) are used as the partition search
early termination speed feature. This refactoring patch made this
feature to be frame size dependent consistently throughout the code.

Change-Id: Idaa0bd8400badaa0f8e2091e3f41ed2544e71be9
2017-03-08 12:56:41 -08:00
Linfeng Zhang
77311e0dff Update vpx_idct32x32_1024_add_neon()
Most are cosmetics changes.
Speed has no change with clang 3.8, and about 5% faster with gcc 4.8.4

Tried the strategy used in 8x8 and 16x16 (which operations' orders are
similar to the C code), though speed gets better with gcc, it's worse
with clang.

Tried to remove store_in_output(), but speed gets worse.

Change-Id: I93c8d284e90836f98962bb23d63a454cd40f776e
2017-03-08 12:39:04 -08:00
Rafael de Lucena Valle
51289302ab Add support for POWER8/VSX
Add ppc, ppc64 and ppc64le on all_platforms and ARCH_LIST

Add VSX flags and check for -mvsx

Define empty setup_rtcd_internal

Add Altivec detection based on:
http://freevec.org/function/altivec_runtime_detection_linux

Detect VSX at runtime when enabled

Change-Id: I304f4d8c5fee0ff19b6483cd2e9cc50d6ddec472
Signed-off-by: Rafael de Lucena Valle <rafaeldelucena@gmail.com>
2017-03-08 20:28:08 +00:00
Linfeng Zhang
48f5886605 Add vpx_highbd_idct32x32_135_add_c()
When eob is less than or equal to 135 for high-bitdepth 32x32 idct,
call this function.

BUG=webm:1301

Change-Id: I8a5864f5c076e449c984e602946547a7b09c9fe6
2017-03-08 10:46:33 -08:00
Marco Paniconi
2fa710aa6d Merge "vp9: Fix for denoising with SVC." 2017-03-08 18:26:12 +00:00
Marco
45de35fc58 vp9: Fix for denoising with SVC.
Fix the conditon for getting last_source when denoising is on.
This avoids unneeded scaling in the case of SVC.

No change in quality.

Change-Id: I32c1c2c9085104da51af8535716bcc4d55fb0f42
2017-03-08 09:45:58 -08:00
Linfeng Zhang
c4e5c54d69 cosmetics,dsp/arm/: vpx_idct32x32_{34,135}_add_neon()
No speed changes and disassembly is almost identical.

Change-Id: Id07996237d2607ca6004da5906b7d288b8307e1f
2017-03-08 08:58:32 -08:00
Linfeng Zhang
3cf5c213f1 cosmetics,dsp/arm/: rename a variable
Rename cospi_6_26_14_18N to cospi_6_26N_14_18N for consistency.

Change-Id: I00498b43bb612b368219a489b3adaa41729bf31a
2017-03-08 08:55:41 -08:00
Jerome Jiang
c4c0331f65 Shift speed 2 from non-large VP9 tests to large ones.
This may fix the time out failure of valgrind tests in nightly
since more coverages were added on row-mt.

Change-Id: Id9414e66d1a266602c7495243d9f5cb69e17ccdc
2017-03-07 13:58:11 -08:00
James Bankoski
88a888f022 Merge "tiny_ssim.c : adds y4m support to tiny_ssim." 2017-03-07 18:49:14 +00:00
Jim Bankoski
393d9d0195 tiny_ssim.c : adds y4m support to tiny_ssim.
Change-Id: I7a13b7e3a1e11ddbe4be3009edf03528e1bc7647
2017-03-07 08:37:00 -08:00
James Zern
47cf7c25a2 Merge "vp8_create_decoder_instances: correct pbi[] memset" 2017-03-04 00:47:18 +00:00
Alex Converse
15dac923b9 Merge "Narrow cat6_high_cost tables to uint16_t" 2017-03-03 23:45:39 +00:00
James Zern
9c3c1f3725 vp8_create_decoder_instances: correct pbi[] memset
clear the entire array on error. the size used previously was equal to
the number of elements.

BUG=webm:1364

Change-Id: I2f2e16ed6e867f41d4774a5a8ac9cedaee11ce46
2017-03-03 15:23:32 -08:00
Alex Converse
bcd12de6c3 Narrow cat6_high_cost tables to uint16_t
Saves 2688 bytes of rodata.

Change-Id: I46633b6e50c2845181c70fff6273a8e58fdd1e56
2017-03-03 23:09:12 +00:00
Vignesh Venkatasubramanian
9e7140b451 Merge "vp9,realtime: Enable row multithreading for non-rd" 2017-03-03 19:05:52 +00:00
Marco Paniconi
1bb63bf669 Merge "vp9: Speed 8: reduce the adaptive_rd_thresh level." 2017-03-02 22:25:03 +00:00
Marco
b60617f5ff vp9: Speed 8: reduce the adaptive_rd_thresh level.
Reduce the level from 4 to 2.
This gives ~1-2% quality gain on RTC set, with small decreaee in speed (~1-2% on mac).

Change-Id: I7d959731badcee3d45b2f4a08efe378765016a13
2017-03-02 13:34:10 -08:00
Vignesh Venkatasubramanian
453f18040f vp9,realtime: Enable row multithreading for non-rd
Enable row level multithreading for realtime encodes where non-rd
path is used (speed >= 5).

Change-Id: I5439cb49a02171166d8e1de06c7d5e6f8e819a41
2017-03-02 11:03:56 -08:00
Yi Luo
07c48ccfe0 Improve idct32x32_34_add SSSE3 intrinsics performance
- Split the transform into first half and second half.
- Reschedule the instructions to avoid stack spillover.
- Function level speed improves ~16%.

Change-Id: I166889840d23aa8a273eca00f6fbdae8b4566f35
2017-03-01 11:14:48 -08:00
Chrome Cunningham
b71245683b Merge "VPX_CODEC_CAP_HIGHBITDEPTH for decoder interface" 2017-03-01 18:01:14 +00:00
Chris Cunningham
bcd0c49af3 VPX_CODEC_CAP_HIGHBITDEPTH for decoder interface
Moves the def from vpx_encoder.h -> vpx_codec.h. The defined value
is changed as part of this move.

Adds the value to decoder capabilities when CONFIG_VP9_HIGHBITDEPTH.

Change-Id: I7d61fc821cda29f1e32bb9b2b9ffd3d83966e419
2017-02-28 17:10:34 -08:00
James Zern
8697d14ec8 Revert "Fix for max qindex calculation of a gf interval"
This reverts commit d3db846cc50b1b0a9f6efcbe2b36c9c1943bc528.

This change causes a large drop in psnr (4-5db) on low framerate
difficult content (tested at 360/480p)

BUG=b/35804225

Change-Id: I8e90012d3b9c8a0cddb062ba93b01b36c0e0c0a0
2017-02-28 16:26:13 -08:00
James Zern
66919e370b vp9_ethread_test,cosmetics: s/new-mt/row-mt/
Change-Id: I8c145337adf49d30b88a17ff31501b8751ed1fa0
2017-02-28 15:13:11 -08:00
James Zern
3ab8a05b37 stress.sh: add vp9_stress_test_row_mt
vp9_stress_test now forces --row-mt=0 to cover both versions

Change-Id: I8d134879435bf1d8e76ab3fd89e698efba0e86b2
2017-02-28 15:09:30 -08:00
James Zern
b58a8ccb02 stress.sh: parameterize thread count
Change-Id: Iae45266cea86585f0935af4012335198cf93719f
2017-02-28 15:09:30 -08:00
James Zern
4684d286de stress.sh: add one pass encodes
Change-Id: I38e6c988f17c56fbfacd95378b27ef8d77c75f90
2017-02-28 15:09:30 -08:00
Yunqing Wang
3833905ff2 Add a comment in encoder thread test
Added a comment.

Change-Id: I82f71c72598ad6f1eaa0b57b0b8ec56ab9658e81
2017-02-28 11:13:09 -08:00
Yunqing Wang
3fa7e5c62c Set row_mt to 0 by default
Set row_mt to 0 for now.

Change-Id: I922536a6d71a765e435daeaf4d932ef14363d19a
2017-02-28 11:00:56 -08:00
Marco
defe094e9e vp9: Fix an issue with setting variance thresholds.
From commit:
https://chromium-review.googlesource.com/c/441393/

On non-segment the set_vbp_thresholds() should be called
again to adjust thresholds based on content_state of superblock.
This was the intended behavior from 441393.

Small change in RTC metrics and speed.

Change-Id: I45e5fbdc4af74db76b3cb4f13074fcae0eb2219e
2017-02-27 12:09:51 -08:00
Vignesh Venkatasubramanian
ddfe906be2 vp9_ethread_test: Rename new_mt to row_mt
Rename left over occurences of new_mt.

Change-Id: Ib884e84c801fcd366ca4b57ec912ac5972023375
2017-02-27 10:50:02 -08:00
Vignesh Venkatasubramanian
5881601488 vp9: Rename new_mt to row_mt
new_mt is a very generic name that will get obsolete soon enough.
Since this is exposed as a codec control, renaming it to row_mt to
signify row level paralellism. Also renaming the ETHREAD_BIT_MATCH
codec control to ROW_MT_BIT_EXACT.

Change-Id: Ic7872d78bb3b12fb4cf92ba028ec8e08eb3a9558
2017-02-27 09:43:26 -08:00
Yunqing Wang
8121f85473 Remove an old leftover comment
Removed an old comment that wasn't true anymore.

Change-Id: I286ad8d7cb2843070a55e45a599d26bc226d6bd7
2017-02-24 18:31:21 -08:00
James Zern
47d6f16a04 get_prob(): rationalize int types
promote the unsigned int calculation to uint64_t rather than int64_t for
type consistency

Change-Id: Ic34dee1dc707d9faf6a3ae250bfe39b60bef3438
2017-02-24 15:36:52 -08:00
Yunqing Wang
af9002dd16 Merge "Improve VP9 encoder threading test for better coverage" 2017-02-24 23:26:23 +00:00
Yunqing Wang
cc168054a8 Improve VP9 encoder threading test for better coverage
Re-organized the encoder threading tests and grouped tests into
4 parts. Added PSNR checking test to make sure the PSNR variation
is within a small range.

BUG=webm:1376

Change-Id: I09edb990236a87a4d2b2b0e1ceaf6c6435a35eff
2017-02-24 09:48:29 -08:00
Jerome Jiang
e96ab22462 Merge "Make vp9_scale_and_extend_frame_ssse3 work for hbd when bitdepth = 8." 2017-02-24 16:56:33 +00:00
Johann
904b957ae9 consolidate block_error functions
vp9_highbd_block_error_8bit_c was a very simple wrapper around
vp9_block_error_c. The SSE2 implemention was practically identical to
the non-HBD one. It was missing some minor improvements which only
went into the original version.

In quick speed tests, the AVX implementation showed minimal
improvement over SSE2 when it does not detect overflow. However, when
overflow is detected the function is run a second time. The
OperationCheck test seems to trigger this case and reverses any
speed benefits by running ~60% slower. AVX2 on the other hand is
always 30-40% faster.

Change-Id: I9fcb9afbcb560f234c7ae1b13ddb69eca3988ba1
2017-02-24 05:25:26 +00:00
Johann Koenig
aa911e8b41 Merge "block error sse2: use tran_low_t" 2017-02-24 05:24:34 +00:00
Jerome Jiang
0998a146d4 Make vp9_scale_and_extend_frame_ssse3 work for hbd when bitdepth = 8.
Only works for bitdepth = 8 when compiled with high bitdepth flag.
4x speed ups for handling 1:2 down/upsampling.

Validated manually for:
1) Dynamic resize for a single layer encoding
2) SVC encoding with 3 spatial layers
Results are bitexact with the patch and the speed gain (~4x) in the
scaling was verified.

BUG=webm:1371

Change-Id: I1bdb5f4d4bd0df67763fc271b6aa355e60f34712
2017-02-23 20:40:28 -08:00
Johann
3c16bbb73b block error sse2: use tran_low_t
Change-Id: Ib04990e4a7bda9fbf501f294da2057a2b2595deb
2017-02-24 01:33:35 +00:00
Johann Koenig
57e987576f Merge "vp8_fdct4x4 test: fix segfault again" 2017-02-23 07:41:21 +00:00
Marco Paniconi
1d12a125e7 Merge "vp9: 1pass CBR: modify condition for reducing loop filter." 2017-02-23 03:24:26 +00:00
Jerome Jiang
a6b6258284 Merge "vp9: Non-rd pickmode: use simple block_yrd under some conditons." 2017-02-22 23:19:29 +00:00
Marco
84f106f198 vp9: 1pass CBR: modify condition for reducing loop filter.
The reduction showed improvement on RTC when aq-mode=3 is on.
Add that (cyclic refresh enabled) to the condition.

Only affects 1 pass CBR.

Change-Id: I5d0843002d8e31d7c165098a62e7a71146b08664
2017-02-22 15:09:45 -08:00
Marco
7e7d820d5b vp9: Non-rd pickmode: use simple block_yrd under some conditons.
For speed 8 only.
3% speed up for QVGA and 6.3% for VGA on Nexus 6.
~3% avgPSNR decrease on rtc_derf and 2.9% on rtc.

Disabled for now.

Change-Id: I70133f1f6c804d663d594df437bfe7fdb0030d6a
2017-02-22 13:22:53 -08:00
Marco Paniconi
0acc270830 Merge "vp9: aq-mode=3: On key frame reset cr->reduce_refresh to 0." 2017-02-22 19:52:24 +00:00
Marco
7e79831016 vp9: aq-mode=3: On key frame reset cr->reduce_refresh to 0.
This prevent possible reduction of cyclic refresh after key frame.

Change-Id: Idd4e49b69cd95476e7eccfa31b2bd8669569e9e8
2017-02-22 10:50:08 -08:00
Johann
672100a84e vp8_fdct4x4 test: fix segfault again
The output needs to be aligned. Input is read with 'movq' not 'movqda'
so it is not expected to be aligned.

Change-Id: Ibd48a84c1785917a6a97c3689a05322abba486b4
2017-02-22 18:29:11 +00:00
Jerome Jiang
3d1fa00fce vp9: Only compute y_sad for golden in variance partition for speed < 8.
Only affects speed 8. No obvious quality regression. Systematic speed
ups by ~1% on Nexus 6.

Change-Id: Ia904ca28ea041c3281c532911ec38fb7d7f46a17
2017-02-22 10:19:09 -08:00
Yunqing Wang
66f36f4735 Merge "Refactored the row based multi-threading code" 2017-02-22 16:55:04 +00:00
Jerome Jiang
b1dcaf7f1e Merge "Fix segmentation fault caused by denoiser working with spatial SVC." 2017-02-22 04:44:55 +00:00
Marco
7f2daa74a0 vp9: Incorporate source sum_diff into non-rd partition thresholds.
Increase the variance partition thresholds for superblocks that
have low sum-diff (from source analysis prior to encoding frame).
Use it for now only for speed >= 7 or for denoising on.

Small change on metrics for rtc set: less than ~0.1 avgPNSR decrease
on RTC set, for both speed 7 and 8.

Change-Id: I38325046ebd5f371f51d6e91233d68ff73561af1
2017-02-21 17:22:11 -08:00
Yi Luo
6036a0d24f Following SSSE3 intrinsics functions also work for HBD
- vpx_idct8x8_12_add_ssse3
  vpx_idct8x8_64_add_ssse3
  vpx_idct32x32_34_add_ssse3
  vpx_idct32x32_135_add_ssse3
  vpx_idct32x32_1024_add_ssse3
- turn on unit tests.

Change-Id: I788b2b3b2074a6f3ab6a0e6f469c1327a123eff7
2017-02-21 12:37:53 -08:00
Johann Koenig
1e224dcb83 Merge "Drop zbin_ptr and quant_shift_ptr" 2017-02-21 18:16:38 +00:00
Jerome Jiang
0d1e5a21c4 Fix segmentation fault caused by denoiser working with spatial SVC.
Re-enable the affected test.
BUG=webm:1374

Change-Id: I98cd49403927123546d1d0056660b98c9cb8babb
2017-02-21 09:38:28 -08:00
Yi Luo
62a332160f Merge "Fix idct8x8 SSSE3 SingleExtremeCoeff unit tests" 2017-02-21 16:36:06 +00:00
Paul Wilkins
4d4231352c Merge "Change to prediction decay calculation." 2017-02-21 09:42:38 +00:00
Marco Paniconi
f091752a9c Merge "vp9: Fix for non-rd pickmode for high-bitdepth build." 2017-02-21 05:37:23 +00:00
Marco
4e1ba35458 vp9: Fix for non-rd pickmode for high-bitdepth build.
Use the simple block_yrd under certain conditions.
The optimization code is completed but the speed is still slower
(~6% on 720p) than the low-bitdepth build.

For now, use the more complex block_yrd under certain conditions
(always use it for speed <= 5, otherwise use it on key frames and for
bsize >= 32x32).

This gives about ~2-3% gain in quality for speed 7 on RTC set
(over high bitdepth build), with about the same encoder fps as the
low bitdepth build.

Change-Id: Ibe92a1945d0bd635f880befb4c815727df62d754
2017-02-20 20:25:36 -08:00
Ranjit Kumar Tulabandu
97d6a4cbd1 Refactored the row based multi-threading code
Modified the code to facilitate bit-match tests in first pass
Added unit-tests to test the row based multi-threading behavior for bit-exactness

Change-Id: Ieaf6a8f935bb1075597e0a3b52d9989c8546d7df
2017-02-20 16:13:45 +05:30
James Zern
bf6fcebfed vp8_fdct4x4_test: align input and output buffers
fixes segfault in 32-bit builds

Change-Id: I5b3cc5a335cb236a6ec4cb11fa8feb54ae0182c7
2017-02-18 13:30:28 -08:00
James Zern
52b3e1a633 datarate_test: disable OnePassCbrSvc2SpatialLayersDenoiserOn
segfaults

BUG=webm:1374

Change-Id: I3790c6cb8a539d13dee6a8225ef09b1575dea26c
2017-02-17 16:23:22 -08:00
Johann Koenig
9cb470eba7 Merge "vp8_short_fdct4x4: verify optimized functions" 2017-02-17 22:11:08 +00:00
Yi Luo
1f8e8e5bf1 Fix idct8x8 SSSE3 SingleExtremeCoeff unit tests
- In SSSE3 optimization, 16-bit addition and subtraction would
  overflow when input coefficient is 16-bit signed extreme values.
- Function-level speed becomes slower (unit ms):
  idct8x8_64: 284 -> 294
  idct8x8_12: 145 -> 158.

BUG=webm:1332

Change-Id: I1e4bf9d30a6d4112b8cac5823729565bf145e40b
2017-02-17 14:05:05 -08:00
James Zern
3e7025022e Merge "Add vpx_highbd_idct16x16_10_add_neon()" 2017-02-17 20:29:37 +00:00
paulwilkins
a63adac604 Change to prediction decay calculation.
This change subtracts out low complexity intra regions that are also low
error in the inter domain, in the calculation of the frame prediction decay.
The rationale here his that low complexity regions (such as sky) do not imply
high prediction decay in the same way as high error intra or neutral blocks.

The effect of this is small in most clips but in a few clips it can be > 10%.
(E.g. In to tree)

Change-Id: If67ac23d17fca14285cad2defa464c61c9ea861c
2017-02-17 09:29:24 +00:00
Johann
bf05cd3c99 vp8_short_fdct4x4: verify optimized functions
Change-Id: I7c7f5dfabde65c09f111fb0ced0e3ad231ee716e
2017-02-16 19:34:50 -08:00
Johann
c7342f35c8 tiny_ssim: clean up on failure
Clears up clang static analysis warnings about memory leaks.

Change-Id: I60d4d0f3794735a8b81d9da4a30d19e7a9cba9cf
2017-02-17 03:28:34 +00:00
Yi Luo
f62dcc9c33 Replace idct32x32_1024_add_ssse3 assembly with intrinsics
- Encoding/decoding test, BQTerrace_1920x1080_60.y4m, on
  i7-6700, no obvious user-level speed performance downgrade.
- Passed unit tests.

Change-Id: I20688e0dd3731021ec8fb4404734336f1a426bfc
2017-02-16 16:10:40 -08:00
James Zern
b5bc9ee02d Merge "cosmetics: Fix spelling mistake in compile flag name." 2017-02-17 00:04:42 +00:00
Johann Koenig
a9b81da575 Merge "block error avx2: use tran_low_t" 2017-02-16 23:51:14 +00:00
Linfeng Zhang
0620081731 Add vpx_highbd_idct16x16_10_add_neon()
BUG=webm:1301

Change-Id: If686c8144764c4162458f0bc4bb1bbf6555c48ab
2017-02-16 15:13:50 -08:00
James Zern
0f014c97e5 Merge "Fix mips vpx_post_proc_down_and_across_mb_row_msa function" 2017-02-16 23:02:10 +00:00
James Zern
e9d07c0c2a Merge "disable VP9MultiThreadedFrameParallel tests" 2017-02-16 22:56:02 +00:00
paulwilkins
d218b0914e cosmetics: Fix spelling mistake in compile flag name.
agressive -> aggressive

after:
ce7b38459 Aggressive VBR method.

Change-Id: Ie0f30b1bbc77ed9f32bec047b4a9b3d0cf4853f5
2017-02-16 14:51:31 -08:00
Johann Koenig
06a82af0de Merge "correct bitdepth_conversion_sse2.h header guard" 2017-02-16 21:41:28 +00:00
Johann
ca4e27f5da Drop zbin_ptr and quant_shift_ptr
vp9[_highbd]_quantize]_fp[_32x32] and vp9_fdct8x8_quant do not make use
of these parameters.

scan is used for C code and iscan is used for SIMD implementations.

Change-Id: I908a0ff7d3febac33da97e0596e040ec7bc18ca5
2017-02-16 13:20:32 -08:00
James Zern
6ab0870d45 disable VP9MultiThreadedFrameParallel tests
these are flaky and cause TSan warnings with clang-3.9.1

BUG=webm:1372

Change-Id: I8a7047552ba2ccd2d8c45f8795818c74562e5990
2017-02-16 12:56:04 -08:00
Johann
6c2d732bf4 correct bitdepth_conversion_sse2.h header guard
Change-Id: Ic4ffd861608e67fe59bcb3a86010ce3ef11a5519
2017-02-16 12:43:33 -08:00
Yi Luo
1cb44945fb Merge "Add idct32x32_135_add SSSE3 intrinsics" 2017-02-16 20:43:29 +00:00
Johann
2104454607 block error avx2: use tran_low_t
Change-Id: Ic5f3a1f569d6f82afeaf4fcd7235374bb460db3c
2017-02-16 12:39:02 -08:00
Johann Koenig
cc43012674 Merge changes I267050a5,Iebade0ef,Id96a8df3
* changes:
  quantize_fp_32x32 highbd ssse3: enable existing function
  quantize_fp highbd ssse3: use tran_low_t for coeff
  quantize_fp highbd sse2: use tran_low_t for coeff
2017-02-16 20:34:48 +00:00
Yi Luo
72a43e2378 Add idct32x32_135_add SSSE3 intrinsics
- Replace the corresponding assembly code.
- No user level speed performance degrade.
- Unit tests passed.

Change-Id: Idd0c5a4bad4976f1617c34100cb46e75e3b961e5
2017-02-16 11:29:34 -08:00
Yunqing Wang
0bf6b51572 Merge "Structured the mode ordering code to avoid redundant memcpy" 2017-02-16 16:22:54 +00:00
Johann
ff37a911ce quantize_fp_32x32 highbd ssse3: enable existing function
This was created as part of the quantize_fp_ssse3 change. Both
functions use the same source file with different macro parameters.

Change-Id: I267050a559426a85955d215aa0aaca270439c5ab
2017-02-16 07:40:56 -08:00
Johann
4682130b60 quantize_fp highbd ssse3: use tran_low_t for coeff
Change-Id: Iebade0efc0efbb0a80a0f3adbef4962e3a2f25e8
2017-02-16 07:40:56 -08:00
Johann
ac3996a6d1 quantize_fp highbd sse2: use tran_low_t for coeff
Change-Id: Id96a8df33354a7987ce890a3d6798c7375ffa4aa
2017-02-16 07:40:55 -08:00
Johann
44600442dc bitdepth conversion: really use num elements
The previous implementation confused bit/bytes/elements. It was using
'32' as the multiplier but that was mistakenly adopted because a 32x32
transform embedded the stride.

Change-Id: Ieeb867a332416b9a40580b5e7c9b20088e9e691a
2017-02-16 15:02:48 +00:00
Ranjit Kumar Tulabandu
5127e58dab Structured the mode ordering code to avoid redundant memcpy
Change-Id: I4f5d6b54018bd1928cd9e5e42619e6f55b334803
2017-02-16 14:12:33 +00:00
Paul Wilkins
60a10116d1 Merge "Disconnect ARF breakout from frame boost." 2017-02-16 10:02:09 +00:00
Paul Wilkins
543ebc900f Merge "Remove unnecessary factor." 2017-02-16 10:01:58 +00:00
Paul Wilkins
9216ba58d8 Merge "Bug in scale_sse_threshold()" 2017-02-16 10:01:46 +00:00
Paul Wilkins
e6c1993f1b Merge "Additional first pass stats." 2017-02-16 09:39:29 +00:00
Kaustubh Raste
fddf66b741 Fix mips vpx_post_proc_down_and_across_mb_row_msa function
Added fix to handle non-multiple of 16 cols case for size 16

Change-Id: If3a6d772d112077c5e0a9be9e612e1148f04338c
2017-02-16 13:17:00 +05:30
Johann Koenig
b63e88e506 Merge "Use 'packssdw' for loading tran_low_t values" 2017-02-16 02:41:00 +00:00
Johann Koenig
61d05c1e67 Merge "vp8_dx_iface: remove unused 'else' condition" 2017-02-16 01:00:45 +00:00
James Zern
cc04ae1565 Merge "vpx_temporal_svc_encoder.sh: remove FUNCNAME bashism" 2017-02-16 00:21:19 +00:00
Marco Paniconi
e6cf741ae6 Merge "vp9: Some code cleanup for aq-mode = 3." 2017-02-15 23:03:27 +00:00
Marco
158b300952 vp9: Some code cleanup for aq-mode = 3.
The weight segment needs to only be computed once per frame,
so remove it from the funciton vp9_cyclic_refresh_rc_bits_per_mb(),
which is called within a loop inside vp9_rc_regulate_q.

Change-Id: Ia0e18b89abb97e42c466d4dbc47700d7f76555db
2017-02-15 14:07:04 -08:00
Jerome Jiang
2865de86ec vpx_temporal_svc_encoder: Expose error resilient control to cmd line.
Change-Id: Ic74a8690b136ffbc370080f70b2d5a6b1572bf63
2017-02-15 21:45:52 +00:00
Linfeng Zhang
d12f25f216 Merge "cosmetics,dsp/inv_txfm.c: reorder functions" 2017-02-15 20:18:23 +00:00
Marco Paniconi
725606a678 Merge "vp9. Use same source_sad threshold for all speeds." 2017-02-15 20:07:19 +00:00
Linfeng Zhang
106c342659 cosmetics,dsp/inv_txfm.c: reorder functions
Change-Id: Ie0f7689ebe230c68eadb22a32b14838c1a7543a6
2017-02-15 11:40:35 -08:00
Linfeng Zhang
d5edf56bb5 Merge "Add vpx_highbd_idct16x16_38_add_neon()" 2017-02-15 19:34:18 +00:00
Marco
f82280820a vp9. Use same source_sad threshold for all speeds.
Only affects real-time mode.

Change-Id: Iba836f110c4da936f5173cc0f54424d5b6121bff
2017-02-15 11:28:26 -08:00
Marco
716c1d5ff5 Vp9: Speed 8 aq-mode=3: Reduce computation in estimating bits per mb.
vp9_compute_qdelta_by_rate has almost 2% overhead in profiling on Nexus 6.
Reduce the calling of that function in speed 8 by estimating the delta-q.
Both rtc and rtc_derf show little/no change in avg psnr/ssim.
Encoding speed is 2~3% faster on Nexus 6.

Change-Id: If25933715783f31104a18a5092ea347b1221b5f5
2017-02-15 09:28:16 -08:00
Linfeng Zhang
81914ce68a Add vpx_highbd_idct16x16_38_add_neon()
BUG=webm:1301

Change-Id: Ic6cd8c1e63e1b7a997cbed221e20fff4c599e0fe
2017-02-15 09:12:02 -08:00
Linfeng Zhang
ccada0636b Merge "Add vpx_highbd_idct16x16_38_add_c()" 2017-02-15 17:06:17 +00:00
paulwilkins
cfc79a357a Disconnect ARF breakout from frame boost.
This small change replaces the frame boost check in the arf group
length break out clause with a test against a prediction decay value.

The boost value is in fact partly dependent on the decay value but
this change means that the per frame boost calculation can be adjusted
without influencing the group length calculation.

The value chosen gives a close match on all the test sets with the previous
code (on average) but it was noted that a lower threshold was slightly better
for 1080P and up and a slightly higher value for small image sizes.

Change-Id: I4d5b9f67d5b17b0d99ea3f796d3d6202fd61ee0c
2017-02-15 10:46:14 +00:00
paulwilkins
b89ba05ab4 Remove unnecessary factor.
Removed unnecessary scaling factor to simplify.

Change-Id: I3fc9c5975a2597e72f1324e09dd586dea1facfa7
2017-02-15 10:45:43 +00:00
paulwilkins
76550dfdc0 Bug in scale_sse_threshold()
The function scale_sse_threshold() returns a threshold scaled
if necessary for use with 10 and 12 bit from an 8 bit baseline.

SSE error values would be expected to rise for the 10 and 12
bit cases where there are more bits of precision.

Hence the threshold used for the test should also be scaled up.

Change-Id: I4009c98b6eecd1bf64c3c38aaa56598e0136b03d
2017-02-15 10:45:03 +00:00
paulwilkins
945ccfee59 Additional first pass stats.
Added counts that split the intra coded blocks into low and high variance.

Change-Id: Ic540144b34d5141659081bb22f7ee16fd6861f14
2017-02-15 10:44:37 +00:00
Paul Wilkins
7635ee0f37 Merge "Aggressive VBR method." 2017-02-15 10:37:02 +00:00
James Zern
1cd926d665 vpx_temporal_svc_encoder.sh: remove FUNCNAME bashism
replace with an explicit output file prefix that matches the function
name

Change-Id: I7f6a4105adb34327b1099a5fbf132aa8d1ad5b90
2017-02-14 23:44:00 -08:00
Johann Koenig
61927ba4ac Merge "vp9 fdct higbd neon: connect existing highbd calls" 2017-02-15 01:33:00 +00:00
Linfeng Zhang
e07e74fb0f Add vpx_highbd_idct16x16_38_add_c()
When eob is less than or equal to 38 for high-bitdepth 16x16 idct,
call this function.

BUG=webm:1301

Change-Id: I09167f89d29c401f9c36710b0fd2d02644052060
2017-02-14 17:25:52 -08:00
Yunqing Wang
f2c1aea118 Merge "Row based multi-threading of encoding stage" 2017-02-15 00:54:10 +00:00
Ranjit Kumar Tulabandu
71061e9332 Row based multi-threading of encoding stage
(Yunqing Wang)
This patch implements the row-based multi-threading within tiles in
the encoding pass, and substantially speeds up the multi-threaded
encoder in VP9.

Speed tests at speed 1 on STDHD(using 4 tiles) set show that the
average speedups of the encoding pass(second pass in the 2-pass
encoding) is 7% while using 2 threads, 16% while using 4 threads,
85% while using 8 threads, and 116% while using 16 threads.

Change-Id: I12e41dbc171951958af9e6d098efd6e2c82827de
2017-02-15 00:49:34 +00:00
Linfeng Zhang
615566aa81 Merge "Replace 14 with DCT_CONST_BITS in idct NEON functions' shifts" 2017-02-15 00:46:29 +00:00
Johann
86fed469ec vp8_dx_iface: remove unused 'else' condition
Clears up static clang analysis warning regarding a dead store.

Change-Id: If4fe7a9a7f94c6e2001d46136944f90712e543b4
2017-02-15 00:05:41 +00:00
Johann
327a02d77e Use 'packssdw' for loading tran_low_t values
This matches bitdepth_conversion_sse2.asm and produces substantially
better assembly. The old way had lots of 'movzwl' and 'shl' and storing
back to memory before loading into an xmm register.

Change-Id: Ib33e35354dfd691a4f8b1e39f4dbcbb14cd5302b
2017-02-14 22:39:49 +00:00
Johann
3e7aa8fda9 vp9 fdct higbd neon: connect existing highbd calls
Change-Id: Ia8f822bd6e70b3911bc433a5a750bfb6f9a3a75c
2017-02-14 22:11:49 +00:00
Johann Koenig
9c2bb7f342 Merge "quantize_fp highbd neon: use tran_low_t for coeff" 2017-02-14 21:28:23 +00:00
Linfeng Zhang
429e652809 Replace 14 with DCT_CONST_BITS in idct NEON functions' shifts
Change-Id: I2a39a3bb87516b04d273bc1c0f4a634e3fb6f0f6
2017-02-14 13:08:41 -08:00
clang-format
4b402746ca apply clang-format
Change-Id: I75e4a9e0b37bd4586f26c8d6c1fa27f3f6ff1bce
2017-02-14 12:45:52 -08:00
James Zern
f670628ca5 .clang-format: update to 3.9.1
Change-Id: Ia51f2201df897651067d09122075953382b59139
2017-02-14 12:39:54 -08:00
Yi Luo
c1a90dc160 Merge "Replace idct32x32_34_add_ssse3 assembly with intrinsics" 2017-02-14 20:13:27 +00:00
Yi Luo
bd86de1ac8 Replace idct32x32_34_add_ssse3 assembly with intrinsics
- No user-level speed performance change.
- Pass unit tests.

Change-Id: Idfc598e00f354265e41f6b3219f4734216c115c6
2017-02-14 10:38:36 -08:00
Johann
2b24aa87d9 quantize_fp highbd neon: use tran_low_t for coeff
Change-Id: I90fd815f15884490ad138f35df575a00d31e8c95
2017-02-14 10:26:10 -08:00
Johann
25301a84a8 vp8 onyx_if: assert divide by zero
Clears up static clang analysis warning regarding divide by zero.

Trying to explain to the compiler how it's impossible to avoid
incrementing num_blocks at least once is difficult.

Change-Id: Ibaae43be572e5cd7a689b440dcd341c17d33443b
2017-02-14 04:27:31 +00:00
Johann Koenig
eeb288d568 Merge "Remove UNINITIALIZED_IS_SAFE" 2017-02-14 03:02:51 +00:00
Linfeng Zhang
de9ae32b93 Merge "Add vpx_highbd_idct16x16_256_add_neon()" 2017-02-14 01:15:34 +00:00
Johann
8a1fb40273 Remove UNINITIALIZED_IS_SAFE
Where clang static analysis or gcc -Wmaybe-uninitialized warns of
uninitialized values, assign 0 to ints, MB_MODE_COUNT to
MB_PREDICTION_MODE, and B_MODE_COUNT to B_PREDICTION_MODE.

Assert that the modes have been changed from the invalid value by
the end of the function.

Change-Id: Ib11e1ffb08f0a6fe4b6c6729dc93b83b1c4b6350
2017-02-14 00:56:08 +00:00
Linfeng Zhang
5ad4159ebb Add vpx_highbd_idct16x16_256_add_neon()
BUG=webm:1301

Change-Id: I6bb755552a39bdd26eef3f449601f6a9766c65ec
2017-02-13 15:50:33 -08:00
Johann Koenig
4526ec7907 Merge "fdct8x8 highbd neon: use tran_low_t for output" 2017-02-13 23:11:30 +00:00
Johann
5ecde212a8 fdct8x8 highbd neon: use tran_low_t for output
Change-Id: I100c4a1955d80bec4d28e82796b3e7f57e84d0ba
2017-02-13 22:16:14 +00:00
Yunqing Wang
318ca07657 The bitstream bit match test in multi-threaded encoder
While the new-mt mode is enabled(namely, allowing to use row-based
multi-threading in encoder), several speed features that adaptively
adjust encoding parameters during encoding would cause mismatch
between single-thread encoded bitstream and multi-thread encoded
bitstream. This patch provides a set_control API to disable these
features, so that the bit match bitstream is obtained in the unit
test.

Change-Id: Ie9868bafdfe196296d1dd29e0dca517f6a9a4d60
2017-02-13 13:02:26 -08:00
Yunqing Wang
e7db593a46 Merge "Minor code style refactoring" 2017-02-13 21:01:41 +00:00
James Zern
45664383f1 Merge "cosmetics,vp9_ratectrl: apply clang-format" 2017-02-13 21:01:18 +00:00
James Zern
7a48bfab47 Merge "vpx_usec_timer_elapsed: use 64-bit math" 2017-02-13 21:00:33 +00:00
Yunqing Wang
f024518387 Minor code style refactoring
Change-Id: I20107693d0a87e08a10520bfb573ff3dcef69fdb
2017-02-13 12:59:01 -08:00
James Zern
3c4ea94210 cosmetics,vp9_ratectrl: apply clang-format
broken since:
c3f095c8b Merge "Fix to avoid abrupt relaxation of max qindex in recode path"
5f21aba4b Fix to avoid abrupt relaxation of max qindex in recode path

the original change pre-dated the addition of .clang-format

Change-Id: If5e399d9a805bcad9147360b13b36fbc8c560a7c
2017-02-13 11:29:39 -08:00
Linfeng Zhang
016933ad48 Add vpx_highbd_idct{16x16,32x32}_1_add_neon()
and update vpx_highbd_idct8x8_1_add_neon()

BUG=webm:1301

Change-Id: I18d1a0cbe98ba822d5194c1b4e13a4c29c5c75f4
2017-02-13 10:25:22 -08:00
paulwilkins
ce7b38459a Aggressive VBR method.
VBR method that allows a wider Q range for the first normal frame
in each ARF group and then centers the min - max range for the rest of
the arf group on the chosen Q value for that first frame.

This allows for quite rapid adjustment of the active Q range even if the
initial estimate is poor.

In some cases where the ARF frames themselves are tending to
undershoot but the normal frames are overshooting this can still give
net undershoot. This can be corrected by allowing a larger Q delta for
arf frames but is usually is a sign that the allocation to the arfs was to
high.

Change-Id: Icec87758925d8f7aeb2dca29aac0ff9496237469
2017-02-13 15:42:11 +00:00
James Zern
91f87e7513 Merge "Add vpx_idct16x16_38_add_neon()" 2017-02-11 03:42:36 +00:00
Marco
22dcfa80aa vp9: Non-rd mode: use simple block_yrd for 8 bit high bitdepth builds
Temporary fix until optimization work for block_yrd is completed.
This essentially reverts back to the state before the change:
https://chromium-review.googlesource.com/c/433821/

Compression loss is about ~5-6% on RTC set.
Speed-up (from using this simple/model-based block_yrd) over the low
bitdepth builds (which uses more complex block_yrd) is ~5% on 720p.

Change-Id: Ie0af9eb0d111e5595f587870c44f08317403b8d8
2017-02-10 10:15:35 -08:00
James Zern
943f9c0356 vpx_usec_timer_elapsed: use 64-bit math
this prevents a rollover when tv_sec is a long:
signed integer overflow: 2776 * 1000000 cannot be represented in type
'long'

Change-Id: I03dc4476ee122b02e2856dad28358a20cf16a9f8
2017-02-09 19:28:59 -08:00
Paul Wilkins
c3f095c8b3 Merge "Fix to avoid abrupt relaxation of max qindex in recode path" 2017-02-09 17:17:55 +00:00
Paul Wilkins
82b88a7fd0 Merge "Fix for max qindex calculation of a gf interval" 2017-02-09 17:17:44 +00:00
Linfeng Zhang
bc1c18e18c Add vpx_idct16x16_38_add_neon()
The RunQuantCheck() test on it exposes 16-bit overflow in stage 7 of
pass 2. Change to use saturating add/sub for both
vpx_idct16x16_38_add_neon() and vpx_idct16x16_256_add_neon() for high
bitdepth.

Change-Id: Ibf4c107a887553a52852cc582e28d38a5a5a2712
2017-02-08 12:15:22 -08:00
Yi Luo
ac04d11abc Replace idct8x8_12_add_ssse3 assembly code with intrinsics
- Performance achieves the same as assembly.
- Unit tests pass.

Change-Id: I6eacfbbd826b3946c724d78fbef7948af6406ccd
2017-02-08 10:07:45 -08:00
Linfeng Zhang
0fefc6873a Merge "Add vpx_idct16x16_38_add_c()" 2017-02-08 17:20:19 +00:00
Johann Koenig
b73f99745b Merge "block_error_fp highbd sse2: use tran_low_t for coeff" 2017-02-07 23:26:10 +00:00
Marco Paniconi
71f5314993 Merge "vp9: Denoiser speed-up: increase partition and ac skip thresholds." 2017-02-07 22:25:00 +00:00
Yunqing Wang
b106abe570 Merge "Row based multi-threading of ARNR filtering stage" 2017-02-07 19:55:41 +00:00
Marco Paniconi
259e835b1b Merge "vp9: Adjust rate_err threshold for setting active_worst factor." 2017-02-07 19:25:47 +00:00
Marco
1a5482d4d8 vp9: Denoiser speed-up: increase partition and ac skip thresholds.
Add factor to increase varianace partition and ac skip thresholds,
under certain conditions (noise level and sum_diff), to increase
denoiser speed.

Change-Id: I7671140ef3598bf5f114a72623d68792bcd7b77b
2017-02-07 10:33:13 -08:00
Linfeng Zhang
cf76ee2cb7 Add vpx_idct16x16_38_add_c()
When eob is less than or equal to 38 for 16x16 idct, call this function.

Change-Id: Ief6f3fb16a49ace3c92cebf4e220bf5bf52a6087
2017-02-07 09:40:51 -08:00
Marco
3c2f076ad0 vp9: Adjust rate_err threshold for setting active_worst factor.
Only affects 1 pass vbr.
Small improvement on ytlive set.

Change-Id: I09a7456fe658fbea82ece1035cf683bd8bd8bd14
2017-02-07 09:38:16 -08:00
Linfeng Zhang
66695533a8 Merge "Update 16x16 8-bit idct NEON intrinsics" 2017-02-07 16:52:40 +00:00
Johann
537949a9df block_error_fp highbd sse2: use tran_low_t for coeff
BUG=webm:1365

Change-Id: Id2ed3ebaaaa6a4b68628c23e08b64ea5f1341761
2017-02-07 15:03:28 +00:00
Ranjit Kumar Tulabandu
91f01a2060 Row based multi-threading of ARNR filtering stage
Change-Id: Ic238d32c7e10b730342224ab56712a89a6026a8f
2017-02-07 14:03:19 +05:30
Johann Koenig
85f3a82355 Merge "highbd x86: consolidate tran_low_t conversions" 2017-02-07 02:49:58 +00:00
Jerome Jiang
aa327a1ed4 vp9: speed 8: Tune threshold of ac skip and partitioning.
Threshold for partitioning only affects VGA and lower res.
0.07% quality regression is observed in borg tests on rtc_derf
and 0.2% regression on rtc.
5.6% speed up for low res and 6.8% for VGA on Nexus 6.

Change-Id: If85a2919b48c991de66059c90f32ed06980452be
2017-02-06 16:27:53 -08:00
Johann
641fda79bb highbd x86: consolidate tran_low_t conversions
Create new helper files specifically for converting tran_low_t types.

Change-Id: I7c4c458ef910f3b3d10a3cfbf9df4de7682fd905
2017-02-06 10:43:26 -08:00
Yunqing Wang
dbc5090b5e Merge "Changes to facilitate multi-threading of encoding stage" 2017-02-04 01:02:29 +00:00
Yunqing Wang
2a21b45fdc Fix visual studio build failure
Fixed the following issue.
..\test\vp9_ethread_test.cc(69): warning C4805: '|=' : unsafe mix of type 'bool' and type 'int' in operation [C:\src\buildbot\test-libvpx\tests\dveCPjwhBE\.build-x86_64-win64-vs10\test_libvpx.vcxproj]
..\test\vp9_ethread_test.cc(69): warning C4800: 'int' : forcing value to bool 'true' or 'false' (performance warning) [C:\src\buildbot\test-libvpx\tests\dveCPjwhBE\.build-x86_64-win64-vs10\test_libvpx.vcxproj]

Change-Id: I37f897cf12a0b7500d2fcbac9e4615f08a83fdb4
2017-02-03 08:36:55 -08:00
Jerome Jiang
a16ca80b09 Merge "Add unit tests for vp9_block_error_fp." 2017-02-02 22:20:42 +00:00
Jingning Han
bb40844e32 Merge "Add SSSE3 intrinsic 8x8 inverse 2D-DCT" 2017-02-02 22:18:32 +00:00
Jerome Jiang
0b60d3ffa5 Add unit tests for vp9_block_error_fp.
BUG=webm:1365

Change-Id: I004e5cd7ca331d14b31b7fc3edeee45fce064026
2017-02-02 12:41:51 -08:00
Johann Koenig
8d5d21aaec Merge "Update third_party/googletest to 1.8.0" 2017-02-02 20:15:46 +00:00
Johann
d89b4f5ece Update third_party/googletest to 1.8.0
Change-Id: If61137e28291f2a0911e9260eb58f234e0d8594c
2017-02-02 07:27:11 -08:00
Ranjit Kumar Tulabandu
12ec948490 Changes to facilitate multi-threading of encoding stage
Modified the encoding stage to have row level entry points with relevant
initializations and to access the token information at row level

Change-Id: Ife10e55a7c1a420ee906d711caf75002688d9e39
2017-02-02 14:47:13 +05:30
Kaustubh Raste
5b10674b5c Merge "Add mips msa sum_squares_2d_i16 function" 2017-02-02 08:09:21 +00:00
Johann Koenig
726556dde9 Merge "Remove neon assembly for idct 16x16 and 8x8" 2017-02-02 03:25:31 +00:00
Johann Koenig
ce6318f254 Merge changes I43521ad3,I013659f6
* changes:
  satd highbd neon: use tran_low_t for coeff
  satd highbd sse2: use tran_low_t for coeff
2017-02-02 03:03:58 +00:00
Linfeng Zhang
e4985cf619 Update 16x16 8-bit idct NEON intrinsics
Remove redundant memory accesses.

Change-Id: I8049074bdba5f49eab7e735b2b377423a69cd4c8
2017-02-01 17:04:33 -08:00
Jingning Han
8f95389742 Add SSSE3 intrinsic 8x8 inverse 2D-DCT
The intrinsic version reduces the average cycles from 183 to 175.

Change-Id: I7c1bcdb0a830266e93d8347aed38120fb3be0e03
2017-02-01 14:47:53 -08:00
Yunqing Wang
770c6663d6 Merge "Changes to facilitate row based multi-threading of ARNR filtering" 2017-02-01 22:04:15 +00:00
Johann Koenig
dc90501ba3 Merge changes I374dfc08,I7e15192e,Ica414007
* changes:
  hadamard highbd ssse3: use tran_low_t for coeff
  hadamard highbd neon: use tran_low_t for coeff
  hadamard highbd sse2: use tran_low_t for coeff
2017-02-01 21:56:36 +00:00
Ranjit Kumar Tulabandu
359a6796da Changes to facilitate row based multi-threading of ARNR filtering
Change-Id: I2fd72af00afbbeb903e4fe364611abcc148f2fbb
2017-02-01 13:03:52 -08:00
Johann Koenig
5cc0a364ae Merge "vp9_rdopt: declare 'c' closer to use" 2017-02-01 20:55:12 +00:00
Johann
bfd62cdaff vp9_rdopt: declare 'c' closer to use
Clears up static clang analysis warning regarding a dead store. Only
declare 'c' when it will be used.

Change-Id: I1ac0fc7f94bc44da63938c63cd1efcd6b95e0eb3
2017-02-01 19:58:24 +00:00
Johann Koenig
f60171bb4f Merge "deblock: annotate postproc parameters" 2017-02-01 19:57:29 +00:00
Johann
f8d744d91a satd highbd neon: use tran_low_t for coeff
BUG=webm:1365

Change-Id: I43521ad32b6c96737a8ef2b8c327f901fd7eaf84
2017-02-01 11:55:47 -08:00
Johann
2ba383474d satd highbd sse2: use tran_low_t for coeff
BUG=webm:1365

Change-Id: I013659f6b9fbf9cc52ab840eae520fe0b5f883fb
2017-02-01 11:55:16 -08:00
Johann
0f751ecee3 hadamard highbd ssse3: use tran_low_t for coeff
BUG=webm:1365

Change-Id: I374dfc08732932382043905f128e928b08cb4f57
2017-02-01 11:51:15 -08:00
Johann
1eb8a718bf hadamard highbd neon: use tran_low_t for coeff
BUG=webm:1365

Change-Id: I7e15192ead3a3631755b386f102c979f06e26279
2017-02-01 11:50:46 -08:00
Johann
2dac808dd1 hadamard highbd sse2: use tran_low_t for coeff
BUG=webm:1365

Change-Id: Ica414007d8412ceebfffa9e58e8416226a3fe934
2017-02-01 11:46:57 -08:00
Johann Koenig
3bda634576 Merge "quantize ssse3: remove unused pxor" 2017-02-01 19:41:41 +00:00
Jingning Han
a7949f2dd2 Make satd unit test support all bit-depth settings
Turn on satd unit test for c function in both regular and high
bit-depth settings.

Change-Id: I4b0c56addfb84964ede0da3ab760fe0ee640cfd0
2017-01-31 23:21:32 -08:00
Jingning Han
59917dd18e Unify the hadamard transform unit test for bit-depth settings
Unify the 8x8 and 16x16 Hadamard unit test system for both 8-bit
and high bit-depth settings.

Change-Id: I53373c1d43f3ced514ad1e53e03f0fb9b25d9ead
2017-01-31 23:21:32 -08:00
Jingning Han
969957f9f2 Fix real-time compression regression in hbd mode
This commit resolves the compression performance regression in
real-time encoding setting when high bit-depth mode is enabled.

The current solution temporarily disables the SIMD implementations
of vpx_satd, hadamard8x8, and hadamard16x16 in high bit-depth mode.

The commit makes the coding results bit-wise identical between
regular coding pipeline and high bit-depth at profile 0.

BUG=webm:1365

Change-Id: Icfb900821733749685370460a1a5a7e07f76f4bf
2017-01-31 23:17:09 -08:00
Johann
32f68cc58c deblock: annotate postproc parameters
Clears a clang static analyzer warning where 'cols' is assumed to be
less than 0, preventing the for loop from executing.

The assembly already requires that the size be 8 or 16 (U/V or Y plane)
and cols is a multiple of 8.

Change-Id: Ica4612690ead1638c94cfe56b306e87f8ce644f9
2017-01-31 15:58:57 -08:00
Johann Koenig
9efc42f4f8 Merge "Use Buffer class for post proc tests" 2017-01-31 15:28:28 +00:00
Kaustubh Raste
750e753134 Add mips msa sum_squares_2d_i16 function
average improvement ~4x-5x

Change-Id: I8d91b71d0677009be52b412e4f52b40b98573a53
2017-01-31 12:22:43 +00:00
Kaustubh Raste
df7e1fecc1 Add mips msa vpx_minmax_8x8 function
average improvement ~4x-5x

Change-Id: I83aee9977534fddb8a9b80d31af646c0b6b1a8c3
2017-01-31 10:00:43 +05:30
Kaustubh Raste
280ad35553 Merge "Add mips msa vpx_vector_var function" 2017-01-31 02:34:51 +00:00
Johann
dcfff3ccc8 quantize ssse3: remove unused pxor
Change-Id: Ifa22d77fd530827de0b32ae71810dc2213ab2937
2017-01-30 17:02:57 -08:00
Marco
d47f257484 vp9: Modify bsize condition for using model_rd_large for speed 7.
In non-rd pickmode: Allow speed 7 to also use larger block size in
model_rd. Small change in behavior for speed 7.

Change-Id: I8c5523e424308e8f0bc71b3f6324dec42a464cc8
2017-01-30 11:16:51 -08:00
Yunqing Wang
106c620a23 Merge "Disable multi-threading in first pass for SVC encoding" 2017-01-28 19:29:01 +00:00
Kaustubh Raste
4ce20fb3f4 Add mips msa vpx_vector_var function
average improvement ~4x-5x

Change-Id: I2f63ef83d816052ca8dc42421e7e9d42f7a7af6b
2017-01-28 08:53:20 +00:00
Marco Paniconi
164db8278f Merge "vp9: Fix to pick_filter_level for highbitdepth build." 2017-01-27 22:47:45 +00:00
Jerome Jiang
9b1a2aa82b Merge "Add macOS Sierra support in configure" 2017-01-27 21:15:52 +00:00
Marco
d94d0ed12f vp9: Fix to pick_filter_level for highbitdepth build.
Change-Id: I53b3fa8bfc0a0717eb1b730c29f2b70060b1b1b7
2017-01-27 10:44:07 -08:00
Jerome Jiang
6d38ad4146 Add macOS Sierra support in configure
BUG=webm:1367

Change-Id: I3000b6d9f93ec49ca86d08151348d33d86bf0034
2017-01-27 10:41:38 -08:00
Ranjit Kumar Tulabandu
6985a0f516 Disable multi-threading in first pass for SVC encoding
BUG=webm:1366

Change-Id: I204ef8496884ba7c4debe64f23f50d298b4090c3
2017-01-27 09:41:53 -08:00
Marco Paniconi
ad1aad69fb Merge "vp9: Modify bsize condition for using model_rd_large." 2017-01-27 15:15:36 +00:00
Marco Paniconi
d0495132aa Merge "vp9: Fixes for usage of skin_map for high bit depth." 2017-01-27 15:15:15 +00:00
Marco
b16c77cdc4 vp9: Modify bsize condition for using model_rd_large.
In non-rd pickmode: small change in behavior for speed 6 and 7.
Remove condition on HIGHBITDEPTH flag.

Change-Id: I360a13fcc313d72612fe9b918162ef4bb278cdea
2017-01-26 22:45:27 -08:00
Kaustubh Raste
407fad2356 Add mips msa vpx Integer projection row/col functions
average improvement ~4x-5x

Change-Id: I17c41383250282b39f5ecae0197ef1df7de20801
2017-01-27 11:11:42 +05:30
Kaustubh Raste
c1553f859f Merge "Add mips msa vpx satd function" 2017-01-27 04:08:51 +00:00
Marco
db99840bf6 vp9: Fixes for usage of skin_map for high bit depth.
Also avoid noise_estimation and source_sad if use_highbitdepth is set.

Change-Id: I5fea396b8f8380ea377045d99ba22a52b92daa46
2017-01-26 19:57:59 -08:00
Johann
f380a1658d Use Buffer class for post proc tests
Add Buffer features for:
Setting the buffer to the output of an ACMRandom function.
Copying a buffer.
Comparing two buffers.
Printing two buffers.

Change-Id: Ib53fb602451a3abdcee279ea2b65b51fbc02d3df
2017-01-26 09:50:49 -08:00
Jerome Jiang
eacc3b4ccf Merge "vp9: Refactor copy partitioning to reduce duplication." 2017-01-26 17:46:11 +00:00
Jerome Jiang
fe4791b0d5 vp9: Refactor copy partitioning to reduce duplication.
Change-Id: Ia1b3c118adec5eccbd2900c8e4b9ea6b1e3e9b7c
2017-01-25 17:33:04 -08:00
Yunqing Wang
4d50dc5ab5 Merge "Remove marco MVC in mcomp.c" 2017-01-26 00:32:55 +00:00
Hui Su
37cd112b0f Merge "Fix an overflow warning in optimize_b()" 2017-01-25 22:49:30 +00:00
Marco
3b2d08a93b vp9-denoiser: Modify skip denoising condition for small blocks.
Skip denoising for blocks < 16x16, and for block = 16x16
skip denoising for low noise levels and width > 480 for now.
Allow for some speed-up in denoiser.

Change-Id: Ib46cefe4741962d145fa08775defea3a9c928567
2017-01-25 11:48:09 -08:00
hui su
519b2e48a8 Fix an overflow warning in optimize_b()
BUG=webm:1361

Change-Id: Ib840bf3b39f7b3c8c017d3488a83434e9a0f45f5
2017-01-25 10:54:39 -08:00
Jerome Jiang
70a3652693 Merge "vp9: Adjust threshold for y sad used in copying partition." 2017-01-25 17:54:15 +00:00
Yunqing Wang
a762cef917 Merge "Initialize errorperbit and sabperbit in ARNR filtering" 2017-01-25 16:43:02 +00:00
Yunqing Wang
633dbcb458 Merge "Multi-threading of first pass stats collection" 2017-01-25 16:40:32 +00:00
Jerome Jiang
3a7ad43fb8 vp9: Adjust threshold for y sad used in copying partition.
Visual quality improvement is observed for noisy clips. Little effects
on speed tests on Nexus 6.

Change-Id: Ib38e04002220708c34102de7b5c36e9940775d89
2017-01-24 17:20:05 -08:00
Ranjit Kumar Tulabandu
8b0c11c358 Multi-threading of first pass stats collection
(yunqingwang)
1. Rebased the patch. Incorporated recent first pass changes.
2. Turned on the first pass unit test.

Change-Id: Ia2f7ba8152d0b6dd6bf8efb9dfaf505ba7d8edee
2017-01-24 15:48:02 -08:00
Marco
8d0c8c5e6b vp9: Adjust some parameters in aq-mode=3 mode.
Increase the qp-delta, mainly for low resolutions,
excluding case of very low bitrates.

avgPSNR/SSSIM gain of ~3-5% on rtc_derf set.
Small change on rtc set.

Change-Id: Ice03d04bd0340404d1957666ef154fd64fed0606
2017-01-24 14:18:02 -08:00
Jerome Jiang
8e8e2d11bf Merge "vp9: Copy partition using avg_source_sad." 2017-01-24 20:58:09 +00:00
Jerome Jiang
ac1358cd56 vp9: Copy partition using avg_source_sad.
Affecting only speed 8.
Speed tests on Nexus 6 show 4% faster for QVGA and 2.4% faster for VGA.
Little/negligible quality regression observed on both rtc and rtc_derf sets.

Change-Id: I337f301a2db49a568d18ba7623160f7678399ae1
2017-01-24 10:31:22 -08:00
Yunqing Wang
91aa1fae2a Merge "Add the multi-threaded first pass encoder unit test" 2017-01-24 17:14:07 +00:00
Ranjit Kumar Tulabandu
75d2443bf0 Initialize errorperbit and sabperbit in ARNR filtering
(Yunqing)
This patch added the missing initialization in temporal filter.
Borg test BDRate results:
PSNR: -0.019%(lowres); -0.013%(hdres);
SSIM: -0.001%(lowres); -0.010%(hdres).
Other q values gave comparable but no better results.

Change-Id: I7ad0c18b39e6f558342688e2fe1e12fdb133ce9b
2017-01-24 08:58:17 -08:00
Kaustubh Raste
182ea677a0 Add mips msa vpx satd function
average improvement ~4x-5x

Change-Id: If8683d636fe2606d4ca1038e28185bca53bbe244
2017-01-24 10:44:22 +05:30
Jerome Jiang
d82b9f62a9 Merge "vp9: Adjust the threshold to set avg_source_sad_sb flag." 2017-01-24 03:43:12 +00:00
Yunqing Wang
b987bc36af Remove marco MVC in mcomp.c
Removed MVC so that mv_err_cost() is always called while calculating
the mv cost.

Change-Id: I28123e05fbfc2352128e266c985d2ab093940071
2017-01-23 17:03:12 -08:00
Jerome Jiang
40ffa2839f vp9: Adjust the threshold to set avg_source_sad_sb flag.
Affect only speed 8. Small/Negligible regression on rtc set.

Change-Id: I67a6b6b4008a22ed798bd980336d95bb799f64b4
2017-01-23 16:11:28 -08:00
Johann
270fadc135 PartialIDctTest: reduce number of RunQuantCheck iterations
This currently runs 1000 * 1000 = one *million* times which is quite
unnecessary. It's one of the slowest items in Jenkins and takes over an
hour for each of the larger transforms.

Change-Id: I01653b5e610683e1a2d778ec60cf5065562ab8db
2017-01-23 13:32:09 -08:00
Marco
f38ed0c560 vp9: Non-rd pickmode: fix to add ARF mode entries to THR_MODES.
BUG=webm:1359

Change-Id: Ie0c66efa2e19d1ec9c744d14e3fa8f1e6214cdd6
2017-01-23 10:56:29 -08:00
Marco
b71ff28a1a vp9: Small threshold adjustment to unittest BasicRateTargeting444
Due to recent change to speed >=7 from commit:219cdab.

Change-Id: I366e7750ec91119881050ff6c05849504c7959e8
2017-01-21 18:19:45 -08:00
Kaustubh Raste
881bef00c7 Merge "Add mips msa vpx hadamard functions" 2017-01-21 03:16:39 +00:00
Jerome Jiang
f4169936ee Merge "vp9: Add feature to use block source_sad for realtime mode." 2017-01-20 20:35:07 +00:00
Marco
219cdab676 vp9: Add feature to use block source_sad for realtime mode.
Only for speed >= 7, and affects skipping of intra modes.
Threshold is set low for now, needs to be tuned.
Small/no difference in metrics on rtc clips.

Change-Id: If9bdbd43f08d1f80407cdd2e9e5e96780dcd2424
2017-01-20 11:57:02 -08:00
Yunqing Wang
b0d8a75e48 Add the multi-threaded first pass encoder unit test
Added the multi-threaded first pass encoder unit test in VP9. The test is
to check if the new multi-threaded first pass encoder(namely, new-mt = 1)
still generates matching stats. In the unit test, the new-mt mode will be
turned on once the multi-threaded first pass implementation is checked in.

Change-Id: Ic21bb1a55c454f024cfd2b397a4c148cfe638218
2017-01-20 10:06:24 -08:00
James Zern
b608c09781 tools_common.h: add missing ';' in generic branch
missed in:
380a26112 Fix compile warnings for target=armv7-android-gcc

Change-Id: I2820fff00858a19f7dcf6e0fff189d455b7d640f
2017-01-19 15:09:59 -08:00
Johann
13234d3c43 Remove neon assembly for idct 16x16 and 8x8
Tested using test/partial_idct_test.cc:DISABLED_Speed

Both gcc 4.9 and clang 3.8 from the r13 Android NDK offer improvements
using the intrinsics:
<function>    <clang asm> <gcc asm> <clang intrin> <gcc intrin>
idct16x16_256  1720ms      1703ms    1546ms         1554ms
idct16x16_10   1320ms      1247ms     518ms          488ms
idct16x16_1     107ms       108ms      64ms           68ms
idct8x8_64      924ms       931ms     866ms          989ms
idct8x8_12      826ms       824ms     519ms          514ms
idct8x8_1       172ms       166ms     110ms          125ms

idct8x8_64 isn't quite perfect (slight regression with gcc intrinsics)
but as a counter example idct16x16_10 goes from ~1300ms to ~500ms

On a sample clip, clang improved from 48.5 to 49fps and gcc stayed roughly
stable.

BUG=webm:1303

Change-Id: I9d4fd2b41b46ea6174a887b40a82c8e6e4769ed4
2017-01-19 12:27:31 -08:00
Marco
0f9760ab6f vp9: Modify usage of force_skip under low temporal variance in non-rd pickmode.
For short_circuit set to level 1, skip newmv for 64x64 blocks if the
low temporal variance flag is set. Also modify threshold for 64x64 split
in variance partitioning.

Overall speed-up on noisy clips of 2-4%.
Only affect speed >= 7.

Change-Id: I384b3772007e84de6f8707e480d2ddf1fe1f907d
2017-01-19 11:21:15 -08:00
Kaustubh Raste
e0c0e65378 Add mips msa vpx hadamard functions
average improvement ~4x-5x

Change-Id: I167132d894c04fa85dda8dde7906ff9c61b3a65d
2017-01-19 14:44:03 +05:30
Jerome Jiang
ee5b29ae30 vp9: Stop copying partition every a fixed number of frames.
Avoid quality loss when copying partition of superblock with large motions.
Maximum consecutively copied frames can be set (currently 5).

Change-Id: I11c30575514f02194c0f001444cf4021609e5049
2017-01-18 11:23:59 -08:00
Peter Boström
e758f9d457 Merge "Add CSV per-frame stats to vpxdec." 2017-01-18 16:32:34 +00:00
James Zern
70c9b3c668 Merge "vp9_cx_iface,encoder_encode: check validate_img return" 2017-01-18 07:36:53 +00:00
Jerome Jiang
9152d434dc vp9: Disable partition copy when resizing is enabled.
Change-Id: I4fa3262e0f1c4018604c954b020ec5d1e3d1465c
2017-01-17 18:21:31 -08:00
Jerome Jiang
255866419d Merge "vp9: Set low variance flag when partition is copied." 2017-01-17 21:02:52 +00:00
Jerome Jiang
0c65aed099 vp9: Set low variance flag when partition is copied.
Also set the flag to 1 when exit early choosing 64x64 block
such that skipping new mv for golden works in these scenerios.

Change the size of prev_segment_id to the number of superblocks
to save memory.

Borg test shows quality regression of 0.012% on average PSNR
and 0.035% on SSIM.

Change-Id: I5014224c8617d439d35c66ece3fed9ae30b31d23
2017-01-17 11:14:50 -08:00
Johann Koenig
add0587fae Merge "Cygwin x86_64 support." 2017-01-17 17:45:55 +00:00
Moriyoshi Koizumi
34be6057da Cygwin x86_64 support.
This should have been taken into account at 64347a10

Change-Id: Ie8e3ad7cbaab3e5799e04bd50f2639390b0a2428
2017-01-17 09:04:37 -08:00
Peter Boström
a9ae351667 Add per-frame SSIM/PSNR stats to tools/tiny_ssim.
Adds an optional output framestats.csv file that prints comparions
per-frame instead of averaged over the entire clip. It prints
per-channel and combined metrics for SSIM and PSNR.

Change-Id: Id28dfade27bc5775b59a9d83cfe8b37d1d52b686
2017-01-17 10:47:50 -05:00
Ranjit Kumar Tulabandu
5f21aba4b0 Fix to avoid abrupt relaxation of max qindex in recode path
The fix relaxes the max qindex based on the data from previous loop of
coding if output frame size is greater than maximum frame size allowed

Change-Id: Iac1f63ec67559d68766e090a7cbb80b812b2560f
2017-01-16 18:03:27 +05:30
James Zern
c42a281439 vp9_cx_iface,encoder_encode: check validate_img return
before calling vp9_apply_encoding_flags() which may crash if the
resolution was invalid. this is the same change as:
c0523090b vp8e_encode: check validate_config return

BUG=https://bugzilla.mozilla.org/show_bug.cgi?id=1315288

Change-Id: Icd2aab322422e83d3a778fca6d7789e5000239d7
2017-01-13 16:53:03 -08:00
Marco
159cc3b33c vp9: Add speed feature flag for computing average source sad.
If enabled will compute source_sad for every superblock on every frame,
prior to encoding. Off by default, only on for speed=8 when
copy_partition is set.

Change-Id: Iab7903180a23dad369135e8234b7f896f20e1231
2017-01-13 11:52:12 -08:00
Marco Paniconi
f217049dbe Merge "vp9: Adjust threshold for copy partiton, for speed=8." 2017-01-13 19:07:57 +00:00
Marco
47270b6858 vp9: Adjust threshold for copy partiton, for speed=8.
Change-Id: I4799cb2b67d911ee385e6d6992c61633ca77e69d
2017-01-13 10:29:31 -08:00
Jingning Han
b6fe63a505 Merge "Rework 8x8 transpose SSSE3 for avg computation" 2017-01-13 18:25:17 +00:00
Jingning Han
553e9e291f Merge "Rework 8x8 transpose SSSE3 for inverse 2D-DCT" 2017-01-13 18:25:09 +00:00
Peter Boström
a981cb2809 Add CSV per-frame stats to vpxdec.
Used with --framestats=file.csv. Currently prints raw codec QP (not
internal 0-63 range) and bytes per frame.

Change-Id: Ifbb90129c218dda869eaf5b810bad12a32ebd82d
2017-01-13 08:14:49 -05:00
Marco Paniconi
888bb6c133 Merge "vp9: Update threshold for partition copy." 2017-01-13 06:22:53 +00:00
Jerome Jiang
2ff2376fbc vp9: Update threshold for partition copy.
Avoid many visual artifacts. Compression quality is improved by more
than 1%. Encode speed is about 4% for QVGA and 6% for VGA faster on
android.

Change-Id: I4dd0a81429ddf7efdef1e80a191da5fb8de8e8af
2017-01-12 18:48:38 -08:00
Johann
d630cda597 Merge remote-tracking branch 'origin/longtailedduck' 2017-01-12 15:40:14 -08:00
Jingning Han
39fff1bea0 Rework 8x8 transpose SSSE3 for avg computation
Use same transpose process as inv_txfm_sse2 does.

Change-Id: I2db05f0b254628a11f621c4c09abb89501ba6d3c
2017-01-12 15:16:07 -08:00
Jingning Han
f65170ea84 Rework 8x8 transpose SSSE3 for inverse 2D-DCT
Use same transpose process as inv_txfm_sse2 does.

Change-Id: Ic4827825bd174cba57a0a80e19bf458a648e7d94
2017-01-12 15:13:18 -08:00
Peter Boström
297dfd8696 Add decoder getters for the last quantizer.
To be used for frame stats output of vpxdec.

Change-Id: I0739a01bd3635c4b3fedd58f3e27363ce8fb1b1e
2017-01-12 16:16:22 -05:00
Johann
0c0a05046d Release v1.6.1 Long Tailed Duck
Change-Id: If27447472417c7ed34238295427ddb9da0561725
2017-01-12 12:27:27 -08:00
Marco Paniconi
baa4a290eb Merge "vp9: Make the denoiser work with spatial SVC." 2017-01-12 17:54:41 +00:00
Johann Koenig
3628975a15 Merge "Create a class for buffers used in tests" 2017-01-12 01:02:58 +00:00
Peter Boström
70ead526f1 Merge "Add Y,U,V channel metrics and unweighted metrics." 2017-01-11 21:05:47 +00:00
Jerome Jiang
6e07bf3634 Merge "vp9: Turn on the partition copy for speed 8. Tune threshold." 2017-01-11 20:50:43 +00:00
Johann Koenig
9f27d1f843 Merge "arm idct16x16: remove extra config guards" 2017-01-11 20:22:27 +00:00
Peter Boström
605ca82e7f Add Y,U,V channel metrics and unweighted metrics.
Renames SSIM to VpxSSIM as an upscaled weighted SSIM metric, then prints
Y, U and V channels unweighted as well as a weighted but not scaled SSIM
score that's 8/1/1 parts Y/U/V (same as VpxSSIM).

Change-Id: Iff800cc8f145314eeb1a9b4af1e11a25bec095ca
2017-01-11 14:51:18 -05:00
Jingning Han
d98bd7cc5f Merge "Rework forward 8x8 2D-DCT ssse3 implementation" 2017-01-11 19:28:39 +00:00
Jerome Jiang
f129e09529 vp9: Turn on the partition copy for speed 8. Tune threshold.
For speed 8, it speeds up the encoding on android by 6% for QVGA and
7.4% for VGA with the new threshold. Overall PSNR is improved by 0.667
for rtc.

Change-Id: I4a644560b32c0b5b4e9f49ffb953d000413a3732
2017-01-11 10:48:16 -08:00
Johann
68d0f46ec0 arm idct16x16: remove extra config guards
This file is guarded by HAVE_NEON_ASM in the .mk file now.

Change-Id: I513a621c234aa90ad52e426c8ed494d8a7d4b74a
2017-01-11 10:17:14 -08:00
Johann
6886da7547 Create a class for buffers used in tests
Demonstrate its use with the IDCT test.

Change-Id: Idf87fe048847c180f13818fd4df916ba4500134b
2017-01-11 08:28:39 -08:00
hui su
7a0bfa6ec6 Add "Large" label to VP9 target level tests
Also reduce the number of test frames.

Change-Id: Iea6fa93ca6b924535aef7bf8b388db4d0ec84c08
2017-01-10 17:29:43 -08:00
Marco
7e3a82c384 vp9: Make the denoiser work with spatial SVC.
If enabled denoiser will only denoise the top spatial layer for now.

Added unittest for SVC with denoising.

Change-Id: Ifa373771c4ecfa208615eb163cc38f1c22c6664b
2017-01-10 17:23:58 -08:00
Jingning Han
9a780fa7db Rework forward 8x8 2D-DCT ssse3 implementation
This commit reworks the SSSE3 implementation of the forward 8x8
2D-DCT. It uses a cyclic rotation approach to the temporary xmm
registers. It reduces the average cycles from 158 to 154. The SSE2
version uses 169 cycles.

Change-Id: I1b79b9642aae0ed3fb3cefb5b70246e6de5d5caa
2017-01-10 12:50:55 -08:00
Marco
91fc730d83 vp9: 1 pass cbr: Adjustments to usage of gf_cbr_boost and aq=3 mode.
When aq=3 mode is on and the gf_cbr_boost is set: make sure golden frame
is always refreshed, and don't incorporate segement cost in qp setting
on the boosted golden frame.

Better performance on RTC set with gf_cbr_boost on,
for example with gf_cbr_boost=50, gains from ~0.5-3%.

Change-Id: Ie811f5e4d444ff3320bd6e2c1745b2c4c09a8460
2017-01-10 09:42:06 -08:00
Jerome Jiang
299ef2f8eb Merge "vp9: Set less aggresive short_circuit_low_temp_var for HD at speed 8." 2017-01-10 00:51:09 +00:00
Jerome Jiang
198b834c97 vp9: Set less aggresive short_circuit_low_temp_var for HD at speed 8.
Quality improved by 1.866 and 0.386 for two noisy clips (dark720p and
marcooffice720p), respectively.

Change-Id: Ib33a7672ae9ca53da156208f7cd13f07b5543e44
2017-01-09 16:44:07 -08:00
Jerome Jiang
5b1a8ca5e8 Merge "Fix compile warnings for target=armv7-android-gcc" 2017-01-09 23:53:41 +00:00
James Zern
9480da21e8 Merge "Refine 8-bit 16x16 idct NEON intrinsics" 2017-01-09 23:52:29 +00:00
Marco Paniconi
62cce50d55 Merge "vp9: 1 pass cbr: Fix to qp clamping when gf_cbr_boost_pct is used." 2017-01-09 23:30:32 +00:00
Marco
35c4a13eb7 vp9: Fix comment in speed features.
Change-Id: I65d79c06b152922d725bf559adaa508f91cd5766
2017-01-09 13:05:31 -08:00
Marco
bea22782e9 vp9: 1 pass cbr: Fix to qp clamping when gf_cbr_boost_pct is used.
Avoid the qp-clamping on gf/alt frame if gf_cbr_boost_pct is set.

Change only affect CBR mode when  gf_cbr_boost_pct is set.

Change-Id: I0655ed4f2b047c8ed1ed33a070c17960ad776704
2017-01-09 12:52:50 -08:00
Johann Koenig
371a64bfe7 Merge "postproc: vpx_mbpost_proc_down_neon" 2017-01-09 19:53:15 +00:00
Johann Koenig
cabc29ba24 Merge "Add mips dspr2 partial idct tests" 2017-01-09 19:49:02 +00:00
Johann Koenig
8a7847c2c9 Merge "Fix mips dspr2 idct32x32 functions for large coefficient input" 2017-01-09 19:47:47 +00:00
Johann Koenig
bf168b24f5 Merge "Fix mips dspr2 idct16x16 functions for large coefficient input" 2017-01-09 19:47:00 +00:00
Johann Koenig
08d0a7fd0f Merge "Fix mips dspr2 idct8x8 functions for large coefficient input" 2017-01-09 19:46:18 +00:00
Johann Koenig
ab20869221 Merge "Fix mips dspr2 idct4x4 functions for large coefficient input" 2017-01-09 19:45:54 +00:00
Johann Koenig
7b18202e74 Merge "Add mips dspr2 vp9 intrapred tests" 2017-01-09 19:39:13 +00:00
Johann
c23970ec25 postproc: vpx_mbpost_proc_down_neon
This was much more amenable to optimization than the across filter.
Speedup of almost 2.5x

BUG=webm:1320

Change-Id: I49acc0f9cb2e7642303df90132cbc938acade4c4
2017-01-09 10:21:56 -08:00
Johann Koenig
9af97fb630 Merge "postproc: vpx_mbpost_proc_across_ip_neon" 2017-01-09 18:17:26 +00:00
Marco Paniconi
ebe0b57c91 Merge "vp9: 1 pass cbr mode: increase threshold for gf_cbr_boost_pct usage." 2017-01-09 17:23:12 +00:00
Kaustubh Raste
6377f9d966 Add mips dspr2 partial idct tests
Change-Id: Idf4003ea6f9a2a42a9f26e156bee73697acb7a37
2017-01-09 17:30:16 +05:30
Kaustubh Raste
50dd3eb62c Fix mips dspr2 idct32x32 functions for large coefficient input
Change-Id: If9da7099f226a27a09cc9e2899eb66a1158909d2
2017-01-09 17:21:09 +05:30
Kaustubh Raste
c06991fce6 Fix mips dspr2 idct16x16 functions for large coefficient input
Change-Id: I9be3d3d040837f658c6314606e28db8c31092a1a
2017-01-09 16:35:28 +05:30
Kaustubh Raste
24d804f79c Fix mips dspr2 idct8x8 functions for large coefficient input
Change-Id: If011dd923bbe976589735d5aa1c3167dda1a3b61
2017-01-09 16:22:19 +05:30
Kaustubh Raste
afd2d797eb Fix mips dspr2 idct4x4 functions for large coefficient input
Change-Id: I06730eec80ca81e0b7436d26232465b79f447e89
2017-01-09 15:28:30 +05:30
Kaustubh Raste
c6ccd1e939 Add mips dspr2 vp9 intrapred tests
Change-Id: I6be8c59ee220af0597bc2d7213f2779ac2e88db9
2017-01-09 14:11:57 +05:30
Linfeng Zhang
6abdd31555 Refine 8-bit 16x16 idct NEON intrinsics
Speed test shows 25% gain on vpx_idct16x16_256_add_neon(),
and vpx_idct16x16_10_add_neon() got trippled.

Change-Id: If8518d9b6a3efab74031297b8d40cd83c4a49541
2017-01-06 17:52:07 -08:00
Hui Su
c7e2bd6298 Merge "Add support for VP9 level targeting" 2017-01-07 00:55:41 +00:00
Johann
4dca923454 postproc: vpx_mbpost_proc_across_ip_neon
The speedup is pretty poor. I would be concerned except the SSE2 is
worse:
Existing SSE2 improvement: 22%
New neon improvement: 35%

BUG=webm:1320

Change-Id: Ied598a261134aa6cbe69f96f58589d2bae17bf62
2017-01-06 16:39:17 -08:00
Marco
f1909d26f8 vp9: 1 pass cbr mode: increase threshold for gf_cbr_boost_pct usage.
Increase the boost threshold below which GOLDEN update will use same
rate correction factor as INTER_NORMAL.

Improves performance when gf_cbr_boost_pct is set (between 0 and 100)
in CBR mode.

Change-Id: I9f54cc18664786a100b13a416b7137ae03bd0cab
2017-01-06 15:37:10 -08:00
Jerome Jiang
316071d79c Merge "vp9: Enable more aggresive short circuit for speed 8." 2017-01-06 22:38:40 +00:00
Marco Paniconi
b632626ec0 Merge "vp9: Add some controls to sample encoder: vpx_temporal_svc_encoder" 2017-01-06 22:34:49 +00:00
Jerome Jiang
b87ebd7af8 Merge "vp9: Compute source sad for every superblock when partition copy is on." 2017-01-06 21:57:27 +00:00
Marco
bf5cdbdf9d vp9: Add some controls to sample encoder: vpx_temporal_svc_encoder
Add the gf boost and frame_parallel controls.
Set as default to off.

Change-Id: Id85fcb16a4fae97f51c09e9ebadb5cdcd510c2f5
2017-01-06 11:34:04 -08:00
Jerome Jiang
267e73446c vp9: Enable more aggresive short circuit for speed 8.
Set short_circuit_low_temp_var to 3 for speed 8 for all res.
No strong visual difference on all clips.

Change-Id: Ia6d9a314291ab1c14d5421bbdd769974083aeb2a
2017-01-06 10:23:34 -08:00
hui su
337ad83e58 Add support for VP9 level targeting
Constraints on encoder config:
-target_bandwidth is no larger than 80% of level bitrate limit
-target_bandwidth * (1 + max_over_shoot_pct) is no larger than
88% of level bitrate limit
-min_gf_interval is no smaller than level limit
-tile_columns is no larger than level limit

Constraints on rate control:
-current frame size plus previous three frames' size is no larger
than the CPB level limit
-current frame size is no larger than 50%/40%/20% of the CPB
level limit if it's a key/alt-ref/other frame.

Change-Id: I84d1a2d6d6e3c82bfd533b3309ce999cfaba2c8b
2017-01-06 10:07:31 -08:00
Jerome Jiang
afc8c4836f vp9: Compute source sad for every superblock when partition copy is on.
The source sad could be used to copy the partition without going into
choose_partitioning function to speed up vp9 encoding. Computing source
sad takes little time. Speed test on Android and Linux shows little
encoding time gain (less than 1.4%).

Turned off for now since partition copy is turned off.

Change-Id: I61c9d5b8f22329760cb29a4ee30a7f9c232ce8d3
2017-01-06 17:59:02 +00:00
Linfeng Zhang
2d12a52ff0 Merge "Add high bitdepth 8x8 idct NEON intrinsics" 2017-01-06 16:47:23 +00:00
Linfeng Zhang
90f889a56d Merge "Clean DC only idct NEON intrinsics" 2017-01-06 01:16:19 +00:00
Jerome Jiang
72746c079d vp9: Set short circuit to level 3 for VGA for speed 8.
vp9: Set short circuit to level 3 for VGA for speed 8. Also change the
threshold_32x32 to 5/8*thresholds[1] to improve quality regression
caused to VGA clips.

Change-Id: Ia1590e91e7cb22be78d5b85013387bb1be4272e3
2017-01-04 11:28:31 -08:00
Marco Paniconi
1ca1515dd3 Merge "vp9: 1 pass cbr: allow noise estimation down to 360p." 2017-01-04 17:24:08 +00:00
Marco
768b1f7281 vp9: 1 pass cbr: allow noise estimation down to 360p.
Also adjust some thresholds for noise level setting.

Change-Id: I7e03d7057ef2061c9447728deb9c6aff5d3da4b7
2017-01-03 16:26:22 -08:00
Marco
63a8257fb7 vp9: SVC unittests: fix to use y4m source.
Comment out check on buffer underrun, as it currently fails
on some of the svc tests.

Also cast the update of bits_in_buffer_model_, as this can
go negative now due to the buffer underrun.
This fixes the issue in #1352.

BUG=webm:1350
BUG=webm:1352

Change-Id: Ibd4ef23921daf09e5c15b000aca904aa4573599c
2017-01-03 15:29:04 -08:00
Ranjit Kumar Tulabandu
d3db846cc5 Fix for max qindex calculation of a gf interval
Calculation of active_worst_quality of a gf interval is modified
for coherency

BUG=webm:1355

Change-Id: I84cc2b47a8713f102a69419fb33ab020cffa3e71
2017-01-03 10:24:02 -08:00
Yunqing Wang
99c573f018 Merge "Fix for out of range motion vector bug in joint motion search" 2017-01-03 17:46:15 +00:00
Ranjit Kumar Tulabandu
b67e1f701f Fix for out of range motion vector bug in joint motion search
Clamped the initial mv in vp9_refining_search_8p_c.

BUG=webm:1354

Change-Id: I47d302b350937e3e6e52e95c983b5fb0b4c64fba
2017-01-03 09:12:32 -08:00
Yunqing Wang
ecdb6a00c2 Merge "Make sub-pixel mv search's return value consistent with the return type" 2016-12-29 19:16:01 +00:00
Yunqing Wang
c96a8dcb5b Merge "Bug fix to avoid random crashes during ARNR filtering" 2016-12-29 17:24:24 +00:00
Gabriel Marin
e6b9609fc0 Merge "Remove superfluous conditional on 'shortcut'" 2016-12-29 06:03:43 +00:00
Linfeng Zhang
911bb980b1 Clean DC only idct NEON intrinsics
BUG=webm:1301

Change-Id: Iffc83854218460b3f687f3774e71d45b552382a5
2016-12-28 13:51:44 -08:00
Linfeng Zhang
9b187954df Add high bitdepth 8x8 idct NEON intrinsics
BUG=webm:1301

Change-Id: I56e3bc3aab9214e2debac93796389a7194991084
2016-12-27 16:28:53 -08:00
Yunqing Wang
1d12559b09 Make sub-pixel mv search's return value consistent with the return type
For out-of-range cases, returned UINT_MAX instead of INT_MAX in the
sub-pixel mv search to be consistent with the "uint32_t" return type.

Change-Id: I8e206d771228c13d89bafbbe9f14722c8ecc6a7a
2016-12-27 12:08:38 -08:00
Ranjit Kumar Tulabandu
7cf13826b7 Bug fix to avoid random crashes during ARNR filtering
The function 'vp9_find_best_sub_pixel_tree_pruned_more' is modified
to return INT_MAX for handling invalid MV cases from UINT32_MAX.

yunqingwang:
patch 3: rebased on top of the tree.
patch 4: The return type of vp9_find_best_sub_pixel_tree* was changed
to uint32_t to fix ubsan warnings. Changing UINT_MAX back to INT_MAX
was not quite right. Patch 4 modified vp9_temporal_filter.c to accept
uint32_t.
(Note: Inconsistency exists in vp9_find_best_sub_pixel_tree*, which
will be fixed in a separate CL.)

Change-Id: Ib1a79dc2aa41ea6335c21669c76883cdbb7e0535
2016-12-27 11:20:08 -08:00
Linfeng Zhang
3c47a0dc6f Merge "Clean idct 8x8 neon functions" 2016-12-27 17:59:28 +00:00
James Zern
78a24171a6 Revert "vp9: SVC unittests: fix to use y4m source."
This reverts commit f0b491a52405abb1b3dbb6b2c74dd6a4c7a7ddb1.

This change results in unsigned integer overflows (as reported by
-fsanitize=integer) in datarate_test.cc,
for many of --gtest_filter=VP9/DatarateOnePassCbrSvc.OnePassCbrSvc*:
unsigned integer overflow: 167198 - 185560 cannot be represented in type
'unsigned long'

As the encoder didn't change, but the input with the change to
(correctly) use Y4mVideoSource, this revert is merely masking the issue.

BUG=webm:1352

Change-Id: Iecd9a6c83b3fca67c566732a5c92d36193cc2060
2016-12-23 14:18:18 -08:00
Jerome Jiang
380a26112c Fix compile warnings for target=armv7-android-gcc
Fix compile warnings about implicit type conversion for
target=armv7-android-gcc in vpxenc.c.

BUG=webm:1348

Change-Id: I9fbabd843512f2a1a09f4bb934cd091e834eed9c
2016-12-22 14:56:20 -08:00
Marco Paniconi
36e767c147 Merge "vp9: SVC unittests: fix to use y4m source." 2016-12-22 17:26:42 +00:00
James Zern
90ceaba3e4 libs.mk/stress.sh,curl: set --retry to 1
provide some resilience for transient errors

Change-Id: I8db3d4eb5ef3cccc235a8c4c0052199c0ce23a27
2016-12-22 08:29:15 -05:00
Marco
f0b491a524 vp9: SVC unittests: fix to use y4m source.
Comment out check on buffer underrun, as it currently fails
on some of the svc tests.

BUG=webm:1350

Change-Id: I73c88b800cdcc06bd2f900f7b7e2a5fd08248065
2016-12-21 22:59:35 -08:00
Linfeng Zhang
6d5a3fe583 Clean idct 8x8 neon functions
BUG=webm:1301

Change-Id: I05f47dca1fddc155c8396e627cfccf6449677307
2016-12-21 14:24:17 -08:00
Marco
e7c453b613 vp9: 1 pass vbr: Skip find_predictors in pickmode when source is altref.
When source frame is altref, we only do zero-mv mode, so we can skip
the find_predictors(). No change in compression.
Small speed gain, ~1%.

Only affects 1 pass vbr with lookhead altref, for ytlive with
the macro flag USE_ALTREF_FOR_ONE_PASS on.

Change-Id: I9318c5da8521f017bf54919cd652438b3a6313d1
2016-12-21 12:12:55 -08:00
Marco Paniconi
b5770a2007 Merge "vp9; Fix to unitest for high noise." 2016-12-21 19:38:00 +00:00
Marco
9ba77ed45b vp9; Fix to unitest for high noise.
Source if y4m, and fix comment.

Change-Id: I1eb84977d42dd0f9009c276b56b3fdb03949bfc2
2016-12-21 10:22:34 -08:00
Marco Paniconi
9ba45fa510 Merge "vp9: Add datarate test for denoiser, for high noise case." 2016-12-21 03:56:13 +00:00
Marco
3fcd595dfb vp9: Add datarate test for denoiser, for high noise case.
Also breakout the denoiser tests, as the denoiser only
runs for real-time speed >=5.

Change-Id: I921b785860c35e9d1ebfad0833673a98490186c2
2016-12-20 16:48:25 -08:00
Jerome Jiang
f27276f44f Merge "vp9: Add feature to copy partition from the last frame." 2016-12-20 21:46:44 +00:00
Gabriel Marin
fce163cd54 Remove superfluous conditional on 'shortcut'
Remove superfluous test. Produces a small improvement in instruction scheduling.
Measured a 1% to 1.5% reduction in execution time for routine vp9_optimize_b
with different compilers.

No change in behavior.

TEST=Verified that encoded files match bit for bit, with and without this
change.
BUG=b/33678225

Change-Id: I2bf248d4c25fc0256147d7a8766ff9108ae9cba3
2016-12-20 12:20:21 -08:00
Kaustubh Raste
8a152a55f7 Merge "Add mips msa vp9 intrapred tests" 2016-12-20 02:27:08 +00:00
Jerome Jiang
1d5ca84df6 vp9: Add feature to copy partition from the last frame.
Add feature to copy partition from the last frame.
The copy is only done under certain conditions that SAD is below threshold.
Feature is currently disabled, until threshold is tuned.
Feature will be initially used for Speed 8 (ARM).

Under extreme case of always copying partition for speed 8:
Encode time is reduced by 5.4% on rtc_derf and 7.8% on rtc.
Overall PSNR reduced by 2.1 on rtc_derf and 0.968 on rtc.

Change-Id: I1bcab515af3088e4d60675758f72613c2d3dc7a5
2016-12-19 16:24:03 -08:00
Gabriel Marin
85aead1790 Merge "Simplify address arithmetic in vp9_optimize_b" 2016-12-19 23:25:39 +00:00
James Zern
80474bf65e Merge "vpx_idct32x32_1024_add_neon: quiet uninitialized warning" 2016-12-19 22:39:01 +00:00
Marco Paniconi
c1f5194842 Merge "vp9 denoiser: Fix the logic for re-evaluating zeromv after denoising." 2016-12-19 21:15:37 +00:00
Gabriel Marin
0549f5aae9 Simplify address arithmetic in vp9_optimize_b
Simplify address arithmetic on token_costs to reduce the number of generated
instructions that are used for address arithmetic inside routine
vp9_optimize_b. It also helps improve instruction scheduling depending on
compiler and optimization level.

Measured a 9.3% reduction in retired instructions and 5.3% reduction in
execution time for this routine with GCC v4.8.4 and optimization flags -O3,
and a reduction of up to 11.6% in execution time with other compilers.

No change in behavior.

TEST=Verified that encoded files match bit for bit, with and without this
change.
BUG=b/33678225

Change-Id: I6098650fb5cd2aa04e014fe6e68ca20761f3a21f
2016-12-19 13:10:04 -08:00
James Zern
a68b36c752 vpx_idct32x32_1024_add_neon: quiet uninitialized warning
relocate the assignment to 'in' outside of the for loop. this quiets a
spurious warning in visual studio builds since:
86e340c enable vpx_idct32x32_1024_add_neon in hbd builds

+ give the variable a more descriptive name

BUG=webm:1294

Change-Id: I5c3da5c7939621477e0fc0ad3a1b2a3045c5bffd
2016-12-19 12:49:44 -08:00
Marco
6e8dbc76ad vp9: With denoising on, only estimate noise level for higher resolns.
Allow it for resolns above 640x360 for now.

Change-Id: I087d0d8173f96b316164fdd4a499110ce2e7a233
2016-12-19 10:05:54 -08:00
Marco
61b569b461 vp9 denoiser: Fix the logic for re-evaluating zeromv after denoising.
Correctly set interp_filter to SWITCHABLE for INTRA mode.
Also reduce threshold on noise level for re-evaluating zeromv.

Change-Id: Id32c01e193209fb380aa07204f0be3babf29f70a
2016-12-19 09:30:16 -08:00
Linfeng Zhang
7e23f895ca Merge "Clean hbd idct 4x4 neon functions and other" 2016-12-19 17:09:26 +00:00
Kaustubh Raste
1f3e079a35 Add mips msa vp9 intrapred tests
Change-Id: I49b91464a87cad8692f4b1477e45e5f567b4fe87
2016-12-19 17:32:38 +05:30
Johann Koenig
9b63cb057a Merge "post proc test: add padding for sse2 tests" 2016-12-17 01:12:34 +00:00
Marco Paniconi
d1eca240fb Merge "vp9: Change condition to enable recheck_zeromv_after_denoising." 2016-12-16 23:53:33 +00:00
Marco
4260a7f2b3 vp9: Change condition to enable recheck_zeromv_after_denoising.
For when denoising enabled: change condition to enable
the recheck_zeromv_after_denoising for only very high noise level.
This is causing an issue, so enabling it for very high noise
to effectively shut it off.

Change-Id: Ic40d6025f3f398338cedd270d17c0ccd9a3daa84
2016-12-16 15:00:21 -08:00
Johann
5993b808f0 post proc test: add padding for sse2 tests
Avoid valgrind warnings for reading out of bounds when the width is not
divisible by 16.

Change-Id: I5670d7cfbbce00874b98cfb7472f99c7936c2c47
2016-12-16 14:06:06 -08:00
Johann
4781a67737 postproc test: disable new down and across test
The new test is causing valgrind failures:
[ RUN      ] SSE2/VpxPostProcDownAndAcrossMbRowTest.CheckCvsAssembly/0
==28923== Invalid read of size 16
28923==    at 0x724016: ??? (deblock_sse2.asm:146)

Disable during investigation. The test is new but the code is not.

Change-Id: I5521e5fd48a595e3798b833bf7e3cc97b81c1975
2016-12-16 12:19:00 -08:00
Jim Bankoski
318a1ff5ec vp8 : use threading mutex's for tsan only.
To avoid decode performance hit of 2% when running on hyperthreaded
cores.

This patch only uses the mutex's when we are running tsan.

This is safe because 32 bit operations like read and store are atomic
on all the platforms we care about. Tsan warns about race situations,
but in this case either situation ( read occurs before write or write
before read) the worst case is that we go around one extra time in the
loop.  So the ordering doesn't really matter.

That said a few other things have been tried :

for instance as per here:
webrtc/base/atomicops.h#52

In this patch they use:
__atomic_load_n(i, __ATOMIC_ACQUIRE);
__atomic_store_n(i, value, __ATOMIC_RELEASE);

This code works on gcc, clang ( replacing protected write and read), and
avoids tsan errors. Incurring no penalty in performance.  In C11 its
replaced by straight atomic operands.

However there is no equivalent in the visual studio's we support as
int32 on all windows platforms is already atomic.  To avoid tsan like
warnings on windows we'd need to use interlocked exchange and the
end result doesn't gain us any thing.

Change-Id: I2066e3c7f42641ebb23d53feb1f16f23f85bcf59
2016-12-16 08:50:55 -08:00
Marco Paniconi
2b1ec65b5d Merge "vp9: Fix to usage of flag USE_ALTREF_FOR_ONE_PASS" 2016-12-15 19:48:16 +00:00
Johann
41b0888a84 postproc: neon down and across macroblock filter
Implement vpx_post_proc_down_and_across_mb_row in NEON.
Runs about 6-7x faster than C.

BUG=webm:1320

Change-Id: Ic5c7d3552a88cfcf999ec5bf2bd46fee460642c2
2016-12-14 15:11:28 -08:00
Marco
5de798f2b2 vp9: Fix to usage of flag USE_ALTREF_FOR_ONE_PASS
The flag USE_ALTREF_FOR_ONE_PASS allows for alt-ref lookahead
in 1 pass vbr (from https://chromium-review.googlesource.com/#/c/365498).
This change is to make sure this macro flag only has effect if
the config flag cpi->oxcf.enable_auto_altef is also on.

No change in ytlive encoding, as USE_ALTREF_FOR_ONE_PASS is not
yet enabled.

Change-Id: I1a69681e4a15c5244581a3dab4587fca08f02e0f
2016-12-14 15:07:38 -08:00
Linfeng Zhang
c8f25fa5c0 Clean hbd idct 4x4 neon functions and other
BUG=webm:1301

Change-Id: I387b7eae716a7df15c691dc6f368b07602df7342
2016-12-14 11:38:28 -08:00
Yaowu Xu
27e1bacdb3 Change order of operation to avoid ubsan warnings
This commit change an order of operation to avoid left shifts of
negative numbers.

Change-Id: I607c7eb91658c7a5ef397fc1504721d1b10e3dd6
2016-12-14 09:37:14 -08:00
Linfeng Zhang
3dd20456ab Merge "Update idct test code to test 8-bit & high bitdepth simultaneously" 2016-12-14 17:05:34 +00:00
Linfeng Zhang
201dcefafe Update idct test code to test 8-bit & high bitdepth simultaneously
Change-Id: Icc0eb9c0ddf2a13ec832877a089450972134e8ec
2016-12-13 17:25:04 -08:00
James Bankoski
3486abd54a Merge "Reapply 'Amend and improve VP8 multithreading implementation'" 2016-12-14 01:21:50 +00:00
James Zern
86e340c76e enable vpx_idct32x32_1024_add_neon in hbd builds
BUG=webm:1294

Change-Id: Ibdda54e6d1303b0f73bc7bc71417e4041d7618de
2016-12-12 19:28:35 -08:00
Jim Bankoski
85a541a421 Reapply 'Amend and improve VP8 multithreading implementation'
Reapply this patch:
ff0107f Amend and improve VP8 multithreading implementation

Amended the patch to add a unit test, and fix an asan error.

BUG=webm:851

Change-Id: I6572c03256169c64e80248bf5a5e99f59a2fc93c
2016-12-13 02:11:34 +00:00
Linfeng Zhang
5d4aa325a6 Cosmetics by unifying dest_stride to stride in idct
Change-Id: Ie9336a808a3c3592bb4fd5d4ad3839028bfcafba
2016-12-12 15:13:22 -08:00
James Bankoski
282f3b3d78 Merge "vp8: adds multithread testing." 2016-12-10 00:01:32 +00:00
Marco Paniconi
817488be47 Merge "vp9: Fix to crash in svc code." 2016-12-09 23:47:02 +00:00
Jim Bankoski
121e161115 vp8: adds multithread testing.
The test is disabled because of TSAN errors until we resolve
BUG=webm:851

Change-Id: I0b21c8d815bc1ea365da024b1e2ee5e1fc5715c2
2016-12-09 15:05:59 -08:00
Johann
2c24f7178d Move load_and_transpose to transpose_neon.h
Allows for use outside the idcts without pulling in idct_neon.h

Change-Id: I4a94c1af3dac3e1b5bc8296ec9eab0ddcc8cfecf
2016-12-09 12:54:55 -08:00
Marco
076d4bd91a vp9: Fix to crash in svc code.
use_base_mv assumes 2x2 scaling, so fix is to shutoff
this feature unless spatial scale factors are 2.

Added svc unittest for 2 spatial layers with 5x5 scaling,
which generates the issue without this fix.

Also fix some settings in svc unittest:
let the speed setting vary (from 5 to 8), and enable static threshold.

BUG=webm:1344

Change-Id: Idfd0a6c633c21b49a0479601506302cfe974e30e
2016-12-09 08:57:09 -08:00
James Zern
7ba9d31e3f Merge "idct16x16_add_neon: fix arm visual studio builds" 2016-12-09 03:19:16 +00:00
Marco
cd6f742980 vp8 multi_res_encoder: Ajust some settings in sample encoder.
Set #threads to default 1 for all streams, change bit allocaton
for 3 temporal layers, and enable denoiser on middle resolution layer.

Change-Id: I4a57adbfdb2c319002b8f3cf359613842dc00d75
2016-12-08 15:27:16 -08:00
James Zern
6defef4ab2 idct16x16_add_neon: fix arm visual studio builds
after:
2d3d95f enable vpx_idct16x16_256_add_neon in hbd builds

reorder INCLUDEs and fix indent of IF/ENDIFs

remove vpx_config.asm to avoid multiple symbol definitions in windows
builds and shift idct_neon.asm.S to the top to allow use of
CONFIG_VP9_HIGHBITDEPTH in the export list.

Change-Id: I0dacfbae62a6ec8fe4a26940c1a52da2dfad2029
2016-12-08 15:17:57 -08:00
Yunqing Wang
880adc3355 Merge "Remove an unused first pass statistic" 2016-12-08 22:46:44 +00:00
Yunqing Wang
394020383d Remove an unused first pass statistic
One of the first pass stats "new_mv_count" is no longer used in VP9,
and is removed. This also makes it easy to implement a multi-threaded
first pass. This change doesn't affect the coding performance, which
has been verified by borg tests.

Change-Id: I4c7c7bf9465fda838eb230814ef0c631c068c903
2016-12-07 15:32:25 -08:00
Marco Paniconi
e4c6f8fde7 Merge "vp9: Fix some TODOs in svc code." 2016-12-07 22:06:01 +00:00
Linfeng Zhang
385599b553 Merge "Update TEST_P(PartialIDctTest, RunQuantCheck)" 2016-12-07 21:05:05 +00:00
Linfeng Zhang
174528de1e Merge "Update idct NEON optimization to not use narrowing saturating shift" 2016-12-07 21:03:21 +00:00
Marco
5778a7c9cb vp9: Fix some TODOs in svc code.
Change-Id: Ie9f441245987ade9dab38af69adf4dd1fb38ca3f
2016-12-07 13:02:48 -08:00
James Zern
f16a0a1aa4 Merge "enable vpx_idct16x16_256_add_neon in hbd builds" 2016-12-07 20:26:44 +00:00
Linfeng Zhang
834feffe08 Update TEST_P(PartialIDctTest, RunQuantCheck)
1. Use correct projections when copying real dct/quant outputs.
2. Remove local random number generator and combine loops.
3. Quantization with minimum allowed step sizes instead of maximum.
   This may generate larger inputs.

Change-Id: I154afc26230c894d564671cff4b8fd5485b69598
2016-12-07 11:34:00 -08:00
Marco Paniconi
17c403d0ab Merge "vp9: Adjust the weight factor for segment rate cost for aq-mode=3." 2016-12-07 19:31:13 +00:00
Linfeng Zhang
018a2adcb1 Update idct NEON optimization to not use narrowing saturating shift
Change-Id: Iae517017217dbacd638d40fcfeeb0f4bba7b8b8b
2016-12-07 10:25:09 -08:00
James Zern
2d3d95f7ac enable vpx_idct16x16_256_add_neon in hbd builds
BUG=webm:1294

Change-Id: Ib421c150b0d29dee0a81390a612bf01a4a28cff1
2016-12-06 18:32:21 -08:00
James Zern
228c9940ea Merge changes Ibad079f2,I7858a0a1
* changes:
  enable vpx_idct16x16_10_add_neon in hbd builds
  idct16x16,NEON: rm output_stride from pass1 fns
2016-12-07 01:40:28 +00:00
James Zern
8befcd0089 enable vpx_idct16x16_10_add_neon in hbd builds
BUG=webm:1294

Change-Id: Ibad079f25e673d4f5181961896a8a8333a51e825
2016-12-06 16:09:19 -08:00
James Zern
af9d7aa9fb idct16x16,NEON: rm output_stride from pass1 fns
vpx_idct16x16_256_add_neon_pass1, vpx_idct16x16_10_add_neon:
this was a constant 8 in all cases meaning the results are stored
contiguously, this allows the number of stores to be reduced.

Change-Id: I7858a0a15a284883ef45c13dfd97c308df9ea09e
2016-12-06 15:13:33 -08:00
Linfeng Zhang
cb339d628f Refine 8-bit 8x8 idct NEON intrinsics
Change-Id: I4ec4ad1928ec2ed87f596f52f097bc52065278dd
2016-12-05 17:50:14 -08:00
Marco
360ac89885 vp9: Adjust the weight factor for segment rate cost for aq-mode=3.
Use the segment weight factor based on the target (cr->percent_refresh)
if it less than the current estimate (avergae of past usage and target).
Small improvement at low bitrates.

Change-Id: Iba8fd909e203f94458901366d3a991f7ea854d49
2016-12-05 12:42:56 -08:00
Linfeng Zhang
a8eee97b43 Check in vpx_lpf_vertical_4_dual_neon() assembly
This replaces its C version.

Change-Id: Ie39e9324305fdc0fff610ced608a037e44a85a1a
2016-12-02 15:54:30 -08:00
James Zern
a7fa1314da Merge changes I4afc130e,Iaa64d23f
* changes:
  Add high bitdepth 4x4 idct NEON intrinsics
  Update idct x86 intrinsics to not use saturated add and sub
2016-12-02 04:01:28 +00:00
Linfeng Zhang
17a8cf5cc3 Add high bitdepth 4x4 idct NEON intrinsics
Change-Id: I4afc130effa05b8be2e9f982967216b1beb2ce4b
2016-11-30 13:07:13 -08:00
Linfeng Zhang
264f6e70ec Update idct x86 intrinsics to not use saturated add and sub
Change-Id: Iaa64d23fdb45ca1f235b0ea57e614516e548eca4
2016-11-29 17:06:08 -08:00
James Zern
c6641782c3 idct16x16,NEON,cosmetics: normalize fn signatures
+ remove unused parameters from vpx_idct16x16_10_add_neon_pass2

Change-Id: Ie5912a4abdd308fab589380bca054a2e7234a2c4
2016-11-28 16:46:01 -08:00
James Zern
12566c3d0f Merge changes Ide6d3994,I164cfcbe
* changes:
  enable vpx_idct32x32_135_add_neon in hbd builds
  idct_neon: rename load_tran_low_to_s16 -> ...s16q
2016-11-29 00:12:45 +00:00
James Zern
33ddc645ce Merge "build/make/Android.mk: correct rtcd template var refs" 2016-11-28 23:39:37 +00:00
James Bankoski
68991d7f87 Merge "svc_test: fix two warnings" 2016-11-28 22:27:26 +00:00
Jim Bankoski
27b5cc31e6 svc_test: fix two warnings
Use of possibly uninitialized variable and missing test initializer.

Change-Id: I2192c81c39ef4239cc11a309850c0ee8781ef17e
2016-11-28 12:53:39 -08:00
Jerome Jiang
f68cf8ba19 Cosmetic changes to variable names in deblocker tests.
Change kExpectedOutput to expected_output in function parameters in
the deblocker test.

Change-Id: I5baf8d1285ac47922950887406c7aa519ddc512a
2016-11-28 10:08:12 -08:00
James Zern
a58e0b2a74 build/make/Android.mk: correct rtcd template var refs
the expansion of findstring and rtcd_dep_template_CONFIG_ASM_ABIS needs
to be deferred until the block is parsed as makefile syntax rather than
eval time where rtcd_dep_template_CONFIG_ASM_ABIS will be unset. this
ensures vpx_config.asm is properly created.

Change-Id: I7c38c6c082da78397936467482789dd468adc316
2016-11-24 17:55:16 -08:00
James Zern
120234fa17 Merge changes I6b4cd56e,I88f91b92
* changes:
  Android.mk,armv7: fix idct_neon.asm.S creation
  build/make/Android.mk: set/use qexec appropriately
2016-11-24 07:22:04 +00:00
James Zern
21a1abd8e3 enable vpx_idct32x32_135_add_neon in hbd builds
BUG=webm:1294

Change-Id: Ide6d3994fe01c4320c9d143e6d059b49568048e4
2016-11-23 19:59:43 -08:00
James Zern
568d4b1d63 idct_neon: rename load_tran_low_to_s16 -> ...s16q
BUG=webm:1294

Change-Id: I164cfcbe9bc4511d1d04af9206cf351a0ec2957b
2016-11-23 19:57:48 -08:00
James Zern
d757d7e998 Merge changes Icc4ead05,Ib019964b,I3b5fd3b3,Ieedadee2
* changes:
  Update vpx_idct4x4_16_add_neon() to pass SingleExtremeCoeff test
  Refine 8-bit 4x4 idct NEON intrinsics
  Add idct speed test.
  Update partial_idct_test.cc to support high bitdepth
2016-11-24 03:31:25 +00:00
Jerome Jiang
f63eb66ecd Merge "Change C/MSA post proc to match SSE2." 2016-11-24 01:56:34 +00:00
Jerome Jiang
95eb505660 Merge "Cover more filter levels in unit tests for post proc." 2016-11-24 01:56:22 +00:00
James Zern
2c598d0858 Android.mk,armv7: fix idct_neon.asm.S creation
force this to be created before any other .S files. this change
additionally removes the file from the source list as it doesn't need to
be compiled on its own.

Change-Id: I6b4cd56ef6059d08f75f06fb749cddf76e0e165e
2016-11-23 16:49:19 -08:00
James Zern
1136db0db0 build/make/Android.mk: set/use qexec appropriately
commands are echo'd when V=1; libs.mk depends on this variable as well

Change-Id: I88f91b9260f16686cfccdf6bd3f29d246521b62e
2016-11-23 16:46:50 -08:00
Marco
d793950ec8 vp9: Adjust cyclic refresh parameters for low bitrates.
Increase the motion threshold and qp-delta for segment#2 boost.
This can increase the frame-drop at low bitrates, but generally
better spatial quality.

Only affects real-time mode with aq-mode=3, at very low bitrates.

Change-Id: I5ccb784667f70d0c27d369806b93b1f93d5605d1
2016-11-23 12:14:28 -08:00
James Zern
af290bfe3b Merge "use storage.googleapis for testdata download" 2016-11-23 19:27:20 +00:00
Jerome Jiang
97ec6291ee Change C/MSA post proc to match SSE2.
BUG=webm:1321

Change-Id: I719023375dc48cf7d8ed72188853f0f1ccc4ad7f
2016-11-23 10:42:11 -08:00
Jerome Jiang
755fb3d4ec Cover more filter levels in unit tests for post proc.
For some filter level, the C/MSA doesn't match SSE2. Part of unit tests
are disabled. They will be re-enabled when C/MSA funcs are fixed.
BUG=webm:1321

Change-Id: Ib16b98b5eecb15d2252aa4ea267b782ee2b27533
2016-11-23 10:31:41 -08:00
Marco Paniconi
8b2cbaefcf Merge "vp9: Use more aggressive skip when short_circuit_low_temp_var = 1." 2016-11-23 18:15:58 +00:00
James Zern
22f7aca097 use storage.googleapis for testdata download
replace downloads.webmproject.org with the canonical
storage.googleapis.com/... form. this appears less likely to fail when
dealing with multiple concurrent connections.

Change-Id: I0dcbd04df9e4057fa851f458b3ef7e3589f1f2f1
2016-11-22 23:03:12 -08:00
James Zern
d7f1d60c51 Merge "avoid redefining WIN32_LEAN_AND_MEAN" 2016-11-23 00:43:22 +00:00
James Zern
198a046d3e Merge "vp9,read_inter_block_mode_info: quiet msan warning" 2016-11-23 00:42:24 +00:00
James Zern
cb22359d02 vp9,read_inter_block_mode_info: quiet msan warning
best_sub8x8[1] won't be used meaningfully when is_compound is false, but
may trigger an msan warning as the value is copied around and later
clamped.

BUG=667044

Change-Id: Icc24c3b72cdb550bebea44d4aaa4ff8bf3fbab56
2016-11-22 15:32:00 -08:00
Linfeng Zhang
05e2b5a59f Merge "Add 32x32 d45 and 8x8, 16x16, 32x32 d135 NEON intra prediction" 2016-11-22 23:20:53 +00:00
James Zern
446d1ee624 avoid redefining WIN32_LEAN_AND_MEAN
fixes redef errors when the macro is supplied elsewhere, e.g., the
command line

Change-Id: Ic15726817a43e30595d50562ef1f077060c193cf
2016-11-22 15:15:53 -08:00
Marco
b6597745f9 vp9: Use more aggressive skip when short_circuit_low_temp_var = 1.
Use the same feature as https://chromium-review.googlesource.com/#/c/411327/,
but allow it to be used for speed  = 6 and 7, where
short_circuit_low_temp_var = 1.

Speed up of ~2-3% for speed 7, with little/no loss in compression.

Change-Id: I263a0f261ad9929034392d68f0153dc6376fdb5f
2016-11-22 14:54:28 -08:00
Jerome Jiang
0966757874 Cosmetic changes to post proc unit tests.
Remove unnecessary "virtual" before some functions. Change *_btm_* in
variable names to *_bottom_*.

Change-Id: Ifd4ce667537617f451cdfed47dd8c48817fd983b
2016-11-22 22:28:17 +00:00
James Zern
7d2690e658 Merge "build/make/Android.mk: use -fPIC w/ENABLE_SHARED=1" 2016-11-22 20:14:12 +00:00
Linfeng Zhang
6cc76ec73f Update vpx_idct4x4_16_add_neon() to pass SingleExtremeCoeff test
Change-Id: Icc4ead05506797d12bf134e8790443676fef5c10
2016-11-22 11:35:05 -08:00
James Bankoski
4bb01229cd Merge "vp9-tests : split VpxEncoderThreadTest into two tests." 2016-11-22 19:34:16 +00:00
Linfeng Zhang
974e81d184 Refine 8-bit 4x4 idct NEON intrinsics
Change-Id: Ib019964bfcbce7aec57d8c3583127f9354d3c11f
2016-11-22 11:26:03 -08:00
Linfeng Zhang
45876b4550 Add idct speed test.
Change-Id: I3b5fd3b36cac1fb3a93e27fd8fd0781c91d412ce
2016-11-22 11:19:24 -08:00
Linfeng Zhang
d479c9653e Update partial_idct_test.cc to support high bitdepth
BUG=webm:1301

Change-Id: Ieedadee221ce539e39bf806c41331f749f891a3c
2016-11-22 11:11:58 -08:00
Jim Bankoski
719f39f44e vp9-tests : split VpxEncoderThreadTest into two tests.
VpxEncoderThreadTest was taking a very long time for some runs and
timing out a lot.   This is an attempt to split the test into runs
that can be run nightly ( speeds 2 through 9) and runs that can
be run weekly ( speeds 0-1 ).

Change-Id: Iee6f61a561006d3a30381dd3b52b9a4dce07a70c
2016-11-22 07:31:04 -08:00
Kaustubh Raste
ecc5998bcf Fix mips dspr2 build warning
Change-Id: Ia8fb3ed124f01384e7896e309c9ff22c05b40719
2016-11-22 17:49:17 +05:30
Yaowu Xu
0ffbb36ddc Add validation of frame_parallel_decoding_mode
This is a boolean value that is written into bitstream, any value other
than 0 or 1 could have led to unexpected behavior. This commit fix the
issue by adding validation of the value to make sure it is boolean.

BUG=webm:1339

Change-Id: I2d3e69e8dbefcab9a0db9cb39a91a40ce531c5a1
2016-11-21 10:53:25 -08:00
Jingning Han
f473e892f7 Merge "Enable asymptotic closed-loop encoding decision" 2016-11-19 04:12:55 +00:00
Kaustubh Raste
a38e9f412d Merge "Fix SingleLargeCoeff idct test" 2016-11-19 03:37:29 +00:00
James Zern
3d55311062 vpx_temporal_svc_encoder.sh: fix comment (// -> #)
Change-Id: Ib13152a9ff523b1c29e8519e4f7ed01ad9874525
2016-11-18 19:11:55 -08:00
James Zern
7317ce8bd4 build/make/Android.mk: use -fPIC w/ENABLE_SHARED=1
fixes reloc errors like:
R_X86_64_PC32
vpx_dsp/x86/deblock_sse2.o:
requires dynamic R_X86_64_PC32 reloc against 'vpx_rv' which may overflow
at runtime

Change-Id: I218fc0e7c8258197f890d395f335e5a4fe82dccb
2016-11-18 18:54:34 -08:00
James Zern
cbeae53e76 Merge "Clean horizontal intra prediction NEON optimization" 2016-11-19 01:29:37 +00:00
James Zern
7adeccb33d Merge "partial_idct_test: s/SingleLargeCoef/SingleExtremeCoeff/" 2016-11-18 20:02:44 +00:00
Jerome Jiang
23f1bfbd85 Merge "Change *_xmm to *_sse2 in deblocker assembly functions." 2016-11-18 00:23:45 +00:00
Jerome Jiang
de5fd00ec5 Change *_xmm to *_sse2 in deblocker assembly functions.
Some cosmetic changes because xmm is an anachronism.

Change-Id: I436a5b78a3c52776c20d6640939311f2a84a9bc7
2016-11-17 23:38:04 +00:00
James Zern
f6921412d4 partial_idct_test: s/SingleLargeCoef/SingleExtremeCoeff/
tests with 'Large' in the name are reserved for slow running tests which
may not be run on all platforms

Change-Id: I2a7d6dd46b29b50469893e46433844132fb727c2
2016-11-17 12:28:57 -08:00
Marco Paniconi
485a49d0b8 Merge "vpx_temporal_svc_encoder.sh: Run all tests for 1-4 threads for vp8/vp9." 2016-11-17 20:22:32 +00:00
Kaustubh Raste
c56e5dd620 Fix SingleLargeCoeff idct test
Updated idct code to handle single large coefficient (-32768)

Change-Id: Ia13ab1ab434a9a1b9954a5914088977a88841cc7
2016-11-17 11:41:07 +00:00
Jerome Jiang
5d48663e04 Merge "Change C and msa to match results from sse2." 2016-11-17 05:16:27 +00:00
Jerome Jiang
cb1b1b8fef Change C and msa to match results from sse2.
Re-enable the tests to check CvsAssembly.
BUG=webm:1321

Change-Id: Id7f7d74b06c469fb6c8f5d04e91359e9cd9097a6
2016-11-16 17:05:26 -08:00
Marco
2ef2243804 vpx_temporal_svc_encoder.sh: Run all tests for 1-4 threads for vp8/vp9.
Change-Id: I079ee87cb32e36a1486c377c0037945b4bb89626
2016-11-16 14:11:25 -08:00
Jim Bankoski
f667cc7a4e stress.sh: Runs multiple libvpx encodes and decodes in parallel
This runs multiple encodes and decodes of vp8 and vp9 in parallel,
with so many threads that problems with synchronization can show up.

Change-Id: I2b297e7f43d1e741323c7ad9f50a3931ae609f16
2016-11-16 06:59:26 -08:00
James Zern
12fe34516e Merge "build/make/Android.mk: fix cpufeatures import" 2016-11-15 23:41:48 +00:00
James Zern
f09c687ea9 Merge changes I3950c883,I2b679b04
* changes:
  partial_idct_test: use <limits> for int16_min/max
  vpx_timer.h,x86.h: define NOMINMAX for windows.h
2016-11-15 23:41:18 +00:00
Linfeng Zhang
011fdec1e6 Merge "Add high bitdepth intra prediction NEON optimization (mode tm)" 2016-11-15 23:30:48 +00:00
Jerome Jiang
4ddae8f524 Merge "vp9: Speed 8: More aggresive golden skip for low res." 2016-11-15 22:50:58 +00:00
Linfeng Zhang
85c1ee434d Add high bitdepth intra prediction NEON optimization (mode tm)
BUG=webm:1316

Change-Id: Ib014de06836ac12726f4a2c9f0833ec4eb4d233b
2016-11-15 14:19:46 -08:00
Jerome Jiang
360217a233 vp9: Speed 8: More aggresive golden skip for low res.
Add a new, more aggresive short circuit: short_circuit_low_temp_var = 3 to skip
golden of any mode when variance is lower than threshold for low res.
This change only affects speed = 8, low resolution.

Metrics for avgPSNR/SSIM on rtc_derf (low resolution) show loss of
0.27/0.31%.
On Nexus 6, the encoding time is reduced by ~2.3% on average across all
low-res clips.

Visually little change on rtc_derf clips.

Change-Id: Ia8f7366fc2d49181a96733a380b4dbd7390246ec
2016-11-15 13:56:27 -08:00
James Zern
2218a4c292 partial_idct_test: use <limits> for int16_min/max
this removes the need for __STDC_LIMIT_MACROS which is defined in
vpx_integer.h, but may be preceded by earlier includes of stdint.h;
fixes build with the r13 ndk

Change-Id: I3950c8837cf90d5584a20ce370ae370581c2182c
2016-11-15 12:18:38 -08:00
James Zern
0412193bb9 vpx_timer.h,x86.h: define NOMINMAX for windows.h
avoids the definition of min/max macros in headers that may appear in
c++ unit tests. the codebase uses VPXMIN/MAX for this purpose in any
case

Change-Id: I2b679b045d64fb34fd8780f704e3caf10a758d82
2016-11-15 12:18:38 -08:00
James Zern
f938ab5e6a build/make/Android.mk: fix cpufeatures import
use 'android/cpufeatures' rather than 'cpufeatures'; this matches the
documentation, fixes compilation with r12b/r13 and still works with
older ndks.

Change-Id: I2f34233c164e6d4d46428f8905d5502cea4288a2
2016-11-14 13:25:51 -08:00
Jerome Jiang
eff68a3a4d vp9: Speed 8: Turn off 4x4avg for low-res non-key frames.
Changes only affects speed = 8 for low resolutions.

Metrics for avgPSNR/SSIM on rtc_derf (low resolutions) show loss of
0.5/0.6%.
On Nexus 6, the encoding time is reduced by ~5.9% on average across all
low-res clips.
Visually little/no change on rtc_derf clips.

Change-Id: I68dd50e558d72dcc1af8317d224bfae5e3bd872d
2016-11-14 11:17:14 -08:00
Jingning Han
44f8ee7258 Enable asymptotic closed-loop encoding decision
This commit enables asymptotic closed-loop encoding decision for
the key frame and alternate reference frame. It follows the regular
rate control scheme, but leaves out additional iteration on the
updated frame level probability model. It is enabled for speed 0.

The compression performance is improved:

lowres 0.2%
midres 0.35%
hdres  0.4%

Change-Id: I905ffa057c9a1ef2e90ef87c9723a6cf7dbe67cb
2016-11-14 09:22:55 -08:00
Linfeng Zhang
a3128ad33a Add high bitdepth intra prediction NEON optimization (h and v)
BUG=webm:1316

Change-Id: I47eeac698a98a31d1af5f72441052302e9fa4f46
2016-11-12 12:00:19 -08:00
Jerome Jiang
186dc40e8e Merge "Add unit tests for post proc." 2016-11-12 04:38:27 +00:00
Jerome Jiang
b282048fe4 Add unit tests for post proc.
Some tests are disabled since C and msa don't match sse2.
BUG=webm:1321

Change-Id: I61f303348e5292844a822612f100dbe006489e3e
2016-11-11 15:17:53 -08:00
Marco Paniconi
b6f6169348 Merge "vp9: Adjust thresholds for limiting cyclic refresh for noisy content." 2016-11-11 17:11:19 +00:00
James Zern
ba016b710a Merge "*ppflags.h: remove unused *_DEBUG_* enum values" 2016-11-10 20:53:22 +00:00
James Zern
80f6b243a7 Merge changes I339088b2,Iaade219e,If142afb1,I4257c4b3
* changes:
  fdct8x8_test: add vpx_idct8x8_64_add_neon in hbd
  fdct4x4_test: add vpx_idct4x4_16_add_neon in hbd
  partial_idct_test,NEON: add missing idct variants
  enable vpx_idct32x32_34_add_neon in hbd builds
2016-11-10 05:02:39 +00:00
James Zern
a1c40a2c1a fdct8x8_test: add vpx_idct8x8_64_add_neon in hbd
this was enabled in:
3ae2597 idct,NEON: add a tran_low_t->s16 load adapter

+ enable it for all NEON configs, both intrisincs and assembly versions
exist

BUG=webm:1294

Change-Id: I339088b2a398200f95658d040034fb9b2a7c8ce0
2016-11-09 20:04:27 -08:00
Linfeng Zhang
40ab0424d4 Add high bitdepth intra prediction NEON optimization (mode d45 and d135)
BUG=webm:1316

Change-Id: I6a330874348df04df24a6d9efdc06f567e04bf8e
2016-11-09 12:04:04 -08:00
James Zern
4807f1584c *ppflags.h: remove unused *_DEBUG_* enum values
usage of the vp8 versions was removed in:
3f72509 vp8: remove VP8_SET_DBG* control support

vp9 had the usage stripped even earlier.

Change-Id: I978142eb6492552cd29c9c6feb1e89acfc5f7b84
2016-11-08 21:09:16 -08:00
James Zern
cfbb599335 fdct4x4_test: add vpx_idct4x4_16_add_neon in hbd
this was enabled in:
3ae2597 idct,NEON: add a tran_low_t->s16 load adapter

+ enable it for all NEON configs, both intrisincs and assembly versions
exist

BUG=webm:1294

Change-Id: Iaade219e9d1de7b69423670d3ea6271b0965e068
2016-11-08 18:29:40 -08:00
James Zern
c344dee463 partial_idct_test,NEON: add missing idct variants
idct4x4 and idct8x8 were universally enabled for high-bitdepth builds
in:
3ae2597 idct,NEON: add a tran_low_t->s16 load adapter

BUG=webm:1294

Change-Id: If142afb169c48728cc4b222e7c41aa4a63f95f0f
2016-11-08 18:29:35 -08:00
James Zern
738c8f23c6 enable vpx_idct32x32_34_add_neon in hbd builds
replace load_and_transpose_s16_8x8() in idct32_6_neon() with a separate
load_tran_low_to_s16() and transpose_s16_8x8(). the combined function is
used in idct32_8_neon() where the input is the correctly sized output
from the earlier stage.

BUG=webm:1294

Change-Id: I4257c4b3a421b2cf5d13651f966eee0680ef98a9
2016-11-08 17:03:36 -08:00
Marco
18794d8ddc vp9: Adjust thresholds for limiting cyclic refresh for noisy content.
For noisy content, be more aggressive in skippping some blocks for
delta-qp to reduce noise pulsing artifact. Also treat frame boundary
case when dimension is not multiple of superblock size/64.

Only affects non-screen content case, and when source noise
is measured to be high (at least level kMedium).

Change-Id: Ib13a2a20ed1ce37ff3c44d95c3ef2635fd695222
2016-11-08 15:50:46 -08:00
Johann
f5141ea45f Refine vp8_refining_search_sadx4 targeting
This uses the same sdx4df pointers as vp8_diamond_search_sadx4 and
should therefore target the same optimizations.

See e4ddf9db6a37eee59c079f5ae427643ae3424fcf

Change-Id: Ic298e9b25c34bbe6b7a0799509355b0addb56675
2016-11-08 15:22:44 -08:00
Johann
50b40f114c Optimize idct32x32_135_add for NEON
BUG=webm:1295

Change-Id: I7f80ef4d29813fcb401fc6075babf19e3c195462
2016-11-08 22:06:07 +00:00
Linfeng Zhang
64a5a8fd6f Merge "Add high bitdepth intra prediction NEON optimization (mode dc)" 2016-11-08 16:53:42 +00:00
James Zern
3fdfbcb73d Merge "partial_idct_test: set MinSupportedCoeff for NEON" 2016-11-08 01:05:16 +00:00
Johann Koenig
5c64c01c7c Merge "ads2gas: remove RN stanza" 2016-11-08 00:44:17 +00:00
Johann
271de2c9fb ads2gas: remove RN stanza
The matching on ads2gas_apple.pl is too liberal and catches
CONFIG_EXTERNAL_BUILD and CONFIG_INTERNAL_STATS because they have RN in
the names.

The RN renaming feature is not used in any existing assembly files. It
was used in some armv6 files but they were removed.

Change-Id: Ib65abf1947d3e89f0d1584e2a5de399d24008f95
2016-11-07 16:21:16 -08:00
James Zern
40bcb96abd partial_idct_test: set MinSupportedCoeff for NEON
vpx_idct4x4_16_add_neon fails with INT16_MIN, +1 is all right

BUG=webm:1335

Change-Id: I25830c8ab0782822fc3c9db6cc669c2e65f2700e
2016-11-07 15:47:09 -08:00
Linfeng Zhang
d545c19afa Rename vpx_highbd_idct8x8_10{*}() to vpx_highbd_idct8x8_12{*}()
Also update its trigger threshold from 10 to 12.

Change-Id: Ib8dddd87a5a22a12ca66e7084d342fbb027b0a2f
2016-11-07 09:07:55 -08:00
Linfeng Zhang
a9874961f0 Merge "Replace highbd_dct_const_round_shift with dct_const_round_shift" 2016-11-07 16:55:01 +00:00
Johann Koenig
ac495218fb Merge "idct test: use coeff consistently" 2016-11-06 00:13:05 +00:00
Johann Koenig
a139ecd0c9 Merge "partial_idct_test: Add large coefficient test" 2016-11-06 00:13:00 +00:00
Johann Koenig
5d0a271ded Merge "Update vp9_fdct8x8_quant_ssse3 for highbitdepth" 2016-11-06 00:12:13 +00:00
James Zern
6e179dacd0 Merge "vp9-svc: Add unittest for svc-decoding." 2016-11-05 02:47:11 +00:00
Johann
e851160642 idct test: use coeff consistently
Change-Id: I913a13066993a3315a0ff8310b3cad1572d4cdd7
2016-11-04 18:41:59 -07:00
Johann
9ad3e14015 partial_idct_test: Add large coefficient test
Two functions do not pass this test:
vpx_idct8x8_64_add_ssse3
vpx_idct8x8_12_add_ssse3

The test has been modified to avoid triggering an issue with those
functions but they still must be investigated.

BUG=webm:1332

Change-Id: I52569a81e8e6e0b33c4a4d060d0b69c3fc4f578e
2016-11-04 18:37:58 -07:00
Marco
eefc7d1412 vp9-svc: Add unittest for svc-decoding.
To test the VP9_DECODE_SVC_SPATIAL_LAYER decoder control
introduced in 86b0042.

Change-Id: I3d164a41d7bbab14c0aee80fd890870704a18f6e
2016-11-05 01:29:51 +00:00
Johann
e10c95dc83 Update vp9_fdct8x8_quant_ssse3 for highbitdepth
Borrow transition functions from fdct.h nee vpx_quantize_b_sse2

BUG=webm:1304

Change-Id: I9c88c3eec3ff8bb461411d98c26c3c236ea28ef1
2016-11-05 01:23:07 +00:00
Linfeng Zhang
04c3bf3c85 Replace highbd_dct_const_round_shift with dct_const_round_shift
They are identical.

Change-Id: I1ccaf03c81c3cbf88e82d77ffeb8204f5b063c61
2016-11-04 16:15:02 -07:00
Linfeng Zhang
32326c2f13 Merge "Cosmetics of inv_txfm.c" 2016-11-04 22:40:03 +00:00
Johann Koenig
900ec31bea Merge "Extract high bit depth helper functions" 2016-11-04 21:03:17 +00:00
Linfeng Zhang
b68d8107cb Cosmetics of inv_txfm.c
Unify code of 8-bit and high bitdepth.

Change-Id: I3fe441577af0249030ca3a1ef769eb9030711434
2016-11-04 13:24:41 -07:00
Johann
cf35ffc025 Extract high bit depth helper functions
These can be used in the vp9 fdct as well.

Change-Id: I4f3875e0cba1b8cad209c3a0581e121deba7675e
2016-11-04 18:13:51 +00:00
James Zern
232221b83a Merge "configure: disable tools for armv7-win32-vs1[24]" 2016-11-04 17:48:24 +00:00
Martin Storsjo
34c35b6fb6 Add a missing END directive in idct_neon.asm
This fixes building with MS armasm.

Change-Id: I2629eeed859b775ca667a65ba109f8d1bf7b0e03
2016-11-04 12:21:18 +02:00
Martin Storsjo
c559cc6191 Fix producing vcxproj files with *.S arm assembly files
These cases were leftover in
1ddb4c03622a654452a5e76b5a0e4db715dc350d.

Change-Id: Ie058fb6c78580e60205c47a1d314bd66e794cde4
2016-11-04 12:21:13 +02:00
James Zern
90a135854c configure: disable tools for armv7-win32-vs1[24]
this shares the same prohibition as the examples

Change-Id: I17d65e4f26847af8cbb1d1a3c4a114ed021a8b9f
2016-11-03 22:54:35 -07:00
Marco Paniconi
cca774c7df Merge "vp9: Non-rd pickmode: fix logic in reference masking." 2016-11-03 23:12:05 +00:00
Marco
86b0042f44 vp9-svc: Add decoder control to decode up to x spatial layers.
Change-Id: I85536473b8722424785c84c5b5520960b4e5744a
2016-11-03 11:18:00 -07:00
Marco
da9f762e24 vp9: Non-rd pickmode: fix logic in reference masking.
Add condition that usable_ref_frame > LAST.
This is to avoid potentially skipping all last-nonzero mv modes,
if golden is used as a reference but skipped completely for the
current block.

This has no effect currenty, as we always consider testing golden
mode for each block.

Change-Id: I3182cf44664081935a90ed43aa7b32e710e60e22
2016-11-03 10:32:57 -07:00
Debargha Mukherjee
f93305aa07 Merge "Speed-up recode loop for extreme bitrate diffs" 2016-11-03 17:04:17 +00:00
Jerome Jiang
cb5a2ac920 Merge "pp_filter_test.cc,cosmetics:adjust name convention" 2016-11-03 04:31:35 +00:00
Jerome Jiang
3e961c09be pp_filter_test.cc,cosmetics:adjust name convention
Change-Id: I81b6fc9b83f0febbb12975aef92768bbd273fd61
2016-11-02 13:50:00 -07:00
Linfeng Zhang
1338c71dfb Clean horizontal intra prediction NEON optimization
Change-Id: I1ef0a5b2655cbc7e1cc2a4a1a72e0eed9aa41f05
2016-11-02 11:43:45 -07:00
Linfeng Zhang
1868582e7d Add 32x32 d45 and 8x8, 16x16, 32x32 d135 NEON intra prediction
Change-Id: I852616794244490123eb615ac750da50265f0fa5
2016-11-02 11:40:37 -07:00
Johann Koenig
5ac7a59a05 Merge "arm idct: move to-be-shared code to header" 2016-11-02 18:09:45 +00:00
Paul Wilkins
295cd3b493 Merge "Fixed bug in formatting of debug stats." 2016-11-02 17:10:07 +00:00
paulwilkins
de76d2e315 Fixed bug in formatting of debug stats.
Fixed formatting bug introduced by the fix to BUG=webm:1322
( Iedc4477aef1746aa0a4f84d88a1156296fd3ba87)

Change-Id: I715ee446c0e8584967ab87ba4e355759dd394187
2016-11-02 09:38:18 +00:00
James Zern
1961a92a94 vp9,tile_worker_hook: correctly set jmp target
vp9_init_macroblockd() resets the error_info to cm's global copy; this
needs to be set to the thread-level target to avoid jumping to the
incorrect stack, resulting in hang or crash.
broken since:
1f4a6c8 vp9/tile_worker_hook: add multiple tile decoding
includes v1.5.0, v1.6.0

BUG=629481

Change-Id: Icbf1696b25ba8c479e845fbf227b3c3ca73542f5
2016-11-01 18:45:50 -07:00
Linfeng Zhang
3b74066b10 Add high bitdepth intra prediction NEON optimization (mode dc)
BUG=webm:1316

Change-Id: I984d6004ea2445e86f213fb6fa4d794a9955af8f
2016-11-01 17:07:36 -07:00
Johann
bf8ab194ee arm idct: move to-be-shared code to header
Change-Id: I67458cd358b4dc4434bbdbfcdd571769561b619e
2016-11-01 15:43:56 -07:00
James Zern
1b275ab898 Merge "idct32x32_1_add_neon: clear a couple conv warnings" 2016-11-01 22:34:59 +00:00
James Zern
9de91855ef Merge changes I08af3a54,If5959a25,I6763e62e
* changes:
  build/make/Android.mk: s/armv8/arm64/
  build/make/Android.mk: fix armeabi-v7a build
  use .S suffix rather than .s for NEON asm
2016-11-01 21:43:13 +00:00
Linfeng Zhang
05ee241493 Add high bitdepth intra prediction optimization speed test
BUG=webm:1316

Change-Id: I99feec867d5b8ea06b43cdd3fcd7c90238f5efdb
2016-11-01 13:57:01 -07:00
Linfeng Zhang
0c88014592 Merge "Refine 8-bit intra prediction NEON optimization (mode tm)" 2016-11-01 19:38:07 +00:00
Linfeng Zhang
cc5f49767a Refine 8-bit intra prediction NEON optimization (mode tm)
Change-Id: I98b9577ec51367df5e5d564bedf7c3ea0606de4c
2016-11-01 09:45:16 -07:00
Paul Wilkins
84dcfced5b Merge "Change to KF boost calculation." 2016-11-01 09:29:30 +00:00
James Zern
7625c803b3 idct32x32_1_add_neon: clear a couple conv warnings
int16_t -> uint8_t

Change-Id: I3c5e0985bc3584dce289c35b5973de24cdc73b76
2016-10-31 18:56:34 -07:00
James Zern
2e076ffe50 build/make/Android.mk: s/armv8/arm64/
the configure target is arm64-android-gcc which generates .mk files of
the same form

Change-Id: I08af3a54ef203b1496d185a0f8c8fe702881a173
2016-10-31 18:35:23 -07:00
James Zern
ae32318170 build/make/Android.mk: fix armeabi-v7a build
vpx_config.asm and idct_neon.asm.S are required since:
3ae2597 idct,NEON: add a tran_low_t->s16 load adapter

Change-Id: If5959a25edb370dd7dcdca71c96e9a5aad0840ce
2016-10-31 18:34:16 -07:00
James Zern
1ddb4c0362 use .S suffix rather than .s for NEON asm
for compatibility with other build systems

Change-Id: I6763e62e3126850ad4f8ad29e388b8dad0bbc4c3
2016-10-31 16:39:05 -07:00
Marco Paniconi
7cf0c000cf Merge "vp9-svc: Fix some stats in vp9_spatial_svc_encoder." 2016-10-31 23:16:36 +00:00
Marco
41ad80f69d vp9-svc: Fix some stats in vp9_spatial_svc_encoder.
Correction to rate control stats output under -rcstat.

Change-Id: I46fa5d2a66ed657121ee3d685608a148bb9a7bb3
2016-10-31 15:24:13 -07:00
James Zern
410d947c5f Merge "idct,NEON: add a tran_low_t->s16 load adapter" 2016-10-31 21:59:12 +00:00
Peter Boström
11b099ea46 Merge "Add vp9_spatial_svc_encoder to .gitignore." 2016-10-31 20:01:11 +00:00
Linfeng Zhang
cde5d5db13 Merge "Refine 8-bit intra prediction NEON optimization (mode h and v)" 2016-10-31 19:57:23 +00:00
Peter Boström
39bcb49909 Add vp9_spatial_svc_encoder to .gitignore.
Change-Id: I3c90d657cca533264dd62bb7749c53a862d0352a
2016-10-31 14:55:56 -04:00
Marco Paniconi
702b3e1ee5 Merge "vp9-svc: Add checks to layer bitrates in vp9_spatial_svc_encoder." 2016-10-31 18:23:14 +00:00
James Zern
3ae25974fd idct,NEON: add a tran_low_t->s16 load adapter
enable idct4x4* and idct8x8* which are compatible for 8-bit decodes in
high-bitdepth mode. the adapter narrows 32-bit input to 16, whether the
expansion can be avoided at all in this case remains a TODO. roughly
matches sse2.

BUG=webm:1294

Change-Id: I3ea94e5a2070dfd509b5de0c555aab4e1f4da036
2016-10-31 11:21:16 -07:00
Linfeng Zhang
a347118f3c Refine 8-bit intra prediction NEON optimization (mode h and v)
Change-Id: I45e1454c3a85e081bfa14386e0248f57e2a91854
2016-10-31 10:33:44 -07:00
Marco
e1cdb50298 vp9-svc: Add checks to layer bitrates in vp9_spatial_svc_encoder.
Add some checks to the layer bitrates passed in through the command line.

Change-Id: I16f270035a6034d63313fe3019aa90dca9a3eefb
2016-10-31 10:07:24 -07:00
James Bankoski
fb9fef83c7 Merge "vpxdec.c : don't double count corrupted frames" 2016-10-31 13:58:15 +00:00
Jim Bankoski
30f3017697 vpxdec.c : don't double count corrupted frames
A past patch made it so that every frame that had a decode error
caused a corrupted frame to be counted.  Unfortunately it was possible
to get both a decode error and a corrupt frame for the same frame
and thus double count an error. This code makes that impossible.

Change-Id: Iea973727422a3bf093ffda72fa358a285736048b
2016-10-31 06:09:58 -07:00
James Zern
086aab7e13 tiny_ssim: fix visual studio build
s/inttypes.h/vpx_integer.h/
clear a uint64_t -> double conversion warning

Change-Id: I58d108b083787a754152eb79ef6df61c2c5f95b1
2016-10-29 13:04:07 -07:00
Peter Boström
ae206924a6 Merge "Add temporal-layer support to tiny_ssim." 2016-10-29 01:25:01 +00:00
Johann Koenig
5724e8c4c7 Merge "partial_idct_test: add _add_ test" 2016-10-29 00:34:16 +00:00
Peter Boström
fd4efde489 Add temporal-layer support to tiny_ssim.
Permits skipping 0, 1/2 or 3/4 of the frames, corresponding to
temporal layers 2, 1 and 0 of a 3-temporal-layer encoding. 1/2
corresponds to TL0 in a 2-layer encoding.

Change-Id: I7f6d131f63707e5262fc67d111bfb3a751ede90d
2016-10-28 14:56:05 -04:00
Marco Paniconi
7042137e60 Merge "vp9: Updates to SVC sample encoder." 2016-10-28 18:32:41 +00:00
Marco
a8fdb3926e vp9: Updates to SVC sample encoder.
Allow for passing in the layer bitrates at command line.
Fix to allow passing in bitrate for each spatial-temporal layer.

Change to some default values for 1 pass cbr mode:
spatial scale and qp-max/min.

Small fixes to some build warnings.

Change-Id: I3f9a776262712480a6570bb863a835b2fc49935a
2016-10-28 10:59:58 -07:00
Yaowu Xu
9205f54744 Merge "Add tools/tiny_ssim for generating SSIM/PSNR." 2016-10-28 17:21:48 +00:00
Peter Boström
7c75cae74a Add tools/tiny_ssim for generating SSIM/PSNR.
Change-Id: Icc3e5aaa6636ffe17dc9da5f7a80afaccbde509a
2016-10-28 12:39:49 -04:00
Linfeng Zhang
4d305dab34 Merge "Refine 8-bit intra prediction NEON optimization (mode d45 and d135)" 2016-10-28 15:58:01 +00:00
Paul Wilkins
715c65914b Change to KF boost calculation.
This  change is a step in a larger change to the way boost and interval are
determined for ARF and Key frames.

This patch contains some pluming for the general case but focuses on the
key frame boost calculation. This now relies more heavily on the rate at
which the error score increases between the primary and secondary reference
frame. This seems to be less fragile when dealing with different frame sizes.
For example larger image formats tend in the first pass to see a higher
% of intra coded blocks and the use of this number in calculating the frame
decay factor was leading to much lower boost numbers for 4K, for example,
than the same clip coded at 2K.

This change does give overall gains but they are MUCH larger for the 4K Netflix
set. For the 4K Netflix set the average gain is around 3% with some clips > 20%
whereas for the same set at 2K the average gain is 0.5-1%.

In general for small image formats the boost is most often reduced a little whereas
4K clips the boost is increased. There are some -ve cases such as Akiyo at 352x288
where the reduced boost hurts the metrics, especially for SSIM, even while
the set as a whole improves. This is most notable at very low Q and may be the
subject of a future patch.

Some common code for KF and ARF was separated in this patch for the purposes of
tuning but may later be re-merged if appropriate.

Change-Id: Iaa15ac5a58d2be89181100d95cef6a8dc4b12d0d
2016-10-28 15:35:59 +01:00
Debargha Mukherjee
4f7a59c802 Merge "Force recode if framesize exceeds max allowed size" 2016-10-28 04:21:44 +00:00
Linfeng Zhang
4ae9f5c092 Refine 8-bit intra prediction NEON optimization (mode d45 and d135)
dst += stride behaving better with gcc/clang.
Unroll loops.

Change-Id: I83f85df2bc9f17c6159542f57680b509395db2b1
2016-10-27 14:24:50 -07:00
Debargha Mukherjee
1cd987d922 Speed-up recode loop for extreme bitrate diffs
Adjusts the q adjustement step depending on how far the
projected and target rates differ.

Change-Id: I498d03523ca233a270512ca3972c372daa4ca2a8
2016-10-27 11:08:44 -07:00
Debargha Mukherjee
54e03017b6 Force recode if framesize exceeds max allowed size
Fixes a case where recode is not triggered based on the value
of maxq passed into the recode loop test function.

BUG=b/32375284

Change-Id: I15ad985d0525c68e0443cfaf842440d2754b2266
2016-10-27 09:52:51 -07:00
Johann Koenig
4555c50ecd Merge "partial_idct_test: consolidate block size" 2016-10-27 15:41:44 +00:00
Paul Wilkins
aadfde4687 Merge "Changes to KF boost calculation." 2016-10-27 10:21:23 +00:00
Paul Wilkins
02deeea447 Merge "Removal of a couple of two pass adjustments." 2016-10-27 10:21:06 +00:00
Johann
7994dba6c0 partial_idct_test: add _add_ test
The result of the transform is added to the destination buffers. In the
existing tests the destination buffer is always empty so that portion of
the code was never exercised.

Change-Id: I1858c4fed2274f1b9faf834d2ba4186a4510492a
2016-10-26 21:35:49 -07:00
Johann
ed2c240538 partial_idct_test: consolidate block size
Use *input_block_ for sizeof() calculation like the other test

Change-Id: I1e4bd227131662056405af78c5052ad6ef769e9f
2016-10-26 21:35:03 -07:00
Johann
08e0da30ca Refactor partial idct test
Switch to using correctly sized inputs and outputs. This simplifies
adding tests with varying strides.

Change-Id: I716a0d8173dcf6a86d56656ac9d3101b7ec27642
2016-10-26 12:28:18 -07:00
Paul Wilkins
de859676dd Changes to KF boost calculation.
Remove double counting of decay. Limit maximum KF boost.

Change-Id: I0fb2344d0f78b5e95bb899dfad12b0ca84034b2c
2016-10-26 17:53:29 +01:00
paulwilkins
ccd6a8e2fa Removal of a couple of two pass adjustments.
Removed a couple of adjustments that no longer move the needle
much but complicate the process of tuning.

Change-Id: Ie320f5cf155e6aac14a4757ea9ada2cd59f27590
2016-10-26 17:52:37 +01:00
Linfeng Zhang
9c0680bd43 Merge "Refine 8-bit intra prediction NEON optimization (mode dc)" 2016-10-26 16:51:44 +00:00
Johann
9720b58aac Optimize idct32x32_34_add for NEON
Approximately 3 times faster than the 1024 version which was used
previously.

BUG=webm:1295

Change-Id: Id15fb3d096029ec38ef01c53e5f6eb08254347c9
2016-10-25 15:43:58 -07:00
James Zern
98ffc49204 Merge "Update vp9_intrapred_test.cc to support 8-bit" 2016-10-25 21:59:29 +00:00
Yunqing Wang
4b8b1bae52 Merge "Modify the encoder multi-thread unit test" 2016-10-25 20:54:26 +00:00
Yunqing Wang
c327b3f0b0 Modify the encoder multi-thread unit test
Modified the encoder multi-thread test so that it included cpu-used=0 and
frame-parallel=0.

frame_parallel_decoding_mode is 1 by default, which disables probability
updating and gives lower encoding quality. Current VP9 multi-threading
encoder and decoder support probability updating. To test this part, we
should turn on it in the unit test, namely, setting frame-parallel to 0.

Change-Id: Ia1f86e01f0de628f50d819ae31509de3e1b6c755
2016-10-25 11:35:01 -07:00
James Bankoski
f53d3363ac Merge "vpxdec: return fail if frame fails to decode." 2016-10-25 18:34:07 +00:00
Yunqing Wang
c192def8f3 Change 2 motion search counts to be tile data
This patch modified the motion search counts used in:
https://chromium-review.googlesource.com/#/c/305640/

These 2 counts were originally added as thread data, and used to
make decisions in motion search. The tile encoding order can be
inconsistent while using different number of threads, which can
cause bitstream mismatch. Here moved them to tile data to solve
the issue.

BUG=webm:1322

Change-Id: Iedc4477aef1746aa0a4f84d88a1156296fd3ba87
2016-10-25 10:12:41 -07:00
Linfeng Zhang
ce88b8f5c5 Refine 8-bit intra prediction NEON optimization (mode dc)
dst += stride behaving better with gcc/clang
Expanding inline function dc_SIZExSIZE() save intructions for
vpx_dc_predictor_SIZExSIZE_neon().

Change-Id: Id0ccbd58b6a31df539141fd33bdf28633339150d
2016-10-24 13:18:51 -07:00
Linfeng Zhang
d1c74c149b Update vp9_intrapred_test.cc to support 8-bit
BUG=webm:1316

Change-Id: Ic9309bbeeef52e9d07fb4a4c95c12efa813cbf8c
2016-10-24 13:13:55 -07:00
Jim Bankoski
7ef094c02f vpxdec: return fail if frame fails to decode.
A failure to decode is most likely equivalent to a corrupt
frame for the purpose of returning a failure.

Change-Id: Ie53db2b8130b40b725841f5f7a299d63aa56913d
2016-10-24 12:05:59 -07:00
James Zern
2e6a1976a0 Merge "remove idct32x32*_add_neon.asm" 2016-10-22 02:29:56 +00:00
James Zern
5d91752a98 Merge "vpx_highbd_convolve_copy_neon: use multi reg loads" 2016-10-22 02:28:15 +00:00
Vignesh Venkatasubramanian
9a032fa262 Merge "vp9_bitstream: Encode tiles in parallel" 2016-10-22 02:23:06 +00:00
Vignesh Venkatasubramanian
5deffa1175 vp9_bitstream: Encode tiles in parallel
Re-use the tile worker threads to pack the bitstream in parallel
on a per-tile basis.  Restricting this to real-time only for now
(further testing is needed to ensure this does not make 2-pass
worse in any case).

BUG=webm:1309

Change-Id: I8a80da7c5089b837d0df79a5c49d5e3022dfc8ec
2016-10-21 17:35:03 -07:00
Marco
ee1b3f34c0 vp9: Nonrd variance partition: increase threshold for using 4x4 avg.
In variance partition low resolutions may use varianace based on
4x4 average for better partitioning.
Increase the threshold for doing this at speed = 8.

Improves speed by ~5%, with little loss, < 1%, on RTC_derf set.

Change-Id: Ib5ec420832ccff887a06cb5e1d2c73199b093941
2016-10-21 11:51:06 -07:00
James Zern
9dbb3ad396 remove idct32x32*_add_neon.asm
the intrinsics are neutral to ~20% faster on cros/android
devices when using gcc-4.9/clang-3.8.1 and gcc-4.9/clang-3.8.x from the
r13 ndk. neutral results typically came with gcc-4.9 while larger
positive gains were achieved with clang 3.8.x.

BUG=webm:1303

Change-Id: I4d31f9c017944681b881493525d4573a7a5b1e16
2016-10-20 19:47:14 -07:00
Marco
a7d116aa67 vp9: Speed=8 real-time: Keep the bias_golden feature on.
Small/no change in metrics on RTC set, speed increase by 2-3%.

Change-Id: Iee997bd7433e8e508216e9267b1c31c5a9aa5121
2016-10-20 17:03:51 -07:00
Marco Paniconi
32e63efcfb Merge "vp8: Apply gf target-size boost only when refresh_golden_frame = 1." 2016-10-20 22:38:55 +00:00
Vignesh Venkatasubramanian
83ca63582a Add vp9cx_set_ref to .gitignore
Get rid of the 'git status' clutter when building with examples.

Change-Id: I20b715ddfc6c8ccb4993de7ebb2b4ad6df9ea437
2016-10-20 12:07:30 -07:00
Marco
9fdae93858 vp8: Apply gf target-size boost only when refresh_golden_frame = 1.
Change only affects 1 pass cbr, error resilience off.

Change-Id: I68b896b09d722995a71c44331233e97bd862bcfc
2016-10-20 11:32:29 -07:00
James Zern
995a967f19 Merge "third_party: roll libwebm snapshot" 2016-10-19 22:34:25 +00:00
Marco
9624964832 vp8: Adjust threshold to set the gf_noboost flag.
Change only affects 1 pass cbr, with error_resilient off.

Change-Id: Ibf254d8772fa2a8f188c9932d37b2f42362d8003
2016-10-19 12:55:37 -07:00
Marco
ff38b8dfae vp8: Add control for gf boost for 1 pass cbr.
Control already exists for vp9, adding it to vp8.
Usage is only when error_resilient is off.
Added a datarate unittest for non-zero boost.

Change-Id: I4296055ebe2f4f048e8210f344531f6486ac9e35
2016-10-19 09:43:53 -07:00
James Zern
7f31bfeddb Revert "vp9_bitstream: Encode tiles in parallel"
This reverts commit 9e8efa5b189a5abf78b1bcbc8076893728129d1e.

this change causes ubsan warnings, failures in
vpxenc_vp9_webm_rt_multithread_tiled

BUG=webm:1309

Change-Id: I020c7be985c771bfff4b3de1afe51cc8edb980da
2016-10-18 22:47:48 -07:00
James Zern
68833c7f85 third_party: roll libwebm snapshot
git log --no-merges 32d5ac4..9732ae9
9732ae9 EbmlElementSize: quiet uint64->int32 conv warning
da04eba SetProjectionPrivate: quiet uint64->size_t conv warning
6db32d5 mkvparser,Projection::Parse: fix int->bool conv
3bb0dfa cosmetics: fix a couple lint warnings
0e179d6 update .clang-format
fc5f88d Fix temp files being left on system.
c04a134 Add support for overriding PixelWidth and PixelHeight.
c0160e0 Add support to explicitly set segment duration.
02bc809 Add support to estimate file duration.
c97e3e7 Add support to output sub-sample encryption information.
26f4344 MakeUID: quiet unused param warning in Android builds
d6af52a Change check to fix compile error.
1720020 webm_parser: Add Mesh value for ProjectionType
78f2c5a webm_parser: Use ./ prefix for includes
da62f65 webm_parser: Remove webm/ prefix from public includes
e15e8f2 webm_parser: Update README build instructions
5023f2b mkvmuxer: Fix Colour::Valid()
cf16204 mkvmuxer_tests: Actually test cue points in the cue point test.
93e9fb3 Validate Colour element values.
8036925 mkvparser_tests: Add Projection element test.
f52d38c mkvparser_tests: Add Colour element test.
826436a mkvparser: minor SeekHead::Entry clean up.
24fb44a mkvmuxer_tests: Add Projection element test.
1e0a8ea mkvmuxer_tests: Add Colour element test.
0278616 mkvmuxer: Colour accessors/mutators.
2346f8f Add mkvparser wrapper functions.
54d6b6b webm_info: Add Projection element support.
65fee06 mkvmuxer_sample: Add support for Projection element.
9a3f2b5 mkvparser_sample: Add support for Projection element.
41e814a mkvparser: Add Projection element support.
483a0ff mkvmuxer: Add Projection element support.
676a713 Add support for the Projection element
725f362 mkvmuxer: Fix memory leak when Colour is set multiple times.
fa182de mkvparser_sample: Add output of audio track codec private size.
8f521f2 mkvparser_tests: Add invalid BlockGroup test.
39137d7 Remove docs saying binary elements default to 0
80685d3 Do not skip over unknown elements at the root level
c147504 Fix legacy Makefile.
58711e8 mkvparser_sample: Fix version info string.
837746f mkvparser_tests: Add invalid block test.
207cd80 Disambiguate sample sources and targets.
a112d71 mkvparser_tests: Refactor invalid file loading code.
5dea33e Disambiguate test source and target names.
125049e parser_tests: Add another truncated chapter string test.
1de8d4c parser_tests: Add truncated chapter string test.
ff8c2b6 parser_tests: Move cue validation to test_util.
4b0690f parser_tests: Add invalid lacing test.
9828e39 mkvmuxer: Set default doc type version to 4.
5495a59 webm_parser: Reference more files in CMakeLists.txt.
0c0ecd0 vpxpes_parser: Add start code emulation prevention support.
639a4bc webm2pes: Remove debug printfs().
9a51102 webm2pes: fflush() in the correct conversion function.
dc7f155 webm2pes: Track total bytes written.
d518128 webm_parser: Enable usage of werror.
e1fe762 webm2pes: Add test for mux/demux of large input.
1b24a79 vpxpes_parser: Read and store PTS when present.
6cf0a0f vpxpes_parser: Store frame payloads.
25d2602 webm_parser: Convert style to match the rest of libwebm
24be76d webm2pes: Replace VpxFrame with VideoFrame.
b451c3b Add a basic video frame storage class.
05c90eb libwebm_util: Clarify error text in superframe parser.
e6415af webm2pes: Make WritePesPacket() a public method.
8f840dd webm2pes: Move frame read out of PES packet write method.
448af97 webm2pes: Restore frame fragmentation support.
f8bb714 cmake: Integrate new parsing API and tests.
cb8ce0b Add a new incremental parsing API
900d322 vpxpes_parser/webm2pes: BCMV and PTS fixes.
4b73545 webm2pes: Add start code emulation prevention.
82903f3 Add column tiles and frame parallel to webm_info
5d91edf style_clean_up: Remove unnecessary parentheses
a95aa4b vp9_level_stats: correct total_uncompressed_bits_ calculation
f46566f mkvreader: Fix shorten-64-to-32 warning in 32 bit builds.
76630ca mkvwriter: Fix shorten-64-to-32 warning in 32 bit builds.
a8ffbd4 webm2pes: Fix format specifier warnings.
faf89d4 Add MaxLumaSampleRate grace percent to stats.
d31e6c9 Fix profile 2 in vp9_header_parser.
bd3ab3a Add flag to estimate last frame's duration to stats.
c182ed9 Fix lint issue in hdr_util.h
cc62ecd Add test for Cluster memory leak
196708a Change MaxLumaSampleRate to be based on frame resolution.
cbd676b mkvmuxer: Fix leak when a Cluster isn't finalized
9a235e0 mkvmuxer: Set doctype to matroska when muxing non-WebM codecs.
47f2843 Add parsing support for new features in CodecPrivate.
e3c9576 Add VP9 level output to webm_info.
5cf549f cmake: Log compiler flag at check time.
bbaaf2d Add class to gather VP9 level stats.
8bb68c2 Add file to parse data from VP9 frames.
296429a Add support to parse VP9 profile.
df3412f Add support for setting VP9 profile and level to sample_muxer.
87832d4 mkvmuxer: Fix Segment::Finalize in kLive mode
6df3e56 mkvmuxerutil.hpp: Add using directives for overloaded size utils.
ec47928 mkvmuxerutil: Revert to using mkvmuxertypes.
a1dc4f2 Fix parsing of VP9 level.
4e3d037 Add support to output Colour elements to webm_info.
d3656fd muxer_tests: ignore iwyu re gtest-message.h
e76dd5e Fix file name in mkvmuxertypes shim.
1be5889 Add temporary include shims at old file locations.
039df94 Add TEST_TMPDIR environment variable

Change-Id: I84bc1401b0aad71ad6727b687f1bede9953a7a08
2016-10-18 18:11:36 -07:00
James Zern
a60dd5c83a Merge "Fix warnings reported by -Wshadow: Part1: vpx_dsp directory" 2016-10-18 22:09:29 +00:00
James Zern
53d8ff6f14 Merge "Revert "third_party: Roll libwebm snapshot."" 2016-10-18 20:06:48 +00:00
Kaustubh Raste
8ff5af773a Merge "Optimize sad_64width_x4d_msa function" 2016-10-18 07:46:02 +00:00
James Zern
171e2ccf99 Revert "third_party: Roll libwebm snapshot."
This reverts commit 808a560be6a71dd0d27f29c26f9fefb5e809d373.

causes build warnings under visual studio

Change-Id: I2e49a75d72469f316e8b01929b783e6f727f756c
2016-10-17 23:24:47 -07:00
Kaustubh Raste
b7310e2aff Optimize sad_64width_x4d_msa function
Reduced HADD_UH_U32 macro calls

Change-Id: Ie089b9a443de516646b46e8f72156aa826ca8cfa
2016-10-18 04:05:33 +00:00
Urvang Joshi
e084e05484 Fix warnings reported by -Wshadow: Part1: vpx_dsp directory
While we are at it:
- Rename some variables to more meaningful names
- Reuse some common consts from a header instead of redefining them.

Change-Id: I75c4248cb75aa54c52111686f139b096dc119328
(cherry picked from aomedia 09eea21)
2016-10-17 19:25:19 -07:00
James Zern
68cd3052ca vpx_highbd_convolve_copy_neon: use multi reg loads
for copy16/32/64

BUG=webm:1299

Change-Id: I5080d736bde7e487c80ef3d7024dda1e96a57eaf
2016-10-17 17:15:03 -07:00
Marco Paniconi
f6980ca68e Merge "vp9: Non-rd variance partition: add condition for 64x64 split." 2016-10-18 00:03:17 +00:00
Linfeng Zhang
b0cc8d5cc6 Merge "add vpx high bitdepth convolve8 NEON intrinsics optimization" 2016-10-17 23:57:14 +00:00
Linfeng Zhang
9c8981c666 add vpx high bitdepth convolve8 NEON intrinsics optimization
BUG=webm:1299

Change-Id: I236bfa0441e357b6ff05add8269a2cfb543924d1
2016-10-17 15:23:54 -07:00
Marco
55a2b67368 vp9: Non-rd variance partition: add condition for 64x64 split.
Add stronger condition for splitting 64x64, for low noise content.
This reduces dragging artifact near moving head.

Little/no change in metrics on RTC set.

Change-Id: I39b38cfd20f2ece53ff49c2aaf76ba9f82761be1
2016-10-17 12:54:27 -07:00
Frank Galligan
808a560be6 third_party: Roll libwebm snapshot.
fc5f88d Fix temp files being left on system.
c04a134 Add support for overriding PixelWidth and PixelHeight.
c0160e0 Add support to explicitly set segment duration.
02bc809 Add support to estimate file duration.
c97e3e7 Add support to output sub-sample encryption information.
26f4344 MakeUID: quiet unused param warning in Android builds
d6af52a Change check to fix compile error.
1720020 webm_parser: Add Mesh value for ProjectionType
78f2c5a webm_parser: Use ./ prefix for includes
da62f65 webm_parser: Remove webm/ prefix from public includes
e15e8f2 webm_parser: Update README build instructions
5023f2b mkvmuxer: Fix Colour::Valid()
cf16204 mkvmuxer_tests: Actually test cue points in the cue point test.
93e9fb3 Validate Colour element values.
8036925 mkvparser_tests: Add Projection element test.
f52d38c mkvparser_tests: Add Colour element test.
826436a mkvparser: minor SeekHead::Entry clean up.
24fb44a mkvmuxer_tests: Add Projection element test.
1e0a8ea mkvmuxer_tests: Add Colour element test.
0278616 mkvmuxer: Colour accessors/mutators.
2346f8f Add mkvparser wrapper functions.
54d6b6b webm_info: Add Projection element support.
65fee06 mkvmuxer_sample: Add support for Projection element.
9a3f2b5 mkvparser_sample: Add support for Projection element.
41e814a mkvparser: Add Projection element support.
483a0ff mkvmuxer: Add Projection element support.
676a713 Add support for the Projection element
725f362 mkvmuxer: Fix memory leak when Colour is set multiple times.
fa182de mkvparser_sample: Add output of audio track codec private size.
8f521f2 mkvparser_tests: Add invalid BlockGroup test.
39137d7 Remove docs saying binary elements default to 0
c147504 Fix legacy Makefile.
80685d3 Do not skip over unknown elements at the root level
58711e8 mkvparser_sample: Fix version info string.
837746f mkvparser_tests: Add invalid block test.
207cd80 Disambiguate sample sources and targets.
a112d71 mkvparser_tests: Refactor invalid file loading code.
5dea33e Disambiguate test source and target names.
125049e parser_tests: Add another truncated chapter string test.
1de8d4c parser_tests: Add truncated chapter string test.
ff8c2b6 parser_tests: Move cue validation to test_util.
4b0690f parser_tests: Add invalid lacing test.
9828e39 mkvmuxer: Set default doc type version to 4.
5495a59 webm_parser: Reference more files in CMakeLists.txt.
0c0ecd0 vpxpes_parser: Add start code emulation prevention support.
639a4bc webm2pes: Remove debug printfs().
9a51102 webm2pes: fflush() in the correct conversion function.
dc7f155 webm2pes: Track total bytes written.
d518128 webm_parser: Enable usage of werror.
e1fe762 webm2pes: Add test for mux/demux of large input.
1b24a79 vpxpes_parser: Read and store PTS when present.
6cf0a0f vpxpes_parser: Store frame payloads.
25d2602 webm_parser: Convert style to match the rest of libwebm
24be76d webm2pes: Replace VpxFrame with VideoFrame.
b451c3b Add a basic video frame storage class.
05c90eb libwebm_util: Clarify error text in superframe parser.
e6415af webm2pes: Make WritePesPacket() a public method.
8f840dd webm2pes: Move frame read out of PES packet write method.
448af97 webm2pes: Restore frame fragmentation support.
f8bb714 cmake: Integrate new parsing API and tests.
cb8ce0b Add a new incremental parsing API
900d322 vpxpes_parser/webm2pes: BCMV and PTS fixes.
4b73545 webm2pes: Add start code emulation prevention.
82903f3 Add column tiles and frame parallel to webm_info
5d91edf style_clean_up: Remove unnecessary parentheses
a95aa4b vp9_level_stats: correct total_uncompressed_bits_ calculation
f46566f mkvreader: Fix shorten-64-to-32 warning in 32 bit builds.
76630ca mkvwriter: Fix shorten-64-to-32 warning in 32 bit builds.
a8ffbd4 webm2pes: Fix format specifier warnings.
faf89d4 Add MaxLumaSampleRate grace percent to stats.
d31e6c9 Fix profile 2 in vp9_header_parser.
bd3ab3a Add flag to estimate last frame's duration to stats.
c182ed9 Fix lint issue in hdr_util.h
cc62ecd Add test for Cluster memory leak
196708a Change MaxLumaSampleRate to be based on frame resolution.
cbd676b mkvmuxer: Fix leak when a Cluster isn't finalized
47f2843 Add parsing support for new features in CodecPrivate.
9a235e0 mkvmuxer: Set doctype to matroska when muxing non-WebM codecs.
e3c9576 Add VP9 level output to webm_info.
bbaaf2d Add class to gather VP9 level stats.
5cf549f cmake: Log compiler flag at check time.
8bb68c2 Add file to parse data from VP9 frames.
df3412f Add support for setting VP9 profile and level to sample_muxer.
296429a Add support to parse VP9 profile.
87832d4 mkvmuxer: Fix Segment::Finalize in kLive mode
6df3e56 mkvmuxerutil.hpp: Add using directives for overloaded size utils.
ec47928 mkvmuxerutil: Revert to using mkvmuxertypes.
4e3d037 Add support to output Colour elements to webm_info.
a1dc4f2 Fix parsing of VP9 level.
039df94 Add TEST_TMPDIR environment variable
d3656fd muxer_tests: ignore iwyu re gtest-message.h
e76dd5e Fix file name in mkvmuxertypes shim.
1be5889 Add temporary include shims at old file locations.

Change-Id: I6a1026814560be80d604a5ecb9b66406a1186dd9
2016-10-17 12:45:05 -07:00
Vignesh Venkatasubramanian
9e8efa5b18 vp9_bitstream: Encode tiles in parallel
Re-use the tile worker threads to pack the bitstream in parallel
on a per-tile basis.  Restricting this to real-time only for now
(further testing is needed to ensure this does not make 2-pass
worse in any case).

BUG=webm:1309

Change-Id: Ia2c982da56697756e12f02643f589189b3271d98
2016-10-17 10:42:03 -07:00
Jerome Jiang
4c3d539baa Merge "VP8: Add realtime speed to datarate_test.cc" 2016-10-15 06:01:41 +00:00
Jerome Jiang
acd21e053a VP8: Add realtime speed to datarate_test.cc
Change-Id: Ia56f0e8dfba20143be3e69666d9184dd3ca5b563
2016-10-14 17:09:27 -07:00
Linfeng Zhang
6c309c1f59 Merge "add vpx_highbd_convolve_{copy,avg}_neon()" 2016-10-14 23:04:59 +00:00
James Bankoski
e49a02b113 Merge "Drop empty frames." 2016-10-14 16:38:56 +00:00
Jim Bankoski
3e21d703ce Drop empty frames.
Change-Id: I2d45a6eb3aaca97eb61e8e7ef9e5114221091244
2016-10-14 06:28:14 -07:00
Linfeng Zhang
f910d14a1a add vpx_highbd_convolve_{copy,avg}_neon()
BUG=webm:1299

Change-Id: Ib87ac466ada63251eb06ae2abd1e13e61e0d1538
2016-10-13 15:21:14 -07:00
Marco
f5b8b473db vp8: Adjust thresholds in VP8/DatarateTestLarge tests.
Fix unit_tests_ubsan failure VP8/DatarateTestLarge.BasicBufferModel.
Failure was triggered by commit: df66f8e8.

Change-Id: I2c49e5cc24094b15063161bab27b09ec7e6f2045
2016-10-13 09:28:40 -07:00
James Zern
1909270f65 Merge "cosmetics,*loopfilter_neon.c: s/tranpose/transpose/" 2016-10-13 07:12:51 +00:00
Vignesh Venkatasubramanian
3e3475321c Merge "vp9_bitstream: Parameterize interp_filter_selected" 2016-10-13 06:33:31 +00:00
Vignesh Venkatasubramanian
769292017b vp9_bitstream: Parameterize interp_filter_selected
Facilitates encoding tiles in parallel.

BUG=webm:1309

Change-Id: I37aa336d47babffc8352188dc767eebdb8a99474
2016-10-12 20:22:03 -07:00
Kaustubh Raste
9e75c01353 Merge "Optimize vpx_mbpost_proc_across_ip_msa function" 2016-10-13 02:12:33 +00:00
Kaustubh Raste
99adf8b22e Merge "Optimize vpx_get4x4sse_cs_msa function" 2016-10-13 02:12:00 +00:00
James Zern
fd270437f0 cosmetics,*loopfilter_neon.c: s/tranpose/transpose/
Change-Id: I267d6a9d715ddb6110f0881c2e820c37fc673fe1
2016-10-12 16:12:56 -07:00
Vignesh Venkatasubramanian
04a6010742 Merge "vp9_bitstream: Parameterize max_mv_magnitude" 2016-10-12 21:52:42 +00:00
Vignesh Venkatasubramanian
d03d1c8cd3 vp9_bitstream: Parameterize max_mv_magnitude
Facilitates encoding tiles in parallel.

BUG=webm:1309

Change-Id: I614a5a492c30b6773c30e7294cd6a6f456e02ab4
2016-10-12 12:50:17 -07:00
Linfeng Zhang
b894d95b32 Merge "[vpx highbd lpf NEON 6/6] vertical 16" 2016-10-12 19:31:39 +00:00
Linfeng Zhang
f664d3f6d5 Merge "[vpx highbd lpf NEON 5/6] horizontal 16" 2016-10-12 19:31:25 +00:00
Linfeng Zhang
3b06acd4e2 Merge "[vpx highbd lpf NEON 4/6] vertical 8" 2016-10-12 19:31:06 +00:00
Linfeng Zhang
01454ec485 [vpx highbd lpf NEON 6/6] vertical 16
BUG=webm:1300

Change-Id: I29d0b482d66f05e278325ddebcf108fbf0b6e222
2016-10-11 22:59:19 -07:00
Linfeng Zhang
27479775c4 [vpx highbd lpf NEON 5/6] horizontal 16
BUG=webm:1300

Change-Id: I21da32d6cfb8a1a6f58bc9756d17f48f13a59a12
2016-10-11 22:59:19 -07:00
Linfeng Zhang
251cbfbec8 [vpx highbd lpf NEON 4/6] vertical 8
BUG=webm:1300

Change-Id: If06b12bc081bab60059b100414dd7018f83ac62d
2016-10-11 22:59:19 -07:00
Kaustubh Raste
56b1be1889 Merge "Optimize vp8 loopfilter msa functions" 2016-10-12 05:44:11 +00:00
James Zern
356f95b423 Merge "[vpx highbd lpf NEON 3/6] horizontal 8" 2016-10-12 05:35:48 +00:00
Linfeng Zhang
96c7206ede [vpx highbd lpf NEON 3/6] horizontal 8
BUG=webm:1300

Change-Id: Ica2379e294be60b7f80fcfcec110dca4c3b59d81
2016-10-12 00:48:31 +00:00
Marco
065ba0c486 vp8: Adjust threshold on VP8/DatarateTestLarge.DenoiserOffOn.
Fix unit_tests_ubsan failure for VP8/DatarateTestLarge.DenoiserOffOn.
Failure was triggered by commit: df66f8e8.

Change-Id: I7cc5bd309e85950cfc5755e01d0eb942d9ca6984
2016-10-11 16:18:14 -07:00
Marco
57c6bf291e 1 pass vbr: Allow for lookahead alt-ref in real-time mode.
For 1 pass vbr real-time mode:
Allow for the usage of alt-ref frame when non-zero lag-in-frames is used.
Use non-filtered alt-ref, and select usage based on fast scene/content
analysis/detection within the lag of frames.

Positive gains on ytlive set: overall avgPSNR ~3-4%.
Several clips are up between 5-14%, a few clips are neutral/small change.

Current speed decrease is about ~5-10%.

Use the flag USE_ALTREF_FOR_ONE_PASS to enable this feature
(off by default for now).

Change-Id: I802d2bf3d44f9cf01f6d15c76be9c90192314769
2016-10-11 10:13:17 -07:00
Marco
cdbd89197e vp9: 1 pass vbr: some adjustments to gf interval.
Put limit on gf interval based on lag, and allow
for the adjustment on next gf group also on key frame.

Small/neutral change on ytlive metrics.

Change only affects 1 pass vbr real-time mode.

Change-Id: I339c8f4398848698b6e10fe9482c52ca661b94a5
2016-10-11 08:34:12 -07:00
Marco Paniconi
294a734a5f Merge "vp8: Change default gf behavior for 1 pass cbr." 2016-10-10 23:06:31 +00:00
Linfeng Zhang
57e4cbc632 Merge "[vpx highbd lpf NEON 2/6] vertical 4" 2016-10-10 16:57:55 +00:00
Linfeng Zhang
19046d9963 Merge "[vpx highbd lpf NEON 1/6] horizontal 4" 2016-10-10 16:56:23 +00:00
Kaustubh Raste
3da752fe00 Optimize vpx_mbpost_proc_across_ip_msa function
Removed HADD_SW_S32 calculation

Change-Id: I7384dc881451d197404d09beb7c27b222e1d6875
2016-10-10 18:03:28 +05:30
Kaustubh Raste
d05104b488 Optimize vpx_get4x4sse_cs_msa function
Reuse CALC_MSE_B macro

Change-Id: I39f0a92ac2dbb5fa8628df1a5d556cfdc42a3648
2016-10-10 16:31:57 +05:30
Kaustubh Raste
8b5eddf709 Merge "Optimize vp9 loopfilter msa functions" 2016-10-08 05:05:16 +00:00
Kaustubh Raste
3c2f7eb339 Optimize vp9 loopfilter msa functions
Updated code to process in 8bit as saturation/clipping takes care of
overflow
Removed unused macro

Change-Id: I113df60286fb28b216df800d95b2d3695ef71440
2016-10-07 19:26:26 -07:00
Marco
df66f8e830 vp8: Change default gf behavior for 1 pass cbr.
In 1 pass CBR, with error_resilience off, allow for
special logic to change the default gf behaviour.
In this CL: boost is turned off and the gf period
is set to a multiple of cyclic refresh period.

Change only affect 1 pass CBR mode, i.e, when the flag
gf_update_onepass_cbr is set.

Including the previous change (3ec8e11: to allow cyclic refresh
for error_resilience off), comparing metrics on RTC set for
error_resilience off vs on: avgPSNR/SSIM up by ~6%.

Change-Id: Id5b3fb62a4f04de5a805bd1b418f2b349574e0bc
2016-10-07 11:13:06 -07:00
Vignesh Venkatasubramanian
e83e828998 Merge "write_modes: add MACROBLOCKD as a parameter" 2016-10-07 18:09:09 +00:00
Vignesh Venkatasubramanian
ed50e7710c write_modes: add MACROBLOCKD as a parameter
This will enable bit stream packing of each tile column in
parallel.

BUG=webm:1309

Change-Id: Ie349d8cc5825326218ffda893a50730b2e68ed34
2016-10-07 10:25:02 -07:00
Kaustubh Raste
06a6b28d75 Optimize vp8 loopfilter msa functions
Updated code to process in 8bit as saturation/clipping takes care of overflow

Change-Id: I35fb2c0e702fd91309cc391c5a7745a3b619a64c
2016-10-07 15:48:31 +05:30
James Zern
5e4d2548cf Merge "Fix build failure in libvpx_example_test-multi-target." 2016-10-07 01:53:40 +00:00
Linfeng Zhang
49aa9b1f12 [vpx highbd lpf NEON 2/6] vertical 4
BUG=webm:1300

Change-Id: Ia33a9f2d6c7e2e6b3497ad6f1a09439a85b33983
2016-10-06 14:22:26 -07:00
Linfeng Zhang
7aa27bd62f [vpx highbd lpf NEON 1/6] horizontal 4
BUG=webm:1300

Change-Id: Idf441806e6bf397ff5ecd8776146b3f781f50c40
2016-10-06 14:03:04 -07:00
James Zern
ac00db7948 Merge changes from topic '8bit-hbd-idct'
* changes:
  vpx_dsp/idct*_neon.asm: simplify immediate loads
  enable idct*_1_add_neon in high-bitdepth builds
2016-10-06 19:37:19 +00:00
Marco
c7072ae2f4 Fix build failure in libvpx_example_test-multi-target.
Due to change in command line to sample encoder from:
7eff8f3 Update to vpx_temporal_svc_encoder command line.

This caused the tests in vpx_temporal_svc_encoder.sh to fail.

Change-Id: Ic667da81955ad117d04610af21877fed1d4f188f
2016-10-06 12:22:32 -07:00
Alex Converse
fd918cf9a3 Merge "Remove vpx_realloc()" 2016-10-06 18:42:05 +00:00
Kaustubh Raste
f875267ad0 Merge "Modify vp8 idct msa functions store method" 2016-10-06 02:25:42 +00:00
James Zern
1e1caad165 vpx_dsp/idct*_neon.asm: simplify immediate loads
mov supports 0-65535

Change-Id: I019de0d784836d7bd60e6b36f2cdeefb541cb3fd
2016-10-05 14:28:32 -07:00
James Zern
a6be7ba1aa enable idct*_1_add_neon in high-bitdepth builds
these are compatible as they only load one element of the input so the
larger size of tran_low_t makes no difference in little endian builds.
note the asm is incompatible with big-endian, but there are other points of
failure there so currently it's considered unsupported.

BUG=webm:1294

Change-Id: Icd2665a0699bccae92d1bea43a95b0a83fb17028
2016-10-05 11:14:25 -07:00
Marco Paniconi
efb56ec3ff Revert "Revert "vp8/encoder/onyx_if.c: apply clang-format""
This reverts commit a7456144ce0ab98e015548dd7cda4165ad2a800c.

Change-Id: I400987fb26a09e9b9ea42c91f48ea12f7bc37356
2016-10-05 17:59:55 +00:00
Alex Converse
3063c37600 Remove vpx_realloc()
It only handles the realloc constraint (preserving low elements) by
serendipity, and we don't actually rely on that behavior anyway.
Meanwhile the calls may do extra copying that gets immediately clobbered
by the callers.

Change-Id: I8dfa89e4a81084b084889c27bd272fdf85184e8d
2016-10-05 10:57:56 -07:00
Marco Paniconi
a7456144ce Revert "vp8/encoder/onyx_if.c: apply clang-format"
This reverts commit 891a87dccddfbb9fd625f4b32aa17ae3501f30a6.

Change-Id: I067b3b6a3cfb5bc760166999948b8087d4c5cb80
2016-10-05 15:45:48 +00:00
Kaustubh Raste
68f6f6c4cc Modify vp8 idct msa functions store method
vp8_short_inv_walsh4x4_msa - Optimized to process in short vector type
Updated below functions to store exact number of bytes in output rather than complete vector
idct4x4_addblk_msa
idct4x4_addconst_msa
dequant_idct4x4_addblk_msa
dequant_idct4x4_addblk_2x_msa
dequant_idct_addconst_2x_msa

Change-Id: Ic1b3752e2421dc7d70a082dcdaab9d140d7e5d9c
2016-10-05 10:12:12 +05:30
clang-format
891a87dccd vp8/encoder/onyx_if.c: apply clang-format
after:
955b3b6 vp8: Allow for cyclic refresh even if error_resilience it off.

Change-Id: Iba189b18c84be8f5140754280c6801cfc387cfcd
2016-10-04 21:12:06 -07:00
Marco
955b3b66bd vp8: Allow for cyclic refresh even if error_resilience it off.
cyclic_refresh was tied to error_resilience mode.
Allow it to be on also for 1 pass CBR mode even if
error_resilience is off.

Other option to use new control for this, but prefer to avoid
that for now.

Change-Id: I3625b292ee059a890e31338b514e211bf0ab5c3e
2016-10-04 14:19:49 -07:00
Sarah Parker
8978704970 Merge "Remove rate deviation metric from vp8" 2016-10-04 18:56:14 +00:00
Sarah Parker
d556d435f3 Remove rate deviation metric from vp8
BUG=b/31780679

Change-Id: I2b2a43b154eeacb4f51a11f6362cc535cfe318da
2016-10-04 11:20:55 -07:00
Johann Koenig
3db06394e7 Merge "Connect partial IDCT tests" 2016-10-04 18:01:19 +00:00
Johann
24c0146403 Connect partial IDCT tests
Change-Id: Ie8d5d9123f5a9d39db4ec9c74f77ee979ae4e685
2016-10-04 10:31:01 -07:00
Angie Chiang
5d635365bb Merge "Move highbd txfm input range check from 2d iht transform to 1d idct/iadst" 2016-10-04 16:57:37 +00:00
Kaustubh Raste
0a92dd7319 Merge "Fix vpx_plane_add_noise_msa functionality bit-mismatch" 2016-10-04 06:35:47 +00:00
Angie Chiang
5b073c695b Move highbd txfm input range check from 2d iht transform to 1d idct/iadst
This change will make the highbd txfm input range check more comprehensive

The 25-bit highbd input range is composed by
12 signal input bits + 7 bits for 2D forward transform amplification + 5 bits for
1D inverse transform amplification + 1 bit for contingency in rounding and quantizing

BUG=https://bugs.chromium.org/p/webm/issues/detail?id=1286
BUG=https://bugs.chromium.org/p/chromium/issues/detail?id=651625

Change-Id: I04c0796edd7653f8d463fba5dc418132986131e7
2016-10-03 17:21:08 -07:00
James Zern
577221bc87 Merge "invalid_file_test: quiet unused const warning" 2016-10-03 22:51:06 +00:00
James Zern
fb020805f9 Merge "Fix warning when building with GCC 5." 2016-10-03 22:42:52 +00:00
James Zern
c6bc7499d9 Merge "cosmetics,*_neon.c: rm redundant return from void fns" 2016-10-03 22:40:42 +00:00
Kaustubh Raste
6922fc8230 Fix vpx_plane_add_noise_msa functionality bit-mismatch
Change-Id: I04961afb592ae6a67fdcfd8c9066e920dd4b30e7
2016-10-03 18:15:59 +00:00
Marco
7eff8f3b1d Update to vpx_temporal_svc_encoder command line.
Set the  #threads at command line.

Change-Id: Id0daa2393880c3da2d903c11a793072d3008b34b
2016-10-03 09:49:15 -07:00
James Zern
50b9c467da Merge "vpx_convolve8_neon,load/store*: correct param type" 2016-10-01 23:52:14 +00:00
Geza Lore
0dc12b4a1c Fix warning when building with GCC 5.
These caused the following warning with GCC 5:
     warning: logical not is only applied to the left hand side of
     comparison [-Wlogical-not-parentheses]
     assert(!is_compound == (cm->reference_mode == SINGLE_REFERENCE));

Change-Id: If296aabb2311ceb7d903b395c1549ef81c2cbf9b
(cherry picked from commit c6cf7a6111f6539f01a34865aaedd179a5ae062c)
2016-10-01 12:23:15 -07:00
James Zern
fca2196a2e invalid_file_test: quiet unused const warning
with --disable-vp9

Change-Id: I81bd603b02ee5d1b45a50aa9e7534f9da498b0e0
2016-10-01 11:49:02 -07:00
James Zern
c449983c56 vpx_convolve8_neon,load/store*: correct param type
stride/pitch in convolve is expressed with a ptrdiff_t

Change-Id: Ia5a6732dc509f06ccf7035386fa8ae721b4b1a71
2016-10-01 11:03:29 -07:00
Martin Storsjo
9255328f27 Remove a stray END declaration in loopfilter_4_neon.asm
Change-Id: Ic8c359a5677f9c663787aac74f530e886163bc69
2016-10-01 14:12:42 +03:00
James Zern
3c00132181 Merge "vp8,frame_buffers: remove unused use_frame_threads" 2016-10-01 01:35:55 +00:00
Linfeng Zhang
da14d23e44 Merge "Refactor vpx lpf NEON files (step 2/2)" 2016-10-01 00:07:51 +00:00
Linfeng Zhang
edbca72a53 Merge "Refactor vpx lpf NEON files (step 1/2)" 2016-10-01 00:07:31 +00:00
Marco Paniconi
0a9f56f146 Merge "vp9: On change_config() only call update_frame_size if needed." 2016-09-30 21:43:33 +00:00
Marco Paniconi
5e908aff34 Merge "vp9 real-time mode: Change loopfilter speed feature at speed 8." 2016-09-30 21:42:05 +00:00
James Zern
db80c23fd4 cosmetics,*_neon.c: rm redundant return from void fns
+ a couple of 'break's after a return

Change-Id: Ia21f12ebcef98244feb923c17b689fc8115da015
2016-09-30 13:09:57 -07:00
James Zern
b6277a47c7 Merge changes from topic '8bit-hbd-idct'
* changes:
  *idct*_neon.c: add missing rtcd include
  idct,msa/neon: exclude idct files from hbd build
  *rtcd_defs.pl: remove empty specialize calls
2016-09-30 19:36:08 +00:00
James Zern
1396d12103 *idct*_neon.c: add missing rtcd include
+ correct declarations as necessary

BUG=webm:1294

Change-Id: I719602df9a56e79188a78e7f8b31257c6d3cc11d
2016-09-30 11:41:26 -07:00
James Zern
b51c4df93a idct,msa/neon: exclude idct files from hbd build
these functions are incompatible currently and unreferenced in rtcd,
exclude them from the build.

BUG=webm:1294

Change-Id: I7790c195a91e1b142f56c04d2a5e305d9133b896
2016-09-30 11:32:47 -07:00
Linfeng Zhang
ca2fe7a8c7 Refactor vpx lpf NEON files (step 2/2)
Change-Id: I0744407cd3361ff752bd7f6e654b70ab6b41a58f
2016-09-30 09:56:28 -07:00
Linfeng Zhang
4779f5308d Refactor vpx lpf NEON files (step 1/2)
Change-Id: I4016d096d46ca691f3b17199b259b7231e983cfb
2016-09-30 09:48:54 -07:00
Linfeng Zhang
8c744fd978 Merge "Unify loopfilter function names" 2016-09-30 15:58:08 +00:00
Linfeng Zhang
c435b7fbdd Merge "Refine vpx convolve8 NEON intrinsics optimization" 2016-09-30 15:56:31 +00:00
Linfeng Zhang
bde905cba1 Merge "Refine vpx_convolve_copy_neon() and vpx_convolve_avg_neon()" 2016-09-30 15:54:02 +00:00
James Zern
ed62d27c71 *rtcd_defs.pl: remove empty specialize calls
add_proto adds a 'c' specialization

Change-Id: I0ed0c2240d45264b0e0056ce7c8f63f4a00780bc
2016-09-29 20:38:26 -07:00
James Zern
f38616e1a2 vp8,frame_buffers: remove unused use_frame_threads
this was never fully implemented

Change-Id: I4640cf84c40ea2cc9c6c12acf116d39df4b04578
2016-09-29 20:24:15 -07:00
James Zern
39ff0de810 Merge "configure: test for -Wshorten-64-to-32 in non hbd builds" 2016-09-30 03:01:56 +00:00
Johann Koenig
cb4aa6d589 Merge changes I158f631a,I0555f639
* changes:
  vp8: remove mmx functions
  Rename _xmm functions to _sse2
2016-09-30 01:47:41 +00:00
Yunqing Wang
9afe2cf599 Merge "Fix an issue in vp9_first_pass for non-mulitple of 16 resolutions" 2016-09-30 00:49:06 +00:00
Linfeng Zhang
7f1f35183a Unify loopfilter function names
Rename vpx_lpf_horizontal_edge_8() to vpx_lpf_horizontal_16().
Rename vpx_lpf_horizontal_edge_16() to vpx_lpf_horizontal_16_dual().

Change-Id: I798ca8fbbd657d06d3db2bfb0fb3321168f49e52
2016-09-29 16:25:42 -07:00
Linfeng Zhang
85a9e48d25 Refine vpx_convolve_copy_neon() and vpx_convolve_avg_neon()
BUG=webm:1290

Change-Id: Ia27e58521eba5a4852b50381c56746fa5767f6d6
2016-09-29 16:19:39 -07:00
Deepa K G
2745f94deb Fix an issue in vp9_first_pass for non-mulitple of 16 resolutions
This patch sets the 16x16 src_diff to zero and ensures correct calculation
of this_error for block sizes smaller than 16x16.

Change-Id: I7b7c02d267433c9f22c8ac9b8d5df2f499175172
2016-09-29 16:19:23 -07:00
Johann Koenig
ad55b1d270 Merge changes Ia3e9122f,Id33eb6c8,I956bd8ce
* changes:
  Remove vp8_clear_system_state
  vpx_dsp: clean up rtcd
  vp8: clean up rtcd
2016-09-29 23:16:45 +00:00
James Zern
7b9c86167e Merge "vp9_detokenize,decode_coefs: fix signed int overflow" 2016-09-29 22:36:13 +00:00
Johann
721354fe7f vp8: remove mmx functions
When they have sse2 equivalents.

Change-Id: I158f631a3bcecba57b36093ac10114b1904767a7
2016-09-29 15:25:27 -07:00
Johann
2663b092ae Rename _xmm functions to _sse2
Avoid the extra level of indirection/confusion.

Change-Id: I0555f639d67835df9fb7dac0c75085e9954805f1
2016-09-29 15:23:11 -07:00
Johann
1364cb58b4 Remove vp8_clear_system_state
Use vpx_clear_system_state instead.

Change-Id: Ia3e9122f69a2c690ddd7c7bc54f92ccb9ec18b3e
2016-09-29 13:22:49 -07:00
Marco
e765435293 vp9: On change_config() only call update_frame_size if needed.
change_config() may be called often in real-time application,
to update bitrate/framerate or qp-max/min.
No need to do update_frame_size() unless frame size has changed.

Change-Id: I23a51deade1e03adc91c468f9ffde3235298770c
2016-09-29 13:03:26 -07:00
Marco
d017548be6 vp9 real-time mode: Change loopfilter speed feature at speed 8.
For real-time mode at speed 8: turn off MINIMAL_LF at speed 8,
for non-screen content mode.

Visually better, avgPSNR/SSIM on rtc set go up by ~4-5%.
Speed decrease of about ~3%.

Change-Id: I8eb69330f02e0ceece1507d43cfc8a049a1d8291
2016-09-29 12:59:01 -07:00
Linfeng Zhang
b3cb065ee4 Refine vpx convolve8 NEON intrinsics optimization
BUG=webm:1290

Change-Id: I5d7fce62270f9d76ef9ce98b3d188ad11fb21873
2016-09-29 12:48:59 -07:00
James Zern
691ef20272 Merge changes I11786887,Ia91823ad
* changes:
  vpx_dsp/get_prob: relocate den == 0 test
  vpx_dsp/get_prob: make clip_prob branchless
2016-09-29 19:11:35 +00:00
Johann
7b5a348088 vpx_dsp: clean up rtcd
Remove avx2+ssse3 specialization. Disabling ssse3 now automatically
disables avx2.

Change-Id: Id33eb6c85d1c4ee57128ebe45c995eb15cfcc765
2016-09-29 12:10:07 -07:00
Johann
c7f9d0719d vp8: clean up rtcd
Remove lines which specify the same name for a function.

Change-Id: I956bd8ce2b81a2a8feab5621d28bd2499c2b4c2d
2016-09-29 12:10:01 -07:00
James Zern
450d89034b vp9_detokenize,decode_coefs: fix signed int overflow
when decoding an invalid bitstream with --enable-vp9-highbitdepth

BUG=webm:1297

Change-Id: I401d87033b4293f2ca595bc51678aad9951ecf15
2016-09-28 22:42:03 -07:00
James Zern
93c823e24b vpx_dsp/get_prob: relocate den == 0 test
to get_binary_prob(). the only other caller mode_mv_merge_probs() does
its own test on 0.

BUG=chromium:639712

Change-Id: I1178688706baeca2883f7aadbc254abb219a44ce
2016-09-28 17:42:49 -07:00
James Zern
e094e151de Merge "vp9: fix compilation for g++ 6.2.x" 2016-09-28 23:36:23 +00:00
Johann Koenig
bb27be0dfe Merge "Hook up vp8_diamond_search_sad_sse3" 2016-09-28 20:54:25 +00:00
James Zern
63f7e131fe Merge "vpxdec: avoid memory leaks under most conditions" 2016-09-28 19:35:16 +00:00
James Zern
7481edb33f vpx_dsp/get_prob: make clip_prob branchless
+ inline the function directly as there was only one consumer
(get_prob())

this is an attempt to reduce the amount of branches to workaround an amd
bug. this change is mildly faster or neutral across x86-64, arm.

http://support.amd.com/TechDocs/44739_12h_Rev_Gd.pdf
665 Integer Divide Instruction May Cause Unpredictable Behavior

BUG=chromium:639712

Suggested-by: Pascal Massimino <pascal.massimino@gmail.com>
Change-Id: Ia91823aded79aab469dd68095d44300e8df04ed2
2016-09-28 11:51:46 -07:00
Tristan Matthews
32c375447c vp9: fix compilation for g++ 6.2.x
Inline function called from test/dct16x16_test.cc wouldn't build due to:
  invalid operands of types ‘__gnu_cxx::__enable_if<true, double>::__type
  {aka double}’ and ‘int’ to binary ‘operator>>’
  return (abs(ref->row) >> 3) < COMPANDED_MVREF_THRESH &&

this converts the test to abs() < COMPANDED_MVREF_THRESH << 3 which
hides the promotion issue.

Regression from commit de993a847f8080d3128420c8ef8495642013bdb1

BUG=webm:1291

Change-Id: I73b5943d07d5b61b709d299114216a2371a8fd62
2016-09-27 23:17:31 -07:00
Linfeng Zhang
240726ac85 Merge "Clean convolve_test.cc" 2016-09-28 00:20:28 +00:00
Debargha Mukherjee
74f038e6f8 Merge "Fix for compile error with range checking" 2016-09-28 00:05:37 +00:00
James Zern
06abc1ecd9 configure: test for -Wshorten-64-to-32 in non hbd builds
provides msvc-like warnings for implicit conversions from 64-bit to
32-bit types

--enable-vp9-highbitdepth still requires some work

this also skips CXXFLAGS for now as some work would be needed to cleanup
third_party/*.cc or split it from test/*.cc where it comes to flags.

Change-Id: Ic9a095b73286eba5ed39bfc27ff69593748cbbf4
2016-09-27 16:52:21 -07:00
Johann
3a57ce4478 Cast strto[u]l down
Change-Id: I945b2f8754cf484a08e5ba511cfd2d4a44181b08
2016-09-27 15:37:10 -07:00
Johann
e4ddf9db6a Hook up vp8_diamond_search_sad_sse3
The original commit never set any 'specialize' line:
61311e61039c300ae872ccba22304e9e60dc0205

It appears the sadx4 version of function uses sdx4df calls to speed up
the search. There are no sse3 versions of the sdx4df functions, but
there are sse2 and msa versions.

There is a neon version of vpx_sad16x16x4d but not any of the smaller
versions. Perhaps if they existed this function could be expanded to use
them.

Change-Id: I936d7d6b1a3ff6dcd5a4d2322272708c47cdec13
2016-09-27 15:31:49 -07:00
James Zern
e61d82bd4f vpxdec: avoid memory leaks under most conditions
avoids false positives when fuzzing with ASan+LSan.

Change-Id: I0d23b530ae80e5692b6951fe6e3690ea44159a5a
2016-09-27 14:29:18 -07:00
Johann Koenig
348cff040a Merge changes from topic 'wextra'
* changes:
  Expand -Wextra to more of the library
  mips: clean up wextra warnings
  Add compiler flag -Wsign-compare
  Add compiler warning flag -Wextra and fix related warnings.
2016-09-27 21:13:50 +00:00
Linfeng Zhang
81ff7a065f Clean convolve_test.cc
Combine test MatchesReferenceSubpixelFilter and
MatchesReferenceAveragingSubpixelFilter.

Change-Id: I75f96befbbb118cdc6b8c6001b4cdda8d88fbbd3
2016-09-27 13:36:31 -07:00
Johann
c3a135b5b8 Expand -Wextra to more of the library
Suppress warnings in third_party/.

vp8 -Wclobbered issue is tracked here:
BUG=webm:1246

BUG=webm:1069

Change-Id: I9b94bf546d7b690c26a59ae67967facdce8ec45b
2016-09-27 13:19:27 -07:00
Johann
02fa245d15 mips: clean up wextra warnings
Remove unused zbin variable:
warning: unused parameter ‘zbin’

Use int for loop variables to avoid unsigned conversion:
warning: comparison between signed and unsigned integer expressions

Change-Id: Icea74b870c0ee68a8bf687e796a69392af25a8ad
2016-09-27 13:19:18 -07:00
Urvang Joshi
097b31c7f0 Add compiler flag -Wsign-compare
Also, fix the warnings generated by this flag.

(cherry picked from commit ebeb1155d4fa6d28e2f40c92265245f8df097fcb)

From AOM. Don't actually add -Wsign-compare. It will be covered by
-Wextra.

Switch to vpx_integer.h from df9c9d6d4c43f02c58d4e776c53323788e013cbc

BUG=webm:1069

Change-Id: I1dc6e61caa5d56af4a55b6692ab620bb3144652a
2016-09-27 12:39:36 -07:00
Urvang Joshi
0aa3e2564f Add compiler warning flag -Wextra and fix related warnings.
Note: some of these warnings are enabled by a combination of -Wunused
(added earlier) and -Wextra.

Cherry-picked from AOM 4790a69faaec8f03d65f64ff070f6ab4307dbb16

Expands use of (void)x; on unused variables. AOM only supports one codec
in codec_factory.h

Does not include changes to HandleDecodeResult. AOM removed
invalid_file_test.cc which does use the video parameter.

Does not enable -Wextra yet. There are more issues to fix.

BUG=webm:1069

Change-Id: I322a1366bd4fd6c0dec9e758c2d5e88e003b1cbf
2016-09-27 12:05:01 -07:00
Paul Wilkins
b3ebea5e8a Merge "Limit max arf boost and scale motion breakout for image size." 2016-09-27 14:08:29 +00:00
Peter de Rivaz
8db503063f Fix for compile error with range checking
Current version does not build with options:
  --enable-vp9-highbitdepth --enable-coefficient-range-checking

Change-Id: Ic3285f1a3e0d6be88da7f2cd8fa5a631368dd03b
2016-09-27 09:28:44 +01:00
Marco Paniconi
70240a77b8 Merge "vp9: Reduce frame loopfilter-level for 1 pass cbr." 2016-09-26 22:05:44 +00:00
Johann Koenig
b165451ad5 Merge "Un-Revert "Restore vp8_sixtap_predict4x4_neon"" 2016-09-26 19:11:00 +00:00
Johann Koenig
37798711aa Merge "Use shifted value for sinpi8sqrt2" 2016-09-26 19:10:57 +00:00
Marco
d9fc28c0a1 vp9: Reduce frame loopfilter-level for 1 pass cbr.
Reduce the filt_guess for 1 pass cbr on inter-frames.
This reduces visual artifact seen in rtc clip (jimred.vga),
and improves metrics on rtc set.

Metrics on rtc set for cbr mode overall positive, most clips are up:
Speed 7 rtc: avgPSNR/SSIM up by: ~2.6/3.9%
Speed 8 rtc: avgPSNR/SSIM up by: ~1.3/2.5%

Change-Id: Ia4eccea1c19d65b583516df28823cd756c49464f
2016-09-26 10:12:43 -07:00
Linfeng Zhang
b46243d7ff Merge "Refactor lpf (size 4 and 8) NEON intrinsics optimization" 2016-09-26 16:11:12 +00:00
paulwilkins
0421d8e318 Limit max arf boost and scale motion breakout for image size.
Added a cap on the maximum boost for an arf based on interval length.
Fixed bug where by the image size was not accounted for in determining
two of the motion breakout thresholds.

Overall small gains of 0.2-0.4% psnr but on large image format clips with
slow zooms the gain may be as much as 20% or more (e.g. in_to_tree
at 1080P)

Change-Id: Id0a47391203026742daa9c97afac5705fd8c4dfb
2016-09-26 15:38:29 +01:00
Scott LaVarnway
60624aa53a Merge "VP9: token decoder expansion" 2016-09-26 12:06:50 +00:00
James Zern
f8c056a895 Merge "vp9_idct: delete dead TODOs" 2016-09-24 01:47:00 +00:00
Johann
ab0e7a237a Use shifted value for sinpi8sqrt2
The value 35468 changes sign when stored in int16_t:
implicit conversion from 'int' to 'int16_t' (aka 'short')
changes value from 35468 to -30068

This negation requires adding back the original value to compensate.
Shifting the value keeps the value positive and saves a post-vqdmulh
shift.

This technique is used in webp and idct_dequant_full_2x_neon

BUG=b/28027557

Change-Id: I0c5ce09bea170fe08061856c2af6f841a557e0c3
2016-09-23 17:04:18 -07:00
Johann
1d14e42df7 Un-Revert "Restore vp8_sixtap_predict4x4_neon"
This restores d9dce2f48eed1368a44c368fa87a506bd89ffec5

Switched to using signed shift-and-narrow. Instead of saturating
negative results to 0, it was saturating them to 255.

BUG=webm:817
BUG=webm:1273

Change-Id: I571095336aa4182e3288b17924fcaaece42b0a49
2016-09-23 14:58:57 -07:00
Scott LaVarnway
87b689f97a VP9: token decoder expansion
This version is based on Change 267683, but does not
use the macros.

Change-Id: I0619fa618decf8bdeef250584d75d70318b5d9a7
2016-09-23 06:24:20 -07:00
Scott LaVarnway
ada850786c Merge "VP9: pass TileWorkerData instead of MACROBLOCKD and vpx_reader." 2016-09-23 11:59:16 +00:00
James Zern
deadda3dea Merge "vpx_idct32x32_34_add_sse2: rm unneeded transposes" 2016-09-23 02:49:26 +00:00
James Zern
a914ffad97 Merge "variance_neon: sync variance*() w/c,sse2" 2016-09-23 02:18:49 +00:00
Scott LaVarnway
7a34f85955 VP9: pass TileWorkerData instead of MACROBLOCKD and vpx_reader.
Change-Id: I869ef0f113c022143b531c44aefa0f1bb267052d
2016-09-22 13:18:36 -07:00
James Zern
fdd1186f97 vpx_idct32x32_34_add_sse2: rm unneeded transposes
this change is neutral to mildly positive across various x86-64
platforms

Change-Id: I28fb5ae598fc1317b7a42c9a846ac5d57d104784
2016-09-21 19:49:25 -07:00
Angie Chiang
99ef84c65a Merge "Detect invalid highbd iht input" 2016-09-22 01:06:38 +00:00
James Zern
e372bfd5ac variance_neon: sync variance*() w/c,sse2
removes some unnecessary casts and adds a few explicit uint32 ones for
larger sizes to quiet -Wshorten-64-to-32 warnings

Change-Id: I63c5fce8e62c426d5cf5c10a66a113c119a43518
2016-09-21 18:04:45 -07:00
James Zern
fcf281b6a1 Merge "vp8: remove VP8_SET_DBG* control support" 2016-09-22 00:43:35 +00:00
Angie Chiang
80338b91d3 Detect invalid highbd iht input
Do nothing in vp9_highbd_iht#x#_##_add_c when input magnitude is beyond
20 bits. Note that, sign bit is not included here.

In the 20 bits, we use 12 bits for input signal, 7 bits for forward
transform amplification, and 1 bit for contingency in rounding and
quantizing

BUG=https://bugs.chromium.org/p/webm/issues/detail?id=1286

Change-Id: I332c6f68df4614fc2e7d2dc4c5bb0d0cff8a245c
2016-09-21 17:15:19 -07:00
Johann
2bed8b6acd Keep vp8 sixtap read within bounds
When filtering it needs 6 pixels: 2 prior to the source, the source, and
3 after the source.

When filtering 16 wide, that means 21. To accomplish this the SSE2 reads
[-2] to [5], [6] to [13], and [14] to [21], a total of 24 bytes (reading
in groups of 8 is easy)

The filter then shifts this last set to the top half of the register and
uses 'or' to combine it with the previous set.

Valgrind detected an issue reading pixels [19], [20] and [21]:
Address 0x7f581c2 is 434 bytes inside a block of size 441 alloc'd

Note: we only need pixels [16], [17], and [18] as context for [15].

To fix this, it now reads 8 bytes starting at [11], which re-loads [11]
through [13], but stops at [18] and does not over-read any values.

This is shifted by 5 and 'or'd with xmm1. Although the lower bits are
not cleared, they overlap directly with [11] through [13], so 'or'
produces the correct results.

Change-Id: I0c89c03afa660fc9b0108ac055d7bd403e493320
2016-09-21 16:17:07 -07:00
Johann
35ebc1cddf predict_test: align dst buffer to 16
On 32 bit machines 'new' does not always appear to allocate sufficiently
aligned buffers, causing intermittent test failures.

Change-Id: I0db4fc73782012e4eef71dc0fb540e74fdbfcebe
2016-09-21 13:35:47 -07:00
James Zern
3f72509587 vp8: remove VP8_SET_DBG* control support
the --enable-postproc-visualizer configure option remains as a no-op as
do the control names and values for compatibility
+ remove the corresponding debug flags from vpxdec: --pp-*

Change-Id: I4a001cd9962b59560d7d6bda6272d4ff32b8d37c
2016-09-20 20:19:36 -07:00
James Zern
cec6433e41 vp9_idct: delete dead TODOs
Change-Id: Icdd5494f557d83026dc078bce37997a76aa288fb
2016-09-20 19:46:27 -07:00
James Zern
b6e686b1ea Merge changes from topic 'Wshorten'
* changes:
  vp8: convert some uses of unsigned long to size_t
  vp8/encoder: quiet some -Wshorten-64-to-32 warnings
2016-09-20 23:17:20 +00:00
James Zern
c31d02615d Merge "variance_avx2: sync variance functions with c-code" 2016-09-20 22:33:39 +00:00
James Zern
2351a73531 Merge "examples: quiet -Wshorten-64-to-32 warnings" 2016-09-20 22:32:58 +00:00
James Zern
feb4313c5f Merge "vp9_rtcd: remove non-existent highbd convolve fns" 2016-09-20 22:07:09 +00:00
Johann Koenig
8478f97105 Merge "Enable ssse3 bilinear tests" 2016-09-20 21:46:50 +00:00
Johann Koenig
18fd69ee91 Merge "Add vp8_bilinear_filter test" 2016-09-20 20:30:48 +00:00
Alex Converse
0d2687ef87 Merge "Code class0 using vpx_read() / vpx_write()." 2016-09-20 19:19:29 +00:00
James Zern
5841929fde vp9_rtcd: remove non-existent highbd convolve fns
these were moved to vpx_dsp

Change-Id: I307b07ae05e2333277d4b7011cba36dcf8409959
2016-09-19 20:01:23 -07:00
James Zern
08b8b6bb8f examples: quiet -Wshorten-64-to-32 warnings
all around usage of strtol/strtoul

Change-Id: If907c89f107a068987aa71ddd93cee9a7389e4cd
2016-09-19 19:02:49 -07:00
James Zern
8281da74b9 vp8: convert some uses of unsigned long to size_t
similar to changes that were done in vp9 for encoded frame size
reporting. has the side-effect of quieting a -Wshorten-64-to-32 warning.

Change-Id: I89f74cb617fc29334ee351dc8dfaa3b8cfd4e5af
2016-09-19 18:35:59 -07:00
James Zern
0ce98b423b vp8/encoder: quiet some -Wshorten-64-to-32 warnings
this code is similar to other existing uses and/or vp9

Change-Id: I56e646931379759d9f7332ea6d746060007c75ee
2016-09-19 18:35:59 -07:00
Linfeng Zhang
761e5ec2f6 Refactor lpf (size 4 and 8) NEON intrinsics optimization
Also check in 8x8 8-bit transpose NEON intrinsics optimization
transpose_u8_8x8()

Change-Id: I32d321cf97ea21eab158ac4896990fc9a51681c4
2016-09-19 16:41:37 -07:00
James Zern
6acd061aad variance_avx2: sync variance functions with c-code
add missing int64 -> uint32 cast; quiets -Wshorten-64-to-32 warnings

Change-Id: I4850b36e18dc8b399108342be4bfe0b684aefb78
2016-09-19 16:19:29 -07:00
Johann Koenig
0695843a21 Merge "Remove -fno-strict-aliasing flag" 2016-09-19 22:49:23 +00:00
Johann
fad70a358b Remove -fno-strict-aliasing flag
The referenced bug was fixed by saving neon registers. That this had any
effect was coincidental.

Both chromium and Android build with clang and neither uses this flag.

Change-Id: I470247d6fd9226fc207b42a187105581a94badc3
2016-09-19 12:16:03 -07:00
Nathan E. Egge
de7f5ce9e5 Code class0 using vpx_read() / vpx_write().
The vp9_mv_class0_tree is a balanced tree with two leafs and can
simply be coded as a boolean with probability class0[0].

Change-Id: If294dac825a5f945371092c74aa8e3f84cd962b6
(cherry picked from commit be8a8ab62ebdd111c6f2e9a33b15630570671eba)
2016-09-19 10:50:39 -07:00
Alex Converse
01e2902521 Zero the whole rd_counts struct rather than the each member
Change-Id: I495aa9cec2b2b8f1ae69bdab8b3feeca76358472
2016-09-19 10:04:47 -07:00
James Zern
aa0eb67bf7 loopfilter_mb_neon: remove unused load_8x8()
quiets a -Wunused-function warning for arm targets

Change-Id: I293a7e3d3d7d61d6af2fbedad5e8c25126c418b6
2016-09-17 11:00:31 -07:00
Linfeng Zhang
5d73639d8f Merge "Refactor lpf (size 16) NEON intrinsics optimization" 2016-09-17 00:33:30 +00:00
James Zern
112eb54c1b Merge "vpx_codec_control: return incapable for unmatched control" 2016-09-16 17:30:44 +00:00
Linfeng Zhang
8107368000 Refactor lpf (size 16) NEON intrinsics optimization
Extract shared code so later lpf size 4 and 8 functions can reuse.

Change-Id: Ibb43ef1fd8651bd2e32fcc4c56cf6fa7ca237401
2016-09-16 09:12:13 -07:00
James Zern
33aef48f29 vpx_subpixel_8t_intrin_avx2: tolerate unversioned clang
assume __clang_major__==0 has the latest version of
_mm256_broadcastsi128_si256. fixes builds with custom clang toolchains.

BUG=b/30970831

Change-Id: I90becd56278e4716bd46e2ba9d910af977e8dfa6
2016-09-16 07:14:17 +00:00
James Zern
7a9e476072 Merge changes from topic 'clang-format'
* changes:
  apply clang-format
  .clang-format: update to 3.8.1
2016-09-16 07:11:33 +00:00
Johann
e813c2b416 Enable ssse3 bilinear tests
The code only has issues when xoffset == 0 and yoffset == 0 which
represents a simple copy. Presumably this case does not need to be
handled because the issue has existed since 2010.

BUG=webm:1287

Change-Id: Ic47e2653f3b729e99b40e53d8d2d8d1501edaaa9
2016-09-15 23:16:26 -07:00
Johann
caf9a7841e Add vp8_bilinear_filter test
Build out the sixtap_predict test because the filters are
interchangeable. Add verbose failures and border checking.

Change-Id: I962f50041750dca6f8d0cd35a943424cf82ddcb1
2016-09-15 23:16:19 -07:00
James Zern
6ae58fd55e Merge "Revert "Restore vp8_sixtap_predict4x4_neon"" 2016-09-16 06:13:42 +00:00
Johann Koenig
7795e99296 Revert "Restore vp8_sixtap_predict4x4_neon"
This reverts commit d9dce2f48eed1368a44c368fa87a506bd89ffec5.

Appears to be failing the SixtapPredict tests in some configurations and possibly test vectors as well.

Change-Id: Ica6aa83ebac47d0a76e451846e7da67b1c17a7d7
2016-09-16 06:12:49 +00:00
Johann Koenig
fdbe249991 Merge "Restore vp8_bilinear_predict4x4_neon" 2016-09-16 05:33:50 +00:00
Johann Koenig
102eae06e9 Merge "zero structures completely" 2016-09-16 04:41:22 +00:00
Johann
43743b1d3e Restore vp8_bilinear_predict4x4_neon
This function was removed when clang started introducing alignment hints
which caused the 32 bit vld1_lane_u32/vst1_lane_u32 to fail:
https://llvm.org/bugs/show_bug.cgi?id=24421

The load has been rendered safe with an implementation ~indiscernible
performance-wise that uses _u8 and over-reads just a touch.

It is still ~5x faster than C in the unaligned case and doing both
filters.

BUG=webm:892
BUG=webm:1273

Change-Id: Icf7167189391b46202f47233bb585c24c42bcc36
2016-09-15 21:16:11 -07:00
Johann Koenig
7bc0733c27 Merge "Restore vp8_sixtap_predict4x4_neon" 2016-09-16 04:12:08 +00:00
Johann
d5054504a7 zero structures completely
Use vp[89]_zero when possible.

Expand the {} set when neither is available or nearby.

Change-Id: Ifc1f46f60100916cd798bf7be3a10f09321c99bd
2016-09-16 03:54:11 +00:00
Johann
1d2aaf58dd vp8 postproc: expand CONFIG_POSTPROC guard
postproc.c is overloaded and used for both postproc and internal stats.
If only --enable-internal-stats is specified there are issues with
non-existent struct members and unused functions.

Change-Id: I82367f1ffce659c3918c9f964dbce94a716fbb89
2016-09-16 03:52:19 +00:00
Johann
f2be831885 altref test: comment out 'pass'
All the other test which do not use 'pass' (which appears to be almost
all of them) do this.

Cleans -Wextra/-Wunused-parameter:
unused parameter ‘pass’

Change-Id: I1ff3acf3f3d1e831f94dcb00ea36337afe0aefe0
2016-09-15 17:45:47 -07:00
Johann Koenig
c53aacf408 Merge "vp9 frame parallel test: Initialize cfg differently" 2016-09-15 23:46:56 +00:00
Marco
4c1a9fb8db vp9: Small code cleanup.
Remove the experiment LIMIT_QP_ONEPASS_VBR_LAG, as its
not currently used and no plan to use in near future.

Change-Id: Ib069f8d7225195be04b765d0ab477510dfba6a3b
2016-09-15 15:17:17 -07:00
clang-format
5f6d143b41 apply clang-format
Change-Id: I501597b7c1e0f0c7ae2aea3ee8073f0a641b3487
2016-09-15 15:07:53 -07:00
James Zern
30b1abd6e6 .clang-format: update to 3.8.1
based on --style=Google with the following differences:
3a4
> # Generated with clang-format 3.8.1
13c14
< AllowShortCaseLabelsOnASingleLine: false
---
> AllowShortCaseLabelsOnASingleLine: true
41c42
< ConstructorInitializerAllOnOneLineOrOnePerLine: true
---
> ConstructorInitializerAllOnOneLineOrOnePerLine: false
44,45c45,46
< Cpp11BracedListStyle: true
< DerivePointerAlignment: true
---
> Cpp11BracedListStyle: false
> DerivePointerAlignment: false
73c74
< PointerAlignment: Left
---
> PointerAlignment: Right
75c76
< SortIncludes:    true
---
> SortIncludes:    false

SortIncludes will like be enabled in a future commit

Change-Id: I5c404f44081b65354e7f526411c91fbbe31ac5af
2016-09-15 15:05:52 -07:00
Johann
d9dce2f48e Restore vp8_sixtap_predict4x4_neon
This function was removed when clang started introducing alignment hints
which caused the 32 bit vld1_lane_u32/vst1_lane_u32 to fail:
https://llvm.org/bugs/show_bug.cgi?id=24421

The load has been rendered safe with an implementation ~indiscernible
performance-wise that uses _u8 and over-reads just a touch.

The store, when unaligned, has a version that is ~25% slower but safe
when xoffset = 0 (second pass filter only). When the first pass filter
(or both) are in play, the new version is almost identical in speed.

Worst case performance (both filters, unaligned stores) is roughly 3-4x
faster than C.

BUG=webm:817
BUG=webm:1273

Change-Id: I1e490e94453e0872151fe0dafb05557463f6247d
2016-09-15 14:56:47 -07:00
Johann
284cb5314e vp9 frame parallel test: Initialize cfg differently
Use the canonical 'vpx_codec_dec_cfg_t()' as opposed to 'vp9_zero()'
which just hammered everything to 0.

Change-Id: Id820efef700ad92a625797f8fd58e465b15eeca4
2016-09-15 12:19:25 -07:00
Johann Koenig
ee01b78ddd Merge "Documentation for building unit tests for Android" 2016-09-15 19:17:14 +00:00
Johann
a3400f4376 Documentation for building unit tests for Android
BUG=webm:1258

Change-Id: Iea142f7b0df0e047720e8c5362464932de57d564
2016-09-15 19:16:14 +00:00
James Zern
4282d29355 Merge "cosmetics,vp8: join some lines, fix table format" 2016-09-14 00:41:51 +00:00
Johann
4c6819d0fc vp8 decoder: cast decoding_thread_count to int
For some reason allocated_decoding_thread_count is signed, but decoding_thread_count is not.

Cleans -Wextra/-Wsign-compare:
comparison between signed and unsigned integer expressions

Change-Id: Id0ada78100acff27c1c4ed7493c563d13c55cdcd
2016-09-13 14:51:14 -07:00
Johann
75fe2d4409 vp9 frame parallel test: Initialize cfg to 0
Use vp9_zero() to set every element.

Cleans -Wextra/-Wmissing-field-initializers:
missing initializer for member ‘vpx_codec_dec_cfg::w’
missing initializer for member ‘vpx_codec_dec_cfg::h’

Change-Id: I5b41ce7d55a912e29b1d4c3e840cea80e8510fbe
2016-09-13 14:51:14 -07:00
Johann
db32581650 vp9cx_set_ref.c: remove unused 'cfg' parameter
Cleans -Wextra/-Wunused-parameter warning:
warning: unused parameter ‘cfg’

Change-Id: I84eae57a50306cb66c625bb648b0a330678818db
2016-09-13 14:51:06 -07:00
Johann
bce23ab36b webmenc: remove unused 'fps' parameter
Cleans -Wextra/-Wunused-parameter warning:
warning: unused parameter ‘fps’

Change-Id: Ia5f9338f11ae8d0708a87c6d4e7d7e924fc3b19b
2016-09-13 14:25:40 -07:00
James Zern
6eca31be5f vpx_codec_control: return incapable for unmatched control
VPX_CODEC_INCAPABLE rather than the more generic VPX_CODEC_ERROR

Change-Id: Id1ed7fb23a2910192713c6b2389c0b7320201f52
2016-09-09 17:40:10 -07:00
James Zern
a22a455899 cosmetics,vp8: join some lines, fix table format
Change-Id: Idcf3b68f0e59bd74c9d332bbd4a7c1484ddb691a
2016-09-09 16:39:34 -07:00
Marco
421f376568 vp8: Set the skin model to mode 1.
This change was reverted before due to a hangouts encode-time
regression investigation. But since then this change has been
cleared of causing any noticeable regression.

This mode reduces some false detection, and uses the
same model as in vp9.

Change-Id: I9c82a748c5f601d0aca9f61ee218abfbd58c62bd
2016-09-09 09:09:43 -07:00
James Zern
66241b9579 Merge "vp8: Remove TSAN warning around end of encode." 2016-09-09 03:08:18 +00:00
Alexander Potapenko
948a1f51d0 vp8: Remove TSAN warning around end of encode.
Tsan warns when run in one pass and there is a recode
loop.

Change-Id: Ice2ecb2270f09ebd49efbd49c0e4f77d32e23c0f
2016-09-08 14:36:32 +02:00
James Zern
4b0e78bfda Merge "vpx_dsp: added vpx_highbd_idct32x32_1_add_sse2()" 2016-09-08 01:05:18 +00:00
James Zern
bcbc4761fa vpx_mem.c: remove unnecessary inline
these aren't overly speed critical, best to leave it to the compiler.

Change-Id: I231c14abee5b845d7b8e8454832f2feb22c6ce45
2016-09-07 12:49:21 -07:00
Scott LaVarnway
309125b1e7 vpx_dsp: added vpx_highbd_idct32x32_1_add_sse2()
Change-Id: I140d93aebadb0eaf6220881e61a0451450081227
2016-09-07 05:58:29 -07:00
Sarah Parker
c892521b1d Fix missing write to opsnr in internal stats
Change-Id: I21c8ad0b5ed7f8d843cae45c18f5727bceb8f859
2016-09-03 12:15:32 -07:00
James Zern
4a25b59bbd Merge "invalid_file_test: quiet -Wunused-const-variable warnings" 2016-09-03 01:14:55 +00:00
James Zern
e6f0c26268 invalid_file_test: quiet -Wunused-const-variable warnings
present when --disable-vp8(-decoder) or --disable-vp9(-decoder) was used

Change-Id: I31ebb7a55c6f1af3c744982f56b78e80116cc845
2016-09-01 19:54:34 -07:00
James Zern
3d253b0c71 vp8_cx_iface: quiet -Wshorten-64-to-32 warning
set_reference_and_update(): use the correct type for flags,
vpx_enc_frame_flags_t

Change-Id: I257da784537ff18686f6db8665f99af6ea6a86ba
2016-09-01 19:54:00 -07:00
James Zern
d6d3d4ba31 get_cpu_count: quiet -Wshorten-64-to-32 warnings
sysconf returns a long; cast (unsigned) dwNumberOfProcessors to int for
good measure

Change-Id: I1f181d7bd9a060c0898db41f66a5065394afdc4e
2016-09-01 19:54:00 -07:00
Johann Koenig
4d1540f8ce Merge changes from topic 'Wundef'
* changes:
  Enable -Wundef by default
  Define VP8_TEMPORAL_ALT_REF to !CONFIG_REALTIME_ONLY
  Remove CONFIG_DEBUG guards from assert()
  Remove unused function vpx_de_mblock
  Fix -Wundef warning for OUTPUT_FPF
  Fix -Wundef warning for __SANITIZE_ADDRESS__
2016-09-02 01:39:18 +00:00
Yaowu Xu
594e53514b Merge "Fix formatting in internal stats for vp8 and vp9" 2016-09-01 23:55:23 +00:00
Yaowu Xu
454139ae13 Merge "Casts to remove some warnings." 2016-09-01 23:37:04 +00:00
Debargha Mukherjee
a6bc3dfb0f Merge "Refactor uv tx size with lookup arrays" 2016-09-01 16:46:32 +00:00
Paul Wilkins
009116cb6f Merge "Modified resize loop constraints." 2016-09-01 15:59:30 +00:00
paulwilkins
3e9e77008c Casts to remove some warnings.
Added casts to remove warnings:
BUG=webm:1274

In regards to the safety of these casts they are of two types:-

- Normalized bits per (16x16) MB stored in a 32 bit int (This is safe as bits
per MB even with << 9 normalization cant overflow 32 bits. Even raw 12
bits hdr source even would only be  29 bits :- (4+4+12+9) and the encoder
imposes much stricter limits than this on max bit rate.

- Cast as part of variance calculations.  There is an internal cast up to 64 bit
for the Sum X Sum calculation, but after normalization dividing by the number
of points the result will always be <= the SSE value.

Change-Id: I4e700236ed83d6b2b1955e92e84c3b1978b9eaa0
2016-09-01 16:10:12 +01:00
Johann
4d1c117f5b Enable -Wundef by default
BUG=webm:1069

Change-Id: I43728f9fd007542718a55d5fdcbc63a8d2f86682
2016-08-31 23:01:57 -07:00
Johann
1139f0dbc2 Define VP8_TEMPORAL_ALT_REF to !CONFIG_REALTIME_ONLY
Previously VP8_TEMPORAL_ALT_REF was only defined for non-realtime-only
builds. However, its value was checked with #if, not #ifdef.

Fixes -Wundef warnings.

BUG=webm:1069

Change-Id: If78d8731298f3f0d3662ffa25f973e7adaf67152
2016-08-31 23:01:57 -07:00
Johann
18b6691105 Remove CONFIG_DEBUG guards from assert()
When 'NDEBUG' is set, assert() generates no code.

Change-Id: Icf61cfc1a8f6e5f0770b3626d8c73ae968df1108
2016-08-31 23:01:57 -07:00
Johann
24f534ac90 Remove unused function vpx_de_mblock
vpx_config.h was not included so CONFIG_POSTPROC was never defined.

Change-Id: I777de499823afa286734549a8e7f4a93e7ad97f3
2016-08-31 23:01:45 -07:00
Johann
7b3c2e3269 Fix -Wundef warning for OUTPUT_FPF
BUG=webm:1069

Change-Id: I3d13d07cf0934e6e262c8033bd77d7197d03ce21
2016-08-31 22:59:59 -07:00
Johann
42ccd79b27 Fix -Wundef warning for __SANITIZE_ADDRESS__
BUG=webm:1069

Change-Id: Iad8811939a910a8f31cf5788220712a255ddf36a
2016-08-31 22:59:53 -07:00
Linfeng Zhang
113f9721d1 Merge "Rename test/lpf_8_test.cc to test/lpf_test.cc" 2016-08-31 22:46:07 +00:00
Linfeng Zhang
5399613889 Rename test/lpf_8_test.cc to test/lpf_test.cc
It actually tests all sizes lpf functions.

Change-Id: Ie31798f90165e6e0c13cbac0e0ab9648ab568bce
2016-08-31 15:16:48 -07:00
Linfeng Zhang
bee7d837ab Update NEON transpose functions.
Unify coding style.

Change-Id: I5826f40c02c882df7353391e0c9dd6cef6bd4b97
2016-08-31 14:58:40 -07:00
Debargha Mukherjee
e6446b4b60 Refactor uv tx size with lookup arrays
Change-Id: Ife6a3d301c5faaba89d16d188d638631083511f7
2016-08-31 13:15:38 -07:00
Linfeng Zhang
3dfba04dec Merge "Update vpx_lpf_vertical_16_dual_neon() intrinsics" 2016-08-31 19:41:25 +00:00
paulwilkins
6fc07a217d Modified resize loop constraints.
Using a tighter resize constraint on undershoot seems to help
results (especially SSIM) as significant undershoot on a frame
seems to have more of a damaging impact than overshoot.

This patch has been tuned so that in local testing using the
derf set it is encode speed neutral for speed  setting 2.

Average quality result for speed 2 (psnr,ssim) were  as follows:-

 lowres  0.039,  0.453
 midres  0.249, 0.853
 hdres  0.159, 0.659
 NetFlix -0.241, 0.360

Change-Id: Ie8d3a0d7d6f7ea89d9965d1821be17f8bda85062
2016-08-31 12:45:49 +01:00
Jim Bankoski
66b2266a22 libyuv: update to de944ed8c74909ea6fbd743a22efe1e55e851b83
Fixes windows build issue:
==> tests::VS10_x64 is broken
         LINK : warning C4742: 'kYvuI601Constants' has different alignment in 'third_party\libyuv\source\row_common.cc' and 'third_party\libyuv\source\planar_functions.cc': 32 and 2 [.build-x86_64-win64-vs10\vpxdec.vcxproj]
         LINK : warning C4744: 'kYvuI601Constants' has different type in 'third_party\libyuv\source\row_common.cc' and 'third_party\libyuv\source\planar_functions.cc': '__declspec(align(32)) struct (224 bytes)' and 'struct (224 bytes)' [.build-x86_64-win64-vs10\vpxdec.vcxproj]
         LINK : warning C4742: 'kYuvI601Constants' has different alignment in 'third_party\libyuv\source\row_common.cc' and 'third_party\libyuv\source\planar_functions.cc': 32 and 2 [.build-x86_64-win64-vs10\vpxdec.vcxproj]
         LINK : warning C4744: 'kYuvI601Constants' has different type in 'third_party\libyuv\source\row_common.cc' and 'third_party\libyuv\source\planar_functions.cc': '__declspec(align(32)) struct (224 bytes)' and 'struct (224 bytes)' [.build-x86_64-win64-vs10\vpxdec.vcxproj]
         LINK : warning C4742: 'kYvuI601Constants' has different alignment in 'third_party\libyuv\source\row_common.cc' and 'third_party\libyuv\source\planar_functions.cc': 32 and 2 [.build-x86_64-win64-vs10\vpxenc.vcxproj]
         LINK : warning C4744: 'kYvuI601Constants' has different type in 'third_party\libyuv\source\row_common.cc' and 'third_party\libyuv\source\planar_functions.cc': '__declspec(align(32)) struct (224 bytes)' and 'struct (224 bytes)' [.build-x86_64-win64-vs10\vpxenc.vcxproj]
         LINK : warning C4742: 'kYuvI601Constants' has different alignment in 'third_party\libyuv\source\row_common.cc' and 'third_party\libyuv\source\planar_functions.cc': 32 and 2 [.build-x86_64-win64-vs10\vpxenc.vcxproj]
         LINK : warning C4744: 'kYuvI601Constants' has different type in 'third_party\libyuv\source\row_common.cc' and 'third_party\libyuv\source\planar_functions.cc': '__declspec(align(32)) struct (224 bytes)' and 'struct (224 bytes)' [.build-x86_64-win64-vs10\vpxenc.vcxproj]
         LINK : error C2220: warning treated as error - no 'executable' file generated [.build-x86_64-win64-vs10\vpxdec.vcxproj]
         LINK : error C2220: warning treated as error - no 'executable' file generated [.build-x86_64-win64-vs10\vpxenc.vcxproj]

Change-Id: Ic3c4fff9209f5a52ff8f8ff321548d49ba09ec06
2016-08-30 14:24:35 -07:00
Linfeng Zhang
f7cbfed682 Update vpx_lpf_vertical_16_dual_neon() intrinsics
Process 16 samples together.

Change-Id: If6ee8e3377aa2786417f2fc411ba7d87ea8b6799
2016-08-30 11:17:33 -07:00
Paul Wilkins
129814fcb4 Merge "Adjust coefficient optimization and tx_domain rd speed features." 2016-08-30 16:54:40 +00:00
Linfeng Zhang
3a3169be59 Merge "Update vpx_lpf_horizontal_edge_16_neon() intrinsics" 2016-08-29 21:37:07 +00:00
Marco Paniconi
e66cd132f0 Merge "vp8: Move loopfilter synchronization to end of encode_frame call." 2016-08-29 05:52:40 +00:00
Linfeng Zhang
4916515511 Update vpx_lpf_horizontal_edge_16_neon() intrinsics
Process 16 samples together.

Change-Id: I9cfbe04c9d25d8b89f63f48f519e812746db754d
2016-08-27 14:47:48 -07:00
James Zern
3a98508775 Merge "vpx_mem,align_addr: use ~ to create mask" 2016-08-27 21:27:45 +00:00
James Zern
19d881290d vpx_mem,align_addr: use ~ to create mask
removes the need for an intermediate cast to int, which was missing in
the call added in:
69c5ba1 vpx_mem: Refactor code

quiets a visual studio warning:
C4146: unary minus operator applied to unsigned type, result still
unsigned

Change-Id: I76c4003416759c6c76b78f74de7c0d2ba5071216
2016-08-27 11:39:18 -07:00
James Zern
2917737879 vp9_alt_ref_aq_set_nsegments: harmonize fn signature
Change-Id: I5f232664652a8dc3a71e43b8b1fa05ddb4a84ecc
2016-08-27 11:16:03 -07:00
Yury Gitman
507d272265 Move vp9_alt_ref_aq_private.h to vp9_alt_ref_aq.c
+ add a temporary dummy element to ALT_REF_AQ to avoid a warning about
an empty struct

Change-Id: Ib6e5c39ff62ad96eb4e3686d4882228a42b3843f
2016-08-27 10:53:41 -07:00
James Zern
a19b9b6185 Merge changes Ia81004d6,I74b80fb6,I38fcb62b,I2da9cd5d
* changes:
  vpx_mem: add basic size check
  vpx_mem: normalize function names
  vpx_realloc correction.
  vpx_mem: Refactor code
2016-08-26 23:52:04 +00:00
James Zern
ed11abbc36 Merge changes I353da4a2,I423f2153
* changes:
  vp8_decoder_create_threads: check sem/pthread returns
  vp8_create_decoder_instances: add missing setjmp
2016-08-26 23:48:08 +00:00
Johann Koenig
a70861c435 Merge "Remove halfpix specialization" 2016-08-26 21:28:01 +00:00
James Zern
58a497dc29 Merge "add_noise,vpx_setup_noise: correct 'char_dist' type" 2016-08-26 18:47:39 +00:00
James Bankoski
fcc4f3fa21 Merge "libyuv: update to c244a3e9" 2016-08-26 18:06:06 +00:00
Jingning Han
dd2a475e43 Merge "Fix VS build warnings in vp9_alt_ref_aq files" 2016-08-26 17:19:12 +00:00
Paul Wilkins
badd32d914 Merge "Add ALLOW_RECODE_FIRST speed mode." 2016-08-26 15:46:45 +00:00
Jingning Han
84fccfe475 Fix VS build warnings in vp9_alt_ref_aq files
Change-Id: I5b19ec00a1eb8b148026f665d217c12eb50b614a
2016-08-26 08:43:36 -07:00
paulwilkins
dc42f343ae Add ALLOW_RECODE_FIRST speed mode.
This patch is to address concerns that changes to allow
recodes on the first frame in each ARF group do not give a
good enough speed quality trade off for speed 2. Though the
average impact  on encode speed is 1-2%, for some hard clips
it is > 5% rise.  For speed 1 this is less an issue and for Speed 0
the previous patch actually  improves speed.

Change-Id: Ie1bcefdbfdf846d3f4428590173f621465dffe3a
2016-08-26 11:43:47 +01:00
James Zern
a91fe33c6d Merge "vp8: fix decoder crash with invalid leading keyframes" 2016-08-26 07:01:42 +00:00
Sarah Parker
37e83789f1 Fix formatting in internal stats for vp8 and vp9
This corrects a formatting error introduced in:
I1e9d548ce445d29002f0c59ebfd3957a6f15e702
where spaces were used as delimiters instead of tabs.

The corresponding fix for vp10 is in
Ica3d625d6672b3c47e0e208b45eede29b9004030.

Change-Id: Ibc4eb8fd82e6b926ba259a679dc98557cadba9b1
2016-08-25 17:46:18 -07:00
Marco
b6a5f6f740 vp8: Move loopfilter synchronization to end of encode_frame call.
Allow loopfilter to continue until encode_frame is completed.

Change-Id: I7bbccc3d409e263aab6a6ff24588d8b2a964a96e
2016-08-25 12:37:30 -07:00
Yury Gitman
292d221fed Create interface for the ALT_REF_AQ class
Current commit is just an API template  for the rest of the code, and
I will add inner logic later.

Altref  frames  generate a  lot  of  bitrate  and  at the  same  time
other  frames  refer to  them  a  lot, so  it  makes  sense to  apply
special  compensation-based adaptive  quantization scheme  for altref
frames. E.g.,  for blocks  that are  good predictors  for the  future
apply rate-control  chosen quantizer  while for bad  predictors apply
worse one.

Change-Id: Iba3f8ec349470673b7249f6a125f6859336a47c8
2016-08-25 10:55:14 -07:00
Yury Gitman
c018032579 Merge "Add --alt-ref-aq=<int> option" 2016-08-25 17:49:41 +00:00
paulwilkins
635ae8bdc1 Adjust coefficient optimization and tx_domain rd speed features.
Previously Tx domain rd was used in all cases above speed 0.
Coefficient optimization was only enabled for best and speed 0.

This patch selectively sets these features at other speed settings
based on block complexity.

For the Netflix and HD sets in particular the quality gains are
large compared to the speed hit. At speed 1 the average psnr
gain in the NF set  is > 2.5% with one clip coming in at 18%
and some points almost 30%.  Average gains for the lower
resolution test sets are around 1%.

The gains are biggest at low Q so some further optimization
may be possible.

Change-Id: I340376c7b2a78e5389a34b7ebdc41072808d0576
2016-08-25 15:36:16 +01:00
Jim Bankoski
6d7a9f3e9c libyuv: update to c244a3e9
Fixes color issue when scaling without breaking mingw.

BUG=https://bugs.chromium.org/p/libyuv/issues/detail?id=605
BUG=https://bugs.chromium.org/p/webm/issues/detail?id=1252

Change-Id: I09437d93fd65964ad57113274d8c819f3eaf2e57
2016-08-25 06:39:38 -07:00
James Zern
3ddff4503a add_noise,vpx_setup_noise: correct 'char_dist' type
fixes SSE2/AddNoiseTest.CheckCvsAssembly/0 with -funsigned-char.
visibly broken since:
0dc69c7 postproc : fix function parameters for noise functions.
where the types diverged (char vs. int8)
but likely the return changed in:
2ca24b0 postproc - move filling of noise buffer to vpx_dsp.
when multiple implementations were merged.

Change-Id: I176ca1f170217f05ba7872b0c4de63e41949e999
2016-08-24 21:46:26 -07:00
Marco Paniconi
ce634bbf4d Merge "Add datarate tests for encoder multi-threads (vp8 and vp9)." 2016-08-25 03:13:36 +00:00
James Zern
4699aca87f vpx_mem: add basic size check
set a max allocable size to prevent overflows in 32-bit and extremely
large allocation attempts in 64-bit. this could be amended to allow size
or num parameters to be 64-bits with the correct size being used at each
call site.

BUG=webm:819

Change-Id: Ia81004d6c4279680714c4488b4f6cf287ab396a5
2016-08-24 19:22:57 -07:00
James Zern
963291217f vpx_mem: normalize function names
use lower case + '_' rather than capital followed by camel case

Change-Id: I74b80fb660d281228e25edc8b6509455ffe2920e
2016-08-24 19:22:56 -07:00
Urvang Joshi
28c6207bcd vpx_realloc correction.
vpx_realloc was allocating 1 byte more than needed every time.
Fixed this, and took this opportunity to do a small refactoring.

Change-Id: I38fcb62b698894acbbab43466c1decd12f906789
(cherry picked from aom: 2a876b4 aom_realloc correction.)
2016-08-24 19:22:52 -07:00
Urvang Joshi
69c5ba1910 vpx_mem: Refactor code
Change-Id: I2da9cd5da48ae97e770bccfd1233bcc70b484688
(cherry picked from aom: 83c95f5 aom_mem: Refactor code)
2016-08-24 19:22:41 -07:00
Marco
dde8004716 Add datarate tests for encoder multi-threads (vp8 and vp9).
Change-Id: I7f9b23026aaee309095cc3f4724125ae319875af
2016-08-24 16:25:36 -07:00
Yury Gitman
d7c20079a6 Add --alt-ref-aq=<int> option
In the future this option will activate adaptive quantization special
for altref frames. Encoder will  create the adaptive quantization map
on the basis of lookahead buffers similarity which is the estimate of
the future motion compensation performance.

Change-Id: Ia0088b3babb0f9a4899c79d8d819947ba5a03df2
2016-08-24 15:49:25 -07:00
Jacky Chen
5260a6675e Merge "vp9: Refactor set_low_temp_var_flag." 2016-08-24 22:02:53 +00:00
James Zern
a6efe6d437 vp8_decoder_create_threads: check sem/pthread returns
Change-Id: I353da4a2f988ca51d48d0ca91236e8cc0bb48ff5
2016-08-23 19:19:57 -07:00
James Zern
13338a481f vp8_create_decoder_instances: add missing setjmp
vp8_decoder_create_threads() has allocations that expect one is set.

Change-Id: I423f2153a2969c88d48ba45cc9ead4a01443ce65
2016-08-23 18:29:42 -07:00
Johann
d393885af1 Remove halfpix specialization
This function only exists as a shortcut to subpixel variance with
predefined offsets. xoffset = 4 for horizontal, yoffset = 4 for vertical
and both for "hv"

Removing this allows the existing optimizations for the variance
functions to be called. Instead of having only sse2 optimizations, this
gives sse2, ssse3, msa and neon.

BUG=webm:1273

Change-Id: Ieb407b423b91b87d33c4263c6a1ad5e673b0efd6
2016-08-23 17:05:39 -07:00
James Zern
0f42d1fa85 vp8: fix decoder crash with invalid leading keyframes
decoding the same invalid keyframe twice would result in a crash as the
second time through the decoder would be assumed to have been
initialized as there was no resolution change. in this case the
resolution was itself invalid (0x6), but vp8_peek_si() was only failing
in the case of 0x0.
invalid-vp80-00-comprehensive-018.ivf.2kf_0x6.ivf tests this case by
duplicating the first keyframe and additionally adds a valid one to
ensure decoding can resume without error.

BUG=b/30593765

Change-Id: If0859035908b7870d67a7f3f646b5a080252eb6d
2016-08-23 16:27:52 -07:00
Yury Gitman
c325fb748a Correct CHECK_MEM_ERROR macro (release builds)
The previous macro doesn't work with &cpi->common as a first argument

Change-Id: Iddf7a1f5d56d7abafd9b2b8707aa611d349e7a68
2016-08-23 22:46:04 +00:00
jackychen
8d4c0ec1f1 vp9: Refactor set_low_temp_var_flag.
No need to pass in force_split, since we should use sb_type in the
condition.

Change-Id: Ide27243ef46e017bbb98d676347fc566a6c828f7
2016-08-23 15:11:40 -07:00
Yunqing Wang
f6c5410cd4 Merge "Disable split mode in 4k video encoding" 2016-08-23 15:35:33 +00:00
Yunqing Wang
ef98f49cb0 Disable split mode in 4k video encoding
Disabled the split mode while encoding 4k video to speed
up the encoder.

Borg test result on 4k set:
Overall PSNR: +0.029%; SSIM: +0.009%.
Average encoder speedup at speed 2 is 2.5%.

Change-Id: I1519c658f07c3ac838affbe5aff0ed9b94f3f8f4
2016-08-22 19:46:44 -07:00
Yury Gitman
bf7a02a4cf Correct CHECK_MEM_ERROR macro
The previous macro doesn't work with &cpi->common as a first argument

Change-Id: Ic3f5c49a94cf8b17de6569811b957c963341bb58
2016-08-22 14:25:57 -07:00
Marco Paniconi
f5bd76f5c1 Merge "Revert "vp8: Move loopfilter synchronization to end of encode_frame call."" 2016-08-22 15:46:57 +00:00
Marco Paniconi
de075a95e0 Revert "vp8: Move loopfilter synchronization to end of encode_frame call."
This reverts commit c2fe9acceda922ca1d9f0d6185b340560b93597a.

This change break linux browser test in chromium:
https://build.chromium.org/p/chromium.webrtc/builders/Linux%20Tester

Change-Id: I226782fad480c17a99ec6c785ad93cf4ab88f0ae
2016-08-22 15:46:20 +00:00
Yunqing Wang
37169c0bd4 Merge "Adjust speed features for 4k video encoding" 2016-08-19 23:11:05 +00:00
Yunqing Wang
fe488cceff Adjust speed features for 4k video encoding
Adjusted speed 2 features to speed up 4k video encoding.
BDBR results from borg test:
PSNR: +0.313%; SSIM: +0.268%.
Average speedup: 8.5%

Change-Id: I1e2695a01fb3f3817c1df4480e184c2aed8f2eba
2016-08-19 09:30:32 -07:00
James Zern
149d082377 vp9_pickmode: quiet float conversion warnings
Change-Id: I591e4f958955b3f2edb2f95a83c54cd83c8ef075
2016-08-19 01:28:01 -07:00
James Zern
8b4c31584e vp9_alloc_context_buffers: clear cm->mi* on failure
this fixes a crash in vp9_dec_setup_mi() via
vp9_init_context_buffers() should decoding continue and the decoder
resyncs on a smaller frame

BUG=b/30593752

Change-Id: I9ce8d94abe89bcd058697e8bd8599690e61bd380
2016-08-19 00:18:11 -07:00
Jacky Chen
52db2b1690 Merge "vp9 svc: SVC encoder speed up." 2016-08-18 21:21:29 +00:00
Johann Koenig
33dedd0628 Merge "Remove '-chromium' flag from ads2gas_apple.pl" 2016-08-18 19:54:55 +00:00
JackyChen
8be7e572a7 vp9 svc: SVC encoder speed up.
Bias towards base_mv and skip 1/4 pixel motion search when using base mv.
2~3% speed up for 2 spatial layers, 3~5% speed up for 3 spatial layers.
PSNR loss:
(2 layers) 0.07dB for gips_stationary, 0.04dB for gips_motion;
(3 layers) 0.07dB for gips_stationary, 0.06dB for gips_motion.

Change-Id: I773acbda080c301cabe8cd259f842bcc5b8bc999
2016-08-18 11:25:45 -07:00
Marco Paniconi
1c07abca18 Merge "vp9 non-rd pickmode: Add limit on newmv-last and golden bias." 2016-08-18 18:03:48 +00:00
Marco Paniconi
37a39ac138 Merge "vp8: Move loopfilter synchronization to end of encode_frame call." 2016-08-18 02:46:31 +00:00
Marco
7eb7d6b227 vp9 non-rd pickmode: Add limit on newmv-last and golden bias.
Add option, for newmv-last, to limit the rd-threshold update for early exit,
under a source varianace condition.
This can improve visual quality in low texture moving areas,
like forehead/faces.

Also add bias against golden to improve the speed/fps,
will little/negligible loss in quality.

Only affects CBR mode, non-svc, non-screen-content.

Change-Id: I3a5229eee860c71499a6fd464c450b167b07534d
2016-08-17 14:33:44 -07:00
Johann
1b982cc64f Remove '-chromium' flag from ads2gas_apple.pl
The flag was added because Apple clang and Chromium clang disagreed
for certain versions of instructions.

qsubaddx, qaddsubx, ldrneb and ldrneh were used in armv6 assembly
which was removed in d55724fae9cb27e070add7952394fc0427ef2061

vqshrun was used in some neon assembly but superseded by
dcbfacbb984cdcd5b5a5030103305fa3669dfece

.include was used for obj_int_extract/asm_offsets and removed in
6eec73a747f3d14d327cdc33279de96d0deb48c8

Change-Id: I32f4c9b536d0318482101c0b8e91e42b8f545f18
2016-08-17 14:05:16 -07:00
paulwilkins
af3b0de732 Add casting to fix warning.
Frame bits can safely be stored int but group bits
(kf or arf) use 64bit.

Change-Id: I0800f2a28070f8749110a95721c116fc56987885
2016-08-17 11:18:07 +01:00
paulwilkins
ab7cd6d068 Add {} to try and keep Jenkins happy.
Change-Id: If1ca3cf83e058317c9751d7da6caa7cd75eb6845
2016-08-17 11:17:36 +01:00
Marco
c2fe9acced vp8: Move loopfilter synchronization to end of encode_frame call.
Change-Id: I5bdfea7f51df1f1fa5d9c1597e96988acce6c2f2
2016-08-16 11:22:23 -07:00
Linfeng Zhang
f9efbad392 NEON asm of vpx_lpf_{horizontal,vertical}_8_dual_neon()
Also expose the NEON intrinsics version.

BUG=webm:1261, webm:1266.

Change-Id: I8c4ae658467dcf66ebf7a75982b2ef712dbb4535
2016-08-16 08:50:57 -07:00
paulwilkins
5d881770e5 Change default recode rule for good speed 0 and best.
Changes the default recode rule for Speed 0 and best quality
from ALLOW_RECODE to ALLOW_RECODE_KFARFGF.

Tested on the NF, hdres, midres and lowres test sets, this setting
when combined with patch I40cb559... now performs "as well" in
metrics terms (in fact it came out a tiny amount better overall)
but encode time is 9.6%  faster (measured as the average
from 27 mid rate local encodes on clips in the derf/lowres set.

Change-Id: I8c781c0cdfa3a9929cd9406d15582fce47d6ae3b
2016-08-15 10:52:54 +01:00
paulwilkins
de3b769524 Change to recode rules.
Allow recodes for the first inter frame in each arf group
even when the recode rule is set to ALLOW_RECODE_KFARFGF.

Small gains of 0.05%.

Change-Id: I40cb559d36a2bf0ebf5cf758c3f92e452b480577
2016-08-15 10:52:02 +01:00
Paul Wilkins
fe4dd4f43f Merge "Modified ARF group allocation." 2016-08-15 09:42:30 +00:00
Yunqing Wang
fafec95702 Merge "Fix another motion vector out of range bug" 2016-08-12 23:52:14 +00:00
James Zern
dfcefe06fa Merge "variance_impl_avx2: restore table layout" 2016-08-12 23:02:27 +00:00
James Zern
bd7cfb46fb variance_impl_avx2: restore table layout
disable clang-format for bilinear_filters_avx2

restores the row layout prior to:
099bd7f vpx_dsp: apply clang-format
but keeps the justification used by clang-format

Change-Id: Icf1733a37edb807e74c26b23a93963c03bd08fd7
2016-08-12 11:52:53 -07:00
Linfeng Zhang
f09b5a3328 NEON intrinsics for 4 loopfilter functions
New NEON intrinsics functions:
vpx_lpf_horizontal_edge_8_neon()
vpx_lpf_horizontal_edge_16_neon()
vpx_lpf_vertical_16_neon()
vpx_lpf_vertical_16_dual_neon()

BUG=webm:1262, webm:1263, webm:1264, webm:1265.

Change-Id: I7a2aff2a358b22277429329adec606e08efbc8cb
2016-08-12 09:58:17 -07:00
Yunqing Wang
a413dbe594 Fix another motion vector out of range bug
This patch fixed a motion vector out of range bug:
vpxenc: ../libvpx/vp9/encoder/vp9_mcomp.c:69:
 mv_cost: Assertion `mv->col >= -((1 << (11 + 1 + 2)) - 1) &&
 mv->col < ((1 << (11 + 1 + 2)) - 1)' failed.

For blocks that returned without having full-pixel search, the original
MV limits were not restored, which caused the failure. Moved the set
MV limit function down to fix the bug.

Change-Id: Id7d798fc7214e95c6e4846c588f0233fcf1a4223
2016-08-12 09:27:58 -07:00
Marco
f1e12c1bf3 vp8: Fix denoiser setting in multi-res sample encoder.
Change-Id: I9222f3b252e5ed883659f1a14cd705944ee9da07
2016-08-10 16:22:08 -07:00
paulwilkins
656f4a88cf Modified ARF group allocation.
Small average gains in the range 0.05 - 0.1

Change-Id: I30e85c04be615cc84726427c5057388b20a6ff60
2016-08-10 14:22:01 -07:00
Aleksey Vasenev
343b6b09a1 Align thread entry point stack
_beginthreadex does not align the stack on 16-byte boundary as expected
by gcc.

On x86 targets, the force_align_arg_pointer attribute may be applied to
individual function definitions, generating an alternate prologue and
epilogue that realigns the run-time stack if necessary. This supports
mixing legacy codes that run with a 4-byte aligned stack with modern
codes that keep a 16-byte stack for SSE compatibility.
https://gcc.gnu.org/onlinedocs/gcc/x86-Function-Attributes.html

Change-Id: Ie4e4ab32948c238fa87054d5664189972ca6708e
Signed-off-by: Aleksey Vasenev <margtu-fivt@ya.ru>
2016-08-10 11:57:34 -07:00
James Zern
4916a87bfc Merge changes I1d3edbdb,I8b49fd05
* changes:
  tests: use scoped_ptr for local video source vars
  y4m_test: init members in the constructor
2016-08-10 00:05:58 +00:00
Alex Converse
941fe20336 Merge "Refactor mv limits." 2016-08-09 17:12:50 +00:00
James Zern
475e9d26e0 tests: use scoped_ptr for local video source vars
prevents leak warnings on ASSERT*() failures

Change-Id: I1d3edbdbb18dbbe3b17691971348a8121cf09afa
2016-08-08 14:43:14 -07:00
Yury Gitman
c37d012ada Merge "Add cpi parameter for forcing segmentation update" 2016-08-08 21:29:42 +00:00
James Zern
9e9722bc79 y4m_test: init members in the constructor
prevents use of an uninitialized value in the deconstructor should the
test fail before tmpfile_ is set.

Change-Id: I8b49fd05f0d05e055fdf653bd46983d30f466a68
2016-08-08 14:27:34 -07:00
Yury Gitman
7a730d5901 Add cpi parameter for forcing segmentation update
Change-Id: I1b0bcb1ffe7604117bfaa0b9989d0e25ff04d28c
2016-08-08 13:20:42 -07:00
James Zern
cfd92dab18 Merge changes from topic 'clang-tidy'
* changes:
  *_perf_test.cc: correct DoDecode signature
  test: apply clang-tidy google-readability-braces-around-statements
2016-08-08 20:12:42 +00:00
Alex Converse
6554333b59 Refactor mv limits.
Change-Id: Ifebdc9ef37850508eb4b8e572fd0f6026ab04987
2016-08-08 11:54:00 -07:00
Yunqing Wang
6a8d4631a8 Merge "Fix a motion vector out of range bug" 2016-08-08 17:59:50 +00:00
James Zern
2c17d54681 *_perf_test.cc: correct DoDecode signature
+ delete unused kMaxPsnr from decode_perf_test.cc

Change-Id: Id93347631e7870491069a8b7c5bb1f6b2828425f
2016-08-05 20:21:02 -07:00
clang-format
9c9d92ae3a test: apply clang-tidy google-readability-braces-around-statements
applied against a x86_64 configure with and without
--enable-vp9-highbitdepth

clang-tidy-3.7.1 \
  -checks='-*,google-readability-braces-around-statements' \
  -header-filter='.*' -fix
+ clang-format afterward

Change-Id: Ia2993ec64cf1eb3505d3bfb39068d9e44cfbce8d
2016-08-05 20:02:28 -07:00
Linfeng Zhang
2d1e63d0c5 Remove duplicates in Loop8Test6Param and Loop8Test9Param
Extract the duplicated data generation code in OperationCheck() of
Loop8Test6Param and Loop8Test9Param, and put in function InitInput().

Change-Id: Ied39ba4ee86b50501cc5d10ebf54f5333c4708f0
2016-08-05 19:51:01 -07:00
James Zern
c12f2f3187 Merge "remove tools/vpx-style.sh" 2016-08-06 01:23:13 +00:00
James Zern
19d2e73dea Merge changes Ice037acb,I806af11b,I344a7dd0,Ib7cb87fa
* changes:
  vp9: normalize vpx_enc_frame_flags_t usage
  args.c: add some explicit casts
  webmdec: quiet -Wshorten-64-to-32 warning
  test/decode_test_driver: rm unused deadline member
2016-08-06 01:20:52 +00:00
Linfeng Zhang
ba42ce64b7 Fix a bug in test/lpf_8_test.cc
This bug is introduced in 36608af524bb65e39177f229301111f669bf0d20,
where buffer tmp_s is not fully initialized.

Change-Id: I125b966cf054a82bc63c72647cdd463f434eda17
2016-08-05 17:52:10 -07:00
Yunqing Wang
2fb826c4d5 Fix a motion vector out of range bug
This patch fixed a motion vector(MV) out of range bug, which was caused
by not restoring the original values of the MV min/max thresholds after
the sub8x8 full pixel motion search. It occurred rarely and only was seen
while encoding a 4k clip for 200 frames.

BUG=webm:1271

Change-Id: Ibc4e0de80846f297431923cef8a0c80fe8dcc6a5
2016-08-05 15:23:05 -07:00
James Zern
7104833085 vp9: normalize vpx_enc_frame_flags_t usage
quiets -Wshorten-64-to-32 warnings

Change-Id: Ice037acb675d1d81bfedf2dfcfa91a8a29a19dfd
2016-08-04 23:37:49 -07:00
James Zern
d772d55704 args.c: add some explicit casts
values are range checked before returning; quiets -Wshorten-64-to-32
warnings

Change-Id: I806af11b2aaf6760c7ab234a2fe2fdf40e7bece7
2016-08-04 23:37:49 -07:00
James Zern
c79665d0ad webmdec: quiet -Wshorten-64-to-32 warning
track->GetNumber() will fit in an int in well-behaved files

Change-Id: I344a7dd05d04daf3df2d67358ea69f8014a03a5b
2016-08-04 23:37:49 -07:00
James Zern
1b1e40c0b2 test/decode_test_driver: rm unused deadline member
has the side-effect of removing some lint and -Wshorten-64-to-32
warnings

Change-Id: Ib7cb87fa65cd65534096921f243d15288e97256d
2016-08-04 23:36:53 -07:00
James Zern
958ae5af9c remove tools/vpx-style.sh
update ftfy.sh to use clang-format

Change-Id: I8ac740c5b3842beed2b8878fbe506f381f4c57e4
2016-08-04 20:17:09 -07:00
Johann Koenig
57f49db81f Merge changes I6ef79702,Id332c641,I354b5d22,I84438013
* changes:
  Use common transpose for vpx_idct32x32_1024_add_neon
  Use common transpose for vpx_idct8x8_[12|64]_add_neon
  Use common transpose for vp9_iht8x8_add_neon
  Use common transpose for vpx_idct16x16_[10|256]_add_neon
2016-08-04 22:30:47 +00:00
Johann Koenig
17720b60bb Merge "Remove armv6 target" 2016-08-04 22:21:13 +00:00
James Zern
7f7c888c14 Merge "correct break placement" 2016-08-04 22:19:30 +00:00
Johann
0325b95938 Use common transpose for vpx_idct32x32_1024_add_neon
Change-Id: I6ef7970206d588761ebe80005aecd35365ec50ff
2016-08-04 20:13:18 +00:00
Johann
f4e4ce7549 Use common transpose for vpx_idct8x8_[12|64]_add_neon
Change-Id: Id332c641f05336ef9a45e17493ff149fd0a168f0
2016-08-04 20:13:12 +00:00
Johann
7103b5307d Use common transpose for vp9_iht8x8_add_neon
Change-Id: I354b5d22130d76b0eceda0748db1f871f58fa372
2016-08-04 20:13:03 +00:00
Johann
8619203ddc Use common transpose for vpx_idct16x16_[10|256]_add_neon
Change-Id: I84438013f483e82084d33ba9a63c33273d35fcaa
2016-08-04 20:12:53 +00:00
Johann Koenig
b757d89ff9 Merge "Extract neon transpose for re-use" 2016-08-04 20:12:38 +00:00
James Zern
4db9bd324d Merge "vp9_ratectrl.c: apply clang-format" 2016-08-04 20:01:46 +00:00
James Zern
70a7885a65 correct break placement
these should be placed within {}s when present

Change-Id: Ia775fac5373603e77360398f19b07958fb43f476
2016-08-04 13:00:14 -07:00
Johann Koenig
caac87b05b Merge "Don't expand to Q register for 4x4 intrapred" 2016-08-04 19:55:50 +00:00
Johann
d55724fae9 Remove armv6 target
Change-Id: I1fa81cc9cabf362a185fc3a53f1e58de533a41e5
2016-08-04 12:55:06 -07:00
Johann Koenig
476e8fc855 Merge "Pad 'Left' when building under ASan" 2016-08-04 19:27:45 +00:00
Linfeng Zhang
36608af524 Merge "Update Loop8Test{6,9}Param to test filter8() in mb_lpf_vertical_edge_w()" 2016-08-04 19:21:22 +00:00
Johann
377cfa31f0 Extract neon transpose for re-use
Change-Id: I5e1c7f4c80d1c6f7fd582ac468c6eaaa3603a06c
2016-08-04 19:04:25 +00:00
James Zern
374f0ff4a0 Merge changes from topic 'clang-format'
* changes:
  README: add a note about clang-format
  README: update target list
  README: fix typo
2016-08-04 19:03:03 +00:00
clang-format
3a4002b94d vp9_ratectrl.c: apply clang-format
after:
ff0a87c vp9 1pass vbr: Adjustment to gf interval.

Change-Id: I1296e53e601bf0c2b562e3a34082ac45c294a5f1
2016-08-04 11:57:00 -07:00
Johann
df69c751a7 Don't expand to Q register for 4x4 intrapred
The code was expanding to Q registers so that vqrshn could be used, for
vector quad round shift and narrow. If 4 values are added together,
there is a shift by 2. If 8 values, a shift by 3. Since this accounts
for any possibility of overflow, we can skip the narrowing shift.

This allows keeping the values in D registers and casting the 16 bit
value to 8 bits.

Change-Id: I8d9cfa07176271f492c116ffa6a7b351af0b8751
2016-08-04 18:51:46 +00:00
Linfeng Zhang
bbf4c91f79 Update Loop8Test{6,9}Param to test filter8() in mb_lpf_vertical_edge_w()
One branch of filter8() in mb_lpf_vertical_edge_w() was not tested.

Change-Id: I194202d771d9acd6b4e5e600ee2bae89986b49f3
2016-08-04 11:33:14 -07:00
Marco Paniconi
9fdeeaf411 Merge "vp9 1pass vbr: Adjustment to gf interval." 2016-08-04 17:50:55 +00:00
Yaowu Xu
7a79fa1362 Fix msvc compiler warnings
MSVC 2013 complained about using 32 shift where 64 bit shift should be
used.

Change-Id: I7a2b165d1a92d3c0a91dd4511b27aba7709b5e55
2016-08-03 18:33:06 -07:00
James Zern
b51d127c82 Merge "Resolve -Wshorten-64-to-32 warnings in prob.h." 2016-08-04 00:38:08 +00:00
James Zern
15f29ef092 README: add a note about clang-format
Change-Id: I835401e3befffcbc68e7d2bdd2fd556a19948e91
2016-08-03 17:34:03 -07:00
James Zern
77f5c3d2e8 README: update target list
Change-Id: I80293720a5f12bc2449ceaadbb2ad0f924141552
2016-08-03 17:30:45 -07:00
James Zern
5ea8712b82 README: fix typo
Change-Id: I2c3ecc62b1fd1e600b3d70b623c8b11e1e8e4d13
2016-08-03 17:30:45 -07:00
James Zern
068281751c Merge "test: apply clang-format" 2016-08-04 00:27:59 +00:00
James Zern
a412c004e4 Merge "vp9/decoder,vp9/*.[hc]: apply clang-format" 2016-08-04 00:22:59 +00:00
Johann
a7a8e07a44 Pad 'Left' when building under ASan
The neon intrinsics are not able to load just the 4 values that are
used. In vpx_dsp/arm/intrapred_neon.c:dc_4x4 it loads 8 values for both
the 'above' and 'left' computations, but only uses the sum of the first
4 values.

BUG=webm:1268

Change-Id: I937113d7e3a21e25bebde3593de0446bf6b0115a
2016-08-03 16:38:51 -07:00
Marco
ff0a87ce38 vp9 1pass vbr: Adjustment to gf interval.
Increase the minimum distance.
Reduces the overshoot somewhat on some clips,
small gain in avgPSNR (~0.1%) on ytlive set.

Change-Id: Id5ddde20c2907dbdb536e79542eff775019c142b
2016-08-03 15:36:27 -07:00
clang-format
08131055e4 vp9/decoder,vp9/*.[hc]: apply clang-format
Change-Id: Ic38ea06c7b2fb3e8e94a4c0910e82672a1acaea7
2016-08-03 14:29:31 -07:00
Yaowu Xu
85e111b3ba Merge "vp9 svc: Fix a valgrind error." 2016-08-03 20:53:05 +00:00
clang-format
8ff40f8bec vp9/common: apply clang-format
Change-Id: Ie0f150fdcfcbf7c4db52d3a08bc8238ed1c72e3b
2016-08-02 18:27:07 -07:00
clang-format
e0cc52db3f vp9/encoder: apply clang-format
Change-Id: I45d9fb4013f50766b24363a86365e8063e8954c2
2016-08-02 16:47:11 -07:00
JackyChen
f7032713af vp9 svc: Fix a valgrind error.
This error was introduced by the patch:
8ce67d7 vp9 svc: Enable different speed setting for each spatial layer.
To use svc, svc_param should be cleared to 0 at the beginning.

Change-Id: I222f03ddae8a50e84b4690b78263abb742fae91e
2016-08-02 16:16:22 -07:00
Alex Converse
d089ac4dda Resolve -Wshorten-64-to-32 warnings in prob.h.
Change-Id: I1244ee908d81467f0fc8a8fce979fc8077a325b4
2016-08-02 15:40:23 -07:00
Alex Converse
3a04c9c9c4 Merge "Resolve -Wshorten-64-to-32 in variance." 2016-08-02 22:26:55 +00:00
Yaowu Xu
039f9e08f0 change HBD pixel value from uint8_t to uint16_t
This fixes a regression in 10/12 bit encoding results.

Change-Id: I438877352a41aae0a864a8d9979afe4aa2061d81
2016-08-02 11:01:39 -07:00
Yaowu Xu
dc5618f3bb Add pointer conversion for HBD buffers
This fixes a crash in HBD build.

Change-Id: I7f688f50227323e69bba65df0d56f4360f01771b
2016-08-01 15:56:43 -07:00
Alex Converse
004eebed31 Merge "Unfork 8-bit in HBD path in vp9_model_rd_from_var_lapndz callers." 2016-08-01 16:42:39 +00:00
Alex Converse
2c3807b89f Merge "Cache optimizations in optimize_b()." 2016-08-01 16:30:05 +00:00
Alex Converse
e446ffda45 Cache optimizations in optimize_b().
Move best index into the token state. Shrink it down to one byte. This
is more cache friendly (access are group together) and uses less total
memory.

Results in 4% fewer cycles in optimize_b().

Change-Id: I75db484fb3dc82f59928d54b659d79c80ee40452
2016-07-29 12:06:49 -07:00
Johann Koenig
d4ab234869 Merge "replace by VSTM/VLDM to reduce one of VST1/VLD1" 2016-07-29 14:25:10 +00:00
Min Chen
407c2e2974 replace by VSTM/VLDM to reduce one of VST1/VLD1
Change-Id: I596567570580babb1a52925541d1fd1045c352f5
2016-07-28 23:01:38 +00:00
JackyChen
6fbb4c3061 vp8: Switch skin model to mode 0 to save some cycle.
This change will speed up vp8 encoder by 1.5% ~ 2% on linux. No
much speed change on Mac.

Change-Id: Id957f19ddd89805baa2af84c5027d52d9a48553f
2016-07-28 13:32:50 -07:00
Jacky Chen
462a7c9f0a Merge "vp9 svc: Enable different speed setting for each spatial layer." 2016-07-28 20:21:30 +00:00
Alex Converse
c0241664aa Resolve -Wshorten-64-to-32 in variance.
The subtrahend is small enough to fit into uint32_t.

Change-Id: Ic4d7128aaa665eaf6b25d562610ba8942c46137f
2016-07-28 10:16:31 -07:00
Alex Converse
4508eb3123 Merge "Fix 64 to 32 narrowing warning." 2016-07-28 16:36:46 +00:00
clang-format
956af1d478 vpx_dsp/x86/quantize_sse2.c: apply clang-format
post:
e429080 .clang-format: disable DerivePointerAlignment

Change-Id: I21a0546668edb2b09660e216d4875a1d2ad24d53
2016-07-27 21:41:18 -07:00
James Zern
6b374abc86 Merge "vp9 denoiser: Derefencing pointer should be after null check." 2016-07-28 00:43:19 +00:00
Alex Converse
335cf67d8b Fix 64 to 32 narrowing warning.
- Solves potential integer overflow on 12-bit
- Fixes Visual Studio build

Change-Id: I26dd660451bbab23040e4123920d59e82585795c
2016-07-27 12:40:23 -07:00
James Zern
341919d038 Merge "vpx_scale: apply clang-format" 2016-07-27 01:59:21 +00:00
clang-format
33e40cb5db test: apply clang-format
Change-Id: I0d9ab85855eb723f653a7bb09b3d0d31dd6cfd2f
2016-07-27 01:58:52 +00:00
JackyChen
47cc64cdf8 vp9 denoiser: Derefencing pointer should be after null check.
BUG=webm:1267

Change-Id: I899fc9e8d784c6eefcbe27945c619845adb7b6f0
2016-07-26 17:31:17 -07:00
James Zern
e4290800b2 .clang-format: disable DerivePointerAlignment
everything outside of third_party should follow 'PointerAlignment:
right' i.e., associate the '*' with the variable

+ add a note about the clang-format that generated this file

Change-Id: I13e3f4f5fb6e22a8fa7fc3d06879c995b7c41a39
2016-07-26 16:46:54 -07:00
clang-format
f4be884466 vpx_scale: apply clang-format
Change-Id: Ia07ba57756f75911d3d06318e1f9b1982e1ca8c5
2016-07-26 15:57:41 -07:00
James Zern
fbf256da41 Merge "vpx_ports: apply clang-format" 2016-07-26 22:54:31 +00:00
Alex Converse
34201e50c1 Unfork 8-bit in HBD path in vp9_model_rd_from_var_lapndz callers.
BUG=b/29583530

Change-Id: Ia88a75f9572e08f228559ab84b8a77efb5aff0af
2016-07-26 21:57:58 +00:00
James Zern
1a3c4f91f6 Merge "vpx_mem: apply clang-format" 2016-07-26 21:19:17 +00:00
James Zern
9f9a8d2aaa Merge "vpx_util: apply clang-format" 2016-07-26 21:18:25 +00:00
Alex Converse
1c85230344 Merge "Only consider visible 4x4s in pixel domain error." 2016-07-26 19:39:54 +00:00
James Zern
7987686397 Merge "register_state_check: simplify Check() methods" 2016-07-26 18:49:18 +00:00
clang-format
6565c17f24 vpx_util: apply clang-format
Change-Id: Ie7eab608e2906b9a2b3533db95292ebc430ad377
2016-07-25 22:33:21 -07:00
James Zern
f8c27d164c register_state_check: simplify Check() methods
- make Check() void as the EXPECT's are sufficient to document failure

cumulatively this has the effect of avoiding reporting incorrect Check()
failures due to earlier test failures.

Change-Id: I2cf775449f18c90c1506b8eadd7067adbc3ea046
2016-07-25 15:14:02 -07:00
jackychen
8ce67d714a vp9 svc: Enable different speed setting for each spatial layer.
This change only affects 1 pass cbr svc mode.

Change-Id: If0da87bb200f7e7762755340c40c8157cc7a16ca
2016-07-25 15:11:43 -07:00
Alex Converse
d6c5ef4557 Only consider visible 4x4s in pixel domain error.
BDRATE change
derf144: -0.327
lowres: -0.048
midres: -0.125
hdres: -0.238

Change-Id: I789aba9870b5c2952373a7dd4fc8ed45590c3c54
2016-07-25 21:44:06 +00:00
clang-format
580f14b68b vpx_ports: apply clang-format
Change-Id: Ice343335a40238fd21490bce0ce2972bdcb87055
2016-07-25 14:29:06 -07:00
clang-format
d7a3b781d3 vpx_mem: apply clang-format
Change-Id: I0440686fc03f1ee02bd0168c91e671a0a2d0056a
2016-07-25 14:17:59 -07:00
clang-format
099bd7f07e vpx_dsp: apply clang-format
Change-Id: I3ea3e77364879928bd916f2b0a7838073ade5975
2016-07-25 14:14:19 -07:00
James Zern
82070ae939 Merge "configure: test for -Wfloat-conversion" 2016-07-25 19:47:38 +00:00
Johann Koenig
5c0f5cdda8 Merge "Fix compilation error under Clang 4.0." 2016-07-25 19:44:05 +00:00
Ivan Krasin
91369fd9b7 Fix compilation error under Clang 4.0.
The LLVM trunk has reached 4.0 and now __clang_major__ is not enough
to distinguish between old XCode Clang and the new 'real' Clang.
Using __apple_build_version__ allows to make this distinction.

BUG=chromium:631144

Change-Id: I0b6e46fddfe4f409c7b7e558bda34872e60ee2d9
2016-07-25 19:18:49 +00:00
James Zern
889ed5b158 configure: test for -Wfloat-conversion
supported by clang, gcc-4.9+

Change-Id: I893766de7307fef9a8b68c0cfae137c9d3b0dbe8
2016-07-25 19:05:15 +00:00
James Zern
7aa0c748b3 Merge "vp9: fix frame-level threaded decode shutdown" 2016-07-25 19:00:37 +00:00
Alex Converse
511bf49b7e Merge "Minor skip segment simplification." 2016-07-25 17:50:43 +00:00
Scott LaVarnway
ad5fea03e6 Merge "VP9: get_pred_context_switchable_interp() -- encoder side" 2016-07-25 11:58:24 +00:00
James Zern
54b2071bf4 vp8/decodeframe: fix signed/unsigned comparison
quiets a visual studio warning

Change-Id: Ic7725616bc2cb837e6f79294d4fcff36b67af834
2016-07-23 11:41:52 -07:00
James Zern
f368f86df6 vp9: fix frame-level threaded decode shutdown
Shutdown all threads before reclaiming any memory. The frame-level
parallel decoder may access data from another worker.

BUG=webm:1259

Change-Id: I26856ebd1f77cc4a4545331baa19bbf3e01c4ea4
2016-07-23 10:59:15 -07:00
clang-format
c42d54c3a3 vp8/postproc.c: disable clang-format for RGB_TO_YUV
Change-Id: Id2a936301ec1e3d5648b4f8adbf4e6625002589d
2016-07-23 10:55:44 -07:00
James Zern
18e53642b7 Merge "vpx/: apply clang-format" 2016-07-23 01:27:14 +00:00
James Zern
5cf8eda308 Merge changes I0089e884,Icb0ecb9e
* changes:
  vp8/postproc: fix implicit float conversion
  blockiness_test: fix implicit float conversion
2016-07-23 01:18:32 +00:00
James Zern
256a4af4d1 Merge "resize_test: fix implicit float->int conversion" 2016-07-23 01:17:49 +00:00
James Bankoski
7381e3330f Merge "vp8:fix threading issues" 2016-07-23 00:51:37 +00:00
Jim Bankoski
0fff2fb34c vp8:fix threading issues
1 - stops de allocating before threads are closed.
2 - limits threads to mb_rows when mb_rows < partitions

BUG=webm:851

Change-Id: I7ead53e80cc0f8c2e4c1c53506eff8431de2a37e
2016-07-23 00:50:55 +00:00
James Zern
b2542417cd vp8/postproc: fix implicit float conversion
float->int as reported by -Wfloat-conversion

Change-Id: I0089e8847b218c47526bcfbb0fffd9aad7c5adb3
2016-07-22 16:01:52 -07:00
Yury Gitman
3d3f51262c Add VPX_SWAP macro
Change-Id: I60e233eddef238ad918183392794084673f27d2d
2016-07-22 15:41:25 -07:00
James Zern
5e2791b54d blockiness_test: fix implicit float conversion
float->int as reported by -Wfloat-conversion

Change-Id: Icb0ecb9e2d54edb95813d9f2de34cb6c27b63cbd
2016-07-22 15:35:42 -07:00
Alex Converse
9a62ecbd35 Minor skip segment simplification.
Change-Id: I34863fce1abe94f9539e9a5a6149ae1efb6501bd
2016-07-22 15:31:18 -07:00
Marco Paniconi
53db633349 Merge "vp9 1pass-vbr: Adjust gf setting for nonzero-lag case." 2016-07-22 21:27:05 +00:00
James Zern
325bdddc38 resize_test: fix implicit float->int conversion
Change-Id: I1efc16fa158740a06da719a1ea90c6dd6a182bb4
2016-07-22 13:11:07 -07:00
Marco
c06a4b9df2 vp9 1pass-vbr: Adjust gf setting for nonzero-lag case.
Change-Id: I230c586c6d5ae56ee9a6d37b7d9452351bb4bd80
2016-07-22 11:48:09 -07:00
Paul Wilkins
830fa866a5 Merge "Sample points to reduce encode overhead." 2016-07-22 09:27:34 +00:00
Paul Wilkins
063e4a2914 Merge "Noise energy Experiment in first pass." 2016-07-22 09:27:19 +00:00
clang-format
e3e9fee419 vpx/: apply clang-format
Change-Id: I95922a64568bf289863c1564212b6be5beec36df
2016-07-21 20:49:07 -07:00
Yunqing Wang
4b073bc39a Add back header in threading.h
Added back the header needed in threading.h

Change-Id: I2ce66ad4fe58004997623f6c3f3b8dd11640aa98
2016-07-21 17:26:05 -07:00
Yunqing Wang
930773a1ed Merge "Revert "Amend and improve VP8 multithreading implementation"" 2016-07-21 21:32:55 +00:00
Yunqing Wang
87c6c5224d Revert "Amend and improve VP8 multithreading implementation"
Reverted the patch because of possible performance issue.

Change-Id: I49944f827ccd38ed194c9f8d9cb9036fa9bf79e1
2016-07-21 12:28:25 -07:00
Scott LaVarnway
c969b2b02b VP9: get_pred_context_switchable_interp() -- encoder side
Change-Id: I7217c90d5cf38c51b76759a2dc4f10070f3a40ac
2016-07-21 11:47:51 -07:00
Alex Converse
18c7f46c12 MinArfFreqTest: Don't leak video on failure.
Change-Id: I250379f0ac8d4929c9032e7343290e2980fc2e77
2016-07-21 11:40:51 -07:00
Alex Converse
92e91bd3a1 Make test encoder test driver less likely to leak on failure.
Individual tests still need to be updated.

Change-Id: Ic433d0f742e13560b136f136b72b2a9973970d78
2016-07-21 11:39:47 -07:00
James Zern
16e069b8bb Merge changes from topic 'clang-tidy'
* changes:
  vp8/onyx_if.c: rework #if's to avoid dangling else's
  vp8/bitstream.c: rework #if to avoid dangling else
2016-07-21 03:05:20 +00:00
Johann
a6cc74b987 Merge remote-tracking branch 'origin/khakicampbell' 2016-07-20 18:49:04 -07:00
Johann
042572177b Release v1.6.0 Khaki Campbell Duck
Change-Id: I08da365dd889093f9919476a02ee96ae9615f140
2016-07-20 18:15:41 -07:00
jackychen
71f9cbcfc8 vp9: Fix the clang warning of unsigned int type.
Change-Id: I6308db16bd626fa5943925471e9171f567669350
2016-07-20 15:58:35 -07:00
Yaowu Xu
297b2a12d6 Fix encoder crashes for odd size input
(cherry picked from commit 98431cde070a33fe346f1316abd8437cd873dbfa)

Change-Id: Id5c30c419282369cc8c3280d9a70b34a859a71d8
2016-07-20 15:02:13 -07:00
James Zern
b19f8b1607 vp8/onyx_if.c: rework #if's to avoid dangling else's
Change-Id: Ieda8958a3da1000424fcff91a1315d0049612202
2016-07-20 12:36:09 -07:00
James Zern
77a31eb3c5 vp8/bitstream.c: rework #if to avoid dangling else
Change-Id: I9178ae75876f3df3fa3271314db39830552b9549
2016-07-20 12:36:09 -07:00
James Zern
7bb35db872 Merge changes from topic 'clang-tidy'
* changes:
  vp8/{bitstream,rdopt},y4minput: correct break placement
  y4minput.c: correct empty loop formatting
  vp8: simplify a few #if's
  vp8: remove extra semicolons
2016-07-20 19:34:59 +00:00
Yaowu Xu
690fcd793b Change to call vp9_post_proc_frame()
This commit changes the call in vp9 encoder from vp9_deblock() to
vp9_post_proc_frame() to ensure the data structures used in the call
are properly allocated. This fixes an encoder crash when configured
with --enable-internal-stats.

Change-Id: I2393b336c0f566665336df4f1ba91c405eb56764
2016-07-20 11:01:49 -07:00
James Zern
fd85664ae6 vp8/{bitstream,rdopt},y4minput: correct break placement
these should be placed within {}s when present

Change-Id: If00e9766fa8cb039cc070467f353a468f99460fb
2016-07-19 20:51:25 -07:00
James Zern
1b048e966a y4minput.c: correct empty loop formatting
prefer {}s over ';'

Change-Id: I563fc82717e1deb4f42a40e03dca318c6adaa0c1
2016-07-19 20:46:39 -07:00
James Zern
b5164f55a0 vp8: simplify a few #if's
bitstream.c: asserts are disabled when CONFIG_DEBUG is unset
vp8_dx_iface.c: split |s into 2 statements across #if bounds

Change-Id: I307d1e969134db5c9c0edd7690589b6b29116cbd
2016-07-19 20:45:28 -07:00
James Zern
96797e43b4 vp8: remove extra semicolons
Change-Id: I84e1a293ee033865f82c244e8aaaadfb2fb27e63
2016-07-19 20:44:14 -07:00
clang-format
033dab9ca0 top-level: apply clang-format
Change-Id: Ibd5395bf8956a80f7c0df4d539c7a42c927a1fc7
2016-07-19 14:34:19 -07:00
James Zern
6e336f6e5f Merge "vp8: apply clang-tidy google-readability-braces-around-statements" 2016-07-19 21:24:30 +00:00
clang-tidy
7f3e07f1c8 vp8: apply clang-tidy google-readability-braces-around-statements
applied against an x86_64 configure

clang-tidy-3.7.1 \
  -checks='-*,google-readability-braces-around-statements' \
  -header-filter='.*' -fix
+ clang-format afterward

Change-Id: I6694edeaee89b58b8b3082187e6756561136b459
2016-07-19 12:38:03 -07:00
James Zern
5b55bcc564 Merge "examples: apply clang-format" 2016-07-19 19:21:08 +00:00
James Zern
e3f7991f99 Merge changes Ia6004c08,I1954f9d6
* changes:
  cosmetics: Add a few explanatory comments
  cosmetics: Correct grammar/spelling in comments
2016-07-19 19:12:23 +00:00
Yury Gitman
e4ac882007 cosmetics: Add a few explanatory comments
Change-Id: Ia6004c08e6f5fd269a1bbd4df51ce9b76345150d
2016-07-19 10:39:00 -07:00
Marco Paniconi
e90d4f0a03 Merge "vp9: Allow usage of lookahead for real-time, 1 pass vbr." 2016-07-19 17:17:16 +00:00
Johann Koenig
451211cb01 Merge "Change 'git cl upload' default to --no-squash" 2016-07-19 16:37:42 +00:00
James Zern
ea3d324f13 Merge changes I18982dbf,I15c8976c
* changes:
  build/make/Makefile: add a 'test_*' default target
  build/make/Makefile: remove default suffix rules
2016-07-19 06:09:36 +00:00
Pascal Massimino
7e4740156f Merge "take II: variance_test partial clean-up" 2016-07-19 03:52:55 +00:00
clang-format
ef45540927 examples: apply clang-format
Change-Id: Icc3bbb07c99a31a70030baec7e51b881902a7b5e
2016-07-18 19:04:56 -07:00
James Bankoski
c69cc4ce1f Merge "configure: turn on all unused warnings by default" 2016-07-19 00:57:46 +00:00
James Zern
25085a6ac2 build/make/Makefile: add a 'test_*' default target
allows 'make test_libvpx', etc. some reworking of the makefiles would be
needed to avoid hard coding targets here.

Change-Id: I18982dbf691e7d36ab8bcf5934bab9340687b061
2016-07-18 16:30:58 -07:00
James Zern
23d0f73838 build/make/Makefile: remove default suffix rules
Change-Id: I15c8976c6478bf75ec617398f49461b310ab7569
2016-07-18 16:30:40 -07:00
skal
7d72ebaa5c take II: variance_test partial clean-up
remove some (but not all yet!) tuple mis-use, and revamp the code a lot.
Factorize some common chores into MainTestClass.

Change-Id: Id37b7330eebe80d19b9d12a454f24ff9be6b1116
2016-07-18 16:18:26 -07:00
Marco
05fe0f20a6 vp9: Allow usage of lookahead for real-time, 1 pass vbr.
Allow usage of lookahead for VBR in real-time mode, for 1 pass vbr.

Current usage is for fast checking of future scene cuts/changes,
and adjusting rate control (gf interval and active_worst/target size).

Added unittests (datarate) for 1 pass vbr mode, with non-zero lag.

Added an experimental option to limit QP based on lookahead.

Overall positive gain in metrics on ytlive set:
avgPNSR/SSIM up on average ~1-3%; several clips up by 5, 7%.

Change-Id: I960d57dfc89de121c4824b9a9bf88d2814e74b56
2016-07-18 15:20:17 -07:00
Johann
1afbd88e81 Change 'git cl upload' default to --no-squash
Chromium changed the upstream default to --squash but this conflicts
with libvpx historical defaults.

Change-Id: I80f2f2b48e2ba08e02184b50e6d5f8f5e76fec24
2016-07-18 14:15:24 -07:00
Yury Gitman
bdfdd7d993 cosmetics: Correct grammar/spelling in comments
Change-Id: I1954f9d6e33abff9081fe7a5cf59d5497768e0df
2016-07-18 12:49:00 -07:00
Jim Bankoski
3e04114f3d prepend ++ instead of post in for loops.
Applied the following regex  :
search for: (for.*\(.*;.*;) ([a-zA-Z_]*)\+\+\)
replace with: \1 ++\2)

This misses some for loops:
ie : for (mb_col = 0; mb_col < oci->mb_cols; mb_col++, mi++)

Change-Id: Icf5f6fb93cced0992e0bb71d2241780f7fb1f0a8
2016-07-18 06:54:50 -07:00
James Zern
106a8a1536 Merge "Revert "variance_test partial clean-up"" 2016-07-16 22:01:19 +00:00
James Zern
3d791194f8 vpx_plane_add_noise_c: normalize int types
quiets signed/unsigned mismatch warning

Change-Id: Iaabd7dfff110ba26056258457541f5635d2e85e6
2016-07-16 11:56:55 -07:00
James Zern
090aa88b5a Revert "variance_test partial clean-up"
This reverts commit f993ed5c86217e31b92ecc7ef58d7d7860b80108.

build warnings under msvc, segfaults with high-bitdepth enabled.

Change-Id: I67502651107830bcadb6ef56d8f2709cccbfdf2b
2016-07-16 11:55:07 -07:00
Pascal Massimino
f44db1487d Merge "sad_test: add some const to methods" 2016-07-16 04:50:45 +00:00
Pascal Massimino
8d681b36c7 Merge "vp9_error_block_test: simplify fn wrapper generation" 2016-07-16 04:41:46 +00:00
Pascal Massimino
5319e83843 sad_test: add some const to methods
Change-Id: I6f2481509b0aa94338ed6185f80c4a6b65532280
2016-07-15 21:07:00 -07:00
Pascal Massimino
22c36dd464 Merge "remove tuple from 'sad_test.cc'" 2016-07-16 03:56:10 +00:00
James Zern
037a50ed36 vp9_error_block_test: simplify fn wrapper generation
Change-Id: I1f1d396b9456e52e863c4c75f23c3d17420668b4
2016-07-15 20:27:45 -07:00
skal
3fc29ae3ee remove tuple from 'sad_test.cc'
+ general clean-up

Change-Id: Ib9dca3d1a3b7f0c1bedef2a26c9ff5ae1c289e8a
2016-07-15 19:52:56 -07:00
clang-format
81a6739533 vp8: apply clang-format
Change-Id: I7605b6678014a5426ceb45c27b54885e0c4e06ed
2016-07-15 19:28:44 -07:00
James Zern
65daa41378 add .clang-format, based on Google style
derived from clang-format 3.7.1; same as used in libaom

Change-Id: I8ea915a41d1f2ea3b0d4e4dab9ebc808e9116f11
2016-07-15 19:26:24 -07:00
James Bankoski
ce6678fdc9 Merge "addnoise : clear out static size for generated noise" 2016-07-16 01:48:07 +00:00
Jim Bankoski
cb957c302a addnoise : clear out static size for generated noise
Change-Id: I5d4343f2da9cd4b01dd37be7a048d159fec109d1
2016-07-15 15:52:45 -07:00
Jim Bankoski
0dfede2e79 configure: turn on all unused warnings by default
Change-Id: I7f6cb446cd3ac57ac39835cf065d9501a66acd5b
2016-07-15 15:26:20 -07:00
Jim Bankoski
da1bda0fb2 vp9_postproc.c : unused variable if not vp9_highbitdepth.
Change-Id: Ib89b128f23767934c40b5add3fcf9dbd875e82f9
2016-07-15 15:04:57 -07:00
James Bankoski
302e425453 Merge "postproc : fix function parameters for noise functions." 2016-07-15 17:33:53 +00:00
Jim Bankoski
0dc69c70f7 postproc : fix function parameters for noise functions.
Change-Id: I582b6307f28bfc987dcf8910379a52c6f679173c
2016-07-15 08:27:34 -07:00
James Zern
60ada7edb4 Merge "variance_test partial clean-up" 2016-07-15 07:31:30 +00:00
skal
f993ed5c86 variance_test partial clean-up
remove some (but not all yet!) tuple mis-use, and revamp the code a lot.
Factorize some common chores into MainTestClass.

Change-Id: Ia14f3924140e8545e4f10d0504475681baae8336
2016-07-14 22:06:44 +00:00
James Zern
6d2b79e3a2 Merge "vp9_intrapred_test: follow-up cleanup" 2016-07-14 19:48:52 +00:00
James Zern
a07bb84215 gtest-all.cc: quiet an unused variable warning
under windows / mingw builds

Change-Id: I93f9a5df77cea0c28d4afb272abcde5a9732e355
2016-07-13 18:36:17 -07:00
skal
3386ca7496 vp9_intrapred_test: follow-up cleanup
address few comments from ce050afaf3e288895c3bee4160336e2d2133b6ea

Change-Id: I5d8fc9dab35c4ee5ec3671134c4eef4ec241e309
2016-07-14 00:40:55 +00:00
James Bankoski
7eec1f31b5 Merge "postproc: noise style fixes." 2016-07-13 22:04:47 +00:00
Hui Su
8dd3bef7ef Merge "Revert "Eliminate isolated and small tail coefficients:"" 2016-07-13 21:30:12 +00:00
Pascal Massimino
8c7751e1c2 Merge "clean-up vp9_intrapred_test" 2016-07-13 21:26:15 +00:00
Yaowu Xu
d6197b621d Merge "Fix encoder crashes for odd size input" 2016-07-13 20:05:09 +00:00
Jim Bankoski
e736691a6d postproc: noise style fixes.
Change-Id: Ifdcb36b8e77b65faeeb10644256e175acb32275d
2016-07-13 12:39:01 -07:00
skal
ce050afaf3 clean-up vp9_intrapred_test
remove tuple and overkill VP9IntraPredBase class.

Change-Id: I85b85bdd33d7fe417895e75f77db219f713dfea3
2016-07-13 18:16:32 +00:00
hui su
248f6ad771 Revert "Eliminate isolated and small tail coefficients:"
This reverts commit ff19cdafdbb5ee470e4369582b0266f4bc23287d.

Change-Id: I81f68870ca27a1ff683ee22090530b6997815fb2
2016-07-13 11:14:44 -07:00
Jingning Han
fed14a3e94 Merge "Disable trellis optimization when lossless is on" 2016-07-13 16:01:01 +00:00
James Bankoski
e93f2fdb83 Merge "postproc - move filling of noise buffer to vpx_dsp." 2016-07-13 15:31:17 +00:00
Jim Bankoski
2ca24b0075 postproc - move filling of noise buffer to vpx_dsp.
Change-Id: I63ba35dc0ae9286c9812367a531e01d79a4c1635
2016-07-13 07:35:25 -07:00
Jim Bankoski
b24373fec2 deblock: missing const on extern const.
Change-Id: I0df08f7c431daf939e266f008bf5158b0c97358b
2016-07-13 07:27:29 -07:00
Jim Bankoski
6f424a768e vp9_postproc.c missing extern.
BUG=webm:1256

Change-Id: I5271e71bc53cce033fb906040643dcdd5ccb2381
2016-07-12 17:47:49 -07:00
James Zern
6a3ff0b617 Merge changes from topic 'webp-thread-update'
* changes:
  vpx_thread: use CreateThread for windows phone
  vpx_thread: use WaitForSingleObjectEx if available
  vpx_thread: use InitializeCriticalSectionEx if available
  vpx_thread: use native windows cond var if available
  vpx_thread.[hc]: update webp source reference
2016-07-13 00:08:05 +00:00
Yaowu Xu
98431cde07 Fix encoder crashes for odd size input
Change-Id: Id5c30c419282369cc8c3280d9a70b34a859a71d8
2016-07-12 11:11:26 -07:00
Jacky Chen
19c157afe2 Merge "vp9 svc: Reuse scaled_temp in two stage downscaling." 2016-07-12 17:59:09 +00:00
JackyChen
110a2ddc9b vp9 svc: Reuse scaled_temp in two stage downscaling.
This change eliminates redundant computation in the two stage
downscaling, which saves ~1% encoding time in 3-layer svc encoding.

Change-Id: Ib4b218811b68499a740af1f9b7b5a5445e28d671
2016-07-12 10:09:55 -07:00
Jingning Han
efccbc9fb5 Disable trellis optimization when lossless is on
Disable trellis coefficient optimization when the lossless mode
is turned on.

Change-Id: I9001bf626e86dc3c8c32331ede04fd39036e5f7c
2016-07-12 09:00:16 -07:00
Jim Bankoski
88e6951465 deblock filter : moved from vp8 code branch
The deblocking filters used in vp8 have been moved to vpx_dsp for
use by both vp8 and vp9.

Change-Id: I5209d76edafc894b550f751fc76d3aa6799b392d
2016-07-12 05:53:00 -07:00
James Zern
45ed7effed Merge "remove *debugmodes.c from the default build" 2016-07-11 23:49:29 +00:00
Scott LaVarnway
2e93fcf893 Merge "vp9_rd_pick_intra_mode_sb(): set interp_filter to" 2016-07-11 22:31:06 +00:00
paulwilkins
3a986eac57 Sample points to reduce encode overhead.
Only noise filter sampled points in first pass to reduce
any first pass speed overhead.

Change-Id: Ic80d4400e59146d1c3332336c4350faf28ff8b17
2016-07-11 11:45:52 +01:00
Scott LaVarnway
ed7786869a vp9_rd_pick_intra_mode_sb(): set interp_filter to
SWITCHABLE_FILTERS.  This is a partial fix for the build
issues with Change 357240.

Change-Id: I4e507c196175bae729a4f1397878ec8776b0146c
2016-07-09 09:47:34 -07:00
Yaowu Xu
5adb43b8be Fix non-highbitdepth coding path for HBD build
Change-Id: I38eb42b8d051924a7cd1ccc3421a4057cf6e170f
2016-07-08 11:26:34 -07:00
Marco Paniconi
20946cdd3b Merge "vp9: Adjustment of gfu_boost and af_ratio for 1 pass vbr." 2016-07-08 16:26:06 +00:00
Yaowu Xu
dc008cc17d Merge "Enable HBD support in real time encoding path" 2016-07-07 22:32:48 +00:00
Marco
cc431ad50a vp9: Adjustment of gfu_boost and af_ratio for 1 pass vbr.
Modify the gfu_boost and af_ratio setting based on the
average frame motion level.

Change only affects 1 pass vbr.

Metrics overall positive on ytlive set.
On average up by ~1%, several clips up by 2-4%.

Change-Id: Ic18c49eb2df74cb4986b63cdb11be36d86ab5e8d
2016-07-07 15:18:14 -07:00
Marco Paniconi
a75965fa94 Merge "vp9: Adjustment to mv bias for non-rd pickmode." 2016-07-07 21:07:37 +00:00
Jingning Han
2f28f9072e Enable coeff optimization for intra modes
This further improves the coding performance by
lowres 0.3%
midres 0.5%
hdres  0.6%

Change-Id: I6a03b6da210b9cbc261474bad4a103e0ba021c68
2016-07-07 12:25:41 -07:00
Jingning Han
44354ee7bf Use precise context to estimate coeff rate cost
Use the precise context to estimate the zero token cost in trellis
optimization process. This improves the speed 0 coding performance
by 0.15% for lowres and 0.1% for midres. It improves the speed 1
coding performance by 0.2% for midres and hdres.

Change-Id: I59c7c08702fc79dc4f8534b64ca594da909e2c91
2016-07-07 12:25:33 -07:00
Jingning Han
62aa642d71 Enable uniform quantization with trellis optimization in speed 0
This commit allows the inter prediction residual to use uniform
quantization followed by trellis coefficient optimization in
speed 0. It improves the coding performance by

lowres 0.79%
midres 1.07%
hdres  1.44%

Change-Id: I46ef8cfe042a4ccc7a0055515012cd6cbf5c9619
2016-07-07 12:25:33 -07:00
Jingning Han
541eb78994 Refactor coeff_cost() function
Move the operations that update the context buffers outside this
function. The coeff_cost() takes all input as const value and returns
the coefficient cost.

This makes preparation for the next coefficient optimization CLs.

Change-Id: I850eec6e5470b91ea84646ff26b9231b09f70a0c
2016-07-07 18:09:39 +00:00
Jingning Han
7c1fdf02cd Merge "Support measure distortion in the pixel domain" 2016-07-07 18:09:20 +00:00
Marco
f451b404ea vp9: Adjustment to mv bias for non-rd pickmode.
Replace the existing mv bias with a bias only for
NEWMV, and based on the motion vector difference of
its top/left neighbors.

For cbr non-screen-content mode.

Change-Id: I8a8cf56347cfa23e9ffd8ead69eec8746c8f9e09
2016-07-07 10:33:06 -07:00
Yunqing Wang
9976ff8c79 Merge "Fix Visual Studio build warning" 2016-07-07 16:48:49 +00:00
Yunqing Wang
9ef37860cd Fix Visual Studio build warning
Fixed signed/unsigned mismatch warning.

Change-Id: I1634d0634de752f4b8baa8059e8f3e2891fa53b6
2016-07-07 08:43:57 -07:00
paulwilkins
2580e7d63e Noise energy Experiment in first pass.
Use a measure of noise energy to adjust Q estimate and
arf filter strength.

Gains 0.3-0.5% on Lowres and |Netflix sets.
Hdres and Midres neutral.

Change-Id: Ic0de552e7b6763e70eeeaa3651619831b423e151
2016-07-07 14:50:21 +01:00
Paul Wilkins
f037cf80c9 Merge "Add experimental spatial de-noise filter on key frames." 2016-07-07 13:30:07 +00:00
Jingning Han
e357b9efe0 Support measure distortion in the pixel domain
Use pixel domain distortion metric in speed 0. This improves the
compression performance by 0.3% for both low and high resolution
test sets.

Change-Id: I5b5b7115960de73f0b5e5d0c69db305e490e6f1d
2016-07-06 18:25:17 -07:00
Yaowu Xu
884c2ddc48 Enable HBD support in real time encoding path
BUG=webm:1223

Change-Id: If83a613784e3b2a33c9c93f9ad0ba39dd4d23056
2016-07-06 14:18:37 -07:00
Debargha Mukherjee
adbad6092f Merge "Remove decode asserts from better-hw-compatibility" 2016-07-06 20:55:29 +00:00
Jacky Chen
aa6108382e Merge "vp9: Choose the scheme for modeling rd for 32x32 based on skin color." 2016-07-06 20:03:55 +00:00
Debargha Mukherjee
4b6e4e1813 Remove decode asserts from better-hw-compatibility
Safer to have the decoder operate normally and have
better-hw-compatibility only implement encoding changes.
Fixes some test failures.

Change-Id: I0dd70d002e4e893992f0cd59774b9363e6f7fe76
2016-07-06 12:26:38 -07:00
Yunqing Wang
a921444fdb Merge "Modify the name of vp9cx_set_ref example" 2016-07-06 18:55:15 +00:00
JackyChen
2678aefc48 vp9: Choose the scheme for modeling rd for 32x32 based on skin color.
For real time CBR mode, use model_rd_for_sb_y for 32x32 if the sb is
a skin sb to avoid visual regression on the slowly moving face.

Refer to the cl: https://chromium-review.googlesource.com/#/c/356020/

Change-Id: I42c36666b2b474ce5ee274239d52ae8ab400fd46
2016-07-06 11:12:03 -07:00
Min Ye
ff19cdafdb Eliminate isolated and small tail coefficients:
Improve hdres PSNR by 0.696%
Improve midres PSNR by 0.313%
Improve lowres PSNR by 0.142%

Change-Id: Icabde78aa9689f539f6a03ec09f712c20758796c
2016-07-06 11:08:23 -07:00
Yunqing Wang
fba5c354ad Modify the name of vp9cx_set_ref example
Modified the name of vp9cx_set_ref example so that the test script
ran correctly.

Change-Id: I0ab2de66220b0a88b7af7ea1633a088ab78dd9ff
2016-07-06 10:05:51 -07:00
Jingning Han
51aad61c8c Merge "Remove txfrm_block_to_raster_xy() from vp9 encoder" 2016-07-06 16:00:18 +00:00
Yunqing Wang
825bb86044 Merge "Make set_reference control API work in VP9" 2016-07-06 00:08:52 +00:00
Jingning Han
14011f037d Remove txfrm_block_to_raster_xy() from vp9 encoder
The transform block row and column positions are always available
outside the callees. There is no need to re-compute these values
again. This approach has been used by the decoder. This commit
removes txfrm_block_to_raster_xy() function.

Change-Id: I5b90f91a0d8b7c35cfa7d171da9edf8202630108
2016-07-04 18:41:47 -07:00
James Zern
5afa3b9150 Merge "improve vpx_filter_block1d* based on replace paddsw+psrlw to pmulhrsw" 2016-07-02 03:08:33 +00:00
James Zern
3197172405 Merge "Update vpx subpixel 1d filter ssse3 asm" 2016-07-02 03:08:17 +00:00
James Zern
3007081a87 vpx_thread: use CreateThread for windows phone
BUG=b/29583578

original webp change:

commit d2afe974f9d751de144ef09d31255aea13b442c0
Author: James Zern <jzern@google.com>
Date:   Mon Nov 23 20:41:26 2015 -0800

    thread: use CreateThread for windows phone

    _beginthreadex is unavailable for winrt/uwp

    Change-Id: Ie7412a568278ac67f0047f1764e2521193d74d4d

100644 blob 93f7622797f05f6acc1126e8296c481d276e4047 src/utils/thread.c
100644 blob 840831185502d42a3246e4b7ff870121c8064791 src/utils/thread.h

Change-Id: Iade8fff6367b45534986c77ebe61abeb45bce0f8
2016-07-01 19:36:58 -07:00
James Zern
7954e67bb8 vpx_thread: use WaitForSingleObjectEx if available
BUG=b/29583578

original webp change:

commit 0fd0e12bfe83f16ce4f1c038b251ccbc13c62ac2
Author: James Zern <jzern@google.com>
Date:   Mon Nov 23 20:40:26 2015 -0800

    thread: use WaitForSingleObjectEx if available

    Windows XP and up

    Change-Id: Ie1a46a82722b8624437c8aba0aa4566a4b0b3f57

100644 blob d58f74e5523dbc985fc531cf5f0833f1e9157cf0 src/utils/thread.c
100644 blob 840831185502d42a3246e4b7ff870121c8064791 src/utils/thread.h

Change-Id: If165c38b378c6e0c55e17a1b071efd3ec3e7dcdd
2016-07-01 19:36:58 -07:00
James Zern
a48d42a804 vpx_thread: use InitializeCriticalSectionEx if available
BUG=b/29583578

original webp change:

commit 63fadc9ffacc77d4617526a50c696d21d558a70b
Author: James Zern <jzern@google.com>
Date:   Mon Nov 23 20:38:46 2015 -0800

    thread: use InitializeCriticalSectionEx if available

    Windows Vista / Server 2008 and up

    Change-Id: I32c5b4e5384d614c5a821ef511293ff014c67966

100644 blob f84207d89b3a6bb98bfe8f3fa55cad72dfd061ff src/utils/thread.c
100644 blob 840831185502d42a3246e4b7ff870121c8064791 src/utils/thread.h

Change-Id: I9ce49b3a86857267e504cd8ceab503b7b441d614
2016-07-01 19:36:58 -07:00
James Zern
8cc525e82b vpx_thread: use native windows cond var if available
BUG=b/29583578

original webp change:

commit 110ad5835ecd66995d0e7f66dca1b90dea595f5a
Author: James Zern <jzern@google.com>
Date:   Mon Nov 23 19:49:58 2015 -0800

    thread: use native windows cond var if available

    Vista / Server 2008 and up. no speed difference observed.

    Change-Id: Ice19704777cb679b290dc107a751a0f36dd0c0a9

100644 blob 4fc372b7bc6980a9ed3618c8cce5b67ed7b0f412 src/utils/thread.c
100644 blob 840831185502d42a3246e4b7ff870121c8064791 src/utils/thread.h

Change-Id: Iede7ae8a7184e4b17a4050b33956918fc84e15b5
2016-07-01 19:36:58 -07:00
James Zern
d4d6c58e37 vpx_thread.[hc]: update webp source reference
+ drop the blob hash, the updated reference will be updated in the
commit message

BUG=b/29583578

Change-Id: Ifabbe52a2f07ac29e1881f5c8a62d7f3eb3c2c04
2016-07-01 19:36:58 -07:00
James Zern
d2b40894be remove *debugmodes.c from the default build
these are debug-only modules that can be added in manually when needed.
leave a reference in vp8_common.mk / vp9_common.mk for easy addition.

quiets -Wmissing-prototypes warning

BUG=b/29584271

Change-Id: Ifc8637d877edfbd562b34dc5c540428bba7951fc
2016-07-01 19:10:04 -07:00
Yunqing Wang
0a075cb39c Make set_reference control API work in VP9
Moved the API patch from NextGenv2. An example was included.
To try it, for example, run the following command:
$ examples/vpx_cx_set_ref vp9 352 288 in.yuv out.ivf 4 30

Change-Id: I4cf8f23b86d7ebd85ffd2630dcfbd799c0b88101
2016-07-01 17:58:02 -07:00
James Zern
3ef9c0ba03 vp8/common/reconintra4x4.c: add missing include
quiets -Wmissing-prototypes warning

BUG=b/29584271

Change-Id: I806e3475ebee579dce0073dd1784a7c2899e7de0
2016-07-01 16:20:42 -07:00
James Bankoski
f5a15f270a Merge "Revert "libyuv: update to 2f101fdb"" 2016-07-01 19:14:53 +00:00
James Bankoski
c5372cf077 Revert "libyuv: update to 2f101fdb"
Compile failures on linux platform.  

BUG=webm:1253

This reverts commit aa81375d73ee33d382e7f717c519db6159e497ee.

Change-Id: Ibab2c4827bc21518dc03c6e9716b5015cff56fc7
2016-07-01 19:14:28 +00:00
Johann Koenig
e616012d69 Merge changes I59a11921,I296a0b81,I397d7753
* changes:
  configure: remove x86inc.asm distinction
  test: remove x86inc.asm distinction
  vpx_dsp: remove x86inc.asm distinction
2016-07-01 18:13:41 +00:00
James Zern
fbbd3f0d8d Merge "convolve_test: fix byte offsets in hbd build" 2016-07-01 01:54:30 +00:00
Jacky Chen
ee78c541a4 Merge "vp9 postproc: Bug fix and code clean." 2016-06-30 21:59:44 +00:00
James Bankoski
892ebd9760 Merge "libyuv: update to 2f101fdb" 2016-06-30 19:11:30 +00:00
Johann
571f00cb95 configure: remove x86inc.asm distinction
BUG=b:29583530

Change-Id: I59a1192142e89a6a36b906f65a491a734e603617
2016-06-30 11:14:14 -07:00
Johann
0266e70c52 test: remove x86inc.asm distinction
BUG=b:29583530

Change-Id: I296a0b81755e3086bc0a40cb126d0200ff03c095
2016-06-30 11:14:10 -07:00
Johann Koenig
3c41d7358c Merge "vp9: remove x86inc.asm distinction" 2016-06-30 17:42:17 +00:00
Johann Koenig
89771f2c2c Merge "Require x86inc.asm" 2016-06-30 17:41:33 +00:00
Paul Wilkins
1d3f1983b2 Merge "Fix error in get_ul_intra_threshold() for 10/12 bit." 2016-06-30 16:26:14 +00:00
Paul Wilkins
f7c2d2a3de Merge "Fix error in get_smooth_intra_threshold() for 10/12 bit." 2016-06-30 16:25:55 +00:00
Jim Bankoski
aa81375d73 libyuv: update to 2f101fdb
Fixes color issue when scaling without breaking mingw.

BUG=https://bugs.chromium.org/p/libyuv/issues/detail?id=605
BUG=https://bugs.chromium.org/p/webm/issues/detail?id=1252

Change-Id: Ifba747feb0c6a08f2b353b820a24c6c145d440ad
2016-06-30 13:25:39 +00:00
paulwilkins
e25d6252a4 Fix error in get_ul_intra_threshold() for 10/12 bit.
The scaling of the threshold for 10 and 12 bit here appears
to be in the wrong direction. For 10 and 12 bit we expect sse
values to be higher and hence the threshold used should be
scaled up not down.

Change-Id: I2678116652b539aef48100e0f22873edd4f5a786
2016-06-30 13:38:57 +01:00
paulwilkins
f9a3d08f1b Fix error in get_smooth_intra_threshold() for 10/12 bit.
This function seems to scale the threshold for testing an
SSE value in the wrong direction for 10 and 12 bit inputs.

Also for a true SSE the scalings should probably be << 4 and 8

Change-Id: Iba8047b3f70d04aa46d9688a824f3d49c1c58e90
2016-06-30 13:34:11 +01:00
Jacky Chen
e85607410e Merge "vp9: Change the scheme for modeling rd for 32x32 on newmv_last mode." 2016-06-30 05:59:46 +00:00
James Zern
f5a6079141 convolve_test: fix byte offsets in hbd build
CONVERT_TO_BYTEPTR(x) was corrected in:
003a9d2 Port metric computation changes from nextgenv2
to use the more common (x) within the expansion. offsets should occur
after converting the pointer to the desired type.

+ factorized some common expressions

Change-Id: I171c3faaa5606d098e984baa9aa74bb36042f57f
2016-06-29 20:39:07 -07:00
Johann
1b833d63d9 vpx_dsp: remove x86inc.asm distinction
BUG=b:29583530

Change-Id: I397d77536b0d3cee0a92cdfe8b76bc4e434d0720
2016-06-29 18:55:58 -07:00
Johann
fe96dbda15 vp9: remove x86inc.asm distinction
BUG=b:29583530

Change-Id: I952da3fc0d4716dec897be0d2e9806af6612722b
2016-06-29 18:55:28 -07:00
Johann
d11c97e8e2 Require x86inc.asm
Force enable x86inc.asm when building for x86. Previously there were
compatibility issues so a flag was added to simplify disabling this
code.

The known issues have been resolved and x86inc.asm is the preferred
abstraction layer (over x86_abi_support.asm).

BUG=b:29583530

Change-Id: Ib935e97b37ffb22d7af72ba0f04564ae6280f1fd
2016-06-29 18:55:12 -07:00
James Zern
0462263765 configure: restore vs_version variable
inadvertently lost in the final patchset of:
078dff7 configure: remove old visual studio support (<2010)

this prevents an empty CONFIG_VS_VERSION and avoids make failure

Change-Id: I529d52eca59329e2715309efd63d80f0e1fed462
2016-06-29 16:57:28 -07:00
JackyChen
5fc2d6cb9f vp9: Change the scheme for modeling rd for 32x32 on newmv_last mode.
For real time CBR mode, use model_rd_for_sb_y for 32x32 if the mode is
newmv last, which is less aggressive in skipping transform and
quantization, to avoid quality regression in some conditions.

Change-Id: Ifa30be587f2a8a4a7f182a172de6ce277c0f8556
2016-06-29 16:28:15 -07:00
James Bankoski
c8f6ed77b9 Merge "Revert "libyuv: update to b8ddb5a2"" 2016-06-29 23:20:25 +00:00
James Bankoski
291033032e Revert "libyuv: update to b8ddb5a2"
This reverts commit b8f83282f8506ad3d839440341bbe683df7d2cf6.

Update was to wrong version and still has: 

BUG=webm:1252

Change-Id: I80f3a7c0581ab5e2dd1a84f7840e51d7c362afac
2016-06-29 23:09:10 +00:00
James Zern
3a6a81fc9a Merge changes I9433d858,Iafd05637,If08ce6ca
* changes:
  tests: remove redundant round() definition
  remove visual studio < 2010 workarounds
  configure: remove old visual studio support (<2010)
2016-06-29 23:07:16 +00:00
Yaowu Xu
b458f42966 Merge "Remove effectless initialization" 2016-06-29 22:51:14 +00:00
James Zern
0a64929f19 tests: remove redundant round() definition
use vpx_ports/msvc.h for compatibility

BUG=b/29583530

Change-Id: I9433d8586cd0b790e7f4d697304298feafe801f1
2016-06-29 14:57:47 -07:00
Yaowu Xu
c02a4beed8 Merge "Prevent negative variance" 2016-06-29 20:53:37 +00:00
Linfeng Zhang
6b350766bd Update vpx subpixel 1d filter ssse3 asm
Speed test shows the new vertical filters have degradation on Celeron
Chromebook. Added "X86_SUBPIX_VFILTER_PREFER_SLOW_CELERON" to control
the vertical filters activated code. Now just simply active the code
without degradation on Celeron. Later there should be 2 set of vertical
filters ssse3 functions, and let jump table to choose based on CPU type.

Change-Id: Iba2f1f2fe059a9d142c396d03a6b8d2d3b981e87
2016-06-29 13:48:41 -07:00
Yaowu Xu
63a37d16f3 Prevent negative variance
Due to rounding, hbd variance may become negative. This commit put in
check and clamp of negative values to 0.

Change-Id: I610d9c8aa2d4eebe7bc5f2c5624a9e3cadad4c94
2016-06-29 11:08:17 -07:00
James Bankoski
f14c323b4c Merge "libyuv: update to b8ddb5a2" 2016-06-29 17:58:40 +00:00
Jim Bankoski
b8f83282f8 libyuv: update to b8ddb5a2
Fixes color issue when scaling without breaking mingw.

BUG=https://bugs.chromium.org/p/libyuv/issues/detail?id=605
BUG=https://bugs.chromium.org/p/webm/issues/detail?id=1252

Change-Id: I3920c5664def7ae7a23f60fb160d26d23bc86a27
2016-06-29 17:53:14 +00:00
paulwilkins
be013eb396 Add experimental spatial de-noise filter on key frames.
For forced key frames in particular this helps to make them
blend better with the surrounding frames where noise tends
to be suppressed by a combination of quantization and alt
ref filtering.

Currently disabled by default under and IFDEF flag pending
wider testing.

Change-Id: I971b5cc2b2a4b9e1f11fe06c67ef073f01b25056
2016-06-29 17:25:41 +01:00
Scott LaVarnway
74bb78df82 Merge "VP9: handle_inter_mode()... Use interp_filter" 2016-06-29 11:41:52 +00:00
James Zern
c125f4a594 remove visual studio < 2010 workarounds
BUG=b/29583530

Change-Id: Iafd05637eb65f4da54a9c857e79204a77646858a
2016-06-28 20:58:49 -07:00
James Zern
078dff72ca configure: remove old visual studio support (<2010)
BUG=b/29583530

Change-Id: If08ce6ca352f377ac4db6b9b1909b507bba6d872
2016-06-28 20:40:22 -07:00
jackychen
6b4463dc1f vp9 postproc: Bug fix and code clean.
Bug fix: The crash is caused by not allocating buffer for prev_mip in
postproc_state and prev_mip in postproc_state is only used for MFQE,
ohter postproc modules, deblocking and etc., should not use it.

BUG=webm:1251

Change-Id: I3120d2f50603b4a2d400e92d583960a513953a28
2016-06-28 16:13:44 -07:00
Scott LaVarnway
feb7e9a372 VP9: handle_inter_mode()... Use interp_filter
only if above/left is inter.

Change-Id: I0cc1f926425c021c84536df8271e9ee5f3f87caf
2016-06-28 14:09:59 -07:00
Jacky Chen
d004c64013 Merge "vp9: Increase thr_var for 32x32 blocks in var-based partitioning." 2016-06-28 20:54:06 +00:00
Jacky Chen
4736e5f9d1 Merge "vp9: Move chroma sensitivity check out from choose_partitioning." 2016-06-28 20:53:23 +00:00
Yaowu Xu
43ae6c1e22 Remove effectless initialization
Change-Id: Iec117841a7ecf6f99d2b718057d8646e221c5c64
2016-06-28 12:28:45 -07:00
James Zern
0afe5e405d Merge "*.asm: normalize label format" 2016-06-28 19:22:10 +00:00
jackychen
91038e0eb6 vp9: Move chroma sensitivity check out from choose_partitioning.
Change-Id: Ie78185a30cac4d1841be3708bd23e6505d3733b6
2016-06-28 09:58:51 -07:00
Yaowu Xu
b2d690187e Merge "psnr.c: use int64_t for sum of differences" 2016-06-28 16:55:44 +00:00
Yaowu Xu
d34b49d7b9 psnr.c: use int64_t for sum of differences
Since the values can be negative.

Change-Id: Idda69e9fb47bb34696aeb20170341a0191c5d85e
2016-06-28 09:53:11 -07:00
Parag Salasakar
10b4753179 Merge "mips added p6600 cpu support" 2016-06-28 08:45:01 +00:00
James Zern
f51f67602e *.asm: normalize label format
add a trailing ':', though it's optional with the tools we support, it's
more common to use it to mark a label. this also quiets the
orphan-labels warning with nasm/yasm.

BUG=b/29583530

Change-Id: I46e95255e12026dd542d9838e2dd3fbddf7b56e2
2016-06-27 19:46:57 -07:00
James Bankoski
32ac7cabdf Merge "Revert "libyuv: update to 1b3e4aee47"" 2016-06-27 22:59:11 +00:00
James Bankoski
7f2628152a Revert "libyuv: update to 1b3e4aee47"
This reverts commit 0c6caf187c59e5d6bdabd8596c1910c6866da7aa.

BUG=https://bugs.chromium.org/p/webm/issues/detail?id=1252

Fails mingw_64 builds.

Change-Id: I83e7204bf1be48b499dc32b2597693b95ec49d06
2016-06-27 22:29:52 +00:00
jackychen
8cbd4f8701 vp9: Increase thr_var for 32x32 blocks in var-based partitioning.
For real-time mode, increase variance threshold for 32x32 blocks in
var-based partitioning for resolution >= 720p, so that it is more
likely to stay at 32x32 for high resolution which accelerates the
encoding speed with little/no PSNR drop.

PSNR effect on different speed settings:
speed 8 rtc: 0.02 overall PSNR drop, 0.285% SSIM drop
speed 7 rtc: 0.196% overall PSNR increase, 0.066% SSIM increase
speed 5 rtc_derf: no effect.

Speed up:
gips_motion_WHD, 1mbps: 2.5% faster on speed 7, 2.6% faster on speed8
gips_stat_WHD, 1mbps: 4.6% faster on speed 7, 5.6% faster on speed8

Change-Id: Ie7c33c4d2dd7d09294917e031357fc5476c3a4bb
2016-06-27 14:44:27 -07:00
James Bankoski
71aacf39c7 Merge "libyuv: update to 1b3e4aee47" 2016-06-27 19:32:50 +00:00
Yaowu Xu
7676defca9 Merge "Port metric computation changes from nextgenv2" 2016-06-27 19:18:00 +00:00
Min Chen
b2fb48cfcf improve vpx_filter_block1d* based on replace paddsw+psrlw to pmulhrsw
Change-Id: I14c0c2e54d0b0584df88e9a3f0a256ec096bea6e
2016-06-27 17:50:45 +00:00
Parag Salasakar
7c184c6e1f mips added p6600 cpu support
Removed -funroll-loops

Change-Id: I6684bcac62902c10f945a6dcc4ed803203fcd829
2016-06-27 13:02:55 +05:30
Yaowu Xu
b9ec759bc2 Fix ubsan warnings: vp9/encoder/vp9_pickmode.c
This commit fixes a number of integer out of range issue in HBD build.

BUG=webm:1219

Change-Id: Ib4192dc74a500e1b86c37a399114c7f6d4ed5185
2016-06-27 05:53:46 +00:00
James Zern
913081ab02 Merge "s/UINT32_MAX/UINT_MAX/" 2016-06-25 21:09:55 +00:00
James Zern
ca88d22f39 s/UINT32_MAX/UINT_MAX/
provides better toolchain compatibility

Change-Id: I8561a6de668a68ff54fe3886a4ee6300f0ae9c04
2016-06-25 12:15:51 -07:00
James Zern
1c0a9f36f1 vp9_pickmode: revert rd modeling change for hbd
Avoids a segfault in high-bitdepth builds.
This restores the condition to its state prior to:
7991241 vp9: Change the scheme for modeling rd for bsize 32x32.

BUG=webm:1250

Change-Id: I6183d5b34cb89dfbf27b7bb589812148a72cd7de
2016-06-25 11:40:26 -07:00
James Zern
cfd5e0221c Revert "Update vpx subpixel 1d filter ssse3 asm"
This reverts commit 1517fb74fd40eaab67246e8fb81d5c321bb33b06.

Fixes a segfault in windows x64 builds.

Change-Id: I6a6959cd7e64a28376849a9f2b11fc852a7c1fbe
2016-06-25 11:37:20 -07:00
Jacky Chen
168eea5d60 Merge "vp9: Change the scheme for modeling rd for bsize 32x32." 2016-06-25 00:43:40 +00:00
James Zern
922751e059 Merge "datarate_test,DatarateTestLarge: normalize bits type" 2016-06-25 00:36:05 +00:00
Jacky Chen
723e357ead Merge "vp9: Code clean, move low temp var logic out of choose_partitioning." 2016-06-24 22:00:49 +00:00
Jim Bankoski
0c6caf187c libyuv: update to 1b3e4aee47
Color issue when scaling.   https://codereview.chromium.org/2084533006/

Change-Id: I84d74346f754c02a5b770b87b6e0b6885d03bb20
2016-06-24 21:57:48 +00:00
James Zern
b34705f64f Merge "cosmetics: Beautify whitespaces and line wrapping" 2016-06-24 21:51:01 +00:00
James Zern
efad6feb9a Merge "cosmetics: Change few types to their posix version" 2016-06-24 21:50:45 +00:00
James Zern
9e5f355daf Merge "cosmetics: Make few conditions clearer" 2016-06-24 21:50:32 +00:00
Yaowu Xu
003a9d20ad Port metric computation changes from nextgenv2
Change-Id: I4aceffcdf7af59ffeb51984f0345c3a4c7e76a9f
2016-06-24 13:52:50 -07:00
jackychen
dd07443f72 vp9: Code clean, move low temp var logic out of choose_partitioning.
Change-Id: I7093e74131e0964471c9993c1e972b4617c4731d
2016-06-24 13:38:22 -07:00
jackychen
7991241a50 vp9: Change the scheme for modeling rd for bsize 32x32.
For real-time CBR mode, use model_rd_for_sb_y_large instead of
model_rd_for_sb_y for 32x32 block. In the former model, transform
might be skipped more aggressively in some condtions, which speeds
up encoding time with only a little PSNR/SSIM drop on rtc test set.
No obvious visual quality regression.

PSNR effect on different speed settings:
speed 8 rtc:  0.129% overall PSNR drop, 0.137% SSIM drop
speed 7 rtc:  0.135% overall PSNR drop, 0.062% SSIM drop
speed 5 rtc_derf: 0.105% overall PSNR drop, 0.095% SSIM drop

Speed up:
gips_motion_WHD, 1mbps: 3.29% faster on speed 7, 2.56% faster on speed8
gips_stat_WHD, 1mbps: 2.17% faster on speed 7, 1.62% faster on speed8

BUG=webm:1250

Change-Id: I818babce5b8549b4b1a7c3978df8591bffde7173
2016-06-24 12:09:13 -07:00
Marco
b582cf0ea9 vp9-svc: Remove some unneeded code/comment.
Change-Id: I710707296042d8586109760544ef68e40ae486c3
2016-06-24 11:43:11 -07:00
Yury Gitman
67611119b5 cosmetics: Beautify whitespaces and line wrapping
Change-Id: I9afa02cae671bd3527cf344695e53d0cc767f549
2016-06-24 10:18:06 -07:00
Yury Gitman
3b2e2f2f77 cosmetics: Change few types to their posix version
Change-Id: I6d7bc9ed7396e7b0d63ee97bfa473fdea002f9ee
2016-06-24 10:18:06 -07:00
Yury Gitman
79436fadfb cosmetics: Make few conditions clearer
Change-Id: Ib024b3e42efc7ce1af56824a4644fdefcd45b215
2016-06-24 10:17:51 -07:00
Yaowu Xu
7ed1d54ab4 Merge "Revert "vp9: Change the scheme for modeling rd for bsize 32x32."" 2016-06-24 16:05:55 +00:00
Yaowu Xu
26daa30da4 Merge "Rationalize type to avoid integer out of range" 2016-06-24 13:58:36 +00:00
Yaowu Xu
7738bcb350 Rationalize type to avoid integer out of range
BUG=webm:1250

Change-Id: Id5bb2762ca1bf996ba4f9a60eec977a7994c1d94
2016-06-24 13:58:02 +00:00
James Zern
73b11ec876 datarate_test,DatarateTestLarge: normalize bits type
quiets a msvc warning:
conversion from 'const int64_t' to 'size_t', possible loss of data

Change-Id: I90a2ac6b040454dac7434fc9b63b98c42ea127b1
2016-06-23 23:29:26 -07:00
James Zern
d4596485be Revert "vp9: Change the scheme for modeling rd for bsize 32x32."
This reverts commit 5c29ee726e622baf6f950dfe980df0d4c116c1a8.

Causes segfaults in VP9/EndToEndTestLarge.EndtoEndPSNRTest.

BUG=webm:1250

Change-Id: I8a30e97be30589abdb76820b5c3c37c46cd6cafb
2016-06-23 15:59:25 -07:00
Johann Koenig
57adf3d573 Merge "configure: clean up var style and set_all usage" 2016-06-23 22:59:21 +00:00
Johann
74a61b5ab9 configure: clean up var style and set_all usage
Use quotes whenever possible and {} always for variables.

Replace multiple set_all calls with *able_feature().

Change-Id: If579d3f718bd4133cf1592b4554a8ed00cf9f2d3
2016-06-23 22:15:13 +00:00
Vignesh Venkatasubramanian
692fe74deb Merge "vp9: Fix potential SEGV in decoder_peek_si_internal" 2016-06-23 21:33:13 +00:00
Linfeng Zhang
bdeb5febe4 Merge "Update vpx subpixel 1d filter ssse3 asm" 2016-06-23 19:08:04 +00:00
Johann Koenig
9eeb1f2fc3 Merge "Fail early when android target does not include --sdk-path" 2016-06-23 19:04:52 +00:00
Angie Chiang
424982bc41 Merge "set interp_filter to SWITCHABLE_FILTER for intra block" 2016-06-23 18:56:27 +00:00
Johann Koenig
5e9c5dfdf0 Merge changes Ifddff89d,I827dfe59,Idca7ef45
* changes:
  vp8 machine setup: mark unused variable
  vp8 realtime encoder: mark unused variable
  vp8 error concealment: remove unused variables
2016-06-23 17:55:34 +00:00
Vignesh Venkatasubramanian
aa1c813c43 vp9: Fix potential SEGV in decoder_peek_si_internal
decoder_peek_si_internal could potentially read more bytes than
what actually exists in the input buffer. We check for the buffer
size to be at least 8, but we try to read up to 10 bytes in the
worst case. A well crafted file could thus cause a segfault.
Likely change that introduced this bug was:
https://chromium-review.googlesource.com/#/c/70439 (git hash:
7c43fb6)

BUG=chromium:621095

Change-Id: Id74880cfdded44caaa45bbdbaac859c09d3db752
2016-06-23 09:39:26 -07:00
Alex Converse
6e4b73125b Merge "vpx_lpf_horizontal_4_sse2: Remove dead load." 2016-06-23 16:20:36 +00:00
Johann
310073868e Fail early when android target does not include --sdk-path
Change-Id: I07e7e63476a2e32e3aae123abdee8b7bbbdc6a8c
2016-06-23 13:48:18 +00:00
Johann Koenig
cc1524aa90 Merge "Add default flags for arm64/armv8 builds" 2016-06-23 13:47:28 +00:00
Johann
6c6eb16bb9 vp8 machine setup: mark unused variable
When building without multithreading and for a non-arm, non-x86 system,
ctx is unused.

Cleans up -Wextra warning:
unused parameter ‘ctx’ [-Werror=unused-parameter]

Change-Id: Ifddff89d2ebd45f7d71e3d415a8f2415dd818957
2016-06-23 13:46:20 +00:00
Johann
3b2c3cb366 vp8 realtime encoder: mark unused variable
'duration' is not used in realtime-only mode:

Cleans up -Wextra warning:
unused parameter 'duration' [-Wunused-parameter]

Change-Id: I827dfe59ebcdc72c5a93fdf7e5aca063433914b1
2016-06-23 13:46:00 +00:00
Johann
55f3740d76 vp8 error concealment: remove unused variables
vp8_conceal_corrupt_mb is an empty function. Remove it entirely.

Cleans up -Wextra warnings:
unused parameter 'mi_stride' [-Wunused-parameter]
unused parameter 'xd' [-Wunused-parameter]

Change-Id: Idca7ef4508fae2b4b76a40d44507522a72ccc2c8
2016-06-22 18:29:03 -07:00
Alex Converse
83db21b2fd vpx_lpf_horizontal_4_sse2: Remove dead load.
Change-Id: I51026c52baa1f0881fcd5b68e1fdf08a2dc0916e
2016-06-22 18:17:41 -07:00
Angie Chiang
d9c417cb49 set interp_filter to SWITCHABLE_FILTER for intra block
In vp9_pick_inter_mode(), instead of using
vp9_get_pred_context_switchable_interp(xd) to assign filter_ref,
we use a less strict condition on assigning filter_ref.
This is to reduce the probabily of entering the flow of not
assigning filter_ref and then skipping filter search.

Overall PSNR gain 0.074% for rtc dataset

Details:
Low    Mid     High
0.185% -0.008% -0.082%

Change-Id: Id5c5ab38d3766c213d5681e17b4d1afd1529e676
2016-06-22 17:19:43 -07:00
Alex Converse
b2597527a5 Merge "Repack vp9_token_state." 2016-06-23 00:17:23 +00:00
Jacky Chen
8496390e73 Merge "vp9: Change the scheme for modeling rd for bsize 32x32." 2016-06-22 23:50:46 +00:00
Johann
ac27b062b0 Add default flags for arm64/armv8 builds
Allows building simple targets with sane default flags.

For example, using the Android arm64 toolchain from the NDK:
https://developer.android.com/ndk/guides/standalone_toolchain.html
./build/tools/make-standalone-toolchain.sh --arch=arm64 \
  --platform=android-24 --install-dir=/tmp/arm64
CROSS=/tmp/arm64/bin/aarch64-linux-android- \
  ~/libvpx/configure --target=arm64-linux-gcc --disable-multithread

BUG=webm:1143

Change-Id: I06f5a7564f5382cf1a4bad41aef4308566c53adf
2016-06-22 23:17:17 +00:00
James Zern
527a9fea76 Merge "remove vp10" 2016-06-22 22:35:57 +00:00
Linfeng Zhang
1517fb74fd Update vpx subpixel 1d filter ssse3 asm
Speed test shows the new vertical filters have degradation on Celeron
Chromebook. Added "X86_SUBPIX_VFILTER_PREFER_SLOW_CELERON" to control
the vertical filters activated code. Now just simply active the code
without degradation on Celeron. Later there should be 2 set of vertical
filters ssse3 functions, and let jump table to choose based on CPU type.

Change-Id: I37e3e9c5694737d9134a6bce6698d3e43f8fc962
2016-06-22 13:15:00 -07:00
Nico Weber
243029faff Merge "win: Include <intrin.h> instead of manually declaring intrinsics." 2016-06-22 19:06:48 +00:00
Nico Weber
8c29d332c9 win: Include <intrin.h> instead of manually declaring intrinsics.
This helps clang-cl.

BUG=chromium:592745

Change-Id: I49f9b6928c91b2b43567f4336520ba4f1010d3ad
2016-06-22 14:44:47 -04:00
jackychen
5c29ee726e vp9: Change the scheme for modeling rd for bsize 32x32.
For real-time CBR mode, use model_rd_for_sb_y_large instead of
model_rd_for_sb_y for 32x32 block. In the former model, transform
might be skipped more aggressively in some condtions, which speeds
up encoding time with only a little PSNR/SSIM drop on rtc test set.
No obvious visual quality regression.

PSNR effect on different speed setting:
speed 8 rtc:  0.129% overall PSNR drop, 0.137% SSIM drop
speed 7 rtc:  0.135% overall PSNR drop, 0.062% SSIM drop
speed 5 rtc_derf: 0.105% overall PSNR drop, 0.095% SSIM drop

Speed up:
gips_motion_WHD, 1mbps: 3.29% faster on speed 7, 2.56% faster on speed8
gips_stat_WHD, 1mbps: 2.17% faster on speed 7, 1.62% faster on speed8

Change-Id: I902f62def225ea01c145d7e5a93497398b8f5edf
2016-06-22 11:17:56 -07:00
Yaowu Xu
ef665996ae Prevent negative variance
Due to rounding used computation, HDB variance computation may produce
slightly negative values. This commit adds clamping to make sure
output variance values for 10 and 12 to be non-negative.

Change-Id: Id679aa55a4c201958c4c7d28cd8733b9246a71c8
2016-06-22 17:55:14 +00:00
Yaowu Xu
b3933e2d3c Merge "Fix ubsan warnings: vp9/encoder/vp9_mcomp.c" 2016-06-22 00:12:58 +00:00
Yaowu Xu
87bf1a149c Fix ubsan warnings: vp9/encoder/vp9_mcomp.c
This commit fixes a number of ubsan warnings in HBD build.

BUG=webm:1219

Change-Id: I05f0fd0ef50e93db4ba34205005c54af1ed32acc
2016-06-21 15:37:59 -07:00
Hui Su
b8ec5dcdf8 Merge "Add a hardware compatibility feature" 2016-06-21 21:33:26 +00:00
Tom Finegan
cb1d152719 Merge "Disable neon for Xcode versions < v6.3." 2016-06-21 17:53:54 +00:00
hui su
a5af392aae 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.

Change-Id: Ic15a938a3107e1b85e96cb7903a5c4220986b99d
2016-06-21 10:33:57 -07:00
Yaowu Xu
b4aa5c9408 Merge "Make type conversion explicit" 2016-06-20 21:34:41 +00:00
Alex Converse
50d3629c61 Repack vp9_token_state.
Reduces size from 32 bytes to 24 bytes on x86_64.

Change-Id: I8a22552343a1fc916117f35267fe6a295250f742
2016-06-20 12:56:32 -07:00
Yaowu Xu
aee577b691 Merge "Fix ubsan warning: vp9/encoder/vp9_encodeframe.c" 2016-06-20 19:33:33 +00:00
Yaowu Xu
543ea3eb3e Make type conversion explicit
This fixes MSVC warnings.

Change-Id: I675d8486230b2b74d7973d95720a4995c4750282
2016-06-20 12:05:29 -07:00
Jingning Han
6929ab0ba6 Merge "Refactor optimize_b for speed performance" 2016-06-20 16:48:22 +00:00
Jingning Han
85786a8ddb Merge "Port optimize_b speed-up from vp10" 2016-06-20 16:48:02 +00:00
Johann Koenig
188420f4fd Merge "Configuration: Use 'is_in' instead of echo | grep" 2016-06-19 23:51:33 +00:00
Johann
7a3d48e56f Fix iosbuild.sh: outdated reference to ios-version.sh
File was removed in b29ebfe91c643b4bab1f24c2b55bf0a5a83cb825 but a
reference was missed.

Change-Id: I7a3d81ab196a70cb5691331705f956cc7dc9bb2a
2016-06-19 16:49:00 -07:00
James Zern
4d9e876b44 realtime_test: remove decoded frame count check
decoding is done if the decoder is available, with errors handled
accordingly. the encoded frame count should be sufficient for this test.

+ remove HandleDecodeResult() as it's redundant given the base
  implementation

BUG=webm:1233

Change-Id: I513c1c3475c58a746f4df627491bdc392fe21416
2016-06-18 11:05:55 -07:00
James Zern
67edc5e83b remove vp10
development has moved to the nextgenv2 branch and a snapshot from here
was used to seed aomedia

BUG=b/29457125

Change-Id: Iedaca11ec7870fb3a4e50b2c9ea0c2b056a0d3c0
2016-06-17 18:26:08 -07:00
Jingning Han
9e185ed177 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%.

Change-Id: I23f47c6e14582520a7f952f03ce8f72183e7f0e6
2016-06-17 17:41:09 -07:00
Jingning Han
dba1d1a63d Port optimize_b speed-up from vp10
This commit back ports the speed-up from vp10. It improves the
unit speed by 15%.

Change-Id: Ibe8c0e0974b03266d6abd16a41e89c3b91d8db2a
2016-06-17 17:41:05 -07:00
Yaowu Xu
40477f1f70 Fix ubsan warning: vp9/encoder/vp9_encodeframe.c
BUG=webm:1219

Change-Id: I29b896c7f61abf871d7853b1d8200aa5a9f6a95c
2016-06-17 17:07:06 -07:00
Jingning Han
1417ed28f3 Merge "Use 64-bit integer to store distortion in optimize_b" 2016-06-17 23:05:33 +00:00
Jingning Han
f99f78c7af Use 64-bit integer to store distortion in optimize_b
This fixes the overflow issue.

Bug=webm:1241

Change-Id: Ia168b7fae1ad214a6837aaa785a08bf8506987dd
2016-06-17 15:07:00 -07:00
DO NOT USE
4f367f5cd9 Merge "Parse codec options in order of occurrence." 2016-06-17 22:03:50 +00:00
Johann
1de5ba75be Configuration: Use 'is_in' instead of echo | grep
Change-Id: I38f7684969f12a624980f4e06698379a49e61bdf
2016-06-17 14:28:19 -07:00
James Zern
9d7a12a0e7 Merge "Fix warnings from gtest under GCC 5 or newer." 2016-06-17 21:18:21 +00:00
Johann Koenig
7055ca556c Merge "Remove ios-version.sh" 2016-06-17 21:08:51 +00:00
Johann
0146fa95ef 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.

BUG=webm:1205

Change-Id: Ic629bfdd06acc04bc5a7227309f36bba54dad8b1
2016-06-17 14:04:51 -07:00
Tom Finegan
bfc75f7382 Disable neon for Xcode versions < v6.3.
vtbl1_u8 is marked unavailable prior to Xcode v6.3.

BUG=webm:1154

Change-Id: I08bd34f712ab7da72658c89d8b606658c1348923
2016-06-17 12:39:14 -07:00
Yaowu Xu
c5fae00227 Merge "Fix ubsan warnings: vp9/encoder/vp9_encoder.c" 2016-06-17 19:29:19 +00:00
Geza Lore
cdd83a0bb2 Fix warnings from gtest under GCC 5 or newer.
Change-Id: I9661f2fe9d315dccae69caa70d929b5d9d93b7db
(cherry picked from commit 4c83fdd3d7cacd66a2c64451db0fb64e5b2ecf48)
2016-06-17 20:11:16 +01:00
Tom Finegan
5a9f21db54 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.

BUG=webm:1233

Change-Id: I5ee4c4e5838c4ca6d24988890aae490b10826db2
2016-06-17 11:25:55 -07:00
Yaowu Xu
754eb95105 Fix ubsan warnings: vp9/encoder/vp9_encoder.c
BUG=webm:1219

Change-Id: I433a688fbbc87094afa888c1e7d49f3eefc0e765
2016-06-17 11:25:11 -07:00
Johann Koenig
a724477d69 Merge "vp8: correct function return types" 2016-06-17 04:19:37 +00:00
Johann Koenig
e9b6172476 Merge "VP8_COMP: make frames_since_golden signed" 2016-06-17 04:19:17 +00:00
James Zern
cf2bfcd9d8 Merge "vp9_pickmode: quiet int64->int conversion warning" 2016-06-17 03:58:46 +00:00
Johann
b29ebfe91c Remove ios-version.sh
The logic can be incorporated into configure.sh

Removes a dependency on ios-version.sh which was not part of DIST-SRCS
and removes a warning from 'make dist' sub builds:

../src/build/make/configure.sh: line 787:
../src/build/make/ios-version.sh: No such file or directory

Change-Id: Ic38314708eb278dd9d2a9769a670da32f6126637
2016-06-16 16:37:45 -07:00
Johann Koenig
ee30cf1408 Merge "vp8_[cd]x_iface.c: Initialize structures to 0" 2016-06-16 23:12:06 +00:00
Johann Koenig
f5713fefa6 Merge "vp8 stats file: initialize to 0" 2016-06-16 22:29:04 +00:00
Johann
6f9982e3c2 vp8_[cd]x_iface.c: Initialize structures to 0
Use vp8_zero() or specify every element.

Cleans warning in Android build:
missing field 'deblocking_level' initializer
vp8_ppflags_t flags = {0};
                        ^
missing field 'sz' initializer
{0},                /* rc_twopass_stats_in */
  ^
missing field 'sz' initializer
{0},                /* rc_firstpass_mb_stats_in */
  ^
missing field 'layer_target_bitrate' initializer
}},
^
missing field 'deblocking_level' initializer
vp8_ppflags_t flags = {0};
                        ^
missing field 'mr_get_mem_loc' initializer
}
^

Change-Id: Iaedde9a77faac7a40316aee67d60d02ba7313500
2016-06-16 22:07:17 +00:00
Johann
f4b5330c50 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))
    ~~~~~~~~~~~~~~~~~~~~~~~~ ^   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Change-Id: Ie137724982f3a46c8c1820548c1960d62a4e96f2
2016-06-16 22:02:30 +00:00
Johann
bd0c981744 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 :
                                           ^

Change-Id: Ia043764e4ce93d2152d2269b1c7b28b5d5f814cf
2016-06-16 21:57:46 +00:00
Johann Koenig
73ae3cdeef Merge "vp8_change_config: fix unsigned/signed comparison" 2016-06-16 21:53:29 +00:00
Yaowu Xu
de3a8f23c8 vpx_dsp/quantize.c: fix ubsan warnings
BUG=webm:1219

Change-Id: I0c80271c6b78adf40aa7a4cac9e6b431d56958cb
2016-06-16 21:46:14 +00:00
Yaowu Xu
e5e998a6eb vpx_dsp/variance.c: change to use correct type
This commit change to use int64_t to represent the sum of pixel
differences, which can be negative.

This fixes a number of ubsan warnings.

BUG=webm:1219

Change-Id: I885f245ae895ab92ca5f3b9848d37024b07aac98
2016-06-16 21:45:48 +00:00
Yaowu Xu
0c1da40ea8 Merge "Fix an ubsan warning: vp9_quantizer.c" 2016-06-16 21:42:41 +00:00
Johann
3108fbd229 vp8 stats file: initialize to 0
Cleans up -Wextra warning:
missing initializer for field ‘intra_error’ of ‘FIRSTPASS_STATS’

Change-Id: I42c1413234aba207f8e89f2e040e14a81bca511e
2016-06-16 14:26:07 -07:00
Johann
db81c34336 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) !=
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  ^

Change-Id: Iac25839cde3425b7b9db7f33740dc46a551b7546
2016-06-16 20:58:37 +00:00
Yaowu Xu
799ab7c064 Merge "Fix ubsan warning: test/datarate_test.cc" 2016-06-16 19:40:21 +00:00
Yaowu Xu
0cb7f545ad Fix ubsan warning: test/datarate_test.cc
BUG=webm:1219

Change-Id: I48470a885cd64a60636a982cd68165c41a702306
2016-06-16 11:25:21 -07:00
Yaowu Xu
c12e61d5a3 Merge "Fix ubsan warning: vp8/encoder/denoising.c" 2016-06-16 18:09:10 +00:00
Yaowu Xu
f180945c18 Merge "Fix ubsan warning: vp8/encoder/onyx_ifc" 2016-06-16 16:44:41 +00:00
Yaowu Xu
77318b0aec Merge "Fix ubsan warning: vp9_cx_iface.c" 2016-06-16 16:44:35 +00:00
Marco Paniconi
8870756ac6 Merge "vp9: Adjustments to nonrd-pickmode for vbr" 2016-06-16 16:07:06 +00:00
Yaowu Xu
159dd0cc39 Fix ubsan warning: vp8/encoder/denoising.c
BUG=webm:1219

Change-Id: Iebdedfb27c70909c0849e169473a2a3ec9f58cc7
2016-06-16 08:53:53 -07:00
Yaowu Xu
354e70dc78 Fix ubsan warning: vp8/encoder/onyx_ifc
BUG=https://bugs.chromium.org/p/webm/issues/detail?id=1219

Change-Id: I4362a1cf79fdcb478b29ddbcdf8091c5f5d10645
2016-06-16 08:32:18 -07:00
Yaowu Xu
1387f5550f Fix ubsan warning: vp9_cx_iface.c
BUG=https://bugs.chromium.org/p/webm/issues/detail?id=1219

Change-Id: I77584af8b9e25db484d9ced6013da3163a9592c0
2016-06-16 08:28:33 -07:00
Yaowu Xu
25110f2837 Fix an ubsan warning: vp9_quantizer.c
BUG=https://bugs.chromium.org/p/webm/issues/detail?id=1219

Change-Id: Ie1bfda4d51c1567f551515f0ed113eec1bc1d98c
2016-06-16 15:23:21 +00:00
James Zern
ff8edd3509 vp9_pickmode: quiet int64->int conversion warning
since:
7901a05 VP9: block_yrd(): Use RD_COST * instead

Change-Id: I808be7a7bc96b81eb7d6255ae96cea7e9b1ecf1f
2016-06-15 23:34:09 -07:00
Hui Su
bbe5ddfdfb Merge "Add vp9 encoder API VP9E_GET_LEVEL to provide bitstream level" 2016-06-15 23:52:19 +00:00
Jacky Chen
7751651ea1 Merge "vp9: Add bias to last frame in choose_partitioning." 2016-06-15 22:50:05 +00:00
Marco
8e070558b0 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.

Change-Id: I0ffbb0a9755563a5acd6230c58236e4f19a47266
2016-06-15 14:31:28 -07:00
Scott LaVarnway
55d0ffeb54 Merge "VP9: block_yrd(): Use RD_COST * instead" 2016-06-15 21:02:45 +00:00
JackyChen
7abc05c9af 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.

Change-Id: I2a2110fe36455f3d8f0fc404aef2228f512e8df8
2016-06-15 13:46:24 -07:00
hui su
72d4890caf Add vp9 encoder API VP9E_GET_LEVEL to provide bitstream level
Change-Id: I1ef3df0192491035728fe9d5eb25cc66dc2965de
2016-06-15 12:53:28 -07:00
Johann Koenig
8767999493 Merge "Match prev_ to number_of_layers" 2016-06-15 18:26:55 +00:00
Johann Koenig
ace4073090 Merge "Use data size directly instead of recomputing." 2016-06-15 18:23:34 +00:00
Jacky Chen
9c90830165 Merge "vp9: Code clean up for short circuit feature in low temp variance." 2016-06-15 16:49:32 +00:00
Scott LaVarnway
7901a051c9 VP9: block_yrd(): Use RD_COST * instead
of int *rate, int *dist.

Change-Id: I7cbaea5252615b6b45b33e896f637cf7d076588a
2016-06-15 05:39:00 -07:00
Scott LaVarnway
221fcdac85 Merge "VP9: minor block_yrd() refactoring" 2016-06-15 11:46:54 +00:00
JackyChen
17962ab2c0 vp9: Code clean up for short circuit feature in low temp variance.
Change-Id: I7573a5cf0ab79abed8d124019c0ed6d9531277f9
2016-06-14 16:53:13 -07:00
Johann
a9936de384 Use data size directly instead of recomputing.
Cleans warning in Android build:
comparison of integers of different signs: 'unsigned int' and 'int'

int n = (int)VPXMIN(sizeof(clear_buffer), data_end - data);
             ^      ~~~~~~~~~~~~~~~~~~~~  ~~~~~~~~~~~~~~~

Change-Id: I964355ceae6b39e22c0196294b25e28387f84945
2016-06-14 22:57:26 +00:00
Johann
c93d30a47f 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
2016-06-14 22:57:14 +00:00
Johann
95d29675b2 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)

Change-Id: If1f118c20ffefd2530fbd371e6787cc8a6c31f0a
2016-06-14 22:55:47 +00:00
Johann
4b8b31838b 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)
    ~~~~~~~~~~~~~~ ^  ~~~~~~

Change-Id: I5cf81c40b103e688a31e1339511f5c9eb27edd38
2016-06-14 22:54:58 +00:00
Johann
c516dd67bc neon hadamard 16x16
Runs about twice as fast as C

BUG=webm:1027

Change-Id: I6760d99f4e22259439ca35d746194b12a81bfa71
2016-06-14 19:23:38 +00:00
Johann Koenig
63eb2ee056 Merge "hadamard 16x16 test" 2016-06-14 19:22:59 +00:00
Jacky Chen
d5be4a17ef Merge "vp9: Encoding cycle reduction for speed 8." 2016-06-14 15:41:32 +00:00
Paul Wilkins
19a4ce904d Merge "Small re-arrangement." 2016-06-14 11:46:58 +00:00
Johann
32ff4906da hadamard 16x16 test
BUG=webm:1027

Change-Id: Ibe58781905b372b9fe29dace39b4bfdd33fd0f83
2016-06-13 19:09:56 -07:00
JackyChen
f9c0587200 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.

Change-Id: Ib43b5b20e67809d03c5a6890818ddff59e1fc94a
2016-06-13 09:33:22 -07:00
Scott LaVarnway
580317160c VP9: minor block_yrd() refactoring
Change-Id: Ic0a81fb5816c8252ca4876753320fde5c28d893f
2016-06-13 07:35:45 -07:00
Marco Paniconi
181988d372 Merge "vp9: Put lower limit on frames_to_key adjustment to gf interval." 2016-06-10 22:49:48 +00:00
Debargha Mukherjee
c1bfa6a846 Merge "Add a couple of missing WRAPLOW checks" 2016-06-10 21:55:36 +00:00
James Zern
40e3bf8630 Merge "vp9_diamond_search_sad_avx cosmetics" 2016-06-10 17:30:39 +00:00
Marco
9b61c709c4 vp9: Put lower limit on frames_to_key adjustment to gf interval.
For 1 pass vbr.

Change-Id: I6c1c1cca3944150140e896e175b07ed518641b9b
2016-06-10 10:08:56 -07:00
Scott LaVarnway
2a0e1bcc83 vp9_diamond_search_sad_avx cosmetics
Fixed cosmetic issues noted in Change 349854.

Change-Id: I1d94070e4066fa920173013c5a36a30dd1cb357d
2016-06-10 04:56:21 -07:00
James Zern
e34944ad26 Merge changes I58081309,I502fd707
* changes:
  fdct8x8_test: fix unsigned overflow
  fdct4x4_test: fix unsigned overflow
2016-06-09 22:54:13 +00:00
Debargha Mukherjee
697bcef677 Add a couple of missing WRAPLOW checks
To make coefficient checking consistent with the VP9 spec sections
8.7.1.6 and 8.7.1.1.

Change-Id: I92e38e89a41d1e482317bb478c48ffa608d2d6ee
2016-06-09 12:58:27 -07:00
paulwilkins
fba94b8cfd Small re-arrangement.
Move initialization of a some new "twopass" values
to the function vp9_init_second_pass() and some other
small  changes.

Remove #if GROUP_ADAPTIVE_MAXQ as this is always
enabled now.

Change-Id: I1dbec2fd7c419779848aa987c4cd7824d4df8456
2016-06-09 11:32:34 +01:00
James Zern
5b7960fa82 vp9_subexp.h: normalize function prototype
vp9_prob_diff_update_savings_search_model

updated in:
19e0b40 Refactor probability savings search.

Change-Id: I13ae3106961f0271f51df17ee1c70c99f2d75f8f
2016-06-08 22:55:53 -07:00
Marco Paniconi
5aeadbb4f6 Merge "vp9: Use nonrd_pick_partition on scene-cut, for speed 5 vbr mode." 2016-06-09 00:49:02 +00:00
James Zern
95d2dc8981 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

Change-Id: I580813093ee46284fde7954520dfcb1188f79268
2016-06-08 17:33:34 -07:00
James Zern
06c6e4cbf6 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

Change-Id: I502fd707823c4faaa7f587c9cc0312f057e04904
2016-06-08 17:29:02 -07:00
Marco
3fc01f95da 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.

Only affects 1 pass vbr mode, speed = 5.

Change-Id: I07c89cbdc75f5bb16eb8e0e2773ead0980d2de5c
2016-06-08 16:05:59 -07:00
Marco
77ffea92c5 vp9: Reduce overshoot factor for setting longer gf interval.
Only affects 1 pass vbr mode.

Change-Id: Ifd7ff3771eabe322a371b35b159cace6baa3b070
2016-06-08 15:15:15 -07:00
Alex Converse
d00aaa9c12 Merge "Refactor probability savings search." 2016-06-08 17:49:52 +00:00
James Zern
97b4f8fe92 Merge "Revert "remove vp9_diamond_search_sad_avx.c"" 2016-06-08 02:56:00 +00:00
Hui Su
28a93d6588 Merge "Avoid a potential assertion fail in optimize_b()" 2016-06-08 00:33:48 +00:00
Scott LaVarnway
eb09bbe88b Revert "remove vp9_diamond_search_sad_avx.c"
This reverts commit be12fefa4b7d224e9f39275a6bb4fab01b8bae3b
and commit 057c1c4034ba5b9bf360c5c1f600ebc6d0718c3a.

Also, the mismatch between the avx version and the
c version has been fixed.

BUG=https://bugs.chromium.org/p/webm/issues/detail?id=1168

For a rt encode using 1080p@60fps material, up to 11% performance
improvement overall was seen.

Change-Id: Icd1f216209ebc6fc0b8da885f32f356fa4355ed0
2016-06-07 17:21:01 -07:00
hui su
a554bd8dac Avoid a potential assertion fail in optimize_b()
The eob of a block is not perperly set when skip_recode is true,
thus triggering assert(eob <= default_eob) to fail.

Change-Id: Ifecbe33dce2dc4903e0a80bd384dc09bf0dd8a44
2016-06-07 15:45:04 -07:00
James Zern
dd217d3df1 Merge "ivfdec: tolerate invalid framerates (2)" 2016-06-07 22:39:49 +00:00
Marco Paniconi
01882a9ee8 Merge "vp9: Replace the avg_size_inter metric, for 1 pass vbr." 2016-06-07 22:27:33 +00:00
Johann Koenig
ef1fb6deb4 Merge changes I999ef597,Ic6dc9f53
* changes:
  configure: Add -mstackrealign flags to CFLAGS on OS/2
  vpx: Add OS/2-specific threading codes
2016-06-07 21:43:55 +00:00
Marco
f0b08aa4fa vp9: Replace the avg_size_inter metric, for 1 pass vbr.
Code cleaup, use existing rolling_actual/target metrics instead,
set threshold to get same/similar effect.

Little/no change in metrics on ytlive set.

Change-Id: I74f3c3d0a143a9cf20dc9c3dee54c0f7e6a97a51
2016-06-07 11:29:33 -07:00
Marco
3de42ac27b 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).

Change-Id: I1c1d72425c86c69419ea43fb9730130e81062f91
2016-06-07 09:51:41 -07:00
Debargha Mukherjee
c2ebd0e6da Merge "Move range checks into WRAPLOW" 2016-06-06 16:28:24 +00:00
James Zern
7982914c37 ivfdec: tolerate invalid framerates (2)
add an upper bound to the framerate denominator above which 30fps will
be reported; fixes warning in corrupt / fuzzed files

Change-Id: I46a6a6f34ab756535cd009fe12273d83dcc1e9f1
2016-06-03 18:04:54 -07:00
James Zern
e34e684059 Merge changes If31d36c8,I10b947e7
* changes:
  vpx_dsp,add_noise: remove mmx implementation
  vpx_dsp: remove mmx variance implementations
2016-06-04 00:56:06 +00:00
James Zern
4539267916 Merge "Fix Visual Studio build failure in filter_selectively_vert_row2() calls" 2016-06-03 20:07:47 +00:00
Debargha Mukherjee
aa90983696 Move range checks into WRAPLOW
Provides more comprehensive coverage for --enable-coefficient-checking.
The intent is to make the --enable-coefficient-checking option
consistent with the VP9 spec.

Change-Id: I12d0120756d17572ca2b2d7e6a2ab9d8071d8d58
2016-06-03 11:27:33 -07:00
Paul Wilkins
03a401c4d9 Merge "Slightly more damped VBR adjustment." 2016-06-03 17:14:12 +00:00
Paul Wilkins
fd38ef4b99 Merge "Change to get_twopass_worst_quality()" 2016-06-03 17:13:51 +00:00
Paul Wilkins
a160533e41 Merge "Removed unused data structure." 2016-06-03 17:13:33 +00:00
Paul Wilkins
bfff16af67 Merge "Adjustment to VBR rate correction." 2016-06-03 17:13:14 +00:00
Paul Wilkins
5ef54c1536 Merge "Adjustment calculation of active worst quality." 2016-06-03 17:12:52 +00:00
Paul Wilkins
7a586cad07 Merge "Remove gf_zeromotion_pct." 2016-06-03 17:12:25 +00:00
Linfeng Zhang
304d310975 Fix Visual Studio build failure in filter_selectively_vert_row2() calls
Error messages:
 ..\vp9\common\vp9_loopfilter.c(1312): warning C4244: 'function' :
conversion from 'uint64_t' to 'unsigned int', possible loss of data
[.build-x86_64-win64-vs10\vpx.vcxproj]

..\vp9\common\vp9_loopfilter.c(1313): warning C4244: 'function' :
conversion from 'uint64_t' to 'unsigned int', possible loss of data
[.build-x86_64-win64-vs10\vpx.vcxproj]

..\vp9\common\vp9_loopfilter.c(1312): error C2220: warning treated as
error - no 'object' file generated
[.build-x86_64-win64-vs10\vpx.vcxproj]

Change-Id: Ia69260611997cd2ba41c7184a85ecead740a7c07
2016-06-03 09:36:58 -07:00
Linfeng Zhang
b90166665f Merge "Slow pshufb removal in 3 intra prediction functions." 2016-06-03 16:35:14 +00:00
Jacky Chen
a8c8bf1c99 Merge "vp9: Fix valgrind failure for short circuit on low temporal vaiance block." 2016-06-03 16:09:36 +00:00
paulwilkins
45a26dd9c8 Slightly more damped VBR adjustment.
Increase in the damping used in adjusting the active Q range.
This does hurt rate accuracy a little in a few extreme cases
especially if the clip is very short*, but helps metrics.

* Note that the adjustment is applied at the GF/ARF group level based
on what happened in the last group.  Hence for very short clips where
the length of a single group may be a significant % of the clip length
there is still scope for some drift that cannot be accommodated.

In practice most data points in our test sets are now much closer to target
than was previously the case with default settings and in some cases are
better even than they were with the command line undershoot and overshoot
parameter was set very low (e.g. 2%). For example in bridge_close at high rates
the old mechanism was unable to adapt enough to prevent extreme overshoot.

Change-Id: I634f8f0e015b5ee64a9f0ccaa2bcfdbc1d360489
2016-06-03 13:19:51 +01:00
paulwilkins
552fd02cf0 Change to get_twopass_worst_quality()
Change to the calculation of the error divisor used in
get_twopass_worst_quality(). This follows on from other
changes to the rate control that impact the output of this
function.

Change-Id: I414fa9aa1e6a68a64dccea17c3712f44b8a0c10c
2016-06-03 13:18:29 +01:00
paulwilkins
f9865d1701 Removed unused data structure.
Removed unused element from TWOPASS data structure.

Change-Id: I9b662fd8eea727a7978055bc14f7c7328f048a5e
2016-06-03 13:18:09 +01:00
paulwilkins
c7ac2f3864 Adjustment to VBR rate correction.
Changes to the function the redistributes bits from overshoot
or undershoot throughout the rest of the clip to respond more
quickly.

Change-Id: I90f10900cdd82cf2ce1d8da4b6f91eb5934310da
2016-06-03 13:17:43 +01:00
paulwilkins
cd700e1ab9 Adjustment calculation of active worst quality.
Added a factor based on the bit spend in the last arf group vs the
target to adjust the choice of the active worst quality in subsequent
groups.

Helps clips where previously there was a big overshoot or undershoot
to adapt and get closer to the target rate.

Change-Id: I67034b801679b99024409489a2273ea6fe23b8e6
2016-06-03 13:17:21 +01:00
paulwilkins
4328b08521 Remove gf_zeromotion_pct.
The use of this value is preventing rate adjustment on clips
or sections that have very little motion but high noise and
this can give rise to some sections with massive overshoot.

Change-Id: I9a65c7c1148dc5d3a7d8b23e50fc1733f3661621
2016-06-03 12:13:03 +01:00
James Zern
462e0ff88b vpx_dsp,add_noise: remove mmx implementation
a sse2 version exists, this is a reasonable modern baseline.

Change-Id: If31d36c8412d25b53f41b4a93cf02f46802c0c33
2016-06-02 23:51:22 -07:00
James Zern
eea8ea88ab vpx_dsp: remove mmx variance implementations
there are sse2 equivalents for all remaining variance implementations

Change-Id: I10b947e73fc0067688181f819b59e47966bec3d2
2016-06-02 23:46:16 -07:00
James Zern
7aef9790cf Merge "ivfdec: tolerate invalid framerates" 2016-06-03 03:15:01 +00:00
JackyChen
891dbe1e52 vp9: Fix valgrind failure for short circuit on low temporal vaiance block.
Add check for actual split before using the variance of the split.

Change-Id: If0f93248be0b16d17738675d16c90516054dad2b
2016-06-02 15:56:58 -07:00
Linfeng Zhang
ad0646cb84 Slow pshufb removal in 3 intra prediction functions.
Replaced vpx_d45_predictor_4x4_ssse3(), vpx_d45_predictor_8x8_ssse3()
and vpx_d207_predictor_4x4_ssse3() with
created vpx_d45_predictor_4x4_sse2(), vpx_d45_predictor_8x8_sse2()
and vpx_d207_predictor_4x4_sse2() respectively.
It's mostly neutral or slightly worse than ssse3 in good cases and
better than ssse3 in the bad cases (but still worse than using the mmx
regs).

Change-Id: Ib0237ceb71d2c57b8a93fd3170330cfed9d56bdd
2016-06-02 10:55:58 -07:00
JackyChen
a32f341539 Disable short circuit feature for low temporal variance.
The featrue fails in libvpx_unit_tests-valgrind. Will re-enable it after
fixing the issue.

Change-Id: I8ba132f04e98f4615b31fbff2097eda83c5e42bc
2016-06-02 09:45:00 -07:00
Linfeng Zhang
10969dfc6e Merge "Update filter_selectively_vert_row2()" 2016-06-02 16:22:21 +00:00
Yaowu Xu
100dfc9eab Merge "firstpass.c: fix an UBSAN/IOC error" 2016-06-02 16:20:06 +00:00
Yaowu Xu
fd500f955f firstpass.c: fix an UBSAN/IOC error
Change-Id: I579286e6741b689ae4281a35beb7b8f95c3ffce5
2016-06-02 00:31:32 +00:00
jackychen
bacc67f4a8 vp9: Skip some modes when variance is low for big blocks, for 1 pass real-time.
Skip intra-mode and some inter-modes (newmv, nearmv, nearestmv) for
golden frame if the variance got from choose_partitioning is very low.
Only for 1 pass real-time CBR mode and bsize >= 32x32, it has ~2.5%
speed up with less than 0.1% PSNR drop for rtc test set. Don't see
visual regression.

Change-Id: I70efbc95a1007231ae36f02c5b2fbf6cd35077ad
2016-06-01 13:54:18 -07:00
Linfeng Zhang
b26232eb1b Update filter_selectively_vert_row2()
Reduce operations and jumps. perf shows CPU time reduced from 1.9% to
1.6% when decoding fdJc1_IBKJA.248.webm on Xeon E5.
Will apply the changes to vp10 after code review.

Change-Id: I9351509922855d8896ddef1ed093b3ca12619a61
2016-06-01 11:20:47 -07:00
Marco Paniconi
204809bfb3 Merge "vp9: Skip computation of best_sad for newmv, unless needed." 2016-06-01 17:37:29 +00:00
Yaowu Xu
6382727dc5 Fix UBSAN/IOC errors
1. test/dct16x16_test.cc
2. test/dct32x32_test.cc
3. test/fdct8x8_test.cc

BUG=webm:1225

Change-Id: I9c9315fbd65ddb3b44f688e01ba265fd22192198
2016-06-01 16:01:18 +00:00
Yaowu Xu
787b38ebb9 Fix VP8 encoder UBSAN/IOC errors
1. vp8/decoder/dboolhuff.c
2. vp8/decoder/dboolhuff.h
3. vp8/encoder/bitstream.c
4. vp8/encoder/boolhuff.h
5. vp8/encoder/rdopt.c

BUG=https://bugs.chromium.org/p/webm/issues/detail?id=1218

Change-Id: I5d315d63fd7aeaee6f3bd79178e593f3db38a6b1
2016-06-01 16:00:56 +00:00
James Zern
e5e2932cb3 ivfdec: tolerate invalid framerates
default invalid framerates to 30, quiets warnings in corrupt / fuzzed
files

Change-Id: Ib10d2b67df83cb6f9ed1cd6ef8e0e637aa7099ff
2016-05-31 17:37:59 -07:00
Yaowu Xu
46ff1072b3 variance_avx2.c: UBSAN/IOC fix
BUG=https://bugs.chromium.org/p/webm/issues/detail?id=1222

Change-Id: Ifb3bedf9b4e1b007b21aebaa4beb9ba50424efef
2016-05-31 16:44:35 -07:00
Marco
bedf1c3af6 vp9: Skip computation of best_sad for newmv, unless needed.
For non-rd pickmode:
best_pred_sad, computed for NEWMV-last, is only used for
skipping golden non-zero modes. Add condition to avoid this
computation if not used (i.e, if golden nonzero modes are not used).

And remove code for computing best_pred_sad for NEWMV-golden,
since that sad is not used.

No change in behavior; small speed gain (~1%) for svc encodes.

Change-Id: Ic2cbdef6c4e9a233a57c0db0eeac8ad5fcead366
2016-05-31 10:29:00 -07:00
Tom Finegan
f80d8011a0 Merge "vpx_ports/mem_ops.h: cast the lhs of bitwise shifts of 24." 2016-05-27 18:52:05 +00:00
James Zern
f6ac6cf5bd Merge "acm_random,Rand9Signed: correct cast" 2016-05-27 18:32:06 +00:00
Linfeng Zhang
2ab7b9a6c9 Merge "Upgrade fwht4x4_mmx() to fwht4x4_sse2() for vp9 and vp10." 2016-05-27 17:51:35 +00:00
James Zern
13d48c4267 acm_random,Rand9Signed: correct cast
convert the random value to int16 before subtracting 256 from it; quiets
a ubsan (sanitize=integer) warning

BUG=webm:1225

Change-Id: Ibc2c5a21f30e112bd6c180f7d6a033327c38d0df
2016-05-27 10:33:56 -07:00
Linfeng Zhang
af7fb17c09 Upgrade fwht4x4_mmx() to fwht4x4_sse2() for vp9 and vp10.
Function level timing test shows about 27% time saving on
a Xeon E5-2680 v2 desktop.

Rename vp9_dct_sse2.c to vp9_dct_intrin_sse2.c for vp9 and
rename dct_sse2.c to dct_intrin_sse2.c for vp10 to avoid
duplicate basenames.

Actually vp9_fwht4x4_mmx/sse2() and vp10_fwht4x4_mmx/sse2()
are identical. TODO: They should be unified later if there is
no intention to keep a duplicate.

Change-Id: I3e537b7bbd9ba417c606cd7c68c4dbbfa583f77d
2016-05-27 09:51:16 -07:00
Tom Finegan
f1de622617 vpx_ports/mem_ops.h: cast the lhs of bitwise shifts of 24.
C does not allow for shifting into the sign bit of a signed
integer, and the two instances here become signed ints via
promotion. Explcitly cast them to unsigned MEM_VALUE_T to
avoid the problem.

BUG=https://bugs.chromium.org/p/chromium/issues/detail?id=614648

Change-Id: I51165361a8c6cbb5c378cf7e4e0f4b80b3ad9a6e
2016-05-27 09:23:11 -07:00
Linfeng Zhang
0ba9b299e9 Merge "Upgrade vpx_lpf_{vertical,horizontal}_4 mmx to sse2" 2016-05-27 15:47:28 +00:00
Linfeng Zhang
4b5e462d08 Upgrade vpx_lpf_{vertical,horizontal}_4 mmx to sse2
Followed the code style of other lpf fuctions.
These 2 functions put 2 rows of data in a single xmm register,
so they have similar but not identical filter operations,
and cannot share the same macros.

Change-Id: I3bab55a5d1a1232926ac8fd1f03251acc38302bc
2016-05-26 14:55:18 -07:00
Yaowu Xu
ff6accf936 Merge "Convert to unsigned int before left shift" 2016-05-26 21:29:50 +00:00
Yaowu Xu
301e345273 Convert to unsigned int before left shift
This is to fix overflow when 128 is left shifted by 24.

Change-Id: Ibb5f6813536d985afa003a9848c0c3dd358955a7
2016-05-26 08:46:01 -07:00
Scott LaVarnway
9d24fe60f1 Merge "Code clean of sub_pixel_variance4xh -- 2" 2016-05-26 13:20:24 +00:00
Marco
75d551783d vp9: Add datarate test for 1 pass VBR mode.
Existing tests are only for CBR mode.

Change-Id: Ie3b2cd46236457748e2650901d1a347a730f38af
2016-05-25 14:20:30 -07:00
Alex Converse
19e0b406c9 Refactor probability savings search.
- Avoid excessive copying

- Don't both searching if no update can possibly offer savings

- Simplify the interface

- Remove the confusing vp9_cost_upd256 macro

Change-Id: Id9d9676a361fd1203b27e930cd29c23b2813ce59
2016-05-25 13:00:09 -07:00
Yaowu Xu
e5b7f14ea7 Merge "Fix comments in build_intra_predictors_high()" 2016-05-25 19:58:18 +00:00
Yaowu Xu
ba8651d474 Fix comments in build_intra_predictors_high()
1. Removed TODOs, no longer applicable to finalized vp9 profiles.
2. Added explanation on assumed values for highbitdepth profiles.

Change-Id: I59e0bebaaab900cc611ed284daa5fa0bdedb8097
2016-05-25 12:18:35 -07:00
Yaowu Xu
75b6cfe1c5 Prevent read to invalid RefBuffer
This commit adds check to validate RefBuffer before reading into the
data structure, to prevent invalid read.

BUG=https://bugs.chromium.org/p/chromium/issues/detail?id=614701

Change-Id: Ie111e95bd18e88fa19d8b25e097cdf52b7139cb6
2016-05-25 09:28:36 -07:00
James Zern
7acd0a59ca Merge "remove vp9_diamond_search_sad_avx.c" 2016-05-25 00:08:38 +00:00
Brion Vibber
35d7e17b03 Move git version extras out of iOS shared framework bundle version
Apple's version format specification is strictly checked on app
store submission, even for embedded frameworks:

http://apple.co/1WgelY1

    The build version number should be a string comprised of
    three non-negative, period-separated integers with the
    first integer being greater than zero. The string should
    only contain numeric (0-9) and period (.) characters.

So that's room for "1.5.0" but not for "1.5.0-906-g656f9c4".

The full version returned from 'version.sh --bare' is now
embedded under a 'VPXFullVersion' custom key in the Info.plist,
so it can still be extracted from the resulting framework.

Change-Id: If34a58d02e407379d1f1859fda533ef7f983170b
2016-05-24 13:08:25 -07:00
James Zern
be12fefa4b remove vp9_diamond_search_sad_avx.c
vp9_diamond_search_sad_avx was disabled in:
057c1c4 disable vp9_diamond_search_sad_avx

this removes a missing prototype warning as the prototype is no longer
included in vp9_rtcd.h. the file can be restored if someone gets around
to fixing the issue.

BUG=https://bugs.chromium.org/p/webm/issues/detail?id=1168

Change-Id: Ia9fda4b81c53dc5fba7c31d780d761f886940b52
2016-05-24 12:02:22 -07:00
Scott LaVarnway
a4f3751be5 Code clean of sub_pixel_variance4xh -- 2
Replace MMX with SSE2.

Change-Id: Id8482d2589131f9427e7f36bc64413f058caf31f
2016-05-24 04:44:05 -07:00
KO Myung-Hun
72e332f767 configure: Add -mstackrealign flags to CFLAGS on OS/2
Many codes require -mstackrealign flags. Although -mstackrealign has
been already added to CFLAGS of some modules, SIGSEGV occurs in other
modules than those modules.

The best way may be to find causes and to fix them. However, we
cannot know those causes until SIGSEGV occur really. In addition, if
SIGSEGV occurs in other programs, it will be fatal.

So adding -mstackrealign flags to CFLAGS unconditionally is
reasonable.

Change-Id: I999ef597a6afe97f5e7cc7bffaa866537c3eedd2
2016-05-22 18:11:59 +09:00
KO Myung-Hun
14e8adea3c vpx: Add OS/2-specific threading codes
With correction of a type of a thread function for new threading
codes.

Change-Id: Ic6dc9f530698800d1cfe2da327848e8f8b62e31f
2016-05-22 18:11:50 +09:00
jackychen
6f397b8a5b vp9: Remove a redundent condition in sub-pixel filter choosing.
Change-Id: I5cbb0f452ec9622437482b3a9496ead1253acfe0
2016-05-20 14:38:45 -07:00
James Zern
4f774ac50e Merge "vp8/error_concealment: remove shift of negative value" 2016-05-20 19:15:53 +00:00
James Zern
e4bdbd3c0b Merge "Revert "Code clean of sub_pixel_variance4xh"" 2016-05-20 19:11:06 +00:00
James Zern
3fb55d24e8 Revert "Code clean of sub_pixel_variance4xh"
This reverts commit 2468163e0770108f5216b65445ce05a8241bca21.

causes valgrind errors for overread of buffer in SubpelVarianceTest

Change-Id: I448e52c76f815ac199305b71f7d169f2bc167679
2016-05-19 23:37:27 -07:00
James Zern
84e3639454 Revert "Extend the external fb interface to allocate individual planes."
This reverts commit 6dd7f2b50a65373aa906d678cb5a29fb65531a55.

conversion warnings, crashes in 32-bit builds

Change-Id: I529ead34cd93c862dd07c9a29d8542dda2fc20ea
2016-05-19 23:33:51 -07:00
James Zern
971c5a16a9 vp8/error_concealment: remove shift of negative value
fixes:
shifting a negative signed value is undefined [-Wshift-negative-value]

Change-Id: I3a55f2dac7c51c0e264d40081ffce98e2abacb89
2016-05-19 19:19:19 -07:00
Jacky Chen
fa5d54f937 Merge "vp9: Refactor some denoiser logic in vp9_pick_inter_mode." 2016-05-19 23:05:32 +00:00
JackyChen
af0a9fcf70 vp9: Refactor some denoiser logic in vp9_pick_inter_mode.
Move the logic for rechecking zeromv on denoised block out to simplify
the function. To simplify the param passing, add a new structure
VP9_PICKMODE_CTX_DEN which is only used when denoiser is enabled.

Change-Id: Iaa9b4396dfcb8147236c02d4a1868a09103a4476
2016-05-19 15:28:25 -07:00
Daniele Castagna
04fdbdc5ca Merge "Extend the external fb interface to allocate individual planes." 2016-05-19 18:01:59 +00:00
Yaowu Xu
d1f0f4cc63 Merge "Clarify integer value ranges" 2016-05-18 23:55:05 +00:00
Yaowu Xu
489f8b2d88 Merge "Prevent invalid read" 2016-05-18 23:54:56 +00:00
James Zern
146ccd304f Merge "Code clean of sub_pixel_variance4xh" 2016-05-18 23:18:35 +00:00
Alex Converse
284be1c9e0 Merge "Move, rename, and inline high_inter_predictor." 2016-05-18 21:20:04 +00:00
Daniele Castagna
6dd7f2b50a Extend the external fb interface to allocate individual planes.
Change-Id: I73e1b9ea6f4c76ae539e2b3292ee4c751d9c7de4
2016-05-18 16:20:18 -04:00
Johann Koenig
36b610d8c1 Merge "neon hadamard 8x8" 2016-05-18 20:11:16 +00:00
Yaowu Xu
a564b18d7f Clarify integer value ranges
This commit clarifies integer value range for vairables used in
several variance functions, also change to use proper type
conversion to reflect the value ranges.

Change-Id: Ic3234b83a912ce1ad12d1b254f3378763e15cc5c
2016-05-18 10:25:12 -07:00
Alex Converse
a5191f3e60 Move, rename, and inline high_inter_predictor.
The inlining mirrors what was done with the low bit depth
inter_predictor. And the new highbd_inter_predictor name is more
consistent with other high bit depth functions.

Change-Id: I96437f745759aeec6260c6e39a974bf36f1c211c
2016-05-18 09:39:49 -07:00
Yaowu Xu
4f0e4d6cef Prevent invalid read
This commit adds a check before reading into RefBuffer to prevent OOB
read.

BUG=https://bugs.chromium.org/p/chromium/issues/detail?id=612023

Change-Id: I5b02951932e7f457cfbe6b2e650790496b8577ae
2016-05-18 07:40:49 -07:00
Scott LaVarnway
8b8e296019 Merge "VP9: _get_pred_context_switchable_interp()" 2016-05-18 12:42:54 +00:00
Scott LaVarnway
2468163e07 Code clean of sub_pixel_variance4xh
Replace MMX with SSE2.

Change-Id: Ia8fcba755952804e347d7d7736f57d1f90c988a0
2016-05-18 04:24:41 -07:00
Scott LaVarnway
3036fd761a VP9: _get_pred_context_switchable_interp()
Remove unnecessary checks.

Change-Id: Ic7bce8277ac5f4ae88d4ab7d0ae3ab110b2f225b
2016-05-17 15:26:12 -07:00
Yaowu Xu
2240d83d78 Promote to uint32_t before left shift
This commit change to promote uint8_t explicitly to uint32_t before
left shift operation.

BUG=https://bugs.chromium.org/p/chromium/issues/detail?id=612021

Change-Id: Id7059154efb5bdfa45889dabe72aaafd46d79f23
2016-05-17 11:39:57 -07:00
Marco Paniconi
bdfbd6325e Merge "vp9: Update to rc-metric for keeping track of average frame size." 2016-05-16 21:09:46 +00:00
Hui Su
57d30b7b4d Merge "Add level test for VP9" 2016-05-16 20:55:10 +00:00
Johann
9b54e812f7 neon hadamard 8x8
Runs about 30% faster than the C

BUG=webm:1021

Change-Id: I6809d6d84c3077ab619c53298296950e976bdaba
2016-05-16 11:58:02 -07:00
hui su
cafbf63d30 Add level test for VP9
Change-Id: I99f50bdd5af3f64a029c2f5f6f5fb1ff45bad67e
2016-05-16 09:54:23 -07:00
JackyChen
0dfa6b38dc Move non-zero mv bias on large block out of vp9_pick_inter_mode.
This is to simplify pick inter mode funtion and is bitexact.

Change-Id: Ib1a115bac5fbd212c626be194bcd4a6ce4af9bf2
2016-05-13 15:29:05 -07:00
Marco
8a79769aff vp9: Update to rc-metric for keeping track of average frame size.
Rename and change to how its updated.
Only affects 1 pass vbr.

Small change in metrics (< ~0.1%) on ytlive set.

Change-Id: Ibb1fe485699b6c4a8194951c8f229abe2f64b9a5
2016-05-13 14:31:57 -07:00
James Zern
98726d538b Merge "convolve_test: Fix high bit depth IOC runtime errors." 2016-05-13 17:56:41 +00:00
Tom Finegan
9a56a5ea18 convolve_test: Fix high bit depth IOC runtime errors.
Add a cast.

BUG=webm:1225

Change-Id: I34ea18ee816569485c1f1046a81fd2a0ce527ac8
2016-05-13 09:42:58 -07:00
Tom Finegan
656f9c4126 Merge "Add --enable-shared option to iosbuild.sh to build dynamic framework" 2016-05-13 15:48:52 +00:00
Yaowu Xu
c1e4f5a80d Merge "Change to use correct check for halfpel" 2016-05-13 01:27:47 +00:00
Tom Finegan
9d7eaf0046 Merge "twopass_encoder: Add frame limit argument." 2016-05-12 16:26:29 +00:00
Brion Vibber
992e4b7090 Add --enable-shared option to iosbuild.sh to build dynamic framework
Also allows use of --enable-shared when configuring for Mac OS X,
producing a bare .dylib.

Enabling the shared framework bumps the iOS deployment target to 8.0,
the minimum required to support dynamic framework deployment in apps.

When not using --enable-shared, a static library for iOS 6.0+ will still
be built.

Minimum version settings have been moved into ios-version.sh so they
can be updated in a single place.

As with the static build, unless header search paths are manually
tweaked, users must add a VPX prefix on includes, such as:

  #include <VPX/vpx/vpx_decoder.h>

A module map for headers is not yet included as inttypes.h is not
modular; this means that VPX cannot be used directly in Swift code,
but can still be pulled in through an Objective-C wrapper.

BUG=https://bugs.chromium.org/p/webm/issues/detail?id=1092
Change-Id: I28fb06ce65e48ed167a88c14a7bfb2861989317e
2016-05-12 08:26:01 -07:00
Tom Finegan
10c7ea4be8 Merge "simple_encoder: Add a frame limit argument." 2016-05-12 14:55:08 +00:00
hui su
3c206aca04 Fix typos in control function for VP9E_SET_TARGET_LEVEL
Change-Id: Ic797c6be579c3434681a5e9dbb3900ae49c43958
2016-05-11 20:23:52 -07:00
Linfeng Zhang
2f55beb355 Merge "remove mmx variance functions" 2016-05-11 22:21:23 +00:00
Marco Paniconi
70bdf643d0 Merge "vp9: Fix to quality regression issue for 1 pass." 2016-05-11 22:15:24 +00:00
Linfeng Zhang
8700eed4c6 Merge "remove mmx sad functions" 2016-05-11 22:04:41 +00:00
Tom Finegan
7d6edc3ddd simple_encoder: Add a frame limit argument.
- Add frame limit argument.
- Make all arguments required.
- Enable the VP9 simple encoder test.

Change-Id: I11d228b358ff90c60ea92e02760cb476434ea571
2016-05-11 14:52:34 -07:00
Tom Finegan
9d47341a4c twopass_encoder: Add frame limit argument.
- Remove twopass_encoder test TODO re frame limit.
- Enable VP9 twopass_encoder test.

Change-Id: I0649f15aabef79a63891e997fd20b212af5672e6
2016-05-11 14:50:03 -07:00
Marco
0c60db7def vp9: Fix to quality regression issue for 1 pass.
BUG=https://bugs.chromium.org/p/webm/issues/detail?id=1217

Issue introduced in https://chromium-review.googlesource.com/#/c/339162/.
The factor on avg_frame_qindex[INTER_FRAME] in that CL, used for q-basis to
set active_best, can cause the QP to decrease too slowly or get stuck
in some cases when max-q=63.

Removing that factor fixes the regression in issue#1217.

Change-Id: I97fe28dca3c2bc2d852b1775f39c62164e032d4f
2016-05-11 14:01:21 -07:00
Yaowu Xu
17fae3ad0a Change to use correct check for halfpel
In motion estimation stage for subpel motion, subpel variance is
computed use bilinear interpolation. The motion vector precision
used is at 1/8 pel and three bits are used to represent the x and y
subpel offsets. Based on this, the half pel check should be against
4, not 8.

Change-Id: I1f56fa1fa3f2f5e19a20d27983efe628557f170e
2016-05-11 13:52:59 -07:00
Alex Converse
ccf4f47b99 Merge changes I412c24aa,I28a8bbf0
* changes:
  mcomp: Remove an obsolete undef.
  mcomp: Remove an obsolete comment.
2016-05-11 20:03:21 +00:00
Linfeng Zhang
d0ffae825d remove mmx variance functions
there are sse2 equivalents which is a reasonable modern baseline
Removed mmx variance functions:
vpx_get_mb_ss_mmx()
vpx_get8x8var_mmx()
vpx_get4x4var_mmx()
vpx_variance4x4_mmx()
vpx_variance8x8_mmx()
vpx_mse16x16_mmx()
vpx_variance16x16_mmx()
vpx_variance16x8_mmx()
vpx_variance8x16_mmx()

Change-Id: Iffaf85344c6676a3dd337c0645a2dd5deb2f86a1
2016-05-11 12:39:42 -07:00
Yaowu Xu
a45596cff7 Merge "Added a measure of rc drift." 2016-05-11 18:02:00 +00:00
Linfeng Zhang
d0e687bf8c remove mmx sad functions
there are sse2 equivalents which is a reasonable modern baseline

Change-Id: Ibbe536a5ad1c2cccef6bdcc75c13b3dde35a56ba
2016-05-11 10:50:04 -07:00
Paul Wilkins
5fd142e763 Merge "Fixed 8K two pass encoder crash." 2016-05-11 16:25:25 +00:00
paulwilkins
45df87ca57 Added a measure of rc drift.
Added actual and absolute rate miss values to the opsnr.stt
stats output line.

Changes to the borg graphing may be needed before merge.

Change-Id: I1e9d548ce445d29002f0c59ebfd3957a6f15e702
2016-05-11 15:15:07 +01:00
paulwilkins
65732c36a8 Fixed 8K two pass encoder crash.
Bug found by Yunqing relating to the correction for size at 8K and
above in get_twopass_worst_quality().

The basis for the correction was changed to the linear size relative to
1080P as a baseline and the adjustment has been clamped to prevent
problems at extreme images sizes.

For 1080P the results on our test sets were neutral but the low res and
mid res sets saw a small gain (0.1%-0.2% average).

I would also expect some gains on 4k and larger content where the
previous correction was overly aggressive.

Change-Id: I30b026b5f4535e9601e3178d738066459d19c8fb
2016-05-11 14:45:50 +01:00
Alex Converse
6dd5ec7efb mcomp: Remove an obsolete undef.
The macro was removed in 6724676.

Change-Id: I412c24aac49bd1ff60a331a30933e0d8ae3f2dd5
2016-05-10 18:04:24 -07:00
Alex Converse
7764f8af3e mcomp: Remove an obsolete comment.
This was copied over from VP8. VP9 doesn't seem to do this buffer copy.

Change-Id: I28a8bbf0503a7f99b2cb60620ab3674adde863bb
2016-05-10 18:04:24 -07:00
Hui Su
d7947c37a8 Merge "Add VP9 encoder API for level specification." 2016-05-10 23:46:14 +00:00
hui su
be3f0698b0 Add VP9 encoder API for level specification.
Add control API VP9E_SET_TARGET_LEVEL that allows the encoder to
control the output bitstream level and/or keep level related
statistics.

Usage:
               255         do not care about level (default)
               0           keep level related stats only
               10          target for level 1
               11          target for level 1.1
               .
               .
               .
               62          target for level 6.2

Usage for vpxenc:

--target-level=0/255/10/11...

Change-Id: I31d1aeca19358b893e7577b4e63748c8e614034a
2016-05-10 11:48:16 -07:00
James Bankoski
57566ff24a Merge "vpx_dsp: Rename postproc.c add_noise." 2016-05-10 17:12:08 +00:00
Hui Su
e2b696c390 Merge "Fix comment for target_bandwidth in VP9 and VP10" 2016-05-10 16:34:54 +00:00
Jim Bankoski
da33728f48 vpx_dsp: Rename postproc.c add_noise.
Change-Id: I4906d1b79a2951e659995202b9fa97e2ea5cfba0
2016-05-10 06:52:58 -07:00
James Zern
04246a60d7 Merge "Revert "Skip inttypes.h on Darwin"" 2016-05-10 01:11:55 +00:00
hui su
667f6320b0 Fix comment for target_bandwidth in VP9 and VP10
Unlike in VP8, it is in units of bits per second in VP9 and VP10.

Change-Id: Iee1936cc58cdfaff205624c2fe87cecdf7eda123
2016-05-09 16:43:02 -07:00
James Zern
9aa23214e2 Revert "Skip inttypes.h on Darwin"
This reverts commit 1bec0c5a7e885ec792f6bb658eb3f34ad8f37b15.

Breaks desktop Mac builds.

Change-Id: I5b79dc29ad544357192ed16a47279716243e51dd
2016-05-09 23:37:09 +00:00
Alex Converse
f5f5ca03ca Merge "pickmode: Fix a pair of unsigned overflows." 2016-05-09 22:16:22 +00:00
Scott LaVarnway
c2c5297595 Merge "VPX: refactor vpx_idct16x16_1_add_sse2()" 2016-05-09 22:15:17 +00:00
Marco Paniconi
42bee40e50 Merge "vp9: 1 pass vbr: Reduce base qp for active_best_quality for inter-frames." 2016-05-09 21:30:11 +00:00
Tom Finegan
d4fccb8f41 Merge "convolve_test: Fix IOC runtime errors." 2016-05-09 21:24:11 +00:00
Johann Koenig
0741629c88 Merge "Alignment is required for sad_array8" 2016-05-09 21:01:45 +00:00
Tom Finegan
6042d68851 convolve_test: Fix IOC runtime errors.
Add a cast.

BUG=https://bugs.chromium.org/p/webm/issues/detail?id=1216

Change-Id: I40627de387bc9cfba37860e7a0a4f2d4524f3431
2016-05-09 16:33:59 -04:00
James Bankoski
7cced7b3ea Merge "libvpx: vpx_add_plane_noise make c match assembly" 2016-05-09 20:17:38 +00:00
Johann Koenig
5cc4c59f2a Merge "Remove sixtap/bilinear 4x4 neon implementations" 2016-05-09 18:40:02 +00:00
Johann
f68f9eefdf Alignment is required for sad_array8
For at least some of the implementations of sdx8f, such as
vpx_sad4x4x8_sse4_1, aligned moves are used to move the results into the
array.

Change-Id: I83df5a8e657b44e906d0d8b0bc154f1e5660f7f9
2016-05-09 18:39:24 +00:00
Johann Koenig
9e5811f485 Merge changes Id13b97f4,I1d342725
* changes:
  The subfunctions are only defined for sse2
  Unlike non-hbd variance, opt2 is never used
2016-05-09 18:38:59 +00:00
Johann Koenig
66a3438602 Merge "Use canonical avg_pred functions" 2016-05-09 18:38:12 +00:00
Alex Converse
d8a18186ba pickmode: Fix a pair of unsigned overflows.
block_variance: This operates on 8x8s and would be safe with a int32 *
int32 to uint32 multiply, but this is potentially unsafe for 12-bit
input. Unfortunately the code already segfaults on 12-bit input:
https://bugs.chromium.org/p/webm/issues/detail?id=1223

calculate_variance: This operates on up to a 32x32 of 8x8s and can
overflow even with 8-bit input (log2((256*32*32)**2) == 36).

BUG=https://bugs.chromium.org/p/webm/issues/detail?id=1220

Change-Id: I1ca4ff6092db9a7580da371ee9a21f403fdadc40
2016-05-09 11:21:20 -07:00
Marco
36f796d2d0 vp9: 1 pass vbr: Reduce base qp for active_best_quality for inter-frames.
Reduce factor for setting base-qp for active_best_quality (for inter-frames).
Small increase in metrics on yt live set.

Change-Id: I9cf0ac797783aeddbfaf1ff510696c9035d7c5ee
2016-05-09 10:21:44 -07:00
Scott LaVarnway
1490342be5 VPX: refactor vpx_idct16x16_1_add_sse2()
Change-Id: I431ea0d9abe764d110a1ba32a8cb15e2fdac8805
2016-05-09 09:50:00 -07:00
Tom Finegan
bd2e7fa1c8 Merge "Skip inttypes.h on Darwin" 2016-05-09 15:07:38 +00:00
Jim Bankoski
7a91d21d69 libvpx: vpx_add_plane_noise make c match assembly
This change makes the c match the assembly and removes the todo's
associated with getting this to work.

Change-Id: Ie32e9ebb584a9d60399662d8bcb71b74fbd19d1e
2016-05-07 12:47:49 -07:00
Johann
7e4c306981 Use canonical avg_pred functions
Change-Id: Ibe0cc388226622561d2b4a00e5bdc1016a3c4a94
2016-05-06 19:06:03 -07:00
Johann
b23bd2360f The subfunctions are only defined for sse2
See highbd_subpel_variance_impl_sse2.asm

Change-Id: Id13b97f4f6d189ed71cdc6d52b3c4ea63dc1da05
2016-05-06 18:58:49 -07:00
Johann
a761197fbd Unlike non-hbd variance, opt2 is never used
Change-Id: I1d342725df332c4efc6006d9e3dcb7372c41f448
2016-05-06 18:38:04 -07:00
Johann
ce11055d57 Remove sixtap/bilinear 4x4 neon implementations
These implementations rely on casting the pointers to load the data.
Clang implemented optimizations which automatically add alignment hints
to such loads. The 4x4 filters do not guarantee the necessary alignment
so the resulting assembly is broken.
https://llvm.org/bugs/show_bug.cgi?id=24421

BUG=webm:817
BUG=webm:892

Change-Id: I608885299f1f86ff83653b65e0e40d0ae87fb3fe
2016-05-06 17:20:15 -07:00
Johann Koenig
d3a62ac850 Merge "Break exports for spatial_svc out to fix shared builds without it" 2016-05-06 23:52:42 +00:00
Johann Koenig
94ec6290f8 Merge "Fix for version.sh when libvpx is checked out as git submodule" 2016-05-06 22:18:16 +00:00
James Zern
512b67f023 Merge "md5_utils,MD5Transform: don't check for unsigned overflow" 2016-05-06 02:26:38 +00:00
James Zern
5e679848e8 Merge changes from topic 'missing-proto'
* changes:
  vp9_frame_scale_ssse3.c: make 2 functions static
  vp9_pickmode.c: make function static
  vp9_noise_estimate.c: make function static
  vp9_aq_360.c: add missing include
  vp9_idct_intrin_sse2: add missing vp9_rtcd.h include
  vpx_dsp/*.[hc]: add missing vpx_dsp_rtcd.h include
2016-05-06 02:25:29 +00:00
Marco Paniconi
e313fc8514 Merge "vp9: Modify logic for gf setting based on up-coming key frame." 2016-05-05 21:23:03 +00:00
Marco
f4b5076ad3 vp9: Reduce qp threshold for limiting cyclic refresh on steady blocks.
Makes the delta-qp stop little earlier on areas that have been refreshed enough.
This helps to reduce some pulsing artifact on noisy flat areas observed in some
noisy vc-clips.

Threshold changes only take effect for sources where noise level is estimated to
be >= medium level.

Only affects 1 pass CBR, non-screen content case.

Change-Id: Iacf557f6aa8abbcd6782c02ff2e6c14891960850
2016-05-05 11:31:43 -07:00
Marco
1fc21052ab vp9: Modify logic for gf setting based on up-coming key frame.
For 1 pass vbr mode:
Refactor to move the logic for gf setting based on up-coming
key frames to a separate function, so same logic can be used for
scene-cuts/changes.

Change-Id: Ic4ede308e08ba869bb62e4566e19ea31222c5229
2016-05-05 09:33:27 -07:00
James Zern
f26fccf3b2 md5_utils,MD5Transform: don't check for unsigned overflow
this transform is well-defined and relies on unsigned rollover

Change-Id: Ia39f3a65a7a07ac871bf857d2684c9839862c2aa
2016-05-04 19:23:47 -07:00
James Zern
3d7e2677df Merge changes I05b3028a,I1ad41c09
* changes:
  vpx_dsp_common.h: remove circular include
  vpx_dsp_common.h: fix include guard
2016-05-05 01:23:20 +00:00
James Zern
272afa9a43 vp9_frame_scale_ssse3.c: make 2 functions static
downsample_2_to_1_ssse3/upsample_1_to_2_ssse3() are local to this module

Change-Id: I78a9de8e1eca475ba1bf137102580c531aa3f7dd
2016-05-04 15:10:24 -07:00
James Zern
9bfa12764c vp9_pickmode.c: make function static
set_intra_cost_penalty() is local to this module

Change-Id: Ie277bfc5e8a26f05a04fd261bdb888388ad0e2a1
2016-05-04 15:10:00 -07:00
James Zern
264c174fca vp9_noise_estimate.c: make function static
enable_noise_estimation() is local to this module

Change-Id: Id736c419387ca1959695dd327ce164bec029b597
2016-05-04 15:09:05 -07:00
James Zern
bc08689fa5 vp9_aq_360.c: add missing include
Change-Id: Ia8ac9b7023211b1da2294b0934cf076fb1cdc65f
2016-05-04 15:08:10 -07:00
James Zern
70c149db7f vp9_idct_intrin_sse2: add missing vp9_rtcd.h include
Change-Id: I39a67ffea7b0a55b45cdf935986439537b65601f
2016-05-04 15:07:27 -07:00
James Zern
2184692c07 vpx_dsp/*.[hc]: add missing vpx_dsp_rtcd.h include
Change-Id: I103be7eee36492f8619144ce8325bc916d4975c7
2016-05-04 15:06:44 -07:00
Marco Paniconi
f38648742a Merge "vp9-noise estimation. Decrease frame period for estimating noise." 2016-05-04 22:02:53 +00:00
Yaowu Xu
939d7d9de8 Merge "Change to use proper type in vp{9,10}_token_state" 2016-05-04 21:57:12 +00:00
James Zern
4f69f741d8 vpx_dsp_common.h: remove circular include
Change-Id: I05b3028a38bbc062c388eeb95e99a3fee583ae6b
2016-05-04 14:54:53 -07:00
James Zern
aa68a8301e vpx_dsp_common.h: fix include guard
Change-Id: I1ad41c096ec86870f9aecab6fdbc3af03e972afc
2016-05-04 14:54:32 -07:00
James Zern
d4d843de81 Merge "yv12extend: make memcpy_short_addr static" 2016-05-04 21:17:09 +00:00
Marco
ff3866dc43 vp9-noise estimation. Decrease frame period for estimating noise.
Makes the noise estimation react little faster.
Little/no change in metrics.

Change only affects 1 pass cbr.

Change-Id: I13f0daa90ecbf9d49eb1cf2e48febd9d92292940
2016-05-04 12:43:02 -07:00
Brion Vibber
1bec0c5a7e Skip inttypes.h on Darwin
When building a dynamic framework with Swift compatibility, can't
include any headers that aren't in another module or you get an
error like this from Xcode on the including project:

  Include of non-modular header inside framework

For some reason the system inttypes.h is not in a module, unlike
other standard C library headers... but it doesn't seem to be
actually needed on Darwin, so removing it doesn't appear to
be a problem.

Change-Id: I11d264483c54feefd9d2edf573afaef34ddcd0f2
2016-05-04 15:41:41 -04:00
Brion Vibber
e2b451d9e3 Break exports for spatial_svc out to fix shared builds without it
Change-Id: I208c84cce216464b82eaa51945ce17a8e6625673
2016-05-04 15:41:41 -04:00
Brion Vibber
880ee94a94 Fix for version.sh when libvpx is checked out as git submodule
When using git submodules, .git may be a file instead of a directory.
The -d test was failing in that case; switched to -e.

BUG=https://bugs.chromium.org/p/webm/issues/detail?id=1215

Change-Id: Iedf0e92bfeb003b28a415945dc729e6ce58c4fe4
2016-05-04 15:41:32 -04:00
Yaowu Xu
81eb71f00c Change to use proper type in vp{9,10}_token_state
"qc" in vp{9,10}_token_state is used to save quantized coefficients, this
commit changes the type from short to tran_low_t to properly reflect
the value range for highbitdepth build.

This fixes an out-of-range bug when optimize_b is used in highbitdepth
build.

Change-Id: Ibf330879e6ac6ae8f099e085caa9d3d9a889fde8
2016-05-04 12:14:11 -07:00
Alex Converse
8620dea882 variance aq: Fix a variance calculation overflow bug.
This is an actual overflow where the result of the calculation is
materially changed, not just a negative value that is stored in an
unsigned.

Caught with fsanitize=integer on the VP9/AqSegmentTest.TestNoMisMatchAQ2/1 test.

Change-Id: I514b0ef4ae7ad50e3e08c0079aa204d59fa679aa
2016-05-04 11:40:55 -07:00
Tom Finegan
3c2231807f Merge "iosbuild.sh: Verify fat library targets." 2016-05-04 17:08:36 +00:00
James Bankoski
89f905e5e5 Merge "libvpx: add a unit test for plane_add_noise." 2016-05-04 13:09:05 +00:00
Jim Bankoski
34d5aff747 libvpx: add a unit test for plane_add_noise.
In so doing this fixes a couple of bugs:

vpx_plane_add_noise.c needed to subtract a clamp instead of add.
And the assembly (mmx sse) had assumptions that parameters were
continuous in memory which was not true.

Change-Id: I76f2c43cf54bfc838eb2edf8a443eaaa7565d7b5
2016-05-03 16:23:06 -07:00
James Zern
eb339264b1 yv12extend: make memcpy_short_addr static
Change-Id: I58612bd04fad6144722569d3db2899ba0fb947a6
2016-05-03 14:42:14 -07:00
James Zern
fe193ad2ac Merge "x86.h,x86_simd_caps: add an explicit cast w/strtol" 2016-05-03 19:48:03 +00:00
Alex Converse
a309742a5f Merge "Fix unsigned overflows in temporal filter." 2016-05-03 19:11:17 +00:00
Alex Converse
f76158131d Fix unsigned overflows in temporal filter.
Change-Id: Iebdc8304d30c78f03f99f6dc665003ff41c8b1cd
2016-05-03 10:55:44 -07:00
James Bankoski
e755a283dd Merge "Move vpx_add_plane from codec to vpx_dsp and dedup." 2016-05-03 14:11:57 +00:00
Tom Finegan
d9653b4be0 Merge "configure.sh: Remove armv6-darwin target." 2016-05-02 21:40:57 +00:00
Alex Converse
8307045cb5 Merge "Use signed variables in the lookahead." 2016-05-02 21:32:39 +00:00
Jacky Chen
04a6db562a Merge "vp9: Refactor vp9_denoiser_NxM_sse2." 2016-05-02 21:28:08 +00:00
Tom Finegan
ef0f98b3a3 iosbuild.sh: Verify fat library targets.
- Make sure VPX.framework/VPX actually contains requested
  targets before reporting success.
- Removes a TODO.

Change-Id: I2344d6e2bb502bf533ce0e4c6f159118e4fe3bdf
2016-05-02 13:50:06 -07:00
Tom Finegan
b05158d630 configure.sh: Remove armv6-darwin target.
- iOS SDKs no longer ship with armv6 support.
- Our minimum iOS version means all target devices have neon.
- Remove armv6 darwin LD workaround.
  - This removes a TODO.

Change-Id: I2fcb5b82c96213364275475be021c7dd8459d5c0
2016-05-02 13:33:25 -07:00
JackyChen
b29612fbbe vp9: Refactor vp9_denoiser_NxM_sse2.
Denoiser is ~1.5% faster in speed 6~8.

Change-Id: I7b350f3c50cce6773d9c4eded4c0c1b722d0a5fc
2016-05-02 13:19:40 -07:00
Jim Bankoski
fce3cee8dd Move vpx_add_plane from codec to vpx_dsp and dedup.
Change-Id: I12218d8331c0558c0587a66321e3ca46da7e5cc7
2016-05-02 12:17:39 -07:00
James Zern
a234308347 Merge "configure.sh: prefer 'which' over 'hash'" 2016-05-02 19:15:40 +00:00
JackyChen
136c29e3a3 vp9: Refactor choose_partitioning.
Move skin superblock force split out of this function as well
as some minor code refactors. Checked bitexact for different speed
settings and different resolutions.

Change-Id: I6078cbe88dd9ce6c0b69470a8a0a8f8d2274161b
2016-05-02 10:15:03 -07:00
James Zern
be660f8ca0 configure.sh: prefer 'which' over 'hash'
hash may trigger a bashism warning; which is already depended on by this
script

Change-Id: Ibe0e7d1132d72f03aaf5b7d4c6180b59e92aceff
2016-04-29 19:48:51 -07:00
James Zern
5d27ee1c08 Merge "vp9_ethread_test: replace FramePktHook w/DecompressedFrameHook" 2016-04-29 19:56:55 +00:00
James Zern
706bd3d57a Merge "msvs_common.sh: make fix_file_list generic" 2016-04-29 18:31:06 +00:00
Marco
7bd73b638a vp9: Move the initialization of some rc variables to rc_init.
And initialize a variable (avg_source_sad) that was not initialized to 0.

Change-Id: I63223e20fffe2a2ea38f03da62dad16af0618ea4
2016-04-28 17:10:37 -07:00
James Zern
ef877d846f vp9_ethread_test: replace FramePktHook w/DecompressedFrameHook
this avoids the decoder test which was only correct for vp9, vp10 was
missed in the earlier change

Change-Id: Ib789c906d440c0e4169052cf64c74d5e4b196caa
2016-04-28 16:26:34 -07:00
Alex Converse
94806e029d Merge "Avoid an unsigned overflow in invert_quant" 2016-04-28 19:44:03 +00:00
Jacky Chen
78cde4f593 Merge "vp9: Don't force block size to 8x8 in denoiser." 2016-04-28 18:06:29 +00:00
Alex Converse
43622dd92a Merge "Port convolve test refactor to master." 2016-04-28 16:26:54 +00:00
Alex Converse
f6d13e7be5 Merge "bitreader: remove an unsigned overflow." 2016-04-28 16:26:37 +00:00
James Zern
a8b056526e x86.h,x86_simd_caps: add an explicit cast w/strtol
+ use strtoul as mask is unsigned

quiets a -Wshorten-64-to-32 warning

Change-Id: Ia1c24679302100a252da7a45d3bb871f591f1888
2016-04-27 23:41:51 -07:00
JackyChen
c69a141a9e vp9: Don't force block size to 8x8 in denoiser.
First, we only set use_4x4_partition for key frame where we don't
denoise; second, envision we have small partitions, we should pass the
actual block size to denoiser and make an early termination if needed.

Change-Id: I331f42046d792b17360723d17ff817d601394658
2016-04-27 22:18:11 -07:00
James Zern
4d8796a59c msvs_common.sh: make fix_file_list generic
take an array name as the first parameter and operate on the reference;
removes a TODO

Change-Id: I9d63a31d7a7625123f0d64f212b4e702813cc01b
2016-04-27 20:26:49 -07:00
Alex Converse
2f97b7cbfe Port convolve test refactor to master.
Brings f03e238f to master.

Change-Id: I7f7754e7d1288b103a4510303d10afc68a7d8ca8
2016-04-27 16:53:33 -07:00
Alex Converse
a68b24fdee Tweak casts on vpx_sub_pixel_variance to avoid implicit overflow.
Change-Id: I481eb271b082fa3497b0283f37d9b4d1f6de270c
2016-04-27 16:37:18 -07:00
Alex Converse
918a2fd726 Use signed variables in the lookahead.
Wrap around behavior is enforced manually and we use the values in
arithmetic involving negative integers.

Change-Id: I199706b6f3af91f4fb6fe2ef302fbbc6d0cf5785
2016-04-27 16:01:20 -07:00
Alex Converse
36a0c7ffe3 bitreader: remove an unsigned overflow.
bits_left is in the range [0, 64 (= BD_VALUE_SIZE)] , so the narrowing
conversion should be safe.

Change-Id: I943fcd359eaad76249ee1e1fb03a2ac16945d2fd
2016-04-27 15:31:35 -07:00
Alex Converse
6c4007be1c Be explicit about overflow in vpx_variance16x16_sse2.
The product always fits in uint32_t, but the operands don't.

An optimizing compiler should generate the wraparound code.
(Verified with clang).

Change-Id: I25eb64df99152992bc898b8ccbb01d55c8d16e3c
2016-04-27 15:22:17 -07:00
Alex Converse
ccb894ce73 Remove casts on < 16x16 variance.
These blocks will never overflow since max sum is +/-255*w*h.

Change-Id: Ia2c630339fd9cfb411b56b6040ff402095f12a2e
2016-04-27 15:21:58 -07:00
Alex Converse
d3fe3b2abb Avoid an unsigned overflow in invert_quant
Change-Id: I16a570b2af66b6580d1cd6f8345a25f079009bf4
2016-04-27 15:07:22 -07:00
Alex Converse
b2ccb9c189 Merge "Declare the operator== overload for M128A in the global namespace." 2016-04-27 20:33:17 +00:00
Alex Converse
bb1e5b79da Declare the operator== overload for M128A in the global namespace.
ADL will look this up from the callsite namespace iff it is declared
before the callsite or from the parent namespace of the class type (the
global namespace).

This patch has been tested on MSVS 2015 and clang-3.8.

Change-Id: I00ba74712c9b617b9d81761abed1e14d8f25d8e3
2016-04-27 20:32:41 +00:00
James Zern
d952b13bf1 Merge changes If45b8931,Ieab273a7
* changes:
  vp9_ethread_test: avoid crash when decoder is unavailable
  resize_test: skip VP9 decode checks if it's disabled
2016-04-27 20:01:33 +00:00
Vignesh Venkatasubramanian
021105e3ac Merge "TODO cleanup: Remove unused buffer_size" 2016-04-27 06:17:12 +00:00
Vignesh Venkatasubramanian
fa99c376e5 TODO cleanup: Remove unused buffer_size
Remove unused variable buffer_size and rename bytes_in_buffer to
buffer_size in webm_read_frame.

Change-Id: I18b6ccbb044cd366610a5e39d83883cc0b174051
2016-04-26 22:40:37 -07:00
Vignesh Venkatasubramanian
9dfec135a6 Merge "webmdec.h: remove stale TODO" 2016-04-27 05:38:53 +00:00
Vignesh Venkatasubramanian
69498d66cd Merge "TODO cleanup: s/EbmlGlobal/WebmOutputContext/" 2016-04-27 05:37:32 +00:00
James Zern
c4d56257f9 vp9_ethread_test: avoid crash when decoder is unavailable
Change-Id: If45b8931771d50990b78a5aa860f372eb0430cf4
2016-04-26 20:15:15 -07:00
James Zern
0616fa6e87 resize_test: skip VP9 decode checks if it's disabled
Change-Id: Ieab273a779c44e1c4648642e9f12735b81bd2300
2016-04-26 19:56:44 -07:00
Marco
a136c1769d vp8: Adjust consec_zeromv thresholds for skin detection.
Change-Id: Iab5aed7bf86538352232e208bce58c3528cc9a4e
2016-04-26 16:03:44 -07:00
Hui Su
03b6f5f8e3 Merge "VP9: adjust trellis quant optimization RD parameters" 2016-04-26 19:12:09 +00:00
Hui Su
f16cf9fbcc Merge "VP9: enable trellis quantization optimization for intra blocks" 2016-04-26 19:11:49 +00:00
Marco Paniconi
fbefe470bf Merge "vp9: Fix condition to update consec_zero_mv." 2016-04-26 18:15:27 +00:00
Jacky Chen
29ade0d3cf Merge "vp9: Simplify the logic in denoiser SSE2 code." 2016-04-26 17:43:49 +00:00
Yi Luo
0bd84571e4 Merge "Add the 64-bit CPU cycle count utility function" 2016-04-26 17:24:21 +00:00
hui su
c3a9247e09 VP9: adjust trellis quant optimization RD parameters
Coding gain:
lowres  0.64%
midres  0.38%
hdres   0.58%

Change-Id: I233fa2a4b24bd1e15091a5f5ef6aff661f3f50ec
2016-04-26 10:17:38 -07:00
hui su
c8f56d2303 VP9: enable trellis quantization optimization for intra blocks
Coding gain:
lowres  0.18%
midres  0.23%
hdres   0.36%

Change-Id: I044c8afbc481fc55b23d440352941071355b0afb
2016-04-26 10:17:29 -07:00
JackyChen
1a53c0c9e1 vp9: Simplify the logic in denoiser SSE2 code.
Block size passed into denoiser filter is always >= BLOCK_8X8 (in
vp9_pick_inter_mode), it is not necessary to check smaller block
size. Passed the bitexact test on clips with different resolutions and
noise levels.

Change-Id: I19fa3195d18c27d9e5de60dc11cff1522ef3714e
2016-04-26 09:04:39 -07:00
Paul Wilkins
779840c9f4 Merge "Resolve a couple of TODOs in firstpass.c" 2016-04-26 12:57:09 +00:00
Paul Wilkins
7a4c2c7671 Merge "Experiment to adapt for net AQ offset." 2016-04-26 12:56:52 +00:00
Marco
b7e8b3cbb6 vp9: Fix consec_zero_mv in skin detection.
This was missed in https://chromium-review.googlesource.com/#/c/340135/.

Change-Id: Iafc83141f4ff744819bdbde7d239678b215feb9d
2016-04-25 15:39:15 -07:00
Marco
9f90473ef8 vp9: Fix condition to update consec_zero_mv.
Fix will reset the consec_zero_mv map on non-skipped blocks with non-zero mv.
Adjust thresholds on consec_zero_mv in noise estimation and skin detection,
as more possible reset on map means lower thresholds should be used.

Change-Id: Ibe8520057472b3609585260b51b6f95a38fb777d
2016-04-25 15:29:11 -07:00
Marco Paniconi
97d8adef82 Merge "vp9: 1 pass vbr: Adjust gf boost/interval on motion level." 2016-04-25 21:13:56 +00:00
Vignesh Venkatasubramanian
9680d4fa2a webmdec.h: remove stale TODO
webm_read_frame is the only function now which requires
documentation for what the return value means (other two are quite
obvious - file_is_webm and webm_guess_framerate).

Change-Id: I7a4f7d8097b1d748812b2ee251ee718a0b5ce836
2016-04-25 14:05:59 -07:00
Vignesh Venkatasubramanian
9441f10b51 TODO cleanup: s/EbmlGlobal/WebmOutputContext/
This brings the struct's name in line with WebmInputContext.

Change-Id: I1a1c7ae60b006ae5de8253177d6d996f5867866d
2016-04-25 13:30:08 -07:00
Jacky Chen
ef4a132cc4 Merge "vp9: Fix a bug where best_sse_mv is not set properly." 2016-04-25 20:00:43 +00:00
Johann Koenig
520055bd1a Merge "vpx_minmax_8x8_neon and test" 2016-04-25 18:58:29 +00:00
Marco
e172e8aa26 vp9: 1 pass vbr: Adjust gf boost/interval on motion level.
Add some adjustment for high motion case.

Change-Id: If700be1ce849c187ed031221ea7cabbc8d91ec2b
2016-04-25 11:54:10 -07:00
JackyChen
57c7c11633 vp9: Fix a bug where best_sse_mv is not set properly.
In VP9 internal denoiser, motion magnitude is computed from
best_sse_mv, which should be set to 0 at the begining. This bug may
cause visual aritifact in denoiser. Also, delete two improper comments.

Change-Id: I8710d2acba23320bc85cf72af17d65245c19438b
2016-04-25 11:44:40 -07:00
Marco Paniconi
bd3c874cac Merge "vp9-denoiser: Bugfix and some adjustments for high noise case." 2016-04-25 17:16:10 +00:00
Marco
229c686c89 vp9-denoiser: Bugfix and some adjustments for high noise case.
Need to check that sse for non-zero mv has been set for the current block
(i.e., check that nonzero-mv is tested as a mode, so newmv_sse != UINT_MAX)
before forcing to not use zero-mv for denoising.

Also increase some thresholds (sse and sse_diff) for high noise case,
and use shift operaton instead of multiplication on a threshold computation.

Change-Id: Iae7339475d57240316b7fa8b887c4ee3c0d0dbec
2016-04-25 10:15:03 -07:00
Marco
8b25dd599f vp9: Add rc quantity to track amount of low motion in scene.
Use it for now in noise estimation to bypass estimation if
motion level is high.

Change-Id: I033662dc909f2060e4e81abf562a7ad262dc8170
2016-04-25 09:07:35 -07:00
Scott LaVarnway
cc5023d55f Merge "VP9: Do not call vp9_adjust_mask() in vp9_setup_mask()" 2016-04-25 13:39:29 +00:00
paulwilkins
015c43f0c1 Resolve a couple of TODOs in firstpass.c
Resolved two TODO items.

Force a minimum value of 1.0 for frame duration as per section duration.

Column inactive zone is currently set to 0 as most of the serious issues
relating to inactive regions relate to letter boxing.

Change-Id: Ifbab3acf2c089d7305620a7ff7ed7c3536cc9235
2016-04-25 12:38:10 +01:00
paulwilkins
4b590058c8 Experiment to adapt for net AQ offset.
In Aq mode 1 the segment and AQ delta for each block is based
on spatial variance. There may be a net imbalance between blocks
that have lower Q than the baseline value and those that have higher Q.

This patch monitors that imbalance and extends the allowed baseline
Q range for the frame to accommodate adjustment of that baseline value
to compensate.

Change-Id: Iae8a48c7c01fe2af94a141e149d03acf467237ca
2016-04-25 12:07:07 +01:00
Scott LaVarnway
9e0efb6008 VP9: Do not call vp9_adjust_mask() in vp9_setup_mask()
vp9_adjust_mask() is called again in loop_filter_rows().

Change-Id: If52f5339dfa7971c47b12f9e05f87951044d9391
2016-04-22 13:53:32 -07:00
James Zern
52889c1016 Merge "hadamard_test: align src/dst buffers" 2016-04-22 20:03:06 +00:00
Marco Paniconi
cf82222316 Merge "vp9: Some adjustments to denoiser under high-noise condition." 2016-04-22 18:55:57 +00:00
Marco
80ed9e4f5c vp9-noise estimation: Add check on whether skin detection is enabled.
Change-Id: Ie80b7a14e3505c40b5742793f84aa6fb9d21dab5
2016-04-22 10:37:00 -07:00
Marco
80bbba1494 vp9: Some adjustments to denoiser under high-noise condition.
Change-Id: Ib47d742d07f13c7c39cea85e228c19ae298baf4a
2016-04-22 10:31:19 -07:00
Marco Paniconi
2c8338f982 Merge "vp9: Move consec_zero_mv from cyclic refresh to cpi struct." 2016-04-22 17:06:31 +00:00
Yi Luo
b547a2f38c Add the 64-bit CPU cycle count utility function
Change-Id: Ie87245bbdf5735bc9729199eeb07899d81dbf267
2016-04-22 09:34:35 -07:00
Marco
adf8533cee vp9: Move consec_zero_mv from cyclic refresh to cpi struct.
So it can be used even with aq-mode=3 not enabled.
Also cleans up some code in the places where its used.

No change in behavior.

Change-Id: Ib6b265308dbd483f691200da9a0be4da4b380dbc
2016-04-22 08:09:39 -07:00
James Zern
9222d467e7 hadamard_test: align src/dst buffers
fixes crash in 32-bit builds

Change-Id: I149e517c940a8cd43643e213bfbe077b6f579090
2016-04-22 00:06:49 -07:00
Johann
2f5840de3e vpx_minmax_8x8_neon and test
BUG=https://bugs.chromium.org/p/webm/issues/detail?id=1156

Change-Id: Ief0ad8d6255b0ef0f233cda153799e3c72d3dbc6
2016-04-21 21:40:25 -07:00
Johann Koenig
1710419eb5 Merge "hadamard 8x8 test" 2016-04-22 04:36:10 +00:00
Johann
8c02a36953 hadamard 8x8 test
The order of the output structure is not currently important.

BUG=https://bugs.chromium.org/p/webm/issues/detail?id=1021

Change-Id: Ibc0006d569675db6c5060c4529f5d9e73f2e96a6
2016-04-21 22:28:21 +00:00
James Bankoski
b816eea5ef Merge "vp9_loopfilter.c : fix / clarify todo" 2016-04-21 20:40:41 +00:00
James Bankoski
2bcec13e5f Merge "vp9_loopfilter.c: Todo clean up encoder should work like decoder." 2016-04-21 20:40:35 +00:00
James Bankoski
166fc7cb43 Merge "vp9_loopfilter.c : todo cleanup" 2016-04-21 20:40:24 +00:00
Jim Bankoski
996ccc3311 vp9_loopfilter.c : fix / clarify todo
Change-Id: Ie3ec67a83d1877d3deae9c7922b6899d915aa19e
2016-04-21 20:39:56 +00:00
Jim Bankoski
6bd28a2d05 vp9_loopfilter.c: Todo clean up encoder should work like decoder.
Change-Id: I570c6859d6e18cd94ce4a29068477b937489399c
2016-04-21 20:36:39 +00:00
Jim Bankoski
1de659af06 vp9_encodemb.c: TODO clean up
huisu did in nextgen branch -> please try in vp9

Change-Id: I0ff35db07ac38464e0e2858e303be686c03a5d0e
2016-04-21 20:35:54 +00:00
Jim Bankoski
df4c95afce vp9_loopfilter.c : todo cleanup
Removed this todo because of another todo which says none of this code
should exist. It should be integrated into the block by block encode
process as per the decoder.

Change-Id: I076bd15140a060e69c014dd7d7cd07fea260aba3
2016-04-21 20:35:30 +00:00
Yaowu Xu
d179b784f9 Merge "vp9_loopfilter.c: Todo try inloop calculation." 2016-04-21 15:38:12 +00:00
Jim Bankoski
b627af0eb0 vp9_loopfilter.c: Todo try inloop calculation.
This is implemented in the decoder already.  Will add a todo for the
encoder.

Change-Id: I5e78c045cb2edb5ba171022aeeb70051a708b916
2016-04-20 23:53:20 +00:00
Marco
83f17eeede vp9: 1 pass vbr: Small fix on reset avg_intersize_gfint on scene cut.
Change-Id: Ie73d1bbc2c953d010b32097440698f0d060750be
2016-04-20 16:32:09 -07:00
Marco
8a906039a7 vp9: 1 pass vbr: small adjustment to active_best factor for inter.
Change-Id: I9c68aa9e72969b0ffbf57eb186380ff666745aeb
2016-04-20 14:25:13 -07:00
Marco Paniconi
e4d9f0e31f Merge "vp8: Update on sum_diff_threshold." 2016-04-20 00:20:42 +00:00
Marco
9ca6b46cef vp9: Adjust gf period for high average Q and overshoot.
For 1 pass vbr mode.
Increase the gf interval for case where average Q is close to
max and high overshoot is detected.

Small increase in overall avg_psnr/sssim metrics (~0.2/0.1%) for ytlive,
but improves the low-end (low bitrate) for several clips (less overshoot).

Change-Id: Ifba40f25b4861b2e0d9832c82d5359a6a3dce9f2
2016-04-19 17:18:11 -07:00
Marco
d33be6caa9 vp8: Update on sum_diff_threshold.
Reset to previous values.

Change-Id: Ia49bafc1d1ec5f657819ffba04d11fd701f315e8
2016-04-19 15:59:48 -07:00
Marco
9cc1f692bd vp9: 1 pass vbr: More even spacing for gf near key frame.
More even spacing near key frame and avoid gf on scene cut
if its close to key frame.

Small increase in metrics for ytlive set (which uses key-period=150).
(~0.2% gain)

Change only affects 1 pass vbr mode.

Change-Id: If1e5a59baf1e0befbaf998522fbc47d94ac5b5df
2016-04-18 14:40:55 -07:00
Marco
d488236ce3 vp9: Adjustment to active_best_quality for inter_frame, 1 pass vbr.
Change only affects 1 pass vbr.

Use a q value somewhat larger (~6%) than avg_frame_qindex[INTER]
as basis for active_best_quality for inter-frames.
And use the minium of this (avg_frame_qindex) and the active_worst_quality.

This reduces some overshoot in ytlive clips.
Overall small but positive average increase in metrics (up on average ~0.2%).

Change-Id: Icdbaae7872d5675fd38a13c0ec6ce0e2e3b919ce
2016-04-18 13:01:27 -07:00
Paul Wilkins
2e0841931c Merge "Adjustment to prediction decay." 2016-04-18 18:47:13 +00:00
Scott LaVarnway
9faa0296b8 Merge "VP9: inline vp9_get_intra_inter_context()" 2016-04-15 19:06:33 +00:00
Johann Koenig
c59c5cbeff Merge "Enable vpx_idct32x32_1024_add_neon for neon as well, not only for neon_asm" 2016-04-15 16:00:51 +00:00
Scott LaVarnway
ef98a8f61f VP9: inline vp9_get_intra_inter_context()
Change-Id: I71366140799b9b39474b9b459082cdb250bd1905
2016-04-15 04:58:37 -07:00
Martin Storsjo
d8b3e29ee7 Enable vpx_idct32x32_1024_add_neon for neon as well, not only for neon_asm
This was never hooked up for the 32x32_34 case as the neon_asm version
in 3f7c12da, when the intrinsics version was added.

Change-Id: Ic7db4ce5850c637315f9fe9e2de93a4f8cf9e320
2016-04-15 10:25:47 +03:00
Johann
26faa3ec7a Apply 'const' to data not pointer
Change-Id: Ic6b695442e319f7582a7ee8e52a47ae3e38c7298
2016-04-14 14:47:16 -07:00
James Zern
5fb49e456a Merge "dct32x32_test: s/HAVE_NEON_ASM/HAVE_NEON/" 2016-04-14 02:35:46 +00:00
Marco Paniconi
e6657f32c5 Merge "vp9: Adjustment to scene-cut detection." 2016-04-13 22:36:29 +00:00
Marco
24db57f0e1 vp9: Adjustment to scene-cut detection.
Change recursive weight for average_source_sad and
put some constraint on spacing between detected scene-cuts.

Change only affects 1 pass real-time mode.

Change-Id: I1917e748d845e244812d11aec2a9d755372ec182
2016-04-13 14:40:08 -07:00
Yunqing Wang
885872f899 Fix Visual Studio build warning
Fixed warning C4244: '-=' : conversion from 'const double' to 'int',
possible loss of data.

Change-Id: Ic4691346037767b244e7f71248c2f871f92002f3
2016-04-13 09:09:08 -07:00
James Zern
ef17fc46f3 dct32x32_test: s/HAVE_NEON_ASM/HAVE_NEON/
vpx_idct32x32_1024_add_neon is implemented with instrinsics

Change-Id: I072b18248b97ee2634f06b2751ffa2ced85f8e5b
2016-04-13 00:08:28 -07:00
James Zern
9c2ed00c8c Merge changes from topic 'arm64'
* changes:
  configure: Detect aarch64 toolchains automatically
  configure: Add an arm64-linux-gcc target configuration
2016-04-13 03:11:39 +00:00
Marco
6a3cf099aa vp9: Adjust threshold for scene-change detection.
For 1 pass vbr.

Change-Id: I10b7eefc36d65c30844d205e139515bec7fed6af
2016-04-12 18:28:04 -07:00
Alex Converse
48b81a1a3c Merge "Increase active map test coverage from RT speeds 0-5 to 0-8." 2016-04-12 22:20:12 +00:00
Marco Paniconi
f81b0000f6 Merge "vp9: Fix to active_best for GF/ARF in 1 pass vbr." 2016-04-12 21:18:41 +00:00
Debargha Mukherjee
ff72cca8bb Merge "Step towards making the 2-pass cq mode perceptual" 2016-04-12 19:42:06 +00:00
Alex Converse
ba5f7a514a Increase active map test coverage from RT speeds 0-5 to 0-8.
This test takes less than 100 ms for each of speeds 6-8.

Change-Id: Ibbeb3004a2607d25dcbf77cb5314ade87809e059
2016-04-12 11:14:10 -07:00
Marco
3861b25be1 vp9: Fix to active_best for GF/ARF in 1 pass vbr.
Correct the setting of Q basis of GF/ARF in 1 pass vbr.

Existing logic would switch to using avg_QP of key frame if
avg_QP of inter is less than active worst (even if key frame is
not last frame).

Instead fix the logic (as per the comment) to use the lower of
active_worst_quality and avg_Q for inter as basis for GF/ARF
active_best_quality (unless last frame was key frame).

Increase in metrics: AvgPSNR/SSIM up by ~0.7/0.3 on ytlive set.

Change-Id: I9a628378ec6684bfda9457ebfc2384ef6d8579f7
2016-04-12 10:37:45 -07:00
Martin Storsjo
819f3c805d configure: Detect aarch64 toolchains automatically
Change-Id: Icafda81dbc3323fa0afdba5f1c8758e812cc592a
2016-04-12 14:15:07 +03:00
Martin Storsjo
babd308b5e configure: Add an arm64-linux-gcc target configuration
Change-Id: I23efc07572b2406ce5d9283340aef5aee8326280
2016-04-12 14:15:01 +03:00
Alex Converse
a3a10a323b pickmode: only cost the skip flag once per prediction block
RTC speed 6:
File    Match   Avg     BDRate  Low     Mid     High
OVERALL ✔       -0.040  -0.045  -0.031  -0.084  0.004

Screencast speed 6:
File     Match   Avg     BDRate  Low     Mid     High
OVERALL ✔       1.115   -0.162  0.203   2.470   0.541

Change-Id: I46bbc11c89301015b5d3eac25294c709f23f0897
2016-04-11 15:39:52 -07:00
Alex Converse
5b3d3b1909 Merge "Remove obsolete segment skip checks from tokenization." 2016-04-11 18:58:32 +00:00
Paul Wilkins
1c187c4be0 Adjustment to prediction decay.
Adjustment to stop excessive prediction decay triggered by blocks
or frames with extremely low spatial complexity which rendered the
comparison of intra and inter coded errors meaningless.

This was causing much shorter than expected groups on some 4k
test content.

Change-Id: I3f2c64200ef6dcef4721fc9f2ec09e480056ffc2
2016-04-11 13:25:33 +01:00
Paul Wilkins
f659c7e99e Merge "Adjust motion component of prediction decay." 2016-04-11 10:27:30 +00:00
Paul Wilkins
c5a89b46b9 Merge "Trap very short arf group just before a kf." 2016-04-11 10:27:12 +00:00
Scott LaVarnway
ad47d1d194 Merge "VP9: Combine TileData with TileWorkerData" 2016-04-10 22:17:45 +00:00
Debargha Mukherjee
c47c460f69 Step towards making the 2-pass cq mode perceptual
Uses a metric on fraction of smooth blocks derived from first pass
stats in a frame to adjust down the cq_level modestly in the cq mode.
The current implementation does not add much complexity, and is
fairly light in the adaptation.

Change-Id: Ic484e810d5bd51b7bb6b8945f378c7c3d9d27053
2016-04-09 06:24:18 -07:00
Tom Finegan
4317ba58a9 third_party: Roll libwebm snapshot.
32d5ac4 mkvmuxerutil: Fix MSVC build.
6397597 vpxpes_parser: Fix MSVC build.
784b6fe mkvmuxer: Revert changes to IMkvWriter types.
030518e webm_info: Fix implicit conversion warnings.
46d5dee sample_muxer: Fix implicit conversion warnings.
22b0845 webmts: Fix implicit conversion warnings.
ef464c2 mkvparser: Fix implicit conversion warnings.
0e9767e Merge "rename mingw64_toolchain.cmake to mingw-w64_toolchain"
f47cbd5 cmake: Move cxx flag testing/setup into its own file.
87443a6 rename mingw64_toolchain.cmake to mingw-w64_toolchain
2aee04f msvc_runtime.cmake: Check for MSVC, not WIN32.
eb50da8 Option to write timecode using fixed # of bytes
c1991fe mkvmuxer: Add missing Segment member initializer.
10aed96 Android.mk: Make libwebm easier to build downstream.
5c50e31 Add support for parsing VPx track codec private data.
4cbdbf1 Fix Android build.
bb48a3f mkvmuxerutil: remove stray 'int32'
a1cba34 Support cross compile for windows via mingw64.
596f5e0 Add webm_info.
ccf75f6 msvc/muxer_tests: Silence integer conversion warnings.
2ff2954 msvc/webm2pes: Silence integer and floating point conversion warnings.
1f24323 msvc/hdr_util: Silence double to float conversion warnings.
0744563 msvc/vpxpes_parser: Silence integer conversion warning.
59614b8 msvc/libwebm_util: Fix floating point to int conversion warning.
6481c24 webvtt: Fix include in vttreader.
e6ed0f4 msvc/vpxpes2ts: Fix MSVC integer conversion warning.
da64396 cmake/msvc: Disable C4996 project wide.
6ef8264 Merge "mkvparser::BlockEntry: inline EOS()"
3fa6aec mkvparser::BlockEntry: inline EOS()
26306f9 mkvmuxer: Remove unused Cluster ctor overload.
0d76597 mkvmuxer: Fix build with GCC 5.3.
0ba80bc mkvparser/sample: Minor clean up.
2e0e906 iosbuild.sh: Fix build.
918440a Makefile.unix: allow CXXFLAGS to be easily overridden
4ff5785 cmake: Add C++11 move ctor and member initializer tests.
402ef4d cmake: remove argc and argv from C++11 test main fns.
cbe5c40 Restore original namespaces for mkvmuxer and mkvparser.
504e0f2 Mass file extension update.
79cb980 Android.mk: Update source file locations.
01db4c2 webmids: Move to common/ sub dir.
235ce59 mkvparser: Explicitly reference internal sources in includes.
f578419 mkvmuxer: Move sources to mkvmuxer/ sub dir.
5f1065e webvtt: Organize and clean up webvtt support.
7abe8ac cmake: Add missing dumpvtt target.
f2f87e2 Makefile.unix: Tidy things up.
12f6dc3 Use <stdint.h> types instead of custom typedefs.
0407360 mkvmuxer: Write last block in each Cluster with Duration
008aa63 mkvparser: move to mkvparser sub dir.
e64bf75 Namespace reorg: Make everything a child of libwebm.
5fdb386 cmake: move c++11 checks into build/cxx11_tests.cmake.
3672488 Copy reference block values in Frame::CopyFrom()
91ca780 reapply clang-format
8d34215 Merge "Clean up AddAudioTrack in muxer_tests"
90861d4 Clean up AddAudioTrack in muxer_tests
a9dfb3d Un-ignore webm files in testdata
c5b76d8 Extract PES parser from WebM2Pes tests.
16524e8 cmake: Add include-what-you-use integration.
7015af5 iwyu/vpxpes2ts: Update includes.
c1d6a70 iwyu/webm2pes: Update includes.
110e797 iwyu/libwebm_util: Update includes.
44e31fb iwyu/webm2pes_tests: Update includes.
d919f96 iwyu/mkvwriter: Update includes.
75790e1 iwyu/mkvparser: Update includes.
5f673ca iwyu/webm2pes_main: Update includes.
747244a iwyu/vpxpes2ts_main: Update includes.
94c985f iwyu/mkvmuxerutil: Update includes.
c365630 iwyu/mkvmuxer: Update includes.
b15b8ef iwyu/file_util: Update includes.
3dfba95 iwyu/hdr_util: Update includes.
baba8b1 iwyu/vttdemux: Update includes.
3212ec1 iwyu/webvttparser: Update includes.
b6d8d92 iwyu/sample_muxer_metadata: Update includes.
a9a1a01 iwyu/sample_muxer: Update includes.
e020ffd iwyu/sample: Update includes.
18834bc iwyu/parser_tests: Update includes.
9c00ae3 iwyu/muxer_tests: Update includes.
41a17eb iwyu/test_util: Update includes
b6174be muxer_tests: Fix windows brokenness.
e092515 file_util: Remove tmpnam() usage in MSVC.
b9dc4ac test_util: Don't pass NULL to std::string() in GetTestDataDir().
1f74651 webmts: Move PES/TS sources to m2ts sub directory.
1b895e9 Rename libwebm_utils to libwebm_util.
2fabcd3 sample_muxer: Replace std::tmpnam() with libwebm::GetTempFileName().
e6a0033 Add file_util.
87f9bea Move hdr_util to common.
1f64aaf cmake: Expand C++11 tests.
6dc81c1 muxer_tests: Die immediately when unable to prep for file writing.
521ce4d webm2pes: Fix type limit warning.
64c4163 vpxpes2ts: Fix sign-compare and type-limits warnings.
741ba68 muxer_tests: Replace std::tmpnam() with GetTempFileName().
6159e83 Merge "test_util: add missing include for close()"
ff81c74 parser_tests: Fix sign compare warnings.
163f57d test_util: add missing include for close()
7c89eb5 Merge "test_util: Remove tmpnam() usage on non-MSVC targets."
c4b8686 Merge "webm2pes_tests: Fix sign compare warnings."
9c9f546 Merge "muxer_tests: Fix sign compare warnings."
0fbefef webm2pes: Silence sign compare warnings.
599e4e8 cmake: Silence clang/gcc deprecation warnings.
82f376f test_util: Remove tmpnam() usage on non-MSVC targets.
4d31d6b webm2pes_tests: Fix sign compare warnings.
07ed7e0 muxer_tests: Fix sign compare warnings.
ae2fbfe parser_tests: Silence sign compare warning.
f488528 libwebm_utils: Silence sign compare warning.
777247b Add C++11 detection to cmake file.
9b89187 Add missing include to libwebm_utils.h.
421874a Merge "mkvmuxer: Fix GCC build."
dd6ab35 Set the mastering metadata on the muxers colour
8b61ef5 mkvmuxer: Fix GCC build.
353b050 Add hdr_util.
c92e080 mkvmuxer: Use kValueNotPresent in Colour/MasteringMetadata.
2d09128 Colour element: TransferFunction renamed to TransferCharacteristics.
f2fc28e Colour element: Matrix renamed to MatrixCoefficients.
e0b1135 cmake: Minor CMakeLists.txt refactor.
1e1872b Revert change from auto_ptr to unique_ptr in sample code.
d7fc382 Track updates to the proposed Matroska Colour spec.
99981ee sample(mkvparser): Output Colour element when present.
375e416 mkvmuxer: Fix Colour element support.
eaeca34 mkvmuxer: Fix bits per channel in the colour element.
1dab7f3 mkvparser: Avoid crash when encountering a Colour element.
a1517aa sample_muxer: copy the Colour element.
ea9dd94 Merge "webm2pes: Fix tests."
8635c5b Merge "mkvparser: Make omitted values detectable in the Colour element."
ae4ae7e mkvparser: Make omitted values detectable in the Colour element.
8c8cba6 webm2pes: Fix tests.
a281a22 mkvmuxer: Add support for the Colour element and its children.
41a9147 sample_muxer: clang-format include order fix.
939a64d Signal E_BUFFER_NOT_FULL in EBMLHeader::Parse
fb1406e mkvparser: Add support for the Colour element and its children.
22bfdf7 Merge "parser_tests: Add validation of cues."
b873000 parser_tests: Add validation of cues.
799891e Update .gitignore to include some new binaries
e051c60 Merge "Update muxer test gold files"
b81d5f0 Update muxer test gold files
48b1e9a mkvparser: clang format run
93c4690 webm2pes: Add PES packet parsing tests.
65ca38f Merge "test_util: Fix gcc build."
520ca6c Merge "parser_tests: Fix gcc build."
37a38ca test_util: Fix gcc build.
ee0ebba parser_tests: Fix gcc build.
c32f970 Replace auto_ptr usage with unique_ptr.
e569ab0 webm2pes/ts: Fix gcc build.
2e55d6c Merge "add bitcode embedding support for ios"
0cfb2dc add bitcode embedding support for ios
bb8cefd webm2ts: Converts WebM VPx video to a MPEG TS.
453bf44 webm2pes: Begin addition of tests.
9299bbb libwebm: Googletest integration.
3bec1ba Merge changes I7bcb5b3e,I8ce733be,I98a928ff,I71910f24
5c83bbe Fix ParseElementHeader to support 0 payload elements
be35869 libwebm_utils: Add FileDeleter.
d6db1e1 webm2pes: Add a WebM parser init method.
aa3593e webm2pes: Rename Convert to ConvertToFile().
e8fca12 webm2pes: Fix super frame splitting.
3cb96b6 webm2pes: Move main() and helper functions into their own files.
021432b webm2pes: Fix the linux build.
82ac5fc Remove RELEASE.TXT.
852e173 webm2pes: Split super frames and packetize large frames.
faf85c2 webm2pes: Refactor header/optional header writing.
7c19266 Add Webm2Pes.
01fdee4 mkvmuxer: Disallow AddTrack() after Tracks element is output.
1ad314e mkvparser: EBMLHeader::Parse: remove dead init

Change-Id: I542bd5e34586f29d4d15771ec4bd728defe0769e
2016-04-08 22:01:48 -07:00
Tom Finegan
985786c780 configure: Disable webm_io when target is VS 7/8/9.
libwebm now requires stdint.h, and the noted Visual Studio versions
omit it.

Change-Id: I7e5de131c357cb7a99c33452b2b623882817df0f
2016-04-08 18:50:32 -07:00
Alex Converse
fa4ca4037e Remove obsolete segment skip checks from tokenization.
Change-Id: Iac7bc0d0eba459a04688aae224d34ae9b59742db
2016-04-08 11:38:25 -07:00
Hui Su
6a0e771555 Merge "Correct comments for scan order neighbors" 2016-04-08 18:03:22 +00:00
Marco Paniconi
989d536861 Merge "vp9-denoiser: Avoid copy-block when denoising is at LowLow level." 2016-04-08 17:51:54 +00:00
Marco Paniconi
86212bc3c1 Merge "vp8-denoiser: Avoid doing the mcomp if we don't denoise." 2016-04-08 17:51:25 +00:00
paulwilkins
81d1e7bf28 Adjust motion component of prediction decay.
Adjust the motion decay component to account for image size.
This has very little impact for smaller image sizes.

Average bdrate results for our HD test sets:-

Hdres set:  opsnr +0,92%,  Fast SSIM +1.6%
Netflix hd set:  opsnr + 1.5%, Fast SSIM +3.1%

There are a couple of notable -ve clips such as cyclist and sunflower
which seem to be better with a shorter interval but also a few very big
wins such as Jets >12% psnr 22% Fast SSIM and from the Netflix
Netflix set PierSeaside 9.7% psnr and 18.2% Fast SSIM.

Change-Id: Ie43aaedaa74331ed83d624a13548094ac64fed9e
2016-04-08 10:28:40 +01:00
Marco Paniconi
13ce6e6d00 Merge "vp9: Some adjustments to scene-cut detection." 2016-04-07 22:00:46 +00:00
Marco
f6f544278e vp9: Some adjustments to scene-cut detection.
Change only affects 1 pass vbr mode, speed >=5.
Increase min_thresh, decrease boost, and set a min/max
value for gf_interval.

Change-Id: I9c1e1a1ab0c5780064eb62714ee39a72ea4d2107
2016-04-07 14:26:15 -07:00
Tom Finegan
6965bde4e0 Revert "third_party: Roll libwebm snapshot."
This reverts commit 31b975713cf69879bcfd66bc653791112a8c3644. It breaks
the VS10_x64 and VS11_ARM builds.

Change-Id: Ifc1146a98daa5b4ef52f49a191bef98932d51f06
2016-04-07 11:47:59 -07:00
Scott LaVarnway
7cb4ab56ea VP9: Combine TileData with TileWorkerData
Change-Id: I83536734a54ef7b85f90f56a51878d94fac7ff22
2016-04-07 11:44:27 -07:00
hui su
69c7ad3407 Correct comments for scan order neighbors
Change-Id: I5e2dc39bf0ee8e501e4dd358be2e92ae50934593
2016-04-07 11:07:21 -07:00
Marco Paniconi
e96f0c3db3 Merge "vp9-1 pass vbr: Use average QP for active_worst_quality, for inter-frames." 2016-04-07 16:31:12 +00:00
paulwilkins
107de19698 Trap very short arf group just before a kf.
Trap the case where we end up with a very short arf group just before
a key frame. Such a group often has poor quality and may cause pulsing.

For example if the KF is 17 frames away we are better doing two mid-size
groups of 9 and 8 than a group of 15 followed by a group of 2.

This becomes more and more important when coding with a short forced
kf interval though it may not impact our standard tests much.

Change-Id: I29d83d6637b203eac69be320dd35a7401a4678c1
2016-04-07 14:56:24 +01:00
Tom Finegan
31b975713c third_party: Roll libwebm snapshot.
eb50da8 Option to write timecode using fixed # of bytes
c1991fe mkvmuxer: Add missing Segment member initializer.
10aed96 Android.mk: Make libwebm easier to build downstream.
5c50e31 Add support for parsing VPx track codec private data.
4cbdbf1 Fix Android build.
bb48a3f mkvmuxerutil: remove stray 'int32'
a1cba34 Support cross compile for windows via mingw64.
596f5e0 Add webm_info.
ccf75f6 msvc/muxer_tests: Silence integer conversion warnings.
2ff2954 msvc/webm2pes: Silence integer and floating point conversion warnings.
1f24323 msvc/hdr_util: Silence double to float conversion warnings.
0744563 msvc/vpxpes_parser: Silence integer conversion warning.
59614b8 msvc/libwebm_util: Fix floating point to int conversion warning.
6481c24 webvtt: Fix include in vttreader.
e6ed0f4 msvc/vpxpes2ts: Fix MSVC integer conversion warning.
da64396 cmake/msvc: Disable C4996 project wide.
6ef8264 Merge "mkvparser::BlockEntry: inline EOS()"
3fa6aec mkvparser::BlockEntry: inline EOS()
26306f9 mkvmuxer: Remove unused Cluster ctor overload.
0d76597 mkvmuxer: Fix build with GCC 5.3.
0ba80bc mkvparser/sample: Minor clean up.
2e0e906 iosbuild.sh: Fix build.
918440a Makefile.unix: allow CXXFLAGS to be easily overridden
4ff5785 cmake: Add C++11 move ctor and member initializer tests.
402ef4d cmake: remove argc and argv from C++11 test main fns.
cbe5c40 Restore original namespaces for mkvmuxer and mkvparser.
504e0f2 Mass file extension update.
79cb980 Android.mk: Update source file locations.
01db4c2 webmids: Move to common/ sub dir.
235ce59 mkvparser: Explicitly reference internal sources in includes.
f578419 mkvmuxer: Move sources to mkvmuxer/ sub dir.
5f1065e webvtt: Organize and clean up webvtt support.
7abe8ac cmake: Add missing dumpvtt target.
f2f87e2 Makefile.unix: Tidy things up.
12f6dc3 Use <stdint.h> types instead of custom typedefs.
0407360 mkvmuxer: Write last block in each Cluster with Duration
008aa63 mkvparser: move to mkvparser sub dir.
e64bf75 Namespace reorg: Make everything a child of libwebm.
5fdb386 cmake: move c++11 checks into build/cxx11_tests.cmake.
3672488 Copy reference block values in Frame::CopyFrom()
91ca780 reapply clang-format
8d34215 Merge "Clean up AddAudioTrack in muxer_tests"
90861d4 Clean up AddAudioTrack in muxer_tests
a9dfb3d Un-ignore webm files in testdata
c5b76d8 Extract PES parser from WebM2Pes tests.
16524e8 cmake: Add include-what-you-use integration.
7015af5 iwyu/vpxpes2ts: Update includes.
c1d6a70 iwyu/webm2pes: Update includes.
110e797 iwyu/libwebm_util: Update includes.
44e31fb iwyu/webm2pes_tests: Update includes.
d919f96 iwyu/mkvwriter: Update includes.
75790e1 iwyu/mkvparser: Update includes.
5f673ca iwyu/webm2pes_main: Update includes.
747244a iwyu/vpxpes2ts_main: Update includes.
94c985f iwyu/mkvmuxerutil: Update includes.
c365630 iwyu/mkvmuxer: Update includes.
b15b8ef iwyu/file_util: Update includes.
3dfba95 iwyu/hdr_util: Update includes.
baba8b1 iwyu/vttdemux: Update includes.
3212ec1 iwyu/webvttparser: Update includes.
b6d8d92 iwyu/sample_muxer_metadata: Update includes.
a9a1a01 iwyu/sample_muxer: Update includes.
e020ffd iwyu/sample: Update includes.
18834bc iwyu/parser_tests: Update includes.
9c00ae3 iwyu/muxer_tests: Update includes.
41a17eb iwyu/test_util: Update includes
b6174be muxer_tests: Fix windows brokenness.
e092515 file_util: Remove tmpnam() usage in MSVC.
b9dc4ac test_util: Don't pass NULL to std::string() in GetTestDataDir().
1f74651 webmts: Move PES/TS sources to m2ts sub directory.
1b895e9 Rename libwebm_utils to libwebm_util.
2fabcd3 sample_muxer: Replace std::tmpnam() with libwebm::GetTempFileName().
e6a0033 Add file_util.
87f9bea Move hdr_util to common.
1f64aaf cmake: Expand C++11 tests.
6dc81c1 muxer_tests: Die immediately when unable to prep for file writing.
521ce4d webm2pes: Fix type limit warning.
64c4163 vpxpes2ts: Fix sign-compare and type-limits warnings.
741ba68 muxer_tests: Replace std::tmpnam() with GetTempFileName().
6159e83 Merge "test_util: add missing include for close()"
ff81c74 parser_tests: Fix sign compare warnings.
163f57d test_util: add missing include for close()
7c89eb5 Merge "test_util: Remove tmpnam() usage on non-MSVC targets."
c4b8686 Merge "webm2pes_tests: Fix sign compare warnings."
9c9f546 Merge "muxer_tests: Fix sign compare warnings."
0fbefef webm2pes: Silence sign compare warnings.
599e4e8 cmake: Silence clang/gcc deprecation warnings.
82f376f test_util: Remove tmpnam() usage on non-MSVC targets.
4d31d6b webm2pes_tests: Fix sign compare warnings.
07ed7e0 muxer_tests: Fix sign compare warnings.
ae2fbfe parser_tests: Silence sign compare warning.
f488528 libwebm_utils: Silence sign compare warning.
777247b Add C++11 detection to cmake file.
9b89187 Add missing include to libwebm_utils.h.
421874a Merge "mkvmuxer: Fix GCC build."
dd6ab35 Set the mastering metadata on the muxers colour
8b61ef5 mkvmuxer: Fix GCC build.
353b050 Add hdr_util.
c92e080 mkvmuxer: Use kValueNotPresent in Colour/MasteringMetadata.
2d09128 Colour element: TransferFunction renamed to TransferCharacteristics.
f2fc28e Colour element: Matrix renamed to MatrixCoefficients.
e0b1135 cmake: Minor CMakeLists.txt refactor.
1e1872b Revert change from auto_ptr to unique_ptr in sample code.
d7fc382 Track updates to the proposed Matroska Colour spec.
99981ee sample(mkvparser): Output Colour element when present.
375e416 mkvmuxer: Fix Colour element support.
eaeca34 mkvmuxer: Fix bits per channel in the colour element.
1dab7f3 mkvparser: Avoid crash when encountering a Colour element.
a1517aa sample_muxer: copy the Colour element.
ea9dd94 Merge "webm2pes: Fix tests."
8635c5b Merge "mkvparser: Make omitted values detectable in the Colour element."
ae4ae7e mkvparser: Make omitted values detectable in the Colour element.
8c8cba6 webm2pes: Fix tests.
a281a22 mkvmuxer: Add support for the Colour element and its children.
41a9147 sample_muxer: clang-format include order fix.
939a64d Signal E_BUFFER_NOT_FULL in EBMLHeader::Parse
fb1406e mkvparser: Add support for the Colour element and its children.
22bfdf7 Merge "parser_tests: Add validation of cues."
b873000 parser_tests: Add validation of cues.
799891e Update .gitignore to include some new binaries
e051c60 Merge "Update muxer test gold files"
b81d5f0 Update muxer test gold files
48b1e9a mkvparser: clang format run
93c4690 webm2pes: Add PES packet parsing tests.
65ca38f Merge "test_util: Fix gcc build."
520ca6c Merge "parser_tests: Fix gcc build."
37a38ca test_util: Fix gcc build.
ee0ebba parser_tests: Fix gcc build.
c32f970 Replace auto_ptr usage with unique_ptr.
e569ab0 webm2pes/ts: Fix gcc build.
2e55d6c Merge "add bitcode embedding support for ios"
0cfb2dc add bitcode embedding support for ios
bb8cefd webm2ts: Converts WebM VPx video to a MPEG TS.
453bf44 webm2pes: Begin addition of tests.
9299bbb libwebm: Googletest integration.
3bec1ba Merge changes I7bcb5b3e,I8ce733be,I98a928ff,I71910f24
5c83bbe Fix ParseElementHeader to support 0 payload elements
be35869 libwebm_utils: Add FileDeleter.
d6db1e1 webm2pes: Add a WebM parser init method.
aa3593e webm2pes: Rename Convert to ConvertToFile().
e8fca12 webm2pes: Fix super frame splitting.
3cb96b6 webm2pes: Move main() and helper functions into their own files.
021432b webm2pes: Fix the linux build.
82ac5fc Remove RELEASE.TXT.
852e173 webm2pes: Split super frames and packetize large frames.
faf85c2 webm2pes: Refactor header/optional header writing.
7c19266 Add Webm2Pes.
01fdee4 mkvmuxer: Disallow AddTrack() after Tracks element is output.
1ad314e mkvparser: EBMLHeader::Parse: remove dead init

Change-Id: I13637ceacab953786064b7f8f6ecf1495b7475d0
2016-04-06 15:37:05 -07:00
Tom Finegan
758fc662b2 Revert "third_party: Roll libwebm snapshot."
This reverts commit 74aaa2389ec056f9dd8631eeed42fe7a757daf32. Unstable
under valgrind because of uninitialized reads. Limiting the bad bisect range.

Change-Id: I45b32f0ee0ba45795e7efb9947fb805830c8ce0e
2016-04-06 14:30:33 -07:00
Scott LaVarnway
c93946bbc3 Merge "VP9: refactor read_switchable_interp_filter()" 2016-04-06 20:51:27 +00:00
Tom Finegan
99211b0263 Merge "Fix crash when mkvparser returns a NULL BlockEntry." 2016-04-06 15:03:09 +00:00
Scott LaVarnway
25920137ec VP9: refactor read_switchable_interp_filter()
Change-Id: I8f88b7ff21a0991297860c4a744a014629b0fa05
2016-04-06 04:53:43 -07:00
James Zern
5ab46e0ecd Merge changes I7a1c0cba,Ie02b5caf,I2cbd85d7,I644f35b0
* changes:
  vpx_fdct16x16_1_sse2: improve load pattern
  vpx_fdct16x16_1_c/msa: fix accumulator overflow
  vpx_fdctNxN_1_sse2: reduce store size
  dct32x32_test: add PartialTrans32x32Test, Random
2016-04-06 02:51:53 +00:00
Yi Luo
16d6aaceb8 Merge "Fix high bit depth mask and variance reference function" 2016-04-05 18:26:55 +00:00
Yi Luo
4bdc7d1c88 Fix high bit depth mask and variance reference function
- Use arithmetic AND (&) instead of logical AND (&&) to
  generate correct testing input.
- Fix variance reference function to be consistent with
  our codebase implementation.
- Refer to the following issue:
https://bugs.chromium.org/p/webm/issues/detail?id=1166

Change-Id: I8c1ebb03e22dc9e1dcd96bdf935fc126cee71307
2016-04-05 09:27:03 -07:00
Tom Finegan
74aaa2389e third_party: Roll libwebm snapshot.
5c50e31 Add support for parsing VPx track codec private data.
4cbdbf1 Fix Android build.
bb48a3f mkvmuxerutil: remove stray 'int32'
a1cba34 Support cross compile for windows via mingw64.
596f5e0 Add webm_info.
ccf75f6 msvc/muxer_tests: Silence integer conversion warnings.
2ff2954 msvc/webm2pes: Silence integer and floating point conversion warnings.
1f24323 msvc/hdr_util: Silence double to float conversion warnings.
0744563 msvc/vpxpes_parser: Silence integer conversion warning.
59614b8 msvc/libwebm_util: Fix floating point to int conversion warning.
6481c24 webvtt: Fix include in vttreader.
e6ed0f4 msvc/vpxpes2ts: Fix MSVC integer conversion warning.
da64396 cmake/msvc: Disable C4996 project wide.
6ef8264 Merge "mkvparser::BlockEntry: inline EOS()"
3fa6aec mkvparser::BlockEntry: inline EOS()
26306f9 mkvmuxer: Remove unused Cluster ctor overload.
0d76597 mkvmuxer: Fix build with GCC 5.3.
0ba80bc mkvparser/sample: Minor clean up.
2e0e906 iosbuild.sh: Fix build.
918440a Makefile.unix: allow CXXFLAGS to be easily overridden
4ff5785 cmake: Add C++11 move ctor and member initializer tests.
402ef4d cmake: remove argc and argv from C++11 test main fns.
cbe5c40 Restore original namespaces for mkvmuxer and mkvparser.
504e0f2 Mass file extension update.
79cb980 Android.mk: Update source file locations.
01db4c2 webmids: Move to common/ sub dir.
235ce59 mkvparser: Explicitly reference internal sources in includes.
f578419 mkvmuxer: Move sources to mkvmuxer/ sub dir.
5f1065e webvtt: Organize and clean up webvtt support.
7abe8ac cmake: Add missing dumpvtt target.
f2f87e2 Makefile.unix: Tidy things up.
12f6dc3 Use <stdint.h> types instead of custom typedefs.
0407360 mkvmuxer: Write last block in each Cluster with Duration
008aa63 mkvparser: move to mkvparser sub dir.
e64bf75 Namespace reorg: Make everything a child of libwebm.
5fdb386 cmake: move c++11 checks into build/cxx11_tests.cmake.
3672488 Copy reference block values in Frame::CopyFrom()
91ca780 reapply clang-format
8d34215 Merge "Clean up AddAudioTrack in muxer_tests"
90861d4 Clean up AddAudioTrack in muxer_tests
a9dfb3d Un-ignore webm files in testdata
c5b76d8 Extract PES parser from WebM2Pes tests.
16524e8 cmake: Add include-what-you-use integration.
7015af5 iwyu/vpxpes2ts: Update includes.
c1d6a70 iwyu/webm2pes: Update includes.
110e797 iwyu/libwebm_util: Update includes.
44e31fb iwyu/webm2pes_tests: Update includes.
d919f96 iwyu/mkvwriter: Update includes.
75790e1 iwyu/mkvparser: Update includes.
5f673ca iwyu/webm2pes_main: Update includes.
747244a iwyu/vpxpes2ts_main: Update includes.
94c985f iwyu/mkvmuxerutil: Update includes.
c365630 iwyu/mkvmuxer: Update includes.
b15b8ef iwyu/file_util: Update includes.
3dfba95 iwyu/hdr_util: Update includes.
baba8b1 iwyu/vttdemux: Update includes.
3212ec1 iwyu/webvttparser: Update includes.
b6d8d92 iwyu/sample_muxer_metadata: Update includes.
a9a1a01 iwyu/sample_muxer: Update includes.
e020ffd iwyu/sample: Update includes.
18834bc iwyu/parser_tests: Update includes.
9c00ae3 iwyu/muxer_tests: Update includes.
41a17eb iwyu/test_util: Update includes
b6174be muxer_tests: Fix windows brokenness.
e092515 file_util: Remove tmpnam() usage in MSVC.
b9dc4ac test_util: Don't pass NULL to std::string() in GetTestDataDir().
1f74651 webmts: Move PES/TS sources to m2ts sub directory.
1b895e9 Rename libwebm_utils to libwebm_util.
2fabcd3 sample_muxer: Replace std::tmpnam() with libwebm::GetTempFileName().
e6a0033 Add file_util.
87f9bea Move hdr_util to common.
1f64aaf cmake: Expand C++11 tests.
6dc81c1 muxer_tests: Die immediately when unable to prep for file writing.
521ce4d webm2pes: Fix type limit warning.
64c4163 vpxpes2ts: Fix sign-compare and type-limits warnings.
741ba68 muxer_tests: Replace std::tmpnam() with GetTempFileName().
6159e83 Merge "test_util: add missing include for close()"
ff81c74 parser_tests: Fix sign compare warnings.
163f57d test_util: add missing include for close()
7c89eb5 Merge "test_util: Remove tmpnam() usage on non-MSVC targets."
c4b8686 Merge "webm2pes_tests: Fix sign compare warnings."
9c9f546 Merge "muxer_tests: Fix sign compare warnings."
0fbefef webm2pes: Silence sign compare warnings.
599e4e8 cmake: Silence clang/gcc deprecation warnings.
82f376f test_util: Remove tmpnam() usage on non-MSVC targets.
4d31d6b webm2pes_tests: Fix sign compare warnings.
07ed7e0 muxer_tests: Fix sign compare warnings.
ae2fbfe parser_tests: Silence sign compare warning.
f488528 libwebm_utils: Silence sign compare warning.
777247b Add C++11 detection to cmake file.
9b89187 Add missing include to libwebm_utils.h.
421874a Merge "mkvmuxer: Fix GCC build."
dd6ab35 Set the mastering metadata on the muxers colour
8b61ef5 mkvmuxer: Fix GCC build.
353b050 Add hdr_util.
c92e080 mkvmuxer: Use kValueNotPresent in Colour/MasteringMetadata.
2d09128 Colour element: TransferFunction renamed to TransferCharacteristics.
f2fc28e Colour element: Matrix renamed to MatrixCoefficients.
e0b1135 cmake: Minor CMakeLists.txt refactor.
1e1872b Revert change from auto_ptr to unique_ptr in sample code.
d7fc382 Track updates to the proposed Matroska Colour spec.
99981ee sample(mkvparser): Output Colour element when present.
375e416 mkvmuxer: Fix Colour element support.
eaeca34 mkvmuxer: Fix bits per channel in the colour element.
1dab7f3 mkvparser: Avoid crash when encountering a Colour element.
a1517aa sample_muxer: copy the Colour element.
ea9dd94 Merge "webm2pes: Fix tests."
8635c5b Merge "mkvparser: Make omitted values detectable in the Colour element."
ae4ae7e mkvparser: Make omitted values detectable in the Colour element.
8c8cba6 webm2pes: Fix tests.
a281a22 mkvmuxer: Add support for the Colour element and its children.
41a9147 sample_muxer: clang-format include order fix.
939a64d Signal E_BUFFER_NOT_FULL in EBMLHeader::Parse
fb1406e mkvparser: Add support for the Colour element and its children.
22bfdf7 Merge "parser_tests: Add validation of cues."
b873000 parser_tests: Add validation of cues.
799891e Update .gitignore to include some new binaries
e051c60 Merge "Update muxer test gold files"
b81d5f0 Update muxer test gold files
48b1e9a mkvparser: clang format run
93c4690 webm2pes: Add PES packet parsing tests.
65ca38f Merge "test_util: Fix gcc build."
520ca6c Merge "parser_tests: Fix gcc build."
37a38ca test_util: Fix gcc build.
ee0ebba parser_tests: Fix gcc build.
c32f970 Replace auto_ptr usage with unique_ptr.
e569ab0 webm2pes/ts: Fix gcc build.
2e55d6c Merge "add bitcode embedding support for ios"
0cfb2dc add bitcode embedding support for ios
bb8cefd webm2ts: Converts WebM VPx video to a MPEG TS.
453bf44 webm2pes: Begin addition of tests.
9299bbb libwebm: Googletest integration.
3bec1ba Merge changes I7bcb5b3e,I8ce733be,I98a928ff,I71910f24
5c83bbe Fix ParseElementHeader to support 0 payload elements
be35869 libwebm_utils: Add FileDeleter.
d6db1e1 webm2pes: Add a WebM parser init method.
aa3593e webm2pes: Rename Convert to ConvertToFile().
e8fca12 webm2pes: Fix super frame splitting.
3cb96b6 webm2pes: Move main() and helper functions into their own files.
021432b webm2pes: Fix the linux build.
82ac5fc Remove RELEASE.TXT.
852e173 webm2pes: Split super frames and packetize large frames.
faf85c2 webm2pes: Refactor header/optional header writing.
7c19266 Add Webm2Pes.
01fdee4 mkvmuxer: Disallow AddTrack() after Tracks element is output.
1ad314e mkvparser: EBMLHeader::Parse: remove dead init

Change-Id: I49c1d6dbfab2855af886dc8af53cf6cf5ca382c2
2016-04-05 07:41:28 -07:00
Marco
ac86dde3af vp9-denoiser: Avoid copy-block when denoising is at LowLow level.
Avoid copy-block when denoising is at LowLow level (i.e., no denoising is done).
Instead, don't enter denoiser at all, and when level goes back up over kLowLow
do a reset in denoiser.

Change-Id: I0544adf58f4dd51ecc4a4607fcb0353bfbbb7a59
2016-04-04 17:02:24 -07:00
James Zern
38bc1d0f4b vpx_fdct16x16_1_sse2: improve load pattern
load the full row rather than doing 2 8-wide columns

Change-Id: I7a1c0cba06b0dc1ae86046410922b1efccb95c95
2016-04-04 16:03:42 -07:00
James Zern
eb64ea3e89 vpx_fdct16x16_1_c/msa: fix accumulator overflow
tran_low_t is only signed 16-bits in non-high-bitdepth mode

Change-Id: Ie02b5caf2658e8e71f995c17dd5ce666a4d64918
2016-04-04 16:03:41 -07:00
James Zern
3735def667 vpx_fdctNxN_1_sse2: reduce store size
only output[0] needs to be set, store_output is more involved than a
movdqa in the high bitdepth case

Change-Id: I2cbd85d7cf74688bdf47eb767934fe42e02bff67
2016-04-04 16:02:06 -07:00
Marco
6877acb67e vp8-denoiser: Avoid doing the mcomp if we don't denoise.
Avoid doing the mcomp in denoiser if we don't denoise the
block (because of motion/SSE/skin threshold, etc).
This can reduce encoding time (with denoiser enabled) by ~1.5-2%.

Change-Id: Ia699b68dfd37b89cdf3a82b8aa40e8c8f98a3d4f
2016-04-04 13:25:38 -07:00
Marco
5572ab1d02 vp9-noise estimate: Adhust threshold for Low level detection.
Change-Id: I1c78255c81cb4ac218964c80f8ecaf29f95b875b
2016-04-04 12:33:08 -07:00
Tom Finegan
79d5aac74f Fix crash when mkvparser returns a NULL BlockEntry.
BUG=https://bugs.chromium.org/p/webm/issues/detail?id=1090

Change-Id: I64b7b19581f15d53048e3026c3f8946e344fbe26
2016-04-04 11:50:44 -07:00
Marco Paniconi
71cf9fac83 Merge "vp9-noise estimation: Increase threshold for Low-level." 2016-04-04 17:33:35 +00:00
Marco
9ff73fe092 vp9-noise estimation: Increase threshold for Low-level.
This make it more likely clean/low-noise content will
be set as LowLow, and hence no denoising will be done.
Also set early exit on denoising for small blocks.

Change-Id: I4a72bba3e6c5e2d523d304c39deacc9c39bf216c
2016-04-04 09:32:22 -07:00
Marco
a2307ff095 vp9-denoiser. Code cleanup and bugfix.
Some cleanup and bugfix: pass mi_row/mi_col (not mv_col/mv_row)
to build_inter_predictors. This only affects case where
the frame is resized, but since denoising is not done on resized
frames, the fix has not effect currently.

Change-Id: I36617a7f0b43b6f49976745f15d400977e6ffa46
2016-04-04 09:11:00 -07:00
James Zern
89b1c9d4be Merge "dct32x32_test: create fn pointers w/'&' ref" 2016-04-02 19:38:36 +00:00
James Zern
50e05d0651 dct32x32_test: create fn pointers w/'&' ref
this helps some toolchains (vs9) resolve the type of the parameter

Change-Id: I116030361fc956e10de82b64c81d5917cddbcd5a
2016-04-02 11:17:29 -07:00
James Zern
c21d437052 vpx_fdct32x32_1_msa: fix accumulator overflow
Change-Id: I33a5432eda3416382e1cea06b45082c0c65faa75
2016-04-02 11:04:38 -07:00
James Zern
c98f8e04e5 dct32x32_test: add PartialTrans32x32Test, Random
Change-Id: I644f35b0b0a540bf5b6ebb6dbc05b3c95736f42b
2016-04-01 19:45:21 -07:00
James Zern
a0359b8c90 Merge changes I8e9692fc,Ifc06110c
* changes:
  vpx_fdctNxN_1_c: remove unnecessary store
  vpx_fdct32x32_1_c: fix accumulator overflow
2016-04-01 23:12:51 +00:00
Marco Paniconi
2f0067c62b Merge "vp9-denoiser: Adjust usage of skin and consec_zeromv." 2016-04-01 21:26:08 +00:00
James Zern
f4cae05cd4 vpx_fdctNxN_1_c: remove unnecessary store
only output[0] needs to be set, the other values will be ignored in this
case.

Change-Id: I8e9692fc0d6d85700ba46f70c2e899a956023910
2016-04-01 12:21:59 -07:00
Marco
7467ee0458 vp9-denoiser: Adjust usage of skin and consec_zeromv.
Change-Id: I250258fc70ec0fcf1b501708c5d4b84685cf882e
2016-04-01 11:50:15 -07:00
Marco
bc6c199785 vp8 denoiser: Some adjustments to usage of skin and motion.
Switch to use new skin model.

And fix condition for denoising skin block.
Previous condition did not denoise skin blocks if the selected
mode was non-zero motion in current frame. Modify condition to
also force no denoising if that mode was not selected as zero motion
now and for at least "x" past frames in a row (x = 2).

Change-Id: I00753e3fe45b9a308a7ef43c58f11868e3bfc6b0
2016-04-01 11:36:45 -07:00
Scott LaVarnway
a2a97b869f VP9: Refactor vp9_decode_block_tokens()
Change-Id: I30ab27808ec903f9490f36621fb16c197bd35d16
2016-04-01 04:57:39 -07:00
James Zern
74ed95a33e Merge "disable vp9_diamond_search_sad_avx" 2016-04-01 03:33:51 +00:00
James Zern
569c0dfc77 Merge "vpx_ports/mem_ops.h: clear some -Wconversion warnings" 2016-04-01 03:31:29 +00:00
Debargha Mukherjee
4aac819a18 Fix some static analysis issues with resize
Change-Id: I2e8ada1ae95bd5577344d6f898e6ad4723e38fbd
2016-03-31 14:39:34 -07:00
Marco
8fab3e82ca vp9-1 pass vbr: Use average QP for active_worst_quality, for inter-frames.
And replace some operation with shift.

Change-Id: If1ea874ee05b7238d5f954e55bb3ceda804a091a
2016-03-30 17:43:47 -07:00
James Zern
057c1c4034 disable vp9_diamond_search_sad_avx
this results in different output than C, observed with 1080p input at
speed 2.

BUG=https://bugs.chromium.org/p/webm/issues/detail?id=1168

Change-Id: Ie58cf20057f4531d1b1d19c7b7eae9e642587ce5
2016-03-30 17:31:28 -07:00
James Zern
44a9edf406 vpx_ports/mem_ops.h: clear some -Wconversion warnings
not strictly necessary, but allows projects using '-Wconversion
-Wno-sign-conversion' to reuse these headers.

Change-Id: Id1398d726c90173ccba9aea66798fcef6f20fa23
2016-03-30 17:02:10 -07:00
Scott LaVarnway
185836116c Merge "VP9: Eliminate up_available and left_available" 2016-03-30 23:21:07 +00:00
James Zern
0269df41c1 vpx_fdct32x32_1_c: fix accumulator overflow
tran_low_t is only 16-bits in non-high-bitdepth mode

Change-Id: Ifc06110c95e86e6d790c44250d52a538b2e9713b
2016-03-30 15:20:20 -07:00
Scott LaVarnway
ba962a5f37 VP9: Eliminate up_available and left_available
Use above_mi and left_mi instead.

Change-Id: I0b50e232c31d11da30aa2fb6f91a695aaf725e0c
2016-03-30 04:47:39 -07:00
James Zern
8d8ee1f644 Merge "vp8_peek_si_internal: quiet static analysis warning" 2016-03-30 05:38:59 +00:00
Johann Koenig
904cb53302 Merge "Properly propagate out of memory errors." 2016-03-29 22:36:42 +00:00
Paul Wilkins
aea8d97a74 Merge "Increase min-max q range for normal inter frames." 2016-03-29 14:02:22 +00:00
Jean-Yves Avenard
6f51672c4e Properly propagate out of memory errors.
It would otherwise result in an infinite loop.

Change-Id: Ic03fb220cc048538bd62dee599653187f2093079
2016-03-28 14:14:49 -07:00
Marco
48e7294e48 vp9-denoiser: Incorporate consec_zeromv in skin detection for denoising.
Change-Id: Ibe4e1207c0db1779e1358f4566da67c9a07bdb15
2016-03-28 10:57:54 -07:00
Marco Paniconi
86fb8130bf Merge "vp8-denoiser: Use the same skin detection for model=1 as in vp9." 2016-03-28 16:05:47 +00:00
James Zern
ee1bd86d9c Revert "third_party: Roll libwebm snapshot."
This reverts commit 80ddeb281a0d4b3d9a6d39a7ef91370f52845b39.

breaks Android build and causes valgrind failures in the examples

Change-Id: Ie13ceed2f9f8970af87339b807032a52083f27fe
2016-03-26 12:56:21 -07:00
Tom Finegan
aa1132d1de Merge "third_party: Roll libwebm snapshot." 2016-03-26 01:41:49 +00:00
Marco
f94124cf31 vp9: 1 pass vbr mode at speed 5: switch to use mv.search to NSTEP.
Change only affects 1 pass, vbr, speed = 5 (real-time mode).

Some improvement for high motion content.
AvgPSNR/SSIM metrics for ytlive set all up, on average ~2%,
some clips (high motion ones) up 4/5%.

Encoder speed down: on mynintendo_x1.1280_720.y4m: 47fps -> 44fps.

Change-Id: I9e3eaa6392dcb6b5b44ee6f43004f97ba859bc11
2016-03-25 15:33:55 -07:00
Tom Finegan
80ddeb281a third_party: Roll libwebm snapshot.
4ff5785 cmake: Add C++11 move ctor and member initializer tests.
402ef4d cmake: remove argc and argv from C++11 test main fns.
cbe5c40 Restore original namespaces for mkvmuxer and mkvparser.
504e0f2 Mass file extension update.
79cb980 Android.mk: Update source file locations.
01db4c2 webmids: Move to common/ sub dir.
235ce59 mkvparser: Explicitly reference internal sources in includes.
f578419 mkvmuxer: Move sources to mkvmuxer/ sub dir.
5f1065e webvtt: Organize and clean up webvtt support.
7abe8ac cmake: Add missing dumpvtt target.
f2f87e2 Makefile.unix: Tidy things up.
12f6dc3 Use <stdint.h> types instead of custom typedefs.
0407360 mkvmuxer: Write last block in each Cluster with Duration
008aa63 mkvparser: move to mkvparser sub dir.
e64bf75 Namespace reorg: Make everything a child of libwebm.
5fdb386 cmake: move c++11 checks into build/cxx11_tests.cmake.
3672488 Copy reference block values in Frame::CopyFrom()
91ca780 reapply clang-format
8d34215 Merge "Clean up AddAudioTrack in muxer_tests"
90861d4 Clean up AddAudioTrack in muxer_tests
a9dfb3d Un-ignore webm files in testdata
c5b76d8 Extract PES parser from WebM2Pes tests.
16524e8 cmake: Add include-what-you-use integration.
7015af5 iwyu/vpxpes2ts: Update includes.
c1d6a70 iwyu/webm2pes: Update includes.
110e797 iwyu/libwebm_util: Update includes.
44e31fb iwyu/webm2pes_tests: Update includes.
d919f96 iwyu/mkvwriter: Update includes.
75790e1 iwyu/mkvparser: Update includes.
5f673ca iwyu/webm2pes_main: Update includes.
747244a iwyu/vpxpes2ts_main: Update includes.
94c985f iwyu/mkvmuxerutil: Update includes.
c365630 iwyu/mkvmuxer: Update includes.
b15b8ef iwyu/file_util: Update includes.
3dfba95 iwyu/hdr_util: Update includes.
baba8b1 iwyu/vttdemux: Update includes.
3212ec1 iwyu/webvttparser: Update includes.
b6d8d92 iwyu/sample_muxer_metadata: Update includes.
a9a1a01 iwyu/sample_muxer: Update includes.
e020ffd iwyu/sample: Update includes.
18834bc iwyu/parser_tests: Update includes.
9c00ae3 iwyu/muxer_tests: Update includes.
41a17eb iwyu/test_util: Update includes
b6174be muxer_tests: Fix windows brokenness.
e092515 file_util: Remove tmpnam() usage in MSVC.
b9dc4ac test_util: Don't pass NULL to std::string() in GetTestDataDir().
1f74651 webmts: Move PES/TS sources to m2ts sub directory.
1b895e9 Rename libwebm_utils to libwebm_util.
2fabcd3 sample_muxer: Replace std::tmpnam() with libwebm::GetTempFileName().
e6a0033 Add file_util.
87f9bea Move hdr_util to common.
1f64aaf cmake: Expand C++11 tests.
6dc81c1 muxer_tests: Die immediately when unable to prep for file writing.
521ce4d webm2pes: Fix type limit warning.
64c4163 vpxpes2ts: Fix sign-compare and type-limits warnings.
741ba68 muxer_tests: Replace std::tmpnam() with GetTempFileName().
6159e83 Merge "test_util: add missing include for close()"
ff81c74 parser_tests: Fix sign compare warnings.
163f57d test_util: add missing include for close()
7c89eb5 Merge "test_util: Remove tmpnam() usage on non-MSVC targets."
c4b8686 Merge "webm2pes_tests: Fix sign compare warnings."
9c9f546 Merge "muxer_tests: Fix sign compare warnings."
0fbefef webm2pes: Silence sign compare warnings.
599e4e8 cmake: Silence clang/gcc deprecation warnings.
82f376f test_util: Remove tmpnam() usage on non-MSVC targets.
4d31d6b webm2pes_tests: Fix sign compare warnings.
07ed7e0 muxer_tests: Fix sign compare warnings.
ae2fbfe parser_tests: Silence sign compare warning.
f488528 libwebm_utils: Silence sign compare warning.
777247b Add C++11 detection to cmake file.
9b89187 Add missing include to libwebm_utils.h.
421874a Merge "mkvmuxer: Fix GCC build."
dd6ab35 Set the mastering metadata on the muxers colour
8b61ef5 mkvmuxer: Fix GCC build.
353b050 Add hdr_util.
c92e080 mkvmuxer: Use kValueNotPresent in Colour/MasteringMetadata.
2d09128 Colour element: TransferFunction renamed to TransferCharacteristics.
f2fc28e Colour element: Matrix renamed to MatrixCoefficients.
e0b1135 cmake: Minor CMakeLists.txt refactor.
1e1872b Revert change from auto_ptr to unique_ptr in sample code.
d7fc382 Track updates to the proposed Matroska Colour spec.
99981ee sample(mkvparser): Output Colour element when present.
375e416 mkvmuxer: Fix Colour element support.
eaeca34 mkvmuxer: Fix bits per channel in the colour element.
1dab7f3 mkvparser: Avoid crash when encountering a Colour element.
a1517aa sample_muxer: copy the Colour element.
ea9dd94 Merge "webm2pes: Fix tests."
8635c5b Merge "mkvparser: Make omitted values detectable in the Colour element."
ae4ae7e mkvparser: Make omitted values detectable in the Colour element.
8c8cba6 webm2pes: Fix tests.
a281a22 mkvmuxer: Add support for the Colour element and its children.
41a9147 sample_muxer: clang-format include order fix.
939a64d Signal E_BUFFER_NOT_FULL in EBMLHeader::Parse
fb1406e mkvparser: Add support for the Colour element and its children.
22bfdf7 Merge "parser_tests: Add validation of cues."
b873000 parser_tests: Add validation of cues.
799891e Update .gitignore to include some new binaries
e051c60 Merge "Update muxer test gold files"
b81d5f0 Update muxer test gold files
48b1e9a mkvparser: clang format run
93c4690 webm2pes: Add PES packet parsing tests.
65ca38f Merge "test_util: Fix gcc build."
520ca6c Merge "parser_tests: Fix gcc build."
37a38ca test_util: Fix gcc build.
ee0ebba parser_tests: Fix gcc build.
c32f970 Replace auto_ptr usage with unique_ptr.
e569ab0 webm2pes/ts: Fix gcc build.
2e55d6c Merge "add bitcode embedding support for ios"
0cfb2dc add bitcode embedding support for ios
bb8cefd webm2ts: Converts WebM VPx video to a MPEG TS.
453bf44 webm2pes: Begin addition of tests.
9299bbb libwebm: Googletest integration.
3bec1ba Merge changes I7bcb5b3e,I8ce733be,I98a928ff,I71910f24
5c83bbe Fix ParseElementHeader to support 0 payload elements
be35869 libwebm_utils: Add FileDeleter.
d6db1e1 webm2pes: Add a WebM parser init method.
aa3593e webm2pes: Rename Convert to ConvertToFile().
e8fca12 webm2pes: Fix super frame splitting.
3cb96b6 webm2pes: Move main() and helper functions into their own files.
021432b webm2pes: Fix the linux build.
82ac5fc Remove RELEASE.TXT.
852e173 webm2pes: Split super frames and packetize large frames.
faf85c2 webm2pes: Refactor header/optional header writing.
7c19266 Add Webm2Pes.
01fdee4 mkvmuxer: Disallow AddTrack() after Tracks element is output.
1ad314e mkvparser: EBMLHeader::Parse: remove dead init

Change-Id: I4026f52f59c6f7644af49b0393af502079b2fbec
2016-03-25 10:29:00 -07:00
James Zern
1bf7a0fb29 vp8_peek_si_internal: quiet static analysis warning
the vpx_decoder layer guarantees that when called directly this won't
receive NULL data and the reuse via decode() is protected by a NULL data
check and 0 size check (NULL data and non-zero data size is protected by
the vpx_decoder layer).

Change-Id: I7437fb5ca4e4aa431963d55b909d4d920f339be3
2016-03-25 10:00:30 -07:00
Marco
5f90713b2b vp8-denoiser: Use the same skin detection for model=1 as in vp9.
Keep setting for model = 0 for now in vp8.

Change-Id: I79c5fa24d5d16b14651f44db9526aa01dbd70ec9
2016-03-24 15:44:40 -07:00
James Zern
79dc6c0393 Merge changes Id0a490bc,I1b4a0504
* changes:
  vp9/inverse_transform_block_inter: move eob check
  vp9/inverse_transform_block_intra: move eob check
2016-03-24 22:04:11 +00:00
Paul Wilkins
04b4a5f25e Merge "Force recode for bad rate misses." 2016-03-24 18:05:24 +00:00
Paul Wilkins
27a6be1419 Merge "Fix some HBD scaling bugs." 2016-03-24 18:04:52 +00:00
Scott LaVarnway
82762e240c VP9: Eliminate extra mv clamp in decoder
The mv is clamped in dec_find_mv_refs() to a smaller region
than the clamp in dec_find_best_ref_mvs().  See clamp_mv_ref
and clamp_mv2.

Change-Id: I47dd5f7fa8b42f2cc593559b4d7c782fe7bcb1db
2016-03-24 04:04:37 +00:00
James Zern
715d3bbd05 Merge "Add a TODO for using tile rows while encoding with multiple threads" 2016-03-24 03:57:28 +00:00
James Zern
c20c955e73 vp9/inverse_transform_block_inter: move eob check
1 level up. the function is a no-op for eob == 0 and shouldn't be called

Change-Id: Id0a490bcce78c2b2ec6ea24d942191eb9b2bc16e
2016-03-23 20:41:05 -07:00
James Zern
f64a30acef vp9/inverse_transform_block_intra: move eob check
1 level up. the function is a no-op for eob == 0 and shouldn't be called

Change-Id: I1b4a050424cf2d0ea820120c8e7c4fb3065e39e7
2016-03-23 20:24:17 -07:00
Johann Koenig
813221a163 Merge "Allows sub-second frame rates in vp9" 2016-03-23 20:04:59 +00:00
Yunqing Wang
5486e1d8f3 Add a TODO for using tile rows while encoding with multiple threads
Added a TODO in vp9_cx_iface.c.

Change-Id: Ib987f20cab8417340a23ae676616de1df48e8a12
2016-03-23 12:23:02 -07:00
Yunqing Wang
a21fc45b13 Merge "Prevent encoder crash caused by row tile dependencies" 2016-03-23 15:52:36 +00:00
Marco Paniconi
c8fc6ed14a Merge "vp9: Non-rd partition selection: use consec_zeromv to set sb_is_skin." 2016-03-23 01:06:57 +00:00
Yaowu Xu
a624692776 Merge "Simplify the loopfilter synchronization logic in VP8 encoder" 2016-03-22 23:45:28 +00:00
Yunqing Wang
dc5f7712f2 Prevent encoder crash caused by row tile dependencies
In multi-thread case, the encoder may crash if using encoder option
tile-rows > 0. To prevent that, force tile-rows=0 in this situation.
This is a workaround for WebM issue 1095:
https://bugs.chromium.org/p/webm/issues/detail?id=1095

The further fix can be done by adding synchronizations after a tile
row is encoded. But this will hurt multi-threaded encoder performance.
So, it is recommended to use tile-rows=0 while encoding with threads
> 1.

Change-Id: I656cbcc200f8d0410d09530e7981ad8f32fe7bc9
2016-03-22 16:15:12 -07:00
Yunqing Wang
b198bcd528 Simplify the loopfilter synchronization logic in VP8 encoder
This patch was to fix a reported Hangouts deadlock/freezing issue
in VP8 encoder(issue 27232610). The original encoder loopfilter
synchronization happened in the following frame, which was prone
to causing problems in some complex use cases. This patch simplified
the synchronization logic.

More testing needs to be done.

Change-Id: I38fd3f35d11f98fae1e44546aa5e4c6d6e19c4be
2016-03-22 14:13:18 -07:00
Paul Wilkins
a84f1f846e Increase min-max q range for normal inter frames.
Allow the encode loop to select from a wider range of Q values
when encoding normal (non arf or kf) frames.

This change is targeted at improving psycho-visual quality in some
easy sections that are currently not getting enough bits.
This is likely to be a little worse from a metrics perspective  and may also
have a small impact on encode speed in cases where extra recode
iterations are triggered.

Change-Id: I667eebf33c753bcbcf8b93596467369e5708b889
2016-03-22 12:56:05 -07:00
Paul Wilkins
9d8ead125d Force recode for bad rate misses.
Adds a second threshold for recodes even on frames where
recode is normally disabled if there is a big rate miss.

Change-Id: Ifd4a34707da55ec15eb7cfb87de4644b8d76deb2
2016-03-22 12:45:27 -07:00
Paul Wilkins
ee35f4dede Fix some HBD scaling bugs.
Fixed a bug for HBD in stats output and scaling of a threshold
within the first pass code.

Change-Id: Icd0463d78cc9ce4661b027b0612c55c0628d212f
2016-03-22 12:28:02 -07:00
Marco
01283e2727 vp9: Non-rd partition selection: use consec_zeromv to set sb_is_skin.
Change-Id: I084360cdeabfc63e146a969053d91baee27f4001
2016-03-22 11:16:06 -07:00
Marco Paniconi
bfc2a7e3a0 Merge "vp9: Improvement to skin detection." 2016-03-18 17:58:03 +00:00
Marco
a3562b60d5 vp8-denoiser: Update on the sum_diff threshold.
Change-Id: I0d459c7ba358da287aff1c706279603d6d4d3c48
2016-03-18 08:39:42 -07:00
James Zern
e1ad39d754 Merge "altref_test: mark AltRefForcedKeyTest as large" 2016-03-18 02:38:14 +00:00
James Zern
0dcd21fb1b altref_test: mark AltRefForcedKeyTest as large
Change-Id: I2bbd7cd2f3b22d3dbfd40d9af430a5d276cd1855
2016-03-17 18:46:10 -07:00
Marco
ce39add465 vp9: Improvement to skin detection.
Add consec_zeromv to skin detection.
Reduces false detection in steady background areas.

Change-Id: Ic31c831537d29f082f58477f82ed78f313d7dd30
2016-03-17 16:26:10 -07:00
Marco
32c38a20ba vp9: Fix the threshold for gf update in cyclic refresh.
Fix the threshold for forcing refresh of golden frame based
on high motion. The current comparison was incorrect and
prevented this (force update of gf on high motion) from being used.
For now keep this logic under a flag (and off for now) so as to
not change behavior, until further testing.

Change-Id: Ib5f0082159a428b0603b9534e4bcb6f83e4ccb25
2016-03-17 12:24:58 -07:00
Alex Converse
e6aebcdf08 Merge "Use whole pixel only at speed 8 screen content." 2016-03-17 16:25:28 +00:00
Alex Converse
54e5ff00a6 Merge "Reuse computation in build_nmv_component_cost_table." 2016-03-17 16:25:02 +00:00
Alex Converse
ed5d2e71c0 Merge "Fix using screen content tuning in all the cpu speed tests." 2016-03-17 16:24:48 +00:00
Marco Paniconi
825e754288 Merge "vp9-svc: Bugfix on usage of svc_force_zeromv in non-rd pickmode." 2016-03-17 15:14:45 +00:00
Alex Converse
e17f6347b9 Fix using screen content tuning in all the cpu speed tests.
Change-Id: Ie302283a52c563be0f1a84650f5f29be30d2bbe4
2016-03-16 21:57:00 -07:00
Alex Converse
0271bafb4a Reuse computation in build_nmv_component_cost_table.
Saves 1% CPU on remoting_perftest with speed 8.

Change-Id: I28dc2f602bd3bf5639a40c9f21f5a9833f01d4be
2016-03-16 21:55:33 -07:00
Alex Converse
bd924fbd21 choose_partitioning: Avoid computing segment_id twice.
1% faster remoting_perftest at speed -8.

Change-Id: I78d591e14b8f890c1e69cacb6d490dfeb9c37900
2016-03-16 16:32:49 -07:00
Marco
f03dfcb118 vp9-svc: Bugfix on usage of svc_force_zeromv in non-rd pickmode.
Only affects 1 pass cbr svc mode.

Change-Id: Ifc0948b4aabffa64a9701295d8dbc58a7208a30f
2016-03-16 16:12:16 -07:00
Alex Converse
55859e8428 Use whole pixel only at speed 8 screen content.
+5.857% BD-RATE on SCREEN_CONTENT

Leaving this off for non-screen content because:
+25.300% on TWITCH120
+37.833% BD-RATE on RTC

Change-Id: Ie0a312182d6cc859fb04298e4cd81d02b39e23fe
2016-03-15 15:04:48 -07:00
Alex Converse
9917842f07 Add tests for VP9E_CONTENT_SCREEN.
Change-Id: Id28007576205b7f46957b20eeacb5fda6872663e
2016-03-15 15:04:48 -07:00
Paul Wilkins
627a3ddcbe Isolate HBD stats bug change.
Change-Id: Ief453daf5f13f42803cb5122fcdd294e65e613f5
2016-03-15 12:24:54 -07:00
Paul Wilkins
afd869308e Merge "Revert "Fix bug in stats output for HBD."" 2016-03-15 19:21:45 +00:00
Paul Wilkins
a132100e63 Revert "Fix bug in stats output for HBD."
This reverts commit c7780075ec0e87f74a1a5706dec914aad8dc9200.

Change-Id: I2d2e1b387bf0c70cc7238ee4f8edab2aad873489
2016-03-15 19:21:14 +00:00
Marco
2bf51c76e3 vp9: Fix to scene cut/content change detection.
Use proper conditon on resolution check.

Change-Id: Idf563eb4391f373baf79546414a075b6516a5d35
2016-03-15 10:31:57 -07:00
hui su
68f2b4100d Fix typos in unit tests
Change-Id: I18996f5c67cd182263930a1363d619402b8f8c14
2016-03-15 09:28:16 -07:00
Marco
239bf26fde vp9: Scene cut/content change detection: Adjust gf update.
For 1 pass vbr mode: Increase the period of gf update on scene
cut (keep it same as orginal/default setting for now).

Change-Id: I679c3bd21152f6c4e486c8098d931c00e1d26b5f
2016-03-14 12:16:37 -07:00
Marco
3521e9ee7c vp9: Scene cut/slide change detection: Increse min_thresh.
Only affects vbr mode.

Change-Id: I15e24c50343bc9171c734dfc7685491c7dbb8654
2016-03-14 10:43:42 -07:00
Johnny Klonaris
76108b4269 Allows sub-second frame rates in vp9
This is the identical change submitted for vp8 here:
https://chromium-review.googlesource.com/#/c/274107/

Tested this change on Mac OSX (10.10) and Linux
(Linux Mint 17 / Ubuntu 14.04) and in both cases:

- downloaded and compiled latest source for libvpx and ffmpeg
- confirmed ffmpeg would build sub-second frame rate webm files
  via the previous patch
- confirmed ffmpeg would *not* build fps < 1 for vp9
- made this change, recompiled libvpn and ffmpeg
- confirmed ffmpeg would now create the same webm with
  fps < 1
- confirmed the resulting file would play and was vp9 (e.g.
  would not play in Firefox (Linux version complained it was
  VP9 but mostly could play it) or older vlc, etc., but does
  play just fine in Google Chrome and a newer version of vlc.

Sorry I didn't catch this last time - but this seems a solid
change and it's handy to be able to create frame rates
less than one second.

-jk

Change-Id: I38fa32148de8c4c359f228cf08b9a4b83b5a52fb
2016-03-12 21:06:31 -08:00
Marco Paniconi
e86d886a39 Merge "vp9: Fix issue in scene/content change detection." 2016-03-11 23:24:16 +00:00
Marco
26e5014567 vp9: Switch to model=1 for skin detection.
Very small change in speed (within 0.5%),
somewhat better detection over RTC clips.

Change-Id: I5bf0a7438fa7ccb60b26887125099e3238e5f298
2016-03-11 12:51:00 -08:00
Marco
15be44a58f vp9: Fix issue in scene/content change detection.
The change https://chromium-review.googlesource.com/#/c/329181/
also changed behavior for cbr mode, which causes some regression
in screenshare test in webrtc.

Resetting the specific change to leave the cbr behavior
unchanged for now.

Change-Id: I52df158806422f86398e1d2f522e92067d8325eb
2016-03-11 12:20:12 -08:00
Marco
caa8de547f vp9 non-rd pickmode. Some adjustments for vbr mode.
Some adjustments to inter-mode selection for vbr mode.
Condition some of the bias to low/zero motion on cbr mode, and
don't use int_pro_motion_estimation for golden ref
(treat it same as last ref).

Change only affect 1 pass vbr mode, speed >=5 (non-rd pickmode).

Encoding time increase within ~5%.
Avg PSNR/SSIM on RTC set increase by ~2%, all clips up,
ranging from 0.5 to 4%.

Change-Id: I0048d0104a8816773d91a2b1484d601169d9bad7
2016-03-11 09:22:36 -08:00
Marco
c3d6da666e vp9: Update to skin detection.
For model=1, use higher threshold on luminance, conditioned
on the skin cluster distance.

Change-Id: I971bccdef7b92b2aeef60af90a8e48b98716a89b
2016-03-10 15:46:05 -08:00
Marco
11bf7ea354 vp9-svc: Fix to frame dropping in svc mode.
Don't advance the svc frame counters on dropped frame,
since this can break the referencing scheme and lead
to a crash/assert.

Updated svc-datarate unittest to add a lower bitrate test.

Change only affects 1 pass cbr svc, with frame dropper enabled.

Change-Id: Ibb7530b7a587a9344d46898d9286fd9e2ef0779c
2016-03-09 10:15:15 -08:00
Marco Paniconi
268ec8dcfb Merge "vp9-svc: Change default spatial bitrate allocation." 2016-03-08 22:08:57 +00:00
James Zern
aeac8435b3 Merge "vp9_svc_layercontext(): fix proto mismatch" 2016-03-08 20:10:40 +00:00
Marco Paniconi
57c50539dc Merge "vp9-svc unitests: Add more tests for key frame periods." 2016-03-08 19:32:36 +00:00
Marco
699276e56d vp9-svc: Change default spatial bitrate allocation.
Only affects 1 pass cbr svc.

Change-Id: I8387219e35e516d9ce890557ee1855f2af8f636a
2016-03-08 11:29:29 -08:00
Scott LaVarnway
2ccd906e44 Merge "VPX: loopfilter_mmx.asm using x86inc 2" 2016-03-08 18:50:20 +00:00
James Zern
dc221e761b vp9_svc_layercontext(): fix proto mismatch
Change-Id: I8a76d150a61662fc2e3158a49ce4e642f917029a
2016-03-08 10:37:27 -08:00
Marco
b5ab8812b5 vp9-svc unitests: Add more tests for key frame periods.
Change-Id: Iea237760b508d87dab057dd824e26d2e66fa8433
2016-03-08 10:36:16 -08:00
Scott LaVarnway
67c4c8244a VPX: loopfilter_mmx.asm using x86inc 2
This reverts commit 9aa083d164e0d39086aa0c83f0d1a0d0f0d1ba61.

Fixes a decoder mismatch with 32bit PIC builds.

Change-Id: I94717df662834810302fe3594b38c53084a4e284
2016-03-08 04:24:47 -08:00
Marco
b9cb955cf0 vp9-resize tests: Update to real-time resize unittests.
Add check for mismatch in unittests.

Change-Id: Ia5d5b5f6af4b7eb653302b81fdd9a53df4aba033
2016-03-07 17:02:05 -08:00
Marco Paniconi
6e88ab5a0a Merge "vp9-svc: Fix to resetting pattern/flags on key frame." 2016-03-07 22:44:29 +00:00
Marco
a304d26bf1 vp9-svc: Fix to resetting pattern/flags on key frame.
Chane only affects 1 pass cbr svc mode.

Change-Id: Ie28557409eb87673ed0b66c6dfe1bf3509a18c4d
2016-03-07 13:54:43 -08:00
Scott LaVarnway
8040a8a6c9 Merge "define GET_GOT_DEFINED if not previously defined" 2016-03-07 21:51:06 +00:00
Scott LaVarnway
e56f96394f define GET_GOT_DEFINED if not previously defined
Change-Id: Id9c764a5b0e4b668a6e804cceb78988138ad910f
2016-03-07 11:34:49 -08:00
Marco
2b5ab8095e vp9-svc: Non-rd pickmode, fix condition for testing zeromv for spatial ref.
Change-Id: I75bad321d5814a6df6735a8ead7700ab93b50763
2016-03-07 09:55:25 -08:00
James Zern
9aa083d164 Revert "VPX: loopfilter_mmx.asm using x86inc"
This reverts commit 15ecdc3970462c15fdf7185d373cb52664f40c0f.

breaks 32-bit pic builds

Change-Id: I8bb1b9471a293f05ac7423aaba0339d408931b7a
2016-03-04 18:23:45 -08:00
Paul Wilkins
38b3593eb9 Merge "Fix bug in stats output for HBD." 2016-03-04 15:55:11 +00:00
paulwilkins
c7780075ec Fix bug in stats output for HBD.
Change-Id: Ic3b033e22cdcdc4a0f78cef433b2208fd254c27b
2016-03-04 12:57:10 +00:00
Marco
38e401b5da vp9-svc: Fix issues with svc with periodic key frames.
Use the superframe counter to set the key frame, and force
it to the key frame on base spatial layer only.
Also, update svc frame counters under frame dropping.

Update unittest: add specific tests with short key frame period.

https://bugs.chromium.org/p/webm/issues/detail?id=1150

Change-Id: I5b1c9a09253e6e5fbfce51b4cf603ae22d422b01
2016-03-02 16:59:58 -08:00
Alex Converse
fcaedc5681 Merge "Simplify the inner loop of duplicate_mode_info_in_sb." 2016-03-02 17:21:08 +00:00
Alex Converse
8b47c2662a Merge "Port "cost_coeff speed improvements" to vp9." 2016-03-02 17:20:58 +00:00
Alex Converse
6c0dd11f29 Simplify the inner loop of duplicate_mode_info_in_sb.
Change-Id: I8ba9164c3550379fb998d4d074846e90fb2c6f8c
2016-03-01 17:43:02 -08:00
Marco
c83bcb3474 vp9-svc: Allow for 2 stage downscaling for spatial layers.
For 1 pass cbr mode: allow for two-stage 1:2 scaling
(which will use the 1:2 optimized scaler) if the spatial
layer is 1/4x1/4 of souce.

Without this change, the base layer for 3 spatial layers would
be using the non-normative scaler which is un-optimized/C code.

Change-Id: I9d73f92a4a96927d0f1d6bf75315c1e60513226a
2016-03-01 15:48:42 -08:00
Jingning Han
dbaf5f64e2 Merge "Port alt reference frame filter improvement to VP9" 2016-03-01 22:31:37 +00:00
Jingning Han
405fe6b78c Merge "Back port partition rate cost estimate fix to VP9" 2016-03-01 22:31:30 +00:00
Alex Converse
76b5a3371c Merge "Don't copy tx_size to all 8x8 MIs in the prediction block." 2016-03-01 17:19:04 +00:00
Jingning Han
9c0a2a7935 Port alt reference frame filter improvement to VP9
Use sharp filter to generate motion compensated reference for
temporal filtering. It improves the average coding performance of
VP9 speed 0:
derf    0.34%
hevcmr  0.38%
stdhd   0.58%

Change-Id: I1772a051be545de8c343055274e5ca0929d19cda
2016-02-29 16:55:13 -08:00
Jingning Han
8d006a16c5 Back port partition rate cost estimate fix to VP9
This commit back ports the fix from
https://chromium-review.googlesource.com/#/c/326940

It corrects the block partition context fetching in rate-distortion
optimization. It improves the average coding performance of speed 0:
derf    0.098%
hevcmr  0.102%
stdhd   0.282%

Change-Id: I8bcc6fe40ba5c6b50a6136daac116dcc738937ec
2016-02-29 16:50:35 -08:00
Marco
41667f4ddb vp9-datarate unittests: Include coverage up to speed 8.
Change-Id: I8529cd04ea4f95d21d83f87d56d6dd882d0a5636
2016-02-29 16:18:28 -08:00
Alex Converse
ee5d3d3760 Don't copy tx_size to all 8x8 MIs in the prediction block.
The double pointer in xd->mi handles this for us.

Cuts encode_suberblock()'s self time in half at rt speed 8.

Change-Id: I820dae24efdbf9a140bbeae82e4e2a5850317766
2016-02-29 15:23:21 -08:00
Marco
f21ff53830 vp9: Remove effective_bitrate from SVC datarate tests.
Change-Id: I1189c2403463e0aca288ba344052ba1c9cf94390
2016-02-29 13:13:32 -08:00
Marco
729c997642 vp8: multi-res-encoder: Fix timer around encoder in sample encoder.
Change-Id: I0131ab4767e2eb72838ab6e58dd77a85fbf508e0
2016-02-29 11:13:42 -08:00
Marco
55a09f7f45 vp9-svc: For 1 pass svc, remove frame-level upsampling.
With the svc fix in https://chromium-review.googlesource.com/#/c/328978/,
the asan error is resolved, so this should work now.

Change-Id: I57b2a593651d414e1b445431d90f2fdc3281128b
2016-02-29 08:56:14 -08:00
Scott LaVarnway
dd6729f826 VPX: Remove pmin/pmax from subpixel functions.
These instructions are unnecessary if the adds
are done in the correct order.

Change-Id: I4e533b8267c32e610a4b94203ad052dc9fdabd71
2016-02-27 05:47:56 -08:00
Scott LaVarnway
51beb29f52 Merge "VPX: vpx_filter_block1d16_(v8, v8_avg)" 2016-02-27 13:31:18 +00:00
James Zern
3b5cb2dbe0 Merge changes I95159bcb,Ia74e3097,I661f6439
* changes:
  x86/convolve.h: remove redundant check in FUN_CONV_2D
  x86/convolve.h: replace while w/if for w < 16
  x86/convolve.h: change filter[] || chains to |
2016-02-27 02:56:41 +00:00
James Zern
4b00f0ecae datarate_test/ChangingDropFrameThresh: set kf interval
restore the value for VP9 to 9999 to satisfy the current test
expectations; without this
VP9/DatarateTestVP9Large.ChangingDropFrameThresh/8 will overshoot.

Change-Id: I88dad574ae4ab10f923579824c7347ff468c7045
2016-02-26 16:54:36 -08:00
James Zern
8062e10162 Revert "vp9-svc: Fix speed issue with source downscaling for spatial layers."
This reverts commit f51f0998e1ca99cd7497ded3642bb27445b1b215.

This causes datarate tests to fail. Some are due to the new default
keyframe distance, another causes an assert even forcing 9999:

[ RUN      ] VP9/DatarateOnePassCbrSvc.OnePassCbrSvc3SpatialLayers/0
test_libvpx:
vpx_dsp/x86/vpx_subpixel_8t_intrin_ssse3.c:853: scaledconvolve2d:
Assertion `y_step_q4 <= 32' failed.

Change-Id: I4ee4fea97f47e4f1a23b82a62e6afc6280961e38
2016-02-26 16:53:26 -08:00
Marco Paniconi
9ef41cf577 Merge "vp8-denoiser: Update some denoiser thresholds." 2016-02-27 00:20:53 +00:00
Julia Robson
74a679de6f Port "cost_coeff speed improvements" to vp9.
About a 5% faster overall encode (perf cycles) at speed zero!

Change-Id: Iaf013ba75884415cd824e98349f654ffb1c3ef33
2016-02-26 14:47:18 -08:00
Marco Paniconi
a69c3f2823 Merge "vp9-svc: Bugfix for svc in non-rd variance partition." 2016-02-26 22:39:28 +00:00
Marco
6a23966c34 vp9-svc: Bugfix for svc in non-rd variance partition.
Reset the scale factors before build_inter_predictors.

Add datarate tests for 3 spatial layers, which exposed this issue.

Change-Id: I7f81efbe44345ecea9fdd5f639a4cca76aed3874
2016-02-26 09:24:18 -08:00
Marco
f51f0998e1 vp9-svc: Fix speed issue with source downscaling for spatial layers.
For 1 pass cbr mode: allow for two-stage 1:2 scaling
(which will use the 1:2 optimized scaler) if the spatial
layer is 1/4x1/4 of souce.

Without this change, the base layer for 3 spatial layers would
be using the non-normative scaler which is un-optimized/C code.

Change-Id: Ifcf526ec2aaf3e5fa7924588d9dd8660bf02fb46
2016-02-26 08:11:37 -08:00
James Zern
654d2163c9 x86/convolve.h: remove redundant check in FUN_CONV_2D
the filter will be the same in this case

Change-Id: I95159bcb05bbfb71b57da741393e80cc7ffc5cff
2016-02-25 23:31:50 -08:00
James Zern
6d8c8c6201 x86/convolve.h: replace while w/if for w < 16
in non-hbd configurations; any high-bitdepth changes will be done in a
follow-up

Change-Id: Ia74e30971b744c1faab68c92fdeda1a053988c77
2016-02-25 21:44:06 -08:00
James Zern
1ff2935ebf altref_test: move AltRefTest instantiation w/in VP8 check
some configurations may fail if AltRefTest is undefined though
VP8_INSTANTIATE_TEST_CASE is defined away.

Change-Id: I7272775a506718336bd6cee2225cf83bd72fede5
2016-02-25 20:58:56 -08:00
James Zern
48755f9f1a Merge "vp9/10: fix forced keyframes w/alt-refs enabled" 2016-02-26 03:52:44 +00:00
James Zern
14828e756f vp9: set kf_max_dist to a reasonable default (128)
the same as vp8, with the same reasoning from:
2a0d7b1 Reduce the default kf_max_dist to 128.

see also:
https://trac.ffmpeg.org/ticket/4904
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=815673

+ restore vpxenc behavior of taking the library default rather than
  forcing 5s

This change also exposes an issue with one-pass svc in cbr mode, keep
the old default in datarate_test.cc for now.

Change-Id: Id6d1244f42490b06fefc1a7b4e12a423a1f83e88
2016-02-25 12:34:12 -08:00
Scott LaVarnway
1f736e400f VPX: vpx_filter_block1d16_(v8, v8_avg)
Store result with one 16 byte store instead of
two 8 byte stores.

Change-Id: I43acbc5edfd6d6055a926f9b9605d47127400f09
2016-02-25 06:15:24 -08:00
James Zern
b3ceb629ba x86/convolve.h: change filter[] || chains to |
Change-Id: I661f64390f232826857b259e7a67e77f5a3a91ad
2016-02-24 19:47:43 -08:00
James Zern
ac4c37c684 vp9/10: fix forced keyframes w/alt-refs enabled
in 1-pass encodes. issues with 2-pass as well as other forced flags
persist.

Change-Id: Ic7ceb906fccea6456d5df96483c10cacd46e01c7
2016-02-24 15:56:37 -08:00
Johann Koenig
784eebb2d3 Merge changes from topic 'x86inc'
* changes:
  x86inc.asm: only set visibility for chromium builds
  Only use .text sections for aout
  Use .text instead of .rodata on macho
  Copy PIC handling code from x86_abi_support
  Set 'private_extern' visibility for macho targets
  Expand PIC default to macho64 and respect CONFIG_PIC from libvpx
  Use libvpx defines to set name mangling rules
  Customize x86inc.asm for libvpx
  Update x86inc.asm from x264
2016-02-24 22:33:02 +00:00
Scott LaVarnway
87bd54fa05 Merge "BUG FIX: vpx_filter_block1d(8,4)_(v8, v8_avg)" 2016-02-24 22:31:07 +00:00
Marco
1cab19e9e4 vp9: Update to scene/content change detection.
Update some parameters and put check on frame size change.
For 1 pass VBR mode, speed >= 5.

Change-Id: If24ed94a21e705ea57d40b9bf235ad079db786fc
2016-02-23 17:52:37 -08:00
Scott LaVarnway
06d0e2fe6c BUG FIX: vpx_filter_block1d(8,4)_(v8, v8_avg)
Change-Id: Ic7ea79988ed0864e7ddbfeb312516bcf77eaaac1
2016-02-23 12:23:41 -08:00
Marco
a0278cad3f vp9 aq-mode=3: Allow it to be used for 1 pass VBR mode.
Change-Id: I630b8e33106c78382545d49da5fb4c75b1b0b528
2016-02-22 17:44:20 -08:00
Scott LaVarnway
034031d4aa Merge "VPX: loopfilter_mmx.asm using x86inc" 2016-02-22 13:47:32 +00:00
Scott LaVarnway
6ccf854061 Merge "VP9: rename vpx_read_mode_info to vp9_read_mode_info" 2016-02-22 13:45:27 +00:00
Scott LaVarnway
3bf3aa26ae Merge "VP9: remove x_mis, y_mis calculations" 2016-02-22 13:44:37 +00:00
Marco
958f372509 vp9: 1 pass vbr real-time mode: Adjust gf refresh for scene change.
Use the existing scene/content change detection to better
update/adjust golden frame refresh.

Change only affects 1 pass real-time vbr mode, speed >=5.

Change-Id: I2963a5bb7ca4a19f8cf8511b0a925e502f60e014
2016-02-19 09:40:23 -08:00
Scott LaVarnway
0499e06f2f VP9: rename vpx_read_mode_info to vp9_read_mode_info
Change-Id: I3cb3da864e33012ba68d61ee8bafa8c42f00313c
2016-02-19 05:34:12 -08:00
Scott LaVarnway
6c0ce09029 VP9: remove x_mis, y_mis calculations
Passed as arguments instead.

Change-Id: I884a90baedf772692372e6e3520702c04a968f44
2016-02-19 05:28:00 -08:00
Scott LaVarnway
15ecdc3970 VPX: loopfilter_mmx.asm using x86inc
Change-Id: Idcf29281d617b275e3ca50f77e6d00c60992a36d
2016-02-18 15:34:58 -08:00
James Zern
6261fcf307 Merge changes from topic 'vp10-missing-alloc-checks'
* changes:
  vp10/resize: add missing alloc checks
  vp10/encoder: add missing alloc checks
  vp10/decoder,resize_mv_buffer: add missing alloc check
  vp10_cyclic_refresh_alloc: correct cleanup on error
2016-02-18 18:56:03 +00:00
James Zern
b6b40d3015 Merge changes from topic 'vp9-missing-alloc-checks'
* changes:
  vp9_svc_layercontext: add missing alloc checks
  vp9_resize: add missing alloc checks
  vp9_encoder: add missing alloc checks
  vp9/decoder,resize_mv_buffer: add missing alloc check
  vp9_cyclic_refresh_alloc: correct cleanup on error
2016-02-18 18:53:13 +00:00
James Zern
c8fa9e9d53 Merge changes from topic 'vp8-missing-alloc-checks'
* changes:
  vp8_dx_iface: add missing alloc checks
  vp8/onyx_if: add missing alloc checks
  vp8/denoising: add missing alloc check
2016-02-18 18:50:58 +00:00
James Zern
4950dbceaf Merge changes from topic 'rm-loopfilter-count-param'
* changes:
  lpf_8_test: remove unneeded function wrapper
  remove loopfilter 'count' param TODOs
  split vpx_highbd_lpf_horizontal_16 in two
  split vpx_lpf_horizontal_16 in two
  vpx_highbd_lpf_horizontal_4: remove unused count param
  vpx_highbd_lpf_horizontal_8: remove unused count param
  vpx_highbd_lpf_vertical_4: remove unused count param
  vpx_highbd_lpf_vertical_8: remove unused count param
  vpx_lpf_horizontal_4: remove unused count param
  vpx_lpf_horizontal_8: remove unused count param
  vpx_lpf_vertical_4: remove unused count param
  vpx_lpf_vertical_8: remove unused count param
  lpf_8_test: add missing dspr2 tests
  lpf_8_test: add missing vpx_lpf_horizontal_4 tests
  lpf_8_test: add missing vpx_lpf_vertical_4 tests
  lpf_8_test: simplify function wrapper generation
2016-02-18 18:47:48 +00:00
James Zern
a4b47b89fd x86inc.asm: only set visibility for chromium builds
this restores the previous version's behavior avoiding issues with
builds that may split sources on directory boundaries; protected
visibility may work in this case.

Change-Id: Ie759bd96c9ea5b45613f450dffa6e67eb45f5a8b
2016-02-17 18:45:40 -08:00
Johann
a97c83f7a4 Only use .text sections for aout
Also do not specify alignment.

Change-Id: I92d07dcce632ff9380c5dce18f88597414ab60c7
2016-02-17 18:45:40 -08:00
Johann
9679be4bc0 Use .text instead of .rodata on macho
The read only sections are getting stripped on some OS X builds. As a
result, random data is used in place of the intended tables.

Change-Id: I4629c90d9e0ae4d4efc193a93be6fb93809ae895
2016-02-17 18:45:40 -08:00
Johann
7e065cd573 Copy PIC handling code from x86_abi_support
Change-Id: Ia05fe78d2bd29b6aebaf6605719fe8a32528f25c
2016-02-17 18:45:21 -08:00
Johann
71ccd103bd Set 'private_extern' visibility for macho targets
Do not set it when building with 'nasm'

Change-Id: Iff2acf22543f5899f6eefa7624821cc6270a0923
2016-02-17 18:08:13 -08:00
James Zern
02fe3ae907 vp8_dx_iface: add missing alloc checks
Change-Id: Id9f4022b0cb4b5d0b3dd8759fd491da4e2ba5cb1
2016-02-17 18:04:23 -08:00
James Zern
61b112b67b vp8/onyx_if: add missing alloc checks
Change-Id: I9b0aa340518f45e16fa9754afd87347aabf968d7
2016-02-17 18:04:14 -08:00
Johann
1be46ef6b5 Expand PIC default to macho64 and respect CONFIG_PIC from libvpx
Change-Id: I8df65c6e52141183344ee91a7f94e8f4d5687e2f
2016-02-17 17:56:29 -08:00
Johann
4de9641f1a Use libvpx defines to set name mangling rules
Change-Id: Ie5dbfe73bdb6132047f9ab7d5716714d50befea5
2016-02-17 17:55:18 -08:00
Johann
2d6393a98d Customize x86inc.asm for libvpx
Use settings from vpx_config.asm

Prefix functions with vpx.

Change-Id: I71b4a89eaecf51fa56a07d9927081d50798a9042
2016-02-17 17:42:07 -08:00
Johann
2497356d06 Update x86inc.asm from x264
Revision d23d18655249944c1ca894b451e2c82c7a584c62
from https://git.videolan.org/x264.git

Change-Id: I841ec8c5ea71935aa364657299c6bba0c8742fc1
2016-02-17 17:41:21 -08:00
James Zern
a3d23877f6 vp8/denoising: add missing alloc check
Change-Id: I51ede902cd9d7bafa41f7caa3f9adf77f9df5903
2016-02-17 16:33:56 -08:00
James Zern
345489c9ec vp10/resize: add missing alloc checks
Change-Id: I96669ddbcdda508a295c68ecf103d10f364e0ad5
2016-02-17 16:13:51 -08:00
James Zern
00a39d6e04 vp9_svc_layercontext: add missing alloc checks
Change-Id: Ieb305c178c64b3864f0e8fc1a13c29799e1ae8f5
2016-02-17 16:12:40 -08:00
James Zern
efbab73cc1 vp9_resize: add missing alloc checks
Change-Id: I87ef6dec7cd2e8f9a40135e5ca11b13520ebd6d7
2016-02-17 16:12:27 -08:00
Alex Converse
09f9c5d7f9 Better workaround for Bug 1089.
Don't initialize first pass costs for a number of symbols where first
pass probabilities aren't initialized.

This brings a 1.22x first pass speedup.

https://bugs.chromium.org/p/webm/issues/detail?id=1089

Change-Id: I97438c357bd88f52f5a15c697031cf0c3cc8f510
2016-02-17 14:46:26 -08:00
James Zern
7fe96753d7 vp10/encoder: add missing alloc checks
Change-Id: I5f81250d054bfd1cc69308a491b8fd21b77e4ee1
2016-02-17 14:36:06 -08:00
James Zern
429d61252d vp10/decoder,resize_mv_buffer: add missing alloc check
Change-Id: I8eef989847fcf3c4b9a16b02db477e1007625145
2016-02-17 14:36:05 -08:00
James Zern
5d233390db vp10_cyclic_refresh_alloc: correct cleanup on error
previously only the CYCLIC_REFRESH allocation was being freed

Change-Id: I600eb496ec4b62accf1a6483c8170eabb046787d
2016-02-17 14:36:05 -08:00
James Zern
1710f6507d vp9_encoder: add missing alloc checks
Change-Id: I08939ab22446b86fae884daaebd1f14c49b21897
2016-02-17 14:33:38 -08:00
James Zern
ac4aeb5714 vp9/decoder,resize_mv_buffer: add missing alloc check
Change-Id: I3bc92175b07d5ef495bd75128638c340f3c2238f
2016-02-17 12:38:40 -08:00
James Zern
7997c68ed4 vp9_cyclic_refresh_alloc: correct cleanup on error
previously only the CYCLIC_REFRESH allocation was being freed

Change-Id: I6e1783d077c5ca83c8d62ea9642f1fb03f2e5bf3
2016-02-17 12:36:49 -08:00
Marco
3c0772977b vp8-denoiser: Update some denoiser thresholds.
Change-Id: I67090d72c0fefd3105ac380415249599e053d3bd
2016-02-17 10:38:35 -08:00
James Zern
3ea537c0ee lpf_8_test: remove unneeded function wrapper
the count parameter has been removed from all loopfilter functions

Change-Id: I87ba72006b59c65c46ca40bcb1c29171dfe0598a
2016-02-16 23:14:03 -08:00
James Zern
110d377899 remove loopfilter 'count' param TODOs
Change-Id: I25ce7314372ce2f521526ea7864ffc4ab62e4519
2016-02-16 23:14:03 -08:00
James Zern
9b44d9d00f split vpx_highbd_lpf_horizontal_16 in two
replace with vpx_highbd_lpf_horizontal_edge_16 and
vpx_highbd_lpf_horizontal_edge_8 to avoid passing a count parameter

Change-Id: I551f8cec0fce57032cb2652584bb802e2248644d
2016-02-16 23:13:58 -08:00
James Zern
1b519fb666 split vpx_lpf_horizontal_16 in two
replace with vpx_lpf_horizontal_edge_16 and vpx_lpf_horizontal_edge_8 to
avoid passing a count parameter

Change-Id: I848c95c02a3c6ebaa6c2bdf0983dce05cd645271
2016-02-16 22:57:45 -08:00
James Zern
e7a23d703b vpx_highbd_lpf_horizontal_4: remove unused count param
Change-Id: I655a771e1b1a8753be5669ef9348a312ba6cfdbc
2016-02-16 22:57:45 -08:00
James Zern
5171857329 vpx_highbd_lpf_horizontal_8: remove unused count param
Change-Id: Iaca71ea3796115d4c2d43563b4e6f3914e21f1bf
2016-02-16 22:57:44 -08:00
James Zern
3c1019e49d vpx_highbd_lpf_vertical_4: remove unused count param
Change-Id: Ic6da723c5cf3cd8127db1f476c3e46ea134cb774
2016-02-16 22:57:44 -08:00
James Zern
72a9f06ac2 vpx_highbd_lpf_vertical_8: remove unused count param
Change-Id: Id16f7259897654831d31642c2d5e0bbe5e13416c
2016-02-16 22:57:44 -08:00
James Zern
b1e97c6a25 vpx_lpf_horizontal_4: remove unused count param
Change-Id: Iec7d8eda343991f7d7d46931dca17af23c821d11
2016-02-16 22:57:27 -08:00
James Zern
bd5a5bb561 vpx_lpf_horizontal_8: remove unused count param
Change-Id: I48741e167a7b09b7c9ad3bfc1c4b88ef1029ae46
2016-02-16 22:54:40 -08:00
James Zern
fdc977afc6 vp10,encoder: relocate setjmp
move to encoder_encode() as vp10_get_compressed_data() allocates data and
would require some modification to make its error return meaningful.

Change-Id: Ia5267c35d16ccd42b6da6d2136402b13e28f9159
2016-02-16 19:33:16 -08:00
James Zern
73f45fcf0b vp9,encoder: relocate setjmp
move to encoder_encode() as vp9_get_compressed_data() allocates data and
would require some modification to make its error return meaningful.

Change-Id: I8ddc390a1441afd0ff937842fa4ad1053c956133
2016-02-16 19:25:54 -08:00
James Zern
b5029a25a8 vp10_cx_iface,encode: remove redundant cpi check
this is allocated in init(), a NULL pointer on encode() should be
treated as a failure.

Change-Id: I09c206f088982716fd5acc39949ceb25576313fc
2016-02-16 18:10:30 -08:00
James Zern
0b9925ccec vp9_cx_iface,encode: remove redundant cpi check
this is allocated in init(), a NULL pointer on encode() should be
treated as a failure.

Change-Id: I3f55ea4a98be616bb5ab74d95ce4a3d6262e734a
2016-02-16 18:10:01 -08:00
James Zern
109a47b342 vpx_lpf_vertical_4: remove unused count param
Change-Id: I43a191cb3d42e51e7bca266adfa11c6239a8064c
2016-02-16 14:59:00 -08:00
James Zern
37225744db vpx_lpf_vertical_8: remove unused count param
Change-Id: Ic69406da00afb0f06588e8c0deb2b043952b078c
2016-02-16 14:59:00 -08:00
James Zern
47dee375db lpf_8_test: add missing dspr2 tests
Change-Id: I3954ff86ec1965cd6d4eec570c2d1993538d9c11
2016-02-16 14:58:43 -08:00
James Zern
4fec4a8e28 lpf_8_test: add missing vpx_lpf_horizontal_4 tests
mmx, msa

Change-Id: Ia9604adcdcc77411f383e081e01a18d232c9d992
2016-02-16 14:58:43 -08:00
James Zern
c3f2c8ad2a lpf_8_test: add missing vpx_lpf_vertical_4 tests
mmx, msa

Change-Id: I113ce0ec144ee673d5dcde4c03fe7670f9f4c369
2016-02-16 14:58:43 -08:00
James Zern
45a7b5ebd7 lpf_8_test: simplify function wrapper generation
Change-Id: Ie4d3e80a4e43dd4ada78d073e308e10db4ea3239
2016-02-16 14:58:33 -08:00
Marco
89cc682528 vp9-real-time mode: Fix condition for allowing reference masking.
Add frame-level condition for reference masking: under external or
internal dynamic resize, allow for reference masking if none of
the references have been scaled.
Peviously, reference masking was turned off for the stream if dynamic
resize feature was enabled or an external resize event occurred.

reference_masking gives speed up with little/no loss in compression.
For speed 7 on rtc set: encoding time decreases by about 5-7%,
avgPSNR/SSIM goes down ~0.2%.

Change-Id: Ie4444577451ef954414d8fb4b2c99d65cadf1746
2016-02-16 13:10:27 -08:00
James Zern
548889c35a Merge "Fix tsan error in VP9 sub8x8 intra mode search" 2016-02-16 20:26:42 +00:00
Jingning Han
d642294b1c Fix tsan error in VP9 sub8x8 intra mode search
This commit fixes issue 1141. The issue was triggered in multi-tile
encoding. The change properly saves and restores the block context
information in the real-time mode selection process. It removes
several redundant memcpy operations in sub8x8 intra block mode search.

Change-Id: I35c9ad197f4bd500ec39b5fc833f052f19eee010
2016-02-16 11:24:09 -08:00
Marco Paniconi
0546636c74 Merge "vp9-resize: Fix an issue with external dynamic resize." 2016-02-16 16:18:43 +00:00
James Zern
425b1562c4 Merge changes from topic 'unused-params'
* changes:
  tests: quiet some unused parameter warnings
  vp9_error_block_test: prefer EXPECT over assert()
  vp9_encoder_parms_get_to_decoder: add missing initializers
  vpxenc: quiet unused param warning
  vpx_ve_predictor_4x4_c: quiet unused param warning
2016-02-13 01:03:46 +00:00
Marco
3cbc26f31b vp9-resize: Fix an issue with external dynamic resize.
External dynamic resize with swapping width and height was
not handled properly.
Fix is to re-init loop-filter under certain condtions.

Modify unittest to test this case.
Without this change test will fail.

Relates to: https://bugs.chromium.org/p/webm/issues/detail?id=1140

Change-Id: I7d81ca7fe0783b3bc103a52a7b7cf073a96be26e
2016-02-12 15:06:48 -08:00
James Zern
cffef113b9 tests: quiet some unused parameter warnings
Change-Id: Iff8b0d77234f78bf407676891bccad92825bfcc6
2016-02-11 19:25:48 -08:00
James Zern
bdad368991 vp9_error_block_test: prefer EXPECT over assert()
Change-Id: Id523448bac903999934370f7b06a5c316f11a966
2016-02-11 19:24:08 -08:00
James Zern
153ef3d866 vp9_encoder_parms_get_to_decoder: add missing initializers
+ quiet an unused parameter warning

Change-Id: I65f69172febb4e0701d3e440b7e1fb31829cda57
2016-02-11 19:24:07 -08:00
James Zern
c8e5a7749c vpxenc: quiet unused param warning
Change-Id: Ib6ed1b8c03f6c269f8d667b21b895b35363cee9e
2016-02-11 19:22:30 -08:00
James Zern
26c6fbdcda vpx_ve_predictor_4x4_c: quiet unused param warning
Change-Id: I62234260e2d2de94d602c6d8095c8f8124334052
2016-02-11 19:22:29 -08:00
James Zern
8628898acf vp10_receive_raw_frame: add missing setjmp
allocations done within this function are protected with
vpx_internal_error; adding the setjmp fixes a crash in
vp10_lookahead_push() under low memory conditions.

Change-Id: I5515017cd71b218840c506791b3a517da7ffc93e
2016-02-11 19:21:28 -08:00
James Zern
6c323e359a vp9_receive_raw_frame: add missing setjmp
allocations done within this function are protected with
vpx_internal_error; adding the setjmp fixes a crash in
vp9_lookahead_push() under low memory conditions.

Change-Id: I4b79dca37cc7fadc4b7633f0db44c0e406799bc6
2016-02-11 19:20:12 -08:00
Marco
34d12d1160 vp9-resize: Force reference masking off for external dynamic-resizing.
An issue exists with reference_masking in non-rd pickmode for spatial
scaling. It was kept off for internal dynamic resizing and svc, this
change is to keep it off also for external dynamic resizing.

Update to external resize test, and update TODO to re-enable this
at frame level when references have same scale as source.

Change-Id: If880a643572127def703ee5b2d16fd41bdbf256c
2016-02-11 08:35:57 -08:00
Marco
acc592b35a vp9 resize_test: Enable resize_allowed in real-time ExternalResize test.
For dynamic resizing (whether the new codec size is determined internally
or externally set by user), we should for now keep rc.resize_allowed enabled.
This prevent the use of referene_masking for real-time mode
(in set_rt_speed_feature()).

Change-Id: Ibb7c3ff35be88afdf1a3c6db6693521766f177a3
2016-02-10 15:23:27 -08:00
Scott LaVarnway
0ae42ee1bd VP9: Pass NULL scale_factors ptr when not scaling
to vp9_setup_pre_planes(), preventing the function
unscaled_value() from being called.  unscaled_value()
returns the same value that was passed in.  See
scaled_buffer_offset() in vp9_reconinter.h.

Change-Id: I2a6fbaf07972c2f212834929d29a2cbe72e399c3
2016-02-10 11:43:23 -08:00
Scott LaVarnway
ad08e0875b Merge "VP9: Refactor read_inter_block_mode_info() -- 2" 2016-02-10 12:59:41 +00:00
James Zern
1aac02247f Merge "intrapred/d135: flatten border results before storing" 2016-02-10 02:41:31 +00:00
James Zern
31a31272cd Merge "vp8: fix build with mingw+pthreads" 2016-02-10 02:40:13 +00:00
Alex Converse
0091fef7a2 Merge "Restore previous motion search bit-error scale." 2016-02-10 01:21:01 +00:00
Scott LaVarnway
2d040dd68c VP9: Refactor read_inter_block_mode_info() -- 2
Change-Id: I96d4764523b8d634eafb4cb3ed6eb3aee4052573
2016-02-09 15:36:01 -08:00
Alex Converse
fac947df77 Restore previous motion search bit-error scale.
The bit to error transformation got doubled as a result of going from
8-bit to 9-bit costs (change d13385c).

Use defines to derive the scale numbers and comment some of the fields.

derf: -0.023 BDRATE
hevcmr: +0.067 BDRATE
stdhd: +0.098 BDRATE
(These are substantially smaller than than the original gains from 8 to
9 bit costing.)

Change-Id: I6a2b3b029b2f1415e4f90a05709b2333ec0eea9b
2016-02-09 13:20:25 -08:00
Marco
f288c943c4 vp9-dynamic resize: Fix bug on releasing scaled reference.
When the codec frame size is the same as the reference frame size,
release the scaled reference before assigning it a new buf_idx.
Only affects 1 pass non-svc mode, where the scaled references are
release only under certain conditions (to prevent un-needed scaling
of the references every frame).

Modified a unittest that can trigger this bug without this change.

https://code.google.com/p/chromium/issues/detail?id=582598

Change-Id: I9a884e36ebd7608b1641ec2a469e20a4f829cf43
2016-02-09 11:10:28 -08:00
Marco
aff0a802e7 vp9-aq-mode=3: Reset cyclic refresh under config/external size change.
If the application changes frame size (external size changes),
and aq-mode=3 is on, reset the cyclic refresh.

Modify the TestExternalResize unittest (longer run with more resize
actions). Without this change an assert would be triggered on this
longer test.

Change-Id: I0eefd2cd7ffa0c557cca96ae30d607034a2599ce
2016-02-09 10:10:36 -08:00
Yaowu Xu
bb8eebc0e0 Merge "Set use_highbitdepth flag to either 1 or 0" 2016-02-09 16:57:28 +00:00
Scott LaVarnway
29e211886f Merge "BUG FIX: undefined reference to `vp9_scale_and_extend_frame_c'" 2016-02-09 14:52:04 +00:00
Yaowu Xu
5c327cb450 Set use_highbitdepth flag to either 1 or 0
This reduces the buffer allocation size for high bit depth buffers by
more than 70%.

Change-Id: Iab9007d9684e8ac30ce7fa94e61f038f01792fc5
2016-02-08 20:30:50 -08:00
Debargha Mukherjee
f28ea3e830 Explicitly set tx_type for sub8x8 blocks
Fixes an issue where the tx_type was not set correctly for
sub8x8 inter and intra blocks. In the current syntax, for
sub8x8 blocks, there is still a single tx_type that is
transmitted. Ideally, this should be searched for the best
rd performance, albeit at the expense of encode speed.
For now, we just set it to DCT_DCT. Previously it was left
incorrectly as what was used for the previous non sub8x8
block.

derflr: BDRATE -0.277%

Change-Id: If76ba903bfbfd4d374cf1ac7d1daee50e92f0edd
2016-02-08 16:11:53 -08:00
Scott LaVarnway
0840c6fb8f BUG FIX: undefined reference to `vp9_scale_and_extend_frame_c'
See https://bugs.chromium.org/p/webm/issues/detail?id=1145

Change-Id: I778ee07dc39a524e3f729bef47a7abeed51e0cee
2016-02-08 13:42:56 -08:00
Marco
2a3f994723 vp9-denoiser: Allow for checking skin for bsize <=32x32.
Change-Id: I6c99ac6fd3735e24cf668479c55bff313c0b4970
2016-02-08 13:01:38 -08:00
Jingning Han
f032c7eaed Merge "Account for sub8x8 block skip mode cost in RD decision" 2016-02-08 19:40:01 +00:00
Jingning Han
203bdd20fb Account for sub8x8 block skip mode cost in RD decision
Make this consistent with regular block size rate-distortion
optimization. It improves the compression performance:
derf    0.055%
hevcmr  0.129%

Change-Id: I112fe734f592c21bc7aa6efb7e3f269c4214ee7b
2016-02-08 10:18:51 -08:00
Jingning Han
ac6d40ece8 Clean up in vp9_rd_pick_inter_mode_sb
Use local variable.

Change-Id: I0d3df36cf4536958a0cda422f6c30da50f0e0bbf
2016-02-08 10:15:02 -08:00
James Zern
ba7ebbb35c vp8: fix build with mingw+pthreads
Change-Id: Icc34a00759c95b7b8ac356cdcc4adae848b61431
2016-02-05 21:08:45 -08:00
Marco
ae98a61e22 vp9-dynamic resize: On a resize trigger frame refresh alt_ref.
For 1 pass real-time mode. No change in behavior as only last
and golden are used as references in 1 pass real-time mode.

Change-Id: Ie4655014eee1a8b271542f29d74b2c6f7fed54c9
2016-02-05 16:32:49 -08:00
James Zern
05437805f7 intrapred/d135: flatten border results before storing
the results along the top and left border are then stored with a moving
window into the vector.
~40-67% faster on ARM, ~40-77+% on x86 depending on the block size.

Change-Id: Iab369aa2946a3ae4eb7290d512868fe5db92dbc8
2016-02-05 12:31:48 -08:00
Alex Converse
def519efb3 Fix an uninitialized warning.
Change-Id: I3ac1070df2948f6d8637ade7192400be53a7675c
2016-02-05 12:06:38 -08:00
James Zern
f7b4364cbb vp9_aq_cyclicrefresh: fix unused-function warning
delete apply_cyclic_refresh_bitrate(). unused since:
3472cbb vp9 aq-mode=3: Keep it on even at low bitrates.

Change-Id: I0fac9a31b59504e31000ac3a8f0b68e8d4320113
2016-02-05 11:56:51 -08:00
Marco Paniconi
85dccb6944 Merge "vp9 aq-mode=3: Keep it on even at low bitrates." 2016-02-05 16:38:41 +00:00
James Zern
693dcc86cf Merge "configure: enable -Wunused-function by default" 2016-02-05 02:45:56 +00:00
James Zern
ecd32d6faa Merge "Vidyo patch: Optimization for 1-to-2 downsampling and upsampling." 2016-02-05 02:36:03 +00:00
Marco
3472cbbd88 vp9 aq-mode=3: Keep it on even at low bitrates.
Change-Id: I6a27db6b9dbe3d8cb3d47ef30fbd52557171cadd
2016-02-04 17:31:10 -08:00
Scott LaVarnway
989c69303d Vidyo patch: Optimization for 1-to-2 downsampling and upsampling.
Change-Id: I9cc9780f506e025aea57485a9e21f0835faf173c
2016-02-04 14:50:26 -08:00
Zoe Liu
0f7dd40324 Define a macro to replace hardcoded values
The definition is for the number of frames to check to determine the
recent decay rate, further to determine the next key frame in the
first pass of the encoder.

Change-Id: Ic696d6eb518a86fa296842273cf8767ef0b0e27a
2016-02-04 05:33:22 -08:00
James Zern
771d276b27 configure: enable -Wunused-function by default
when INLINE is defined and mips is not being targeted. otherwise keep
the old --enable-extra-warnings behavior

Change-Id: Iba576edbe5fca03efa56ce99eee11f9cafc573ad
2016-02-03 23:07:20 -08:00
James Zern
f74e04cc62 fdct8x8_test:: quiet unused-function warning
in non-x86 builds

Change-Id: I9f6fa40d27f95a4afe92444f71c23dc9a15db466
2016-02-03 23:04:42 -08:00
James Zern
497b6744ea Merge changes from topic 'dead-code'
* changes:
  yv12config.c: remove dead CONFIG_ALPHA code
  vp9_encoder.c: remove unused macro
  vpx_mem.c: remove unused macro
  vp9_svc_layercontext.c: relocate a macro definition
  vp9_encoder.c: protect SNPRINT* macros w/CONFIG check
  vp9_aq_360.c: remove some unused macros
  vp9_diamond_search_sad_avx.c: rename (un)likely macros
  vp9_resize.c: add missing include
  vp9_aq_complexity.c: remove unused macros
  vp9_detokenize.c: remove unused macros
2016-02-04 06:25:44 +00:00
James Zern
b63788a116 Merge changes I1171e9c7,I77292e11,I1678ab48,Id7a2c345
* changes:
  dct16x16_test: quiet unused-function warning
  intrapred: protect functions w/CONFIG check x2
  dct32x32_test: remove unused function
  tests: quiet some warnings w/--disable-webm-io
2016-02-04 03:43:49 +00:00
Marco Paniconi
37c8f57318 Merge "vp9-skinmap. Some adjustments for model=1." 2016-02-03 23:34:07 +00:00
Marco
82148c02c1 vp9-skinmap. Some adjustments for model=1.
-use larger threshold on y (as in vp8).
-add distance threshold for each cluster
-use larger skin distance threshold for first cluster
-add some early exist checks.

Keep default setting to model=0.

Change-Id: I1044b99ade4bb1f215a860a019a4d84cee2f7715
2016-02-03 14:47:15 -08:00
Jingning Han
6f49e8a186 Merge "Use precise rate cost estimate for skip block mode" 2016-02-03 20:40:10 +00:00
Jingning Han
bcce658d31 Use precise rate cost estimate for skip block mode
It improves the compression performance of VP9 by 0.1% across all
test sets. No speed change is observed.

Change-Id: I59338c5c9e67bae22188f35fc3afbfe2a6bba6b0
2016-02-03 11:09:16 -08:00
Hui Su
2231d1063c Merge "Fix some interger overflow errors" 2016-02-03 18:12:26 +00:00
Hui Su
f22a0bc574 Merge "Add high bit depth args to arg list" 2016-02-03 05:49:35 +00:00
James Zern
81c165973e dct16x16_test: quiet unused-function warning
in non-x86 builds

Change-Id: I1171e9c7e7ea5bcdea70bf5e3d28b07d6bb5578f
2016-02-02 19:42:19 -08:00
James Zern
cdf1077d5a intrapred: protect functions w/CONFIG check x2
high-bitdepth version
d207e, d63e, d45e are only used with CONFIG_MISC_FIXES

Change-Id: I77292e11f51fd76d4127fd0027f876866bcf8675
2016-02-02 19:38:37 -08:00
James Zern
b0549839f6 dct32x32_test: remove unused function
idct32x32_8

Change-Id: I1678ab48639cc54be4c9294479de01beced9e1e9
2016-02-02 19:37:22 -08:00
James Zern
51906ad6e3 tests: quiet some warnings w/--disable-webm-io
unused-functions/variables

Change-Id: Id7a2c345442129d84ec1482e38fcdc4bc9eaad7d
2016-02-02 19:32:25 -08:00
hui su
06bcd852ad Add high bit depth args to arg list
So that their usage info. will show up with --help.

Change-Id: I8542240dcc98e8be29ac63d081f5abb932627cbf
2016-02-02 18:08:54 -08:00
James Zern
29b9461a5a yv12config.c: remove dead CONFIG_ALPHA code
the rest was removed with:
5926e7c Remove unfinished VP9 alpha channel.

Change-Id: I0c1d92765e5334e1380ad027b069b401e4ae9b8f
2016-02-02 18:06:05 -08:00
James Zern
fc110235ad vp9_encoder.c: remove unused macro
SHARP_FILTER_QTHRESH

unused since:
5373119 Merging in the Switchable interp experiment

Change-Id: I9ccc1883828babffd1886810b59aa16aca4766bf
2016-02-02 18:03:26 -08:00
James Zern
77d3775941 vpx_mem.c: remove unused macro
__VPX_MEM_C__

unused since:
f58011a vpx_mem: remove vpx_memset

Change-Id: I820c972c4165275ddf21c1687748409818a7f2af
2016-02-02 18:03:15 -08:00
James Zern
c9e057a9a0 vp9_svc_layercontext.c: relocate a macro definition
move SMALL_FRAME_FB_IDX closer to its first use. this is only used with
CONFIG_SPATIAL_SVC.

Change-Id: Ibf2b3e59a3aab2be2c3b3f89b4380ebe272e0ed6
2016-02-02 18:02:33 -08:00
James Zern
d6c66d4691 vp9_encoder.c: protect SNPRINT* macros w/CONFIG check
these are only used with CONFIG_INTERNAL_STATS

Change-Id: Ibbcefbdc1db79d93f75e5865289f9960a8c2358a
2016-02-02 18:02:32 -08:00
James Zern
d78ebb82f5 vp9_aq_360.c: remove some unused macros
ENERGY_MIN
ENERGY_MAX
ENERGY_SPAN
ENERGY_IN_BOUNDS

unused since first commit

Change-Id: I5507d36487aaee3e64f7a5fba582791ef9a533b0
2016-02-02 18:01:49 -08:00
James Zern
8647792975 vp9_diamond_search_sad_avx.c: rename (un)likely macros
avoid using '__' this is a reserved namespace for the compiler

Change-Id: I7d2be4dba2bdddc6f1010a16ad9e59a2e211b064
2016-02-02 18:01:49 -08:00
James Zern
8a515c16fd vp9_resize.c: add missing include
Change-Id: I429e3c80216102ed0a85ce348ecac0bf1e1e28eb
2016-02-02 18:01:49 -08:00
James Zern
59b560acef vp9_aq_complexity.c: remove unused macros
DEFAULT_COMPLEXITY
VAR_STRENGTH_STEP

unused since first commit

Change-Id: I4a47544098caf0d72e571633b7776146be88237c
2016-02-02 18:01:30 -08:00
James Zern
8ec0159159 vp9_detokenize.c: remove unused macros
LOW_VAL_CONTEXT_NODE
TWO_CONTEXT_NODE
THREE_CONTEXT_NODE
HIGH_LOW_CONTEXT_NODE
CAT_ONE_CONTEXT_NODE
CAT_THREEFOUR_CONTEXT_NODE
CAT_THREE_CONTEXT_NODE
CAT_FIVE_CONTEXT_NODE

unused since:
adaec4d Speeding up decode_coeffs().

Change-Id: Id07d2b0b76ff0ee6ef40d1b7a8e085e5e9e4aa8d
2016-02-02 18:00:46 -08:00
hui su
1c9b0918b3 Fix some interger overflow errors
Change-Id: I7e44bd952f28ce9925e8bdf6ee8ca2bb13de1b49
2016-02-02 17:32:15 -08:00
James Zern
dee831c484 Merge changes I4a365757,I14a3b328
* changes:
  vp10: remove unused (read|write)_uniform
  vp9_denoiser: mark total_adj_strong_thresh inline
2016-02-03 00:51:42 +00:00
Alex Converse
614f0727e4 Merge "Fix a signed overflow in vp9 motion cost." 2016-02-02 21:12:49 +00:00
Paul Wilkins
e062eb16fb Merge "Loop filter search resets on overlay frame." 2016-02-02 14:44:47 +00:00
James Zern
ebf258688e vp10: remove unused (read|write)_uniform
dead code since:
5d3327e Remove palette from VP10

Change-Id: I4a36575706ea6fffefe5bc778595112ef6ff37d8
2016-02-01 23:47:35 -08:00
James Zern
724ba02f1b vp9_denoiser: mark total_adj_strong_thresh inline
avoids -Wunused-function warnings when INLINE is set

Change-Id: I14a3b32837d358516b7702a2fb804bec010bb5c6
2016-02-01 23:47:02 -08:00
Alex Converse
ad43a73883 Fix a signed overflow in vp9 motion cost.
Change-Id: I5975e3aede62202d8ee6ced33889350c0a56554a
2016-02-01 14:27:32 -08:00
Marco
734dc36173 vp9: Add flag to control usage of skin detection.
Set off as default; on for 1 pass cbr mode, speed >=5, non-screen-content.

Change-Id: I03f2497e4028b354fd83b8a7d0e072c2a6bec878
2016-02-01 11:57:56 -08:00
Marco Paniconi
f51dd8c2ac Merge "vp9 non-rd partition: Update condition on force_split for skin area." 2016-02-01 18:48:46 +00:00
Marco
9248689645 vp9 non-rd partition: Update condition on force_split for skin area.
Avoid low resolutions for now.

Change-Id: Ib3a7bb8716a033449b2afb216edd70897a280df9
2016-02-01 09:50:53 -08:00
Marco
dc2e97c900 vp9-denoiser bugfix: Disable postproc-denoiser under temporal denoising.
The postproc vp9_denoise() is a spatial denoise/blur function.
It was not intended to be used if temporal denoising is enabled.

Change-Id: I97d2dcb941e7cc49bbafce99d9286beb2693249d
2016-02-01 09:08:28 -08:00
Marco Paniconi
0a3593a555 Merge "vp9-noise estimate: Put check to avoid possible out of bounds." 2016-02-01 15:18:16 +00:00
Scott LaVarnway
0c60282786 Merge "VP9: Refactor read_inter_block_mode_info()" 2016-02-01 12:52:15 +00:00
Marco
9b24251c91 vp9-noise estimate: Put check to avoid possible out of bounds.
Put check to avoid possible out of bounds when looping
over the blocks to estimate noise level.
No change in behavior.

Change-Id: I4b7b19b7edee0ae1c35b9dc0700b1bf9b304d7f5
2016-01-31 22:29:51 -08:00
Yaowu Xu
6a94d6ad8e Merge "Enable sse2 version of inverse wht for hbd build" 2016-01-31 04:38:39 +00:00
James Zern
49bf2e2ffe Merge changes I51d42a50,Id8aaf820,I6af91959
* changes:
  configure: extend armv7 hf target autodetect
  configure: remove default CROSS for arm targets
  configure: avoid default when CROSS is set to null
2016-01-30 00:27:45 +00:00
James Zern
8faccb709a Merge changes If13946e4,I61a1814d,I2ca9aa3c,I44d91eaa
* changes:
  intrapred: protect functions w/CONFIG check
  vp9_noise_estimate: protect copy_frame w/CONFIG check
  vp8_cx_iface: delete 3 unused functions
  vp8: mark intra_prediction_down_copy inline
2016-01-30 00:17:16 +00:00
Hui Su
8050e0219f Merge "Refactor prob_diff_update_savings_search_model" 2016-01-29 23:58:49 +00:00
Scott LaVarnway
d12f87cd07 VP9: Refactor read_inter_block_mode_info()
Change-Id: I8e6a1a1b6eec17d0076660b559f6fc120a78c538
2016-01-29 15:30:27 -08:00
Yaowu Xu
0aef1bc898 Enable sse2 version of inverse wht for hbd build
Change-Id: If8f5efd701a11c8a7ad3078d10ec3cd0fe27667e
2016-01-29 14:47:56 -08:00
hui su
580e815f3b Refactor prob_diff_update_savings_search_model
Change-Id: Icfab58e880285d5af00985dc20db2174a67d1fe8
2016-01-29 12:51:10 -08:00
Yaowu Xu
b229710811 SSSE3 idct8x8 functions for highbitdpeth build
This commit changes SSSE3 optimized idct8x8 functions to work with
highbitdepth build.

With this commit and the previous one that enabled SSSE3 idct32x32
functions, tests showed virtually no difference on decoding speed for
file fdJc1_IBKJA.248.webm for the build with -enable-vp9-highbitdpeth
option and the build without the option.

Change-Id: Ibe0634149ec70e8b921e6b30171664b8690a9c45
2016-01-29 12:36:53 -08:00
Marco Paniconi
432136ef56 Merge "Fix failure with libvpx__unit_tests-multi-target" 2016-01-29 18:55:13 +00:00
Marco Paniconi
b9723c4be9 Merge "vp9-denoiser: Force increase_denoising = 0 for skin block." 2016-01-29 18:43:27 +00:00
Marco
72e3b5b2c5 Fix failure with libvpx__unit_tests-multi-target
Introduced in: https://chromium-review.googlesource.com/#/c/323215/
For now exclude the computation of vp_compute_skin_block for highbitdepth.

Change-Id: I18107a862c17ba869438ec3616a787bf173736c4
2016-01-29 10:05:08 -08:00
Marco
c9e984a858 vp9-denoiser: Force increase_denoising = 0 for skin block.
Change-Id: Ic5af41db58a3daad4103175b4b4b9300675020c0
2016-01-29 08:37:02 -08:00
Zoe Liu
bca1a350c9 Merge "Cleaned code in firstpass related to altref frame" 2016-01-29 16:31:41 +00:00
Yaowu Xu
aac1ef7f80 Enable hbd_build to use SSSE3optimized functions
This commit changes the SSSE3 assembly functions for idct32x32 to
support highbitdepth build.

On test clip fdJc1_IBKJA.248.webm, this cuts the speed difference
between hbd and lbd build from between 3-4% to 1-2%.

Change-Id: Ic3390e0113bc1ca5bba8ec80d1795ad31b484fca
2016-01-29 01:30:43 +00:00
Yaowu Xu
8fdab8a4a4 Merge "Add a vp9 test vector" 2016-01-29 01:28:43 +00:00
Marco Paniconi
35b878ca25 Merge "vp9: encoder-breakout: Modify UV thresholds." 2016-01-29 01:19:30 +00:00
Zoe Liu
b6f1f369af Cleaned code in firstpass related to altref frame
Change-Id: I6dbddf500fd4f64216774685700efea972165470
2016-01-28 16:37:17 -08:00
Yaowu Xu
a643964a5f Add a vp9 test vector
This test vector exercises various idct32x32 functions in decoder.

Change-Id: Ic9453f50ef4723bdaace9bd80f32540d061ef2a1
2016-01-28 14:36:19 -08:00
James Zern
4f780e94a1 vp9/10: fix encoder crash on flush
the lookahead buffer allocation is deferred to receipt of the first
frame to allow profile changes. if the encoder was flushed before
supplying any frames the encoder would crash trying to dereference the
NULL buffer. vp8 is unaffected.

fixes mozilla bug:
https://bugzilla.mozilla.org/show_bug.cgi?id=1237848

Change-Id: Icee4b64de760476eee0d33b568f0a1010335ff13
2016-01-28 12:53:41 -08:00
Marco
1c2df9cd48 vp9: encoder-breakout: Modify UV thresholds.
Set UV thresholds to 0 for encoder breakout if
block is detected as skin.

Change-Id: Iaaa30b5cc8bae4cf611f8ea8eba693b730e32a3f
2016-01-28 12:12:40 -08:00
JackyChen
d1e3d0467c VPX skin map improvement.
Use multiple clusters instead of one and decrease
the distance thresholds.

Add a define to switch between models.
Default is set to existing (1 cluster) model.

Change-Id: I802cd9bb565437ae8983ef39453939f5d5073bb1
2016-01-28 10:38:14 -08:00
Marco Paniconi
aa3fb7e1b5 Merge "vp9 non-rd mode: Modification for detected skin areas." 2016-01-28 17:01:19 +00:00
Scott LaVarnway
66129c7214 Merge "VP9: Refactor dec_build_inter_predictors_sb()" 2016-01-28 12:31:22 +00:00
Marco
b39a599cef vp9 non-rd mode: Modification for detected skin areas.
If a superblock contains alot of "skin" then force split
of 64x64 partition, and make some adjustments in mode selection.

This helps to reduce artifacts on moving face/skin areas at low bitrates.

Little/no change in metrics: avgPSNR/SSIM down by ~0.12%.
Small encoding time increase < 1%.

Change-Id: Ic57f52148c3716f391419fab0530d916e4c1d186
2016-01-27 17:38:58 -08:00
Hui Su
cdb141dd94 Merge "Fix some typos." 2016-01-28 01:04:50 +00:00
hui su
5afc4e4c77 Fix some typos.
Change-Id: I32aacd014df6c927cf2893dc096cbe6ec7604b9b
2016-01-27 16:12:49 -08:00
Marco Paniconi
ced5cea41c Merge "vp9-aqmode=3: Limit on period for golden update." 2016-01-27 21:38:35 +00:00
Alex Converse
acc248e83d Merge "Switch to 9-bit rate cost constants built on a 256 probability denominator." 2016-01-27 20:54:07 +00:00
Marco
fab630fac9 vp9-aqmode=3: Limit on period for golden update.
For aqmode=3, golden period update is set based on period of cyclic refresh.
Put a limit on max golden period update, for now set to 40.
And fix comment.

Change-Id: Icb61dd87c796cce2a5f5f7331c6a129540994696
2016-01-27 12:07:49 -08:00
Alex Converse
d13385cee7 Switch to 9-bit rate cost constants built on a 256 probability denominator.
-.220 BDRATE derf: https://x20web.corp.google.com/~aconverse/results/cost256_derf.html
-.675 BDRATE hevcmr: https://x20web.corp.google.com/~aconverse/results/cost256_hevcmr.html

Change-Id: Ifb1646d8ce65ffe0eff9953a911b1b88735b335f
2016-01-27 19:34:30 +00:00
Scott LaVarnway
7203100127 VP9: Refactor dec_build_inter_predictors_sb()
Change-Id: I336fe2006288214977b5ee854124ee7b5bba5796
2016-01-27 07:37:59 -08:00
James Zern
fea27ccca0 intrapred: protect functions w/CONFIG check
d207e, d63e, d45e are only used with CONFIG_MISC_FIXES

Change-Id: If13946e483c4d0ccaa3e1d60dc14216c06d5a219
2016-01-26 20:13:57 -08:00
James Zern
fb58a84c68 vp9_noise_estimate: protect copy_frame w/CONFIG check
This is only used with CONFIG_VP9_TEMPORAL_DENOISING

Change-Id: I61a1814d43d71235077a2426f7bfce141677a79a
2016-01-26 20:09:36 -08:00
James Zern
42c2c6bf33 vp8_cx_iface: delete 3 unused functions
vp8e_update_entropy, vp8e_update_reference, vp8e_use_reference have been
unused since:
a046f56 vp8cx: remove deprecated reference/entropy controls

Change-Id: I2ca9aa3c3f1a209a534a1492432b16852e3d8629
2016-01-26 20:08:37 -08:00
James Zern
abd62063ee vp8: mark intra_prediction_down_copy inline
avoids -Wunused-function warnings when INLINE is set

Change-Id: I44d91eaa7efba7bc2427501fb9f63a93f32aaa7f
2016-01-26 20:07:42 -08:00
Yunqing Wang
d6996849f0 Merge "Fix a clang/win build error" 2016-01-26 19:00:06 +00:00
Yunqing Wang
e6f05e78fe Fix a clang/win build error
Made the definition of THREAD_FUNCTION consistent.

Change-Id: I1ac099484e201e359298ed16de0b81ec781075ce
2016-01-26 10:10:07 -08:00
Alex Converse
fa0f25891f Merge "vp9: Be more responsive to massive overshoot." 2016-01-26 17:59:59 +00:00
James Zern
3a2ad10de2 Merge "Code clean of sad4xNx4D_sse" 2016-01-25 20:57:15 +00:00
Alex Converse
4b2b90fed3 vp9: Be more responsive to massive overshoot.
Limit oscilation detection in the case where overshoot is very very
large.

This keeps the 9-bit cost patch from breaking the DownUp reisze test.
The patch pushed us to an 11% undershoot right before a scene cut
causing a 1200% overshoot. (Whereas before we were undershooting by
only 6% before overshooting by 1200%).

Change-Id: Id90ccfab8aba872ccadc45b73b3bb097b895677f
2016-01-25 12:03:50 -08:00
Zoe Liu
9e612763f0 Cleaned a code in define_gf_group() for firstpass
Change-Id: I0b8eff9e74e3446024482d011ec4fb28b19136d3
2016-01-25 09:38:45 -08:00
Alex Converse
27c13712c9 Merge "Short circuit flat blocks when coding screen content at realtime speed." 2016-01-23 02:04:37 +00:00
Scott LaVarnway
be916257bd Merge "VP9: Do not set up/left available in vp9_first_pass()" 2016-01-22 21:53:26 +00:00
Alex Converse
7da6324cab Short circuit flat blocks when coding screen content at realtime speed.
In inter mode search skip all modes except NEARESTMV and DC_PRED.

10% less encode latency for large frames using the chromium remoting_perftests.

+0.313% BDRATE on the screencast set at speed -6.

Change-Id: Ib97a39dd8bcdeab545509e0e02d78ce7033f8c63
2016-01-22 12:40:45 -08:00
Scott LaVarnway
78fadcd063 VP9: Do not set up/left available in vp9_first_pass()
These values are set in set_mi_row_col()

Change-Id: Ie44c9d2dcb79797a8473b5fc29394277a7117547
2016-01-22 11:30:51 -08:00
Yaowu Xu
2ab58d812f Fix a minor typo
a wrong variable.

Change-Id: I9fa02621dbdc508a12ba1ef9c8f98dbeab68e958
2016-01-22 10:57:16 -08:00
Yaowu Xu
307c84c352 Merge "Properly set segmentation for error-resilient mode" 2016-01-22 16:52:41 +00:00
Marco Paniconi
732242ab3d Merge "vp9 pickmode: Fix the shift on negative value." 2016-01-22 00:09:27 +00:00
Marco
dbc963a42f vp9 pickmode: Fix the shift on negative value.
Error only affected svc 1 pass mode, introduced in:
https://chromium-review.googlesource.com/#/c/319609/

Change-Id: Ifc078c82d38b742966a81baaf5ad532f7dbc13a4
2016-01-21 15:16:52 -08:00
Alex Converse
a61ac8e2e7 Merge "Remove the vestigal skip_eob feature from tokenization." 2016-01-21 23:11:14 +00:00
James Zern
604e975f93 Merge "vp9_aq_cyclicrefresh: fix double->float warning" 2016-01-21 23:08:02 +00:00
James Zern
bd4501fe28 vp9_aq_cyclicrefresh: fix double->float warning
Change-Id: I39d3a150de9a77967a4e25ca89d2eda51fd18d47
2016-01-21 14:07:33 -08:00
Yaowu Xu
8c4360ed89 Merge "Fix a typo in ctrl_set_render_size()" 2016-01-21 20:06:29 +00:00
Yaowu Xu
b6cefbf052 Fix a typo in ctrl_set_render_size()
Change-Id: I6a7fa6d0ae8ce8de7b426189d5eb00413f21bc17
2016-01-21 11:19:08 -08:00
Alex Converse
4326cffa65 Merge "Tie the bit cost scale to a define." 2016-01-21 19:17:56 +00:00
Marco
a925173da0 vp9-aqmode=3: Reduce condition below which we turn off delta-qp.
Add TODO to consider turning-off more smoothly.

Change-Id: Id6dd4c5c515f5b09c388af965eb27dbe24924362
2016-01-20 20:26:40 -08:00
hui su
19de4d9408 Fix build with --enable-internal-stats
Change-Id: I9649647cc5755c8411ddd56f92e7f96d421c2663
2016-01-20 18:02:30 -08:00
Marco Paniconi
4ec5d7dd18 Merge "vp9-svc: Allow frame-dropping in svc datarate control tests." 2016-01-21 01:39:53 +00:00
Alex Converse
5bd99f83d9 Remove the vestigal skip_eob feature from tokenization.
Repack TOKENEXTRA fields.

Speed impact within measurment margin of error.

Change-Id: I9a6d1dde1bb4a0766b02d0cb74c871ddde907cde
2016-01-20 17:13:59 -08:00
Marco
f5c07b6803 vp9-svc: Allow frame-dropping in svc datarate control tests.
Remove comment(s) and enable frame-dropper for tests.
Frame dropper for 1 pass svc was fixed a while ago:
https://chromium-review.googlesource.com/#/c/309230/

Change-Id: I5fd3192825b22e562db9210d3dc7b246a1799d8d
2016-01-20 14:00:42 -08:00
Marco
4800e179fe vp8-denoiser: Fix threshold for skin map.
Make it consistent with the comment/intended behavior,
that is, only denoise if current block is zero_mv.

Change-Id: I3909761e802e80089752a493ab3646dc32698ded
2016-01-20 13:48:46 -08:00
Yaowu Xu
31a94868b5 Merge "Remove duplicate definitions" 2016-01-20 18:12:51 +00:00
Yaowu Xu
cfe9758c4e Remove duplicate definitions
This fixes the build errors with msvc.

Change-Id: Ie2716e4c15a1bacfb00a8d41ec3283d718af88fc
2016-01-20 08:56:41 -08:00
Marco
abf58ecf6a Vidyo patch: Changes to the scalability code.
Changes to mode selection for 1 pass SVC mode:
use base layer motion vector, changes to intra-prediction.

Change-Id: I3e883aa04db521cfa026a0b12c9478ea35a344c9
2016-01-20 08:53:51 -08:00
Scott LaVarnway
a7e0b1ea01 Merge "VP9: Eliminate MB_MODE_INFO" 2016-01-20 12:19:27 +00:00
James Zern
3277d481eb Merge "Use input framerate as timebase if none was explicitly specified." 2016-01-20 02:27:29 +00:00
Yunqing Wang
5ac25c9102 Merge "Amend and improve VP8 multithreading implementation" 2016-01-20 01:51:37 +00:00
Scott LaVarnway
5232326716 VP9: Eliminate MB_MODE_INFO
Change-Id: Ifa607dd2bb366ce09fa16dfcad3cc45a2440c185
2016-01-19 16:40:20 -08:00
Alex Converse
cb785ade5b Merge "Deduplicate sign cost for ONE/TWO/THREE/FOUR tokens" 2016-01-19 20:04:28 +00:00
paulwilkins
733bbab53a Loop filter search resets on overlay frame.
This patch fixes a bug that causes the loop filter search to reset to
a low value or zero after each arf overlay frame. We expect the overlay
frames to need little or no loop filtering but this should not propagate.

Change-Id: I895b28474cf200f20d82793f3de40b60b19579fd
2016-01-19 13:05:15 +00:00
Ronald S. Bultje
9134e9f8bb Use input framerate as timebase if none was explicitly specified.
After patch:
$ vpxenc tennis_sif.y4m --end-usage=q -q 20 -o x.ivf --ivf --codec=vp9 --limit=30
$ ffmpeg -i x.ivf -i tennis_sif.y4m -lavfi psnr -f null -
[..]
[Parsed_psnr_0 @ 0x7f8913c21e40] PSNR y:43.270594 u:46.300362 v:47.011172 average:44.097994 min:43.460704 max:52.509271

Before patch:
$ vpxenc tennis_sif.y4m --end-usage=q -q 20 -o x.ivf --ivf --codec=vp9 --limit=30
$ ffmpeg -i x.ivf -i tennis_sif.y4m -lavfi psnr -f null -
[..]
[Parsed_psnr_0 @ 0x7fbdaac22780] PSNR y:27.427366 u:41.505376 v:36.853477 average:28.990890 min:22.219454 max:52.509271
$ ffmpeg -i x.ivf -f rawvideo x.yuv
$ ffmpeg -f rawvideo -vcodec rawvideo -video_size 352x240 -framerate 29.97 -i x.yuv -i tennis_sif.y4m -lavfi psnr -f null -
[..]
[Parsed_psnr_0 @ 0x7fadf9e013a0] PSNR y:43.270594 u:46.300362 v:47.011172 average:44.097994 min:43.460704 max:52.509271

Change-Id: Ifac2d6c2ff8379b2d318fe5cfe4be0bf1bc9f27f
2016-01-18 14:05:07 -05:00
Alex Converse
269428e35c Tie the bit cost scale to a define.
This is a pure-refactor in preparation to potentially raise the bit-cost
resolution.

Verified at good speed 0 and rt speed -6.

Change-Id: I5347e6e8c28a9ad9dd0aae1d76a3d0f3c2335bb9
2016-01-15 15:59:31 -08:00
Marco
c0307e6cea vp9-denoiser: Set motion threshold for skin_map to 0.
More aggresive on avoiding denoising on skin.
May supplement this later by adding condtion onn consec_zeromv.

Change-Id: Ied92b332f9b24e821d2009f81d1565758588d9a5
2016-01-15 15:04:14 -08:00
Alex Converse
dea6f5217e Deduplicate sign cost for ONE/TWO/THREE/FOUR tokens
Change-Id: I9c383d604dfd240e38b198ac5bf86ddd3456f442
2016-01-15 13:56:34 -08:00
Debargha Mukherjee
dcc0c894c4 Merge "Adding an aq mode for 360 videos" 2016-01-14 16:13:56 +00:00
Scott LaVarnway
d4bc17d696 Merge "VP9: inline vp9_use_mv_hp()" 2016-01-14 13:36:40 +00:00
Scott LaVarnway
13177d7ecb Merge "VP9: Remove decoder args from find_mv_refs_idx()" 2016-01-14 13:30:30 +00:00
James Zern
b524cca58a configure: extend armv7 hf target autodetect
Change-Id: I51d42a50288fc5224eb3ed7f895c916ae53239c8
2016-01-13 23:16:10 -08:00
James Zern
8d92858a91 Merge changes I6998e15f,I88891d9f
* changes:
  Remove unused POSIX_MMAP references
  Remove unused stdint.h check
2016-01-14 04:13:24 +00:00
Yaowu Xu
0dfe9618c3 Properly set segmentation for error-resilient mode
Change-Id: I0c85b637e51dc949a4e919f10a78870f23c2ca6a
2016-01-13 17:27:17 -08:00
Debargha Mukherjee
02345be986 Adding an aq mode for 360 videos
Different quality levels are used for different regions in
the frame depending on how far they are vertically from the
center. Specifically, three segments are used based on the
mi_row index with respect number to the number of mi_rows in
the frame.

Change-Id: Ifc8b777bc58ea8521dffc4640360c67d99f8d381
2016-01-13 16:17:37 -08:00
Alex Converse
28ff0e0d1d Merge "Revert "Merge "Change highbd variance rounding to prevent negative variance.""" 2016-01-13 21:51:23 +00:00
Scott LaVarnway
a85e552d95 VP9: Remove decoder args from find_mv_refs_idx()
The decoder does not use this function.

Change-Id: Ie67f909c0f4108ef286789c70df867d4b960a780
2016-01-13 13:30:40 -08:00
Yaowu Xu
ca4df94858 Merge "Fix encoder crashes and enc/dec mismatches" 2016-01-13 21:07:53 +00:00
Alex Converse
ed3df445d9 Revert "Merge "Change highbd variance rounding to prevent negative variance.""
This reverts commit ea48370a500537906d62544ca4ed75301d79e772, reversing
changes made to 15939cb2d76c773950cda40988ede89e111872ea.

The commit was insufficiently tested and causes failures.

Change-Id: I623d6fc2cd3ae6fd42d0abab1f8eada465ae57a7
2016-01-13 11:19:06 -08:00
Yaowu Xu
d803e8a20e Fix encoder crashes and enc/dec mismatches
This commit adds the logic for segmentation map initialization and
disable temporal update of segmentation map when error-resilient
mode is on. It fixes the enc/dec mistmates (release build) and
assertions(debug) when both aq-mode and error-resilient are on.

Change-Id: Id2155e8b28962cf1f64494f4df0c8d79499b6890
2016-01-13 09:51:05 -08:00
Scott LaVarnway
de993a847f VP9: inline vp9_use_mv_hp()
Change-Id: Ib275bfc4c29c572d6c70e5ec6dbfc241590d3e3e
2016-01-13 08:02:05 -08:00
Alex Converse
ea48370a50 Merge "Change highbd variance rounding to prevent negative variance." 2016-01-13 00:25:54 +00:00
Scott LaVarnway
15939cb2d7 Merge "VP9: Eliminate unnecessary nearest/near searches" 2016-01-12 20:00:59 +00:00
Scott LaVarnway
d8aa40634a VP9: Eliminate unnecessary nearest/near searches
Prior to this patch, read_inter_block_mode_info() would
find the nearmv and nearestmv for all modes.  Now it does not
search for ZEROMV modes and breaks out early for NEARMV and
NEWMV modes.

Change-Id: Ifa7b1eaf58bb03b9c7792ea5012fef477527d0fd
2016-01-12 05:09:06 -08:00
Debargha Mukherjee
a0900fd0db Remove experimental flag for ext_tx
Also includes a bug fix.

Change-Id: Ia49ed00f8ffd1531c10bcf89b1f497310ee7cb82
2016-01-08 13:48:24 -08:00
Debargha Mukherjee
004b546ae1 Merge "Modifies inter/intra coding to allow all tx types" 2016-01-08 20:02:41 +00:00
Yunqing Wang
ff0107f60d Amend and improve VP8 multithreading implementation
There are flaws in current implementation of VP8 multithreading encoder
and decoder as reported in the following issue:
https://code.google.com/p/chromium/issues/detail?id=158922

Although the data race warnings are harmless, and wouldn't cause real
problems while encoding and decoding videos, it is better to fix the
warnings so that VP8 code could pass the TSan test.

To synchronize the thread-shared data access and maintain the speed
(i.e. decoding speed), use multiple mutexes based on mb_rows to reduce
the number of synchronizations needed, make the reads and writes of
the shared data protected, and reduce the number of mb_col writes by
nsync times.

The decoder speed tests showed < 3% speed loss while using 2 ~ 4
threads.

Change-Id: Ie296defffcd86a693188b668270d811964227882
2016-01-08 11:59:49 -08:00
Debargha Mukherjee
f7dfa4ece7 Modifies inter/intra coding to allow all tx types
The nominal tx_type for a given mode is used as a context
to encode the actual tx_type for intra.

Results:
derflr: -0.241% BDRATE
hevcmr: -0.366% BDRATE

Change-Id: Icfe7b0a58d79bc6497a06e3441779afec6e01e21
2016-01-08 11:13:46 -08:00
James Zern
dfb26082ea Merge "Update IMAGE_ABI_VERSION which wasn't updated after color_range enum was introduced." 2016-01-08 02:32:38 +00:00
Yaowu Xu
4893d28186 Merge "Enable encoder to avoid 8x4 or 4x8 partitions" 2016-01-07 23:00:00 +00:00
Yaowu Xu
017fea7cfb Merge "Fix a typo" 2016-01-07 20:26:09 +00:00
Yaowu Xu
9cac17d157 Enable encoder to avoid 8x4 or 4x8 partitions
This commit enables encoder to avoid 8x4 and 4x8 partitions for
scaled reference frames when libvpx is configured and built with
--enable-better-hw-compatibility

Change-Id: I02ad65c386f5855f4325d72570c49164ed52f413
2016-01-07 09:53:14 -08:00
Yaowu Xu
650a2d7628 Fix a typo
Change-Id: I12de2dd5e5f375551804166188d76a9ad8067b41
2016-01-07 09:29:34 -08:00
Marco
b520882f0e vp9-svc: Fix to avoid msan unitialized value.
Move the logic for forcing zero_mode after the
(ref_frame & flag_list) check.
This was causing an memory leak under msan:
https://bugs.chromium.org/p/webrtc/issues/detail?id=5402

Change-Id: Ie9d243369f8ed7c332f46178275945331da4fd85
2016-01-06 11:34:57 -08:00
Yaowu Xu
2bd4f44409 Assert no mv clamping for scaled references
Under --enable-better-hw-compabibility, this commit adds the asserts
that no mv clamping is applied for scaled references, so when built
with this configure option, decoder will assert if an input bitstream
triggger mv clamping for scaled reference frames.

Change-Id: I786e86a2bbbfb5bc2d2b706a31b0ffa8fe2eb0cb
2016-01-05 14:55:05 -08:00
Yaowu Xu
ce6d3f1de4 Merge "Assert no 8x4/4x8 partition for scaled references" 2016-01-05 20:35:46 +00:00
Marco Paniconi
e9e726f744 Merge "vp9-skin detection: Refactoring." 2016-01-05 16:56:54 +00:00
Yaowu Xu
03a021a6fc Assert no 8x4/4x8 partition for scaled references
This commit adds a new configure option:

--enable-better-hw-compatibility

The purpose of the configure option is to provide information on known
hardware decoder implementation bugs, so encoder implementers may
choose to implement their encoders in a way to avoid triggering these
decoder bugs.

The WebM team were made aware of that a number of hardware decoders
have trouble in handling the combination of scaled frame reference
frame and 8x4 or 4x8 partitions. This commit added asserts to vp9
decoder, so when built with above configure option, the decoder can
assert if an input bitstream triggers such decoder bug.

Change-Id: I386204cfa80ed16b50ebde57f886121ed76200bf
2016-01-04 18:33:37 -08:00
Yaowu Xu
ef77ce4407 Merge "vp10: only assume ONLY_4X4 if segmentation is disabled." 2016-01-05 02:29:05 +00:00
Yaowu Xu
0b769b2929 Merge "vp10: skip coding of txsz for lossless-segment blocks." 2016-01-05 02:28:58 +00:00
Marco
a8b7c6aad3 vp9-skin detection: Refactoring.
Add function to compute skin map for a given block, as its
used in several places (cyclic refresh, noise estimation, and denoising).

Change-Id: Ied622908df43b6927f7fafc6c019d1867f2a24eb
2016-01-04 16:58:06 -08:00
Marco
e5dfca02a9 vp9-svc: Set initial values for ext_buffer/flag indices.
Set initial values for these parameters in the vp9_init_layer_context().

This also fixes an issue in the svc-bypass mode when frame flags are
passed via the vpx_codec_encode().

Change-Id: I0968f04672f8d3d2fe2cea6b8a23f79f80d7a8b1
2016-01-04 12:28:46 -08:00
Ronald S. Bultje
53a11656cd vp10: only assume ONLY_4X4 if segmentation is disabled.
Otherwise, per-segment lossless might mean that some segments are not
lossless and they could still want to use another mode. The per-block
tx points remain uncoded on blocks where (per the segment id) the Q
value implies lossless.

Change-Id: If210206ab1fe3dd11976797370c77f961f13dfa0
2016-01-04 15:21:02 -05:00
Ronald S. Bultje
d9439fdc36 vp10: skip coding of txsz for lossless-segment blocks.
Change-Id: Ic23c10b6d2a9fed3abe69c6bf10e910832444f2c
2016-01-04 15:21:02 -05:00
Sasi Inguva
1e6af9e2b6 Update IMAGE_ABI_VERSION which wasn't updated after color_range enum was introduced.
Change-Id: I83703851f65f93573ebf7d2c0d0f056ba879c07a
2016-01-04 11:56:56 -08:00
Jian Zhou
b8c2a4eb0c Merge "Code clean of highbd_tm_predictor_32x32" 2015-12-28 18:17:03 +00:00
Jian Zhou
dbe2d8c33c Merge changes I0139f8e9,I7d2545fc
* changes:
  Code clean of highbd_tm_predictor_16x16
  Code clean of highbd_dc_predictor_32x32
2015-12-28 18:16:13 +00:00
Jingning Han
c84d3abeb8 Merge "Fix sub8x8 motion search on scaled reference frame" 2015-12-23 02:34:18 +00:00
Jian Zhou
26a6ce4c6d Code clean of highbd_tm_predictor_32x32
Remove the ARCH_X86_64 constraint. No performance hit on both
big core and small core.

Change-Id: I39860b62b7a0ae4acaafdca7d68f3e5820133a81
2015-12-22 16:51:57 -08:00
Jian Zhou
355bfa2193 Code clean of highbd_tm_predictor_16x16
Remove the ARCH_X86_64 constraint.

Change-Id: I0139f8e998cc5525df55161c2054008d21ac24d4
2015-12-22 16:34:40 -08:00
Jian Zhou
a4c265f1b7 Code clean of highbd_dc_predictor_32x32
Remove the ARCH_X86_64 constraint.

Change-Id: I7d2545fc4f24eb352cf3e03082fc4d48d46fbb09
2015-12-22 16:06:54 -08:00
Marco Paniconi
a9dd8a7308 Merge "aq-mode=3: Don't reset segment if block is determined to be skin." 2015-12-22 20:18:24 +00:00
Marco
b121a3e7b8 aq-mode=3: Don't reset segment if block is determined to be skin.
For coding block sizes <=16X16, if the block is determined to be skin,
then always allow for that block to be candidate for refresh. So if that
block happens to be on the boost segment(s), segment won't get reset to 0
and delta-q will be applied.

PSNR/SSIM metrics neutral (little/no change) on RTC clips.
Speed increase small/negligible (< 1%).
Some visual improvement on faces in a few RTC clips.

Change-Id: I6bf0fce6f39d820b491ce05d7c017ad168fce7d6
2015-12-22 10:23:44 -08:00
James Zern
cedb1db594 Merge "Code clean of highbd_tm_predictor_4x4" 2015-12-22 16:45:01 +00:00
James Zern
a097963f80 Merge "Code clean of highbd_dc_predictor_4x4" 2015-12-22 16:30:37 +00:00
James Zern
5aab99f24b configure: remove default CROSS for arm targets
arm-none-linux-gnueabi- is an anachronism and makes building on native
arm platforms more difficult. further, many distros include alternative
cross compilers, e.g., arm-linux-gnueabihf-, so the choice is best left
up to the user.

Change-Id: Id8aaf820ed112b85db2b8518d0e9d8abee1ad85c
2015-12-22 11:01:31 -05:00
James Zern
47a1718c4d configure: avoid default when CROSS is set to null
avoids picking up defaults if CROSS is forcibly set empty as in:
$ CROSS= ./configure ...

BUG=1121

Change-Id: I6af91959288dede01efe3e5945698ab249eb6ec3
2015-12-21 22:09:52 -08:00
Jian Zhou
52e7f4153b Merge "Code clean of highbd_v_predictor_4x4" 2015-12-21 18:07:48 +00:00
Yunqing Wang
b597e3e188 Merge "Fix for issue 1114 compile error" 2015-12-19 04:29:39 +00:00
James Zern
8b2ddbc728 sad_sse2: fix sad4xN(_avg) on windows
reduce the register count by 1 to avoid xmm6 and unnecessarily
penalizing the other users of the base macro

Change-Id: I59605c9a41a31c1b74f67ec06a40d1a7f92c4699
2015-12-18 19:19:32 -08:00
Jian Zhou
db11307502 Code clean of highbd_tm_predictor_4x4
Replace MMX with SSE2, reduce mem access to left neighbor,
loop unrolled.

Change-Id: I941be915af809025f121ecc6c6443f73c9903e70
2015-12-18 18:43:41 -08:00
Jian Zhou
c91dd55eda Code clean of highbd_v_predictor_4x4
MMX replaced with SSE2, same performance.

Change-Id: I2ab8f30a71e5fadbbc172fb385093dec1e11a696
2015-12-18 15:25:27 -08:00
Jian Zhou
8366b414dd Code clean of highbd_dc_predictor_4x4
MMX replaced with SSE2, same performance.

Change-Id: Ic57855254e26757191933c948fac6aa047fadafc
2015-12-18 12:45:23 -08:00
Marco Paniconi
f075fdc474 Merge "Non-rd speed >=5: Include H/V intra for bsize=16x16." 2015-12-18 17:45:49 +00:00
Peter de Rivaz
7361ef732b Fix for issue 1114 compile error
In 32-bit build with --enable-shared, there is a lot of
register pressure and register src_strideq is reused.
The code needs to use the stack based version of src_stride,
but this doesn't compile when used in an lea instruction.

This patch also fixes a related segmentation fault caused by the
implementation using src_strideq even though it has been
reused.

This patch also fixes the HBD subpel variance tests that fail
when compiled without disable-optimizations.
These failures were caused by local variables in the assembler
routines colliding with the caller's stack frame.

Change-Id: Ice9d4dafdcbdc6038ad5ee7c1c09a8f06deca362
2015-12-18 09:43:22 +00:00
Jian Zhou
789dbb3131 Code clean of sad4xNx4D_sse
Replace MMX with SSE2.

Change-Id: I948ca1be6ed9b8e67f16555e226f1203726b7da6
2015-12-17 17:43:46 -08:00
Jian Zhou
8f8a3b6a78 Merge "Code clean of sad4xN(_avg)_sse" 2015-12-18 01:39:20 +00:00
Marco
c8a2c31ec1 Non-rd speed >=5: Include H/V intra for bsize=16x16.
H/V intra mode was only enabled for bsize < 16x16,
enable it also for bsize=16x16.

Metrics are neutral with this change:
Overall very small gain (0.1%), small visual gain on some RTC clips.

Change-Id: Ib2d7a44382433bfc11cf324aa3cc5c382ea9e088
2015-12-17 17:18:44 -08:00
Johann
91c75c5c23 Remove unused POSIX_MMAP references
Change-Id: I6998e15f9ed2849a270033217c02e27c79ee8343
2015-12-17 17:04:11 -08:00
Johann
3c92144280 Remove unused stdint.h check
https://bugs.chromium.org/p/webm/issues/detail?id=1119

Change-Id: I88891d9f0be29ac6f845d2b470e5735dad16e693
2015-12-17 17:00:19 -08:00
Jian Zhou
b158d9a649 Code clean of sad4xN(_avg)_sse
Replace MMX with SSE2, reduce psadbw ops which may help Silvermont.

Change-Id: Ic7aec15245c9e5b2f3903dc7631f38e60be7c93d
2015-12-17 11:10:42 -08:00
Marco Paniconi
685a6b602b Merge "vp9-svc: Fix to allow for 4x4 variance for low resolutions." 2015-12-16 23:04:26 +00:00
James Zern
a71dcd6f99 Merge "vpxenc: don't warn about libwebm availability if writing IVF." 2015-12-16 22:53:01 +00:00
Marco
f0961498a0 vp9-svc: Fix to allow for 4x4 variance for low resolutions.
Change-Id: I3ec08e10d9ebf6d8b8a03004a320523f926e5cc4
2015-12-16 13:38:41 -08:00
Yaowu Xu
e650129683 Move bit_depth init out of setup_quantization
This also fixes a compiling error under --enable-vp9_highbitdepth.

Change-Id: I9d1dcb95d3336d797eb3c23a4702c30b04355357
2015-12-16 11:43:11 -08:00
Ronald S. Bultje
3977507339 vpxenc: don't warn about libwebm availability if writing IVF.
Change-Id: I1a9635a9948458e6c83f5b58764b7e720d98e2ea
2015-12-16 13:35:59 -05:00
Marco Paniconi
f73a511d37 Merge "Non-rd variance partition: Lower the 64->32 force split threshold." 2015-12-16 16:48:07 +00:00
Marco
26fda00840 Non-rd variance partition: Lower the 64->32 force split threshold.
Change-Id: I837551bdf87197bee8a193353bb31f4cff794787
2015-12-15 17:29:01 -08:00
Yaowu Xu
eace551c87 Merge changes Icf9b57c3,I9e12da84,Idf5ee179
* changes:
  Fixed interval, fixed Q 1 pass test patch.
  1 pass VBR mode bug fix.
  Fixed interval, fixed Q 1 pass test patch.
2015-12-15 17:51:33 +00:00
Marco Paniconi
12084f6d57 Merge "Revert "Add "unknown" status for noise estimation."" 2015-12-15 16:46:06 +00:00
Marco Paniconi
f3e7539c67 Revert "Add "unknown" status for noise estimation."
This reverts commit e15fedb9258251bbb07def57e49e2bd1e0c4c538.

Change-Id: Ibf2bce008c727a9754f88814b7630095fa7b8253
2015-12-15 16:44:40 +00:00
Marco Paniconi
93c0b879d4 Merge "SVC 1 pass mode: Constrain inter mode search within superframe." 2015-12-15 16:25:20 +00:00
Yaowu Xu
9232f69b26 Merge "Fix a enc/dec mismatch under CONFIG_MISC_FIXES" 2015-12-15 16:02:39 +00:00
Paul Wilkins
a5af49331d Merge "1 pass VBR mode bug fix." 2015-12-15 15:50:05 +00:00
paulwilkins
99309004bf Fixed interval, fixed Q 1 pass test patch.
For testing implemented a fixed pattern and delta, 1 pass,
fixed Q, low delay mode.

This has not in any way been tuned or optimized.

Change-Id: Icf9b57c3bb16cc5c0726d5229009212af36eb6d9
2015-12-15 15:33:25 +00:00
paulwilkins
9ce611a764 1 pass VBR mode bug fix.
(copied from VP9)

The one pass VBR mode selects a Q range based on a
moving average of recent Q values. This calculation
should have been excluding arf overlay frames as these
are usually coded at the highest allowed value. Their
inclusion skews the average and can cause it to drift
upwards even when the clip as a whole is undershooting.

As such it can undermine correct adaptation of the allowed
Q range especially for easy content.

Change-Id: I9e12da84e12917e836b6e53ca4dfe4f150b9efb1
2015-12-15 15:02:40 +00:00
paulwilkins
fc50d95b2e Fixed interval, fixed Q 1 pass test patch.
For testing implemented a fixed pattern and delta, 1 pass,
fixed Q, low delay mode.

This has not in any way been tuned or optimized.

Change-Id: Idf5ee179b277fa15d07a97f14f2ce5bbaae80a04
2015-12-15 15:00:38 +00:00
paulwilkins
cea5e1c1e3 1 pass VBR mode bug fix.
The one pass VBR mode selects a Q range based on a
moving average of recent Q values. This calculation
should have been excluding arf overlay frames as these
are usually coded at the highest allowed value. Their
inclusion skews the average and can cause it to drift
upwards even when the clip as a whole is undershooting.

As such it can undermine correct adaptation of the allowed
Q range especially for easy content.

Change-Id: I7d10fe4227262376aa2dc2a7aec0f1fd82bf11f9
2015-12-15 10:27:51 +00:00
Yaowu Xu
c7101830a6 Fix a enc/dec mismatch under CONFIG_MISC_FIXES
The culprit is on the decode side xd->lossless[i] setup was in wrong
location where segment features are not yet decoded.

Also on the encoder side, transform mode was not set consistently
between when tx_mode is selected and how tx_mode is enforced in
tx size selection.

Change-Id: I4c4c32188fda7530cadab9b46d4201f33f7ceca3
2015-12-14 20:56:37 -08:00
James Zern
b81f04a0cc Merge "move vp9_avg to vpx_dsp" 2015-12-15 03:41:22 +00:00
Jacky Chen
b7654afb6b Merge "Add "unknown" status for noise estimation." 2015-12-15 00:41:23 +00:00
jackychen
e15fedb925 Add "unknown" status for noise estimation.
Change-Id: I0fe95332ccfa2e1ad2a01a8e7ddd631289e0f8eb
2015-12-14 15:38:20 -08:00
Marco
c760c33b99 SVC 1 pass mode: Constrain inter mode search within superframe.
Keep track of frame indexes for the references, and
constrain inter mode search for reference with same
temporal alignment.

Improves speed by about ~15%, no noticeable loss in
compression performance.

Change-Id: I5c407a8acca921234060c4fcef4afd7d734201c8
2015-12-14 15:19:29 -08:00
Marco Paniconi
c0c0edd9d7 Merge "Non-rd variance partition: Adjust logic for 32->16 force split." 2015-12-14 22:46:15 +00:00
James Zern
d36659cec7 move vp9_avg to vpx_dsp
Change-Id: I7bc991abea383db1f86c1bb0f2e849837b54d90f
2015-12-14 14:42:12 -08:00
Marco
6f17954f85 Non-rd variance partition: Adjust logic for 32->16 force split.
Lower the threshold for splitting 32x32->16x16 based on average variance,
and add lower bound condition for this split to occur. This prevents
unneccassry splitting for areas with very low variance.

Change-Id: Ibeb33b3d993632c2019f296eb87ef3b7e3568189
2015-12-14 12:54:10 -08:00
Jian Zhou
2404e3290e Merge "Code clean of tm_predictor_32x32" 2015-12-14 17:56:01 +00:00
Marco Paniconi
e19b7df8d3 Merge "Non-rd variance partition: Adjustments to reduce dragging artifact." 2015-12-12 02:59:33 +00:00
Marco
d4440614ae Non-rd variance partition: Adjustments to reduce dragging artifact.
For non-rd variannce partition, speed >= 5:
Adjustments to reduce dragging artifcat of background area near
slow moving boundary.

-Decrease base threshold under low source noise conditions.
-Add condition to split 64x64/32x32 based on average variances
of lower level blocks.

PSNR/SSIM metrics go down ~0.7/0.9% on average on RTC set.
Visually helps to reduce dragging artifact on some rtc clips.

Change-Id: If1f0a1aef1ddacd67464520ca070e167abf82fac
2015-12-11 16:16:02 -08:00
Jian Zhou
6e87880e7f Merge "Speed up tm_predictor_16x16" 2015-12-11 18:55:46 +00:00
Jian Zhou
88120481a4 Code clean of tm_predictor_32x32
Reallocate the xmm register usage so that no ARCH_X86_64 required.
Reduce memory access to the left neighbor by half.
Speed up by single digit on big core machine.

Change-Id: I392515ed8e8aeb02e6a717b3966b1ba13f5be990
2015-12-11 10:32:08 -08:00
Jingning Han
27bbfd652d Fix sub8x8 motion search on scaled reference frame
This commit makes the sub8x8 block rate-distortion optimization
scheme use precise motion compensated prediction to compute the rd
cost. It fixes a potential buffer overflow issue related to sub8x8
motion search on scaled reference frame.

Change-Id: I4274992ef4f54eaacfde60db045e269c13aaa2de
2015-12-11 10:08:51 -08:00
Jian Zhou
62f986265f Merge "SSE2 based h_predictor_32x32" 2015-12-11 18:02:34 +00:00
James Zern
ecb8dff768 Merge "dc_left_pred[48]: fix pic builds" 2015-12-11 02:48:11 +00:00
Jian Zhou
5604924945 Merge "Code clean of dc_left/top_predictor_16x16" 2015-12-11 01:53:44 +00:00
Yaowu Xu
f0bef772be Merge "Proper fix of a msvc complier warning" 2015-12-11 00:53:28 +00:00
Yunqing Wang
be0501c875 Merge "Minor cleanup" 2015-12-11 00:52:03 +00:00
Yaowu Xu
4d2cfeab36 Proper fix of a msvc complier warning
Change-Id: I701ab4993be7cfb15b61a1adbbaf5565bd14ae27
2015-12-10 16:29:01 -08:00
James Zern
40ee78bc19 dc_left_pred[48]: fix pic builds
GET_GOT modifies the stack pointer so the offset for left's address will
be wrong if loaded afterword.

Change-Id: Iff9433aec45f5f6fe1a59ed8080c589bad429536
2015-12-10 15:44:31 -08:00
Yaowu Xu
5a81c5c4be Merge changes Iece22223,Iefad9d8d
* changes:
  Fix two msvc build issues
  Fix enc/dec mismatches for aq-mode 1 and 2
2015-12-10 23:32:32 +00:00
Yunqing Wang
cd08120d62 Minor cleanup
Removed unused GET_GOT_SAVE_ARG.

Change-Id: I0ae41c2d0dcd6d7d1c8dda05062fcdb737fd917d
2015-12-10 15:28:07 -08:00
Yunqing Wang
feeb116c92 Merge "Fix the win32 crash when GET_GOT is not defined" 2015-12-10 23:25:05 +00:00
Jingning Han
72760976a0 Merge "Sync high bit-depth temporal filter" 2015-12-10 22:54:59 +00:00
Yunqing Wang
322ea7ff5b Fix the win32 crash when GET_GOT is not defined
This patch continues to fix the win32 crash issue:
https://bugs.chromium.org/p/webm/issues/detail?id=1105

Johann's patch is here:
https://chromium-review.googlesource.com/#/c/316446/2

Change-Id: I7fe191c717e40df8602e229371321efb0d689375
2015-12-10 14:25:01 -08:00
Yaowu Xu
6786280807 Fix two msvc build issues
Change-Id: Iece22223773dd6d0f87f8f59827705acd2ebe2a4
2015-12-10 12:41:27 -08:00
Jian Zhou
4ec5953080 Code clean of dc_left/top_predictor_16x16
Remove some redundant code.

Change-Id: Ida2e8c0ce28770f7a9545ca014fe792b04295260
2015-12-10 11:59:58 -08:00
Yaowu Xu
221ed5e47b Fix enc/dec mismatches for aq-mode 1 and 2
Change-Id: Iefad9d8d96a08dcc788a5efdca2df6a815d1205f
2015-12-10 11:45:26 -08:00
Jian Zhou
c90a8a1a43 SSE2 based h_predictor_32x32
Relocate the function from SSSE3 to SSE2, Unroll loop from 16 to 8,
and reduce mem access to left.
Speed up by single digit in ./test_intra_pred_speed on big core
machines.

Change-Id: I2b7fc95ffc0c42145be2baca4dc77116dff1c960
2015-12-10 10:09:58 -08:00
Tom Finegan
7f79a83f17 Merge "iosbuild.sh: Support macosx targets in Xcode 7." 2015-12-10 16:45:01 +00:00
Paul Wilkins
449e46958c Merge "Backport temporal filter approach to VP9" 2015-12-10 09:47:25 +00:00
Jingning Han
d3c972403a Sync high bit-depth temporal filter
Change-Id: Ifdcfb91416be8189569f703bee9be253d7b3d9b6
2015-12-09 15:06:36 -08:00
Tom Finegan
acf580d2bb iosbuild.sh: Support macosx targets in Xcode 7.
Xcode 7 refuses to link to x86 and x86_64 code that's built for
iphone sim, so add an extra command line flag that forces iosbuild
to use darwin15 targets.

Change-Id: I2228d458f5cccf4d26866040380a974f88d9d360
2015-12-09 13:52:06 -08:00
Jingning Han
ece4fd5d22 Backport temporal filter approach to VP9
This commit enables the new temporal filter system for VP9. For
speed 1, it improves the compression performance:
derf  0.54%
stdhd 1.62%

Change-Id: I041760044def943e464345223790d4efad70b91e
2015-12-09 13:39:06 -08:00
Johann Koenig
420b9f5bd3 Merge "fix null pointer crash in Win32 because esp register is broken" 2015-12-09 19:31:12 +00:00
Yaowu Xu
74c67e3da3 Merge "Changes to exhaustive motion search." 2015-12-09 15:57:10 +00:00
Jacky Chen
d9bba21306 Merge "Add vp9_avg_4x4_neon and the unit test." 2015-12-09 06:09:33 +00:00
James Zern
3dc19feb29 Merge changes Id3c6cf5c,I7970575e,If3253a87
* changes:
  test.mk: simplify vp8/9 checks
  test.mk: regroup white box tests
  test.mk: enable test_intra_pred_speed unconditionally
2015-12-09 01:39:45 +00:00
James Zern
44fe73ec37 Merge "vp8: fix loop filter level clamping" 2015-12-09 01:38:09 +00:00
James Zern
e040c6c404 Merge "vp8: fix quantizer clamping" 2015-12-09 01:37:58 +00:00
jackychen
303f144eef Add vp9_avg_4x4_neon and the unit test.
Change-Id: I3ef9a9648841374ed3cc865a02053c14ad821a20
2015-12-08 17:23:36 -08:00
Marco Paniconi
835f16ea36 Merge "vp9 denoiser: Re-evaluate mode selection for golden reference." 2015-12-09 00:34:09 +00:00
paulwilkins
4e692bbee2 Changes to exhaustive motion search.
This change has been imported from VP9 and
alters the nature and use of exhaustive motion search.

Firstly any exhaustive search is preceded by a normal step search.
The exhaustive search is only carried out if the distortion resulting
from the step search is above a threshold value.

Secondly the simple +/- 64 exhaustive search is replaced by a
multi stage mesh based search where each stage has a range
and step/interval size. Subsequent stages use the best position from
the previous stage as the center of the search but use a reduced range
and interval size.

For example:
  stage 1: Range +/- 64 interval 4
  stage 2: Range +/- 32 interval 2
  stage 3: Range +/- 15 interval 1

This process, especially when it follows on from a normal step
search, has shown itself to be almost as effective as a full range
exhaustive search with step 1 but greatly lowers the computational
complexity such that it can be used in some cases for speeds 0-2.

This patch also removes a double exhaustive search for sub 8x8 blocks
which also contained  a bug (the two searches used different distortion
metrics).

For best quality in my test animation sequence this patch has almost
no impact on quality but improves encode speed by more than 5X.

Restricted use in good quality speeds 0-2 yields significant quality gains
on the animation test of 0.2 - 0.5 db with only a small impact on encode
speed. On most natural video clips, however, where the step search
is performing well, the quality gain and speed impact are small.

Change-Id: Iac24152ae239f42a246f39ee5f00fe62d193cb98
2015-12-08 16:54:42 +00:00
Jian Zhou
aa5b517a39 Re-enable SSE2 based intra 4x4 prediction
4x4 Intra predictor implemented with MMX is replaced with SSE2.
Segfault in change 315561 when decoding vp8 is taken care of.

Change-Id: I083a7cb4eb8982954c20865160f91ebec777ec76
2015-12-07 18:50:37 -08:00
Scott LaVarnway
c7e557b82c Merge "VP9: Add ssse3 version of vpx_idct32x32_135_add()" 2015-12-07 21:13:35 +00:00
Sergey Kolomenkin
5fc9688792 fix null pointer crash in Win32 because esp register is broken
https://bugs.chromium.org/p/webm/issues/detail?id=1105

Change-Id: I304ea85ea1f6474e26f074dc39dc0748b90d4d3d
2015-12-07 12:57:06 -08:00
Johann Koenig
14ea8848fb Merge "Strip redundant entries from .mailmap" 2015-12-07 18:14:05 +00:00
Johann
9fde1f2ee3 Strip redundant entries from .mailmap
Also prevent them from being reintroduced.

Change-Id: I4e16293c8185462b48e641f066d78449685e2854
2015-12-07 09:03:00 -08:00
paulwilkins
9d85ce8e0c Fix bug when overlaying middle arfs in multi-arf groups.
Fix copied over from VP9 master to VP10 master.
Do not reset the alt ref active flag when overlaying the middle
arf(s) of a multi arf group.

Change-Id: I1b7392107e7c675640d5ee1624012f39cc374c58
2015-12-07 15:23:46 +00:00
James Zern
79a9add666 Revert "MMX in intra 4x4 prediction replaced with SSE2"
This reverts commit 89a1efa4c436c58c101c8b3de866e3014be7d77a.

This causes a segfault when decoding vp8, in both 32 and 64-bit

Change-Id: Idbb9bb28ab897e1d055340497c47b49a12231367
2015-12-05 10:20:39 -08:00
James Zern
a046ba21d8 test.mk: simplify vp8/9 checks
use CONFIG_VP[89] to protect white-box tests and drop redundant
uses of CONFIG_VP9 in variable assignments within that block

Change-Id: Id3c6cf5c7822aa161b19768b295f58829a1c6447
2015-12-04 18:44:45 -08:00
James Zern
2c9c2e0b8b test.mk: regroup white box tests
vp8/9/10/multi-config/unconditional

Change-Id: I7970575e997da0b68c6c54741a221fbba5ad0b08
2015-12-04 18:44:34 -08:00
Marco Paniconi
16a4fab9e2 Merge "Adjust variance threshold based on source noise level." 2015-12-05 00:06:14 +00:00
Angie Chiang
06bdcea606 Merge "comment out range_check of fdct in dct.c" 2015-12-04 23:38:35 +00:00
Marco
d5b3f29f3c Adjust variance threshold based on source noise level.
For non-rd variance partition: Adjust variance threhsold based
on noise level estimate. This change allows the adjustment to be
updated more frequently.

Change-Id: Ie2abf63bf3f1ee54d0bc4ff497298801fdb92b0d
2015-12-04 14:43:39 -08:00
Jian Zhou
589f3c7bc8 Merge changes Ie48229c2,Ib9f18468,I0c90e7c1
* changes:
  Speed up h_predictor_16x16
  Speed up h_predictor_8x8
  MMX in intra 8x8 prediction replaced with SSE2
2015-12-04 21:43:10 +00:00
Jian Zhou
e86c7c863e Speed up h_predictor_16x16
Relocate the function from SSSE3 to SSE2, Unroll loop from 8 to 4,
and reduce mem access to left.
Speed up by >20% in ./test_intra_pred_speed.

Change-Id: Ie48229c2e32404706b722442942c84983bda74cc
2015-12-04 12:12:55 -08:00
Jian Zhou
da3f08fac3 Speed up h_predictor_8x8
Relocate the function from SSSE3 to SSE2, Unroll loop from 4 to 2,
and reduce mem access to left.
Speed up by >20% in ./test_intra_pred_speed.

Change-Id: Ib9f1846819783b6e05e2a310c930eb844b2b4d2e
2015-12-04 11:36:44 -08:00
Marco Paniconi
64e46a033f Merge "Non-rd partition: Use force split on 16x16 for low resolutions." 2015-12-04 19:21:26 +00:00
Angie Chiang
08b157da8e comment out range_check of fdct in dct.c
The range_check is not used because the bit range
in fdct# is not correct. Since we are going to merge in a new version
of fdct# from nextgenv2, we won't fix the incorrect bit range now.

Change-Id: I54f27a6507f27bf475af302b4dbedc71c5385118
2015-12-04 10:54:31 -08:00
Jian Zhou
9f23a9c2e1 Merge "MMX in intra 4x4 prediction replaced with SSE2" 2015-12-04 18:50:58 +00:00
Marco
6490fc71a7 Non-rd partition: Use force split on 16x16 for low resolutions.
For low resolutions, whem 4x4downsample is used for variance,
use the same force split (that is used for 8x8downsample) for 16x16 blocks.

No change in metrics. Small improvement visually.

Change-Id: I915b9895902d0b9a41e75d37fee1bf3714d2366d
2015-12-04 09:24:28 -08:00
Paul Wilkins
2b5baea8fd Merge "Fix bug when overlaying middle arfs in multi-arf groups." 2015-12-04 10:33:55 +00:00
Jian Zhou
aa2764abdd MMX in intra 8x8 prediction replaced with SSE2
8x8 Intra predictor implemented with MMX is replaced with SSE2.

Change-Id: I0c90e7c1e1e6942489ac2bfe58903b728aac7a52
2015-12-03 18:11:06 -08:00
Jian Zhou
89a1efa4c4 MMX in intra 4x4 prediction replaced with SSE2
4x4 Intra predictor implemented with MMX is replaced with SSE2.

Change-Id: Id57da2a7c38832d0356bc998790fc1989d39eafc
2015-12-03 16:40:23 -08:00
Marco Paniconi
6202ce5ada Merge "vp9-noise estimate: Move level setting to a function." 2015-12-04 00:24:49 +00:00
James Zern
2e693eb80e vp8: fix loop filter level clamping
the loop filter level is transmitted as 6-bits + sign so needs to be clamped in
the delta + absolute case.

BUG=https://bugzilla.mozilla.org/show_bug.cgi?id=1224363

Change-Id: Icbdca4fdbf043466429bd5c9d59dbe913bf153bc
2015-12-03 16:18:48 -08:00
James Zern
ff3674a15e vp8: fix quantizer clamping
the quantizer is transmitted as 7-bits + sign so needs to be clamped in
the delta + absolute case.

BUG=https://bugzilla.mozilla.org/show_bug.cgi?id=1224361

Change-Id: I9115f5d1d5cf7e0a1d149d79486d9d17de9b9639
2015-12-03 16:16:28 -08:00
Marco Paniconi
b38a7cd169 Merge "vp9-denoiser: Increase threshold for mode re-evaluation." 2015-12-03 23:52:46 +00:00
Marco
dd998adc7a vp9-denoiser: Increase threshold for mode re-evaluation.
Change-Id: I57a15aec1cb2d6638f5211d30c2c9f15fb62494f
2015-12-03 13:48:35 -08:00
Marco
b12e353424 vp9-noise estimate: Move level setting to a function.
This is so we may update level at any time (e.g., to be used
for setting thresholds in variance-based partition).

Change-Id: I32caad2271b8e03017a531f9ea456a6dbb9d49c7
2015-12-03 13:11:49 -08:00
hui su
5d3327e891 Remove palette from VP10
Store it in nextgenv2 for now.

Change-Id: Iab0af0e15246758e3b6e8bde4a74b13c410576fc
2015-12-03 12:30:47 -08:00
paulwilkins
4a79503b3e Fix bug when overlaying middle arfs in multi-arf groups.
Do not reset the alt ref active flag when overlaying the middle
arf(s) of a multi arf group.

Change-Id: Ia55a55a376973f3fd17161429fd2afb07b4df31f
2015-12-03 15:19:02 +00:00
Jian Zhou
623e988add Merge "SSE2 speed up of h_predictor_4x4" 2015-12-02 18:49:00 +00:00
Scott LaVarnway
f0b0b1fe62 VP9: Add ssse3 version of vpx_idct32x32_135_add()
Change-Id: I9a780131efaad28cf1ad233ae64c5c319a329727
2015-12-02 04:50:46 -08:00
Debargha Mukherjee
f70095076b Fix a spatial svc test crash
Fixes crash in 2pass spatial svc test that was introduced in:
https://chromium-review.googlesource.com/#/c/313571/6

Change-Id: Iab3e8225a8d159cd33f5849dffe6802e25038047
2015-12-01 17:17:51 -08:00
Debargha Mukherjee
7ceba7c26b Fix a spatial svc assert failure
Fixes spatial svc rc assert failure introdcued in:
https://chromium-review.googlesource.com/#/c/312959/1

Change-Id: I6096bfbc484859d71a5fb55e6a3248a31885af61
2015-12-01 14:24:50 -08:00
Debargha Mukherjee
01a2b40e95 Merge "Spatial SVC crash fix" 2015-12-01 21:24:46 +00:00
Debargha Mukherjee
d3409bad9a Fix a spatial svc bug related to scaling
Fixes bug introduced in
https://chromium-review.googlesource.com/#/c/299482/5

Change-Id: If542c1a917380465dd9bc4ce5e32b0adbb20e340
2015-12-01 10:40:59 -08:00
Marco
1abf575f32 vp9 denoiser: Re-evaluate mode selection for golden reference.
Under certain denoising conditons, check for re-evaluation of
zero_last mode if best mode was golden reference.

Change-Id: Ic6cdfd175eef2f7d68606300c7173ab6654b3f6e
2015-12-01 09:39:01 -08:00
Jian Zhou
c7fae5d893 Speed up tm_predictor_16x16
Reduce mem access to left. Speed up by 10% in ./test_intra_pred_speed
with the same instruction size.

Change-Id: Ia33689d62476972cc82ebb06b50415aeccc95d15
2015-11-30 17:46:40 -08:00
Marco
f78b7daec4 Condition use of minmax in variance partition on speed setting.
For non-rd variance partition: only allow minmax computation
(which currently has no arm-neon optimization) for speeds < 8.

Performance loss is small: On RTC set with speed 8, few clips lose ~2/3%,
average loss is < 1%.

Change-Id: Ia9414f4d0b77dc83c3e73ca8de5d903f64b425ce
2015-11-30 17:23:32 -08:00
Scott LaVarnway
2669e05949 Merge "VPX: x86 asm version of vpx_idct32x32_1024_add()" 2015-11-30 23:28:27 +00:00
Marco Paniconi
23831545a0 Merge "vp9 denoiser: Fix to re-evaluate mode selection." 2015-11-30 19:00:39 +00:00
Jian Zhou
9d29d76280 SSE2 speed up of h_predictor_4x4
Relocate h_predictor_4x4 from SSSE3 to SSE2 with XMM registers.
Speed up by ~25% in ./test_intra_pred_speed.

Change-Id: I64e14c13b482a471449be3559bfb0da45cf88d9d
2015-11-30 10:08:05 -08:00
Marco
f1f74a4e6c vp9: Update to noise estimation for denoising.
Change initial state of noise level, and only update
denoiser with noise level when estimate is done.

Change-Id: If44090d29949d3e4927e855d88241634cdb395dc
2015-11-30 10:03:20 -08:00
Marco
ad7e765319 vp9 denoiser: Fix to re-evaluate mode selection.
This fix allows to enable reuse_inter_pred.

Change-Id: I53f2bf1163bb0036ffb6df92117a86debdca11d1
2015-11-30 08:59:10 -08:00
Scott LaVarnway
0148e20c3c VPX: x86 asm version of vpx_idct32x32_1024_add()
Change-Id: I3ba4ede553e068bf116dce59d1317347988b3542
2015-11-25 10:11:29 -08:00
James Zern
1138b986c9 test.mk: enable test_intra_pred_speed unconditionally
vpx_dsp is currently included in all configurations

Change-Id: If3253a87d27f3e1abc94fbfe76f978c1172f3762
2015-11-24 22:29:12 -08:00
Marco Paniconi
610b413d7b Merge "vp9 denoiser: Re-evaluate ZEROMV after denoiser filtering." 2015-11-25 04:24:00 +00:00
Jian Zhou
901d20369a Merge "Speed up tm_predictor_8x8" 2015-11-25 02:34:07 +00:00
James Zern
adb033b57b Merge "configure: simplify x86 asm dependencies" 2015-11-25 02:19:47 +00:00
James Zern
fd51d90159 Merge changes Iaf8cbe95,I6748183d,I2a49811d
* changes:
  add vp9_satd_neon
  fix vp9_satd_sse2
  vp9_satd: return an int
2015-11-25 01:48:53 +00:00
Marco
5b0ddb931d vp9 denoiser: Re-evaluate ZEROMV after denoiser filtering.
For denoising, and for noise level above threshold, re-evaluate
ZEROMV for mode selection after denoising.
Current change only does this check if selected best mode (before denoising)
was intra.

Change-Id: I4b1435b68d26c78f7597b995ee7bff0ddd5f9511
2015-11-24 17:30:32 -08:00
Debargha Mukherjee
e807517a93 Spatial SVC crash fix
Fixes a spatial_svc breakage introduced in
https://chromium-review.googlesource.com/#/c/305228/3.

Change-Id: I7f2cecbdca980addb85d5e58b58b5454f4730ada
2015-11-24 16:40:27 -08:00
Alex Converse
022c848b4d Change highbd variance rounding to prevent negative variance.
Always round sum error and sum square error toward zero in variance
calculations. This prevents variance from becoming negative.
Avoiding rounding variance at all might be better but would be far
more invasive.

Change-Id: Icf24e0e75ff94952fc026ba6a4d26adf8d373f1c
2015-11-24 16:32:01 -08:00
James Zern
eb1d0f8d60 add vp9_satd_neon
~60-65% faster at the function level across block sizes

Change-Id: Iaf8cbe95731c43fdcbf68256e44284ba51a93893
2015-11-24 16:09:10 -08:00
Jian Zhou
f4621c5c8d Speed up tm_predictor_8x8
Left neighbor read from memory only once.
Speed up by ~20% in ./test_intra_pred_speed.

Change-Id: Ia1388630df6fed0dce9a6eeded6cb855bbc43505
2015-11-24 16:07:06 -08:00
Marco
fbd245c598 vp9-denoiser: Fix to reset frame_stats.
zeromv_lastref_sse was not reset.

Change-Id: I23c12e804d63dc7dc18514f6efe71de1d1acbd6a
2015-11-24 15:58:28 -08:00
Marco Paniconi
e99e4a64e0 Merge "vp9 non-rd pickmode: Fix logic in reference masking." 2015-11-24 19:14:35 +00:00
Alex Converse
b84fa548fb Merge "bitreader/writer: Change shift to signed" 2015-11-24 18:33:45 +00:00
Alex Converse
4b038ad2ef Merge "Deduplicate some high bit depth tables" 2015-11-24 18:24:32 +00:00
Marco
eb43c8ebfc vp9 non-rd pickmode: Fix logic in reference masking.
This change makes sure last reference with zero mv
is always checked for mode selection.

No change in metrics.

Change-Id: Iaf01877bf34272b966c78bfe18daad882a0a419e
2015-11-24 10:10:03 -08:00
Scott LaVarnway
b16a164c97 Merge "VPX: Removed unnecessary pmulhrsw in IDCT32X32_34" 2015-11-23 23:37:13 +00:00
Scott LaVarnway
26eb806342 Merge "VP9: Only zero counts when !frame_parallel_decoding_mode (2)" 2015-11-23 23:36:46 +00:00
Scott LaVarnway
2c3b737af6 VP9: Only zero counts when !frame_parallel_decoding_mode (2)
The counts are never used when frame_parallel_decoding_mode
is set.

Change-Id: I293aa68abadcdd30973adacb9f5f5a3aecf8daa2
2015-11-23 14:42:15 -08:00
Marco
b0027b96ae vp9-svc: Fix to allow setting qp-max/min per spatial and temporal layer.
Change-Id: Ic0ec32c1d7f7c08c9f956592dccbfd9060b1f624
2015-11-23 10:46:34 -08:00
Scott LaVarnway
97e6cc6198 VPX: Removed unnecessary pmulhrsw in IDCT32X32_34
and fixed macro name.

Change-Id: I306b98a2b4ec80b130ae80290b4cd9c7a5363311
2015-11-23 10:24:09 -08:00
James Zern
16eba81f69 Revert "Speed up h_predictor_4x4"
This reverts commit d76032ae87e535be5b924d9e88bbd67189380534.

breaks 32-bit builds

Change-Id: If6266ec2a405b5a21d615112f0f37e8a71193858
2015-11-20 22:25:29 -08:00
James Zern
073dc71cd0 Merge "Use Interlocked calls in win32 once() implementation." 2015-11-21 01:40:11 +00:00
James Zern
1b10753ad7 Merge "Speed up h_predictor_4x4" 2015-11-21 01:12:42 +00:00
Marco
131c1600a9 vp9 denoiser: Bias to last reference for temporal filter.
Change-Id: I6a360a12e8da8cdcb8a779647512591612d64f31
2015-11-20 15:38:32 -08:00
James Zern
60760f710f fix vp9_satd_sse2
accumulate satd in 32-bits
+ add unit test

Change-Id: I6748183df3662ddb9d635f9641f9586f2fd38ad5
2015-11-20 14:35:46 -08:00
James Zern
3e0138edb7 vp9_satd: return an int
the final sum may use up to 26 bits

+ add a unit test
+ disable the sse2 as the result will rollover; this will be fixed in a
future commit

Change-Id: I2a49811dfaa06abfd9fa1e1e65ed7cd68e4c97ce
2015-11-20 14:35:38 -08:00
Marco Paniconi
64a60ce3ba Merge "vp9-svc: Fix the setting of is_key_frame." 2015-11-20 18:29:15 +00:00
Alex Converse
612e3c8a0e Merge "Fix a signed shift overflow in vpx_rb_read_inv_signed_literal." 2015-11-20 17:42:05 +00:00
Alex Converse
d37c78819a Merge "Fix unsigned overflow in rd_variance_adjustment." 2015-11-20 17:41:58 +00:00
Marco
80a3e2615a vp9-svc: Fix the setting of is_key_frame.
Change on affects 1 pass CBR.
On key frame, temporal layer_id is reset to 0 for 1 pass CBR,
but since "layer" is reset, the svc.layer_context[layer].is_key_frame
was not correspondingly set properly.

Change-Id: I08f6da0a55ac7429ccfbaddfb7be14479e43543b
2015-11-20 08:51:13 -08:00
Scott LaVarnway
e7fc39fdf5 Merge "VPX: x86 asm version of vpx_idct32x32_34_add()" 2015-11-20 15:11:00 +00:00
Alex Converse
6aa2163b69 bitreader/writer: Change shift to signed
Silences several legal but suspicious unsigned overflows found with
clang -fsanitize=integer.

Change-Id: I69399751492a183167932b0a10751c433c32ca7b
2015-11-19 15:13:39 -08:00
Alex Converse
42b7c44b2f Fix a signed shift overflow in vpx_rb_read_inv_signed_literal.
Found with clang -fsanitize=integer

Change-Id: I17cb2166c06ff463abfaf9b0e6bc749d0d6fdf94
2015-11-19 15:04:20 -08:00
Alex Converse
b1fcd1751e Fix unsigned overflow in rd_variance_adjustment.
Found with clang -fsanitize=integer

Change-Id: I2538e7483cb2d5f06bceecbd3326bdd88bfecfa1
2015-11-19 15:00:59 -08:00
Jian Zhou
d76032ae87 Speed up h_predictor_4x4
Modify h_predictor_4x4 with XMM registers.
Speed up by ~25% in ./test_intra_pred_speed.

Change-Id: Id01c34c48e75b9d56dfc2e93af12cf0c0326a279
2015-11-19 11:34:22 -08:00
Paul Wilkins
f3f6b6fe3e Merge "Changes to best quality settings." 2015-11-19 16:13:43 +00:00
Jian Zhou
4993158ee5 Merge "Speed up tm_predictor_4x4" 2015-11-19 02:32:48 +00:00
Jian Zhou
79b68626ae Speed up tm_predictor_4x4
tm_predictor_4x4 is implemented with SSE2 using XMM registers.
Speed up by ~25% in ./test_intra_pred_speed.

Change-Id: I25074b78d476a2cb17f81cf654bdfd80df2070e0
2015-11-18 16:44:25 -08:00
Marco
eed5494fc6 vp9-svc: Fix to key frame counter for spatial layers.
Existing condition only applied to temporal layers.

Change-Id: Icef20a59d0afc61d4e14dea01aff4786fa9e41ae
2015-11-18 14:31:37 -08:00
Paul Wilkins
85aea16f17 Merge "Changes to exhaustive motion search." 2015-11-18 11:10:13 +00:00
Scott LaVarnway
ed833048c2 VPX: x86 asm version of vpx_idct32x32_34_add()
Change-Id: Ic81f38998fb1b8d33f5a5d7424c2c41002786cef
2015-11-17 17:42:24 -08:00
James Zern
6e6dbbc67d configure: simplify x86 asm dependencies
--disable-XXX has the effect of disabling all extensions above it, e.g.,
--disable-ssse3 disables ssse3-avx2.

Change-Id: If02b44ca71ee12e4acb12010db8593a7989f2a9d
2015-11-17 16:15:57 -08:00
Zoe Liu
8a782c7eac Fixed a few sanity checks.
Change-Id: Ieec4a7be5945dc6de192e2d8292ab978baf47f53
(cherry picked from commit 2096296421c7fa56abb49470c0fbe7c4337b8a71)
2015-11-17 22:54:03 +00:00
paulwilkins
8ba98516fd Changes to best quality settings.
Small changes to the best quality default speed trade off.
Some speedup settings are worth while even for best quality as they
have only a very small impact on quality but a significant impact on
encode time.

These changes give as much as a further 50-60% increase in encode
speed for my test animations clip with minimal impact on quality.

For this sequence these changes improve the best quality encode  speed
to about the same level as good quality speed 0 in Q3 2015 whilst
retaining the large quality gain of over 1 db

For many natural videos though the quality difference from good 0
to best is much smaller.

Change-Id: I28b3840009d77e129817a78a7c41e29cb03e1132
2015-11-17 16:20:20 +00:00
jackychen
204cde580a Enable resize test(down&up) by changing the bitrate.
Change-Id: I5a4f1f7b9de20fbfc28cb743dcd29c0eeca736f8
2015-11-13 16:46:00 -08:00
Ralph Giles
2635573a7f Use Interlocked calls in win32 once() implementation.
This is simpler than the previous scheme, which tried to allocate
the CRITICAL_SECTION struct in a thread-safe manner before it
could use it to run the wrapped function in a thread-safe manner.

Change-Id: I172e5544e5f16403a3a0e5e2b9104b1292a0d786
2015-11-13 13:04:36 -08:00
Marco
988fd77c1f Reduce sampling time for noise estimate.
Change-Id: I46abd85e2187b8f4c2846416a23fab26d9b9f67d
2015-11-13 08:11:30 -08:00
Marco
006fd19246 Fix resize internal test.
Temporary fix to make sure it always passes.

Change-Id: I56a0529986ad7049b6090f871c14e9e06d573d5f
2015-11-13 06:22:27 -08:00
Marco Paniconi
5f5d185d01 Merge "VP9 noise estimation: add frame level motion metrics and adjust thresholds." 2015-11-13 14:09:19 +00:00
paulwilkins
0149fb3d6b Changes to exhaustive motion search.
This change alters the nature and use of exhaustive motion search.

Firstly any exhaustive search is preceded by a normal step search.
The exhaustive search is only carried out if the distortion resulting
from the step search is above a threshold value.

Secondly the simple +/- 64 exhaustive search is replaced by a
multi stage mesh based search where each stage has a range
and step/interval size. Subsequent stages use the best position from
the previous stage as the center of the search but use a reduced range
and interval size.

For example:
  stage 1: Range +/- 64 interval 4
  stage 2: Range +/- 32 interval 2
  stage 3: Range +/- 15 interval 1

This process, especially when it follows on from a normal step
search, has shown itself to be almost as effective as a full range
exhaustive search with step 1 but greatly lowers the computational
complexity such that it can be used in some cases for speeds 0-2.

This patch also removes a double exhaustive search for sub 8x8 blocks
which also contained  a bug (the two searches used different distortion
metrics).

For best quality in my test animation sequence this patch has almost
no impact on quality but improves encode speed by more than 5X.

Restricted use in good quality speeds 0-2 yields significant quality gains
on the animation test of 0.2 - 0.5 db with only a small impact on encode
speed. On most clips though the quality gain and speed impact are small.

Change-Id: Id22967a840e996e1db273f6ac4ff03f4f52d49aa
2015-11-13 10:16:31 +00:00
JackyChen
6fb3d6db99 VP9 noise estimation: add frame level motion metrics and adjust thresholds.
Change-Id: Ia1aba00603b32cee6835951d3d8f740937cf20f4
2015-11-12 23:41:42 -08:00
James Zern
7501728327 Merge "libs.mk, testdata: rm redundant test of LIBVPX_TEST_DATA" 2015-11-13 06:49:00 +00:00
James Zern
34159b72d9 Merge "Add AVX vectorized vp9_diamond_search_sad" 2015-11-13 06:29:20 +00:00
Marco
419da5c734 Adjust variance threshold for 16x16 split at low resolutions.
Change-Id: I635e37f81237e9703d7d9a11ed76a043f4ec6eb0
2015-11-12 17:58:31 -08:00
Marco Paniconi
866c9357c2 Revert "Update to noise estimation."
This reverts commit 6b79a1e3e0dfc265f43445b8181aa95e1c02deac.

Change-Id: I5a4923ca8a6de842855ce0725e92567ccbed6fb7
2015-11-13 00:13:32 +00:00
Marco
6b79a1e3e0 Update to noise estimation.
Add frame level global check and adjust some parameters.

Change-Id: I42103394f2d329781195d94ce6cbb5b3383eea17
2015-11-12 09:18:35 -08:00
Marco Paniconi
1b63238b67 Merge "Non-rd partition: reduce variance threshold low resolutions." 2015-11-12 06:08:38 +00:00
Marco Paniconi
0941ff72a0 Merge "Adjust varianace threshold for high noise condition." 2015-11-12 06:06:51 +00:00
Marco
384fc5e381 Adjust motion threshold to limit cyclic refresh.
Change-Id: Icfca27a567eb8929c312c6315856ee130d982a04
2015-11-11 18:22:21 -08:00
Marco
1827764450 Adjust varianace threshold for high noise condition.
Change-Id: I91c722e480328ff95b8c57614d8176ccaceb2539
2015-11-11 18:06:21 -08:00
Marco Paniconi
4d38dbdfb5 Merge "vp9 denoiser: Add another noise level to denoising." 2015-11-11 20:40:29 +00:00
James Zern
9ecb99abf0 Merge "Revert "VPX: x86 asm version of vpx_idct32x32_34_add()"" 2015-11-11 20:39:12 +00:00
Marco
ff32369804 vp9 denoiser: Add another noise level to denoising.
Change-Id: Idc755ab54e4f78bb7d75bc97634c451804edad99
2015-11-11 11:21:26 -08:00
James Zern
0ccad4d649 Revert "VPX: x86 asm version of vpx_idct32x32_34_add()"
This reverts commit 9aeaa2016e7470c4e316d90da33d883098eed6f4.

This causes some test vectors to fail.

Change-Id: I3659a2068404ec5a0591fba5c88b1bec0c9059a4
2015-11-11 11:12:38 -08:00
James Zern
8f7bc45b5b Revert "VP9: Only zero counts when !frame_parallel_decoding_mode"
This reverts commit 380a5519cca999f54b17f37b709996a11f3204ea.

This causes an assertion failure in debug_check_frame_counts() which
probably isn't valid with this change; leaving the investigation for
later now.

Change-Id: Ieda5ca811ed2fa50a0cc6935919a8d10dca996e0
2015-11-11 11:11:00 -08:00
Geza Lore
5eefd3ebfd Add AVX vectorized vp9_diamond_search_sad
This function now has an AVX intrinsics version which is about 80%
faster compared to the C implementation. This provides a 2-4% total
speed-up for encode, depending on encoding parameters. The function
utilizes 3 properties of the cost function lookup table, constructed
in 'cal_nmvjointsadcost' and 'cal_nmvsadcosts'.
For the joint cost:
  - mvjointsadcost[1] == mvjointsadcost[2] == mvjointsadcost[3]
For the component costs:
  - For all i: mvsadcost[0][i] == mvsadcost[1][i]
        (equal per component cost)
  - For all i: mvsadcost[0][i] == mvsadcost[0][-i]
        (Cost function is even)
These must hold, otherwise the AVX version of the function cannot be used.

Change-Id: I6c2791d43022822a9e6ab43cd124a773946d0bdc
2015-11-11 14:03:47 +00:00
James Zern
ec45003a8f libs.mk, testdata: rm redundant test of LIBVPX_TEST_DATA
the return value of enabled, which may be empty, is handled by the for
loop. this avoids making an unnecessarily long command line which may
fail in certain cases.

Change-Id: Ib88ecbbe2c0f6d7debb600b4caed4884497263b1
2015-11-10 17:54:51 -08:00
Marco
064a9eca49 Non-rd partition: reduce variance threshold low resolutions.
Change-Id: I06306905d187948a92f839357df5d21413823808
2015-11-10 15:42:58 -08:00
Marco Paniconi
79a194692f Merge "Add bias to zero/small motion for noisy source." 2015-11-10 23:10:31 +00:00
James Zern
e3efed7f4c Merge "convolve_copy_sse2: replace SSE w/SSE2 code" 2015-11-10 22:35:12 +00:00
Scott LaVarnway
f48321974b Merge "VPX: x86 asm version of vpx_idct32x32_34_add()" 2015-11-10 21:40:11 +00:00
Scott LaVarnway
9aeaa2016e VPX: x86 asm version of vpx_idct32x32_34_add()
Change-Id: I8a933c63b7fbf3c65e2c06dbdca9646cadd0b7cb
2015-11-10 11:54:56 -08:00
Marco
bd6bf25969 Add bias to zero/small motion for noisy source.
Change is only for real-time mode, speed >= 5, and non-screen content mode.
Add bias to zero/low motion for big blocks, if noise estimation
is enabled and noise level is above threshold.

Change-Id: I3a0a4608ede6aa535bda6eca528d20f8aba738e7
2015-11-10 11:23:40 -08:00
James Zern
40dab58941 convolve_copy_sse2: replace SSE w/SSE2 code
this should be neutral or slightly faster on modern (P4+) architectures

Change-Id: Iec4c080275941eb8c9e05a66a2daf0405d86a69b
2015-11-09 23:45:16 -08:00
JackyChen
19272d866b VP9 noise estimate: no noise estimate if frame size change.
Change-Id: I521f7b53c143d562a88fe7de330aa3f0ef09f414
2015-11-09 19:18:29 -08:00
Jacky Chen
394d6c122a Merge "VP9: add unit test for realtime external resize." 2015-11-10 03:05:30 +00:00
Johann
f937114402 Merge branch 'javanwhistlingduck'
Change-Id: Ib63fde31ae7b3f71e608830f7433113733b2a275
2015-11-09 17:00:37 -08:00
jackychen
55c8843791 VP9: add unit test for realtime external resize.
Change-Id: I9bfa80de73847d9be88b6ce9865d7bb5fafaaa57
2015-11-09 16:48:18 -08:00
Jacky Chen
7155f7ab78 Merge "VP9 dynamic resize: enable resize unit test(DownUp)." 2015-11-09 22:54:53 +00:00
James Zern
e1fbc886e1 Merge "VP9: Only zero counts when !frame_parallel_decoding_mode" 2015-11-09 22:23:34 +00:00
Johann
cbecf57f3e Release v1.5.0
Javan Whistling Duck release.

Change-Id: If44c9ca16a8188b68759325fbacc771365cb4af8
2015-11-09 14:12:38 -08:00
jackychen
0465aa45ea VP9 dynamic resize: enable resize unit test(DownUp).
The unit test requires a longer clip which is already in the repo.

Change-Id: Ic42e8d83e636fafd20d485a7f5f8422835319245
2015-11-09 14:04:58 -08:00
Marco Paniconi
cdec99b243 Merge "VP9 dynamic resize: increase waiting time after key frame." 2015-11-09 21:11:51 +00:00
jackychen
3c9a424e6e VP9 dynamic resize: increase waiting time after key frame.
For 1 pass CBR mode: increase waiting time after key frame
before we start sampling rate control behavior for determining
resize. This change need to disable one internal resize(DownUp)
temporally since it requires a longer clip to do so.

Change-Id: If21beda1be23f169ee541ab4dd642f718347887a
2015-11-09 12:04:00 -08:00
Marco Paniconi
498fd551fd Merge "Use same bias (against non-zero mv for big blocks) for speed 5." 2015-11-09 19:29:35 +00:00
Alex Converse
d1a7c10325 Merge "Expand unconstrained nodes in pack_mb_tokens and loop on zeros." 2015-11-09 18:27:40 +00:00
Scott LaVarnway
380a5519cc VP9: Only zero counts when !frame_parallel_decoding_mode
The counts are never used when frame_parallel_decoding_mode
is set.

Change-Id: Ic7a566a048297f7373c9ffbb48929ea09eff674f
2015-11-09 10:14:13 -08:00
Marco
718654848a Use same bias (against non-zero mv for big blocks) for speed 5.
Use same setting for speed 5 (as it is for speed > 5).
Change is only for real-time (non-rd) mode.

Change-Id: I830250eac654328373cb318baa89d4f0e63942e1
2015-11-09 10:09:51 -08:00
James Zern
420e8d6d03 Merge changes I8c83b86d,Ic53b2ed5,I4acc8a84
* changes:
  variance_test: create fn pointers w/'&' ref
  sixtap_predict_test: create fn pointers w/'&' ref
  sad_test: create fn pointers w/'&' ref
2015-11-07 00:57:06 +00:00
Hui Su
908fbabe4e Merge "Use accurate bit cost for uv_mode in UV intra mode RD selection" 2015-11-07 00:22:50 +00:00
Alex Converse
70eb870cfe Expand unconstrained nodes in pack_mb_tokens and loop on zeros.
Reduces Linux perf estimated cycle count for pack_mb_tokens on a
lossless encode on my desktop from 61858501855 to 48154040219 or from
26% of the overall profile to 21%.

Change-Id: I9ca3426d7e3272bc7f7030abda4f0d0cec87fb4a
2015-11-06 16:00:10 -08:00
hui su
6ab6ac450b Use accurate bit cost for uv_mode in UV intra mode RD selection
On derflr, +0.1% for VP10; however, -0.03% on VP9.

Change-Id: I09c724232ede74254043d61d3cadc506256af0af
2015-11-06 14:45:43 -08:00
James Zern
eba14ddbe7 Merge "Revert "Add AVX vectorized vp9_diamond_search_sad"" 2015-11-06 22:37:20 +00:00
James Zern
30466f26b4 Revert "Add AVX vectorized vp9_diamond_search_sad"
This reverts commit f1342a7b070ef61b9fbdf03e899ac2107cfcb6bd.

This breaks 32-bit builds:
 runtime error: load of misaligned address 0xf72fdd48 for type 'const
__m128i' (vector of 2 'long long' values), which requires 16 byte
alignment

+ _mm_set1_epi64x is incompatible with some versions of visual studio

Change-Id: I6f6fc3c11403344cef78d1c432cdc9147e5c1673
2015-11-06 13:15:01 -08:00
James Zern
837cea40fc variance_test: create fn pointers w/'&' ref
this helps some toolchains (vs9) resolve the type of the parameter

Change-Id: I8c83b86da53b1783cd18c0f765b67ba33da91d72
2015-11-06 11:04:11 -08:00
James Zern
ab5ce2e5ae sixtap_predict_test: create fn pointers w/'&' ref
this helps some toolchains (vs9) resolve the type of the parameter

Change-Id: Ic53b2ed5fbce05c5b5e633b4a4ef9ea75c55360a
2015-11-06 11:04:10 -08:00
Marco
5f041c01ed vp9: Disable noise estimate on resize trigger frame.
Change-Id: I35767a6320943582ee11d737b5f240cea2d01b25
2015-11-06 08:42:09 -08:00
James Zern
91606bbbe6 sad_test: create fn pointers w/'&' ref
this helps some toolchains (vs9) resolve the type of the parameter

Change-Id: I4acc8a844d1e55b766f66482bd6d32998174d70f
2015-11-05 23:53:24 -08:00
Marco Paniconi
d7bbe1a210 Merge "vp9: Updates to noise estimation." 2015-11-06 06:51:11 +00:00
Marco
1c724d01aa vp9: Updates to noise estimation.
Add threshold/condition on spatial_variance and brightness level.
Modification to normalization of block variance.
Change resolution limit below which we disable noise estimation.

Change-Id: If5be08a26ceda351242d8a58d2f0bc88c0a918f0
2015-11-05 18:19:01 -08:00
James Zern
892130f75b vp9_spatial_svc_encoder.sh: fix command line param
-l -> -sl, renamed in:
be3b08d [svc] Temporal svc with two pass rate control

Change-Id: I5a7b179b33d94e20e54825090659156dece928c0
2015-11-05 15:22:39 -08:00
Yunqing Wang
57cae22c1e Merge "Add AVX vectorized vp9_diamond_search_sad" 2015-11-05 20:17:13 +00:00
Geza Lore
f1342a7b07 Add AVX vectorized vp9_diamond_search_sad
This function now has an AVX intrinsics version which is about 80%
faster compared to the C implementation. This provides a 2-4% total
speed-up for encode, depending on encoding parameters. The function
utilizes 3 properties of the cost function lookup table, constructed
in 'cal_nmvjointsadcost' and 'cal_nmvsadcosts'.
For the joint cost:
  - mvjointsadcost[1] == mvjointsadcost[2] == mvjointsadcost[3]
For the component costs:
  - For all i: mvsadcost[0][i] == mvsadcost[1][i]
        (equal per component cost)
  - For all i: mvsadcost[0][i] == mvsadcost[0][-i]
        (Cost function is even)
These must hold, otherwise the AVX version of the function cannot be used.

Change-Id: I184055b864c5a2dc37b2d8c5c9012eb801e9daf6
2015-11-05 10:02:17 +00:00
Marco Paniconi
c6641709a7 Merge "Bias against non-zero mv for large blocks." 2015-11-04 00:01:23 +00:00
Alex Converse
246e0eaa71 Deduplicate some high bit depth tables
Change-Id: I6977f7d155cc1e81ae2393933893caac6770821f
2015-11-03 15:40:44 -08:00
Marco
04a99cb36b Bias against non-zero mv for large blocks.
Change is only for real-time mode, speed > 5, and non-screen content mode.
Bias is based on block size and motion vector level (motion above some threshold).

Helps to improves stability in background from lightning changes.
PSNR/SSIM metrics on RTC set almost no change/neutral (within +/- 0.1).

Change-Id: I7eac13c1ae10be4ab1f40acc7f9f1df5653ece9d
2015-11-03 14:51:56 -08:00
Marco Paniconi
17534d2918 Merge "Update to encoder_breakout_test, for non-rd mode." 2015-11-03 22:40:53 +00:00
Yaowu Xu
5ff1008ed9 Merge "Fix a msvc warning" 2015-11-03 21:56:25 +00:00
Hui Su
3cbe767972 Merge "Generate intra prediction reference values only when necessary" 2015-11-03 20:55:14 +00:00
Marco Paniconi
73372cc09a Merge "Adjust threshold for datarate frame drop test." 2015-11-03 19:54:52 +00:00
Marco
9a7785b9d6 Update to encoder_breakout_test, for non-rd mode.
Only use non-zero threshold(s) for breakout if
the motion level of the current tested mode is low.

Change-Id: I22aae961cc42371b49d3f648560181cc54708502
2015-11-03 11:49:44 -08:00
Yaowu Xu
87e08f4d9f Fix a msvc warning
Change-Id: Id5b8f597fb275395232559fea7bfeb56912b88a1
2015-11-03 11:22:58 -08:00
Alex Converse
255bcf8697 Merge "misc fixes: Remove a wasted value." 2015-11-03 17:52:34 +00:00
Alex Converse
1796d1cc77 Merge "Add target for Mac OS X 10.11 'El Capitan'" 2015-11-03 17:50:34 +00:00
Marco
cb7b2a4f4b Adjust threshold for datarate frame drop test.
Current threshold is little too strict.

Change-Id: I99ec1409d095e0c2fd3b7ab398742cabcc05700b
2015-11-03 08:17:21 -08:00
Jacky Chen
d73e6cef75 Merge "vpx_scale: fix the issue in msan test." 2015-11-02 23:37:23 +00:00
Alex Converse
080ad919df Add target for Mac OS X 10.11 'El Capitan'
Change-Id: I174f5b41be384894e41b8e2926cbf8fd0f8e21b2
2015-11-02 14:35:57 -08:00
Marco Paniconi
61f240c288 Merge "Move noise level estimate outside denoiser." 2015-11-02 22:08:01 +00:00
jackychen
fcb464671c vpx_scale: fix the issue in msan test.
Do memset to fix msan issue due to the access of uninitialized
memory.

BUG=https://code.google.com/p/chromium/issues/detail?id=549155

Change-Id: I02f995ede79e3574e72587cc078df1a0d11af002
2015-11-02 12:36:10 -08:00
Marco
c7da053d4b Move noise level estimate outside denoiser.
Source noise level estimate is also useful for
setting variance encoder parameters (variance thresholds,
qp-delta, mode selection, etc), so allow it to be used also
if denoising is not on.

Change-Id: I4fe23d47607b4e17a35287057f489c29114beed1
2015-11-02 12:15:26 -08:00
hui su
16bf821dfc Move palette-based intra prediction out of misc-fixes
Change-Id: Ia59724413c4a4831390119a33d40a7d713b4b69f
2015-11-02 11:11:25 -08:00
hui su
e085fb643f Generate intra prediction reference values only when necessary
This can help increase encoding speed substantially.

Change-Id: Id0c009146e6e74d9365add71c7b10b9a57a84676
2015-11-02 10:26:50 -08:00
Marco
c2f6a7df8d vp9 denoiser: Don't estimate noise on resized trigger frame.
Change-Id: I60461f011d1aba0b1eb6584c6940f745221915f4
2015-11-02 09:11:35 -08:00
James Zern
bc98bf65e8 vp9_dx_iface: move struct defs to separate header
this avoids redefining vpx_codec_vp9_dx, vpx_codec_vp9_dx_algo in
vp9_encoder_parms_get_to_decoder.cc

Change-Id: I3b89e7a62497227ee32419f1a7d30e4c10a13c05
(cherry picked from commit ca163b85bb13fc07df3e1be60d4e4b71c8e83090)
2015-10-31 12:23:53 -07:00
James Zern
8f9c9ab5c9 vp9_decodeframe.h: add missing include
Change-Id: I8ef772a016a79cab88bee8e9739530aa030baaa9
(cherry picked from commit 68ecfc1e62408800611ed96c37949d65b7f25cf7)
2015-10-31 12:23:53 -07:00
Debargha Mukherjee
9cafc46d9e Merge "Convert motion search config from AoS to SoA" 2015-10-30 20:57:10 +00:00
James Zern
082434b274 Merge changes I3b89e7a6,I8ef772a0
* changes:
  vp9_dx_iface: move struct defs to separate header
  vp9_decodeframe.h: add missing include
2015-10-30 05:50:58 +00:00
James Zern
ca163b85bb vp9_dx_iface: move struct defs to separate header
this avoids redefining vpx_codec_vp9_dx, vpx_codec_vp9_dx_algo in
vp9_encoder_parms_get_to_decoder.cc

Change-Id: I3b89e7a62497227ee32419f1a7d30e4c10a13c05
2015-10-29 17:55:35 -07:00
Alex Converse
d2967221d2 Merge "Make the zero handling in extend_to_full_distribution more explicit." 2015-10-30 00:37:33 +00:00
James Zern
68ecfc1e62 vp9_decodeframe.h: add missing include
Change-Id: I8ef772a016a79cab88bee8e9739530aa030baaa9
2015-10-29 16:41:25 -07:00
hui su
ede323a119 Specify feasible parameter values for lossless mode
Change-Id: I53d9719dcb81fa83fe3c920a552db5a0f1cacefa
2015-10-29 16:07:55 -07:00
Alex Converse
989193c797 Make the zero handling in extend_to_full_distribution more explicit.
The old workaround "p = 0 ? 0 : p -1" is misleading.

?: happens before =
assigning back to p truncates to one byte.

Therefore it is equivalent to (p - 1) & 0xFF, but the check just exists
to work around a first pass bug, so let's make the work around more
clear.

https://bugs.chromium.org/p/webm/issues/detail?id=1089

Change-Id: I587c44dd61c1f3767543c0126376f881889935af
2015-10-29 14:46:55 -07:00
Jacky Chen
039f241fc2 Merge "VP9_resizing: add limitation to the downsacling resolution." 2015-10-29 21:00:36 +00:00
Alex Converse
6f229b3e62 Merge "Shrink probability remap tables." 2015-10-29 19:58:24 +00:00
jackychen
dba2d5b3f3 VP9_resizing: add limitation to the downsacling resolution.
Width and height of downscaling resolution should not be lower
than min_width and min_height which can be set as needed, both
are 180 for now.

Change-Id: I34d06704ea51affbdd814246e22ee8d41d991f00
2015-10-29 09:42:44 -07:00
Jacky Chen
487023e94e Merge "VP9 decoder: Add more test vectors for resizing." 2015-10-29 16:00:15 +00:00
Marco
9cb73659d5 Update to vp9_spatial_svc_encoder.
Some fixes for rate control stats and bypass mode.

Change-Id: I28bed5467a681b8867cca55852d5d3a25d850f39
2015-10-29 08:21:10 -07:00
jackychen
d464e8a462 VP9 decoder: Add more test vectors for resizing.
Refer to doc "vp9-test-vectors".

BUG=https://code.google.com/p/webm/issues/detail?id=1086

Change-Id: I523d1f39141a3a86f113604cbdb9cd41cc2d6470
2015-10-28 21:26:00 -07:00
Marco Paniconi
9645cd4826 Merge "VP9-SVC: Allow frame dropping due to overshoot for spatial layers." 2015-10-28 21:59:17 +00:00
Alex Converse
e765969971 Merge "Revert "Replace the zero handling in extend_to_full_distribution."" 2015-10-28 20:48:52 +00:00
Johann Koenig
bb0bc06fa5 Merge "Skip AS detection when using --enable-external-build" 2015-10-28 19:18:49 +00:00
Johann Koenig
6f498956e5 Merge "Only set sysroot when alt_libc finds a directory" 2015-10-28 19:16:42 +00:00
Alex Converse
663960e757 Revert "Replace the zero handling in extend_to_full_distribution."
This reverts commit 7f56cb29787b187c8cb1b778918ca3b80184c804.

It causes uninitialized reads in the first pass setting up later cost tables.

Change-Id: I2df498df3f5c03eff359f79edf045aed0c618dc9
2015-10-28 11:51:40 -07:00
Hangyu Kuang
bd45af8bbb Add more resize test videos that with larger resolution change intervals.
These videos change resolution every 10 frames versus every 3 frames in current
test sets.

Change-Id: Ic33f449fc9b6d2f480825d4715b8f63e70801232
2015-10-28 10:57:30 -07:00
Geza Lore
965a8dea0b Convert motion search config from AoS to SoA
This is a prerequisite for vectorizing vp9_diamond_search_sad_c.

Change-Id: I49cd9148782410ca8b16e8a468ca9e7c6d088410
2015-10-28 15:30:43 +00:00
Hangyu Kuang
f5f19a1fbd Merge "Add several new test vectors with small resolution." 2015-10-28 15:04:25 +00:00
Hangyu Kuang
0771a30e9e Add several new test vectors with small resolution.
Change-Id: I70b1b8162a0c9b8501358ba7d32fecd1dc020ab5
2015-10-27 17:46:48 -07:00
Marco
823a47ee3b Update to vp9-denoising.
Set increase_denoising parameter for temporal filter.

Change-Id: Id98bf160db98dfa9aedf76e20b43e6f7c783fb1c
2015-10-27 15:52:56 -07:00
Johann
a6f70b42b6 Only set sysroot when alt_libc finds a directory
Change-Id: Idc0a9adb4fb371272d6c8c98737f66c6cf209e37
2015-10-27 15:38:47 -07:00
Marco
4fb2ba2861 VP9-SVC: Allow frame dropping due to overshoot for spatial layers.
For 1 pass CBR mode.

Change-Id: I8bceb489a850ec26f05382eecb5c0c32a1bb8883
2015-10-27 14:51:47 -07:00
Alex Converse
0f059d6d65 misc fixes: Remove a wasted value.
Remove delta index 254 from probability remapping and subexp coding.
Saves 1-bit when the delta index is 129.

Change-Id: I88aba565fc766b1769165be458d2efd3ce45817e
2015-10-27 12:10:25 -07:00
Marco Paniconi
2de14eb942 Merge "Adjustments to vp9-denoising." 2015-10-27 19:10:01 +00:00
Alex Converse
a736bf6bfb Shrink probability remap tables.
Saves 2288 bytes in vp8+vp9 libvpx.a.

Change-Id: Iaa5712e59a9693ed58cea63de63781a96827e44e
2015-10-27 12:08:23 -07:00
Marco
8a2fc54508 Adjustments to vp9-denoising.
Adjust variance threshold, delta-qp, and intra penalty cost,
based on estimated noise level in source.

Replace denoising_on with a level value=L/M/H.

Change-Id: I0c017dae75a5d897367d2c42dec26f2f37e447c1
2015-10-27 10:44:19 -07:00
Yaowu Xu
c1b2d416d7 Merge "Reorder code to be consistent accross branches" 2015-10-27 17:07:50 +00:00
Alex Converse
89d10d8f3f Merge "Replace the zero handling in extend_to_full_distribution." 2015-10-27 16:54:49 +00:00
Yaowu Xu
9d8bde85cb Reorder code to be consistent accross branches
This is to make future merge a bit easier.

Change-Id: I1039de381d8fe7b9988b57c23d15d0cb5f2fcd32
2015-10-27 09:04:40 -07:00
Alex Converse
811be0df3a Fix VS build.
Add a cast on a double to unsigned assignment.

Change-Id: I4abce7cfa13e145ed0c71469844ac9b274aa1411
2015-10-26 23:13:03 -07:00
Johann
12f26bf0bc Skip AS detection when using --enable-external-build
The option exists specifically to allow for configurations
where the build environment is different from the configure
environment.

Change-Id: I95196fa3c49700251d10ff5d256dc7380e39d0c4
2015-10-26 16:43:59 -07:00
Marco Paniconi
dc9d36c0a6 Merge "Code cleanup for vp9-denoiser." 2015-10-26 20:52:16 +00:00
Paul Wilkins
cce3982c48 Merge "Incorrect frame used in KF boost loop." 2015-10-26 19:12:34 +00:00
Paul Wilkins
26abc15e04 Merge "Bug in clamping of base_frame_target." 2015-10-26 19:12:08 +00:00
Marco
f2845ed83c Code cleanup for vp9-denoiser.
Change-Id: Ibb573f50c4bf2cfb382b589803f3363db0ac1285
2015-10-26 12:04:54 -07:00
Alex Converse
7f56cb2978 Replace the zero handling in extend_to_full_distribution.
The old workaround "p = 0 ? 0 : p -1" is misleading.

?: happens before =
assigning back to p truncates to one byte.

Therefore it is equivalent to (p - 1) & 0xFF, but the check just exists
to work around a first pass bug, so let's make the work around more
clear.

https://code.google.com/p/webm/issues/detail?id=1089

Change-Id: Ia6dcc8922e1acbac0eeca23a4d564a355c489572
2015-10-26 11:29:46 -07:00
Debargha Mukherjee
65dd056e41 Merge "Optimize vpx_quantize_{b,b_32x32} assembler." 2015-10-26 18:04:49 +00:00
Debargha Mukherjee
35cae7f1b3 Merge "Optimize vp9_highbd_block_error_8bit assembly." 2015-10-26 18:03:46 +00:00
Alex Converse
e34c7e3f59 Merge "palette: Replace rand() call with custom LCG." 2015-10-26 17:05:00 +00:00
Jingning Han
e1a056e163 Merge "Use explicit block position in foreach_transformed_block" 2015-10-26 16:25:56 +00:00
Alex Converse
171fd8999f palette: Replace rand() call with custom LCG.
The custom LCG is based on the POSIX recommend constants for a 16-bit
rand(). This implementation uses less computation than typical standard
library procedures which have been extended for 32-bit support, is
guaranteed to be reentrant, and identical everywhere.

Change-Id: I3140bbd566f44ab820d131c584a5d4ec6134c5a0
Ref: http://pubs.opengroup.org/onlinepubs/9699919799/functions/rand.html
2015-10-24 13:38:23 -07:00
Paul Wilkins
762c0f2264 Bug in clamping of base_frame_target.
Bug relating to issue:- http://b/25090786

base_frame_target is supposed to track the idealized bit
allocation based on error score and not the actual bits
allocated to each frame.

The clamping of this value based on the VBR min and max pct values
was causing a bug where in some cases the loop that adjusts the
active max quantizer for each GF group was running out of bits at
the end of a KF group. This caused a spike in Q and some ugly artifacts.

A second change makes sure that the calculation of the active
Q range for a group DOES, however, take account of clamping.

Change-Id: I31035e97d18853530b0874b433c1da7703f607d1
2015-10-23 14:45:48 -07:00
Marco
d162934bdc VP9: Estimate noise level for denoiser.
Periodically estiamte noise level in source, and only denoise
if estimated noise level is above threshold.

Change-Id: I54f967b3003b0c14d0b1d3dc83cb82ce8cc2d381
2015-10-23 11:03:30 -07:00
Jingning Han
caeb10bf06 Use explicit block position in foreach_transformed_block
Add the row and column index to the argument list of unit functions
called by foreach_transformed_block wrapper. This avoids the
repeated internal parsing according to the block index.

Change-Id: Ie7508acdac0b498487564639bc5cc6378a8a0df7
2015-10-23 09:19:17 -07:00
Ronald S. Bultje
f4af1a9af4 Merge "vp10: merge ext_ipred_bltr experiment into misc_fixes." 2015-10-22 21:14:20 +00:00
Ronald S. Bultje
806ae29d80 Merge "vp10: merge universal_hp experiment into misc_fixes." 2015-10-22 21:14:13 +00:00
Ronald S. Bultje
d6fc63ac31 Merge "Adjust superframe-is-optional unit test for vp10 superframe syntax." 2015-10-22 21:14:06 +00:00
Ronald S. Bultje
dbefcc0609 Merge "vp10: don't allow comp_inter_inter on keyframes." 2015-10-22 21:14:00 +00:00
Ronald S. Bultje
a857728267 Merge "vp10: fix tile size in remuxing step." 2015-10-22 21:12:44 +00:00
Ronald S. Bultje
40347d0c07 Merge "vp10: use correct constant for bw adaptation of seg pred probs." 2015-10-22 21:12:35 +00:00
Ronald S. Bultje
de4e2662d7 Merge "vp10: don't make right edge available across tile boundaries." 2015-10-22 21:12:25 +00:00
Ronald S. Bultje
69df584416 Merge "vp10: clip MVs before adding to find_ref_mvs() list." 2015-10-22 21:12:09 +00:00
Ronald S. Bultje
53dc9fd0a0 vp10: merge ext_ipred_bltr experiment into misc_fixes.
Change-Id: I2f2deb700748408b8278b7f5c29ee1f2e39785ec
2015-10-21 22:27:34 -04:00
Ronald S. Bultje
194c0a5cfb vp10: merge universal_hp experiment into misc_fixes.
Change-Id: I79fc3c0594535adc0056339c929cff69b8188760
2015-10-21 22:27:34 -04:00
Ronald S. Bultje
aa11256555 Adjust superframe-is-optional unit test for vp10 superframe syntax.
Change-Id: Ic64b6928af7ae8ecc987f845b0bf0faecdacb072
2015-10-21 22:27:28 -04:00
Paul Wilkins
4e887f032d Incorrect frame used in KF boost loop.
Fixes a bug in the calculation of the boost for key frames.

Change-Id: I75e9c96a9e86379239fbbbecb56ccd529783dc7c
2015-10-21 22:17:53 +01:00
Ronald S. Bultje
6a032503ca vp10: don't allow comp_inter_inter on keyframes.
Change-Id: Ibd0e13721a2bb71c532d20b36c42f4cccf5c5de2
2015-10-21 15:19:11 -04:00
Ronald S. Bultje
558d93f3a5 vp10: fix tile size in remuxing step.
Change-Id: Id48fb193bbdb3afed1d0db26c4ddded65a293b1b
2015-10-21 15:19:11 -04:00
Ronald S. Bultje
59058775fc vp10: use correct constant for bw adaptation of seg pred probs.
Change-Id: Idb869a77a126982814b8e7e288f952a65340e6be
2015-10-21 15:19:11 -04:00
Ronald S. Bultje
3d90819149 vp10: don't make right edge available across tile boundaries.
Change-Id: Ia81cf3858ef6c8d1fd4b1fb2dd9627906081129d
2015-10-21 15:19:11 -04:00
Geza Lore
aa8f85223b Optimize vp9_highbd_block_error_8bit assembly.
A new version of vp9_highbd_error_8bit is now available which is
optimized with AVX assembly. AVX itself does not buy us too much, but
the non-destructive 3 operand format encoding of the 128bit SSEn integer
instructions helps to eliminate move instructions. The Sandy Bridge
micro-architecture cannot eliminate move instructions in the processor
front end, so AVX will help on these machines.

Further 2 optimizations are applied:

1. The common case of computing block error on 4x4 blocks is optimized
as a special case.
2. All arithmetic is speculatively done on 32 bits only. At the end of
the loop, the code detects if overflow might have happened and if so,
the whole computation is re-executed using higher precision arithmetic.
This case however is extremely rare in real use, so we can achieve a
large net gain here.

The optimizations rely on the fact that the coefficients are in the
range [-(2^15-1), 2^15-1], and that the quantized coefficients always
have the same sign as the input coefficients (in the worst case they are
0). These are the same assumptions that the old SSE2 assembly code for
the non high bitdepth configuration relied on. The unit tests have been
updated to take this constraint into consideration when generating test
input data.

Change-Id: I57d9888a74715e7145a5d9987d67891ef68f39b7
2015-10-21 12:30:40 +01:00
Ronald S. Bultje
56cfbeefb4 Merge "vp10: disallow coding zero-sized tiles-in-frame/frames-in-superframe." 2015-10-20 19:58:00 +00:00
Ronald S. Bultje
293e20df91 vp10: clip MVs before adding to find_ref_mvs() list.
This causes the output of find_ref_mvs() to always be unique or zero.
A nice side-effect of this is that it also causes the output of
find_ref_mvs_sub8x8() to be unique-or-zero, and it will not ignore
available candidate MVs under certain conditions.

See issue 1012.

Change-Id: If4792789cb7885dbc9db420001d95f9b91b63bfa
2015-10-20 14:48:35 -04:00
Ronald S. Bultje
dec4405cfa vp10: disallow coding zero-sized tiles-in-frame/frames-in-superframe.
See issue 1088.

Change-Id: Icb15d33b4e316add848f210b50cbccd7c7847207
2015-10-20 14:48:31 -04:00
Marco
be3f2713ad Setting change in sample encoder: vpx_temporal_svc_encoder.c
Change-Id: Ifb384fa571eb08b516ed08fe05b8bca0c94b1edf
2015-10-20 10:40:20 -07:00
Hui Su
96b69deca5 Merge "VP10: some changes to palette mode" 2015-10-20 16:37:31 +00:00
Ronald S. Bultje
9897e1c27c Merge "vp10: write colorspace info for profile 0 intraonly frames." 2015-10-20 15:57:21 +00:00
Ronald S. Bultje
bafadaafbb Merge "vp10: per-segment lossless coding." 2015-10-20 15:57:12 +00:00
Ronald S. Bultje
92c4d8149a Merge "vp10: add extended-intra prediction edges experiment." 2015-10-20 15:57:05 +00:00
Ronald S. Bultje
1a64595780 Merge "vp10: allow MV refs to point outside visible image." 2015-10-20 15:56:56 +00:00
Ronald S. Bultje
4a7f012b95 Merge "vp10: allow forward updates for keyframe y intra mode probabilities." 2015-10-20 15:56:49 +00:00
Ronald S. Bultje
f441a652b7 Merge "vp10: merge keyframe/interframe uvintramode/partition probabilities." 2015-10-20 15:56:42 +00:00
Ronald S. Bultje
24517b9635 Merge "vp10: make segmentation probs use generic probability model." 2015-10-20 15:56:34 +00:00
Geza Lore
9cfba09ac0 Optimize vpx_quantize_{b,b_32x32} assembler.
Added optimization of the 8 bit assembly quantizer routines. This makes
these functions up to 100% faster, depending on encoding parameters.

This patch maskes the encoder faster in both the high bitdepth and 8bit
configurations. In the high bitdepth configuration, it effects profile 0
only.

Based on my profiling using 1080p input the net gain is between 1-3% for
the 8 bit config, and around 2.5-4.5% for the high bitdepth config,
depending on target bitrate. The difference between the 8 bit and high
bitdepth configurations for the same encoder run is reduced by 1% in all
cases I have profiled.

Change-Id: I86714a6b7364da20cd468cd784247009663a5140
2015-10-20 10:11:19 +01:00
James Zern
849e54cedd Merge "vp8cx: remove deprecated reference/entropy controls" 2015-10-20 02:46:36 +00:00
Ronald S. Bultje
2a388b53f2 vp10: write colorspace info for profile 0 intraonly frames.
See issue 1087.

Change-Id: I231f6f12f870d0a56391daf1673536048418b207
2015-10-19 12:18:57 -04:00
James Zern
a046f56491 vp8cx: remove deprecated reference/entropy controls
VP8E_UPD_ENTROPY, VP8E_UPD_REFERENCE and VP8E_USE_REFERENCE have been
deprecated since the initial public release

Change-Id: Ied16b441eec13434d85f1ab115d49ccaf5f2f7b0
2015-10-16 17:02:36 -07:00
Ronald S. Bultje
60c58b5284 vp10: per-segment lossless coding.
Some more testing of this patch would probably be useful, but I
think the basics of it should work fine now.

See issue 1035.

Change-Id: I4a36d58f671c5391cb09d564581784a00ed26245
2015-10-16 19:30:39 -04:00
Ronald S. Bultje
c7dc1d78bf vp10: add extended-intra prediction edges experiment.
This experiment allows using full above/right edges for all transform
sizes whenever available (for d45/d63), and adds bottom/left edges for
d207.

See issue 1043.

Change-Id: I5cf7f345e783e8539bb6b6d2c9972fb1d6d0a78b
2015-10-16 19:30:39 -04:00
Ronald S. Bultje
dea998997f vp10: allow MV refs to point outside visible image.
In VP9, the ref MV had to point to a block that itself fully resided
within the visible image, i.e. all borders of the image had to be
within the visible borders of the coded frame. This is somewhat
illogical, and had obscure side effects, e.g. clamping of fairly
reasonable motion vectors such as 0,0 were clipped to negative values
if the block was overhanging on frame edges (such as the last rows
on 1080p content), which makes no sense whatsoever.

Instead, relax clamping constraints such that the ref MVs are allowed
to point to blocks exactly outside the visible edges in both Y as well
as UV planes, including the 8tap filter edges (that's why the offset is
8 pixels + block size).

See issue 1037.

Change-Id: I2683eb2a18b24955e4dcce36c2940aa2ba3a1061
2015-10-16 19:30:38 -04:00
Ronald S. Bultje
1eb51a2010 vp10: allow forward updates for keyframe y intra mode probabilities.
See issue 1040 point 5.

Change-Id: I51a70b9eade39efba392a1457bd70a3c515525cb
2015-10-16 19:30:38 -04:00
Ronald S. Bultje
d8f3bb1837 vp10: merge keyframe/interframe uvintramode/partition probabilities.
This has various benefits:
- simplify implementations because we don't have to switch between
  multiple probability tables depending on frametype
- allows fw subexp and bw adaptivity for partitions/uvmode in keyframes

See issue 1040 point 5.

Change-Id: Ia566aa2863252d130cee9deedcf123bb2a0d3765
2015-10-16 19:30:38 -04:00
Ronald S. Bultje
6e5a1165be vp10: make segmentation probs use generic probability model.
Locate them (code-wise) in frame_context, and have them be updated
as any other probability using the subexp forward and adaptive bw
updates.

See issue 1040 point 1.

TODOs:
- real-world default probabilities
- why is counts sometimes NULL in the decoder? Does that mean bw
  adaptivity updates only work on some frames? (I haven't looked
  very closely yet, maybe this is a red herring.)

Change-Id: I23b57b4e5e7574b75f16eb64823b29c22fbab42e
2015-10-16 19:30:38 -04:00
Yaowu Xu
568429512e Add a new enum type vpx_color_range_t
to make meaning of color_range obvious.

Change-Id: I303582e448b82b3203b497e27b22601cc718dfff
2015-10-16 16:27:18 -07:00
James Zern
7dd7a7da20 vpx/*.h: add VPX_CTRL_* preproc defines
allows controls to be tested for at compile-time

Change-Id: I1cd01287dc144392956c82e6dbac003f37703039
2015-10-16 18:47:20 +00:00
James Zern
9ade6e1001 Merge "vpx/*.h, cosmetics: fix some typos" 2015-10-16 18:47:08 +00:00
hui su
17c817adfc VP10: some changes to palette mode
Account for rounding in distortion calculation in k-means;
carry out rounding before duplicates removal of base colors;
replace numbers with macros;
use prefix increment.

Slight coding gain (<0.1%) on screen_content testset.

Change-Id: Ie8bd241266da6b82c7b2874befc3a0c72b4fcd8c
2015-10-16 11:41:26 -07:00
Marco
b44c5cf639 Adjustment on limiting cyclic refresh on steady blocks.
Adjust the qp threshold and consec_zeromv threshold for
limiting cyclic refresh. Also increase the refresh period
when the limit amount is significant, and some code-cleanup.

Small gain in PSNR/SSIM metrics: ~0.25/0.3 gain on RTC set, speed 7.

Change only affects non-screen content.

Change-Id: I1ced87a89a132684c071e722616e445b2d18236a
2015-10-16 10:16:44 -07:00
Yaowu Xu
1832ba7509 Restore partial changes from previous commit
This portion was tested to have no effect on asan test failures.

Change-Id: I3de1dab7479148bdffc24c4568cb2e7e9963f099
2015-10-16 00:28:37 +00:00
hui su
aaf6f6215f Fix palette mode in multi-thread encoding setting
Fix a couple of memory related errors. Also fix thread test failures.

Change-Id: I0103995f832cecf1dd2380000321ac7204f0cfc0
2015-10-15 15:00:57 -07:00
Jacky Chen
a5d74843eb Merge "VP9_resizing: adjust the threshold and another improvement." 2015-10-15 21:35:02 +00:00
Marco Paniconi
cff15f9d3c Merge "Fix resetting of cyclic refresh on dynamic resize change." 2015-10-15 21:09:06 +00:00
JackyChen
dc002cb7b4 VP9_resizing: adjust the threshold and another improvement.
Adjust the qp threshold based on the denoising setting; not allow
to scale directly from original resolution to one half and vise versa.

Change-Id: I032a9b22f8e1c88de6bb81cf8351367223a3e40d
2015-10-15 09:27:22 -07:00
Marco
d6bbda4bc2 Fix resetting of cyclic refresh on dynamic resize change.
Put the reset at the right place, during the setup and prior
to updating the map.

Change-Id: I75e550ae9d8cc15081330b8857edc04c23947875
2015-10-15 09:03:51 -07:00
Marco
1a0a10cf3d VP9: Rate control update for re-encode screen-content.
For the re-encoding (at max-qp) on the detected high-content change:
update rate correction factor, reset rate over/under-shoot flags,
and update/reset the rate control for layered coding.

Change-Id: I5dc72bb235427344dc87b5235f2b0f31704a034a
2015-10-15 08:26:15 -07:00
Yaowu Xu
15cc8bc72f Merge "fix a msvc compiler warning" 2015-10-15 14:39:01 +00:00
Yaowu Xu
3e1e3ac789 Merge "Fix two asan failures" 2015-10-15 14:38:05 +00:00
Yaowu Xu
8ced62f250 fix a msvc compiler warning
Change-Id: Ifd6581c1bdb8d8f4b2ecf676c1a3d385dc129abf
2015-10-15 01:05:13 +00:00
Yaowu Xu
4727fa2a75 Fix two asan failures
Change-Id: I57865e9604ac162ef0d97deb16e81ca436a98428
2015-10-14 18:03:31 -07:00
Johann
5d5cc0d082 Check for bswap* builtins before using
Canonical builtin checks for clang are to use
__has_builtin. Much less fragile than version checks.

https://code.google.com/p/webm/issues/detail?id=1082

Change-Id: I8151fb75899acdf1a935c23aad9441da99a9abcd
2015-10-14 15:37:53 -07:00
Johann
ec623a0bb7 Upstream Mozilla fix for older Apple clang builds
Also use the _mm_broadcastsi128_si256 intrisic for
Apple clang versions 4.[012]

https://bugzilla.mozilla.org/show_bug.cgi?id=1085607
https://code.google.com/p/webm/issues/detail?id=1082

Change-Id: I6bc821d8163387194ef663e94bfed91fa7281d88
2015-10-14 07:41:23 -07:00
Yaowu Xu
c2b8b5bfe2 Merge "Changes to partition breakout rules." 2015-10-13 22:31:56 +00:00
paulwilkins
cdc359989a Changes to partition breakout rules.
Changes to the breakout behavior for partition selection.
The biggest impact is on speed 0 where encode speed in
some cases more than doubles with typically less than 1%
impact on quality.

Speed 0 encode speed impact examples
Animation test clip: +128%
Park Joy:  +59%
Old town Cross: + 109%

Change-Id: I222720657e56cede1b2a5539096f788ffb2df3a1
2015-10-13 14:19:06 -07:00
Marco Paniconi
86c16df39d Merge "VP9-SVC: Bugfix to allow skipping lower layer(s) encoding." 2015-10-13 21:09:10 +00:00
Ronald S. Bultje
567c791d01 Merge "vp10: fix compiler warning with --enable-universal_hp." 2015-10-13 19:33:05 +00:00
Hui Su
fe0396cadc Merge "Fix compiler warnings" 2015-10-13 19:30:33 +00:00
Ronald S. Bultje
fa8ba206bf vp10: fix compiler warning with --enable-universal_hp.
Change-Id: I0d7ca20bdd0fc868b28b0755e3114a4499056f45
2015-10-13 14:05:47 -04:00
Hui Su
b9e31b5163 Merge "VP10: Add palette mode part 1" 2015-10-13 17:34:27 +00:00
hui su
6f31722950 Fix compiler warnings
Change-Id: I761256a8100d83abf1b937f3739580237e3fad2a
2015-10-13 10:33:17 -07:00
Marco
1ce01eaaf7 VP9-SVC: Bugfix to allow skipping lower layer(s) encoding.
The setting of svc->spatial_layer_to_encode was missing
in VP9E_SET_SVC_LAYER_ID.

Change-Id: I015b1a64adb9ef2644d6477a02d9d9364c8462b9
2015-10-12 16:11:34 -07:00
Ronald S. Bultje
00170953b1 vp10: allow forward updates for uv_mode probabilities.
See issue 1040 point 4.

Change-Id: I79e06bd71a27f45770c760c47dc71bc3767a77a0
2015-10-12 17:51:01 -04:00
Ronald S. Bultje
5f589826f3 vp10: allow bw adaptivity for skip/tx probabilities in keyframes.
See issue 1040 point 3.

Change-Id: Ieef6d326b7fb50ceca5936525b7c688225a11fd1
2015-10-12 17:51:01 -04:00
Ronald S. Bultje
fee146e60b vp10: don't write tile size marker bit if CONFIG_MISC_FIXES=0.
Change-Id: I41b13b8767e30da391c2c4da9a729ca7292b16b9
2015-10-12 17:50:57 -04:00
Ronald S. Bultje
1799f2f81d vp10: remove ref-MV-dependent use of HP.
This change (in a new config experiment: universal_hp) removes the
bitstream parsing dependency of the HP MV bit on the ref MV to be
coded. It also cleans up clearing of the HP bit in near/nearestMV,
since HP is always on if it's set in the frame header.

This admittedly doesn't clean up the crap that could be cleaned up,
but that's mostly because I think this needs some careful review;
not so much for coding style, but more from hardware people and from
the codec team on what we/you want. It would also be nice to get some
actual numbers on the real quality impact of this change. If, for
example, hardware people come up and tell us they don't actually care
anymore, we should probably just this code as-is and do nothing (i.e.
discard this patch).

See issue 1036.

Change-Id: Ic9b106f34422aa0f79de0c28125b72d566bd511a
2015-10-12 14:45:18 -04:00
Ronald S. Bultje
5b4805d6e9 vp10: remove clamp_mv2() call from vp10_find_best_ref_mvs().
This actually has no effect whatsoever, since the input MVs themselves
are clamped by clamp_mv_ref() already, which is significantly more
restrictive in its bounds.

Change-Id: I4a3a7b2b121ee422c56428c2a12d930c3813c06e
2015-10-12 14:45:18 -04:00
Ronald S. Bultje
2e45ce1493 vp10: update assertion/allocation for tokens.
We only write EOSB tokens if we write tokens (i.e. not for skip blocks),
and we write EOSB tokens per-plane instead of per block.

Change-Id: I8d7ee99f8ec50eb7ae809f9f9282c1c91dbf6537
2015-10-12 14:45:18 -04:00
hui su
5d011cb278 VP10: Add palette mode part 1
Add palette mode for keyframe luma channel. Palette mode is enabled
when using "--tune-content=screen" in encoding config parameters.

on screen_content testset:  +6.89%
on derlr                 :  +0.00%

Design doc (WIP):
https://goo.gl/lD4yJw

Change-Id: Ib368b216bfd3ea21c6c27436934ad87afdaa6f88
2015-10-12 10:02:17 -07:00
James Zern
ba7ea4456f tile_worker_hook: fix -Wclobbered warning
*tile should be marked volatile like the others due to the use of
setjmp()

Change-Id: I5dbf8e6792e4c0f34a683434b4fd06e3b4c75c4b
2015-10-10 11:17:08 -07:00
James Zern
0b74e5d7af vpx/*.h, cosmetics: fix some typos
Change-Id: Ie9ead2c665c6c065a6b922ab66bae9be63483272
2015-10-09 16:33:15 -07:00
Alex Converse
0c00af126d Add vpx_highbd_convolve_{copy,avg}_sse2
single-threaded:
swanky (silvermont): ~1% faster overall
peppy (celeron,haswell): ~1.5% faster overall

Change-Id: Ib74f014374c63c9eaf2d38191cbd8e2edcc52073
2015-10-09 11:50:25 -07:00
Alex Converse
7e77938d72 Generate convolve_test wrapper functions with a macro
Change-Id: Iccb4cdc23c1845cf9cb7d69101c9f4f43675d368
2015-10-09 11:42:05 -07:00
James Zern
65055a5fbd Merge "vp9/decode_tiles_mt: remove unnecessary local" 2015-10-09 17:52:34 +00:00
Geza Lore
cbada4a982 Remove 4 mova insts from quantize_ssse3_x86_64.asm
Change-Id: If3cb9345b44162e600e6c74873e0cb4c207fc7fb
2015-10-09 07:52:04 -07:00
Debargha Mukherjee
94bedd013e Merge "Optimization of 8bit block error for high bitdepth" 2015-10-09 13:36:47 +00:00
Geza Lore
0134764fa6 Optimization of 8bit block error for high bitdepth
If high bit depth configuration is enabled, but encoding in profile 0,
the code now falls back on optimized SSE2 assembler to compute the
block errors, similar to when high bit depth is not enabled.

Change-Id: I471d1494e541de61a4008f852dbc0d548856484f
2015-10-08 14:05:25 -07:00
Jacky Chen
66bf686975 Merge "VP9 denoiser: use skin map to improve denoising." 2015-10-08 21:02:46 +00:00
jackychen
bafe1a2d67 VP9 denoiser: use skin map to improve denoising.
Only denoise at small motion if it's a skin block.

Change-Id: I6235cad9dd7f76ab40e7d9cdfe6180e619c20c6e
2015-10-08 12:17:25 -07:00
Ronald S. Bultje
95f8b81962 Merge "vp10: use subexp probability updates for MV probs." 2015-10-08 18:50:50 +00:00
Ronald S. Bultje
ca67339901 Merge "vp10: skip unreachable cat6 token extrabits." 2015-10-08 18:50:39 +00:00
Ronald S. Bultje
b60b15bc11 Merge "vp10: remove superframe size field for last frame in superframe." 2015-10-08 18:50:08 +00:00
Jacky Chen
0f6e9c5d3d Merge "vp9_skin_detection: fix some build warnings." 2015-10-08 18:15:10 +00:00
Ronald S. Bultje
5dd85e525d Merge "vp10: use superframe marker index/size mechanism for tile size." 2015-10-08 17:32:52 +00:00
jackychen
eaa101b502 vp9_skin_detection: fix some build warnings.
Change-Id: Ib779c083e9775dc9922ed6e104f6275bc453bef9
2015-10-08 09:51:34 -07:00
James Zern
50b20b90aa vp9/decode_tiles_mt: remove unnecessary local
reuse the common loop index

Change-Id: I9db45a93c219c2123917514cb8e9d4ea86454711
2015-10-07 17:46:13 -07:00
James Zern
a83e8ec008 Merge "vp9/tile_worker_hook: pass pbi directly" 2015-10-07 22:09:33 +00:00
James Zern
1f2acb7e40 Merge changes Iaee60826,I51cf1e39
* changes:
  vp9/tile_worker_hook: add multiple tile decoding
  invalid_file_test: loosen error check w/tile-threading
2015-10-07 22:09:21 +00:00
jackychen
b0a2ba2ffa VP9_denoiser: pass address in copy_frame to make it faster.
Change-Id: I65269ddb3ea5f911d5be38614b93c97be7e1ba76
2015-10-07 13:22:37 -07:00
Marco Paniconi
780ada18aa Merge "VP9 denoiser bug-fix: artifact caused by false buffer swap." 2015-10-07 19:08:07 +00:00
Alex Converse
061103dc82 Merge "vp9: simplify extrabits encoding" 2015-10-07 18:45:02 +00:00
James Zern
8b55eafed1 Merge "test/reg...check,video_source.h: avoid NOMINMAX redef" 2015-10-07 18:40:02 +00:00
James Zern
12de7e2a4a Merge "vpxdec: quiet signed/unsigned warning" 2015-10-07 18:26:36 +00:00
James Zern
05b4e18142 Merge changes I2965e786,I144bedde
* changes:
  vpx_memset16: drop unnecessary local
  vpx_memset16: quiet signed/unsigned warning
2015-10-07 18:26:15 +00:00
jackychen
7231c62c9f VP9 denoiser bug-fix: artifact caused by false buffer swap.
The artifact occurs periodically when VP9 denoiser is on and
refresh_golden_frame happen. When refresh_golden_frame happen,
we should copy the frame buffer instead of swapping the pointers.

Change-Id: Ib3204c4b04db28ecf439c6d9e61f3d146f04196d
2015-10-07 11:16:15 -07:00
Marco Paniconi
d20f086be5 Merge "Move setting of refresh threshold outside loop." 2015-10-07 16:44:32 +00:00
Debargha Mukherjee
f3a73f1277 Merge "Backports highbitdepth accelerations into vp10" 2015-10-07 16:28:36 +00:00
James Zern
18bd24ba9d test/reg...check,video_source.h: avoid NOMINMAX redef
some mingw32 configs define this. force this to be on to ensure the
build succeeds

Change-Id: I2cc490782b6a0736aa617e6a1457fc2bc984adbb
2015-10-06 23:05:15 -07:00
James Zern
fcf1609b7c vpxdec: quiet signed/unsigned warning
Change-Id: I93c56dfa547af9b2f2b96c4f85fd9862ea67af62
2015-10-06 22:56:34 -07:00
James Zern
d0f406366c vpx_memset16: drop unnecessary local
+ add a cast

Change-Id: I2965e7867223aa25bf688c988629ac57b4971905
2015-10-06 22:51:35 -07:00
James Zern
3554089838 vpx_memset16: quiet signed/unsigned warning
Change-Id: I144bedde7ea43f1b84360c1a7c8a042fd30abb6b
2015-10-06 22:48:18 -07:00
James Zern
0bd82af834 vp9/tile_worker_hook: pass pbi directly
reduces the size of TileWorkerData reusing the storage in the worker
itself

Change-Id: If8a62fcb35167037c3da5814ab84fb81893f9cab
2015-10-06 20:14:24 -07:00
James Zern
1f4a6c8a4e vp9/tile_worker_hook: add multiple tile decoding
this reduces the number of synchronizations in decode_tiles_mt() and
improves overall performance when the number of threads is less than the
number of tiles

Change-Id: Iaee6082673dc187ffe0e3d91a701d1e470c62924
2015-10-06 20:13:54 -07:00
Marco
bc137ff67b Move setting of refresh threshold outside loop.
Small code cleanup. consec_zeromv refresh threshold
does not need to be computed for every super-block.

No change in behavior.

Change-Id: I8c4b1b28072f42b01d917fff6d1f62722f1e1554
2015-10-06 17:51:30 -07:00
James Zern
fb209003a8 invalid_file_test: loosen error check w/tile-threading
The serial decode check is too strict for tile-threaded decoding as
there is no guarantee on the decode order nor which specific error
will take precedence. Currently a tile-level error is not forwarded so
the frame will simply be marked corrupt.

Change-Id: I51cf1e39e44bedeac93746154b36a4ccb2f059b1
2015-10-06 16:40:20 -07:00
Alex Converse
2f7f482c77 vp9: simplify extrabits encoding
Change-Id: I5a2abd35cb303d8f6354b3119ab95acf90405116
2015-10-06 16:26:08 -07:00
Debargha Mukherjee
ce3f4ade67 Merge "SSSE3 optimisation for quantize in high bit depth" 2015-10-06 22:28:11 +00:00
Marco
7266bedc04 Add first_spatial_layer_to_encode to SVC.
Use the existing VP9_SET_SVC control to set the
first spatial layer to encode.

Since we loop over all spatial layers inside the encoder, the
setting of spatial_layer_id via VP9_SET_SVC has no relevance.
Use it instead to set the first_spatial_layer_to_encode,
which allows an application to skip encoding lower layer(s).

Change only affects the 1 pass CBR SVC.

Change-Id: I5d63ab713c3e250fdf42c637f38d5ec8f60cd1fb
2015-10-06 08:56:15 -07:00
Julia Robson
37c68efee2 SSSE3 optimisation for quantize in high bit depth
When configured with high bit detpth enabled, the 8bit quantize
function stopped using optimised code. This made 8bit content
decode slowly. This commit re-enables the SSSE3 optimisations.

Change-Id: I194b505dd3f4c494e5c5e53e020f5d94534b16b5
2015-10-06 13:32:02 +01:00
Scott LaVarnway
b212094839 Merge "VPX: refactor vpx_idct32x32_1_add_sse2()" 2015-10-06 11:35:15 +00:00
Ronald S. Bultje
48178d2cf2 Merge "vp10: extend range for delta Q values." 2015-10-06 10:49:30 +00:00
Ronald S. Bultje
177e7b53e7 vp10: use subexp probability updates for MV probs.
See issue 1040 point 2.

Change-Id: I0b37fe74be764610696620f1fe296dc74e4806d7
2015-10-05 20:58:32 -04:00
Ronald S. Bultje
3461e8ce64 vp10: skip unreachable cat6 token extrabits.
We have historically added new bits to cat6 whenever we added a new
transform size (or bitdepth, for that matter). However, we have
always coded these new bits regardless of the actual transform size,
which means that for smaller transforms, we code bits that cannot
possibly be set. The coding (quality) impact of this is negligible,
but the bigger issue is that this allows creating bitstreams with
coefficient values that are nonsensible and can cause int overflows,
which then de facto become part of the bitstream spec. By not coding
these bits, we remove this possibility.

See issue 1065.

Change-Id: Ib3186eca2df6a7a15ddc60c8b55af182aadd964d
2015-10-05 20:58:32 -04:00
Ronald S. Bultje
d77a84bf52 vp10: remove superframe size field for last frame in superframe.
This is identical to what the tile size does for the last tile. See
issue 1042 (which covers generalizing the superframe/tile concepts).

Change-Id: I1f187d2e3b984e424e3b6d79201b8723069e1a50
2015-10-05 20:58:32 -04:00
Ronald S. Bultje
7460798ba5 vp10: use superframe marker index/size mechanism for tile size.
See issue 1042. Should provide slight bitstream savings in most cases
where tiles are being used.

Change-Id: Ie2808cf8ef30b3efe50804396900c4d63a3fa026
2015-10-05 20:58:32 -04:00
Ronald S. Bultje
612104bb8d vp10: extend range for delta Q values.
See issue 1051. 6 bits is fairly arbitrary but at least allows writing
delta Q values that are fairly normal in other codecs. I can extend to
8 if people want full range, although I personally don't have any need
for that.

Change-Id: I0a5a7c3d9b8eb3de4418430ab0e925d4a08cd7a0
2015-10-05 20:58:32 -04:00
jackychen
de53e6de49 Add the check of resolution in VP9 dynamic resizing.
The resolution check fixs the issue which resets resize_pending
unnecessarily and causes not-bitexact with previous one-step version.

Change-Id: I4e7660b3c8f34f59781e2e61ca30d61080c322de
2015-10-05 15:39:32 -07:00
Julia Robson
5e6533e707 SSE2 optimisation for quantize in high bit depth
When configured with high bit detpth enabled, the 8bit quantize
function stopped using optimised code. This made 8bit content
decode slowly. This commit re-enables the SSE2 optimisation
(but not the SSSE3 optimisation).

Change-Id: Id015fe3c1c44580a4bff3f4bd985170f2806a9d9
2015-10-05 10:59:16 -07:00
Marco Paniconi
7777e7a8d5 Merge "Fix to denoiser with dynamic resize." 2015-10-05 14:14:35 +00:00
Marco Paniconi
3da6564f90 Merge "Stabilize the encoder buffer from going too negative." 2015-10-05 14:11:43 +00:00
Scott LaVarnway
23d1c06268 VPX: refactor vpx_idct32x32_1_add_sse2()
Change-Id: Ia1a2cac0e9dc05f3207b3433a6c1589fa7f2aee3
2015-10-05 06:33:42 -07:00
JackyChen
87b2495f95 Turn on two-steps scaling in VP9 encoder dynamic resizing.
First do a 3/4 scaling and then go down to 1/2 when necessary.

Change-Id: I5689c5228ca7e1606baea7f960eb24d0dab04d4d
2015-10-02 15:27:37 -07:00
Marco
86ede50943 Fix to denoiser with dynamic resize.
Temporary fix to denoiser when dynamic resizing is on.
 -Reallocate denoiser buffers on resized frame.
 -Force golden update on resized frame.
 -Don't denoise resized frame, and copy source into denoised buffers.

Change-Id: Ife7638173b76a1c49eac7da4f2a30c9c1f4e2000
2015-10-02 11:50:57 -07:00
Marco
37293583cd Stabilize the encoder buffer from going too negative.
For screen-content mode, with frame dropper off, put a limit
on how low encoder buffer can go.

Under hard slide changes, the buffer level can go too low and then
take long time to come back up (in particular when frame-dropping
is not used), which will affect the active_worst and target frame size.

Change-Id: Ie9fca097e05cd71141f978ec687f852daf9de332
2015-10-02 11:07:59 -07:00
Ronald S. Bultje
ce3780251c vp10: make render_width/height referenceable through ref frames.
See issue 1079.

Change-Id: I754a61ec011c3508bbb26826cf8e11dbdfdd8379
2015-10-02 13:39:38 -04:00
Ronald S. Bultje
3fedf4a59b Merge "vp10: reimplement d45/4x4 to match vp8 instead of vp9." 2015-10-02 17:15:59 +00:00
Debargha Mukherjee
f18322262f Backports highbitdepth accelerations into vp10
Ports the changes in
https://chromium-review.googlesource.com/#/c/302372/3
into vp10.

Change-Id: I334c409f693691227ad16fc703c91899592dd8dc
2015-10-02 00:57:37 -07:00
Debargha Mukherjee
cb5c47f20d Merge "Accelerated transform in high bit depth" 2015-10-02 06:55:55 +00:00
Marco Paniconi
194b374bb6 Merge "Two-steps scaling in VP9 encoder dynamic resizing." 2015-10-02 03:20:22 +00:00
jackychen
ba06be3844 Two-steps scaling in VP9 encoder dynamic resizing.
Dynamic resizing now support two-steps scaling: first go down to
3/4 and then 1/2. This feature is under a flag which controls the
switch between two-steps scaling and one-step scaling (1/2 only).

Change-Id: I3a6c1d3d5668cf8e016a0a02aeca737565604a0f
2015-10-01 18:18:49 -07:00
hui su
06bdc7f6db Small cleanup
Change-Id: I5aeaa94b743f84738d288f8b027fec4c164f2ec3
2015-10-01 11:19:13 -07:00
Scott LaVarnway
dfeaaeb0ad Merge "VP9: remove plane_type from macroblockd_plane" 2015-10-01 17:31:10 +00:00
Ronald S. Bultje
62a1579525 vp10: reimplement d45/4x4 to match vp8 instead of vp9.
This is more a proof of concept than anything else. The problem here
isn't so much how to code it, but rather where to place the resulting
code. All intrapred DSP code lives in vpx_dsp, so do we want the vp10
specific intra pred functions to live there, or in vp10/?

See issue 1015.

Change-Id: I675f7badcc8e18fd99a9553910ecf3ddf81f0a05
2015-10-01 10:11:54 -04:00
Ronald S. Bultje
b1d85bf60f vp8: align left pixel array by 16 bytes.
The x86 simd expects this. Identical alignment can be found in vp9
and vp10 also. Fixes crashes on 32bit x86 systems.

Change-Id: I229c88d8f696acbef5337c8fa9503528df4e1c40
2015-10-01 10:11:54 -04:00
James Zern
20f43ddfde Merge "sixtap_predict_test: enable NEON tests" 2015-10-01 02:10:22 +00:00
Ronald S. Bultje
31498df5f0 Merge "vp8: change build_intra4x4_predictors() to use vpx_dsp." 2015-10-01 01:01:57 +00:00
Ronald S. Bultje
12238fe851 Merge "vp8: change build_intra_predictors_mbuv_s to use vpx_dsp." 2015-10-01 01:01:45 +00:00
Ronald S. Bultje
0462172ccf Merge "vp8: change build_intra_predictors_mby_s to use vpx_dsp." 2015-10-01 00:57:37 +00:00
Ronald S. Bultje
c26a9ecaa2 vp8: change build_intra4x4_predictors() to use vpx_dsp.
I've added a few new functions (d45e, d63e, he, ve) to cover the
filtered h/v 4x4 predictors that are vp8-specific, the "correct"
d45 with the correctly filtered bottom-right pixel (as opposed to
the unfiltered version in vp9), and the "broken" d63 with weirdly
filtered bottom-right pixels (which is correctly filtered in vp9).

There may be a minor performance impact on all systems because we
have to do an extra copy of the Above pixel array to incorporate
the topleft pixel in the same array (thus fitting the vpx_dsp API).
In addition, armv6 will have a more serious performance impact b/c
I removed the armv6/vp8-specific assembly. I'm not sure anyone
cares...

Change-Id: I7f9e5ebee11d8e21aca2cd517a69eefc181b2e86
2015-09-30 18:45:49 -04:00
Ronald S. Bultje
7cdcfee82c vp8: change build_intra_predictors_mbuv_s to use vpx_dsp.
Change-Id: I936c2430c3c5b1e0ab5dec0a20110525e925b5e4
2015-09-30 18:45:46 -04:00
Ronald S. Bultje
54d48955f6 vp8: change build_intra_predictors_mby_s to use vpx_dsp.
Change-Id: I2000820e0c04de2c975d370a0cf7145330289bb2
2015-09-30 18:45:40 -04:00
Scott LaVarnway
2f8625d824 VP9: remove plane_type from macroblockd_plane
Change-Id: Ia5072a3a92212d8565f33359f6c146469bdfbbec
2015-09-30 15:15:11 -07:00
Scott LaVarnway
13888e0eef Merge "VP9: remove plane_type checks in loopfilter functions" 2015-09-30 22:11:21 +00:00
James Zern
bdcfdebd68 Merge changes I264e75bf,Ifb0f41fb
* changes:
  vp9_loopfilter: remove unnecessary masks
  vp9_reset_lfm: harmonize function signature
2015-09-30 21:52:38 +00:00
James Zern
05c202a702 Merge changes I68c4f189,Ia5a752db
* changes:
  vp9_thread_test: clarify test case names
  vp9_thread_test: add non-frame-parallel files
2015-09-30 21:51:51 +00:00
James Zern
cd6d56e9a6 Merge "test/*.h: (windows) fix min/max conflict" 2015-09-30 19:55:36 +00:00
James Zern
a18cc591a5 vp9_loopfilter: remove unnecessary masks
Change-Id: I264e75bf3ddd083ee5311c50a37fb18fe634ddc3
2015-09-30 12:12:53 -07:00
James Zern
5d91201069 test/*.h: (windows) fix min/max conflict
define NOMINMAX to allow the std:: versions to be used; min/max will be
defined transitively via windows.h otherwise

Change-Id: I692b03fa3e70b7a53962d3fd209498f70f712fed
2015-09-29 23:03:26 -07:00
James Zern
a1914dbb31 vp9_reset_lfm: harmonize function signature
Change-Id: Ifb0f41fb43564a777be29b4c66443b366fa146a3
2015-09-29 20:46:37 -07:00
Alex Converse
aeae7fc903 Change dynamic_cast to static_cast to fix no-rtti build
Change-Id: Iad73b490b171cdda5c368ada69fb8eab2a86c156
2015-09-29 18:49:21 -07:00
Alex Converse
d2a953e02b Merge "Add a test for the interaction between active map and cyclic referesh." 2015-09-30 01:20:30 +00:00
Scott LaVarnway
18373264d9 VP9: remove plane_type checks in loopfilter functions
vp9_filter_block_plane_ss11() and vp9_filter_block_plane_non420()
are only called for the uv planes.

Change-Id: Iacd3b3242c8ce581edd37c8f06d95efc8a0f88a3
2015-09-29 15:54:33 -07:00
Scott LaVarnway
66de2b710f Merge "VP9: move loopfilter build masks to decode loop" 2015-09-29 21:40:48 +00:00
Tom Finegan
388a807e49 Merge "vpxenc: Allow non i420 input for VP10." 2015-09-29 18:56:21 +00:00
Marco Paniconi
0ca0a536f5 Merge "aq-mode for SVC: Add consec_zero_mv to layer context." 2015-09-29 17:47:39 +00:00
Tom Finegan
ed0d9dc836 vpxenc: Allow non i420 input for VP10.
BUG=https://code.google.com/p/webm/issues/detail?id=1066

Change-Id: I3bd26a516ef3d2742c523af570f639f9312df6df
2015-09-29 10:45:00 -07:00
Yaowu Xu
08ae94404f Merge "Fix a macro definition" 2015-09-29 17:22:49 +00:00
Tom Finegan
c0e2b5f473 Merge "build/make/iosbuild.sh: Remove jobs argument." 2015-09-29 17:08:55 +00:00
Marco
c05c58f8ff aq-mode for SVC: Add consec_zero_mv to layer context.
Change-Id: I63fadf1c7240d4b2893384f75c519311e9659d47
2015-09-29 10:01:53 -07:00
Yaowu Xu
45948a03c0 Fix a macro definition
to be consistent with the head file name.

Change-Id: I9634332a2b3fac7e7f3b7ef58821ea7c81c5c813
2015-09-29 09:34:42 -07:00
Scott LaVarnway
7718117104 VP9: move loopfilter build masks to decode loop
The loopfilter masks are now built in the decode loop.
This is done so we can eventually reduce the number of
MODE_INFO structs required by the decoder.

The encoder builds the masks for the entire frame prior
to calling the loopfilter.

Change-Id: Ia2146b07e0acb8c50203e586dfae0c4c5b316f11
2015-09-29 05:20:49 -07:00
Julia Robson
406030d1b0 Accelerated transform in high bit depth
When configured with high bitdepth enabled, the 8bit transform
stopped using optimised code. This made 8bit content decode slowly.

Change-Id: I67d91f9b212921d5320f949fc0a0d3f32f90c0ea
2015-09-28 21:09:16 -07:00
Marco Paniconi
7d28d12ef3 Merge "VP8: Update rate correction factor for drop_overshoot feature." 2015-09-28 19:53:10 +00:00
Marco
bd3088fd56 VP8: Update rate correction factor for drop_overshoot feature.
Update rate correction factor when we drop the frame due to overshoot.
Only affects when the drop_overshoot feature is on: screen_content_mode = 2.

Change-Id: I67e24de979b4c74744151d2ceb3cd75fec2a1e7a
2015-09-28 12:11:33 -07:00
Angie Chiang
e40a448e45 Merge "comment out fdct32" 2015-09-28 17:26:22 +00:00
Ronald S. Bultje
cc5dd3ec10 Merge "vp9/10: improve support for render_width/height." 2015-09-28 16:25:28 +00:00
Ronald S. Bultje
3db5721e21 Merge "Rename display_{size,width,height} to render_*." 2015-09-28 16:25:20 +00:00
Ronald S. Bultje
7238492235 Merge "vp10: code reference_mode in uncompressed header." 2015-09-28 16:23:11 +00:00
Ronald S. Bultje
2e3aa0587c Merge "vp10: split UV int4x4 loopfilter flag in one for each covered edge." 2015-09-28 16:23:00 +00:00
Ronald S. Bultje
812945a8f1 vp9/10: improve support for render_width/height.
In the decoder, map this to the output variable vpx_image_t.r_w/h.
This is intended as an improved version of VP9D_GET_DISPLAY_SIZE,
which doesn't work with parallel frame decoding. In the encoder,
map this to a codec control func (VP9E_SET_RENDER_SIZE) that takes
a w/h pair argument in a int[2] (identical to VP9D_GET_DISPLAY_SIZE).

Also add render_size to the encoder_param_get_to_decoder unit test.

See issue 1030.

Change-Id: I12124c13602d832bf4c44090db08c1009c94c7e8
2015-09-25 22:18:22 -04:00
James Zern
db2056f341 Merge "vp9/10 encoder: prevent NULL access on failure" 2015-09-26 01:52:52 +00:00
Ronald S. Bultje
36ffe64498 Rename display_{size,width,height} to render_*.
The name "display_*" (or "d_*") is used for non-compatible information
(that is, the cropped frame dimensions in pixels, as opposed to the
intended screen rendering surface size). Therefore, continuing to use
display_* would be confusing to end users. Instead, rename the field
to render_*, so that struct vpx_image can include it.

Change-Id: Iab8d2eae96492b71c4ea60c4bce8121cb2a1fe2d
2015-09-25 21:34:29 -04:00
Ronald S. Bultje
fcd6414e77 Merge "vp10: remove MACROBLOCK.{highbd_,}itxfm_add function pointer." 2015-09-26 01:20:14 +00:00
Ronald S. Bultje
690f662e26 Merge "vp10: remove MACROBLOCK.fwd_txm4x4 function pointer." 2015-09-26 01:19:49 +00:00
Angie Chiang
6a382101dd comment out fdct32
comment out fdct32
remove fdct32 test

Change-Id: I31c47fb435377465cd3265e39621ca50d3aae656
2015-09-25 18:18:27 -07:00
Ronald S. Bultje
8979e9e387 vp10: code reference_mode in uncompressed header.
See issue 1041 point 2.

Change-Id: I6fc6427b1a0edff828e39d43428e3271491f8ac5
2015-09-25 20:32:14 -04:00
Ronald S. Bultje
034c28b0a4 vp10: split UV int4x4 loopfilter flag in one for each covered edge.
In practice, this fixes the issue that if you have an odd number of
mi_cols, on the full right of the image, the UV int4x4 loopfilter
will be skipped over odd cols as well as odd rows (because it holds a
single variable for both edges).

See issue 1016.

Change-Id: Id53b501cbff9323a8239ed4775ae01fe91874b7e
2015-09-25 20:25:10 -04:00
James Zern
b945a532e5 Merge "Revert "remove static from fdct4/8/16/32"" 2015-09-26 00:12:43 +00:00
Ronald S. Bultje
bab8d38f7f vp10: remove MACROBLOCK.{highbd_,}itxfm_add function pointer.
This is preparatory work for allowing per-segment lossless coding.

See issue 1035.

Change-Id: I9487d02717ee3e766aee61a487780056bb35d2d3
2015-09-25 19:30:46 -04:00
Ronald S. Bultje
c74b33a413 vp10: remove MACROBLOCK.fwd_txm4x4 function pointer.
This is preparatory work for allowing per-segment lossless coding.

See issue 1035.

Change-Id: Idd72e2a42d90fa7319c10122032d1a7c7a54dc05
2015-09-25 19:30:46 -04:00
Tom Finegan
c6a419b490 build/make/iosbuild.sh: Remove jobs argument.
This can be handled via MAKEFLAGS.

Change-Id: I3a58a8a41f6570cb3b80c7c97e51735b82bf4ec9
2015-09-25 15:18:17 -07:00
Tom Finegan
7602232642 Merge "build/make/configure.sh: Embed bitcode in arm darwin targets." 2015-09-25 22:14:38 +00:00
Alex Converse
35fb3441f8 Add a test for the interaction between active map and cyclic referesh.
Fails with Icac63051bf37c7355e661837b57c257d58c764fc reverted.

Change-Id: I460d7a5a74faa4daace25f911f8dc5f68e16c951
2015-09-25 13:04:00 -07:00
James Zern
e7c949d32d Merge "vp9/10 decoder_remove: check pbi pointer" 2015-09-25 19:31:07 +00:00
Marco Paniconi
040395b944 Merge "VP8: Adjust rate correction factor for drop due to overshoot." 2015-09-25 18:59:58 +00:00
Marco
3f7656cc23 Limit cyclic refresh on steady background blocks.
Use the existing QP condition on limiting cyclic refresh, and add
addiitonal condition that block has been encoded with zero/small motion
x frames in row (where x is at least several times the refresh period).
Additional condition only affect non-screen content mode.

This helps to improve visual stability for noisy input, where on steady
background areas the application of delta_qp may lead to encoding the noise.

Also added a change to use the true skip (after encoding) to update the
last QP.

Change-Id: I234a1128d017d284cf767fdb58ef6c59d809f679
2015-09-25 10:40:35 -07:00
James Zern
7e54f0fe4b Merge "configure: reference the README for missing yasm" 2015-09-25 03:22:15 +00:00
James Zern
921c347ef6 vp9/10 decoder_remove: check pbi pointer
fixes crash on error

Change-Id: Ibb1ef5565fb833cdee1a49335473d98f1187ef43
2015-09-24 19:51:14 -07:00
Jacky Chen
ee72b6915e Merge "Change size on first frame and change config cause crash." 2015-09-25 01:04:07 +00:00
Marco
ece841f03f VP8: Adjust rate correction factor for drop due to overshoot.
Change-Id: Id70ca2e18a46247720eb631ae13a8430bd8b0954
2015-09-24 16:40:29 -07:00
Tom Finegan
9194f3c0cb build/make/configure.sh: Embed bitcode in arm darwin targets.
When the iOS SDK major version is 9 or higher:
- Pass -fembed-bitcode to compiler, assembler, and linker.
- Add a warning for simulator targets since yasm doesn't know
  what -fembed-bitcode means, and exits with an error.

BUG=https://code.google.com/p/webm/issues/detail?id=1075

Change-Id: I38c997a0225e53c5dd1b4ddf7935d21362953f76
2015-09-24 15:11:15 -07:00
Tom Finegan
20b770eecd Merge "build/make/configure.sh: Silence arm target Xcode7 link warnings." 2015-09-24 18:44:32 +00:00
Tom Finegan
4327d50904 Merge "build/make/configure.sh: Fix armv7 builds in Xcode7." 2015-09-24 18:44:23 +00:00
Tom Finegan
324bcbfaed build/make/configure.sh: Silence arm target Xcode7 link warnings.
Always add IOS_VERSION_MIN to darwin arm cflags. The warning occured
because the default (9.0) does not match the value set by configure
(6.0).

BUG=https://code.google.com/p/webm/issues/detail?id=1075

Change-Id: Ia9085ceeca10e057f9eb781c14f07581bb6280a5
2015-09-23 18:42:32 -07:00
Tom Finegan
6cf994b924 build/make/configure.sh: Fix armv7 builds in Xcode7.
- Use the iphoneos SDK path (instead of macosx).
- Detect iOS SDK major version and disable media (armv6) when using
  iOS SDK version 9 or higher.

BUG=https://code.google.com/p/webm/issues/detail?id=1075

Change-Id: I12f77dbeee4c0084e8322f6841813da8b5e91c16
2015-09-23 18:42:21 -07:00
Tom Finegan
6002212d2b build/make/configure.sh: docs for soft_{dis|en}able.
Add function comments explaining what the functions do and do not do.

Change-Id: I23dea09f93bc5cdbea6a0077f90683a1df2f74dc
2015-09-23 18:34:40 -07:00
James Zern
078312979e vp9_thread_test: clarify test case names
rename Decode[2-4] to something more precise

Change-Id: I68c4f189796eb11ac1a5b7b682f24efb71708187
2015-09-23 18:31:36 -07:00
James Zern
f8a5ab5257 vp9_thread_test: add non-frame-parallel files
these have been supported in tile-threaded decoding since:
b3b7645 vp9_dthread: remove frame_parallel_decoding_mode requirement

Change-Id: Ia5a752db9be937153cf4830d9258752136356d1b
2015-09-23 18:31:35 -07:00
James Zern
cf8f6559ce vp9/10 encoder: prevent NULL access on failure
Change-Id: I1fc8e0b3d48675cd5428b7b36f7cc28ab32cbf71
2015-09-23 17:55:51 -07:00
James Zern
f3627c82d0 configure: reference the README for missing yasm
Change-Id: I2ad799901385011764affadeaddcc271df21509f
2015-09-23 17:51:42 -07:00
James Zern
e7c8b71a86 Revert "remove static from fdct4/8/16/32"
This reverts commit 8903b9fa8345726efbe9b92a759c98cc21c4c14b.

there is no reason for these to be global

Change-Id: I66a31c06f8426aeca348ef12d9b9ab59d6d5e55d
2015-09-23 17:45:57 -07:00
James Zern
af631e1f19 Merge "VP9: Remove frame_parallel_decoding_mode from macroblockd" 2015-09-24 00:33:16 +00:00
Marco Paniconi
30bd74cf74 Merge "Non-rd mode: Limit transform size for intra to 16x16." 2015-09-24 00:12:02 +00:00
Scott LaVarnway
5404978825 VP9: Remove frame_parallel_decoding_mode from macroblockd
Not used.

Change-Id: I71527d0ee43a5730f1a2527e7ab687a77a137db4
2015-09-23 16:06:46 -07:00
Hui Su
d5683faab9 Merge "Adjust rd calculation in choose_tx_size_from_rd" 2015-09-23 21:39:43 +00:00
Marco
9b51b3a9ca Adjust rate-boost threshold in cyclic refresh for seg#2.
Small gain in metrics (average ~0.2dB), small
reduction in rate fluctuation.

Change-Id: Id75bd89c168486f075308fb474ebd26e3bdfb85b
2015-09-23 11:52:55 -07:00
Marco
01860f6fe4 Non-rd mode: Limit transform size for intra to 16x16.
Limit transform size for intra to 16x16, for non-screen content mode.
Little/no change in speed or metrics.
32x32 intra block is rarley selected in RTC (non-screen content) case,
but some visual improvement can be seen in some example,
e.g., captured_video_dark_whd.yuv.

Change-Id: I68e2db87875343b3fb9bb407a7709f0088f84072
2015-09-23 10:59:24 -07:00
hui su
38cc168822 Adjust rd calculation in choose_tx_size_from_rd
Coding gain:
derflr 0.142%
hevclr 0.153%
hevcmr 0.124%

Change-Id: I63b56ae3a9002c3a266e10e2964135ed43b0ba53
2015-09-23 10:54:28 -07:00
Johann
90a109f0ee Restrict get_msb inputs
Add a warning and assert that inputs for get_msb must not be zero.

Change-Id: I8c6f289ff13248f6e3a8bc24aab3712ed33022a6
2015-09-22 00:24:01 +00:00
Angie Chiang
36c4e8b27a Merge "remove static from fdct4/8/16/32" 2015-09-21 23:25:26 +00:00
Johann Koenig
90889b9a45 Merge "Remove vpx_filter_block1d16_v8_intrin_ssse3" 2015-09-21 19:17:18 +00:00
Angie Chiang
8903b9fa83 remove static from fdct4/8/16/32
remove static from fdct4/8/16/32 in vp10/encoder/dct.c
add prefix vp10_ to fdct4/8/16/32
add vp10/encoder/dct.h

Change-Id: I644827a191c1a7761850ec0b1da705638b618c66
2015-09-21 11:49:10 -07:00
Marco Paniconi
ce2b56cd69 Merge "Non-rd pickmode: Don't skip checking zeromv-last mode." 2015-09-21 18:26:28 +00:00
jackychen
55f092db09 Change size on first frame and change config cause crash.
Reallocation of mi buffer fails if change size on the first frame and
change config in subsequent frames. Add a condition for resolution
check to avoid assertion failure.

BUG=1074

Change-Id: Ie26ed816a57fa871ba27a72db9805baaaeaba9f3
2015-09-21 10:57:05 -07:00
Marco
38ad2dcea6 Non-rd pickmode: Don't skip checking zeromv-last mode.
Reference frame masking logic may skip checking zeromv-last mode.
Fix to avoid this and make sure zero-last is always checked.

No noticeable change in speed, and PSNR/SSIM metrics on RTC set overall
neutral (very small gain ~0.02).
Small visual improvement on few RTC clips.

Change-Id: I26eacdc449126424001a4a64e5ac31949f064417
2015-09-21 10:32:23 -07:00
Jingning Han
67ec82a262 Merge "Create sub8x8 block inter prediction function" 2015-09-21 16:13:37 +00:00
James Zern
571b7c978e vp9_end_to_end_test: disable vp10 w/high bitdepth
the range check in dct.c (abs(input[i]) < (1 << bit)) will fail in many
cases. this was broken at the time this check was added

BUG=1076

Change-Id: I3df8c7a555e95567d73ac16acda997096ab8d6e2
2015-09-19 09:14:18 -07:00
Jingning Han
d6be2671ed Create sub8x8 block inter prediction function
Change-Id: Ib161e6fb3eb081f7176a1d969fed16a7d1ffc320
2015-09-18 16:31:36 -07:00
James Zern
57694362e0 Merge "configure: add --extra-cxxflags option" 2015-09-18 23:18:10 +00:00
Johann
dd4f953350 Remove vpx_filter_block1d16_v8_intrin_ssse3
This was rewritten and moved to vpx_dsp/x86/vpx_subpixel_8t_ssse3.asm
in 195883023bb39b5ee5c6811a316ab96d9225034d

Change-Id: I117ce983dae12006e302679ba7f175573dd9e874
2015-09-18 16:05:43 -07:00
Tom Finegan
cd82f69823 Merge "iosbuild: Enable PIC for x86 targets." 2015-09-18 19:38:55 +00:00
Tom Finegan
9a8fe58caf Merge "iosbuild: Add --test-link argument." 2015-09-18 19:38:45 +00:00
James Zern
e00470aef8 vp9_arf_freq_test: disable vp10 w/high bitdepth
the range check in dct.c (abs(input[i]) < (1 << bit)) will fail in the
25-29 range. this was broken at the time this check was added

Change-Id: I8ca9607f6cbdc8be7f47696ffeabbab3ac5727e2
2015-09-17 20:17:35 -07:00
Jingning Han
48b8023ef0 Merge "Refactor mbmi_ext structure" 2015-09-18 00:49:14 +00:00
Tom Finegan
69ceed8e3a iosbuild: Enable PIC for x86 targets.
Change-Id: I03b1e8f983f8cd87519aefda732210359b319c81
2015-09-17 16:22:07 -07:00
Tom Finegan
01276f4453 iosbuild: Add --test-link argument.
Shortcut arg for --extra-configure-args --enable-examples. Enables
the examples, and thus ensures that all versions of libvpx that
iosbuild.sh produces can actually be linked.

Change-Id: I2ddda094361bf0ac77f8d2ae542e4dc7b2cab158
2015-09-17 16:21:22 -07:00
Marco Paniconi
e12ec3615c Merge "Add SVC codec control to set frame flags and buffer indices." 2015-09-17 22:29:07 +00:00
James Zern
9d8decc162 Merge changes from topic 'tile-thread-cleanup'
* changes:
  vp9/decode_tiles_mt: move frame count accum from loop
  VP9Decoder: remove duplicate tile_worker_info
  vp9/decode_tiles_mt: move some inits from inner loop
  vp9_accumulate_frame_counts: pass counts directly
2015-09-17 22:00:23 +00:00
James Zern
e665d0bdd9 Merge "vpx_subpixel_8t_ssse3: fix reg counts/access" 2015-09-17 21:31:14 +00:00
James Zern
683b5a3161 vpx_subpixel_8t_ssse3: fix reg counts/access
fixes build on windows x64; previously 'heightq' i.e., the 64-bit register
was accessed when only the 32-bit value was needed. given this is from a
stack variable the upper bits were undefined.

+ bump register/xmm counts; users of SETUP_LOCAL_VARS touch xmm13 in
64-bit builds and filter_block1d16_v* uses one extra temp variable

Change-Id: I9c768c0b2047481d1d3b11c2e16b2f8de6eb0d80
2015-09-17 12:27:34 -07:00
Jingning Han
c3bf837572 Refactor mbmi_ext structure
This commit removes mbmi_ext_base pointer from MACROBLOCK struct.
Its use case can be fully covered by cpi->mbmi_ext_base pointer.

Change-Id: I155351609336cf5b6145ed13c21b105052727f30
2015-09-17 09:51:45 -07:00
Marco
730cdefd3e Add SVC codec control to set frame flags and buffer indices.
Add SVC codec control to set the frame flags and buffer indices
for each spatial layer of the current (super)frame to be encoded.
This allows the application to set (and change on the fly) the
reference frame configuration for spatial layers.

Added an example layer pattern (spatial and temporal layers)
in vp9_spatial_svc_encoder for the bypass_mode using new control.

Change-Id: I05f941897cae13fb9275b939d11f93941cb73bee
2015-09-17 09:37:15 -07:00
Ronald S. Bultje
50f944272c vp10: do sub8x8 block reconstruction in full subblocks.
This means that we don't reconstruct in 4x4 dimensions, but in
blocksize dimensions, e.g. 4x8 or 8x4. This may in some cases lead
to performance improvements. Also, if we decide to re-introduce
scalable coding support, this would fix the fact that you need to
re-scale the MV halfway the block in sub8x8 non-4x4 blocks.

See issue 1013.

Change-Id: If39c890cad20dff96635720d8c75b910cafac495
2015-09-16 19:35:54 -04:00
Ronald S. Bultje
ed29c2f945 vp10: fix 4:2:2 chroma MVs for 8x4/4x4 blocks.
In vp9, the bottom MV would be the average of the topright and
bottomleft luma MV (instead of the bottomleft/bottomright luma MV).

See issue 993.

Change-Id: Ic91c0b195950e7b32fc26c84c04788a09321e391
2015-09-16 19:35:54 -04:00
Ronald S. Bultje
43be86dbff vp10: remove double MV value check.
This has virtually no effect on coding efficiency, but it is more
logical from a theoretical perspective (since it makes no sense to
me that you would exclude a MV from a list just because it's sign-
inversed value is identical to a value already in a list), and it
also makes the code simpler (it removes a duplicate value check in
cases where signbias is equal between the two MVs being compared).

See issue 662.

Change-Id: I23e607c6de150b9f11d1372fb2868b813c322d37
2015-09-16 19:35:53 -04:00
Ronald S. Bultje
00a203b7bc vp10: move coding of tx_mode element to the non-arithcoded header.
See issue 1040 point 3.

Change-Id: If051b92c24a34d6a39861fb7d7180c5ca32f3d82
2015-09-16 19:35:53 -04:00
Ronald S. Bultje
a3df343cda vp10: code sign bit before absolute value in non-arithcoded header.
For reading, this makes the operation branchless, although it still
requires two shifts. For writing, this makes the operation as fast
as writing an unsigned value, branchlessly. This is also how other
codecs typically code signed, non-arithcoded bitstream elements.

See issue 1039.

Change-Id: I6a8182cc88a16842fb431688c38f6b52d7f24ead
2015-09-16 19:35:03 -04:00
Ronald S. Bultje
3c8e04e939 Merge "vp10: don't reset contextual skip flag if block has no coefficients." 2015-09-16 20:55:14 +00:00
Ronald S. Bultje
623279169a Merge "Add support for color-range." 2015-09-16 20:26:10 +00:00
Jacky Chen
c21ce82832 Merge "VP9 dynamic resizing unit test with bitrate change." 2015-09-16 16:55:14 +00:00
Ronald S. Bultje
a5d930e464 vp10: don't reset contextual skip flag if block has no coefficients.
The implicitly changed value would be used for contextualizing future
skip flags of neighbour blocks (bottom/right), which is certainly not
what was intended. The original code stems from vp8, and was useful
in cases where coding of the skip flag was disabled. In vp9, the skip
flag is always coded. The result of this change is that for bitstream
parsing purposes, decoding of the skip flag becomes independent of
decoding of block coefficients.

See issue 1014.

Change-Id: I8629e6abe76f7c1d649f28cd6fe22a675ce4a15d
2015-09-16 06:41:51 -04:00
Ronald S. Bultje
eeb5ef0a24 Add support for color-range.
In decoder, export (eventually) into vpx_image_t.range field. In
encoder, use oxcf->color_range to set it (same way as for
color_space).

See issue 1059.

Change-Id: Ieabbb2a785fa58cc4044bd54eee66f328f3906ce
2015-09-16 06:41:46 -04:00
Ronald S. Bultje
e562c71783 Merge "vp10: fix entropy counts for the hp bit." 2015-09-16 01:53:44 +00:00
jackychen
ca8f8fd304 VP9 dynamic resizing unit test with bitrate change.
Verify the dynamic resizer behavior for real time, 1 pass CBR mode.
Start at low target bitrate, raise the bitrate in the middle of the
clip, verify that scaling-up does occur after bitrate changed.

Change-Id: I7ad8c9a4c8288387d897dd6bdda592f142d8870c
2015-09-15 18:03:26 -07:00
Angie Chiang
8c1dce86e8 Merge "fix implicit declaration" 2015-09-16 00:20:43 +00:00
James Zern
c667593e1e Merge changes from topic 'fix-vp9-bitstream-test'
* changes:
  vp9_encoder_parms_get_to_decoder: cosmetics
  vp9...parms_get_to_decoder: remove unneeded func
  vp9...parms_get_to_decoder: fix EXPECT param order
  vp9_encoder_parms_get_to_decoder: delete dead code
  fix BitstreamParms test
  vp9_encoder_parms_get_to_decoder: remove vp10
  yuvconfig2image(): add explicit cast to avoid conv warning
  vp9/10 decoder_init: add missing alloc cast
  vp9/10: set color_space on preview frame
  vp10: add extern "C" to headers
  vp9: add extern "C" to headers
2015-09-15 23:14:34 +00:00
Marco Paniconi
9c82fc457e Merge "VP9 dynamic resizing unit test." 2015-09-15 22:26:03 +00:00
Marco Paniconi
f6097ef243 Merge "SVC fix to set worst/best_quality per layer." 2015-09-15 22:06:13 +00:00
jackychen
9ac42bc15c VP9 dynamic resizing unit test.
Verify the dynamic resizer behavior for real time, 1 pass CBR mode.
Run at low bitrate, with resize_allowed = 1, and verify that we get
one resize down event.

Change-Id: Ic347be60972fa87f7d68310da2a055679788929d
2015-09-15 14:36:55 -07:00
Marco
15c43d9ac7 SVC fix to set worst/best_quality per layer.
Allow the worst/best_quality to be set per layer via the
VP9E_SET_SVC_PARAMETERS control.

Change-Id: Icba5ec8ac757152f3bb7860d6010d9174a7bd578
2015-09-15 14:16:07 -07:00
Marco
eb53c69ece Add cyclic refresh parameters to svc-layer context.
For 1 pass CBR spatial-SVC:
Add cyclic refresh parameters to the svc-layer context.

This allows cyclic refresh (aq-mode=3) to be applied to
the whole super-frame (all spatial layers).
This gives a performance improvement for spatial layer encoding.

Addd the aq_mode mode on/off setting as command line option.

Change-Id: Ib9c3b5ba3cb7851bfb8c37d4f911664bef38e165
2015-09-15 10:06:36 -07:00
Debargha Mukherjee
0e1b4fb941 Fix two pass svc encoding
Fixes temporal scalability. Updates were inadvertently turned
off for two pass svc causing crashes due to gf_group.index
growing unchecked.

Change-Id: Iff759946bf61bbde70630347cc8fa4d51a8c2d2f
2015-09-15 06:11:24 -07:00
Yaowu Xu
e723e36da6 Merge "Remove leftover of "frame_parallel_decoding"" 2015-09-15 02:24:36 +00:00
Yaowu Xu
ee825f9372 Remove leftover of "frame_parallel_decoding"
The variable has been removed by a previous commit, but missed this
instance.

Change-Id: Ia34474b0be4945cc6cb9191f0d7cd24a99a4c22e
2015-09-14 18:10:08 -07:00
jackychen
419456617e Change parameters for VP9 dynamic resizing.
Use a smaller window in dynamic resizing and wait a shorter
time after key frame.

Change-Id: I086f840cdec3c6bdaa9acfe11346d919e445973d
2015-09-14 16:17:52 -07:00
Alex Converse
0b762e0c0c Merge "CR: Don't attempt to read qindex_delta for segments CR is unaware of." 2015-09-14 22:59:24 +00:00
Alex Converse
575e81f7c9 CR: Don't attempt to read qindex_delta for segments CR is unaware of.
Found by the remoting VideoEncoderVpxTest.Vp9LossyUnchangedFrame unit
test under asan.

Change-Id: Icac63051bf37c7355e661837b57c257d58c764fc
2015-09-14 13:55:30 -07:00
Marco Paniconi
bb581f4e83 Merge "For 1 pass: always use the normative filter in vp9_scale_if_required()" 2015-09-14 20:36:34 +00:00
Ronald S. Bultje
1e9e9ce2dc vp10: fix entropy counts for the hp bit.
The counts didn't take usehp into account, which means that if the
scope of the refmv is too large for the hp bit to be coded, the value
(always 1) is still included in the stats. Therefore, the final
counts will not reflect the entropy of the coded bits, but rather the
entropy of the combination of coded bits and the implied value (which
is always 1). Fix that by only including counts if the hp bit is
actually coded.

See issue 1060.

Change-Id: I19a3adda4a8662a05f08a9e58d7e56ff979be11e
2015-09-14 16:13:59 -04:00
Marco
4d1424faf9 For 1 pass: always use the normative filter in vp9_scale_if_required()
The normative (convolve8) filter is optimized/faster than
the nonnormative one. Pass usage of scaler (normative/nonomorative)
to vp9_scale_if_required(), and always use normative one for 1 pass.

Change-Id: I2b71d9ff18b3c7499b058d1325a9554de993dd52
2015-09-14 13:13:32 -07:00
Ronald S. Bultje
48f0168e95 Merge "vp10: merge frame_parallel_decoding_mode and refresh_frame_context." 2015-09-14 18:24:24 +00:00
James Zern
12355c4c4c configure: add --extra-cxxflags option
same usage as --extra-cflags

Change-Id: Iff2ed7b8ebb6e51610ee0851aeec08413367ab23
2015-09-12 10:25:28 -07:00
Angie Chiang
fe776ce61f add range_check for fdct in vp10
Unify the style of fdct4() fdct8() fdct16()
Add fdct32()
Add range_check() at each stage
Add unit test at ../../test/vp10_dct_test.cc

Change-Id: I13f76d9046c3ea473c82024b09a5bc8662e2c28e
2015-09-12 03:26:09 +00:00
James Zern
9759c3d542 third_party/libwebm: pull from upstream.
Upstream hash: 476366249e1fda7710a389cd41c57db42305e0d4

Changes from upstream since last update:
4763662 mkvparser: fix type warnings
267f71c mkvparser: SafeArrayAlloc fix type warning
f1a99d5 mkvparser: s/LONG_LONG_MAX/LLONG_MAX/ for compatibility
bff1aa5 mkvparser: add msvc compatibility for isnan/isinf

Change-Id: Ie0375e564fc74b3b296744d0039830d2f77b83b6
2015-09-11 19:02:24 -07:00
Ronald S. Bultje
d1474f02aa vp10: merge frame_parallel_decoding_mode and refresh_frame_context.
See issue 1030. The value of frame_parallel_decoding_mode was ignored
in vp9 if refresh_frame_context was 0, so instead make it a 3-member
enum where the dependency is obviously stated.

Change-Id: I37f0177e5759f54e2e6cc6217023d5681de92438
2015-09-11 19:33:46 -04:00
Ronald S. Bultje
c92c50f2fe vpxdec: remove implied --output-bit-depth=8 for --yv12.
Change-Id: I28c939db49334572476aa2b428ec93111d4e869d
2015-09-11 19:33:45 -04:00
Ronald S. Bultje
ef73bbf778 vp10: remove duplicate frame_parallel_decode field.
Keep the one in VP10_COMMON in favour of the one in VP10_DECODER.

Change-Id: Ia81983ccc95d83829dc815e28d9b1143e16e27b1
2015-09-11 18:37:24 -04:00
Ronald S. Bultje
eba342af87 Don't convert bitdepth for !single-file or MD5.
... unless --output-bit-depth was set.

Change-Id: I3482eaf12e245eec24427518fccdd173f890f4b4
2015-09-11 18:37:24 -04:00
Ronald S. Bultje
812fbc5ecb Merge "Make reset_frame_context an enum." 2015-09-11 22:36:49 +00:00
Marco Paniconi
cd9ae6d758 Merge "Avoid scaling last_source, unless needed." 2015-09-11 21:39:06 +00:00
Angie Chiang
894ab8be7e fix implicit declaration
include vpx_dsp_rtcd.h to avoid implicit declaration of
vp10_highbd_fdct32x32_rd_c

Change-Id: I0b9ad50381a302750138deab14d2d5ac31f286ee
2015-09-11 12:17:15 -07:00
Ronald S. Bultje
62da0bf162 Make reset_frame_context an enum.
In vp9, [0] and [1] had identical meaning, so merge them into a
single value. Make it impossible to code RESET_FRAME_CONTEXT_NONE
for intra_only frames, since that is a non-sensical combination.

See issue 1030.

Change-Id: If450c74162d35ca63a9d279beaa53ff9cdd6612b
2015-09-11 15:12:02 -04:00
Marco
e8a4a3e2b1 Avoid scaling last_source, unless needed.
Save some encoding time, for the case of spatial layers
or under dynamic resizing mode.

Change-Id: If4a8eb6f0376c3d2dde8465fde6bfd86ab704920
2015-09-11 11:53:25 -07:00
James Zern
f79f71fc22 Merge "Fix vp10 high bit-depth build" 2015-09-11 18:27:49 +00:00
Jingning Han
481b834842 Fix vp10 high bit-depth build
Change-Id: Ie3daed0b282b43ef81d2f8797ac1f6e8bde7d65e
2015-09-11 08:56:29 -07:00
Marco
6ddbc845cc Remove unneeded/incorrect comment.
Change-Id: I5c923223c284ad4fda0c45572a66bebc8528dd1d
2015-09-11 08:49:13 -07:00
James Zern
d318d7cb6f Merge "build: modify default ARFLAGS / .a target" 2015-09-11 02:30:07 +00:00
Ronald S. Bultje
ad747e94d0 Merge "Add misc_fixes experiment." 2015-09-11 02:00:45 +00:00
Ronald S. Bultje
3ef3dcb8b6 Merge "Don't reset sign_bias fields in vp10_setup_past_independence()." 2015-09-11 02:00:30 +00:00
Angie Chiang
501efcad4a Merge "Isolate vp10's fwd_txfm from vp9" 2015-09-11 00:10:45 +00:00
Alex Converse
3c092e2474 Merge changes Ibb308526,I99e330f8
* changes:
  Prevent CR in screen mode from refreshing flat inter blocks forever.
  For screen content consider intra uv when color_sensitivity is set.
2015-09-10 23:04:46 +00:00
Jingning Han
b50e0badbc Merge "Take out reference_masking speed feature" 2015-09-10 23:03:06 +00:00
Jingning Han
b999f1509c Merge "Take out skip_encode speed feature in vp10" 2015-09-10 23:02:38 +00:00
Jingning Han
7f71d1e00a Merge "Remove speed features in vp10" 2015-09-10 23:02:27 +00:00
Angie Chiang
b0bfea4f5f Merge "Isolate vp10's inv_txfm from vp9" 2015-09-10 22:51:02 +00:00
Angie Chiang
ee5b80597e Isolate vp10's fwd_txfm from vp9
1) copy fw_txfm related files from vpx_dsp tp vp10

    vpx_dsp/fwd_txfm.h → vp10/common/vp10_fwd_txfm.h
    vpx_dsp/fwd_txfm.c → vp10/common/vp10_fwd_txfm.c
    vpx_dsp/x86/fwd_dct32x32_impl_sse2.h →  vp10/common/x86/vp10_fwd_dct32x32_impl_sse2.h
    vpx_dsp/x86/fwd_txfm_sse2.c →  vp10/common/x86/vp10_fwd_txfm_sse2.c
    vpx_dsp/x86/fwd_txfm_impl_sse2.h → vp10/common/vp10_fwd_txfm_impl_sse2.h

Change-Id: Ie9428b2ab1ffeb28e17981bb8a142ebe204f3bba
2015-09-10 15:19:43 -07:00
Angie Chiang
87175ed592 Isolate vp10's inv_txfm from vp9
1) copy following files from vpx_dsp/ to vp10/common/
vp10_inv_txfm.c
vp10_inv_txfm.h
vp10_inv_txfm_sse2.c
vp10_inv_txfm_sse2.h

2) change the function prefix "vpx_" to "vp10_" in above files

3) add unit test at vp10_inv_txfm_test.cc

Change-Id: I206f10f60c8b27d872c84b7482c3bb1d1cb4b913
2015-09-10 15:08:37 -07:00
Alex Converse
3d6b8a667f Prevent CR in screen mode from refreshing flat inter blocks forever.
Take the minimum last_codec_q_map on inter skip.

Change-Id: Ibb308526dd19793bb359f51ebd7b48d8692903fd
2015-09-10 15:03:13 -07:00
Alex Converse
d5c0e366d7 For screen content consider intra uv when color_sensitivity is set.
Change-Id: I99e330f8a779b4d564c19ef4639a881cb68910ae
2015-09-10 15:03:09 -07:00
Jingning Han
1eb760e55d Take out reference_masking speed feature
This condition is not effectively in use. The actual reference
frame masking is done in other route.

Change-Id: Ia59c843bcac7243dada92f0f67658d7ce43df5e8
2015-09-10 12:57:48 -07:00
James Zern
1b3d775366 build: modify default ARFLAGS / .a target
remove 'u' and specify all objects to allow objects with the same
basename to be added and a incremental rebuild to succeed

fixes issue #1067

Change-Id: Id0ebc89be826a026f1bbf21b4e32a2b1af45154d
2015-09-10 12:54:01 -07:00
Vignesh Venkatasubramanian
dd5510750a third_party/libwebm: pull from upstream.
Upstream hash: a58c32339e06e5d672a58cdd5844cea0a661e735

Changes from upstream since last update:
a58c323 mkvmuxer: Add codec id constant for VP10.
714f3c4 mkvparser: validate results in EBMLHeader::Parse.
cec98d4 mkvparser: Correct the ReadID implementation.
eb36ae4 Merge changes I029a268e,Ia272b150,I5c4d1bbc,Ia47a2478,I3a2e2226
229f493 Merge "mkvparser: Segment::AppendCluster asserts to error checks."
287faf9 Merge "mkvparser: Segment::DoLoadClusterUnknownSize asserts to error checks."
1a87b59 Merge "mkvparser: Segment assert clean up."
d26ec69 mkvparser: Cluster::Parse clean up.
f2029be mkvparser: Disallow EBML IDs equal to 0.
19f5694 mkvparser: Cluster::Load clean up.
27a07c1 mkvparser: Segment::Load asserts to error checks.
d0313dd mkvparser: Segment::PreloadCluster asserts to error checks.
b108695 mkvparser: Segment::AppendCluster asserts to error checks.
4630f80 mkvparser: Segment::DoLoadClusterUnknownSize asserts to error checks.
841a9b5 mkvparser: Segment assert clean up.
8c4ca2e Merge "mkvparser: Make mkvparser namespace usage uniform."
49ae6f0 Merge "mkvparser: Fix include order."
0735bb5 mkvparser: Make mkvparser namespace usage uniform.
93b24c4 mkvparser: Fix include order.
a57d660 sample_muxer: fix Segment memory leak on error
1c5bd94 mkvparser: Cues, change asserts to error checks.
7f77201 Merge "mkvparser: Add ReadID."
795fd56 mkvparser: set kMaxAllocSize explicitly
23bb18b mkvparser: Add ReadID.
7b57e37 mkvparser: add SafeArrayAlloc.
83a1f68 mkvparser: Remove buf_t typedef.
5074714 Merge changes Ia1265a63,I799d54df,Icfc582e4,I3425f608
b181105 Merge changes Ie4318152,I1e65f30f
06b4337 Block::Parse: replace pos asserts w/checks
b366a98 Cluster::ParseBlockGroup: replace pos asserts w/checks
2857b23 Tags::*::Parse: replace pos asserts w/checks
f1b2cfa Chapters::*::Parse: replace pos asserts w/checks
ca80629 Merge "mkvparser: Cues::PreloadCuePoint now returns bool."
6b4b297 Block::Parse: use int64 to aggregate laced frame sizes
c0d2c98 UnserializeFloat: check result for Inf/NaN
1a6dc4f mkvparser: Cues::PreloadCuePoint now returns bool.
275ac22 mkvparser: Cluster::Create clean up.
064f2ee Segment::PreloadCluster(): return a bool status
3778408 Segment::AppendCluster(): return a bool status
e86d046 mkvparser: check Cluster::Create() return
f9885b5 mkvparser: check allocations
21ee398 mkvparser: Segment::Load fail w/missing info/tracks
08fb654 Merge changes I264e68b2,Ife6190a4,Ibf37245f,I06efadb5,I88b5dfec, ...
c896095 mkvparser/Cluster: convert asserts to failure returns
680b4bf mkvparser/Tracks: convert asserts to failure returns
5889e6c mkvparser/Track: convert asserts to failure returns
5135c4c mkvparser/ContentEncoding: convert asserts to failure returns
b0e4f32 mkvparser/Cues: convert asserts to failure returns
13ccc7f mkvparser/UnserializeInt: fix sign flip
db3f9bb mkvparser/SeekHead: convert asserts to failure returns
8de3654 mkvparser/Segment: convert asserts to failure returns
fa2aa7d SeekHead::Parse(): fix assertion failure
d9bdade sample{,_muxer}: check SegmentInfo::GetInfo() return
07a9cf7 Merge "mkvparser: Remove some asserts."
c56ee29 mkvparser: Remove some asserts.
d901324 Merge "mkvparser: Remove some asserts from SegmentInfo::Parse."
7f7d898 Fix case sensitivity issue in iosbuild.sh.
42fe2cd mkvparser: Remove some asserts from SegmentInfo::Parse.
8bccd9c Merge "mkvparser: avoid rollover in UnserializeInt()."
7a2fa0d mkvparser: avoid rollover in UnserializeInt().
44f5ce6 mkvparser: Disallow durations in seconds greater than LONG_LONG_MAX.
b521e30 Merge "mkvparser: Segment::ParseHeaders() avoid rollover and bad int sizes."
7680e2a mkvparser: Check for errors in Match().
39a315f mkvparser: Segment::ParseHeaders() avoid rollover and bad int sizes.
f250ace mkvparser: Handle invalid lengths and rollover in ParseElementHeader().
cd96a76 mkvparser: Avoid rollover/truncation in UnserializeString().
8e8b3db Merge "mkvparser: Add error checking in Block::Parse."
82b7e5f sample: correct mbstowcs() error check
04d7809 sample: check allocation return
986b64b mkvparser: Add error checking in Block::Parse.

Change-Id: I39beef84962d6341f8ce53be06807b3e2068f777
2015-09-10 12:47:21 -07:00
Jingning Han
f137697c32 Take out skip_encode speed feature in vp10
Change-Id: Ic39d4523e78863c816b0fc85f56ea5ae5e0b3310
2015-09-10 12:45:39 -07:00
Jingning Han
4fa8e73249 Remove speed features in vp10
Take out speed features that affect the compression performance
to simplify the coding route. This commit removes the motion field
mode search used in speed 3.

Change-Id: Ifdf6862cb1ece8261125a56d9d89bcef60758c00
2015-09-10 12:25:33 -07:00
Vignesh Venkatasubramanian
09969ac9a2 webmdec: Handle codec id being NULL.
WebM files could have CodecId missing in the track headers. Treat those files as
unknown input file type in vpxdec.

Fixes issue #1064.

Change-Id: I6c3bb7b4bd3a4f5c244312482a5996f8b68db3f3
2015-09-10 10:44:59 -07:00
Marco Paniconi
2ff108aac6 Merge "vp8: Small adjustment to cyclic_refresh max_mbs_perframe." 2015-09-10 15:47:49 +00:00
James Zern
ba317bc9dc vp9_encoder_parms_get_to_decoder: cosmetics
fix indent, */& association, join a few lines

Change-Id: Idaca24b87b574788f9508168082d0ade3d4e9ecc
2015-09-10 00:21:59 -07:00
James Zern
fc4ddc0d00 vp9...parms_get_to_decoder: remove unneeded func
removes a redundant cast in the process

Change-Id: Ie3727a0938c0093f70f25a875c2c58671938d45c
2015-09-10 00:21:59 -07:00
James Zern
67774db59f vp9...parms_get_to_decoder: fix EXPECT param order
(expected, actual)

Change-Id: I449e7b6c51aa85cdde008d2fad5a9629970222a9
2015-09-10 00:21:58 -07:00
James Zern
21952bab12 vp9_encoder_parms_get_to_decoder: delete dead code
the only input is y4m, there's no need to test for yuv.

Change-Id: Ie5b55ea4af44ad79a55304ef5636a8ad7ed30bb8
2015-09-10 00:21:58 -07:00
James Zern
0fe900a543 fix BitstreamParms test
avoid duplicating internal structures and include vp9_dx_iface.c
directly. these had fallen out of sync after the frame-parallel branch
merge.

Change-Id: I604cfbffa95abe2a1c8e906a696f32436b1422ed
2015-09-10 00:21:57 -07:00
James Zern
7793a51ddc vp9_encoder_parms_get_to_decoder: remove vp10
this file needs to be reworked to remove the duplication of codec
internals + allow for divergence of vp9 and vp10

Change-Id: I6266b94ccfbc24dae30148f134804b52aa411b88
2015-09-10 00:21:56 -07:00
James Zern
58cb7886c3 yuvconfig2image(): add explicit cast to avoid conv warning
prevents an int -> vpx_img_fmt_t conversion warning with high-bitdepth
as it modifies the image format

Change-Id: Ie3135d031565312613a036a1e6937abb59760a7e
2015-09-10 00:19:18 -07:00
James Zern
a124bc7a81 vp9/10 decoder_init: add missing alloc cast
Change-Id: I1ba4400d67095f3a360fb7d97ee8d118d4f741fe
2015-09-09 23:15:59 -07:00
James Zern
a2e61adc96 vp9/10: set color_space on preview frame
Change-Id: If9176ce6ed3eb6c7ef8ffd1378456cb95b4aeb86
2015-09-09 23:15:59 -07:00
James Zern
55f5d557f2 vp10: add extern "C" to headers
Change-Id: Ie2e8b37fa01ce8d6b993684f431f3159d511cfb1
2015-09-09 23:15:59 -07:00
James Zern
b09aa3ac54 vp9: add extern "C" to headers
Change-Id: I1b6927ad820f99340985b094d415aaab14defaf4
2015-09-09 23:15:59 -07:00
James Zern
992d9a062a Merge "Fix ioc warnings related to sub8x8 reference frame" 2015-09-10 06:10:44 +00:00
Tom Finegan
8fa5ca4899 Merge "Revert "Fix building with iOS 9 beta SDK"" 2015-09-10 01:36:29 +00:00
Jingning Han
b6d71a308c Fix ioc warnings related to sub8x8 reference frame
Access scaled reference frame in the sub8x8 rate-distortion
optimization loop only when the current test mode is an inter mode.
This prevents an ioc warning triggered by sending intra_frame index
to fetch scaled reference frame.

Change-Id: I6177ecc946651dd86c7ce362e3f65c4074444604
2015-09-09 15:48:00 -07:00
jackychen
f5617fd083 Change the qp threshold of VP9 dynamic resizing.
Change-Id: I1efe086191665ff8fa063f03d8e2032024dc090f
2015-09-09 15:47:07 -07:00
Marco
3140e90175 vp8: Small adjustment to cyclic_refresh max_mbs_perframe.
For 3 temporal layers, reduce somewhat the
cyclic_refresh_mode_max_mbs_perframe parameter, from 20% to ~14%.
Small increase in PSNR/SSIM metrics.

Change-Id: Ia216fa5474048f1ef7fe3db88cd60dfef2a1bf8a
2015-09-09 15:34:58 -07:00
Marco Paniconi
64677c7e99 Merge "SVC sample encoder: Change some settings/update." 2015-09-09 18:05:31 +00:00
Marco
465eaceb68 SVC sample encoder: Change some settings/update.
Change settings for 1 pass CBR.
And only use SET_SVC control(s) if there is at least 1 layer (spatial or temporal).
This allows sample encoder to also work for 1 layer case.

Change-Id: I5b0a33c25afb2f24a3a8aa4ec8ade9afc87cd702
2015-09-09 08:58:14 -07:00
Tom Finegan
d8808d365e Revert "Fix building with iOS 9 beta SDK"
This reverts commit 78637b61361ab11425afd4a67d43c4df948647a6.

Breaks armv7-darwin targets with current SDK (iOS 8/Xcode 6.4).

BUG=https://code.google.com/p/webm/issues/detail?id=1062

Change-Id: I58b27950f330557154d681a894114eadfbd3e593
2015-09-09 05:28:42 -07:00
Jingning Han
50461166b7 Enable sub8x8 inter mode with scaled ref frame in RD optimization
This commit allows the encoder to include sub8x8 inter mode with
scaled reference frame in the rate-distortion optimization scheme.

Change-Id: Ibbe9678801592826ef22566566dcdeeb008350d5
2015-09-09 00:29:06 +00:00
Jingning Han
0278ae16f6 Merge "Fix the sub8x8 block inter prediction with scaled reference frame" 2015-09-09 00:28:42 +00:00
Debargha Mukherjee
e6ec22cb8c Merge "Remove some trailing whitespaces" 2015-09-09 00:26:36 +00:00
Marco
bda690d446 Move cyclic_refresh struct into .h file.
Change-Id: I9327cd52d0ec050887ba7e591b094d74bd36bce8
2015-09-08 13:49:24 -07:00
Jingning Han
42b0560319 Fix the sub8x8 block inter prediction with scaled reference frame
Sync the encoder's buffer offset calculation for sub8x8 block motion
compensated prediction with scaled reference frame to match the
decoder's behavior. This resolves an enc/dec mismatch issue when
sub8x8 inter mode with scaled is turned on.

Change-Id: I4bab3672b007a5ae0c992f8a701341892d2458b0
2015-09-08 11:09:30 -07:00
Ronald S. Bultje
1589ecb0ae Add misc_fixes experiment.
Will be used to hold various trivial bitstream fixes.

Change-Id: Ic8ba07a2ae392db7c956ebae124913afe2ae4409
2015-09-08 14:05:08 -04:00
Ronald S. Bultje
e1d22db451 Don't reset sign_bias fields in vp10_setup_past_independence().
The fields are always coded in the frame itself, so there is never any
dependency on past frames. In practice, this fixes sign_bias being
ignored when error_resilient_mode=1.

See issue 1011.

Change-Id: I9d134ef6b445ced4d100fa735ce579855a0fa5af
2015-09-08 13:48:20 -04:00
Debargha Mukherjee
1c8567ff09 Remove some trailing whitespaces
Change-Id: Icf06d35ca347713253d1eba341a894b51efa81a9
2015-09-08 01:31:04 -07:00
James Zern
ad0ac045d5 vp9/decode_tiles_mt: move frame count accum from loop
the check performed within the while was redundant; simply place the
accumulation after all tiles are decoded.

Change-Id: I6a74e87257c775fd8bfc8ac4511e4a6ad8f18346
2015-09-04 20:24:29 -07:00
James Zern
5e1e6a9f17 VP9Decoder: remove duplicate tile_worker_info
unnecessary since: 86f4a3d Remove tile param

Change-Id: Iff75d3acf6c5aade833ea0a214c919279403cf97
2015-09-04 19:47:33 -07:00
James Zern
2d06b08cba vp9/decode_tiles_mt: move some inits from inner loop
worker copies of pbi/xd/counts only need to be initialized once

Change-Id: I0081a85b9c82d39573c22d2fd2c670ec2f7b8715
2015-09-04 19:47:33 -07:00
James Zern
0548046ae3 vp9_accumulate_frame_counts: pass counts directly
Change-Id: Ic3c6cfba5b1867c335f2834da936e20caec8597a
2015-09-04 19:47:33 -07:00
Ronald S. Bultje
536a90970b Merge "Make update_map/temporal_update fields implicit for keyframes." 2015-09-04 23:53:24 +00:00
James Zern
9511b948ef Merge "VPX: subpixel_8t_ssse3 asm using x86inc" 2015-09-04 05:30:57 +00:00
Scott LaVarnway
195883023b VPX: subpixel_8t_ssse3 asm using x86inc
This is based on the original patch optimized for 32bit
platforms by Tamar/Ilya and now uses the x86inc style asm.
The assembly was also modified to support 64bit platforms.

Change-Id: Ice12f249bbbc162a7427e3d23fbf0cbe4135aff2
2015-09-03 20:35:51 -07:00
Ronald S. Bultje
d88cee3712 Make update_map/temporal_update fields implicit for keyframes.
These frame types cannot make bitstream parsing depend on previous
frames, so the hypothetical combinations of e.g. keyframe=1 and
update_map=0 or keyframe=1 and temporal_update=1 are non-sensical.
Therefore, make it impossible to code such combinations in the vp10
bitstream header.

See issue 1044.

Change-Id: I3f0a83d5c7e3989541a469a909471424a285239d
2015-09-03 21:19:45 -04:00
Adrian Grange
4679af1ce9 Merge "Fix to dynamic resize mode under change_config()." 2015-09-03 21:44:45 +00:00
Marco
be3489eaf4 Fix to dynamic resize mode under change_config().
If the encoder dynamic resize is triggered and change config()
is then called, it will reset the current (resized) codec width/height
back to the the config (unresized) width/height (which will then
prevent the resizing action from occurring in encoder_loop).

Avoid this by checking for a change in the config width/height
before resetting the cm->width/height.

Change-Id: Id9d50c0ee8a943abe4b6c72bbaa02d9696f93177
2015-09-03 13:30:26 -07:00
Ronald S. Bultje
ecd34e6494 Unify coding order of MC filters between blocks and frame header.
In VP9, the order for frame header was: [0] smooth, [1] regular, [2]
sharp, [3] bilinear. Per-block, the order was [0] regular, [1] smooth
and [2] sharp. For VP10, swap smooth/regular in the frame header so
that the block ordering and frame header ordering are interchangeable.

See issue #1046.

Change-Id: Ic9ec5964874375e40cd59bef50b489a76cbe4365
2015-09-03 09:34:55 -07:00
James Zern
e5732bcf05 test/*.h: use inline rather than INLINE
inline is always available in c++

Change-Id: Ie8e4fc4df75309b649d7ef36bb5aadd95554035f
2015-09-02 18:44:28 -07:00
James Zern
b5c50ae91f Merge "Revert "add range_check for fdct in vp10"" 2015-09-03 01:25:44 +00:00
James Zern
43a4900ea3 Revert "add range_check for fdct in vp10"
Tests fail to build.

This reverts commit f78d6aa77245cea5cd7f630a20f4e6d576679e7f.

Change-Id: Ia220270517ded273c65a7ab965d82edb696663c9
2015-09-03 00:23:16 +00:00
Angie Chiang
3080691e92 Merge "add range_check for fdct in vp10" 2015-09-02 22:27:47 +00:00
Angie Chiang
f78d6aa772 add range_check for fdct in vp10
Unify the style of fdct4() fdct8() fdct16()
Add fdct32()
Add range_check() at each stage
Add unit test at ../../test/vp10_dct_test.cc

Change-Id: I9e912b2c5683862e65c5a21abc3e1c260cca4576
2015-09-02 13:50:17 -07:00
Johann Koenig
bdb8afbbc0 Merge changes If253fb95,I1c8a792c,I49f9b10f,I15472738,I1e7f3c32
* changes:
  test: limit the valid image size on OS/2
  configure: add -Zhigh-mem to LDFLAGS on OS/2
  configure: disable PIC on OS/2
  Makefile: add $(STACKREALIGN) to CFLAGS for vp9_reconintra.c
  x86inc.asm: fix NASM compilation
2015-09-02 19:21:46 +00:00
KO Myung-Hun
9af8c39694 test: limit the valid image size on OS/2
Without this, test_libvpx crashes at VP9FrameSizeTestsLarge.ValidSizes
on OS/2.

Change-Id: If253fb95a04216babed56458f0fab8c70523fc7e
2015-09-02 19:04:16 +09:00
KO Myung-Hun
e909da888c configure: add -Zhigh-mem to LDFLAGS on OS/2
-Zhigh-mem enables to allocate very large memory on OS/2.

Change-Id: I1c8a792cc792c65ce9539a6d3d6b77fc4767848a
2015-09-02 19:04:15 +09:00
KO Myung-Hun
8a6f0551f1 configure: disable PIC on OS/2
Change-Id: I49f9b10faa059decf18e123a1f88738071b9c2b8
2015-09-02 19:04:14 +09:00
KO Myung-Hun
fb2dd7366b Makefile: add $(STACKREALIGN) to CFLAGS for vp9_reconintra.c
Without this, test_libvpx crashes at
VP9MultiThreadedFrameParallel.PauseSeekResume on OS/2.

Change-Id: I15472738f4166d97cb49868652982d351a291c11
2015-09-02 19:04:14 +09:00
KO Myung-Hun
6b56405f5e x86inc.asm: fix NASM compilation
Change-Id: I1e7f3c32969dac7911921062b396750302878c2e
2015-09-02 19:04:13 +09:00
Johann Koenig
356c944782 Merge changes I2e0cc72a,I63a7da78,I4aee2600,I71113505,I3dce6c70, ...
* changes:
  Only build multithreaded functions on mt builds.
  Don't build calc_psnr for high bit depth.
  Enable missing dual lpf test
  Remove unused VP10 functions.
  Mark VP10 functions as 'INLINE'
  Remove unused functions from test files
  Only build append_negative_gtest_filter when it is used.
  Add INLINE decoration to static test functions
2015-09-02 02:46:54 +00:00
Johann
c7f58bcc70 Only build multithreaded functions on mt builds.
Change-Id: I2e0cc72a0543bfea1d2d3499b9906519d5cb3f15
2015-09-01 17:05:05 -07:00
Johann
bd89a34c3a Don't build calc_psnr for high bit depth.
Change-Id: I63a7da7857534dcb4c69ed316c1feadea9ffb45b
2015-09-01 17:05:05 -07:00
Johann
f642ee891b Enable missing dual lpf test
Found with -Wunused-function
Change-Id: I4aee260016ae522e3fbbd72977ff09a8ebe5f3cf
2015-09-01 17:05:05 -07:00
Johann
e5357230e2 Remove unused VP10 functions.
Change-Id: I711135054f02883289cca2efb1f109637009ffbb
2015-09-01 17:05:04 -07:00
Johann
7e14baa1da Mark VP10 functions as 'INLINE'
Change-Id: I3dce6c702344a5cb5aaf9de1e4be44c53f9ce7e9
2015-09-01 17:05:04 -07:00
Johann
906ec30c10 Remove unused functions from test files
Change-Id: Id479a83fe3cb7d989a490328b3ff526530777f81
2015-09-01 17:05:04 -07:00
Johann
95633d0e80 Only build append_negative_gtest_filter when it is used.
Change-Id: If6fec02fd8125b368ea83c99208575ac0d4a662b
2015-09-01 17:03:55 -07:00
Johann
9a5e0d4038 Match improved vp9/10 style in libs.mk
Change-Id: I5402c4e4a7d028f4865f429ec5ac6cb592aa2dcb
2015-09-01 21:39:55 +00:00
Johann
e5b76ba26e Add INLINE decoration to static test functions
Fixes "unused function" warnings.

Change-Id: Idc0cd06189917c37dead17d923ac7f9ecef18983
2015-09-01 12:46:29 -07:00
Yunqing Wang
2474bea46e Merge "Disable temporal/spatial svc test in VP10" 2015-09-01 19:01:13 +00:00
Yunqing Wang
eb1566b632 Disable temporal/spatial svc test in VP10
The svc tests are disabled since it is not supported in VP10.

Change-Id: Ie6801e7a573b27afd1ea951bf037ccbae1201e8b
2015-08-31 22:46:44 -07:00
Johann
c5f11912ae Include vpx_dsp_common.h when using VPXMIN/MAX
Change-Id: I2e387a06484a06301f3cd6600c4ba2f4335b61ee
2015-08-31 14:36:35 -07:00
Yunqing Wang
9a9b1cf772 Merge "Fix an indent" 2015-08-31 17:49:45 +00:00
Johann Koenig
6a467ee711 Merge "Check CONFIG_VP<N> instead of encoder and decoder" 2015-08-31 17:46:20 +00:00
Yaowu Xu
08507eb82a Merge "Expand the idct4_c() function in idct8_c()" 2015-08-31 16:38:36 +00:00
Yunqing Wang
36c51c7afe Fix an indent
An indent fix in bitstream.c.

Change-Id: Ia47e9ac5b01490cb2173a254444848b7bed56e5c
2015-08-31 08:41:50 -07:00
James Zern
d5657905b6 vp10: fix high bitdepth build
broken since:
c147c4d vp10 cleanup: remove svc code

Change-Id: Id703502b2d645fc051a5d9a23e6f1715d92a116b
2015-08-29 15:47:46 -07:00
James Zern
cc29cebde6 Merge changes from topic 'vp9-enc-static-fns'
* changes:
  vp9_mcomp: make search functions private
  vp9_mbgraph: use vp9_full_pixel_search(HEX)
  vp9_temporal_filter: use vp9_full_pixel_search(HEX)
  vp9_firstpass: make vp9_init_subsampling private
  vp9_encoder: make vp9_alloc_compressor_data private
2015-08-29 03:25:29 +00:00
James Zern
6d585393a2 update gitignore
Change-Id: I01c8ba864b73fd3a66c10442041274767ac87bf1
2015-08-28 20:22:00 -07:00
James Zern
ff03d5448a vp9_mcomp: make search functions private
vp9_full_pixel_search() can be used as a replacement as it dispatches to
all search methods

Change-Id: I57fcb79c1362b569dc95237bdcc8390f54efd440
2015-08-28 18:54:10 -07:00
James Zern
4e21830987 vp9_mbgraph: use vp9_full_pixel_search(HEX)
instead of calling vp9_hex_search() directly. this will allow the
function to be made private

Change-Id: I2f9d4779763aa5b24eda4eb01c78954e061e45ac
2015-08-28 18:54:09 -07:00
James Zern
d743a55adb vp9_temporal_filter: use vp9_full_pixel_search(HEX)
instead of calling vp9_hex_search() directly. this will allow the
function to be made private

Change-Id: I8c8cfc61fca4faef593c1c3fc29824dc417cae22
2015-08-28 18:54:08 -07:00
James Zern
c6eadc3309 vp9_firstpass: make vp9_init_subsampling private
Change-Id: I03b2ae99ec2e212c76bf815de7d5745b5c965d57
2015-08-28 18:54:08 -07:00
James Zern
5e35c3c9a0 vp9_encoder: make vp9_alloc_compressor_data private
Change-Id: I38b4de692f4f7e880766316783981cbd1134bed9
2015-08-28 18:53:57 -07:00
Johann Koenig
0231e27bf0 Check CONFIG_VP<N> instead of encoder and decoder
If either the encoder or the decoder is enabled, CONFIG_VP<N> will be
set. This simplifies the conditional and passes the chromium update
script when CONFIG_ values are passed in with 'yes' and 'no' values.

This was failing because it was checking against empty strings but
they are set to 'no'

Change-Id: I02ecd557210088ba1458cd0e89eead5666f6597a
2015-08-28 16:18:18 -07:00
Yunqing Wang
180b1804e5 Merge "vp10 cleanup: remove svc code" 2015-08-28 22:23:31 +00:00
Marco Paniconi
4dcbf0a809 Merge "vp8: modifcatiion to skin map computation." 2015-08-28 21:49:56 +00:00
James Zern
b6d874d73b Merge "encode_test_driver: test for failure prior to encode" 2015-08-28 20:31:01 +00:00
Yunqing Wang
c147c4d65c vp10 cleanup: remove svc code
Spatial/temporal svc code was removed. Verified using Borg test,
and the results before and after the change are matching.

Change-Id: I4c2ee5cd560428e3e50be02e57e5871ef4246390
2015-08-28 11:53:32 -07:00
Angie Chiang
45db71d0ac Expand the idct4_c() function in idct8_c()
Change-Id: I5afa3c351ba7c5e7deb3889f7471619ac60af255
2015-08-28 10:53:11 -07:00
Marco
bc0a974310 Fix to golden update in cyclic_refresh.
For one pass CBR: only check for updating refresh_golden
if ext_refresh_frame_flags_pending is not set (i.e., == 0).
And move the resetting of ext_refresh_frame_flags_pending = 0
down to after the encode_loop (and account for dropped frames).

This is to prevent changing refresh_golden flga when the user
supplies the reference/update flags.

Change-Id: I4d87b3e705ba43f243667e367503b585c61e2a54
2015-08-28 10:22:09 -07:00
James Zern
6201a256f4 Merge "configure: append --extra-cflags to final set" 2015-08-28 02:55:49 +00:00
James Zern
d1ff1e9ffb encode_test_driver: test for failure prior to encode
limits the amount of failure messages should e.g., a test file fail to
be opened

Change-Id: I0b30da0faa78cada23a226b577b3a48c74a896cd
2015-08-27 16:05:52 -07:00
James Zern
820302a394 vp8: use VPX(MIN|MAX) from vpx_dsp_common.h
remove MIN/MAX defines in vp8/common/common.h

Change-Id: I41520f34af175e05b263ebd12198f4de29a967db
2015-08-27 15:31:24 -07:00
Johann Koenig
5c245a46d8 Merge changes I53b5bdc5,Ib81168a7,Ie0113945
* changes:
  Only build ssse3 filter functions on 64 bit
  Clean up unused function warnings in vp8 encoder
  Clean up unused function warnings in vp8 onyx_if.c
2015-08-27 20:58:53 +00:00
Johann Koenig
0ae1c83277 Merge "Clean up unused function warnings in vp8 common" 2015-08-27 20:57:23 +00:00
Johann Koenig
18ea2a7e0c Merge "Add sse2 versions of halfpix variance" 2015-08-27 20:56:32 +00:00
Johann
a28b2c6ff0 Add sse2 versions of halfpix variance
These were lost in the great sub pixel variance move of
6a82f0d7fb9ee908c389e8d55444bbaed3d54e9c

Not having these functions caused a ~10% performance regression in
some realtime vp8 encodes.

Change-Id: I50658483d9198391806b27899f2c0d309233c4b5
2015-08-27 11:58:38 -07:00
James Zern
43a34557f1 configure: append --extra-cflags to final set
previously any flags added while setting up the toolchain would
override the user selections; environment variables could be treated
similarly

Change-Id: Ibfcc644137d8e579af554d19a38d4020019a7a34
2015-08-26 20:28:26 -07:00
James Zern
5e16d397bd vpx_dsp_common: add VPX prefix to MIN/MAX
prevents redeclaration warnings;
vp8 has its own define which will be resolved in a future commit

Change-Id: Ic941fef3dd4262fcdce48b73075fe6b375f11c9c
2015-08-26 20:11:32 -07:00
James Zern
205532f3a7 Merge changes I56fad85c,I7401a70a
* changes:
  vp8e_encode: check validate_config return
  vp9_update_layer_...config: delete dead assignment
2015-08-27 03:02:57 +00:00
Marco Paniconi
9a733b399c Merge "vp9_spatial_svc_encoder: Enable aq-mode for real-time mode." 2015-08-26 23:37:00 +00:00
Marco
1b556e1f9a vp9_spatial_svc_encoder: Enable aq-mode for real-time mode.
For real-time mode (speeds >=5) enable aq-mode=3.

Change-Id: Ib8b4ef7609bc30ac935742c8d27e8cd89933c6af
2015-08-26 15:19:44 -07:00
Hui Su
42ef854f97 Merge "Remove vp10_default_scan_orders[] that is unused" 2015-08-26 22:19:01 +00:00
Yunqing Wang
1c0769107b vp10 cleanup: remove nonrd and real-time code
Code cleanup.

Change-Id: I668bd5a4e5fbe96969d51d9ee777fc5f1d8abfe6
2015-08-26 13:36:54 -07:00
Marco Paniconi
413a0392c0 Merge "vp9_spatial_svc_encoder: Add encoding time log." 2015-08-26 19:47:15 +00:00
Marco
4ebded6840 vp9_spatial_svc_encoder: Add encoding time log.
Change-Id: Iab4e4a13a65c9dc5314e5107b126c30667c7b448
2015-08-26 12:20:10 -07:00
Johann Koenig
c50f6739f8 Merge "Clean up unused function warnings in vp8 decoder" 2015-08-26 18:36:10 +00:00
hui su
28bd7673ad Remove vp10_default_scan_orders[] that is unused
Change-Id: Ibc3b5cb3799f080808cf22ccb01d733e74ab4461
2015-08-26 10:43:25 -07:00
Johann
f5507b514c Only build ssse3 filter functions on 64 bit
Avoid an unused function warning by only building the functions when
they will be used.

Change-Id: I53b5bdc5a180c79d63b34e4c8921d679bbc54009
2015-08-26 10:32:18 -07:00
Johann
06ba5254ee Clean up unused function warnings in vp8 encoder
Mark rdopt.h and treewriter.h functions with INLINE.

Change-Id: Ib81168a709d09dfba7de16c596133310e04c6656
2015-08-26 10:32:12 -07:00
Johann
821f02947e Clean up unused function warnings in vp8 onyx_if.c
Remove really unused segmentation_test_function

Hide decide_key_frame and recode_loop_test under non-realtime check.

Change-Id: Ie0113945ffbd096dbb89a553548f526b2a0ee0c6
2015-08-26 10:29:42 -07:00
Johann
5c055cc4cf Clean up unused function warnings in vp8 common
Mark functions in findnearmv.h, invtrans.h and setupintrarecon.h
with INLINE.

Hide function in postproc.h behind the same #if as it's callers.

Change-Id: Ic1e014a943d2aca280f137019218b9d4f1443d61
2015-08-26 10:15:24 -07:00
Johann
51b654e8f0 Remove vp8_priv_sz
This is a leftover of the XMA code which was removed a long time ago.

Found while looking for unused functions.

Change-Id: I07a3d542ae55440af59380dcdcf9a6c11cdfcb75
2015-08-26 17:10:41 +00:00
Johann
690971898b Clean up unused function warnings in vp8 decoder
Mark functions in dboolhuff.h and treereader.h with INLINE.

Change-Id: Ifc1008de0713c8d43f4fec83a8c2b836622be365
2015-08-26 17:10:30 +00:00
James Zern
c0523090be vp8e_encode: check validate_config return
Change-Id: I56fad85cae4537f9d68febf9b9264c3e1cf82ce1
2015-08-25 18:45:05 -07:00
James Zern
a390b90f01 vp9_update_layer_...config: delete dead assignment
Change-Id: I7401a70a3f33d13fa1ab0393e59fceb5ef083534
2015-08-25 18:45:05 -07:00
Johann
467c66e842 Mark Scale2Ratio INLINE
WebRTC builds with -Wunused-function do not like all the uses of onyx.h

Change-Id: Ic57cb143b48df9c9895f94b5f8f395c260fa7025
2015-08-25 14:56:18 -07:00
Yaowu Xu
7105df53d7 Merge "Limit new motion vector size" 2015-08-25 17:07:34 +00:00
Yaowu Xu
a1ec3eb326 Limit new motion vector size
This commit adds clamp of new vectors similar to the logic in RD loop.
Such clamp is not necessary from the perspective of VP8 bitstream, but
is added to improve ChromeCast mirroring's robustness.

Change-Id: I42f6adbc60ffce283b994869364230858632d6fa
2015-08-25 10:00:34 -07:00
Shunyao Li
e8032a5fae Merge "Add transform size rate for intra skip mode in rdopt" 2015-08-25 16:51:04 +00:00
Debargha Mukherjee
071b781e37 Merge "Prevent an ASAN failure for svc tests" 2015-08-25 16:31:54 +00:00
Shunyao Li
aa006d7149 Add transform size rate for intra skip mode in rdopt
stdhd +0.226 hevchr +0.091 hevcmr +0.052 derflr +0.033

Change-Id: I84034209c5760609a99bd6e0ce55e02534b72cac
2015-08-24 18:15:09 -07:00
Marco
ee380cc5c4 vp8: modifcatiion to skin map computation.
For each block in pickinter: use average of four middle
pixels (instead of single pixel) to set skin map.
This can help a little in reducing false skin detection in
some cases.

Change-Id: Ic247af75e9c2948b08ab977a39e061adacd8ec97
2015-08-24 15:35:03 -07:00
hui su
d88ca3c335 Fix a bug induced in f1d090e2f56e28b3218fb99f648bd5d59ae2f4b1
Change-Id: I5f7ab8ee75192a4c6c7aa723d2e113400d6ca9a5
2015-08-24 13:46:05 -07:00
Hui Su
f1d090e2f5 Merge "Refactoring on transform types" 2015-08-24 19:57:22 +00:00
hui su
697a8e6fe6 Avoid setting rate multiplier as 0
In high bitdepth setting, the rate multipier may be set as 0. In
lossless mode, the RD cost would always be 0, resulting in bad
partition and prediction mode choices.

Change-Id: I297014dd8bfa8a07ff0ab480119f75678300ff68
2015-08-24 11:47:36 -07:00
hui su
d76e5b3652 Refactoring on transform types
Prepare for adding more transform varieties (EXT_TX and TX_SKIP in nextgen).

Change-Id: I2dfe024f6be7a92078775917092ed62abc2e7d1e
2015-08-24 10:47:25 -07:00
Debargha Mukherjee
653832ea06 Prevent an ASAN failure for svc tests
This patch just fixes the test for the time being, but does not
actually solve the underlying issue, which still needs investigation.

Change-Id: I54a35de839723f5b499b57e38dd2bdd400adc427
2015-08-24 10:28:02 -07:00
Jingning Han
41be09afee Turn on codec behavior unit tests for vp10
This commit adds codec behavior unit tests for vp10.

Change-Id: Ieb49cb66f0b29679ff2a3e2c0804d1ebbf48f986
2015-08-22 00:00:43 +00:00
Jingning Han
71412d82a3 Merge "vpxenc: fix DECODER ifdef" 2015-08-22 00:00:27 +00:00
Hui Su
cd14e03196 Merge "Refactor get_tx_type and get_scan" 2015-08-21 23:21:04 +00:00
James Zern
bb55193448 vpxenc: fix DECODER ifdef
CONFIG_VP10_ENCODER -> CONFIG_VP10_DECODER

Change-Id: I6f1a798835acc4ef66bd2c5d6ffb02247c74b1d6
2015-08-21 16:08:36 -07:00
hui su
5eed74e1d3 Refactor get_tx_type and get_scan
This makes it easier to add new transform types and scan orders
to VP10 in the future.

Change-Id: I94874ddc9b19928d7820d57e94e2af04adf51efe
2015-08-21 09:53:37 -07:00
Jingning Han
e0425bc0ef Merge "Replace MAX_REF_LF_DELTAS with MAX_REF_FRAMES" 2015-08-21 15:31:26 +00:00
Marco Paniconi
82cb1c5e7a Merge "Update to dynamic resize for 1 pass CBR: source scaling." 2015-08-21 15:28:23 +00:00
Scott LaVarnway
6c0f6dd817 Merge "VPX: scaled convolve : fix windows build errors" 2015-08-21 12:06:34 +00:00
Marco
93ffe9d6dc Update to dynamic resize for 1 pass CBR: source scaling.
Switch to use the normative (convolve8) filter for source scaling,
only for 1/2x1/2 scaling for now. This is faster and has better
quality than either the vpx_scale_frame or the nonnormative scaler.

Remove the vp9_scale_if_required_fast, which is now not used.

Change-Id: I2f7d73950589d19baafb1fa650eac987d531bcc8
2015-08-20 16:34:01 -07:00
Scott LaVarnway
acf24cc1b8 VPX: scaled convolve : fix windows build errors
Change-Id: Ic81d435ea928183197040cdf64b6afd7dbaf57e4
2015-08-20 13:09:27 -07:00
Jingning Han
f3fa7cfbfa Merge "Refactor REFS_PER_FRAME definition" 2015-08-20 18:01:06 +00:00
Jingning Han
c455919f03 Replace MAX_REF_LF_DELTAS with MAX_REF_FRAMES
The macro MAX_REF_LF_DELTAS is repeatedly defined. Merge its use
cases with MAX_REF_FRAMES.

Change-Id: I71c4634fb5feae78ce6f9bf99074f45ed7f68b73
2015-08-20 09:52:52 -07:00
Jingning Han
83bd16aaf3 Refactor REFS_PER_FRAME definition
Define it as a function of reference frame types to provide
scalability for multiple reference frames.

Change-Id: I77b856c96916f352bc31004b9266b3f24e19bd0f
2015-08-20 09:29:28 -07:00
James Zern
7fa5223444 x86inc.asm: only set visibility for chromium builds
this restores the previous version's behavior avoiding issues with
builds that may split sources on directory boundaries; protected
visibility may work in this case.

Change-Id: If37c70d9bd81de85a8e112457b9819a5cac6129d
2015-08-19 16:26:48 -07:00
Scott LaVarnway
6a21ca20cc Merge "VPX ssse3 scaled convolve" 2015-08-19 22:12:21 +00:00
Jingning Han
b1339751b9 Merge "Rename inv_txfm_sse2.asm to inv_wht_sse2.asm" 2015-08-19 18:26:30 +00:00
Jingning Han
49f6ff1103 Rename inv_txfm_sse2.asm to inv_wht_sse2.asm
Change-Id: I43bcc70680503e4c18d8f021097307778cf9ea70
2015-08-19 10:29:53 -07:00
Marco Paniconi
1fefc39e94 Merge "Fix to non-rd variance partition selection." 2015-08-19 15:47:40 +00:00
Marco Paniconi
b1e3e8348d Merge "Allow for re-encoding frame if high overshoot." 2015-08-18 23:28:05 +00:00
Johann Koenig
5942839d2d Merge "Rename vp8 loopfilter_filters_dspr2.c" 2015-08-18 23:09:03 +00:00
Johann Koenig
950b68288a Merge "Rename vp8 loopfilter[_neon.c]" 2015-08-18 23:08:51 +00:00
Johann Koenig
798b54a006 Merge "Rename vp8 quantize.c" 2015-08-18 23:08:44 +00:00
Marco
42b6791774 Allow for re-encoding frame if high overshoot.
For 1 pass CBR mode under screen content mode:
if pre-analysis (source temporal-sad) indicates significant
change in content, then check the projected frame size after
encode_frame(), and if size is above threshold, force re-encode
of that frame at max QP.

Change-Id: I91e66d9f3167aff2ffcc6f16f47f19f1c21dc688
2015-08-18 15:36:59 -07:00
Scott LaVarnway
2030c49cf8 VPX ssse3 scaled convolve
Change-Id: I71d5994e21813554a927d35ebcc26bf7a68984fd
2015-08-18 15:13:02 -07:00
Johann
e7aa2d9b21 Rename vp8 loopfilter_filters_dspr2.c
Change-Id: I914b456558edbdee5eefdfba731bc70d3d5f5d53
2015-08-18 15:10:37 -07:00
Marco
0092960d27 Updates to skin detection
-Use 8x8 or 16x16 blocks.
-Option to use average of center pixel(s).

Change-Id: I7d962da30039d41385843e11606bc6482c7906f9
2015-08-18 11:55:23 -07:00
Johann
4e5e5fc52b Rename vp8 loopfilter[_neon.c]
Avoid conflict with vpx_dsp version

Change-Id: I041b1532a9276400a5547de8dfed1de43ad4e83d
2015-08-18 11:47:00 -07:00
Johann
79a00d71bd Rename vp8 quantize.c
Move it to vp8_quantize.c and make sure to
use the full path for all vp8 includes of quantize.h

Change-Id: I284651ff681707385f4924ea7db1541905c1624a
2015-08-18 11:44:32 -07:00
Jingning Han
2fdb63fd72 Merge "Turn on dspr2 loop filter functions in vpx_dsp" 2015-08-18 02:37:45 +00:00
Hui Su
72190cb5e3 Merge "create vp10_arg_ctrl_map" 2015-08-18 00:49:24 +00:00
Hui Su
dca95791d0 Merge "remove unused high-bit-depth args from arg list" 2015-08-18 00:49:13 +00:00
Jingning Han
5de049b067 Turn on dspr2 loop filter functions in vpx_dsp
Add the dspr2 files to vpx_dsp.mk and enable these functions in
vpx_dsp_rtcd_defs.pl file.

Change-Id: I79feb5af24f174f4a0788dc6f3b6df7f4e1fa467
2015-08-17 16:15:24 -07:00
Marco
e18800443c Fix to non-rd variance partition selection.
Only test for using golden as reference for variance partition
selection if it is used as a reference for that frame.

For temporal layers, golden may not be a reference on a given frame,
even though it was for some previous frame. If it is not a reference
for current frame, don't check/use it for partition selection.

Change-Id: I6b0f2bd36aebbb5903077c9a0a66d80f1de9a7b1
2015-08-17 13:32:40 -07:00
hui su
82331e000a create vp10_arg_ctrl_map
Change-Id: Ibe49acb022f1d557ffccb91e7bd2558870ff1a0b
2015-08-17 10:13:41 -07:00
Jingning Han
f1fc47becf Merge "Configure vp10 disabled by default" 2015-08-17 16:57:29 +00:00
Hui Su
81cb6bd496 Merge "VP9EncoderConfig -> VP10EncoderConfig" 2015-08-17 16:46:06 +00:00
hui su
db14911ccb remove unused high-bit-depth args from arg list
Change-Id: I8373a0e980aaaa0d0cab8b2e69d1a897ff5aec2d
2015-08-17 09:44:40 -07:00
Jingning Han
407968cb88 Configure vp10 disabled by default
To turn on vp10, one needs to explicitly set --enable-vp10.

Change-Id: Ifc7e294aea9a5bdf5d08f0001ae26fba5a837b64
2015-08-17 09:06:26 -07:00
hui su
a4c7e92b81 VP9EncoderConfig -> VP10EncoderConfig
Change-Id: Id691d8a9d4aa137e8de73fe680016fd4fd070e6e
2015-08-16 17:24:35 -07:00
Jingning Han
5dccce558c Set VP9 as vpxenc default encoder
Change-Id: Idb8a133364fc29ac762ad344262bcc47c568a55c
2015-08-15 15:59:18 -07:00
Jingning Han
bbb9ca4535 Merge "Change vp9_ prefix function names in vpx_scale to vpx_" 2015-08-15 22:40:11 +00:00
Jingning Han
89af744ba6 Change vp9_ prefix function names in vpx_scale to vpx_
Change-Id: Iac85902cbbb3e752801dc85de9a3c778e47304aa
2015-08-14 15:27:43 -07:00
Yaowu Xu
d0307158cd Merge "change vp10 to use a different sync code than vp9" 2015-08-14 21:52:29 +00:00
Yaowu Xu
519b526de8 Merge "write correct codecID for vp10 webm file" 2015-08-14 21:52:18 +00:00
Yaowu Xu
aab9218741 Merge "Remove vp10's build dependency on vp9" 2015-08-14 21:52:10 +00:00
Yaowu Xu
d692f26dd5 change vp10 to use a different sync code than vp9
Change-Id: If5b5beb38c938bd7a6016dedc9bd0c8e06153d73
2015-08-14 13:06:56 -07:00
Yaowu Xu
3d1bb97b1b write correct codecID for vp10 webm file
Change-Id: Ifeb6073c4a687a73540a0f8aef0d834f4712c193
2015-08-14 12:54:59 -07:00
James Zern
1794624c18 Merge changes I2fe52bfb,I5e5084eb
* changes:
  VPX: removed filter == 128 checks from mips convolve code
  VPX: removed step checks from mips convolve code
2015-08-14 19:45:27 +00:00
James Zern
78629508f2 Merge "VPX: removed step checks from neon convolve code" 2015-08-14 19:23:46 +00:00
Yaowu Xu
72889a2a60 Remove vp10's build dependency on vp9
CONFIG_VP9_HIGHBITDEPTH is currently used by both vp9 and vp10, but in
many place outside vp9/vp10, the macro was used in conjunction of
CONFIG_VP9. This created a dependency on vp9 for vp10 to build. This
commit removes the dependency by use CONFIG_VP9_HIGHBITDEPTH only in
these places.

Change-Id: I8cc007fc9cf132394c6498ce6759e606b64a6ad0
2015-08-14 12:16:07 -07:00
Yaowu Xu
94ba3939cd vpx_highbd_ssim_parms_8x8: make parameter types consistent
Change-Id: Ie1fe6603232adc22dbe4d51bd1008c856a6d40ca
2015-08-14 09:18:07 -07:00
Yunqing Wang
d04a0d77fb Merge "Copy VP9 second-level sub-pixel search change to VP10" 2015-08-13 23:51:27 +00:00
Yaowu Xu
92946472a1 Merge "VP9Common -> VP10Common" 2015-08-13 22:51:51 +00:00
Yaowu Xu
6f0cc9f53c Merge "VP9Decoder -> VP10Decoder" 2015-08-13 22:32:42 +00:00
Yunqing Wang
0ea70f77a5 Copy VP9 second-level sub-pixel search change to VP10
Merged patch "Improve the second-level sub-pixel motion search"
(commit: 7418b176ce1c985637c639280d70b12bdc850e57) to VP10.

Change-Id: I89b5d76624290c47dd84d9c5332b4909238e268d
2015-08-13 15:00:32 -07:00
Yaowu Xu
afb6b4b852 VP9Common -> VP10Common
Change-Id: Ifddc68a8ab020f35a266ffc74429363301fe7d9e
2015-08-13 15:00:19 -07:00
Yaowu Xu
706b0ad629 Merge "VP9_COMP -> VP10_COMP" 2015-08-13 21:56:33 +00:00
Yaowu Xu
cf9366e504 VP9Decoder -> VP10Decoder
Change-Id: I427b56e92aa2d1381192cb394ac1bb95becb32a1
2015-08-13 14:43:55 -07:00
Scott LaVarnway
89dcc13939 VPX: removed filter == 128 checks from mips convolve code
The check is handled by the predictor table.

Change-Id: I2fe52bfbbfccb2edd13ba250986e3a4b4b589459
2015-08-13 12:57:01 -07:00
Alex Converse
62bfc97d05 opsnr.stt: Add a missing tab after PSNRHVS
Logfile parsers expect it to be there.

Change-Id: I7c96a42c8be570a28f51cc4edfa619d9cf9af73b
2015-08-13 12:08:36 -07:00
Yaowu Xu
26a9afc32c VP9_COMP -> VP10_COMP
Change-Id: I83b5c69621f9f28b742e5b13517d4e5b99c6cd26
2015-08-13 11:37:17 -07:00
Scott LaVarnway
aeea00cc4f VPX: removed step checks from mips convolve code
The check is handled by the predictor table.

Change-Id: I5e5084ebb46be8087c8c9d80b5f76e919a1cd05b
2015-08-13 11:27:04 -07:00
Yaowu Xu
7da965daa9 Merge "VP9_COMMON -> VP10->COMMON" 2015-08-13 18:00:27 +00:00
Yaowu Xu
7bca5619eb Merge "Correct guard macros in header files" 2015-08-13 18:00:02 +00:00
Yaowu Xu
fc7cbd1f60 VP9_COMMON -> VP10->COMMON
Change-Id: I651b7bee90f33581368853da81f9622805ccc0ea
2015-08-13 09:58:26 -07:00
Jingning Han
534ac8a617 Remove common_data.c file from vp10 folder
This file is empty in vp10. Remove it to clear out visual studio
warning.

Change-Id: I741e88adcf3c9fc6b73b13ea08a2094e2f3a7eba
2015-08-13 16:33:03 +00:00
Yaowu Xu
2dcefd9c7f Correct guard macros in header files
Change-Id: Ifce12a95c1cdc36dc6ac5a72759249a17407da9e
2015-08-13 09:25:39 -07:00
Yaowu Xu
4622af69e6 Merge "Add vpxenc help info" 2015-08-13 15:41:10 +00:00
Scott LaVarnway
fa47212933 VPX: removed step checks from neon convolve code
The check is handled by the predictor table.

Change-Id: I42479f843e77a2d40cdcdfc9e2e6c48a05a36561
2015-08-12 16:46:53 -07:00
Jingning Han
1aa84e03fd Merge "vp10_encoder: add missing vpx_clear_system_state" 2015-08-12 23:33:46 +00:00
Jingning Han
13c3c8309a vp10_encoder: add missing vpx_clear_system_state
Mirror the fix in vp9_encoder for sse-only build.

Change-Id: I9f272874e52f4cc295fcaa71920f8a5d3a80045b
2015-08-12 15:43:19 -07:00
James Zern
9cc8995f46 Merge "vp9_encoder: add missing vpx_clear_system_state" 2015-08-12 22:41:51 +00:00
Scott LaVarnway
6cf95bd1e7 Merge "VPX: remove step == 16 and filter[3] != 128 checks" 2015-08-12 20:13:33 +00:00
Hui Su
17cf545edb Merge "Call set_ref_ptrs only for inter blocks" 2015-08-12 19:49:48 +00:00
Hui Su
54fb24aac3 Merge "Use sizeof(variable) instead of sizeof(type)" 2015-08-12 19:49:22 +00:00
Yaowu Xu
2b18c9a09b Add vpxenc help info
1. information on --test-decode
2. vp10 specific parameters, currently shared with vp9

Change-Id: Ida4b691052441e68b9352746988027e5a2a26f48
2015-08-12 12:43:19 -07:00
hui su
cb79ea1c16 Call set_ref_ptrs only for inter blocks
In encode_superblock, call set_ref_ptrs only for inter blocks.

Change-Id: I27545c0e3e679e1838b78d7c9d01fe5a4d3cc0fb
2015-08-12 11:25:43 -07:00
hui su
088b05fd99 Use sizeof(variable) instead of sizeof(type)
Change-Id: Ia069da11eebb271063e9eb837bdb3e7175ecce13
2015-08-12 11:25:38 -07:00
Jingning Han
3acfe46e8d Sync vp10 with vpx_ports/system_state.h
Change-Id: Ic5004f8bdc1c2b025b598e80374ee1f286ea95ee
2015-08-12 09:21:25 -07:00
Jingning Han
0a81d36ab4 Replace vp10_ssim functions with vpx_ssim versions
Remove the ssim files from vp10 folder.

Change-Id: Icc1d9d61a0878d53584328b278dfa090aa070035
2015-08-11 22:35:46 -07:00
Jingning Han
54d66ef165 Remove vp9_ prefix from vp10 files
Remove the vp9_ prefix from vp10 file names.

Change-Id: I513a211b286a57d6126fc1b0fbfd6405120014f1
2015-08-11 21:24:08 -07:00
Jingning Han
b522d1cdff Merge "Fix high bit depth in vp10 codebase" 2015-08-12 04:15:41 +00:00
Jingning Han
3fc0f5ed12 Merge "Android.mk: add missing vp10_rtcd.h dep" 2015-08-12 04:15:04 +00:00
Jingning Han
470cbfcb0b Merge "Change vp10 interface prefix from vp9_ to vp10_" 2015-08-12 04:14:22 +00:00
James Zern
c927e94fd1 Android.mk: add missing vp10_rtcd.h dep
broken since:
be6c031 Merge "Fork VP9 and VP10 codebase"
3ee6db6 Fork VP9 and VP10 codebase

Change-Id: I1dcdb378e11fe9aaf7c433ab187ebf952ef9cf09
2015-08-11 19:57:25 -07:00
James Zern
472e14e725 vp9_encoder: add missing vpx_clear_system_state
fixes sse-only build

Change-Id: I4591f5be6773464238744a41d6901cf0e903b5bd
2015-08-11 19:28:23 -07:00
James Zern
345b11cd73 Merge "fix build w/only mmx+sse enabled" 2015-08-12 02:26:08 +00:00
Jingning Han
c4e354b4bd Change vp10 interface prefix from vp9_ to vp10_
This commit renames the vp10 encoder, decoder, and common interface
file names from vp9_ prefix to vp10_ prefix.

Change-Id: Iafb5d786e4b428d2b9bf097123bd86c4fa9ded24
2015-08-11 18:59:30 -07:00
Jingning Han
8af092dbd7 Fix high bit depth in vp10 codebase
Change-Id: Iacbfac29898ac7954eb6375e83873dbb7390fd47
2015-08-12 01:59:04 +00:00
Jingning Han
be6c031fb3 Merge "Fork VP9 and VP10 codebase" 2015-08-12 01:57:15 +00:00
James Zern
70deaf00eb Merge "tools_common: fix build w/encoders/decoders disabled" 2015-08-12 01:52:55 +00:00
Jingning Han
3ee6db6c81 Fork VP9 and VP10 codebase
This commit folks the VP9 and VP10 codebase and makes libvpx
support VP8, VP9, and VP10.

Change-Id: I81782e0b809acb3c9844bee8c8ec8f4d5e8fa356
2015-08-11 17:05:28 -07:00
James Zern
23532eb7b6 fix build w/only mmx+sse enabled
many _sse2.asm have sse implementations as well

Change-Id: Idfa1f5cab593e4913aaad37f7223e8430188c44a
2015-08-11 15:52:43 -07:00
Scott LaVarnway
b04dad328c Merge "VPX: remove scaled calls from FUN_CONV_1D" 2015-08-11 21:46:50 +00:00
Marco Paniconi
762641bacc Merge "Adjust speed setting for temporal layers in 1 pass non-rd mode." 2015-08-11 21:33:47 +00:00
Marco
3d181a4516 Adjust speed setting for temporal layers in 1 pass non-rd mode.
For speed 7, real-time mode: Base layer frames are further apart
(for #temporal layers = 3, this is every 4 frames) so worth keeping
same motion search parameters (as in speed 6) on the base layer frames.

Change-Id: Idebf49dda6ef4f3d9a55aee55129a68253f692fb
2015-08-11 11:21:01 -07:00
Alex Converse
fe4a14af72 blockiness: cleanup includes and add statics
Change-Id: I26c53f8e74cf5431fb3179af5d480e4e9f3d8f32
2015-08-11 10:58:08 -07:00
Scott LaVarnway
4ef08dcec8 Merge "VPX: Add rtcd support for scaling." 2015-08-11 13:19:00 +00:00
Aℓex Converse
b152472ba7 Merge "Move vp9_systemdependent.h to vpx_ports bitops.h and system_state.h" 2015-08-11 01:18:39 +00:00
James Zern
8465c938f1 tools_common: fix build w/encoders/decoders disabled
gcc-based builds will allow a 0-element array, but visual studio builds
will not; this change hides the encoder and decoder specific symbols as
modules using them are selected based on the configuration.

Change-Id: Ic16ba9d12241070ec689dc5880164c14a4f7ca44
2015-08-10 16:48:47 -07:00
Marco Paniconi
1d723572b9 Merge "Adjustments for VP9 temporal layers, for 1 pass CBR" 2015-08-10 22:53:35 +00:00
Alex Converse
a8a08ce57e Move vp9_systemdependent.h to vpx_ports bitops.h and system_state.h
Use system_state.h in vpx_dsp and remove unneeded includes of
vp9_systemdependent.h.

Change-Id: I92557ec6dd5aa790160b4f31fe7967db0d7ec3c4
2015-08-10 15:37:14 -07:00
James Zern
9265bad906 Merge changes from topic 'x86inc'
* changes:
  Only use .text sections for aout
  Use newer x86inc.asm
  Use .text instead of .rodata on macho
  Copy PIC handling code from x86_abi_support
  Set 'private_extern' visibility for macho targets
  Avoid 'amdnop' when building with nasm
  Catch all elf formats
  Expand PIC default to macho64 and respect CONFIG_PIC from libvpx
  Use libvpx defines to set name mangling rules
  Customize x86inc.asm for libvpx
2015-08-10 21:20:38 +00:00
Johann Koenig
7e28ca0157 Merge "Update x86inc.asm from x264" 2015-08-10 21:16:32 +00:00
Scott LaVarnway
a229dbc1f0 VPX: remove step == 16 and filter[3] != 128 checks
from FUN_CONV_1D and FUN_CONV_2D macros.  The functions
will not be called with these inputs.

Change-Id: I67ec75e4edafc0acee70190521a80ea85dfa521b
2015-08-10 13:44:32 -07:00
Marco
0d8cb09058 Adjustments for VP9 temporal layers, for 1 pass CBR
Adjust logic for golden reference usage in non-rd pickmode,
under svc mode.

Change-Id: If012e21e8123a0684634af0ac7ed3da9c8c7d7cc
2015-08-10 13:21:42 -07:00
Marco Paniconi
768aad88d9 Merge "Add unittest for SVC 1pass CBR mode with 4 threads." 2015-08-10 19:16:47 +00:00
Johann
8634eaf87a Only use .text sections for aout
Also do not specify alignment.

Change-Id: Id4a62bfa0fc3bc56e25689b5de7796bd6e864457
2015-08-10 12:08:18 -07:00
Aℓex Converse
29d0cc2431 Merge "fastssim: Add some missing consts" 2015-08-10 17:49:39 +00:00
Tom Finegan
20d902a376 Merge "clang/win: Make libvpx build with -Wunused-function." 2015-08-10 17:25:32 +00:00
Tom Finegan
1767067068 Merge "Add a codereview.setting file so that git cl upload works." 2015-08-10 17:24:56 +00:00
Jingning Han
3715a914b8 Merge "Make build_inter_predictors static function" 2015-08-10 16:56:48 +00:00
Marco
c9426aaa1b Add unittest for SVC 1pass CBR mode with 4 threads.
Change-Id: I2b25d495d0dd3eedea31aa12cb908a90480f25de
2015-08-10 09:52:18 -07:00
Alex Converse
4ea7f2be43 fastssim: Add some missing consts
Change-Id: Id36f180032c8a92c686da6f716a7468332b23b94
2015-08-10 09:48:25 -07:00
Aℓex Converse
2808dd12c2 Merge changes I2aa2a545,I63932eda,Ie3694ecd
* changes:
  ssim: Add missing statics and consts
  psnrhvs: Add missing consts and static consts.
  ssim: Replace unsigned long with uint32_t.
2015-08-10 16:41:54 +00:00
Jingning Han
244912d506 Make build_inter_predictors static function
Remove the function declaration from vp9_reconinter.h file.

Change-Id: I193562151b69ece19b9ee2efa1a791fe2522cca0
2015-08-10 15:51:13 +00:00
Jingning Han
d705e17f5e Merge "Add static syntax to total_adj_strong_thresh" 2015-08-10 15:50:53 +00:00
James Zern
d65ea85ce6 vpx_ports/msvc.h: include math.h for ceil/floor
fixes visual studio build errors

Change-Id: I5d24f91c74572a75dfa77b9384d6614de231dc50
2015-08-08 11:11:23 -07:00
James Zern
6032239e2f vpx_ports/x86.h: fix visual studio build warning
test for WINAPI_FAMILY_PARTITION before using it

Change-Id: I6b7a7b1ccd3332b31c73b733f88c997e30b22de8
2015-08-08 11:10:44 -07:00
Alex Converse
f2e44aa664 Move the msvc round() replacement to msvc.h
Change-Id: If470411c3c62a27f52261f4ece2c5054b71789c7
2015-08-07 18:27:48 -07:00
Alex Converse
610e258cc5 Make the round() replacement match C99 and POSIX.
http://pubs.opengroup.org/onlinepubs/009695399/functions/round.html

Change-Id: Idf387d944d36bf593f8797db9053e11e5c9b9b39
2015-08-07 18:24:21 -07:00
Jingning Han
6ad714fa52 Add static syntax to total_adj_strong_thresh
Change-Id: I34cc7b500d19a79f29c5ad241f602c1bc269446e
2015-08-07 17:26:25 -07:00
Johann
41a0a0cb35 Use newer x86inc.asm
Rename updated version of x86inc.asm

Use "private_prefix" instead of "program_name" and make vpx the default
prefix.

Change-Id: I4883a99b2aee8e5dc9f2c16a2e6f4b5d6e4de458
2015-08-07 16:44:44 -07:00
Johann
c7e9e486b8 Use .text instead of .rodata on macho
The read only sections are getting stripped on some OS X builds. As a
result, random data is used in place of the intended tables.

Change-Id: I58c18a53e503f093ee268451698c5761e6c32540
2015-08-07 16:43:31 -07:00
Johann
e15b535791 Copy PIC handling code from x86_abi_support
Change-Id: Ifcd9493802f0c957d7a3b16ce641b989e166792f
2015-08-07 16:43:31 -07:00
Johann
e0ab364701 Set 'private_extern' visibility for macho targets
Don't set it when building with 'nasm'

Change-Id: I01c211090f6870e0d34011f867471249a5f54bb0
2015-08-07 16:43:31 -07:00
Johann
bfbba9c6b0 Avoid 'amdnop' when building with nasm
Other implementations of x86inc.asm have more comprehensive nasm
workarounds. This is the only thing that was changed for the previous
import to libvpx. See if we can still get away with it.

Change-Id: I3ef6fe9a4816461c89431a82b7e4a08b4b948d39
2015-08-07 16:43:31 -07:00
Johann
5d8f9f53d1 Catch all elf formats
Make sure all variants get correct visibility and SECTION notes.

libvpx only pass elf32 and elf64 to the assembler, never just elf.

Change-Id: I7c36c115bf52436c9afe61985c859a2081948271
2015-08-07 16:42:53 -07:00
Johann
89ba55ed1c Expand PIC default to macho64 and respect CONFIG_PIC from libvpx
Change-Id: Ic8c07cc02c80953920f5f86b426a55114ea2cc44
2015-08-07 16:22:08 -07:00
Johann
25a2434752 Use libvpx defines to set name mangling rules
Change-Id: I03986bf2b05032d8a29e5bd629f7f6703269ab13
2015-08-07 16:22:02 -07:00
Johann
dfa42cf8b7 Update x86inc.asm from x264
Revision a95584945dd9ce3acc66c6cd8f6796bc4404d40d
from git://git.videolan.org/x264.git

Temporarily name file x86inc.asm until all necessary local patches are
applied.

Change-Id: I9c7d0ed4d3ed900ae2d5db0abbcc048a2892c9b8
2015-08-07 16:20:33 -07:00
Johann
35747296b0 Customize x86inc.asm for libvpx
Use settings from vpx_config.asm

Prefix functions with vpx.

Change-Id: I1091d9b063e9f5af0dce554bb636ee894c05dcf7
2015-08-07 16:20:33 -07:00
Nico Weber
a95f4d961e Add a codereview.setting file so that git cl upload works.
Change-Id: Ieb43e61c14296c6caea5881a102fe4cb6d65e1df
2015-08-07 22:24:24 +00:00
Nico Weber
8a64f516cb clang/win: Make libvpx build with -Wunused-function.
BUG=chromium:505316

Change-Id: I1c951eb99fd0487e1bc70ebb2852b981fd69ed8a
2015-08-07 21:53:29 +00:00
Jingning Han
a9aa29d901 Merge "Add static syntax to copy_mem64x64" 2015-08-07 21:41:32 +00:00
Aℓex Converse
9f7fdcbe60 Merge "fastssim: Add stdlib.h for malloc/free" 2015-08-07 19:21:42 +00:00
Aℓex Converse
5c4a037c86 Merge "Replace VP8 SSIM with VP9 derived vpx_dsp SSIM." 2015-08-07 19:15:35 +00:00
Alex Converse
26f4f2dc8e ssim: Add missing statics and consts
Change-Id: I2aa2a545bd2f8f170c66c2e267ea9d617ff10d87
2015-08-07 12:01:19 -07:00
Alex Converse
c1f911a2ea psnrhvs: Add missing consts and static consts.
Change-Id: I63932edaef4c4d4d0a57e6f7d3e4aa42651a5c47
2015-08-07 12:01:14 -07:00
Alex Converse
c65e79d2e5 ssim: Replace unsigned long with uint32_t.
The assembly only writes the low 4 bytes, and the HBD version only uses
uint32_t bytes.

Change-Id: Ie3694ecda511c231e55870df814cbae30e588073
2015-08-07 11:48:31 -07:00
Marco Paniconi
f87fdebefc Merge "Fix a setting in cyclic refresh." 2015-08-07 18:38:40 +00:00
Alex Converse
17cfee3cb5 fastssim: Add stdlib.h for malloc/free
Change-Id: I4d734febc14c534dba20b67cf6bd628996cc9ab7
2015-08-07 11:20:05 -07:00
Alex Converse
d816fa7bfd Replace VP8 SSIM with VP9 derived vpx_dsp SSIM.
Change-Id: Ic61f30af12d1b01c1d5adc4e08bc20e20ad38027
2015-08-07 11:20:05 -07:00
Zoe Liu
9b769e47f4 Merge "Fixed a comment on the compound ref frames." 2015-08-07 18:04:35 +00:00
Marco
dc36e5aff0 Fix a setting in cyclic refresh.
Use the correct period (in terms of cr->percent_refresh) for the condition
of larger delta-qp following key frame.
And account for larger interval for temporal layers.

Change-Id: Ibb43f5200f9b1eeb8bbb8211327b08ecda3c3b8a
2015-08-07 10:34:47 -07:00
Jingning Han
1057ee4847 Add static syntax to copy_mem64x64
Change-Id: Iee4c853ea4a44ae9f5de60c09e5a7b810f15d2dd
2015-08-07 10:16:27 -07:00
Aℓex Converse
eaa8043a31 Merge "Move VP9 SSIM metrics to vpx_dsp." 2015-08-07 16:43:28 +00:00
Yunqing Wang
4bc6ae4342 Merge "Improve the second-level sub-pixel motion search" 2015-08-07 16:05:59 +00:00
Alex Converse
c7b7011b9b Move VP9 SSIM metrics to vpx_dsp.
Change-Id: I20c7b42631b579fade6cf7ebf6d4c69b2fcb5e5e
2015-08-06 18:25:25 -07:00
Zoe Liu
c21cab39c8 Fixed a comment on the compound ref frames.
Change-Id: I77e397ac9f594c9c4c1db442e334a6ea5f53f588
2015-08-06 17:36:57 -07:00
Jingning Han
d74ceb03de Merge "Cosmetic - align format in vp9" 2015-08-07 00:03:05 +00:00
Yunqing Wang
7418b176ce Improve the second-level sub-pixel motion search
Re-investigated the second-level sub-pixel motion search. Improved the
way of choosing search points. Rewrote the second-level search code.

At speed 0, the borg tests showed:
1. for stdhd set, Avg PSNR gain: 0.216%; Overall PSNR gain: 0.196%;
   SSIM gain: 0.206%. Only 1 out of 15 clips showed PSNR loss.
2. for derf set, Avg PSNR gain: 0.171%; Overall PSNR gain: 0.192%;
   SSIM gain: 0.207%. Only 3 out of 30 clips showed PSNR losses.
Added the condition for third-point checking, namely, less points
were checked. Speed tests showed no speed loss(Avg 0.3% speedup at
speed 0).

Change-Id: I6284ebb3fa7ba63be8528184c49e06757211a7f1
2015-08-06 16:28:32 -07:00
Jingning Han
b4f2c567c8 Cosmetic - align format in vp9
Change-Id: I83ed3422f1f4009675ad2f5c4b7236bc7b83b30e
2015-08-06 15:56:11 -07:00
Alex Converse
294550c881 Fix a new[]/delete mismatch
Change-Id: I04c43ff71748d7a2e2ede462cb42b22116a1bfd6
2015-08-06 15:31:43 -07:00
James Zern
7914f7a028 Merge "endian_inl.h: fix mips32 android build" 2015-08-06 22:23:39 +00:00
Aℓex Converse
7ac505c726 Merge "Narrow a load in iwht4x4_16_add." 2015-08-06 22:21:16 +00:00
Jingning Han
fb1a8ba35a Merge "Fix compiler error in vp8/9 decoder test" 2015-08-06 19:50:23 +00:00
James Zern
15de7bd334 Merge "Revert "VP9_COPY_CONVOLVE_SSE2 optimization"" 2015-08-06 19:28:49 +00:00
James Zern
2abfd8f92a endian_inl.h: fix mips32 android build
when configuring with mips32-android-gcc HAVE_MIPS32 would be set, but the
ndk does not set -mips32r2 for APP_ABI=mips which results in BSwap32 failing
to build; refine the check in endian_inl.h

Change-Id: I22893fe61f29111eb902d961b500b2174596268d
2015-08-06 12:27:00 -07:00
Jingning Han
463c94854f Fix compiler error in vp8/9 decoder test
The test file compiler fails if one uses --disable-vp8-decoder
--enable-vp9-decoder. It effectively turns on CONFIG_VP8 and
CONFIG_DECODERS, but turns off CONFIG_VP8_DECODER, which causes
compiler error at test_vector_test.cc.

This commit fixes this issue by adding vp8/9 decoder flags to
the decoder behavior test, respectively.

Change-Id: I097ff8fd5e12715a94a565a82e54503885eb7187
2015-08-06 12:02:05 -07:00
Marco
c54d165014 Rate control adjustment for temporal-svc 1pass.
-For ambient qp in active_worst setting: increase the initial
averaging time (from very first frame) to account for avg_qp of key_frame.
-In postencode on key frame: update the last_q/avg_q[key_frame] for
all temporal layers.

Change-Id: I5313153d350b1045b4835ce948dfffb7d2039b52
2015-08-05 17:34:35 -07:00
James Zern
6b9f046791 Merge "Support build with Visual Studio 14." 2015-08-06 00:10:40 +00:00
Marco Paniconi
f1ecf63f68 Merge "Bugfix for svc." 2015-08-05 21:53:19 +00:00
Ghislain MARY
3067c34c5a Support build with Visual Studio 14.
Change-Id: Id0d7c19857e29b66c652c8cc1ab56b64e4fc0fa3
2015-08-05 14:45:16 -07:00
Marco
f6255dbb53 Bugfix for svc.
Condition usage of rc.frames_since_golden to non-svc mode.

rc.frames_since_golden, which is used in non-svc mode to add second reference,
was causing, under certain condiiton, the turning off of golden reference
for svc case.

Change-Id: Icec644d235d0471e56d8ff73d6c37278bd6ecd3b
2015-08-05 13:59:52 -07:00
James Zern
23591322cf third_party/libwebm: pull from upstream
Changes:
2dec094 mkvparser: normalize UnserializeInt signature

fixes a visual studio build warning

Change-Id: Ifb99c8a46957ee135f8a6a639f19f2515c7526c3
2015-08-05 12:52:40 -07:00
Alex Converse
0572052725 Narrow a load in iwht4x4_16_add.
The top half is unused.

Change-Id: I29b2f6a93e20ea43aff4ad0bd2d52257e1e752b6
2015-08-05 12:16:12 -07:00
Scott LaVarnway
4e6b5079c6 VPX: remove scaled calls from FUN_CONV_1D
and FUN_CONV_2D macros.  The predict lut now handles
this case.  The encoder now calls vpx_scaled_2d() instead
of vpx_convolve8() for scaling.

Change-Id: Ia1c8af8a31e4cb4887a587143108cb45835f7df7
2015-08-05 10:47:06 -07:00
James Zern
afd2f68dae Revert "VP9_COPY_CONVOLVE_SSE2 optimization"
This reverts commit a5e97d874b16ae5826b68515f1e35ffb44361cf8.

Additionally:
Revert "vpx_convolve_copy_sse2: fix win64"

This reverts commit 22a8474fe7ec30d96f746dc6e4b23771758c071e.

This change performs poorly on various x86_64 devices affecting
performance by 1-3% at 1080P. Performance on chromebook like devices was
mixed neutral to slightly negative, so there should be minimal change
there.

Change-Id: I95831233b4b84ee96369baa192a2d4cc7639658c
2015-08-04 17:57:01 -07:00
James Zern
16c0ec711c Merge "third_party/libwebm: pull from upstream" 2015-08-05 00:48:39 +00:00
James Zern
c93dc38ca3 Merge "examples.mk: quiet vcproj script exec by default" 2015-08-05 00:42:36 +00:00
Jingning Han
d621de7e8d Change vp9_quantize to vpx_quantize
This commit clears all the vp9_ prefix use case in vpx_dsp. It gets
the vp9 folder ready to branch out vp10.

Change-Id: I2906eec179ee792b4af8c9b4161313653050e931
2015-08-04 15:31:49 -07:00
Jingning Han
3ad75fc623 Merge "Replace vp9_ prefix with vpx_ prefix in vpx_dsp function names" 2015-08-04 22:30:36 +00:00
Yunqing Wang
df14d9f4e7 Merge "Minor adjustment in diagonal sub-pixel point checking" 2015-08-04 21:00:41 +00:00
Yunqing Wang
f4656961ca Merge "Small improvement in sub-pixel motion search" 2015-08-04 20:59:30 +00:00
Jingning Han
08a453b9de Replace vp9_ prefix with vpx_ prefix in vpx_dsp function names
This commit clears the function naming convention in vpx_dsp. It
replaces vp9_ prefix of global functions with vpx_ prefix. It also
removes the vp9_ prefix from static functions.

Change-Id: I6394359a63b71a51dda01342eec6a3cc08dfeedf
2015-08-04 13:46:11 -07:00
Yunqing Wang
726d1b841b Minor adjustment in diagonal sub-pixel point checking
Choose a different diagonal point to check when the two costs are
the same, making it consistent with the way we choose the best mv.
This slightly changes the encoding result, and the derflr set borg
test at speed 0 shows 0.027% Overall PSNR gain, 0.024% Avg PSNR
gain, and 0.043% SSIM gain.

Change-Id: Ic8ee3a6767394866d159e4f9e1c777604dd73c17
2015-08-04 12:16:47 -07:00
Yunqing Wang
a3d22aa2a4 Small improvement in sub-pixel motion search
If the current best mv(namely, the search center) is still the best mv
after the first level search, the second level checks is skipped. This
patch doesn't change the bitstream. At speed 0, it speeds up the encoder
by 1% - 2%.

Change-Id: I054c91b884d3f7aef157436c061744562bd6506d
2015-08-04 12:06:21 -07:00
Jingning Han
5f138986fc Exclude inv_txfm dspr2 files from make file when highbd is on
Add a guard to exclud dspr2 inverse transform files from vpx_dsp
make file, when high bit-depth is turned on. This fixes the jenkins
nightly build.

Change-Id: Ibacd86563af1ec4810c550905b3fa0397baeeafc
2015-08-04 09:47:31 -07:00
Johann Koenig
ac29aa135c Merge "Rename vp8 loopfilter_mmx.asm" 2015-08-04 15:55:48 +00:00
Parag Salasakar
805a12c75b Merge "mips msa vp8 denoising filter optimization" 2015-08-04 04:30:44 +00:00
Parag Salasakar
814e1346a6 Merge "mips msa vpx convolve optimzation" 2015-08-04 04:30:22 +00:00
Parag Salasakar
cc4c5de22f Merge "mips msa vpx subpel variance optimization" 2015-08-04 04:30:11 +00:00
Parag Salasakar
5a9f36d391 Merge "mips msa vpx subtract test added" 2015-08-04 04:29:45 +00:00
Jingning Han
457a87d986 Merge "Move inverse transfrom dspr2 functions from vp9 to vpx_dsp" 2015-08-04 04:16:22 +00:00
James Zern
c353da68aa third_party/libwebm: pull from upstream
Changes:
b6de61a Adds support for simple tags
75a6d2d sample_muxer: Don't write huge files.
cec1f85 mkvmuxer: remove unused timecode_scale variable
8a61b40 Merge "mkvparser: Tiny whitespace fix."
7affc5c clang-format re-run
d6d04ac mkvmuxer: use generic Cluster::AddFrame
4928b0b Merge "mkvmuxer: Write Block key frames correctly."
c2e4a46 Merge "sample_muxer: Use AddGenericFrame to add frames."
e97f296 mkvparser: Tiny whitespace fix.
d66ba44 Merge "Add support to parse DisplayUnit."
deb41c2 Add support to parse DisplayUnit.
42e5660 Fix issues on EBML lacing block parsing
fe1e9bb Fix block parsing to not allow frame_size = 0
2cb6a28 Change assertions to checks when parsing TrackPositions
d04580f Fixes issues on Block Group parsing
c3550fd mkvmuxer: Write Block key frames correctly.
5dd0e40 Merge "mkvmuxer: Set is_key to true for metadata blocks."
8e96863 mkvmuxer: Set is_key to true for metadata blocks.
a9e4819 sample_muxer: Use AddGenericFrame to add frames.
5a3be73 Change assertions to checks when load CuePoints
f99f3b2 mkvmuxerutil::EbmlDateElementSize: remove value param
ff572b5 Frame::IsValid: fix track_number check
b6311dc mkvmuxer: Refactor to remove a lot of duplicate code
256cd02 Merge "mkvmuxer: DiscardPadding should be signed integer."
16c8e78 mkvmuxer: s/frame/data in all AddFrame* functions.
c5e511c mkvmuxer: DiscardPadding should be signed integer.
4baaa2c Add framework build script: iosbuild.sh
3d06eb1 PATENTS: fix a typo: constitutes -> constitute
d3849c2 mkvparser: Dead code removal.
f439e52 Change assertions to checks when preloading Cues
d3a44cd Fix track transversal when listing Cues on sample
c6255af Tweak .gitignore so git status is clean after checkout and
build: - added missing underscore to sample_muxer - added cmake and make
related files
b5229c7 Makefile.unix: s/samplemuxer/sample_muxer/
e3616a6 Add support to parse stereo mode, display width and display
height in mkvparser
a4b68f8 parser: Fix bug in Chapters::Atom::Parse()
bab0a00 cmake: Set library and project name the proper way on Windows.
feeb9b1 Set library name to match Windows expectations.
b9a549b Fix CMakefile to generate libwebm.a
b386aa5 Add CMakeLists.txt and msvc_runtime.cmake.
b0f8a81 parser: Fix memory leak in Chapter parsing
f06e152 mkvmuxer: Fix MoveCuesBeforeClustersHelper recursive call.
27bb747 allow subtitle tracks with ContentEncodings
623d182 DoLoadCluster: tolerate empty clusters
1156da8 Update PATENTS to reflect s/VP8/WebM/g
0d4cb40 mkvmuxerutil: Use rand() in MSVC builds.
e12fff0 mkvmuxer: Overload WriteEbmlHeader for backward compatibility
a321704 mkvmuxer: write correct DocTypeVersion
574045e mkvmuxer: fix DiscardPadding
8be6397 Include crop elements when calculating size of Video element
8f2d1b3 mkvparser: fix DiscardPadding extraction
1c36c24 mkvmuxer: fix style guide violations
568504e Merge "UUIDs can have their high bit set"
acf788b Add support for CropLeft, CropRight, CropTop and CropBottom
elements.
418188b Merge "muxer: codec_id is a mandatory element"
07688c9 mkvmuxer: Reject frames if invalid track number is passed.
2a63e47 muxer: codec_id is a mandatory element
d13c017 UUIDs can have their high bit set

Change-Id: Iba28acb1ff774349d03e565f2641ddea132cf1e7
2015-08-03 20:29:47 -07:00
James Zern
18427983ab Merge "update libyuv to r1456" 2015-08-04 02:34:32 +00:00
James Zern
a2746d7096 examples.mk: quiet vcproj script exec by default
the full command line can be seen with V=1 as with the other gen*
scripts

Change-Id: Id045b57e0f9af17d82d79201bbc1241b25a2b821
2015-08-03 19:31:32 -07:00
James Zern
a0fd7a9831 Merge "add vp9_vector_var_neon" 2015-08-04 02:30:41 +00:00
James Zern
d011808777 gen_msvs_proj.sh: avoid asm object name collisions
fixes link under vs9; this is the same change as:
dbf6e3f gen_msvs_vcxproj.sh: Avoid object name collisions.

Change-Id: I2a188c9024d0605e60e5e03ddcef1a25e7e53585
2015-08-03 16:22:21 -07:00
Johann
749c393c8d Rename vp8 loopfilter_mmx.asm
Chromium puts all the yasm output in the same directory. Looking at ways
to improve this but in the meantime get rid of collisions.

Change-Id: I923c5231d14e895ab96521eb89807ede868a0753
2015-08-03 14:27:03 -07:00
Jingning Han
bfad9d2fe6 Move inverse transfrom dspr2 functions from vp9 to vpx_dsp
Change-Id: Ia9cf7c31cab4ba3dd6b9bb668c4b3e84bd55cf69
2015-08-03 11:59:50 -07:00
Jingning Han
7723b8df6a Merge "Add common_dspr2.c file to vpx_dsp/mips" 2015-08-03 18:58:37 +00:00
Yaowu Xu
9d9273726b Merge "Correct the allocation size for ssim_vars" 2015-08-03 18:43:55 +00:00
Jingning Han
92b08f516a Add common_dspr2.c file to vpx_dsp/mips
Move the declaration of commonly referenced variable to
vpx_dsp/mips/common_dspr2.c.

Change-Id: Ia51287b02e2ac5cfae0fba98c721f0810618f28e
2015-08-03 10:53:47 -07:00
Yaowu Xu
8f089cbd2e Correct the allocation size for ssim_vars
Ssim_vars is used to accumulate stats based 4x4 pixel blocks, this
commit changes the allocations size to be based on mi_rows and mi_cols
to avoid out-of-bound memory access for larger size videos. The hard
coded 720x480 can only work for image size up to 2880x1920.

Change-Id: Id9d07f3f777385b448ac88a6034b7472e4cf3c79
2015-08-03 10:46:12 -07:00
Jingning Han
a68356202d Remove vpx_ prefix from the dspr2 file name in vpx_dsp/mips
Make it consistent with other formats.

Change-Id: I28f0d05ff7c5bf2b815989b3f1bd6c6b25608677
2015-08-03 09:59:14 -07:00
Scott LaVarnway
8f6b943100 VPX: Add rtcd support for scaling.
Change-Id: If34bfb0d918967445aea7dc30cd7b55ebfedb1f2
2015-08-03 09:43:34 -07:00
Jingning Han
d10fc5af8f Merge "Add vpx_dsp_rtcd.h to inv_txfm_sse2.c" 2015-08-03 16:03:09 +00:00
Jingning Han
b096db5ad4 Merge "Remove vp9_common.h from idct16x16_neon.c" 2015-08-03 16:03:02 +00:00
Parag Salasakar
1579bb88c5 mips msa vpx convolve optimzation
Removed redundant clip/saturate code from 2tap filter functions
average improvement 10%-40%

Change-Id: I1dafb5f7d2ce7a021d883d8af30fb93cd9ace173
2015-08-03 14:03:40 +05:30
Parag Salasakar
9b375871db mips msa vpx subpel variance optimization
Removed redundant clip/saturate code from 2tap filter functions
average improvement 20%-40%

Change-Id: I362540b0c7d5d3d69932c39d61b7d2a44da533d2
2015-08-03 13:00:55 +05:30
Parag Salasakar
4bfe3bdf27 mips msa vpx subtract test added
Change-Id: I0f0827a665c4d3039d3e5f09fa8c75c8f2bb2bab
2015-08-03 09:42:11 +05:30
Jingning Han
0b0eba728d Add _dspr2 to local function names
It avoids symbol conflicts between function names of various
implementation versions.

Change-Id: Iad79ebcb8e289457801812a7745c8380b5b06a46
2015-08-02 20:21:59 -07:00
Jingning Han
da7dc59837 Merge "Factor out mips/msa inverse transform implementations" 2015-08-03 03:18:39 +00:00
Jingning Han
0fcfc613c6 Merge "Add x86inc flag guard to inv_txfm_sse2.asm" 2015-08-02 21:56:09 +00:00
Jingning Han
6eabf229e2 Remove vp9_common.h from idct16x16_neon.c
Change-Id: I3df35a99900ef8ce549d315866849a10db1a4c7b
2015-08-02 09:57:25 -07:00
Jingning Han
4f7a7d29fa Add x86inc flag guard to inv_txfm_sse2.asm
Fix the VS build failure.

Change-Id: I4fb9d1c83980c4b52d5a848a9cb02ec72493dccb
2015-08-02 08:43:51 -07:00
Jingning Han
80ae856c8b Add vpx_dsp_rtcd.h to inv_txfm_sse2.c
Change-Id: Ibab434fb4bd6da02dba087582ed74811f555c3ed
2015-08-02 08:25:13 -07:00
James Zern
22a8474fe7 vpx_convolve_copy_sse2: fix win64
xmm6-7 need to be stored

Change-Id: I6c51559598d335946ec91be6246b49589c63b724
2015-08-01 11:45:49 -07:00
Jingning Han
44849516d4 Factor out mips/msa inverse transform implementations
Move mips/msa inverse transform implementations from vp9 folder to
vpx_dsp.

Change-Id: Ic4cf3f05247c3c63db7b532a0e5000017a962391
2015-08-01 09:25:12 -07:00
Jingning Han
b37494cfb5 Merge "Use precise header files in inverse transform msa implementations" 2015-08-01 16:20:43 +00:00
Jingning Han
b4c7d0523a Merge "Factor inverse transform functions into vpx_dsp" 2015-08-01 16:20:24 +00:00
Parag Salasakar
d35f992599 mips msa vp8 denoising filter optimization
average improvement ~2x-3x

Change-Id: I6c17012c731fa4d56e0343f8de0df47b2dde289b
2015-08-01 08:05:25 +05:30
Parag Salasakar
c1b233dd43 Merge "mips msa vp8 temporal filter optimization" 2015-08-01 02:12:20 +00:00
James Zern
fcb4253c9c update libyuv to r1456
picks up build warning fixes for visual studio 2015

Change-Id: Idea85fa70d1aeb2a46ea355b87fe41ec5b2b9520
2015-07-31 18:34:20 -07:00
Jingning Han
4dc390b15d Merge "Add dynamic range notes to vp9_vector_var_c" 2015-08-01 01:01:37 +00:00
James Zern
7dc5a689b4 add vp9_vector_var_neon
~50-60% faster depending on the width

Change-Id: I9d007cfa10b9aaa2169c8c009d95522df6123a92
2015-07-31 17:31:58 -07:00
Aℓex Converse
fd22c492f7 Merge "Turn off simple_model_rd_from_var at speed 4." 2015-07-31 23:51:01 +00:00
Jingning Han
36a9a33b90 Add dynamic range notes to vp9_vector_var_c
Change-Id: If536ad31046ecd9e2ecd9c21f52f8192c8153ad7
2015-07-31 16:42:09 -07:00
Jingning Han
56c2cb7553 Use precise header files in inverse transform msa implementations
Change-Id: Ie8a79d9e2837842c3f60776b661cd42782b108d5
2015-07-31 23:24:54 +00:00
James Zern
d8642d831f Merge "VP9_COPY_CONVOLVE_SSE2 optimization" 2015-07-31 23:22:34 +00:00
Jingning Han
e8b133c79c Factor inverse transform functions into vpx_dsp
This commit moves the module inverse transform functions from vp9
to vpx_dsp folder. The hybrid transform wrapper functions stay in
the vp9 folder, since it involves codec-specific data structures.

Change-Id: Ib066367c953d3d024c73ba65157bbd70a95c9ef8
2015-07-31 16:21:00 -07:00
Alex Converse
af6d2c7d42 Turn off simple_model_rd_from_var at speed 4.
This got erroneously changed during the refactor. This fixes
SvcTest.TwoPassEncode2TemporalLayersWithMultipleFrameContextsAndTiles.

Change-Id: Ifa5ab0e098396c5e2d10478db87df256eadfa4c7
2015-07-31 15:50:17 -07:00
James Zern
e184b613b9 Merge changes Iecdbbc34,I8b4db93f
* changes:
  Android.mk: fix *_rtcd.h deps for armeabi-v7a
  Android.mk: add a dep on vpx_config.asm for x86_64
2015-07-31 22:22:48 +00:00
Scott LaVarnway
a5e97d874b VP9_COPY_CONVOLVE_SSE2 optimization
This function suffers from a couple problems in small core(tablets):
-The load of the next iteration is blocked by the store of previous iteration
-4k aliasing (between future store and older loads)
-current small core machine are in-order machine and because of it the store will spin the rehabQ until the load is finished
fixed by:
- prefetching 2 lines ahead
- unroll copy of 2 rows of block
- pre-load all xmm regiters before the loop, final stores after the loop
The function is optimized by:
copy_convolve_sse2 64x64 - 16%
copy_convolve_sse2 32x32 - 52%
copy_convolve_sse2 16x16 - 6%
copy_convolve_sse2 8x8 - 2.5%
copy_convolve_sse2 4x4 - 2.7%
credit goes to Tom Craver(tom.r.craver@intel.com) and Ilya Albrekht(ilya.albrekht@intel.com)

Change-Id: I63d3428799c50b2bf7b5677c8268bacb9fc29671
2015-07-31 14:51:51 -07:00
Jingning Han
6025c6d65b Merge "Fix compiler warning in mips/dspr2" 2015-07-31 21:29:50 +00:00
Aℓex Converse
dd4b416412 Merge "Compute skippable inside the block_rd_txfm loop." 2015-07-31 21:19:11 +00:00
Jingning Han
135b43ccf3 Fix compiler warning in mips/dspr2
This commit fixes the mix declaration and definition warning when
mips/dspr2 is turned on.

Change-Id: I633d6fe42368b9ac35b106786ebac6969ad53552
2015-07-31 12:34:34 -07:00
Aℓex Converse
90e563d91f Merge changes Ic1ce346a,Ic0b4e92c
* changes:
  Simplify model_rd_for_sb HBD ifdefs
  Simplify dist_block HBD ifdefs
2015-07-31 19:05:54 +00:00
Alex Converse
ab20c98e84 Compute skippable inside the block_rd_txfm loop.
Change-Id: Iaa43aeeb7a2074495e00cdb83bb551c3f13d3ed2
2015-07-31 11:45:59 -07:00
Zoe Liu
7f8dd35329 Merge "Refactor mips/dspr2 on convolution." 2015-07-31 18:23:19 +00:00
Zoe Liu
873a158f14 Merge "Code refactor on InterpKernel" 2015-07-31 18:20:14 +00:00
Alex Converse
c62228f273 Simplify model_rd_for_sb HBD ifdefs
Change-Id: Ic1ce346a053800ae3b2d77178f46e6a388357f6d
2015-07-31 11:16:59 -07:00
Alex Converse
da9c73c293 Simplify dist_block HBD ifdefs
Change-Id: Ic0b4e92cbaf813bcca8a8e9052c936c2e025e114
2015-07-31 11:04:01 -07:00
Aℓex Converse
8abd0c2a12 Merge "Short circuit rate_block in block_rd_txfm." 2015-07-31 17:59:22 +00:00
Zoe Liu
7cfdc00337 Refactor mips/dspr2 on convolution.
Change-Id: If59a39d5a92c261537342726f94bb7f7f26dfff3
2015-07-31 10:27:42 -07:00
Zoe Liu
7186a2dd86 Code refactor on InterpKernel
It in essence refactors the code for both the interpolation
filtering and the convolution. This change includes the moving
of all the files as well as the changing of the code from vp9_
prefix to vpx_ prefix accordingly, for underneath architectures:
(1) x86;
(2) arm/neon; and
(3) mips/msa.
The work on mips/drsp2 will be done in a separate change list.

Change-Id: Ic3ce7fb7f81210db7628b373c73553db68793c46
2015-07-31 10:27:33 -07:00
Alex Converse
4ac5058afc Give skip_txfm constants names.
This is using a define instead of an enum to keep byte packing.

Change-Id: I3abb07c8bfe377e19be4531b624af7b7b4207792
2015-07-31 10:08:08 -07:00
Alex Converse
73422d3b2d Short circuit rate_block in block_rd_txfm.
Don't run rate_block (cost_coeffs) if distortion alone is enough to
surpass best_rd.

This decreases 2nd pass runtime on HD at speed 2 by about 2%. There is
zero effect on output if tx_cache is removed.

Change-Id: Ia3b1cc77bfbe6ee988c395fde06c0eb92940b784
2015-07-31 10:05:51 -07:00
Parag Salasakar
8fbc641540 mips msa vp8 temporal filter optimization
average improvement ~2x-3x

Change-Id: I05593bed583234dc7809aaec6cab82773a29505d
2015-07-31 12:03:19 +05:30
Parag Salasakar
0e3f494b21 mips msa vp8 block subtract optimization
average improvement ~2x-3x

Change-Id: I30abf4c92cddcc9e87b7a40d4106076e1ec701c2
2015-07-31 09:29:10 +05:30
Parag Salasakar
e3ee8c292b Merge "mips msa vp8 quantize optimization" 2015-07-31 03:44:03 +00:00
Yunqing Wang
3b2e73b9a4 Remove tx cache and speed up tx size selection
1. The RD scores obtained during the tx size selection were stored in the
tx cache, and used to help make the tx decision for the following frames.
This wasn't used anymore in VP9 encoder. Recovered the related decision
making code from 1.5+ years ago, and borg tests didn't show any quality
gain. This patch removed it to lower the complexity.

2. An optimization was done after the above refactoring. If the tx_mode
is not TX_MODE_SELECT, we only need to test the chosen tx size instead
of all posible tx sizes. This gave a 1.5% average speed gain at speed 2,
and a 1% average speed gain at speed 3.

Change-Id: Id8cd650e066a8cef33829d8c15388a8138adc78c
2015-07-30 18:53:40 -07:00
Aℓex Converse
eb6b443bd2 Merge "Convert simple_model_rd_from_var from a speed check to a speed feature." 2015-07-30 23:04:28 +00:00
Hui Su
a71c5c0ee9 Merge "Exclude vpx intra prediction functions in vp8-only build" 2015-07-30 22:29:35 +00:00
Alex Converse
c827c59eaf Convert simple_model_rd_from_var from a speed check to a speed feature.
Change-Id: I8877025e172fff29bc4e270790211463b676b4d7
2015-07-30 13:53:26 -07:00
hui su
5fddefbced Exclude vpx intra prediction functions in vp8-only build
Currently vp8 is not using the intra prediction functions in vpx_dsp.

Change-Id: I1522b5f5cb12a81999fb126cf7c62c70259e7a52
2015-07-30 13:49:47 -07:00
James Zern
21da45e570 Android.mk: fix *_rtcd.h deps for armeabi-v7a
strip '.neon' so *_rtcd.h depends on the correct file

Change-Id: Iecdbbc34c9ce5c6d0a4b466332d52f4e6a0cb128
2015-07-30 13:27:30 -07:00
Parag Salasakar
56aa0da405 mips msa vp8 quantize optimization
average improvement ~2x-3x

Change-Id: I6fc37191bf9cb5a67e1af9787d0d27659c17bdba
2015-07-30 12:56:57 -07:00
Alex Converse
b7f441a0bc Cleanup rdcost_block_args
Change-Id: I9d613cbe9e76b5dd15e935878ef9fd04521690ba
2015-07-30 12:55:51 -07:00
Aℓex Converse
c0f0245e8a Merge "Clean up some casts." 2015-07-30 19:37:28 +00:00
Jingning Han
91feec1452 Merge "Cosmetics - Fix header file order in unit tests" 2015-07-30 05:37:53 +00:00
Jingning Han
097d59c28c Cosmetics - Fix header file order in unit tests
Change-Id: I9582a8d74990125b71e8fe620f7f3f2585a30798
2015-07-29 20:48:25 -07:00
Parag Salasakar
0c2a14f9e2 mips msa vp8 fdct optimization
average improvement ~2x-4x

Change-Id: Id0bc600440f7ef53348f585ebadb1ac6869e9a00
2015-07-30 08:14:42 +05:30
Parag Salasakar
7c6ae373ac Merge "mips msa vp8 post proc optimization" 2015-07-30 02:34:06 +00:00
Aℓex Converse
583c205270 Merge "Comment zcoeff_blk." 2015-07-30 01:06:08 +00:00
Alex Converse
dfe7fdae7d Comment zcoeff_blk.
Change-Id: Iefc2eb78e71472ecf51802ec59ff32caef4bd0f4
2015-07-29 16:53:33 -07:00
Yaowu Xu
f23241087a Add const to a variable declaration
Change-Id: Idf572c22a87098665f5179dc3212a06d9a85a342
2015-07-29 16:27:34 -07:00
Yaowu Xu
47c55acdad Fix a typo
Change-Id: Ief8eea8fe6bef139d1e94f8d6dfac5a44efe785d
2015-07-29 16:23:14 -07:00
James Zern
e3365c894a Android.mk: add a dep on vpx_config.asm for x86_64
Change-Id: I8b4db93f754607aab64351745bd102ab238d9501
2015-07-29 15:38:43 -07:00
Alex Converse
49e0673659 Clean up some casts.
Change-Id: I264ca534cd7d4755906e20aea47e7a2523bca611
2015-07-29 11:26:51 -07:00
Parag Salasakar
a5d9416fd7 mips msa vp8 post proc optimization
average improvement ~2x-4x

Change-Id: I93abc15389649c169bb8b69127c0b95407d34692
2015-07-29 09:40:26 +05:30
Parag Salasakar
ce4c4b96e4 Merge "mips msa vp8 filter by weight optimization" 2015-07-29 04:00:41 +00:00
James Zern
f42012e526 Merge "add vp9_block_error_fp_neon" 2015-07-29 00:47:09 +00:00
Hui Su
4cbf36b105 Merge "Replace prefix vp9_ with vpx_ for intra prediction functions" 2015-07-29 00:38:48 +00:00
Jingning Han
d12a4a825c Merge "Replace vp9_ prefix in 2D-DCT functions with vpx_" 2015-07-29 00:07:31 +00:00
Jingning Han
39e3937c24 Merge "Remove vp9_dct.h file" 2015-07-29 00:06:56 +00:00
Jingning Han
fc18cf7a11 Merge "Move DC only forward 2D-DCT functions to vpx_dsp" 2015-07-29 00:06:37 +00:00
Jingning Han
4b5109cd73 Replace vp9_ prefix in 2D-DCT functions with vpx_
Clean up the forward 2D-DCT function names in vpx_dsp.

Change-Id: I3117978596d198b690036e7eb05fe429caf3bc25
2015-07-28 16:06:44 -07:00
Jingning Han
a7e9178d80 Remove vp9_dct.h file
The forward 32x32 2D-DCT functions are aligned in vpx_dsp folder.
The vp9_dct.h file is not effectively used now.

Change-Id: Ie7946b6fdd784b8e91496242337bc9002c75c281
2015-07-28 15:27:36 -07:00
Aℓex Converse
08d5cf226e Merge "Remove branch in inner loop of foreach_transformed_block_in_plane()" 2015-07-28 21:59:33 +00:00
Aℓex Converse
8191ed8b63 Merge changes If196d9e5,Ib669d572
* changes:
  Simplify is_skippable to point straight to eobs.
  Don't initialize extra context tree buffers for 4x8 and 8x4.
2015-07-28 21:59:02 +00:00
Jingning Han
d19033fa4e Move DC only forward 2D-DCT functions to vpx_dsp
This completes the forward transform functions layout refactoring.

Change-Id: I996fb0fb795f41e2040f7b21db985774098aedbd
2015-07-28 14:52:30 -07:00
James Zern
bd863314d0 Merge "build/make/Android.mk: support TARGET_ARCH_ABI=x86_64" 2015-07-28 21:50:35 +00:00
Johann
124ada514b Don't use 'h' for functions using x86inc.asm
In newer version of x86inc.asm 'h' is used as a modifier for register
names.

Change-Id: Ie5b9dd2f91ecdc8f6f18b2701b6dc23042b604e4
2015-07-28 14:00:32 -07:00
Hui Su
fe7cabe8b6 Merge "Move intra prediction functions from vp9/common/ to vpx_dsp/" 2015-07-28 20:41:01 +00:00
Jingning Han
a73f0f4170 Merge "Factor 32x32 fwd DCT to vpx_dsp folder" 2015-07-28 20:36:59 +00:00
Jingning Han
a6a4659bea Factor 32x32 fwd DCT to vpx_dsp folder
Move the 32x32 2D-DCT implementations from vp9/ to vpx_dsp/.

Change-Id: Id3980696f8b69906ff7a59ff9fb2b9013d60047d
2015-07-28 11:13:41 -07:00
Frank Galligan
b1fb6e0365 Fix dspr2 build.
Change-Id: I18895c29d6db872d033b3874de9dcd9501d0c10e
2015-07-28 09:05:41 -07:00
James Zern
ea990af7f5 add vp9_block_error_fp_neon
~60-70% faster depending on the block size

Change-Id: Icdbaa9977a91a63cbcc6ead0cf19d5a2af7f27e1
2015-07-27 19:59:50 -07:00
Parag Salasakar
5deb983744 mips msa vp8 filter by weight optimization
average improvement ~3x-5x

Change-Id: Ia808ae56b118e0e1b293901447aa5a0f597b405b
2015-07-28 08:16:34 +05:30
Parag Salasakar
f8b869f573 Merge "mips msa vp8 recon intra optimization" 2015-07-28 02:27:31 +00:00
Yunqing Wang
4f08d3d6c5 Merge "Remove tx_select_threshes" 2015-07-28 01:25:14 +00:00
Jingning Han
8eefb36ca9 Move forward dct sse2 header file to vpx_dsp
Change-Id: Iba03852ce778c956200818e3473cfb2b48cf8d8e
2015-07-27 14:59:57 -07:00
hui su
4013645353 Replace prefix vp9_ with vpx_ for intra prediction functions
Change-Id: I8ae6fb586f8d5d018ace228df11714f82b085076
2015-07-27 13:42:06 -07:00
hui su
7971846a5e Move intra prediction functions from vp9/common/ to vpx_dsp/
Change-Id: I64edc26cf4aab050c83f2d393df6250628ad43b8
2015-07-27 13:38:16 -07:00
Jingning Han
5f214d6bca Use common coefficient definition in neon idct implementations
Replace the duplicate coefficient definition in neon implementations
of inverse transform with those from vpx_dsp/txfm_common.h

Change-Id: I4cd9bd9569ab1793dfdbb6f16d80bcb581599f0d
2015-07-27 12:12:31 -07:00
Yunqing Wang
b2446fb6be Remove tx_select_threshes
Removed unused tx_select_threshes and tx_select_diff.

Change-Id: I5e9e7ad170056efe14b5f071e94d0c5a36e4a34c
2015-07-27 12:02:05 -07:00
Jingning Han
a9a1d4e8e5 Replace vp9_idct.h for precise dependency
This commit replaces vp9_idct.h with txfm_common.h in many SIMD
implementation files for precise file dependency.

Change-Id: If73dd726bb16537e7494f28538b0a169810f9756
2015-07-27 11:55:31 -07:00
Jingning Han
5ebc8febdc Refactor vp9_idct.h file
Separate the common coefficient constant into vpx_dsp/txfm_common.h.
Move the SSE2 macro definitions to vpx_dsp/x86/txfm_common_sse2.h.
This clears the use case of vp9_idct.h in vpx_dsp folder.

Change-Id: I319735a2abf42888e5080ac14cfbcde34be7b121
2015-07-26 08:26:32 -07:00
Parag Salasakar
af6733aec6 mips msa vp8 recon intra optimization
average improvement ~3x-5x

Change-Id: I73306863e9bf172d5adc06b8dd54e43985d1e063
2015-07-25 12:32:26 +05:30
James Zern
5da87e84d5 build/make/Android.mk: support TARGET_ARCH_ABI=x86_64
requires r10e or newer:

Android NDK, Revision 10e (May 2015)
...
Other bug fixes:
...
  - Fixed .asm support for ABI x86_64.

Change-Id: I51ec9a5f77c982b7412d922e896348a83ae2d7d6
2015-07-24 19:36:39 -07:00
Marco Paniconi
55c6a74bd4 Merge "Dynamic resize for real-time: reference scaling." 2015-07-24 22:23:10 +00:00
Jingning Han
48de07d882 Remove redundant function definitions in vp9_dct_sse2.h
Change-Id: I283d364a4e65ca9bf6ff581da1d0b498433c5402
2015-07-24 21:12:06 +00:00
Jingning Han
252ec59821 Remove vp9_dct.h from fwd_txfm_impl_sse2 header file
Change-Id: Ib3a4814fdb9d69cf6cc23bdd208f9bc9e7972edc
2015-07-24 21:11:44 +00:00
Jingning Han
c376fbc62e Merge "Move msa implementations of 2D-DCT to vpx_dsp" 2015-07-24 21:11:33 +00:00
Jingning Han
9aaf523ace Move msa implementations of 2D-DCT to vpx_dsp
Refactor and clean up the msa transform related code layout.

Change-Id: Ic5048bd3d62a6046589817da745370ea89448e44
2015-07-24 13:24:25 -07:00
Parag Salasakar
16dcf013d3 Merge "mips msa vp8 bilinear filter optimization" 2015-07-24 18:16:23 +00:00
Alex Converse
742021f026 Remove branch in inner loop of foreach_transformed_block_in_plane()
Change-Id: Ib14d09376a9ce4fa5f541264e5c335aceb71380a
2015-07-24 11:14:33 -07:00
Alex Converse
d3b6062a13 Simplify is_skippable to point straight to eobs.
Change-Id: If196d9e5c7a15ee7d988ee2ecbf155a54d59b480
2015-07-24 11:14:33 -07:00
Alex Converse
964058129f Don't initialize extra context tree buffers for 4x8 and 8x4.
Change-Id: Ib669d572654f24fd43410a9399a8b609e87f846a
2015-07-24 11:14:33 -07:00
Hui Su
a15edeb76d Merge "Code cleanup in vp9_encode_block_intra" 2015-07-24 17:40:37 +00:00
Aℓex Converse
a60e0c15bc Merge "Allocate four |zcoeff_blk| for sub8x8 contexts." 2015-07-24 17:38:45 +00:00
Aℓex Converse
b4297bb122 Merge "Allocate eobs array per txblock and not per pixel." 2015-07-24 17:38:32 +00:00
Parag Salasakar
fb73ceae85 mips msa vp8 bilinear filter optimization
average improvement ~3x-4x

Change-Id: I8c0b3d5c86c9eb4f802b87c971864d2cfceeb7cc
2015-07-24 09:21:35 +05:30
Parag Salasakar
fd660f0164 Merge "mips msa vp8 copy mem optimization" 2015-07-24 03:43:37 +00:00
Marco
f01c769dc6 Dynamic resize for real-time: reference scaling.
Avoid scaling the references if they have already been scaled.
Change only affects 1 pass non-svc mode for now.

Change-Id: I204f4079c026cba7adce7a7f855d072f6139ccec
2015-07-23 16:08:40 -07:00
Alex Converse
e905da6f9c Allocate four |zcoeff_blk| for sub8x8 contexts.
The RD and load save/code grabs it as groups of four. In practice there
is no change to physical allocations becaquse this is backed by a 16-byte
memalign.

Change-Id: I01e89769872300e23227e03dd24a6e229f482025
2015-07-23 15:43:48 -07:00
Alex Converse
fa84acb441 Allocate eobs array per txblock and not per pixel.
Change-Id: I5368f5fc7283420c38d5bd85e3077b761d94ace6
2015-07-23 15:19:43 -07:00
Jingning Han
d4657a7efb Merge "Add x86_64 flag to guard fwd_txfm_ssse3.asm in make file" 2015-07-23 21:21:07 +00:00
Jingning Han
e8c6c00d80 Merge "Fix vp9_psnrhvs.c build error" 2015-07-23 21:19:40 +00:00
Jingning Han
598b083342 Fix vp9_psnrhvs.c build error
Add vpx_dsp_rtcd.h to the header file list. The od_bin_fdct8x8()
here depends on forward 8x8 2D-DCT.

Change-Id: I1d71edc71f07069808823d2445c1cafd285e1b94
2015-07-23 13:00:15 -07:00
Jingning Han
5ddfa101c9 Add x86_64 flag to guard fwd_txfm_ssse3.asm in make file
This fixes a VS build error. Fix by @johannkoenig.

Change-Id: I6e71435d70ae56079db7328e4c7915416ece8fda
2015-07-23 12:55:50 -07:00
Jingning Han
d341f843e2 Refactor forward/inverse transform msa implementations
This commit factors out common macro definitions from the forward
and inverse transform implementations into vpx_dsp. It removes
the duplicate macro definitions from encoder and decoder folders.

Change-Id: I92301acbd3317075e9c5f03328a25abb123bca78
2015-07-23 11:20:30 -07:00
Parag Salasakar
509fb0bc9d mips msa vp8 copy mem optimization
average improvement ~2x-4x

Change-Id: I3af3ecced96c5b8e0cb811256e5089e28fe013a2
2015-07-23 10:29:40 +05:30
James Zern
33a9d53c10 Merge "mips/dspr2: fix vp9-highbitdepth build" 2015-07-23 02:08:50 +00:00
Jingning Han
2b4f49cb1a Merge "Take out VP9_ prefix from mips/msa macros" 2015-07-23 01:15:52 +00:00
Parag Salasakar
00a35fdeda Merge "mips msa vp8 sixtap filter optimization" 2015-07-23 01:03:39 +00:00
Yaowu Xu
963b9b8818 Merge "Added TODOs for two unused #defines" 2015-07-23 00:23:39 +00:00
Jingning Han
97ec51233d Take out VP9_ prefix from mips/msa macros
The msa macros are locally used and should not be named with VP9
prefix.

Change-Id: I2c9c746c4027383c16b9ab12b77b4e70e7e7d206
2015-07-22 16:47:42 -07:00
Jingning Han
f0f00251ea Merge "Factor forward 2D-DCT transforms into vpx_dsp" 2015-07-22 23:47:03 +00:00
Yaowu Xu
130c0ec71a Added TODOs for two unused #defines
Change-Id: I70407e9350147d6585667f157d9cfe78c6251d26
2015-07-22 15:54:56 -07:00
Jingning Han
b67821f37b Factor forward 2D-DCT transforms into vpx_dsp
This commit factors the 4x4, 8x8, and 16x16 2D-DCT forward
transform operations into vpx_dsp folder.

Change-Id: I084b117b79c0925edcbcabb93f62b9f4bf8dbe7d
2015-07-22 15:48:17 -07:00
James Zern
9a0a2193e4 mips/dspr2: fix vp9-highbitdepth build
vp9_itrans*_dspr2.c aren't necessary for high bitdepth builds and
notably vp9_itrans8_dspr2.c fails in various configurations using a
codesourcery toolchain:
vp9_itrans8_dspr2.c:31:5: can't find a register in class 'GR_REGS' while reloading 'asm'

Change-Id: I2ac76203e65cc643cb835ab50e95701896d92a1a
2015-07-22 11:54:39 -07:00
Scott LaVarnway
34c4e1d6f9 Merge "Delete ChangeFilterWorks test" 2015-07-22 18:39:11 +00:00
hui su
e298d650cb Code cleanup in vp9_encode_block_intra
Change-Id: Ie4d958b26e586db218f8ee95d5df4bf11f2345a1
2015-07-22 10:53:12 -07:00
Scott LaVarnway
1ec0853d17 Delete ChangeFilterWorks test
This test places 128 in positions that would not be found
in the VP9 filter tables.  The ssse3 code packs this table
into chars and uses the pmaddubsw instruction, which treats
the value as signed.  The ssse3 code checks for 128 in
position 3, skipping the ssse3 code if found, and calls
vp9_convolve8_c().  vp9_convolve8_c() is also used for scaling.
ChangeFilterWorks breaks the ssse3 scaling code found in other
commits.

Change-Id: I1f5a76834bc35180b9094c48f9421bdb19d3d1cb
2015-07-22 09:05:17 -07:00
Jim Bankoski
0fe589f21e Fill buffer speed up
Eliminates the byte by byte read from bool decoder,  by reading
in a size_t and then shifting it into place.

Change-Id: I0ed8c7b6f942847e79cc90105dc1d2b5b3deb0d6
2015-07-21 12:54:44 -07:00
Jingning Han
2726023fc1 Merge "Clean up vp9_dct32x32_sse2_impl.h header files" 2015-07-21 16:31:50 +00:00
Parag Salasakar
2cdd3beac9 Merge "mips msa vp9 avg subpel variance optimization rebased" 2015-07-21 06:07:01 +00:00
Jingning Han
aeee70f9dd Merge "Arrange 1D forward transform order in vp9_dct.c" 2015-07-21 04:59:14 +00:00
Jingning Han
fe39f6cc9f Merge "Remove redundant function definitions from vp9_dct.h" 2015-07-21 04:57:58 +00:00
Yaowu Xu
4110a27d66 Merge "vpx_dsp/bitwriter_buffer.h: vp9_ -> vpx_" 2015-07-21 04:10:23 +00:00
Yaowu Xu
987451d864 Merge "vpx_dsp/bitwriter.h: vp9_->vpx_" 2015-07-21 04:10:09 +00:00
Yaowu Xu
41c13ddbc9 Merge "vpx_dsp/prob.h: vp9_ -> vpx_" 2015-07-21 04:09:53 +00:00
Yaowu Xu
0fc4d4e1ef Merge "vpx_dsp/bitreader_buffer.h: vp9_->vpx_" 2015-07-21 04:09:38 +00:00
Yaowu Xu
ac1e1b698f Merge "vpx_dsp/bitreader.h: vp9_->vpx_" 2015-07-21 04:09:08 +00:00
Yaowu Xu
d41781560e Merge "Fix bug in setting sf->use_square_partition_only." 2015-07-21 01:24:53 +00:00
Yaowu Xu
5f5091636e vpx_dsp/bitwriter_buffer.h: vp9_ -> vpx_
Change-Id: I0ac7beaa160a6c2a60a019f6b8ce85e6537bed7d
2015-07-20 18:13:06 -07:00
Yaowu Xu
817be1d214 vpx_dsp/bitwriter.h: vp9_->vpx_
changes prefix vp9_ to vpx_ for non codec specific functions and
data structures.

Change-Id: I91a21548e39bd24d2c7caaaa223ae47240bb78c8
2015-07-20 18:13:05 -07:00
Yaowu Xu
70ad668056 vpx_dsp/prob.h: vp9_ -> vpx_
change prefix vp9_ to vpx_ for non codec specific functions and data
structures.

Change-Id: I97c7e6422eceea99212b93f4942bc2187763a07c
2015-07-20 18:13:04 -07:00
Yaowu Xu
cbce003712 vpx_dsp/bitreader_buffer.h: vp9_->vpx_
Replace vp9_ in names to vpx_ for non codec specific functions.

Change-Id: Ib9e3b86cb0728d10b239f3493ceda18cc2c34e0f
2015-07-20 18:13:03 -07:00
Yaowu Xu
bf82514b54 vpx_dsp/bitreader.h: vp9_->vpx_
Replace vp9_ in names to vpx_ as they are not codec specific.

Change-Id: I2e583aa63dee769353ada4b42417aa15c4074ebb
2015-07-20 18:06:31 -07:00
Jingning Han
07d5d538c2 Clean up vp9_dct32x32_sse2_impl.h header files
Remove redundant file dependency.

Change-Id: I4708218157617dabe00e2e33e237be2838c16603
2015-07-20 17:22:12 -07:00
Jingning Han
bcbd3c8fa2 Arrange 1D forward transform order in vp9_dct.c
Remove the redundant function declarations therein.

Change-Id: I27731fb70bb1abce63da761a5812f518c62f590f
2015-07-20 16:29:40 -07:00
Jingning Han
1279d3bac7 Remove redundant function definitions from vp9_dct.h
Change-Id: I963f08f1023481712c6f9ed624ddf05e5bac6321
2015-07-20 16:26:36 -07:00
Jingning Han
b8c47a98b8 Merge "Make local functions in vp9_dct.c static" 2015-07-20 23:08:14 +00:00
Yaowu Xu
149822e399 Merge "Correctly report "Unsupported bitstream profile"" 2015-07-20 22:49:54 +00:00
Jingning Han
f62805fae0 Make local functions in vp9_dct.c static
This commit limits the scope of 1-D DCT and ADST functions within
vp9_dct.c and makes them static. This largely clears out the cross
referencing issue between vp9_dct.c and the SIMD optimizations.

Change-Id: If7cac478b11bb32328ccf70a9f60b709dad43d7f
2015-07-20 15:15:27 -07:00
Yaowu Xu
add779e425 Merge "Remove vp9_ prefix from bit writer files" 2015-07-20 21:21:53 +00:00
Yaowu Xu
7a63e6446b Merge "Move bit writer files to vpx_dsp/" 2015-07-20 21:21:41 +00:00
Jingning Han
f987e64476 Merge "Unify the high bit-depth forward hybrid transforms" 2015-07-20 20:19:03 +00:00
Jingning Han
9e23c6d534 Merge "Refactor highbd forward transform use case" 2015-07-20 20:18:22 +00:00
Yaowu Xu
1fcef81cb0 Remove vp9_ prefix from bit writer files
Change-Id: I07647c7482b9ec498fbad3a9c9901f72b2336500
2015-07-20 11:20:03 -07:00
Yaowu Xu
c5ad31e518 Move bit writer files to vpx_dsp/
Change-Id: Id27e0007a0feac821ca66bcecbf3a723305da82d
2015-07-20 11:20:02 -07:00
Jingning Han
e253eaa036 Unify the high bit-depth forward hybrid transforms
The SSE2 version high bit-depth forward hybrid transforms are
essentially using the C functions via cross referencing to 1-D
functions in vp9_dct.c. This commit unifies the two versions and
removes the unnecessary dependency.

Change-Id: Ib4d0702a138f8daf7d0bd97c141ee7088f293765
2015-07-20 11:17:49 -07:00
hui su
f744613be9 Fix uninitialized value warning
Change-Id: Ib919a8ec2ec66d460d2f8a26d72aabc09dcbbd72
2015-07-20 11:13:00 -07:00
Jingning Han
389ed6da10 Refactor highbd forward transform use case
Separate the hybrid transform case from 2D-DCT case. This will
allow us to clear up cross dependency between c and SIMD
implementations later.

Change-Id: Iaa499e8b096850a1c5a0c50a3b6e63e15d0184bf
2015-07-20 10:31:17 -07:00
Yaowu Xu
345ff1a2f2 Merge "Removed vp9_ prefix from vpx_dsp/bitreader file names" 2015-07-20 17:12:08 +00:00
Yunqing Wang
f65473c036 Merge "Migrate quantization functions from vp9/ to vpx_dsp/" 2015-07-20 16:20:07 +00:00
Yaowu Xu
87d2c3c063 Removed vp9_ prefix from vpx_dsp/bitreader file names
Change-Id: I0426126d0a65f13f9250983e44cc366b1b1a9c4a
2015-07-20 08:57:35 -07:00
Yaowu Xu
b0e6811ace Merge "Move bit reader files to vpx_dsp" 2015-07-20 14:52:50 +00:00
Jingning Han
a2b623d467 Merge "Remove dspr2 loop filter files from vp9_common.mk" 2015-07-18 01:33:35 +00:00
Jingning Han
44925b4c17 Merge "Rename loop filter function from vp9_ to vpx_" 2015-07-18 01:33:15 +00:00
Jingning Han
fd15cd5ad9 Remove dspr2 loop filter files from vp9_common.mk
These files have been moved to vpx_dsp directory. Clean the
vp9_common make file accordingly.

Change-Id: I9b1e820376421c801f705157e60cc7a55487f469
2015-07-17 16:38:53 -07:00
Yunqing Wang
38f1fbbb75 Migrate quantization functions from vp9/ to vpx_dsp/
The following quantization functions were moved:
vp9_quantize_b
vp9_quantize_b_32x32
vp9_highbd_quantize_b
vp9_highbd_quantize_b_32x32

vp9_quantize_dc
vp9_quantize_dc_32x32
vp9_highbd_quantize_dc
vp9_highbd_quantize_dc_32x32

The purpose of doing that was to allow these functions to be shared
by multiple codecs.

Change-Id: Id8ab939f283353cdd07bd930d47db3d932a5d87f
2015-07-17 16:38:14 -07:00
Jingning Han
2992739b5d Rename loop filter function from vp9_ to vpx_
Change-Id: I6f424bb8daec26bf8482b5d75dd9b0e45c11a665
2015-07-17 15:55:02 -07:00
Yaowu Xu
97279ed2e2 Move bit reader files to vpx_dsp
Change-Id: Ib1cb1fbe92a39ff5312cee069559be6d3ea458d0
2015-07-17 15:38:40 -07:00
Marco
479c669a61 Merge "Dynamic resize 1 pass mode: fix buffer underflow threshold." 2015-07-17 21:31:56 +00:00
Jingning Han
4735edd00f Migrate mips dspr2 loop filter implementation from vp9 to vpx
This commit moves the loop filter dspr2 implementation from vp9 to
vpx_dsp directory. It also fixes header file format issues.

Change-Id: I09203ed4bd267d7fd76bb79a6ee84a37646206b2
2015-07-17 11:51:05 -07:00
Marco
7501de267c Dynamic resize 1 pass mode: fix buffer underflow threshold.
Remove the use of drop_frames_water_mark, as this is used for
frame dropping control. Use fixed threshold for now on buffer underflow.

Change-Id: If0ddda9f7f6fa96067cdcb0eccb42e17bda37c32
2015-07-17 11:25:15 -07:00
Yaowu Xu
7c0c62df1d Correctly report "Unsupported bitstream profile"
For vp9 decoder build without profile 2 and profile 3 support, this
commit changes to report error "Unsupported bitstream profile" for
input streams in profile 2 or 3, rather than other misleading error
information.

In addition, one of the invalid files in unit tests is actually coded
profile 2, this commit makes it tested only when the decoder is built
with vp9-highbitdepth.

This fixes issue #1028.

Change-Id: I8b6c1210787c8f89c703a546687dcf973ac20fc0
2015-07-17 10:51:02 -07:00
Jingning Han
d0750d287f Resolve dspr2 loop filter dependency complexity
Narrow the scope of dependency required by the dspr2 implementation
of loop filters.

Change-Id: Ib8d99dc7d9c231f69dd31d02e0a89e5bd0545a28
2015-07-17 10:38:35 -07:00
Jingning Han
55e80a3cc6 Replace vp9_common_dspr2.h with common_dspr2.h
Narrow the scope of dependency in dspr2 loop filter implementation.

Change-Id: I30426d7e4d41575a82286f1d3c5881aeb99a3250
2015-07-17 10:31:38 -07:00
Jingning Han
b8ff84b7f8 Create common dspr2 header file in vpx_dsp
Move the common prefetch_load/store in dspr2 to header file in
vpx_dsp/mips.

Change-Id: I8acc22970f2a0ef97d73061e39a3ae65c6955eac
2015-07-17 09:54:02 -07:00
Jingning Han
3590a4b437 Merge "Simplify dependencies in dspr2 related codes" 2015-07-17 16:12:52 +00:00
Jingning Han
be72944166 Merge "Take out unnecessary header file from highbd_loopfilter_sse2" 2015-07-17 16:12:25 +00:00
Jingning Han
0a01e4401b Merge "Remove vp9_ prefix from static function names in loopfilter_16_msa" 2015-07-17 16:12:12 +00:00
Jingning Han
845aad42b8 Merge "Migrate loop filter functions from vp9/ to vpx_dsp/" 2015-07-17 16:12:01 +00:00
Jingning Han
d190ad228f Simplify dependencies in dspr2 related codes
The common_dspr2.h should be independent of codec-specific data
structures.

Change-Id: I34ee1f9552c2d2d205fd7f1813cdf312c7ff5d2b
2015-07-16 18:22:48 -07:00
Jingning Han
6e5ab70a93 Take out unnecessary header file from highbd_loopfilter_sse2
The dependency on vp9_loopfilter.h is not needed.

Change-Id: Ic0583c43d3d63f19cef06cf9d8e5c8031601be6a
2015-07-16 18:15:02 -07:00
Jingning Han
b76fd48a99 Remove vp9_ prefix from static function names in loopfilter_16_msa
Remove the codec-specific global prefix from static function names.

Change-Id: I61b2d5f2b7b5fb9dc8bc357d5493ea44df8ab19d
2015-07-16 18:06:01 -07:00
Jingning Han
50adfdf5ba Migrate loop filter functions from vp9/ to vpx_dsp/
The various tap loop filter operations are common functions across
codec. This commit moves them along with SIMD optimizations to
vpx_dsp folder.

Change-Id: Ia5fa0b2e5289cdb98467502a549c380b9c60e92c
2015-07-16 16:40:47 -07:00
Marco
f83f9dbb3a Merge "Dynamic resize for 1 pass: update of golden frame." 2015-07-16 19:38:27 +00:00
Marco
7ae1aa6b37 Dynamic resize for 1 pass: update of golden frame.
In aq-mode=3 under a resizing action (i.e., resize_pending != 0),
force an update of the golden reference frame.

Change-Id: I14806f6db71b5f8c827678cc5e1fc913c138a9a4
2015-07-16 09:27:20 -07:00
paulwilkins
7d15444d07 Fix bug in setting sf->use_square_partition_only.
Fix bug in setting this flag for animated content.
The bug did cause quality to increase because far
more frames are not boosted than boosted.

However, the speed trade off to gain is a lot less
favorable and the behavior was not as intended.

Change-Id: I89fb70419c88b26f40b3534de0481730a1b3fcfa
2015-07-16 16:20:39 +01:00
Frank Galligan
8be1dcb4cb Merge "Add vp9_int_pro_col_neon." 2015-07-16 05:45:17 +00:00
Jingning Han
b946e5ce0f Merge "Add vpx_dsp_common.h file" 2015-07-15 22:41:54 +00:00
Jingning Han
de740b258b Merge "Remove redundant header files in vp9_loopfilter_filers.c" 2015-07-15 22:41:11 +00:00
Marco
eaf1ffd837 Merge "Fix to resize logic for 1 pass mode." 2015-07-15 21:43:07 +00:00
Jingning Han
db8e731b8d Add vpx_dsp_common.h file
Move the clamp functions to vpx_dsp_common.h file. Clear out the
dependency of vp9_loopfilter_filters.c on vp9_common.h file.

Change-Id: I9c4b928bcd7f597106b5aa96354356d3775a3431
2015-07-15 13:03:23 -07:00
Jingning Han
3fe83cdf81 Remove redundant header files in vp9_loopfilter_filers.c
This cleans out the unnecessary dependency on vp9 codec-specific
data structures.

Change-Id: Iadbe431174a0f9bf9423f39ab854fc18be554bea
2015-07-15 12:44:47 -07:00
Marco
2f66fdd375 Adjust some logic for dynamic_resize 1 pass mode.
Use drop_frames_water_mark for threshold on buffer underflow,
and change threshold for resize down.

Change-Id: I2de19adce50abe9bcdc0b107528cec8cc1857fcc
2015-07-15 11:54:04 -07:00
Frank Galligan
1c39998e39 Add vp9_int_pro_col_neon.
BUG=https://code.google.com/p/webm/issues/detail?id=1023

Change-Id: I212a1d67b23ce3b5ce08800de369b25b9e375e7d
2015-07-15 09:04:28 -07:00
Marco
7b756183aa Fix to source scaling for dynamic_resize.
The fast scaling for 1 pass mode was being used only on the
first frame after resizing event (because resize_scale_num/den
is set to 1 and only changed for first frame following resize event).

Change-Id: I723b63e21823eb858f25f5662d2bbe4f1842e61f
2015-07-15 08:28:59 -07:00
Marco
dc7da005d7 Fix to resize logic for 1 pass mode.
Proper use/update of resize_state and resize_pending to constrain
the total amount of downsizing to be at most one scale down, for now.

Change-Id: Id18fc32499f2fbdbec16728dcdc9e4eac09098f0
2015-07-14 16:23:57 -07:00
Alex Converse
fa94dbda81 Merge "Add an SSE2 version of vp9_iwht4x4_16_add" 2015-07-14 22:11:47 +00:00
Alex Converse
d8426d6f12 Add an SSE2 version of vp9_iwht4x4_16_add
Roughly half as many cycles as plain C.

Change-Id: I8c16c29940b76d54ee7e4fb874c328ce90bff5d4
2015-07-14 14:23:32 -07:00
paulwilkins
e11878c8e3 Merge "Add extra resize trigger for frames above maximum allowed size." 2015-07-14 18:24:13 +00:00
Debargha Mukherjee
3c5244886a Fixes part of merge regression from adding arf parameters.
From Change  Ibf0c30b72074b3f71918ab278ccccc02a95a70a0
There is still an issue relating to one animated test clip with repeat
patterns where this change effectively increase the default  maximum
arf interval by +1. This can be examined seperately.

Change-Id: Idd01d5480fc45202d8a059a0c3afc0997cc5bdd1
2015-07-14 18:32:38 +01:00
Jingning Han
cda17e12ed Merge "Refactor intra block prediction and reconstruction process" 2015-07-14 16:22:42 +00:00
Jingning Han
d5975b733b Merge "Refactor intra block prediction function" 2015-07-14 16:22:21 +00:00
Jingning Han
cb1e817c77 Refactor intra block prediction and reconstruction process
Flaten the intra block decoding process. It removes the legacy
foreach_transformed_block use in the decoder. This saves cycles
spent on retrieving the transform block position.

Change-Id: I21969afa50bb0a8ca292ef72f3569f33f663ef00
2015-07-13 22:24:17 +00:00
Jingning Han
81452cf0b7 Refactor intra block prediction function
This commit simplifies the intra block boundary condition logic.
It removes the block index from the argument set.

Change-Id: If00142512eb88992613d6609356dfd73ba390138
2015-07-13 15:20:47 -07:00
Marco
e03b8b78b2 Merge "Dynamic resize for real-time: source scaling" 2015-07-13 19:06:26 +00:00
Yaowu Xu
0cdc85d8cf Merge "Revert "Add an SSE2 version of vp9_iwht4x4_16_add."" 2015-07-13 16:27:10 +00:00
Yaowu Xu
ae5394b9e2 Revert "Add an SSE2 version of vp9_iwht4x4_16_add."
This reverts commit f8d35016408f3957c67945160d65be467ca97fdc.

Change-Id: If8c7af403c091b7fb447a6f0c73fecdbccbc51b3
2015-07-13 16:26:27 +00:00
Jim Bankoski
c243835303 Merge "Revert "Fill buffer speed up"" 2015-07-13 14:39:01 +00:00
Jim Bankoski
da9db83270 Revert "Fill buffer speed up"
This reverts commit 9b4f9f45eee4d63cef3cd10f24923ed0bdd5ab7b.

Change-Id: I23545ac8c7464127f7466fc6a58de517874fe0cf
2015-07-13 13:47:46 +00:00
Parag Salasakar
55c0df5ef1 mips msa vp8 sixtap filter optimization
average improvement ~3x-5x

Change-Id: I5fd88cb088814be443d04be384b9fca99b22adef
2015-07-13 09:23:52 +05:30
Parag Salasakar
e4fb53ea6e Merge "mips msa vp8 loop filter optimization" 2015-07-13 01:16:45 +00:00
Marco
4bbd95512a Dynamic resize for real-time: source scaling
Use faster scaling on source.

Change-Id: I968df97239a86834c96126b86832d3d6d0875a53
2015-07-10 11:04:18 -07:00
Jim Bankoski
db50037ece Merge "Fill buffer speed up" 2015-07-09 20:26:23 +00:00
Jim Bankoski
9b4f9f45ee Fill buffer speed up
Eliminates the byte by byte read from bool decoder,  by reading
in a size_t and then shifting it into place.

Change-Id: Id89241977103fc3b973e4ed172a5cbf246998e5d
2015-07-09 11:41:30 -07:00
paulwilkins
4b44e46de0 Merge "Changes to use of rectangular partitions." 2015-07-09 18:34:41 +00:00
Yaowu Xu
49fa5276fe Merge "Remove clamp operations." 2015-07-09 17:49:18 +00:00
Yaowu Xu
f70c80289c Merge "Clean out more MSVC warnings" 2015-07-09 17:49:08 +00:00
Scott LaVarnway
e8103f3676 Merge "Eliminate num_8x8 and num_4x4 width/height lookups" 2015-07-09 17:16:22 +00:00
Alex Converse
74f869b962 Merge "Add an SSE2 version of vp9_iwht4x4_16_add." 2015-07-09 16:57:03 +00:00
paulwilkins
2d637ca36d Merge "Change speed and rd features for formatting bars." 2015-07-09 16:38:38 +00:00
Scott LaVarnway
13a4f14710 Eliminate num_8x8 and num_4x4 width/height lookups
Also some log2 lookups.

Pass in 8x8 block width/height and log2 num4x4s instead.

Change-Id: I8ea9a1ec1e0bbab23f8ba556954a1b5433f4d613
2015-07-09 05:30:46 -07:00
Yaowu Xu
b58c99eb71 Remove clamp operations.
The clamp calls with INT32_MIN and INT32_MAX have no effect at all on
int values passed in, therefore this commit removes those effectless
clamps and also adds more const intermediate results to make the code
more readable.

Change-Id: I66d8811f58bb74ec31cbec9a6c441983a662352e
2015-07-08 17:44:19 -07:00
Jingning Han
535cc6d87f Format fixes in vp9_encodeframe.c and vp9_encodemb.c
Change-Id: Ib1303dac9043ab1b1f8fce54611cf4ea8a208038
2015-07-09 00:04:28 +00:00
Jingning Han
8783a8a97c Refactor transform block loop for inter mode decoding
Rework the inter mode transform block decoding loop. Replace the
block index with the row and col index as the input argument. It
saves function call to compute the row and col index according to
the block index and overall block size, and many if statements
associated with the transform block position relative to the coding
block. For the test bit-stream pedestrian_area 1080p at 5 Mbps,
the decoding speed goes up from 81.13 fps to 81.92 fps.

Note that the intra coded block decoding needs more refactoring
work than the inter ones. So keep it using foreach_transforme_block
as for now.

Change-Id: I5622bdae7be28ed5af96693274057f55ba9b4fb4
2015-07-08 22:55:16 +00:00
Yaowu Xu
c369daf3ea Clean out more MSVC warnings
Change-Id: I1bab0c104df2ec4825d050cd516e26ab635a7b3e
2015-07-08 15:09:20 -07:00
Alex Converse
f8d3501640 Add an SSE2 version of vp9_iwht4x4_16_add.
80% fewer cycles than C

Change-Id: I841bde1e268ddd33ae2ee75eee94737a400e2cde
2015-07-08 15:00:51 -07:00
Alex Converse
8bf791e7ef Merge "Don't allocate dqcoeff in MACROBLOCKD." 2015-07-08 20:42:36 +00:00
Alex Converse
89090d8046 Don't allocate dqcoeff in MACROBLOCKD.
The encoder gets its dqcoeff from the context tree. In the decoder move
it to directly after MACROBLOCKD.

Change-Id: I46c9b76f26956a360d17de0b26ecb994dae34ecb
2015-07-08 12:37:55 -07:00
Jingning Han
66da771040 Merge "Refactor inverse_transform_block argument list" 2015-07-08 19:28:25 +00:00
Jingning Han
0497d3a827 Merge "Reset dqcoeff[0] only if eob is 1" 2015-07-08 19:27:22 +00:00
Frank Galligan
b770def572 Merge "VP9_LPF_VERTICAL_16_DUAL_SSE2 optimization" 2015-07-08 18:15:39 +00:00
Johann
340d82efb9 Merge "Use 'unsigned long' for _BitScanReverse parameter" 2015-07-08 17:50:33 +00:00
paulwilkins
a6f2a9619b Add extra resize trigger for frames above maximum allowed size.
Even if the recode loop is not enabled for the current frame type
trap the case where the projected size of a a frame is above the
maximum allowed in recode_loop_test()

Change-Id: I453004694b8f8699e3c2a83252e9f83adccdda4e
2015-07-08 18:15:10 +01:00
paulwilkins
8dd466edc8 Changes to use of rectangular partitions.
Changes to allow more use of rectangular partitions at
speeds 1 and 2 for content classed by the first pass as
animation and for blocks near the active image edge.

This has quite a big impact in quality for the animated
test sequence but also hurts encode speed for speed 2.

For other content types the impact on both speed and
quality is small.

Added some plumbing for detection of internal vertical
image edges.

Change-Id: I3fc48de2349f8cb87946caaf0b06dbb0ea261a9a
2015-07-08 18:14:12 +01:00
paulwilkins
a126b6ce7d Change speed and rd features for formatting bars.
Change speed features / behavior for split mode when there
is an internal active edge (e.g. formatting bars).

Remove some threshold constraints in rd code near the active
edge of the image.

Add some plumbing for left and right active edge detection.

Patch set 5. Limit rd pass through for sub 8x8 to internal active edges.
This takes away any speed penalty for most clips but keeps the enhanced
edge coding for the more critical case of internal image edges

Change-Id: If644e4762874de4fe9cbb0a66211953fa74c13a5
2015-07-08 17:51:42 +01:00
Jingning Han
7e0d0de211 Refactor inverse_transform_block argument list
Replace block index with transform type in the argument list. This
allows to save an extra fetch to the prediction mode. For pedestrian
area 1080p coded at 5 Mbps with single tile, the average decoding
speed goes up from 80.55 fps (before the refactoring series) to
81.13 fps.

Change-Id: Icbebf84ce63c19c0c92f3690ed201f6c3eab7881
2015-07-08 09:26:02 -07:00
Parag Salasakar
0ea2684c2c mips msa vp8 loop filter optimization
average improvement ~2x-4x

Change-Id: I20c4f900ef95d99b18f9cf4db592cd352c2212eb
2015-07-08 12:41:00 +05:30
Parag Salasakar
1d7f1ca7da mips msa vp9 avg subpel variance optimization rebased
Change-Id: Ia21987010dbb688e2a8fa204ca9129d2f34c9581
2015-07-08 12:07:28 +05:30
James Zern
892128f6ca Merge "vp9_entropymv: remove vp9_get_mv_mag()" 2015-07-08 01:27:13 +00:00
Johann
0f96939ceb Use 'unsigned long' for _BitScanReverse parameter
New clang warnings in chromium reveal an incompatible pointer being
passed.

Change-Id: I0d893993726ecf899f467c16175bfb8c76329731
https://code.google.com/p/chromium/issues/detail?id=504696
2015-07-07 17:45:06 -07:00
Frank Galligan
5327fcf857 Merge "Add vp9_int_pro_row_neon." 2015-07-08 00:16:03 +00:00
Johann
ac7f403cbe Merge "Move sub pixel variance to vpx_dsp" 2015-07-07 23:57:18 +00:00
Jingning Han
55c2646666 Merge "Rework scan order fetch logic for decoder" 2015-07-07 23:09:39 +00:00
Johann
6a82f0d7fb Move sub pixel variance to vpx_dsp
Change-Id: I66bf6720c396c89aa2d1fd26d5d52bf5d5e3dff1
2015-07-07 15:51:04 -07:00
Marco
155b9416b3 Merge "Update to speed 5 non-rd mode partition search." 2015-07-07 22:47:47 +00:00
Jingning Han
c2d0f9ddeb Merge "Add vp9_ prefix to init_macroblockd" 2015-07-07 22:35:45 +00:00
Jingning Han
6e6c57da9a Merge "Reduce dqcoeff array size in decoder" 2015-07-07 22:35:31 +00:00
Jingning Han
76ccba9ec8 Reset dqcoeff[0] only if eob is 1
If only the first dequantized coefficient is non-zero, reset
dqcoeff[0] to zero directly.

Change-Id: I0197ba72028a8ec436f0b1b9abcc1c0ae5d70abe
2015-07-07 15:20:34 -07:00
Jingning Han
97d1f1aaae Rework scan order fetch logic for decoder
Save redundant call for getting prediction mode to obtain scan
order for detokenization.

Change-Id: I0683ef119f1579d1261ed5d59052a1745b68ef6f
2015-07-07 15:03:21 -07:00
Marco
1acdd04d2d Merge "Update to vpx_temporal_svc_encoder:" 2015-07-07 21:34:09 +00:00
Jingning Han
9d251f9510 Merge "Unify subtract function used in VP8/9" 2015-07-07 20:42:19 +00:00
Yaowu Xu
ea5450b280 Merge "Allows using optimzed version vp9_fdct8x8" 2015-07-07 19:28:57 +00:00
Johann
3caf2bb606 Merge "Remove comment about disabled tests" 2015-07-07 19:14:35 +00:00
Jingning Han
a652048efd Add vp9_ prefix to init_macroblockd
Change-Id: I202d4924e627eec94838741df004ed9259d38b88
2015-07-07 12:00:01 -07:00
Marco
478fbc8f23 Update to speed 5 non-rd mode partition search.
If the pre-selected partition size (from variance partition) is
32x32, also apply nonrd partition search for 32x32 and 16x16 size.

Overall small positive gain in metrics, average ~1%.
Some visual improvement, for lower resolutions.

Change-Id: I69cb425bda94f7d13d34c451ab30e9276335a30e
2015-07-07 11:52:01 -07:00
Jingning Han
cccad1c5de Reduce dqcoeff array size in decoder
The decoding process handles detokenization and reconstruction per
transform block sequentially. There is no need to offset the dqcoeff
buffer according to the transform block index. This allows to
reduce the memory spill and improve cache performance.

Change-Id: Ibb8bfe532a7a08fcabaf6d42cbec1e986901d32d
2015-07-07 11:36:05 -07:00
Parag Salasakar
45b7e160d8 Merge "mips msa vp8 idct optimization" 2015-07-07 18:14:20 +00:00
Marco
83f8ab5001 Update to vpx_temporal_svc_encoder:
Add set_tune_content control setting.

Change-Id: I8f7af8e8e9bc35a2d1546c5a0b2dd14be3cce750
2015-07-07 11:08:50 -07:00
Yaowu Xu
a8f8b83cef Allows using optimzed version vp9_fdct8x8
Change-Id: I59cecb7178a93cdee7ad535fa996ef0caa6e988c
2015-07-07 10:28:42 -07:00
Jingning Han
0ede9f52b7 Unify subtract function used in VP8/9
This commit replaces the vp8_ prefixed subtract function with the
common vpx_subtract_block function. It removes redundant SIMD
optimization codes and unit tests.

Change-Id: I42e086c32c93c6125e452dcaa6ed04337fe028d9
2015-07-07 09:57:44 -07:00
Debargha Mukherjee
9cb3a13426 Merge "Adds macros for new encoder controls" 2015-07-07 14:25:36 +00:00
paulwilkins
02b3b05278 Merge "Alter partition search at image edge." 2015-07-07 12:44:28 +00:00
paulwilkins
8051b6d256 Merge "Error score recalibration for inactive regions." 2015-07-07 08:44:35 +00:00
paulwilkins
00c0cbb445 Merge "ARF Boost correction for inactive regions." 2015-07-07 08:44:17 +00:00
Parag Salasakar
3d938d71b0 mips msa vp8 idct optimization
average improvement ~2x-5x

Change-Id: I19e82f78772993bcd67fcf975fe180232172f86d
2015-07-07 12:41:54 +05:30
James Zern
c6d90f0535 vp9_entropymv: remove vp9_get_mv_mag()
inline the code directly in read_mv_component(), the only place where it
was being used; this removes a function call in a hot function

Change-Id: I66f99c0c9ce3bc310101dbca4a470f023cc6fb55
2015-07-06 22:30:21 -07:00
Parag Salasakar
33a0deb928 Merge "mips msa vpx_dsp sadx3 sadx8 optimization" 2015-07-07 02:10:23 +00:00
James Zern
8c6d5a874d Merge "inline vp9_reader_has_error()" 2015-07-07 00:48:58 +00:00
Johann
efb05d0d1c Remove comment about disabled tests
The tests were re-enabled in
1fe643cf03f45198e5a033743d7c4dc027b8dfd9

Change-Id: I17b45a4bbe720a56605aed338446ff77df71abad
2015-07-06 16:49:11 -07:00
Debargha Mukherjee
e8a3abe41e Adds macros for new encoder controls
To aid version management for integration with ffmpeg by use
of:
  #ifdef VPX_CTRL_<CTRL_ID>
    ...
  #endif

Change-Id: If550e06de4d3aa3685881f312ce6a86fa9de083b
2015-07-06 16:11:38 -07:00
James Zern
4ec8f9c5ae Merge "vp9_variance*.c: make static tables const" 2015-07-06 22:52:39 +00:00
James Zern
1696114587 Merge "mips msa vp9 subpel variance optimization" 2015-07-06 22:43:01 +00:00
Jingning Han
fcb5a8692a Merge "Move subtract functions from vp9 to vpx_dsp" 2015-07-06 22:39:26 +00:00
James Zern
cb4310fc58 vp9_variance*.c: make static tables const
Change-Id: Ia5044d13c09685c401191fe87fbf90d36203aadd
2015-07-06 15:04:37 -07:00
Parag Salasakar
fbe67d307a mips msa vp9 subpel variance optimization
Change-Id: If88401bf8c5d8ee58200278734d7a5058d1585d0
2015-07-06 14:59:01 -07:00
Debargha Mukherjee
5256a4034b Merge "Expose params min-gf-interval/max-gf-interval" 2015-07-06 21:36:40 +00:00
James Zern
91c412b6db Merge "remove vp9_get_interp_kernel()" 2015-07-06 21:36:37 +00:00
James Zern
017253b7a3 remove vp9_get_interp_kernel()
expose filter_kernels[] and do the table lookup directly

Change-Id: I0b10bff0327c3e01a723736141a9ffd377cd3d20
2015-07-06 13:04:05 -07:00
Debargha Mukherjee
9852643373 Expose params min-gf-interval/max-gf-interval
Adds two new vp9 parameters --min-gf-interval and --max-gf-interval
to enable testing based on frequency of alt-ref frames.

Also adds a unit-test to test enforcement of min-gf-interval.

For both these parameters the default value is 0, which indicates
they are picked by the encoder, based on resolution and framerate
considerations. If they are greater than zero, the specified
parameter is honored.

(Additional note by paulwilkins)
Note that there is a slight oddity in that key frames are also GFs and
considered part of  GF only group. However they are treated as not
being part of an arf group because for arf groups the previous GF is
assumed to be the terminal or overlay frame for the previous group.

(end note)

Change-Id: Ibf0c30b72074b3f71918ab278ccccc02a95a70a0
2015-07-06 12:24:59 -07:00
Jingning Han
432cd4bfb7 Move subtract functions from vp9 to vpx_dsp
Factor out the subtraction operator as common function.

Change-Id: I526e703477c6a290e0e3e3c8898f8bb1ca82779b
2015-07-06 12:22:47 -07:00
Jingning Han
39f03bf9c6 Merge "Rename vpx_thread to vpx_util" 2015-07-06 17:01:30 +00:00
James Zern
823a126d4c Merge "Revert "Correct the inter prediction coordinate..."" 2015-07-03 18:44:02 +00:00
hkuang
52e358f13e Revert "Correct the inter prediction coordinate..."
Change in 92b199061a13173d29247257f4ef906d38b012bf leads to frame parallel
decode failure in extreme case.

addresses issue #1010

Change-Id: I4fa488dac8e8c584f5eef4cae1640a579130d387
2015-07-03 11:05:28 -07:00
James Zern
3d4526322b Merge "Revert "mips msa vp9 subpel variance optimization"" 2015-07-02 21:07:32 +00:00
James Zern
4c5ac477cb Merge "Revert "mips msa vp9 avg subpel variance optimization"" 2015-07-02 21:07:24 +00:00
James Zern
97946622c0 Revert "mips msa vp9 subpel variance optimization"
This reverts commit a42df86c035d1bc007dbc816b4b758605135d6d9.

this change causes MSA/VP9SubpelVarianceTest.Ref and
MSA/VP9SubpelVarianceTest.ExtremeRef failures under
mips32r5el-msa-linux-gnu and mips64r6el-msa-linux-gnu

Change-Id: I40b71a0b774eaeb31f66f795733f95cf360909f7
2015-07-02 12:06:51 -07:00
James Zern
ced982640b Revert "mips msa vp9 avg subpel variance optimization"
This reverts commit 61774ad1c44c73ccde48a2e3456e86196965b5dc.

this change causes MSA/VP9SubpelAvgVarianceTest.Ref failures under
mips32r5el-msa-linux-gnu and mips64r6el-msa-linux-gnu

Change-Id: I7fb520c12b2a3b212d5e84b7619a380a48e49bb0
2015-07-02 12:06:29 -07:00
levytamar82
3c5256d572 VP9_LPF_VERTICAL_16_DUAL_SSE2 optimization
The vp9_lpf_vertical_16_dual function optimized for x86 32bit target. The hot code in that function was caused by the call to the transpose8x16.
The gcc generated assembly created uneeded fills and spills to the stack. By interleaving 2 loads and unpack instructions, in addition to hoisting the consumer
instruction closer to the producer instructions, we eliminated most of the fills and spills and improve the function-level performance by 17%.
credit for writing the function as well as finding the root cause goes to Erik Niemeyer (erik.a.niemeyer@intel.com)

Change-Id: I6173cf53956d52918a047d1c53d9a673f952ec46
2015-07-02 11:56:11 -07:00
Jingning Han
d1b30ceaa3 Rename vpx_thread to vpx_util
Change the dir name to include more util tools.

Change-Id: Id5b16062803ce5eed872fe2edb36d7e56b32eed8
2015-07-02 10:02:37 -07:00
paulwilkins
99f8bd72cb Alter partition search at image edge.
Added code to reduce the minimum partition size searched
for super blocks at or straddling the edge of the image.

If the first pass has detected formatting bars the "active" edge
may not be the real edge.

Change-Id: I9c4bdd1477e60f162a75fac95ba6be7c3521e05c
2015-07-02 16:25:25 +01:00
paulwilkins
dc19f352af Error score recalibration for inactive regions.
Apply a correction to the frame error scores for frames
with inactive regions.

Change-Id: I217840f2efe7eafed3f5b8ddc7c468f1ca3d923c
2015-07-02 15:13:01 +01:00
paulwilkins
e4702deeec ARF Boost correction for inactive regions.
Correct the ARF boost calculations to partly discount
inactive or very low energy regions of the image.

Examples (formatting bars and 0 energy areas of animated clips).

Change-Id: I241af058d10aba8c67a4deca36deb913047d4561
2015-07-02 14:15:46 +01:00
Jingning Han
8565a1c99a Merge "Use vpx prefix for codec independent threading functions" 2015-07-02 04:24:54 +00:00
Jingning Han
66cf8098e6 Merge "Move multi-threading module functions into vpx_thread folder" 2015-07-02 04:24:37 +00:00
Parag Salasakar
6abf1aea63 mips msa vpx_dsp sadx3 sadx8 optimization
average improvement ~3x-5x

Change-Id: Ifdb4670d31ae83c4e22a4238293d1377b16c90db
2015-07-02 08:02:19 +05:30
James Zern
1e0aa9497f inline vp9_reader_has_error()
this is tested for each block

Change-Id: I229c6f0e9513fb206bdbce8be9699a4bf4008ca4
2015-07-01 19:10:43 -07:00
James Zern
e757808429 Merge "vp9_pred_common: inline vp9_get_tx_size_context" 2015-07-02 01:52:40 +00:00
James Zern
0ea304620c Merge "vp9_pred_common: inline vp9_get_segment_id" 2015-07-02 01:52:21 +00:00
James Zern
95dc082168 Merge "vp9_dsubexp: replace some divides with shifts" 2015-07-02 01:51:25 +00:00
James Zern
b49de21d74 Merge "vp9/inv_remap_prob: simplify inv_map_table[]" 2015-07-02 01:51:06 +00:00
James Zern
f0b3b08fb4 Merge "vp9_dsubexp: remove clamp in inv_remap_prob()" 2015-07-02 01:50:46 +00:00
Jingning Han
04d2e57425 Use vpx prefix for codec independent threading functions
Replace vp9_ prefix with vpx_ for common multi-threading functions.

Change-Id: I941a5ead9bfe8213fdad345511d2061b07797b55
2015-07-02 00:47:54 +00:00
Jingning Han
3a3b0be09a Move multi-threading module functions into vpx_thread folder
This commit moves the primitive multi-threading files from vp9
folder to vpx_thread, which will be accessible by all vpx codec.

Change-Id: Ib51e66e9c69801c10631fab56d35a0c0aaed5883
2015-07-01 17:45:49 -07:00
Johann
79fcc56781 Merge "Fix --disable-use-x86inc when used with --enable-vp9-highbitdepth" 2015-07-01 21:14:41 +00:00
Johann
8d5389171f Merge "Fix --disable-use-x86inc" 2015-07-01 21:14:17 +00:00
Johann
1c967f17bd Fix --disable-use-x86inc when used with --enable-vp9-highbitdepth
Change-Id: I0ed6de72dc0bb99fc9c5b1f6500399b16754ffb3
2015-07-01 13:17:01 -07:00
Johann
ff8505a54d Fix --disable-use-x86inc
Change-Id: I374fcd8fb45a6893dcdeac6896671be142a99f06
2015-07-01 13:15:51 -07:00
James Zern
4f7e7c4d49 Merge "mips msa vp9 avg subpel variance optimization" 2015-07-01 20:05:50 +00:00
Scott LaVarnway
dc6d954bd2 Merge "Move inter_predictor to vp9_reconinter.h" 2015-07-01 20:01:53 +00:00
Parag Salasakar
29a17db913 Merge "mips msa vpx_dsp sad sad4d avgsad optimization" 2015-07-01 18:23:10 +00:00
James Zern
440995cabb Merge "loopfiltersimpleverticaledge_neon: quiet uninit var warnings" 2015-07-01 17:57:54 +00:00
Scott LaVarnway
d157742788 Merge "VP9: Move ref_mvs[][] and mode_context[] from MB_MODE_INFO" 2015-07-01 12:52:21 +00:00
Parag Salasakar
61774ad1c4 mips msa vp9 avg subpel variance optimization
average improvement ~3x-5x

Change-Id: Iefbcafc05daab77b38a4e63b551e427867a501a4
2015-07-01 13:46:41 +05:30
James Zern
dcf5b7cfdd loopfiltersimpleverticaledge_neon: quiet uninit var warnings
take 2. localize the function parameter to actually remove the warning

Change-Id: I23c02061b5e21b0b75bd33c26062d1e531df7b92
2015-06-30 23:23:59 -07:00
Parag Salasakar
bc3ec8ef07 mips msa vpx_dsp sad sad4d avgsad optimization
average improvement ~3x-5x

Change-Id: Ie30748cfbedebbd544b7ef4f286055ccb7f60306
2015-07-01 11:39:43 +05:30
James Zern
bd7162269f vp9_dsubexp: replace some divides with shifts
Change-Id: I24e10c37ea8f06600cd04b43512efa6170e23e5c
2015-06-30 20:09:00 -07:00
James Zern
5609858785 vp9/inv_remap_prob: simplify inv_map_table[]
add one to each entry to remove the universal 'value + 1'.

Change-Id: I8919b1d7fde8155d1728196c4d577db3064e2c1e
2015-06-30 19:58:08 -07:00
Parag Salasakar
a42df86c03 mips msa vp9 subpel variance optimization
average improvement ~3x-5x

Change-Id: I4cbba2711467b0e205904769ebbb4a1fcbb1a311
2015-07-01 07:51:34 +05:30
Parag Salasakar
c96bb8004e Merge "mips msa vpx_dsp variance optimization" 2015-07-01 01:40:27 +00:00
James Zern
8aaf5ec4c7 vp9_dsubexp: remove clamp in inv_remap_prob()
the max value of the lookup in expanded form is:
(((1 << 7) - 1) << 1) - 65 + 1 + 64 = 254

remove the clamp [0, 253] and add one table entry

Change-Id: I0b5d0c66702fdb0b8f1cc9ab9b0dac66326e85a6
2015-06-30 15:49:29 -07:00
James Zern
fc5f3b8f4f Merge "vp9_common_data: right-size tables" 2015-06-30 21:12:54 +00:00
Yaowu Xu
e943db045a Merge "Fixed a variance calculation" 2015-06-30 19:48:33 +00:00
Parag Salasakar
2d730a289a mips msa vpx_dsp variance optimization
average improvement ~2x-4x

Change-Id: Ia3eef3f390148c2eb5cdc580a94cb26369737f82
2015-06-30 12:22:18 +05:30
Parag Salasakar
fc3c456053 Merge "mips msa vp9 common macro comments updated" 2015-06-30 06:25:31 +00:00
James Zern
1e77058b7b Merge changes Idce95354,I6b791088
* changes:
  loopfiltersimpleverticaledge_neon: quiet uninit var warnings
  idct_dequant_0_2x_neon: quiet uninit var warnings
2015-06-30 06:21:59 +00:00
Scott LaVarnway
c06d56cc7d VP9: Move ref_mvs[][] and mode_context[] from MB_MODE_INFO
to MB_MODE_INFO_EXT.  This saves 36 bytes per 8x8 area for
both the decoder and encoder. (encoder has two MODE_INFO
buffers)

Change-Id: If006abb2224acaf326df3c2be09e77e967662107
2015-06-29 12:46:47 -07:00
Scott LaVarnway
437d033dbb Merge "Remove tile param" 2015-06-29 18:04:56 +00:00
Parag Salasakar
3c353e58c0 mips msa vp9 common macro comments updated
Cosmetic/Grammatical corrections in vp9 macro comments

Change-Id: I774b983aff854feb69c7e4442e8731ce4c995645
2015-06-29 11:52:28 +05:30
Parag Salasakar
f3a1295cff Merge "mips msa vp9 temporal filter optimization" 2015-06-27 01:29:04 +00:00
Yaowu Xu
9f14bbfd80 Fixed a variance calculation
This commit fixed a mistake in variance calculation.

Thanks to Xintong for spotting the error.

Change-Id: Ia285fc0128c00f0234a73b0a7eba6adc88b8a7de
2015-06-26 15:54:43 -07:00
Tom Finegan
8fdfeb3f40 Merge "vpxenc.sh: Add basic multithreaded frame parallel encode test." 2015-06-26 16:12:34 +00:00
Parag Salasakar
b92cc27b76 mips msa vp9 temporal filter optimization
average improvement ~4x-5x

Change-Id: Iad9c0a296dbc2ea96d000bd009077999ed58a3c5
2015-06-26 12:00:24 +05:30
Parag Salasakar
c040f96e4b mips msa vp9 subtract block optimization
average improvement ~3x-4x

Change-Id: Idbe4d13a00d05ff8be6559b116f416e42c3b4097
2015-06-26 09:23:56 +05:30
Parag Salasakar
d017f5ba38 Merge "mips msa vp9 block error optimization" 2015-06-26 03:42:31 +00:00
James Zern
69c153c4e6 loopfiltersimpleverticaledge_neon: quiet uninit var warnings
the vector used in vld*_lane_* should be initialized before use

Change-Id: Idce95354737915f6fb4e6b5e8980a050e953036d
2015-06-25 20:39:21 -07:00
Parag Salasakar
1543f2b60e mips msa vp9 block error optimization
average improvement ~3x-4x

Change-Id: If0fdcc34b17437a7e3e7fb4caaf1067bc175f291
2015-06-26 09:04:00 +05:30
James Zern
f4d746a3c1 idct_dequant_0_2x_neon: quiet uninit var warnings
the vector used in vld*_lane_* should be initialized before use

Change-Id: I6b791088479fec3bc021ca75cc2af5adcc39d954
2015-06-25 20:29:35 -07:00
James Zern
28a8226350 vp9_common_data: right-size tables
Change-Id: I2206ee148a46b234df58f2b623e9f32f26033e04
2015-06-25 20:20:40 -07:00
Tom Finegan
92f7d79030 vpxenc.sh: Add basic multithreaded frame parallel encode test.
Change-Id: Id526783fa2e3e9bb31229931b6548ac7a9b2b7e6
2015-06-25 13:52:04 -07:00
Marco
1c7b1f9aec Update to dynamic resize logic for 1pass CBR.
Only do the check for resizing if the feature is selected
(i.e., resize_mode = RESIZE_DYNAMIC).

And modify condition for checking to be resize_count >= window,
(since framerate can change).

Change-Id: Idceb4e50956bb965a1492b4993b0dcb393c9be4d
2015-06-25 12:28:43 -07:00
James Zern
3393243d5e Merge "vp8_subpixelvariance_neon: right size coeff table" 2015-06-25 02:14:18 +00:00
Marco
3dd9cde2a5 Fix to unstable build from commit 517a66.
Change-Id: I123db2d20ae65a10e2dec95eec61150e2f69546d
2015-06-24 17:28:57 -07:00
James Zern
d219f2b9d2 Merge "vp9_reconintra_neon: add d45 16x16" 2015-06-24 21:23:15 +00:00
Tom Finegan
0bd61519c0 Merge "vpxenc.sh: Add basic vp9 multithread encode test." 2015-06-24 16:36:09 +00:00
James Zern
4bd87a9b9e vp8_subpixelvariance_neon: right size coeff table
only uint8 is required; each use only loads one value as a uint8
quiets a few type conversion warnings

Change-Id: I03dc0dc0eb01ac23a6e8673daa2b77c6c57bf1b0
2015-06-23 23:48:12 -07:00
James Zern
9f0383c66f Merge "build: add *test-no-data-check targets" 2015-06-24 06:20:38 +00:00
Tom Finegan
8281a19465 vpxenc.sh: Add basic vp9 multithread encode test.
- Change default real time speed to -6.
- Add vpxenc_vp9_webm_rt_multithread, which encodes
  niklas_1280_720_30.y4m with 2 to 4 threads using 2 to 4
  tile columns.

Change-Id: I4d86c3360aec67ae5d1ba82eb6e0f0be8068b5af
2015-06-23 18:30:52 -07:00
Marco
4774d38970 Merge "aq-mode=3: Reduce boost for segment#2 at low bitrates/low res." 2015-06-23 23:55:16 +00:00
Marco
517a662005 aq-mode=3: Reduce boost for segment#2 at low bitrates/low res.
Reduce boost for segment#2 for low bitrates and low-res.

This change is to reduce the rate overshoot at low bitrates.
No change in behavior, except at the very low bitrates.

Change-Id: I0dbd9d3b6356da5804de94adf10fca6a7a8f8948
2015-06-23 16:50:43 -07:00
Tom Finegan
46df71396d Merge "Fix building with iOS 9 beta SDK" 2015-06-23 22:57:05 +00:00
Frank Galligan
944ad6cac9 Add vp9_int_pro_row_neon.
BUG=https://code.google.com/p/webm/issues/detail?id=1022

Change-Id: I510c3b0a70158fa2e4da554f7c5d7558021a6ddf
2015-06-23 11:53:49 -07:00
James Zern
9db1f24c47 vp9_reconintra_neon: add d45 16x16
~90% faster over 20M pixels

Change-Id: I92d80f66e91e0a870a672cfb5dd29bf1a17cb11a
2015-06-22 21:00:07 -07:00
Parag Salasakar
7555e2b822 mips msa vp9 avg optimization
average improvement ~2x-3x

Change-Id: I76f7fc00c0ffdf2b4ba41bf3819f3b6044bcdeff
2015-06-23 07:32:25 +05:30
Parag Salasakar
7b71cdb0b4 Merge "mips msa vp9 fdct 4x4 optimization" 2015-06-23 01:46:54 +00:00
Marco
fb2a89b1fb Fixes for key frame coding at speed 5.
Keep the same transform cutoff and partition selection
for speed 5 as in speeds >=6 (non-rd speed settings).

Existing setting for key frame at speed 5 allowed transform size
up to 32x32 on key frames, and did not allow for 4x4 block partition size.
This created more visual artifacts on first few frames.

avgPSNR/overallPSNR/SSIM gains of 0.2/0.7/0.8 for rtc_derf(low-res) set,
and 0/0.7/1.1 gains for rtc set.

Change-Id: I8c139ec6c9bb74e14b4ffbad5f12e94f18a59c0b
2015-06-22 16:57:35 -07:00
James Zern
c8b9658ecc Merge "vp9_reconintra_neon: add d45 8x8" 2015-06-22 22:27:57 +00:00
Brion Vibber
78637b6136 Fix building with iOS 9 beta SDK
configure.sh was setting some Mac OS X options for iOS targets, which
confuses the iOS 9 beta SDK in Xcode 7 when linking libraries.

Additionally, old armv6 media extensions were being enabled on iOS
when they're not needed (we always have Neon since iOS 6). These
broke on iOS 9 SDK which no longer assembles those instructions.

Change-Id: I4e4d2722392ead3382ce96289c03ef1e489799d6
2015-06-22 12:09:09 -07:00
Marco
8e029fcfa9 Merge "Reduce max_partition_size for low resolutions at speed 5." 2015-06-22 16:59:48 +00:00
Scott LaVarnway
86f4a3d8af Remove tile param
and added to MACROBLOCKD.

Change-Id: I0e60aaa9f84bcc9f2376d71bd934f251baee38db
2015-06-22 06:09:38 -07:00
Parag Salasakar
bc94999148 mips msa vp9 fdct 4x4 optimization
average improvement ~2x-3x

Change-Id: Idf8be780b8b4228fc91f110a94e4ee1fd9af0163
2015-06-22 14:30:24 +05:30
Frank Galligan
1395b56a1d Add assembly tests for int projections.
BUG=https://code.google.com/p/webm/issues/detail?id=1022

Change-Id: I5ae4acac39fd75c56d3feff0716cb52133de3b22
2015-06-20 12:05:59 -07:00
Parag Salasakar
b6131a733d Merge "mips msa vp9 fdct 8x8 optimization" 2015-06-20 02:58:10 +00:00
James Zern
12c6688e31 vp9_reconintra_neon: add d45 8x8
based on ssse3 implementation

~91% faster over 20M pixels

Change-Id: I6d743a53352c2d6de0efe7899d7996e8b0f7fa29
2015-06-19 19:19:22 -07:00
Parag Salasakar
7ca84888c2 mips msa vp9 fdct 8x8 optimization
average improvement ~4x-5x

Change-Id: I37582efc2622bc20b2bf99617a76110ab24e9f6a
2015-06-20 07:48:35 +05:30
James Zern
7b480ee90c Merge "Add dynamic range comment to vp9_int_pro_row" 2015-06-20 01:43:54 +00:00
Jingning Han
922af194bc Add dynamic range comment to vp9_int_pro_row
Change-Id: Icaa643568159c4e2db24eef42090b002ae02a45e
2015-06-19 17:39:33 -07:00
Jingning Han
c539ec022f Merge "Add dynamic range comment to vp9_int_pro_col" 2015-06-20 00:35:07 +00:00
James Zern
557ae511cb build: add *test-no-data-check targets
skips testdata verification; useful with slow media or if the data was
retrieved via a separate call to testdata

Change-Id: Ifd97892cee6c04b0111874cc8071675e90ec852b
2015-06-19 16:50:26 -07:00
Marco
debe4e920f Reduce max_partition_size for low resolutions at speed 5.
For speed 5 real-time mode, the selection of the partition size for
superblocks on the segment (aq-mode=3) uses the non-rd recursive
pick partition search, and can sometimes select 64x64.

For low resolutions, visually better to limit this to 32x32.

Change-Id: I69657a7ed8899f8b3cf8c9c318a2509c5c72c565
2015-06-19 16:48:16 -07:00
Alex Converse
90c9ede8e6 Limit cyclic refresh revisitng blocks at the same quantizer.
For screen content don't refresh a block at a quantizer higher than
it was last coded at. PReviosuly at realtime speeds the encoder had a
tendency to recode a block from GOLDEN with a higher Q than it was last
coded at.

Change-Id: Iacd561806c769dcce1a81b9827ffc70090f5ba18
2015-06-19 15:23:02 -07:00
Yaowu Xu
e5d4062962 Merge "Fix a msvc compiler warning" 2015-06-19 19:02:15 +00:00
Jingning Han
8e8bc5f28b Add dynamic range comment to vp9_int_pro_col
Change-Id: If14d9f874bd0bf2c5a455982088fd70591f5ea5a
2015-06-19 09:43:57 -07:00
Johann Koenig
001baa5dd8 Merge "Move vp8 variance files" 2015-06-19 16:27:25 +00:00
Yaowu Xu
d8428ae35d Fix a msvc compiler warning
Change-Id: Ida8a04370895ed14bd118324ec2577da926e4648
2015-06-19 09:04:29 -07:00
James Zern
714a46a63c Merge "vp9_filter: make all filter tables static" 2015-06-19 03:32:24 +00:00
James Zern
c5d779d266 Merge changes I2552d810,I51952c0a,Ib82e4247,I9c8d16cb
* changes:
  vp9_mcomp: make search_step_table static
  vp9_encodeframe: delete auto_partition_range()
  vp9_mcomp: don't mark setup_center_error() inline
  vp9_encoder: hide adjust_image_stat()
2015-06-19 03:31:38 +00:00
James Zern
a2c69af50e Merge "vp9_reconintra_neon: add d45 4x4" 2015-06-19 03:27:23 +00:00
James Zern
5d1d72df16 Merge changes from topic 'vp9-intra-pred'
* changes:
  vp9_reconintra_neon: add d135 4x4
  vp9_reconintra: correct d135 4x4 signature
2015-06-19 03:24:58 +00:00
Marco
4b45088fc9 Merge "Add dynamic resize logic for 1 pass CBR." 2015-06-19 00:56:06 +00:00
Marco
d77f51ba9e Add dynamic resize logic for 1 pass CBR.
Decision to scale down/up is based on buffer state and average QP
over previous time window. Limit the total amount of down-scaling
to be at most one scale down for now.

Reset certain quantities after resize (buffer level, cyclic refresh,
rate correction factor).

Feature is enable via the setting rc_resize_allowed = 1.

Change-Id: I9b1a53024e1e1e953fb8a1e1f75d21d160280dc7
2015-06-18 17:13:37 -07:00
Johann
907b33cdc4 Move vp8 variance files
There is a naming conflict in the chromium build system.

The rest of the variance functions will move to vpx_dsp soon.

Change-Id: Iff78da2aafb0d7380eda73e38d7dac72110a1e47
2015-06-18 16:42:28 -07:00
James Zern
ce88d74d34 vp9_reconintra_neon: add d45 4x4
based on webp's LD4()

~59% faster over 20M pixels

Change-Id: I371eaed9ce8f470451046997e130b0ba1a2f7a9c
2015-06-18 15:25:07 -07:00
James Zern
337b221e00 vp9_reconintra_neon: add d135 4x4
based on webp's RD4()

~50% faster over 20M pixels

Change-Id: Ifcb7bf7f7fc8eabf79d9e3b219ce1be67abc524a
2015-06-18 15:25:06 -07:00
James Zern
e8e3583fc7 vp9_reconintra: correct d135 4x4 signature
add missing '_c' suffix

Change-Id: I928d6cf8f90db0b8ca0b1f3bbf10b3d792062cec
2015-06-18 15:25:06 -07:00
James Zern
41d8545ab6 Merge "vp9_reconintra_neon: add DC 4x4 predictors" 2015-06-18 22:24:55 +00:00
James Zern
6e44bf20f7 vp9_reconintra_neon: add DC 4x4 predictors
~85-89% faster over 20M pixels

Change-Id: I3812e8adfffe5255034da88dfe6546e12f4d10ee
2015-06-18 15:22:43 -07:00
James Zern
e77f859d72 Merge "vp9_reconintra_neon: add DC 32x32 predictors" 2015-06-18 22:17:51 +00:00
Jingning Han
d1398e9f13 Merge "Add dynamic range comment to vp9_satd" 2015-06-18 19:36:53 +00:00
Jingning Han
4f1f510f16 Add dynamic range comment to vp9_satd
Change-Id: I75873846e6fdafbe7597a1bd0192115d2d1e9987
2015-06-18 09:18:22 -07:00
Parag Salasakar
b6ea0c4c57 Merge "mips msa vp9 fdct 32x32 optimization" 2015-06-18 04:30:53 +00:00
Jingning Han
7f6cddb58f Take out assertion for block_yrd in rtc coding flow
The internal behavior of block_yrd differs in high bit depth
settings from 8-bit one. This causes the assertion condition not
true for high bit depth.

Change-Id: I15dc02e7162d27cabe78c451941d769d488b1174
2015-06-17 08:51:16 -07:00
James Zern
0d51a97ae9 Merge "Fix integer overflow issue in rtc coding flow intra mode search" 2015-06-17 05:29:32 +00:00
Jingning Han
bc7074508a Fix integer overflow issue in rtc coding flow intra mode search
The overflow issue affects a variable that is only used in inter
mode. This commit fixes the ioc warning triggered in the intra
mode. It does not affect the compression performance.

Change-Id: I593d1b5650599de07f3e68176dd1442c6cb7bdbc
2015-06-16 19:31:24 -07:00
Parag Salasakar
d9fedf7832 mips msa vp9 fdct 32x32 optimization
average improvement ~4x-6x

Change-Id: Ibcac3ef8ed5e207cf8c121e696570e6b63d3c0f4
2015-06-17 07:58:34 +05:30
Parag Salasakar
fa53008fb7 Merge "mips msa vp9 fdct 16x16 optimization" 2015-06-17 01:21:59 +00:00
Scott LaVarnway
97b3913dcc Merge "Moved has_rows, has_cols in vp9_decodeframe.c" 2015-06-16 22:01:06 +00:00
Scott LaVarnway
ce6a6c5411 Moved has_rows, has_cols in vp9_decodeframe.c
from read_partition() to decode_partition().

Change-Id: I6bee2a0e9ff315290a690c9d773c9648dd2a200d
2015-06-16 11:50:54 -07:00
Marco
8914ab696d Remove duplicate calls for set_frame_size in 1 pass mode.
set_frame_size() is being called twice, once before entering
encode_encode_frame_to_data_rate(), and once again in that function.
No need to call it twice for one-pass mode.

Change-Id: I5fabaf0a90482d4f42cd89ef7ae1402c31aec600
2015-06-16 09:57:13 -07:00
Scott LaVarnway
5fe0e55ca4 Merge "Eliminated frame_type check in get_partition_probs()" 2015-06-16 13:40:23 +00:00
Scott LaVarnway
b2658ec321 Eliminated frame_type check in get_partition_probs()
Moved the frame_type check to the tile level and stored
the prob ptr in MACROBLOCKD.

Change-Id: I10b5a4abd58213dc7610e3ade1a1583c01526842
2015-06-16 05:37:54 -07:00
Scott LaVarnway
a41fe749a8 Merge "Update use_prev_frame_mvs flag in decoder." 2015-06-16 12:28:46 +00:00
Parag Salasakar
89b4b315aa mips msa vp9 fdct 16x16 optimization
average improvement ~4x-6x

Change-Id: Id3b2243e5b3c7844c90c4231a5e75fa69911362c
2015-06-16 12:49:34 +05:30
James Zern
79fb3a013e vp9_reconintra_neon: add DC 32x32 predictors
~84-85% faster over 20M pixels

Change-Id: Ia67a7f4a342bf7b0a9280e05c25d81a774d90469
2015-06-15 20:57:28 -07:00
James Zern
3edd293dae vp9_pred_common: inline vp9_get_tx_size_context
+ drop 'vp9_' prefix

Change-Id: If3f3ec32d03026af78b8fcd82749e587a3f43059
2015-06-15 18:41:22 -07:00
James Zern
e6add6499f vp9_pred_common: inline vp9_get_segment_id
+ drop 'vp9_' prefix

Change-Id: Id5a3c8d416dbdf93d9f4f1bde662f7b2c2290168
2015-06-15 18:41:14 -07:00
Yunqing Wang
e820ca6973 Merge "vp9_ethread: create enough threads while using SVC" 2015-06-15 23:03:32 +00:00
James Zern
a6d126709a Merge changes I19588f9e,I6dc338a6
* changes:
  vp9_encodeframe: make coord_lookup[] static
  vp9_resize: make vp9_filteredinterp_*[] static
2015-06-15 23:03:28 +00:00
James Zern
17c9678a3c Merge "vp9_entropy: delete vp9_coefmodel_tree[]" 2015-06-15 23:02:42 +00:00
James Zern
e8d3491ec2 Merge "vp9_entropymode: make vp9_init_mode_probs private" 2015-06-15 23:02:36 +00:00
James Zern
43d49e4710 Merge "enable vp9_d153_predictor_32x32_ssse3" 2015-06-15 23:01:29 +00:00
Yunqing Wang
c98273c9e7 vp9_ethread: create enough threads while using SVC
This patch modified the thread creating code. When use_svc is true,
the number of threads created is decided by the highest resolution.
This resolved WebM issue 1018.

Change-Id: I367227b14d1f8b08bbdad3635b232a3a37bbba26
2015-06-15 14:30:54 -07:00
Marco
24b3ede251 Remove redundant second declaration in svc_layercontext.c
Change-Id: Ia3b1c1db54204fd92a56b7f698a9f26d27ee572a
2015-06-15 14:06:43 -07:00
James Zern
98f0178611 enable vp9_d153_predictor_32x32_ssse3
unused since its initial commit
~91% faster over 20M pixels

Change-Id: Ic8b5b3246bc97c8406be8bc4496601370403b70a
2015-06-12 19:48:22 -07:00
James Zern
5214bd52c8 vp9_encodeframe: make coord_lookup[] static
Change-Id: I19588f9e674c8635b6e58e4633120be736d256a6
2015-06-12 19:47:46 -07:00
James Zern
5168baea10 vp9_resize: make vp9_filteredinterp_*[] static
+ drop the vp9_ prefix

Change-Id: I6dc338a69265dcaa8c6fe071e5757312bf92efca
2015-06-12 19:47:45 -07:00
James Zern
ef75416ab7 vp9_entropy: delete vp9_coefmodel_tree[]
it's been unused since:
4ac6a25 Moving vp9_tree_probs_from_distribution() to encoder.

Change-Id: Ieae65864277fc3dbe993c5c08d75c6c5fcaa3a2d
2015-06-12 18:43:37 -07:00
James Zern
53b7f33f2d vp9_entropymode: make vp9_init_mode_probs private
rename to init_mode_probs

Change-Id: Id451d7763b784ed37e43f2c35073a778078d3d0f
2015-06-12 18:25:23 -07:00
James Zern
aaa49f0485 vp9_mcomp: make search_step_table static
Change-Id: I2552d8101cf49ed951782ab69adce407579700fc
2015-06-12 18:11:54 -07:00
James Zern
31509af247 vp9_encodeframe: delete auto_partition_range()
unused since:
1f00a9b Fix choose_partitioning threshold setup for speed -5

Change-Id: I51952c0a1be3e6e0aa36ff2ffcfbbea60a505960
2015-06-12 17:57:37 -07:00
James Zern
7ea431df98 vp9_mcomp: don't mark setup_center_error() inline
this function is a bit too involved for the hint; avoids a -Winline
warning

Change-Id: Ib82e424764aa78b37ddb94116e2b009a6de31d35
2015-06-12 17:56:33 -07:00
James Zern
471302a07b vp9_encoder: hide adjust_image_stat()
this function is only needed with CONFIG_INTERNAL_STATS

Change-Id: I9c8d16cb9069dd8370f8b30329933c0d97f6d0aa
2015-06-12 17:55:08 -07:00
James Zern
a4bb5f2a29 Merge "decode_tiles_mt: remove incorrect TODO" 2015-06-12 22:13:38 +00:00
James Zern
dc0f0f1cf2 Merge changes I342075eb,I222eaa4e
* changes:
  vp9_decodeframe: simplify init_read_bit_buffer signature
  vp9_decode_frame: remove explicit read_bit_buffer init
2015-06-12 22:13:28 +00:00
James Zern
e21c1eab9d Merge changes Iedb5b6a3,Iaea98508,I36580cea,Ia0574320
* changes:
  vp9_decodeframe.h: remove unused prototype
  vp9_decodeframe: move public funcs to end of file
  vp9_decodeframe: reorder some functions
  vp9_decodeframe: hide vp9_dec_build_inter_predictors_sb
2015-06-12 22:12:30 +00:00
James Zern
44317a511b Merge "variance_test: fix build w/--disable-vp8-encoder" 2015-06-12 22:08:33 +00:00
Jingning Han
d8985f5360 Merge "Fix potential overflow issue in hadamard_16x16()" 2015-06-12 19:03:21 +00:00
Jingning Han
bea691b5c9 Merge "Add dynamic range comment to hadamard_8x8()" 2015-06-12 18:43:41 +00:00
Parag Salasakar
ecbbef6b67 Merge "mips msa vp9 filter by weight optimization" 2015-06-12 18:30:11 +00:00
Jingning Han
176c291d9c Fix potential overflow issue in hadamard_16x16()
This commit fixes a potential integer overflow issue in function
hadamard_16x16. It adds corresponding dynamic range comment.

Change-Id: Iec22f3be345fb920ec79178e016378e2f65b20be
2015-06-12 10:56:18 -07:00
Jingning Han
4f52d49f1e Add dynamic range comment to hadamard_8x8()
Add comment to assist SIMD optimization.

Change-Id: I300d5a848e6e9947e451de2a871a88940703fc9f
2015-06-12 10:39:49 -07:00
Yunqing Wang
254a4c033c Merge "Allocate tile data adaptively to accommodate the frame size increase" 2015-06-12 15:49:40 +00:00
Parag Salasakar
fbac961b47 mips msa vp9 filter by weight optimization
filter by weight - average improvement ~2x-3x

Change-Id: I4832033335d339cdafdce697f07ce3e643920057
2015-06-12 12:06:42 +05:30
James Zern
07799ef28a Merge "test_intra_pred_speed: add ClearSystemState() call" 2015-06-12 06:27:45 +00:00
James Zern
e0e4045db8 variance_test: fix build w/--disable-vp8-encoder
s/CONFIG_VP8\b/CONFIG_VP8_ENCODER/

Change-Id: I616aace9cf8f18d7e83f00f7aef3b8a26fc4c17b
2015-06-11 23:15:30 -07:00
James Zern
e2b52f6f01 vp9_filter: make all filter tables static
these are returned via vp9_get_interp_kernel()

Change-Id: I45ed75e5b1515c4f5be9212759dcb50a456b5548
2015-06-11 15:15:52 -07:00
James Zern
33b3953c54 vp9_filter: restore vp9_bilinear_filters alignment
the declaration containing the alignment in vp9_filter.h was removed in:
eb88b17 Make vp9 subpixel match vp8

fixes a crash in 32-bit builds

Change-Id: I9a97e6b4e8e94698e43ff79d0d8bb85043b73c61
2015-06-11 15:15:25 -07:00
Scott LaVarnway
0fbc277746 Merge "inline vp9_get_segdata()" 2015-06-11 19:48:19 +00:00
Yunqing Wang
2c838ede68 Allocate tile data adaptively to accommodate the frame size increase
If the frame size increases, the tile data buffer needs to be
re-allocated according to the number of tiles existing in current
frame. This patch makes the multi-tile encoding work in spatial
SVC usage case, and partially solved WebM issue 1018.

Change-Id: I1ad6f33058cf5ce6f60ed5024455a709ca80c5ad
2015-06-11 11:30:18 -07:00
Scott LaVarnway
cca866f578 inline vp9_get_segdata()
and change name.

Change-Id: I706645cf9d9dc04f1b3b6ac80df80edb7f101854
2015-06-11 09:52:00 -07:00
Marco
2aa67ce20f Move adjustment of some CR parameters to existing function.
Refactor/no change in behavior.

Change-Id: Idb3c55b1304feaf689b90403f79bc96dba26f060
2015-06-11 08:31:03 -07:00
Scott LaVarnway
a49c701529 Merge "inline vp9_segfeature_active()" 2015-06-11 12:29:45 +00:00
Scott LaVarnway
42c0b1b1f1 inline vp9_segfeature_active()
and changed name.

Change-Id: Ie023ca66cc2c823032f58d4faeb53fd1863c94f3
2015-06-11 04:20:55 -07:00
Parag Salasakar
c7489f4815 Merge "mips msa vp9 intra-pred optimization" 2015-06-11 03:31:49 +00:00
James Zern
15c839f563 decode_tiles_mt: remove incorrect TODO
all allocated workers are used, the final one in the main thread.

Change-Id: I04647d4fb2e01d6d404790e7899515289047f553
2015-06-10 15:56:51 -07:00
James Zern
b105414118 vp9_decodeframe: simplify init_read_bit_buffer signature
Change-Id: I342075eb5a4ba2a85d36d47ae52d1f3476039e31
2015-06-10 15:53:30 -07:00
James Zern
92146eb8ac vp9_decode_frame: remove explicit read_bit_buffer init
this is done by init_read_bit_buffer()

Change-Id: I222eaa4e9758ff9f7e1e4122106c5c4652ffa99c
2015-06-10 15:50:54 -07:00
James Zern
dca319040c vp9_decodeframe.h: remove unused prototype
vp9_init_dequantizer() was deleted in:
bdd249b Optimize the dequantization process on decoder side.

Change-Id: Iedb5b6a3a03964dd6901c1e3b2325194d94bc708
2015-06-10 15:48:59 -07:00
James Zern
b0bafd0439 vp9_decodeframe: move public funcs to end of file
Change-Id: Iaea9850890b726c7b5552c5f02b3a309086edc85
2015-06-10 15:47:57 -07:00
James Zern
38dd0448cd vp9_decodeframe: reorder some functions
removes the need for a prototype for the static function
dec_build_inter_predictors_sb

Change-Id: I36580ceae061d27f341ab0a16ece479f92e98004
2015-06-10 15:44:21 -07:00
James Zern
587bd3669e vp9_decodeframe: hide vp9_dec_build_inter_predictors_sb
+ strip 'vp9_' prefix

Change-Id: Ia057432095e5741473275d4da03ab665c37e924e
2015-06-10 15:31:55 -07:00
James Zern
1898d1336d test_intra_pred_speed: add ClearSystemState() call
fixes instability; noticed on mingw

Change-Id: Idef4349339444ec84916e5fcd908ee9633d28aaa
2015-06-10 12:44:07 -07:00
James Zern
44afbbb72d Merge "vp9_reconintra/d45_predictor: remove temp storage" 2015-06-10 19:23:57 +00:00
James Zern
c620c632c1 Merge "test/android/Android.mk: fix build w/ENABLE_SHARED=0" 2015-06-10 19:22:42 +00:00
James Zern
4ded624ff3 Merge changes I89a8440f,Ifa3926e1
* changes:
  libs.mk: relocate TEST_INTRA_PRED_SPEED_OBJS init
  test_intra_pred_speed: remove #if w/in another macro
2015-06-10 19:18:04 +00:00
Paul Wilkins
59114915bc Merge "Changes to active maxq calculation in two pass." 2015-06-10 13:33:53 +00:00
Scott LaVarnway
97880c3324 Merge "Reducing size of MODE_INFO struct" 2015-06-10 13:15:19 +00:00
James Zern
39d93f3891 libs.mk: relocate TEST_INTRA_PRED_SPEED_OBJS init
allows the visual studio project to be generated

Change-Id: I89a8440fb0bcaef11ff89dd967aa37bfe200758d
2015-06-09 19:30:46 -07:00
James Zern
6a422e4452 test_intra_pred_speed: remove #if w/in another macro
fixes the compile under visual studio

Change-Id: Ifa3926e198af97d73250540c6d0ef692f5e354ff
2015-06-09 19:30:04 -07:00
James Zern
0f8ee6eb4b test/android/Android.mk: fix build w/ENABLE_SHARED=0
add a dependency on *_rtcd.h to ensure they're generated before
attempting to build the test files

Change-Id: Ibbbd1f6ea77912bfd297129e7c83b9a80923ea12
2015-06-09 19:27:20 -07:00
Marco
61c5c96ae1 Merge "Adjust some parameters for cyclic refresh for low bitrates." 2015-06-09 23:22:29 +00:00
Marco
997ac14c6a Adjust some parameters for cyclic refresh for low bitrates.
Reduce motion threshold and boost factor for second segment,
for low bitrates, at low resolutions for now.
This is to reduce the rate fluctuation/frame dropping that occurs
at these low bitrates.

Change-Id: Ia66c3be41831882fca8c1e4fe104f5ea8fbe7142
2015-06-09 15:10:03 -07:00
Debargha Mukherjee
2fd31bbba7 Merge "Prevent dividing by 0 when target-bitrate is 0." 2015-06-09 17:03:22 +00:00
Paul Wilkins
faf8c63b0f Changes to active maxq calculation in two pass.
Some initial experiments into discounting dead zone
formating bars and intra skip blocks (common in some
types of animation and graphics) in the calculation of
the active max Q for each ARF/GF group.

TODO: check for vertical formating bars and validate the
horizontal bar at the bottom edge of the image.

As expected, this change as it stands, does not make much
difference for the natural videos in the std-hd and derf sets.
However, for the yt and yt hd set there is a significant rise
in the average PSNR with overall PSNR and SSIM remaining
neutral.

The mean rise for the YT-HD test set was > 6%. This is mainly
because the change allows Q to drop further on titles and
other graphics sections where spending a small number of
extra bits gives a sharp rise in PSNR.

Change-Id: I3f878ae91fc1854312d7ecf9fa792c17bc1aa6b7
2015-06-09 15:31:24 +01:00
Paul Wilkins
4a28da5843 Enable more split modes for animated content.
For content that is identified as likely to contain some
animation or graphics content, increase the availability
of split modes for good quality speeds 1-3.

On a problem test animation clip this improves metrics
results by about 0.25 db and makes a noticeable difference
visually. It also causes a small drop in file size (~0.5%) but
a rise in encode time of about 5-6% at speed  2.

For more normal content it should have no effect.

Change-Id: Ic4cd9a8de065af9f9402f4477a17442aebf0e439
2015-06-09 14:50:44 +01:00
Debargha Mukherjee
c23a9e218c Prevent dividing by 0 when target-bitrate is 0.
Change-Id: I05b7fb378b6b0c5f263e7839f96ba6830ee34fd2
2015-06-08 16:19:13 -07:00
Paul Wilkins
b19b16cfa1 Merge "Animation and dead zone detection." 2015-06-08 14:26:07 +00:00
Scott LaVarnway
c9976b32b4 Update use_prev_frame_mvs flag in decoder.
Added check to see if last frame was all intra.  This will
eliminate two checks in find_mv_refs_idx().  Also, do not
update the frame mvs if the current frame is all intra.

This improved performance on material with frequent
intra-only frames.

Change-Id: I44a4042c3670ab0d38439d565062a0e2a1ba9d1e
2015-06-08 03:38:13 -07:00
Parag Salasakar
a2288d274c mips msa vp9 intra-pred optimization
intra pred - average improvement ~2x-3x

Change-Id: Ie3f7d6eded5ecb7ed7ee506ba8e4d98f93803b09
2015-06-06 22:29:32 +05:30
James Zern
e67d45d4ce Merge "vpxdec: cosmetics: break some long lines" 2015-06-06 16:11:00 +00:00
James Zern
913ddbf747 Merge "vpxenc: relocate vp8/vp9 only options" 2015-06-06 16:10:18 +00:00
James Zern
ad8e6f2ed6 Merge "disable vp8_sub_pixel_variance8x8_neon" 2015-06-06 16:07:58 +00:00
James Zern
a3938266f5 Merge "vs/armv7: use -oldit armasm flag" 2015-06-06 03:24:35 +00:00
James Zern
47fe535422 disable vp8_sub_pixel_variance8x8_neon
fails unit tests:
[  FAILED  ] NEON/VP8SubpelVarianceTest.ExtremeRef/0, where GetParam() = (3, 3, 0x14e36d, 0)
[  FAILED  ] NEON/VP8SubpelVarianceTest.Ref/0, where GetParam() = (3, 3, 0x14e36d, 0)

the tests were recently enabled in:
eb88b17 Make vp9 subpixel match vp8

the functions likely haven't changed since being converted from assembly

Change-Id: I6141717b111b8f735f436c160d74270af53ef722
2015-06-05 20:18:51 -07:00
James Zern
3a070ba502 vpxdec: cosmetics: break some long lines
Change-Id: I95827a6f5e585d2accbb8fc09501f2d38db585e4
2015-06-05 16:18:49 -07:00
James Zern
f82cfc2ee8 vpxenc: relocate vp8/vp9 only options
move them under their respective config check to avoid some unused
variable warnings when disabled

Change-Id: Ic5e5280cf1bc1f56e8349676f0bedae4acef34ea
2015-06-05 16:14:14 -07:00
hkuang
87c21a95ae Optimize the decode_partition. About 0.7% gain on N10.
Change-Id: Ia689c254bd2d4f274abcc451a9b758f62e3a2b1f
2015-06-05 15:47:09 -07:00
James Zern
5908e0b664 vs/armv7: use -oldit armasm flag
this quiets warnings from armv6 code [1].
from msdn [2]:
-oldit
Generate ARMv7-style IT blocks. By default, ARMv8-compatible IT blocks
are generated.

a new configuration would be needed for armv8 in any case as the neon
assembly is being built, so removing this should be harmless

[1] A4509: This form of conditional instruction is deprecated
[2] https://msdn.microsoft.com/en-us/library/hh873189.aspx

Change-Id: I4c3b838b52a87401c6daecd83d22ab148ed7c5d9
2015-06-05 15:21:10 -07:00
James Zern
9c6eea35b6 Merge "vp9_reconintra: simplify d63_predictor" 2015-06-05 21:49:13 +00:00
Scott LaVarnway
5831a7127e Merge "BUG FIX: Remove counts param" 2015-06-05 20:04:26 +00:00
Scott LaVarnway
63819c033c BUG FIX: Remove counts param
member access within null pointer of type 'FRAME_COUNTS'

Change-Id: Id3bf75e0a6f2a1abf8522cf9fbb98b3a4443de38
2015-06-05 11:54:04 -07:00
Frank Galligan
8c854769fc Merge "Add control to skip loop filter in VP9 decoder." 2015-06-05 18:03:51 +00:00
Frank Galligan
44138d7d9e Merge "vpxenc: Add support for pixel aspect ratio." 2015-06-05 18:01:52 +00:00
Frank Galligan
bfb6d48812 Add control to skip loop filter in VP9 decoder.
This control allows the application to skip the loop filter in the
decoder. This is an advanced control that should only be used in
extreme circumstances as it may introduce and accumulate decode
artifacts.

Change-Id: I278c65c60826f84c9141ebe06c6eeed3c2335fa8
2015-06-05 10:07:09 -07:00
Frank Galligan
09acd267bc vpxenc: Add support for pixel aspect ratio.
WebM files will adjust the display width and height according to the
input pixel aspect ratio. The default pixel aspect ratio is 1:1.

BUG=https://code.google.com/p/webm/issues/detail?id=1005

Change-Id: I23e0a601b7259fa9513cb86110c41b8437769808
2015-06-05 09:56:50 -07:00
Johann
a4dad3e961 Merge "Duplicate reference variance code" 2015-06-05 16:54:33 +00:00
Marco
8710cceb45 Fix to spatial svc: set reference_frame masking.
For real-time mode: keep reference_frame masking off
for spatial svc.

Change-Id: I15e123c06f67ea040172b8d4042a672f3525b9d8
2015-06-05 08:25:33 -07:00
Parag Salasakar
78b434e8b1 Merge "mips msa vp9 loopfilter 4, 8 optimization" 2015-06-05 05:32:18 +00:00
Parag Salasakar
d43fd99822 mips msa vp9 loopfilter 4, 8 optimization
average improvement ~3x-4x

Change-Id: I59279293ce4b2a1e99bd10579ac97740e943643f
2015-06-05 09:56:08 +05:30
Marco
0d0db3e8c3 Merge "Bugfx in setting layer framerate." 2015-06-05 04:26:06 +00:00
James Zern
60d0b3364c vp9_reconintra/d45_predictor: remove temp storage
dst row 0 can be reused in the same way

Change-Id: Id977da62545dcc4a89cebbcbad90ba84f8ff5d6b
2015-06-04 20:11:53 -07:00
James Zern
7012ba6395 vp9_reconintra: simplify d63_predictor
calculate the averages needed for even and odd rows once; this removes a
conditional from the inner loop
the final average calculated currently relies on above[] being extended,
it could be reduced to use
above[block_size - 2] + 3 * above[block_size - 1]

Change-Id: I70f5eac8d8a2a959c7114844a95826f445c3dd4d
2015-06-04 19:21:05 -07:00
Parag Salasakar
dc07cc6fed Merge "mips msa vp9 loopfilter 16 optimization" 2015-06-05 02:15:26 +00:00
James Zern
c2cf347fe2 Merge "vp9_reconintra: use AVG[23] consistently" 2015-06-05 02:15:22 +00:00
James Zern
2b6d62140e Merge "vp9_reconintra_neon_asm/tm4x4: simplify left load" 2015-06-05 01:46:39 +00:00
James Zern
6c3b691c49 Merge "vp9_reconintra: fix d45/d63 discrepancies" 2015-06-04 22:56:43 +00:00
Scott LaVarnway
7ccd7fc325 Merge "Remove cm parameter from vp9_decode_block_tokens() part 2" 2015-06-04 22:20:55 +00:00
James Zern
faea038f4f vp9_reconintra: fix d45/d63 discrepancies
the final index in rows 2, 3 differ from vp8

Change-Id: I0fcea907b4ab44e266c0f1fd77b290d2236b280a
2015-06-04 14:49:56 -07:00
Marco
8f7e7663ad Bugfx in setting layer framerate.
Index for ts_rate_decimator should be temporal layer (tl) index.

Change-Id: I0320b7f7ae987ef64fdfe7c45099e7978a8fef17
2015-06-04 13:12:09 -07:00
Yaowu Xu
f990b35fa4 Make vp9 the default codec for vpxenc
Change-Id: Ic3b4f3c9a6d8f9b04efb8b5ee080880895063564
2015-06-04 08:28:12 -07:00
Scott LaVarnway
baaaa57533 Reducing size of MODE_INFO struct
Reduced size from 124 bytes to 104 bytes.  For decode only builds,
it is reduced to 68 bytes.

Change-Id: If9e6b92285459425fa086ab5a743d0a598a69de3
2015-06-04 07:32:16 -07:00
Scott LaVarnway
8bb37dd069 Remove cm parameter from vp9_decode_block_tokens() part 2
Change-Id: Iee24b6bb095f748333223e6036fc5c9d9e7e5f1c
2015-06-04 07:13:19 -07:00
Scott LaVarnway
877fac122b Merge "Remove counts param" 2015-06-04 13:46:42 +00:00
Parag Salasakar
914f8f9ee0 mips msa vp9 loopfilter 16 optimization
average improvement ~3x-4x

Change-Id: I8ef263da6ebcf8f20aabaefeccf25a84640ba048
2015-06-04 11:50:41 +05:30
Johann Koenig
c005792951 Merge "Make vp9 subpixel match vp8" 2015-06-04 06:16:13 +00:00
Parag Salasakar
fd891a9655 Merge "mips msa vp9 convolve8 avg hv optimization" 2015-06-04 05:44:24 +00:00
Johann
eb88b172fe Make vp9 subpixel match vp8
The only difference between the two was that the vp9 function allowed
for every step in the bilinear filter (16 steps) while vp8 only allowed
for half of those. Since all the call sites in vp9 (<< 1) the input, it
only ever used the same steps as vp8.

This will allow moving the subpel variance to vpx_dsp with the rest of
the variance functions.

Change-Id: I6fa2509350a2dc610c46b3e15bde98a15a084b75
2015-06-03 22:10:51 -07:00
hkuang
ce5e17072d Merge "Optimize the idct assembly code." 2015-06-04 04:32:11 +00:00
James Zern
4fcabf5169 vp9_reconintra: use AVG[23] consistently
Change-Id: Iab7215f82be0c0c831cd81b6f8091afc3710dd54
2015-06-03 19:52:46 -07:00
Parag Salasakar
bdfbc3e876 mips msa vp9 convolve8 avg hv optimization
average improvement ~4x-6x

Change-Id: I7c8b4f2334491be8a859592606e568bc95d019aa
2015-06-04 08:11:01 +05:30
James Zern
2da8d24e8f Merge "vp9_reconintra: simplify d45_predictor" 2015-06-04 01:59:10 +00:00
James Zern
a9f55e8324 Merge changes from topic 'vp9-intra-pred'
* changes:
  vp9_reconintra: specialize d135 4x4
  vp9_reconintra: specialize d117 4x4
  vp9_reconintra: specialize d207 4x4
  vp9_reconintra: specialize d153 4x4
  vp9_reconintra: specialize d63 4x4
  vp9_reconintra: specialize d45 4x4
2015-06-04 01:58:28 +00:00
Marco
2561b4dd4c Merge "Remove ABI check for 1 pass CBR SVC." 2015-06-04 01:54:19 +00:00
James Zern
65d9599807 vp9_reconintra_neon_asm/tm4x4: simplify left load
use vld1.8 {d0[]}, [r0] rather than ldrb+vdup; mildly faster

Change-Id: Ia5ffc736bcb0f5497b7d9e55a93bf5a5f5f6928c
2015-06-03 18:51:13 -07:00
Parag Salasakar
f1b09c0433 Merge "mips msa vp9 convolve8 avg horiz optimization" 2015-06-04 01:16:21 +00:00
Marco
a8c5ab2ca6 Remove ABI check for 1 pass CBR SVC.
Remove the ABI check for the controls needed for SVC 1 pass CBR mode.
Bump up the ABI version.

Change-Id: I35b79ee010e14af83c6d1e801d574deaaa2fc7eb
2015-06-03 17:43:22 -07:00
hkuang
98e88e6ad8 Optimize the idct assembly code.
Change-Id: Ia0ff859ff1c813dbe100e2f27b1ef78167483f4e
2015-06-03 17:20:35 -07:00
Paul Wilkins
668e804504 Animation and dead zone detection.
Adds code to detect dead zone bars at the top and bottom
of reformatted letterbox video (note that the code only
looks at the top of the image and assumes any dead zone
is symmetrical).  Use of this to adapt rate control etc.
will follow in a subsequent patch.

Also counts other blocks (excluding the dead zone) that
have no intra signal. The presence of a significant
number of such blocks can be used as a identify that the frame
may be artificial (e.g.  animation, screen capture, graphics).
This patch contains plumbing only and does not use
the signal.

Change-Id: I59bc93529cd4065416cef773e405fda3ae006a20
2015-06-04 01:01:20 +01:00
Marco
5df6c04585 Fix to sample encoder: vpx_temporal_svc_encoder.c
vp8 uses ts_target_bitrate for layer settings.

Change-Id: Ie72477b549051396feebff87a3744fed04366bf4
2015-06-03 14:50:27 -07:00
Johann
ce2ca9f777 Duplicate reference variance code
Some places are using the unoptimized variance function. This was never
intended and does not fit into the optimization framework.

Change-Id: Id96238407aad03b0ffd4a46cd183555a026daedc
2015-06-03 13:28:59 -07:00
Johann
516c087c51 Remove unused sub pixel mse
Change-Id: I7a5e4e2632c3fa69d2a85a68fa9b418631caf09c
2015-06-03 08:00:51 -07:00
Parag Salasakar
b8c1cdcd12 mips msa vp9 convolve8 avg horiz optimization
average improvement ~5x-8x

Change-Id: I179a69ec620fbd69979bd128f05d18113618aab4
2015-06-03 11:33:42 +05:30
Parag Salasakar
179bceffdb Merge "mips msa vp9 convolve8 avg vert optimization" 2015-06-03 05:58:43 +00:00
James Zern
0601f92a88 Merge "test-data.sha1: mark test data files as binary" 2015-06-03 05:49:43 +00:00
James Zern
88fadafa9e Merge "Support building shared libraries on OS/2" 2015-06-03 05:47:43 +00:00
KO Myung-Hun
19dbc0f066 test-data.sha1: mark test data files as binary
Change-Id: Ie3605bf4c4fb16eb21186adbb4577c20a8027344
2015-06-03 13:48:35 +09:00
KO Myung-Hun
6d52fe2e71 Support building shared libraries on OS/2
Change-Id: I5750db0504cb69ead52f9f44bf583e693bffbb7e
2015-06-03 13:48:34 +09:00
Parag Salasakar
c543d38ac7 mips msa vp9 convolve8 avg vert optimization
average improvement ~4x-6x

Change-Id: Ia2e6f770da46416ebec31fdcea5cc7878879a9d9
2015-06-03 09:55:25 +05:30
Parag Salasakar
622beaba67 Merge "mips msa vp9 idct4x4 and iwht4x4 optimization" 2015-06-03 04:10:14 +00:00
Johann
01853d7ce9 Merge "Unify reference variance functions" 2015-06-03 02:03:45 +00:00
Johann
d90536c1a2 Unify reference variance functions
Use uint32_t for all output and make all functions static

Change-Id: I2c9c6f6310732dc53444607d1c1a268ac1ab83ba
2015-06-02 15:14:55 -07:00
Johann
e2a5fd2cf4 Merge "Disable neon bilinear 4x4" 2015-06-02 21:44:14 +00:00
Scott LaVarnway
f779dba405 Remove counts param
Moved to MACROBLOCKD.

Change-Id: Icce765b334f2755f4fe2a4c39fb2ae2d7660d004
2015-06-02 09:06:00 -07:00
Marco
c139b81a13 Vidyo patch: Rate control for SVC, 1 pass CBR mode.
-Make Rate control work for SVC 1 pass CBR mode.
-Added temporal layering mode.
-Fixed bug in non-rd variance partition.
-Modified/updated the sample encoders (vp9_spatial_svc_encoder, vpx_temporal_svc_encoder).
-Added datarate unittest(s) for 1 pass CBR SVC.

Change-Id: Ie94b1b68a56ea1267b5087c625e5df04def2ee48
2015-06-02 07:54:13 -07:00
Parag Salasakar
54a6f73958 mips msa vp9 idct4x4 and iwht4x4 optimization
average improvement ~3x-4x
moved assert to respective files

Change-Id: I6c915059d456a00bdd76fab0dd2eede8b6c6ea58
2015-06-02 12:16:28 +05:30
Parag Salasakar
ebf7466cd8 mips msa vp9 updated convolve horiz, vert, hv, copy, avg module
Updated sources according to improved version of common MSA macros.
Enabled respective convolve MSA hooks and tests.
Overall, this is just upgrading the code with styling changes.

Change-Id: If5ad6ef8ea7ca47feed6d2fc9f34f0f0e8b6694d
2015-06-02 12:03:51 +05:30
Parag Salasakar
cf1c0ebc3a Merge "mips msa vp9 updated idct 8x8, 16x16 and 32x32 module" 2015-06-02 04:48:02 +00:00
Johann
86d0cb8325 Disable neon bilinear 4x4
Clang adds alignment hints when casting up the loads/stores. Although
this should be safe for most paths, it's causing some crashes. Either
the source of the misalignment needs to be determined and adjusted or
the intrinsics need to be rewritten to avoid using the cast to load the
data.

BUG=817,892

Change-Id: Ia3aa824d6a4cd97e14325ff49dc730b6f85ec7e8
2015-06-02 00:02:55 +00:00
Johann Koenig
cbebbff025 Merge "Adds subsecond frame rates to webm" 2015-06-01 22:36:09 +00:00
James Zern
71d923232c Merge changes from topic 'vp9-intra-pred'
* changes:
  vp9_reconintra_neon/tm: improve above_left load
  vp9_reconintra_neon: cosmetics: normalize fn params
2015-06-01 20:03:47 +00:00
James Zern
b601202905 Merge "vp9_reconintra_neon_asm/tm: simplify above_left load" 2015-06-01 20:01:38 +00:00
Johann
275c102787 Merge "Cast variance reference output" 2015-06-01 18:56:50 +00:00
paulwilkins
dbd3760712 Merge "Fast feedback of bits on undershoot." 2015-06-01 18:15:10 +00:00
Johann
fdc549994a Cast variance reference output
The larger internal variables are required for the intermediates
but RoundHighBitDepth brings them down to uint32_t/unsigned int.

Fixes type warnings in visual studio.

Change-Id: I48d35284d6cbde330ccdc1f46b6215a645d5eb00
2015-06-01 10:56:52 -07:00
Johnny Klonaris
d02aa04422 Adds subsecond frame rates to webm
Numerator was being range checked against the
denominator - preventing any frame rate slower
than 1 fps.

I've tested this on a Mac using using ffmpeg and
results are comparable to mp4 and ogg files generated
at the same time.

Not yet tested on Windows.

Johnny Klonaris
google@jawknee.com

Change-Id: Idb358dbc2e7dc000037880ede4a1b0df248a42c8
2015-06-01 10:13:58 -07:00
Parag Salasakar
6af9d7f2e2 mips msa vp9 updated idct 8x8, 16x16 and 32x32 module
Updated sources according to improved version of common MSA macros.
Enabled idct MSA hooks and tests.
Overall, this is just upgrading the code with styling changes.

Change-Id: I1f488ab2c741f6c622b7a855388a202168082209
2015-06-01 09:24:23 +05:30
James Zern
acc481eaae vp9_reconintra: simplify d45_predictor
only the immediate above right pixel is needed; this removes a
conditional from the inner loop
the final average calculated currently relies on above[] being extended,
it could be reduced to use above[block_size - 2] + 3 * above_right

Change-Id: Ica4f2b8d25eec3ca1d6fa52ef0d4adc228eeea3f
2015-05-30 13:30:59 -07:00
James Zern
6e068e51b5 vp9_reconintra: specialize d135 4x4
based on webp's RD4()

Change-Id: I64c8f0a1325a8f201eaad39b396fae7a2d06efff
2015-05-30 13:29:40 -07:00
James Zern
b6782686f4 vp9_reconintra: specialize d117 4x4
based on webp's VR4()

Change-Id: Ic8c0b8ed65a63772ca0a4321592880a5e8947db5
2015-05-30 13:29:02 -07:00
James Zern
c022dbc4d3 vp9_reconintra: specialize d207 4x4
based on webp's HU4()

Change-Id: I2401ef307cd94e70cc7904f55954af04290c8af9
2015-05-30 13:28:22 -07:00
James Zern
2276eb16f3 vp9_reconintra: specialize d153 4x4
based on webp's HD4()

Change-Id: Icba1e21ec4b8f5026dc92e49741a68b059c8b9b1
2015-05-30 13:27:50 -07:00
James Zern
102123821d vp9_reconintra: specialize d63 4x4
based on webp's VL4()

Change-Id: Ibab962053843eae8752b4e74b6481a53bb034ae9
2015-05-30 13:27:03 -07:00
James Zern
6051bcc3dc vp9_reconintra: specialize d45 4x4
based on webp's LD4()

Change-Id: I74855d23ce73e1c6988fe08bf7c959b7a69b4abf
2015-05-30 13:26:21 -07:00
Parag Salasakar
71e88f903d Merge "mips msa vp9 updated macros and disable all MSA functions" 2015-05-30 02:52:27 +00:00
James Zern
7621b48a1c vp9_reconintra_neon/tm: improve above_left load
use vld1?_dup_u8 over vdup?_n_u8, reduces general register use; mildly
faster

Change-Id: Ie0e4e550849a207b34b378541196b553c9f12011
2015-05-29 19:18:43 -07:00
James Zern
f2d621e383 vp9_reconintra_neon: cosmetics: normalize fn params
s/y_stride/stride/

Change-Id: Ie98c3fe241dc240b653849eda356a8862bdd52f4
2015-05-29 19:01:39 -07:00
James Zern
b337c54cc4 vp9_reconintra_neon_asm/tm: simplify above_left load
use vld1.8 {d0[]}, [r0] rather than ldrb+vdup; mildly faster

Change-Id: I5c24d49a90c2855c94395184774b289da8e9d5a7
2015-05-29 18:56:16 -07:00
James Zern
7544e766e4 Merge changes from topic 'vp9-intra-pred'
* changes:
  vp9_reconintra_neon: add DC 16x16 predictors
  vp9_reconintra_neon: add DC 8x8 predictors
2015-05-30 01:51:35 +00:00
James Zern
a2a13cbe5f vp9_reconintra_neon: add DC 16x16 predictors
85-89% faster over 20M pixels

Change-Id: I9b320ed6b9e67f27df738b84c8b43b65a93c50c2
2015-05-29 15:41:44 -07:00
James Zern
e97b849219 vp9_reconintra_neon: add DC 8x8 predictors
~90% faster over 20M pixels

Change-Id: Iab791510cc57c8332c2f9a5da0ed50702e5f5763
2015-05-29 15:39:08 -07:00
Parag Salasakar
f9f078ebb6 mips msa vp9 updated macros and disable all MSA functions
Done little restructuring/styling changes to the sources like generic macro definitions, their use to reduce code lines, better code alignments etc.
Disabled all MSA hooks and tests

Change-Id: Ic6f2dce0b501f46b80c06c46c0fe2043d557b190
2015-05-29 13:34:33 +05:30
James Zern
be380f2005 variance_neon: add missing include
vpx_ports/mem.h is necessary for MSVC __builtin_prefetch compatibility
macro

Change-Id: I210fad6c6b4545df1874d028b31f42018490b029
2015-05-28 23:38:53 -07:00
Marco
26ab314176 For non-rd pickmode: remove VAR_PARTITION condition.
Keep the logic, transform size based on cyclic refresh and bsize,
(that was conditioned on VAR_PARTITION conditions) the same
for all speeds in non-rd mode (speeds >= 5).

No change to speeds >=6.
Small improvement for speed 5, ~0.5/1.5% gain for avg psnr/ssim.

Change-Id: If9c5657f3d30efd3c7f147166bba7cb69ea55114
2015-05-28 17:29:47 -07:00
Minghai Shang
45db29784d Merge "[svc] Disable tiles for spatial svc case" 2015-05-28 22:13:54 +00:00
Johann
7c16dcc79b Merge "Check size restrictions before running test vector" 2015-05-28 22:01:53 +00:00
Scott LaVarnway
bbea7c95d8 Merge "Re-worked header files" 2015-05-28 19:56:39 +00:00
Johann
a927aec5f8 Merge "Use correct parameters for NEON variance tests" 2015-05-28 19:53:50 +00:00
Johann
89ab1dca50 Merge "Remove conversion warnings from hbd shifts" 2015-05-28 19:39:32 +00:00
Johann
3f2a06674a Merge "Don't #define snprintf in VS 2015 or higher." 2015-05-28 19:38:57 +00:00
Johann
efc2e9844e Use correct parameters for NEON variance tests
Change-Id: Ib2949d0a3e9273e7952bbf91956357c1138093f1
2015-05-28 11:28:06 -07:00
hkuang
5317185eb0 Merge "Add error handling when running out of free frame buffers." 2015-05-28 17:41:01 +00:00
Johann
cad0eca25c Don't #define snprintf in VS 2015 or higher.
In VS 2015 and higher snprintf is supplied and therefore vsnprintf
doesn't need to be defined. This also avoids problems caused by
_snprintf being different from snprintf.

This fixes a build break with VS 2015 and improves security.

Originally submitted via chromium by brucedawson@chromium.org
https://codereview.chromium.org/1055603003

Additionally break this MSVC-specific tweak to a new file, which will
become the home of all such MSVC-specific things.

This requires adding a dependency on msvc.h to every example which uses
args.c and tools_common.h

Change-Id: I35b5f8e7ea00f6627403aabc9ea79b0412557a99
2015-05-27 18:28:25 -07:00
Johann
c855ed72a6 Remove conversion warnings from hbd shifts
ROUND_POWER_OF_TWO has some poor side effects when used
with [u]int64_t such as doing the shifting in 32bits.

Change-Id: Ic85a19765cd316fb43657cb21c86f35ceb772773
2015-05-27 17:54:22 -07:00
Johann
1e4473b216 Check size restrictions before running test vector
Change-Id: I60ea7724e6ab06fc658f678c1b76d984a43f5a5e
2015-05-27 15:55:17 -07:00
hkuang
131cab7c27 Add error handling when running out of free frame buffers.
Change-Id: If28b59b9521204a6e3aecedcf75932d76a752567
2015-05-27 14:20:58 -07:00
Johann
ed93470a69 Merge "Only use one 'END' per file" 2015-05-27 20:36:31 +00:00
Minghai Shang
cbdfdb947c Merge "[decoder] Optimize context buffer re-allocation" 2015-05-27 20:24:30 +00:00
Marco
a49fff632c Non-rd variance partition: Adjust thresholds for 1080p.
Increase the 32x32 split threshold, to allow for more 32x32
at expense of 16x16. Visually looks somewhat better.

Change-Id: Ia1439c3a0dc2d7933468b88bd59266fcd9f03505
2015-05-27 12:30:35 -07:00
Johann
7e272e8c43 Merge "Correct case in Get4x4SSEFunc" 2015-05-27 19:26:47 +00:00
Marco
109a2edf90 Merge "Refactor set_vbp_thresholds." 2015-05-27 19:10:28 +00:00
Johann
bbefdce7eb Only use one 'END' per file
On visual studio builds the 'END' directive aggressively signals the end
of file.

Change-Id: I28714da32762ef5abcbaeb5a109fb02b80dd13ec
2015-05-27 12:01:32 -07:00
Johann
c5a7c89e89 Correct case in Get4x4SSEFunc
Change-Id: Ie8a7508798fa8e65c579a77cedb8305cee4ddc81
2015-05-27 11:38:43 -07:00
Minghai Shang
30181c46d8 Merge "[svc] Make size of empty frame to be 16x16 all the time" 2015-05-27 17:49:00 +00:00
Marco
f76d42a98a Refactor set_vbp_thresholds.
Break out the setting of the block variance split thresholds,
since they are locally modified, e.g., based on local/segment qp.

No change in performance.

Change-Id: I0a3238e6dab05140657539fc4bd27ac5ff7a554e
2015-05-27 09:25:18 -07:00
Minghai Shang
15353216c5 [svc] Make size of empty frame to be 16x16 all the time
Change-Id: Ibab09aa0e8c69cf5efea2f0ec035e5da9cc894b0
2015-05-26 16:04:36 -07:00
Johann
dee70d355f Merge "Move variance functions to vpx_dsp" 2015-05-26 23:02:11 +00:00
Johann
c3bdffb0a5 Move variance functions to vpx_dsp
subpel functions will be moved in another patch.

Change-Id: Idb2e049bad0b9b32ac42cc7731cd6903de2826ce
2015-05-26 12:01:52 -07:00
Minghai Shang
9ae5fb706e Merge "[svc] Turn on frame_parallel_decoding_mode" 2015-05-26 17:50:45 +00:00
Jingning Han
55ef1ae9e7 Merge "Fix integral projection motion search for frame resize" 2015-05-26 16:08:31 +00:00
Scott LaVarnway
89ca85dacd Move inter_predictor to vp9_reconinter.h
This function was originally static.

Change-Id: I1922fa86711ace884d9f394210b6bb9ea2a0bfe3
2015-05-26 04:22:11 -07:00
James Zern
02fda6582c Merge changes Ie15e301e,Ib070c79b
* changes:
  vp9_reconintra_neon: cosmetics: reindent
  vp9_reconintra_neon: cosmetics: drop unneeded returns
2015-05-23 17:47:52 +00:00
James Zern
4e11f3ca6e vp9_reconintra_neon: cosmetics: reindent
Change-Id: Ie15e301e8f55cf928f42a03e53a8bb8b66d0e5d5
2015-05-22 21:04:30 -07:00
James Zern
ff683ab1da vp9_reconintra_neon: cosmetics: drop unneeded returns
Change-Id: Ib070c79bdbb9c1f4e25af693d7056ec9f964c789
2015-05-22 20:59:36 -07:00
James Zern
8c15ced172 vp9: move ssse3 convolve fns to intrinsics file
+ synchronize filter function signatures

this makes any intrinsics filters available for inlining and has the
side-effect of making those filters static, quieting missing-prototype
warnings.

Change-Id: I1908875caffa585bd4fc65aaf10d17a5e20cfb46
2015-05-22 20:14:16 -07:00
James Zern
2161e44025 vp9: move avx2 convolve fns to intrinsics file
+ synchronize filter function signatures

this makes any intrinsics filters available for inlining and has the
side-effect of making those filters static, quieting missing-prototype
warnings.

Change-Id: I1cd55c9d52547793ad65aa90c7620f0e426edaa2
2015-05-22 20:13:06 -07:00
James Zern
ef2b3cce50 add vp9/common/x86/convolve.h
collect the vp9_convolve function definition macros there; this will
allow some relocation of functions from vp9_asm_stubs.c

Change-Id: Idadd117fa256dd48748379856973fd985b8204e8
2015-05-22 20:12:16 -07:00
Johann
9e420c01da Merge "Remove unused "alt-tree-layout"" 2015-05-22 23:52:48 +00:00
Jingning Han
96dba4902c Fix integral projection motion search for frame resize
This commit fixes the integral projection motion search crash when
frame resize is used. It fixes issue 994.

Change-Id: Ieeb52619121d7444f7d6b3d0cf09415f990d1506
2015-05-22 15:40:45 -07:00
James Zern
48d8291df4 vp9_subpixel_8t_intrin_ssse3: quiet vs9 warning
reorder includes to avoid:
warning C4985: 'ceil': attributes not present on previous declaration.

this is the same workaround used in vp9/common/vp9_systemdependent.h

Change-Id: Ia10dd63de24f96fa1507a6179220e9d6ec774db6
2015-05-22 12:05:02 -07:00
Johann
7875e1d8ad Remove unused "alt-tree-layout"
Change-Id: Idddefb2fd3e4441421f61bd246479c627020a652
2015-05-22 11:35:37 -07:00
Scott LaVarnway
b962646fc5 Re-worked header files
Various header/test files had to be re-worked in order to
build "Remove cm parameter from vp9_decode_block_tokens()".

This patch reverts the "Remove cm" part and only contains
the re-worked header files.

Change-Id: I520958a88d1991fee988a3c784d0eac40e117a32
2015-05-22 11:19:51 -07:00
Marco
7ca17435d5 Fix to visual studio build error.
Change-Id: Ide080141ebc064584574c861fb324fe64cc572cc
2015-05-21 14:08:32 -07:00
paulwilkins
da8c3bf218 Merge "Fix issues with mixed ARF and GF groups." 2015-05-21 12:08:15 +00:00
James Zern
a492bcef87 vp9_mvref_common.c: fix compile warning
string literal to int within an assert

Change-Id: Ifd7acc717e01ee1bb3955ef830ec0d1645942459
2015-05-20 16:45:16 -07:00
Minghai Shang
9843e7c635 [svc] Disable tiles for spatial svc case
Change-Id: I8655a6760ab61947c09f337ddd9f4c1baf803a56
2015-05-20 14:31:49 -07:00
Marco
6f41e29064 vp8_drop_encodedframe_overshoot: fix to return setting.
Make sure force_maxqp is set to 0 for return 0.

Change-Id: Ie7c57842637226e932a390e7080e5ebb99996da3
2015-05-20 12:26:08 -07:00
Minghai Shang
48bfee8797 [decoder] Optimize context buffer re-allocation
1. Check existing buffer sizes when re-allocate context buffers.
2. Don't need to set mi buffers to 0 during setup_mi.

Change-Id: I6b48b0e077a4d804312b605ad0dc34aec5795a6d
2015-05-20 11:05:22 -07:00
Minghai Shang
e2c6a633fb [svc] Turn on frame_parallel_decoding_mode
Change-Id: I33b0384ee87f83950e03be6c999bc5f193055fd3
2015-05-20 10:56:48 -07:00
paulwilkins
883fdd45cf Fast feedback of bits on undershoot.
This patch provides a partial rapid feedback of bits
resulting from extreme undershoot.

Some  improvement on some problem animated material
but in its current form only a small impact on the metrics results
of our standard test sets.

Change-Id: Ie03036ea8123bc2553437cb8c8c9e7a9fc5dac5d
2015-05-20 16:47:34 +01:00
paulwilkins
ade9693a30 Fix issues with mixed ARF and GF groups.
This patch addresses two issues that can occur when the
encoder chooses to use a mixture of ARF and GF groups.

The first issue relates to a failure to reset the "ARF active" flag
correctly when transitioning from coding ARF groups to coding
GF groups. This caused some golden frames to be  encoded
with an incorrect bit rate target as if they were ARF overlay frames.

The second issue relates to the encoding of a single short GF group
just before a key frame.  Where the last group before a key frame
is an ARF group we expect the final frame before the key frame  to
be an low data rate overlay frame. However, when the last  group
is a GF group, the final frame before the key frame should be a normal
frame with a normal bit allocation. This issue had the potential to cause
a single poorly coded frame just before a key frame. If that key frame
were a forced key frame rather than a real scene cut, this might cause
pulsing.

Change-Id: Idf1eb5eaf63a231495a74de7899236e1ead9fb00
2015-05-20 16:46:44 +01:00
Marco
976f7f42c1 VP8: For high overshoot, force drop frame and max-out QP.
This allows rate control to react to content of current frame being encoded.
Enabling this feature via the setting: screen_content_mode = 2.

Change-Id: Ib2c6670551d96f4907495d5b7b76bb8c49e673db
2015-05-19 08:19:21 -07:00
James Zern
37d03809bf Merge "rename vp9_dct_impl_sse2.c to vp9_dct_sse2_impl.h" 2015-05-19 00:01:57 +00:00
James Zern
1bcf7a35e9 Merge "rename vp9_dct32x32_sse2.c to vp9_dct32x32_sse2_impl.h" 2015-05-19 00:01:22 +00:00
James Zern
0f854e9ab5 Merge "rename vp9_dct32x32_avx2.c to vp9_dct32x32_avx2_impl.h" 2015-05-19 00:01:07 +00:00
James Zern
3373f0e93b md5_helper.h: fix type conversion warning
add a cast in Add() from size_t -> uint32; quiets a visual studio build
warning

Change-Id: I0d87a3e460faf1fe2d4fb44df5f4042ef7500190
2015-05-17 11:21:22 -07:00
James Zern
8089f1cf13 test_intra_pred_speed: reuse test_libvpx's main()
this allows test_libvpx's simd caps check to be used; it also fixes a
link error on OS X with -fcommon.

Change-Id: I1a62a3e74ba06b8f3b37a22fcfdebf90c04ab289
2015-05-16 17:16:27 -07:00
James Zern
129a25c76d test_libvpx: add <arch>.* to negative filter
in addition to <arch>/*. this will pick up tests defined with TEST()
instead of INSTANTIATE_TEST_CASE_P()

Change-Id: I0917741baac89d9ce857f4d4aa53790e8a0c6c12
2015-05-16 11:52:59 -07:00
James Zern
85076fc5ab dec_build_inter_predictors: don't return a void fn
split call of extend_and_predict() and return, fixes visual studio build
warning since:
0a80164 Move mc_buf to cut down size of MACROBLOCKD.

Change-Id: I7cdf712941ef773a07f038539cb8080dc27861cd
2015-05-16 10:33:57 -07:00
James Zern
a989c66b84 rename vp9_dct_impl_sse2.c to vp9_dct_sse2_impl.h
this file shouldn't be built directly, it is included in vp9_dct_sse2.c
to create a non-high-bitdepth and a high-bitdepth version

silences missing prototype warnings for the unused FDCT* functions

Change-Id: Ide6ff8c24ab31bdb0f833260505ae33660a1ad5b
2015-05-15 17:01:19 -07:00
James Zern
587a71f1d6 rename vp9_dct32x32_sse2.c to vp9_dct32x32_sse2_impl.h
this file shouldn't be built directly, it is included in vp9_dct_sse2.c
to create a non-high-bitdepth and a high-bitdepth version

silences missing prototype warnings for the unused FDCT32x32* functions

Change-Id: I0e38f16dae5ea1728de184ee2c89287d48675c51
2015-05-15 16:59:52 -07:00
James Zern
4ec47249bc rename vp9_dct32x32_avx2.c to vp9_dct32x32_avx2_impl.h
this file shouldn't be built directly, it is included in vp9_dct_avx2.c
to create a non-high-bitdepth and a high-bitdepth version

silences missing prototype warnings for the unused FDCT32x32* functions

Change-Id: I4c19935c0e035b393be513bde735e9a78064a494
2015-05-15 16:47:51 -07:00
James Zern
cdf16c22ba Merge "tests: add test_intra_pred_speed" 2015-05-15 23:34:06 +00:00
James Zern
985f19bc6b Merge changes from topic 'missing-proto'
* changes:
  vp9_subexp.h: add a missing prototype
  vp9: add some missing includes
  vp9 intrinsics: add vp9_rtcd include
  vp9: correct some function signatures
  vp9_variance_sse2: sync function signatures
  vp9/encoder: make some functions static
  vp9_dct_sse2: make some functions static
  vp9_decodeframe.c: make a function static
2015-05-15 23:08:15 +00:00
Marco
beec69cfe2 Merge "Change tx_size_search_method setting for non-rd speed 5." 2015-05-15 21:29:01 +00:00
Marco
e88de49faa Change tx_size_search_method setting for non-rd speed 5.
Use the same settting as in speed >=6.
This will use same logic for tx_size selecton as in speed >=6,
which limits the transform size and reduces ringing artifact.
Also metrics go up on average with this change: ~2% for PSNR, ~10% for SSIM.

Change-Id: Ia2d50db236ae1cc72f742bfa6c9ec5ea50ff0e0a
2015-05-15 11:12:47 -07:00
James Zern
ca5a54113f vp9_subexp.h: add a missing prototype
+ include the .h in the .c
silences missing prototype warnings

Change-Id: Ia87366dccb4bf4e9f2ffa5d3ab51ac6ca5488c91
2015-05-15 10:43:48 -07:00
James Zern
97db651ce0 vp9: add some missing includes
mostly: <file>.c should include <file>.h
silences missing prototype warnings

Change-Id: Ic05ec32c6f7b2224b78825904d96d73aacad6000
2015-05-15 10:43:47 -07:00
James Zern
330fba41e2 vp9 intrinsics: add vp9_rtcd include
silences a missing declaration warning

Change-Id: I59a34e1a1377cf3529b678d7ec0122bd43ab1bf1
2015-05-15 10:43:47 -07:00
James Zern
18b60af27c vp9: correct some function signatures
silences missing prototype warnings

Change-Id: Idaf68d83d2cb03847f3ee002c4d00c2ac79da604
2015-05-15 10:43:47 -07:00
James Zern
43d5cc7fe1 vp9_variance_sse2: sync function signatures
+ include vp9_rtcd.h
silences missing prototype warnings

Change-Id: I77902f07a454029baad4fe5fe6fc37c65644e6f7
2015-05-15 10:43:47 -07:00
James Zern
700b7fd0a9 vp9/encoder: make some functions static
silences missing prototype warnings

Change-Id: I3338fcaa67b5dcdf6bf237e8b374db3befd18753
2015-05-15 10:43:47 -07:00
James Zern
8515e62e6b vp9_dct_sse2: make some functions static
silences missing prototype warnings

Change-Id: I773b6a6b5bd7c57db18c3b17c519534f80e131de
2015-05-15 10:43:47 -07:00
James Zern
f3bf5f2029 vp9_decodeframe.c: make a function static
silences a missing declaration warning

Change-Id: I2f49ebca9ba7a47f3c48f5fe919b90cd4114a9bc
2015-05-15 10:43:47 -07:00
Adrian Grange
8371c897dc Merge "Fix illegal memory access when stream starts w/ invisible frame." 2015-05-15 17:36:41 +00:00
James Zern
8dfeece878 Merge changes from topic 'missing-proto'
* changes:
  vp8/rdopt.h+onyx_int.h: add some missing prototypes
  vp8: add some missing includes
  vp8: make some functions static
  vp8/common/variance*: add vp8_rtcd include
  vp8_copy32xn: sync function signature
2015-05-15 17:19:50 +00:00
James Zern
0e5d0f7485 Merge changes from topic 'missing-proto'
* changes:
  sad*_avx2.c: sync function signatures
  vpx_scale: add missing rtcd + vpx_scale includes
2015-05-15 17:17:13 +00:00
James Zern
1fb9a8eed2 Merge changes from topic 'missing-proto'
* changes:
  fdct8x8_test: move functions to an anonymous namespace
  md5_utils.c: make a function static
  vpx_config.c: add vpx_codec include
2015-05-15 17:16:52 +00:00
Frank Galligan
d610ead258 Merge "Move mc_buf to cut down size of MACROBLOCKD." 2015-05-15 15:20:39 +00:00
paulwilkins
4f569e8485 Merge "Revert "Skip the last frame update for some frame repeats."" 2015-05-15 09:17:19 +00:00
James Zern
60b9f685cb vp8/rdopt.h+onyx_int.h: add some missing prototypes
silences missing prototype warnings

Change-Id: Icd477e37b502205d0a60e7389e51b1ba17d8888e
2015-05-14 22:41:26 -07:00
James Zern
62ad8baa40 vp8: add some missing includes
silences missing prototype warnings

Change-Id: Ib62e4743532b871e63bc99732875fff20501b8ac
2015-05-14 22:41:25 -07:00
James Zern
632177fa7f vp8: make some functions static
silences missing prototype warnings

Change-Id: I9f24a3214c832c982ca0dc5a032316eba48472ff
2015-05-14 22:41:25 -07:00
James Zern
f80bbc0efb vp8/common/variance*: add vp8_rtcd include
silences missing prototype warnings

Change-Id: I5ca198b56a5ff0cf5b93c89957526f243c04e9c8
2015-05-14 22:41:25 -07:00
James Zern
6eb1016301 vp8_copy32xn: sync function signature
+ include vp8_rtcd.h in copy_c.c
silences missing prototype warnings

Change-Id: Iecc279c695b08a26b231dedb41e3b84c551703f3
2015-05-14 22:41:13 -07:00
James Zern
4be50c5289 sad*_avx2.c: sync function signatures
+ include vpx_dsp_rtcd.h
silences missing prototype warnings

Change-Id: Ifa1780bcf72b1fa2b153025d0d78d91ad38774c3
2015-05-14 20:58:56 -07:00
James Zern
ad8bae3c2d vpx_scale: add missing rtcd + vpx_scale includes
silences missing prototype warnings

Change-Id: I33320f66c789b8c5c51d69f9dc0e017f9e06b0d0
2015-05-14 20:58:44 -07:00
James Zern
c47d868d99 fdct8x8_test: move functions to an anonymous namespace
silences missing declaration warnings

Change-Id: I9486c13c973df3d25fcdc2c3de9a0da783ce8fd6
2015-05-14 20:51:17 -07:00
James Zern
26453e7b67 md5_utils.c: make a function static
silences a missing prototype warning

Change-Id: I982c9c70e0e9f94a5201559300cadb8bd22441f9
2015-05-14 20:51:14 -07:00
James Zern
db4afa6bd2 vpx_config.c: add vpx_codec include
silences a missing prototype warning

Change-Id: I31a11c8390ae58e9a99ecc7cdf2a36334fac3f65
2015-05-14 20:51:08 -07:00
Frank Galligan
0a80164c94 Move mc_buf to cut down size of MACROBLOCKD.
Change-Id: Icea64b9e5632b41aaa7cd7018c501d6add9b7a7f
2015-05-14 19:10:02 -07:00
James Zern
0d2f348392 tests: add test_intra_pred_speed
useful for speed testing / verifying individual function optimizations;
currently tests non-high-bitdepth VP9 intra predictors

Change-Id: Ibd247765e43a31894697d43f1d39d312e0ba2090
2015-05-14 16:20:21 -07:00
Adrian Grange
f480c1256d Fix illegal memory access when stream starts w/ invisible frame.
Add a check to make sure we have a decoded frame available
before copying its 'corrupt' flag.

(Originally submitted to the old repository by Alexander Voronov
as: https://gerrit.chromium.org/gerrit/#/c/74305/).

Change-Id: Iceb4686c785afb437b668015bf8818b18d60e0ce
2015-05-14 15:49:10 -07:00
Tom Finegan
0de534b725 Merge "Remove BUILD_LIBVPX_SO variable from the build system." 2015-05-14 20:47:43 +00:00
Tom Finegan
f9a5b96fd2 Merge "Remove the BUILD_LIBVPX variable from the build system." 2015-05-14 19:08:06 +00:00
Tom Finegan
556ff27e2e Remove BUILD_LIBVPX_SO variable from the build system.
Was just an additional layer of indirection for CONFIG_SHARED, so
use CONFIG_SHARED directly.

Change-Id: I7c022b9f926a63c2c5884def5f03dfd648329afc
2015-05-14 11:20:34 -07:00
Tom Finegan
d104b16b56 Remove the BUILD_LIBVPX variable from the build system.
Replace it with it's value (yes), which is constant.

Change-Id: Ifb0c0408a53ecadf81156da6a64fa583b2ada746
2015-05-14 10:46:44 -07:00
paulwilkins
eb8faf1c89 Revert "Skip the last frame update for some frame repeats."
Testing on another rate control patch reveals that in some
situations, where the encoder is flipping in and out of arf
mode, we get an encoder decoder mismatch.

Whilst it is still not clear why, skipping  the last buffer
update seems to trigger the problem. Until I can establish
why, or if there is another underlying cause, I am reverting
this change.

This reverts commit e5112b3ae3352c4c55fb31235305f3f80f4b8f7e.

Change-Id: I315c5200414de89458015823344b7367e9dd75ba
2015-05-14 17:21:44 +01:00
Johann
cafae5b544 Merge "Relocate memory operations for common code" 2015-05-13 19:47:24 +00:00
Johann
1d7ccd5325 Relocate memory operations for common code
With the sad functions, and hopefully the variance functions soon,
moving to the vpx_dsp location, place the defines used in the
reference C code in a common location.

Change-Id: I4c8ce7778eb38a0a3ee674d2f1c488eda01cfeca
2015-05-13 11:41:15 -07:00
Tom Finegan
3007db0b45 Avoid failed include when Makefile is processed with no target.
Basically just a warning, but disconcerting nonetheless. Removes this
output from the build:
Makefile:59: -x86_64-darwin13-gcc.mk: No such file or directory

Change-Id: Ibb379506352b2f613ef4a7b1ac47e9c95d0d1580
2015-05-13 11:16:09 -07:00
Tom Finegan
ae14b37431 Merge "Remove claims of universal target support from the build system." 2015-05-13 17:05:46 +00:00
Parag Salasakar
686616a989 Merge "mips msa vp9 idct 8x8 optimization" 2015-05-13 04:36:34 +00:00
Tom Finegan
3d7063d4b0 Remove claims of universal target support from the build system.
These targets no longer build (PPC support was removed from
libvpx). Remove the dead code and misleading help output.

BUG=https://code.google.com/p/webm/issues/detail?id=997

Change-Id: Ib35614806adeae970f3821da0d8dbcc54ab8d868
2015-05-12 19:16:49 -07:00
Yunqing Wang
f72af26305 Merge "Remove unneeded variable declaration" 2015-05-12 23:33:31 +00:00
Yaowu Xu
a8015e217e Merge "Protect new metric computation with use_highbitdepth flag" 2015-05-12 23:20:35 +00:00
Yaowu Xu
3f42d10805 Protect new metric computation with use_highbitdepth flag
The computation of new metrics is not supported yet in highbitdepth
mode. This commit adds protection to make sure the computation is
done only when highbitdepth is not on. This protection shall be
revised when support of highbitdpeth computation is added.

This resolves the encoder crash when configured with both
--enable-internal-stats
--enable-vp9-highbitdepth

Change-Id: Id9f4bcc4fa26d9ca0e9eabade83f3f88a5b212e6
2015-05-12 15:12:05 -07:00
Yunqing Wang
8ba2d2d5a0 Remove unneeded variable declaration
This patch fixed the following warning:
src\third_party\libvpx\source\libvpx\vp9\encoder\vp9_pickmode.c(1607) :
warning C6246: Local declaration of 'this_mode' hides declaration of the
same name in outer scope.

Change-Id: I1d93c4a47a13cb13089fec5bd61e8b58e6cd8d58
2015-05-12 15:01:40 -07:00
James Zern
5c02f88a81 Merge "libs.mk: simplify test_libvpx target" 2015-05-12 21:10:43 +00:00
James Zern
f237849862 Merge changes from topic 'missing-proto'
* changes:
  vpxenc: make some functions static
  vpxdec: make some functions static
  tools_common.h: fix get_vpx_decoder_count() proto
  tools_common.h: fix get_vpx_encoder_count() proto
  tools_common.h: fix usage_exit() prototype
2015-05-12 19:02:05 +00:00
Johann
73de6ad522 Merge "Remove reference to compatibility layer" 2015-05-12 18:44:24 +00:00
Adrian Grange
17fc3e94c9 Merge "Recompute tile params on frame resize" 2015-05-12 17:48:16 +00:00
Johann
4aaf4661c3 Remove reference to compatibility layer
The compatibility layer was removed before the 1.4.0 release.

Change-Id: I268513ee9b3a2640ec33c4a25a5c5614fee7b3b2
2015-05-12 10:40:13 -07:00
James Zern
5c337fd08a vpxenc: make some functions static
silences missing-prototype warnings

Change-Id: I641a61b21f9de135e59e3769a2063d5a94f34746
2015-05-11 20:55:03 -07:00
James Zern
6a2e0f029a vpxdec: make some functions static
silences missing-prototype warnings

Change-Id: I080d2a24eeb6faa8c160683cc1fbf30d3b0b49e5
2015-05-11 20:55:02 -07:00
James Zern
d1999cb234 tools_common.h: fix get_vpx_decoder_count() proto
silences a missing-prototype warning

Change-Id: I99f8b4a9b7df836208e93170159733c5b5c2d881
2015-05-11 20:55:02 -07:00
James Zern
5a73bbdb83 tools_common.h: fix get_vpx_encoder_count() proto
silences a missing-prototype warning

Change-Id: Icf5c7f1f3e8ae9792276068fb3c0fd04b40fc7ad
2015-05-11 20:55:01 -07:00
James Zern
59e7a47c41 tools_common.h: fix usage_exit() prototype
+ the definitions in the examples

silences a missing-prototype warning

Change-Id: I7c064cacd6d2073a6107de6c3e2cc46ef8a68411
2015-05-11 20:54:55 -07:00
James Zern
b0789cd299 libs.mk: simplify test_libvpx target
rename LIBVPX_TEST_BINS to LIBVPX_TEST_BIN and remove foreach usage.
this was a leftover from having multiple targets with their own (single)
object list; the use of LIBVPX_TEST_OBJS so widely makes extending these
loops difficult.

Change-Id: I61bda1b91acb43145609f04b8fe6e45ec4483e22
2015-05-11 19:13:38 -07:00
James Zern
465ce0e420 Merge "build_intra_predictors*: reduce above_data size" 2015-05-11 23:48:58 +00:00
Adrian Grange
5f0dc57653 Merge "Reduce border extension by 1 line" 2015-05-11 22:47:49 +00:00
Adrian Grange
65b768fdf9 Recompute tile params on frame resize
When the frame size changes we must recompute details
of the tile dimensions.

Change-Id: Ie519bd6da47b5cd43933c0bcfc0f2429bcb01986
2015-05-11 15:45:26 -07:00
Jingning Han
2dcfd16fbd Merge "Sort variables dependency in read_uncompressed_header" 2015-05-11 19:11:56 +00:00
Jingning Han
2b2b461d39 Sort variables dependency in read_uncompressed_header
Remove a few repeated data structure reads from
read_uncompressed_header.

Change-Id: I6eb741b39f9415ad0aa4631dfbf4a1ace4eba56a
2015-05-11 10:07:55 -07:00
Marco
913862be8c Fix rate control issue with layers and aq-mode=3.
When aq-mode=3 is enabled, only for base layer frames should the
qp of the frame incorporate the segment delta-qp.

This was causing more rate mismatch for the enhancement layer frames
when running temporal layers with aq-mode=3 on.

Change-Id: I1c5e69d1ef8a51188af8696753c17fd8f67699b3
2015-05-11 10:04:18 -07:00
paulwilkins
aa5c1b4c5d Merge "Skip the last frame update for some frame repeats." 2015-05-11 12:28:45 +00:00
James Zern
a5e4ca8390 build_intra_predictors*: reduce above_data size
currently this needs to be 2x (NEED_ABOVERIGHT) the size of the largest
block (32) + 1 (for above_left). reduce the buffer size from 128 + 16
(alignment) to 64 + 16.

Change-Id: Idaca1806c7e1214e9437de24e15edc2ebf18f95d
2015-05-08 20:17:20 -07:00
James Zern
6d22713722 Merge "build_intra_predictors*: reduce left_col size" 2015-05-09 00:53:55 +00:00
hkuang
d53fb0fda5 Fix clang ioc warning due to NULL mi pointer.
The warning only happens in VP9 encoder's first pass due to src_mi
is not set up yet. But it will not fail the encoder as left_mi and
above_mi are not used in the first_pass and they will be set up again
in the second pass.

Change-Id: I0713b4660d71e229e196654cb0970ba6b1574f28
2015-05-08 15:42:50 -07:00
Johann Koenig
f003f77b8c Merge "Fix ndk build." 2015-05-08 18:56:21 +00:00
hkuang
f5574fb44c Merge "Add more sse2 code for intra prediction." 2015-05-08 17:26:30 +00:00
paulwilkins
e5112b3ae3 Skip the last frame update for some frame repeats.
Where a frame appears to be a repeat of an earlier
frame or frame buffer,  but the first pass code
does not anticipate this (usually because it is matching
the GF or ARF buffer not the last frame buffer), do not
update the last frame buffer.

This helps ensure that the content of the last frame buffer
is kept "different" where possible, and not updated to
match the GF or ARF. This is particularly helpful in some
animated sequences where there are groups of repeating
frames. Here it has quite a big impact. However, in most
of our standard test clips it has little or no impact.

Change-Id: I77332ee1a69f9ffc0c6080bfeb811c43fd8828e6
2015-05-08 17:51:26 +01:00
Parag Salasakar
7c5f00f868 mips msa vp9 idct 8x8 optimization
average improvement ~4x-6x

Change-Id: I5edf713721b9e24c7e0ce2e69d8fc3ecab625d91
2015-05-08 12:23:27 +05:30
Parag Salasakar
a8a9c2bb45 Merge "mips msa vp9 idct 32x32 optimization" 2015-05-08 04:27:44 +00:00
Frank Galligan
a4bcc8c318 Fix ndk build.
Android.mk should depend on vpx_dsp_rtcd.h

Change-Id: Ib614af195a9574fd849c28b695f9f4b3b2bd125c
2015-05-07 18:22:29 -07:00
Johann
11a4a3c065 Merge "Remove only remaining uses of 'fast_unaligned'" 2015-05-07 23:32:18 +00:00
James Zern
7e55ff1593 build_intra_predictors*: reduce left_col size
this should only need to be the size of the largest block, i.e., 32, not
64.

Change-Id: Ib8cb2424771fdd2a64c55379597248b2722a5ceb
2015-05-07 16:16:42 -07:00
Johann
802e1d84cc Remove only remaining uses of 'fast_unaligned'
Use memcpy instead of casting.

Change-Id: Ieca725cc628883985bde23c7d742af8781c5dbb5
2015-05-07 14:39:37 -07:00
James Zern
fd3658b0e4 replace DECLARE_ALIGNED_ARRAY w/DECLARE_ALIGNED
this macro was used inconsistently and only differs in behavior from
DECLARE_ALIGNED when an alignment attribute is unavailable. this macro
is used with calls to assembly, while generic c-code doesn't rely on it,
so in a c-only build without an alignment attribute the code will
function as expected.

Change-Id: Ie9d06d4028c0de17c63b3a27e6c1b0491cc4ea79
2015-05-07 11:55:08 -07:00
Johann
76a08210b6 Merge "Move shared SAD code to vpx_dsp" 2015-05-07 18:33:06 +00:00
hkuang
086934136b Merge "Remove an unnecessary check." 2015-05-07 15:51:11 +00:00
Marco
97307af21a Merge "Remvoe EIGHTTAP_SHARP filter check for non-rd mode." 2015-05-07 15:40:11 +00:00
paulwilkins
aecb1770d5 Merge "Image size restriction to rd auto partition search." 2015-05-07 14:12:14 +00:00
Parag Salasakar
1601c1385a mips msa vp9 idct 32x32 optimization
average improvement ~4x-6x

Change-Id: Idaba7e49fbd7f388caee0d73773ccf6e4807ef17
2015-05-07 12:42:23 +05:30
hkuang
7153b822ed Add more sse2 code for intra prediction.
vp9_dc_left_predictor_16x16
vp9_dc_top_predictor_32x32
vp9_dc_left_predictor_32x32
vp9_dc_128_predictor_32x32

Change-Id: Ib9861deefd01c3527235b92ff6b3d571ef6b4bc6
2015-05-06 17:17:00 -07:00
Marco
76fe5dfc67 Remvoe EIGHTTAP_SHARP filter check for non-rd mode.
Using EIGHTTAP and EIGHTTAP_SMOOTH seem sufficient.
Hard to see any visual gain from allowing EIGHTTAP_SHARP, and it is
rarely selected.

PSNR/SSIM metrics go up by ~0.18/0.14%.

Change-Id: I96fa0d98f9321b913e3ebcd464d4ff3c63018791
2015-05-06 17:08:34 -07:00
Johann
d5d9289800 Move shared SAD code to vpx_dsp
Create a new component, vpx_dsp, for code that can be shared
between codecs. Move the SAD code into the component.

This reduces the size of vpxenc/dec by 36k on x86_64 builds.

Change-Id: I73f837ddaecac6b350bf757af0cfe19c4ab9327a
2015-05-06 16:58:20 -07:00
Adrian Grange
0af5ff49bd Reduce border extension by 1 line
The code was using one row too many.

Change-Id: Ie0c05d02c22ae3d0d13d3b6565c40de3bc4fa17a
2015-05-06 14:44:24 -07:00
hkuang
240767b29d Remove an unnecessary check.
Change-Id: Id0f224ac4667dd173363b0f05711678448291d4e
2015-05-06 14:15:00 -07:00
hkuang
92b199061a Correct the inter prediction coordinate calculation which greatly reduced the
times of border extension.

Change-Id: I8e5bd590cc696ee71cfe1f4cc66c12fb24aaf44e
2015-05-06 10:55:56 -07:00
hkuang
623e6eed5e Merge "Optimize the read_partition." 2015-05-06 17:29:52 +00:00
Yunqing Wang
7dbdada49f Merge "Add intra mode early termination in non-rd mode" 2015-05-06 17:12:11 +00:00
Parag Salasakar
d1cdda88bd Merge "mips msa vp9 idct 16x16 optimization" 2015-05-06 06:40:56 +00:00
Yunqing Wang
36eabb1c3c Add intra mode early termination in non-rd mode
Added the intra mode early termination in order to
speed up the mode search in non-rd case since we
started to include more intra modes in the search
list. Borg tests(rtc set) showed a 0.048% PSNR gain
and 0.061 SSIM gain. No speed change.

Change-Id: I6f255fe534dc50b736e6a66a726ad458eb9b4443
2015-05-05 16:31:36 -07:00
hkuang
4c1a8be29d Optimize the read_partition.
Change-Id: I5a796425ce5706824a2fc17c6f24f983c5b9e43b
2015-05-05 15:51:04 -07:00
James Zern
ccae5d99d2 fix and enable vp9_dc_128_predictor_16x16
widen the loads and stores to 128-bit.

this was added, but not enabled in:
493a857 Add some sse2 code for intra prediction.

Change-Id: I277d7db608a7db7d75cc0bde86f48fa66ad487e4
2015-05-05 11:40:13 -07:00
hkuang
e47811ef8f Merge "Add some sse2 code for intra prediction." 2015-05-05 17:11:07 +00:00
paulwilkins
af76953448 Merge "Remove CONSTRAIN_NEIGHBORING_MIN_MAX." 2015-05-05 09:32:11 +00:00
paulwilkins
4cd65e4f19 Merge "Adjust ARF min and max interval." 2015-05-05 09:31:38 +00:00
Parag Salasakar
60052b618f mips msa vp9 idct 16x16 optimization
average improvement ~4x-6x

Change-Id: I55e95b7f2ba403dff11813958dc7c73a900dd022
2015-05-05 12:37:06 +05:30
Marco
b9a72d3c4d Allow for H and V intra modes for non-rd mode.
For non-rd mode (speed >=5): use mask based on prediction block size, and
(for non-screen content mode) allow for checking horiz and vert intra modes
for blocks sizes < 16x16.

Avg psnr/ssim metrics go up by about ~0.2%.

Only allowing H/V intra on block sizes below 16x16 for now, to keep
encoding time increase very small, and also when allowing H/V on 16x16 blocks,
metrics went down on a few clips which need to be further examined.

Change-Id: I8ae0bc8cb2a964f9709612c76c5661acaab1381e
2015-05-04 09:48:41 -07:00
James Zern
670b2c09ce vp9_idct_intrin_sse2: cosmetics: reindent
+ fix some whitespace

Change-Id: Id61b739282014288a7e5d3c17a9d6448d9d4cda2
2015-05-01 16:07:54 -07:00
Yunqing Wang
d31256cd38 Merge "Reduce intra_cost_penalty for BLOCK_8X8" 2015-05-01 18:29:38 +00:00
Yunqing Wang
57fefd5f9a Merge "Adjust the vbp early termination threshold slightly" 2015-05-01 18:29:25 +00:00
Scott LaVarnway
7b0f24fc21 FIX: Use correct above/left in read_intra_frame_mode_info
Should be using xd->above_mi and xd->left_mi.

Change-Id: Ifab83512db5491a955a3ed44a2d6e3b25b5ae5a5
2015-05-01 08:23:47 -07:00
paulwilkins
4a7dcf8eb2 Image size restriction to rd auto partition search.
Impose a limit on the rd auto partition search based on
the image format. Smaller formats require that the search
includes includes a smaller minimum block size.

This change is intended to mitigate the visual impact of
ringing in some problem clips, for smaller image formats.

Change-Id: Ie039e5f599ee079bbef5d272f3e40e2e27d8f97b
2015-05-01 16:16:02 +01:00
paulwilkins
287b0c6da9 Remove CONSTRAIN_NEIGHBORING_MIN_MAX.
Remove one of the auto partition size cases.
This case can behaves badly in some types of animated content
and was only used for the rd encode path. A subsequent patch
will add additional checks to help further improve visual quality.

Change-Id: I0ebd8da3d45ab8501afa45d7959ced8c2d60ee4e
2015-05-01 15:15:16 +01:00
paulwilkins
e0786c280e Adjust ARF min and max interval.
Previously limit on max interval  set to 0.5 seconds.
Though this helped some low frame rate material it
appears to be a bit too aggressive for some 24 and 25 fps
content. This patch relaxes the limit to 0.75 seconds.

The patch also adds a new minimum interval variable
to replace the current hard wired value. This allows us
to impose a limit on the maximum number of primary
arfs per second for high frame rate (e.g. 50 & 60fps)
content. This is to address concerns regarding playback
performance on some platforms if there is a high base
frame rate and very frequent arfs.

Change-Id: I373e8b6b2a8ef522eced6c6d2cceb234ff763fcf
2015-05-01 15:11:49 +01:00
James Zern
c77b1f5acd vp9: RECON_AND_STORE4X4: remove dest offset
offsetting by a variable stride prevents instruction reordering,
resulting in poor assembly

Change-Id: Id62d6b3299cdd23f8c44f97b630abf4fea241446
2015-04-30 19:14:17 -07:00
James Zern
778845da05 vp9_idct_intrin_*: RECON_AND_STORE: remove dest offset
offsetting by a variable stride prevents instruction reordering,
resulting in poor assembly.
additionally reroll 16x16/32x32 loops to reduce register spill with this
new format

Change-Id: I0635b8ba21ecdb88116e927dbdab53acdf256e11
2015-04-30 19:14:17 -07:00
Yaowu Xu
2061359fcf Merge "Remove vp9_idct16x16_10_add_ssse3()" 2015-04-30 23:13:33 +00:00
James Zern
0ae1e4a95a Merge "vp9_decodeframe: simplify compare_tile_buffers" 2015-04-30 23:05:42 +00:00
hkuang
493a8579f1 Add some sse2 code for intra prediction.
Change-Id: I16c0a62e52dab62837c547345df31e7518620ed4
2015-04-30 15:42:57 -07:00
Yunqing Wang
4907c29904 Reduce intra_cost_penalty for BLOCK_8X8
This patch reduced the BLOCK_8X8's intra_cost_penalty, which
allows 8x8 blocks to conduct intra mode search. Borg test
result(rtc set): 0.077% PSNR gain, 0.228% SSIM gain. No speed
changes.

Change-Id: Icfe90c4f6969de24bda8ecacbd3da50330bf22b2
2015-04-30 11:03:06 -07:00
Yaowu Xu
47767609fe Remove vp9_idct16x16_10_add_ssse3()
The rotation computation using 2X of cos(pi/16) has a potential to
overflow 32 bit, this commit disable the function to allow further
investigation and optimization.

Change-Id: I4a9803bc71303d459cb1ec5bbd7c4aaf8968e5cf
2015-04-30 09:07:30 -07:00
Yunqing Wang
fd90ce2711 Merge "Improve golden frame refreshing in non-rd mode" 2015-04-30 15:57:55 +00:00
Yunqing Wang
a257e469e1 Adjust the vbp early termination threshold slightly
Calculated cpi->vbp_threshold_sad from this frame's dequant value.
The encoding quality and speed didn't change much. Borg test
result: PSNR: -0.002%, SSIM: -0.003%.

Change-Id: I97c9826986f39582f29910d637d08a69c90afdee
2015-04-30 08:51:02 -07:00
Parag Salasakar
95cb130f32 Merge "mips msa vp9 copy and avg convolve optimization" 2015-04-30 04:39:13 +00:00
Yaowu Xu
d45870be8d Merge "Disable ssse3 version idct16x16_256_add()" 2015-04-30 03:09:23 +00:00
James Zern
9e81112df2 vp9_decodeframe: simplify compare_tile_buffers
return the difference between the 2 buffer sizes rather than exactly
-1/0/1.

Change-Id: Idf1ccff7088b31845470bcc71bea5927b0598cc7
2015-04-29 17:42:30 -07:00
Yaowu Xu
486a73a9ce Disable ssse3 version idct16x16_256_add()
The version is currently producing different result from c version
for some input. Disable the use of it for now to allow time for
investigation the source of mismatch.

Change-Id: Id039455494ee531db4886a9f1fa4761174ef6df3
2015-04-29 16:58:59 -07:00
Yunqing Wang
d31698b0e0 Improve golden frame refreshing in non-rd mode
The default golden frame interval was doubled. After encoding a
frame, the background motion was measured. If the motion was high,
the current frame was set as the golden frame. Currently, the
changes were applied only while aq-mode 3 was on.

Borg tests(rtc set) showed a 0.226% PSNR gain and 0.312% SSIM gain.
No speed changes.

Change-Id: Id1e2793cc5be37e8a9bacec1380af6f36182f9b1
2015-04-29 16:43:43 -07:00
Marco
3a7bc16156 Merge "vpx_temporal_svc_encoder: Keep static_threshold off as default." 2015-04-29 21:42:57 +00:00
Marco
ee3d42bf3f vpx_temporal_svc_encoder: Keep static_threshold off as default.
Change-Id: Iadb42041f08ac969cc0b6af6f15e30c8498db680
2015-04-29 14:41:36 -07:00
James Zern
4aec440682 Merge changes from topic 'vpx_mem-cruft'
* changes:
  vpx_mem: remove vpx_memset
  vpx_mem: remove vpx_memcpy
  vpx_mem: remove vpx_memmove
2015-04-29 19:01:48 +00:00
Marco
0810a2d8bc vpx_temporal_svc_encoder: Update some settings.
Set denoiser off by default: should add this option to command line.

Change-Id: Iaecc94f5b5099feaacd7a5c415fc86eb68a2eea5
2015-04-29 09:26:24 -07:00
Marco
03f12e142b vpx_temporal_svc_encoder: Set static threshold to off by default.
Change-Id: I029484a5ffddcc3e518eeee609a6709b01cba146
2015-04-29 08:38:14 -07:00
Parag Salasakar
2301d10f73 mips msa vp9 copy and avg convolve optimization
average improvement ~3x-5x

Change-Id: I422e4c33ea7e6d6783ba40029438ccf21b0e76bb
2015-04-29 12:28:17 +05:30
James Zern
f58011ada5 vpx_mem: remove vpx_memset
vestigial. replace instances with memset() which they already were being
defined to.

Change-Id: Ie030cfaaa3e890dd92cf1a995fcb1927ba175201
2015-04-28 20:00:59 -07:00
James Zern
f274c2199b vpx_mem: remove vpx_memcpy
vestigial. replace instances with memcpy() which they already were being
defined to.

Change-Id: Icfd1b0bc5d95b70efab91b9ae777ace1e81d2d7c
2015-04-28 19:59:41 -07:00
James Zern
fbd3b89488 vpx_mem: remove vpx_memmove
vestigial. replace instances with memmove() which they already were
being defined to.

Change-Id: If396d3f9e3cf79c0ee5d7429615ef3d6b2a34afa
2015-04-28 19:59:40 -07:00
James Zern
ccc9e1da8d Merge "vpx_mem: remove REPLACE_BUILTIN_FUNCTIONS" 2015-04-29 02:58:39 +00:00
James Zern
4902606bb6 Merge "x86_simd_caps: check max cpuid before testing AVX2" 2015-04-28 21:31:03 +00:00
Frank Galligan
2be50a1c9c Merge "WIP: Use LUT for y_dequant/uv_dequant" 2015-04-28 16:12:10 +00:00
Yunqing Wang
bfce02971e Merge "Fix debugmodes file to print modes and MVs correctly" 2015-04-28 15:47:46 +00:00
Scott LaVarnway
afcb62b414 WIP: Use LUT for y_dequant/uv_dequant
instead of calculating every block.

Change-Id: Ib19ff2546be8441f8755ae971ba2910f29412029
2015-04-28 07:52:06 -07:00
Yunqing Wang
297b2b99de Fix debugmodes file to print modes and MVs correctly
This patch fixed the issues in debugmodes file because of the recent
changes in MODE_INFO struct.

Change-Id: I4df83379ecc887c1f009d4a8329c9809c5b299d6
2015-04-27 17:09:38 -07:00
James Zern
6686e4411d Merge "PATENTS: fix a typo: constitutes -> constitute" 2015-04-25 06:06:08 +00:00
James Zern
8d98aef055 PATENTS: fix a typo: constitutes -> constitute
Change-Id: Ie54413818b7f731b8a48b719038e66c9744de81e
2015-04-24 20:24:02 -07:00
James Zern
abff8b24b9 x86_simd_caps: check max cpuid before testing AVX2
structured extended feature flags require eax = 7; avoids incorrectly
detecting avx2 on some older processors that support avx.

from [1]:
INPUT EAX = 0: Returns CPUID’s Highest Value for Basic Processor
Information and the Vendor Identification String

[1] http://www.intel.com/content/www/us/en/processors/processor-identification-cpuid-instruction-note.html

Change-Id: I6b4735b5f7b7729a815e428fca767d1e5a10bcab
2015-04-24 19:24:14 -07:00
Yaowu Xu
b3e411e481 Add validation of UV partition size
For color sampling format other than 420, valid partion size in Y may
not work for UV plane. This commit adds validation of UV partition
size before select the partition choice.

This fixes a crash for real time encoding of 422 input.

Change-Id: I1fe3282accfd58625e8b5e6a4c8d2c84199751b6
2015-04-24 12:34:18 -07:00
James Zern
3e9263e1ca vpx_mem: remove REPLACE_BUILTIN_FUNCTIONS
vestigial. there are other ways to achieve this.

Change-Id: Ie977ce952527e596479df3084f331b694a682e39
2015-04-23 20:31:59 -07:00
James Zern
4feae6791c vpx_mem: remove global function pointer
vestigial.

Change-Id: I11389f660d0c5db8fa48bd355cbc3223fc3bcabb
2015-04-22 13:11:07 -07:00
James Zern
4659e3644f vpx_mem: remove mem tracker
vestigial. there are tools better suited for this

Change-Id: I7a72a2cfe32377f07c8cd0973ddb18842720a225
2015-04-22 13:10:12 -07:00
Johann
4a29474c83 Merge "vpx_mem: remove 'mem checks'" 2015-04-22 13:09:47 -07:00
Johann
9ed0e071fe Merge "vpx_mem: remove memory manager code" 2015-04-22 13:09:39 -07:00
Jim Bankoski
a6e9ae9066 Adds worst frame metrics for a bunch of metrics.
Change-Id: Ieaccc36ed1bee024bb644a9cfaafdaaa65d31772
2015-04-22 06:45:56 -07:00
paulwilkins
e07b141da0 Merge "Modified test for auto key frame detection." 2015-04-22 02:29:17 -07:00
paulwilkins
5d8877a944 Merge "Limit arf interval for low fpf clips." 2015-04-22 02:25:38 -07:00
Parag Salasakar
1c9af9833d Merge "mips msa vp9 convolve8 horiz optimization" 2015-04-21 22:08:25 -07:00
Jim Bankoski
3b35e962e2 Merge "Adds a new temporal consistency metric to libvpx." 2015-04-21 16:11:11 -07:00
Johann
931c0a954f Merge "Rename neon convolve avg file" 2015-04-21 15:45:29 -07:00
Johann
66b9933b8d Rename neon convolve avg file
Some build systems use just the basename for object files.

Change-Id: I333e1107ee866f3906cc46476ef8d04c6200a8a0
2015-04-21 14:18:17 -07:00
Scott LaVarnway
8b17f7f4eb Revert "Remove mi_grid_* structures."
(see I3a05cf1610679fed26e0b2eadd315a9ae91afdd6)

For the test clip used, the decoder performance improved by ~2%.
This is also an intermediate step towards adding back the
mode_info streams.

Change-Id: Idddc4a3f46e4180fbebddc156c4bbf177d5c2e0d
2015-04-21 11:16:45 -07:00
Jim Bankoski
ee87e20d53 Adds a new temporal consistency metric to libvpx.
Change-Id: Id61699ebf57ae4f8af96a468740c852b2f45f8e1
2015-04-21 10:05:37 -07:00
Yaowu Xu
924d06a075 Merge "Resolve configuration conflict" 2015-04-21 08:00:49 -07:00
paulwilkins
3606b78108 Modified test for auto key frame detection.
The existing test was triggering a lot of false positives on some types
of animated material with very plain backgrounds. These were triggering
code designed to catch key frames in letter box format clips.

This patch tightens up the criteria and imposes a minimum requirement
on the % blocks coded intra in the first pass and the ratio between the
% coded intra and the modified inter % after discounting neutral (flat)
blocks that are coded equally well either way.

On a particular problem animation clip this change eliminated a large
number of false positives including some cases where the old code
selected kf several times in a row. Marginal false negatives are less
damaging typically to compression and in the problem clip there are now
a couple of cases where "visual" scene cuts are ignored because of well
correlated content across the scene cut.

Replaced some magic numbers related to this with #defines and added
explanatory comments.

Change-Id: Ia3d304ac60eb7e4323e3817eaf83b4752cd63ecf
2015-04-21 12:50:11 +01:00
Parag Salasakar
ca90d4fd96 mips msa vp9 convolve8 horiz optimization
average improvement ~6x-8x

Change-Id: I7c91eec41aada3b0a5231dda7869b3b968f3ad18
2015-04-21 12:31:26 +05:30
Parag Salasakar
391ecffed9 Merge "mips msa vp9 convolve8 hv optimization" 2015-04-20 23:39:24 -07:00
James Zern
02804821cc vpx_mem: remove 'mem checks'
vestigial. there are tools better suited for this

Change-Id: I1d6f604452fbc62cb7523eec8d1f8a72a276d6b5
2015-04-20 20:52:32 -07:00
James Zern
e5eda53e3d vpx_mem: remove memory manager code
vestigial. the code is stale and couldn't be configured directly; there
are better ways to achieve this now

Change-Id: I5a9c62e099215588cd0d7e5ae002dfc77c21a895
2015-04-20 20:52:32 -07:00
Parag Salasakar
ef51c1ab5b mips msa vp9 convolve8 hv optimization
average improvement ~5x-8x

Change-Id: I3214734cb3716e742907ce0d2d7a042d953df82b
2015-04-21 09:17:49 +05:30
Yaowu Xu
b423a6b212 Resolve configuration conflict
Between --enable-internal-stats and --enable-vp9-highbitdepth

Change-Id: I36b741554e835033e69883270b6b0e5374a1aafa
2015-04-20 16:44:12 -07:00
Yaowu Xu
305492c375 Move declaration before statement
Change-Id: Ib64786fcc0d6dc11c4e66f5b7f3e93b2a4fcb664
2015-04-20 09:50:59 -07:00
Parag Salasakar
2e36149ccd Merge "mips msa vp9 convolve8 vert optimization" 2015-04-18 23:39:25 -07:00
Parag Salasakar
27d083c1b9 mips msa vp9 convolve8 vert optimization
average improvement ~6x-10x

Change-Id: Ie3f3ab3a9005be84935919701e56b404e420affa
2015-04-18 08:13:04 +05:30
Jim Bankoski
03829f2fea Merge "Adds a blockiness metric to internal stats." 2015-04-17 16:06:26 -07:00
Jim Bankoski
3d2f037a44 Merge "adds psnrhvs to internal stats." 2015-04-17 16:06:10 -07:00
Jim Bankoski
f2cbee9a04 Merge "Adds a fastssim metric to VPX internal stats." 2015-04-17 16:05:53 -07:00
Jim Bankoski
1777413a2a Adds a blockiness metric to internal stats.
Change-Id: Iedceeb020492050063acf3fd2326f96c29db9ae5
2015-04-17 11:13:18 -07:00
Frank Galligan
3a7ebf9c36 Fix dependency of android vpx test application.
Change-Id: I32b7c92c89c9a2be0cf38e67a17266b9d3866154
2015-04-17 10:59:11 -07:00
Jim Bankoski
9757c1aded adds psnrhvs to internal stats.
PSNR HVS is a human visual system weighted version of SNR that's
gained some popularity from academia and apparently better matches
MOS testing.

This code is borrowed from the Daala Project but uses our FDCT code.

Change-Id: Idd10fbc93129f7f4734946f6009f87d0f44cd2d7
2015-04-17 10:29:27 -07:00
Jim Bankoski
3f7f194304 Adds a fastssim metric to VPX internal stats.
This code appeared in the Daala project first and was originally
committed by Nathan Egge.

Change-Id: Iadce416a091929c51b46637ebdec984cddcaf18c
2015-04-17 10:23:24 -07:00
Jingning Han
73bce9ec7e Merge "Remove unnecessary backup token stream pointer" 2015-04-17 09:13:53 -07:00
Marco Paniconi
f76ccce5bc Revert "Revert "Force_split on 16x16 blocks in variance partition.""
This reverts commit 004b9d83e37d355f590a6976a27b7b845d19a869

Change-Id: I2f2d0bdb9368c2c07f1d29a69cd461267a3a8743
2015-04-16 17:52:13 -07:00
Jingning Han
645c70f852 Remove unnecessary backup token stream pointer
When the tokenization is not taking effect, the tokenization
pointer remains unchanged. No need to re-assign the backup pointer
value.

Change-Id: I58fe1f6285aa3b4a88ceb864c11d5de8ac6235dd
2015-04-16 16:44:44 -07:00
Frank Galligan
c0b23ac20d Merge "Fix multithread encode test" 2015-04-16 16:00:54 -07:00
Frank Galligan
45f9ee263f Fix multithread encode test
The multithread encode test was never actually setting more than
one thread.

Change-Id: Ie7a3b7b138e88344c943bffd544cf2b4aab866a9
2015-04-16 14:20:18 -07:00
Minghai Shang
29b5cf6a9d Merge "[svc] Fix syntax error when encoding multiple tiles." 2015-04-16 13:43:44 -07:00
Johann
a53c495b3e Merge "Use extern for *_rtcd() in test/test_libvpx.cc" 2015-04-16 13:42:34 -07:00
Minghai Shang
4aa9255efa [svc] Fix syntax error when encoding multiple tiles.
Change-Id: Ia77b551415f3b3386e22a6c805f244f2d13fe3e3
2015-04-16 12:56:30 -07:00
Johann
e8645ce9f9 Use extern for *_rtcd() in test/test_libvpx.cc
This partially reverts commit 14ef4aeafb

Including the rtcd headers to get the function definitions causes
problems on VS9.

Change-Id: I780874d9e03af2d3124192ab0e3907301f22674c
2015-04-16 15:04:59 -04:00
James Zern
278593c9a9 Merge "Android.mk: remove unnecessary -llog reference" 2015-04-16 12:00:11 -07:00
paulwilkins
effd974b16 Limit arf interval for low fpf clips.
This patch limits  the maximum arf interval length to
approximately half a second. In some low fps animations in
particular the existing code was selecting an overly long interval
which was hurting visual quality. For a sample problem test clip
(360P animation , 15fps, ~200Kbit/s) this change also improved
metrics by >0.5 db.

There may be some clips where this hurts metrics a little, but the
worst case impact visually is likely to be less than having an
interval that is much too long. On more normal material at 24
fps or higher, the impact is likely to be nil/minimal.

Change-Id: Id8b57413931a670c861213ea91d7cc596375a297
2015-04-16 11:50:37 +01:00
Parag Salasakar
3701dcc5c1 Merge "mips msa configuration fix" 2015-04-15 21:17:13 -07:00
James Zern
e3bf76f9ec Android.mk: remove unnecessary -llog reference
nothing is using android/log.h currently; also quiets a warning when
building a static lib:
Android NDK: WARNING:libvpx/build/make/Android.mk:vpx: LOCAL_LDLIBS is
always ignored for static libraries

Change-Id: I1469a5d6fca4f7338a4a82e26a03e60fc91d92ca
2015-04-15 20:54:04 -07:00
James Zern
1551d7c00b Merge "Android.mk: add a flag to control shared/static lib" 2015-04-15 20:33:03 -07:00
Yunqing Wang
14e7203e7b Merge "Fix Tsan errors" 2015-04-15 15:34:03 -07:00
Yunqing Wang
63c5bf2b9c Fix Tsan errors
This patch fixed 2 reported Tsan errors while running VP9 real-time
encoder.

Change-Id: Ib0278fe802852862c3ce87c4a500e544d7089f67
2015-04-15 12:33:39 -07:00
Johann
3cba8dc304 Merge "Reorganize *_rtcd() calling conventions" 2015-04-15 12:27:59 -07:00
Johann
d61c1ea69b Merge "Allow specifying a different prefix in x86inc.asm" 2015-04-15 12:12:58 -07:00
Johann
14ef4aeafb Reorganize *_rtcd() calling conventions
Change-Id: Ib1e17d8aae9b713b87f560ab5e49952ee2bfdcc2
2015-04-15 11:12:05 -04:00
Johann
b09ac154af Allow specifying a different prefix in x86inc.asm
Currently the prefix is forced to vp9 for any function using
x86inc.asm.

Change-Id: Icbca57ce68a52e743bdd7e9be86cfe8353f274c1
2015-04-15 09:42:48 -04:00
Johann
d011a8a45c Merge "Remove unused scaleopt.cpp" 2015-04-15 06:36:45 -07:00
Parag Salasakar
4009b63c42 mips msa configuration fix
for big endian disable msa
removed -flax-vector-conversion flag
disable runtime_cpu_detect feature if enabled

Change-Id: Icd5130b733f2ddcdb94ffb6e4d170e6ca0f9832b
2015-04-15 11:56:42 +05:30
Yunqing Wang
004b9d83e3 Revert "Force_split on 16x16 blocks in variance partition."
This reverts commit eb8c667570aa83134c7db0690de9dbdde4d90291.
The patch caused mismatch while using multi-threads.

Change-Id: Icd646340af25b5d91e32f03ed3ea212e00e3e0be
2015-04-14 15:19:31 -07:00
Johann
af7484a332 Remove unused scaleopt.cpp
Change-Id: Ibaeede61c128c73809332b9a853cd62b8d6d5325
2015-04-14 16:59:30 -04:00
Marco
2baa3debd5 Merge "Force_split on 16x16 blocks in variance partition." 2015-04-14 09:44:58 -07:00
hkuang
3b2510374a Merge "Remove unnecessary set postproc flags." 2015-04-13 14:33:43 -07:00
Marco
eb8c667570 Force_split on 16x16 blocks in variance partition.
Force split on 16x16 block (to 8x8) based on the minmax over the 8x8 sub-blocks.

Also increase variance threshold for 32x32, and add exit condiiton in choose_partition
(with very safe threshold) based on sad used to select reference frame.

Some visual improvement near moving boundaries.
Average gain in psnr/ssim: ~0.6%, some clips go up ~1 or 2%.
Encoding time increase (due to more 8x8 blocks) from ~1-4%, depending on clip.

Change-Id: I4759bb181251ac41517cd45e326ce2997dadb577
2015-04-13 12:05:07 -07:00
Parag Salasakar
2f693be8f8 Merge "mips msa vp9 common headers added" 2015-04-09 21:50:15 -07:00
Jingning Han
2404332c1b Merge "Remove get_nonrd_var_based_fixed_partition function" 2015-04-09 14:45:19 -07:00
Jingning Han
4565812032 Merge "Compute prediction filter type cost only when needed" 2015-04-09 14:45:11 -07:00
Jingning Han
93d9c50419 Merge "SSSE3 assembly implementation of 8x8 Hadamard transform" 2015-04-09 11:16:11 -07:00
hkuang
9244ac8592 Merge "Remove unnecessary mv clamp with on demand border extension." 2015-04-09 10:08:06 -07:00
Parag Salasakar
481fb7640c mips msa vp9 common headers added
Change-Id: Ia31ada59172eb1818e1eb91009f83cbb1f581223
2015-04-09 15:35:12 +05:30
James Zern
b815f3a977 Android.mk: add a flag to control shared/static lib
ndk-build ENABLE_SHARED=1 ...

Change-Id: Idd64804b165d0d4bbfb0b242d6c4eee5e828dab4
2015-04-08 21:03:36 -07:00
James Zern
8a75847497 Merge "vpxdec.sh: fix vp9_webm_less_than_50_frames w/valgrind" 2015-04-08 21:01:34 -07:00
hkuang
7e8e507bfb Remove unnecessary mv clamp with on demand border extension.
Change-Id: Ia2956f06f409b9b0ca8320ca4c1ea5680e938402
2015-04-08 17:16:52 -07:00
Frank Galligan
5668dcc7b9 Refactor dec_build_inter_predictors
Refactor the loops in dec_build_inter_predictors to try and decrease
the number of instructions. Limited testing saw about 1% perf
increase on x86 and about 0.67 % perf increase on Arm.

Change-Id: I69cfe6335bb562fbaaebf43fb3f5c5a2a28882a2
2015-04-08 15:00:29 -07:00
James Zern
aac3adb3c5 vpxdec.sh: fix vp9_webm_less_than_50_frames w/valgrind
add a check for the status line to awk and better report failure given
the program output will be lost in this case

Change-Id: I1348a80108c81099d609f2e2227dd2c31bd8cd54
2015-04-08 11:45:04 -07:00
Debargha Mukherjee
59681be0a0 Merge "Improve accuracy of rate control in CQ mode" 2015-04-08 10:48:17 -07:00
James Zern
2ed0cf06f9 Merge "vp9_full_search_sadx[38]: align sad arrays" 2015-04-07 20:57:21 -07:00
Yaowu Xu
c88ce84bb5 Merge "Optimize the checking for transform skipping" 2015-04-07 16:29:51 -07:00
Yaowu Xu
90517b5e85 Merge "move ref_frame_cost computations into a function" 2015-04-07 16:29:45 -07:00
Debargha Mukherjee
60bd744c88 Improve accuracy of rate control in CQ mode
Modifies a special handling that improves rate control accuracy in
the constrained quality mode, when the undershoot and overshoot
limits are set tighter.

Change-Id: If62103f0ef3ed1cac92807400678c93da50cf046
2015-04-07 16:29:21 -07:00
Yaowu Xu
5eee2a88f8 Merge "Test loopfilters with count=2" 2015-04-07 16:08:25 -07:00
James Zern
e1ff83f4b0 vp9_full_search_sadx[38]: align sad arrays
the sse4 code expects 16-byte aligned arrays; vp8 already had a similar
change applied:
b2aa401 Align SAD output array to be 16-byte aligned

Change-Id: I5e902035e5a87e23309e151113f3c0d4a8372226
2015-04-07 14:34:06 -07:00
Jingning Han
927693a991 Merge "Enable Hadamard transform based cost estimate for all block sizes" 2015-04-07 12:51:27 -07:00
Jingning Han
6de407b638 Merge "Account for eob cost in the RTC mode decision process" 2015-04-07 12:50:30 -07:00
Vignesh Venkatasubramanian
8de26efa66 Merge "webmdec: Fix for reaching eof in webm_guess_framerate" 2015-04-07 11:53:43 -07:00
Vignesh Venkatasubramanian
866447a008 webmdec: Fix for reaching eof in webm_guess_framerate
Reset the reached_eos flag in webm_guess_framerate in case it ends
up consuming the entire file. Also adding a vpxdec shell test to
verify this behavior.

Change-Id: I371eebd2105231dc0f60e65da1f71b233ad14be5
2015-04-07 11:04:51 -07:00
Yaowu Xu
0bb897211d Optimize the checking for transform skipping
If U is not skippable, then do not perform the check on V.

Change-Id: Iba5e8362bd42390197f373c44388a426a4404549
2015-04-06 17:54:05 -07:00
Jim Bankoski
5e300cac2c Merge changes Ide5eefad,I28026b86,Ie9a6fac0,Ia8a20c67,I8c7f5b97,I33ca9cdd,I438cbf49
* changes:
  vp8_regular_quantize_b_sse2: remove dead init
  vp8cx_pick_filter_level*: remove dead inits
  vp8_decode_frame: remove dead increment
  rdopt: remove dead stores
  find_next_key_frame: remove dead init & store
  multiframe_quality_enhance_block: remove dead stores
  vp8_print_modes_and_motion_vectors: remove dead stores
2015-04-06 17:05:35 -07:00
Jingning Han
7f629dfca4 SSSE3 assembly implementation of 8x8 Hadamard transform
It uses about 10% less CPU cycles than the SSE2 intrinsic
implementation.

Change-Id: I91017c0c068679a214b98cdd4cff3a6facfb7499
2015-04-04 09:59:37 -07:00
Yunqing Wang
b2baaa215b Merge "Fix the scaling factor in UV skipping test" 2015-04-03 17:09:59 -07:00
James Zern
5afa7d1f87 vp8_regular_quantize_b_sse2: remove dead init
Change-Id: Ide5eefadbb3cab38743a69f744a003abb37a6506
2015-04-03 16:44:16 -07:00
James Zern
30205e14b7 vp8cx_pick_filter_level*: remove dead inits
Change-Id: I28026b86d03264b9f4e2fc8ac1d3c74aa3954208
2015-04-03 16:44:15 -07:00
James Zern
acb219be25 vp8_decode_frame: remove dead increment
Change-Id: Ie9a6fac02796d24e6f4a15416d0b4c19010547df
2015-04-03 16:44:15 -07:00
James Zern
0c5a140a02 rdopt: remove dead stores
Change-Id: Ia8a20c6751cc6d63c60bb00b99c78faca1e61051
2015-04-03 16:44:14 -07:00
James Zern
04c53d2393 find_next_key_frame: remove dead init & store
Change-Id: I8c7f5b9718ef14e4397a263aa9f52a9edcf7d1cd
2015-04-03 16:43:48 -07:00
James Zern
970acffa8f multiframe_quality_enhance_block: remove dead stores
Change-Id: I33ca9cddfdd54c3d8a23c1cb978986a537a20bf2
2015-04-03 16:15:51 -07:00
James Zern
7b4f727959 vp8_print_modes_and_motion_vectors: remove dead stores
Change-Id: I438cbf4970fa2220fb73b0b41a29e654836d4e3b
2015-04-03 16:08:37 -07:00
Yunqing Wang
1a1114d21c Fix the scaling factor in UV skipping test
The threshold scaling factor was calculated wrong using partition
size "bsize". Thank Yaowu for pointing it out. It was fixed and no
speed change was seen.

Change-Id: If7a5564456f0f68d6957df3bd2d1876bbb8dfd27
2015-04-03 16:07:43 -07:00
Ed Baker
4e73e4bf93 Test loopfilters with count=2
The following functions use the count parameter to either loop or select
dedicated paths:
vp9_lpf_horizontal_16_c
vp9_lpf_horizontal_16_sse2
vp9_lpf_horizontal_16_avx2
vp9_lpf_horizontal_16_neon
vp9_highbd_lpf_horizontal_16_c
vp9_highbd_lpf_horizontal_16_sse2

Change-Id: I7abfd2cb30baa292b4ebe11c847968481103c037
2015-04-03 15:36:52 -07:00
James Zern
44e3640923 Merge "vp9: enable sse4 sad functions" 2015-04-03 14:57:52 -07:00
Johann
0080aca235 Merge "Merge branch 'indianrunnerduck'" 2015-04-03 13:43:20 -07:00
Johann
c5f7842234 Merge "Remove AltiVec flag" 2015-04-03 13:42:49 -07:00
Johann
79bd071373 Merge branch 'indianrunnerduck'
* indianrunnerduck:
  Update CHANGELOG for v1.4.0 (Indian Runner Duck) release
  vp9: fix high-bitdepth NEON build
  Fix use of scaling in joint motion search
  Prepare Release Candidate for libvpx v1.4.0
  vp8cx.h: vpx/vpx_encoder.h -> ./vpx_encoder.h

Change-Id: Ib2eee50f02e12623aae478871cb9150604bb2ac2
2015-04-03 12:53:45 -07:00
Johann
c74bf6d889 Update CHANGELOG for v1.4.0 (Indian Runner Duck) release
Change-Id: Id31b4da40c484aefc1236f5cc568171a9fd12af2
2015-04-03 11:49:19 -07:00
Jingning Han
30e9c091c0 Merge "Tune SSSE3 assembly implementation to improve quantization speed" 2015-04-03 11:24:28 -07:00
Johann
73fe337647 Remove AltiVec flag
Change-Id: I560b1a954a5089a8af69952b8084408c6a420b96
2015-04-03 10:33:20 -07:00
hkuang
d72ed35374 Merge "Fix error of "Left shift of negative value -1"." 2015-04-02 21:35:12 -07:00
Yunqing Wang
12cb30d4bd Merge "Set vbp thresholds for aq3 boosted blocks" 2015-04-02 18:22:08 -07:00
Yaowu Xu
718feb0f69 move ref_frame_cost computations into a function
Change-Id: Iebf2ad2b1db7e2874788fda8d55e67f4cb1149f1
2015-04-02 18:10:55 -07:00
hkuang
73c8fe5deb Fix error of "Left shift of negative value -1".
Change-Id: Ia4f3feb20df0e89cc51b02def858e12e927312cc
2015-04-02 17:35:33 -07:00
Marco
f85f79f630 Merge "Code cleanup: put (8x8/4x4)fill_variance into separate function." 2015-04-02 17:33:01 -07:00
Johann
327b138b2c Merge "Remove PPC build support" 2015-04-02 16:26:48 -07:00
Yunqing Wang
cae03a7ef5 Set vbp thresholds for aq3 boosted blocks
The vbp thresholds are set seperately for boosted/non-boosted
superblocks according to their segment_id. This way we don't
have to force the boosted blocks to split to 32x32.

Speed 6 RTC set borg test result showed some quality gains.
Overall PSNR: +0.199%; Avg PSNR: +0.245%; SSIM: +0.802%.
No speed change was observed.

Change-Id: I37c6643a3e2da59c4b7dc10ebe05abc8abf4026a
2015-04-02 15:48:32 -07:00
James Zern
d181a627f0 vp9: fix high-bitdepth NEON build
remove incorrect specializations in rtcd and update a configuration
check in partial_idct_test.cc

(cherry picked from commit 8845334097d1cb03fc8d7a91c86f02235afc8da6)

Change-Id: I20f551f38ce502092b476fb16d3ca0969dba56f0
2015-04-02 15:19:46 -07:00
Adrian Grange
5ef2d1ddae Fix use of scaling in joint motion search
To enable us to the scale-invariant motion estimation
code during mode selection, each of the reference
buffers is scaled to match the size of the frame
being encoded.

This fix ensures that a unit scaling factor is used in
this case rather than the one calculated assuming that
the reference frame is not scaled.

(cherry picked from commit 8d8d7bfde5d311bb7d4ff4e921a9dbaa8f389af5)

Change-Id: Id9a5c85dad402f3a7cc7ea9f30f204edad080ebf
2015-04-02 15:19:23 -07:00
Marco
77ea408983 Code cleanup: put (8x8/4x4)fill_variance into separate function.
Code cleanup, no change in behavior.

Change-Id: I043b889f8f0b3afb49de0da00873bc3499ebda24
2015-04-02 13:37:35 -07:00
Marco
6eb05c9ed0 Small fix to segment check in pickmode.
Change-Id: Id5fd82a504def2523292466fbaad5dade9424c72
2015-04-02 09:55:13 -07:00
Johann
bc98e93b53 Remove PPC build support
There are no functional optimizations for AltiVec/PPC

Change-Id: I6877a7a9739017fe36fc769be22679c65ea99976
2015-04-02 09:13:59 -07:00
James Zern
b8a1de86fd Merge "vp9/neon: skip some files in high-bitdepth build" 2015-04-01 23:36:56 -07:00
James Zern
b644384bb5 Merge "vp9: fix high-bitdepth NEON build" 2015-04-01 23:36:17 -07:00
Yaowu Xu
54210f706c Merge "use MAX_MB_PLANE consistently" 2015-04-01 18:24:39 -07:00
hkuang
f3bea3de5b Remove unnecessary set postproc flags.
Change-Id: Iaf136969bc368a890f9671647576ee9d54eef03b
2015-04-01 17:11:35 -07:00
hkuang
4cf68be17a Merge "Fix 10-bit video decode failure with --frame-parallel mode." 2015-04-01 17:07:58 -07:00
Jingning Han
2149f214d5 Merge "Reduce required xmm number by one in block_error_fp" 2015-04-01 15:46:22 -07:00
Yaowu Xu
f26b8c84f8 use MAX_MB_PLANE consistently
Change-Id: Ic416a7f145001a88f5a7f70dde9b1edbc1b69381
2015-04-01 15:21:20 -07:00
Jingning Han
f2cf3c06a0 Reduce required xmm number by one in block_error_fp
Use 6 xmms instead of 8.

Change-Id: If976ad85d09191d2fb0565399d690f2869dbbcc7
2015-04-01 12:07:35 -07:00
hkuang
1582ac851f Fix 10-bit video decode failure with --frame-parallel mode.
Also add unit test to avoid same error in the future.

Issue:981

Change-Id: Iaf9889d8d5514cfdff1ea098e6ae133be56d501f
2015-04-01 09:19:35 -07:00
James Zern
14e24a1297 vp9: enable sse4 sad functions
sse4 isn't set by configure or used in rtcd, correct the sad entries to
use sse4_1 without changing the signatures for now.
this was done in vp8 post-vp9 branch.

Change-Id: Ia9f1fff9f2476fdfa53ed022778dd2f708caa271
2015-03-31 21:00:55 -07:00
James Zern
a98f6c0254 vp9/neon: skip some files in high-bitdepth build
exclude files that only contain functions for non-high-bitdepth builds.
this removes some warnings related to missing prototypes

Change-Id: Ic6642998c46a7b808c6c53b2f9c34bcd4d037abe
2015-03-31 18:06:21 -07:00
James Zern
8845334097 vp9: fix high-bitdepth NEON build
remove incorrect specializations in rtcd and update a configuration
check in partial_idct_test.cc

Change-Id: I20f551f38ce502092b476fb16d3ca0969dba56f0
2015-03-31 17:45:25 -07:00
Johann
bb5a39c1a7 Prepare Release Candidate for libvpx v1.4.0
Change-Id: I9ffd30c88a5e40c555bde1f5efcf8a3c9ffcf5ff
2015-03-23 23:54:52 -07:00
James Zern
19b4dead25 vp8cx.h: vpx/vpx_encoder.h -> ./vpx_encoder.h
this matches the other includes and simplifies include paths in builds
from source

(cherry picked from commit 7999c07697740387a48783de1902a1f465dabeb0)

Change-Id: I344902c84f688ef93c9f3a53e7c06c30db49d8d3
2015-03-23 17:21:27 -07:00
James Zern
14bc773199 sixtap_predict_test: enable NEON tests
the offending assembly code was deleted in:
08e38f0 VP8 for ARMv8 by using NEON intrinsics 14

the intrinsics currently pass.

fixes issue #725

Change-Id: I43e4263bef21f9d9008c51ffdfa39fcf10b8e776
2014-11-05 18:10:59 -08:00
1208 changed files with 267660 additions and 220241 deletions

109
.clang-format Normal file
View File

@ -0,0 +1,109 @@
---
Language: Cpp
# BasedOnStyle: Google
# Generated with clang-format 5.0.0
AccessModifierOffset: -1
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
AlignEscapedNewlines: Left
AlignOperands: true
AlignTrailingComments: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: true
AllowShortFunctionsOnASingleLine: All
AllowShortIfStatementsOnASingleLine: true
AllowShortLoopsOnASingleLine: true
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: true
AlwaysBreakTemplateDeclarations: true
BinPackArguments: true
BinPackParameters: true
BraceWrapping:
AfterClass: false
AfterControlStatement: false
AfterEnum: false
AfterFunction: false
AfterNamespace: false
AfterObjCDeclaration: false
AfterStruct: false
AfterUnion: false
BeforeCatch: false
BeforeElse: false
IndentBraces: false
SplitEmptyFunction: true
SplitEmptyRecord: true
SplitEmptyNamespace: true
BreakBeforeBinaryOperators: None
BreakBeforeBraces: Attach
BreakBeforeInheritanceComma: false
BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma: false
BreakConstructorInitializers: BeforeColon
BreakAfterJavaFieldAnnotations: false
BreakStringLiterals: true
ColumnLimit: 80
CommentPragmas: '^ IWYU pragma:'
CompactNamespaces: false
ConstructorInitializerAllOnOneLineOrOnePerLine: false
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: false
DerivePointerAlignment: false
DisableFormat: false
ExperimentalAutoDetectBinPacking: false
FixNamespaceComments: true
ForEachMacros:
- foreach
- Q_FOREACH
- BOOST_FOREACH
IncludeCategories:
- Regex: '^<.*\.h>'
Priority: 1
- Regex: '^<.*'
Priority: 2
- Regex: '.*'
Priority: 3
IncludeIsMainRegex: '([-_](test|unittest))?$'
IndentCaseLabels: true
IndentWidth: 2
IndentWrappedFunctionNames: false
JavaScriptQuotes: Leave
JavaScriptWrapImports: true
KeepEmptyLinesAtTheStartOfBlocks: false
MacroBlockBegin: ''
MacroBlockEnd: ''
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
ObjCBlockIndentWidth: 2
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: false
PenaltyBreakAssignment: 2
PenaltyBreakBeforeFirstCallParameter: 1
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakString: 1000
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 200
PointerAlignment: Right
ReflowComments: true
SortIncludes: false
SortUsingDeclarations: true
SpaceAfterCStyleCast: false
SpaceAfterTemplateKeyword: true
SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: ControlStatements
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 2
SpacesInAngles: false
SpacesInContainerLiterals: true
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: Auto
TabWidth: 8
UseTab: Never
...

12
.gitignore vendored
View File

@ -30,14 +30,17 @@
/examples/decode_with_partial_drops
/examples/example_xma
/examples/postproc
/examples/resize_util
/examples/set_maps
/examples/simple_decoder
/examples/simple_encoder
/examples/twopass_encoder
/examples/vp8_multi_resolution_encoder
/examples/vp8cx_set_ref
/examples/vp9_spatial_scalable_encoder
/examples/vpx_temporal_scalable_patterns
/examples/vp9cx_set_ref
/examples/vp9_lossless_encoder
/examples/vp9_spatial_svc_encoder
/examples/vpx_temporal_svc_encoder
/ivfdec
/ivfdec.dox
/ivfenc
@ -45,12 +48,17 @@
/libvpx.so*
/libvpx.ver
/samples.dox
/test_intra_pred_speed
/test_libvpx
/tools.dox
/tools/*.dox
/tools/tiny_ssim
/vp8_api1_migration.dox
/vp[89x]_rtcd.h
/vpx.pc
/vpx_config.c
/vpx_config.h
/vpx_dsp_rtcd.h
/vpx_scale_rtcd.h
/vpx_version.h
/vpxdec

View File

@ -1,18 +1,42 @@
Adrian Grange <agrange@google.com>
Aex Converse <aconverse@google.com>
Aex Converse <aconverse@google.com> <alex.converse@gmail.com>
Alexis Ballier <aballier@gentoo.org> <alexis.ballier@gmail.com>
Alpha Lam <hclam@google.com> <hclam@chromium.org>
Chris Cunningham <chcunningham@chromium.org>
Daniele Castagna <dcastagna@chromium.org> <dcastagna@google.com>
Deb Mukherjee <debargha@google.com>
Erik Niemeyer <erik.a.niemeyer@intel.com> <erik.a.niemeyer@gmail.com>
Guillaume Martres <gmartres@google.com> <smarter3@gmail.com>
Hangyu Kuang <hkuang@google.com>
Hui Su <huisu@google.com>
Jacky Chen <jackychen@google.com>
Jim Bankoski <jimbankoski@google.com>
John Koleszar <jkoleszar@google.com>
Johann Koenig <johannkoenig@google.com>
Johann Koenig <johannkoenig@google.com> <johann.koenig@duck.com>
Johann Koenig <johannkoenig@google.com> <johannkoenig@dhcp-172-19-7-52.mtv.corp.google.com>
Johann Koenig <johannkoenig@google.com> <johann.koenig@gmail.com>
Johann Koenig <johannkoenig@google.com> <johannkoenig@chromium.org>
John Koleszar <jkoleszar@google.com>
Joshua Litt <joshualitt@google.com> <joshualitt@chromium.org>
Marco Paniconi <marpan@google.com>
Marco Paniconi <marpan@google.com> <marpan@chromium.org>
Pascal Massimino <pascal.massimino@gmail.com>
Sami Pietilä <samipietila@google.com>
Tero Rintaluoma <teror@google.com> <tero.rintaluoma@on2.com>
Timothy B. Terriberry <tterribe@xiph.org> Tim Terriberry <tterriberry@mozilla.com>
Tom Finegan <tomfinegan@google.com>
Paul Wilkins <paulwilkins@google.com>
Peter Boström <pbos@chromium.org> <pbos@google.com>
Peter de Rivaz <peter.derivaz@gmail.com>
Peter de Rivaz <peter.derivaz@gmail.com> <peter.derivaz@argondesign.com>
Ralph Giles <giles@xiph.org> <giles@entropywave.com>
Ralph Giles <giles@xiph.org> <giles@mozilla.com>
Alpha Lam <hclam@google.com> <hclam@chromium.org>
Deb Mukherjee <debargha@google.com>
Ronald S. Bultje <rsbultje@gmail.com> <rbultje@google.com>
Sami Pietilä <samipietila@google.com>
Shiyou Yin <yinshiyou-hf@loongson.cn>
Tamar Levy <tamar.levy@intel.com>
Tamar Levy <tamar.levy@intel.com> <levytamar82@gmail.com>
Tero Rintaluoma <teror@google.com> <tero.rintaluoma@on2.com>
Timothy B. Terriberry <tterribe@xiph.org> <tterriberry@mozilla.com>
Tom Finegan <tomfinegan@google.com>
Tom Finegan <tomfinegan@google.com> <tomfinegan@chromium.org>
Urvang Joshi <urvang@google.com> <urvang@chromium.org>
Yaowu Xu <yaowu@google.com> <adam@xuyaowu.com>
Yaowu Xu <yaowu@google.com> <yaowu@xuyaowu.com>
Yaowu Xu <yaowu@google.com> <Yaowu Xu>

76
AUTHORS
View File

@ -4,9 +4,12 @@
Aaron Watry <awatry@gmail.com>
Abo Talib Mahfoodh <ab.mahfoodh@gmail.com>
Adrian Grange <agrange@google.com>
Aex Converse <aconverse@google.com>
Ahmad Sharif <asharif@google.com>
Aleksey Vasenev <margtu-fivt@ya.ru>
Alexander Potapenko <glider@google.com>
Alexander Voronov <avoronov@graphics.cs.msu.ru>
Alex Converse <alex.converse@gmail.com>
Alexandra Hájková <alexandra.khirnova@gmail.com>
Alexis Ballier <aballier@gentoo.org>
Alok Ahuja <waveletcoeff@gmail.com>
Alpha Lam <hclam@google.com>
@ -14,44 +17,80 @@ A.Mahfoodh <ab.mahfoodh@gmail.com>
Ami Fischman <fischman@chromium.org>
Andoni Morales Alastruey <ylatuya@gmail.com>
Andres Mejia <mcitadel@gmail.com>
Andrew Lewis <andrewlewis@google.com>
Andrew Russell <anrussell@google.com>
Angie Chiang <angiebird@google.com>
Aron Rosenberg <arosenberg@logitech.com>
Attila Nagy <attilanagy@google.com>
Brion Vibber <bvibber@wikimedia.org>
changjun.yang <changjun.yang@intel.com>
Charles 'Buck' Krasic <ckrasic@google.com>
Cheng Chen <chengchen@google.com>
chm <chm@rock-chips.com>
Chris Cunningham <chcunningham@chromium.org>
Christian Duvivier <cduvivier@google.com>
Daniele Castagna <dcastagna@chromium.org>
Daniel Kang <ddkang@google.com>
Deb Mukherjee <debargha@google.com>
Deepa K G <deepa.kg@ittiam.com>
Dim Temp <dimtemp0@gmail.com>
Dmitry Kovalev <dkovalev@google.com>
Dragan Mrdjan <dmrdjan@mips.com>
Erik Niemeyer <erik.a.niemeyer@gmail.com>
Ed Baker <edward.baker@intel.com>
Ehsan Akhgari <ehsan.akhgari@gmail.com>
Erik Niemeyer <erik.a.niemeyer@intel.com>
Fabio Pedretti <fabio.ped@libero.it>
Frank Galligan <fgalligan@google.com>
Fredrik Söderquist <fs@opera.com>
Fritz Koenig <frkoenig@google.com>
Gabriel Marin <gmx@chromium.org>
Gaute Strokkenes <gaute.strokkenes@broadcom.com>
Geza Lore <gezalore@gmail.com>
Ghislain MARY <ghislainmary2@gmail.com>
Giuseppe Scrivano <gscrivano@gnu.org>
Gordana Cmiljanovic <gordana.cmiljanovic@imgtec.com>
Gregor Jasny <gjasny@gmail.com>
Guillaume Martres <gmartres@google.com>
Guillermo Ballester Valor <gbvalor@gmail.com>
Hangyu Kuang <hkuang@google.com>
Hanno Böck <hanno@hboeck.de>
Han Shen <shenhan@google.com>
Henrik Lundin <hlundin@google.com>
Hui Su <huisu@google.com>
Ivan Krasin <krasin@chromium.org>
Ivan Maltz <ivanmaltz@google.com>
Jacek Caban <cjacek@gmail.com>
Jacky Chen <jackychen@google.com>
James Berry <jamesberry@google.com>
James Yu <james.yu@linaro.org>
James Zern <jzern@google.com>
Jan Gerber <j@mailb.org>
Jan Kratochvil <jan.kratochvil@redhat.com>
Janne Salonen <jsalonen@google.com>
Jean-Yves Avenard <jyavenard@mozilla.com>
Jeff Faust <jfaust@google.com>
Jeff Muizelaar <jmuizelaar@mozilla.com>
Jeff Petkau <jpet@chromium.org>
Jerome Jiang <jianj@google.com>
Jia Jia <jia.jia@linaro.org>
Jian Zhou <zhoujian@google.com>
Jim Bankoski <jimbankoski@google.com>
Jingning Han <jingning@google.com>
Joey Parrish <joeyparrish@google.com>
Johann Koenig <johannkoenig@google.com>
John Koleszar <jkoleszar@google.com>
Johnny Klonaris <google@jawknee.com>
John Stark <jhnstrk@gmail.com>
Joshua Bleecher Snyder <josh@treelinelabs.com>
Joshua Litt <joshualitt@google.com>
Julia Robson <juliamrobson@gmail.com>
Justin Clift <justin@salasaga.org>
Justin Lebar <justin.lebar@gmail.com>
Kaustubh Raste <kaustubh.raste@imgtec.com>
KO Myung-Hun <komh@chollian.net>
Kyle Siefring <kylesiefring@gmail.com>
Lawrence Velázquez <larryv@macports.org>
Linfeng Zhang <linfengz@google.com>
Lou Quillio <louquillio@google.com>
Luca Barbato <lu_zero@gentoo.org>
Makoto Kato <makoto.kt@gmail.com>
@ -65,36 +104,67 @@ Michael Kohler <michaelkohler@live.com>
Mike Frysinger <vapier@chromium.org>
Mike Hommey <mhommey@mozilla.com>
Mikhal Shemer <mikhal@google.com>
Min Chen <chenm003@gmail.com>
Minghai Shang <minghai@google.com>
Min Ye <yeemmi@google.com>
Moriyoshi Koizumi <mozo@mozo.jp>
Morton Jonuschat <yabawock@gmail.com>
Nathan E. Egge <negge@mozilla.com>
Nico Weber <thakis@chromium.org>
Parag Salasakar <img.mips1@gmail.com>
Pascal Massimino <pascal.massimino@gmail.com>
Patrik Westin <patrik.westin@gmail.com>
Paul Wilkins <paulwilkins@google.com>
Pavol Rusnak <stick@gk2.sk>
Paweł Hajdan <phajdan@google.com>
Pengchong Jin <pengchong@google.com>
Peter Boström <pbos@chromium.org>
Peter Collingbourne <pcc@chromium.org>
Peter de Rivaz <peter.derivaz@gmail.com>
Philip Jägenstedt <philipj@opera.com>
Priit Laes <plaes@plaes.org>
Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
Rafaël Carré <funman@videolan.org>
Rafael de Lucena Valle <rafaeldelucena@gmail.com>
Rahul Chaudhry <rahulchaudhry@google.com>
Ralph Giles <giles@xiph.org>
Ranjit Kumar Tulabandu <ranjit.tulabandu@ittiam.com>
Rob Bradford <rob@linux.intel.com>
Ronald S. Bultje <rbultje@google.com>
Ronald S. Bultje <rsbultje@gmail.com>
Rui Ueyama <ruiu@google.com>
Sami Pietilä <samipietila@google.com>
Sarah Parker <sarahparker@google.com>
Sasi Inguva <isasi@google.com>
Scott Graham <scottmg@chromium.org>
Scott LaVarnway <slavarnway@google.com>
Sean McGovern <gseanmcg@gmail.com>
Sergey Kolomenkin <kolomenkin@gmail.com>
Sergey Ulanov <sergeyu@chromium.org>
Shimon Doodkin <helpmepro1@gmail.com>
Shiyou Yin <yinshiyou-hf@loongson.cn>
Shunyao Li <shunyaoli@google.com>
Stefan Holmer <holmer@google.com>
Suman Sunkara <sunkaras@google.com>
Sylvestre Ledru <sylvestre@mozilla.com>
Taekhyun Kim <takim@nvidia.com>
Takanori MATSUURA <t.matsuu@gmail.com>
Tamar Levy <tamar.levy@intel.com>
Tao Bai <michaelbai@chromium.org>
Tero Rintaluoma <teror@google.com>
Thijs Vermeir <thijsvermeir@gmail.com>
Tim Kopp <tkopp@google.com>
Timothy B. Terriberry <tterribe@xiph.org>
Tom Finegan <tomfinegan@google.com>
Tristan Matthews <le.businessman@gmail.com>
Urvang Joshi <urvang@google.com>
Vignesh Venkatasubramanian <vigneshv@google.com>
Vlad Tsyrklevich <vtsyrklevich@chromium.org>
Yaowu Xu <yaowu@google.com>
Yi Luo <luoyi@google.com>
Yongzhe Wang <yongzhe@google.com>
Yunqing Wang <yunqingwang@google.com>
Yury Gitman <yuryg@google.com>
Zoe Liu <zoeliu@google.com>
Google Inc.
The Mozilla Foundation
The Xiph.Org Foundation

111
CHANGELOG
View File

@ -1,3 +1,114 @@
2017-01-04 v1.7.0 "Mandarin Duck"
This release focused on high bit depth performance (10/12 bit) and vp9
encoding improvements.
- Upgrading:
This release is ABI incompatible due to new vp9 encoder features.
Frame parallel decoding for vp9 has been removed.
- Enhancements:
vp9 encoding supports additional threads with --row-mt. This can be greater
than the number of tiles.
Two new vp9 encoder options have been added:
--corpus-complexity
--tune-content=film
Additional tooling for respecting the vp9 "level" profiles has been added.
- Bug fixes:
A variety of fuzzing issues.
vp8 threading fix for ARM.
Codec control VP9_SET_SKIP_LOOP_FILTER fixed.
Reject invalid multi resolution configurations.
2017-01-09 v1.6.1 "Long Tailed Duck"
This release improves upon the VP9 encoder and speeds up the encoding and
decoding processes.
- Upgrading:
This release is ABI compatible with 1.6.0.
- Enhancements:
Faster VP9 encoding and decoding.
High bit depth builds now provide similar speed for 8 bit encode and decode
for x86 targets. Other platforms and higher bit depth improvements are in
progress.
- Bug Fixes:
A variety of fuzzing issues.
2016-07-20 v1.6.0 "Khaki Campbell Duck"
This release improves upon the VP9 encoder and speeds up the encoding and
decoding processes.
- Upgrading:
This release is ABI incompatible with 1.5.0 due to a new 'color_range' enum
in vpx_image and some minor changes to the VP8_COMP structure.
The default key frame interval for VP9 has changed from 128 to 9999.
- Enhancement:
A core focus has been performance for low end Intel processors. SSSE3
instructions such as 'pshufb' have been avoided and instructions have been
reordered to better accommodate the more constrained pipelines.
As a result, devices based on Celeron processors have seen substantial
decoding improvements. From Indian Runner Duck to Javan Whistling Duck,
decoding speed improved between 10 and 30%. Between Javan Whistling Duck
and Khaki Campbell Duck, it improved another 10 to 15%.
While Celeron benefited most, Core-i5 also improved 5% and 10% between the
respective releases.
Realtime performance for WebRTC for both speed and quality has received a
lot of attention.
- Bug Fixes:
A number of fuzzing issues, found variously by Mozilla, Chromium and others,
have been fixed and we strongly recommend updating.
2015-11-09 v1.5.0 "Javan Whistling Duck"
This release improves upon the VP9 encoder and speeds up the encoding and
decoding processes.
- Upgrading:
This release is ABI incompatible with 1.4.0. It drops deprecated VP8
controls and adds a variety of VP9 controls for testing.
The vpxenc utility now prefers VP9 by default.
- Enhancements:
Faster VP9 encoding and decoding
Smaller library size by combining functions used by VP8 and VP9
- Bug Fixes:
A variety of fuzzing issues
2015-04-03 v1.4.0 "Indian Runner Duck"
This release includes significant improvements to the VP9 codec.
- Upgrading:
This release is ABI incompatible with 1.3.0. It drops the compatibility
layer, requiring VPX_IMG_FMT_* instead of IMG_FMT_*, and adds several codec
controls for VP9.
- Enhancements:
Faster VP9 encoding and decoding
Multithreaded VP9 decoding (tile and frame-based)
Multithreaded VP9 encoding - on by default
YUV 4:2:2 and 4:4:4 support in VP9
10 and 12bit support in VP9
64bit ARM support by replacing ARM assembly with intrinsics
- Bug Fixes:
Fixes a VP9 bitstream issue in Profile 1. This only affected non-YUV 4:2:0
files.
- Known Issues:
Frame Parallel decoding fails for segmented and non-420 files.
2013-11-15 v1.3.0 "Forest"
This release introduces the VP9 codec in a backward-compatible way.
All existing users of VP8 can continue to use the library without

View File

@ -17,7 +17,7 @@ or agree to the institution of patent litigation or any other patent
enforcement activity against any entity (including a cross-claim or
counterclaim in a lawsuit) alleging that any of these implementations of WebM
or any code incorporated within any of these implementations of WebM
constitutes direct or contributory patent infringement, or inducement of
constitute direct or contributory patent infringement, or inducement of
patent infringement, then any patent rights granted to you under this License
for these implementations of WebM shall terminate as of the date such
litigation is filed.

91
README
View File

@ -1,4 +1,4 @@
README - 30 May 2014
README - 24 January 2018
Welcome to the WebM VP8/VP9 Codec SDK!
@ -9,22 +9,26 @@ COMPILING THE APPLICATIONS/LIBRARIES:
1. Prerequisites
* All x86 targets require the Yasm[1] assembler be installed.
* All Windows builds require that Cygwin[2] be installed.
* Building the documentation requires Doxygen[3]. If you do not
* All x86 targets require the Yasm[1] assembler be installed[2].
* All Windows builds require that Cygwin[3] be installed.
* Building the documentation requires Doxygen[4]. If you do not
have this package, the install-docs option will be disabled.
* Downloading the data for the unit tests requires curl[4] and sha1sum.
* Downloading the data for the unit tests requires curl[5] and sha1sum.
sha1sum is provided via the GNU coreutils, installed by default on
many *nix platforms, as well as MinGW and Cygwin. If coreutils is not
available, a compatible version of sha1sum can be built from
source[5]. These requirements are optional if not running the unit
source[6]. These requirements are optional if not running the unit
tests.
[1]: http://www.tortall.net/projects/yasm
[2]: http://www.cygwin.com
[3]: http://www.doxygen.org
[4]: http://curl.haxx.se
[5]: http://www.microbrew.org/tools/md5sha1sum/
[2]: For Visual Studio the base yasm binary (not vsyasm) should be in the
PATH for Visual Studio. For VS2017 it is sufficient to rename
yasm-<version>-<arch>.exe to yasm.exe and place it in:
Program Files (x86)/Microsoft Visual Studio/2017/<level>/Common7/Tools/
[3]: http://www.cygwin.com
[4]: http://www.doxygen.org
[5]: http://curl.haxx.se
[6]: http://www.microbrew.org/tools/md5sha1sum/
2. Out-of-tree builds
Out of tree builds are a supported method of building the application. For
@ -41,17 +45,24 @@ COMPILING THE APPLICATIONS/LIBRARIES:
used to get a list of supported options:
$ ../libvpx/configure --help
4. Cross development
4. Compiler analyzers
Compilers have added sanitizers which instrument binaries with information
about address calculation, memory usage, threading, undefined behavior, and
other common errors. To simplify building libvpx with some of these features
use tools/set_analyzer_env.sh before running configure. It will set the
compiler and necessary flags for building as well as environment variables
read by the analyzer when testing the binaries.
$ source ../libvpx/tools/set_analyzer_env.sh address
5. Cross development
For cross development, the most notable option is the --target option. The
most up-to-date list of supported targets can be found at the bottom of the
--help output of the configure script. As of this writing, the list of
available targets is:
armv6-darwin-gcc
armv6-linux-rvct
armv6-linux-gcc
armv6-none-rvct
arm64-android-gcc
arm64-darwin-gcc
arm64-linux-gcc
armv7-android-gcc
armv7-darwin-gcc
armv7-linux-rvct
@ -59,15 +70,14 @@ COMPILING THE APPLICATIONS/LIBRARIES:
armv7-none-rvct
armv7-win32-vs11
armv7-win32-vs12
armv7-win32-vs14
armv7-win32-vs15
armv7s-darwin-gcc
armv8-linux-gcc
mips32-linux-gcc
mips64-linux-gcc
ppc32-darwin8-gcc
ppc32-darwin9-gcc
ppc32-linux-gcc
ppc64-darwin8-gcc
ppc64-darwin9-gcc
ppc64-linux-gcc
ppc64le-linux-gcc
sparc-solaris-gcc
x86-android-gcc
x86-darwin8-gcc
@ -78,39 +88,39 @@ COMPILING THE APPLICATIONS/LIBRARIES:
x86-darwin11-gcc
x86-darwin12-gcc
x86-darwin13-gcc
x86-darwin14-gcc
x86-darwin15-gcc
x86-darwin16-gcc
x86-iphonesimulator-gcc
x86-linux-gcc
x86-linux-icc
x86-os2-gcc
x86-solaris-gcc
x86-win32-gcc
x86-win32-vs7
x86-win32-vs8
x86-win32-vs9
x86-win32-vs10
x86-win32-vs11
x86-win32-vs12
x86-win32-vs14
x86-win32-vs15
x86_64-android-gcc
x86_64-darwin9-gcc
x86_64-darwin10-gcc
x86_64-darwin11-gcc
x86_64-darwin12-gcc
x86_64-darwin13-gcc
x86_64-darwin14-gcc
x86_64-darwin15-gcc
x86_64-darwin16-gcc
x86_64-iphonesimulator-gcc
x86_64-linux-gcc
x86_64-linux-icc
x86_64-solaris-gcc
x86_64-win64-gcc
x86_64-win64-vs8
x86_64-win64-vs9
x86_64-win64-vs10
x86_64-win64-vs11
x86_64-win64-vs12
universal-darwin8-gcc
universal-darwin9-gcc
universal-darwin10-gcc
universal-darwin11-gcc
universal-darwin12-gcc
universal-darwin13-gcc
x86_64-win64-vs14
x86_64-win64-vs15
generic-gnu
The generic-gnu target, in conjunction with the CROSS environment variable,
@ -126,7 +136,7 @@ COMPILING THE APPLICATIONS/LIBRARIES:
environment variables: CC, AR, LD, AS, STRIP, NM. Additional flags can be
passed to these executables with CFLAGS, LDFLAGS, and ASFLAGS.
5. Configuration errors
6. Configuration errors
If the configuration step fails, the first step is to look in the error log.
This defaults to config.log. This should give a good indication of what went
wrong. If not, contact us for support.
@ -139,7 +149,22 @@ VP8/VP9 TEST VECTORS:
$ ./configure --enable-unit-tests
$ LIBVPX_TEST_DATA_PATH=../libvpx-test-data make testdata
CODE STYLE:
The coding style used by this project is enforced with clang-format using the
configuration contained in the .clang-format file in the root of the
repository.
Before pushing changes for review you can format your code with:
# Apply clang-format to modified .c, .h and .cc files
$ clang-format -i --style=file \
$(git diff --name-only --diff-filter=ACMR '*.[hc]' '*.cc')
Check the .clang-format file for the version used to generate it if there is
any difference between your local formatting and the review system.
See also: http://clang.llvm.org/docs/ClangFormat.html
SUPPORT
This library is an open source project supported by its community. Please
please email webm-discuss@webmproject.org for help.
email webm-discuss@webmproject.org for help.

129
args.c
View File

@ -8,15 +8,13 @@
* be found in the AUTHORS file in the root of the source tree.
*/
#include <stdlib.h>
#include <string.h>
#include <limits.h>
#include "args.h"
#ifdef _MSC_VER
#define snprintf _snprintf
#endif
#include "vpx/vpx_integer.h"
#include "vpx_ports/msvc.h"
#if defined(__GNUC__) && __GNUC__
extern void die(const char *fmt, ...) __attribute__((noreturn));
@ -24,42 +22,36 @@ extern void die(const char *fmt, ...) __attribute__((noreturn));
extern void die(const char *fmt, ...);
#endif
struct arg arg_init(char **argv) {
struct arg a;
a.argv = argv;
a.argv = argv;
a.argv_step = 1;
a.name = NULL;
a.val = NULL;
a.def = NULL;
a.name = NULL;
a.val = NULL;
a.def = NULL;
return a;
}
int arg_match(struct arg *arg_, const struct arg_def *def, char **argv) {
struct arg arg;
if (!argv[0] || argv[0][0] != '-')
return 0;
if (!argv[0] || argv[0][0] != '-') return 0;
arg = arg_init(argv);
if (def->short_name
&& strlen(arg.argv[0]) == strlen(def->short_name) + 1
&& !strcmp(arg.argv[0] + 1, def->short_name)) {
if (def->short_name && strlen(arg.argv[0]) == strlen(def->short_name) + 1 &&
!strcmp(arg.argv[0] + 1, def->short_name)) {
arg.name = arg.argv[0] + 1;
arg.val = def->has_val ? arg.argv[1] : NULL;
arg.argv_step = def->has_val ? 2 : 1;
} else if (def->long_name) {
const size_t name_len = strlen(def->long_name);
if (strlen(arg.argv[0]) >= name_len + 2
&& arg.argv[0][1] == '-'
&& !strncmp(arg.argv[0] + 2, def->long_name, name_len)
&& (arg.argv[0][name_len + 2] == '='
|| arg.argv[0][name_len + 2] == '\0')) {
if (strlen(arg.argv[0]) >= name_len + 2 && arg.argv[0][1] == '-' &&
!strncmp(arg.argv[0] + 2, def->long_name, name_len) &&
(arg.argv[0][name_len + 2] == '=' ||
arg.argv[0][name_len + 2] == '\0')) {
arg.name = arg.argv[0] + 2;
arg.val = arg.name[name_len] == '=' ? arg.name + name_len + 1 : NULL;
arg.argv_step = 1;
@ -72,8 +64,7 @@ int arg_match(struct arg *arg_, const struct arg_def *def, char **argv) {
if (arg.name && arg.val && !def->has_val)
die("Error: option %s requires no argument.\n", arg.name);
if (arg.name
&& (arg.val || !def->has_val)) {
if (arg.name && (arg.val || !def->has_val)) {
arg.def = def;
*arg_ = arg;
return 1;
@ -82,15 +73,12 @@ int arg_match(struct arg *arg_, const struct arg_def *def, char **argv) {
return 0;
}
const char *arg_next(struct arg *arg) {
if (arg->argv[0])
arg->argv += arg->argv_step;
if (arg->argv[0]) arg->argv += arg->argv_step;
return *arg->argv;
}
char **argv_dup(int argc, const char **argv) {
char **new_argv = malloc((argc + 1) * sizeof(*argv));
@ -99,9 +87,8 @@ char **argv_dup(int argc, const char **argv) {
return new_argv;
}
void arg_show_usage(FILE *fp, const struct arg_def *const *defs) {
char option_text[40] = {0};
char option_text[40] = { 0 };
for (; *defs; defs++) {
const struct arg_def *def = *defs;
@ -111,15 +98,12 @@ void arg_show_usage(FILE *fp, const struct arg_def *const *defs) {
if (def->short_name && def->long_name) {
char *comma = def->has_val ? "," : ", ";
snprintf(option_text, 37, "-%s%s%s --%s%6s",
def->short_name, short_val, comma,
def->long_name, long_val);
snprintf(option_text, 37, "-%s%s%s --%s%6s", def->short_name, short_val,
comma, def->long_name, long_val);
} else if (def->short_name)
snprintf(option_text, 37, "-%s%s",
def->short_name, short_val);
snprintf(option_text, 37, "-%s%s", def->short_name, short_val);
else if (def->long_name)
snprintf(option_text, 37, " --%s%s",
def->long_name, long_val);
snprintf(option_text, 37, " --%s%s", def->long_name, long_val);
fprintf(fp, " %-37s\t%s\n", option_text, def->desc);
@ -129,110 +113,103 @@ void arg_show_usage(FILE *fp, const struct arg_def *const *defs) {
fprintf(fp, " %-37s\t ", "");
for (listptr = def->enums; listptr->name; listptr++)
fprintf(fp, "%s%s", listptr->name,
listptr[1].name ? ", " : "\n");
fprintf(fp, "%s%s", listptr->name, listptr[1].name ? ", " : "\n");
}
}
}
unsigned int arg_parse_uint(const struct arg *arg) {
long int rawval;
char *endptr;
uint32_t rawval;
char *endptr;
rawval = strtol(arg->val, &endptr, 10);
rawval = (uint32_t)strtoul(arg->val, &endptr, 10);
if (arg->val[0] != '\0' && endptr[0] == '\0') {
if (rawval >= 0 && rawval <= UINT_MAX)
return rawval;
if (rawval <= UINT_MAX) return rawval;
die("Option %s: Value %ld out of range for unsigned int\n",
arg->name, rawval);
die("Option %s: Value %ld out of range for unsigned int\n", arg->name,
rawval);
}
die("Option %s: Invalid character '%c'\n", arg->name, *endptr);
return 0;
}
int arg_parse_int(const struct arg *arg) {
long int rawval;
char *endptr;
int32_t rawval;
char *endptr;
rawval = strtol(arg->val, &endptr, 10);
rawval = (int32_t)strtol(arg->val, &endptr, 10);
if (arg->val[0] != '\0' && endptr[0] == '\0') {
if (rawval >= INT_MIN && rawval <= INT_MAX)
return rawval;
if (rawval >= INT_MIN && rawval <= INT_MAX) return (int)rawval;
die("Option %s: Value %ld out of range for signed int\n",
arg->name, rawval);
die("Option %s: Value %ld out of range for signed int\n", arg->name,
rawval);
}
die("Option %s: Invalid character '%c'\n", arg->name, *endptr);
return 0;
}
struct vpx_rational {
int num; /**< fraction numerator */
int den; /**< fraction denominator */
};
struct vpx_rational arg_parse_rational(const struct arg *arg) {
long int rawval;
char *endptr;
struct vpx_rational rat;
long int rawval;
char *endptr;
struct vpx_rational rat;
/* parse numerator */
rawval = strtol(arg->val, &endptr, 10);
if (arg->val[0] != '\0' && endptr[0] == '/') {
if (rawval >= INT_MIN && rawval <= INT_MAX)
rat.num = rawval;
else die("Option %s: Value %ld out of range for signed int\n",
arg->name, rawval);
} else die("Option %s: Expected / at '%c'\n", arg->name, *endptr);
rat.num = (int)rawval;
else
die("Option %s: Value %ld out of range for signed int\n", arg->name,
rawval);
} else
die("Option %s: Expected / at '%c'\n", arg->name, *endptr);
/* parse denominator */
rawval = strtol(endptr + 1, &endptr, 10);
if (arg->val[0] != '\0' && endptr[0] == '\0') {
if (rawval >= INT_MIN && rawval <= INT_MAX)
rat.den = rawval;
else die("Option %s: Value %ld out of range for signed int\n",
arg->name, rawval);
} else die("Option %s: Invalid character '%c'\n", arg->name, *endptr);
rat.den = (int)rawval;
else
die("Option %s: Value %ld out of range for signed int\n", arg->name,
rawval);
} else
die("Option %s: Invalid character '%c'\n", arg->name, *endptr);
return rat;
}
int arg_parse_enum(const struct arg *arg) {
const struct arg_enum_list *listptr;
long int rawval;
char *endptr;
long int rawval;
char *endptr;
/* First see if the value can be parsed as a raw value */
rawval = strtol(arg->val, &endptr, 10);
if (arg->val[0] != '\0' && endptr[0] == '\0') {
/* Got a raw value, make sure it's valid */
for (listptr = arg->def->enums; listptr->name; listptr++)
if (listptr->val == rawval)
return rawval;
if (listptr->val == rawval) return (int)rawval;
}
/* Next see if it can be parsed as a string */
for (listptr = arg->def->enums; listptr->name; listptr++)
if (!strcmp(arg->val, listptr->name))
return listptr->val;
if (!strcmp(arg->val, listptr->name)) return listptr->val;
die("Option %s: Invalid value '%s'\n", arg->name, arg->val);
return 0;
}
int arg_parse_enum_or_int(const struct arg *arg) {
if (arg->def->enums)
return arg_parse_enum(arg);
if (arg->def->enums) return arg_parse_enum(arg);
return arg_parse_int(arg);
}

27
args.h
View File

@ -8,7 +8,6 @@
* be found in the AUTHORS file in the root of the source tree.
*/
#ifndef ARGS_H_
#define ARGS_H_
#include <stdio.h>
@ -18,29 +17,33 @@ extern "C" {
#endif
struct arg {
char **argv;
const char *name;
const char *val;
unsigned int argv_step;
const struct arg_def *def;
char **argv;
const char *name;
const char *val;
unsigned int argv_step;
const struct arg_def *def;
};
struct arg_enum_list {
const char *name;
int val;
int val;
};
#define ARG_ENUM_LIST_END {0}
#define ARG_ENUM_LIST_END \
{ 0 }
typedef struct arg_def {
const char *short_name;
const char *long_name;
int has_val;
int has_val;
const char *desc;
const struct arg_enum_list *enums;
} arg_def_t;
#define ARG_DEF(s,l,v,d) {s,l,v,d, NULL}
#define ARG_DEF_ENUM(s,l,v,d,e) {s,l,v,d,e}
#define ARG_DEF_LIST_END {0}
#define ARG_DEF(s, l, v, d) \
{ s, l, v, d, NULL }
#define ARG_DEF_ENUM(s, l, v, d, e) \
{ s, l, v, d, e }
#define ARG_DEF_LIST_END \
{ 0 }
struct arg arg_init(char **argv);
int arg_match(struct arg *arg_, const struct arg_def *def, char **argv);

View File

@ -1,2 +0,0 @@
*-vs8/*.rules -crlf
*-msvs/*.rules -crlf

1
build/.gitignore vendored
View File

@ -1 +0,0 @@
x86*-win32-vs*

View File

@ -29,11 +29,6 @@
# include $(CLEAR_VARS)
# include jni/libvpx/build/make/Android.mk
#
# There are currently two TARGET_ARCH_ABI targets for ARM.
# armeabi and armeabi-v7a. armeabi-v7a is selected by creating an
# Application.mk in the jni directory that contains:
# APP_ABI := armeabi-v7a
#
# By default libvpx will detect at runtime the existance of NEON extension.
# For this we import the 'cpufeatures' module from the NDK sources.
# libvpx can also be configured without this runtime detection method.
@ -42,31 +37,49 @@
# --disable-neon-asm
# will remove any NEON dependency.
# To change to building armeabi, run ./libvpx/configure again, but with
# --target=armv6-android-gcc and modify the Application.mk file to
# set APP_ABI := armeabi
#
# Running ndk-build will build libvpx and include it in your project.
#
# Alternatively, building the examples and unit tests can be accomplished in the
# following way:
#
# Create a standalone toolchain from the NDK:
# https://developer.android.com/ndk/guides/standalone_toolchain.html
#
# For example - to test on arm64 devices with clang:
# $NDK/build/tools/make_standalone_toolchain.py \
# --arch arm64 --install-dir=/tmp/my-android-toolchain
# export PATH=/tmp/my-android-toolchain/bin:$PATH
# CROSS=aarch64-linux-android- CC=clang CXX=clang++ /path/to/libvpx/configure \
# --target=arm64-android-gcc
#
# Push the resulting binaries to a device and run them:
# adb push test_libvpx /data/tmp/test_libvpx
# adb shell /data/tmp/test_libvpx --gtest_filter=\*Sixtap\*
#
# Make sure to push the test data as well and set LIBVPX_TEST_DATA
CONFIG_DIR := $(LOCAL_PATH)/
LIBVPX_PATH := $(LOCAL_PATH)/libvpx
ASM_CNV_PATH_LOCAL := $(TARGET_ARCH_ABI)/ads2gas
ASM_CNV_PATH := $(LOCAL_PATH)/$(ASM_CNV_PATH_LOCAL)
ifneq ($(V),1)
qexec := @
endif
# Use the makefiles generated by upstream configure to determine which files to
# build. Also set any architecture-specific flags.
ifeq ($(TARGET_ARCH_ABI),armeabi-v7a)
include $(CONFIG_DIR)libs-armv7-android-gcc.mk
LOCAL_ARM_MODE := arm
else ifeq ($(TARGET_ARCH_ABI),armeabi)
include $(CONFIG_DIR)libs-armv6-android-gcc.mk
LOCAL_ARM_MODE := arm
else ifeq ($(TARGET_ARCH_ABI),arm64-v8a)
include $(CONFIG_DIR)libs-armv8-android-gcc.mk
include $(CONFIG_DIR)libs-arm64-android-gcc.mk
LOCAL_ARM_MODE := arm
else ifeq ($(TARGET_ARCH_ABI),x86)
include $(CONFIG_DIR)libs-x86-android-gcc.mk
else ifeq ($(TARGET_ARCH_ABI),x86_64)
include $(CONFIG_DIR)libs-x86_64-android-gcc.mk
else ifeq ($(TARGET_ARCH_ABI),mips)
include $(CONFIG_DIR)libs-mips-android-gcc.mk
else
@ -91,10 +104,10 @@ LOCAL_CFLAGS := -O3
# like x86inc.asm and x86_abi_support.asm
LOCAL_ASMFLAGS := -I$(LIBVPX_PATH)
.PRECIOUS: %.asm.s
$(ASM_CNV_PATH)/libvpx/%.asm.s: $(LIBVPX_PATH)/%.asm
@mkdir -p $(dir $@)
@$(CONFIG_DIR)$(ASM_CONVERSION) <$< > $@
.PRECIOUS: %.asm.S
$(ASM_CNV_PATH)/libvpx/%.asm.S: $(LIBVPX_PATH)/%.asm
$(qexec)mkdir -p $(dir $@)
$(qexec)$(CONFIG_DIR)$(ASM_CONVERSION) <$< > $@
# For building *_rtcd.h, which have rules in libs.mk
TGT_ISA:=$(word 1, $(subst -, ,$(TOOLCHAIN)))
@ -122,7 +135,7 @@ endif
# Pull out assembly files, splitting NEON from the rest. This is
# done to specify that the NEON assembly files use NEON assembler flags.
# x86 assembly matches %.asm, arm matches %.asm.s
# x86 assembly matches %.asm, arm matches %.asm.S
# x86:
@ -130,62 +143,86 @@ CODEC_SRCS_ASM_X86 = $(filter %.asm, $(CODEC_SRCS_UNIQUE))
LOCAL_SRC_FILES += $(foreach file, $(CODEC_SRCS_ASM_X86), libvpx/$(file))
# arm:
CODEC_SRCS_ASM_ARM_ALL = $(filter %.asm.s, $(CODEC_SRCS_UNIQUE))
CODEC_SRCS_ASM_ARM_ALL = $(filter %.asm.S, $(CODEC_SRCS_UNIQUE))
CODEC_SRCS_ASM_ARM = $(foreach v, \
$(CODEC_SRCS_ASM_ARM_ALL), \
$(if $(findstring neon,$(v)),,$(v)))
CODEC_SRCS_ASM_ADS2GAS = $(patsubst %.s, \
$(ASM_CNV_PATH_LOCAL)/libvpx/%.s, \
CODEC_SRCS_ASM_ADS2GAS = $(patsubst %.S, \
$(ASM_CNV_PATH_LOCAL)/libvpx/%.S, \
$(CODEC_SRCS_ASM_ARM))
LOCAL_SRC_FILES += $(CODEC_SRCS_ASM_ADS2GAS)
ifeq ($(TARGET_ARCH_ABI),armeabi-v7a)
ASM_INCLUDES := vpx_dsp/arm/idct_neon.asm.S
CODEC_SRCS_ASM_NEON = $(foreach v, \
$(CODEC_SRCS_ASM_ARM_ALL),\
$(if $(findstring neon,$(v)),$(v),))
CODEC_SRCS_ASM_NEON_ADS2GAS = $(patsubst %.s, \
$(ASM_CNV_PATH_LOCAL)/libvpx/%.s, \
CODEC_SRCS_ASM_NEON := $(filter-out $(addprefix %, $(ASM_INCLUDES)), \
$(CODEC_SRCS_ASM_NEON))
CODEC_SRCS_ASM_NEON_ADS2GAS = $(patsubst %.S, \
$(ASM_CNV_PATH_LOCAL)/libvpx/%.S, \
$(CODEC_SRCS_ASM_NEON))
LOCAL_SRC_FILES += $(patsubst %.s, \
%.s.neon, \
LOCAL_SRC_FILES += $(patsubst %.S, \
%.S.neon, \
$(CODEC_SRCS_ASM_NEON_ADS2GAS))
NEON_ASM_TARGETS = $(patsubst %.S, \
$(ASM_CNV_PATH)/libvpx/%.S, \
$(CODEC_SRCS_ASM_NEON))
# add a dependency to the full path to the ads2gas output to ensure the
# includes are converted first.
ifneq ($(strip $(NEON_ASM_TARGETS)),)
$(NEON_ASM_TARGETS): $(addprefix $(ASM_CNV_PATH)/libvpx/, $(ASM_INCLUDES))
endif
endif
LOCAL_CFLAGS += \
-DHAVE_CONFIG_H=vpx_config.h \
-I$(LIBVPX_PATH) \
-I$(ASM_CNV_PATH)
-I$(ASM_CNV_PATH) \
-I$(ASM_CNV_PATH)/libvpx
LOCAL_MODULE := libvpx
LOCAL_LDLIBS := -llog
ifeq ($(CONFIG_RUNTIME_CPU_DETECT),yes)
LOCAL_STATIC_LIBRARIES := cpufeatures
endif
# Add a dependency to force generation of the RTCD files.
define rtcd_dep_template
rtcd_dep_template_SRCS := $(addprefix $(LOCAL_PATH)/, $(LOCAL_SRC_FILES))
rtcd_dep_template_SRCS := $$(rtcd_dep_template_SRCS:.neon=)
ifeq ($(CONFIG_VP8), yes)
$(foreach file, $(LOCAL_SRC_FILES), $(LOCAL_PATH)/$(file)): vp8_rtcd.h
$$(rtcd_dep_template_SRCS): vp8_rtcd.h
endif
ifeq ($(CONFIG_VP9), yes)
$(foreach file, $(LOCAL_SRC_FILES), $(LOCAL_PATH)/$(file)): vp9_rtcd.h
$$(rtcd_dep_template_SRCS): vp9_rtcd.h
endif
$(foreach file, $(LOCAL_SRC_FILES), $(LOCAL_PATH)/$(file)): vpx_scale_rtcd.h
$$(rtcd_dep_template_SRCS): vpx_scale_rtcd.h
$$(rtcd_dep_template_SRCS): vpx_dsp_rtcd.h
ifeq ($(TARGET_ARCH_ABI),x86)
$(foreach file, $(LOCAL_SRC_FILES), $(LOCAL_PATH)/$(file)): vpx_config.asm
rtcd_dep_template_CONFIG_ASM_ABIS := x86 x86_64 armeabi-v7a
ifneq ($$(findstring $(TARGET_ARCH_ABI),$$(rtcd_dep_template_CONFIG_ASM_ABIS)),)
$$(rtcd_dep_template_SRCS): vpx_config.asm
endif
endef
$(eval $(call rtcd_dep_template))
.PHONY: clean
clean:
@echo "Clean: ads2gas files [$(TARGET_ARCH_ABI)]"
@$(RM) $(CODEC_SRCS_ASM_ADS2GAS) $(CODEC_SRCS_ASM_NEON_ADS2GAS)
@$(RM) -r $(ASM_CNV_PATH)
@$(RM) $(CLEAN-OBJS)
$(qexec)$(RM) $(CODEC_SRCS_ASM_ADS2GAS) $(CODEC_SRCS_ASM_NEON_ADS2GAS)
$(qexec)$(RM) -r $(ASM_CNV_PATH)
$(qexec)$(RM) $(CLEAN-OBJS)
include $(BUILD_SHARED_LIBRARY)
ifeq ($(ENABLE_SHARED),1)
LOCAL_CFLAGS += -fPIC
include $(BUILD_SHARED_LIBRARY)
else
include $(BUILD_STATIC_LIBRARY)
endif
ifeq ($(CONFIG_RUNTIME_CPU_DETECT),yes)
$(call import-module,cpufeatures)
$(call import-module,android/cpufeatures)
endif

View File

@ -22,9 +22,11 @@ clean:: .DEFAULT
exampletest: .DEFAULT
install:: .DEFAULT
test:: .DEFAULT
test-no-data-check:: .DEFAULT
testdata:: .DEFAULT
utiltest: .DEFAULT
exampletest-no-data-check utiltest-no-data-check: .DEFAULT
test_%: .DEFAULT ;
# Note: md5sum is not installed on OS X, but openssl is. Openssl may not be
# installed on cygwin, so we need to autodetect here.
@ -56,13 +58,10 @@ dist:
fi
endif
# Since we invoke make recursively for multiple targets we need to include the
# .mk file for the correct target, but only when $(target) is non-empty.
ifneq ($(target),)
# Normally, we want to build the filename from the target and the toolchain.
# This disambiguates from the $(target).mk file that exists in the source tree.
# However, the toolchain is part of the target in universal builds, so we
# don't want to include TOOLCHAIN in that case. FAT_ARCHS is used to test
# if we're in the universal case.
include $(target)$(if $(FAT_ARCHS),,-$(TOOLCHAIN)).mk
include $(target)-$(TOOLCHAIN).mk
endif
BUILD_ROOT?=.
VPATH=$(SRC_PATH_BARE)
@ -91,7 +90,7 @@ all:
.PHONY: clean
clean::
rm -f $(OBJS-yes) $(OBJS-yes:.o=.d) $(OBJS-yes:.asm.s.o=.asm.s)
rm -f $(OBJS-yes) $(OBJS-yes:.o=.d) $(OBJS-yes:.asm.S.o=.asm.S)
rm -f $(CLEAN-OBJS)
.PHONY: clean
@ -116,28 +115,36 @@ test::
testdata::
.PHONY: utiltest
utiltest:
.PHONY: test-no-data-check exampletest-no-data-check utiltest-no-data-check
test-no-data-check::
exampletest-no-data-check utiltest-no-data-check:
# Add compiler flags for intrinsic files
# Force to realign stack always on OS/2
ifeq ($(TOOLCHAIN), x86-os2-gcc)
STACKREALIGN=-mstackrealign
else
STACKREALIGN=
CFLAGS += -mstackrealign
endif
# x86[_64]
$(BUILD_PFX)%_mmx.c.d: CFLAGS += -mmmx
$(BUILD_PFX)%_mmx.c.o: CFLAGS += -mmmx
$(BUILD_PFX)%_sse2.c.d: CFLAGS += -msse2 $(STACKREALIGN)
$(BUILD_PFX)%_sse2.c.o: CFLAGS += -msse2 $(STACKREALIGN)
$(BUILD_PFX)%_sse3.c.d: CFLAGS += -msse3 $(STACKREALIGN)
$(BUILD_PFX)%_sse3.c.o: CFLAGS += -msse3 $(STACKREALIGN)
$(BUILD_PFX)%_ssse3.c.d: CFLAGS += -mssse3 $(STACKREALIGN)
$(BUILD_PFX)%_ssse3.c.o: CFLAGS += -mssse3 $(STACKREALIGN)
$(BUILD_PFX)%_sse4.c.d: CFLAGS += -msse4.1 $(STACKREALIGN)
$(BUILD_PFX)%_sse4.c.o: CFLAGS += -msse4.1 $(STACKREALIGN)
$(BUILD_PFX)%_avx.c.d: CFLAGS += -mavx $(STACKREALIGN)
$(BUILD_PFX)%_avx.c.o: CFLAGS += -mavx $(STACKREALIGN)
$(BUILD_PFX)%_avx2.c.d: CFLAGS += -mavx2 $(STACKREALIGN)
$(BUILD_PFX)%_avx2.c.o: CFLAGS += -mavx2 $(STACKREALIGN)
$(BUILD_PFX)%_sse2.c.d: CFLAGS += -msse2
$(BUILD_PFX)%_sse2.c.o: CFLAGS += -msse2
$(BUILD_PFX)%_sse3.c.d: CFLAGS += -msse3
$(BUILD_PFX)%_sse3.c.o: CFLAGS += -msse3
$(BUILD_PFX)%_ssse3.c.d: CFLAGS += -mssse3
$(BUILD_PFX)%_ssse3.c.o: CFLAGS += -mssse3
$(BUILD_PFX)%_sse4.c.d: CFLAGS += -msse4.1
$(BUILD_PFX)%_sse4.c.o: CFLAGS += -msse4.1
$(BUILD_PFX)%_avx.c.d: CFLAGS += -mavx
$(BUILD_PFX)%_avx.c.o: CFLAGS += -mavx
$(BUILD_PFX)%_avx2.c.d: CFLAGS += -mavx2
$(BUILD_PFX)%_avx2.c.o: CFLAGS += -mavx2
$(BUILD_PFX)%_avx512.c.d: CFLAGS += -mavx512f -mavx512cd -mavx512bw -mavx512dq -mavx512vl
$(BUILD_PFX)%_avx512.c.o: CFLAGS += -mavx512f -mavx512cd -mavx512bw -mavx512dq -mavx512vl
# POWER
$(BUILD_PFX)%_vsx.c.d: CFLAGS += -maltivec -mvsx
$(BUILD_PFX)%_vsx.c.o: CFLAGS += -maltivec -mvsx
$(BUILD_PFX)%.c.d: %.c
$(if $(quiet),@echo " [DEP] $@")
@ -180,13 +187,13 @@ $(BUILD_PFX)%.asm.o: %.asm
$(qexec)$(if $(CONFIG_DEPENDENCY_TRACKING),,mkdir -p $(dir $@))
$(qexec)$(AS) $(ASFLAGS) -o $@ $<
$(BUILD_PFX)%.s.d: %.s
$(BUILD_PFX)%.S.d: %.S
$(if $(quiet),@echo " [DEP] $@")
$(qexec)mkdir -p $(dir $@)
$(qexec)$(SRC_PATH_BARE)/build/make/gen_asm_deps.sh \
--build-pfx=$(BUILD_PFX) --depfile=$@ $(ASFLAGS) $< > $@
$(BUILD_PFX)%.s.o: %.s
$(BUILD_PFX)%.S.o: %.S
$(if $(quiet),@echo " [AS] $@")
$(qexec)$(if $(CONFIG_DEPENDENCY_TRACKING),,mkdir -p $(dir $@))
$(qexec)$(AS) $(ASFLAGS) -o $@ $<
@ -198,8 +205,8 @@ $(BUILD_PFX)%.c.S: %.c
$(qexec)$(if $(CONFIG_DEPENDENCY_TRACKING),,mkdir -p $(dir $@))
$(qexec)$(CC) -S $(CFLAGS) -o $@ $<
.PRECIOUS: %.asm.s
$(BUILD_PFX)%.asm.s: %.asm
.PRECIOUS: %.asm.S
$(BUILD_PFX)%.asm.S: %.asm
$(if $(quiet),@echo " [ASM CONVERSION] $@")
$(qexec)mkdir -p $(dir $@)
$(qexec)$(ASM_CONVERSION) <$< >$@
@ -283,7 +290,7 @@ define archive_template
# for creating them.
$(1):
$(if $(quiet),@echo " [AR] $$@")
$(qexec)$$(AR) $$(ARFLAGS) $$@ $$?
$(qexec)$$(AR) $$(ARFLAGS) $$@ $$^
endef
define so_template
@ -313,18 +320,15 @@ $(1):
$$(filter %.o,$$^) $$(extralibs)
endef
define lipo_lib_template
$(1): $(addsuffix /$(1),$(FAT_ARCHS))
$(if $(quiet),@echo " [LIPO] $$@")
$(qexec)libtool -static -o $$@ $$?
endef
define lipo_bin_template
$(1): $(addsuffix /$(1),$(FAT_ARCHS))
$(if $(quiet),@echo " [LIPO] $$@")
$(qexec)lipo -output $$@ -create $$?
define dll_template
# Not using a pattern rule here because we don't want to generate empty
# archives when they are listed as a dependency in files not responsible
# for creating them.
$(1):
$(if $(quiet),@echo " [LD] $$@")
$(qexec)$$(LD) -Zdll $$(LDFLAGS) \
-o $$@ \
$$(filter %.o,$$^) $$(extralibs) $$(EXPORTS_FILE)
endef
@ -383,8 +387,9 @@ LIBS=$(call enabled,LIBS)
.libs: $(LIBS)
@touch $@
$(foreach lib,$(filter %_g.a,$(LIBS)),$(eval $(call archive_template,$(lib))))
$(foreach lib,$(filter %so.$(VERSION_MAJOR).$(VERSION_MINOR).$(VERSION_PATCH),$(LIBS)),$(eval $(call so_template,$(lib))))
$(foreach lib,$(filter %$(VERSION_MAJOR).dylib,$(LIBS)),$(eval $(call dl_template,$(lib))))
$(foreach lib,$(filter %so.$(SO_VERSION_MAJOR).$(SO_VERSION_MINOR).$(SO_VERSION_PATCH),$(LIBS)),$(eval $(call so_template,$(lib))))
$(foreach lib,$(filter %$(SO_VERSION_MAJOR).dylib,$(LIBS)),$(eval $(call dl_template,$(lib))))
$(foreach lib,$(filter %$(SO_VERSION_MAJOR).dll,$(LIBS)),$(eval $(call dll_template,$(lib))))
INSTALL-LIBS=$(call cond_enabled,CONFIG_INSTALL_LIBS,INSTALL-LIBS)
ifeq ($(MAKECMDGOALS),dist)
@ -420,7 +425,6 @@ ifneq ($(call enabled,DIST-SRCS),)
DIST-SRCS-yes += build/make/gen_asm_deps.sh
DIST-SRCS-yes += build/make/Makefile
DIST-SRCS-$(CONFIG_MSVS) += build/make/gen_msvs_def.sh
DIST-SRCS-$(CONFIG_MSVS) += build/make/gen_msvs_proj.sh
DIST-SRCS-$(CONFIG_MSVS) += build/make/gen_msvs_sln.sh
DIST-SRCS-$(CONFIG_MSVS) += build/make/gen_msvs_vcxproj.sh
DIST-SRCS-$(CONFIG_MSVS) += build/make/msvs_common.sh
@ -451,3 +455,5 @@ all: $(BUILD_TARGETS)
install:: $(INSTALL_TARGETS)
dist: $(INSTALL_TARGETS)
test::
.SUFFIXES: # Delete default suffix rules

View File

@ -23,9 +23,11 @@ use lib $FindBin::Bin;
use thumb;
my $thumb = 0;
my $elf = 1;
foreach my $arg (@ARGV) {
$thumb = 1 if ($arg eq "-thumb");
$elf = 0 if ($arg eq "-noelf");
}
print "@ This file was created from a .asm file\n";
@ -138,17 +140,13 @@ while (<STDIN>)
s/DCD(.*)/.long $1/;
s/DCB(.*)/.byte $1/;
# RN to .req
if (s/RN\s+([Rr]\d+|lr)/.req $1/)
{
print;
print "$comment_sub$comment\n" if defined $comment;
next;
}
# Make function visible to linker, and make additional symbol with
# prepended underscore
s/EXPORT\s+\|([\$\w]*)\|/.global $1 \n\t.type $1, function/;
if ($elf) {
s/EXPORT\s+\|([\$\w]*)\|/.global $1 \n\t.type $1, function/;
} else {
s/EXPORT\s+\|([\$\w]*)\|/.global $1/;
}
s/IMPORT\s+\|([\$\w]*)\|/.global $1/;
s/EXPORT\s+([\$\w]*)/.global $1/;
@ -189,11 +187,16 @@ while (<STDIN>)
# eabi_attributes numerical equivalents can be found in the
# "ARM IHI 0045C" document.
# REQUIRE8 Stack is required to be 8-byte aligned
s/\sREQUIRE8/.eabi_attribute 24, 1 \@Tag_ABI_align_needed/g;
if ($elf) {
# REQUIRE8 Stack is required to be 8-byte aligned
s/\sREQUIRE8/.eabi_attribute 24, 1 \@Tag_ABI_align_needed/g;
# PRESERVE8 Stack 8-byte align is preserved
s/\sPRESERVE8/.eabi_attribute 25, 1 \@Tag_ABI_align_preserved/g;
# PRESERVE8 Stack 8-byte align is preserved
s/\sPRESERVE8/.eabi_attribute 25, 1 \@Tag_ABI_align_preserved/g;
} else {
s/\sREQUIRE8//;
s/\sPRESERVE8//;
}
# Use PROC and ENDP to give the symbols a .size directive.
# This makes them show up properly in debugging tools like gdb and valgrind.
@ -210,7 +213,7 @@ while (<STDIN>)
my $proc;
s/\bENDP\b/@ $&/;
$proc = pop(@proc_stack);
$_ = "\t.size $proc, .-$proc".$_ if ($proc);
$_ = "\t.size $proc, .-$proc".$_ if ($proc and $elf);
}
# EQU directive
@ -233,4 +236,4 @@ while (<STDIN>)
}
# Mark that this object doesn't need an executable stack.
printf ("\t.section\t.note.GNU-stack,\"\",\%\%progbits\n");
printf ("\t.section\t.note.GNU-stack,\"\",\%\%progbits\n") if $elf;

View File

@ -18,12 +18,6 @@
# Usage: cat inputfile | perl ads2gas_apple.pl > outputfile
#
my $chromium = 0;
foreach my $arg (@ARGV) {
$chromium = 1 if ($arg eq "-chromium");
}
print "@ This file was created from a .asm file\n";
print "@ using the ads2gas_apple.pl script.\n\n";
print "\t.set WIDE_REFERENCE, 0\n";
@ -126,18 +120,6 @@ while (<STDIN>)
s/DCD(.*)/.long $1/;
s/DCB(.*)/.byte $1/;
# Build a hash of all the register - alias pairs.
if (s/(.*)RN(.*)/$1 .req $2/g)
{
$register_aliases{trim($1)} = trim($2);
next;
}
while (($key, $value) = each(%register_aliases))
{
s/\b$key\b/$value/g;
}
# Make function visible to linker, and make additional symbol with
# prepended underscore
s/EXPORT\s+\|([\$\w]*)\|/.globl _$1\n\t.globl $1/;
@ -218,18 +200,5 @@ while (<STDIN>)
s/\bMEND\b/.endm/; # No need to tell it where to stop assembling
next if /^\s*END\s*$/;
# Clang used by Chromium differs slightly from clang in XCode in what it
# will accept in the assembly.
if ($chromium) {
s/qsubaddx/qsax/i;
s/qaddsubx/qasx/i;
s/ldrneb/ldrbne/i;
s/ldrneh/ldrhne/i;
s/(vqshrun\.s16 .*, \#)0$/${1}8/i;
# http://llvm.org/bugs/show_bug.cgi?id=16022
s/\.include/#include/;
}
print;
}

View File

@ -73,6 +73,7 @@ Build options:
--target=TARGET target platform tuple [generic-gnu]
--cpu=CPU optimize for a specific cpu rather than a family
--extra-cflags=ECFLAGS add ECFLAGS to CFLAGS [$CFLAGS]
--extra-cxxflags=ECXXFLAGS add ECXXFLAGS to CXXFLAGS [$CXXFLAGS]
${toggle_extra_warnings} emit harmless warnings (always non-fatal)
${toggle_werror} treat warnings as errors, if possible
(not available with all compilers)
@ -184,6 +185,7 @@ add_extralibs() {
#
# Boolean Manipulation Functions
#
enable_feature(){
set_all yes $*
}
@ -200,6 +202,24 @@ disabled(){
eval test "x\$$1" = "xno"
}
enable_codec(){
enabled "${1}" || echo " enabling ${1}"
enable_feature "${1}"
is_in "${1}" vp8 vp9 && enable_feature "${1}_encoder" "${1}_decoder"
}
disable_codec(){
disabled "${1}" || echo " disabling ${1}"
disable_feature "${1}"
is_in "${1}" vp8 vp9 && disable_feature "${1}_encoder" "${1}_decoder"
}
# Iterates through positional parameters, checks to confirm the parameter has
# not been explicitly (force) disabled, and enables the setting controlled by
# the parameter when the setting is not disabled.
# Note: Does NOT alter RTCD generation options ($RTCD_OPTIONS).
soft_enable() {
for var in $*; do
if ! disabled $var; then
@ -209,6 +229,10 @@ soft_enable() {
done
}
# Iterates through positional parameters, checks to confirm the parameter has
# not been explicitly (force) enabled, and disables the setting controlled by
# the parameter when the setting is not enabled.
# Note: Does NOT alter RTCD generation options ($RTCD_OPTIONS).
soft_disable() {
for var in $*; do
if ! enabled $var; then
@ -337,6 +361,10 @@ check_add_cflags() {
check_cflags "$@" && add_cflags_only "$@"
}
check_add_cxxflags() {
check_cxxflags "$@" && add_cxxflags_only "$@"
}
check_add_asflags() {
log add_asflags "$@"
add_asflags "$@"
@ -375,6 +403,23 @@ check_gcc_machine_option() {
fi
}
# tests for -m$2, -m$3, -m$4... toggling the feature given in $1.
check_gcc_machine_options() {
feature="$1"
shift
flags="-m$1"
shift
for opt in $*; do
flags="$flags -m$opt"
done
if enabled gcc && ! disabled "$feature" && ! check_cflags $flags; then
RTCD_OPTIONS="${RTCD_OPTIONS}--disable-$feature "
else
soft_enable "$feature"
fi
}
write_common_config_banner() {
print_webm_license config.mk "##" ""
echo '# This file automatically generated by configure. Do not edit!' >> config.mk
@ -390,7 +435,7 @@ write_common_config_banner() {
write_common_config_targets() {
for t in ${all_targets}; do
if enabled ${t}; then
if enabled universal || enabled child; then
if enabled child; then
fwrite config.mk "ALL_TARGETS += ${t}-${toolchain}"
else
fwrite config.mk "ALL_TARGETS += ${t}"
@ -428,7 +473,7 @@ NM=${NM}
CFLAGS = ${CFLAGS}
CXXFLAGS = ${CXXFLAGS}
ARFLAGS = -rus\$(if \$(quiet),c,v)
ARFLAGS = -crs\$(if \$(quiet),,v)
LDFLAGS = ${LDFLAGS}
ASFLAGS = ${ASFLAGS}
extralibs = ${extralibs}
@ -503,24 +548,25 @@ process_common_cmdline() {
--extra-cflags=*)
extra_cflags="${optval}"
;;
--extra-cxxflags=*)
extra_cxxflags="${optval}"
;;
--enable-?*|--disable-?*)
eval `echo "$opt" | sed 's/--/action=/;s/-/ option=/;s/-/_/g'`
if echo "${ARCH_EXT_LIST}" | grep "^ *$option\$" >/dev/null; then
if is_in ${option} ${ARCH_EXT_LIST}; then
[ $action = "disable" ] && RTCD_OPTIONS="${RTCD_OPTIONS}--disable-${option} "
elif [ $action = "disable" ] && ! disabled $option ; then
echo "${CMDLINE_SELECT}" | grep "^ *$option\$" >/dev/null ||
die_unknown $opt
is_in ${option} ${CMDLINE_SELECT} || die_unknown $opt
log_echo " disabling $option"
elif [ $action = "enable" ] && ! enabled $option ; then
echo "${CMDLINE_SELECT}" | grep "^ *$option\$" >/dev/null ||
die_unknown $opt
is_in ${option} ${CMDLINE_SELECT} || die_unknown $opt
log_echo " enabling $option"
fi
${action}_feature $option
;;
--require-?*)
eval `echo "$opt" | sed 's/--/action=/;s/-/ option=/;s/-/_/g'`
if echo "${ARCH_EXT_LIST}" none | grep "^ *$option\$" >/dev/null; then
if is_in ${option} ${ARCH_EXT_LIST}; then
RTCD_OPTIONS="${RTCD_OPTIONS}${opt} "
else
die_unknown $opt
@ -606,7 +652,7 @@ setup_gnu_toolchain() {
AS=${AS:-${CROSS}as}
STRIP=${STRIP:-${CROSS}strip}
NM=${NM:-${CROSS}nm}
AS_SFX=.s
AS_SFX=.S
EXE_SFX=
}
@ -617,16 +663,40 @@ show_darwin_sdk_path() {
xcodebuild -sdk $1 -version Path 2>/dev/null
}
# Print the major version number of the Darwin SDK specified by $1.
show_darwin_sdk_major_version() {
xcrun --sdk $1 --show-sdk-version 2>/dev/null | cut -d. -f1
}
# Print the Xcode version.
show_xcode_version() {
xcodebuild -version | head -n1 | cut -d' ' -f2
}
# Fails when Xcode version is less than 6.3.
check_xcode_minimum_version() {
xcode_major=$(show_xcode_version | cut -f1 -d.)
xcode_minor=$(show_xcode_version | cut -f2 -d.)
xcode_min_major=6
xcode_min_minor=3
if [ ${xcode_major} -lt ${xcode_min_major} ]; then
return 1
fi
if [ ${xcode_major} -eq ${xcode_min_major} ] \
&& [ ${xcode_minor} -lt ${xcode_min_minor} ]; then
return 1
fi
}
process_common_toolchain() {
if [ -z "$toolchain" ]; then
gcctarget="${CHOST:-$(gcc -dumpmachine 2> /dev/null)}"
# detect tgt_isa
case "$gcctarget" in
armv6*)
tgt_isa=armv6
aarch64*)
tgt_isa=arm64
;;
armv7*-hardfloat*)
armv7*-hardfloat* | armv7*-gnueabihf | arm-*-gnueabihf)
tgt_isa=armv7
float_abi=hard
;;
@ -640,27 +710,25 @@ process_common_toolchain() {
*i[3456]86*)
tgt_isa=x86
;;
*powerpc64*)
tgt_isa=ppc64
;;
*powerpc*)
tgt_isa=ppc32
;;
*sparc*)
tgt_isa=sparc
;;
power*64*-*)
tgt_isa=ppc64
;;
power*)
tgt_isa=ppc
;;
*mips64el*)
tgt_isa=mips64
;;
*mips32el*)
tgt_isa=mips32
;;
esac
# detect tgt_os
case "$gcctarget" in
*darwin8*)
tgt_isa=universal
tgt_os=darwin8
;;
*darwin9*)
tgt_isa=universal
tgt_os=darwin9
;;
*darwin10*)
tgt_isa=x86_64
tgt_os=darwin10
@ -681,9 +749,24 @@ process_common_toolchain() {
tgt_isa=x86_64
tgt_os=darwin14
;;
*darwin15*)
tgt_isa=x86_64
tgt_os=darwin15
;;
*darwin16*)
tgt_isa=x86_64
tgt_os=darwin16
;;
*darwin17*)
tgt_isa=x86_64
tgt_os=darwin17
;;
x86_64*mingw32*)
tgt_os=win64
;;
x86_64*cygwin*)
tgt_os=win64
;;
*mingw32*|*cygwin*)
[ -z "$tgt_isa" ] && tgt_isa=x86
tgt_os=win32
@ -731,18 +814,36 @@ process_common_toolchain() {
mips*)
enable_feature mips
;;
ppc*)
enable_feature ppc
;;
esac
# PIC is probably what we want when building shared libs
enabled shared && soft_enable pic
# Minimum iOS version for all target platforms (darwin and iphonesimulator).
IOS_VERSION_MIN="6.0"
# Shared library framework builds are only possible on iOS 8 and later.
if enabled shared; then
IOS_VERSION_OPTIONS="--enable-shared"
IOS_VERSION_MIN="8.0"
else
IOS_VERSION_OPTIONS=""
IOS_VERSION_MIN="6.0"
fi
# Handle darwin variants. Newer SDKs allow targeting older
# platforms, so use the newest one available.
case ${toolchain} in
*-darwin*)
arm*-darwin*)
add_cflags "-miphoneos-version-min=${IOS_VERSION_MIN}"
iphoneos_sdk_dir="$(show_darwin_sdk_path iphoneos)"
if [ -d "${iphoneos_sdk_dir}" ]; then
add_cflags "-isysroot ${iphoneos_sdk_dir}"
add_ldflags "-isysroot ${iphoneos_sdk_dir}"
fi
;;
x86*-darwin*)
osx_sdk_dir="$(show_darwin_sdk_path macosx)"
if [ -d "${osx_sdk_dir}" ]; then
add_cflags "-isysroot ${osx_sdk_dir}"
@ -780,6 +881,18 @@ process_common_toolchain() {
add_cflags "-mmacosx-version-min=10.10"
add_ldflags "-mmacosx-version-min=10.10"
;;
*-darwin15-*)
add_cflags "-mmacosx-version-min=10.11"
add_ldflags "-mmacosx-version-min=10.11"
;;
*-darwin16-*)
add_cflags "-mmacosx-version-min=10.12"
add_ldflags "-mmacosx-version-min=10.12"
;;
*-darwin17-*)
add_cflags "-mmacosx-version-min=10.13"
add_ldflags "-mmacosx-version-min=10.13"
;;
*-iphonesimulator-*)
add_cflags "-miphoneos-version-min=${IOS_VERSION_MIN}"
add_ldflags "-miphoneos-version-min=${IOS_VERSION_MIN}"
@ -795,7 +908,6 @@ process_common_toolchain() {
case ${toolchain} in
sparc-solaris-*)
add_extralibs -lposix4
disable_feature fast_unaligned
;;
*-solaris-*)
add_extralibs -lposix4
@ -818,12 +930,6 @@ process_common_toolchain() {
if disabled neon && enabled neon_asm; then
die "Disabling neon while keeping neon-asm is not supported"
fi
soft_enable media
soft_enable fast_unaligned
;;
armv6)
soft_enable media
soft_enable fast_unaligned
;;
esac
@ -831,12 +937,10 @@ process_common_toolchain() {
case ${tgt_cc} in
gcc)
CROSS=${CROSS:-arm-none-linux-gnueabi-}
link_with_cc=gcc
setup_gnu_toolchain
arch_int=${tgt_isa##armv}
arch_int=${arch_int%%te}
check_add_asflags --defsym ARCHITECTURE=${arch_int}
tune_cflags="-mtune="
if [ ${tgt_isa} = "armv7" ] || [ ${tgt_isa} = "armv7s" ]; then
if [ -z "${float_abi}" ]; then
@ -853,6 +957,9 @@ EOF
check_add_cflags -mfpu=neon #-ftree-vectorize
check_add_asflags -mfpu=neon
fi
elif [ ${tgt_isa} = "arm64" ] || [ ${tgt_isa} = "armv8" ]; then
check_add_cflags -march=armv8-a
check_add_asflags -march=armv8-a
else
check_add_cflags -march=${tgt_isa}
check_add_asflags -march=${tgt_isa}
@ -860,6 +967,19 @@ EOF
enabled debug && add_asflags -g
asm_conversion_cmd="${source_path}/build/make/ads2gas.pl"
case ${tgt_os} in
win*)
asm_conversion_cmd="$asm_conversion_cmd -noelf"
AS="$CC -c"
EXE_SFX=.exe
enable_feature thumb
;;
*)
check_add_asflags --defsym ARCHITECTURE=${arch_int}
;;
esac
if enabled thumb; then
asm_conversion_cmd="$asm_conversion_cmd -thumb"
check_add_cflags -mthumb
@ -868,7 +988,7 @@ EOF
;;
vs*)
asm_conversion_cmd="${source_path}/build/make/ads2armasm_ms.pl"
AS_SFX=.s
AS_SFX=.S
msvs_arch_dir=arm-msvs
disable_feature multithread
disable_feature unit_tests
@ -878,6 +998,7 @@ EOF
# only "AppContainerApplication" which requires an AppxManifest.
# Therefore disable the examples, just build the library.
disable_feature examples
disable_feature tools
fi
;;
rvct)
@ -920,41 +1041,50 @@ EOF
;;
android*)
SDK_PATH=${sdk_path}
COMPILER_LOCATION=`find "${SDK_PATH}" \
-name "arm-linux-androideabi-gcc*" -print -quit`
TOOLCHAIN_PATH=${COMPILER_LOCATION%/*}/arm-linux-androideabi-
CC=${TOOLCHAIN_PATH}gcc
CXX=${TOOLCHAIN_PATH}g++
AR=${TOOLCHAIN_PATH}ar
LD=${TOOLCHAIN_PATH}gcc
AS=${TOOLCHAIN_PATH}as
STRIP=${TOOLCHAIN_PATH}strip
NM=${TOOLCHAIN_PATH}nm
if [ -n "${sdk_path}" ]; then
SDK_PATH=${sdk_path}
COMPILER_LOCATION=`find "${SDK_PATH}" \
-name "arm-linux-androideabi-gcc*" -print -quit`
TOOLCHAIN_PATH=${COMPILER_LOCATION%/*}/arm-linux-androideabi-
CC=${TOOLCHAIN_PATH}gcc
CXX=${TOOLCHAIN_PATH}g++
AR=${TOOLCHAIN_PATH}ar
LD=${TOOLCHAIN_PATH}gcc
AS=${TOOLCHAIN_PATH}as
STRIP=${TOOLCHAIN_PATH}strip
NM=${TOOLCHAIN_PATH}nm
if [ -z "${alt_libc}" ]; then
alt_libc=`find "${SDK_PATH}" -name arch-arm -print | \
awk '{n = split($0,a,"/"); \
if [ -z "${alt_libc}" ]; then
alt_libc=`find "${SDK_PATH}" -name arch-arm -print | \
awk '{n = split($0,a,"/"); \
split(a[n-1],b,"-"); \
print $0 " " b[2]}' | \
sort -g -k 2 | \
awk '{ print $1 }' | tail -1`
fi
fi
add_cflags "--sysroot=${alt_libc}"
add_ldflags "--sysroot=${alt_libc}"
if [ -d "${alt_libc}" ]; then
add_cflags "--sysroot=${alt_libc}"
add_ldflags "--sysroot=${alt_libc}"
fi
# linker flag that routes around a CPU bug in some
# Cortex-A8 implementations (NDK Dev Guide)
add_ldflags "-Wl,--fix-cortex-a8"
# linker flag that routes around a CPU bug in some
# Cortex-A8 implementations (NDK Dev Guide)
add_ldflags "-Wl,--fix-cortex-a8"
enable_feature pic
soft_enable realtime_only
if [ ${tgt_isa} = "armv7" ]; then
soft_enable runtime_cpu_detect
fi
if enabled runtime_cpu_detect; then
add_cflags "-I${SDK_PATH}/sources/android/cpufeatures"
enable_feature pic
soft_enable realtime_only
if [ ${tgt_isa} = "armv7" ]; then
soft_enable runtime_cpu_detect
fi
if enabled runtime_cpu_detect; then
add_cflags "-I${SDK_PATH}/sources/android/cpufeatures"
fi
else
echo "Assuming standalone build with NDK toolchain."
echo "See build/make/Android.mk for details."
check_add_ldflags -static
soft_enable unit_tests
fi
;;
@ -967,19 +1097,8 @@ EOF
STRIP="$(${XCRUN_FIND} strip)"
NM="$(${XCRUN_FIND} nm)"
RANLIB="$(${XCRUN_FIND} ranlib)"
AS_SFX=.s
# Special handling of ld for armv6 because libclang_rt.ios.a does
# not contain armv6 support in Apple's clang package:
# Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn).
# TODO(tomfinegan): Remove this. Our minimum iOS version (6.0)
# renders support for armv6 unnecessary because the 3GS and up
# support neon.
if [ "${tgt_isa}" = "armv6" ]; then
LD="$(${XCRUN_FIND} ld)"
else
LD="${CXX:-$(${XCRUN_FIND} ld)}"
fi
AS_SFX=.S
LD="${CXX:-$(${XCRUN_FIND} ld)}"
# ASFLAGS is written here instead of using check_add_asflags
# because we need to overwrite all of ASFLAGS and purge the
@ -1005,7 +1124,26 @@ EOF
[ -d "${try_dir}" ] && add_ldflags -L"${try_dir}"
done
case ${tgt_isa} in
armv7|armv7s|armv8|arm64)
if enabled neon && ! check_xcode_minimum_version; then
soft_disable neon
log_echo " neon disabled: upgrade Xcode (need v6.3+)."
if enabled neon_asm; then
soft_disable neon_asm
log_echo " neon_asm disabled: upgrade Xcode (need v6.3+)."
fi
fi
;;
esac
asm_conversion_cmd="${source_path}/build/make/ads2gas_apple.pl"
if [ "$(show_darwin_sdk_major_version iphoneos)" -gt 8 ]; then
check_add_cflags -fembed-bitcode
check_add_asflags -fembed-bitcode
check_add_ldflags -fembed-bitcode
fi
;;
linux*)
@ -1013,7 +1151,7 @@ EOF
if enabled rvct; then
# Check if we have CodeSourcery GCC in PATH. Needed for
# libraries
hash arm-none-linux-gnueabi-gcc 2>&- || \
which arm-none-linux-gnueabi-gcc 2>&- || \
die "Couldn't find CodeSourcery GCC from PATH"
# Use armcc as a linker to enable translation of
@ -1039,62 +1177,54 @@ EOF
tune_cflags="-mtune="
if enabled dspr2; then
check_add_cflags -mips32r2 -mdspr2
disable_feature fast_unaligned
fi
if enabled runtime_cpu_detect; then
disable_feature runtime_cpu_detect
fi
if [ -n "${tune_cpu}" ]; then
case ${tune_cpu} in
p5600)
add_cflags -mips32r5 -funroll-loops -mload-store-pairs
add_cflags -msched-weight -mhard-float
add_asflags -mips32r5 -mhard-float
check_add_cflags -mips32r5 -mload-store-pairs
check_add_cflags -msched-weight -mhard-float -mfp64
check_add_asflags -mips32r5 -mhard-float -mfp64
check_add_ldflags -mfp64
;;
i6400)
add_cflags -mips64r6 -mabi=64 -funroll-loops -mload-store-pairs
add_cflags -msched-weight -mhard-float
add_asflags -mips64r6 -mabi=64 -mhard-float
add_ldflags -mips64r6 -mabi=64
i6400|p6600)
check_add_cflags -mips64r6 -mabi=64 -msched-weight
check_add_cflags -mload-store-pairs -mhard-float -mfp64
check_add_asflags -mips64r6 -mabi=64 -mhard-float -mfp64
check_add_ldflags -mips64r6 -mabi=64 -mfp64
;;
esac
if enabled msa; then
add_cflags -mmsa -mfp64 -flax-vector-conversions
add_asflags -mmsa -mfp64 -flax-vector-conversions
add_ldflags -mmsa -mfp64 -flax-vector-conversions
disable_feature fast_unaligned
add_cflags -mmsa
add_asflags -mmsa
add_ldflags -mmsa
fi
fi
if enabled mmi; then
tgt_isa=loongson3a
check_add_ldflags -march=loongson3a
fi
check_add_cflags -march=${tgt_isa}
check_add_asflags -march=${tgt_isa}
check_add_asflags -KPIC
;;
ppc*)
enable_feature ppc
bits=${tgt_isa##ppc}
link_with_cc=gcc
setup_gnu_toolchain
add_asflags -force_cpusubtype_ALL -I"\$(dir \$<)darwin"
soft_enable altivec
enabled altivec && add_cflags -maltivec
case "$tgt_os" in
linux*)
add_asflags -maltivec -mregnames -I"\$(dir \$<)linux"
;;
darwin*)
darwin_arch="-arch ppc"
enabled ppc64 && darwin_arch="${darwin_arch}64"
add_cflags ${darwin_arch} -m${bits} -fasm-blocks
add_asflags ${darwin_arch} -force_cpusubtype_ALL -I"\$(dir \$<)darwin"
add_ldflags ${darwin_arch} -m${bits}
enabled altivec && add_cflags -faltivec
;;
esac
check_gcc_machine_option "vsx"
;;
x86*)
case ${tgt_os} in
android)
soft_enable realtime_only
;;
win*)
enabled gcc && add_cflags -fno-common
;;
@ -1102,10 +1232,12 @@ EOF
CC=${CC:-${CROSS}gcc}
CXX=${CXX:-${CROSS}g++}
LD=${LD:-${CROSS}gcc}
CROSS=${CROSS:-g}
CROSS=${CROSS-g}
;;
os2)
disable_feature pic
AS=${AS:-nasm}
add_ldflags -Zhigh-mem
;;
esac
@ -1145,6 +1277,13 @@ EOF
AS=msvs
msvs_arch_dir=x86-msvs
vc_version=${tgt_cc##vs}
case $vc_version in
7|8|9|10|11|12|13|14)
echo "${tgt_cc} does not support avx512, disabling....."
RTCD_OPTIONS="${RTCD_OPTIONS}--disable-avx512 "
soft_disable avx512
;;
esac
case $vc_version in
7|8|9|10)
echo "${tgt_cc} does not support avx/avx2, disabling....."
@ -1153,6 +1292,12 @@ EOF
soft_disable avx2
;;
esac
case $vc_version in
7|8|9)
echo "${tgt_cc} omits stdint.h, disabling webm-io..."
soft_disable webm_io
;;
esac
;;
esac
@ -1173,33 +1318,47 @@ EOF
soft_enable runtime_cpu_detect
# We can't use 'check_cflags' until the compiler is configured and CC is
# populated.
check_gcc_machine_option mmx
check_gcc_machine_option sse
check_gcc_machine_option sse2
check_gcc_machine_option sse3
check_gcc_machine_option ssse3
check_gcc_machine_option sse4 sse4_1
check_gcc_machine_option avx
check_gcc_machine_option avx2
case "${AS}" in
auto|"")
which nasm >/dev/null 2>&1 && AS=nasm
which yasm >/dev/null 2>&1 && AS=yasm
if [ "${AS}" = nasm ] ; then
# Apple ships version 0.98 of nasm through at least Xcode 6. Revisit
# this check if they start shipping a compatible version.
apple=`nasm -v | grep "Apple"`
[ -n "${apple}" ] \
&& echo "Unsupported version of nasm: ${apple}" \
&& AS=""
for ext in ${ARCH_EXT_LIST_X86}; do
# disable higher order extensions to simplify asm dependencies
if [ "$disable_exts" = "yes" ]; then
if ! disabled $ext; then
RTCD_OPTIONS="${RTCD_OPTIONS}--disable-${ext} "
disable_feature $ext
fi
[ "${AS}" = auto ] || [ -z "${AS}" ] \
&& die "Neither yasm nor nasm have been found"
;;
esac
log_echo " using $AS"
[ "${AS##*/}" = nasm ] && add_asflags -Ox
elif disabled $ext; then
disable_exts="yes"
else
if [ "$ext" = "avx512" ]; then
check_gcc_machine_options $ext avx512f avx512cd avx512bw avx512dq avx512vl
else
# use the shortened version for the flag: sse4_1 -> sse4
check_gcc_machine_option ${ext%_*} $ext
fi
fi
done
if enabled external_build; then
log_echo " skipping assembler detection"
else
case "${AS}" in
auto|"")
which nasm >/dev/null 2>&1 && AS=nasm
which yasm >/dev/null 2>&1 && AS=yasm
if [ "${AS}" = nasm ] ; then
# Apple ships version 0.98 of nasm through at least Xcode 6. Revisit
# this check if they start shipping a compatible version.
apple=`nasm -v | grep "Apple"`
[ -n "${apple}" ] \
&& echo "Unsupported version of nasm: ${apple}" \
&& AS=""
fi
[ "${AS}" = auto ] || [ -z "${AS}" ] \
&& die "Neither yasm nor nasm have been found." \
"See the prerequisites section in the README for more info."
;;
esac
log_echo " using $AS"
fi
AS_SFX=.asm
case ${tgt_os} in
win32)
@ -1208,7 +1367,7 @@ EOF
EXE_SFX=.exe
;;
win64)
add_asflags -f x64
add_asflags -f win64
enabled debug && add_asflags -g cv8
EXE_SFX=.exe
;;
@ -1234,6 +1393,14 @@ EOF
enabled x86 && sim_arch="-arch i386" || sim_arch="-arch x86_64"
add_cflags ${sim_arch}
add_ldflags ${sim_arch}
if [ "$(disabled external_build)" ] &&
[ "$(show_darwin_sdk_major_version iphonesimulator)" -gt 8 ]; then
# yasm v1.3.0 doesn't know what -fembed-bitcode means, so turning it
# on is pointless (unless building a C-only lib). Warn the user, but
# do nothing here.
log "Warning: Bitcode embed disabled for simulator targets."
fi
;;
os2)
add_asflags -f aout
@ -1245,7 +1412,7 @@ EOF
;;
esac
;;
universal*|*-gcc|generic-gnu)
*-gcc|generic-gnu)
link_with_cc=gcc
enable_feature gcc
setup_gnu_toolchain
@ -1286,10 +1453,6 @@ EOF
fi
fi
if [ "${tgt_isa}" = "x86_64" ] || [ "${tgt_isa}" = "x86" ]; then
soft_enable use_x86inc
fi
# Position Independent Code (PIC) support, for building relocatable
# shared objects
enabled gcc && enabled pic && check_add_cflags -fPIC
@ -1319,6 +1482,7 @@ EOF
*-win*-vs*)
;;
*-android-gcc)
# bionic includes basic pthread functionality, obviating -lpthread.
;;
*)
check_header pthread.h && add_extralibs -lpthread
@ -1329,11 +1493,19 @@ EOF
# only for MIPS platforms
case ${toolchain} in
mips*)
if enabled dspr2; then
if enabled big_endian; then
if enabled big_endian; then
if enabled dspr2; then
echo "dspr2 optimizations are available only for little endian platforms"
disable_feature dspr2
fi
if enabled msa; then
echo "msa optimizations are available only for little endian platforms"
disable_feature msa
fi
if enabled mmi; then
echo "mmi optimizations are available only for little endian platforms"
disable_feature mmi
fi
fi
;;
esac
@ -1343,12 +1515,6 @@ EOF
add_cflags -D_LARGEFILE_SOURCE
add_cflags -D_FILE_OFFSET_BITS=64
fi
# append any user defined extra cflags
if [ -n "${extra_cflags}" ] ; then
check_add_cflags ${extra_cflags} || \
die "Requested extra CFLAGS '${extra_cflags}' not supported by compiler"
fi
}
process_toolchain() {

View File

@ -1,486 +0,0 @@
#!/bin/bash
##
## Copyright (c) 2010 The WebM project authors. All Rights Reserved.
##
## Use of this source code is governed by a BSD-style license
## that can be found in the LICENSE file in the root of the source
## tree. An additional intellectual property rights grant can be found
## in the file PATENTS. All contributing project authors may
## be found in the AUTHORS file in the root of the source tree.
##
self=$0
self_basename=${self##*/}
self_dirname=$(dirname "$0")
. "$self_dirname/msvs_common.sh"|| exit 127
show_help() {
cat <<EOF
Usage: ${self_basename} --name=projname [options] file1 [file2 ...]
This script generates a Visual Studio project file from a list of source
code files.
Options:
--help Print this message
--exe Generate a project for building an Application
--lib Generate a project for creating a static library
--dll Generate a project for creating a dll
--static-crt Use the static C runtime (/MT)
--target=isa-os-cc Target specifier (required)
--out=filename Write output to a file [stdout]
--name=project_name Name of the project (required)
--proj-guid=GUID GUID to use for the project
--module-def=filename File containing export definitions (for DLLs)
--ver=version Version (7,8,9) of visual studio to generate for
--src-path-bare=dir Path to root of source tree
-Ipath/to/include Additional include directories
-DFLAG[=value] Preprocessor macros to define
-Lpath/to/lib Additional library search paths
-llibname Library to link against
EOF
exit 1
}
generate_filter() {
local var=$1
local name=$2
local pats=$3
local file_list_sz
local i
local f
local saveIFS="$IFS"
local pack
echo "generating filter '$name' from ${#file_list[@]} files" >&2
IFS=*
open_tag Filter \
Name=$name \
Filter=$pats \
UniqueIdentifier=`generate_uuid` \
file_list_sz=${#file_list[@]}
for i in ${!file_list[@]}; do
f=${file_list[i]}
for pat in ${pats//;/$IFS}; do
if [ "${f##*.}" == "$pat" ]; then
unset file_list[i]
objf=$(echo ${f%.*}.obj \
| sed -e "s,$src_path_bare,," \
-e 's/^[\./]\+//g' -e 's,[:/ ],_,g')
open_tag File RelativePath="$f"
if [ "$pat" == "asm" ] && $asm_use_custom_step; then
for plat in "${platforms[@]}"; do
for cfg in Debug Release; do
open_tag FileConfiguration \
Name="${cfg}|${plat}" \
tag Tool \
Name="VCCustomBuildTool" \
Description="Assembling \$(InputFileName)" \
CommandLine="$(eval echo \$asm_${cfg}_cmdline) -o \$(IntDir)\\$objf" \
Outputs="\$(IntDir)\\$objf" \
close_tag FileConfiguration
done
done
fi
if [ "$pat" == "c" ] || \
[ "$pat" == "cc" ] || [ "$pat" == "cpp" ]; then
for plat in "${platforms[@]}"; do
for cfg in Debug Release; do
open_tag FileConfiguration \
Name="${cfg}|${plat}" \
tag Tool \
Name="VCCLCompilerTool" \
ObjectFile="\$(IntDir)\\$objf" \
close_tag FileConfiguration
done
done
fi
close_tag File
break
fi
done
done
close_tag Filter
IFS="$saveIFS"
}
# Process command line
unset target
for opt in "$@"; do
optval="${opt#*=}"
case "$opt" in
--help|-h) show_help
;;
--target=*) target="${optval}"
;;
--out=*) outfile="$optval"
;;
--name=*) name="${optval}"
;;
--proj-guid=*) guid="${optval}"
;;
--module-def=*) link_opts="${link_opts} ModuleDefinitionFile=${optval}"
;;
--exe) proj_kind="exe"
;;
--dll) proj_kind="dll"
;;
--lib) proj_kind="lib"
;;
--src-path-bare=*)
src_path_bare=$(fix_path "$optval")
src_path_bare=${src_path_bare%/}
;;
--static-crt) use_static_runtime=true
;;
--ver=*)
vs_ver="$optval"
case "$optval" in
[789])
;;
*) die Unrecognized Visual Studio Version in $opt
;;
esac
;;
-I*)
opt=${opt##-I}
opt=$(fix_path "$opt")
opt="${opt%/}"
incs="${incs}${incs:+;}&quot;${opt}&quot;"
yasmincs="${yasmincs} -I&quot;${opt}&quot;"
;;
-D*) defines="${defines}${defines:+;}${opt##-D}"
;;
-L*) # fudge . to $(OutDir)
if [ "${opt##-L}" == "." ]; then
libdirs="${libdirs}${libdirs:+;}&quot;\$(OutDir)&quot;"
else
# Also try directories for this platform/configuration
opt=${opt##-L}
opt=$(fix_path "$opt")
libdirs="${libdirs}${libdirs:+;}&quot;${opt}&quot;"
libdirs="${libdirs}${libdirs:+;}&quot;${opt}/\$(PlatformName)/\$(ConfigurationName)&quot;"
libdirs="${libdirs}${libdirs:+;}&quot;${opt}/\$(PlatformName)&quot;"
fi
;;
-l*) libs="${libs}${libs:+ }${opt##-l}.lib"
;;
-*) die_unknown $opt
;;
*)
# The paths in file_list are fixed outside of the loop.
file_list[${#file_list[@]}]="$opt"
case "$opt" in
*.asm) uses_asm=true
;;
esac
;;
esac
done
# Make one call to fix_path for file_list to improve performance.
fix_file_list
outfile=${outfile:-/dev/stdout}
guid=${guid:-`generate_uuid`}
asm_use_custom_step=false
uses_asm=${uses_asm:-false}
case "${vs_ver:-8}" in
7) vs_ver_id="7.10"
asm_use_custom_step=$uses_asm
warn_64bit='Detect64BitPortabilityProblems=true'
;;
8) vs_ver_id="8.00"
asm_use_custom_step=$uses_asm
warn_64bit='Detect64BitPortabilityProblems=true'
;;
9) vs_ver_id="9.00"
asm_use_custom_step=$uses_asm
warn_64bit='Detect64BitPortabilityProblems=false'
;;
esac
[ -n "$name" ] || die "Project name (--name) must be specified!"
[ -n "$target" ] || die "Target (--target) must be specified!"
if ${use_static_runtime:-false}; then
release_runtime=0
debug_runtime=1
lib_sfx=mt
else
release_runtime=2
debug_runtime=3
lib_sfx=md
fi
# Calculate debug lib names: If a lib ends in ${lib_sfx}.lib, then rename
# it to ${lib_sfx}d.lib. This precludes linking to release libs from a
# debug exe, so this may need to be refactored later.
for lib in ${libs}; do
if [ "$lib" != "${lib%${lib_sfx}.lib}" ]; then
lib=${lib%.lib}d.lib
fi
debug_libs="${debug_libs}${debug_libs:+ }${lib}"
done
# List Keyword for this target
case "$target" in
x86*) keyword="ManagedCProj"
;;
*) die "Unsupported target $target!"
esac
# List of all platforms supported for this target
case "$target" in
x86_64*)
platforms[0]="x64"
asm_Debug_cmdline="yasm -Xvc -g cv8 -f win64 ${yasmincs} &quot;\$(InputPath)&quot;"
asm_Release_cmdline="yasm -Xvc -f win64 ${yasmincs} &quot;\$(InputPath)&quot;"
;;
x86*)
platforms[0]="Win32"
asm_Debug_cmdline="yasm -Xvc -g cv8 -f win32 ${yasmincs} &quot;\$(InputPath)&quot;"
asm_Release_cmdline="yasm -Xvc -f win32 ${yasmincs} &quot;\$(InputPath)&quot;"
;;
*) die "Unsupported target $target!"
;;
esac
generate_vcproj() {
case "$proj_kind" in
exe) vs_ConfigurationType=1
;;
dll) vs_ConfigurationType=2
;;
*) vs_ConfigurationType=4
;;
esac
echo "<?xml version=\"1.0\" encoding=\"Windows-1252\"?>"
open_tag VisualStudioProject \
ProjectType="Visual C++" \
Version="${vs_ver_id}" \
Name="${name}" \
ProjectGUID="{${guid}}" \
RootNamespace="${name}" \
Keyword="${keyword}" \
open_tag Platforms
for plat in "${platforms[@]}"; do
tag Platform Name="$plat"
done
close_tag Platforms
open_tag Configurations
for plat in "${platforms[@]}"; do
plat_no_ws=`echo $plat | sed 's/[^A-Za-z0-9_]/_/g'`
open_tag Configuration \
Name="Debug|$plat" \
OutputDirectory="\$(SolutionDir)$plat_no_ws/\$(ConfigurationName)" \
IntermediateDirectory="$plat_no_ws/\$(ConfigurationName)/${name}" \
ConfigurationType="$vs_ConfigurationType" \
CharacterSet="1" \
case "$target" in
x86*)
case "$name" in
vpx)
tag Tool \
Name="VCCLCompilerTool" \
Optimization="0" \
AdditionalIncludeDirectories="$incs" \
PreprocessorDefinitions="WIN32;_DEBUG;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE;$defines" \
RuntimeLibrary="$debug_runtime" \
UsePrecompiledHeader="0" \
WarningLevel="3" \
DebugInformationFormat="2" \
$warn_64bit \
$uses_asm && tag Tool Name="YASM" IncludePaths="$incs" Debug="true"
;;
*)
tag Tool \
Name="VCCLCompilerTool" \
Optimization="0" \
AdditionalIncludeDirectories="$incs" \
PreprocessorDefinitions="WIN32;_DEBUG;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE;$defines" \
RuntimeLibrary="$debug_runtime" \
UsePrecompiledHeader="0" \
WarningLevel="3" \
DebugInformationFormat="2" \
$warn_64bit \
$uses_asm && tag Tool Name="YASM" IncludePaths="$incs" Debug="true"
;;
esac
;;
esac
case "$proj_kind" in
exe)
case "$target" in
x86*)
case "$name" in
*)
tag Tool \
Name="VCLinkerTool" \
AdditionalDependencies="$debug_libs \$(NoInherit)" \
AdditionalLibraryDirectories="$libdirs" \
GenerateDebugInformation="true" \
ProgramDatabaseFile="\$(OutDir)/${name}.pdb" \
;;
esac
;;
esac
;;
lib)
case "$target" in
x86*)
tag Tool \
Name="VCLibrarianTool" \
OutputFile="\$(OutDir)/${name}${lib_sfx}d.lib" \
;;
esac
;;
dll)
tag Tool \
Name="VCLinkerTool" \
AdditionalDependencies="\$(NoInherit)" \
LinkIncremental="2" \
GenerateDebugInformation="true" \
AssemblyDebug="1" \
TargetMachine="1" \
$link_opts \
;;
esac
close_tag Configuration
open_tag Configuration \
Name="Release|$plat" \
OutputDirectory="\$(SolutionDir)$plat_no_ws/\$(ConfigurationName)" \
IntermediateDirectory="$plat_no_ws/\$(ConfigurationName)/${name}" \
ConfigurationType="$vs_ConfigurationType" \
CharacterSet="1" \
WholeProgramOptimization="0" \
case "$target" in
x86*)
case "$name" in
vpx)
tag Tool \
Name="VCCLCompilerTool" \
Optimization="2" \
FavorSizeorSpeed="1" \
AdditionalIncludeDirectories="$incs" \
PreprocessorDefinitions="WIN32;NDEBUG;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE;$defines" \
RuntimeLibrary="$release_runtime" \
UsePrecompiledHeader="0" \
WarningLevel="3" \
DebugInformationFormat="0" \
$warn_64bit \
$uses_asm && tag Tool Name="YASM" IncludePaths="$incs"
;;
*)
tag Tool \
Name="VCCLCompilerTool" \
AdditionalIncludeDirectories="$incs" \
Optimization="2" \
FavorSizeorSpeed="1" \
PreprocessorDefinitions="WIN32;NDEBUG;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE;$defines" \
RuntimeLibrary="$release_runtime" \
UsePrecompiledHeader="0" \
WarningLevel="3" \
DebugInformationFormat="0" \
$warn_64bit \
$uses_asm && tag Tool Name="YASM" IncludePaths="$incs"
;;
esac
;;
esac
case "$proj_kind" in
exe)
case "$target" in
x86*)
case "$name" in
*)
tag Tool \
Name="VCLinkerTool" \
AdditionalDependencies="$libs \$(NoInherit)" \
AdditionalLibraryDirectories="$libdirs" \
;;
esac
;;
esac
;;
lib)
case "$target" in
x86*)
tag Tool \
Name="VCLibrarianTool" \
OutputFile="\$(OutDir)/${name}${lib_sfx}.lib" \
;;
esac
;;
dll) # note differences to debug version: LinkIncremental, AssemblyDebug
tag Tool \
Name="VCLinkerTool" \
AdditionalDependencies="\$(NoInherit)" \
LinkIncremental="1" \
GenerateDebugInformation="true" \
TargetMachine="1" \
$link_opts \
;;
esac
close_tag Configuration
done
close_tag Configurations
open_tag Files
generate_filter srcs "Source Files" "c;cc;cpp;def;odl;idl;hpj;bat;asm;asmx"
generate_filter hdrs "Header Files" "h;hm;inl;inc;xsd"
generate_filter resrcs "Resource Files" "rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
generate_filter resrcs "Build Files" "mk"
close_tag Files
tag Globals
close_tag VisualStudioProject
# This must be done from within the {} subshell
echo "Ignored files list (${#file_list[@]} items) is:" >&2
for f in "${file_list[@]}"; do
echo " $f" >&2
done
}
generate_vcproj |
sed -e '/"/s;\([^ "]\)/;\1\\;g' > ${outfile}
exit
<!--
TODO: Add any files not captured by filters.
<File
RelativePath=".\ReadMe.txt"
>
</File>
-->

View File

@ -19,13 +19,13 @@ show_help() {
cat <<EOF
Usage: ${self_basename} [options] file1 [file2 ...]
This script generates a Visual Studio 2005 solution file from a list of project
This script generates a Visual Studio solution file from a list of project
files.
Options:
--help Print this message
--out=outfile Redirect output to a file
--ver=version Version (7,8,9,10,11) of visual studio to generate for
--ver=version Version (7,8,9,10,11,12,14,15) of visual studio to generate for
--target=isa-os-cc Target specifier
EOF
exit 1
@ -55,16 +55,11 @@ indent_pop() {
parse_project() {
local file=$1
if [ "$sfx" = "vcproj" ]; then
local name=`grep Name "$file" | awk 'BEGIN {FS="\""}{if (NR==1) print $2}'`
local guid=`grep ProjectGUID "$file" | awk 'BEGIN {FS="\""}{if (NR==1) print $2}'`
else
local name=`grep RootNamespace "$file" | sed 's,.*<.*>\(.*\)</.*>.*,\1,'`
local guid=`grep ProjectGuid "$file" | sed 's,.*<.*>\(.*\)</.*>.*,\1,'`
fi
local name=`grep RootNamespace "$file" | sed 's,.*<.*>\(.*\)</.*>.*,\1,'`
local guid=`grep ProjectGuid "$file" | sed 's,.*<.*>\(.*\)</.*>.*,\1,'`
# save the project GUID to a varaible, normalizing to the basename of the
# vcproj file without the extension
# vcxproj file without the extension
local var
var=${file##*/}
var=${var%%.${sfx}}
@ -72,13 +67,8 @@ parse_project() {
eval "${var}_name=$name"
eval "${var}_guid=$guid"
if [ "$sfx" = "vcproj" ]; then
cur_config_list=`grep -A1 '<Configuration' $file |
grep Name | cut -d\" -f2`
else
cur_config_list=`grep -B1 'Label="Configuration"' $file |
grep Condition | cut -d\' -f4`
fi
cur_config_list=`grep -B1 'Label="Configuration"' $file |
grep Condition | cut -d\' -f4`
new_config_list=$(for i in $config_list $cur_config_list; do
echo $i
done | sort | uniq)
@ -103,25 +93,6 @@ process_project() {
eval "${var}_guid=$guid"
echo "Project(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"$name\", \"$file\", \"$guid\""
indent_push
eval "local deps=\"\${${var}_deps}\""
if [ -n "$deps" ] && [ "$sfx" = "vcproj" ]; then
echo "${indent}ProjectSection(ProjectDependencies) = postProject"
indent_push
for dep in $deps; do
eval "local dep_guid=\${${dep}_guid}"
[ -z "${dep_guid}" ] && die "Unknown GUID for $dep (dependency of $var)"
echo "${indent}$dep_guid = $dep_guid"
done
indent_pop
echo "${indent}EndProjectSection"
fi
indent_pop
echo "EndProject"
}
@ -191,11 +162,7 @@ process_makefile() {
IFS=$'\r'$'\n'
local TAB=$'\t'
cat <<EOF
ifeq (\$(CONFIG_VS_VERSION),7)
MSBUILD_TOOL := devenv.com
else
MSBUILD_TOOL := msbuild.exe
endif
found_devenv := \$(shell which \$(MSBUILD_TOOL) >/dev/null 2>&1 && echo yes)
.nodevenv.once:
${TAB}@echo " * \$(MSBUILD_TOOL) not found in path."
@ -204,7 +171,7 @@ ${TAB}@echo " * You will have to build all configurations manually using the"
${TAB}@echo " * Visual Studio IDE. To allow make to build them automatically,"
${TAB}@echo " * add the Common7/IDE directory of your Visual Studio"
${TAB}@echo " * installation to your path, eg:"
${TAB}@echo " * C:\Program Files\Microsoft Visual Studio 8\Common7\IDE"
${TAB}@echo " * C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE"
${TAB}@echo " * "
${TAB}@touch \$@
CLEAN-OBJS += \$(if \$(found_devenv),,.nodevenv.once)
@ -221,16 +188,9 @@ clean::
${TAB}rm -rf "$platform"/"$config"
.PHONY: $nows_sln_config
ifneq (\$(found_devenv),)
ifeq (\$(CONFIG_VS_VERSION),7)
$nows_sln_config: $outfile
${TAB}\$(MSBUILD_TOOL) $outfile -build "$config"
else
$nows_sln_config: $outfile
${TAB}\$(MSBUILD_TOOL) $outfile -m -t:Build \\
${TAB}${TAB}-p:Configuration="$config" -p:Platform="$platform"
endif
else
$nows_sln_config: $outfile .nodevenv.once
${TAB}@echo " * Skipping build of $sln_config (\$(MSBUILD_TOOL) not in path)."
@ -255,23 +215,12 @@ for opt in "$@"; do
;;
--ver=*) vs_ver="$optval"
case $optval in
[789]|10|11|12)
10|11|12|14|15)
;;
*) die Unrecognized Visual Studio Version in $opt
;;
esac
;;
--ver=*) vs_ver="$optval"
case $optval in
7) sln_vers="8.00"
sln_vers_str="Visual Studio .NET 2003"
;;
[89])
;;
*) die "Unrecognized Visual Studio Version '$optval' in $opt"
;;
esac
;;
--target=*) target="${optval}"
;;
-*) die_unknown $opt
@ -281,16 +230,7 @@ for opt in "$@"; do
done
outfile=${outfile:-/dev/stdout}
mkoutfile=${mkoutfile:-/dev/stdout}
case "${vs_ver:-8}" in
7) sln_vers="8.00"
sln_vers_str="Visual Studio .NET 2003"
;;
8) sln_vers="9.00"
sln_vers_str="Visual Studio 2005"
;;
9) sln_vers="10.00"
sln_vers_str="Visual Studio 2008"
;;
case "${vs_ver:-10}" in
10) sln_vers="11.00"
sln_vers_str="Visual Studio 2010"
;;
@ -300,15 +240,14 @@ case "${vs_ver:-8}" in
12) sln_vers="12.00"
sln_vers_str="Visual Studio 2013"
;;
esac
case "${vs_ver:-8}" in
[789])
sfx=vcproj
14) sln_vers="12.00"
sln_vers_str="Visual Studio 2015"
;;
10|11|12)
sfx=vcxproj
15) sln_vers="12.00"
sln_vers_str="Visual Studio 2017"
;;
esac
sfx=vcxproj
for f in "${file_list[@]}"; do
parse_project $f

View File

@ -34,7 +34,7 @@ Options:
--name=project_name Name of the project (required)
--proj-guid=GUID GUID to use for the project
--module-def=filename File containing export definitions (for DLLs)
--ver=version Version (10,11,12) of visual studio to generate for
--ver=version Version (10,11,12,14,15) of visual studio to generate for
--src-path-bare=dir Path to root of source tree
-Ipath/to/include Additional include directories
-DFLAG[=value] Preprocessor macros to define
@ -82,7 +82,7 @@ generate_filter() {
| sed -e "s,$src_path_bare,," \
-e 's/^[\./]\+//g' -e 's,[:/ ],_,g')
if ([ "$pat" == "asm" ] || [ "$pat" == "s" ]) && $asm_use_custom_step; then
if ([ "$pat" == "asm" ] || [ "$pat" == "s" ] || [ "$pat" == "S" ]) && $asm_use_custom_step; then
# Avoid object file name collisions, i.e. vpx_config.c and
# vpx_config.asm produce the same object file without
# this additional suffix.
@ -168,7 +168,7 @@ for opt in "$@"; do
--ver=*)
vs_ver="$optval"
case "$optval" in
10|11|12)
10|11|12|14|15)
;;
*) die Unrecognized Visual Studio Version in $opt
;;
@ -203,7 +203,7 @@ for opt in "$@"; do
# The paths in file_list are fixed outside of the loop.
file_list[${#file_list[@]}]="$opt"
case "$opt" in
*.asm|*.s) uses_asm=true
*.asm|*.[Ss]) uses_asm=true
;;
esac
;;
@ -211,14 +211,14 @@ for opt in "$@"; do
done
# Make one call to fix_path for file_list to improve performance.
fix_file_list
fix_file_list file_list
outfile=${outfile:-/dev/stdout}
guid=${guid:-`generate_uuid`}
asm_use_custom_step=false
uses_asm=${uses_asm:-false}
case "${vs_ver:-11}" in
10|11|12)
10|11|12|14|15)
asm_use_custom_step=$uses_asm
;;
esac
@ -263,8 +263,8 @@ case "$target" in
;;
arm*)
platforms[0]="ARM"
asm_Debug_cmdline="armasm -nologo &quot;%(FullPath)&quot;"
asm_Release_cmdline="armasm -nologo &quot;%(FullPath)&quot;"
asm_Debug_cmdline="armasm -nologo -oldit &quot;%(FullPath)&quot;"
asm_Release_cmdline="armasm -nologo -oldit &quot;%(FullPath)&quot;"
;;
*) die "Unsupported target $target!"
;;
@ -344,6 +344,12 @@ generate_vcxproj() {
# has to enable AppContainerApplication as well.
tag_content PlatformToolset v120
fi
if [ "$vs_ver" = "14" ]; then
tag_content PlatformToolset v140
fi
if [ "$vs_ver" = "15" ]; then
tag_content PlatformToolset v141
fi
tag_content CharacterSet Unicode
if [ "$config" = "Release" ]; then
tag_content WholeProgramOptimization true
@ -449,7 +455,7 @@ generate_vcxproj() {
done
open_tag ItemGroup
generate_filter "Source Files" "c;cc;cpp;def;odl;idl;hpj;bat;asm;asmx;s"
generate_filter "Source Files" "c;cc;cpp;def;odl;idl;hpj;bat;asm;asmx;s;S"
close_tag ItemGroup
open_tag ItemGroup
generate_filter "Header Files" "h;hm;inl;inc;xsd"

37
build/make/ios-Info.plist Normal file
View File

@ -0,0 +1,37 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>VPX</string>
<key>CFBundleIdentifier</key>
<string>org.webmproject.VPX</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>VPX</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>${VERSION}</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleSupportedPlatforms</key>
<array>
<string>iPhoneOS</string>
</array>
<key>CFBundleVersion</key>
<string>${VERSION}</string>
<key>MinimumOSVersion</key>
<string>${IOS_VERSION_MIN}</string>
<key>UIDeviceFamily</key>
<array>
<integer>1</integer>
<integer>2</integer>
</array>
<key>VPXFullVersion</key>
<string>${FULLVERSION}</string>
</dict>
</plist>

View File

@ -24,32 +24,44 @@ CONFIGURE_ARGS="--disable-docs
--disable-unit-tests"
DIST_DIR="_dist"
FRAMEWORK_DIR="VPX.framework"
FRAMEWORK_LIB="VPX.framework/VPX"
HEADER_DIR="${FRAMEWORK_DIR}/Headers/vpx"
MAKE_JOBS=1
SCRIPT_DIR=$(dirname "$0")
LIBVPX_SOURCE_DIR=$(cd ${SCRIPT_DIR}/../..; pwd)
LIPO=$(xcrun -sdk iphoneos${SDK} -find lipo)
ORIG_PWD="$(pwd)"
TARGETS="arm64-darwin-gcc
armv7-darwin-gcc
armv7s-darwin-gcc
x86-iphonesimulator-gcc
x86_64-iphonesimulator-gcc"
ARM_TARGETS="arm64-darwin-gcc
armv7-darwin-gcc
armv7s-darwin-gcc"
SIM_TARGETS="x86-iphonesimulator-gcc
x86_64-iphonesimulator-gcc"
OSX_TARGETS="x86-darwin16-gcc
x86_64-darwin16-gcc"
TARGETS="${ARM_TARGETS} ${SIM_TARGETS}"
# Configures for the target specified by $1, and invokes make with the dist
# target using $DIST_DIR as the distribution output directory.
build_target() {
local target="$1"
local old_pwd="$(pwd)"
local target_specific_flags=""
vlog "***Building target: ${target}***"
case "${target}" in
x86-*)
target_specific_flags="--enable-pic"
vlog "Enabled PIC for ${target}"
;;
esac
mkdir "${target}"
cd "${target}"
eval "${LIBVPX_SOURCE_DIR}/configure" --target="${target}" \
${CONFIGURE_ARGS} ${EXTRA_CONFIGURE_ARGS} ${devnull}
${CONFIGURE_ARGS} ${EXTRA_CONFIGURE_ARGS} ${target_specific_flags} \
${devnull}
export DIST_DIR
eval make -j ${MAKE_JOBS} dist ${devnull}
eval make dist ${devnull}
cd "${old_pwd}"
vlog "***Done building target: ${target}***"
@ -126,6 +138,44 @@ create_vpx_framework_config_shim() {
printf "#endif // ${include_guard}" >> "${config_file}"
}
# Verifies that $FRAMEWORK_LIB fat library contains requested builds.
verify_framework_targets() {
local requested_cpus=""
local cpu=""
# Extract CPU from full target name.
for target; do
cpu="${target%%-*}"
if [ "${cpu}" = "x86" ]; then
# lipo -info outputs i386 for libvpx x86 targets.
cpu="i386"
fi
requested_cpus="${requested_cpus}${cpu} "
done
# Get target CPUs present in framework library.
local targets_built=$(${LIPO} -info ${FRAMEWORK_LIB})
# $LIPO -info outputs a string like the following:
# Architectures in the fat file: $FRAMEWORK_LIB <architectures>
# Capture only the architecture strings.
targets_built=${targets_built##*: }
# Sort CPU strings to make the next step a simple string compare.
local actual=$(echo ${targets_built} | tr " " "\n" | sort | tr "\n" " ")
local requested=$(echo ${requested_cpus} | tr " " "\n" | sort | tr "\n" " ")
vlog "Requested ${FRAMEWORK_LIB} CPUs: ${requested}"
vlog "Actual ${FRAMEWORK_LIB} CPUs: ${actual}"
if [ "${requested}" != "${actual}" ]; then
elog "Actual ${FRAMEWORK_LIB} targets do not match requested target list."
elog " Requested target CPUs: ${requested}"
elog " Actual target CPUs: ${actual}"
return 1
fi
}
# Configures and builds each target specified by $1, and then builds
# VPX.framework.
build_framework() {
@ -146,7 +196,12 @@ build_framework() {
for target in ${targets}; do
build_target "${target}"
target_dist_dir="${BUILD_ROOT}/${target}/${DIST_DIR}"
lib_list="${lib_list} ${target_dist_dir}/lib/libvpx.a"
if [ "${ENABLE_SHARED}" = "yes" ]; then
local suffix="dylib"
else
local suffix="a"
fi
lib_list="${lib_list} ${target_dist_dir}/lib/libvpx.${suffix}"
done
cd "${ORIG_PWD}"
@ -165,13 +220,25 @@ build_framework() {
# Copy in vpx_version.h.
cp -p "${BUILD_ROOT}/${target}/vpx_version.h" "${HEADER_DIR}"
vlog "Created fat library ${FRAMEWORK_DIR}/VPX containing:"
if [ "${ENABLE_SHARED}" = "yes" ]; then
# Adjust the dylib's name so dynamic linking in apps works as expected.
install_name_tool -id '@rpath/VPX.framework/VPX' ${FRAMEWORK_DIR}/VPX
# Copy in Info.plist.
cat "${SCRIPT_DIR}/ios-Info.plist" \
| sed "s/\${FULLVERSION}/${FULLVERSION}/g" \
| sed "s/\${VERSION}/${VERSION}/g" \
| sed "s/\${IOS_VERSION_MIN}/${IOS_VERSION_MIN}/g" \
> "${FRAMEWORK_DIR}/Info.plist"
fi
# Confirm VPX.framework/VPX contains the targets requested.
verify_framework_targets ${targets}
vlog "Created fat library ${FRAMEWORK_LIB} containing:"
for lib in ${lib_list}; do
vlog " $(echo ${lib} | awk -F / '{print $2, $NF}')"
done
# TODO(tomfinegan): Verify that expected targets are included within
# VPX.framework/VPX via lipo -info.
}
# Trap function. Cleans up the subtree used to build all targets contained in
@ -189,16 +256,30 @@ cleanup() {
fi
}
print_list() {
local indent="$1"
shift
local list="$@"
for entry in ${list}; do
echo "${indent}${entry}"
done
}
iosbuild_usage() {
cat << EOF
Usage: ${0##*/} [arguments]
--help: Display this message and exit.
--enable-shared: Build a dynamic framework for use on iOS 8 or later.
--extra-configure-args <args>: Extra args to pass when configuring libvpx.
--jobs: Number of make jobs.
--macosx: Uses darwin16 targets instead of iphonesimulator targets for x86
and x86_64. Allows linking to framework when builds target MacOSX
instead of iOS.
--preserve-build-output: Do not delete the build directory.
--show-build-output: Show output from each library build.
--targets <targets>: Override default target list. Defaults:
${TARGETS}
$(print_list " " ${TARGETS})
--test-link: Confirms all targets can be linked. Functionally identical to
passing --enable-examples via --extra-configure-args.
--verbose: Output information about the environment and each stage of the
build.
EOF
@ -227,9 +308,8 @@ while [ -n "$1" ]; do
iosbuild_usage
exit
;;
--jobs)
MAKE_JOBS="$2"
shift
--enable-shared)
ENABLE_SHARED=yes
;;
--preserve-build-output)
PRESERVE_BUILD_OUTPUT=yes
@ -237,10 +317,16 @@ while [ -n "$1" ]; do
--show-build-output)
devnull=
;;
--test-link)
EXTRA_CONFIGURE_ARGS="${EXTRA_CONFIGURE_ARGS} --enable-examples"
;;
--targets)
TARGETS="$2"
shift
;;
--macosx)
TARGETS="${ARM_TARGETS} ${OSX_TARGETS}"
;;
--verbose)
VERBOSE=yes
;;
@ -252,6 +338,21 @@ while [ -n "$1" ]; do
shift
done
if [ "${ENABLE_SHARED}" = "yes" ]; then
CONFIGURE_ARGS="--enable-shared ${CONFIGURE_ARGS}"
fi
FULLVERSION=$("${SCRIPT_DIR}"/version.sh --bare "${LIBVPX_SOURCE_DIR}")
VERSION=$(echo "${FULLVERSION}" | sed -E 's/^v([0-9]+\.[0-9]+\.[0-9]+).*$/\1/')
if [ "$ENABLE_SHARED" = "yes" ]; then
IOS_VERSION_OPTIONS="--enable-shared"
IOS_VERSION_MIN="8.0"
else
IOS_VERSION_OPTIONS=""
IOS_VERSION_MIN="6.0"
fi
if [ "${VERBOSE}" = "yes" ]; then
cat << EOF
BUILD_ROOT=${BUILD_ROOT}
@ -259,16 +360,24 @@ cat << EOF
CONFIGURE_ARGS=${CONFIGURE_ARGS}
EXTRA_CONFIGURE_ARGS=${EXTRA_CONFIGURE_ARGS}
FRAMEWORK_DIR=${FRAMEWORK_DIR}
FRAMEWORK_LIB=${FRAMEWORK_LIB}
HEADER_DIR=${HEADER_DIR}
MAKE_JOBS=${MAKE_JOBS}
PRESERVE_BUILD_OUTPUT=${PRESERVE_BUILD_OUTPUT}
LIBVPX_SOURCE_DIR=${LIBVPX_SOURCE_DIR}
LIPO=${LIPO}
MAKEFLAGS=${MAKEFLAGS}
ORIG_PWD=${ORIG_PWD}
TARGETS="${TARGETS}"
PRESERVE_BUILD_OUTPUT=${PRESERVE_BUILD_OUTPUT}
TARGETS="$(print_list "" ${TARGETS})"
ENABLE_SHARED=${ENABLE_SHARED}
OSX_TARGETS="${OSX_TARGETS}"
SIM_TARGETS="${SIM_TARGETS}"
SCRIPT_DIR="${SCRIPT_DIR}"
FULLVERSION="${FULLVERSION}"
VERSION="${VERSION}"
IOS_VERSION_MIN="${IOS_VERSION_MIN}"
EOF
fi
build_framework "${TARGETS}"
echo "Successfully built '${FRAMEWORK_DIR}' for:"
echo " ${TARGETS}"
print_list "" ${TARGETS}

View File

@ -39,11 +39,21 @@ fix_path() {
}
# Corrects the paths in file_list in one pass for efficiency.
# $1 is the name of the array to be modified.
fix_file_list() {
# TODO(jzern): this could be more generic and take the array as a param.
files=$(fix_path "${file_list[@]}")
if [ "${FIXPATH}" = "echo_path" ] ; then
# When used with echo_path, fix_file_list is a no-op. Avoid warning about
# unsupported 'declare -n' when it is not important.
return 0
elif [ "${BASH_VERSINFO}" -lt 4 ] ; then
echo "Cygwin path conversion has failed. Please use a version of bash"
echo "which supports nameref (-n), introduced in bash 4.3"
return 1
fi
declare -n array_ref=$1
files=$(fix_path "${array_ref[@]}")
local IFS=$'\n'
file_list=($files)
array_ref=($files)
}
generate_uuid() {

View File

@ -1,4 +1,13 @@
#!/usr/bin/env perl
##
## Copyright (c) 2017 The WebM project authors. All Rights Reserved.
##
## Use of this source code is governed by a BSD-style license
## that can be found in the LICENSE file in the root of the source
## tree. An additional intellectual property rights grant can be found
## in the file PATENTS. All contributing project authors may
## be found in the AUTHORS file in the root of the source tree.
##
no strict 'refs';
use warnings;
@ -200,6 +209,7 @@ sub filter {
sub common_top() {
my $include_guard = uc($opts{sym})."_H_";
print <<EOF;
// This file is generated. Do not edit.
#ifndef ${include_guard}
#define ${include_guard}
@ -319,15 +329,46 @@ EOF
print <<EOF;
#if HAVE_DSPR2
void vpx_dsputil_static_init();
#if CONFIG_VP8
void dsputil_static_init();
#endif
vpx_dsputil_static_init();
#if CONFIG_VP8
dsputil_static_init();
#endif
#if CONFIG_VP9
void vp9_dsputil_static_init();
vp9_dsputil_static_init();
#endif
}
#endif
EOF
common_bottom;
}
sub ppc() {
determine_indirection("c", @ALL_ARCHS);
# Assign the helper variable for each enabled extension
foreach my $opt (@ALL_ARCHS) {
my $opt_uc = uc $opt;
eval "\$have_${opt}=\"flags & HAS_${opt_uc}\"";
}
common_top;
print <<EOF;
#include "vpx_config.h"
#ifdef RTCD_C
#include "vpx_ports/ppc.h"
static void setup_rtcd_internal(void)
{
int flags = ppc_simd_caps();
(void)flags;
EOF
set_function_pointers("c", @ALL_ARCHS);
print <<EOF;
}
#endif
EOF
@ -360,10 +401,10 @@ EOF
&require("c");
if ($opts{arch} eq 'x86') {
@ALL_ARCHS = filter(qw/mmx sse sse2 sse3 ssse3 sse4_1 avx avx2/);
@ALL_ARCHS = filter(qw/mmx sse sse2 sse3 ssse3 sse4_1 avx avx2 avx512/);
x86;
} elsif ($opts{arch} eq 'x86_64') {
@ALL_ARCHS = filter(qw/mmx sse sse2 sse3 ssse3 sse4_1 avx avx2/);
@ALL_ARCHS = filter(qw/mmx sse sse2 sse3 ssse3 sse4_1 avx avx2 avx512/);
@REQUIRES = filter(keys %required ? keys %required : qw/mmx sse sse2/);
&require(@REQUIRES);
x86;
@ -380,20 +421,22 @@ if ($opts{arch} eq 'x86') {
@ALL_ARCHS = filter("$opts{arch}", qw/msa/);
last;
}
if (/HAVE_MMI=yes/) {
@ALL_ARCHS = filter("$opts{arch}", qw/mmi/);
last;
}
}
close CONFIG_FILE;
mips;
} elsif ($opts{arch} eq 'armv6') {
@ALL_ARCHS = filter(qw/media/);
arm;
} elsif ($opts{arch} =~ /armv7\w?/) {
@ALL_ARCHS = filter(qw/media neon_asm neon/);
@REQUIRES = filter(keys %required ? keys %required : qw/media/);
&require(@REQUIRES);
@ALL_ARCHS = filter(qw/neon_asm neon/);
arm;
} elsif ($opts{arch} eq 'armv8' || $opts{arch} eq 'arm64' ) {
@ALL_ARCHS = filter(qw/neon/);
arm;
} elsif ($opts{arch} =~ /^ppc/ ) {
@ALL_ARCHS = filter(qw/vsx/);
ppc;
} else {
unoptimized;
}

View File

@ -54,13 +54,6 @@ sub FixThumbInstructions($$)
# "addne r0, r0, r2".
s/^(\s*)((ldr|str)(ne)?[bhd]?)(\s+)(\w+),(\s*\w+,)?\s*\[(\w+)\],\s*(\w+)/$1$2$5$6,$7 [$8]\n$1add$4$5$8, $8, $9/g;
# Convert a conditional addition to the pc register into a series of
# instructions. This converts "addlt pc, pc, r3, lsl #2" into
# "itttt lt", "movlt.n r12, pc", "addlt.w r12, #12",
# "addlt.w r12, r12, r3, lsl #2", "movlt.n pc, r12".
# This assumes that r12 is free at this point.
s/^(\s*)addlt(\s+)pc,\s*pc,\s*(\w+),\s*lsl\s*#(\d+)/$1itttt$2lt\n$1movlt.n$2r12, pc\n$1addlt.w$2r12, #12\n$1addlt.w$2r12, r12, $3, lsl #($4-$branch_shift_offset)\n$1movlt.n$2pc, r12/g;
# Convert "mov pc, lr" into "bx lr", since the former only works
# for switching from arm to thumb (and only in armv7), but not
# from thumb to arm.

View File

@ -24,8 +24,9 @@ out_file=${2}
id=${3:-VERSION_STRING}
git_version_id=""
if [ -d "${source_path}/.git" ]; then
if [ -e "${source_path}/.git" ]; then
# Source Path is a git working copy. Check for local modifications.
# Note that git submodules may have a file as .git, not a directory.
export GIT_DIR="${source_path}/.git"
git_version_id=`git describe --match=v[0-9]* 2>/dev/null`
fi
@ -59,6 +60,7 @@ if [ ${bare} ]; then
echo "${changelog_version}${git_version_id}" > $$.tmp
else
cat<<EOF>$$.tmp
// This file is generated. Do not edit.
#define VERSION_MAJOR $major_version
#define VERSION_MINOR $minor_version
#define VERSION_PATCH $patch_version

4
codereview.settings Normal file
View File

@ -0,0 +1,4 @@
# This file is used by git cl to get repository specific information.
GERRIT_HOST: True
CODE_REVIEW_SERVER: chromium-review.googlesource.com
GERRIT_SQUASH_UPLOADS: False

287
configure vendored
View File

@ -22,6 +22,7 @@ show_help(){
Advanced options:
${toggle_libs} libraries
${toggle_examples} examples
${toggle_tools} tools
${toggle_docs} documentation
${toggle_unit_tests} unit tests
${toggle_decode_perf_tests} build decoder perf tests with unit tests
@ -31,16 +32,16 @@ Advanced options:
--size-limit=WxH max size to allow in the decoder
--as={yasm|nasm|auto} use specified assembler [auto, yasm preferred]
--sdk-path=PATH path to root of sdk (android builds only)
${toggle_fast_unaligned} don't use unaligned accesses, even when
supported by hardware [auto]
${toggle_codec_srcs} in/exclude codec library source code
${toggle_debug_libs} in/exclude debug version of libraries
${toggle_static_msvcrt} use static MSVCRT (VS builds only)
${toggle_vp9_highbitdepth} use VP9 high bit depth (10/12) profiles
${toggle_better_hw_compatibility}
enable encoder to produce streams with better
hardware decoder compatibility
${toggle_vp8} VP8 codec support
${toggle_vp9} VP9 codec support
${toggle_internal_stats} output of encoder internal stats for debug, if supported (encoders)
${toggle_mem_tracker} track memory usage
${toggle_postproc} postprocessing
${toggle_vp9_postproc} vp9 specific postprocessing
${toggle_multithread} multithreaded encoding and decoding
@ -97,27 +98,26 @@ EOF
# all_platforms is a list of all supported target platforms. Maintain
# alphabetically by architecture, generic-gnu last.
all_platforms="${all_platforms} armv6-darwin-gcc"
all_platforms="${all_platforms} armv6-linux-rvct"
all_platforms="${all_platforms} armv6-linux-gcc"
all_platforms="${all_platforms} armv6-none-rvct"
all_platforms="${all_platforms} arm64-android-gcc"
all_platforms="${all_platforms} arm64-darwin-gcc"
all_platforms="${all_platforms} arm64-linux-gcc"
all_platforms="${all_platforms} arm64-win64-gcc"
all_platforms="${all_platforms} armv7-android-gcc" #neon Cortex-A8
all_platforms="${all_platforms} armv7-darwin-gcc" #neon Cortex-A8
all_platforms="${all_platforms} armv7-linux-rvct" #neon Cortex-A8
all_platforms="${all_platforms} armv7-linux-gcc" #neon Cortex-A8
all_platforms="${all_platforms} armv7-none-rvct" #neon Cortex-A8
all_platforms="${all_platforms} armv7-win32-gcc"
all_platforms="${all_platforms} armv7-win32-vs11"
all_platforms="${all_platforms} armv7-win32-vs12"
all_platforms="${all_platforms} armv7-win32-vs14"
all_platforms="${all_platforms} armv7-win32-vs15"
all_platforms="${all_platforms} armv7s-darwin-gcc"
all_platforms="${all_platforms} armv8-linux-gcc"
all_platforms="${all_platforms} mips32-linux-gcc"
all_platforms="${all_platforms} mips64-linux-gcc"
all_platforms="${all_platforms} ppc32-darwin8-gcc"
all_platforms="${all_platforms} ppc32-darwin9-gcc"
all_platforms="${all_platforms} ppc32-linux-gcc"
all_platforms="${all_platforms} ppc64-darwin8-gcc"
all_platforms="${all_platforms} ppc64-darwin9-gcc"
all_platforms="${all_platforms} ppc64-linux-gcc"
all_platforms="${all_platforms} ppc64le-linux-gcc"
all_platforms="${all_platforms} sparc-solaris-gcc"
all_platforms="${all_platforms} x86-android-gcc"
all_platforms="${all_platforms} x86-darwin8-gcc"
@ -129,57 +129,59 @@ all_platforms="${all_platforms} x86-darwin11-gcc"
all_platforms="${all_platforms} x86-darwin12-gcc"
all_platforms="${all_platforms} x86-darwin13-gcc"
all_platforms="${all_platforms} x86-darwin14-gcc"
all_platforms="${all_platforms} x86-darwin15-gcc"
all_platforms="${all_platforms} x86-darwin16-gcc"
all_platforms="${all_platforms} x86-darwin17-gcc"
all_platforms="${all_platforms} x86-iphonesimulator-gcc"
all_platforms="${all_platforms} x86-linux-gcc"
all_platforms="${all_platforms} x86-linux-icc"
all_platforms="${all_platforms} x86-os2-gcc"
all_platforms="${all_platforms} x86-solaris-gcc"
all_platforms="${all_platforms} x86-win32-gcc"
all_platforms="${all_platforms} x86-win32-vs7"
all_platforms="${all_platforms} x86-win32-vs8"
all_platforms="${all_platforms} x86-win32-vs9"
all_platforms="${all_platforms} x86-win32-vs10"
all_platforms="${all_platforms} x86-win32-vs11"
all_platforms="${all_platforms} x86-win32-vs12"
all_platforms="${all_platforms} x86-win32-vs14"
all_platforms="${all_platforms} x86-win32-vs15"
all_platforms="${all_platforms} x86_64-android-gcc"
all_platforms="${all_platforms} x86_64-darwin9-gcc"
all_platforms="${all_platforms} x86_64-darwin10-gcc"
all_platforms="${all_platforms} x86_64-darwin11-gcc"
all_platforms="${all_platforms} x86_64-darwin12-gcc"
all_platforms="${all_platforms} x86_64-darwin13-gcc"
all_platforms="${all_platforms} x86_64-darwin14-gcc"
all_platforms="${all_platforms} x86_64-darwin15-gcc"
all_platforms="${all_platforms} x86_64-darwin16-gcc"
all_platforms="${all_platforms} x86_64-darwin17-gcc"
all_platforms="${all_platforms} x86_64-iphonesimulator-gcc"
all_platforms="${all_platforms} x86_64-linux-gcc"
all_platforms="${all_platforms} x86_64-linux-icc"
all_platforms="${all_platforms} x86_64-solaris-gcc"
all_platforms="${all_platforms} x86_64-win64-gcc"
all_platforms="${all_platforms} x86_64-win64-vs8"
all_platforms="${all_platforms} x86_64-win64-vs9"
all_platforms="${all_platforms} x86_64-win64-vs10"
all_platforms="${all_platforms} x86_64-win64-vs11"
all_platforms="${all_platforms} x86_64-win64-vs12"
all_platforms="${all_platforms} universal-darwin8-gcc"
all_platforms="${all_platforms} universal-darwin9-gcc"
all_platforms="${all_platforms} universal-darwin10-gcc"
all_platforms="${all_platforms} universal-darwin11-gcc"
all_platforms="${all_platforms} universal-darwin12-gcc"
all_platforms="${all_platforms} universal-darwin13-gcc"
all_platforms="${all_platforms} universal-darwin14-gcc"
all_platforms="${all_platforms} x86_64-win64-vs14"
all_platforms="${all_platforms} x86_64-win64-vs15"
all_platforms="${all_platforms} generic-gnu"
# all_targets is a list of all targets that can be configured
# note that these should be in dependency order for now.
all_targets="libs examples docs"
all_targets="libs examples tools docs"
# all targets available are enabled, by default.
for t in ${all_targets}; do
[ -f "${source_path}/${t}.mk" ] && enable_feature ${t}
done
if ! diff --version >/dev/null; then
die "diff missing: Try installing diffutils via your package manager."
fi
if ! perl --version >/dev/null; then
die "Perl is required to build"
fi
if [ "`cd \"${source_path}\" && pwd`" != "`pwd`" ]; then
# test to see if source_path already configured
if [ -f "${source_path}/vpx_config.h" ]; then
@ -200,6 +202,10 @@ if [ ${doxy_major:-0} -ge 1 ]; then
[ $doxy_minor -eq 5 ] && [ $doxy_patch -ge 3 ] && enable_feature doxygen
fi
# disable codecs when their source directory does not exist
[ -d "${source_path}/vp8" ] || disable_codec vp8
[ -d "${source_path}/vp9" ] || disable_codec vp9
# install everything except the sources, by default. sources will have
# to be enabled when doing dist builds, since that's no longer a common
# case.
@ -210,57 +216,30 @@ enable_feature install_libs
enable_feature static
enable_feature optimizations
enable_feature dependency_tracking
enable_feature fast_unaligned #allow unaligned accesses, if supported by hw
enable_feature spatial_resampling
enable_feature multithread
enable_feature os_support
enable_feature temporal_denoising
[ -d "${source_path}/../include" ] && enable_feature alt_tree_layout
for d in vp8 vp9; do
[ -d "${source_path}/${d}" ] && disable_feature alt_tree_layout;
done
if ! enabled alt_tree_layout; then
# development environment
[ -d "${source_path}/vp8" ] && CODECS="${CODECS} vp8_encoder vp8_decoder"
[ -d "${source_path}/vp9" ] && CODECS="${CODECS} vp9_encoder vp9_decoder"
else
# customer environment
[ -f "${source_path}/../include/vpx/vp8cx.h" ] && CODECS="${CODECS} vp8_encoder"
[ -f "${source_path}/../include/vpx/vp8dx.h" ] && CODECS="${CODECS} vp8_decoder"
[ -f "${source_path}/../include/vpx/vp9cx.h" ] && CODECS="${CODECS} vp9_encoder"
[ -f "${source_path}/../include/vpx/vp9dx.h" ] && CODECS="${CODECS} vp9_decoder"
[ -f "${source_path}/../include/vpx/vp8cx.h" ] || disable_feature vp8_encoder
[ -f "${source_path}/../include/vpx/vp8dx.h" ] || disable_feature vp8_decoder
[ -f "${source_path}/../include/vpx/vp9cx.h" ] || disable_feature vp9_encoder
[ -f "${source_path}/../include/vpx/vp9dx.h" ] || disable_feature vp9_decoder
[ -f "${source_path}/../lib/*/*mt.lib" ] && soft_enable static_msvcrt
fi
CODECS="$(echo ${CODECS} | tr ' ' '\n')"
CODEC_FAMILIES="$(for c in ${CODECS}; do echo ${c%_*}; done | sort | uniq)"
CODECS="
vp8_encoder
vp8_decoder
vp9_encoder
vp9_decoder
"
CODEC_FAMILIES="
vp8
vp9
"
ARCH_LIST="
arm
mips
x86
x86_64
ppc32
ppc64
ppc
"
ARCH_EXT_LIST="
edsp
media
neon
neon_asm
mips32
dspr2
msa
mips64
ARCH_EXT_LIST_X86="
mmx
sse
sse2
@ -269,20 +248,35 @@ ARCH_EXT_LIST="
sse4_1
avx
avx2
avx512
"
altivec
ARCH_EXT_LIST_LOONGSON="
mmi
"
ARCH_EXT_LIST="
neon
neon_asm
mips32
dspr2
msa
mips64
${ARCH_EXT_LIST_X86}
vsx
${ARCH_EXT_LIST_LOONGSON}
"
HAVE_LIST="
${ARCH_EXT_LIST}
vpx_ports
stdint_h
alt_tree_layout
pthread_h
sys_mman_h
unistd_h
"
EXPERIMENT_LIST="
spatial_svc
fp_mb_stats
emulate_hardware
"
@ -293,7 +287,6 @@ CONFIG_LIST="
install_bins
install_libs
install_srcs
use_x86inc
debug
gprof
gcov
@ -305,10 +298,6 @@ CONFIG_LIST="
codec_srcs
debug_libs
fast_unaligned
mem_manager
mem_tracker
mem_checks
dequant_tokens
dc_recon
@ -341,8 +330,10 @@ CONFIG_LIST="
vp9_temporal_denoising
coefficient_range_checking
vp9_highbitdepth
better_hw_compatibility
experimental
size_limit
always_adjust_bpm
${EXPERIMENT_LIST}
"
CMDLINE_SELECT="
@ -358,7 +349,6 @@ CMDLINE_SELECT="
gprof
gcov
pic
use_x86inc
optimizations
ccache
runtime_cpu_detect
@ -366,11 +356,11 @@ CMDLINE_SELECT="
libs
examples
tools
docs
libc
as
size_limit
fast_unaligned
codec_srcs
debug_libs
@ -383,7 +373,6 @@ CMDLINE_SELECT="
${CODECS}
${CODEC_FAMILIES}
static_msvcrt
mem_tracker
spatial_resampling
realtime_only
onthefly_bitpacking
@ -401,23 +390,29 @@ CMDLINE_SELECT="
temporal_denoising
vp9_temporal_denoising
coefficient_range_checking
better_hw_compatibility
vp9_highbitdepth
experimental
always_adjust_bpm
"
process_cmdline() {
for opt do
optval="${opt#*=}"
case "$opt" in
--disable-codecs) for c in ${CODECS}; do disable_feature $c; done ;;
--disable-codecs)
for c in ${CODEC_FAMILIES}; do disable_codec $c; done
;;
--enable-?*|--disable-?*)
eval `echo "$opt" | sed 's/--/action=/;s/-/ option=/;s/-/_/g'`
if echo "${EXPERIMENT_LIST}" | grep "^ *$option\$" >/dev/null; then
if is_in ${option} ${EXPERIMENT_LIST}; then
if enabled experimental; then
${action}_feature $option
else
log_echo "Ignoring $opt -- not in experimental mode."
fi
elif is_in ${option} "${CODECS} ${CODEC_FAMILIES}"; then
${action}_codec ${option}
else
process_common_cmdline $opt
fi
@ -431,14 +426,6 @@ process_cmdline() {
post_process_cmdline() {
c=""
# If the codec family is disabled, disable all components of that family.
# If the codec family is enabled, enable all components of that family.
log_echo "Configuring selected codecs"
for c in ${CODECS}; do
disabled ${c%%_*} && disable_feature ${c}
enabled ${c%%_*} && enable_feature ${c}
done
# Enable all detected codecs, if they haven't been disabled
for c in ${CODECS}; do soft_enable $c; done
@ -456,22 +443,8 @@ post_process_cmdline() {
process_targets() {
enabled child || write_common_config_banner
enabled universal || write_common_target_config_h ${BUILD_PFX}vpx_config.h
# For fat binaries, call configure recursively to configure for each
# binary architecture to be included.
if enabled universal; then
# Call configure (ourselves) for each subarchitecture
for arch in $fat_bin_archs; do
BUILD_PFX=${arch}/ toolchain=${arch} $self --child $cmdline_args || exit $?
done
fi
# The write_common_config (config.mk) logic is deferred until after the
# recursive calls to configure complete, because we want our universal
# targets to be executed last.
write_common_target_config_h ${BUILD_PFX}vpx_config.h
write_common_config_targets
enabled universal && echo "FAT_ARCHS=${fat_bin_archs}" >> config.mk
# Calculate the default distribution name, based on the enabled features
cf=""
@ -530,7 +503,7 @@ EOF
#
# Write makefiles for all enabled targets
#
for tgt in libs examples docs solution; do
for tgt in libs examples tools docs solution; do
tgt_fn="$tgt-$toolchain.mk"
if enabled $tgt; then
@ -547,13 +520,18 @@ process_detect() {
# Can only build shared libs on a subset of platforms. Doing this check
# here rather than at option parse time because the target auto-detect
# magic happens after the command line has been parsed.
if ! enabled linux; then
case "${tgt_os}" in
linux|os2|darwin*|iphonesimulator*)
# Supported platforms
;;
*)
if enabled gnu; then
echo "--enable-shared is only supported on ELF; assuming this is OK"
else
die "--enable-shared only supported on ELF for now"
die "--enable-shared only supported on ELF, OS/2, and Darwin for now"
fi
fi
;;
esac
fi
if [ -z "$CC" ] || enabled external_build; then
echo "Bypassing toolchain for environment detection."
@ -580,16 +558,12 @@ process_detect() {
# Specialize windows and POSIX environments.
case $toolchain in
*-win*-*)
case $header-$toolchain in
stdint*-gcc) true;;
*) false;;
esac && enable_feature $var
;;
# Don't check for any headers in Windows builds.
false
;;
*)
case $header in
stdint.h) true;;
pthread.h) true;;
sys/mman.h) true;;
unistd.h) true;;
*) false;;
esac && enable_feature $var
@ -605,9 +579,7 @@ process_detect() {
int main(void) {return 0;}
EOF
# check system headers
check_header stdint.h
check_header pthread.h
check_header sys/mman.h
check_header unistd.h # for sysconf(3) and friends.
check_header vpx/vpx_integer.h -I${source_path} && enable_feature vpx_ports
@ -616,53 +588,37 @@ EOF
process_toolchain() {
process_common_toolchain
# Handle universal binaries for this architecture
case $toolchain in
universal-darwin*)
darwin_ver=${tgt_os##darwin}
# Snow Leopard (10.6/darwin10) dropped support for PPC
# Include PPC support for all prior versions
if [ $darwin_ver -lt 10 ]; then
fat_bin_archs="$fat_bin_archs ppc32-${tgt_os}-gcc"
fi
# Tiger (10.4/darwin8) brought support for x86
if [ $darwin_ver -ge 8 ]; then
fat_bin_archs="$fat_bin_archs x86-${tgt_os}-${tgt_cc}"
fi
# Leopard (10.5/darwin9) brought 64 bit support
if [ $darwin_ver -ge 9 ]; then
fat_bin_archs="$fat_bin_archs x86_64-${tgt_os}-${tgt_cc}"
fi
;;
esac
# Enable some useful compiler flags
if enabled gcc; then
enabled werror && check_add_cflags -Werror
check_add_cflags -Wall
check_add_cflags -Wdeclaration-after-statement
check_add_cflags -Wdisabled-optimization
check_add_cflags -Wfloat-conversion
check_add_cflags -Wparentheses-equality
check_add_cflags -Wpointer-arith
check_add_cflags -Wtype-limits
check_add_cflags -Wcast-qual
check_add_cflags -Wvla
check_add_cflags -Wimplicit-function-declaration
check_add_cflags -Wuninitialized
check_add_cflags -Wunused-variable
case ${CC} in
*clang*)
# libvpx and/or clang have issues with aliasing:
# https://code.google.com/p/webm/issues/detail?id=603
# work around them until they are fixed
check_add_cflags -fno-strict-aliasing
;;
*) check_add_cflags -Wunused-but-set-variable ;;
esac
enabled extra_warnings || check_add_cflags -Wno-unused-function
check_add_cflags -Wunused
# -Wextra has some tricky cases. Rather than fix them all now, get the
# flag for as many files as possible and fix the remaining issues
# piecemeal.
# https://bugs.chromium.org/p/webm/issues/detail?id=1069
check_add_cflags -Wextra
# check_add_cflags also adds to cxxflags. gtest does not do well with
# these flags so add them explicitly to CFLAGS only.
check_cflags -Wundef && add_cflags_only -Wundef
check_cflags -Wframe-larger-than=52000 && \
add_cflags_only -Wframe-larger-than=52000
if enabled mips || [ -z "${INLINE}" ]; then
enabled extra_warnings || check_add_cflags -Wno-unused-function
fi
# Avoid this warning for third_party C++ sources. Some reorganization
# would be needed to apply this only to test/*.cc.
check_cflags -Wshorten-64-to-32 && add_cflags_only -Wshorten-64-to-32
fi
if enabled icc; then
@ -710,24 +666,16 @@ process_toolchain() {
vs*) enable_feature msvs
enable_feature solution
vs_version=${tgt_cc##vs}
case $vs_version in
[789])
VCPROJ_SFX=vcproj
gen_vcproj_cmd=${source_path}/build/make/gen_msvs_proj.sh
;;
10|11|12)
VCPROJ_SFX=vcxproj
gen_vcproj_cmd=${source_path}/build/make/gen_msvs_vcxproj.sh
enabled werror && gen_vcproj_cmd="${gen_vcproj_cmd} --enable-werror"
;;
esac
VCPROJ_SFX=vcxproj
gen_vcproj_cmd=${source_path}/build/make/gen_msvs_vcxproj.sh
enabled werror && gen_vcproj_cmd="${gen_vcproj_cmd} --enable-werror"
all_targets="${all_targets} solution"
INLINE="__forceinline"
INLINE="__inline"
;;
esac
# Other toolchain specific defaults
case $toolchain in x86*|ppc*|universal*) soft_enable postproc;; esac
case $toolchain in x86*) soft_enable postproc;; esac
if enabled postproc_visualizer; then
enabled postproc || die "postproc_visualizer requires postproc to be enabled"
@ -781,6 +729,16 @@ EOF
esac
# libwebm needs to be linked with C++ standard library
enabled webm_io && LD=${CXX}
# append any user defined extra cflags
if [ -n "${extra_cflags}" ] ; then
check_add_cflags ${extra_cflags} || \
die "Requested extra CFLAGS '${extra_cflags}' not supported by compiler"
fi
if [ -n "${extra_cxxflags}" ]; then
check_add_cxxflags ${extra_cxxflags} || \
die "Requested extra CXXFLAGS '${extra_cxxflags}' not supported by compiler"
fi
}
@ -791,6 +749,7 @@ CONFIGURE_ARGS="$@"
process "$@"
print_webm_license ${BUILD_PFX}vpx_config.c "/*" " */"
cat <<EOF >> ${BUILD_PFX}vpx_config.c
#include "vpx/vpx_codec.h"
static const char* const cfg = "$CONFIGURE_ARGS";
const char *vpx_codec_build_config(void) {return cfg;}
EOF

View File

@ -22,33 +22,44 @@ LIBYUV_SRCS += third_party/libyuv/include/libyuv/basic_types.h \
third_party/libyuv/source/planar_functions.cc \
third_party/libyuv/source/row_any.cc \
third_party/libyuv/source/row_common.cc \
third_party/libyuv/source/row_gcc.cc \
third_party/libyuv/source/row_mips.cc \
third_party/libyuv/source/row_neon.cc \
third_party/libyuv/source/row_neon64.cc \
third_party/libyuv/source/row_posix.cc \
third_party/libyuv/source/row_win.cc \
third_party/libyuv/source/scale.cc \
third_party/libyuv/source/scale_any.cc \
third_party/libyuv/source/scale_common.cc \
third_party/libyuv/source/scale_gcc.cc \
third_party/libyuv/source/scale_mips.cc \
third_party/libyuv/source/scale_neon.cc \
third_party/libyuv/source/scale_neon64.cc \
third_party/libyuv/source/scale_posix.cc \
third_party/libyuv/source/scale_win.cc \
LIBWEBM_MUXER_SRCS += third_party/libwebm/mkvmuxer.cpp \
third_party/libwebm/mkvmuxerutil.cpp \
third_party/libwebm/mkvwriter.cpp \
third_party/libwebm/mkvmuxer.hpp \
third_party/libwebm/mkvmuxertypes.hpp \
third_party/libwebm/mkvmuxerutil.hpp \
third_party/libwebm/mkvparser.hpp \
third_party/libwebm/mkvwriter.hpp \
third_party/libwebm/webmids.hpp
LIBWEBM_COMMON_SRCS += third_party/libwebm/common/hdr_util.cc \
third_party/libwebm/common/hdr_util.h \
third_party/libwebm/common/webmids.h
LIBWEBM_MUXER_SRCS += third_party/libwebm/mkvmuxer/mkvmuxer.cc \
third_party/libwebm/mkvmuxer/mkvmuxerutil.cc \
third_party/libwebm/mkvmuxer/mkvwriter.cc \
third_party/libwebm/mkvmuxer/mkvmuxer.h \
third_party/libwebm/mkvmuxer/mkvmuxertypes.h \
third_party/libwebm/mkvmuxer/mkvmuxerutil.h \
third_party/libwebm/mkvparser/mkvparser.h \
third_party/libwebm/mkvmuxer/mkvwriter.h
LIBWEBM_PARSER_SRCS = third_party/libwebm/mkvparser/mkvparser.cc \
third_party/libwebm/mkvparser/mkvreader.cc \
third_party/libwebm/mkvparser/mkvparser.h \
third_party/libwebm/mkvparser/mkvreader.h
# Add compile flags and include path for libwebm sources.
ifeq ($(CONFIG_WEBM_IO),yes)
CXXFLAGS += -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS
INC_PATH-yes += $(SRC_PATH_BARE)/third_party/libwebm
endif
LIBWEBM_PARSER_SRCS = third_party/libwebm/mkvparser.cpp \
third_party/libwebm/mkvreader.cpp \
third_party/libwebm/mkvparser.hpp \
third_party/libwebm/mkvreader.hpp
# List of examples to build. UTILS are tools meant for distribution
# while EXAMPLES demonstrate specific portions of the API.
@ -56,6 +67,7 @@ UTILS-$(CONFIG_DECODERS) += vpxdec.c
vpxdec.SRCS += md5_utils.c md5_utils.h
vpxdec.SRCS += vpx_ports/mem_ops.h
vpxdec.SRCS += vpx_ports/mem_ops_aligned.h
vpxdec.SRCS += vpx_ports/msvc.h
vpxdec.SRCS += vpx_ports/vpx_timer.h
vpxdec.SRCS += vpx/vpx_integer.h
vpxdec.SRCS += args.c args.h
@ -64,8 +76,11 @@ vpxdec.SRCS += tools_common.c tools_common.h
vpxdec.SRCS += y4menc.c y4menc.h
ifeq ($(CONFIG_LIBYUV),yes)
vpxdec.SRCS += $(LIBYUV_SRCS)
$(BUILD_PFX)third_party/libyuv/%.cc.o: CXXFLAGS += -Wno-unused-parameter
endif
ifeq ($(CONFIG_WEBM_IO),yes)
vpxdec.SRCS += $(LIBWEBM_COMMON_SRCS)
vpxdec.SRCS += $(LIBWEBM_MUXER_SRCS)
vpxdec.SRCS += $(LIBWEBM_PARSER_SRCS)
vpxdec.SRCS += webmdec.cc webmdec.h
endif
@ -80,28 +95,31 @@ vpxenc.SRCS += tools_common.c tools_common.h
vpxenc.SRCS += warnings.c warnings.h
vpxenc.SRCS += vpx_ports/mem_ops.h
vpxenc.SRCS += vpx_ports/mem_ops_aligned.h
vpxenc.SRCS += vpx_ports/msvc.h
vpxenc.SRCS += vpx_ports/vpx_timer.h
vpxenc.SRCS += vpxstats.c vpxstats.h
ifeq ($(CONFIG_LIBYUV),yes)
vpxenc.SRCS += $(LIBYUV_SRCS)
endif
ifeq ($(CONFIG_WEBM_IO),yes)
vpxenc.SRCS += $(LIBWEBM_COMMON_SRCS)
vpxenc.SRCS += $(LIBWEBM_MUXER_SRCS)
vpxenc.SRCS += $(LIBWEBM_PARSER_SRCS)
vpxenc.SRCS += webmenc.cc webmenc.h
endif
vpxenc.GUID = 548DEC74-7A15-4B2B-AFC3-AA102E7C25C1
vpxenc.DESCRIPTION = Full featured encoder
ifeq ($(CONFIG_SPATIAL_SVC),yes)
EXAMPLES-$(CONFIG_VP9_ENCODER) += vp9_spatial_svc_encoder.c
vp9_spatial_svc_encoder.SRCS += args.c args.h
vp9_spatial_svc_encoder.SRCS += ivfenc.c ivfenc.h
vp9_spatial_svc_encoder.SRCS += tools_common.c tools_common.h
vp9_spatial_svc_encoder.SRCS += video_common.h
vp9_spatial_svc_encoder.SRCS += video_writer.h video_writer.c
vp9_spatial_svc_encoder.SRCS += vpxstats.c vpxstats.h
vp9_spatial_svc_encoder.GUID = 4A38598D-627D-4505-9C7B-D4020C84100D
vp9_spatial_svc_encoder.DESCRIPTION = VP9 Spatial SVC Encoder
endif
EXAMPLES-$(CONFIG_VP9_ENCODER) += vp9_spatial_svc_encoder.c
vp9_spatial_svc_encoder.SRCS += args.c args.h
vp9_spatial_svc_encoder.SRCS += ivfenc.c ivfenc.h
vp9_spatial_svc_encoder.SRCS += tools_common.c tools_common.h
vp9_spatial_svc_encoder.SRCS += video_common.h
vp9_spatial_svc_encoder.SRCS += video_writer.h video_writer.c
vp9_spatial_svc_encoder.SRCS += vpx_ports/msvc.h
vp9_spatial_svc_encoder.SRCS += vpxstats.c vpxstats.h
vp9_spatial_svc_encoder.GUID = 4A38598D-627D-4505-9C7B-D4020C84100D
vp9_spatial_svc_encoder.DESCRIPTION = VP9 Spatial SVC Encoder
ifneq ($(CONFIG_SHARED),yes)
EXAMPLES-$(CONFIG_VP9_ENCODER) += resize_util.c
@ -112,6 +130,7 @@ vpx_temporal_svc_encoder.SRCS += ivfenc.c ivfenc.h
vpx_temporal_svc_encoder.SRCS += tools_common.c tools_common.h
vpx_temporal_svc_encoder.SRCS += video_common.h
vpx_temporal_svc_encoder.SRCS += video_writer.h video_writer.c
vpx_temporal_svc_encoder.SRCS += vpx_ports/msvc.h
vpx_temporal_svc_encoder.GUID = B18C08F2-A439-4502-A78E-849BE3D60947
vpx_temporal_svc_encoder.DESCRIPTION = Temporal SVC Encoder
EXAMPLES-$(CONFIG_DECODERS) += simple_decoder.c
@ -122,6 +141,7 @@ simple_decoder.SRCS += video_common.h
simple_decoder.SRCS += video_reader.h video_reader.c
simple_decoder.SRCS += vpx_ports/mem_ops.h
simple_decoder.SRCS += vpx_ports/mem_ops_aligned.h
simple_decoder.SRCS += vpx_ports/msvc.h
simple_decoder.DESCRIPTION = Simplified decoder loop
EXAMPLES-$(CONFIG_DECODERS) += postproc.c
postproc.SRCS += ivfdec.h ivfdec.c
@ -130,6 +150,7 @@ postproc.SRCS += video_common.h
postproc.SRCS += video_reader.h video_reader.c
postproc.SRCS += vpx_ports/mem_ops.h
postproc.SRCS += vpx_ports/mem_ops_aligned.h
postproc.SRCS += vpx_ports/msvc.h
postproc.GUID = 65E33355-F35E-4088-884D-3FD4905881D7
postproc.DESCRIPTION = Decoder postprocessor control
EXAMPLES-$(CONFIG_DECODERS) += decode_to_md5.c
@ -140,6 +161,7 @@ decode_to_md5.SRCS += video_common.h
decode_to_md5.SRCS += video_reader.h video_reader.c
decode_to_md5.SRCS += vpx_ports/mem_ops.h
decode_to_md5.SRCS += vpx_ports/mem_ops_aligned.h
decode_to_md5.SRCS += vpx_ports/msvc.h
decode_to_md5.GUID = 59120B9B-2735-4BFE-B022-146CA340FE42
decode_to_md5.DESCRIPTION = Frame by frame MD5 checksum
EXAMPLES-$(CONFIG_ENCODERS) += simple_encoder.c
@ -147,6 +169,7 @@ simple_encoder.SRCS += ivfenc.h ivfenc.c
simple_encoder.SRCS += tools_common.h tools_common.c
simple_encoder.SRCS += video_common.h
simple_encoder.SRCS += video_writer.h video_writer.c
simple_encoder.SRCS += vpx_ports/msvc.h
simple_encoder.GUID = 4607D299-8A71-4D2C-9B1D-071899B6FBFD
simple_encoder.DESCRIPTION = Simplified encoder loop
EXAMPLES-$(CONFIG_VP9_ENCODER) += vp9_lossless_encoder.c
@ -154,6 +177,7 @@ vp9_lossless_encoder.SRCS += ivfenc.h ivfenc.c
vp9_lossless_encoder.SRCS += tools_common.h tools_common.c
vp9_lossless_encoder.SRCS += video_common.h
vp9_lossless_encoder.SRCS += video_writer.h video_writer.c
vp9_lossless_encoder.SRCS += vpx_ports/msvc.h
vp9_lossless_encoder.GUID = B63C7C88-5348-46DC-A5A6-CC151EF93366
vp9_lossless_encoder.DESCRIPTION = Simplified lossless VP9 encoder
EXAMPLES-$(CONFIG_ENCODERS) += twopass_encoder.c
@ -161,6 +185,7 @@ twopass_encoder.SRCS += ivfenc.h ivfenc.c
twopass_encoder.SRCS += tools_common.h tools_common.c
twopass_encoder.SRCS += video_common.h
twopass_encoder.SRCS += video_writer.h video_writer.c
twopass_encoder.SRCS += vpx_ports/msvc.h
twopass_encoder.GUID = 73494FA6-4AF9-4763-8FBB-265C92402FD8
twopass_encoder.DESCRIPTION = Two-pass encoder loop
EXAMPLES-$(CONFIG_DECODERS) += decode_with_drops.c
@ -170,6 +195,7 @@ decode_with_drops.SRCS += video_common.h
decode_with_drops.SRCS += video_reader.h video_reader.c
decode_with_drops.SRCS += vpx_ports/mem_ops.h
decode_with_drops.SRCS += vpx_ports/mem_ops_aligned.h
decode_with_drops.SRCS += vpx_ports/msvc.h
decode_with_drops.GUID = CE5C53C4-8DDA-438A-86ED-0DDD3CDB8D26
decode_with_drops.DESCRIPTION = Drops frames while decoding
EXAMPLES-$(CONFIG_ENCODERS) += set_maps.c
@ -177,6 +203,7 @@ set_maps.SRCS += ivfenc.h ivfenc.c
set_maps.SRCS += tools_common.h tools_common.c
set_maps.SRCS += video_common.h
set_maps.SRCS += video_writer.h video_writer.c
set_maps.SRCS += vpx_ports/msvc.h
set_maps.GUID = ECB2D24D-98B8-4015-A465-A4AF3DCC145F
set_maps.DESCRIPTION = Set active and ROI maps
EXAMPLES-$(CONFIG_VP8_ENCODER) += vp8cx_set_ref.c
@ -184,9 +211,21 @@ vp8cx_set_ref.SRCS += ivfenc.h ivfenc.c
vp8cx_set_ref.SRCS += tools_common.h tools_common.c
vp8cx_set_ref.SRCS += video_common.h
vp8cx_set_ref.SRCS += video_writer.h video_writer.c
vp8cx_set_ref.SRCS += vpx_ports/msvc.h
vp8cx_set_ref.GUID = C5E31F7F-96F6-48BD-BD3E-10EBF6E8057A
vp8cx_set_ref.DESCRIPTION = VP8 set encoder reference frame
ifeq ($(CONFIG_VP9_ENCODER),yes)
ifeq ($(CONFIG_DECODERS),yes)
EXAMPLES-yes += vp9cx_set_ref.c
vp9cx_set_ref.SRCS += ivfenc.h ivfenc.c
vp9cx_set_ref.SRCS += tools_common.h tools_common.c
vp9cx_set_ref.SRCS += video_common.h
vp9cx_set_ref.SRCS += video_writer.h video_writer.c
vp9cx_set_ref.GUID = 65D7F14A-2EE6-4293-B958-AB5107A03B55
vp9cx_set_ref.DESCRIPTION = VP9 set encoder reference frame
endif
endif
ifeq ($(CONFIG_MULTI_RES_ENCODING),yes)
ifeq ($(CONFIG_LIBYUV),yes)
@ -194,6 +233,7 @@ EXAMPLES-$(CONFIG_VP8_ENCODER) += vp8_multi_resolution_encoder.c
vp8_multi_resolution_encoder.SRCS += ivfenc.h ivfenc.c
vp8_multi_resolution_encoder.SRCS += tools_common.h tools_common.c
vp8_multi_resolution_encoder.SRCS += video_writer.h video_writer.c
vp8_multi_resolution_encoder.SRCS += vpx_ports/msvc.h
vp8_multi_resolution_encoder.SRCS += $(LIBYUV_SRCS)
vp8_multi_resolution_encoder.GUID = 04f8738e-63c8-423b-90fa-7c2703a374de
vp8_multi_resolution_encoder.DESCRIPTION = VP8 Multiple-resolution Encoding
@ -254,14 +294,6 @@ CODEC_EXTRA_LIBS=$(sort $(call enabled,CODEC_EXTRA_LIBS))
$(foreach ex,$(ALL_EXAMPLES),$(eval $(notdir $(ex:.c=)).SRCS += $(ex) examples.mk))
# If this is a universal (fat) binary, then all the subarchitectures have
# already been built and our job is to stitch them together. The
# BUILD_OBJS variable indicates whether we should be building
# (compiling, linking) the library. The LIPO_OBJS variable indicates
# that we're stitching.
$(eval $(if $(filter universal%,$(TOOLCHAIN)),LIPO_OBJS,BUILD_OBJS):=yes)
# Create build/install dependencies for all examples. The common case
# is handled here. The MSVS case is handled below.
NOT_MSVS = $(if $(CONFIG_MSVS),,yes)
@ -269,24 +301,28 @@ DIST-BINS-$(NOT_MSVS) += $(addprefix bin/,$(ALL_EXAMPLES:.c=$(EXE_SFX)))
INSTALL-BINS-$(NOT_MSVS) += $(addprefix bin/,$(UTILS:.c=$(EXE_SFX)))
DIST-SRCS-yes += $(ALL_SRCS)
INSTALL-SRCS-yes += $(UTIL_SRCS)
OBJS-$(NOT_MSVS) += $(if $(BUILD_OBJS),$(call objs,$(ALL_SRCS)))
OBJS-$(NOT_MSVS) += $(call objs,$(ALL_SRCS))
BINS-$(NOT_MSVS) += $(addprefix $(BUILD_PFX),$(ALL_EXAMPLES:.c=$(EXE_SFX)))
# Instantiate linker template for all examples.
CODEC_LIB=$(if $(CONFIG_DEBUG_LIBS),vpx_g,vpx)
SHARED_LIB_SUF=$(if $(filter darwin%,$(TGT_OS)),.dylib,.so)
ifneq ($(filter darwin%,$(TGT_OS)),)
SHARED_LIB_SUF=.dylib
else
ifneq ($(filter os2%,$(TGT_OS)),)
SHARED_LIB_SUF=_dll.a
else
SHARED_LIB_SUF=.so
endif
endif
CODEC_LIB_SUF=$(if $(CONFIG_SHARED),$(SHARED_LIB_SUF),.a)
$(foreach bin,$(BINS-yes),\
$(if $(BUILD_OBJS),$(eval $(bin):\
$(LIB_PATH)/lib$(CODEC_LIB)$(CODEC_LIB_SUF)))\
$(if $(BUILD_OBJS),$(eval $(call linker_template,$(bin),\
$(eval $(bin):$(LIB_PATH)/lib$(CODEC_LIB)$(CODEC_LIB_SUF))\
$(eval $(call linker_template,$(bin),\
$(call objs,$($(notdir $(bin:$(EXE_SFX)=)).SRCS)) \
-l$(CODEC_LIB) $(addprefix -l,$(CODEC_EXTRA_LIBS))\
)))\
$(if $(LIPO_OBJS),$(eval $(call lipo_bin_template,$(bin))))\
)
)))
# The following pairs define a mapping of locations in the distribution
# tree to locations in the source/build trees.
@ -314,8 +350,8 @@ endif
# the makefiles). We may want to revisit this.
define vcproj_template
$(1): $($(1:.$(VCPROJ_SFX)=).SRCS) vpx.$(VCPROJ_SFX)
@echo " [vcproj] $$@"
$$(GEN_VCPROJ)\
$(if $(quiet),@echo " [vcproj] $$@")
$(qexec)$$(GEN_VCPROJ)\
--exe\
--target=$$(TOOLCHAIN)\
--name=$$(@:.$(VCPROJ_SFX)=)\

View File

@ -65,13 +65,12 @@ static void get_image_md5(const vpx_image_t *img, unsigned char digest[16]) {
static void print_md5(FILE *stream, unsigned char digest[16]) {
int i;
for (i = 0; i < 16; ++i)
fprintf(stream, "%02x", digest[i]);
for (i = 0; i < 16; ++i) fprintf(stream, "%02x", digest[i]);
}
static const char *exec_name;
void usage_exit() {
void usage_exit(void) {
fprintf(stderr, "Usage: %s <infile> <outfile>\n", exec_name);
exit(EXIT_FAILURE);
}
@ -86,12 +85,10 @@ int main(int argc, char **argv) {
exec_name = argv[0];
if (argc != 3)
die("Invalid number of arguments.");
if (argc != 3) die("Invalid number of arguments.");
reader = vpx_video_reader_open(argv[1]);
if (!reader)
die("Failed to open %s for reading.", argv[1]);
if (!reader) die("Failed to open %s for reading.", argv[1]);
if (!(outfile = fopen(argv[2], "wb")))
die("Failed to open %s for writing.", argv[2]);
@ -99,8 +96,7 @@ int main(int argc, char **argv) {
info = vpx_video_reader_get_info(reader);
decoder = get_vpx_decoder_by_fourcc(info->codec_fourcc);
if (!decoder)
die("Unknown input codec.");
if (!decoder) die("Unknown input codec.");
printf("Using %s\n", vpx_codec_iface_name(decoder->codec_interface()));
@ -111,8 +107,8 @@ int main(int argc, char **argv) {
vpx_codec_iter_t iter = NULL;
vpx_image_t *img = NULL;
size_t frame_size = 0;
const unsigned char *frame = vpx_video_reader_get_frame(reader,
&frame_size);
const unsigned char *frame =
vpx_video_reader_get_frame(reader, &frame_size);
if (vpx_codec_decode(&codec, frame, (unsigned int)frame_size, NULL, 0))
die_codec(&codec, "Failed to decode frame");
@ -121,14 +117,13 @@ int main(int argc, char **argv) {
get_image_md5(img, digest);
print_md5(outfile, digest);
fprintf(outfile, " img-%dx%d-%04d.i420\n",
img->d_w, img->d_h, ++frame_cnt);
fprintf(outfile, " img-%dx%d-%04d.i420\n", img->d_w, img->d_h,
++frame_cnt);
}
}
printf("Processed %d frames.\n", frame_cnt);
if (vpx_codec_destroy(&codec))
die_codec(&codec, "Failed to destroy codec.");
if (vpx_codec_destroy(&codec)) die_codec(&codec, "Failed to destroy codec.");
vpx_video_reader_close(reader);

View File

@ -65,7 +65,7 @@
static const char *exec_name;
void usage_exit() {
void usage_exit(void) {
fprintf(stderr, "Usage: %s <infile> <outfile> <N-M|N/M>\n", exec_name);
exit(EXIT_FAILURE);
}
@ -84,18 +84,16 @@ int main(int argc, char **argv) {
exec_name = argv[0];
if (argc != 4)
die("Invalid number of arguments.");
if (argc != 4) die("Invalid number of arguments.");
reader = vpx_video_reader_open(argv[1]);
if (!reader)
die("Failed to open %s for reading.", argv[1]);
if (!reader) die("Failed to open %s for reading.", argv[1]);
if (!(outfile = fopen(argv[2], "wb")))
die("Failed to open %s for writing.", argv[2]);
n = strtol(argv[3], &nptr, 0);
m = strtol(nptr + 1, NULL, 0);
n = (int)strtol(argv[3], &nptr, 0);
m = (int)strtol(nptr + 1, NULL, 0);
is_range = (*nptr == '-');
if (!n || !m || (*nptr != '-' && *nptr != '/'))
die("Couldn't parse pattern %s.\n", argv[3]);
@ -103,8 +101,7 @@ int main(int argc, char **argv) {
info = vpx_video_reader_get_info(reader);
decoder = get_vpx_decoder_by_fourcc(info->codec_fourcc);
if (!decoder)
die("Unknown input codec.");
if (!decoder) die("Unknown input codec.");
printf("Using %s\n", vpx_codec_iface_name(decoder->codec_interface()));
@ -116,8 +113,8 @@ int main(int argc, char **argv) {
vpx_image_t *img = NULL;
size_t frame_size = 0;
int skip;
const unsigned char *frame = vpx_video_reader_get_frame(reader,
&frame_size);
const unsigned char *frame =
vpx_video_reader_get_frame(reader, &frame_size);
if (vpx_codec_decode(&codec, frame, (unsigned int)frame_size, NULL, 0))
die_codec(&codec, "Failed to decode frame.");
@ -139,8 +136,7 @@ int main(int argc, char **argv) {
}
printf("Processed %d frames.\n", frame_cnt);
if (vpx_codec_destroy(&codec))
die_codec(&codec, "Failed to destroy codec.");
if (vpx_codec_destroy(&codec)) die_codec(&codec, "Failed to destroy codec.");
printf("Play: ffplay -f rawvideo -pix_fmt yuv420p -s %dx%d %s\n",
info->frame_width, info->frame_height, argv[2]);

View File

@ -52,7 +52,7 @@
static const char *exec_name;
void usage_exit() {
void usage_exit(void) {
fprintf(stderr, "Usage: %s <infile> <outfile>\n", exec_name);
exit(EXIT_FAILURE);
}
@ -68,12 +68,10 @@ int main(int argc, char **argv) {
exec_name = argv[0];
if (argc != 3)
die("Invalid number of arguments.");
if (argc != 3) die("Invalid number of arguments.");
reader = vpx_video_reader_open(argv[1]);
if (!reader)
die("Failed to open %s for reading.", argv[1]);
if (!reader) die("Failed to open %s for reading.", argv[1]);
if (!(outfile = fopen(argv[2], "wb")))
die("Failed to open %s for writing", argv[2]);
@ -81,8 +79,7 @@ int main(int argc, char **argv) {
info = vpx_video_reader_get_info(reader);
decoder = get_vpx_decoder_by_fourcc(info->codec_fourcc);
if (!decoder)
die("Unknown input codec.");
if (!decoder) die("Unknown input codec.");
printf("Using %s\n", vpx_codec_iface_name(decoder->codec_interface()));
@ -91,26 +88,25 @@ int main(int argc, char **argv) {
if (res == VPX_CODEC_INCAPABLE)
die_codec(&codec, "Postproc not supported by this decoder.");
if (res)
die_codec(&codec, "Failed to initialize decoder.");
if (res) die_codec(&codec, "Failed to initialize decoder.");
while (vpx_video_reader_read_frame(reader)) {
vpx_codec_iter_t iter = NULL;
vpx_image_t *img = NULL;
size_t frame_size = 0;
const unsigned char *frame = vpx_video_reader_get_frame(reader,
&frame_size);
const unsigned char *frame =
vpx_video_reader_get_frame(reader, &frame_size);
++frame_cnt;
if (frame_cnt % 30 == 1) {
vp8_postproc_cfg_t pp = {0, 0, 0};
vp8_postproc_cfg_t pp = { 0, 0, 0 };
if (vpx_codec_control(&codec, VP8_SET_POSTPROC, &pp))
die_codec(&codec, "Failed to turn off postproc.");
if (vpx_codec_control(&codec, VP8_SET_POSTPROC, &pp))
die_codec(&codec, "Failed to turn off postproc.");
} else if (frame_cnt % 30 == 16) {
vp8_postproc_cfg_t pp = {VP8_DEBLOCK | VP8_DEMACROBLOCK | VP8_MFQE,
4, 0};
vp8_postproc_cfg_t pp = { VP8_DEBLOCK | VP8_DEMACROBLOCK | VP8_MFQE, 4,
0 };
if (vpx_codec_control(&codec, VP8_SET_POSTPROC, &pp))
die_codec(&codec, "Failed to turn on postproc.");
};
@ -125,8 +121,7 @@ int main(int argc, char **argv) {
}
printf("Processed %d frames.\n", frame_cnt);
if (vpx_codec_destroy(&codec))
die_codec(&codec, "Failed to destroy codec");
if (vpx_codec_destroy(&codec)) die_codec(&codec, "Failed to destroy codec");
printf("Play: ffplay -f rawvideo -pix_fmt yuv420p -s %dx%d %s\n",
info->frame_width, info->frame_height, argv[2]);

View File

@ -15,6 +15,7 @@
#include <stdlib.h>
#include <string.h>
#include "../tools_common.h"
#include "../vp9/encoder/vp9_resize.h"
static const char *exec_name = NULL;
@ -26,17 +27,15 @@ static void usage() {
printf("<output_yuv> [<frames>]\n");
}
void usage_exit() {
void usage_exit(void) {
usage();
exit(EXIT_FAILURE);
}
static int parse_dim(char *v, int *width, int *height) {
char *x = strchr(v, 'x');
if (x == NULL)
x = strchr(v, 'X');
if (x == NULL)
return 0;
if (x == NULL) x = strchr(v, 'X');
if (x == NULL) return 0;
*width = atoi(v);
*height = atoi(&x[1]);
if (*width <= 0 || *height <= 0)
@ -92,30 +91,25 @@ int main(int argc, char *argv[]) {
else
frames = INT_MAX;
printf("Input size: %dx%d\n",
width, height);
printf("Target size: %dx%d, Frames: ",
target_width, target_height);
printf("Input size: %dx%d\n", width, height);
printf("Target size: %dx%d, Frames: ", target_width, target_height);
if (frames == INT_MAX)
printf("All\n");
else
printf("%d\n", frames);
inbuf = (uint8_t*)malloc(width * height * 3 / 2);
outbuf = (uint8_t*)malloc(target_width * target_height * 3 / 2);
inbuf = (uint8_t *)malloc(width * height * 3 / 2);
outbuf = (uint8_t *)malloc(target_width * target_height * 3 / 2);
inbuf_u = inbuf + width * height;
inbuf_v = inbuf_u + width * height / 4;
outbuf_u = outbuf + target_width * target_height;
outbuf_v = outbuf_u + target_width * target_height / 4;
f = 0;
while (f < frames) {
if (fread(inbuf, width * height * 3 / 2, 1, fpin) != 1)
break;
vp9_resize_frame420(inbuf, width, inbuf_u, inbuf_v, width / 2,
height, width,
outbuf, target_width, outbuf_u, outbuf_v,
target_width / 2,
target_height, target_width);
if (fread(inbuf, width * height * 3 / 2, 1, fpin) != 1) break;
vp9_resize_frame420(inbuf, width, inbuf_u, inbuf_v, width / 2, height,
width, outbuf, target_width, outbuf_u, outbuf_v,
target_width / 2, target_height, target_width);
fwrite(outbuf, target_width * target_height * 3 / 2, 1, fpout);
f++;
}

View File

@ -8,7 +8,6 @@
* be found in the AUTHORS file in the root of the source tree.
*/
// VP8 Set Active and ROI Maps
// ===========================
//
@ -55,7 +54,7 @@
static const char *exec_name;
void usage_exit() {
void usage_exit(void) {
fprintf(stderr, "Usage: %s <codec> <width> <height> <infile> <outfile>\n",
exec_name);
exit(EXIT_FAILURE);
@ -86,8 +85,7 @@ static void set_roi_map(const vpx_codec_enc_cfg_t *cfg,
roi.static_threshold[3] = 0;
roi.roi_map = (uint8_t *)malloc(roi.rows * roi.cols);
for (i = 0; i < roi.rows * roi.cols; ++i)
roi.roi_map[i] = i % 4;
for (i = 0; i < roi.rows * roi.cols; ++i) roi.roi_map[i] = i % 4;
if (vpx_codec_control(codec, VP8E_SET_ROI_MAP, &roi))
die_codec(codec, "Failed to set ROI map");
@ -98,14 +96,13 @@ static void set_roi_map(const vpx_codec_enc_cfg_t *cfg,
static void set_active_map(const vpx_codec_enc_cfg_t *cfg,
vpx_codec_ctx_t *codec) {
unsigned int i;
vpx_active_map_t map = {0, 0, 0};
vpx_active_map_t map = { 0, 0, 0 };
map.rows = (cfg->g_h + 15) / 16;
map.cols = (cfg->g_w + 15) / 16;
map.active_map = (uint8_t *)malloc(map.rows * map.cols);
for (i = 0; i < map.rows * map.cols; ++i)
map.active_map[i] = i % 2;
for (i = 0; i < map.rows * map.cols; ++i) map.active_map[i] = i % 2;
if (vpx_codec_control(codec, VP8E_SET_ACTIVEMAP, &map))
die_codec(codec, "Failed to set active map");
@ -115,7 +112,7 @@ static void set_active_map(const vpx_codec_enc_cfg_t *cfg,
static void unset_active_map(const vpx_codec_enc_cfg_t *cfg,
vpx_codec_ctx_t *codec) {
vpx_active_map_t map = {0, 0, 0};
vpx_active_map_t map = { 0, 0, 0 };
map.rows = (cfg->g_h + 15) / 16;
map.cols = (cfg->g_w + 15) / 16;
@ -125,25 +122,21 @@ static void unset_active_map(const vpx_codec_enc_cfg_t *cfg,
die_codec(codec, "Failed to set active map");
}
static int encode_frame(vpx_codec_ctx_t *codec,
vpx_image_t *img,
int frame_index,
VpxVideoWriter *writer) {
static int encode_frame(vpx_codec_ctx_t *codec, vpx_image_t *img,
int frame_index, VpxVideoWriter *writer) {
int got_pkts = 0;
vpx_codec_iter_t iter = NULL;
const vpx_codec_cx_pkt_t *pkt = NULL;
const vpx_codec_err_t res = vpx_codec_encode(codec, img, frame_index, 1, 0,
VPX_DL_GOOD_QUALITY);
if (res != VPX_CODEC_OK)
die_codec(codec, "Failed to encode frame");
const vpx_codec_err_t res =
vpx_codec_encode(codec, img, frame_index, 1, 0, VPX_DL_GOOD_QUALITY);
if (res != VPX_CODEC_OK) die_codec(codec, "Failed to encode frame");
while ((pkt = vpx_codec_get_cx_data(codec, &iter)) != NULL) {
got_pkts = 1;
if (pkt->kind == VPX_CODEC_CX_FRAME_PKT) {
const int keyframe = (pkt->data.frame.flags & VPX_FRAME_IS_KEY) != 0;
if (!vpx_video_writer_write_frame(writer,
pkt->data.frame.buf,
if (!vpx_video_writer_write_frame(writer, pkt->data.frame.buf,
pkt->data.frame.sz,
pkt->data.frame.pts)) {
die_codec(codec, "Failed to write compressed frame");
@ -167,12 +160,11 @@ int main(int argc, char **argv) {
VpxVideoInfo info;
VpxVideoWriter *writer = NULL;
const VpxInterface *encoder = NULL;
const int fps = 2; // TODO(dkovalev) add command line argument
const int fps = 2; // TODO(dkovalev) add command line argument
const double bits_per_pixel_per_frame = 0.067;
exec_name = argv[0];
if (argc != 6)
die("Invalid number of arguments");
if (argc != 6) die("Invalid number of arguments");
memset(&info, 0, sizeof(info));
@ -182,40 +174,36 @@ int main(int argc, char **argv) {
}
assert(encoder != NULL);
info.codec_fourcc = encoder->fourcc;
info.frame_width = strtol(argv[2], NULL, 0);
info.frame_height = strtol(argv[3], NULL, 0);
info.frame_width = (int)strtol(argv[2], NULL, 0);
info.frame_height = (int)strtol(argv[3], NULL, 0);
info.time_base.numerator = 1;
info.time_base.denominator = fps;
if (info.frame_width <= 0 ||
info.frame_height <= 0 ||
(info.frame_width % 2) != 0 ||
(info.frame_height % 2) != 0) {
if (info.frame_width <= 0 || info.frame_height <= 0 ||
(info.frame_width % 2) != 0 || (info.frame_height % 2) != 0) {
die("Invalid frame size: %dx%d", info.frame_width, info.frame_height);
}
if (!vpx_img_alloc(&raw, VPX_IMG_FMT_I420, info.frame_width,
info.frame_height, 1)) {
info.frame_height, 1)) {
die("Failed to allocate image.");
}
printf("Using %s\n", vpx_codec_iface_name(encoder->codec_interface()));
res = vpx_codec_enc_config_default(encoder->codec_interface(), &cfg, 0);
if (res)
die_codec(&codec, "Failed to get default codec config.");
if (res) die_codec(&codec, "Failed to get default codec config.");
cfg.g_w = info.frame_width;
cfg.g_h = info.frame_height;
cfg.g_timebase.num = info.time_base.numerator;
cfg.g_timebase.den = info.time_base.denominator;
cfg.rc_target_bitrate = (unsigned int)(bits_per_pixel_per_frame * cfg.g_w *
cfg.g_h * fps / 1000);
cfg.rc_target_bitrate =
(unsigned int)(bits_per_pixel_per_frame * cfg.g_w * cfg.g_h * fps / 1000);
cfg.g_lag_in_frames = 0;
writer = vpx_video_writer_open(argv[5], kContainerIVF, &info);
if (!writer)
die("Failed to open %s for writing.", argv[5]);
if (!writer) die("Failed to open %s for writing.", argv[5]);
if (!(infile = fopen(argv[4], "rb")))
die("Failed to open %s for reading.", argv[4]);
@ -239,15 +227,15 @@ int main(int argc, char **argv) {
}
// Flush encoder.
while (encode_frame(&codec, NULL, -1, writer)) {}
while (encode_frame(&codec, NULL, -1, writer)) {
}
printf("\n");
fclose(infile);
printf("Processed %d frames.\n", frame_count);
vpx_img_free(&raw);
if (vpx_codec_destroy(&codec))
die_codec(&codec, "Failed to destroy codec.");
if (vpx_codec_destroy(&codec)) die_codec(&codec, "Failed to destroy codec.");
vpx_video_writer_close(writer);

View File

@ -8,7 +8,6 @@
* be found in the AUTHORS file in the root of the source tree.
*/
// Simple Decoder
// ==============
//
@ -88,7 +87,7 @@
static const char *exec_name;
void usage_exit() {
void usage_exit(void) {
fprintf(stderr, "Usage: %s <infile> <outfile>\n", exec_name);
exit(EXIT_FAILURE);
}
@ -103,12 +102,10 @@ int main(int argc, char **argv) {
exec_name = argv[0];
if (argc != 3)
die("Invalid number of arguments.");
if (argc != 3) die("Invalid number of arguments.");
reader = vpx_video_reader_open(argv[1]);
if (!reader)
die("Failed to open %s for reading.", argv[1]);
if (!reader) die("Failed to open %s for reading.", argv[1]);
if (!(outfile = fopen(argv[2], "wb")))
die("Failed to open %s for writing.", argv[2]);
@ -116,8 +113,7 @@ int main(int argc, char **argv) {
info = vpx_video_reader_get_info(reader);
decoder = get_vpx_decoder_by_fourcc(info->codec_fourcc);
if (!decoder)
die("Unknown input codec.");
if (!decoder) die("Unknown input codec.");
printf("Using %s\n", vpx_codec_iface_name(decoder->codec_interface()));
@ -128,8 +124,8 @@ int main(int argc, char **argv) {
vpx_codec_iter_t iter = NULL;
vpx_image_t *img = NULL;
size_t frame_size = 0;
const unsigned char *frame = vpx_video_reader_get_frame(reader,
&frame_size);
const unsigned char *frame =
vpx_video_reader_get_frame(reader, &frame_size);
if (vpx_codec_decode(&codec, frame, (unsigned int)frame_size, NULL, 0))
die_codec(&codec, "Failed to decode frame.");
@ -140,8 +136,7 @@ int main(int argc, char **argv) {
}
printf("Processed %d frames.\n", frame_cnt);
if (vpx_codec_destroy(&codec))
die_codec(&codec, "Failed to destroy codec");
if (vpx_codec_destroy(&codec)) die_codec(&codec, "Failed to destroy codec");
printf("Play: ffplay -f rawvideo -pix_fmt yuv420p -s %dx%d %s\n",
info->frame_width, info->frame_height, argv[2]);

View File

@ -106,35 +106,30 @@
static const char *exec_name;
void usage_exit() {
void usage_exit(void) {
fprintf(stderr,
"Usage: %s <codec> <width> <height> <infile> <outfile> "
"<keyframe-interval> [<error-resilient>]\nSee comments in "
"simple_encoder.c for more information.\n",
"<keyframe-interval> <error-resilient> <frames to encode>\n"
"See comments in simple_encoder.c for more information.\n",
exec_name);
exit(EXIT_FAILURE);
}
static int encode_frame(vpx_codec_ctx_t *codec,
vpx_image_t *img,
int frame_index,
int flags,
VpxVideoWriter *writer) {
static int encode_frame(vpx_codec_ctx_t *codec, vpx_image_t *img,
int frame_index, int flags, VpxVideoWriter *writer) {
int got_pkts = 0;
vpx_codec_iter_t iter = NULL;
const vpx_codec_cx_pkt_t *pkt = NULL;
const vpx_codec_err_t res = vpx_codec_encode(codec, img, frame_index, 1,
flags, VPX_DL_GOOD_QUALITY);
if (res != VPX_CODEC_OK)
die_codec(codec, "Failed to encode frame");
const vpx_codec_err_t res =
vpx_codec_encode(codec, img, frame_index, 1, flags, VPX_DL_GOOD_QUALITY);
if (res != VPX_CODEC_OK) die_codec(codec, "Failed to encode frame");
while ((pkt = vpx_codec_get_cx_data(codec, &iter)) != NULL) {
got_pkts = 1;
if (pkt->kind == VPX_CODEC_CX_FRAME_PKT) {
const int keyframe = (pkt->data.frame.flags & VPX_FRAME_IS_KEY) != 0;
if (!vpx_video_writer_write_frame(writer,
pkt->data.frame.buf,
if (!vpx_video_writer_write_frame(writer, pkt->data.frame.buf,
pkt->data.frame.sz,
pkt->data.frame.pts)) {
die_codec(codec, "Failed to write compressed frame");
@ -147,6 +142,7 @@ static int encode_frame(vpx_codec_ctx_t *codec,
return got_pkts;
}
// TODO(tomfinegan): Improve command line parsing and add args for bitrate/fps.
int main(int argc, char **argv) {
FILE *infile = NULL;
vpx_codec_ctx_t codec;
@ -154,15 +150,14 @@ int main(int argc, char **argv) {
int frame_count = 0;
vpx_image_t raw;
vpx_codec_err_t res;
VpxVideoInfo info = {0};
VpxVideoInfo info = { 0, 0, 0, { 0, 0 } };
VpxVideoWriter *writer = NULL;
const VpxInterface *encoder = NULL;
const int fps = 30; // TODO(dkovalev) add command line argument
const int bitrate = 200; // kbit/s TODO(dkovalev) add command line argument
const int fps = 30;
const int bitrate = 200;
int keyframe_interval = 0;
// TODO(dkovalev): Add some simple command line parsing code to make the
// command line more flexible.
int max_frames = 0;
int frames_encoded = 0;
const char *codec_arg = NULL;
const char *width_arg = NULL;
const char *height_arg = NULL;
@ -172,8 +167,7 @@ int main(int argc, char **argv) {
exec_name = argv[0];
if (argc < 7)
die("Invalid number of arguments");
if (argc != 9) die("Invalid number of arguments");
codec_arg = argv[1];
width_arg = argv[2];
@ -181,49 +175,44 @@ int main(int argc, char **argv) {
infile_arg = argv[4];
outfile_arg = argv[5];
keyframe_interval_arg = argv[6];
max_frames = (int)strtol(argv[8], NULL, 0);
encoder = get_vpx_encoder_by_name(codec_arg);
if (!encoder)
die("Unsupported codec.");
if (!encoder) die("Unsupported codec.");
info.codec_fourcc = encoder->fourcc;
info.frame_width = strtol(width_arg, NULL, 0);
info.frame_height = strtol(height_arg, NULL, 0);
info.frame_width = (int)strtol(width_arg, NULL, 0);
info.frame_height = (int)strtol(height_arg, NULL, 0);
info.time_base.numerator = 1;
info.time_base.denominator = fps;
if (info.frame_width <= 0 ||
info.frame_height <= 0 ||
(info.frame_width % 2) != 0 ||
(info.frame_height % 2) != 0) {
if (info.frame_width <= 0 || info.frame_height <= 0 ||
(info.frame_width % 2) != 0 || (info.frame_height % 2) != 0) {
die("Invalid frame size: %dx%d", info.frame_width, info.frame_height);
}
if (!vpx_img_alloc(&raw, VPX_IMG_FMT_I420, info.frame_width,
info.frame_height, 1)) {
info.frame_height, 1)) {
die("Failed to allocate image.");
}
keyframe_interval = strtol(keyframe_interval_arg, NULL, 0);
if (keyframe_interval < 0)
die("Invalid keyframe interval value.");
keyframe_interval = (int)strtol(keyframe_interval_arg, NULL, 0);
if (keyframe_interval < 0) die("Invalid keyframe interval value.");
printf("Using %s\n", vpx_codec_iface_name(encoder->codec_interface()));
res = vpx_codec_enc_config_default(encoder->codec_interface(), &cfg, 0);
if (res)
die_codec(&codec, "Failed to get default codec config.");
if (res) die_codec(&codec, "Failed to get default codec config.");
cfg.g_w = info.frame_width;
cfg.g_h = info.frame_height;
cfg.g_timebase.num = info.time_base.numerator;
cfg.g_timebase.den = info.time_base.denominator;
cfg.rc_target_bitrate = bitrate;
cfg.g_error_resilient = argc > 7 ? strtol(argv[7], NULL, 0) : 0;
cfg.g_error_resilient = (vpx_codec_er_flags_t)strtoul(argv[7], NULL, 0);
writer = vpx_video_writer_open(outfile_arg, kContainerIVF, &info);
if (!writer)
die("Failed to open %s for writing.", outfile_arg);
if (!writer) die("Failed to open %s for writing.", outfile_arg);
if (!(infile = fopen(infile_arg, "rb")))
die("Failed to open %s for reading.", infile_arg);
@ -237,18 +226,20 @@ int main(int argc, char **argv) {
if (keyframe_interval > 0 && frame_count % keyframe_interval == 0)
flags |= VPX_EFLAG_FORCE_KF;
encode_frame(&codec, &raw, frame_count++, flags, writer);
frames_encoded++;
if (max_frames > 0 && frames_encoded >= max_frames) break;
}
// Flush encoder.
while (encode_frame(&codec, NULL, -1, 0, writer)) {};
while (encode_frame(&codec, NULL, -1, 0, writer)) {
}
printf("\n");
fclose(infile);
printf("Processed %d frames.\n", frame_count);
vpx_img_free(&raw);
if (vpx_codec_destroy(&codec))
die_codec(&codec, "Failed to destroy codec.");
if (vpx_codec_destroy(&codec)) die_codec(&codec, "Failed to destroy codec.");
vpx_video_writer_close(writer);

View File

@ -58,26 +58,24 @@
static const char *exec_name;
void usage_exit() {
fprintf(stderr, "Usage: %s <codec> <width> <height> <infile> <outfile>\n",
void usage_exit(void) {
fprintf(stderr,
"Usage: %s <codec> <width> <height> <infile> <outfile> "
"<frame limit>\n",
exec_name);
exit(EXIT_FAILURE);
}
static int get_frame_stats(vpx_codec_ctx_t *ctx,
const vpx_image_t *img,
vpx_codec_pts_t pts,
unsigned int duration,
vpx_enc_frame_flags_t flags,
unsigned int deadline,
static int get_frame_stats(vpx_codec_ctx_t *ctx, const vpx_image_t *img,
vpx_codec_pts_t pts, unsigned int duration,
vpx_enc_frame_flags_t flags, unsigned int deadline,
vpx_fixed_buf_t *stats) {
int got_pkts = 0;
vpx_codec_iter_t iter = NULL;
const vpx_codec_cx_pkt_t *pkt = NULL;
const vpx_codec_err_t res = vpx_codec_encode(ctx, img, pts, duration, flags,
deadline);
if (res != VPX_CODEC_OK)
die_codec(ctx, "Failed to get frame stats.");
const vpx_codec_err_t res =
vpx_codec_encode(ctx, img, pts, duration, flags, deadline);
if (res != VPX_CODEC_OK) die_codec(ctx, "Failed to get frame stats.");
while ((pkt = vpx_codec_get_cx_data(ctx, &iter)) != NULL) {
got_pkts = 1;
@ -94,20 +92,16 @@ static int get_frame_stats(vpx_codec_ctx_t *ctx,
return got_pkts;
}
static int encode_frame(vpx_codec_ctx_t *ctx,
const vpx_image_t *img,
vpx_codec_pts_t pts,
unsigned int duration,
vpx_enc_frame_flags_t flags,
unsigned int deadline,
static int encode_frame(vpx_codec_ctx_t *ctx, const vpx_image_t *img,
vpx_codec_pts_t pts, unsigned int duration,
vpx_enc_frame_flags_t flags, unsigned int deadline,
VpxVideoWriter *writer) {
int got_pkts = 0;
vpx_codec_iter_t iter = NULL;
const vpx_codec_cx_pkt_t *pkt = NULL;
const vpx_codec_err_t res = vpx_codec_encode(ctx, img, pts, duration, flags,
deadline);
if (res != VPX_CODEC_OK)
die_codec(ctx, "Failed to encode frame.");
const vpx_codec_err_t res =
vpx_codec_encode(ctx, img, pts, duration, flags, deadline);
if (res != VPX_CODEC_OK) die_codec(ctx, "Failed to encode frame.");
while ((pkt = vpx_codec_get_cx_data(ctx, &iter)) != NULL) {
got_pkts = 1;
@ -115,8 +109,8 @@ static int encode_frame(vpx_codec_ctx_t *ctx,
const int keyframe = (pkt->data.frame.flags & VPX_FRAME_IS_KEY) != 0;
if (!vpx_video_writer_write_frame(writer, pkt->data.frame.buf,
pkt->data.frame.sz,
pkt->data.frame.pts))
pkt->data.frame.sz,
pkt->data.frame.pts))
die_codec(ctx, "Failed to write compressed frame.");
printf(keyframe ? "K" : ".");
fflush(stdout);
@ -126,13 +120,12 @@ static int encode_frame(vpx_codec_ctx_t *ctx,
return got_pkts;
}
static vpx_fixed_buf_t pass0(vpx_image_t *raw,
FILE *infile,
static vpx_fixed_buf_t pass0(vpx_image_t *raw, FILE *infile,
const VpxInterface *encoder,
const vpx_codec_enc_cfg_t *cfg) {
const vpx_codec_enc_cfg_t *cfg, int max_frames) {
vpx_codec_ctx_t codec;
int frame_count = 0;
vpx_fixed_buf_t stats = {NULL, 0};
vpx_fixed_buf_t stats = { NULL, 0 };
if (vpx_codec_enc_init(&codec, encoder->codec_interface(), cfg, 0))
die_codec(&codec, "Failed to initialize encoder");
@ -142,37 +135,33 @@ static vpx_fixed_buf_t pass0(vpx_image_t *raw,
++frame_count;
get_frame_stats(&codec, raw, frame_count, 1, 0, VPX_DL_GOOD_QUALITY,
&stats);
if (max_frames > 0 && frame_count >= max_frames) break;
}
// Flush encoder.
while (get_frame_stats(&codec, NULL, frame_count, 1, 0,
VPX_DL_GOOD_QUALITY, &stats)) {}
while (get_frame_stats(&codec, NULL, frame_count, 1, 0, VPX_DL_GOOD_QUALITY,
&stats)) {
}
printf("Pass 0 complete. Processed %d frames.\n", frame_count);
if (vpx_codec_destroy(&codec))
die_codec(&codec, "Failed to destroy codec.");
if (vpx_codec_destroy(&codec)) die_codec(&codec, "Failed to destroy codec.");
return stats;
}
static void pass1(vpx_image_t *raw,
FILE *infile,
const char *outfile_name,
const VpxInterface *encoder,
const vpx_codec_enc_cfg_t *cfg) {
VpxVideoInfo info = {
encoder->fourcc,
cfg->g_w,
cfg->g_h,
{cfg->g_timebase.num, cfg->g_timebase.den}
};
static void pass1(vpx_image_t *raw, FILE *infile, const char *outfile_name,
const VpxInterface *encoder, const vpx_codec_enc_cfg_t *cfg,
int max_frames) {
VpxVideoInfo info = { encoder->fourcc,
cfg->g_w,
cfg->g_h,
{ cfg->g_timebase.num, cfg->g_timebase.den } };
VpxVideoWriter *writer = NULL;
vpx_codec_ctx_t codec;
int frame_count = 0;
writer = vpx_video_writer_open(outfile_name, kContainerIVF, &info);
if (!writer)
die("Failed to open %s for writing", outfile_name);
if (!writer) die("Failed to open %s for writing", outfile_name);
if (vpx_codec_enc_init(&codec, encoder->codec_interface(), cfg, 0))
die_codec(&codec, "Failed to initialize encoder");
@ -181,15 +170,17 @@ static void pass1(vpx_image_t *raw,
while (vpx_img_read(raw, infile)) {
++frame_count;
encode_frame(&codec, raw, frame_count, 1, 0, VPX_DL_GOOD_QUALITY, writer);
if (max_frames > 0 && frame_count >= max_frames) break;
}
// Flush encoder.
while (encode_frame(&codec, NULL, -1, 1, 0, VPX_DL_GOOD_QUALITY, writer)) {}
while (encode_frame(&codec, NULL, -1, 1, 0, VPX_DL_GOOD_QUALITY, writer)) {
}
printf("\n");
if (vpx_codec_destroy(&codec))
die_codec(&codec, "Failed to destroy codec.");
if (vpx_codec_destroy(&codec)) die_codec(&codec, "Failed to destroy codec.");
vpx_video_writer_close(writer);
@ -206,26 +197,27 @@ int main(int argc, char **argv) {
vpx_fixed_buf_t stats;
const VpxInterface *encoder = NULL;
const int fps = 30; // TODO(dkovalev) add command line argument
const int bitrate = 200; // kbit/s TODO(dkovalev) add command line argument
const int fps = 30; // TODO(dkovalev) add command line argument
const int bitrate = 200; // kbit/s TODO(dkovalev) add command line argument
const char *const codec_arg = argv[1];
const char *const width_arg = argv[2];
const char *const height_arg = argv[3];
const char *const infile_arg = argv[4];
const char *const outfile_arg = argv[5];
int max_frames = 0;
exec_name = argv[0];
if (argc != 6)
die("Invalid number of arguments.");
if (argc != 7) die("Invalid number of arguments.");
max_frames = (int)strtol(argv[6], NULL, 0);
encoder = get_vpx_encoder_by_name(codec_arg);
if (!encoder)
die("Unsupported codec.");
if (!encoder) die("Unsupported codec.");
w = strtol(width_arg, NULL, 0);
h = strtol(height_arg, NULL, 0);
w = (int)strtol(width_arg, NULL, 0);
h = (int)strtol(height_arg, NULL, 0);
if (w <= 0 || h <= 0 || (w % 2) != 0 || (h % 2) != 0)
if (w <= 0 || h <= 0 || (w % 2) != 0 || (h % 2) != 0)
die("Invalid frame size: %dx%d", w, h);
if (!vpx_img_alloc(&raw, VPX_IMG_FMT_I420, w, h, 1))
@ -235,8 +227,7 @@ int main(int argc, char **argv) {
// Configuration
res = vpx_codec_enc_config_default(encoder->codec_interface(), &cfg, 0);
if (res)
die_codec(&codec, "Failed to get default codec config.");
if (res) die_codec(&codec, "Failed to get default codec config.");
cfg.g_w = w;
cfg.g_h = h;
@ -249,13 +240,13 @@ int main(int argc, char **argv) {
// Pass 0
cfg.g_pass = VPX_RC_FIRST_PASS;
stats = pass0(&raw, infile, encoder, &cfg);
stats = pass0(&raw, infile, encoder, &cfg, max_frames);
// Pass 1
rewind(infile);
cfg.g_pass = VPX_RC_LAST_PASS;
cfg.rc_twopass_stats_in = stats;
pass1(&raw, infile, outfile_arg, encoder, &cfg);
pass1(&raw, infile, outfile_arg, encoder, &cfg, max_frames);
free(stats.buf);
vpx_img_free(&raw);

File diff suppressed because it is too large Load Diff

View File

@ -8,7 +8,6 @@
* be found in the AUTHORS file in the root of the source tree.
*/
// VP8 Set Reference Frame
// =======================
//
@ -52,37 +51,34 @@
#include "vpx/vp8cx.h"
#include "vpx/vpx_encoder.h"
#include "vp8/common/common.h"
#include "../tools_common.h"
#include "../video_writer.h"
static const char *exec_name;
void usage_exit() {
void usage_exit(void) {
fprintf(stderr, "Usage: %s <width> <height> <infile> <outfile> <frame>\n",
exec_name);
exit(EXIT_FAILURE);
}
static int encode_frame(vpx_codec_ctx_t *codec,
vpx_image_t *img,
int frame_index,
VpxVideoWriter *writer) {
static int encode_frame(vpx_codec_ctx_t *codec, vpx_image_t *img,
int frame_index, VpxVideoWriter *writer) {
int got_pkts = 0;
vpx_codec_iter_t iter = NULL;
const vpx_codec_cx_pkt_t *pkt = NULL;
const vpx_codec_err_t res = vpx_codec_encode(codec, img, frame_index, 1, 0,
VPX_DL_GOOD_QUALITY);
if (res != VPX_CODEC_OK)
die_codec(codec, "Failed to encode frame");
const vpx_codec_err_t res =
vpx_codec_encode(codec, img, frame_index, 1, 0, VPX_DL_GOOD_QUALITY);
if (res != VPX_CODEC_OK) die_codec(codec, "Failed to encode frame");
while ((pkt = vpx_codec_get_cx_data(codec, &iter)) != NULL) {
got_pkts = 1;
if (pkt->kind == VPX_CODEC_CX_FRAME_PKT) {
const int keyframe = (pkt->data.frame.flags & VPX_FRAME_IS_KEY) != 0;
if (!vpx_video_writer_write_frame(writer,
pkt->data.frame.buf,
if (!vpx_video_writer_write_frame(writer, pkt->data.frame.buf,
pkt->data.frame.sz,
pkt->data.frame.pts)) {
die_codec(codec, "Failed to write compressed frame");
@ -98,55 +94,53 @@ static int encode_frame(vpx_codec_ctx_t *codec,
int main(int argc, char **argv) {
FILE *infile = NULL;
vpx_codec_ctx_t codec = {0};
vpx_codec_enc_cfg_t cfg = {0};
vpx_codec_ctx_t codec;
vpx_codec_enc_cfg_t cfg;
int frame_count = 0;
vpx_image_t raw;
vpx_codec_err_t res;
VpxVideoInfo info = {0};
VpxVideoInfo info;
VpxVideoWriter *writer = NULL;
const VpxInterface *encoder = NULL;
int update_frame_num = 0;
const int fps = 30; // TODO(dkovalev) add command line argument
const int bitrate = 200; // kbit/s TODO(dkovalev) add command line argument
const int fps = 30; // TODO(dkovalev) add command line argument
const int bitrate = 200; // kbit/s TODO(dkovalev) add command line argument
vp8_zero(codec);
vp8_zero(cfg);
vp8_zero(info);
exec_name = argv[0];
if (argc != 6)
die("Invalid number of arguments");
if (argc != 6) die("Invalid number of arguments");
// TODO(dkovalev): add vp9 support and rename the file accordingly
encoder = get_vpx_encoder_by_name("vp8");
if (!encoder)
die("Unsupported codec.");
if (!encoder) die("Unsupported codec.");
update_frame_num = atoi(argv[5]);
if (!update_frame_num)
die("Couldn't parse frame number '%s'\n", argv[5]);
if (!update_frame_num) die("Couldn't parse frame number '%s'\n", argv[5]);
info.codec_fourcc = encoder->fourcc;
info.frame_width = strtol(argv[1], NULL, 0);
info.frame_height = strtol(argv[2], NULL, 0);
info.frame_width = (int)strtol(argv[1], NULL, 0);
info.frame_height = (int)strtol(argv[2], NULL, 0);
info.time_base.numerator = 1;
info.time_base.denominator = fps;
if (info.frame_width <= 0 ||
info.frame_height <= 0 ||
(info.frame_width % 2) != 0 ||
(info.frame_height % 2) != 0) {
if (info.frame_width <= 0 || info.frame_height <= 0 ||
(info.frame_width % 2) != 0 || (info.frame_height % 2) != 0) {
die("Invalid frame size: %dx%d", info.frame_width, info.frame_height);
}
if (!vpx_img_alloc(&raw, VPX_IMG_FMT_I420, info.frame_width,
info.frame_height, 1)) {
info.frame_height, 1)) {
die("Failed to allocate image.");
}
printf("Using %s\n", vpx_codec_iface_name(encoder->codec_interface()));
res = vpx_codec_enc_config_default(encoder->codec_interface(), &cfg, 0);
if (res)
die_codec(&codec, "Failed to get default codec config.");
if (res) die_codec(&codec, "Failed to get default codec config.");
cfg.g_w = info.frame_width;
cfg.g_h = info.frame_height;
@ -155,8 +149,7 @@ int main(int argc, char **argv) {
cfg.rc_target_bitrate = bitrate;
writer = vpx_video_writer_open(argv[4], kContainerIVF, &info);
if (!writer)
die("Failed to open %s for writing.", argv[4]);
if (!writer) die("Failed to open %s for writing.", argv[4]);
if (!(infile = fopen(argv[3], "rb")))
die("Failed to open %s for reading.", argv[3]);
@ -178,15 +171,15 @@ int main(int argc, char **argv) {
}
// Flush encoder.
while (encode_frame(&codec, NULL, -1, writer)) {}
while (encode_frame(&codec, NULL, -1, writer)) {
}
printf("\n");
fclose(infile);
printf("Processed %d frames.\n", frame_count);
vpx_img_free(&raw);
if (vpx_codec_destroy(&codec))
die_codec(&codec, "Failed to destroy codec.");
if (vpx_codec_destroy(&codec)) die_codec(&codec, "Failed to destroy codec.");
vpx_video_writer_close(writer);

View File

@ -14,39 +14,36 @@
#include "vpx/vpx_encoder.h"
#include "vpx/vp8cx.h"
#include "vp9/common/vp9_common.h"
#include "../tools_common.h"
#include "../video_writer.h"
static const char *exec_name;
void usage_exit() {
fprintf(stderr, "vp9_lossless_encoder: Example demonstrating VP9 lossless "
"encoding feature. Supports raw input only.\n");
void usage_exit(void) {
fprintf(stderr,
"vp9_lossless_encoder: Example demonstrating VP9 lossless "
"encoding feature. Supports raw input only.\n");
fprintf(stderr, "Usage: %s <width> <height> <infile> <outfile>\n", exec_name);
exit(EXIT_FAILURE);
}
static int encode_frame(vpx_codec_ctx_t *codec,
vpx_image_t *img,
int frame_index,
int flags,
VpxVideoWriter *writer) {
static int encode_frame(vpx_codec_ctx_t *codec, vpx_image_t *img,
int frame_index, int flags, VpxVideoWriter *writer) {
int got_pkts = 0;
vpx_codec_iter_t iter = NULL;
const vpx_codec_cx_pkt_t *pkt = NULL;
const vpx_codec_err_t res = vpx_codec_encode(codec, img, frame_index, 1,
flags, VPX_DL_GOOD_QUALITY);
if (res != VPX_CODEC_OK)
die_codec(codec, "Failed to encode frame");
const vpx_codec_err_t res =
vpx_codec_encode(codec, img, frame_index, 1, flags, VPX_DL_GOOD_QUALITY);
if (res != VPX_CODEC_OK) die_codec(codec, "Failed to encode frame");
while ((pkt = vpx_codec_get_cx_data(codec, &iter)) != NULL) {
got_pkts = 1;
if (pkt->kind == VPX_CODEC_CX_FRAME_PKT) {
const int keyframe = (pkt->data.frame.flags & VPX_FRAME_IS_KEY) != 0;
if (!vpx_video_writer_write_frame(writer,
pkt->data.frame.buf,
if (!vpx_video_writer_write_frame(writer, pkt->data.frame.buf,
pkt->data.frame.sz,
pkt->data.frame.pts)) {
die_codec(codec, "Failed to write compressed frame");
@ -66,43 +63,40 @@ int main(int argc, char **argv) {
int frame_count = 0;
vpx_image_t raw;
vpx_codec_err_t res;
VpxVideoInfo info = {0};
VpxVideoInfo info;
VpxVideoWriter *writer = NULL;
const VpxInterface *encoder = NULL;
const int fps = 30;
vp9_zero(info);
exec_name = argv[0];
if (argc < 5)
die("Invalid number of arguments");
if (argc < 5) die("Invalid number of arguments");
encoder = get_vpx_encoder_by_name("vp9");
if (!encoder)
die("Unsupported codec.");
if (!encoder) die("Unsupported codec.");
info.codec_fourcc = encoder->fourcc;
info.frame_width = strtol(argv[1], NULL, 0);
info.frame_height = strtol(argv[2], NULL, 0);
info.frame_width = (int)strtol(argv[1], NULL, 0);
info.frame_height = (int)strtol(argv[2], NULL, 0);
info.time_base.numerator = 1;
info.time_base.denominator = fps;
if (info.frame_width <= 0 ||
info.frame_height <= 0 ||
(info.frame_width % 2) != 0 ||
(info.frame_height % 2) != 0) {
if (info.frame_width <= 0 || info.frame_height <= 0 ||
(info.frame_width % 2) != 0 || (info.frame_height % 2) != 0) {
die("Invalid frame size: %dx%d", info.frame_width, info.frame_height);
}
if (!vpx_img_alloc(&raw, VPX_IMG_FMT_I420, info.frame_width,
info.frame_height, 1)) {
info.frame_height, 1)) {
die("Failed to allocate image.");
}
printf("Using %s\n", vpx_codec_iface_name(encoder->codec_interface()));
res = vpx_codec_enc_config_default(encoder->codec_interface(), &cfg, 0);
if (res)
die_codec(&codec, "Failed to get default codec config.");
if (res) die_codec(&codec, "Failed to get default codec config.");
cfg.g_w = info.frame_width;
cfg.g_h = info.frame_height;
@ -110,8 +104,7 @@ int main(int argc, char **argv) {
cfg.g_timebase.den = info.time_base.denominator;
writer = vpx_video_writer_open(argv[4], kContainerIVF, &info);
if (!writer)
die("Failed to open %s for writing.", argv[4]);
if (!writer) die("Failed to open %s for writing.", argv[4]);
if (!(infile = fopen(argv[3], "rb")))
die("Failed to open %s for reading.", argv[3]);
@ -128,15 +121,15 @@ int main(int argc, char **argv) {
}
// Flush encoder.
while (encode_frame(&codec, NULL, -1, 0, writer)) {}
while (encode_frame(&codec, NULL, -1, 0, writer)) {
}
printf("\n");
fclose(infile);
printf("Processed %d frames.\n", frame_count);
vpx_img_free(&raw);
if (vpx_codec_destroy(&codec))
die_codec(&codec, "Failed to destroy codec.");
if (vpx_codec_destroy(&codec)) die_codec(&codec, "Failed to destroy codec.");
vpx_video_writer_close(writer);

View File

@ -14,6 +14,7 @@
* that benefit from a scalable bitstream.
*/
#include <math.h>
#include <stdarg.h>
#include <stdlib.h>
#include <string.h>
@ -23,15 +24,24 @@
#include "../tools_common.h"
#include "../video_writer.h"
#include "../vpx_ports/vpx_timer.h"
#include "vpx/svc_context.h"
#include "vpx/vp8cx.h"
#include "vpx/vpx_encoder.h"
#include "../vpxstats.h"
#include "vp9/encoder/vp9_encoder.h"
#define OUTPUT_RC_STATS 1
static const arg_def_t skip_frames_arg =
ARG_DEF("s", "skip-frames", 1, "input frames to skip");
static const arg_def_t frames_arg =
ARG_DEF("f", "frames", 1, "number of frames to encode");
static const arg_def_t threads_arg =
ARG_DEF("th", "threads", 1, "number of threads to use");
#if OUTPUT_RC_STATS
static const arg_def_t output_rc_stats_arg =
ARG_DEF("rcstat", "output_rc_stats", 1, "output rc stats");
#endif
static const arg_def_t width_arg = ARG_DEF("w", "width", 1, "source width");
static const arg_def_t height_arg = ARG_DEF("h", "height", 1, "source height");
static const arg_def_t timebase_arg =
@ -42,6 +52,10 @@ static const arg_def_t spatial_layers_arg =
ARG_DEF("sl", "spatial-layers", 1, "number of spatial SVC layers");
static const arg_def_t temporal_layers_arg =
ARG_DEF("tl", "temporal-layers", 1, "number of temporal SVC layers");
static const arg_def_t temporal_layering_mode_arg =
ARG_DEF("tlm", "temporal-layering-mode", 1,
"temporal layering scheme."
"VP9E_TEMPORAL_LAYERING_MODE");
static const arg_def_t kf_dist_arg =
ARG_DEF("k", "kf-dist", 1, "number of frames between keyframes");
static const arg_def_t scale_factors_arg =
@ -61,36 +75,59 @@ static const arg_def_t min_bitrate_arg =
static const arg_def_t max_bitrate_arg =
ARG_DEF(NULL, "max-bitrate", 1, "Maximum bitrate");
static const arg_def_t lag_in_frame_arg =
ARG_DEF(NULL, "lag-in-frames", 1, "Number of frame to input before "
"generating any outputs");
ARG_DEF(NULL, "lag-in-frames", 1,
"Number of frame to input before "
"generating any outputs");
static const arg_def_t rc_end_usage_arg =
ARG_DEF(NULL, "rc-end-usage", 1, "0 - 3: VBR, CBR, CQ, Q");
static const arg_def_t speed_arg =
ARG_DEF("sp", "speed", 1, "speed configuration");
static const arg_def_t aqmode_arg =
ARG_DEF("aq", "aqmode", 1, "aq-mode off/on");
static const arg_def_t bitrates_arg =
ARG_DEF("bl", "bitrates", 1, "bitrates[sl * num_tl + tl]");
#if CONFIG_VP9_HIGHBITDEPTH
static const struct arg_enum_list bitdepth_enum[] = {
{"8", VPX_BITS_8},
{"10", VPX_BITS_10},
{"12", VPX_BITS_12},
{NULL, 0}
{ "8", VPX_BITS_8 }, { "10", VPX_BITS_10 }, { "12", VPX_BITS_12 }, { NULL, 0 }
};
static const arg_def_t bitdepth_arg =
ARG_DEF_ENUM("d", "bit-depth", 1, "Bit depth for codec 8, 10 or 12. ",
bitdepth_enum);
static const arg_def_t bitdepth_arg = ARG_DEF_ENUM(
"d", "bit-depth", 1, "Bit depth for codec 8, 10 or 12. ", bitdepth_enum);
#endif // CONFIG_VP9_HIGHBITDEPTH
static const arg_def_t *svc_args[] = {
&frames_arg, &width_arg, &height_arg,
&timebase_arg, &bitrate_arg, &skip_frames_arg, &spatial_layers_arg,
&kf_dist_arg, &scale_factors_arg, &passes_arg, &pass_arg,
&fpf_name_arg, &min_q_arg, &max_q_arg, &min_bitrate_arg,
&max_bitrate_arg, &temporal_layers_arg, &lag_in_frame_arg,
#if CONFIG_VP9_HIGHBITDEPTH
&bitdepth_arg,
static const arg_def_t *svc_args[] = { &frames_arg,
&width_arg,
&height_arg,
&timebase_arg,
&bitrate_arg,
&skip_frames_arg,
&spatial_layers_arg,
&kf_dist_arg,
&scale_factors_arg,
&passes_arg,
&pass_arg,
&fpf_name_arg,
&min_q_arg,
&max_q_arg,
&min_bitrate_arg,
&max_bitrate_arg,
&temporal_layers_arg,
&temporal_layering_mode_arg,
&lag_in_frame_arg,
&threads_arg,
&aqmode_arg,
#if OUTPUT_RC_STATS
&output_rc_stats_arg,
#endif
&rc_end_usage_arg, NULL
};
#if CONFIG_VP9_HIGHBITDEPTH
&bitdepth_arg,
#endif
&speed_arg,
&rc_end_usage_arg,
&bitrates_arg,
NULL };
static const uint32_t default_frames_to_skip = 0;
static const uint32_t default_frames_to_code = 60 * 60;
@ -102,6 +139,10 @@ static const uint32_t default_bitrate = 1000;
static const uint32_t default_spatial_layers = 5;
static const uint32_t default_temporal_layers = 1;
static const uint32_t default_kf_dist = 100;
static const uint32_t default_temporal_layering_mode = 0;
static const uint32_t default_output_rc_stats = 0;
static const int32_t default_speed = -1; // -1 means use library default.
static const uint32_t default_threads = 0; // zero means use library default.
typedef struct {
const char *input_filename;
@ -116,7 +157,7 @@ typedef struct {
static const char *exec_name;
void usage_exit() {
void usage_exit(void) {
fprintf(stderr, "Usage: %s <options> input_filename output_filename\n",
exec_name);
fprintf(stderr, "Options:\n");
@ -127,7 +168,7 @@ void usage_exit() {
static void parse_command_line(int argc, const char **argv_,
AppInput *app_input, SvcContext *svc_ctx,
vpx_codec_enc_cfg_t *enc_cfg) {
struct arg arg = {0};
struct arg arg;
char **argv = NULL;
char **argi = NULL;
char **argj = NULL;
@ -137,12 +178,18 @@ static void parse_command_line(int argc, const char **argv_,
const char *fpf_file_name = NULL;
unsigned int min_bitrate = 0;
unsigned int max_bitrate = 0;
char string_options[1024] = {0};
char string_options[1024] = { 0 };
// initialize SvcContext with parameters that will be passed to vpx_svc_init
svc_ctx->log_level = SVC_LOG_DEBUG;
svc_ctx->spatial_layers = default_spatial_layers;
svc_ctx->temporal_layers = default_temporal_layers;
svc_ctx->temporal_layering_mode = default_temporal_layering_mode;
#if OUTPUT_RC_STATS
svc_ctx->output_rc_stat = default_output_rc_stats;
#endif
svc_ctx->speed = default_speed;
svc_ctx->threads = default_threads;
// start with default encoder configuration
res = vpx_codec_enc_config_default(vpx_codec_vp9_cx(), enc_cfg, 0);
@ -184,12 +231,31 @@ static void parse_command_line(int argc, const char **argv_,
svc_ctx->spatial_layers = arg_parse_uint(&arg);
} else if (arg_match(&arg, &temporal_layers_arg, argi)) {
svc_ctx->temporal_layers = arg_parse_uint(&arg);
#if OUTPUT_RC_STATS
} else if (arg_match(&arg, &output_rc_stats_arg, argi)) {
svc_ctx->output_rc_stat = arg_parse_uint(&arg);
#endif
} else if (arg_match(&arg, &speed_arg, argi)) {
svc_ctx->speed = arg_parse_uint(&arg);
} else if (arg_match(&arg, &aqmode_arg, argi)) {
svc_ctx->aqmode = arg_parse_uint(&arg);
} else if (arg_match(&arg, &threads_arg, argi)) {
svc_ctx->threads = arg_parse_uint(&arg);
} else if (arg_match(&arg, &temporal_layering_mode_arg, argi)) {
svc_ctx->temporal_layering_mode = enc_cfg->temporal_layering_mode =
arg_parse_int(&arg);
if (svc_ctx->temporal_layering_mode) {
enc_cfg->g_error_resilient = 1;
}
} else if (arg_match(&arg, &kf_dist_arg, argi)) {
enc_cfg->kf_min_dist = arg_parse_uint(&arg);
enc_cfg->kf_max_dist = enc_cfg->kf_min_dist;
} else if (arg_match(&arg, &scale_factors_arg, argi)) {
snprintf(string_options, sizeof(string_options), "%s scale-factors=%s",
string_options, arg.val);
} else if (arg_match(&arg, &bitrates_arg, argi)) {
snprintf(string_options, sizeof(string_options), "%s bitrates=%s",
string_options, arg.val);
} else if (arg_match(&arg, &passes_arg, argi)) {
passes = arg_parse_uint(&arg);
if (passes < 1 || passes > 2) {
@ -228,7 +294,7 @@ static void parse_command_line(int argc, const char **argv_,
enc_cfg->g_input_bit_depth = 10;
enc_cfg->g_profile = 2;
break;
case VPX_BITS_12:
case VPX_BITS_12:
enc_cfg->g_input_bit_depth = 12;
enc_cfg->g_profile = 2;
break;
@ -310,16 +376,249 @@ static void parse_command_line(int argc, const char **argv_,
"num: %d, den: %d, bitrate: %d,\n"
"gop size: %d\n",
vpx_codec_iface_name(vpx_codec_vp9_cx()), app_input->frames_to_code,
app_input->frames_to_skip,
svc_ctx->spatial_layers, enc_cfg->g_w, enc_cfg->g_h,
enc_cfg->g_timebase.num, enc_cfg->g_timebase.den,
app_input->frames_to_skip, svc_ctx->spatial_layers, enc_cfg->g_w,
enc_cfg->g_h, enc_cfg->g_timebase.num, enc_cfg->g_timebase.den,
enc_cfg->rc_target_bitrate, enc_cfg->kf_max_dist);
}
#if OUTPUT_RC_STATS
// For rate control encoding stats.
struct RateControlStats {
// Number of input frames per layer.
int layer_input_frames[VPX_MAX_LAYERS];
// Total (cumulative) number of encoded frames per layer.
int layer_tot_enc_frames[VPX_MAX_LAYERS];
// Number of encoded non-key frames per layer.
int layer_enc_frames[VPX_MAX_LAYERS];
// Framerate per layer (cumulative).
double layer_framerate[VPX_MAX_LAYERS];
// Target average frame size per layer (per-frame-bandwidth per layer).
double layer_pfb[VPX_MAX_LAYERS];
// Actual average frame size per layer.
double layer_avg_frame_size[VPX_MAX_LAYERS];
// Average rate mismatch per layer (|target - actual| / target).
double layer_avg_rate_mismatch[VPX_MAX_LAYERS];
// Actual encoding bitrate per layer (cumulative).
double layer_encoding_bitrate[VPX_MAX_LAYERS];
// Average of the short-time encoder actual bitrate.
// TODO(marpan): Should we add these short-time stats for each layer?
double avg_st_encoding_bitrate;
// Variance of the short-time encoder actual bitrate.
double variance_st_encoding_bitrate;
// Window (number of frames) for computing short-time encoding bitrate.
int window_size;
// Number of window measurements.
int window_count;
};
// Note: these rate control stats assume only 1 key frame in the
// sequence (i.e., first frame only).
static void set_rate_control_stats(struct RateControlStats *rc,
vpx_codec_enc_cfg_t *cfg) {
unsigned int sl, tl;
// Set the layer (cumulative) framerate and the target layer (non-cumulative)
// per-frame-bandwidth, for the rate control encoding stats below.
const double framerate = cfg->g_timebase.den / cfg->g_timebase.num;
for (sl = 0; sl < cfg->ss_number_layers; ++sl) {
for (tl = 0; tl < cfg->ts_number_layers; ++tl) {
const int layer = sl * cfg->ts_number_layers + tl;
if (cfg->ts_number_layers == 1)
rc->layer_framerate[layer] = framerate;
else
rc->layer_framerate[layer] = framerate / cfg->ts_rate_decimator[tl];
if (tl > 0) {
rc->layer_pfb[layer] =
1000.0 *
(cfg->layer_target_bitrate[layer] -
cfg->layer_target_bitrate[layer - 1]) /
(rc->layer_framerate[layer] - rc->layer_framerate[layer - 1]);
} else {
rc->layer_pfb[layer] = 1000.0 * cfg->layer_target_bitrate[layer] /
rc->layer_framerate[layer];
}
rc->layer_input_frames[layer] = 0;
rc->layer_enc_frames[layer] = 0;
rc->layer_tot_enc_frames[layer] = 0;
rc->layer_encoding_bitrate[layer] = 0.0;
rc->layer_avg_frame_size[layer] = 0.0;
rc->layer_avg_rate_mismatch[layer] = 0.0;
}
}
rc->window_count = 0;
rc->window_size = 15;
rc->avg_st_encoding_bitrate = 0.0;
rc->variance_st_encoding_bitrate = 0.0;
}
static void printout_rate_control_summary(struct RateControlStats *rc,
vpx_codec_enc_cfg_t *cfg,
int frame_cnt) {
unsigned int sl, tl;
double perc_fluctuation = 0.0;
int tot_num_frames = 0;
printf("Total number of processed frames: %d\n\n", frame_cnt - 1);
printf("Rate control layer stats for sl%d tl%d layer(s):\n\n",
cfg->ss_number_layers, cfg->ts_number_layers);
for (sl = 0; sl < cfg->ss_number_layers; ++sl) {
tot_num_frames = 0;
for (tl = 0; tl < cfg->ts_number_layers; ++tl) {
const int layer = sl * cfg->ts_number_layers + tl;
const int num_dropped =
(tl > 0)
? (rc->layer_input_frames[layer] - rc->layer_enc_frames[layer])
: (rc->layer_input_frames[layer] - rc->layer_enc_frames[layer] -
1);
tot_num_frames += rc->layer_input_frames[layer];
rc->layer_encoding_bitrate[layer] = 0.001 * rc->layer_framerate[layer] *
rc->layer_encoding_bitrate[layer] /
tot_num_frames;
rc->layer_avg_frame_size[layer] =
rc->layer_avg_frame_size[layer] / rc->layer_enc_frames[layer];
rc->layer_avg_rate_mismatch[layer] = 100.0 *
rc->layer_avg_rate_mismatch[layer] /
rc->layer_enc_frames[layer];
printf("For layer#: sl%d tl%d \n", sl, tl);
printf("Bitrate (target vs actual): %d %f.0 kbps\n",
cfg->layer_target_bitrate[layer],
rc->layer_encoding_bitrate[layer]);
printf("Average frame size (target vs actual): %f %f bits\n",
rc->layer_pfb[layer], rc->layer_avg_frame_size[layer]);
printf("Average rate_mismatch: %f\n", rc->layer_avg_rate_mismatch[layer]);
printf(
"Number of input frames, encoded (non-key) frames, "
"and percent dropped frames: %d %d %f.0 \n",
rc->layer_input_frames[layer], rc->layer_enc_frames[layer],
100.0 * num_dropped / rc->layer_input_frames[layer]);
printf("\n");
}
}
rc->avg_st_encoding_bitrate = rc->avg_st_encoding_bitrate / rc->window_count;
rc->variance_st_encoding_bitrate =
rc->variance_st_encoding_bitrate / rc->window_count -
(rc->avg_st_encoding_bitrate * rc->avg_st_encoding_bitrate);
perc_fluctuation = 100.0 * sqrt(rc->variance_st_encoding_bitrate) /
rc->avg_st_encoding_bitrate;
printf("Short-time stats, for window of %d frames: \n", rc->window_size);
printf("Average, rms-variance, and percent-fluct: %f %f %f \n",
rc->avg_st_encoding_bitrate, sqrt(rc->variance_st_encoding_bitrate),
perc_fluctuation);
printf("Num of input, num of encoded (super) frames: %d %d \n", frame_cnt,
tot_num_frames);
}
vpx_codec_err_t parse_superframe_index(const uint8_t *data, size_t data_sz,
uint64_t sizes[8], int *count) {
// A chunk ending with a byte matching 0xc0 is an invalid chunk unless
// it is a super frame index. If the last byte of real video compression
// data is 0xc0 the encoder must add a 0 byte. If we have the marker but
// not the associated matching marker byte at the front of the index we have
// an invalid bitstream and need to return an error.
uint8_t marker;
marker = *(data + data_sz - 1);
*count = 0;
if ((marker & 0xe0) == 0xc0) {
const uint32_t frames = (marker & 0x7) + 1;
const uint32_t mag = ((marker >> 3) & 0x3) + 1;
const size_t index_sz = 2 + mag * frames;
// This chunk is marked as having a superframe index but doesn't have
// enough data for it, thus it's an invalid superframe index.
if (data_sz < index_sz) return VPX_CODEC_CORRUPT_FRAME;
{
const uint8_t marker2 = *(data + data_sz - index_sz);
// This chunk is marked as having a superframe index but doesn't have
// the matching marker byte at the front of the index therefore it's an
// invalid chunk.
if (marker != marker2) return VPX_CODEC_CORRUPT_FRAME;
}
{
// Found a valid superframe index.
uint32_t i, j;
const uint8_t *x = &data[data_sz - index_sz + 1];
for (i = 0; i < frames; ++i) {
uint32_t this_sz = 0;
for (j = 0; j < mag; ++j) this_sz |= (*x++) << (j * 8);
sizes[i] = this_sz;
}
*count = frames;
}
}
return VPX_CODEC_OK;
}
#endif
// Example pattern for spatial layers and 2 temporal layers used in the
// bypass/flexible mode. The pattern corresponds to the pattern
// VP9E_TEMPORAL_LAYERING_MODE_0101 (temporal_layering_mode == 2) used in
// non-flexible mode.
void set_frame_flags_bypass_mode(int tl, int num_spatial_layers,
int is_key_frame,
vpx_svc_ref_frame_config_t *ref_frame_config) {
int sl;
for (sl = 0; sl < num_spatial_layers; ++sl) {
if (!tl) {
if (!sl) {
ref_frame_config->frame_flags[sl] =
VP8_EFLAG_NO_REF_GF | VP8_EFLAG_NO_REF_ARF | VP8_EFLAG_NO_UPD_GF |
VP8_EFLAG_NO_UPD_ARF;
} else {
if (is_key_frame) {
ref_frame_config->frame_flags[sl] =
VP8_EFLAG_NO_REF_GF | VP8_EFLAG_NO_REF_ARF |
VP8_EFLAG_NO_UPD_LAST | VP8_EFLAG_NO_UPD_ARF;
} else {
ref_frame_config->frame_flags[sl] =
VP8_EFLAG_NO_REF_ARF | VP8_EFLAG_NO_UPD_GF | VP8_EFLAG_NO_UPD_ARF;
}
}
} else if (tl == 1) {
if (!sl) {
ref_frame_config->frame_flags[sl] =
VP8_EFLAG_NO_REF_GF | VP8_EFLAG_NO_REF_ARF | VP8_EFLAG_NO_UPD_LAST |
VP8_EFLAG_NO_UPD_GF;
} else {
ref_frame_config->frame_flags[sl] =
VP8_EFLAG_NO_REF_ARF | VP8_EFLAG_NO_UPD_LAST | VP8_EFLAG_NO_UPD_GF;
if (sl == num_spatial_layers - 1)
ref_frame_config->frame_flags[sl] =
VP8_EFLAG_NO_UPD_ARF | VP8_EFLAG_NO_REF_ARF |
VP8_EFLAG_NO_UPD_LAST | VP8_EFLAG_NO_UPD_GF;
}
}
if (tl == 0) {
ref_frame_config->lst_fb_idx[sl] = sl;
if (sl) {
if (is_key_frame) {
ref_frame_config->lst_fb_idx[sl] = sl - 1;
ref_frame_config->gld_fb_idx[sl] = sl;
} else {
ref_frame_config->gld_fb_idx[sl] = sl - 1;
}
} else {
ref_frame_config->gld_fb_idx[sl] = 0;
}
ref_frame_config->alt_fb_idx[sl] = 0;
} else if (tl == 1) {
ref_frame_config->lst_fb_idx[sl] = sl;
ref_frame_config->gld_fb_idx[sl] = num_spatial_layers + sl - 1;
ref_frame_config->alt_fb_idx[sl] = num_spatial_layers + sl;
}
}
}
int main(int argc, const char **argv) {
AppInput app_input = {0};
AppInput app_input;
VpxVideoWriter *writer = NULL;
VpxVideoInfo info = {0};
VpxVideoInfo info;
vpx_codec_ctx_t codec;
vpx_codec_enc_cfg_t enc_cfg;
SvcContext svc_ctx;
@ -332,16 +631,29 @@ int main(int argc, const char **argv) {
FILE *infile = NULL;
int end_of_stream = 0;
int frames_received = 0;
#if OUTPUT_RC_STATS
VpxVideoWriter *outfile[VPX_SS_MAX_LAYERS] = { NULL };
struct RateControlStats rc;
vpx_svc_layer_id_t layer_id;
vpx_svc_ref_frame_config_t ref_frame_config;
unsigned int sl, tl;
double sum_bitrate = 0.0;
double sum_bitrate2 = 0.0;
double framerate = 30.0;
#endif
struct vpx_usec_timer timer;
int64_t cx_time = 0;
memset(&svc_ctx, 0, sizeof(svc_ctx));
svc_ctx.log_print = 1;
memset(&app_input, 0, sizeof(AppInput));
memset(&info, 0, sizeof(VpxVideoInfo));
exec_name = argv[0];
parse_command_line(argc, argv, &app_input, &svc_ctx, &enc_cfg);
// Allocate image buffer
// Allocate image buffer
#if CONFIG_VP9_HIGHBITDEPTH
if (!vpx_img_alloc(&raw, enc_cfg.g_input_bit_depth == 8 ?
VPX_IMG_FMT_I420 : VPX_IMG_FMT_I42016,
if (!vpx_img_alloc(&raw,
enc_cfg.g_input_bit_depth == 8 ? VPX_IMG_FMT_I420
: VPX_IMG_FMT_I42016,
enc_cfg.g_w, enc_cfg.g_h, 32)) {
die("Failed to allocate image %dx%d\n", enc_cfg.g_w, enc_cfg.g_h);
}
@ -359,21 +671,64 @@ int main(int argc, const char **argv) {
VPX_CODEC_OK)
die("Failed to initialize encoder\n");
#if OUTPUT_RC_STATS
rc.window_count = 1;
rc.window_size = 15; // Silence a static analysis warning.
rc.avg_st_encoding_bitrate = 0.0;
rc.variance_st_encoding_bitrate = 0.0;
if (svc_ctx.output_rc_stat) {
set_rate_control_stats(&rc, &enc_cfg);
framerate = enc_cfg.g_timebase.den / enc_cfg.g_timebase.num;
}
#endif
info.codec_fourcc = VP9_FOURCC;
info.time_base.numerator = enc_cfg.g_timebase.num;
info.time_base.denominator = enc_cfg.g_timebase.den;
if (!(app_input.passes == 2 && app_input.pass == 1)) {
// We don't save the bitstream for the 1st pass on two pass rate control
writer = vpx_video_writer_open(app_input.output_filename, kContainerIVF,
&info);
writer =
vpx_video_writer_open(app_input.output_filename, kContainerIVF, &info);
if (!writer)
die("Failed to open %s for writing\n", app_input.output_filename);
}
#if OUTPUT_RC_STATS
// Write out spatial layer stream.
// TODO(marpan/jianj): allow for writing each spatial and temporal stream.
if (svc_ctx.output_rc_stat) {
for (sl = 0; sl < enc_cfg.ss_number_layers; ++sl) {
char file_name[PATH_MAX];
snprintf(file_name, sizeof(file_name), "%s_s%d.ivf",
app_input.output_filename, sl);
outfile[sl] = vpx_video_writer_open(file_name, kContainerIVF, &info);
if (!outfile[sl]) die("Failed to open %s for writing", file_name);
}
}
#endif
// skip initial frames
for (i = 0; i < app_input.frames_to_skip; ++i)
vpx_img_read(&raw, infile);
for (i = 0; i < app_input.frames_to_skip; ++i) vpx_img_read(&raw, infile);
if (svc_ctx.speed != -1)
vpx_codec_control(&codec, VP8E_SET_CPUUSED, svc_ctx.speed);
if (svc_ctx.threads) {
vpx_codec_control(&codec, VP9E_SET_TILE_COLUMNS, get_msb(svc_ctx.threads));
if (svc_ctx.threads > 1)
vpx_codec_control(&codec, VP9E_SET_ROW_MT, 1);
else
vpx_codec_control(&codec, VP9E_SET_ROW_MT, 0);
}
if (svc_ctx.speed >= 5 && svc_ctx.aqmode == 1)
vpx_codec_control(&codec, VP9E_SET_AQ_MODE, 3);
if (svc_ctx.speed >= 5)
vpx_codec_control(&codec, VP8E_SET_STATIC_THRESHOLD, 1);
vpx_codec_control(&codec, VP8E_SET_MAX_INTRA_BITRATE_PCT, 900);
vpx_codec_control(&codec, VP9E_SET_SVC_INTER_LAYER_PRED, 0);
vpx_codec_control(&codec, VP9E_SET_NOISE_SENSITIVITY, 0);
// Encode frames
while (!end_of_stream) {
@ -385,9 +740,57 @@ int main(int argc, const char **argv) {
end_of_stream = 1;
}
res = vpx_svc_encode(&svc_ctx, &codec, (end_of_stream ? NULL : &raw),
pts, frame_duration, VPX_DL_GOOD_QUALITY);
printf("%s", vpx_svc_get_message(&svc_ctx));
// For BYPASS/FLEXIBLE mode, set the frame flags (reference and updates)
// and the buffer indices for each spatial layer of the current
// (super)frame to be encoded. The temporal layer_id for the current frame
// also needs to be set.
// TODO(marpan): Should rename the "VP9E_TEMPORAL_LAYERING_MODE_BYPASS"
// mode to "VP9E_LAYERING_MODE_BYPASS".
if (svc_ctx.temporal_layering_mode == VP9E_TEMPORAL_LAYERING_MODE_BYPASS) {
layer_id.spatial_layer_id = 0;
// Example for 2 temporal layers.
if (frame_cnt % 2 == 0)
layer_id.temporal_layer_id = 0;
else
layer_id.temporal_layer_id = 1;
// Note that we only set the temporal layer_id, since we are calling
// the encode for the whole superframe. The encoder will internally loop
// over all the spatial layers for the current superframe.
vpx_codec_control(&codec, VP9E_SET_SVC_LAYER_ID, &layer_id);
// TODO(jianj): Fix the parameter passing for "is_key_frame" in
// set_frame_flags_bypass_model() for case of periodic key frames.
set_frame_flags_bypass_mode(layer_id.temporal_layer_id,
svc_ctx.spatial_layers, frame_cnt == 0,
&ref_frame_config);
vpx_codec_control(&codec, VP9E_SET_SVC_REF_FRAME_CONFIG,
&ref_frame_config);
// Keep track of input frames, to account for frame drops in rate control
// stats/metrics.
for (sl = 0; sl < (unsigned int)enc_cfg.ss_number_layers; ++sl) {
++rc.layer_input_frames[sl * enc_cfg.ts_number_layers +
layer_id.temporal_layer_id];
}
} else {
// For the fixed pattern SVC, temporal layer is given by superframe count.
unsigned int tl = 0;
if (enc_cfg.ts_number_layers == 2)
tl = (frame_cnt % 2 != 0);
else if (enc_cfg.ts_number_layers == 3) {
if (frame_cnt % 2 != 0) tl = 2;
if ((frame_cnt > 1) && ((frame_cnt - 2) % 4 == 0)) tl = 1;
}
for (sl = 0; sl < enc_cfg.ss_number_layers; ++sl)
++rc.layer_input_frames[sl * enc_cfg.ts_number_layers + tl];
}
vpx_usec_timer_start(&timer);
res = vpx_svc_encode(
&svc_ctx, &codec, (end_of_stream ? NULL : &raw), pts, frame_duration,
svc_ctx.speed >= 5 ? VPX_DL_REALTIME : VPX_DL_GOOD_QUALITY);
vpx_usec_timer_mark(&timer);
cx_time += vpx_usec_timer_elapsed(&timer);
fflush(stdout);
if (res != VPX_CODEC_OK) {
die_codec(&codec, "Failed to encode frame");
}
@ -395,27 +798,125 @@ int main(int argc, const char **argv) {
while ((cx_pkt = vpx_codec_get_cx_data(&codec, &iter)) != NULL) {
switch (cx_pkt->kind) {
case VPX_CODEC_CX_FRAME_PKT: {
if (cx_pkt->data.frame.sz > 0)
vpx_video_writer_write_frame(writer,
cx_pkt->data.frame.buf,
SvcInternal_t *const si = (SvcInternal_t *)svc_ctx.internal;
if (cx_pkt->data.frame.sz > 0) {
#if OUTPUT_RC_STATS
uint64_t sizes[8];
uint64_t sizes_parsed[8];
int count = 0;
vp9_zero(sizes);
vp9_zero(sizes_parsed);
#endif
vpx_video_writer_write_frame(writer, cx_pkt->data.frame.buf,
cx_pkt->data.frame.sz,
cx_pkt->data.frame.pts);
#if OUTPUT_RC_STATS
// TODO(marpan): Put this (to line728) in separate function.
if (svc_ctx.output_rc_stat) {
vpx_codec_control(&codec, VP9E_GET_SVC_LAYER_ID, &layer_id);
parse_superframe_index(cx_pkt->data.frame.buf,
cx_pkt->data.frame.sz, sizes_parsed,
&count);
if (enc_cfg.ss_number_layers == 1)
sizes[0] = cx_pkt->data.frame.sz;
if (svc_ctx.temporal_layering_mode !=
VP9E_TEMPORAL_LAYERING_MODE_BYPASS) {
int num_layers_encoded = 0;
for (sl = 0; sl < enc_cfg.ss_number_layers; ++sl) {
sizes[sl] = 0;
if (cx_pkt->data.frame.spatial_layer_encoded[sl]) {
sizes[sl] = sizes_parsed[num_layers_encoded];
num_layers_encoded++;
}
}
for (sl = 0; sl < enc_cfg.ss_number_layers; ++sl) {
unsigned int sl2;
uint64_t tot_size = 0;
for (sl2 = 0; sl2 <= sl; ++sl2) {
if (cx_pkt->data.frame.spatial_layer_encoded[sl2])
tot_size += sizes[sl2];
}
if (tot_size > 0)
vpx_video_writer_write_frame(
outfile[sl], cx_pkt->data.frame.buf, (size_t)(tot_size),
cx_pkt->data.frame.pts);
}
}
for (sl = 0; sl < enc_cfg.ss_number_layers; ++sl) {
if (cx_pkt->data.frame.spatial_layer_encoded[sl]) {
for (tl = layer_id.temporal_layer_id;
tl < enc_cfg.ts_number_layers; ++tl) {
const int layer = sl * enc_cfg.ts_number_layers + tl;
++rc.layer_tot_enc_frames[layer];
rc.layer_encoding_bitrate[layer] += 8.0 * sizes[sl];
// Keep count of rate control stats per layer, for non-key
// frames.
if (tl == (unsigned int)layer_id.temporal_layer_id &&
!(cx_pkt->data.frame.flags & VPX_FRAME_IS_KEY)) {
rc.layer_avg_frame_size[layer] += 8.0 * sizes[sl];
rc.layer_avg_rate_mismatch[layer] +=
fabs(8.0 * sizes[sl] - rc.layer_pfb[layer]) /
rc.layer_pfb[layer];
++rc.layer_enc_frames[layer];
}
}
}
}
// Update for short-time encoding bitrate states, for moving
// window of size rc->window, shifted by rc->window / 2.
// Ignore first window segment, due to key frame.
if (frame_cnt > (unsigned int)rc.window_size) {
for (sl = 0; sl < enc_cfg.ss_number_layers; ++sl) {
if (cx_pkt->data.frame.spatial_layer_encoded[sl])
sum_bitrate += 0.001 * 8.0 * sizes[sl] * framerate;
}
if (frame_cnt % rc.window_size == 0) {
rc.window_count += 1;
rc.avg_st_encoding_bitrate += sum_bitrate / rc.window_size;
rc.variance_st_encoding_bitrate +=
(sum_bitrate / rc.window_size) *
(sum_bitrate / rc.window_size);
sum_bitrate = 0.0;
}
}
// Second shifted window.
if (frame_cnt >
(unsigned int)(rc.window_size + rc.window_size / 2)) {
for (sl = 0; sl < enc_cfg.ss_number_layers; ++sl) {
sum_bitrate2 += 0.001 * 8.0 * sizes[sl] * framerate;
}
if (frame_cnt > (unsigned int)(2 * rc.window_size) &&
frame_cnt % rc.window_size == 0) {
rc.window_count += 1;
rc.avg_st_encoding_bitrate += sum_bitrate2 / rc.window_size;
rc.variance_st_encoding_bitrate +=
(sum_bitrate2 / rc.window_size) *
(sum_bitrate2 / rc.window_size);
sum_bitrate2 = 0.0;
}
}
}
#endif
}
/*
printf("SVC frame: %d, kf: %d, size: %d, pts: %d\n", frames_received,
!!(cx_pkt->data.frame.flags & VPX_FRAME_IS_KEY),
(int)cx_pkt->data.frame.sz, (int)cx_pkt->data.frame.pts);
*/
if (enc_cfg.ss_number_layers == 1 && enc_cfg.ts_number_layers == 1)
si->bytes_sum[0] += (int)cx_pkt->data.frame.sz;
++frames_received;
break;
}
case VPX_CODEC_STATS_PKT: {
stats_write(&app_input.rc_stats,
cx_pkt->data.twopass_stats.buf,
stats_write(&app_input.rc_stats, cx_pkt->data.twopass_stats.buf,
cx_pkt->data.twopass_stats.sz);
break;
}
default: {
break;
}
default: { break; }
}
}
@ -425,24 +926,41 @@ int main(int argc, const char **argv) {
}
}
// Compensate for the extra frame count for the bypass mode.
if (svc_ctx.temporal_layering_mode == VP9E_TEMPORAL_LAYERING_MODE_BYPASS) {
for (sl = 0; sl < enc_cfg.ss_number_layers; ++sl) {
const int layer =
sl * enc_cfg.ts_number_layers + layer_id.temporal_layer_id;
--rc.layer_input_frames[layer];
}
}
printf("Processed %d frames\n", frame_cnt);
fclose(infile);
#if OUTPUT_RC_STATS
if (svc_ctx.output_rc_stat) {
printout_rate_control_summary(&rc, &enc_cfg, frame_cnt);
printf("\n");
}
#endif
if (vpx_codec_destroy(&codec)) die_codec(&codec, "Failed to destroy codec");
if (app_input.passes == 2)
stats_close(&app_input.rc_stats, 1);
if (app_input.passes == 2) stats_close(&app_input.rc_stats, 1);
if (writer) {
vpx_video_writer_close(writer);
}
#if OUTPUT_RC_STATS
if (svc_ctx.output_rc_stat) {
for (sl = 0; sl < enc_cfg.ss_number_layers; ++sl) {
vpx_video_writer_close(outfile[sl]);
}
}
#endif
printf("Frame cnt and encoding time/FPS stats for encoding: %d %f %f \n",
frame_cnt, 1000 * (float)cx_time / (double)(frame_cnt * 1000000),
1000000 * (double)frame_cnt / (double)cx_time);
vpx_img_free(&raw);
// display average size, psnr
printf("%s", vpx_svc_dump_statistics(&svc_ctx));
vpx_svc_dump_statistics(&svc_ctx);
vpx_svc_release(&svc_ctx);
return EXIT_SUCCESS;
}

442
examples/vp9cx_set_ref.c Normal file
View File

@ -0,0 +1,442 @@
/*
* Copyright (c) 2016 The WebM project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
// VP9 Set Reference Frame
// ============================
//
// This is an example demonstrating how to overwrite the VP9 encoder's
// internal reference frame. In the sample we set the last frame to the
// current frame. This technique could be used to bounce between two cameras.
//
// The decoder would also have to set the reference frame to the same value
// on the same frame, or the video will become corrupt. The 'test_decode'
// variable is set to 1 in this example that tests if the encoder and decoder
// results are matching.
//
// Usage
// -----
// This example encodes a raw video. And the last argument passed in specifies
// the frame number to update the reference frame on. For example, run
// examples/vp9cx_set_ref 352 288 in.yuv out.ivf 4 30
// The parameter is parsed as follows:
//
//
// Extra Variables
// ---------------
// This example maintains the frame number passed on the command line
// in the `update_frame_num` variable.
//
//
// Configuration
// -------------
//
// The reference frame is updated on the frame specified on the command
// line.
//
// Observing The Effects
// ---------------------
// The encoder and decoder results should be matching when the same reference
// frame setting operation is done in both encoder and decoder. Otherwise,
// the encoder/decoder mismatch would be seen.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "vpx/vp8cx.h"
#include "vpx/vpx_decoder.h"
#include "vpx/vpx_encoder.h"
#include "vp9/common/vp9_common.h"
#include "./tools_common.h"
#include "./video_writer.h"
static const char *exec_name;
void usage_exit() {
fprintf(stderr,
"Usage: %s <width> <height> <infile> <outfile> "
"<frame> <limit(optional)>\n",
exec_name);
exit(EXIT_FAILURE);
}
static int compare_img(const vpx_image_t *const img1,
const vpx_image_t *const img2) {
uint32_t l_w = img1->d_w;
uint32_t c_w = (img1->d_w + img1->x_chroma_shift) >> img1->x_chroma_shift;
const uint32_t c_h =
(img1->d_h + img1->y_chroma_shift) >> img1->y_chroma_shift;
uint32_t i;
int match = 1;
match &= (img1->fmt == img2->fmt);
match &= (img1->d_w == img2->d_w);
match &= (img1->d_h == img2->d_h);
for (i = 0; i < img1->d_h; ++i)
match &= (memcmp(img1->planes[VPX_PLANE_Y] + i * img1->stride[VPX_PLANE_Y],
img2->planes[VPX_PLANE_Y] + i * img2->stride[VPX_PLANE_Y],
l_w) == 0);
for (i = 0; i < c_h; ++i)
match &= (memcmp(img1->planes[VPX_PLANE_U] + i * img1->stride[VPX_PLANE_U],
img2->planes[VPX_PLANE_U] + i * img2->stride[VPX_PLANE_U],
c_w) == 0);
for (i = 0; i < c_h; ++i)
match &= (memcmp(img1->planes[VPX_PLANE_V] + i * img1->stride[VPX_PLANE_V],
img2->planes[VPX_PLANE_V] + i * img2->stride[VPX_PLANE_V],
c_w) == 0);
return match;
}
#define mmin(a, b) ((a) < (b) ? (a) : (b))
static void find_mismatch(const vpx_image_t *const img1,
const vpx_image_t *const img2, int yloc[4],
int uloc[4], int vloc[4]) {
const uint32_t bsize = 64;
const uint32_t bsizey = bsize >> img1->y_chroma_shift;
const uint32_t bsizex = bsize >> img1->x_chroma_shift;
const uint32_t c_w =
(img1->d_w + img1->x_chroma_shift) >> img1->x_chroma_shift;
const uint32_t c_h =
(img1->d_h + img1->y_chroma_shift) >> img1->y_chroma_shift;
int match = 1;
uint32_t i, j;
yloc[0] = yloc[1] = yloc[2] = yloc[3] = -1;
for (i = 0, match = 1; match && i < img1->d_h; i += bsize) {
for (j = 0; match && j < img1->d_w; j += bsize) {
int k, l;
const int si = mmin(i + bsize, img1->d_h) - i;
const int sj = mmin(j + bsize, img1->d_w) - j;
for (k = 0; match && k < si; ++k) {
for (l = 0; match && l < sj; ++l) {
if (*(img1->planes[VPX_PLANE_Y] +
(i + k) * img1->stride[VPX_PLANE_Y] + j + l) !=
*(img2->planes[VPX_PLANE_Y] +
(i + k) * img2->stride[VPX_PLANE_Y] + j + l)) {
yloc[0] = i + k;
yloc[1] = j + l;
yloc[2] = *(img1->planes[VPX_PLANE_Y] +
(i + k) * img1->stride[VPX_PLANE_Y] + j + l);
yloc[3] = *(img2->planes[VPX_PLANE_Y] +
(i + k) * img2->stride[VPX_PLANE_Y] + j + l);
match = 0;
break;
}
}
}
}
}
uloc[0] = uloc[1] = uloc[2] = uloc[3] = -1;
for (i = 0, match = 1; match && i < c_h; i += bsizey) {
for (j = 0; match && j < c_w; j += bsizex) {
int k, l;
const int si = mmin(i + bsizey, c_h - i);
const int sj = mmin(j + bsizex, c_w - j);
for (k = 0; match && k < si; ++k) {
for (l = 0; match && l < sj; ++l) {
if (*(img1->planes[VPX_PLANE_U] +
(i + k) * img1->stride[VPX_PLANE_U] + j + l) !=
*(img2->planes[VPX_PLANE_U] +
(i + k) * img2->stride[VPX_PLANE_U] + j + l)) {
uloc[0] = i + k;
uloc[1] = j + l;
uloc[2] = *(img1->planes[VPX_PLANE_U] +
(i + k) * img1->stride[VPX_PLANE_U] + j + l);
uloc[3] = *(img2->planes[VPX_PLANE_U] +
(i + k) * img2->stride[VPX_PLANE_U] + j + l);
match = 0;
break;
}
}
}
}
}
vloc[0] = vloc[1] = vloc[2] = vloc[3] = -1;
for (i = 0, match = 1; match && i < c_h; i += bsizey) {
for (j = 0; match && j < c_w; j += bsizex) {
int k, l;
const int si = mmin(i + bsizey, c_h - i);
const int sj = mmin(j + bsizex, c_w - j);
for (k = 0; match && k < si; ++k) {
for (l = 0; match && l < sj; ++l) {
if (*(img1->planes[VPX_PLANE_V] +
(i + k) * img1->stride[VPX_PLANE_V] + j + l) !=
*(img2->planes[VPX_PLANE_V] +
(i + k) * img2->stride[VPX_PLANE_V] + j + l)) {
vloc[0] = i + k;
vloc[1] = j + l;
vloc[2] = *(img1->planes[VPX_PLANE_V] +
(i + k) * img1->stride[VPX_PLANE_V] + j + l);
vloc[3] = *(img2->planes[VPX_PLANE_V] +
(i + k) * img2->stride[VPX_PLANE_V] + j + l);
match = 0;
break;
}
}
}
}
}
}
static void testing_decode(vpx_codec_ctx_t *encoder, vpx_codec_ctx_t *decoder,
unsigned int frame_out, int *mismatch_seen) {
vpx_image_t enc_img, dec_img;
struct vp9_ref_frame ref_enc, ref_dec;
if (*mismatch_seen) return;
ref_enc.idx = 0;
ref_dec.idx = 0;
if (vpx_codec_control(encoder, VP9_GET_REFERENCE, &ref_enc))
die_codec(encoder, "Failed to get encoder reference frame");
enc_img = ref_enc.img;
if (vpx_codec_control(decoder, VP9_GET_REFERENCE, &ref_dec))
die_codec(decoder, "Failed to get decoder reference frame");
dec_img = ref_dec.img;
if (!compare_img(&enc_img, &dec_img)) {
int y[4], u[4], v[4];
*mismatch_seen = 1;
find_mismatch(&enc_img, &dec_img, y, u, v);
printf(
"Encode/decode mismatch on frame %d at"
" Y[%d, %d] {%d/%d},"
" U[%d, %d] {%d/%d},"
" V[%d, %d] {%d/%d}",
frame_out, y[0], y[1], y[2], y[3], u[0], u[1], u[2], u[3], v[0], v[1],
v[2], v[3]);
}
vpx_img_free(&enc_img);
vpx_img_free(&dec_img);
}
static int encode_frame(vpx_codec_ctx_t *ecodec, vpx_image_t *img,
unsigned int frame_in, VpxVideoWriter *writer,
int test_decode, vpx_codec_ctx_t *dcodec,
unsigned int *frame_out, int *mismatch_seen) {
int got_pkts = 0;
vpx_codec_iter_t iter = NULL;
const vpx_codec_cx_pkt_t *pkt = NULL;
int got_data;
const vpx_codec_err_t res =
vpx_codec_encode(ecodec, img, frame_in, 1, 0, VPX_DL_GOOD_QUALITY);
if (res != VPX_CODEC_OK) die_codec(ecodec, "Failed to encode frame");
got_data = 0;
while ((pkt = vpx_codec_get_cx_data(ecodec, &iter)) != NULL) {
got_pkts = 1;
if (pkt->kind == VPX_CODEC_CX_FRAME_PKT) {
const int keyframe = (pkt->data.frame.flags & VPX_FRAME_IS_KEY) != 0;
if (!(pkt->data.frame.flags & VPX_FRAME_IS_FRAGMENT)) {
*frame_out += 1;
}
if (!vpx_video_writer_write_frame(writer, pkt->data.frame.buf,
pkt->data.frame.sz,
pkt->data.frame.pts)) {
die_codec(ecodec, "Failed to write compressed frame");
}
printf(keyframe ? "K" : ".");
fflush(stdout);
got_data = 1;
// Decode 1 frame.
if (test_decode) {
if (vpx_codec_decode(dcodec, pkt->data.frame.buf,
(unsigned int)pkt->data.frame.sz, NULL, 0))
die_codec(dcodec, "Failed to decode frame.");
}
}
}
// Mismatch checking
if (got_data && test_decode) {
testing_decode(ecodec, dcodec, *frame_out, mismatch_seen);
}
return got_pkts;
}
int main(int argc, char **argv) {
FILE *infile = NULL;
// Encoder
vpx_codec_ctx_t ecodec;
vpx_codec_enc_cfg_t cfg;
unsigned int frame_in = 0;
vpx_image_t raw;
vpx_codec_err_t res;
VpxVideoInfo info;
VpxVideoWriter *writer = NULL;
const VpxInterface *encoder = NULL;
// Test encoder/decoder mismatch.
int test_decode = 1;
// Decoder
vpx_codec_ctx_t dcodec;
unsigned int frame_out = 0;
// The frame number to set reference frame on
unsigned int update_frame_num = 0;
int mismatch_seen = 0;
const int fps = 30;
const int bitrate = 500;
const char *width_arg = NULL;
const char *height_arg = NULL;
const char *infile_arg = NULL;
const char *outfile_arg = NULL;
const char *update_frame_num_arg = NULL;
unsigned int limit = 0;
vp9_zero(ecodec);
vp9_zero(cfg);
vp9_zero(info);
exec_name = argv[0];
if (argc < 6) die("Invalid number of arguments");
width_arg = argv[1];
height_arg = argv[2];
infile_arg = argv[3];
outfile_arg = argv[4];
update_frame_num_arg = argv[5];
encoder = get_vpx_encoder_by_name("vp9");
if (!encoder) die("Unsupported codec.");
update_frame_num = (unsigned int)strtoul(update_frame_num_arg, NULL, 0);
// In VP9, the reference buffers (cm->buffer_pool->frame_bufs[i].buf) are
// allocated while calling vpx_codec_encode(), thus, setting reference for
// 1st frame isn't supported.
if (update_frame_num <= 1) {
die("Couldn't parse frame number '%s'\n", update_frame_num_arg);
}
if (argc > 6) {
limit = (unsigned int)strtoul(argv[6], NULL, 0);
if (update_frame_num > limit)
die("Update frame number couldn't larger than limit\n");
}
info.codec_fourcc = encoder->fourcc;
info.frame_width = (int)strtol(width_arg, NULL, 0);
info.frame_height = (int)strtol(height_arg, NULL, 0);
info.time_base.numerator = 1;
info.time_base.denominator = fps;
if (info.frame_width <= 0 || info.frame_height <= 0 ||
(info.frame_width % 2) != 0 || (info.frame_height % 2) != 0) {
die("Invalid frame size: %dx%d", info.frame_width, info.frame_height);
}
if (!vpx_img_alloc(&raw, VPX_IMG_FMT_I420, info.frame_width,
info.frame_height, 1)) {
die("Failed to allocate image.");
}
printf("Using %s\n", vpx_codec_iface_name(encoder->codec_interface()));
res = vpx_codec_enc_config_default(encoder->codec_interface(), &cfg, 0);
if (res) die_codec(&ecodec, "Failed to get default codec config.");
cfg.g_w = info.frame_width;
cfg.g_h = info.frame_height;
cfg.g_timebase.num = info.time_base.numerator;
cfg.g_timebase.den = info.time_base.denominator;
cfg.rc_target_bitrate = bitrate;
cfg.g_lag_in_frames = 3;
writer = vpx_video_writer_open(outfile_arg, kContainerIVF, &info);
if (!writer) die("Failed to open %s for writing.", outfile_arg);
if (!(infile = fopen(infile_arg, "rb")))
die("Failed to open %s for reading.", infile_arg);
if (vpx_codec_enc_init(&ecodec, encoder->codec_interface(), &cfg, 0))
die_codec(&ecodec, "Failed to initialize encoder");
// Disable alt_ref.
if (vpx_codec_control(&ecodec, VP8E_SET_ENABLEAUTOALTREF, 0))
die_codec(&ecodec, "Failed to set enable auto alt ref");
if (test_decode) {
const VpxInterface *decoder = get_vpx_decoder_by_name("vp9");
if (vpx_codec_dec_init(&dcodec, decoder->codec_interface(), NULL, 0))
die_codec(&dcodec, "Failed to initialize decoder.");
}
// Encode frames.
while (vpx_img_read(&raw, infile)) {
if (limit && frame_in >= limit) break;
if (update_frame_num > 1 && frame_out + 1 == update_frame_num) {
vpx_ref_frame_t ref;
ref.frame_type = VP8_LAST_FRAME;
ref.img = raw;
// Set reference frame in encoder.
if (vpx_codec_control(&ecodec, VP8_SET_REFERENCE, &ref))
die_codec(&ecodec, "Failed to set reference frame");
printf(" <SET_REF>");
// If set_reference in decoder is commented out, the enc/dec mismatch
// would be seen.
if (test_decode) {
if (vpx_codec_control(&dcodec, VP8_SET_REFERENCE, &ref))
die_codec(&dcodec, "Failed to set reference frame");
}
}
encode_frame(&ecodec, &raw, frame_in, writer, test_decode, &dcodec,
&frame_out, &mismatch_seen);
frame_in++;
if (mismatch_seen) break;
}
// Flush encoder.
if (!mismatch_seen)
while (encode_frame(&ecodec, NULL, frame_in, writer, test_decode, &dcodec,
&frame_out, &mismatch_seen)) {
}
printf("\n");
fclose(infile);
printf("Processed %d frames.\n", frame_out);
if (test_decode) {
if (!mismatch_seen)
printf("Encoder/decoder results are matching.\n");
else
printf("Encoder/decoder results are NOT matching.\n");
}
if (test_decode)
if (vpx_codec_destroy(&dcodec))
die_codec(&dcodec, "Failed to destroy decoder");
vpx_img_free(&raw);
if (vpx_codec_destroy(&ecodec))
die_codec(&ecodec, "Failed to destroy encoder.");
vpx_video_writer_close(writer);
return EXIT_SUCCESS;
}

View File

@ -22,26 +22,37 @@
#include "../vpx_ports/vpx_timer.h"
#include "vpx/vp8cx.h"
#include "vpx/vpx_encoder.h"
#include "vpx_ports/bitops.h"
#include "../tools_common.h"
#include "../video_writer.h"
#define ROI_MAP 0
#define zero(Dest) memset(&Dest, 0, sizeof(Dest));
static const char *exec_name;
void usage_exit() {
exit(EXIT_FAILURE);
}
void usage_exit(void) { exit(EXIT_FAILURE); }
// Denoiser states, for temporal denoising.
enum denoiserState {
kDenoiserOff,
kDenoiserOnYOnly,
kDenoiserOnYUV,
kDenoiserOnYUVAggressive,
kDenoiserOnAdaptive
// Denoiser states for vp8, for temporal denoising.
enum denoiserStateVp8 {
kVp8DenoiserOff,
kVp8DenoiserOnYOnly,
kVp8DenoiserOnYUV,
kVp8DenoiserOnYUVAggressive,
kVp8DenoiserOnAdaptive
};
static int mode_to_num_layers[12] = {1, 2, 2, 3, 3, 3, 3, 5, 2, 3, 3, 3};
// Denoiser states for vp9, for temporal denoising.
enum denoiserStateVp9 {
kVp9DenoiserOff,
kVp9DenoiserOnYOnly,
// For SVC: denoise the top two spatial layers.
kVp9DenoiserOnYTwoSpatialLayers
};
static int mode_to_num_layers[13] = { 1, 2, 2, 3, 3, 3, 3, 5, 2, 3, 3, 3, 3 };
// For rate control encoding stats.
struct RateControlMetrics {
@ -70,6 +81,7 @@ struct RateControlMetrics {
int window_size;
// Number of window measurements.
int window_count;
int layer_target_bitrate[VPX_MAX_LAYERS];
};
// Note: these rate control metrics assume only 1 key frame in the
@ -85,13 +97,14 @@ static void set_rate_control_metrics(struct RateControlMetrics *rc,
// per-frame-bandwidth, for the rate control encoding stats below.
const double framerate = cfg->g_timebase.den / cfg->g_timebase.num;
rc->layer_framerate[0] = framerate / cfg->ts_rate_decimator[0];
rc->layer_pfb[0] = 1000.0 * cfg->ts_target_bitrate[0] /
rc->layer_framerate[0];
rc->layer_pfb[0] =
1000.0 * rc->layer_target_bitrate[0] / rc->layer_framerate[0];
for (i = 0; i < cfg->ts_number_layers; ++i) {
if (i > 0) {
rc->layer_framerate[i] = framerate / cfg->ts_rate_decimator[i];
rc->layer_pfb[i] = 1000.0 *
(cfg->ts_target_bitrate[i] - cfg->ts_target_bitrate[i - 1]) /
rc->layer_pfb[i] =
1000.0 *
(rc->layer_target_bitrate[i] - rc->layer_target_bitrate[i - 1]) /
(rc->layer_framerate[i] - rc->layer_framerate[i - 1]);
}
rc->layer_input_frames[i] = 0;
@ -113,29 +126,31 @@ static void printout_rate_control_summary(struct RateControlMetrics *rc,
unsigned int i = 0;
int tot_num_frames = 0;
double perc_fluctuation = 0.0;
printf("Total number of processed frames: %d\n\n", frame_cnt -1);
printf("Total number of processed frames: %d\n\n", frame_cnt - 1);
printf("Rate control layer stats for %d layer(s):\n\n",
cfg->ts_number_layers);
cfg->ts_number_layers);
for (i = 0; i < cfg->ts_number_layers; ++i) {
const int num_dropped = (i > 0) ?
(rc->layer_input_frames[i] - rc->layer_enc_frames[i]) :
(rc->layer_input_frames[i] - rc->layer_enc_frames[i] - 1);
const int num_dropped =
(i > 0) ? (rc->layer_input_frames[i] - rc->layer_enc_frames[i])
: (rc->layer_input_frames[i] - rc->layer_enc_frames[i] - 1);
tot_num_frames += rc->layer_input_frames[i];
rc->layer_encoding_bitrate[i] = 0.001 * rc->layer_framerate[i] *
rc->layer_encoding_bitrate[i] / tot_num_frames;
rc->layer_avg_frame_size[i] = rc->layer_avg_frame_size[i] /
rc->layer_enc_frames[i];
rc->layer_avg_rate_mismatch[i] = 100.0 * rc->layer_avg_rate_mismatch[i] /
rc->layer_enc_frames[i];
rc->layer_encoding_bitrate[i] /
tot_num_frames;
rc->layer_avg_frame_size[i] =
rc->layer_avg_frame_size[i] / rc->layer_enc_frames[i];
rc->layer_avg_rate_mismatch[i] =
100.0 * rc->layer_avg_rate_mismatch[i] / rc->layer_enc_frames[i];
printf("For layer#: %d \n", i);
printf("Bitrate (target vs actual): %d %f \n", cfg->ts_target_bitrate[i],
printf("Bitrate (target vs actual): %d %f \n", rc->layer_target_bitrate[i],
rc->layer_encoding_bitrate[i]);
printf("Average frame size (target vs actual): %f %f \n", rc->layer_pfb[i],
rc->layer_avg_frame_size[i]);
printf("Average rate_mismatch: %f \n", rc->layer_avg_rate_mismatch[i]);
printf("Number of input frames, encoded (non-key) frames, "
"and perc dropped frames: %d %d %f \n", rc->layer_input_frames[i],
rc->layer_enc_frames[i],
printf(
"Number of input frames, encoded (non-key) frames, "
"and perc dropped frames: %d %d %f \n",
rc->layer_input_frames[i], rc->layer_enc_frames[i],
100.0 * num_dropped / rc->layer_input_frames[i]);
printf("\n");
}
@ -144,16 +159,84 @@ static void printout_rate_control_summary(struct RateControlMetrics *rc,
rc->variance_st_encoding_bitrate / rc->window_count -
(rc->avg_st_encoding_bitrate * rc->avg_st_encoding_bitrate);
perc_fluctuation = 100.0 * sqrt(rc->variance_st_encoding_bitrate) /
rc->avg_st_encoding_bitrate;
printf("Short-time stats, for window of %d frames: \n",rc->window_size);
rc->avg_st_encoding_bitrate;
printf("Short-time stats, for window of %d frames: \n", rc->window_size);
printf("Average, rms-variance, and percent-fluct: %f %f %f \n",
rc->avg_st_encoding_bitrate,
sqrt(rc->variance_st_encoding_bitrate),
rc->avg_st_encoding_bitrate, sqrt(rc->variance_st_encoding_bitrate),
perc_fluctuation);
if ((frame_cnt - 1) != tot_num_frames)
die("Error: Number of input frames not equal to output! \n");
}
#if ROI_MAP
static void set_roi_map(const char *enc_name, vpx_codec_enc_cfg_t *cfg,
vpx_roi_map_t *roi) {
unsigned int i, j;
int block_size = 0;
uint8_t is_vp8 = strncmp(enc_name, "vp8", 3) == 0 ? 1 : 0;
uint8_t is_vp9 = strncmp(enc_name, "vp9", 3) == 0 ? 1 : 0;
if (!is_vp8 && !is_vp9) {
die("unsupported codec.");
}
zero(*roi);
block_size = is_vp9 && !is_vp8 ? 8 : 16;
// ROI is based on the segments (4 for vp8, 8 for vp9), smallest unit for
// segment is 16x16 for vp8, 8x8 for vp9.
roi->rows = (cfg->g_h + block_size - 1) / block_size;
roi->cols = (cfg->g_w + block_size - 1) / block_size;
// Applies delta QP on the segment blocks, varies from -63 to 63.
// Setting to negative means lower QP (better quality).
// Below we set delta_q to the extreme (-63) to show strong effect.
// VP8 uses the first 4 segments. VP9 uses all 8 segments.
zero(roi->delta_q);
roi->delta_q[1] = -63;
// Applies delta loopfilter strength on the segment blocks, varies from -63 to
// 63. Setting to positive means stronger loopfilter. VP8 uses the first 4
// segments. VP9 uses all 8 segments.
zero(roi->delta_lf);
if (is_vp8) {
// Applies skip encoding threshold on the segment blocks, varies from 0 to
// UINT_MAX. Larger value means more skipping of encoding is possible.
// This skip threshold only applies on delta frames.
zero(roi->static_threshold);
}
if (is_vp9) {
// Apply skip segment. Setting to 1 means this block will be copied from
// previous frame.
zero(roi->skip);
}
if (is_vp9) {
// Apply ref frame segment.
// -1 : Do not apply this segment.
// 0 : Froce using intra.
// 1 : Force using last.
// 2 : Force using golden.
// 3 : Force using alfref but not used in non-rd pickmode for 0 lag.
memset(roi->ref_frame, -1, sizeof(roi->ref_frame));
roi->ref_frame[1] = 1;
}
// Use 2 states: 1 is center square, 0 is the rest.
roi->roi_map =
(uint8_t *)calloc(roi->rows * roi->cols, sizeof(*roi->roi_map));
for (i = 0; i < roi->rows; ++i) {
for (j = 0; j < roi->cols; ++j) {
if (i > (roi->rows >> 2) && i < ((roi->rows * 3) >> 2) &&
j > (roi->cols >> 2) && j < ((roi->cols * 3) >> 2)) {
roi->roi_map[i * roi->cols + j] = 1;
}
}
}
}
#endif
// Temporal scaling parameters:
// NOTE: The 3 prediction frames cannot be used interchangeably due to
// differences in the way they are handled throughout the code. The
@ -166,20 +249,20 @@ static void set_temporal_layer_pattern(int layering_mode,
switch (layering_mode) {
case 0: {
// 1-layer.
int ids[1] = {0};
int ids[1] = { 0 };
cfg->ts_periodicity = 1;
*flag_periodicity = 1;
cfg->ts_number_layers = 1;
cfg->ts_rate_decimator[0] = 1;
memcpy(cfg->ts_layer_id, ids, sizeof(ids));
// Update L only.
layer_flags[0] = VPX_EFLAG_FORCE_KF | VP8_EFLAG_NO_UPD_GF |
VP8_EFLAG_NO_UPD_ARF;
layer_flags[0] =
VPX_EFLAG_FORCE_KF | VP8_EFLAG_NO_UPD_GF | VP8_EFLAG_NO_UPD_ARF;
break;
}
case 1: {
// 2-layers, 2-frame period.
int ids[2] = {0, 1};
int ids[2] = { 0, 1 };
cfg->ts_periodicity = 2;
*flag_periodicity = 2;
cfg->ts_number_layers = 2;
@ -188,22 +271,24 @@ static void set_temporal_layer_pattern(int layering_mode,
memcpy(cfg->ts_layer_id, ids, sizeof(ids));
#if 1
// 0=L, 1=GF, Intra-layer prediction enabled.
layer_flags[0] = VPX_EFLAG_FORCE_KF | VP8_EFLAG_NO_UPD_GF |
VP8_EFLAG_NO_UPD_ARF | VP8_EFLAG_NO_REF_GF | VP8_EFLAG_NO_REF_ARF;
layer_flags[1] = VP8_EFLAG_NO_UPD_ARF | VP8_EFLAG_NO_UPD_LAST |
VP8_EFLAG_NO_REF_ARF;
layer_flags[0] = VPX_EFLAG_FORCE_KF | VP8_EFLAG_NO_UPD_GF |
VP8_EFLAG_NO_UPD_ARF | VP8_EFLAG_NO_REF_GF |
VP8_EFLAG_NO_REF_ARF;
layer_flags[1] =
VP8_EFLAG_NO_UPD_ARF | VP8_EFLAG_NO_UPD_LAST | VP8_EFLAG_NO_REF_ARF;
#else
// 0=L, 1=GF, Intra-layer prediction disabled.
layer_flags[0] = VPX_EFLAG_FORCE_KF | VP8_EFLAG_NO_UPD_GF |
VP8_EFLAG_NO_UPD_ARF | VP8_EFLAG_NO_REF_GF | VP8_EFLAG_NO_REF_ARF;
// 0=L, 1=GF, Intra-layer prediction disabled.
layer_flags[0] = VPX_EFLAG_FORCE_KF | VP8_EFLAG_NO_UPD_GF |
VP8_EFLAG_NO_UPD_ARF | VP8_EFLAG_NO_REF_GF |
VP8_EFLAG_NO_REF_ARF;
layer_flags[1] = VP8_EFLAG_NO_UPD_ARF | VP8_EFLAG_NO_UPD_LAST |
VP8_EFLAG_NO_REF_ARF | VP8_EFLAG_NO_REF_LAST;
VP8_EFLAG_NO_REF_ARF | VP8_EFLAG_NO_REF_LAST;
#endif
break;
}
case 2: {
// 2-layers, 3-frame period.
int ids[3] = {0, 1, 1};
int ids[3] = { 0, 1, 1 };
cfg->ts_periodicity = 3;
*flag_periodicity = 3;
cfg->ts_number_layers = 2;
@ -211,16 +296,17 @@ static void set_temporal_layer_pattern(int layering_mode,
cfg->ts_rate_decimator[1] = 1;
memcpy(cfg->ts_layer_id, ids, sizeof(ids));
// 0=L, 1=GF, Intra-layer prediction enabled.
layer_flags[0] = VPX_EFLAG_FORCE_KF | VP8_EFLAG_NO_REF_GF |
VP8_EFLAG_NO_REF_ARF | VP8_EFLAG_NO_UPD_GF | VP8_EFLAG_NO_UPD_ARF;
layer_flags[1] =
layer_flags[2] = VP8_EFLAG_NO_REF_GF | VP8_EFLAG_NO_REF_ARF |
VP8_EFLAG_NO_UPD_ARF | VP8_EFLAG_NO_UPD_LAST;
layer_flags[0] = VPX_EFLAG_FORCE_KF | VP8_EFLAG_NO_REF_GF |
VP8_EFLAG_NO_REF_ARF | VP8_EFLAG_NO_UPD_GF |
VP8_EFLAG_NO_UPD_ARF;
layer_flags[1] = layer_flags[2] =
VP8_EFLAG_NO_REF_GF | VP8_EFLAG_NO_REF_ARF | VP8_EFLAG_NO_UPD_ARF |
VP8_EFLAG_NO_UPD_LAST;
break;
}
case 3: {
// 3-layers, 6-frame period.
int ids[6] = {0, 2, 2, 1, 2, 2};
int ids[6] = { 0, 2, 2, 1, 2, 2 };
cfg->ts_periodicity = 6;
*flag_periodicity = 6;
cfg->ts_number_layers = 3;
@ -229,19 +315,18 @@ static void set_temporal_layer_pattern(int layering_mode,
cfg->ts_rate_decimator[2] = 1;
memcpy(cfg->ts_layer_id, ids, sizeof(ids));
// 0=L, 1=GF, 2=ARF, Intra-layer prediction enabled.
layer_flags[0] = VPX_EFLAG_FORCE_KF | VP8_EFLAG_NO_REF_GF |
VP8_EFLAG_NO_REF_ARF | VP8_EFLAG_NO_UPD_GF | VP8_EFLAG_NO_UPD_ARF;
layer_flags[3] = VP8_EFLAG_NO_REF_ARF | VP8_EFLAG_NO_UPD_ARF |
VP8_EFLAG_NO_UPD_LAST;
layer_flags[1] =
layer_flags[2] =
layer_flags[4] =
layer_flags[5] = VP8_EFLAG_NO_UPD_GF | VP8_EFLAG_NO_UPD_LAST;
layer_flags[0] = VPX_EFLAG_FORCE_KF | VP8_EFLAG_NO_REF_GF |
VP8_EFLAG_NO_REF_ARF | VP8_EFLAG_NO_UPD_GF |
VP8_EFLAG_NO_UPD_ARF;
layer_flags[3] =
VP8_EFLAG_NO_REF_ARF | VP8_EFLAG_NO_UPD_ARF | VP8_EFLAG_NO_UPD_LAST;
layer_flags[1] = layer_flags[2] = layer_flags[4] = layer_flags[5] =
VP8_EFLAG_NO_UPD_GF | VP8_EFLAG_NO_UPD_LAST;
break;
}
case 4: {
// 3-layers, 4-frame period.
int ids[4] = {0, 2, 1, 2};
int ids[4] = { 0, 2, 1, 2 };
cfg->ts_periodicity = 4;
*flag_periodicity = 4;
cfg->ts_number_layers = 3;
@ -250,39 +335,41 @@ static void set_temporal_layer_pattern(int layering_mode,
cfg->ts_rate_decimator[2] = 1;
memcpy(cfg->ts_layer_id, ids, sizeof(ids));
// 0=L, 1=GF, 2=ARF, Intra-layer prediction disabled.
layer_flags[0] = VPX_EFLAG_FORCE_KF | VP8_EFLAG_NO_REF_GF |
VP8_EFLAG_NO_REF_ARF | VP8_EFLAG_NO_UPD_GF | VP8_EFLAG_NO_UPD_ARF;
layer_flags[0] = VPX_EFLAG_FORCE_KF | VP8_EFLAG_NO_REF_GF |
VP8_EFLAG_NO_REF_ARF | VP8_EFLAG_NO_UPD_GF |
VP8_EFLAG_NO_UPD_ARF;
layer_flags[2] = VP8_EFLAG_NO_REF_GF | VP8_EFLAG_NO_REF_ARF |
VP8_EFLAG_NO_UPD_ARF | VP8_EFLAG_NO_UPD_LAST;
layer_flags[1] =
layer_flags[3] = VP8_EFLAG_NO_REF_ARF | VP8_EFLAG_NO_UPD_LAST |
VP8_EFLAG_NO_UPD_GF | VP8_EFLAG_NO_UPD_ARF;
VP8_EFLAG_NO_UPD_ARF | VP8_EFLAG_NO_UPD_LAST;
layer_flags[1] = layer_flags[3] =
VP8_EFLAG_NO_REF_ARF | VP8_EFLAG_NO_UPD_LAST | VP8_EFLAG_NO_UPD_GF |
VP8_EFLAG_NO_UPD_ARF;
break;
}
case 5: {
// 3-layers, 4-frame period.
int ids[4] = {0, 2, 1, 2};
int ids[4] = { 0, 2, 1, 2 };
cfg->ts_periodicity = 4;
*flag_periodicity = 4;
cfg->ts_number_layers = 3;
cfg->ts_number_layers = 3;
cfg->ts_rate_decimator[0] = 4;
cfg->ts_rate_decimator[1] = 2;
cfg->ts_rate_decimator[2] = 1;
memcpy(cfg->ts_layer_id, ids, sizeof(ids));
// 0=L, 1=GF, 2=ARF, Intra-layer prediction enabled in layer 1, disabled
// in layer 2.
layer_flags[0] = VPX_EFLAG_FORCE_KF | VP8_EFLAG_NO_REF_GF |
VP8_EFLAG_NO_REF_ARF | VP8_EFLAG_NO_UPD_GF | VP8_EFLAG_NO_UPD_ARF;
layer_flags[2] = VP8_EFLAG_NO_REF_ARF | VP8_EFLAG_NO_UPD_LAST |
layer_flags[0] = VPX_EFLAG_FORCE_KF | VP8_EFLAG_NO_REF_GF |
VP8_EFLAG_NO_REF_ARF | VP8_EFLAG_NO_UPD_GF |
VP8_EFLAG_NO_UPD_ARF;
layer_flags[2] =
VP8_EFLAG_NO_REF_ARF | VP8_EFLAG_NO_UPD_LAST | VP8_EFLAG_NO_UPD_ARF;
layer_flags[1] = layer_flags[3] =
VP8_EFLAG_NO_REF_ARF | VP8_EFLAG_NO_UPD_LAST | VP8_EFLAG_NO_UPD_GF |
VP8_EFLAG_NO_UPD_ARF;
layer_flags[1] =
layer_flags[3] = VP8_EFLAG_NO_REF_ARF | VP8_EFLAG_NO_UPD_LAST |
VP8_EFLAG_NO_UPD_GF | VP8_EFLAG_NO_UPD_ARF;
break;
}
case 6: {
// 3-layers, 4-frame period.
int ids[4] = {0, 2, 1, 2};
int ids[4] = { 0, 2, 1, 2 };
cfg->ts_periodicity = 4;
*flag_periodicity = 4;
cfg->ts_number_layers = 3;
@ -291,18 +378,19 @@ static void set_temporal_layer_pattern(int layering_mode,
cfg->ts_rate_decimator[2] = 1;
memcpy(cfg->ts_layer_id, ids, sizeof(ids));
// 0=L, 1=GF, 2=ARF, Intra-layer prediction enabled.
layer_flags[0] = VPX_EFLAG_FORCE_KF | VP8_EFLAG_NO_REF_GF |
VP8_EFLAG_NO_REF_ARF | VP8_EFLAG_NO_UPD_GF | VP8_EFLAG_NO_UPD_ARF;
layer_flags[2] = VP8_EFLAG_NO_REF_ARF | VP8_EFLAG_NO_UPD_LAST |
VP8_EFLAG_NO_UPD_ARF;
layer_flags[1] =
layer_flags[3] = VP8_EFLAG_NO_UPD_LAST | VP8_EFLAG_NO_UPD_GF;
layer_flags[0] = VPX_EFLAG_FORCE_KF | VP8_EFLAG_NO_REF_GF |
VP8_EFLAG_NO_REF_ARF | VP8_EFLAG_NO_UPD_GF |
VP8_EFLAG_NO_UPD_ARF;
layer_flags[2] =
VP8_EFLAG_NO_REF_ARF | VP8_EFLAG_NO_UPD_LAST | VP8_EFLAG_NO_UPD_ARF;
layer_flags[1] = layer_flags[3] =
VP8_EFLAG_NO_UPD_LAST | VP8_EFLAG_NO_UPD_GF;
break;
}
case 7: {
// NOTE: Probably of academic interest only.
// 5-layers, 16-frame period.
int ids[16] = {0, 4, 3, 4, 2, 4, 3, 4, 1, 4, 3, 4, 2, 4, 3, 4};
int ids[16] = { 0, 4, 3, 4, 2, 4, 3, 4, 1, 4, 3, 4, 2, 4, 3, 4 };
cfg->ts_periodicity = 16;
*flag_periodicity = 16;
cfg->ts_number_layers = 5;
@ -312,28 +400,21 @@ static void set_temporal_layer_pattern(int layering_mode,
cfg->ts_rate_decimator[3] = 2;
cfg->ts_rate_decimator[4] = 1;
memcpy(cfg->ts_layer_id, ids, sizeof(ids));
layer_flags[0] = VPX_EFLAG_FORCE_KF;
layer_flags[1] =
layer_flags[3] =
layer_flags[5] =
layer_flags[7] =
layer_flags[9] =
layer_flags[11] =
layer_flags[13] =
layer_flags[15] = VP8_EFLAG_NO_UPD_LAST | VP8_EFLAG_NO_UPD_GF |
VP8_EFLAG_NO_UPD_ARF;
layer_flags[2] =
layer_flags[6] =
layer_flags[10] =
layer_flags[14] = VP8_EFLAG_NO_UPD_ARF | VP8_EFLAG_NO_UPD_GF;
layer_flags[4] =
layer_flags[12] = VP8_EFLAG_NO_REF_LAST | VP8_EFLAG_NO_UPD_ARF;
layer_flags[8] = VP8_EFLAG_NO_REF_LAST | VP8_EFLAG_NO_REF_GF;
layer_flags[0] = VPX_EFLAG_FORCE_KF;
layer_flags[1] = layer_flags[3] = layer_flags[5] = layer_flags[7] =
layer_flags[9] = layer_flags[11] = layer_flags[13] = layer_flags[15] =
VP8_EFLAG_NO_UPD_LAST | VP8_EFLAG_NO_UPD_GF |
VP8_EFLAG_NO_UPD_ARF;
layer_flags[2] = layer_flags[6] = layer_flags[10] = layer_flags[14] =
VP8_EFLAG_NO_UPD_ARF | VP8_EFLAG_NO_UPD_GF;
layer_flags[4] = layer_flags[12] =
VP8_EFLAG_NO_REF_LAST | VP8_EFLAG_NO_UPD_ARF;
layer_flags[8] = VP8_EFLAG_NO_REF_LAST | VP8_EFLAG_NO_REF_GF;
break;
}
case 8: {
// 2-layers, with sync point at first frame of layer 1.
int ids[2] = {0, 1};
int ids[2] = { 0, 1 };
cfg->ts_periodicity = 2;
*flag_periodicity = 8;
cfg->ts_number_layers = 2;
@ -345,17 +426,17 @@ static void set_temporal_layer_pattern(int layering_mode,
// key frame. Sync point every 8 frames.
// Layer 0: predict from L and ARF, update L and G.
layer_flags[0] = VPX_EFLAG_FORCE_KF | VP8_EFLAG_NO_REF_GF |
VP8_EFLAG_NO_UPD_ARF;
layer_flags[0] =
VPX_EFLAG_FORCE_KF | VP8_EFLAG_NO_REF_GF | VP8_EFLAG_NO_UPD_ARF;
// Layer 1: sync point: predict from L and ARF, and update G.
layer_flags[1] = VP8_EFLAG_NO_REF_GF | VP8_EFLAG_NO_UPD_LAST |
VP8_EFLAG_NO_UPD_ARF;
layer_flags[1] =
VP8_EFLAG_NO_REF_GF | VP8_EFLAG_NO_UPD_LAST | VP8_EFLAG_NO_UPD_ARF;
// Layer 0, predict from L and ARF, update L.
layer_flags[2] = VP8_EFLAG_NO_REF_GF | VP8_EFLAG_NO_UPD_GF |
VP8_EFLAG_NO_UPD_ARF;
layer_flags[2] =
VP8_EFLAG_NO_REF_GF | VP8_EFLAG_NO_UPD_GF | VP8_EFLAG_NO_UPD_ARF;
// Layer 1: predict from L, G and ARF, and update G.
layer_flags[3] = VP8_EFLAG_NO_UPD_ARF | VP8_EFLAG_NO_UPD_LAST |
VP8_EFLAG_NO_UPD_ENTROPY;
VP8_EFLAG_NO_UPD_ENTROPY;
// Layer 0.
layer_flags[4] = layer_flags[2];
// Layer 1.
@ -364,11 +445,11 @@ static void set_temporal_layer_pattern(int layering_mode,
layer_flags[6] = layer_flags[4];
// Layer 1.
layer_flags[7] = layer_flags[5];
break;
break;
}
case 9: {
// 3-layers: Sync points for layer 1 and 2 every 8 frames.
int ids[4] = {0, 2, 1, 2};
int ids[4] = { 0, 2, 1, 2 };
cfg->ts_periodicity = 4;
*flag_periodicity = 8;
cfg->ts_number_layers = 3;
@ -377,20 +458,21 @@ static void set_temporal_layer_pattern(int layering_mode,
cfg->ts_rate_decimator[2] = 1;
memcpy(cfg->ts_layer_id, ids, sizeof(ids));
// 0=L, 1=GF, 2=ARF.
layer_flags[0] = VPX_EFLAG_FORCE_KF | VP8_EFLAG_NO_REF_GF |
VP8_EFLAG_NO_REF_ARF | VP8_EFLAG_NO_UPD_GF | VP8_EFLAG_NO_UPD_ARF;
layer_flags[0] = VPX_EFLAG_FORCE_KF | VP8_EFLAG_NO_REF_GF |
VP8_EFLAG_NO_REF_ARF | VP8_EFLAG_NO_UPD_GF |
VP8_EFLAG_NO_UPD_ARF;
layer_flags[1] = VP8_EFLAG_NO_REF_GF | VP8_EFLAG_NO_REF_ARF |
VP8_EFLAG_NO_UPD_LAST | VP8_EFLAG_NO_UPD_GF;
layer_flags[2] = VP8_EFLAG_NO_REF_GF | VP8_EFLAG_NO_REF_ARF |
VP8_EFLAG_NO_UPD_LAST | VP8_EFLAG_NO_UPD_ARF;
layer_flags[3] = layer_flags[5] =
VP8_EFLAG_NO_UPD_LAST | VP8_EFLAG_NO_UPD_GF;
layer_flags[2] = VP8_EFLAG_NO_REF_GF | VP8_EFLAG_NO_REF_ARF |
VP8_EFLAG_NO_UPD_LAST | VP8_EFLAG_NO_UPD_ARF;
layer_flags[3] =
layer_flags[5] = VP8_EFLAG_NO_UPD_LAST | VP8_EFLAG_NO_UPD_GF;
layer_flags[4] = VP8_EFLAG_NO_REF_GF | VP8_EFLAG_NO_REF_ARF |
VP8_EFLAG_NO_UPD_GF | VP8_EFLAG_NO_UPD_ARF;
layer_flags[6] = VP8_EFLAG_NO_REF_ARF | VP8_EFLAG_NO_UPD_LAST |
VP8_EFLAG_NO_UPD_ARF;
VP8_EFLAG_NO_UPD_GF | VP8_EFLAG_NO_UPD_ARF;
layer_flags[6] =
VP8_EFLAG_NO_REF_ARF | VP8_EFLAG_NO_UPD_LAST | VP8_EFLAG_NO_UPD_ARF;
layer_flags[7] = VP8_EFLAG_NO_UPD_LAST | VP8_EFLAG_NO_UPD_GF |
VP8_EFLAG_NO_UPD_ARF | VP8_EFLAG_NO_UPD_ENTROPY;
VP8_EFLAG_NO_UPD_ARF | VP8_EFLAG_NO_UPD_ENTROPY;
break;
}
case 10: {
@ -398,7 +480,7 @@ static void set_temporal_layer_pattern(int layering_mode,
// and is only updated on key frame.
// Sync points for layer 1 and 2 every 8 frames.
int ids[4] = {0, 2, 1, 2};
int ids[4] = { 0, 2, 1, 2 };
cfg->ts_periodicity = 4;
*flag_periodicity = 8;
cfg->ts_number_layers = 3;
@ -408,21 +490,21 @@ static void set_temporal_layer_pattern(int layering_mode,
memcpy(cfg->ts_layer_id, ids, sizeof(ids));
// 0=L, 1=GF, 2=ARF.
// Layer 0: predict from L and ARF; update L and G.
layer_flags[0] = VPX_EFLAG_FORCE_KF | VP8_EFLAG_NO_UPD_ARF |
VP8_EFLAG_NO_REF_GF;
layer_flags[0] =
VPX_EFLAG_FORCE_KF | VP8_EFLAG_NO_UPD_ARF | VP8_EFLAG_NO_REF_GF;
// Layer 2: sync point: predict from L and ARF; update none.
layer_flags[1] = VP8_EFLAG_NO_REF_GF | VP8_EFLAG_NO_UPD_GF |
VP8_EFLAG_NO_UPD_ARF | VP8_EFLAG_NO_UPD_LAST |
VP8_EFLAG_NO_UPD_ENTROPY;
VP8_EFLAG_NO_UPD_ARF | VP8_EFLAG_NO_UPD_LAST |
VP8_EFLAG_NO_UPD_ENTROPY;
// Layer 1: sync point: predict from L and ARF; update G.
layer_flags[2] = VP8_EFLAG_NO_REF_GF | VP8_EFLAG_NO_UPD_ARF |
VP8_EFLAG_NO_UPD_LAST;
layer_flags[2] =
VP8_EFLAG_NO_REF_GF | VP8_EFLAG_NO_UPD_ARF | VP8_EFLAG_NO_UPD_LAST;
// Layer 2: predict from L, G, ARF; update none.
layer_flags[3] = VP8_EFLAG_NO_UPD_GF | VP8_EFLAG_NO_UPD_ARF |
VP8_EFLAG_NO_UPD_LAST | VP8_EFLAG_NO_UPD_ENTROPY;
VP8_EFLAG_NO_UPD_LAST | VP8_EFLAG_NO_UPD_ENTROPY;
// Layer 0: predict from L and ARF; update L.
layer_flags[4] = VP8_EFLAG_NO_UPD_GF | VP8_EFLAG_NO_UPD_ARF |
VP8_EFLAG_NO_REF_GF;
layer_flags[4] =
VP8_EFLAG_NO_UPD_GF | VP8_EFLAG_NO_UPD_ARF | VP8_EFLAG_NO_REF_GF;
// Layer 2: predict from L, G, ARF; update none.
layer_flags[5] = layer_flags[3];
// Layer 1: predict from L, G, ARF; update G.
@ -431,11 +513,36 @@ static void set_temporal_layer_pattern(int layering_mode,
layer_flags[7] = layer_flags[3];
break;
}
case 11:
case 11: {
// 3-layers structure with one reference frame.
// This works same as temporal_layering_mode 3.
// This was added to compare with vp9_spatial_svc_encoder.
// 3-layers, 4-frame period.
int ids[4] = { 0, 2, 1, 2 };
cfg->ts_periodicity = 4;
*flag_periodicity = 4;
cfg->ts_number_layers = 3;
cfg->ts_rate_decimator[0] = 4;
cfg->ts_rate_decimator[1] = 2;
cfg->ts_rate_decimator[2] = 1;
memcpy(cfg->ts_layer_id, ids, sizeof(ids));
// 0=L, 1=GF, 2=ARF, Intra-layer prediction disabled.
layer_flags[0] = VP8_EFLAG_NO_REF_GF | VP8_EFLAG_NO_REF_ARF |
VP8_EFLAG_NO_UPD_GF | VP8_EFLAG_NO_UPD_ARF;
layer_flags[2] = VP8_EFLAG_NO_REF_GF | VP8_EFLAG_NO_REF_ARF |
VP8_EFLAG_NO_UPD_ARF | VP8_EFLAG_NO_UPD_LAST;
layer_flags[1] = VP8_EFLAG_NO_REF_GF | VP8_EFLAG_NO_REF_ARF |
VP8_EFLAG_NO_UPD_LAST | VP8_EFLAG_NO_UPD_GF;
layer_flags[3] = VP8_EFLAG_NO_REF_LAST | VP8_EFLAG_NO_REF_ARF |
VP8_EFLAG_NO_UPD_LAST | VP8_EFLAG_NO_UPD_GF;
break;
}
case 12:
default: {
// 3-layers structure as in case 10, but no sync/refresh points for
// layer 1 and 2.
int ids[4] = {0, 2, 1, 2};
int ids[4] = { 0, 2, 1, 2 };
cfg->ts_periodicity = 4;
*flag_periodicity = 8;
cfg->ts_number_layers = 3;
@ -445,15 +552,15 @@ static void set_temporal_layer_pattern(int layering_mode,
memcpy(cfg->ts_layer_id, ids, sizeof(ids));
// 0=L, 1=GF, 2=ARF.
// Layer 0: predict from L and ARF; update L.
layer_flags[0] = VP8_EFLAG_NO_UPD_GF | VP8_EFLAG_NO_UPD_ARF |
VP8_EFLAG_NO_REF_GF;
layer_flags[0] =
VP8_EFLAG_NO_UPD_GF | VP8_EFLAG_NO_UPD_ARF | VP8_EFLAG_NO_REF_GF;
layer_flags[4] = layer_flags[0];
// Layer 1: predict from L, G, ARF; update G.
layer_flags[2] = VP8_EFLAG_NO_UPD_ARF | VP8_EFLAG_NO_UPD_LAST;
layer_flags[6] = layer_flags[2];
// Layer 2: predict from L, G, ARF; update none.
layer_flags[1] = VP8_EFLAG_NO_UPD_GF | VP8_EFLAG_NO_UPD_ARF |
VP8_EFLAG_NO_UPD_LAST | VP8_EFLAG_NO_UPD_ENTROPY;
VP8_EFLAG_NO_UPD_LAST | VP8_EFLAG_NO_UPD_ENTROPY;
layer_flags[3] = layer_flags[1];
layer_flags[5] = layer_flags[1];
layer_flags[7] = layer_flags[1];
@ -463,7 +570,7 @@ static void set_temporal_layer_pattern(int layering_mode,
}
int main(int argc, char **argv) {
VpxVideoWriter *outfile[VPX_TS_MAX_LAYERS] = {NULL};
VpxVideoWriter *outfile[VPX_TS_MAX_LAYERS] = { NULL };
vpx_codec_ctx_t codec;
vpx_codec_enc_cfg_t cfg;
int frame_cnt = 0;
@ -471,26 +578,26 @@ int main(int argc, char **argv) {
vpx_codec_err_t res;
unsigned int width;
unsigned int height;
uint32_t error_resilient = 0;
int speed;
int frame_avail;
int got_data;
int flags = 0;
unsigned int i;
int pts = 0; // PTS starts at 0.
int pts = 0; // PTS starts at 0.
int frame_duration = 1; // 1 timebase tick per frame.
int layering_mode = 0;
int layer_flags[VPX_TS_MAX_PERIODICITY] = {0};
int layer_flags[VPX_TS_MAX_PERIODICITY] = { 0 };
int flag_periodicity = 1;
#if VPX_ENCODER_ABI_VERSION > (4 + VPX_CODEC_ABI_VERSION)
vpx_svc_layer_id_t layer_id = {0, 0};
#else
vpx_svc_layer_id_t layer_id = {0};
#if ROI_MAP
vpx_roi_map_t roi;
#endif
vpx_svc_layer_id_t layer_id = { 0, 0 };
const VpxInterface *encoder = NULL;
FILE *infile = NULL;
struct RateControlMetrics rc;
int64_t cx_time = 0;
const int min_args_base = 11;
const int min_args_base = 13;
#if CONFIG_VP9_HIGHBITDEPTH
vpx_bit_depth_t bit_depth = VPX_BITS_8;
int input_bit_depth = 8;
@ -500,37 +607,42 @@ int main(int argc, char **argv) {
#endif // CONFIG_VP9_HIGHBITDEPTH
double sum_bitrate = 0.0;
double sum_bitrate2 = 0.0;
double framerate = 30.0;
double framerate = 30.0;
zero(rc.layer_target_bitrate);
exec_name = argv[0];
// Check usage and arguments.
if (argc < min_args) {
#if CONFIG_VP9_HIGHBITDEPTH
die("Usage: %s <infile> <outfile> <codec_type(vp8/vp9)> <width> <height> "
"<rate_num> <rate_den> <speed> <frame_drop_threshold> <mode> "
"<Rate_0> ... <Rate_nlayers-1> <bit-depth> \n", argv[0]);
"<rate_num> <rate_den> <speed> <frame_drop_threshold> "
"<error_resilient> <threads> <mode> "
"<Rate_0> ... <Rate_nlayers-1> <bit-depth> \n",
argv[0]);
#else
die("Usage: %s <infile> <outfile> <codec_type(vp8/vp9)> <width> <height> "
"<rate_num> <rate_den> <speed> <frame_drop_threshold> <mode> "
"<Rate_0> ... <Rate_nlayers-1> \n", argv[0]);
"<rate_num> <rate_den> <speed> <frame_drop_threshold> "
"<error_resilient> <threads> <mode> "
"<Rate_0> ... <Rate_nlayers-1> \n",
argv[0]);
#endif // CONFIG_VP9_HIGHBITDEPTH
}
encoder = get_vpx_encoder_by_name(argv[3]);
if (!encoder)
die("Unsupported codec.");
if (!encoder) die("Unsupported codec.");
printf("Using %s\n", vpx_codec_iface_name(encoder->codec_interface()));
width = strtol(argv[4], NULL, 0);
height = strtol(argv[5], NULL, 0);
width = (unsigned int)strtoul(argv[4], NULL, 0);
height = (unsigned int)strtoul(argv[5], NULL, 0);
if (width < 16 || width % 2 || height < 16 || height % 2) {
die("Invalid resolution: %d x %d", width, height);
}
layering_mode = strtol(argv[10], NULL, 0);
if (layering_mode < 0 || layering_mode > 12) {
die("Invalid layering mode (0..12) %s", argv[10]);
layering_mode = (int)strtol(argv[12], NULL, 0);
if (layering_mode < 0 || layering_mode > 13) {
die("Invalid layering mode (0..12) %s", argv[12]);
}
if (argc != min_args + mode_to_num_layers[layering_mode]) {
@ -538,7 +650,7 @@ int main(int argc, char **argv) {
}
#if CONFIG_VP9_HIGHBITDEPTH
switch (strtol(argv[argc-1], NULL, 0)) {
switch (strtol(argv[argc - 1], NULL, 0)) {
case 8:
bit_depth = VPX_BITS_8;
input_bit_depth = 8;
@ -551,13 +663,11 @@ int main(int argc, char **argv) {
bit_depth = VPX_BITS_12;
input_bit_depth = 12;
break;
default:
die("Invalid bit depth (8, 10, 12) %s", argv[argc-1]);
default: die("Invalid bit depth (8, 10, 12) %s", argv[argc - 1]);
}
if (!vpx_img_alloc(&raw,
bit_depth == VPX_BITS_8 ? VPX_IMG_FMT_I420 :
VPX_IMG_FMT_I42016,
width, height, 32)) {
if (!vpx_img_alloc(
&raw, bit_depth == VPX_BITS_8 ? VPX_IMG_FMT_I420 : VPX_IMG_FMT_I42016,
width, height, 32)) {
die("Failed to allocate image", width, height);
}
#else
@ -586,55 +696,63 @@ int main(int argc, char **argv) {
#endif // CONFIG_VP9_HIGHBITDEPTH
// Timebase format e.g. 30fps: numerator=1, demoninator = 30.
cfg.g_timebase.num = strtol(argv[6], NULL, 0);
cfg.g_timebase.den = strtol(argv[7], NULL, 0);
cfg.g_timebase.num = (int)strtol(argv[6], NULL, 0);
cfg.g_timebase.den = (int)strtol(argv[7], NULL, 0);
speed = strtol(argv[8], NULL, 0);
speed = (int)strtol(argv[8], NULL, 0);
if (speed < 0) {
die("Invalid speed setting: must be positive");
}
for (i = min_args_base;
(int)i < min_args_base + mode_to_num_layers[layering_mode];
++i) {
cfg.ts_target_bitrate[i - 11] = strtol(argv[i], NULL, 0);
(int)i < min_args_base + mode_to_num_layers[layering_mode]; ++i) {
rc.layer_target_bitrate[i - 13] = (int)strtol(argv[i], NULL, 0);
if (strncmp(encoder->name, "vp8", 3) == 0)
cfg.ts_target_bitrate[i - 13] = rc.layer_target_bitrate[i - 13];
else if (strncmp(encoder->name, "vp9", 3) == 0)
cfg.layer_target_bitrate[i - 13] = rc.layer_target_bitrate[i - 13];
}
// Real time parameters.
cfg.rc_dropframe_thresh = strtol(argv[9], NULL, 0);
cfg.rc_dropframe_thresh = (unsigned int)strtoul(argv[9], NULL, 0);
cfg.rc_end_usage = VPX_CBR;
cfg.rc_resize_allowed = 0;
cfg.rc_min_quantizer = 2;
cfg.rc_max_quantizer = 56;
if (strncmp(encoder->name, "vp9", 3) == 0)
cfg.rc_max_quantizer = 52;
if (strncmp(encoder->name, "vp9", 3) == 0) cfg.rc_max_quantizer = 52;
cfg.rc_undershoot_pct = 50;
cfg.rc_overshoot_pct = 50;
cfg.rc_buf_initial_sz = 500;
cfg.rc_buf_initial_sz = 600;
cfg.rc_buf_optimal_sz = 600;
cfg.rc_buf_sz = 1000;
// Use 1 thread as default.
cfg.g_threads = 1;
// Disable dynamic resizing by default.
cfg.rc_resize_allowed = 0;
// Use 1 thread as default.
cfg.g_threads = (unsigned int)strtoul(argv[11], NULL, 0);
error_resilient = (uint32_t)strtoul(argv[10], NULL, 0);
if (error_resilient != 0 && error_resilient != 1) {
die("Invalid value for error resilient (0, 1): %d.", error_resilient);
}
// Enable error resilient mode.
cfg.g_error_resilient = 1;
cfg.g_lag_in_frames = 0;
cfg.g_error_resilient = error_resilient;
cfg.g_lag_in_frames = 0;
cfg.kf_mode = VPX_KF_AUTO;
// Disable automatic keyframe placement.
cfg.kf_min_dist = cfg.kf_max_dist = 3000;
set_temporal_layer_pattern(layering_mode,
&cfg,
layer_flags,
cfg.temporal_layering_mode = VP9E_TEMPORAL_LAYERING_MODE_BYPASS;
set_temporal_layer_pattern(layering_mode, &cfg, layer_flags,
&flag_periodicity);
set_rate_control_metrics(&rc, &cfg);
// Target bandwidth for the whole stream.
// Set to ts_target_bitrate for highest layer (total bitrate).
cfg.rc_target_bitrate = cfg.ts_target_bitrate[cfg.ts_number_layers - 1];
// Set to layer_target_bitrate for highest layer (total bitrate).
cfg.rc_target_bitrate = rc.layer_target_bitrate[cfg.ts_number_layers - 1];
// Open input file.
if (!(infile = fopen(argv[1], "rb"))) {
@ -654,15 +772,14 @@ int main(int argc, char **argv) {
snprintf(file_name, sizeof(file_name), "%s_%d.ivf", argv[2], i);
outfile[i] = vpx_video_writer_open(file_name, kContainerIVF, &info);
if (!outfile[i])
die("Failed to open %s for writing", file_name);
if (!outfile[i]) die("Failed to open %s for writing", file_name);
assert(outfile[i] != NULL);
}
// No spatial layers in this encoder.
cfg.ss_number_layers = 1;
// Initialize codec.
// Initialize codec.
#if CONFIG_VP9_HIGHBITDEPTH
if (vpx_codec_enc_init(
&codec, encoder->codec_interface(), &cfg,
@ -674,18 +791,48 @@ int main(int argc, char **argv) {
if (strncmp(encoder->name, "vp8", 3) == 0) {
vpx_codec_control(&codec, VP8E_SET_CPUUSED, -speed);
vpx_codec_control(&codec, VP8E_SET_NOISE_SENSITIVITY, kDenoiserOnYOnly);
vpx_codec_control(&codec, VP8E_SET_NOISE_SENSITIVITY, kVp8DenoiserOff);
vpx_codec_control(&codec, VP8E_SET_STATIC_THRESHOLD, 1);
vpx_codec_control(&codec, VP8E_SET_GF_CBR_BOOST_PCT, 0);
#if ROI_MAP
set_roi_map(encoder->name, &cfg, &roi);
if (vpx_codec_control(&codec, VP8E_SET_ROI_MAP, &roi))
die_codec(&codec, "Failed to set ROI map");
#endif
} else if (strncmp(encoder->name, "vp9", 3) == 0) {
vpx_codec_control(&codec, VP8E_SET_CPUUSED, speed);
vpx_codec_control(&codec, VP9E_SET_AQ_MODE, 3);
vpx_codec_control(&codec, VP9E_SET_FRAME_PERIODIC_BOOST, 0);
vpx_codec_control(&codec, VP9E_SET_NOISE_SENSITIVITY, 0);
vpx_codec_control(&codec, VP8E_SET_STATIC_THRESHOLD, 1);
vpx_codec_control(&codec, VP9E_SET_TILE_COLUMNS, (cfg.g_threads >> 1));
if (vpx_codec_control(&codec, VP9E_SET_SVC, layering_mode > 0 ? 1: 0)) {
die_codec(&codec, "Failed to set SVC");
vpx_svc_extra_cfg_t svc_params;
memset(&svc_params, 0, sizeof(svc_params));
vpx_codec_control(&codec, VP8E_SET_CPUUSED, speed);
vpx_codec_control(&codec, VP9E_SET_AQ_MODE, 3);
vpx_codec_control(&codec, VP9E_SET_GF_CBR_BOOST_PCT, 0);
vpx_codec_control(&codec, VP9E_SET_FRAME_PARALLEL_DECODING, 0);
vpx_codec_control(&codec, VP9E_SET_FRAME_PERIODIC_BOOST, 0);
vpx_codec_control(&codec, VP9E_SET_NOISE_SENSITIVITY, kVp9DenoiserOff);
vpx_codec_control(&codec, VP8E_SET_STATIC_THRESHOLD, 1);
vpx_codec_control(&codec, VP9E_SET_TUNE_CONTENT, 0);
vpx_codec_control(&codec, VP9E_SET_TILE_COLUMNS, get_msb(cfg.g_threads));
#if ROI_MAP
set_roi_map(encoder->name, &cfg, &roi);
if (vpx_codec_control(&codec, VP9E_SET_ROI_MAP, &roi))
die_codec(&codec, "Failed to set ROI map");
vpx_codec_control(&codec, VP9E_SET_AQ_MODE, 0);
#endif
// TODO(marpan/jianj): There is an issue with row-mt for low resolutons at
// high speed settings, disable its use for those cases for now.
if (cfg.g_threads > 1 && ((cfg.g_w > 320 && cfg.g_h > 240) || speed < 7))
vpx_codec_control(&codec, VP9E_SET_ROW_MT, 1);
else
vpx_codec_control(&codec, VP9E_SET_ROW_MT, 0);
if (vpx_codec_control(&codec, VP9E_SET_SVC, layering_mode > 0 ? 1 : 0))
die_codec(&codec, "Failed to set SVC");
for (i = 0; i < cfg.ts_number_layers; ++i) {
svc_params.max_quantizers[i] = cfg.rc_max_quantizer;
svc_params.min_quantizers[i] = cfg.rc_min_quantizer;
}
svc_params.scaling_factor_num[0] = cfg.g_h;
svc_params.scaling_factor_den[0] = cfg.g_h;
vpx_codec_control(&codec, VP9E_SET_SVC_PARAMETERS, &svc_params);
}
if (strncmp(encoder->name, "vp8", 3) == 0) {
vpx_codec_control(&codec, VP8E_SET_SCREEN_CONTENT_MODE, 0);
@ -695,7 +842,7 @@ int main(int argc, char **argv) {
// For generating smaller key frames, use a smaller max_intra_size_pct
// value, like 100 or 200.
{
const int max_intra_size_pct = 900;
const int max_intra_size_pct = 1000;
vpx_codec_control(&codec, VP8E_SET_MAX_INTRA_BITRATE_PCT,
max_intra_size_pct);
}
@ -705,10 +852,8 @@ int main(int argc, char **argv) {
struct vpx_usec_timer timer;
vpx_codec_iter_t iter = NULL;
const vpx_codec_cx_pkt_t *pkt;
#if VPX_ENCODER_ABI_VERSION > (4 + VPX_CODEC_ABI_VERSION)
// Update the temporal layer_id. No spatial layers in this test.
layer_id.spatial_layer_id = 0;
#endif
layer_id.temporal_layer_id =
cfg.ts_layer_id[frame_cnt % cfg.ts_periodicity];
if (strncmp(encoder->name, "vp9", 3) == 0) {
@ -718,14 +863,12 @@ int main(int argc, char **argv) {
layer_id.temporal_layer_id);
}
flags = layer_flags[frame_cnt % flag_periodicity];
if (layering_mode == 0)
flags = 0;
if (layering_mode == 0) flags = 0;
frame_avail = vpx_img_read(&raw, infile);
if (frame_avail)
++rc.layer_input_frames[layer_id.temporal_layer_id];
if (frame_avail) ++rc.layer_input_frames[layer_id.temporal_layer_id];
vpx_usec_timer_start(&timer);
if (vpx_codec_encode(&codec, frame_avail? &raw : NULL, pts, 1, flags,
VPX_DL_REALTIME)) {
if (vpx_codec_encode(&codec, frame_avail ? &raw : NULL, pts, 1, flags,
VPX_DL_REALTIME)) {
die_codec(&codec, "Failed to encode frame");
}
vpx_usec_timer_mark(&timer);
@ -735,12 +878,12 @@ int main(int argc, char **argv) {
layer_flags[0] &= ~VPX_EFLAG_FORCE_KF;
}
got_data = 0;
while ( (pkt = vpx_codec_get_cx_data(&codec, &iter)) ) {
while ((pkt = vpx_codec_get_cx_data(&codec, &iter))) {
got_data = 1;
switch (pkt->kind) {
case VPX_CODEC_CX_FRAME_PKT:
for (i = cfg.ts_layer_id[frame_cnt % cfg.ts_periodicity];
i < cfg.ts_number_layers; ++i) {
i < cfg.ts_number_layers; ++i) {
vpx_video_writer_write_frame(outfile[i], pkt->data.frame.buf,
pkt->data.frame.sz, pts);
++rc.layer_tot_enc_frames[i];
@ -783,8 +926,7 @@ int main(int argc, char **argv) {
}
}
break;
default:
break;
default: break;
}
}
++frame_cnt;
@ -794,17 +936,17 @@ int main(int argc, char **argv) {
printout_rate_control_summary(&rc, &cfg, frame_cnt);
printf("\n");
printf("Frame cnt and encoding time/FPS stats for encoding: %d %f %f \n",
frame_cnt,
1000 * (float)cx_time / (double)(frame_cnt * 1000000),
1000000 * (double)frame_cnt / (double)cx_time);
frame_cnt, 1000 * (float)cx_time / (double)(frame_cnt * 1000000),
1000000 * (double)frame_cnt / (double)cx_time);
if (vpx_codec_destroy(&codec))
die_codec(&codec, "Failed to destroy codec");
if (vpx_codec_destroy(&codec)) die_codec(&codec, "Failed to destroy codec");
// Try to rewrite the output file headers with the actual frame count.
for (i = 0; i < cfg.ts_number_layers; ++i)
vpx_video_writer_close(outfile[i]);
for (i = 0; i < cfg.ts_number_layers; ++i) vpx_video_writer_close(outfile[i]);
vpx_img_free(&raw);
#if ROI_MAP
free(roi.roi_map);
#endif
return EXIT_SUCCESS;
}

View File

@ -23,7 +23,7 @@ static void fix_framerate(int *num, int *den) {
// we can guess the framerate using only the timebase in this
// case. Other files would require reading ahead to guess the
// timebase, like we do for webm.
if (*num < 1000) {
if (*den > 0 && *den < 1000000000 && *num > 0 && *num < 1000) {
// Correct for the factor of 2 applied to the timebase in the encoder.
if (*num & 1)
*den *= 2;
@ -46,7 +46,8 @@ int file_is_ivf(struct VpxInputContext *input_ctx) {
is_ivf = 1;
if (mem_get_le16(raw_hdr + 4) != 0) {
fprintf(stderr, "Error: Unrecognized IVF version! This file may not"
fprintf(stderr,
"Error: Unrecognized IVF version! This file may not"
" decode properly.");
}
@ -69,14 +70,13 @@ int file_is_ivf(struct VpxInputContext *input_ctx) {
return is_ivf;
}
int ivf_read_frame(FILE *infile, uint8_t **buffer,
size_t *bytes_read, size_t *buffer_size) {
char raw_header[IVF_FRAME_HDR_SZ] = {0};
int ivf_read_frame(FILE *infile, uint8_t **buffer, size_t *bytes_read,
size_t *buffer_size) {
char raw_header[IVF_FRAME_HDR_SZ] = { 0 };
size_t frame_size = 0;
if (fread(raw_header, IVF_FRAME_HDR_SZ, 1, infile) != 1) {
if (!feof(infile))
warn("Failed to read frame size\n");
if (!feof(infile)) warn("Failed to read frame size\n");
} else {
frame_size = mem_get_le32(raw_header);

View File

@ -18,11 +18,11 @@ extern "C" {
int file_is_ivf(struct VpxInputContext *input);
int ivf_read_frame(FILE *infile, uint8_t **buffer,
size_t *bytes_read, size_t *buffer_size);
int ivf_read_frame(FILE *infile, uint8_t **buffer, size_t *bytes_read,
size_t *buffer_size);
#ifdef __cplusplus
} /* extern "C" */
} /* extern "C" */
#endif
#endif // IVFDEC_H_

View File

@ -13,10 +13,8 @@
#include "vpx/vpx_encoder.h"
#include "vpx_ports/mem_ops.h"
void ivf_write_file_header(FILE *outfile,
const struct vpx_codec_enc_cfg *cfg,
unsigned int fourcc,
int frame_cnt) {
void ivf_write_file_header(FILE *outfile, const struct vpx_codec_enc_cfg *cfg,
unsigned int fourcc, int frame_cnt) {
char header[32];
header[0] = 'D';

View File

@ -19,17 +19,15 @@ struct vpx_codec_cx_pkt;
extern "C" {
#endif
void ivf_write_file_header(FILE *outfile,
const struct vpx_codec_enc_cfg *cfg,
uint32_t fourcc,
int frame_cnt);
void ivf_write_file_header(FILE *outfile, const struct vpx_codec_enc_cfg *cfg,
uint32_t fourcc, int frame_cnt);
void ivf_write_frame_header(FILE *outfile, int64_t pts, size_t frame_size);
void ivf_write_frame_size(FILE *outfile, size_t frame_size);
#ifdef __cplusplus
} /* extern "C" */
} /* extern "C" */
#endif
#endif // IVFENC_H_

View File

@ -943,18 +943,6 @@ GENERATE_XML = NO
XML_OUTPUT = xml
# The XML_SCHEMA tag can be used to specify an XML schema,
# which can be used by a validating XML parser to check the
# syntax of the XML files.
XML_SCHEMA =
# The XML_DTD tag can be used to specify an XML DTD,
# which can be used by a validating XML parser to check the
# syntax of the XML files.
XML_DTD =
# If the XML_PROGRAMLISTING tag is set to YES Doxygen will
# dump the program listings (including syntax highlighting
# and cross-referencing information) to the XML output. Note that

270
libs.mk
View File

@ -12,7 +12,7 @@
# ARM assembly files are written in RVCT-style. We use some make magic to
# filter those files to allow GCC compilation
ifeq ($(ARCH_ARM),yes)
ASM:=$(if $(filter yes,$(CONFIG_GCC)$(CONFIG_MSVS)),.asm.s,.asm)
ASM:=$(if $(filter yes,$(CONFIG_GCC)$(CONFIG_MSVS)),.asm.S,.asm)
else
ASM:=.asm
endif
@ -25,7 +25,7 @@ $$(BUILD_PFX)$(1).h: $$(SRC_PATH_BARE)/$(2)
@echo " [CREATE] $$@"
$$(qexec)$$(SRC_PATH_BARE)/build/make/rtcd.pl --arch=$$(TGT_ISA) \
--sym=$(1) \
--config=$$(CONFIG_DIR)$$(target)$$(if $$(FAT_ARCHS),,-$$(TOOLCHAIN)).mk \
--config=$$(CONFIG_DIR)$$(target)-$$(TOOLCHAIN).mk \
$$(RTCD_OPTIONS) $$^ > $$@
CLEAN-OBJS += $$(BUILD_PFX)$(1).h
RTCD += $$(BUILD_PFX)$(1).h
@ -34,13 +34,6 @@ endef
CODEC_SRCS-yes += CHANGELOG
CODEC_SRCS-yes += libs.mk
# If this is a universal (fat) binary, then all the subarchitectures have
# already been built and our job is to stitch them together. The
# BUILD_LIBVPX variable indicates whether we should be building
# (compiling, linking) the library. The LIPO_LIBVPX variable indicates
# that we're stitching.
$(eval $(if $(filter universal%,$(TOOLCHAIN)),LIPO_LIBVPX,BUILD_LIBVPX):=yes)
include $(SRC_PATH_BARE)/vpx/vpx_codec.mk
CODEC_SRCS-yes += $(addprefix vpx/,$(call enabled,API_SRCS))
CODEC_DOC_SRCS += $(addprefix vpx/,$(call enabled,API_DOC_SRCS))
@ -54,7 +47,13 @@ CODEC_SRCS-yes += $(addprefix vpx_scale/,$(call enabled,SCALE_SRCS))
include $(SRC_PATH_BARE)/vpx_ports/vpx_ports.mk
CODEC_SRCS-yes += $(addprefix vpx_ports/,$(call enabled,PORTS_SRCS))
ifneq ($(CONFIG_VP8_ENCODER)$(CONFIG_VP8_DECODER),)
include $(SRC_PATH_BARE)/vpx_dsp/vpx_dsp.mk
CODEC_SRCS-yes += $(addprefix vpx_dsp/,$(call enabled,DSP_SRCS))
include $(SRC_PATH_BARE)/vpx_util/vpx_util.mk
CODEC_SRCS-yes += $(addprefix vpx_util/,$(call enabled,UTIL_SRCS))
ifeq ($(CONFIG_VP8),yes)
VP8_PREFIX=vp8/
include $(SRC_PATH_BARE)/$(VP8_PREFIX)vp8_common.mk
endif
@ -77,7 +76,7 @@ ifeq ($(CONFIG_VP8_DECODER),yes)
CODEC_DOC_SECTIONS += vp8 vp8_decoder
endif
ifneq ($(CONFIG_VP9_ENCODER)$(CONFIG_VP9_DECODER),)
ifeq ($(CONFIG_VP9),yes)
VP9_PREFIX=vp9/
include $(SRC_PATH_BARE)/$(VP9_PREFIX)vp9_common.mk
endif
@ -89,7 +88,7 @@ ifeq ($(CONFIG_VP9_ENCODER),yes)
CODEC_EXPORTS-yes += $(addprefix $(VP9_PREFIX),$(VP9_CX_EXPORTS))
CODEC_SRCS-yes += $(VP9_PREFIX)vp9cx.mk vpx/vp8.h vpx/vp8cx.h
INSTALL-LIBS-yes += include/vpx/vp8.h include/vpx/vp8cx.h
INSTALL-LIBS-$(CONFIG_SPATIAL_SVC) += include/vpx/svc_context.h
INSTALL-LIBS-yes += include/vpx/svc_context.h
INSTALL_MAPS += include/vpx/% $(SRC_PATH_BARE)/$(VP9_PREFIX)/%
CODEC_DOC_SRCS += vpx/vp8.h vpx/vp8cx.h
CODEC_DOC_SECTIONS += vp9 vp9_encoder
@ -107,9 +106,6 @@ ifeq ($(CONFIG_VP9_DECODER),yes)
CODEC_DOC_SECTIONS += vp9 vp9_decoder
endif
VP9_PREFIX=vp9/
$(BUILD_PFX)$(VP9_PREFIX)%.c.o: CFLAGS += -Wextra
ifeq ($(CONFIG_ENCODERS),yes)
CODEC_DOC_SECTIONS += encoder
endif
@ -117,6 +113,12 @@ ifeq ($(CONFIG_DECODERS),yes)
CODEC_DOC_SECTIONS += decoder
endif
# Suppress -Wextra warnings in third party code.
$(BUILD_PFX)third_party/googletest/%.cc.o: CXXFLAGS += -Wno-missing-field-initializers
# Suppress -Wextra warnings in first party code pending investigation.
# https://bugs.chromium.org/p/webm/issues/detail?id=1069
$(BUILD_PFX)vp8/encoder/onyx_if.c.o: CFLAGS += -Wno-unknown-warning-option -Wno-clobbered
$(BUILD_PFX)vp8/decoder/onyxd_if.c.o: CFLAGS += -Wno-unknown-warning-option -Wno-clobbered
ifeq ($(CONFIG_MSVS),yes)
CODEC_LIB=$(if $(CONFIG_STATIC_MSVCRT),vpxmt,vpxmd)
@ -137,19 +139,21 @@ INSTALL_MAPS += $(foreach p,$(VS_PLATFORMS),$(LIBSUBDIR)/$(p)/% $(p)/Release/%)
INSTALL_MAPS += $(foreach p,$(VS_PLATFORMS),$(LIBSUBDIR)/$(p)/% $(p)/Debug/%)
endif
CODEC_SRCS-$(BUILD_LIBVPX) += build/make/version.sh
CODEC_SRCS-$(BUILD_LIBVPX) += build/make/rtcd.pl
CODEC_SRCS-$(BUILD_LIBVPX) += vpx_ports/emmintrin_compat.h
CODEC_SRCS-$(BUILD_LIBVPX) += vpx_ports/mem_ops.h
CODEC_SRCS-$(BUILD_LIBVPX) += vpx_ports/mem_ops_aligned.h
CODEC_SRCS-$(BUILD_LIBVPX) += vpx_ports/vpx_once.h
CODEC_SRCS-$(BUILD_LIBVPX) += $(BUILD_PFX)vpx_config.c
CODEC_SRCS-yes += build/make/version.sh
CODEC_SRCS-yes += build/make/rtcd.pl
CODEC_SRCS-yes += vpx_ports/emmintrin_compat.h
CODEC_SRCS-yes += vpx_ports/mem_ops.h
CODEC_SRCS-yes += vpx_ports/mem_ops_aligned.h
CODEC_SRCS-yes += vpx_ports/vpx_once.h
CODEC_SRCS-yes += $(BUILD_PFX)vpx_config.c
INSTALL-SRCS-no += $(BUILD_PFX)vpx_config.c
ifeq ($(ARCH_X86)$(ARCH_X86_64),yes)
INSTALL-SRCS-$(CONFIG_CODEC_SRCS) += third_party/x86inc/x86inc.asm
INSTALL-SRCS-$(CONFIG_CODEC_SRCS) += vpx_dsp/x86/bitdepth_conversion_sse2.asm
endif
CODEC_EXPORTS-$(BUILD_LIBVPX) += vpx/exports_com
CODEC_EXPORTS-yes += vpx/exports_com
CODEC_EXPORTS-$(CONFIG_ENCODERS) += vpx/exports_enc
CODEC_EXPORTS-$(CONFIG_VP9_ENCODER) += vpx/exports_spatial_svc
CODEC_EXPORTS-$(CONFIG_DECODERS) += vpx/exports_dec
INSTALL-LIBS-yes += include/vpx/vpx_codec.h
@ -182,6 +186,13 @@ libvpx_srcs.txt:
@echo $(CODEC_SRCS) | xargs -n1 echo | LC_ALL=C sort -u > $@
CLEAN-OBJS += libvpx_srcs.txt
# Assembly files that are included, but don't define symbols themselves.
# Filtered out to avoid Windows build warnings.
ASM_INCLUDES := \
third_party/x86inc/x86inc.asm \
vpx_config.asm \
vpx_ports/x86_abi_support.asm \
vpx_dsp/x86/bitdepth_conversion_sse2.asm \
ifeq ($(CONFIG_EXTERNAL_BUILD),yes)
ifeq ($(CONFIG_MSVS),yes)
@ -193,12 +204,7 @@ vpx.def: $(call enabled,CODEC_EXPORTS)
--out=$@ $^
CLEAN-OBJS += vpx.def
# Assembly files that are included, but don't define symbols themselves.
# Filtered out to avoid Visual Studio build warnings.
ASM_INCLUDES := \
third_party/x86inc/x86inc.asm \
vpx_config.asm \
vpx_ports/x86_abi_support.asm \
vpx.$(VCPROJ_SFX): VCPROJ_SRCS=$(filter-out $(addprefix %, $(ASM_INCLUDES)), $^)
vpx.$(VCPROJ_SFX): $(CODEC_SRCS) vpx.def
@echo " [CREATE] $@"
@ -212,43 +218,68 @@ vpx.$(VCPROJ_SFX): $(CODEC_SRCS) vpx.def
--ver=$(CONFIG_VS_VERSION) \
--src-path-bare="$(SRC_PATH_BARE)" \
--out=$@ $(CFLAGS) \
$(filter-out $(addprefix %, $(ASM_INCLUDES)), $^) \
$(filter $(SRC_PATH_BARE)/vp8/%.c, $(VCPROJ_SRCS)) \
$(filter $(SRC_PATH_BARE)/vp8/%.h, $(VCPROJ_SRCS)) \
$(filter $(SRC_PATH_BARE)/vp9/%.c, $(VCPROJ_SRCS)) \
$(filter $(SRC_PATH_BARE)/vp9/%.h, $(VCPROJ_SRCS)) \
$(filter $(SRC_PATH_BARE)/vpx/%, $(VCPROJ_SRCS)) \
$(filter $(SRC_PATH_BARE)/vpx_dsp/%, $(VCPROJ_SRCS)) \
$(filter-out $(addprefix $(SRC_PATH_BARE)/, \
vp8/%.c vp8/%.h vp9/%.c vp9/%.h vpx/% vpx_dsp/%), \
$(VCPROJ_SRCS)) \
--src-path-bare="$(SRC_PATH_BARE)" \
PROJECTS-$(BUILD_LIBVPX) += vpx.$(VCPROJ_SFX)
PROJECTS-yes += vpx.$(VCPROJ_SFX)
vpx.$(VCPROJ_SFX): vpx_config.asm
vpx.$(VCPROJ_SFX): $(RTCD)
endif
else
LIBVPX_OBJS=$(call objs,$(CODEC_SRCS))
OBJS-$(BUILD_LIBVPX) += $(LIBVPX_OBJS)
LIBS-$(if $(BUILD_LIBVPX),$(CONFIG_STATIC)) += $(BUILD_PFX)libvpx.a $(BUILD_PFX)libvpx_g.a
LIBVPX_OBJS=$(call objs, $(filter-out $(ASM_INCLUDES), $(CODEC_SRCS)))
OBJS-yes += $(LIBVPX_OBJS)
LIBS-$(if yes,$(CONFIG_STATIC)) += $(BUILD_PFX)libvpx.a $(BUILD_PFX)libvpx_g.a
$(BUILD_PFX)libvpx_g.a: $(LIBVPX_OBJS)
BUILD_LIBVPX_SO := $(if $(BUILD_LIBVPX),$(CONFIG_SHARED))
SO_VERSION_MAJOR := 5
SO_VERSION_MINOR := 0
SO_VERSION_PATCH := 0
ifeq ($(filter darwin%,$(TGT_OS)),$(TGT_OS))
LIBVPX_SO := libvpx.$(VERSION_MAJOR).dylib
LIBVPX_SO := libvpx.$(SO_VERSION_MAJOR).dylib
SHARED_LIB_SUF := .dylib
EXPORT_FILE := libvpx.syms
LIBVPX_SO_SYMLINKS := $(addprefix $(LIBSUBDIR)/, \
libvpx.dylib )
else
LIBVPX_SO := libvpx.so.$(VERSION_MAJOR).$(VERSION_MINOR).$(VERSION_PATCH)
ifeq ($(filter iphonesimulator%,$(TGT_OS)),$(TGT_OS))
LIBVPX_SO := libvpx.$(SO_VERSION_MAJOR).dylib
SHARED_LIB_SUF := .dylib
EXPORT_FILE := libvpx.syms
LIBVPX_SO_SYMLINKS := $(addprefix $(LIBSUBDIR)/, libvpx.dylib)
else
ifeq ($(filter os2%,$(TGT_OS)),$(TGT_OS))
LIBVPX_SO := libvpx$(SO_VERSION_MAJOR).dll
SHARED_LIB_SUF := _dll.a
EXPORT_FILE := libvpx.def
LIBVPX_SO_SYMLINKS :=
LIBVPX_SO_IMPLIB := libvpx_dll.a
else
LIBVPX_SO := libvpx.so.$(SO_VERSION_MAJOR).$(SO_VERSION_MINOR).$(SO_VERSION_PATCH)
SHARED_LIB_SUF := .so
EXPORT_FILE := libvpx.ver
SYM_LINK := libvpx.so
LIBVPX_SO_SYMLINKS := $(addprefix $(LIBSUBDIR)/, \
libvpx.so libvpx.so.$(VERSION_MAJOR) \
libvpx.so.$(VERSION_MAJOR).$(VERSION_MINOR))
libvpx.so libvpx.so.$(SO_VERSION_MAJOR) \
libvpx.so.$(SO_VERSION_MAJOR).$(SO_VERSION_MINOR))
endif
endif
endif
LIBS-$(BUILD_LIBVPX_SO) += $(BUILD_PFX)$(LIBVPX_SO)\
$(notdir $(LIBVPX_SO_SYMLINKS))
LIBS-$(CONFIG_SHARED) += $(BUILD_PFX)$(LIBVPX_SO)\
$(notdir $(LIBVPX_SO_SYMLINKS)) \
$(if $(LIBVPX_SO_IMPLIB), $(BUILD_PFX)$(LIBVPX_SO_IMPLIB))
$(BUILD_PFX)$(LIBVPX_SO): $(LIBVPX_OBJS) $(EXPORT_FILE)
$(BUILD_PFX)$(LIBVPX_SO): extralibs += -lm
$(BUILD_PFX)$(LIBVPX_SO): SONAME = libvpx.so.$(VERSION_MAJOR)
$(BUILD_PFX)$(LIBVPX_SO): SONAME = libvpx.so.$(SO_VERSION_MAJOR)
$(BUILD_PFX)$(LIBVPX_SO): EXPORTS_FILE = $(EXPORT_FILE)
libvpx.ver: $(call enabled,CODEC_EXPORTS)
@ -263,6 +294,19 @@ libvpx.syms: $(call enabled,CODEC_EXPORTS)
$(qexec)awk '{print "_"$$2}' $^ >$@
CLEAN-OBJS += libvpx.syms
libvpx.def: $(call enabled,CODEC_EXPORTS)
@echo " [CREATE] $@"
$(qexec)echo LIBRARY $(LIBVPX_SO:.dll=) INITINSTANCE TERMINSTANCE > $@
$(qexec)echo "DATA MULTIPLE NONSHARED" >> $@
$(qexec)echo "EXPORTS" >> $@
$(qexec)awk '!/vpx_svc_*/ {print "_"$$2}' $^ >>$@
CLEAN-OBJS += libvpx.def
libvpx_dll.a: $(LIBVPX_SO)
@echo " [IMPLIB] $@"
$(qexec)emximp -o $@ $<
CLEAN-OBJS += libvpx_dll.a
define libvpx_symlink_template
$(1): $(2)
@echo " [LN] $(2) $$@"
@ -278,11 +322,12 @@ $(eval $(call libvpx_symlink_template,\
$(LIBVPX_SO)))
INSTALL-LIBS-$(BUILD_LIBVPX_SO) += $(LIBVPX_SO_SYMLINKS)
INSTALL-LIBS-$(BUILD_LIBVPX_SO) += $(LIBSUBDIR)/$(LIBVPX_SO)
INSTALL-LIBS-$(CONFIG_SHARED) += $(LIBVPX_SO_SYMLINKS)
INSTALL-LIBS-$(CONFIG_SHARED) += $(LIBSUBDIR)/$(LIBVPX_SO)
INSTALL-LIBS-$(CONFIG_SHARED) += $(if $(LIBVPX_SO_IMPLIB),$(LIBSUBDIR)/$(LIBVPX_SO_IMPLIB))
LIBS-$(BUILD_LIBVPX) += vpx.pc
LIBS-yes += vpx.pc
vpx.pc: config.mk libs.mk
@echo " [CREATE] $@"
$(qexec)echo '# pkg-config file from libvpx $(VERSION_STRING)' > $@
@ -308,9 +353,6 @@ INSTALL_MAPS += $(LIBSUBDIR)/pkgconfig/%.pc %.pc
CLEAN-OBJS += vpx.pc
endif
LIBS-$(LIPO_LIBVPX) += libvpx.a
$(eval $(if $(LIPO_LIBVPX),$(call lipo_lib_template,libvpx.a)))
#
# Rule to make assembler configuration file from C configuration file
#
@ -333,13 +375,19 @@ endif
#
# Add assembler dependencies for configuration.
#
$(filter %.s.o,$(OBJS-yes)): $(BUILD_PFX)vpx_config.asm
$(filter %.S.o,$(OBJS-yes)): $(BUILD_PFX)vpx_config.asm
$(filter %$(ASM).o,$(OBJS-yes)): $(BUILD_PFX)vpx_config.asm
$(shell $(SRC_PATH_BARE)/build/make/version.sh "$(SRC_PATH_BARE)" $(BUILD_PFX)vpx_version.h)
CLEAN-OBJS += $(BUILD_PFX)vpx_version.h
#
# Add include path for libwebm sources.
#
ifeq ($(CONFIG_WEBM_IO),yes)
CXXFLAGS += -I$(SRC_PATH_BARE)/third_party/libwebm
endif
##
## libvpx test directives
@ -349,10 +397,14 @@ LIBVPX_TEST_DATA_PATH ?= .
include $(SRC_PATH_BARE)/test/test.mk
LIBVPX_TEST_SRCS=$(addprefix test/,$(call enabled,LIBVPX_TEST_SRCS))
LIBVPX_TEST_BINS=./test_libvpx$(EXE_SFX)
LIBVPX_TEST_BIN=./test_libvpx$(EXE_SFX)
LIBVPX_TEST_DATA=$(addprefix $(LIBVPX_TEST_DATA_PATH)/,\
$(call enabled,LIBVPX_TEST_DATA))
libvpx_test_data_url=http://downloads.webmproject.org/test_data/libvpx/$(1)
libvpx_test_data_url=https://storage.googleapis.com/downloads.webmproject.org/test_data/libvpx/$(1)
TEST_INTRA_PRED_SPEED_BIN=./test_intra_pred_speed$(EXE_SFX)
TEST_INTRA_PRED_SPEED_SRCS=$(addprefix test/,$(call enabled,TEST_INTRA_PRED_SPEED_SRCS))
TEST_INTRA_PRED_SPEED_OBJS := $(sort $(call objs,$(TEST_INTRA_PRED_SPEED_SRCS)))
libvpx_test_srcs.txt:
@echo " [CREATE] $@"
@ -361,8 +413,16 @@ CLEAN-OBJS += libvpx_test_srcs.txt
$(LIBVPX_TEST_DATA): $(SRC_PATH_BARE)/test/test-data.sha1
@echo " [DOWNLOAD] $@"
$(qexec)trap 'rm -f $@' INT TERM &&\
curl -L -o $@ $(call libvpx_test_data_url,$(@F))
# Attempt to download the file using curl, retrying once if it fails for a
# partial file (18).
$(qexec)( \
trap 'rm -f $@' INT TERM; \
curl="curl --retry 1 -L -o $@ $(call libvpx_test_data_url,$(@F))"; \
$$curl; \
case "$$?" in \
18) $$curl -C -;; \
esac \
)
testdata:: $(LIBVPX_TEST_DATA)
$(qexec)[ -x "$$(which sha1sum)" ] && sha1sum=sha1sum;\
@ -371,12 +431,10 @@ testdata:: $(LIBVPX_TEST_DATA)
if [ -n "$${sha1sum}" ]; then\
set -e;\
echo "Checking test data:";\
if [ -n "$(LIBVPX_TEST_DATA)" ]; then\
for f in $(call enabled,LIBVPX_TEST_DATA); do\
grep $$f $(SRC_PATH_BARE)/test/test-data.sha1 |\
(cd $(LIBVPX_TEST_DATA_PATH); $${sha1sum} -c);\
done; \
fi; \
for f in $(call enabled,LIBVPX_TEST_DATA); do\
grep $$f $(SRC_PATH_BARE)/test/test-data.sha1 |\
(cd $(LIBVPX_TEST_DATA_PATH); $${sha1sum} -c);\
done; \
else\
echo "Skipping test data integrity check, sha1sum not found.";\
fi
@ -413,11 +471,30 @@ test_libvpx.$(VCPROJ_SFX): $(LIBVPX_TEST_SRCS) vpx.$(VCPROJ_SFX) gtest.$(VCPROJ_
$(if $(CONFIG_STATIC_MSVCRT),--static-crt) \
--out=$@ $(INTERNAL_CFLAGS) $(CFLAGS) \
-I. -I"$(SRC_PATH_BARE)/third_party/googletest/src/include" \
$(if $(CONFIG_WEBM_IO),-I"$(SRC_PATH_BARE)/third_party/libwebm") \
-L. -l$(CODEC_LIB) -l$(GTEST_LIB) $^
PROJECTS-$(CONFIG_MSVS) += test_libvpx.$(VCPROJ_SFX)
LIBVPX_TEST_BINS := $(addprefix $(TGT_OS:win64=x64)/Release/,$(notdir $(LIBVPX_TEST_BINS)))
LIBVPX_TEST_BIN := $(addprefix $(TGT_OS:win64=x64)/Release/,$(notdir $(LIBVPX_TEST_BIN)))
ifneq ($(strip $(TEST_INTRA_PRED_SPEED_OBJS)),)
PROJECTS-$(CONFIG_MSVS) += test_intra_pred_speed.$(VCPROJ_SFX)
test_intra_pred_speed.$(VCPROJ_SFX): $(TEST_INTRA_PRED_SPEED_SRCS) vpx.$(VCPROJ_SFX) gtest.$(VCPROJ_SFX)
@echo " [CREATE] $@"
$(qexec)$(GEN_VCPROJ) \
--exe \
--target=$(TOOLCHAIN) \
--name=test_intra_pred_speed \
-D_VARIADIC_MAX=10 \
--proj-guid=CD837F5F-52D8-4314-A370-895D614166A7 \
--ver=$(CONFIG_VS_VERSION) \
--src-path-bare="$(SRC_PATH_BARE)" \
$(if $(CONFIG_STATIC_MSVCRT),--static-crt) \
--out=$@ $(INTERNAL_CFLAGS) $(CFLAGS) \
-I. -I"$(SRC_PATH_BARE)/third_party/googletest/src/include" \
-L. -l$(CODEC_LIB) -l$(GTEST_LIB) $^
endif # TEST_INTRA_PRED_SPEED
endif
else
@ -428,45 +505,54 @@ ifeq ($(filter win%,$(TGT_OS)),$(TGT_OS))
# Disabling pthreads globally will cause issues on darwin and possibly elsewhere
$(GTEST_OBJS) $(GTEST_OBJS:.o=.d): CXXFLAGS += -DGTEST_HAS_PTHREAD=0
endif
$(GTEST_OBJS) $(GTEST_OBJS:.o=.d): CXXFLAGS += -I$(SRC_PATH_BARE)/third_party/googletest/src
$(GTEST_OBJS) $(GTEST_OBJS:.o=.d): CXXFLAGS += -I$(SRC_PATH_BARE)/third_party/googletest/src/include
OBJS-$(BUILD_LIBVPX) += $(GTEST_OBJS)
LIBS-$(BUILD_LIBVPX) += $(BUILD_PFX)libgtest.a $(BUILD_PFX)libgtest_g.a
GTEST_INCLUDES := -I$(SRC_PATH_BARE)/third_party/googletest/src
GTEST_INCLUDES += -I$(SRC_PATH_BARE)/third_party/googletest/src/include
$(GTEST_OBJS) $(GTEST_OBJS:.o=.d): CXXFLAGS += $(GTEST_INCLUDES)
OBJS-yes += $(GTEST_OBJS)
LIBS-yes += $(BUILD_PFX)libgtest.a $(BUILD_PFX)libgtest_g.a
$(BUILD_PFX)libgtest_g.a: $(GTEST_OBJS)
LIBVPX_TEST_OBJS=$(sort $(call objs,$(LIBVPX_TEST_SRCS)))
$(LIBVPX_TEST_OBJS) $(LIBVPX_TEST_OBJS:.o=.d): CXXFLAGS += -I$(SRC_PATH_BARE)/third_party/googletest/src
$(LIBVPX_TEST_OBJS) $(LIBVPX_TEST_OBJS:.o=.d): CXXFLAGS += -I$(SRC_PATH_BARE)/third_party/googletest/src/include
OBJS-$(BUILD_LIBVPX) += $(LIBVPX_TEST_OBJS)
BINS-$(BUILD_LIBVPX) += $(LIBVPX_TEST_BINS)
$(LIBVPX_TEST_OBJS) $(LIBVPX_TEST_OBJS:.o=.d): CXXFLAGS += $(GTEST_INCLUDES)
OBJS-yes += $(LIBVPX_TEST_OBJS)
BINS-yes += $(LIBVPX_TEST_BIN)
CODEC_LIB=$(if $(CONFIG_DEBUG_LIBS),vpx_g,vpx)
CODEC_LIB_SUF=$(if $(CONFIG_SHARED),.so,.a)
$(foreach bin,$(LIBVPX_TEST_BINS),\
$(if $(BUILD_LIBVPX),$(eval $(bin): \
lib$(CODEC_LIB)$(CODEC_LIB_SUF) libgtest.a ))\
$(if $(BUILD_LIBVPX),$(eval $(call linkerxx_template,$(bin),\
$(LIBVPX_TEST_OBJS) \
-L. -lvpx -lgtest $(extralibs) -lm)\
)))\
$(if $(LIPO_LIBS),$(eval $(call lipo_bin_template,$(bin))))\
CODEC_LIB_SUF=$(if $(CONFIG_SHARED),$(SHARED_LIB_SUF),.a)
TEST_LIBS := lib$(CODEC_LIB)$(CODEC_LIB_SUF) libgtest.a
$(LIBVPX_TEST_BIN): $(TEST_LIBS)
$(eval $(call linkerxx_template,$(LIBVPX_TEST_BIN), \
$(LIBVPX_TEST_OBJS) \
-L. -lvpx -lgtest $(extralibs) -lm))
endif
ifneq ($(strip $(TEST_INTRA_PRED_SPEED_OBJS)),)
$(TEST_INTRA_PRED_SPEED_OBJS) $(TEST_INTRA_PRED_SPEED_OBJS:.o=.d): CXXFLAGS += $(GTEST_INCLUDES)
OBJS-yes += $(TEST_INTRA_PRED_SPEED_OBJS)
BINS-yes += $(TEST_INTRA_PRED_SPEED_BIN)
$(TEST_INTRA_PRED_SPEED_BIN): $(TEST_LIBS)
$(eval $(call linkerxx_template,$(TEST_INTRA_PRED_SPEED_BIN), \
$(TEST_INTRA_PRED_SPEED_OBJS) \
-L. -lvpx -lgtest $(extralibs) -lm))
endif # TEST_INTRA_PRED_SPEED
endif # CONFIG_UNIT_TESTS
# Install test sources only if codec source is included
INSTALL-SRCS-$(CONFIG_CODEC_SRCS) += $(patsubst $(SRC_PATH_BARE)/%,%,\
$(shell find $(SRC_PATH_BARE)/third_party/googletest -type f))
INSTALL-SRCS-$(CONFIG_CODEC_SRCS) += $(LIBVPX_TEST_SRCS)
INSTALL-SRCS-$(CONFIG_CODEC_SRCS) += $(TEST_INTRA_PRED_SPEED_SRCS)
define test_shard_template
test:: test_shard.$(1)
test_shard.$(1): $(LIBVPX_TEST_BINS) testdata
test-no-data-check:: test_shard_ndc.$(1)
test_shard.$(1) test_shard_ndc.$(1): $(LIBVPX_TEST_BIN)
@set -e; \
for t in $(LIBVPX_TEST_BINS); do \
export GTEST_SHARD_INDEX=$(1); \
export GTEST_TOTAL_SHARDS=$(2); \
$$$$t; \
done
export GTEST_SHARD_INDEX=$(1); \
export GTEST_TOTAL_SHARDS=$(2); \
$(LIBVPX_TEST_BIN)
test_shard.$(1): testdata
.PHONY: test_shard.$(1)
endef
@ -511,15 +597,16 @@ ifeq ($(CONFIG_MSVS),yes)
# TODO(tomfinegan): Support running the debug versions of tools?
TEST_BIN_PATH := $(addsuffix /$(TGT_OS:win64=x64)/Release, $(TEST_BIN_PATH))
endif
utiltest: testdata
utiltest utiltest-no-data-check:
$(qexec)$(SRC_PATH_BARE)/test/vpxdec.sh \
--test-data-path $(LIBVPX_TEST_DATA_PATH) \
--bin-path $(TEST_BIN_PATH)
$(qexec)$(SRC_PATH_BARE)/test/vpxenc.sh \
--test-data-path $(LIBVPX_TEST_DATA_PATH) \
--bin-path $(TEST_BIN_PATH)
utiltest: testdata
else
utiltest:
utiltest utiltest-no-data-check:
@echo Unit tests must be enabled to make the utiltest target.
endif
@ -537,11 +624,12 @@ ifeq ($(CONFIG_MSVS),yes)
# TODO(tomfinegan): Support running the debug versions of tools?
EXAMPLES_BIN_PATH := $(TGT_OS:win64=x64)/Release
endif
exampletest: examples testdata
exampletest exampletest-no-data-check: examples
$(qexec)$(SRC_PATH_BARE)/test/examples.sh \
--test-data-path $(LIBVPX_TEST_DATA_PATH) \
--bin-path $(EXAMPLES_BIN_PATH)
exampletest: testdata
else
exampletest:
exampletest exampletest-no-data-check:
@echo Unit tests must be enabled to make the exampletest target.
endif

View File

@ -20,19 +20,17 @@
* Still in the public domain.
*/
#include <string.h> /* for memcpy() */
#include <string.h> /* for memcpy() */
#include "md5_utils.h"
void
byteSwap(UWORD32 *buf, unsigned words) {
static void byteSwap(UWORD32 *buf, unsigned words) {
md5byte *p;
/* Only swap bytes for big endian machines */
int i = 1;
if (*(char *)&i == 1)
return;
if (*(char *)&i == 1) return;
p = (md5byte *)buf;
@ -47,8 +45,7 @@ byteSwap(UWORD32 *buf, unsigned words) {
* Start MD5 accumulation. Set bit count to 0 and buffer to mysterious
* initialization constants.
*/
void
MD5Init(struct MD5Context *ctx) {
void MD5Init(struct MD5Context *ctx) {
ctx->buf[0] = 0x67452301;
ctx->buf[1] = 0xefcdab89;
ctx->buf[2] = 0x98badcfe;
@ -62,8 +59,7 @@ MD5Init(struct MD5Context *ctx) {
* Update context to reflect the concatenation of another buffer full
* of bytes.
*/
void
MD5Update(struct MD5Context *ctx, md5byte const *buf, unsigned len) {
void MD5Update(struct MD5Context *ctx, md5byte const *buf, unsigned len) {
UWORD32 t;
/* Update byte count */
@ -71,9 +67,9 @@ MD5Update(struct MD5Context *ctx, md5byte const *buf, unsigned len) {
t = ctx->bytes[0];
if ((ctx->bytes[0] = t + len) < t)
ctx->bytes[1]++; /* Carry from low to high */
ctx->bytes[1]++; /* Carry from low to high */
t = 64 - (t & 0x3f); /* Space available in ctx->in (at least 1) */
t = 64 - (t & 0x3f); /* Space available in ctx->in (at least 1) */
if (t > len) {
memcpy((md5byte *)ctx->in + 64 - t, buf, len);
@ -104,8 +100,7 @@ MD5Update(struct MD5Context *ctx, md5byte const *buf, unsigned len) {
* Final wrapup - pad to 64-byte boundary with the bit pattern
* 1 0* (64-bit count of bits processed, MSB-first)
*/
void
MD5Final(md5byte digest[16], struct MD5Context *ctx) {
void MD5Final(md5byte digest[16], struct MD5Context *ctx) {
int count = ctx->bytes[0] & 0x3f; /* Number of bytes in ctx->in */
md5byte *p = (md5byte *)ctx->in + count;
@ -115,7 +110,7 @@ MD5Final(md5byte digest[16], struct MD5Context *ctx) {
/* Bytes of padding needed to make 56 bytes (-8..55) */
count = 56 - 1 - count;
if (count < 0) { /* Padding forces an extra block */
if (count < 0) { /* Padding forces an extra block */
memset(p, 0, count + 8);
byteSwap(ctx->in, 16);
MD5Transform(ctx->buf, ctx->in);
@ -147,16 +142,27 @@ MD5Final(md5byte digest[16], struct MD5Context *ctx) {
#define F4(x, y, z) (y ^ (x | ~z))
/* This is the central step in the MD5 algorithm. */
#define MD5STEP(f,w,x,y,z,in,s) \
(w += f(x,y,z) + in, w = (w<<s | w>>(32-s)) + x)
#define MD5STEP(f, w, x, y, z, in, s) \
(w += f(x, y, z) + in, w = (w << s | w >> (32 - s)) + x)
#if defined(__clang__) && defined(__has_attribute)
#if __has_attribute(no_sanitize)
#define VPX_NO_UNSIGNED_OVERFLOW_CHECK \
__attribute__((no_sanitize("unsigned-integer-overflow")))
#endif
#endif
#ifndef VPX_NO_UNSIGNED_OVERFLOW_CHECK
#define VPX_NO_UNSIGNED_OVERFLOW_CHECK
#endif
/*
* The core of the MD5 algorithm, this alters an existing MD5 hash to
* reflect the addition of 16 longwords of new data. MD5Update blocks
* the data and converts bytes into longwords for this routine.
*/
void
MD5Transform(UWORD32 buf[4], UWORD32 const in[16]) {
VPX_NO_UNSIGNED_OVERFLOW_CHECK void MD5Transform(UWORD32 buf[4],
UWORD32 const in[16]) {
register UWORD32 a, b, c, d;
a = buf[0];
@ -238,4 +244,6 @@ MD5Transform(UWORD32 buf[4], UWORD32 const in[16]) {
buf[3] += d;
}
#undef VPX_NO_UNSIGNED_OVERFLOW_CHECK
#endif

View File

@ -37,7 +37,13 @@ struct rate_hist {
struct rate_hist *init_rate_histogram(const vpx_codec_enc_cfg_t *cfg,
const vpx_rational_t *fps) {
int i;
struct rate_hist *hist = malloc(sizeof(*hist));
struct rate_hist *hist = calloc(1, sizeof(*hist));
if (hist == NULL || cfg == NULL || fps == NULL || fps->num == 0 ||
fps->den == 0) {
destroy_rate_histogram(hist);
return NULL;
}
// Determine the number of samples in the buffer. Use the file's framerate
// to determine the number of frames in rc_buf_sz milliseconds, with an
@ -45,8 +51,7 @@ struct rate_hist *init_rate_histogram(const vpx_codec_enc_cfg_t *cfg,
hist->samples = cfg->rc_buf_sz * 5 / 4 * fps->num / fps->den / 1000;
// prevent division by zero
if (hist->samples == 0)
hist->samples = 1;
if (hist->samples == 0) hist->samples = 1;
hist->frames = 0;
hist->total = 0;
@ -78,15 +83,20 @@ void update_rate_histogram(struct rate_hist *hist,
int64_t avg_bitrate = 0;
int64_t sum_sz = 0;
const int64_t now = pkt->data.frame.pts * 1000 *
(uint64_t)cfg->g_timebase.num /
(uint64_t)cfg->g_timebase.den;
(uint64_t)cfg->g_timebase.num /
(uint64_t)cfg->g_timebase.den;
int idx = hist->frames++ % hist->samples;
int idx;
if (hist == NULL || cfg == NULL || pkt == NULL) return;
idx = hist->frames++ % hist->samples;
hist->pts[idx] = now;
hist->sz[idx] = (int)pkt->data.frame.sz;
if (now < cfg->rc_buf_initial_sz)
return;
if (now < cfg->rc_buf_initial_sz) return;
if (!cfg->rc_target_bitrate) return;
then = now;
@ -95,20 +105,16 @@ void update_rate_histogram(struct rate_hist *hist,
const int i_idx = (i - 1) % hist->samples;
then = hist->pts[i_idx];
if (now - then > cfg->rc_buf_sz)
break;
if (now - then > cfg->rc_buf_sz) break;
sum_sz += hist->sz[i_idx];
}
if (now == then)
return;
if (now == then) return;
avg_bitrate = sum_sz * 8 * 1000 / (now - then);
idx = (int)(avg_bitrate * (RATE_BINS / 2) / (cfg->rc_target_bitrate * 1000));
if (idx < 0)
idx = 0;
if (idx > RATE_BINS - 1)
idx = RATE_BINS - 1;
if (idx < 0) idx = 0;
if (idx > RATE_BINS - 1) idx = RATE_BINS - 1;
if (hist->bucket[idx].low > avg_bitrate)
hist->bucket[idx].low = (int)avg_bitrate;
if (hist->bucket[idx].high < avg_bitrate)
@ -117,19 +123,22 @@ void update_rate_histogram(struct rate_hist *hist,
hist->total++;
}
static int merge_hist_buckets(struct hist_bucket *bucket,
int max_buckets, int *num_buckets) {
static int merge_hist_buckets(struct hist_bucket *bucket, int max_buckets,
int *num_buckets) {
int small_bucket = 0, merge_bucket = INT_MAX, big_bucket = 0;
int buckets = *num_buckets;
int buckets;
int i;
assert(bucket != NULL);
assert(num_buckets != NULL);
buckets = *num_buckets;
/* Find the extrema for this list of buckets */
big_bucket = small_bucket = 0;
for (i = 0; i < buckets; i++) {
if (bucket[i].count < bucket[small_bucket].count)
small_bucket = i;
if (bucket[i].count > bucket[big_bucket].count)
big_bucket = i;
if (bucket[i].count < bucket[small_bucket].count) small_bucket = i;
if (bucket[i].count > bucket[big_bucket].count) big_bucket = i;
}
/* If we have too many buckets, merge the smallest with an adjacent
@ -171,13 +180,10 @@ static int merge_hist_buckets(struct hist_bucket *bucket,
*/
big_bucket = small_bucket = 0;
for (i = 0; i < buckets; i++) {
if (i > merge_bucket)
bucket[i] = bucket[i + 1];
if (i > merge_bucket) bucket[i] = bucket[i + 1];
if (bucket[i].count < bucket[small_bucket].count)
small_bucket = i;
if (bucket[i].count > bucket[big_bucket].count)
big_bucket = i;
if (bucket[i].count < bucket[small_bucket].count) small_bucket = i;
if (bucket[i].count > bucket[big_bucket].count) big_bucket = i;
}
}
@ -185,11 +191,13 @@ static int merge_hist_buckets(struct hist_bucket *bucket,
return bucket[big_bucket].count;
}
static void show_histogram(const struct hist_bucket *bucket,
int buckets, int total, int scale) {
static void show_histogram(const struct hist_bucket *bucket, int buckets,
int total, int scale) {
const char *pat1, *pat2;
int i;
assert(bucket != NULL);
switch ((int)(log(bucket[buckets - 1].high) / log(10)) + 1) {
case 1:
case 2:
@ -229,8 +237,7 @@ static void show_histogram(const struct hist_bucket *bucket,
pct = (float)(100.0 * bucket[i].count / total);
len = HIST_BAR_MAX * bucket[i].count / scale;
if (len < 1)
len = 1;
if (len < 1) len = 1;
assert(len <= HIST_BAR_MAX);
if (bucket[i].low == bucket[i].high)
@ -238,8 +245,7 @@ static void show_histogram(const struct hist_bucket *bucket,
else
fprintf(stderr, pat2, bucket[i].low, bucket[i].high);
for (j = 0; j < HIST_BAR_MAX; j++)
fprintf(stderr, j < len ? "=" : " ");
for (j = 0; j < HIST_BAR_MAX; j++) fprintf(stderr, j < len ? "=" : " ");
fprintf(stderr, "\t%5d (%6.2f%%)\n", bucket[i].count, pct);
}
}
@ -265,14 +271,15 @@ void show_q_histogram(const int counts[64], int max_buckets) {
show_histogram(bucket, buckets, total, scale);
}
void show_rate_histogram(struct rate_hist *hist,
const vpx_codec_enc_cfg_t *cfg, int max_buckets) {
void show_rate_histogram(struct rate_hist *hist, const vpx_codec_enc_cfg_t *cfg,
int max_buckets) {
int i, scale;
int buckets = 0;
if (hist == NULL || cfg == NULL) return;
for (i = 0; i < RATE_BINS; i++) {
if (hist->bucket[i].low == INT_MAX)
continue;
if (hist->bucket[i].low == INT_MAX) continue;
hist->bucket[buckets++] = hist->bucket[i];
}

View File

@ -11,6 +11,10 @@
#ifndef TEST_ACM_RANDOM_H_
#define TEST_ACM_RANDOM_H_
#include <assert.h>
#include <limits>
#include "third_party/googletest/src/include/gtest/gtest.h"
#include "vpx/vpx_integer.h"
@ -23,15 +27,19 @@ class ACMRandom {
explicit ACMRandom(int seed) : random_(seed) {}
void Reset(int seed) {
random_.Reseed(seed);
}
void Reset(int seed) { random_.Reseed(seed); }
uint16_t Rand16(void) {
const uint32_t value =
random_.Generate(testing::internal::Random::kMaxRange);
return (value >> 15) & 0xffff;
}
int16_t Rand9Signed(void) {
// Use 9 bits: values between 255 (0x0FF) and -256 (0x100).
const uint32_t value = random_.Generate(512);
return static_cast<int16_t>(value) - 256;
}
uint8_t Rand8(void) {
const uint32_t value =
random_.Generate(testing::internal::Random::kMaxRange);
@ -46,17 +54,18 @@ class ACMRandom {
return r < 128 ? r << 4 : r >> 4;
}
int PseudoUniform(int range) {
uint32_t RandRange(const uint32_t range) {
// testing::internal::Random::Generate provides values in the range
// testing::internal::Random::kMaxRange.
assert(range <= testing::internal::Random::kMaxRange);
return random_.Generate(range);
}
int operator()(int n) {
return PseudoUniform(n);
}
int PseudoUniform(int range) { return random_.Generate(range); }
static int DeterministicSeed(void) {
return 0xbaba;
}
int operator()(int n) { return PseudoUniform(n); }
static int DeterministicSeed(void) { return 0xbaba; }
private:
testing::internal::Random random_;

View File

@ -0,0 +1,128 @@
/*
* Copyright (c) 2015 The WebM project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#include <algorithm>
#include "third_party/googletest/src/include/gtest/gtest.h"
#include "test/codec_factory.h"
#include "test/encode_test_driver.h"
#include "test/util.h"
#include "test/y4m_video_source.h"
namespace {
// Check if any pixel in a 16x16 macroblock varies between frames.
int CheckMb(const vpx_image_t &current, const vpx_image_t &previous, int mb_r,
int mb_c) {
for (int plane = 0; plane < 3; plane++) {
int r = 16 * mb_r;
int c0 = 16 * mb_c;
int r_top = std::min(r + 16, static_cast<int>(current.d_h));
int c_top = std::min(c0 + 16, static_cast<int>(current.d_w));
r = std::max(r, 0);
c0 = std::max(c0, 0);
if (plane > 0 && current.x_chroma_shift) {
c_top = (c_top + 1) >> 1;
c0 >>= 1;
}
if (plane > 0 && current.y_chroma_shift) {
r_top = (r_top + 1) >> 1;
r >>= 1;
}
for (; r < r_top; ++r) {
for (int c = c0; c < c_top; ++c) {
if (current.planes[plane][current.stride[plane] * r + c] !=
previous.planes[plane][previous.stride[plane] * r + c]) {
return 1;
}
}
}
}
return 0;
}
void GenerateMap(int mb_rows, int mb_cols, const vpx_image_t &current,
const vpx_image_t &previous, uint8_t *map) {
for (int mb_r = 0; mb_r < mb_rows; ++mb_r) {
for (int mb_c = 0; mb_c < mb_cols; ++mb_c) {
map[mb_r * mb_cols + mb_c] = CheckMb(current, previous, mb_r, mb_c);
}
}
}
const int kAqModeCyclicRefresh = 3;
class ActiveMapRefreshTest
: public ::libvpx_test::EncoderTest,
public ::libvpx_test::CodecTestWith2Params<libvpx_test::TestMode, int> {
protected:
ActiveMapRefreshTest() : EncoderTest(GET_PARAM(0)) {}
virtual ~ActiveMapRefreshTest() {}
virtual void SetUp() {
InitializeConfig();
SetMode(GET_PARAM(1));
cpu_used_ = GET_PARAM(2);
}
virtual void PreEncodeFrameHook(::libvpx_test::VideoSource *video,
::libvpx_test::Encoder *encoder) {
::libvpx_test::Y4mVideoSource *y4m_video =
static_cast<libvpx_test::Y4mVideoSource *>(video);
if (video->frame() == 1) {
encoder->Control(VP8E_SET_CPUUSED, cpu_used_);
encoder->Control(VP9E_SET_AQ_MODE, kAqModeCyclicRefresh);
} else if (video->frame() >= 2 && video->img()) {
vpx_image_t *current = video->img();
vpx_image_t *previous = y4m_holder_->img();
ASSERT_TRUE(previous != NULL);
vpx_active_map_t map = vpx_active_map_t();
const int width = static_cast<int>(current->d_w);
const int height = static_cast<int>(current->d_h);
const int mb_width = (width + 15) / 16;
const int mb_height = (height + 15) / 16;
uint8_t *active_map = new uint8_t[mb_width * mb_height];
GenerateMap(mb_height, mb_width, *current, *previous, active_map);
map.cols = mb_width;
map.rows = mb_height;
map.active_map = active_map;
encoder->Control(VP8E_SET_ACTIVEMAP, &map);
delete[] active_map;
}
if (video->img()) {
y4m_video->SwapBuffers(y4m_holder_);
}
}
int cpu_used_;
::libvpx_test::Y4mVideoSource *y4m_holder_;
};
TEST_P(ActiveMapRefreshTest, Test) {
cfg_.g_lag_in_frames = 0;
cfg_.g_profile = 1;
cfg_.rc_target_bitrate = 600;
cfg_.rc_resize_allowed = 0;
cfg_.rc_min_quantizer = 8;
cfg_.rc_max_quantizer = 30;
cfg_.g_pass = VPX_RC_ONE_PASS;
cfg_.rc_end_usage = VPX_CBR;
cfg_.kf_max_dist = 90000;
::libvpx_test::Y4mVideoSource video("desktop_credits.y4m", 0, 30);
::libvpx_test::Y4mVideoSource video_holder("desktop_credits.y4m", 0, 30);
video_holder.Begin();
y4m_holder_ = &video_holder;
ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
}
VP9_INSTANTIATE_TEST_CASE(ActiveMapRefreshTest,
::testing::Values(::libvpx_test::kRealTime),
::testing::Range(5, 6));
} // namespace

View File

@ -39,6 +39,7 @@ class ActiveMapTest
encoder->Control(VP8E_SET_CPUUSED, cpu_used_);
} else if (video->frame() == 3) {
vpx_active_map_t map = vpx_active_map_t();
/* clang-format off */
uint8_t active_map[9 * 13] = {
1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0,
1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0,
@ -50,6 +51,7 @@ class ActiveMapTest
0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 1, 1,
1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0,
};
/* clang-format on */
map.cols = (kWidth + 15) / 16;
map.rows = (kHeight + 15) / 16;
ASSERT_EQ(map.cols, 13u);
@ -77,13 +79,13 @@ TEST_P(ActiveMapTest, Test) {
cfg_.rc_end_usage = VPX_CBR;
cfg_.kf_max_dist = 90000;
::libvpx_test::I420VideoSource video("hantro_odd.yuv", kWidth, kHeight, 30,
1, 0, 20);
::libvpx_test::I420VideoSource video("hantro_odd.yuv", kWidth, kHeight, 30, 1,
0, 20);
ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
}
VP9_INSTANTIATE_TEST_CASE(ActiveMapTest,
::testing::Values(::libvpx_test::kRealTime),
::testing::Range(0, 6));
::testing::Range(0, 9));
} // namespace

136
test/add_noise_test.cc Normal file
View File

@ -0,0 +1,136 @@
/*
* Copyright (c) 2016 The WebM project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#include <math.h>
#include "test/clear_system_state.h"
#include "test/register_state_check.h"
#include "third_party/googletest/src/include/gtest/gtest.h"
#include "./vpx_dsp_rtcd.h"
#include "vpx/vpx_integer.h"
#include "vpx_dsp/postproc.h"
#include "vpx_mem/vpx_mem.h"
namespace {
static const int kNoiseSize = 3072;
// TODO(jimbankoski): make width and height integers not unsigned.
typedef void (*AddNoiseFunc)(uint8_t *start, const int8_t *noise,
int blackclamp, int whiteclamp, int width,
int height, int pitch);
class AddNoiseTest : public ::testing::TestWithParam<AddNoiseFunc> {
public:
virtual void TearDown() { libvpx_test::ClearSystemState(); }
virtual ~AddNoiseTest() {}
};
double stddev6(char a, char b, char c, char d, char e, char f) {
const double n = (a + b + c + d + e + f) / 6.0;
const double v = ((a - n) * (a - n) + (b - n) * (b - n) + (c - n) * (c - n) +
(d - n) * (d - n) + (e - n) * (e - n) + (f - n) * (f - n)) /
6.0;
return sqrt(v);
}
TEST_P(AddNoiseTest, CheckNoiseAdded) {
const int width = 64;
const int height = 64;
const int image_size = width * height;
int8_t noise[kNoiseSize];
const int clamp = vpx_setup_noise(4.4, noise, kNoiseSize);
uint8_t *const s =
reinterpret_cast<uint8_t *>(vpx_calloc(image_size, sizeof(*s)));
ASSERT_TRUE(s != NULL);
memset(s, 99, image_size * sizeof(*s));
ASM_REGISTER_STATE_CHECK(
GetParam()(s, noise, clamp, clamp, width, height, width));
// Check to make sure we don't end up having either the same or no added
// noise either vertically or horizontally.
for (int i = 0; i < image_size - 6 * width - 6; ++i) {
const double hd = stddev6(s[i] - 99, s[i + 1] - 99, s[i + 2] - 99,
s[i + 3] - 99, s[i + 4] - 99, s[i + 5] - 99);
const double vd = stddev6(s[i] - 99, s[i + width] - 99,
s[i + 2 * width] - 99, s[i + 3 * width] - 99,
s[i + 4 * width] - 99, s[i + 5 * width] - 99);
EXPECT_NE(hd, 0);
EXPECT_NE(vd, 0);
}
// Initialize pixels in the image to 255 and check for roll over.
memset(s, 255, image_size);
ASM_REGISTER_STATE_CHECK(
GetParam()(s, noise, clamp, clamp, width, height, width));
// Check to make sure don't roll over.
for (int i = 0; i < image_size; ++i) {
EXPECT_GT(static_cast<int>(s[i]), clamp) << "i = " << i;
}
// Initialize pixels in the image to 0 and check for roll under.
memset(s, 0, image_size);
ASM_REGISTER_STATE_CHECK(
GetParam()(s, noise, clamp, clamp, width, height, width));
// Check to make sure don't roll under.
for (int i = 0; i < image_size; ++i) {
EXPECT_LT(static_cast<int>(s[i]), 255 - clamp) << "i = " << i;
}
vpx_free(s);
}
TEST_P(AddNoiseTest, CheckCvsAssembly) {
const int width = 64;
const int height = 64;
const int image_size = width * height;
int8_t noise[kNoiseSize];
const int clamp = vpx_setup_noise(4.4, noise, kNoiseSize);
uint8_t *const s = reinterpret_cast<uint8_t *>(vpx_calloc(image_size, 1));
uint8_t *const d = reinterpret_cast<uint8_t *>(vpx_calloc(image_size, 1));
ASSERT_TRUE(s != NULL);
ASSERT_TRUE(d != NULL);
memset(s, 99, image_size);
memset(d, 99, image_size);
srand(0);
ASM_REGISTER_STATE_CHECK(
GetParam()(s, noise, clamp, clamp, width, height, width));
srand(0);
ASM_REGISTER_STATE_CHECK(
vpx_plane_add_noise_c(d, noise, clamp, clamp, width, height, width));
for (int i = 0; i < image_size; ++i) {
EXPECT_EQ(static_cast<int>(s[i]), static_cast<int>(d[i])) << "i = " << i;
}
vpx_free(d);
vpx_free(s);
}
INSTANTIATE_TEST_CASE_P(C, AddNoiseTest,
::testing::Values(vpx_plane_add_noise_c));
#if HAVE_SSE2
INSTANTIATE_TEST_CASE_P(SSE2, AddNoiseTest,
::testing::Values(vpx_plane_add_noise_sse2));
#endif
#if HAVE_MSA
INSTANTIATE_TEST_CASE_P(MSA, AddNoiseTest,
::testing::Values(vpx_plane_add_noise_msa));
#endif
} // namespace

View File

@ -0,0 +1,157 @@
/*
* Copyright (c) 2012 The WebM project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#include "third_party/googletest/src/include/gtest/gtest.h"
#include "test/codec_factory.h"
#include "test/encode_test_driver.h"
#include "test/i420_video_source.h"
#include "test/util.h"
namespace {
class AltRefAqSegmentTest
: public ::libvpx_test::EncoderTest,
public ::libvpx_test::CodecTestWith2Params<libvpx_test::TestMode, int> {
protected:
AltRefAqSegmentTest() : EncoderTest(GET_PARAM(0)) {}
virtual ~AltRefAqSegmentTest() {}
virtual void SetUp() {
InitializeConfig();
SetMode(GET_PARAM(1));
set_cpu_used_ = GET_PARAM(2);
aq_mode_ = 0;
alt_ref_aq_mode_ = 0;
}
virtual void PreEncodeFrameHook(::libvpx_test::VideoSource *video,
::libvpx_test::Encoder *encoder) {
if (video->frame() == 1) {
encoder->Control(VP8E_SET_CPUUSED, set_cpu_used_);
encoder->Control(VP9E_SET_ALT_REF_AQ, alt_ref_aq_mode_);
encoder->Control(VP9E_SET_AQ_MODE, aq_mode_);
encoder->Control(VP8E_SET_MAX_INTRA_BITRATE_PCT, 100);
}
}
int set_cpu_used_;
int aq_mode_;
int alt_ref_aq_mode_;
};
// Validate that this ALT_REF_AQ/AQ segmentation mode
// (ALT_REF_AQ=0, AQ=0/no_aq)
// encodes and decodes without a mismatch.
TEST_P(AltRefAqSegmentTest, TestNoMisMatchAltRefAQ0) {
cfg_.rc_min_quantizer = 8;
cfg_.rc_max_quantizer = 56;
cfg_.rc_end_usage = VPX_VBR;
cfg_.rc_buf_initial_sz = 500;
cfg_.rc_buf_optimal_sz = 500;
cfg_.rc_buf_sz = 1000;
cfg_.rc_target_bitrate = 300;
aq_mode_ = 0;
alt_ref_aq_mode_ = 1;
::libvpx_test::I420VideoSource video("hantro_collage_w352h288.yuv", 352, 288,
30, 1, 0, 100);
ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
}
// Validate that this ALT_REF_AQ/AQ segmentation mode
// (ALT_REF_AQ=0, AQ=1/variance_aq)
// encodes and decodes without a mismatch.
TEST_P(AltRefAqSegmentTest, TestNoMisMatchAltRefAQ1) {
cfg_.rc_min_quantizer = 8;
cfg_.rc_max_quantizer = 56;
cfg_.rc_end_usage = VPX_VBR;
cfg_.rc_buf_initial_sz = 500;
cfg_.rc_buf_optimal_sz = 500;
cfg_.rc_buf_sz = 1000;
cfg_.rc_target_bitrate = 300;
aq_mode_ = 1;
alt_ref_aq_mode_ = 1;
::libvpx_test::I420VideoSource video("hantro_collage_w352h288.yuv", 352, 288,
30, 1, 0, 100);
ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
}
// Validate that this ALT_REF_AQ/AQ segmentation mode
// (ALT_REF_AQ=0, AQ=2/complexity_aq)
// encodes and decodes without a mismatch.
TEST_P(AltRefAqSegmentTest, TestNoMisMatchAltRefAQ2) {
cfg_.rc_min_quantizer = 8;
cfg_.rc_max_quantizer = 56;
cfg_.rc_end_usage = VPX_VBR;
cfg_.rc_buf_initial_sz = 500;
cfg_.rc_buf_optimal_sz = 500;
cfg_.rc_buf_sz = 1000;
cfg_.rc_target_bitrate = 300;
aq_mode_ = 2;
alt_ref_aq_mode_ = 1;
::libvpx_test::I420VideoSource video("hantro_collage_w352h288.yuv", 352, 288,
30, 1, 0, 100);
ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
}
// Validate that this ALT_REF_AQ/AQ segmentation mode
// (ALT_REF_AQ=0, AQ=3/cyclicrefresh_aq)
// encodes and decodes without a mismatch.
TEST_P(AltRefAqSegmentTest, TestNoMisMatchAltRefAQ3) {
cfg_.rc_min_quantizer = 8;
cfg_.rc_max_quantizer = 56;
cfg_.rc_end_usage = VPX_VBR;
cfg_.rc_buf_initial_sz = 500;
cfg_.rc_buf_optimal_sz = 500;
cfg_.rc_buf_sz = 1000;
cfg_.rc_target_bitrate = 300;
aq_mode_ = 3;
alt_ref_aq_mode_ = 1;
::libvpx_test::I420VideoSource video("hantro_collage_w352h288.yuv", 352, 288,
30, 1, 0, 100);
ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
}
// Validate that this ALT_REF_AQ/AQ segmentation mode
// (ALT_REF_AQ=0, AQ=4/equator360_aq)
// encodes and decodes without a mismatch.
TEST_P(AltRefAqSegmentTest, TestNoMisMatchAltRefAQ4) {
cfg_.rc_min_quantizer = 8;
cfg_.rc_max_quantizer = 56;
cfg_.rc_end_usage = VPX_VBR;
cfg_.rc_buf_initial_sz = 500;
cfg_.rc_buf_optimal_sz = 500;
cfg_.rc_buf_sz = 1000;
cfg_.rc_target_bitrate = 300;
aq_mode_ = 4;
alt_ref_aq_mode_ = 1;
::libvpx_test::I420VideoSource video("hantro_collage_w352h288.yuv", 352, 288,
30, 1, 0, 100);
ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
}
VP9_INSTANTIATE_TEST_CASE(AltRefAqSegmentTest,
::testing::Values(::libvpx_test::kOnePassGood,
::libvpx_test::kTwoPassGood),
::testing::Range(2, 5));
} // namespace

View File

@ -14,12 +14,14 @@
#include "test/util.h"
namespace {
#if CONFIG_VP8_ENCODER
// lookahead range: [kLookAheadMin, kLookAheadMax).
const int kLookAheadMin = 5;
const int kLookAheadMax = 26;
class AltRefTest : public ::libvpx_test::EncoderTest,
public ::libvpx_test::CodecTestWithParam<int> {
public ::libvpx_test::CodecTestWithParam<int> {
protected:
AltRefTest() : EncoderTest(GET_PARAM(0)), altref_count_(0) {}
virtual ~AltRefTest() {}
@ -29,9 +31,7 @@ class AltRefTest : public ::libvpx_test::EncoderTest,
SetMode(libvpx_test::kTwoPassGood);
}
virtual void BeginPassHook(unsigned int pass) {
altref_count_ = 0;
}
virtual void BeginPassHook(unsigned int /*pass*/) { altref_count_ = 0; }
virtual void PreEncodeFrameHook(libvpx_test::VideoSource *video,
libvpx_test::Encoder *encoder) {
@ -63,7 +63,90 @@ TEST_P(AltRefTest, MonotonicTimestamps) {
EXPECT_GE(altref_count(), 1);
}
VP8_INSTANTIATE_TEST_CASE(AltRefTest,
::testing::Range(kLookAheadMin, kLookAheadMax));
#endif // CONFIG_VP8_ENCODER
class AltRefForcedKeyTestLarge
: public ::libvpx_test::EncoderTest,
public ::libvpx_test::CodecTestWith2Params<libvpx_test::TestMode, int> {
protected:
AltRefForcedKeyTestLarge()
: EncoderTest(GET_PARAM(0)), encoding_mode_(GET_PARAM(1)),
cpu_used_(GET_PARAM(2)), forced_kf_frame_num_(1), frame_num_(0) {}
virtual ~AltRefForcedKeyTestLarge() {}
virtual void SetUp() {
InitializeConfig();
SetMode(encoding_mode_);
cfg_.rc_end_usage = VPX_VBR;
cfg_.g_threads = 0;
}
virtual void PreEncodeFrameHook(::libvpx_test::VideoSource *video,
::libvpx_test::Encoder *encoder) {
if (video->frame() == 0) {
encoder->Control(VP8E_SET_CPUUSED, cpu_used_);
encoder->Control(VP8E_SET_ENABLEAUTOALTREF, 1);
#if CONFIG_VP9_ENCODER
// override test default for tile columns if necessary.
if (GET_PARAM(0) == &libvpx_test::kVP9) {
encoder->Control(VP9E_SET_TILE_COLUMNS, 6);
}
#endif
}
frame_flags_ =
(video->frame() == forced_kf_frame_num_) ? VPX_EFLAG_FORCE_KF : 0;
}
virtual void FramePktHook(const vpx_codec_cx_pkt_t *pkt) {
if (frame_num_ == forced_kf_frame_num_) {
ASSERT_TRUE(!!(pkt->data.frame.flags & VPX_FRAME_IS_KEY))
<< "Frame #" << frame_num_ << " isn't a keyframe!";
}
++frame_num_;
}
::libvpx_test::TestMode encoding_mode_;
int cpu_used_;
unsigned int forced_kf_frame_num_;
unsigned int frame_num_;
};
TEST_P(AltRefForcedKeyTestLarge, Frame1IsKey) {
const vpx_rational timebase = { 1, 30 };
const int lag_values[] = { 3, 15, 25, -1 };
forced_kf_frame_num_ = 1;
for (int i = 0; lag_values[i] != -1; ++i) {
frame_num_ = 0;
cfg_.g_lag_in_frames = lag_values[i];
libvpx_test::I420VideoSource video("hantro_collage_w352h288.yuv", 352, 288,
timebase.den, timebase.num, 0, 30);
ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
}
}
TEST_P(AltRefForcedKeyTestLarge, ForcedFrameIsKey) {
const vpx_rational timebase = { 1, 30 };
const int lag_values[] = { 3, 15, 25, -1 };
for (int i = 0; lag_values[i] != -1; ++i) {
frame_num_ = 0;
forced_kf_frame_num_ = lag_values[i] - 1;
cfg_.g_lag_in_frames = lag_values[i];
libvpx_test::I420VideoSource video("hantro_collage_w352h288.yuv", 352, 288,
timebase.den, timebase.num, 0, 30);
ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
}
}
VP8_INSTANTIATE_TEST_CASE(AltRefForcedKeyTestLarge,
::testing::Values(::libvpx_test::kOnePassGood),
::testing::Range(0, 9));
VP9_INSTANTIATE_TEST_CASE(AltRefForcedKeyTestLarge,
::testing::Values(::libvpx_test::kOnePassGood),
::testing::Range(0, 9));
} // namespace

View File

@ -32,6 +32,7 @@ LOCAL_CPP_EXTENSION := .cc
LOCAL_MODULE := gtest
LOCAL_C_INCLUDES := $(LOCAL_PATH)/third_party/googletest/src/
LOCAL_C_INCLUDES += $(LOCAL_PATH)/third_party/googletest/src/include/
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/third_party/googletest/src/include/
LOCAL_SRC_FILES := ./third_party/googletest/src/src/gtest-all.cc
include $(BUILD_STATIC_LIBRARY)
@ -40,9 +41,17 @@ include $(CLEAR_VARS)
LOCAL_ARM_MODE := arm
LOCAL_MODULE := libvpx_test
LOCAL_STATIC_LIBRARIES := gtest libwebm
LOCAL_SHARED_LIBRARIES := vpx
ifeq ($(ENABLE_SHARED),1)
LOCAL_SHARED_LIBRARIES := vpx
else
LOCAL_STATIC_LIBRARIES += vpx
endif
include $(LOCAL_PATH)/test/test.mk
LOCAL_C_INCLUDES := $(BINDINGS_DIR)
FILTERED_SRC := $(sort $(filter %.cc %.c, $(LIBVPX_TEST_SRCS-yes)))
LOCAL_SRC_FILES := $(addprefix ./test/, $(FILTERED_SRC))
# some test files depend on *_rtcd.h, ensure they're generated first.
$(eval $(call rtcd_dep_template))
include $(BUILD_EXECUTABLE)

View File

@ -57,7 +57,7 @@ TEST_P(AqSegmentTest, TestNoMisMatchAQ1) {
aq_mode_ = 1;
::libvpx_test::I420VideoSource video("hantro_collage_w352h288.yuv", 352, 288,
30, 1, 0, 100);
30, 1, 0, 100);
ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
}
@ -77,7 +77,7 @@ TEST_P(AqSegmentTest, TestNoMisMatchAQ2) {
aq_mode_ = 2;
::libvpx_test::I420VideoSource video("hantro_collage_w352h288.yuv", 352, 288,
30, 1, 0, 100);
30, 1, 0, 100);
ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
}
@ -97,7 +97,7 @@ TEST_P(AqSegmentTest, TestNoMisMatchAQ3) {
aq_mode_ = 3;
::libvpx_test::I420VideoSource video("hantro_collage_w352h288.yuv", 352, 288,
30, 1, 0, 100);
30, 1, 0, 100);
ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
}

581
test/avg_test.cc Normal file
View File

@ -0,0 +1,581 @@
/*
* Copyright (c) 2012 The WebM project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#include <limits.h>
#include <stdio.h>
#include <string.h>
#include "third_party/googletest/src/include/gtest/gtest.h"
#include "./vp9_rtcd.h"
#include "./vpx_config.h"
#include "./vpx_dsp_rtcd.h"
#include "test/acm_random.h"
#include "test/clear_system_state.h"
#include "test/register_state_check.h"
#include "test/util.h"
#include "vpx_mem/vpx_mem.h"
#include "vpx_ports/vpx_timer.h"
using libvpx_test::ACMRandom;
namespace {
class AverageTestBase : public ::testing::Test {
public:
AverageTestBase(int width, int height) : width_(width), height_(height) {}
static void SetUpTestCase() {
source_data_ = reinterpret_cast<uint8_t *>(
vpx_memalign(kDataAlignment, kDataBlockSize));
}
static void TearDownTestCase() {
vpx_free(source_data_);
source_data_ = NULL;
}
virtual void TearDown() { libvpx_test::ClearSystemState(); }
protected:
// Handle blocks up to 4 blocks 64x64 with stride up to 128
static const int kDataAlignment = 16;
static const int kDataBlockSize = 64 * 128;
virtual void SetUp() {
source_stride_ = (width_ + 31) & ~31;
rnd_.Reset(ACMRandom::DeterministicSeed());
}
// Sum Pixels
static unsigned int ReferenceAverage8x8(const uint8_t *source, int pitch) {
unsigned int average = 0;
for (int h = 0; h < 8; ++h) {
for (int w = 0; w < 8; ++w) average += source[h * pitch + w];
}
return ((average + 32) >> 6);
}
static unsigned int ReferenceAverage4x4(const uint8_t *source, int pitch) {
unsigned int average = 0;
for (int h = 0; h < 4; ++h) {
for (int w = 0; w < 4; ++w) average += source[h * pitch + w];
}
return ((average + 8) >> 4);
}
void FillConstant(uint8_t fill_constant) {
for (int i = 0; i < width_ * height_; ++i) {
source_data_[i] = fill_constant;
}
}
void FillRandom() {
for (int i = 0; i < width_ * height_; ++i) {
source_data_[i] = rnd_.Rand8();
}
}
int width_, height_;
static uint8_t *source_data_;
int source_stride_;
ACMRandom rnd_;
};
typedef unsigned int (*AverageFunction)(const uint8_t *s, int pitch);
typedef ::testing::tuple<int, int, int, int, AverageFunction> AvgFunc;
class AverageTest : public AverageTestBase,
public ::testing::WithParamInterface<AvgFunc> {
public:
AverageTest() : AverageTestBase(GET_PARAM(0), GET_PARAM(1)) {}
protected:
void CheckAverages() {
const int block_size = GET_PARAM(3);
unsigned int expected = 0;
if (block_size == 8) {
expected =
ReferenceAverage8x8(source_data_ + GET_PARAM(2), source_stride_);
} else if (block_size == 4) {
expected =
ReferenceAverage4x4(source_data_ + GET_PARAM(2), source_stride_);
}
ASM_REGISTER_STATE_CHECK(
GET_PARAM(4)(source_data_ + GET_PARAM(2), source_stride_));
unsigned int actual =
GET_PARAM(4)(source_data_ + GET_PARAM(2), source_stride_);
EXPECT_EQ(expected, actual);
}
};
typedef void (*IntProRowFunc)(int16_t hbuf[16], uint8_t const *ref,
const int ref_stride, const int height);
typedef ::testing::tuple<int, IntProRowFunc, IntProRowFunc> IntProRowParam;
class IntProRowTest : public AverageTestBase,
public ::testing::WithParamInterface<IntProRowParam> {
public:
IntProRowTest()
: AverageTestBase(16, GET_PARAM(0)), hbuf_asm_(NULL), hbuf_c_(NULL) {
asm_func_ = GET_PARAM(1);
c_func_ = GET_PARAM(2);
}
protected:
virtual void SetUp() {
hbuf_asm_ = reinterpret_cast<int16_t *>(
vpx_memalign(kDataAlignment, sizeof(*hbuf_asm_) * 16));
hbuf_c_ = reinterpret_cast<int16_t *>(
vpx_memalign(kDataAlignment, sizeof(*hbuf_c_) * 16));
}
virtual void TearDown() {
vpx_free(hbuf_c_);
hbuf_c_ = NULL;
vpx_free(hbuf_asm_);
hbuf_asm_ = NULL;
}
void RunComparison() {
ASM_REGISTER_STATE_CHECK(c_func_(hbuf_c_, source_data_, 0, height_));
ASM_REGISTER_STATE_CHECK(asm_func_(hbuf_asm_, source_data_, 0, height_));
EXPECT_EQ(0, memcmp(hbuf_c_, hbuf_asm_, sizeof(*hbuf_c_) * 16))
<< "Output mismatch";
}
private:
IntProRowFunc asm_func_;
IntProRowFunc c_func_;
int16_t *hbuf_asm_;
int16_t *hbuf_c_;
};
typedef int16_t (*IntProColFunc)(uint8_t const *ref, const int width);
typedef ::testing::tuple<int, IntProColFunc, IntProColFunc> IntProColParam;
class IntProColTest : public AverageTestBase,
public ::testing::WithParamInterface<IntProColParam> {
public:
IntProColTest() : AverageTestBase(GET_PARAM(0), 1), sum_asm_(0), sum_c_(0) {
asm_func_ = GET_PARAM(1);
c_func_ = GET_PARAM(2);
}
protected:
void RunComparison() {
ASM_REGISTER_STATE_CHECK(sum_c_ = c_func_(source_data_, width_));
ASM_REGISTER_STATE_CHECK(sum_asm_ = asm_func_(source_data_, width_));
EXPECT_EQ(sum_c_, sum_asm_) << "Output mismatch";
}
private:
IntProColFunc asm_func_;
IntProColFunc c_func_;
int16_t sum_asm_;
int16_t sum_c_;
};
typedef int (*SatdFunc)(const tran_low_t *coeffs, int length);
typedef ::testing::tuple<int, SatdFunc> SatdTestParam;
class SatdTest : public ::testing::Test,
public ::testing::WithParamInterface<SatdTestParam> {
protected:
virtual void SetUp() {
satd_size_ = GET_PARAM(0);
satd_func_ = GET_PARAM(1);
rnd_.Reset(ACMRandom::DeterministicSeed());
src_ = reinterpret_cast<tran_low_t *>(
vpx_memalign(16, sizeof(*src_) * satd_size_));
ASSERT_TRUE(src_ != NULL);
}
virtual void TearDown() {
libvpx_test::ClearSystemState();
vpx_free(src_);
}
void FillConstant(const tran_low_t val) {
for (int i = 0; i < satd_size_; ++i) src_[i] = val;
}
void FillRandom() {
for (int i = 0; i < satd_size_; ++i) {
const int16_t tmp = rnd_.Rand16();
src_[i] = (tran_low_t)tmp;
}
}
void Check(const int expected) {
int total;
ASM_REGISTER_STATE_CHECK(total = satd_func_(src_, satd_size_));
EXPECT_EQ(expected, total);
}
int satd_size_;
private:
tran_low_t *src_;
SatdFunc satd_func_;
ACMRandom rnd_;
};
typedef int64_t (*BlockErrorFunc)(const tran_low_t *coeff,
const tran_low_t *dqcoeff, int block_size);
typedef ::testing::tuple<int, BlockErrorFunc> BlockErrorTestFPParam;
class BlockErrorTestFP
: public ::testing::Test,
public ::testing::WithParamInterface<BlockErrorTestFPParam> {
protected:
virtual void SetUp() {
txfm_size_ = GET_PARAM(0);
block_error_func_ = GET_PARAM(1);
rnd_.Reset(ACMRandom::DeterministicSeed());
coeff_ = reinterpret_cast<tran_low_t *>(
vpx_memalign(16, sizeof(*coeff_) * txfm_size_));
dqcoeff_ = reinterpret_cast<tran_low_t *>(
vpx_memalign(16, sizeof(*dqcoeff_) * txfm_size_));
ASSERT_TRUE(coeff_ != NULL);
ASSERT_TRUE(dqcoeff_ != NULL);
}
virtual void TearDown() {
libvpx_test::ClearSystemState();
vpx_free(coeff_);
vpx_free(dqcoeff_);
}
void FillConstant(const tran_low_t coeff_val, const tran_low_t dqcoeff_val) {
for (int i = 0; i < txfm_size_; ++i) coeff_[i] = coeff_val;
for (int i = 0; i < txfm_size_; ++i) dqcoeff_[i] = dqcoeff_val;
}
void FillRandom() {
// Just two fixed seeds
rnd_.Reset(0xb0b9);
for (int i = 0; i < txfm_size_; ++i) coeff_[i] = rnd_.Rand16() >> 1;
rnd_.Reset(0xb0c8);
for (int i = 0; i < txfm_size_; ++i) dqcoeff_[i] = rnd_.Rand16() >> 1;
}
void Check(const int64_t expected) {
int64_t total;
ASM_REGISTER_STATE_CHECK(
total = block_error_func_(coeff_, dqcoeff_, txfm_size_));
EXPECT_EQ(expected, total);
}
int txfm_size_;
private:
tran_low_t *coeff_;
tran_low_t *dqcoeff_;
BlockErrorFunc block_error_func_;
ACMRandom rnd_;
};
uint8_t *AverageTestBase::source_data_ = NULL;
TEST_P(AverageTest, MinValue) {
FillConstant(0);
CheckAverages();
}
TEST_P(AverageTest, MaxValue) {
FillConstant(255);
CheckAverages();
}
TEST_P(AverageTest, Random) {
// The reference frame, but not the source frame, may be unaligned for
// certain types of searches.
for (int i = 0; i < 1000; i++) {
FillRandom();
CheckAverages();
}
}
TEST_P(IntProRowTest, MinValue) {
FillConstant(0);
RunComparison();
}
TEST_P(IntProRowTest, MaxValue) {
FillConstant(255);
RunComparison();
}
TEST_P(IntProRowTest, Random) {
FillRandom();
RunComparison();
}
TEST_P(IntProColTest, MinValue) {
FillConstant(0);
RunComparison();
}
TEST_P(IntProColTest, MaxValue) {
FillConstant(255);
RunComparison();
}
TEST_P(IntProColTest, Random) {
FillRandom();
RunComparison();
}
TEST_P(SatdTest, MinValue) {
const int kMin = -32640;
const int expected = -kMin * satd_size_;
FillConstant(kMin);
Check(expected);
}
TEST_P(SatdTest, MaxValue) {
const int kMax = 32640;
const int expected = kMax * satd_size_;
FillConstant(kMax);
Check(expected);
}
TEST_P(SatdTest, Random) {
int expected;
switch (satd_size_) {
case 16: expected = 205298; break;
case 64: expected = 1113950; break;
case 256: expected = 4268415; break;
case 1024: expected = 16954082; break;
default:
FAIL() << "Invalid satd size (" << satd_size_
<< ") valid: 16/64/256/1024";
}
FillRandom();
Check(expected);
}
TEST_P(SatdTest, DISABLED_Speed) {
const int kCountSpeedTestBlock = 20000;
vpx_usec_timer timer;
DECLARE_ALIGNED(16, tran_low_t, coeff[1024]);
const int blocksize = GET_PARAM(0);
vpx_usec_timer_start(&timer);
for (int i = 0; i < kCountSpeedTestBlock; ++i) {
GET_PARAM(1)(coeff, blocksize);
}
vpx_usec_timer_mark(&timer);
const int elapsed_time = static_cast<int>(vpx_usec_timer_elapsed(&timer));
printf("blocksize: %4d time: %4d us\n", blocksize, elapsed_time);
}
TEST_P(BlockErrorTestFP, MinValue) {
const int64_t kMin = -32640;
const int64_t expected = kMin * kMin * txfm_size_;
FillConstant(kMin, 0);
Check(expected);
}
TEST_P(BlockErrorTestFP, MaxValue) {
const int64_t kMax = 32640;
const int64_t expected = kMax * kMax * txfm_size_;
FillConstant(kMax, 0);
Check(expected);
}
TEST_P(BlockErrorTestFP, Random) {
int64_t expected;
switch (txfm_size_) {
case 16: expected = 2051681432; break;
case 64: expected = 11075114379; break;
case 256: expected = 44386271116; break;
case 1024: expected = 184774996089; break;
default:
FAIL() << "Invalid satd size (" << txfm_size_
<< ") valid: 16/64/256/1024";
}
FillRandom();
Check(expected);
}
TEST_P(BlockErrorTestFP, DISABLED_Speed) {
const int kCountSpeedTestBlock = 20000;
vpx_usec_timer timer;
DECLARE_ALIGNED(16, tran_low_t, coeff[1024]);
DECLARE_ALIGNED(16, tran_low_t, dqcoeff[1024]);
const int blocksize = GET_PARAM(0);
vpx_usec_timer_start(&timer);
for (int i = 0; i < kCountSpeedTestBlock; ++i) {
GET_PARAM(1)(coeff, dqcoeff, blocksize);
}
vpx_usec_timer_mark(&timer);
const int elapsed_time = static_cast<int>(vpx_usec_timer_elapsed(&timer));
printf("blocksize: %4d time: %4d us\n", blocksize, elapsed_time);
}
using ::testing::make_tuple;
INSTANTIATE_TEST_CASE_P(
C, AverageTest,
::testing::Values(make_tuple(16, 16, 1, 8, &vpx_avg_8x8_c),
make_tuple(16, 16, 1, 4, &vpx_avg_4x4_c)));
INSTANTIATE_TEST_CASE_P(C, SatdTest,
::testing::Values(make_tuple(16, &vpx_satd_c),
make_tuple(64, &vpx_satd_c),
make_tuple(256, &vpx_satd_c),
make_tuple(1024, &vpx_satd_c)));
INSTANTIATE_TEST_CASE_P(
C, BlockErrorTestFP,
::testing::Values(make_tuple(16, &vp9_block_error_fp_c),
make_tuple(64, &vp9_block_error_fp_c),
make_tuple(256, &vp9_block_error_fp_c),
make_tuple(1024, &vp9_block_error_fp_c)));
#if HAVE_SSE2
INSTANTIATE_TEST_CASE_P(
SSE2, AverageTest,
::testing::Values(make_tuple(16, 16, 0, 8, &vpx_avg_8x8_sse2),
make_tuple(16, 16, 5, 8, &vpx_avg_8x8_sse2),
make_tuple(32, 32, 15, 8, &vpx_avg_8x8_sse2),
make_tuple(16, 16, 0, 4, &vpx_avg_4x4_sse2),
make_tuple(16, 16, 5, 4, &vpx_avg_4x4_sse2),
make_tuple(32, 32, 15, 4, &vpx_avg_4x4_sse2)));
INSTANTIATE_TEST_CASE_P(
SSE2, IntProRowTest,
::testing::Values(make_tuple(16, &vpx_int_pro_row_sse2, &vpx_int_pro_row_c),
make_tuple(32, &vpx_int_pro_row_sse2, &vpx_int_pro_row_c),
make_tuple(64, &vpx_int_pro_row_sse2,
&vpx_int_pro_row_c)));
INSTANTIATE_TEST_CASE_P(
SSE2, IntProColTest,
::testing::Values(make_tuple(16, &vpx_int_pro_col_sse2, &vpx_int_pro_col_c),
make_tuple(32, &vpx_int_pro_col_sse2, &vpx_int_pro_col_c),
make_tuple(64, &vpx_int_pro_col_sse2,
&vpx_int_pro_col_c)));
INSTANTIATE_TEST_CASE_P(SSE2, SatdTest,
::testing::Values(make_tuple(16, &vpx_satd_sse2),
make_tuple(64, &vpx_satd_sse2),
make_tuple(256, &vpx_satd_sse2),
make_tuple(1024, &vpx_satd_sse2)));
INSTANTIATE_TEST_CASE_P(
SSE2, BlockErrorTestFP,
::testing::Values(make_tuple(16, &vp9_block_error_fp_sse2),
make_tuple(64, &vp9_block_error_fp_sse2),
make_tuple(256, &vp9_block_error_fp_sse2),
make_tuple(1024, &vp9_block_error_fp_sse2)));
#endif // HAVE_SSE2
#if HAVE_AVX2
INSTANTIATE_TEST_CASE_P(AVX2, SatdTest,
::testing::Values(make_tuple(16, &vpx_satd_avx2),
make_tuple(64, &vpx_satd_avx2),
make_tuple(256, &vpx_satd_avx2),
make_tuple(1024, &vpx_satd_avx2)));
INSTANTIATE_TEST_CASE_P(
AVX2, BlockErrorTestFP,
::testing::Values(make_tuple(16, &vp9_block_error_fp_avx2),
make_tuple(64, &vp9_block_error_fp_avx2),
make_tuple(256, &vp9_block_error_fp_avx2),
make_tuple(1024, &vp9_block_error_fp_avx2)));
#endif
#if HAVE_NEON
INSTANTIATE_TEST_CASE_P(
NEON, AverageTest,
::testing::Values(make_tuple(16, 16, 0, 8, &vpx_avg_8x8_neon),
make_tuple(16, 16, 5, 8, &vpx_avg_8x8_neon),
make_tuple(32, 32, 15, 8, &vpx_avg_8x8_neon),
make_tuple(16, 16, 0, 4, &vpx_avg_4x4_neon),
make_tuple(16, 16, 5, 4, &vpx_avg_4x4_neon),
make_tuple(32, 32, 15, 4, &vpx_avg_4x4_neon)));
INSTANTIATE_TEST_CASE_P(
NEON, IntProRowTest,
::testing::Values(make_tuple(16, &vpx_int_pro_row_neon, &vpx_int_pro_row_c),
make_tuple(32, &vpx_int_pro_row_neon, &vpx_int_pro_row_c),
make_tuple(64, &vpx_int_pro_row_neon,
&vpx_int_pro_row_c)));
INSTANTIATE_TEST_CASE_P(
NEON, IntProColTest,
::testing::Values(make_tuple(16, &vpx_int_pro_col_neon, &vpx_int_pro_col_c),
make_tuple(32, &vpx_int_pro_col_neon, &vpx_int_pro_col_c),
make_tuple(64, &vpx_int_pro_col_neon,
&vpx_int_pro_col_c)));
INSTANTIATE_TEST_CASE_P(NEON, SatdTest,
::testing::Values(make_tuple(16, &vpx_satd_neon),
make_tuple(64, &vpx_satd_neon),
make_tuple(256, &vpx_satd_neon),
make_tuple(1024, &vpx_satd_neon)));
// TODO(jianj): Remove the highbitdepth flag once the SIMD functions are
// in place.
#if !CONFIG_VP9_HIGHBITDEPTH
INSTANTIATE_TEST_CASE_P(
NEON, BlockErrorTestFP,
::testing::Values(make_tuple(16, &vp9_block_error_fp_neon),
make_tuple(64, &vp9_block_error_fp_neon),
make_tuple(256, &vp9_block_error_fp_neon),
make_tuple(1024, &vp9_block_error_fp_neon)));
#endif // !CONFIG_VP9_HIGHBITDEPTH
#endif // HAVE_NEON
#if HAVE_MSA
INSTANTIATE_TEST_CASE_P(
MSA, AverageTest,
::testing::Values(make_tuple(16, 16, 0, 8, &vpx_avg_8x8_msa),
make_tuple(16, 16, 5, 8, &vpx_avg_8x8_msa),
make_tuple(32, 32, 15, 8, &vpx_avg_8x8_msa),
make_tuple(16, 16, 0, 4, &vpx_avg_4x4_msa),
make_tuple(16, 16, 5, 4, &vpx_avg_4x4_msa),
make_tuple(32, 32, 15, 4, &vpx_avg_4x4_msa)));
INSTANTIATE_TEST_CASE_P(
MSA, IntProRowTest,
::testing::Values(make_tuple(16, &vpx_int_pro_row_msa, &vpx_int_pro_row_c),
make_tuple(32, &vpx_int_pro_row_msa, &vpx_int_pro_row_c),
make_tuple(64, &vpx_int_pro_row_msa,
&vpx_int_pro_row_c)));
INSTANTIATE_TEST_CASE_P(
MSA, IntProColTest,
::testing::Values(make_tuple(16, &vpx_int_pro_col_msa, &vpx_int_pro_col_c),
make_tuple(32, &vpx_int_pro_col_msa, &vpx_int_pro_col_c),
make_tuple(64, &vpx_int_pro_col_msa,
&vpx_int_pro_col_c)));
// TODO(jingning): Remove the highbitdepth flag once the SIMD functions are
// in place.
#if !CONFIG_VP9_HIGHBITDEPTH
INSTANTIATE_TEST_CASE_P(MSA, SatdTest,
::testing::Values(make_tuple(16, &vpx_satd_msa),
make_tuple(64, &vpx_satd_msa),
make_tuple(256, &vpx_satd_msa),
make_tuple(1024, &vpx_satd_msa)));
#endif // !CONFIG_VP9_HIGHBITDEPTH
#endif // HAVE_MSA
} // namespace

223
test/blockiness_test.cc Normal file
View File

@ -0,0 +1,223 @@
/*
* Copyright (c) 2012 The WebM project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#include <limits.h>
#include <stdio.h>
#include <string.h>
#include "third_party/googletest/src/include/gtest/gtest.h"
#include "./vpx_config.h"
#if CONFIG_VP9_ENCODER
#include "./vp9_rtcd.h"
#endif
#include "test/acm_random.h"
#include "test/clear_system_state.h"
#include "test/register_state_check.h"
#include "test/util.h"
#include "vpx_mem/vpx_mem.h"
extern "C" double vp9_get_blockiness(const unsigned char *img1, int img1_pitch,
const unsigned char *img2, int img2_pitch,
int width, int height);
using libvpx_test::ACMRandom;
namespace {
class BlockinessTestBase : public ::testing::Test {
public:
BlockinessTestBase(int width, int height) : width_(width), height_(height) {}
static void SetUpTestCase() {
source_data_ = reinterpret_cast<uint8_t *>(
vpx_memalign(kDataAlignment, kDataBufferSize));
reference_data_ = reinterpret_cast<uint8_t *>(
vpx_memalign(kDataAlignment, kDataBufferSize));
}
static void TearDownTestCase() {
vpx_free(source_data_);
source_data_ = NULL;
vpx_free(reference_data_);
reference_data_ = NULL;
}
virtual void TearDown() { libvpx_test::ClearSystemState(); }
protected:
// Handle frames up to 640x480
static const int kDataAlignment = 16;
static const int kDataBufferSize = 640 * 480;
virtual void SetUp() {
source_stride_ = (width_ + 31) & ~31;
reference_stride_ = width_ * 2;
rnd_.Reset(ACMRandom::DeterministicSeed());
}
void FillConstant(uint8_t *data, int stride, uint8_t fill_constant, int width,
int height) {
for (int h = 0; h < height; ++h) {
for (int w = 0; w < width; ++w) {
data[h * stride + w] = fill_constant;
}
}
}
void FillConstant(uint8_t *data, int stride, uint8_t fill_constant) {
FillConstant(data, stride, fill_constant, width_, height_);
}
void FillRandom(uint8_t *data, int stride, int width, int height) {
for (int h = 0; h < height; ++h) {
for (int w = 0; w < width; ++w) {
data[h * stride + w] = rnd_.Rand8();
}
}
}
void FillRandom(uint8_t *data, int stride) {
FillRandom(data, stride, width_, height_);
}
void FillRandomBlocky(uint8_t *data, int stride) {
for (int h = 0; h < height_; h += 4) {
for (int w = 0; w < width_; w += 4) {
FillRandom(data + h * stride + w, stride, 4, 4);
}
}
}
void FillCheckerboard(uint8_t *data, int stride) {
for (int h = 0; h < height_; h += 4) {
for (int w = 0; w < width_; w += 4) {
if (((h / 4) ^ (w / 4)) & 1) {
FillConstant(data + h * stride + w, stride, 255, 4, 4);
} else {
FillConstant(data + h * stride + w, stride, 0, 4, 4);
}
}
}
}
void Blur(uint8_t *data, int stride, int taps) {
int sum = 0;
int half_taps = taps / 2;
for (int h = 0; h < height_; ++h) {
for (int w = 0; w < taps; ++w) {
sum += data[w + h * stride];
}
for (int w = taps; w < width_; ++w) {
sum += data[w + h * stride] - data[w - taps + h * stride];
data[w - half_taps + h * stride] = (sum + half_taps) / taps;
}
}
for (int w = 0; w < width_; ++w) {
for (int h = 0; h < taps; ++h) {
sum += data[h + w * stride];
}
for (int h = taps; h < height_; ++h) {
sum += data[w + h * stride] - data[(h - taps) * stride + w];
data[(h - half_taps) * stride + w] = (sum + half_taps) / taps;
}
}
}
int width_, height_;
static uint8_t *source_data_;
int source_stride_;
static uint8_t *reference_data_;
int reference_stride_;
ACMRandom rnd_;
};
#if CONFIG_VP9_ENCODER
typedef ::testing::tuple<int, int> BlockinessParam;
class BlockinessVP9Test
: public BlockinessTestBase,
public ::testing::WithParamInterface<BlockinessParam> {
public:
BlockinessVP9Test() : BlockinessTestBase(GET_PARAM(0), GET_PARAM(1)) {}
protected:
double GetBlockiness() const {
return vp9_get_blockiness(source_data_, source_stride_, reference_data_,
reference_stride_, width_, height_);
}
};
#endif // CONFIG_VP9_ENCODER
uint8_t *BlockinessTestBase::source_data_ = NULL;
uint8_t *BlockinessTestBase::reference_data_ = NULL;
#if CONFIG_VP9_ENCODER
TEST_P(BlockinessVP9Test, SourceBlockierThanReference) {
// Source is blockier than reference.
FillRandomBlocky(source_data_, source_stride_);
FillConstant(reference_data_, reference_stride_, 128);
const double super_blocky = GetBlockiness();
EXPECT_DOUBLE_EQ(0.0, super_blocky)
<< "Blocky source should produce 0 blockiness.";
}
TEST_P(BlockinessVP9Test, ReferenceBlockierThanSource) {
// Source is blockier than reference.
FillConstant(source_data_, source_stride_, 128);
FillRandomBlocky(reference_data_, reference_stride_);
const double super_blocky = GetBlockiness();
EXPECT_GT(super_blocky, 0.0)
<< "Blocky reference should score high for blockiness.";
}
TEST_P(BlockinessVP9Test, BlurringDecreasesBlockiness) {
// Source is blockier than reference.
FillConstant(source_data_, source_stride_, 128);
FillRandomBlocky(reference_data_, reference_stride_);
const double super_blocky = GetBlockiness();
Blur(reference_data_, reference_stride_, 4);
const double less_blocky = GetBlockiness();
EXPECT_GT(super_blocky, less_blocky)
<< "A straight blur should decrease blockiness.";
}
TEST_P(BlockinessVP9Test, WorstCaseBlockiness) {
// Source is blockier than reference.
FillConstant(source_data_, source_stride_, 128);
FillCheckerboard(reference_data_, reference_stride_);
const double super_blocky = GetBlockiness();
Blur(reference_data_, reference_stride_, 4);
const double less_blocky = GetBlockiness();
EXPECT_GT(super_blocky, less_blocky)
<< "A straight blur should decrease blockiness.";
}
#endif // CONFIG_VP9_ENCODER
using ::testing::make_tuple;
//------------------------------------------------------------------------------
// C functions
#if CONFIG_VP9_ENCODER
const BlockinessParam c_vp9_tests[] = {
make_tuple(320, 240), make_tuple(318, 242), make_tuple(318, 238)
};
INSTANTIATE_TEST_CASE_P(C, BlockinessVP9Test, ::testing::ValuesIn(c_vp9_tests));
#endif
} // namespace

View File

@ -17,8 +17,9 @@
namespace {
class BordersTest : public ::libvpx_test::EncoderTest,
public ::libvpx_test::CodecTestWithParam<libvpx_test::TestMode> {
class BordersTest
: public ::libvpx_test::EncoderTest,
public ::libvpx_test::CodecTestWithParam<libvpx_test::TestMode> {
protected:
BordersTest() : EncoderTest(GET_PARAM(0)) {}
virtual ~BordersTest() {}
@ -52,7 +53,7 @@ TEST_P(BordersTest, TestEncodeHighBitrate) {
// extend into the border and test the border condition.
cfg_.g_lag_in_frames = 25;
cfg_.rc_2pass_vbr_minsection_pct = 5;
cfg_.rc_2pass_vbr_minsection_pct = 2000;
cfg_.rc_2pass_vbr_maxsection_pct = 2000;
cfg_.rc_target_bitrate = 2000;
cfg_.rc_max_quantizer = 10;
@ -78,6 +79,6 @@ TEST_P(BordersTest, TestLowBitrate) {
ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
}
VP9_INSTANTIATE_TEST_CASE(BordersTest, ::testing::Values(
::libvpx_test::kTwoPassGood));
VP9_INSTANTIATE_TEST_CASE(BordersTest,
::testing::Values(::libvpx_test::kTwoPassGood));
} // namespace

382
test/buffer.h Normal file
View File

@ -0,0 +1,382 @@
/*
* Copyright (c) 2016 The WebM project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#ifndef TEST_BUFFER_H_
#define TEST_BUFFER_H_
#include <stdio.h>
#include <limits>
#include "third_party/googletest/src/include/gtest/gtest.h"
#include "test/acm_random.h"
#include "vpx/vpx_integer.h"
#include "vpx_mem/vpx_mem.h"
namespace libvpx_test {
template <typename T>
class Buffer {
public:
Buffer(int width, int height, int top_padding, int left_padding,
int right_padding, int bottom_padding)
: width_(width), height_(height), top_padding_(top_padding),
left_padding_(left_padding), right_padding_(right_padding),
bottom_padding_(bottom_padding), alignment_(0), padding_value_(0),
stride_(0), raw_size_(0), num_elements_(0), raw_buffer_(NULL) {}
Buffer(int width, int height, int top_padding, int left_padding,
int right_padding, int bottom_padding, unsigned int alignment)
: width_(width), height_(height), top_padding_(top_padding),
left_padding_(left_padding), right_padding_(right_padding),
bottom_padding_(bottom_padding), alignment_(alignment),
padding_value_(0), stride_(0), raw_size_(0), num_elements_(0),
raw_buffer_(NULL) {}
Buffer(int width, int height, int padding)
: width_(width), height_(height), top_padding_(padding),
left_padding_(padding), right_padding_(padding),
bottom_padding_(padding), alignment_(0), padding_value_(0), stride_(0),
raw_size_(0), num_elements_(0), raw_buffer_(NULL) {}
Buffer(int width, int height, int padding, unsigned int alignment)
: width_(width), height_(height), top_padding_(padding),
left_padding_(padding), right_padding_(padding),
bottom_padding_(padding), alignment_(alignment), padding_value_(0),
stride_(0), raw_size_(0), num_elements_(0), raw_buffer_(NULL) {}
~Buffer() {
if (alignment_) {
vpx_free(raw_buffer_);
} else {
delete[] raw_buffer_;
}
}
T *TopLeftPixel() const;
int stride() const { return stride_; }
// Set the buffer (excluding padding) to 'value'.
void Set(const T value);
// Set the buffer (excluding padding) to the output of ACMRandom function
// 'rand_func'.
void Set(ACMRandom *rand_class, T (ACMRandom::*rand_func)());
// Set the buffer (excluding padding) to the output of ACMRandom function
// 'RandRange' with range 'low' to 'high' which typically must be within
// testing::internal::Random::kMaxRange (1u << 31). However, because we want
// to allow negative low (and high) values, it is restricted to INT32_MAX
// here.
void Set(ACMRandom *rand_class, const T low, const T high);
// Copy the contents of Buffer 'a' (excluding padding).
void CopyFrom(const Buffer<T> &a);
void DumpBuffer() const;
// Highlight the differences between two buffers if they are the same size.
void PrintDifference(const Buffer<T> &a) const;
bool HasPadding() const;
// Sets all the values in the buffer to 'padding_value'.
void SetPadding(const T padding_value);
// Checks if all the values (excluding padding) are equal to 'value' if the
// Buffers are the same size.
bool CheckValues(const T value) const;
// Check that padding matches the expected value or there is no padding.
bool CheckPadding() const;
// Compare the non-padding portion of two buffers if they are the same size.
bool CheckValues(const Buffer<T> &a) const;
bool Init() {
if (raw_buffer_ != NULL) return false;
EXPECT_GT(width_, 0);
EXPECT_GT(height_, 0);
EXPECT_GE(top_padding_, 0);
EXPECT_GE(left_padding_, 0);
EXPECT_GE(right_padding_, 0);
EXPECT_GE(bottom_padding_, 0);
stride_ = left_padding_ + width_ + right_padding_;
num_elements_ = stride_ * (top_padding_ + height_ + bottom_padding_);
raw_size_ = num_elements_ * sizeof(T);
if (alignment_) {
EXPECT_GE(alignment_, sizeof(T));
// Ensure alignment of the first value will be preserved.
EXPECT_EQ((left_padding_ * sizeof(T)) % alignment_, 0u);
// Ensure alignment of the subsequent rows will be preserved when there is
// a stride.
if (stride_ != width_) {
EXPECT_EQ((stride_ * sizeof(T)) % alignment_, 0u);
}
raw_buffer_ = reinterpret_cast<T *>(vpx_memalign(alignment_, raw_size_));
} else {
raw_buffer_ = new (std::nothrow) T[num_elements_];
}
EXPECT_TRUE(raw_buffer_ != NULL);
SetPadding(std::numeric_limits<T>::max());
return !::testing::Test::HasFailure();
}
private:
bool BufferSizesMatch(const Buffer<T> &a) const;
const int width_;
const int height_;
const int top_padding_;
const int left_padding_;
const int right_padding_;
const int bottom_padding_;
const unsigned int alignment_;
T padding_value_;
int stride_;
int raw_size_;
int num_elements_;
T *raw_buffer_;
};
template <typename T>
T *Buffer<T>::TopLeftPixel() const {
if (!raw_buffer_) return NULL;
return raw_buffer_ + (top_padding_ * stride_) + left_padding_;
}
template <typename T>
void Buffer<T>::Set(const T value) {
if (!raw_buffer_) return;
T *src = TopLeftPixel();
for (int height = 0; height < height_; ++height) {
for (int width = 0; width < width_; ++width) {
src[width] = value;
}
src += stride_;
}
}
template <typename T>
void Buffer<T>::Set(ACMRandom *rand_class, T (ACMRandom::*rand_func)()) {
if (!raw_buffer_) return;
T *src = TopLeftPixel();
for (int height = 0; height < height_; ++height) {
for (int width = 0; width < width_; ++width) {
src[width] = (*rand_class.*rand_func)();
}
src += stride_;
}
}
template <typename T>
void Buffer<T>::Set(ACMRandom *rand_class, const T low, const T high) {
if (!raw_buffer_) return;
EXPECT_LE(low, high);
EXPECT_LE(static_cast<int64_t>(high) - low,
std::numeric_limits<int32_t>::max());
T *src = TopLeftPixel();
for (int height = 0; height < height_; ++height) {
for (int width = 0; width < width_; ++width) {
// 'low' will be promoted to unsigned given the return type of RandRange.
// Store the value as an int to avoid unsigned overflow warnings when
// 'low' is negative.
const int32_t value =
static_cast<int32_t>((*rand_class).RandRange(high - low));
src[width] = static_cast<T>(value + low);
}
src += stride_;
}
}
template <typename T>
void Buffer<T>::CopyFrom(const Buffer<T> &a) {
if (!raw_buffer_) return;
if (!BufferSizesMatch(a)) return;
T *a_src = a.TopLeftPixel();
T *b_src = this->TopLeftPixel();
for (int height = 0; height < height_; ++height) {
for (int width = 0; width < width_; ++width) {
b_src[width] = a_src[width];
}
a_src += a.stride();
b_src += this->stride();
}
}
template <typename T>
void Buffer<T>::DumpBuffer() const {
if (!raw_buffer_) return;
for (int height = 0; height < height_ + top_padding_ + bottom_padding_;
++height) {
for (int width = 0; width < stride_; ++width) {
printf("%4d", raw_buffer_[height + width * stride_]);
}
printf("\n");
}
}
template <typename T>
bool Buffer<T>::HasPadding() const {
if (!raw_buffer_) return false;
return top_padding_ || left_padding_ || right_padding_ || bottom_padding_;
}
template <typename T>
void Buffer<T>::PrintDifference(const Buffer<T> &a) const {
if (!raw_buffer_) return;
if (!BufferSizesMatch(a)) return;
T *a_src = a.TopLeftPixel();
T *b_src = TopLeftPixel();
printf("This buffer:\n");
for (int height = 0; height < height_; ++height) {
for (int width = 0; width < width_; ++width) {
if (a_src[width] != b_src[width]) {
printf("*%3d", b_src[width]);
} else {
printf("%4d", b_src[width]);
}
}
printf("\n");
a_src += a.stride();
b_src += this->stride();
}
a_src = a.TopLeftPixel();
b_src = TopLeftPixel();
printf("Reference buffer:\n");
for (int height = 0; height < height_; ++height) {
for (int width = 0; width < width_; ++width) {
if (a_src[width] != b_src[width]) {
printf("*%3d", a_src[width]);
} else {
printf("%4d", a_src[width]);
}
}
printf("\n");
a_src += a.stride();
b_src += this->stride();
}
}
template <typename T>
void Buffer<T>::SetPadding(const T padding_value) {
if (!raw_buffer_) return;
padding_value_ = padding_value;
T *src = raw_buffer_;
for (int i = 0; i < num_elements_; ++i) {
src[i] = padding_value;
}
}
template <typename T>
bool Buffer<T>::CheckValues(const T value) const {
if (!raw_buffer_) return false;
T *src = TopLeftPixel();
for (int height = 0; height < height_; ++height) {
for (int width = 0; width < width_; ++width) {
if (value != src[width]) {
return false;
}
}
src += stride_;
}
return true;
}
template <typename T>
bool Buffer<T>::CheckPadding() const {
if (!raw_buffer_) return false;
if (!HasPadding()) return true;
// Top padding.
T const *top = raw_buffer_;
for (int i = 0; i < stride_ * top_padding_; ++i) {
if (padding_value_ != top[i]) {
return false;
}
}
// Left padding.
T const *left = TopLeftPixel() - left_padding_;
for (int height = 0; height < height_; ++height) {
for (int width = 0; width < left_padding_; ++width) {
if (padding_value_ != left[width]) {
return false;
}
}
left += stride_;
}
// Right padding.
T const *right = TopLeftPixel() + width_;
for (int height = 0; height < height_; ++height) {
for (int width = 0; width < right_padding_; ++width) {
if (padding_value_ != right[width]) {
return false;
}
}
right += stride_;
}
// Bottom padding
T const *bottom = raw_buffer_ + (top_padding_ + height_) * stride_;
for (int i = 0; i < stride_ * bottom_padding_; ++i) {
if (padding_value_ != bottom[i]) {
return false;
}
}
return true;
}
template <typename T>
bool Buffer<T>::CheckValues(const Buffer<T> &a) const {
if (!raw_buffer_) return false;
if (!BufferSizesMatch(a)) return false;
T *a_src = a.TopLeftPixel();
T *b_src = this->TopLeftPixel();
for (int height = 0; height < height_; ++height) {
for (int width = 0; width < width_; ++width) {
if (a_src[width] != b_src[width]) {
return false;
}
}
a_src += a.stride();
b_src += this->stride();
}
return true;
}
template <typename T>
bool Buffer<T>::BufferSizesMatch(const Buffer<T> &a) const {
if (!raw_buffer_) return false;
if (a.width_ != this->width_ || a.height_ != this->height_) {
printf(
"Reference buffer of size %dx%d does not match this buffer which is "
"size %dx%d\n",
a.width_, a.height_, this->width_, this->height_);
return false;
}
return true;
}
} // namespace libvpx_test
#endif // TEST_BUFFER_H_

View File

@ -21,14 +21,14 @@
namespace {
#if CONFIG_WEBM_IO
const int kLegacyByteAlignment = 0;
const int kLegacyYPlaneByteAlignment = 32;
const int kNumPlanesToCheck = 3;
const char kVP9TestFile[] = "vp90-2-02-size-lf-1920x1080.webm";
const char kVP9Md5File[] = "vp90-2-02-size-lf-1920x1080.webm.md5";
#if CONFIG_WEBM_IO
struct ByteAlignmentTestParam {
int byte_alignment;
vpx_codec_err_t expected_value;
@ -36,29 +36,26 @@ struct ByteAlignmentTestParam {
};
const ByteAlignmentTestParam kBaTestParams[] = {
{kLegacyByteAlignment, VPX_CODEC_OK, true},
{32, VPX_CODEC_OK, true},
{64, VPX_CODEC_OK, true},
{128, VPX_CODEC_OK, true},
{256, VPX_CODEC_OK, true},
{512, VPX_CODEC_OK, true},
{1024, VPX_CODEC_OK, true},
{1, VPX_CODEC_INVALID_PARAM, false},
{-2, VPX_CODEC_INVALID_PARAM, false},
{4, VPX_CODEC_INVALID_PARAM, false},
{16, VPX_CODEC_INVALID_PARAM, false},
{255, VPX_CODEC_INVALID_PARAM, false},
{2048, VPX_CODEC_INVALID_PARAM, false},
{ kLegacyByteAlignment, VPX_CODEC_OK, true },
{ 32, VPX_CODEC_OK, true },
{ 64, VPX_CODEC_OK, true },
{ 128, VPX_CODEC_OK, true },
{ 256, VPX_CODEC_OK, true },
{ 512, VPX_CODEC_OK, true },
{ 1024, VPX_CODEC_OK, true },
{ 1, VPX_CODEC_INVALID_PARAM, false },
{ -2, VPX_CODEC_INVALID_PARAM, false },
{ 4, VPX_CODEC_INVALID_PARAM, false },
{ 16, VPX_CODEC_INVALID_PARAM, false },
{ 255, VPX_CODEC_INVALID_PARAM, false },
{ 2048, VPX_CODEC_INVALID_PARAM, false },
};
// Class for testing byte alignment of reference buffers.
class ByteAlignmentTest
: public ::testing::TestWithParam<ByteAlignmentTestParam> {
protected:
ByteAlignmentTest()
: video_(NULL),
decoder_(NULL),
md5_file_(NULL) {}
ByteAlignmentTest() : video_(NULL), decoder_(NULL), md5_file_(NULL) {}
virtual void SetUp() {
video_ = new libvpx_test::WebMVideoSource(kVP9TestFile);
@ -74,8 +71,7 @@ class ByteAlignmentTest
}
virtual void TearDown() {
if (md5_file_ != NULL)
fclose(md5_file_);
if (md5_file_ != NULL) fclose(md5_file_);
delete decoder_;
delete video_;
@ -89,8 +85,7 @@ class ByteAlignmentTest
const vpx_codec_err_t res =
decoder_->DecodeFrame(video_->cxdata(), video_->frame_size());
CheckDecodedFrames(byte_alignment_to_check);
if (res == VPX_CODEC_OK)
video_->Next();
if (res == VPX_CODEC_OK) video_->Next();
return res;
}
@ -98,8 +93,7 @@ class ByteAlignmentTest
for (; video_->cxdata() != NULL; video_->Next()) {
const vpx_codec_err_t res =
decoder_->DecodeFrame(video_->cxdata(), video_->frame_size());
if (res != VPX_CODEC_OK)
return res;
if (res != VPX_CODEC_OK) return res;
CheckDecodedFrames(byte_alignment_to_check);
}
return VPX_CODEC_OK;
@ -134,8 +128,8 @@ class ByteAlignmentTest
// TODO(fgalligan): Move the MD5 testing code into another class.
void OpenMd5File(const std::string &md5_file_name_) {
md5_file_ = libvpx_test::OpenTestDataFile(md5_file_name_);
ASSERT_TRUE(md5_file_ != NULL) << "MD5 file open failed. Filename: "
<< md5_file_name_;
ASSERT_TRUE(md5_file_ != NULL)
<< "MD5 file open failed. Filename: " << md5_file_name_;
}
void CheckMd5(const vpx_image_t &img) {
@ -163,8 +157,8 @@ class ByteAlignmentTest
TEST_F(ByteAlignmentTest, SwitchByteAlignment) {
const int num_elements = 14;
const int byte_alignments[] = { 0, 32, 64, 128, 256, 512, 1024,
0, 1024, 32, 512, 64, 256, 128 };
const int byte_alignments[] = { 0, 32, 64, 128, 256, 512, 1024,
0, 1024, 32, 512, 64, 256, 128 };
for (int i = 0; i < num_elements; ++i) {
SetByteAlignment(byte_alignments[i], VPX_CODEC_OK);
@ -177,8 +171,9 @@ TEST_F(ByteAlignmentTest, SwitchByteAlignment) {
TEST_P(ByteAlignmentTest, TestAlignment) {
const ByteAlignmentTestParam t = GetParam();
SetByteAlignment(t.byte_alignment, t.expected_value);
if (t.decode_remaining)
if (t.decode_remaining) {
ASSERT_EQ(VPX_CODEC_OK, DecodeRemainingFrames(t.byte_alignment));
}
}
INSTANTIATE_TEST_CASE_P(Alignments, ByteAlignmentTest,

View File

@ -11,19 +11,13 @@
#define TEST_CLEAR_SYSTEM_STATE_H_
#include "./vpx_config.h"
#if ARCH_X86 || ARCH_X86_64
# include "vpx_ports/x86.h"
#endif
#include "vpx_ports/system_state.h"
namespace libvpx_test {
// Reset system to a known state. This function should be used for all non-API
// test cases.
inline void ClearSystemState() {
#if ARCH_X86 || ARCH_X86_64
vpx_reset_mmx_state();
#endif
}
inline void ClearSystemState() { vpx_clear_system_state(); }
} // namespace libvpx_test
#endif // TEST_CLEAR_SYSTEM_STATE_H_

View File

@ -32,15 +32,12 @@ class CodecFactory {
virtual ~CodecFactory() {}
virtual Decoder* CreateDecoder(vpx_codec_dec_cfg_t cfg,
unsigned long deadline) const = 0;
virtual Decoder *CreateDecoder(vpx_codec_dec_cfg_t cfg) const = 0;
virtual Decoder* CreateDecoder(vpx_codec_dec_cfg_t cfg,
const vpx_codec_flags_t flags,
unsigned long deadline) // NOLINT(runtime/int)
const = 0;
virtual Decoder *CreateDecoder(vpx_codec_dec_cfg_t cfg,
const vpx_codec_flags_t flags) const = 0;
virtual Encoder* CreateEncoder(vpx_codec_enc_cfg_t cfg,
virtual Encoder *CreateEncoder(vpx_codec_enc_cfg_t cfg,
unsigned long deadline,
const unsigned long init_flags,
TwopassStatsStore *stats) const = 0;
@ -53,20 +50,25 @@ class CodecFactory {
* to avoid having to include a pointer to the CodecFactory in every test
* definition.
*/
template<class T1>
class CodecTestWithParam : public ::testing::TestWithParam<
std::tr1::tuple< const libvpx_test::CodecFactory*, T1 > > {
};
template <class T1>
class CodecTestWithParam
: public ::testing::TestWithParam<
::testing::tuple<const libvpx_test::CodecFactory *, T1> > {};
template<class T1, class T2>
class CodecTestWith2Params : public ::testing::TestWithParam<
std::tr1::tuple< const libvpx_test::CodecFactory*, T1, T2 > > {
};
template <class T1, class T2>
class CodecTestWith2Params
: public ::testing::TestWithParam<
::testing::tuple<const libvpx_test::CodecFactory *, T1, T2> > {};
template<class T1, class T2, class T3>
class CodecTestWith3Params : public ::testing::TestWithParam<
std::tr1::tuple< const libvpx_test::CodecFactory*, T1, T2, T3 > > {
};
template <class T1, class T2, class T3>
class CodecTestWith3Params
: public ::testing::TestWithParam<
::testing::tuple<const libvpx_test::CodecFactory *, T1, T2, T3> > {};
template <class T1, class T2, class T3, class T4>
class CodecTestWith4Params
: public ::testing::TestWithParam< ::testing::tuple<
const libvpx_test::CodecFactory *, T1, T2, T3, T4> > {};
/*
* VP8 Codec Definitions
@ -74,15 +76,13 @@ class CodecTestWith3Params : public ::testing::TestWithParam<
#if CONFIG_VP8
class VP8Decoder : public Decoder {
public:
VP8Decoder(vpx_codec_dec_cfg_t cfg, unsigned long deadline)
: Decoder(cfg, deadline) {}
explicit VP8Decoder(vpx_codec_dec_cfg_t cfg) : Decoder(cfg) {}
VP8Decoder(vpx_codec_dec_cfg_t cfg, const vpx_codec_flags_t flag,
unsigned long deadline) // NOLINT
: Decoder(cfg, flag, deadline) {}
VP8Decoder(vpx_codec_dec_cfg_t cfg, const vpx_codec_flags_t flag)
: Decoder(cfg, flag) {}
protected:
virtual vpx_codec_iface_t* CodecInterface() const {
virtual vpx_codec_iface_t *CodecInterface() const {
#if CONFIG_VP8_DECODER
return &vpx_codec_vp8_dx_algo;
#else
@ -98,7 +98,7 @@ class VP8Encoder : public Encoder {
: Encoder(cfg, deadline, init_flags, stats) {}
protected:
virtual vpx_codec_iface_t* CodecInterface() const {
virtual vpx_codec_iface_t *CodecInterface() const {
#if CONFIG_VP8_ENCODER
return &vpx_codec_vp8_cx_algo;
#else
@ -111,28 +111,32 @@ class VP8CodecFactory : public CodecFactory {
public:
VP8CodecFactory() : CodecFactory() {}
virtual Decoder* CreateDecoder(vpx_codec_dec_cfg_t cfg,
unsigned long deadline) const {
return CreateDecoder(cfg, 0, deadline);
virtual Decoder *CreateDecoder(vpx_codec_dec_cfg_t cfg) const {
return CreateDecoder(cfg, 0);
}
virtual Decoder* CreateDecoder(vpx_codec_dec_cfg_t cfg,
const vpx_codec_flags_t flags,
unsigned long deadline) const { // NOLINT
virtual Decoder *CreateDecoder(vpx_codec_dec_cfg_t cfg,
const vpx_codec_flags_t flags) const {
#if CONFIG_VP8_DECODER
return new VP8Decoder(cfg, flags, deadline);
return new VP8Decoder(cfg, flags);
#else
(void)cfg;
(void)flags;
return NULL;
#endif
}
virtual Encoder* CreateEncoder(vpx_codec_enc_cfg_t cfg,
virtual Encoder *CreateEncoder(vpx_codec_enc_cfg_t cfg,
unsigned long deadline,
const unsigned long init_flags,
TwopassStatsStore *stats) const {
#if CONFIG_VP8_ENCODER
return new VP8Encoder(cfg, deadline, init_flags, stats);
#else
(void)cfg;
(void)deadline;
(void)init_flags;
(void)stats;
return NULL;
#endif
}
@ -142,6 +146,8 @@ class VP8CodecFactory : public CodecFactory {
#if CONFIG_VP8_ENCODER
return vpx_codec_enc_config_default(&vpx_codec_vp8_cx_algo, cfg, usage);
#else
(void)cfg;
(void)usage;
return VPX_CODEC_INCAPABLE;
#endif
}
@ -149,32 +155,30 @@ class VP8CodecFactory : public CodecFactory {
const libvpx_test::VP8CodecFactory kVP8;
#define VP8_INSTANTIATE_TEST_CASE(test, ...)\
INSTANTIATE_TEST_CASE_P(VP8, test, \
::testing::Combine( \
::testing::Values(static_cast<const libvpx_test::CodecFactory*>( \
&libvpx_test::kVP8)), \
#define VP8_INSTANTIATE_TEST_CASE(test, ...) \
INSTANTIATE_TEST_CASE_P( \
VP8, test, \
::testing::Combine( \
::testing::Values(static_cast<const libvpx_test::CodecFactory *>( \
&libvpx_test::kVP8)), \
__VA_ARGS__))
#else
#define VP8_INSTANTIATE_TEST_CASE(test, ...)
#endif // CONFIG_VP8
/*
* VP9 Codec Definitions
*/
#if CONFIG_VP9
class VP9Decoder : public Decoder {
public:
VP9Decoder(vpx_codec_dec_cfg_t cfg, unsigned long deadline)
: Decoder(cfg, deadline) {}
explicit VP9Decoder(vpx_codec_dec_cfg_t cfg) : Decoder(cfg) {}
VP9Decoder(vpx_codec_dec_cfg_t cfg, const vpx_codec_flags_t flag,
unsigned long deadline) // NOLINT
: Decoder(cfg, flag, deadline) {}
VP9Decoder(vpx_codec_dec_cfg_t cfg, const vpx_codec_flags_t flag)
: Decoder(cfg, flag) {}
protected:
virtual vpx_codec_iface_t* CodecInterface() const {
virtual vpx_codec_iface_t *CodecInterface() const {
#if CONFIG_VP9_DECODER
return &vpx_codec_vp9_dx_algo;
#else
@ -190,7 +194,7 @@ class VP9Encoder : public Encoder {
: Encoder(cfg, deadline, init_flags, stats) {}
protected:
virtual vpx_codec_iface_t* CodecInterface() const {
virtual vpx_codec_iface_t *CodecInterface() const {
#if CONFIG_VP9_ENCODER
return &vpx_codec_vp9_cx_algo;
#else
@ -203,28 +207,32 @@ class VP9CodecFactory : public CodecFactory {
public:
VP9CodecFactory() : CodecFactory() {}
virtual Decoder* CreateDecoder(vpx_codec_dec_cfg_t cfg,
unsigned long deadline) const {
return CreateDecoder(cfg, 0, deadline);
virtual Decoder *CreateDecoder(vpx_codec_dec_cfg_t cfg) const {
return CreateDecoder(cfg, 0);
}
virtual Decoder* CreateDecoder(vpx_codec_dec_cfg_t cfg,
const vpx_codec_flags_t flags,
unsigned long deadline) const { // NOLINT
virtual Decoder *CreateDecoder(vpx_codec_dec_cfg_t cfg,
const vpx_codec_flags_t flags) const {
#if CONFIG_VP9_DECODER
return new VP9Decoder(cfg, flags, deadline);
return new VP9Decoder(cfg, flags);
#else
(void)cfg;
(void)flags;
return NULL;
#endif
}
virtual Encoder* CreateEncoder(vpx_codec_enc_cfg_t cfg,
virtual Encoder *CreateEncoder(vpx_codec_enc_cfg_t cfg,
unsigned long deadline,
const unsigned long init_flags,
TwopassStatsStore *stats) const {
#if CONFIG_VP9_ENCODER
return new VP9Encoder(cfg, deadline, init_flags, stats);
#else
(void)cfg;
(void)deadline;
(void)init_flags;
(void)stats;
return NULL;
#endif
}
@ -234,6 +242,8 @@ class VP9CodecFactory : public CodecFactory {
#if CONFIG_VP9_ENCODER
return vpx_codec_enc_config_default(&vpx_codec_vp9_cx_algo, cfg, usage);
#else
(void)cfg;
(void)usage;
return VPX_CODEC_INCAPABLE;
#endif
}
@ -241,17 +251,16 @@ class VP9CodecFactory : public CodecFactory {
const libvpx_test::VP9CodecFactory kVP9;
#define VP9_INSTANTIATE_TEST_CASE(test, ...)\
INSTANTIATE_TEST_CASE_P(VP9, test, \
::testing::Combine( \
::testing::Values(static_cast<const libvpx_test::CodecFactory*>( \
&libvpx_test::kVP9)), \
#define VP9_INSTANTIATE_TEST_CASE(test, ...) \
INSTANTIATE_TEST_CASE_P( \
VP9, test, \
::testing::Combine( \
::testing::Values(static_cast<const libvpx_test::CodecFactory *>( \
&libvpx_test::kVP9)), \
__VA_ARGS__))
#else
#define VP9_INSTANTIATE_TEST_CASE(test, ...)
#endif // CONFIG_VP9
} // namespace libvpx_test
#endif // TEST_CODEC_FACTORY_H_

182
test/comp_avg_pred_test.cc Normal file
View File

@ -0,0 +1,182 @@
/*
* Copyright (c) 2017 The WebM project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#include "third_party/googletest/src/include/gtest/gtest.h"
#include "./vpx_dsp_rtcd.h"
#include "test/acm_random.h"
#include "test/buffer.h"
#include "test/register_state_check.h"
#include "vpx_ports/vpx_timer.h"
namespace {
using ::libvpx_test::ACMRandom;
using ::libvpx_test::Buffer;
typedef void (*AvgPredFunc)(uint8_t *a, const uint8_t *b, int w, int h,
const uint8_t *c, int c_stride);
uint8_t avg_with_rounding(uint8_t a, uint8_t b) { return (a + b + 1) >> 1; }
void reference_pred(const Buffer<uint8_t> &pred, const Buffer<uint8_t> &ref,
int width, int height, Buffer<uint8_t> *avg) {
for (int y = 0; y < height; ++y) {
for (int x = 0; x < width; ++x) {
avg->TopLeftPixel()[y * avg->stride() + x] =
avg_with_rounding(pred.TopLeftPixel()[y * pred.stride() + x],
ref.TopLeftPixel()[y * ref.stride() + x]);
}
}
}
class AvgPredTest : public ::testing::TestWithParam<AvgPredFunc> {
public:
virtual void SetUp() {
avg_pred_func_ = GetParam();
rnd_.Reset(ACMRandom::DeterministicSeed());
}
protected:
AvgPredFunc avg_pred_func_;
ACMRandom rnd_;
};
TEST_P(AvgPredTest, SizeCombinations) {
// This is called as part of the sub pixel variance. As such it must be one of
// the variance block sizes.
for (int width_pow = 2; width_pow <= 6; ++width_pow) {
for (int height_pow = width_pow - 1; height_pow <= width_pow + 1;
++height_pow) {
// Don't test 4x2 or 64x128
if (height_pow == 1 || height_pow == 7) continue;
// The sse2 special-cases when ref width == stride, so make sure to test
// it.
for (int ref_padding = 0; ref_padding < 2; ref_padding++) {
const int width = 1 << width_pow;
const int height = 1 << height_pow;
// Only the reference buffer may have a stride not equal to width.
Buffer<uint8_t> ref =
Buffer<uint8_t>(width, height, ref_padding ? 8 : 0);
ASSERT_TRUE(ref.Init());
Buffer<uint8_t> pred = Buffer<uint8_t>(width, height, 0, 16);
ASSERT_TRUE(pred.Init());
Buffer<uint8_t> avg_ref = Buffer<uint8_t>(width, height, 0, 16);
ASSERT_TRUE(avg_ref.Init());
Buffer<uint8_t> avg_chk = Buffer<uint8_t>(width, height, 0, 16);
ASSERT_TRUE(avg_chk.Init());
ref.Set(&rnd_, &ACMRandom::Rand8);
pred.Set(&rnd_, &ACMRandom::Rand8);
reference_pred(pred, ref, width, height, &avg_ref);
ASM_REGISTER_STATE_CHECK(
avg_pred_func_(avg_chk.TopLeftPixel(), pred.TopLeftPixel(), width,
height, ref.TopLeftPixel(), ref.stride()));
EXPECT_TRUE(avg_chk.CheckValues(avg_ref));
if (HasFailure()) {
printf("Width: %d Height: %d\n", width, height);
avg_chk.PrintDifference(avg_ref);
return;
}
}
}
}
}
TEST_P(AvgPredTest, CompareReferenceRandom) {
const int width = 64;
const int height = 32;
Buffer<uint8_t> ref = Buffer<uint8_t>(width, height, 8);
ASSERT_TRUE(ref.Init());
Buffer<uint8_t> pred = Buffer<uint8_t>(width, height, 0, 16);
ASSERT_TRUE(pred.Init());
Buffer<uint8_t> avg_ref = Buffer<uint8_t>(width, height, 0, 16);
ASSERT_TRUE(avg_ref.Init());
Buffer<uint8_t> avg_chk = Buffer<uint8_t>(width, height, 0, 16);
ASSERT_TRUE(avg_chk.Init());
for (int i = 0; i < 500; ++i) {
ref.Set(&rnd_, &ACMRandom::Rand8);
pred.Set(&rnd_, &ACMRandom::Rand8);
reference_pred(pred, ref, width, height, &avg_ref);
ASM_REGISTER_STATE_CHECK(avg_pred_func_(avg_chk.TopLeftPixel(),
pred.TopLeftPixel(), width, height,
ref.TopLeftPixel(), ref.stride()));
EXPECT_TRUE(avg_chk.CheckValues(avg_ref));
if (HasFailure()) {
printf("Width: %d Height: %d\n", width, height);
avg_chk.PrintDifference(avg_ref);
return;
}
}
}
TEST_P(AvgPredTest, DISABLED_Speed) {
for (int width_pow = 2; width_pow <= 6; ++width_pow) {
for (int height_pow = width_pow - 1; height_pow <= width_pow + 1;
++height_pow) {
// Don't test 4x2 or 64x128
if (height_pow == 1 || height_pow == 7) continue;
for (int ref_padding = 0; ref_padding < 2; ref_padding++) {
const int width = 1 << width_pow;
const int height = 1 << height_pow;
Buffer<uint8_t> ref =
Buffer<uint8_t>(width, height, ref_padding ? 8 : 0);
ASSERT_TRUE(ref.Init());
Buffer<uint8_t> pred = Buffer<uint8_t>(width, height, 0, 16);
ASSERT_TRUE(pred.Init());
Buffer<uint8_t> avg = Buffer<uint8_t>(width, height, 0, 16);
ASSERT_TRUE(avg.Init());
ref.Set(&rnd_, &ACMRandom::Rand8);
pred.Set(&rnd_, &ACMRandom::Rand8);
vpx_usec_timer timer;
vpx_usec_timer_start(&timer);
for (int i = 0; i < 10000000 / (width * height); ++i) {
avg_pred_func_(avg.TopLeftPixel(), pred.TopLeftPixel(), width, height,
ref.TopLeftPixel(), ref.stride());
}
vpx_usec_timer_mark(&timer);
const int elapsed_time =
static_cast<int>(vpx_usec_timer_elapsed(&timer));
printf("Average Test (ref_padding: %d) %dx%d time: %5d us\n",
ref_padding, width, height, elapsed_time);
}
}
}
}
INSTANTIATE_TEST_CASE_P(C, AvgPredTest,
::testing::Values(&vpx_comp_avg_pred_c));
#if HAVE_SSE2
INSTANTIATE_TEST_CASE_P(SSE2, AvgPredTest,
::testing::Values(&vpx_comp_avg_pred_sse2));
#endif // HAVE_SSE2
#if HAVE_NEON
INSTANTIATE_TEST_CASE_P(NEON, AvgPredTest,
::testing::Values(&vpx_comp_avg_pred_neon));
#endif // HAVE_NEON
#if HAVE_VSX
INSTANTIATE_TEST_CASE_P(VSX, AvgPredTest,
::testing::Values(&vpx_comp_avg_pred_vsx));
#endif // HAVE_VSX
} // namespace

View File

@ -15,11 +15,13 @@
namespace {
class ConfigTest : public ::libvpx_test::EncoderTest,
public ::libvpx_test::CodecTestWithParam<libvpx_test::TestMode> {
class ConfigTest
: public ::libvpx_test::EncoderTest,
public ::libvpx_test::CodecTestWithParam<libvpx_test::TestMode> {
protected:
ConfigTest() : EncoderTest(GET_PARAM(0)),
frame_count_in_(0), frame_count_out_(0), frame_count_max_(0) {}
ConfigTest()
: EncoderTest(GET_PARAM(0)), frame_count_in_(0), frame_count_out_(0),
frame_count_max_(0) {}
virtual ~ConfigTest() {}
virtual void SetUp() {
@ -32,12 +34,12 @@ class ConfigTest : public ::libvpx_test::EncoderTest,
frame_count_out_ = 0;
}
virtual void PreEncodeFrameHook(libvpx_test::VideoSource* /*video*/) {
virtual void PreEncodeFrameHook(libvpx_test::VideoSource * /*video*/) {
++frame_count_in_;
abort_ |= (frame_count_in_ >= frame_count_max_);
}
virtual void FramePktHook(const vpx_codec_cx_pkt_t* /*pkt*/) {
virtual void FramePktHook(const vpx_codec_cx_pkt_t * /*pkt*/) {
++frame_count_out_;
}

214
test/consistency_test.cc Normal file
View File

@ -0,0 +1,214 @@
/*
* Copyright (c) 2012 The WebM project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#include <limits.h>
#include <stdio.h>
#include <string.h>
#include "third_party/googletest/src/include/gtest/gtest.h"
#include "./vpx_config.h"
#if CONFIG_VP9_ENCODER
#include "./vp9_rtcd.h"
#endif
#include "test/acm_random.h"
#include "test/clear_system_state.h"
#include "test/register_state_check.h"
#include "test/util.h"
#include "vpx_dsp/ssim.h"
#include "vpx_mem/vpx_mem.h"
extern "C" double vpx_get_ssim_metrics(uint8_t *img1, int img1_pitch,
uint8_t *img2, int img2_pitch, int width,
int height, Ssimv *sv2, Metrics *m,
int do_inconsistency);
using libvpx_test::ACMRandom;
namespace {
class ConsistencyTestBase : public ::testing::Test {
public:
ConsistencyTestBase(int width, int height) : width_(width), height_(height) {}
static void SetUpTestCase() {
source_data_[0] = reinterpret_cast<uint8_t *>(
vpx_memalign(kDataAlignment, kDataBufferSize));
reference_data_[0] = reinterpret_cast<uint8_t *>(
vpx_memalign(kDataAlignment, kDataBufferSize));
source_data_[1] = reinterpret_cast<uint8_t *>(
vpx_memalign(kDataAlignment, kDataBufferSize));
reference_data_[1] = reinterpret_cast<uint8_t *>(
vpx_memalign(kDataAlignment, kDataBufferSize));
ssim_array_ = new Ssimv[kDataBufferSize / 16];
}
static void ClearSsim() { memset(ssim_array_, 0, kDataBufferSize / 16); }
static void TearDownTestCase() {
vpx_free(source_data_[0]);
source_data_[0] = NULL;
vpx_free(reference_data_[0]);
reference_data_[0] = NULL;
vpx_free(source_data_[1]);
source_data_[1] = NULL;
vpx_free(reference_data_[1]);
reference_data_[1] = NULL;
delete[] ssim_array_;
}
virtual void TearDown() { libvpx_test::ClearSystemState(); }
protected:
// Handle frames up to 640x480
static const int kDataAlignment = 16;
static const int kDataBufferSize = 640 * 480;
virtual void SetUp() {
source_stride_ = (width_ + 31) & ~31;
reference_stride_ = width_ * 2;
rnd_.Reset(ACMRandom::DeterministicSeed());
}
void FillRandom(uint8_t *data, int stride, int width, int height) {
for (int h = 0; h < height; ++h) {
for (int w = 0; w < width; ++w) {
data[h * stride + w] = rnd_.Rand8();
}
}
}
void FillRandom(uint8_t *data, int stride) {
FillRandom(data, stride, width_, height_);
}
void Copy(uint8_t *reference, uint8_t *source) {
memcpy(reference, source, kDataBufferSize);
}
void Blur(uint8_t *data, int stride, int taps) {
int sum = 0;
int half_taps = taps / 2;
for (int h = 0; h < height_; ++h) {
for (int w = 0; w < taps; ++w) {
sum += data[w + h * stride];
}
for (int w = taps; w < width_; ++w) {
sum += data[w + h * stride] - data[w - taps + h * stride];
data[w - half_taps + h * stride] = (sum + half_taps) / taps;
}
}
for (int w = 0; w < width_; ++w) {
for (int h = 0; h < taps; ++h) {
sum += data[h + w * stride];
}
for (int h = taps; h < height_; ++h) {
sum += data[w + h * stride] - data[(h - taps) * stride + w];
data[(h - half_taps) * stride + w] = (sum + half_taps) / taps;
}
}
}
int width_, height_;
static uint8_t *source_data_[2];
int source_stride_;
static uint8_t *reference_data_[2];
int reference_stride_;
static Ssimv *ssim_array_;
Metrics metrics_;
ACMRandom rnd_;
};
#if CONFIG_VP9_ENCODER
typedef ::testing::tuple<int, int> ConsistencyParam;
class ConsistencyVP9Test
: public ConsistencyTestBase,
public ::testing::WithParamInterface<ConsistencyParam> {
public:
ConsistencyVP9Test() : ConsistencyTestBase(GET_PARAM(0), GET_PARAM(1)) {}
protected:
double CheckConsistency(int frame) {
EXPECT_LT(frame, 2) << "Frame to check has to be less than 2.";
return vpx_get_ssim_metrics(source_data_[frame], source_stride_,
reference_data_[frame], reference_stride_,
width_, height_, ssim_array_, &metrics_, 1);
}
};
#endif // CONFIG_VP9_ENCODER
uint8_t *ConsistencyTestBase::source_data_[2] = { NULL, NULL };
uint8_t *ConsistencyTestBase::reference_data_[2] = { NULL, NULL };
Ssimv *ConsistencyTestBase::ssim_array_ = NULL;
#if CONFIG_VP9_ENCODER
TEST_P(ConsistencyVP9Test, ConsistencyIsZero) {
FillRandom(source_data_[0], source_stride_);
Copy(source_data_[1], source_data_[0]);
Copy(reference_data_[0], source_data_[0]);
Blur(reference_data_[0], reference_stride_, 3);
Copy(reference_data_[1], source_data_[0]);
Blur(reference_data_[1], reference_stride_, 3);
double inconsistency = CheckConsistency(1);
inconsistency = CheckConsistency(0);
EXPECT_EQ(inconsistency, 0.0)
<< "Should have 0 inconsistency if they are exactly the same.";
// If sources are not consistent reference frames inconsistency should
// be less than if the source is consistent.
FillRandom(source_data_[0], source_stride_);
FillRandom(source_data_[1], source_stride_);
FillRandom(reference_data_[0], reference_stride_);
FillRandom(reference_data_[1], reference_stride_);
CheckConsistency(0);
inconsistency = CheckConsistency(1);
Copy(source_data_[1], source_data_[0]);
CheckConsistency(0);
double inconsistency2 = CheckConsistency(1);
EXPECT_LT(inconsistency, inconsistency2)
<< "Should have less inconsistency if source itself is inconsistent.";
// Less of a blur should be less inconsistent than more blur coming off a
// a frame with no blur.
ClearSsim();
FillRandom(source_data_[0], source_stride_);
Copy(source_data_[1], source_data_[0]);
Copy(reference_data_[0], source_data_[0]);
Copy(reference_data_[1], source_data_[0]);
Blur(reference_data_[1], reference_stride_, 4);
CheckConsistency(0);
inconsistency = CheckConsistency(1);
ClearSsim();
Copy(reference_data_[1], source_data_[0]);
Blur(reference_data_[1], reference_stride_, 8);
CheckConsistency(0);
inconsistency2 = CheckConsistency(1);
EXPECT_LT(inconsistency, inconsistency2)
<< "Stronger Blur should produce more inconsistency.";
}
#endif // CONFIG_VP9_ENCODER
using ::testing::make_tuple;
//------------------------------------------------------------------------------
// C functions
#if CONFIG_VP9_ENCODER
const ConsistencyParam c_vp9_tests[] = {
make_tuple(320, 240), make_tuple(318, 242), make_tuple(318, 238)
};
INSTANTIATE_TEST_CASE_P(C, ConsistencyVP9Test,
::testing::ValuesIn(c_vp9_tests));
#endif
} // namespace

File diff suppressed because it is too large Load Diff

View File

@ -23,10 +23,9 @@ class CpuSpeedTest
public ::libvpx_test::CodecTestWith2Params<libvpx_test::TestMode, int> {
protected:
CpuSpeedTest()
: EncoderTest(GET_PARAM(0)),
encoding_mode_(GET_PARAM(1)),
set_cpu_used_(GET_PARAM(2)),
min_psnr_(kMaxPSNR) {}
: EncoderTest(GET_PARAM(0)), encoding_mode_(GET_PARAM(1)),
set_cpu_used_(GET_PARAM(2)), min_psnr_(kMaxPSNR),
tune_content_(VP9E_CONTENT_DEFAULT) {}
virtual ~CpuSpeedTest() {}
virtual void SetUp() {
@ -41,14 +40,13 @@ class CpuSpeedTest
}
}
virtual void BeginPassHook(unsigned int /*pass*/) {
min_psnr_ = kMaxPSNR;
}
virtual void BeginPassHook(unsigned int /*pass*/) { min_psnr_ = kMaxPSNR; }
virtual void PreEncodeFrameHook(::libvpx_test::VideoSource *video,
::libvpx_test::Encoder *encoder) {
if (video->frame() == 1) {
encoder->Control(VP8E_SET_CPUUSED, set_cpu_used_);
encoder->Control(VP9E_SET_TUNE_CONTENT, tune_content_);
if (encoding_mode_ != ::libvpx_test::kRealTime) {
encoder->Control(VP8E_SET_ENABLEAUTOALTREF, 1);
encoder->Control(VP8E_SET_ARNR_MAXFRAMES, 7);
@ -59,13 +57,13 @@ class CpuSpeedTest
}
virtual void PSNRPktHook(const vpx_codec_cx_pkt_t *pkt) {
if (pkt->data.psnr.psnr[0] < min_psnr_)
min_psnr_ = pkt->data.psnr.psnr[0];
if (pkt->data.psnr.psnr[0] < min_psnr_) min_psnr_ = pkt->data.psnr.psnr[0];
}
::libvpx_test::TestMode encoding_mode_;
int set_cpu_used_;
double min_psnr_;
int tune_content_;
};
TEST_P(CpuSpeedTest, TestQ0) {
@ -74,7 +72,7 @@ TEST_P(CpuSpeedTest, TestQ0) {
// the encoder to producing lots of big partitions which will likely
// extend into the border and test the border condition.
cfg_.rc_2pass_vbr_minsection_pct = 5;
cfg_.rc_2pass_vbr_minsection_pct = 2000;
cfg_.rc_2pass_vbr_maxsection_pct = 2000;
cfg_.rc_target_bitrate = 400;
cfg_.rc_max_quantizer = 0;
cfg_.rc_min_quantizer = 0;
@ -92,7 +90,7 @@ TEST_P(CpuSpeedTest, TestScreencastQ0) {
::libvpx_test::Y4mVideoSource video("screendata.y4m", 0, 25);
cfg_.g_timebase = video.timebase();
cfg_.rc_2pass_vbr_minsection_pct = 5;
cfg_.rc_2pass_vbr_minsection_pct = 2000;
cfg_.rc_2pass_vbr_maxsection_pct = 2000;
cfg_.rc_target_bitrate = 400;
cfg_.rc_max_quantizer = 0;
cfg_.rc_min_quantizer = 0;
@ -103,13 +101,28 @@ TEST_P(CpuSpeedTest, TestScreencastQ0) {
EXPECT_GE(min_psnr_, kMaxPSNR);
}
TEST_P(CpuSpeedTest, TestTuneScreen) {
::libvpx_test::Y4mVideoSource video("screendata.y4m", 0, 25);
cfg_.g_timebase = video.timebase();
cfg_.rc_2pass_vbr_minsection_pct = 5;
cfg_.rc_2pass_vbr_minsection_pct = 2000;
cfg_.rc_target_bitrate = 2000;
cfg_.rc_max_quantizer = 63;
cfg_.rc_min_quantizer = 0;
tune_content_ = VP9E_CONTENT_SCREEN;
init_flags_ = VPX_CODEC_USE_PSNR;
ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
}
TEST_P(CpuSpeedTest, TestEncodeHighBitrate) {
// Validate that this non multiple of 64 wide clip encodes and decodes
// without a mismatch when passing in a very low max q. This pushes
// the encoder to producing lots of big partitions which will likely
// extend into the border and test the border condition.
cfg_.rc_2pass_vbr_minsection_pct = 5;
cfg_.rc_2pass_vbr_minsection_pct = 2000;
cfg_.rc_2pass_vbr_maxsection_pct = 2000;
cfg_.rc_target_bitrate = 12000;
cfg_.rc_max_quantizer = 10;
cfg_.rc_min_quantizer = 0;
@ -125,7 +138,7 @@ TEST_P(CpuSpeedTest, TestLowBitrate) {
// when passing in a very high min q. This pushes the encoder to producing
// lots of small partitions which might will test the other condition.
cfg_.rc_2pass_vbr_minsection_pct = 5;
cfg_.rc_2pass_vbr_minsection_pct = 2000;
cfg_.rc_2pass_vbr_maxsection_pct = 2000;
cfg_.rc_target_bitrate = 200;
cfg_.rc_min_quantizer = 40;
@ -135,9 +148,9 @@ TEST_P(CpuSpeedTest, TestLowBitrate) {
ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
}
VP9_INSTANTIATE_TEST_CASE(
CpuSpeedTest,
::testing::Values(::libvpx_test::kTwoPassGood, ::libvpx_test::kOnePassGood,
::libvpx_test::kRealTime),
::testing::Range(0, 9));
VP9_INSTANTIATE_TEST_CASE(CpuSpeedTest,
::testing::Values(::libvpx_test::kTwoPassGood,
::libvpx_test::kOnePassGood,
::libvpx_test::kRealTime),
::testing::Range(0, 9));
} // namespace

View File

@ -24,14 +24,12 @@ const int kCQLevelStep = 8;
const unsigned int kCQTargetBitrate = 2000;
class CQTest : public ::libvpx_test::EncoderTest,
public ::libvpx_test::CodecTestWithParam<int> {
public ::libvpx_test::CodecTestWithParam<int> {
public:
// maps the cqlevel to the bitrate produced.
typedef std::map<int, uint32_t> BitrateMap;
static void SetUpTestCase() {
bitrates_.clear();
}
static void SetUpTestCase() { bitrates_.clear(); }
static void TearDownTestCase() {
ASSERT_TRUE(!HasFailure())
@ -128,7 +126,6 @@ TEST_P(CQTest, LinearPSNRIsHigherForCQLevel) {
EXPECT_GE(cq_psnr_lin, vbr_psnr_lin);
}
VP8_INSTANTIATE_TEST_CASE(CQTest,
::testing::Range(kCQLevelMin, kCQLevelMax,
kCQLevelStep));
VP8_INSTANTIATE_TEST_CASE(CQTest, ::testing::Range(kCQLevelMin, kCQLevelMax,
kCQLevelStep));
} // namespace

View File

@ -1,6 +1,6 @@
#!/bin/sh
##
## Copyright (c) 2014 The WebM project authors. All Rights Reserved.
## Copyright (c) 2016 The WebM project authors. All Rights Reserved.
##
## Use of this source code is governed by a BSD-style license
## that can be found in the LICENSE file in the root of the source
@ -8,30 +8,27 @@
## in the file PATENTS. All contributing project authors may
## be found in the AUTHORS file in the root of the source tree.
##
## This file tests the libvpx vp8cx_set_ref example. To add new tests to this
## This file tests the libvpx cx_set_ref example. To add new tests to this
## file, do the following:
## 1. Write a shell function (this is your test).
## 2. Add the function to vp8cx_set_ref_tests (on a new line).
## 2. Add the function to cx_set_ref_tests (on a new line).
##
. $(dirname $0)/tools_common.sh
# Environment check: $YUV_RAW_INPUT is required.
vp8cx_set_ref_verify_environment() {
cx_set_ref_verify_environment() {
if [ ! -e "${YUV_RAW_INPUT}" ]; then
echo "Libvpx test data must exist in LIBVPX_TEST_DATA_PATH."
return 1
fi
}
# Runs vp8cx_set_ref and updates the reference frame before encoding frame 90.
# $1 is the codec name, which vp8cx_set_ref does not support at present: It's
# currently used only to name the output file.
# TODO(tomfinegan): Pass the codec param once the example is updated to support
# VP9.
# Runs cx_set_ref and updates the reference frame before encoding frame 90.
# $1 is the codec name.
vpx_set_ref() {
local encoder="${LIBVPX_BIN_PATH}/vp8cx_set_ref${VPX_TEST_EXE_SUFFIX}"
local codec="$1"
local output_file="${VPX_TEST_OUTPUT_DIR}/vp8cx_set_ref_${codec}.ivf"
local encoder="${LIBVPX_BIN_PATH}/${codec}cx_set_ref${VPX_TEST_EXE_SUFFIX}"
local output_file="${VPX_TEST_OUTPUT_DIR}/${codec}cx_set_ref_${codec}.ivf"
local ref_frame_num=90
if [ ! -x "${encoder}" ]; then
@ -46,12 +43,18 @@ vpx_set_ref() {
[ -e "${output_file}" ] || return 1
}
vp8cx_set_ref_vp8() {
cx_set_ref_vp8() {
if [ "$(vp8_encode_available)" = "yes" ]; then
vpx_set_ref vp8 || return 1
fi
}
vp8cx_set_ref_tests="vp8cx_set_ref_vp8"
cx_set_ref_vp9() {
if [ "$(vp9_encode_available)" = "yes" ]; then
vpx_set_ref vp9 || return 1
fi
}
run_tests vp8cx_set_ref_verify_environment "${vp8cx_set_ref_tests}"
cx_set_ref_tests="cx_set_ref_vp8 cx_set_ref_vp9"
run_tests cx_set_ref_verify_environment "${cx_set_ref_tests}"

View File

@ -1,745 +0,0 @@
/*
* Copyright (c) 2012 The WebM project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#include "./vpx_config.h"
#include "third_party/googletest/src/include/gtest/gtest.h"
#include "test/codec_factory.h"
#include "test/encode_test_driver.h"
#include "test/i420_video_source.h"
#include "test/util.h"
#include "test/y4m_video_source.h"
namespace {
class DatarateTestLarge : public ::libvpx_test::EncoderTest,
public ::libvpx_test::CodecTestWithParam<libvpx_test::TestMode> {
public:
DatarateTestLarge() : EncoderTest(GET_PARAM(0)) {}
virtual ~DatarateTestLarge() {}
protected:
virtual void SetUp() {
InitializeConfig();
SetMode(GET_PARAM(1));
ResetModel();
}
virtual void ResetModel() {
last_pts_ = 0;
bits_in_buffer_model_ = cfg_.rc_target_bitrate * cfg_.rc_buf_initial_sz;
frame_number_ = 0;
first_drop_ = 0;
bits_total_ = 0;
duration_ = 0.0;
denoiser_offon_test_ = 0;
denoiser_offon_period_ = -1;
}
virtual void PreEncodeFrameHook(::libvpx_test::VideoSource *video,
::libvpx_test::Encoder *encoder) {
if (video->frame() == 0)
encoder->Control(VP8E_SET_NOISE_SENSITIVITY, denoiser_on_);
if (denoiser_offon_test_) {
ASSERT_GT(denoiser_offon_period_, 0)
<< "denoiser_offon_period_ is not positive.";
if ((video->frame() + 1) % denoiser_offon_period_ == 0) {
// Flip denoiser_on_ periodically
denoiser_on_ ^= 1;
}
encoder->Control(VP8E_SET_NOISE_SENSITIVITY, denoiser_on_);
}
const vpx_rational_t tb = video->timebase();
timebase_ = static_cast<double>(tb.num) / tb.den;
duration_ = 0;
}
virtual void FramePktHook(const vpx_codec_cx_pkt_t *pkt) {
// Time since last timestamp = duration.
vpx_codec_pts_t duration = pkt->data.frame.pts - last_pts_;
// TODO(jimbankoski): Remove these lines when the issue:
// http://code.google.com/p/webm/issues/detail?id=496 is fixed.
// For now the codec assumes buffer starts at starting buffer rate
// plus one frame's time.
if (last_pts_ == 0)
duration = 1;
// Add to the buffer the bits we'd expect from a constant bitrate server.
bits_in_buffer_model_ += static_cast<int64_t>(
duration * timebase_ * cfg_.rc_target_bitrate * 1000);
/* Test the buffer model here before subtracting the frame. Do so because
* the way the leaky bucket model works in libvpx is to allow the buffer to
* empty - and then stop showing frames until we've got enough bits to
* show one. As noted in comment below (issue 495), this does not currently
* apply to key frames. For now exclude key frames in condition below. */
const bool key_frame = (pkt->data.frame.flags & VPX_FRAME_IS_KEY)
? true: false;
if (!key_frame) {
ASSERT_GE(bits_in_buffer_model_, 0) << "Buffer Underrun at frame "
<< pkt->data.frame.pts;
}
const size_t frame_size_in_bits = pkt->data.frame.sz * 8;
// Subtract from the buffer the bits associated with a played back frame.
bits_in_buffer_model_ -= frame_size_in_bits;
// Update the running total of bits for end of test datarate checks.
bits_total_ += frame_size_in_bits;
// If first drop not set and we have a drop set it to this time.
if (!first_drop_ && duration > 1)
first_drop_ = last_pts_ + 1;
// Update the most recent pts.
last_pts_ = pkt->data.frame.pts;
// We update this so that we can calculate the datarate minus the last
// frame encoded in the file.
bits_in_last_frame_ = frame_size_in_bits;
++frame_number_;
}
virtual void EndPassHook(void) {
if (bits_total_) {
const double file_size_in_kb = bits_total_ / 1000.; // bits per kilobit
duration_ = (last_pts_ + 1) * timebase_;
// Effective file datarate includes the time spent prebuffering.
effective_datarate_ = (bits_total_ - bits_in_last_frame_) / 1000.0
/ (cfg_.rc_buf_initial_sz / 1000.0 + duration_);
file_datarate_ = file_size_in_kb / duration_;
}
}
vpx_codec_pts_t last_pts_;
int64_t bits_in_buffer_model_;
double timebase_;
int frame_number_;
vpx_codec_pts_t first_drop_;
int64_t bits_total_;
double duration_;
double file_datarate_;
double effective_datarate_;
size_t bits_in_last_frame_;
int denoiser_on_;
int denoiser_offon_test_;
int denoiser_offon_period_;
};
#if CONFIG_TEMPORAL_DENOISING
// Check basic datarate targeting, for a single bitrate, but loop over the
// various denoiser settings.
TEST_P(DatarateTestLarge, DenoiserLevels) {
cfg_.rc_buf_initial_sz = 500;
cfg_.rc_dropframe_thresh = 1;
cfg_.rc_max_quantizer = 56;
cfg_.rc_end_usage = VPX_CBR;
::libvpx_test::I420VideoSource video("hantro_collage_w352h288.yuv", 352, 288,
30, 1, 0, 140);
for (int j = 1; j < 5; ++j) {
// Run over the denoiser levels.
// For the temporal denoiser (#if CONFIG_TEMPORAL_DENOISING) the level j
// refers to the 4 denoiser modes: denoiserYonly, denoiserOnYUV,
// denoiserOnAggressive, and denoiserOnAdaptive.
// For the spatial denoiser (if !CONFIG_TEMPORAL_DENOISING), the level j
// refers to the blur thresholds: 20, 40, 60 80.
// The j = 0 case (denoiser off) is covered in the tests below.
denoiser_on_ = j;
cfg_.rc_target_bitrate = 300;
ResetModel();
ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
ASSERT_GE(cfg_.rc_target_bitrate, effective_datarate_ * 0.95)
<< " The datarate for the file exceeds the target!";
ASSERT_LE(cfg_.rc_target_bitrate, file_datarate_ * 1.3)
<< " The datarate for the file missed the target!";
}
}
// Check basic datarate targeting, for a single bitrate, when denoiser is off
// and on.
TEST_P(DatarateTestLarge, DenoiserOffOn) {
cfg_.rc_buf_initial_sz = 500;
cfg_.rc_dropframe_thresh = 1;
cfg_.rc_max_quantizer = 56;
cfg_.rc_end_usage = VPX_CBR;
::libvpx_test::I420VideoSource video("hantro_collage_w352h288.yuv", 352, 288,
30, 1, 0, 299);
cfg_.rc_target_bitrate = 300;
ResetModel();
// The denoiser is off by default.
denoiser_on_ = 0;
// Set the offon test flag.
denoiser_offon_test_ = 1;
denoiser_offon_period_ = 100;
ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
ASSERT_GE(cfg_.rc_target_bitrate, effective_datarate_ * 0.95)
<< " The datarate for the file exceeds the target!";
ASSERT_LE(cfg_.rc_target_bitrate, file_datarate_ * 1.3)
<< " The datarate for the file missed the target!";
}
#endif // CONFIG_TEMPORAL_DENOISING
TEST_P(DatarateTestLarge, BasicBufferModel) {
denoiser_on_ = 0;
cfg_.rc_buf_initial_sz = 500;
cfg_.rc_dropframe_thresh = 1;
cfg_.rc_max_quantizer = 56;
cfg_.rc_end_usage = VPX_CBR;
// 2 pass cbr datarate control has a bug hidden by the small # of
// frames selected in this encode. The problem is that even if the buffer is
// negative we produce a keyframe on a cutscene. Ignoring datarate
// constraints
// TODO(jimbankoski): ( Fix when issue
// http://code.google.com/p/webm/issues/detail?id=495 is addressed. )
::libvpx_test::I420VideoSource video("hantro_collage_w352h288.yuv", 352, 288,
30, 1, 0, 140);
// There is an issue for low bitrates in real-time mode, where the
// effective_datarate slightly overshoots the target bitrate.
// This is same the issue as noted about (#495).
// TODO(jimbankoski/marpan): Update test to run for lower bitrates (< 100),
// when the issue is resolved.
for (int i = 100; i < 800; i += 200) {
cfg_.rc_target_bitrate = i;
ResetModel();
ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
ASSERT_GE(cfg_.rc_target_bitrate, effective_datarate_ * 0.95)
<< " The datarate for the file exceeds the target!";
ASSERT_LE(cfg_.rc_target_bitrate, file_datarate_ * 1.3)
<< " The datarate for the file missed the target!";
}
}
TEST_P(DatarateTestLarge, ChangingDropFrameThresh) {
denoiser_on_ = 0;
cfg_.rc_buf_initial_sz = 500;
cfg_.rc_max_quantizer = 36;
cfg_.rc_end_usage = VPX_CBR;
cfg_.rc_target_bitrate = 200;
cfg_.kf_mode = VPX_KF_DISABLED;
const int frame_count = 40;
::libvpx_test::I420VideoSource video("hantro_collage_w352h288.yuv", 352, 288,
30, 1, 0, frame_count);
// Here we check that the first dropped frame gets earlier and earlier
// as the drop frame threshold is increased.
const int kDropFrameThreshTestStep = 30;
vpx_codec_pts_t last_drop = frame_count;
for (int i = 1; i < 91; i += kDropFrameThreshTestStep) {
cfg_.rc_dropframe_thresh = i;
ResetModel();
ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
ASSERT_LE(first_drop_, last_drop)
<< " The first dropped frame for drop_thresh " << i
<< " > first dropped frame for drop_thresh "
<< i - kDropFrameThreshTestStep;
last_drop = first_drop_;
}
}
class DatarateTestVP9Large : public ::libvpx_test::EncoderTest,
public ::libvpx_test::CodecTestWith2Params<libvpx_test::TestMode, int> {
public:
DatarateTestVP9Large() : EncoderTest(GET_PARAM(0)) {}
protected:
virtual ~DatarateTestVP9Large() {}
virtual void SetUp() {
InitializeConfig();
SetMode(GET_PARAM(1));
set_cpu_used_ = GET_PARAM(2);
ResetModel();
}
virtual void ResetModel() {
last_pts_ = 0;
bits_in_buffer_model_ = cfg_.rc_target_bitrate * cfg_.rc_buf_initial_sz;
frame_number_ = 0;
tot_frame_number_ = 0;
first_drop_ = 0;
num_drops_ = 0;
// Denoiser is off by default.
denoiser_on_ = 0;
// For testing up to 3 layers.
for (int i = 0; i < 3; ++i) {
bits_total_[i] = 0;
}
denoiser_offon_test_ = 0;
denoiser_offon_period_ = -1;
}
//
// Frame flags and layer id for temporal layers.
//
// For two layers, test pattern is:
// 1 3
// 0 2 .....
// For three layers, test pattern is:
// 1 3 5 7
// 2 6
// 0 4 ....
// LAST is always update on base/layer 0, GOLDEN is updated on layer 1.
// For this 3 layer example, the 2nd enhancement layer (layer 2) does not
// update any reference frames.
int SetFrameFlags(int frame_num, int num_temp_layers) {
int frame_flags = 0;
if (num_temp_layers == 2) {
if (frame_num % 2 == 0) {
// Layer 0: predict from L and ARF, update L.
frame_flags = VP8_EFLAG_NO_REF_GF | VP8_EFLAG_NO_UPD_GF |
VP8_EFLAG_NO_UPD_ARF;
} else {
// Layer 1: predict from L, G and ARF, and update G.
frame_flags = VP8_EFLAG_NO_UPD_ARF | VP8_EFLAG_NO_UPD_LAST |
VP8_EFLAG_NO_UPD_ENTROPY;
}
} else if (num_temp_layers == 3) {
if (frame_num % 4 == 0) {
// Layer 0: predict from L and ARF; update L.
frame_flags = VP8_EFLAG_NO_UPD_GF | VP8_EFLAG_NO_UPD_ARF |
VP8_EFLAG_NO_REF_GF;
} else if ((frame_num - 2) % 4 == 0) {
// Layer 1: predict from L, G, ARF; update G.
frame_flags = VP8_EFLAG_NO_UPD_ARF | VP8_EFLAG_NO_UPD_LAST;
} else if ((frame_num - 1) % 2 == 0) {
// Layer 2: predict from L, G, ARF; update none.
frame_flags = VP8_EFLAG_NO_UPD_GF | VP8_EFLAG_NO_UPD_ARF |
VP8_EFLAG_NO_UPD_LAST;
}
}
return frame_flags;
}
int SetLayerId(int frame_num, int num_temp_layers) {
int layer_id = 0;
if (num_temp_layers == 2) {
if (frame_num % 2 == 0) {
layer_id = 0;
} else {
layer_id = 1;
}
} else if (num_temp_layers == 3) {
if (frame_num % 4 == 0) {
layer_id = 0;
} else if ((frame_num - 2) % 4 == 0) {
layer_id = 1;
} else if ((frame_num - 1) % 2 == 0) {
layer_id = 2;
}
}
return layer_id;
}
virtual void PreEncodeFrameHook(::libvpx_test::VideoSource *video,
::libvpx_test::Encoder *encoder) {
if (video->frame() == 0)
encoder->Control(VP8E_SET_CPUUSED, set_cpu_used_);
if (denoiser_offon_test_) {
ASSERT_GT(denoiser_offon_period_, 0)
<< "denoiser_offon_period_ is not positive.";
if ((video->frame() + 1) % denoiser_offon_period_ == 0) {
// Flip denoiser_on_ periodically
denoiser_on_ ^= 1;
}
}
encoder->Control(VP9E_SET_NOISE_SENSITIVITY, denoiser_on_);
if (cfg_.ts_number_layers > 1) {
if (video->frame() == 0) {
encoder->Control(VP9E_SET_SVC, 1);
}
vpx_svc_layer_id_t layer_id;
#if VPX_ENCODER_ABI_VERSION > (4 + VPX_CODEC_ABI_VERSION)
layer_id.spatial_layer_id = 0;
#endif
frame_flags_ = SetFrameFlags(video->frame(), cfg_.ts_number_layers);
layer_id.temporal_layer_id = SetLayerId(video->frame(),
cfg_.ts_number_layers);
encoder->Control(VP9E_SET_SVC_LAYER_ID, &layer_id);
}
const vpx_rational_t tb = video->timebase();
timebase_ = static_cast<double>(tb.num) / tb.den;
duration_ = 0;
}
virtual void FramePktHook(const vpx_codec_cx_pkt_t *pkt) {
// Time since last timestamp = duration.
vpx_codec_pts_t duration = pkt->data.frame.pts - last_pts_;
if (duration > 1) {
// If first drop not set and we have a drop set it to this time.
if (!first_drop_)
first_drop_ = last_pts_ + 1;
// Update the number of frame drops.
num_drops_ += static_cast<int>(duration - 1);
// Update counter for total number of frames (#frames input to encoder).
// Needed for setting the proper layer_id below.
tot_frame_number_ += static_cast<int>(duration - 1);
}
int layer = SetLayerId(tot_frame_number_, cfg_.ts_number_layers);
// Add to the buffer the bits we'd expect from a constant bitrate server.
bits_in_buffer_model_ += static_cast<int64_t>(
duration * timebase_ * cfg_.rc_target_bitrate * 1000);
// Buffer should not go negative.
ASSERT_GE(bits_in_buffer_model_, 0) << "Buffer Underrun at frame "
<< pkt->data.frame.pts;
const size_t frame_size_in_bits = pkt->data.frame.sz * 8;
// Update the total encoded bits. For temporal layers, update the cumulative
// encoded bits per layer.
for (int i = layer; i < static_cast<int>(cfg_.ts_number_layers); ++i) {
bits_total_[i] += frame_size_in_bits;
}
// Update the most recent pts.
last_pts_ = pkt->data.frame.pts;
++frame_number_;
++tot_frame_number_;
}
virtual void EndPassHook(void) {
for (int layer = 0; layer < static_cast<int>(cfg_.ts_number_layers);
++layer) {
duration_ = (last_pts_ + 1) * timebase_;
if (bits_total_[layer]) {
// Effective file datarate:
effective_datarate_[layer] = (bits_total_[layer] / 1000.0) / duration_;
}
}
}
vpx_codec_pts_t last_pts_;
double timebase_;
int frame_number_; // Counter for number of non-dropped/encoded frames.
int tot_frame_number_; // Counter for total number of input frames.
int64_t bits_total_[3];
double duration_;
double effective_datarate_[3];
int set_cpu_used_;
int64_t bits_in_buffer_model_;
vpx_codec_pts_t first_drop_;
int num_drops_;
int denoiser_on_;
int denoiser_offon_test_;
int denoiser_offon_period_;
};
// Check basic rate targeting,
TEST_P(DatarateTestVP9Large, BasicRateTargeting) {
cfg_.rc_buf_initial_sz = 500;
cfg_.rc_buf_optimal_sz = 500;
cfg_.rc_buf_sz = 1000;
cfg_.rc_dropframe_thresh = 1;
cfg_.rc_min_quantizer = 0;
cfg_.rc_max_quantizer = 63;
cfg_.rc_end_usage = VPX_CBR;
cfg_.g_lag_in_frames = 0;
::libvpx_test::I420VideoSource video("hantro_collage_w352h288.yuv", 352, 288,
30, 1, 0, 140);
for (int i = 150; i < 800; i += 200) {
cfg_.rc_target_bitrate = i;
ResetModel();
ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
ASSERT_GE(effective_datarate_[0], cfg_.rc_target_bitrate * 0.85)
<< " The datarate for the file is lower than target by too much!";
ASSERT_LE(effective_datarate_[0], cfg_.rc_target_bitrate * 1.15)
<< " The datarate for the file is greater than target by too much!";
}
}
// Check basic rate targeting,
TEST_P(DatarateTestVP9Large, BasicRateTargeting444) {
::libvpx_test::Y4mVideoSource video("rush_hour_444.y4m", 0, 140);
cfg_.g_profile = 1;
cfg_.g_timebase = video.timebase();
cfg_.rc_buf_initial_sz = 500;
cfg_.rc_buf_optimal_sz = 500;
cfg_.rc_buf_sz = 1000;
cfg_.rc_dropframe_thresh = 1;
cfg_.rc_min_quantizer = 0;
cfg_.rc_max_quantizer = 63;
cfg_.rc_end_usage = VPX_CBR;
for (int i = 250; i < 900; i += 200) {
cfg_.rc_target_bitrate = i;
ResetModel();
ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
ASSERT_GE(static_cast<double>(cfg_.rc_target_bitrate),
effective_datarate_[0] * 0.85)
<< " The datarate for the file exceeds the target by too much!";
ASSERT_LE(static_cast<double>(cfg_.rc_target_bitrate),
effective_datarate_[0] * 1.15)
<< " The datarate for the file missed the target!"
<< cfg_.rc_target_bitrate << " "<< effective_datarate_;
}
}
// Check that (1) the first dropped frame gets earlier and earlier
// as the drop frame threshold is increased, and (2) that the total number of
// frame drops does not decrease as we increase frame drop threshold.
// Use a lower qp-max to force some frame drops.
TEST_P(DatarateTestVP9Large, ChangingDropFrameThresh) {
cfg_.rc_buf_initial_sz = 500;
cfg_.rc_buf_optimal_sz = 500;
cfg_.rc_buf_sz = 1000;
cfg_.rc_undershoot_pct = 20;
cfg_.rc_undershoot_pct = 20;
cfg_.rc_dropframe_thresh = 10;
cfg_.rc_min_quantizer = 0;
cfg_.rc_max_quantizer = 50;
cfg_.rc_end_usage = VPX_CBR;
cfg_.rc_target_bitrate = 200;
cfg_.g_lag_in_frames = 0;
::libvpx_test::I420VideoSource video("hantro_collage_w352h288.yuv", 352, 288,
30, 1, 0, 140);
const int kDropFrameThreshTestStep = 30;
vpx_codec_pts_t last_drop = 140;
int last_num_drops = 0;
for (int i = 10; i < 100; i += kDropFrameThreshTestStep) {
cfg_.rc_dropframe_thresh = i;
ResetModel();
ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
ASSERT_GE(effective_datarate_[0], cfg_.rc_target_bitrate * 0.85)
<< " The datarate for the file is lower than target by too much!";
ASSERT_LE(effective_datarate_[0], cfg_.rc_target_bitrate * 1.15)
<< " The datarate for the file is greater than target by too much!";
ASSERT_LE(first_drop_, last_drop)
<< " The first dropped frame for drop_thresh " << i
<< " > first dropped frame for drop_thresh "
<< i - kDropFrameThreshTestStep;
ASSERT_GE(num_drops_, last_num_drops * 0.90)
<< " The number of dropped frames for drop_thresh " << i
<< " < number of dropped frames for drop_thresh "
<< i - kDropFrameThreshTestStep;
last_drop = first_drop_;
last_num_drops = num_drops_;
}
}
// Check basic rate targeting for 2 temporal layers.
TEST_P(DatarateTestVP9Large, BasicRateTargeting2TemporalLayers) {
cfg_.rc_buf_initial_sz = 500;
cfg_.rc_buf_optimal_sz = 500;
cfg_.rc_buf_sz = 1000;
cfg_.rc_dropframe_thresh = 1;
cfg_.rc_min_quantizer = 0;
cfg_.rc_max_quantizer = 63;
cfg_.rc_end_usage = VPX_CBR;
cfg_.g_lag_in_frames = 0;
// 2 Temporal layers, no spatial layers: Framerate decimation (2, 1).
cfg_.ss_number_layers = 1;
cfg_.ts_number_layers = 2;
cfg_.ts_rate_decimator[0] = 2;
cfg_.ts_rate_decimator[1] = 1;
if (deadline_ == VPX_DL_REALTIME)
cfg_.g_error_resilient = 1;
::libvpx_test::I420VideoSource video("hantro_collage_w352h288.yuv", 352, 288,
30, 1, 0, 200);
for (int i = 200; i <= 800; i += 200) {
cfg_.rc_target_bitrate = i;
ResetModel();
// 60-40 bitrate allocation for 2 temporal layers.
cfg_.ts_target_bitrate[0] = 60 * cfg_.rc_target_bitrate / 100;
cfg_.ts_target_bitrate[1] = cfg_.rc_target_bitrate;
ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
for (int j = 0; j < static_cast<int>(cfg_.ts_number_layers); ++j) {
ASSERT_GE(effective_datarate_[j], cfg_.ts_target_bitrate[j] * 0.85)
<< " The datarate for the file is lower than target by too much, "
"for layer: " << j;
ASSERT_LE(effective_datarate_[j], cfg_.ts_target_bitrate[j] * 1.15)
<< " The datarate for the file is greater than target by too much, "
"for layer: " << j;
}
}
}
// Check basic rate targeting for 3 temporal layers.
TEST_P(DatarateTestVP9Large, BasicRateTargeting3TemporalLayers) {
cfg_.rc_buf_initial_sz = 500;
cfg_.rc_buf_optimal_sz = 500;
cfg_.rc_buf_sz = 1000;
cfg_.rc_dropframe_thresh = 1;
cfg_.rc_min_quantizer = 0;
cfg_.rc_max_quantizer = 63;
cfg_.rc_end_usage = VPX_CBR;
cfg_.g_lag_in_frames = 0;
// 3 Temporal layers, no spatial layers: Framerate decimation (4, 2, 1).
cfg_.ss_number_layers = 1;
cfg_.ts_number_layers = 3;
cfg_.ts_rate_decimator[0] = 4;
cfg_.ts_rate_decimator[1] = 2;
cfg_.ts_rate_decimator[2] = 1;
::libvpx_test::I420VideoSource video("hantro_collage_w352h288.yuv", 352, 288,
30, 1, 0, 200);
for (int i = 200; i <= 800; i += 200) {
cfg_.rc_target_bitrate = i;
ResetModel();
// 40-20-40 bitrate allocation for 3 temporal layers.
cfg_.ts_target_bitrate[0] = 40 * cfg_.rc_target_bitrate / 100;
cfg_.ts_target_bitrate[1] = 60 * cfg_.rc_target_bitrate / 100;
cfg_.ts_target_bitrate[2] = cfg_.rc_target_bitrate;
ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
for (int j = 0; j < static_cast<int>(cfg_.ts_number_layers); ++j) {
// TODO(yaowu): Work out more stable rc control strategy and
// Adjust the thresholds to be tighter than .75.
ASSERT_GE(effective_datarate_[j], cfg_.ts_target_bitrate[j] * 0.75)
<< " The datarate for the file is lower than target by too much, "
"for layer: " << j;
// TODO(yaowu): Work out more stable rc control strategy and
// Adjust the thresholds to be tighter than 1.25.
ASSERT_LE(effective_datarate_[j], cfg_.ts_target_bitrate[j] * 1.25)
<< " The datarate for the file is greater than target by too much, "
"for layer: " << j;
}
}
}
// Check basic rate targeting for 3 temporal layers, with frame dropping.
// Only for one (low) bitrate with lower max_quantizer, and somewhat higher
// frame drop threshold, to force frame dropping.
TEST_P(DatarateTestVP9Large, BasicRateTargeting3TemporalLayersFrameDropping) {
cfg_.rc_buf_initial_sz = 500;
cfg_.rc_buf_optimal_sz = 500;
cfg_.rc_buf_sz = 1000;
// Set frame drop threshold and rc_max_quantizer to force some frame drops.
cfg_.rc_dropframe_thresh = 20;
cfg_.rc_max_quantizer = 45;
cfg_.rc_min_quantizer = 0;
cfg_.rc_end_usage = VPX_CBR;
cfg_.g_lag_in_frames = 0;
// 3 Temporal layers, no spatial layers: Framerate decimation (4, 2, 1).
cfg_.ss_number_layers = 1;
cfg_.ts_number_layers = 3;
cfg_.ts_rate_decimator[0] = 4;
cfg_.ts_rate_decimator[1] = 2;
cfg_.ts_rate_decimator[2] = 1;
::libvpx_test::I420VideoSource video("hantro_collage_w352h288.yuv", 352, 288,
30, 1, 0, 200);
cfg_.rc_target_bitrate = 200;
ResetModel();
// 40-20-40 bitrate allocation for 3 temporal layers.
cfg_.ts_target_bitrate[0] = 40 * cfg_.rc_target_bitrate / 100;
cfg_.ts_target_bitrate[1] = 60 * cfg_.rc_target_bitrate / 100;
cfg_.ts_target_bitrate[2] = cfg_.rc_target_bitrate;
ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
for (int j = 0; j < static_cast<int>(cfg_.ts_number_layers); ++j) {
ASSERT_GE(effective_datarate_[j], cfg_.ts_target_bitrate[j] * 0.85)
<< " The datarate for the file is lower than target by too much, "
"for layer: " << j;
ASSERT_LE(effective_datarate_[j], cfg_.ts_target_bitrate[j] * 1.15)
<< " The datarate for the file is greater than target by too much, "
"for layer: " << j;
// Expect some frame drops in this test: for this 200 frames test,
// expect at least 10% and not more than 60% drops.
ASSERT_GE(num_drops_, 20);
ASSERT_LE(num_drops_, 130);
}
}
#if CONFIG_VP9_TEMPORAL_DENOISING
// Check basic datarate targeting, for a single bitrate, when denoiser is on.
TEST_P(DatarateTestVP9Large, DenoiserLevels) {
cfg_.rc_buf_initial_sz = 500;
cfg_.rc_buf_optimal_sz = 500;
cfg_.rc_buf_sz = 1000;
cfg_.rc_dropframe_thresh = 1;
cfg_.rc_min_quantizer = 2;
cfg_.rc_max_quantizer = 56;
cfg_.rc_end_usage = VPX_CBR;
cfg_.g_lag_in_frames = 0;
::libvpx_test::I420VideoSource video("hantro_collage_w352h288.yuv", 352, 288,
30, 1, 0, 140);
// For the temporal denoiser (#if CONFIG_VP9_TEMPORAL_DENOISING),
// there is only one denoiser mode: denoiserYonly(which is 1),
// but may add more modes in the future.
cfg_.rc_target_bitrate = 300;
ResetModel();
// Turn on the denoiser.
denoiser_on_ = 1;
ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
ASSERT_GE(effective_datarate_[0], cfg_.rc_target_bitrate * 0.85)
<< " The datarate for the file is lower than target by too much!";
ASSERT_LE(effective_datarate_[0], cfg_.rc_target_bitrate * 1.15)
<< " The datarate for the file is greater than target by too much!";
}
// Check basic datarate targeting, for a single bitrate, when denoiser is off
// and on.
TEST_P(DatarateTestVP9Large, DenoiserOffOn) {
cfg_.rc_buf_initial_sz = 500;
cfg_.rc_buf_optimal_sz = 500;
cfg_.rc_buf_sz = 1000;
cfg_.rc_dropframe_thresh = 1;
cfg_.rc_min_quantizer = 2;
cfg_.rc_max_quantizer = 56;
cfg_.rc_end_usage = VPX_CBR;
cfg_.g_lag_in_frames = 0;
::libvpx_test::I420VideoSource video("hantro_collage_w352h288.yuv", 352, 288,
30, 1, 0, 299);
// For the temporal denoiser (#if CONFIG_VP9_TEMPORAL_DENOISING),
// there is only one denoiser mode: denoiserYonly(which is 1),
// but may add more modes in the future.
cfg_.rc_target_bitrate = 300;
ResetModel();
// The denoiser is off by default.
denoiser_on_ = 0;
// Set the offon test flag.
denoiser_offon_test_ = 1;
denoiser_offon_period_ = 100;
ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
ASSERT_GE(effective_datarate_[0], cfg_.rc_target_bitrate * 0.85)
<< " The datarate for the file is lower than target by too much!";
ASSERT_LE(effective_datarate_[0], cfg_.rc_target_bitrate * 1.15)
<< " The datarate for the file is greater than target by too much!";
}
#endif // CONFIG_VP9_TEMPORAL_DENOISING
VP8_INSTANTIATE_TEST_CASE(DatarateTestLarge, ALL_TEST_MODES);
VP9_INSTANTIATE_TEST_CASE(DatarateTestVP9Large,
::testing::Values(::libvpx_test::kOnePassGood,
::libvpx_test::kRealTime),
::testing::Range(2, 7));
} // namespace

View File

@ -13,54 +13,25 @@
#include <string.h>
#include "third_party/googletest/src/include/gtest/gtest.h"
#include "./vp9_rtcd.h"
#include "./vpx_dsp_rtcd.h"
#include "test/acm_random.h"
#include "test/clear_system_state.h"
#include "test/register_state_check.h"
#include "test/util.h"
#include "./vp9_rtcd.h"
#include "vp9/common/vp9_entropy.h"
#include "vp9/common/vp9_scan.h"
#include "vpx/vpx_codec.h"
#include "vpx/vpx_integer.h"
#include "vpx_ports/mem.h"
#include "vpx_ports/msvc.h" // for round()
using libvpx_test::ACMRandom;
namespace {
#ifdef _MSC_VER
static int round(double x) {
if (x < 0)
return static_cast<int>(ceil(x - 0.5));
else
return static_cast<int>(floor(x + 0.5));
}
#endif
const int kNumCoeffs = 256;
const double PI = 3.1415926535898;
void reference2_16x16_idct_2d(double *input, double *output) {
double x;
for (int l = 0; l < 16; ++l) {
for (int k = 0; k < 16; ++k) {
double s = 0;
for (int i = 0; i < 16; ++i) {
for (int j = 0; j < 16; ++j) {
x = cos(PI * j * (l + 0.5) / 16.0) *
cos(PI * i * (k + 0.5) / 16.0) *
input[i * 16 + j] / 256;
if (i != 0)
x *= sqrt(2.0);
if (j != 0)
x *= sqrt(2.0);
s += x;
}
}
output[k*16+l] = s;
}
}
}
const double C1 = 0.995184726672197;
const double C2 = 0.98078528040323;
const double C3 = 0.956940335732209;
@ -83,16 +54,16 @@ void butterfly_16x16_dct_1d(double input[16], double output[16]) {
double temp1, temp2;
// step 1
step[ 0] = input[0] + input[15];
step[ 1] = input[1] + input[14];
step[ 2] = input[2] + input[13];
step[ 3] = input[3] + input[12];
step[ 4] = input[4] + input[11];
step[ 5] = input[5] + input[10];
step[ 6] = input[6] + input[ 9];
step[ 7] = input[7] + input[ 8];
step[ 8] = input[7] - input[ 8];
step[ 9] = input[6] - input[ 9];
step[0] = input[0] + input[15];
step[1] = input[1] + input[14];
step[2] = input[2] + input[13];
step[3] = input[3] + input[12];
step[4] = input[4] + input[11];
step[5] = input[5] + input[10];
step[6] = input[6] + input[9];
step[7] = input[7] + input[8];
step[8] = input[7] - input[8];
step[9] = input[6] - input[9];
step[10] = input[5] - input[10];
step[11] = input[4] - input[11];
step[12] = input[3] - input[12];
@ -110,13 +81,13 @@ void butterfly_16x16_dct_1d(double input[16], double output[16]) {
output[6] = step[1] - step[6];
output[7] = step[0] - step[7];
temp1 = step[ 8] * C7;
temp1 = step[8] * C7;
temp2 = step[15] * C9;
output[ 8] = temp1 + temp2;
output[8] = temp1 + temp2;
temp1 = step[ 9] * C11;
temp1 = step[9] * C11;
temp2 = step[14] * C5;
output[ 9] = temp1 - temp2;
output[9] = temp1 - temp2;
temp1 = step[10] * C3;
temp2 = step[13] * C13;
@ -134,40 +105,40 @@ void butterfly_16x16_dct_1d(double input[16], double output[16]) {
temp2 = step[13] * C3;
output[13] = temp2 - temp1;
temp1 = step[ 9] * C5;
temp1 = step[9] * C5;
temp2 = step[14] * C11;
output[14] = temp2 + temp1;
temp1 = step[ 8] * C9;
temp1 = step[8] * C9;
temp2 = step[15] * C7;
output[15] = temp2 - temp1;
// step 3
step[ 0] = output[0] + output[3];
step[ 1] = output[1] + output[2];
step[ 2] = output[1] - output[2];
step[ 3] = output[0] - output[3];
step[0] = output[0] + output[3];
step[1] = output[1] + output[2];
step[2] = output[1] - output[2];
step[3] = output[0] - output[3];
temp1 = output[4] * C14;
temp2 = output[7] * C2;
step[ 4] = temp1 + temp2;
step[4] = temp1 + temp2;
temp1 = output[5] * C10;
temp2 = output[6] * C6;
step[ 5] = temp1 + temp2;
step[5] = temp1 + temp2;
temp1 = output[5] * C6;
temp2 = output[6] * C10;
step[ 6] = temp2 - temp1;
step[6] = temp2 - temp1;
temp1 = output[4] * C2;
temp2 = output[7] * C14;
step[ 7] = temp2 - temp1;
step[7] = temp2 - temp1;
step[ 8] = output[ 8] + output[11];
step[ 9] = output[ 9] + output[10];
step[10] = output[ 9] - output[10];
step[11] = output[ 8] - output[11];
step[8] = output[8] + output[11];
step[9] = output[9] + output[10];
step[10] = output[9] - output[10];
step[11] = output[8] - output[11];
step[12] = output[12] + output[15];
step[13] = output[13] + output[14];
@ -175,25 +146,25 @@ void butterfly_16x16_dct_1d(double input[16], double output[16]) {
step[15] = output[12] - output[15];
// step 4
output[ 0] = (step[ 0] + step[ 1]);
output[ 8] = (step[ 0] - step[ 1]);
output[0] = (step[0] + step[1]);
output[8] = (step[0] - step[1]);
temp1 = step[2] * C12;
temp2 = step[3] * C4;
temp1 = temp1 + temp2;
output[ 4] = 2*(temp1 * C8);
output[4] = 2 * (temp1 * C8);
temp1 = step[2] * C4;
temp2 = step[3] * C12;
temp1 = temp2 - temp1;
output[12] = 2 * (temp1 * C8);
output[ 2] = 2 * ((step[4] + step[ 5]) * C8);
output[14] = 2 * ((step[7] - step[ 6]) * C8);
output[2] = 2 * ((step[4] + step[5]) * C8);
output[14] = 2 * ((step[7] - step[6]) * C8);
temp1 = step[4] - step[5];
temp2 = step[6] + step[7];
output[ 6] = (temp1 + temp2);
output[6] = (temp1 + temp2);
output[10] = (temp1 - temp2);
intermediate[8] = step[8] + step[14];
@ -209,18 +180,18 @@ void butterfly_16x16_dct_1d(double input[16], double output[16]) {
temp1 = temp2 + temp1;
output[13] = 2 * (temp1 * C8);
output[ 9] = 2 * ((step[10] + step[11]) * C8);
output[9] = 2 * ((step[10] + step[11]) * C8);
intermediate[11] = step[10] - step[11];
intermediate[12] = step[12] + step[13];
intermediate[13] = step[12] - step[13];
intermediate[14] = step[ 8] - step[14];
intermediate[15] = step[ 9] - step[15];
intermediate[14] = step[8] - step[14];
intermediate[15] = step[9] - step[15];
output[15] = (intermediate[11] + intermediate[12]);
output[ 1] = -(intermediate[11] - intermediate[12]);
output[1] = -(intermediate[11] - intermediate[12]);
output[ 7] = 2 * (intermediate[13] * C8);
output[7] = 2 * (intermediate[13] * C8);
temp1 = intermediate[14] * C12;
temp2 = intermediate[15] * C4;
@ -230,28 +201,24 @@ void butterfly_16x16_dct_1d(double input[16], double output[16]) {
temp1 = intermediate[14] * C4;
temp2 = intermediate[15] * C12;
temp1 = temp2 + temp1;
output[ 5] = 2 * (temp1 * C8);
output[5] = 2 * (temp1 * C8);
}
void reference_16x16_dct_2d(int16_t input[256], double output[256]) {
// First transform columns
for (int i = 0; i < 16; ++i) {
double temp_in[16], temp_out[16];
for (int j = 0; j < 16; ++j)
temp_in[j] = input[j * 16 + i];
for (int j = 0; j < 16; ++j) temp_in[j] = input[j * 16 + i];
butterfly_16x16_dct_1d(temp_in, temp_out);
for (int j = 0; j < 16; ++j)
output[j * 16 + i] = temp_out[j];
for (int j = 0; j < 16; ++j) output[j * 16 + i] = temp_out[j];
}
// Then transform rows
for (int i = 0; i < 16; ++i) {
double temp_in[16], temp_out[16];
for (int j = 0; j < 16; ++j)
temp_in[j] = output[j + i * 16];
for (int j = 0; j < 16; ++j) temp_in[j] = output[j + i * 16];
butterfly_16x16_dct_1d(temp_in, temp_out);
// Scale by some magic number
for (int j = 0; j < 16; ++j)
output[j + i * 16] = temp_out[j]/2;
for (int j = 0; j < 16; ++j) output[j + i * 16] = temp_out[j] / 2;
}
}
@ -262,23 +229,23 @@ typedef void (*FhtFunc)(const int16_t *in, tran_low_t *out, int stride,
typedef void (*IhtFunc)(const tran_low_t *in, uint8_t *out, int stride,
int tx_type);
typedef std::tr1::tuple<FdctFunc, IdctFunc, int, vpx_bit_depth_t> Dct16x16Param;
typedef std::tr1::tuple<FhtFunc, IhtFunc, int, vpx_bit_depth_t> Ht16x16Param;
typedef std::tr1::tuple<IdctFunc, IdctFunc, int, vpx_bit_depth_t>
typedef ::testing::tuple<FdctFunc, IdctFunc, int, vpx_bit_depth_t>
Dct16x16Param;
typedef ::testing::tuple<FhtFunc, IhtFunc, int, vpx_bit_depth_t> Ht16x16Param;
typedef ::testing::tuple<IdctFunc, IdctFunc, int, vpx_bit_depth_t>
Idct16x16Param;
void fdct16x16_ref(const int16_t *in, tran_low_t *out, int stride,
int /*tx_type*/) {
vp9_fdct16x16_c(in, out, stride);
vpx_fdct16x16_c(in, out, stride);
}
void idct16x16_ref(const tran_low_t *in, uint8_t *dest, int stride,
int /*tx_type*/) {
vp9_idct16x16_256_add_c(in, dest, stride);
vpx_idct16x16_256_add_c(in, dest, stride);
}
void fht16x16_ref(const int16_t *in, tran_low_t *out, int stride,
int tx_type) {
void fht16x16_ref(const int16_t *in, tran_low_t *out, int stride, int tx_type) {
vp9_fht16x16_c(in, out, stride, tx_type);
}
@ -289,54 +256,54 @@ void iht16x16_ref(const tran_low_t *in, uint8_t *dest, int stride,
#if CONFIG_VP9_HIGHBITDEPTH
void idct16x16_10(const tran_low_t *in, uint8_t *out, int stride) {
vp9_highbd_idct16x16_256_add_c(in, out, stride, 10);
vpx_highbd_idct16x16_256_add_c(in, CAST_TO_SHORTPTR(out), stride, 10);
}
void idct16x16_12(const tran_low_t *in, uint8_t *out, int stride) {
vp9_highbd_idct16x16_256_add_c(in, out, stride, 12);
vpx_highbd_idct16x16_256_add_c(in, CAST_TO_SHORTPTR(out), stride, 12);
}
void idct16x16_10_ref(const tran_low_t *in, uint8_t *out, int stride,
int tx_type) {
int /*tx_type*/) {
idct16x16_10(in, out, stride);
}
void idct16x16_12_ref(const tran_low_t *in, uint8_t *out, int stride,
int tx_type) {
int /*tx_type*/) {
idct16x16_12(in, out, stride);
}
void iht16x16_10(const tran_low_t *in, uint8_t *out, int stride, int tx_type) {
vp9_highbd_iht16x16_256_add_c(in, out, stride, tx_type, 10);
vp9_highbd_iht16x16_256_add_c(in, CAST_TO_SHORTPTR(out), stride, tx_type, 10);
}
void iht16x16_12(const tran_low_t *in, uint8_t *out, int stride, int tx_type) {
vp9_highbd_iht16x16_256_add_c(in, out, stride, tx_type, 12);
}
void idct16x16_10_add_10_c(const tran_low_t *in, uint8_t *out, int stride) {
vp9_highbd_idct16x16_10_add_c(in, out, stride, 10);
}
void idct16x16_10_add_12_c(const tran_low_t *in, uint8_t *out, int stride) {
vp9_highbd_idct16x16_10_add_c(in, out, stride, 12);
vp9_highbd_iht16x16_256_add_c(in, CAST_TO_SHORTPTR(out), stride, tx_type, 12);
}
#if HAVE_SSE2
void idct16x16_10_add_10_c(const tran_low_t *in, uint8_t *out, int stride) {
vpx_highbd_idct16x16_10_add_c(in, CAST_TO_SHORTPTR(out), stride, 10);
}
void idct16x16_10_add_12_c(const tran_low_t *in, uint8_t *out, int stride) {
vpx_highbd_idct16x16_10_add_c(in, CAST_TO_SHORTPTR(out), stride, 12);
}
void idct16x16_256_add_10_sse2(const tran_low_t *in, uint8_t *out, int stride) {
vp9_highbd_idct16x16_256_add_sse2(in, out, stride, 10);
vpx_highbd_idct16x16_256_add_sse2(in, CAST_TO_SHORTPTR(out), stride, 10);
}
void idct16x16_256_add_12_sse2(const tran_low_t *in, uint8_t *out, int stride) {
vp9_highbd_idct16x16_256_add_sse2(in, out, stride, 12);
vpx_highbd_idct16x16_256_add_sse2(in, CAST_TO_SHORTPTR(out), stride, 12);
}
void idct16x16_10_add_10_sse2(const tran_low_t *in, uint8_t *out, int stride) {
vp9_highbd_idct16x16_10_add_sse2(in, out, stride, 10);
vpx_highbd_idct16x16_10_add_sse2(in, CAST_TO_SHORTPTR(out), stride, 10);
}
void idct16x16_10_add_12_sse2(const tran_low_t *in, uint8_t *out, int stride) {
vp9_highbd_idct16x16_10_add_sse2(in, out, stride, 12);
vpx_highbd_idct16x16_10_add_sse2(in, CAST_TO_SHORTPTR(out), stride, 12);
}
#endif // HAVE_SSE2
#endif // CONFIG_VP9_HIGHBITDEPTH
@ -356,13 +323,13 @@ class Trans16x16TestBase {
int64_t total_error = 0;
const int count_test_block = 10000;
for (int i = 0; i < count_test_block; ++i) {
DECLARE_ALIGNED_ARRAY(16, int16_t, test_input_block, kNumCoeffs);
DECLARE_ALIGNED_ARRAY(16, tran_low_t, test_temp_block, kNumCoeffs);
DECLARE_ALIGNED_ARRAY(16, uint8_t, dst, kNumCoeffs);
DECLARE_ALIGNED_ARRAY(16, uint8_t, src, kNumCoeffs);
DECLARE_ALIGNED(16, int16_t, test_input_block[kNumCoeffs]);
DECLARE_ALIGNED(16, tran_low_t, test_temp_block[kNumCoeffs]);
DECLARE_ALIGNED(16, uint8_t, dst[kNumCoeffs]);
DECLARE_ALIGNED(16, uint8_t, src[kNumCoeffs]);
#if CONFIG_VP9_HIGHBITDEPTH
DECLARE_ALIGNED_ARRAY(16, uint16_t, dst16, kNumCoeffs);
DECLARE_ALIGNED_ARRAY(16, uint16_t, src16, kNumCoeffs);
DECLARE_ALIGNED(16, uint16_t, dst16[kNumCoeffs]);
DECLARE_ALIGNED(16, uint16_t, src16[kNumCoeffs]);
#endif
// Initialize a test block with input range [-mask_, mask_].
@ -380,33 +347,31 @@ class Trans16x16TestBase {
}
}
ASM_REGISTER_STATE_CHECK(RunFwdTxfm(test_input_block,
test_temp_block, pitch_));
ASM_REGISTER_STATE_CHECK(
RunFwdTxfm(test_input_block, test_temp_block, pitch_));
if (bit_depth_ == VPX_BITS_8) {
ASM_REGISTER_STATE_CHECK(
RunInvTxfm(test_temp_block, dst, pitch_));
ASM_REGISTER_STATE_CHECK(RunInvTxfm(test_temp_block, dst, pitch_));
#if CONFIG_VP9_HIGHBITDEPTH
} else {
ASM_REGISTER_STATE_CHECK(
RunInvTxfm(test_temp_block, CONVERT_TO_BYTEPTR(dst16), pitch_));
RunInvTxfm(test_temp_block, CAST_TO_BYTEPTR(dst16), pitch_));
#endif
}
for (int j = 0; j < kNumCoeffs; ++j) {
#if CONFIG_VP9_HIGHBITDEPTH
const uint32_t diff =
bit_depth_ == VPX_BITS_8 ? dst[j] - src[j] : dst16[j] - src16[j];
const int32_t diff =
bit_depth_ == VPX_BITS_8 ? dst[j] - src[j] : dst16[j] - src16[j];
#else
const uint32_t diff = dst[j] - src[j];
const int32_t diff = dst[j] - src[j];
#endif
const uint32_t error = diff * diff;
if (max_error < error)
max_error = error;
if (max_error < error) max_error = error;
total_error += error;
}
}
EXPECT_GE(1u << 2 * (bit_depth_ - 8), max_error)
EXPECT_GE(1u << 2 * (bit_depth_ - 8), max_error)
<< "Error: 16x16 FHT/IHT has an individual round trip error > 1";
EXPECT_GE(count_test_block << 2 * (bit_depth_ - 8), total_error)
@ -416,14 +381,15 @@ class Trans16x16TestBase {
void RunCoeffCheck() {
ACMRandom rnd(ACMRandom::DeterministicSeed());
const int count_test_block = 1000;
DECLARE_ALIGNED_ARRAY(16, int16_t, input_block, kNumCoeffs);
DECLARE_ALIGNED_ARRAY(16, tran_low_t, output_ref_block, kNumCoeffs);
DECLARE_ALIGNED_ARRAY(16, tran_low_t, output_block, kNumCoeffs);
DECLARE_ALIGNED(16, int16_t, input_block[kNumCoeffs]);
DECLARE_ALIGNED(16, tran_low_t, output_ref_block[kNumCoeffs]);
DECLARE_ALIGNED(16, tran_low_t, output_block[kNumCoeffs]);
for (int i = 0; i < count_test_block; ++i) {
// Initialize a test block with input range [-mask_, mask_].
for (int j = 0; j < kNumCoeffs; ++j)
for (int j = 0; j < kNumCoeffs; ++j) {
input_block[j] = (rnd.Rand16() & mask_) - (rnd.Rand16() & mask_);
}
fwd_txfm_ref(input_block, output_ref_block, pitch_, tx_type_);
ASM_REGISTER_STATE_CHECK(RunFwdTxfm(input_block, output_block, pitch_));
@ -437,28 +403,24 @@ class Trans16x16TestBase {
void RunMemCheck() {
ACMRandom rnd(ACMRandom::DeterministicSeed());
const int count_test_block = 1000;
DECLARE_ALIGNED_ARRAY(16, int16_t, input_block, kNumCoeffs);
DECLARE_ALIGNED_ARRAY(16, int16_t, input_extreme_block, kNumCoeffs);
DECLARE_ALIGNED_ARRAY(16, tran_low_t, output_ref_block, kNumCoeffs);
DECLARE_ALIGNED_ARRAY(16, tran_low_t, output_block, kNumCoeffs);
DECLARE_ALIGNED(16, int16_t, input_extreme_block[kNumCoeffs]);
DECLARE_ALIGNED(16, tran_low_t, output_ref_block[kNumCoeffs]);
DECLARE_ALIGNED(16, tran_low_t, output_block[kNumCoeffs]);
for (int i = 0; i < count_test_block; ++i) {
// Initialize a test block with input range [-mask_, mask_].
for (int j = 0; j < kNumCoeffs; ++j) {
input_block[j] = (rnd.Rand16() & mask_) - (rnd.Rand16() & mask_);
input_extreme_block[j] = rnd.Rand8() % 2 ? mask_ : -mask_;
}
if (i == 0) {
for (int j = 0; j < kNumCoeffs; ++j)
input_extreme_block[j] = mask_;
for (int j = 0; j < kNumCoeffs; ++j) input_extreme_block[j] = mask_;
} else if (i == 1) {
for (int j = 0; j < kNumCoeffs; ++j)
input_extreme_block[j] = -mask_;
for (int j = 0; j < kNumCoeffs; ++j) input_extreme_block[j] = -mask_;
}
fwd_txfm_ref(input_extreme_block, output_ref_block, pitch_, tx_type_);
ASM_REGISTER_STATE_CHECK(RunFwdTxfm(input_extreme_block,
output_block, pitch_));
ASM_REGISTER_STATE_CHECK(
RunFwdTxfm(input_extreme_block, output_block, pitch_));
// The minimum quant value is 4.
for (int j = 0; j < kNumCoeffs; ++j) {
@ -472,65 +434,59 @@ class Trans16x16TestBase {
void RunQuantCheck(int dc_thred, int ac_thred) {
ACMRandom rnd(ACMRandom::DeterministicSeed());
const int count_test_block = 100000;
DECLARE_ALIGNED_ARRAY(16, int16_t, input_block, kNumCoeffs);
DECLARE_ALIGNED_ARRAY(16, int16_t, input_extreme_block, kNumCoeffs);
DECLARE_ALIGNED_ARRAY(16, tran_low_t, output_ref_block, kNumCoeffs);
DECLARE_ALIGNED(16, int16_t, input_extreme_block[kNumCoeffs]);
DECLARE_ALIGNED(16, tran_low_t, output_ref_block[kNumCoeffs]);
DECLARE_ALIGNED_ARRAY(16, uint8_t, dst, kNumCoeffs);
DECLARE_ALIGNED_ARRAY(16, uint8_t, ref, kNumCoeffs);
DECLARE_ALIGNED(16, uint8_t, dst[kNumCoeffs]);
DECLARE_ALIGNED(16, uint8_t, ref[kNumCoeffs]);
#if CONFIG_VP9_HIGHBITDEPTH
DECLARE_ALIGNED_ARRAY(16, uint16_t, dst16, kNumCoeffs);
DECLARE_ALIGNED_ARRAY(16, uint16_t, ref16, kNumCoeffs);
DECLARE_ALIGNED(16, uint16_t, dst16[kNumCoeffs]);
DECLARE_ALIGNED(16, uint16_t, ref16[kNumCoeffs]);
#endif
for (int i = 0; i < count_test_block; ++i) {
// Initialize a test block with input range [-mask_, mask_].
for (int j = 0; j < kNumCoeffs; ++j) {
if (bit_depth_ == VPX_BITS_8)
input_block[j] = rnd.Rand8() - rnd.Rand8();
else
input_block[j] = (rnd.Rand16() & mask_) - (rnd.Rand16() & mask_);
input_extreme_block[j] = rnd.Rand8() % 2 ? mask_ : -mask_;
}
if (i == 0)
for (int j = 0; j < kNumCoeffs; ++j)
input_extreme_block[j] = mask_;
if (i == 1)
for (int j = 0; j < kNumCoeffs; ++j)
input_extreme_block[j] = -mask_;
if (i == 0) {
for (int j = 0; j < kNumCoeffs; ++j) input_extreme_block[j] = mask_;
}
if (i == 1) {
for (int j = 0; j < kNumCoeffs; ++j) input_extreme_block[j] = -mask_;
}
fwd_txfm_ref(input_extreme_block, output_ref_block, pitch_, tx_type_);
// clear reconstructed pixel buffers
vpx_memset(dst, 0, kNumCoeffs * sizeof(uint8_t));
vpx_memset(ref, 0, kNumCoeffs * sizeof(uint8_t));
memset(dst, 0, kNumCoeffs * sizeof(uint8_t));
memset(ref, 0, kNumCoeffs * sizeof(uint8_t));
#if CONFIG_VP9_HIGHBITDEPTH
vpx_memset(dst16, 0, kNumCoeffs * sizeof(uint16_t));
vpx_memset(ref16, 0, kNumCoeffs * sizeof(uint16_t));
memset(dst16, 0, kNumCoeffs * sizeof(uint16_t));
memset(ref16, 0, kNumCoeffs * sizeof(uint16_t));
#endif
// quantization with maximum allowed step sizes
output_ref_block[0] = (output_ref_block[0] / dc_thred) * dc_thred;
for (int j = 1; j < kNumCoeffs; ++j)
for (int j = 1; j < kNumCoeffs; ++j) {
output_ref_block[j] = (output_ref_block[j] / ac_thred) * ac_thred;
}
if (bit_depth_ == VPX_BITS_8) {
inv_txfm_ref(output_ref_block, ref, pitch_, tx_type_);
ASM_REGISTER_STATE_CHECK(RunInvTxfm(output_ref_block, dst, pitch_));
#if CONFIG_VP9_HIGHBITDEPTH
} else {
inv_txfm_ref(output_ref_block, CONVERT_TO_BYTEPTR(ref16), pitch_,
inv_txfm_ref(output_ref_block, CAST_TO_BYTEPTR(ref16), pitch_,
tx_type_);
ASM_REGISTER_STATE_CHECK(RunInvTxfm(output_ref_block,
CONVERT_TO_BYTEPTR(dst16), pitch_));
ASM_REGISTER_STATE_CHECK(
RunInvTxfm(output_ref_block, CAST_TO_BYTEPTR(dst16), pitch_));
#endif
}
if (bit_depth_ == VPX_BITS_8) {
for (int j = 0; j < kNumCoeffs; ++j)
EXPECT_EQ(ref[j], dst[j]);
for (int j = 0; j < kNumCoeffs; ++j) EXPECT_EQ(ref[j], dst[j]);
#if CONFIG_VP9_HIGHBITDEPTH
} else {
for (int j = 0; j < kNumCoeffs; ++j)
EXPECT_EQ(ref16[j], dst16[j]);
for (int j = 0; j < kNumCoeffs; ++j) EXPECT_EQ(ref16[j], dst16[j]);
#endif
}
}
@ -539,13 +495,13 @@ class Trans16x16TestBase {
void RunInvAccuracyCheck() {
ACMRandom rnd(ACMRandom::DeterministicSeed());
const int count_test_block = 1000;
DECLARE_ALIGNED_ARRAY(16, int16_t, in, kNumCoeffs);
DECLARE_ALIGNED_ARRAY(16, tran_low_t, coeff, kNumCoeffs);
DECLARE_ALIGNED_ARRAY(16, uint8_t, dst, kNumCoeffs);
DECLARE_ALIGNED_ARRAY(16, uint8_t, src, kNumCoeffs);
DECLARE_ALIGNED(16, int16_t, in[kNumCoeffs]);
DECLARE_ALIGNED(16, tran_low_t, coeff[kNumCoeffs]);
DECLARE_ALIGNED(16, uint8_t, dst[kNumCoeffs]);
DECLARE_ALIGNED(16, uint8_t, src[kNumCoeffs]);
#if CONFIG_VP9_HIGHBITDEPTH
DECLARE_ALIGNED_ARRAY(16, uint16_t, dst16, kNumCoeffs);
DECLARE_ALIGNED_ARRAY(16, uint16_t, src16, kNumCoeffs);
DECLARE_ALIGNED(16, uint16_t, dst16[kNumCoeffs]);
DECLARE_ALIGNED(16, uint16_t, src16[kNumCoeffs]);
#endif // CONFIG_VP9_HIGHBITDEPTH
for (int i = 0; i < count_test_block; ++i) {
@ -567,15 +523,15 @@ class Trans16x16TestBase {
}
reference_16x16_dct_2d(in, out_r);
for (int j = 0; j < kNumCoeffs; ++j)
for (int j = 0; j < kNumCoeffs; ++j) {
coeff[j] = static_cast<tran_low_t>(round(out_r[j]));
}
if (bit_depth_ == VPX_BITS_8) {
ASM_REGISTER_STATE_CHECK(RunInvTxfm(coeff, dst, 16));
#if CONFIG_VP9_HIGHBITDEPTH
} else {
ASM_REGISTER_STATE_CHECK(RunInvTxfm(coeff, CONVERT_TO_BYTEPTR(dst16),
16));
ASM_REGISTER_STATE_CHECK(RunInvTxfm(coeff, CAST_TO_BYTEPTR(dst16), 16));
#endif // CONFIG_VP9_HIGHBITDEPTH
}
@ -588,8 +544,7 @@ class Trans16x16TestBase {
#endif // CONFIG_VP9_HIGHBITDEPTH
const uint32_t error = diff * diff;
EXPECT_GE(1u, error)
<< "Error: 16x16 IDCT has error " << error
<< " at index " << j;
<< "Error: 16x16 IDCT has error " << error << " at index " << j;
}
}
}
@ -599,12 +554,12 @@ class Trans16x16TestBase {
const int count_test_block = 10000;
const int eob = 10;
const int16_t *scan = vp9_default_scan_orders[TX_16X16].scan;
DECLARE_ALIGNED_ARRAY(16, tran_low_t, coeff, kNumCoeffs);
DECLARE_ALIGNED_ARRAY(16, uint8_t, dst, kNumCoeffs);
DECLARE_ALIGNED_ARRAY(16, uint8_t, ref, kNumCoeffs);
DECLARE_ALIGNED(16, tran_low_t, coeff[kNumCoeffs]);
DECLARE_ALIGNED(16, uint8_t, dst[kNumCoeffs]);
DECLARE_ALIGNED(16, uint8_t, ref[kNumCoeffs]);
#if CONFIG_VP9_HIGHBITDEPTH
DECLARE_ALIGNED_ARRAY(16, uint16_t, dst16, kNumCoeffs);
DECLARE_ALIGNED_ARRAY(16, uint16_t, ref16, kNumCoeffs);
DECLARE_ALIGNED(16, uint16_t, dst16[kNumCoeffs]);
DECLARE_ALIGNED(16, uint16_t, ref16[kNumCoeffs]);
#endif // CONFIG_VP9_HIGHBITDEPTH
for (int i = 0; i < count_test_block; ++i) {
@ -630,9 +585,9 @@ class Trans16x16TestBase {
ASM_REGISTER_STATE_CHECK(RunInvTxfm(coeff, dst, pitch_));
} else {
#if CONFIG_VP9_HIGHBITDEPTH
ref_txfm(coeff, CONVERT_TO_BYTEPTR(ref16), pitch_);
ASM_REGISTER_STATE_CHECK(RunInvTxfm(coeff, CONVERT_TO_BYTEPTR(dst16),
pitch_));
ref_txfm(coeff, CAST_TO_BYTEPTR(ref16), pitch_);
ASM_REGISTER_STATE_CHECK(
RunInvTxfm(coeff, CAST_TO_BYTEPTR(dst16), pitch_));
#endif // CONFIG_VP9_HIGHBITDEPTH
}
@ -644,9 +599,8 @@ class Trans16x16TestBase {
const uint32_t diff = dst[j] - ref[j];
#endif // CONFIG_VP9_HIGHBITDEPTH
const uint32_t error = diff * diff;
EXPECT_EQ(0u, error)
<< "Error: 16x16 IDCT Comparison has error " << error
<< " at index " << j;
EXPECT_EQ(0u, error) << "Error: 16x16 IDCT Comparison has error "
<< error << " at index " << j;
}
}
}
@ -659,32 +613,25 @@ class Trans16x16TestBase {
IhtFunc inv_txfm_ref;
};
class Trans16x16DCT
: public Trans16x16TestBase,
public ::testing::TestWithParam<Dct16x16Param> {
class Trans16x16DCT : public Trans16x16TestBase,
public ::testing::TestWithParam<Dct16x16Param> {
public:
virtual ~Trans16x16DCT() {}
virtual void SetUp() {
fwd_txfm_ = GET_PARAM(0);
inv_txfm_ = GET_PARAM(1);
tx_type_ = GET_PARAM(2);
tx_type_ = GET_PARAM(2);
bit_depth_ = GET_PARAM(3);
pitch_ = 16;
pitch_ = 16;
fwd_txfm_ref = fdct16x16_ref;
inv_txfm_ref = idct16x16_ref;
mask_ = (1 << bit_depth_) - 1;
#if CONFIG_VP9_HIGHBITDEPTH
switch (bit_depth_) {
case VPX_BITS_10:
inv_txfm_ref = idct16x16_10_ref;
break;
case VPX_BITS_12:
inv_txfm_ref = idct16x16_12_ref;
break;
default:
inv_txfm_ref = idct16x16_ref;
break;
case VPX_BITS_10: inv_txfm_ref = idct16x16_10_ref; break;
case VPX_BITS_12: inv_txfm_ref = idct16x16_12_ref; break;
default: inv_txfm_ref = idct16x16_ref; break;
}
#else
inv_txfm_ref = idct16x16_ref;
@ -704,17 +651,11 @@ class Trans16x16DCT
IdctFunc inv_txfm_;
};
TEST_P(Trans16x16DCT, AccuracyCheck) {
RunAccuracyCheck();
}
TEST_P(Trans16x16DCT, AccuracyCheck) { RunAccuracyCheck(); }
TEST_P(Trans16x16DCT, CoeffCheck) {
RunCoeffCheck();
}
TEST_P(Trans16x16DCT, CoeffCheck) { RunCoeffCheck(); }
TEST_P(Trans16x16DCT, MemCheck) {
RunMemCheck();
}
TEST_P(Trans16x16DCT, MemCheck) { RunMemCheck(); }
TEST_P(Trans16x16DCT, QuantCheck) {
// Use maximally allowed quantization step sizes for DC and AC
@ -722,36 +663,27 @@ TEST_P(Trans16x16DCT, QuantCheck) {
RunQuantCheck(1336, 1828);
}
TEST_P(Trans16x16DCT, InvAccuracyCheck) {
RunInvAccuracyCheck();
}
TEST_P(Trans16x16DCT, InvAccuracyCheck) { RunInvAccuracyCheck(); }
class Trans16x16HT
: public Trans16x16TestBase,
public ::testing::TestWithParam<Ht16x16Param> {
class Trans16x16HT : public Trans16x16TestBase,
public ::testing::TestWithParam<Ht16x16Param> {
public:
virtual ~Trans16x16HT() {}
virtual void SetUp() {
fwd_txfm_ = GET_PARAM(0);
inv_txfm_ = GET_PARAM(1);
tx_type_ = GET_PARAM(2);
tx_type_ = GET_PARAM(2);
bit_depth_ = GET_PARAM(3);
pitch_ = 16;
pitch_ = 16;
fwd_txfm_ref = fht16x16_ref;
inv_txfm_ref = iht16x16_ref;
mask_ = (1 << bit_depth_) - 1;
#if CONFIG_VP9_HIGHBITDEPTH
switch (bit_depth_) {
case VPX_BITS_10:
inv_txfm_ref = iht16x16_10;
break;
case VPX_BITS_12:
inv_txfm_ref = iht16x16_12;
break;
default:
inv_txfm_ref = iht16x16_ref;
break;
case VPX_BITS_10: inv_txfm_ref = iht16x16_10; break;
case VPX_BITS_12: inv_txfm_ref = iht16x16_12; break;
default: inv_txfm_ref = iht16x16_ref; break;
}
#else
inv_txfm_ref = iht16x16_ref;
@ -771,17 +703,11 @@ class Trans16x16HT
IhtFunc inv_txfm_;
};
TEST_P(Trans16x16HT, AccuracyCheck) {
RunAccuracyCheck();
}
TEST_P(Trans16x16HT, AccuracyCheck) { RunAccuracyCheck(); }
TEST_P(Trans16x16HT, CoeffCheck) {
RunCoeffCheck();
}
TEST_P(Trans16x16HT, CoeffCheck) { RunCoeffCheck(); }
TEST_P(Trans16x16HT, MemCheck) {
RunMemCheck();
}
TEST_P(Trans16x16HT, MemCheck) { RunMemCheck(); }
TEST_P(Trans16x16HT, QuantCheck) {
// The encoder skips any non-DC intra prediction modes,
@ -789,9 +715,8 @@ TEST_P(Trans16x16HT, QuantCheck) {
RunQuantCheck(429, 729);
}
class InvTrans16x16DCT
: public Trans16x16TestBase,
public ::testing::TestWithParam<Idct16x16Param> {
class InvTrans16x16DCT : public Trans16x16TestBase,
public ::testing::TestWithParam<Idct16x16Param> {
public:
virtual ~InvTrans16x16DCT() {}
@ -802,11 +727,11 @@ class InvTrans16x16DCT
bit_depth_ = GET_PARAM(3);
pitch_ = 16;
mask_ = (1 << bit_depth_) - 1;
}
}
virtual void TearDown() { libvpx_test::ClearSystemState(); }
protected:
void RunFwdTxfm(int16_t *in, tran_low_t *out, int stride) {}
void RunFwdTxfm(int16_t * /*in*/, tran_low_t * /*out*/, int /*stride*/) {}
void RunInvTxfm(tran_low_t *out, uint8_t *dst, int stride) {
inv_txfm_(out, dst, stride);
}
@ -820,20 +745,20 @@ TEST_P(InvTrans16x16DCT, CompareReference) {
CompareInvReference(ref_txfm_, thresh_);
}
using std::tr1::make_tuple;
using ::testing::make_tuple;
#if CONFIG_VP9_HIGHBITDEPTH
INSTANTIATE_TEST_CASE_P(
C, Trans16x16DCT,
::testing::Values(
make_tuple(&vp9_highbd_fdct16x16_c, &idct16x16_10, 0, VPX_BITS_10),
make_tuple(&vp9_highbd_fdct16x16_c, &idct16x16_12, 0, VPX_BITS_12),
make_tuple(&vp9_fdct16x16_c, &vp9_idct16x16_256_add_c, 0, VPX_BITS_8)));
make_tuple(&vpx_highbd_fdct16x16_c, &idct16x16_10, 0, VPX_BITS_10),
make_tuple(&vpx_highbd_fdct16x16_c, &idct16x16_12, 0, VPX_BITS_12),
make_tuple(&vpx_fdct16x16_c, &vpx_idct16x16_256_add_c, 0, VPX_BITS_8)));
#else
INSTANTIATE_TEST_CASE_P(
C, Trans16x16DCT,
::testing::Values(
make_tuple(&vp9_fdct16x16_c, &vp9_idct16x16_256_add_c, 0, VPX_BITS_8)));
INSTANTIATE_TEST_CASE_P(C, Trans16x16DCT,
::testing::Values(make_tuple(&vpx_fdct16x16_c,
&vpx_idct16x16_256_add_c,
0, VPX_BITS_8)));
#endif // CONFIG_VP9_HIGHBITDEPTH
#if CONFIG_VP9_HIGHBITDEPTH
@ -862,58 +787,45 @@ INSTANTIATE_TEST_CASE_P(
make_tuple(&vp9_fht16x16_c, &vp9_iht16x16_256_add_c, 3, VPX_BITS_8)));
#endif // CONFIG_VP9_HIGHBITDEPTH
#if HAVE_NEON_ASM && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
#if HAVE_NEON && !CONFIG_EMULATE_HARDWARE
INSTANTIATE_TEST_CASE_P(
NEON, Trans16x16DCT,
::testing::Values(
make_tuple(&vp9_fdct16x16_c,
&vp9_idct16x16_256_add_neon, 0, VPX_BITS_8)));
#endif
::testing::Values(make_tuple(&vpx_fdct16x16_neon,
&vpx_idct16x16_256_add_neon, 0, VPX_BITS_8)));
#endif // HAVE_NEON && !CONFIG_EMULATE_HARDWARE
#if HAVE_SSE2 && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
INSTANTIATE_TEST_CASE_P(
SSE2, Trans16x16DCT,
::testing::Values(
make_tuple(&vp9_fdct16x16_sse2,
&vp9_idct16x16_256_add_sse2, 0, VPX_BITS_8)));
::testing::Values(make_tuple(&vpx_fdct16x16_sse2,
&vpx_idct16x16_256_add_sse2, 0, VPX_BITS_8)));
INSTANTIATE_TEST_CASE_P(
SSE2, Trans16x16HT,
::testing::Values(
make_tuple(&vp9_fht16x16_sse2, &vp9_iht16x16_256_add_sse2, 0,
VPX_BITS_8),
make_tuple(&vp9_fht16x16_sse2, &vp9_iht16x16_256_add_sse2, 1,
VPX_BITS_8),
make_tuple(&vp9_fht16x16_sse2, &vp9_iht16x16_256_add_sse2, 2,
VPX_BITS_8),
make_tuple(&vp9_fht16x16_sse2, &vp9_iht16x16_256_add_sse2, 3,
VPX_BITS_8)));
::testing::Values(make_tuple(&vp9_fht16x16_sse2, &vp9_iht16x16_256_add_sse2,
0, VPX_BITS_8),
make_tuple(&vp9_fht16x16_sse2, &vp9_iht16x16_256_add_sse2,
1, VPX_BITS_8),
make_tuple(&vp9_fht16x16_sse2, &vp9_iht16x16_256_add_sse2,
2, VPX_BITS_8),
make_tuple(&vp9_fht16x16_sse2, &vp9_iht16x16_256_add_sse2,
3, VPX_BITS_8)));
#endif // HAVE_SSE2 && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
#if HAVE_SSE2 && CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
INSTANTIATE_TEST_CASE_P(
SSE2, Trans16x16DCT,
::testing::Values(
make_tuple(&vp9_highbd_fdct16x16_sse2,
&idct16x16_10, 0, VPX_BITS_10),
make_tuple(&vp9_highbd_fdct16x16_c,
&idct16x16_256_add_10_sse2, 0, VPX_BITS_10),
make_tuple(&vp9_highbd_fdct16x16_sse2,
&idct16x16_12, 0, VPX_BITS_12),
make_tuple(&vp9_highbd_fdct16x16_c,
&idct16x16_256_add_12_sse2, 0, VPX_BITS_12),
make_tuple(&vp9_fdct16x16_sse2,
&vp9_idct16x16_256_add_c, 0, VPX_BITS_8)));
make_tuple(&vpx_highbd_fdct16x16_sse2, &idct16x16_10, 0, VPX_BITS_10),
make_tuple(&vpx_highbd_fdct16x16_c, &idct16x16_256_add_10_sse2, 0,
VPX_BITS_10),
make_tuple(&vpx_highbd_fdct16x16_sse2, &idct16x16_12, 0, VPX_BITS_12),
make_tuple(&vpx_highbd_fdct16x16_c, &idct16x16_256_add_12_sse2, 0,
VPX_BITS_12),
make_tuple(&vpx_fdct16x16_sse2, &vpx_idct16x16_256_add_c, 0,
VPX_BITS_8)));
INSTANTIATE_TEST_CASE_P(
SSE2, Trans16x16HT,
::testing::Values(
make_tuple(&vp9_highbd_fht16x16_sse2, &iht16x16_10, 0, VPX_BITS_10),
make_tuple(&vp9_highbd_fht16x16_sse2, &iht16x16_10, 1, VPX_BITS_10),
make_tuple(&vp9_highbd_fht16x16_sse2, &iht16x16_10, 2, VPX_BITS_10),
make_tuple(&vp9_highbd_fht16x16_sse2, &iht16x16_10, 3, VPX_BITS_10),
make_tuple(&vp9_highbd_fht16x16_sse2, &iht16x16_12, 0, VPX_BITS_12),
make_tuple(&vp9_highbd_fht16x16_sse2, &iht16x16_12, 1, VPX_BITS_12),
make_tuple(&vp9_highbd_fht16x16_sse2, &iht16x16_12, 2, VPX_BITS_12),
make_tuple(&vp9_highbd_fht16x16_sse2, &iht16x16_12, 3, VPX_BITS_12),
make_tuple(&vp9_fht16x16_sse2, &vp9_iht16x16_256_add_c, 0, VPX_BITS_8),
make_tuple(&vp9_fht16x16_sse2, &vp9_iht16x16_256_add_c, 1, VPX_BITS_8),
make_tuple(&vp9_fht16x16_sse2, &vp9_iht16x16_256_add_c, 2, VPX_BITS_8),
@ -923,22 +835,35 @@ INSTANTIATE_TEST_CASE_P(
// that to test both branches.
INSTANTIATE_TEST_CASE_P(
SSE2, InvTrans16x16DCT,
::testing::Values(
make_tuple(&idct16x16_10_add_10_c,
&idct16x16_10_add_10_sse2, 3167, VPX_BITS_10),
make_tuple(&idct16x16_10,
&idct16x16_256_add_10_sse2, 3167, VPX_BITS_10),
make_tuple(&idct16x16_10_add_12_c,
&idct16x16_10_add_12_sse2, 3167, VPX_BITS_12),
make_tuple(&idct16x16_12,
&idct16x16_256_add_12_sse2, 3167, VPX_BITS_12)));
::testing::Values(make_tuple(&idct16x16_10_add_10_c,
&idct16x16_10_add_10_sse2, 3167, VPX_BITS_10),
make_tuple(&idct16x16_10, &idct16x16_256_add_10_sse2,
3167, VPX_BITS_10),
make_tuple(&idct16x16_10_add_12_c,
&idct16x16_10_add_12_sse2, 3167, VPX_BITS_12),
make_tuple(&idct16x16_12, &idct16x16_256_add_12_sse2,
3167, VPX_BITS_12)));
#endif // HAVE_SSE2 && CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
#if HAVE_SSSE3 && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
#if HAVE_MSA && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
INSTANTIATE_TEST_CASE_P(MSA, Trans16x16DCT,
::testing::Values(make_tuple(&vpx_fdct16x16_msa,
&vpx_idct16x16_256_add_msa,
0, VPX_BITS_8)));
INSTANTIATE_TEST_CASE_P(
SSSE3, Trans16x16DCT,
MSA, Trans16x16HT,
::testing::Values(
make_tuple(&vp9_fdct16x16_c, &vp9_idct16x16_256_add_ssse3, 0,
make_tuple(&vp9_fht16x16_msa, &vp9_iht16x16_256_add_msa, 0, VPX_BITS_8),
make_tuple(&vp9_fht16x16_msa, &vp9_iht16x16_256_add_msa, 1, VPX_BITS_8),
make_tuple(&vp9_fht16x16_msa, &vp9_iht16x16_256_add_msa, 2, VPX_BITS_8),
make_tuple(&vp9_fht16x16_msa, &vp9_iht16x16_256_add_msa, 3,
VPX_BITS_8)));
#endif // HAVE_SSSE3 && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
#endif // HAVE_MSA && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
#if HAVE_VSX && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
INSTANTIATE_TEST_CASE_P(VSX, Trans16x16DCT,
::testing::Values(make_tuple(&vpx_fdct16x16_c,
&vpx_idct16x16_256_add_vsx,
0, VPX_BITS_8)));
#endif // HAVE_VSX && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
} // namespace

View File

@ -13,28 +13,23 @@
#include <string.h>
#include "third_party/googletest/src/include/gtest/gtest.h"
#include "./vp9_rtcd.h"
#include "./vpx_config.h"
#include "./vpx_dsp_rtcd.h"
#include "test/acm_random.h"
#include "test/clear_system_state.h"
#include "test/register_state_check.h"
#include "test/util.h"
#include "./vpx_config.h"
#include "./vp9_rtcd.h"
#include "vp9/common/vp9_entropy.h"
#include "vpx/vpx_codec.h"
#include "vpx/vpx_integer.h"
#include "vpx_ports/mem.h"
#include "vpx_ports/msvc.h" // for round()
using libvpx_test::ACMRandom;
namespace {
#ifdef _MSC_VER
static int round(double x) {
if (x < 0)
return static_cast<int>(ceil(x - 0.5));
else
return static_cast<int>(floor(x + 0.5));
}
#endif
const int kNumCoeffs = 1024;
const double kPi = 3.141592653589793238462643383279502884;
@ -42,10 +37,10 @@ void reference_32x32_dct_1d(const double in[32], double out[32]) {
const double kInvSqrt2 = 0.707106781186547524400844362104;
for (int k = 0; k < 32; k++) {
out[k] = 0.0;
for (int n = 0; n < 32; n++)
for (int n = 0; n < 32; n++) {
out[k] += in[n] * cos(kPi * (2 * n + 1) * k / 64.0);
if (k == 0)
out[k] = out[k] * kInvSqrt2;
}
if (k == 0) out[k] = out[k] * kInvSqrt2;
}
}
@ -54,41 +49,33 @@ void reference_32x32_dct_2d(const int16_t input[kNumCoeffs],
// First transform columns
for (int i = 0; i < 32; ++i) {
double temp_in[32], temp_out[32];
for (int j = 0; j < 32; ++j)
temp_in[j] = input[j*32 + i];
for (int j = 0; j < 32; ++j) temp_in[j] = input[j * 32 + i];
reference_32x32_dct_1d(temp_in, temp_out);
for (int j = 0; j < 32; ++j)
output[j * 32 + i] = temp_out[j];
for (int j = 0; j < 32; ++j) output[j * 32 + i] = temp_out[j];
}
// Then transform rows
for (int i = 0; i < 32; ++i) {
double temp_in[32], temp_out[32];
for (int j = 0; j < 32; ++j)
temp_in[j] = output[j + i*32];
for (int j = 0; j < 32; ++j) temp_in[j] = output[j + i * 32];
reference_32x32_dct_1d(temp_in, temp_out);
// Scale by some magic number
for (int j = 0; j < 32; ++j)
output[j + i * 32] = temp_out[j] / 4;
for (int j = 0; j < 32; ++j) output[j + i * 32] = temp_out[j] / 4;
}
}
typedef void (*FwdTxfmFunc)(const int16_t *in, tran_low_t *out, int stride);
typedef void (*InvTxfmFunc)(const tran_low_t *in, uint8_t *out, int stride);
typedef std::tr1::tuple<FwdTxfmFunc, InvTxfmFunc, int, vpx_bit_depth_t>
typedef ::testing::tuple<FwdTxfmFunc, InvTxfmFunc, int, vpx_bit_depth_t>
Trans32x32Param;
#if CONFIG_VP9_HIGHBITDEPTH
void idct32x32_8(const tran_low_t *in, uint8_t *out, int stride) {
vp9_highbd_idct32x32_1024_add_c(in, out, stride, 8);
}
void idct32x32_10(const tran_low_t *in, uint8_t *out, int stride) {
vp9_highbd_idct32x32_1024_add_c(in, out, stride, 10);
vpx_highbd_idct32x32_1024_add_c(in, CAST_TO_SHORTPTR(out), stride, 10);
}
void idct32x32_12(const tran_low_t *in, uint8_t *out, int stride) {
vp9_highbd_idct32x32_1024_add_c(in, out, stride, 12);
vpx_highbd_idct32x32_1024_add_c(in, CAST_TO_SHORTPTR(out), stride, 12);
}
#endif // CONFIG_VP9_HIGHBITDEPTH
@ -98,8 +85,8 @@ class Trans32x32Test : public ::testing::TestWithParam<Trans32x32Param> {
virtual void SetUp() {
fwd_txfm_ = GET_PARAM(0);
inv_txfm_ = GET_PARAM(1);
version_ = GET_PARAM(2); // 0: high precision forward transform
// 1: low precision version for rd loop
version_ = GET_PARAM(2); // 0: high precision forward transform
// 1: low precision version for rd loop
bit_depth_ = GET_PARAM(3);
mask_ = (1 << bit_depth_) - 1;
}
@ -119,13 +106,13 @@ TEST_P(Trans32x32Test, AccuracyCheck) {
uint32_t max_error = 0;
int64_t total_error = 0;
const int count_test_block = 10000;
DECLARE_ALIGNED_ARRAY(16, int16_t, test_input_block, kNumCoeffs);
DECLARE_ALIGNED_ARRAY(16, tran_low_t, test_temp_block, kNumCoeffs);
DECLARE_ALIGNED_ARRAY(16, uint8_t, dst, kNumCoeffs);
DECLARE_ALIGNED_ARRAY(16, uint8_t, src, kNumCoeffs);
DECLARE_ALIGNED(16, int16_t, test_input_block[kNumCoeffs]);
DECLARE_ALIGNED(16, tran_low_t, test_temp_block[kNumCoeffs]);
DECLARE_ALIGNED(16, uint8_t, dst[kNumCoeffs]);
DECLARE_ALIGNED(16, uint8_t, src[kNumCoeffs]);
#if CONFIG_VP9_HIGHBITDEPTH
DECLARE_ALIGNED_ARRAY(16, uint16_t, dst16, kNumCoeffs);
DECLARE_ALIGNED_ARRAY(16, uint16_t, src16, kNumCoeffs);
DECLARE_ALIGNED(16, uint16_t, dst16[kNumCoeffs]);
DECLARE_ALIGNED(16, uint16_t, src16[kNumCoeffs]);
#endif
for (int i = 0; i < count_test_block; ++i) {
@ -149,21 +136,20 @@ TEST_P(Trans32x32Test, AccuracyCheck) {
ASM_REGISTER_STATE_CHECK(inv_txfm_(test_temp_block, dst, 32));
#if CONFIG_VP9_HIGHBITDEPTH
} else {
ASM_REGISTER_STATE_CHECK(inv_txfm_(test_temp_block,
CONVERT_TO_BYTEPTR(dst16), 32));
ASM_REGISTER_STATE_CHECK(
inv_txfm_(test_temp_block, CAST_TO_BYTEPTR(dst16), 32));
#endif
}
for (int j = 0; j < kNumCoeffs; ++j) {
#if CONFIG_VP9_HIGHBITDEPTH
const uint32_t diff =
const int32_t diff =
bit_depth_ == VPX_BITS_8 ? dst[j] - src[j] : dst16[j] - src16[j];
#else
const uint32_t diff = dst[j] - src[j];
const int32_t diff = dst[j] - src[j];
#endif
const uint32_t error = diff * diff;
if (max_error < error)
max_error = error;
if (max_error < error) max_error = error;
total_error += error;
}
}
@ -184,16 +170,17 @@ TEST_P(Trans32x32Test, CoeffCheck) {
ACMRandom rnd(ACMRandom::DeterministicSeed());
const int count_test_block = 1000;
DECLARE_ALIGNED_ARRAY(16, int16_t, input_block, kNumCoeffs);
DECLARE_ALIGNED_ARRAY(16, tran_low_t, output_ref_block, kNumCoeffs);
DECLARE_ALIGNED_ARRAY(16, tran_low_t, output_block, kNumCoeffs);
DECLARE_ALIGNED(16, int16_t, input_block[kNumCoeffs]);
DECLARE_ALIGNED(16, tran_low_t, output_ref_block[kNumCoeffs]);
DECLARE_ALIGNED(16, tran_low_t, output_block[kNumCoeffs]);
for (int i = 0; i < count_test_block; ++i) {
for (int j = 0; j < kNumCoeffs; ++j)
for (int j = 0; j < kNumCoeffs; ++j) {
input_block[j] = (rnd.Rand16() & mask_) - (rnd.Rand16() & mask_);
}
const int stride = 32;
vp9_fdct32x32_c(input_block, output_ref_block, stride);
vpx_fdct32x32_c(input_block, output_ref_block, stride);
ASM_REGISTER_STATE_CHECK(fwd_txfm_(input_block, output_block, stride));
if (version_ == 0) {
@ -212,27 +199,23 @@ TEST_P(Trans32x32Test, MemCheck) {
ACMRandom rnd(ACMRandom::DeterministicSeed());
const int count_test_block = 2000;
DECLARE_ALIGNED_ARRAY(16, int16_t, input_block, kNumCoeffs);
DECLARE_ALIGNED_ARRAY(16, int16_t, input_extreme_block, kNumCoeffs);
DECLARE_ALIGNED_ARRAY(16, tran_low_t, output_ref_block, kNumCoeffs);
DECLARE_ALIGNED_ARRAY(16, tran_low_t, output_block, kNumCoeffs);
DECLARE_ALIGNED(16, int16_t, input_extreme_block[kNumCoeffs]);
DECLARE_ALIGNED(16, tran_low_t, output_ref_block[kNumCoeffs]);
DECLARE_ALIGNED(16, tran_low_t, output_block[kNumCoeffs]);
for (int i = 0; i < count_test_block; ++i) {
// Initialize a test block with input range [-mask_, mask_].
for (int j = 0; j < kNumCoeffs; ++j) {
input_block[j] = (rnd.Rand16() & mask_) - (rnd.Rand16() & mask_);
input_extreme_block[j] = rnd.Rand8() & 1 ? mask_ : -mask_;
}
if (i == 0) {
for (int j = 0; j < kNumCoeffs; ++j)
input_extreme_block[j] = mask_;
for (int j = 0; j < kNumCoeffs; ++j) input_extreme_block[j] = mask_;
} else if (i == 1) {
for (int j = 0; j < kNumCoeffs; ++j)
input_extreme_block[j] = -mask_;
for (int j = 0; j < kNumCoeffs; ++j) input_extreme_block[j] = -mask_;
}
const int stride = 32;
vp9_fdct32x32_c(input_extreme_block, output_ref_block, stride);
vpx_fdct32x32_c(input_extreme_block, output_ref_block, stride);
ASM_REGISTER_STATE_CHECK(
fwd_txfm_(input_extreme_block, output_block, stride));
@ -257,13 +240,13 @@ TEST_P(Trans32x32Test, MemCheck) {
TEST_P(Trans32x32Test, InverseAccuracy) {
ACMRandom rnd(ACMRandom::DeterministicSeed());
const int count_test_block = 1000;
DECLARE_ALIGNED_ARRAY(16, int16_t, in, kNumCoeffs);
DECLARE_ALIGNED_ARRAY(16, tran_low_t, coeff, kNumCoeffs);
DECLARE_ALIGNED_ARRAY(16, uint8_t, dst, kNumCoeffs);
DECLARE_ALIGNED_ARRAY(16, uint8_t, src, kNumCoeffs);
DECLARE_ALIGNED(16, int16_t, in[kNumCoeffs]);
DECLARE_ALIGNED(16, tran_low_t, coeff[kNumCoeffs]);
DECLARE_ALIGNED(16, uint8_t, dst[kNumCoeffs]);
DECLARE_ALIGNED(16, uint8_t, src[kNumCoeffs]);
#if CONFIG_VP9_HIGHBITDEPTH
DECLARE_ALIGNED_ARRAY(16, uint16_t, dst16, kNumCoeffs);
DECLARE_ALIGNED_ARRAY(16, uint16_t, src16, kNumCoeffs);
DECLARE_ALIGNED(16, uint16_t, dst16[kNumCoeffs]);
DECLARE_ALIGNED(16, uint16_t, src16[kNumCoeffs]);
#endif
for (int i = 0; i < count_test_block; ++i) {
@ -285,13 +268,14 @@ TEST_P(Trans32x32Test, InverseAccuracy) {
}
reference_32x32_dct_2d(in, out_r);
for (int j = 0; j < kNumCoeffs; ++j)
for (int j = 0; j < kNumCoeffs; ++j) {
coeff[j] = static_cast<tran_low_t>(round(out_r[j]));
}
if (bit_depth_ == VPX_BITS_8) {
ASM_REGISTER_STATE_CHECK(inv_txfm_(coeff, dst, 32));
#if CONFIG_VP9_HIGHBITDEPTH
} else {
ASM_REGISTER_STATE_CHECK(inv_txfm_(coeff, CONVERT_TO_BYTEPTR(dst16), 32));
ASM_REGISTER_STATE_CHECK(inv_txfm_(coeff, CAST_TO_BYTEPTR(dst16), 32));
#endif
}
for (int j = 0; j < kNumCoeffs; ++j) {
@ -302,84 +286,92 @@ TEST_P(Trans32x32Test, InverseAccuracy) {
const int diff = dst[j] - src[j];
#endif
const int error = diff * diff;
EXPECT_GE(1, error)
<< "Error: 32x32 IDCT has error " << error
<< " at index " << j;
EXPECT_GE(1, error) << "Error: 32x32 IDCT has error " << error
<< " at index " << j;
}
}
}
using std::tr1::make_tuple;
using ::testing::make_tuple;
#if CONFIG_VP9_HIGHBITDEPTH
INSTANTIATE_TEST_CASE_P(
C, Trans32x32Test,
::testing::Values(
make_tuple(&vp9_highbd_fdct32x32_c,
&idct32x32_10, 0, VPX_BITS_10),
make_tuple(&vp9_highbd_fdct32x32_rd_c,
&idct32x32_10, 1, VPX_BITS_10),
make_tuple(&vp9_highbd_fdct32x32_c,
&idct32x32_12, 0, VPX_BITS_12),
make_tuple(&vp9_highbd_fdct32x32_rd_c,
&idct32x32_12, 1, VPX_BITS_12),
make_tuple(&vp9_fdct32x32_c,
&vp9_idct32x32_1024_add_c, 0, VPX_BITS_8),
make_tuple(&vp9_fdct32x32_rd_c,
&vp9_idct32x32_1024_add_c, 1, VPX_BITS_8)));
make_tuple(&vpx_highbd_fdct32x32_c, &idct32x32_10, 0, VPX_BITS_10),
make_tuple(&vpx_highbd_fdct32x32_rd_c, &idct32x32_10, 1, VPX_BITS_10),
make_tuple(&vpx_highbd_fdct32x32_c, &idct32x32_12, 0, VPX_BITS_12),
make_tuple(&vpx_highbd_fdct32x32_rd_c, &idct32x32_12, 1, VPX_BITS_12),
make_tuple(&vpx_fdct32x32_c, &vpx_idct32x32_1024_add_c, 0, VPX_BITS_8),
make_tuple(&vpx_fdct32x32_rd_c, &vpx_idct32x32_1024_add_c, 1,
VPX_BITS_8)));
#else
INSTANTIATE_TEST_CASE_P(
C, Trans32x32Test,
::testing::Values(
make_tuple(&vp9_fdct32x32_c,
&vp9_idct32x32_1024_add_c, 0, VPX_BITS_8),
make_tuple(&vp9_fdct32x32_rd_c,
&vp9_idct32x32_1024_add_c, 1, VPX_BITS_8)));
::testing::Values(make_tuple(&vpx_fdct32x32_c, &vpx_idct32x32_1024_add_c, 0,
VPX_BITS_8),
make_tuple(&vpx_fdct32x32_rd_c, &vpx_idct32x32_1024_add_c,
1, VPX_BITS_8)));
#endif // CONFIG_VP9_HIGHBITDEPTH
#if HAVE_NEON_ASM && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
#if HAVE_NEON && !CONFIG_EMULATE_HARDWARE
INSTANTIATE_TEST_CASE_P(
NEON, Trans32x32Test,
::testing::Values(
make_tuple(&vp9_fdct32x32_c,
&vp9_idct32x32_1024_add_neon, 0, VPX_BITS_8),
make_tuple(&vp9_fdct32x32_rd_c,
&vp9_idct32x32_1024_add_neon, 1, VPX_BITS_8)));
#endif // HAVE_NEON_ASM && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
::testing::Values(make_tuple(&vpx_fdct32x32_neon,
&vpx_idct32x32_1024_add_neon, 0, VPX_BITS_8),
make_tuple(&vpx_fdct32x32_rd_neon,
&vpx_idct32x32_1024_add_neon, 1, VPX_BITS_8)));
#endif // HAVE_NEON && !CONFIG_EMULATE_HARDWARE
#if HAVE_SSE2 && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
INSTANTIATE_TEST_CASE_P(
SSE2, Trans32x32Test,
::testing::Values(
make_tuple(&vp9_fdct32x32_sse2,
&vp9_idct32x32_1024_add_sse2, 0, VPX_BITS_8),
make_tuple(&vp9_fdct32x32_rd_sse2,
&vp9_idct32x32_1024_add_sse2, 1, VPX_BITS_8)));
::testing::Values(make_tuple(&vpx_fdct32x32_sse2,
&vpx_idct32x32_1024_add_sse2, 0, VPX_BITS_8),
make_tuple(&vpx_fdct32x32_rd_sse2,
&vpx_idct32x32_1024_add_sse2, 1, VPX_BITS_8)));
#endif // HAVE_SSE2 && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
#if HAVE_SSE2 && CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
INSTANTIATE_TEST_CASE_P(
SSE2, Trans32x32Test,
::testing::Values(
make_tuple(&vp9_highbd_fdct32x32_sse2, &idct32x32_10, 0, VPX_BITS_10),
make_tuple(&vp9_highbd_fdct32x32_rd_sse2, &idct32x32_10, 1,
make_tuple(&vpx_highbd_fdct32x32_sse2, &idct32x32_10, 0, VPX_BITS_10),
make_tuple(&vpx_highbd_fdct32x32_rd_sse2, &idct32x32_10, 1,
VPX_BITS_10),
make_tuple(&vp9_highbd_fdct32x32_sse2, &idct32x32_12, 0, VPX_BITS_12),
make_tuple(&vp9_highbd_fdct32x32_rd_sse2, &idct32x32_12, 1,
make_tuple(&vpx_highbd_fdct32x32_sse2, &idct32x32_12, 0, VPX_BITS_12),
make_tuple(&vpx_highbd_fdct32x32_rd_sse2, &idct32x32_12, 1,
VPX_BITS_12),
make_tuple(&vp9_fdct32x32_sse2, &vp9_idct32x32_1024_add_c, 0,
make_tuple(&vpx_fdct32x32_sse2, &vpx_idct32x32_1024_add_c, 0,
VPX_BITS_8),
make_tuple(&vp9_fdct32x32_rd_sse2, &vp9_idct32x32_1024_add_c, 1,
make_tuple(&vpx_fdct32x32_rd_sse2, &vpx_idct32x32_1024_add_c, 1,
VPX_BITS_8)));
#endif // HAVE_SSE2 && CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
#if HAVE_AVX2 && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
INSTANTIATE_TEST_CASE_P(
AVX2, Trans32x32Test,
::testing::Values(
make_tuple(&vp9_fdct32x32_avx2,
&vp9_idct32x32_1024_add_sse2, 0, VPX_BITS_8),
make_tuple(&vp9_fdct32x32_rd_avx2,
&vp9_idct32x32_1024_add_sse2, 1, VPX_BITS_8)));
::testing::Values(make_tuple(&vpx_fdct32x32_avx2,
&vpx_idct32x32_1024_add_sse2, 0, VPX_BITS_8),
make_tuple(&vpx_fdct32x32_rd_avx2,
&vpx_idct32x32_1024_add_sse2, 1, VPX_BITS_8)));
#endif // HAVE_AVX2 && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
#if HAVE_MSA && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
INSTANTIATE_TEST_CASE_P(
MSA, Trans32x32Test,
::testing::Values(make_tuple(&vpx_fdct32x32_msa,
&vpx_idct32x32_1024_add_msa, 0, VPX_BITS_8),
make_tuple(&vpx_fdct32x32_rd_msa,
&vpx_idct32x32_1024_add_msa, 1, VPX_BITS_8)));
#endif // HAVE_MSA && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
#if HAVE_VSX && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
INSTANTIATE_TEST_CASE_P(
VSX, Trans32x32Test,
::testing::Values(make_tuple(&vpx_fdct32x32_c, &vpx_idct32x32_1024_add_vsx,
0, VPX_BITS_8),
make_tuple(&vpx_fdct32x32_rd_c,
&vpx_idct32x32_1024_add_vsx, 1, VPX_BITS_8)));
#endif // HAVE_VSX && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
} // namespace

169
test/dct_partial_test.cc Normal file
View File

@ -0,0 +1,169 @@
/*
* Copyright (c) 2017 The WebM project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#include <math.h>
#include <stdlib.h>
#include <string.h>
#include <limits>
#include "third_party/googletest/src/include/gtest/gtest.h"
#include "./vpx_dsp_rtcd.h"
#include "test/acm_random.h"
#include "test/buffer.h"
#include "test/clear_system_state.h"
#include "test/register_state_check.h"
#include "test/util.h"
#include "vpx/vpx_codec.h"
#include "vpx/vpx_integer.h"
#include "vpx_dsp/vpx_dsp_common.h"
using ::testing::make_tuple;
using ::testing::tuple;
using libvpx_test::ACMRandom;
using libvpx_test::Buffer;
namespace {
typedef void (*PartialFdctFunc)(const int16_t *in, tran_low_t *out, int stride);
typedef tuple<PartialFdctFunc, int /* size */, vpx_bit_depth_t>
PartialFdctParam;
tran_low_t partial_fdct_ref(const Buffer<int16_t> &in, int size) {
int64_t sum = 0;
for (int y = 0; y < size; ++y) {
for (int x = 0; x < size; ++x) {
sum += in.TopLeftPixel()[y * in.stride() + x];
}
}
switch (size) {
case 4: sum *= 2; break;
case 8: /*sum = sum;*/ break;
case 16: sum >>= 1; break;
case 32: sum >>= 3; break;
}
return static_cast<tran_low_t>(sum);
}
class PartialFdctTest : public ::testing::TestWithParam<PartialFdctParam> {
public:
PartialFdctTest() {
fwd_txfm_ = GET_PARAM(0);
size_ = GET_PARAM(1);
bit_depth_ = GET_PARAM(2);
}
virtual void TearDown() { libvpx_test::ClearSystemState(); }
protected:
void RunTest() {
ACMRandom rnd(ACMRandom::DeterministicSeed());
const int16_t maxvalue =
clip_pixel_highbd(std::numeric_limits<int16_t>::max(), bit_depth_);
const int16_t minvalue = -maxvalue;
Buffer<int16_t> input_block =
Buffer<int16_t>(size_, size_, 8, size_ == 4 ? 0 : 16);
ASSERT_TRUE(input_block.Init());
Buffer<tran_low_t> output_block = Buffer<tran_low_t>(size_, size_, 0, 16);
ASSERT_TRUE(output_block.Init());
for (int i = 0; i < 100; ++i) {
if (i == 0) {
input_block.Set(maxvalue);
} else if (i == 1) {
input_block.Set(minvalue);
} else {
input_block.Set(&rnd, minvalue, maxvalue);
}
ASM_REGISTER_STATE_CHECK(fwd_txfm_(input_block.TopLeftPixel(),
output_block.TopLeftPixel(),
input_block.stride()));
EXPECT_EQ(partial_fdct_ref(input_block, size_),
output_block.TopLeftPixel()[0]);
}
}
PartialFdctFunc fwd_txfm_;
vpx_bit_depth_t bit_depth_;
int size_;
};
TEST_P(PartialFdctTest, PartialFdctTest) { RunTest(); }
#if CONFIG_VP9_HIGHBITDEPTH
INSTANTIATE_TEST_CASE_P(
C, PartialFdctTest,
::testing::Values(make_tuple(&vpx_highbd_fdct32x32_1_c, 32, VPX_BITS_12),
make_tuple(&vpx_highbd_fdct32x32_1_c, 32, VPX_BITS_10),
make_tuple(&vpx_fdct32x32_1_c, 32, VPX_BITS_8),
make_tuple(&vpx_highbd_fdct16x16_1_c, 16, VPX_BITS_12),
make_tuple(&vpx_highbd_fdct16x16_1_c, 16, VPX_BITS_10),
make_tuple(&vpx_fdct16x16_1_c, 16, VPX_BITS_8),
make_tuple(&vpx_highbd_fdct8x8_1_c, 8, VPX_BITS_12),
make_tuple(&vpx_highbd_fdct8x8_1_c, 8, VPX_BITS_10),
make_tuple(&vpx_fdct8x8_1_c, 8, VPX_BITS_8),
make_tuple(&vpx_fdct4x4_1_c, 4, VPX_BITS_8)));
#else
INSTANTIATE_TEST_CASE_P(
C, PartialFdctTest,
::testing::Values(make_tuple(&vpx_fdct32x32_1_c, 32, VPX_BITS_8),
make_tuple(&vpx_fdct16x16_1_c, 16, VPX_BITS_8),
make_tuple(&vpx_fdct8x8_1_c, 8, VPX_BITS_8),
make_tuple(&vpx_fdct4x4_1_c, 4, VPX_BITS_8)));
#endif // CONFIG_VP9_HIGHBITDEPTH
#if HAVE_SSE2
INSTANTIATE_TEST_CASE_P(
SSE2, PartialFdctTest,
::testing::Values(make_tuple(&vpx_fdct32x32_1_sse2, 32, VPX_BITS_8),
make_tuple(&vpx_fdct16x16_1_sse2, 16, VPX_BITS_8),
make_tuple(&vpx_fdct8x8_1_sse2, 8, VPX_BITS_8),
make_tuple(&vpx_fdct4x4_1_sse2, 4, VPX_BITS_8)));
#endif // HAVE_SSE2
#if HAVE_NEON
#if CONFIG_VP9_HIGHBITDEPTH
INSTANTIATE_TEST_CASE_P(
NEON, PartialFdctTest,
::testing::Values(make_tuple(&vpx_fdct32x32_1_neon, 32, VPX_BITS_8),
make_tuple(&vpx_fdct16x16_1_neon, 16, VPX_BITS_8),
make_tuple(&vpx_fdct8x8_1_neon, 8, VPX_BITS_12),
make_tuple(&vpx_fdct8x8_1_neon, 8, VPX_BITS_10),
make_tuple(&vpx_fdct8x8_1_neon, 8, VPX_BITS_8),
make_tuple(&vpx_fdct4x4_1_neon, 4, VPX_BITS_8)));
#else
INSTANTIATE_TEST_CASE_P(
NEON, PartialFdctTest,
::testing::Values(make_tuple(&vpx_fdct32x32_1_neon, 32, VPX_BITS_8),
make_tuple(&vpx_fdct16x16_1_neon, 16, VPX_BITS_8),
make_tuple(&vpx_fdct8x8_1_neon, 8, VPX_BITS_8),
make_tuple(&vpx_fdct4x4_1_neon, 4, VPX_BITS_8)));
#endif // CONFIG_VP9_HIGHBITDEPTH
#endif // HAVE_NEON
#if HAVE_MSA
#if CONFIG_VP9_HIGHBITDEPTH
INSTANTIATE_TEST_CASE_P(MSA, PartialFdctTest,
::testing::Values(make_tuple(&vpx_fdct8x8_1_msa, 8,
VPX_BITS_8)));
#else // !CONFIG_VP9_HIGHBITDEPTH
INSTANTIATE_TEST_CASE_P(
MSA, PartialFdctTest,
::testing::Values(make_tuple(&vpx_fdct32x32_1_msa, 32, VPX_BITS_8),
make_tuple(&vpx_fdct16x16_1_msa, 16, VPX_BITS_8),
make_tuple(&vpx_fdct8x8_1_msa, 8, VPX_BITS_8)));
#endif // CONFIG_VP9_HIGHBITDEPTH
#endif // HAVE_MSA
} // namespace

728
test/dct_test.cc Normal file
View File

@ -0,0 +1,728 @@
/*
* Copyright (c) 2017 The WebM project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#include <math.h>
#include <stdlib.h>
#include <string.h>
#include "third_party/googletest/src/include/gtest/gtest.h"
#include "./vp9_rtcd.h"
#include "./vpx_dsp_rtcd.h"
#include "test/acm_random.h"
#include "test/buffer.h"
#include "test/clear_system_state.h"
#include "test/register_state_check.h"
#include "test/util.h"
#include "vp9/common/vp9_entropy.h"
#include "vpx/vpx_codec.h"
#include "vpx/vpx_integer.h"
#include "vpx_ports/mem.h"
using ::testing::make_tuple;
using ::testing::tuple;
using libvpx_test::ACMRandom;
using libvpx_test::Buffer;
namespace {
typedef void (*FdctFunc)(const int16_t *in, tran_low_t *out, int stride);
typedef void (*IdctFunc)(const tran_low_t *in, uint8_t *out, int stride);
typedef void (*FhtFunc)(const int16_t *in, tran_low_t *out, int stride,
int tx_type);
typedef void (*FhtFuncRef)(const Buffer<int16_t> &in, Buffer<tran_low_t> *out,
int size, int tx_type);
typedef void (*IhtFunc)(const tran_low_t *in, uint8_t *out, int stride,
int tx_type);
typedef void (*IhtWithBdFunc)(const tran_low_t *in, uint8_t *out, int stride,
int tx_type, int bd);
template <FdctFunc fn>
void fdct_wrapper(const int16_t *in, tran_low_t *out, int stride, int tx_type) {
(void)tx_type;
fn(in, out, stride);
}
template <IdctFunc fn>
void idct_wrapper(const tran_low_t *in, uint8_t *out, int stride, int tx_type,
int bd) {
(void)tx_type;
(void)bd;
fn(in, out, stride);
}
template <IhtFunc fn>
void iht_wrapper(const tran_low_t *in, uint8_t *out, int stride, int tx_type,
int bd) {
(void)bd;
fn(in, out, stride, tx_type);
}
#if CONFIG_VP9_HIGHBITDEPTH
typedef void (*HighbdIdctFunc)(const tran_low_t *in, uint16_t *out, int stride,
int bd);
typedef void (*HighbdIhtFunc)(const tran_low_t *in, uint16_t *out, int stride,
int tx_type, int bd);
template <HighbdIdctFunc fn>
void highbd_idct_wrapper(const tran_low_t *in, uint8_t *out, int stride,
int tx_type, int bd) {
(void)tx_type;
fn(in, CAST_TO_SHORTPTR(out), stride, bd);
}
template <HighbdIhtFunc fn>
void highbd_iht_wrapper(const tran_low_t *in, uint8_t *out, int stride,
int tx_type, int bd) {
fn(in, CAST_TO_SHORTPTR(out), stride, tx_type, bd);
}
#endif // CONFIG_VP9_HIGHBITDEPTH
struct FuncInfo {
FhtFunc ft_func;
IhtWithBdFunc it_func;
int size;
int pixel_size;
};
/* forward transform, inverse transform, size, transform type, bit depth */
typedef tuple<int, const FuncInfo *, int, vpx_bit_depth_t> DctParam;
void fdct_ref(const Buffer<int16_t> &in, Buffer<tran_low_t> *out, int size,
int /*tx_type*/) {
const int16_t *i = in.TopLeftPixel();
const int i_stride = in.stride();
tran_low_t *o = out->TopLeftPixel();
if (size == 4) {
vpx_fdct4x4_c(i, o, i_stride);
} else if (size == 8) {
vpx_fdct8x8_c(i, o, i_stride);
} else if (size == 16) {
vpx_fdct16x16_c(i, o, i_stride);
} else if (size == 32) {
vpx_fdct32x32_c(i, o, i_stride);
}
}
void fht_ref(const Buffer<int16_t> &in, Buffer<tran_low_t> *out, int size,
int tx_type) {
const int16_t *i = in.TopLeftPixel();
const int i_stride = in.stride();
tran_low_t *o = out->TopLeftPixel();
if (size == 4) {
vp9_fht4x4_c(i, o, i_stride, tx_type);
} else if (size == 8) {
vp9_fht8x8_c(i, o, i_stride, tx_type);
} else if (size == 16) {
vp9_fht16x16_c(i, o, i_stride, tx_type);
}
}
void fwht_ref(const Buffer<int16_t> &in, Buffer<tran_low_t> *out, int size,
int /*tx_type*/) {
ASSERT_EQ(size, 4);
vp9_fwht4x4_c(in.TopLeftPixel(), out->TopLeftPixel(), in.stride());
}
class TransTestBase : public ::testing::TestWithParam<DctParam> {
public:
virtual void SetUp() {
rnd_.Reset(ACMRandom::DeterministicSeed());
const int idx = GET_PARAM(0);
const FuncInfo *func_info = &(GET_PARAM(1)[idx]);
tx_type_ = GET_PARAM(2);
bit_depth_ = GET_PARAM(3);
fwd_txfm_ = func_info->ft_func;
inv_txfm_ = func_info->it_func;
size_ = func_info->size;
pixel_size_ = func_info->pixel_size;
max_pixel_value_ = (1 << bit_depth_) - 1;
// Randomize stride_ to a value less than or equal to 1024
stride_ = rnd_(1024) + 1;
if (stride_ < size_) {
stride_ = size_;
}
// Align stride_ to 16 if it's bigger than 16.
if (stride_ > 16) {
stride_ &= ~15;
}
block_size_ = size_ * stride_;
src_ = reinterpret_cast<uint8_t *>(
vpx_memalign(16, pixel_size_ * block_size_));
ASSERT_TRUE(src_ != NULL);
dst_ = reinterpret_cast<uint8_t *>(
vpx_memalign(16, pixel_size_ * block_size_));
ASSERT_TRUE(dst_ != NULL);
}
virtual void TearDown() {
vpx_free(src_);
src_ = NULL;
vpx_free(dst_);
dst_ = NULL;
libvpx_test::ClearSystemState();
}
void InitMem() {
if (pixel_size_ == 1 && bit_depth_ > VPX_BITS_8) return;
if (pixel_size_ == 1) {
for (int j = 0; j < block_size_; ++j) {
src_[j] = rnd_.Rand16() & max_pixel_value_;
}
for (int j = 0; j < block_size_; ++j) {
dst_[j] = rnd_.Rand16() & max_pixel_value_;
}
} else {
ASSERT_EQ(pixel_size_, 2);
uint16_t *const src = reinterpret_cast<uint16_t *>(src_);
uint16_t *const dst = reinterpret_cast<uint16_t *>(dst_);
for (int j = 0; j < block_size_; ++j) {
src[j] = rnd_.Rand16() & max_pixel_value_;
}
for (int j = 0; j < block_size_; ++j) {
dst[j] = rnd_.Rand16() & max_pixel_value_;
}
}
}
void RunFwdTxfm(const Buffer<int16_t> &in, Buffer<tran_low_t> *out) {
fwd_txfm_(in.TopLeftPixel(), out->TopLeftPixel(), in.stride(), tx_type_);
}
void RunInvTxfm(const Buffer<tran_low_t> &in, uint8_t *out) {
inv_txfm_(in.TopLeftPixel(), out, stride_, tx_type_, bit_depth_);
}
protected:
void RunAccuracyCheck(int limit) {
if (pixel_size_ == 1 && bit_depth_ > VPX_BITS_8) return;
ACMRandom rnd(ACMRandom::DeterministicSeed());
Buffer<int16_t> test_input_block =
Buffer<int16_t>(size_, size_, 8, size_ == 4 ? 0 : 16);
ASSERT_TRUE(test_input_block.Init());
Buffer<tran_low_t> test_temp_block =
Buffer<tran_low_t>(size_, size_, 0, 16);
ASSERT_TRUE(test_temp_block.Init());
uint32_t max_error = 0;
int64_t total_error = 0;
const int count_test_block = 10000;
for (int i = 0; i < count_test_block; ++i) {
InitMem();
for (int h = 0; h < size_; ++h) {
for (int w = 0; w < size_; ++w) {
if (pixel_size_ == 1) {
test_input_block.TopLeftPixel()[h * test_input_block.stride() + w] =
src_[h * stride_ + w] - dst_[h * stride_ + w];
} else {
ASSERT_EQ(pixel_size_, 2);
const uint16_t *const src = reinterpret_cast<uint16_t *>(src_);
const uint16_t *const dst = reinterpret_cast<uint16_t *>(dst_);
test_input_block.TopLeftPixel()[h * test_input_block.stride() + w] =
src[h * stride_ + w] - dst[h * stride_ + w];
}
}
}
ASM_REGISTER_STATE_CHECK(RunFwdTxfm(test_input_block, &test_temp_block));
ASM_REGISTER_STATE_CHECK(RunInvTxfm(test_temp_block, dst_));
for (int h = 0; h < size_; ++h) {
for (int w = 0; w < size_; ++w) {
int diff;
if (pixel_size_ == 1) {
diff = dst_[h * stride_ + w] - src_[h * stride_ + w];
} else {
ASSERT_EQ(pixel_size_, 2);
const uint16_t *const src = reinterpret_cast<uint16_t *>(src_);
const uint16_t *const dst = reinterpret_cast<uint16_t *>(dst_);
diff = dst[h * stride_ + w] - src[h * stride_ + w];
}
const uint32_t error = diff * diff;
if (max_error < error) max_error = error;
total_error += error;
}
}
}
EXPECT_GE(static_cast<uint32_t>(limit), max_error)
<< "Error: " << size_ << "x" << size_
<< " transform/inverse transform has an individual round trip error > "
<< limit;
EXPECT_GE(count_test_block * limit, total_error)
<< "Error: " << size_ << "x" << size_
<< " transform/inverse transform has average round trip error > "
<< limit << " per block";
}
void RunCoeffCheck() {
if (pixel_size_ == 1 && bit_depth_ > VPX_BITS_8) return;
ACMRandom rnd(ACMRandom::DeterministicSeed());
const int count_test_block = 5000;
Buffer<int16_t> input_block =
Buffer<int16_t>(size_, size_, 8, size_ == 4 ? 0 : 16);
ASSERT_TRUE(input_block.Init());
Buffer<tran_low_t> output_ref_block = Buffer<tran_low_t>(size_, size_, 0);
ASSERT_TRUE(output_ref_block.Init());
Buffer<tran_low_t> output_block = Buffer<tran_low_t>(size_, size_, 0, 16);
ASSERT_TRUE(output_block.Init());
for (int i = 0; i < count_test_block; ++i) {
// Initialize a test block with input range [-max_pixel_value_,
// max_pixel_value_].
input_block.Set(&rnd, -max_pixel_value_, max_pixel_value_);
fwd_txfm_ref(input_block, &output_ref_block, size_, tx_type_);
ASM_REGISTER_STATE_CHECK(RunFwdTxfm(input_block, &output_block));
// The minimum quant value is 4.
EXPECT_TRUE(output_block.CheckValues(output_ref_block));
if (::testing::Test::HasFailure()) {
printf("Size: %d Transform type: %d\n", size_, tx_type_);
output_block.PrintDifference(output_ref_block);
return;
}
}
}
void RunMemCheck() {
if (pixel_size_ == 1 && bit_depth_ > VPX_BITS_8) return;
ACMRandom rnd(ACMRandom::DeterministicSeed());
const int count_test_block = 5000;
Buffer<int16_t> input_extreme_block =
Buffer<int16_t>(size_, size_, 8, size_ == 4 ? 0 : 16);
ASSERT_TRUE(input_extreme_block.Init());
Buffer<tran_low_t> output_ref_block = Buffer<tran_low_t>(size_, size_, 0);
ASSERT_TRUE(output_ref_block.Init());
Buffer<tran_low_t> output_block = Buffer<tran_low_t>(size_, size_, 0, 16);
ASSERT_TRUE(output_block.Init());
for (int i = 0; i < count_test_block; ++i) {
// Initialize a test block with -max_pixel_value_ or max_pixel_value_.
if (i == 0) {
input_extreme_block.Set(max_pixel_value_);
} else if (i == 1) {
input_extreme_block.Set(-max_pixel_value_);
} else {
for (int h = 0; h < size_; ++h) {
for (int w = 0; w < size_; ++w) {
input_extreme_block
.TopLeftPixel()[h * input_extreme_block.stride() + w] =
rnd.Rand8() % 2 ? max_pixel_value_ : -max_pixel_value_;
}
}
}
fwd_txfm_ref(input_extreme_block, &output_ref_block, size_, tx_type_);
ASM_REGISTER_STATE_CHECK(RunFwdTxfm(input_extreme_block, &output_block));
// The minimum quant value is 4.
EXPECT_TRUE(output_block.CheckValues(output_ref_block));
for (int h = 0; h < size_; ++h) {
for (int w = 0; w < size_; ++w) {
EXPECT_GE(
4 * DCT_MAX_VALUE << (bit_depth_ - 8),
abs(output_block.TopLeftPixel()[h * output_block.stride() + w]))
<< "Error: " << size_ << "x" << size_
<< " transform has coefficient larger than 4*DCT_MAX_VALUE"
<< " at " << w << "," << h;
if (::testing::Test::HasFailure()) {
printf("Size: %d Transform type: %d\n", size_, tx_type_);
output_block.DumpBuffer();
return;
}
}
}
}
}
void RunInvAccuracyCheck(int limit) {
if (pixel_size_ == 1 && bit_depth_ > VPX_BITS_8) return;
ACMRandom rnd(ACMRandom::DeterministicSeed());
const int count_test_block = 1000;
Buffer<int16_t> in = Buffer<int16_t>(size_, size_, 4);
ASSERT_TRUE(in.Init());
Buffer<tran_low_t> coeff = Buffer<tran_low_t>(size_, size_, 0, 16);
ASSERT_TRUE(coeff.Init());
Buffer<uint8_t> dst = Buffer<uint8_t>(size_, size_, 0, 16);
ASSERT_TRUE(dst.Init());
Buffer<uint8_t> src = Buffer<uint8_t>(size_, size_, 0);
ASSERT_TRUE(src.Init());
Buffer<uint16_t> dst16 = Buffer<uint16_t>(size_, size_, 0, 16);
ASSERT_TRUE(dst16.Init());
Buffer<uint16_t> src16 = Buffer<uint16_t>(size_, size_, 0);
ASSERT_TRUE(src16.Init());
for (int i = 0; i < count_test_block; ++i) {
InitMem();
// Initialize a test block with input range [-max_pixel_value_,
// max_pixel_value_].
for (int h = 0; h < size_; ++h) {
for (int w = 0; w < size_; ++w) {
if (pixel_size_ == 1) {
in.TopLeftPixel()[h * in.stride() + w] =
src_[h * stride_ + w] - dst_[h * stride_ + w];
} else {
ASSERT_EQ(pixel_size_, 2);
const uint16_t *const src = reinterpret_cast<uint16_t *>(src_);
const uint16_t *const dst = reinterpret_cast<uint16_t *>(dst_);
in.TopLeftPixel()[h * in.stride() + w] =
src[h * stride_ + w] - dst[h * stride_ + w];
}
}
}
fwd_txfm_ref(in, &coeff, size_, tx_type_);
ASM_REGISTER_STATE_CHECK(RunInvTxfm(coeff, dst_));
for (int h = 0; h < size_; ++h) {
for (int w = 0; w < size_; ++w) {
int diff;
if (pixel_size_ == 1) {
diff = dst_[h * stride_ + w] - src_[h * stride_ + w];
} else {
ASSERT_EQ(pixel_size_, 2);
const uint16_t *const src = reinterpret_cast<uint16_t *>(src_);
const uint16_t *const dst = reinterpret_cast<uint16_t *>(dst_);
diff = dst[h * stride_ + w] - src[h * stride_ + w];
}
const uint32_t error = diff * diff;
EXPECT_GE(static_cast<uint32_t>(limit), error)
<< "Error: " << size_ << "x" << size_
<< " inverse transform has error " << error << " at " << w << ","
<< h;
if (::testing::Test::HasFailure()) {
printf("Size: %d Transform type: %d\n", size_, tx_type_);
return;
}
}
}
}
}
FhtFunc fwd_txfm_;
FhtFuncRef fwd_txfm_ref;
IhtWithBdFunc inv_txfm_;
ACMRandom rnd_;
uint8_t *src_;
uint8_t *dst_;
vpx_bit_depth_t bit_depth_;
int tx_type_;
int max_pixel_value_;
int size_;
int stride_;
int pixel_size_;
int block_size_;
};
/* -------------------------------------------------------------------------- */
class TransDCT : public TransTestBase {
public:
TransDCT() { fwd_txfm_ref = fdct_ref; }
};
TEST_P(TransDCT, AccuracyCheck) {
int t = 1;
if (size_ == 16 && bit_depth_ > 10 && pixel_size_ == 2) {
t = 2;
} else if (size_ == 32 && bit_depth_ > 10 && pixel_size_ == 2) {
t = 7;
}
RunAccuracyCheck(t);
}
TEST_P(TransDCT, CoeffCheck) { RunCoeffCheck(); }
TEST_P(TransDCT, MemCheck) { RunMemCheck(); }
TEST_P(TransDCT, InvAccuracyCheck) { RunInvAccuracyCheck(1); }
static const FuncInfo dct_c_func_info[] = {
#if CONFIG_VP9_HIGHBITDEPTH
{ &fdct_wrapper<vpx_highbd_fdct4x4_c>,
&highbd_idct_wrapper<vpx_highbd_idct4x4_16_add_c>, 4, 2 },
{ &fdct_wrapper<vpx_highbd_fdct8x8_c>,
&highbd_idct_wrapper<vpx_highbd_idct8x8_64_add_c>, 8, 2 },
{ &fdct_wrapper<vpx_highbd_fdct16x16_c>,
&highbd_idct_wrapper<vpx_highbd_idct16x16_256_add_c>, 16, 2 },
{ &fdct_wrapper<vpx_highbd_fdct32x32_c>,
&highbd_idct_wrapper<vpx_highbd_idct32x32_1024_add_c>, 32, 2 },
#endif
{ &fdct_wrapper<vpx_fdct4x4_c>, &idct_wrapper<vpx_idct4x4_16_add_c>, 4, 1 },
{ &fdct_wrapper<vpx_fdct8x8_c>, &idct_wrapper<vpx_idct8x8_64_add_c>, 8, 1 },
{ &fdct_wrapper<vpx_fdct16x16_c>, &idct_wrapper<vpx_idct16x16_256_add_c>, 16,
1 },
{ &fdct_wrapper<vpx_fdct32x32_c>, &idct_wrapper<vpx_idct32x32_1024_add_c>, 32,
1 }
};
INSTANTIATE_TEST_CASE_P(
C, TransDCT,
::testing::Combine(
::testing::Range(0, static_cast<int>(sizeof(dct_c_func_info) /
sizeof(dct_c_func_info[0]))),
::testing::Values(dct_c_func_info), ::testing::Values(0),
::testing::Values(VPX_BITS_8, VPX_BITS_10, VPX_BITS_12)));
#if !CONFIG_EMULATE_HARDWARE
#if HAVE_SSE2
static const FuncInfo dct_sse2_func_info[] = {
#if CONFIG_VP9_HIGHBITDEPTH
{ &fdct_wrapper<vpx_highbd_fdct4x4_sse2>,
&highbd_idct_wrapper<vpx_highbd_idct4x4_16_add_sse2>, 4, 2 },
{ &fdct_wrapper<vpx_highbd_fdct8x8_sse2>,
&highbd_idct_wrapper<vpx_highbd_idct8x8_64_add_sse2>, 8, 2 },
{ &fdct_wrapper<vpx_highbd_fdct16x16_sse2>,
&highbd_idct_wrapper<vpx_highbd_idct16x16_256_add_sse2>, 16, 2 },
{ &fdct_wrapper<vpx_highbd_fdct32x32_sse2>,
&highbd_idct_wrapper<vpx_highbd_idct32x32_1024_add_sse2>, 32, 2 },
#endif
{ &fdct_wrapper<vpx_fdct4x4_sse2>, &idct_wrapper<vpx_idct4x4_16_add_sse2>, 4,
1 },
{ &fdct_wrapper<vpx_fdct8x8_sse2>, &idct_wrapper<vpx_idct8x8_64_add_sse2>, 8,
1 },
{ &fdct_wrapper<vpx_fdct16x16_sse2>,
&idct_wrapper<vpx_idct16x16_256_add_sse2>, 16, 1 },
{ &fdct_wrapper<vpx_fdct32x32_sse2>,
&idct_wrapper<vpx_idct32x32_1024_add_sse2>, 32, 1 }
};
INSTANTIATE_TEST_CASE_P(
SSE2, TransDCT,
::testing::Combine(
::testing::Range(0, static_cast<int>(sizeof(dct_sse2_func_info) /
sizeof(dct_sse2_func_info[0]))),
::testing::Values(dct_sse2_func_info), ::testing::Values(0),
::testing::Values(VPX_BITS_8, VPX_BITS_10, VPX_BITS_12)));
#endif // HAVE_SSE2
#if HAVE_SSSE3 && !CONFIG_VP9_HIGHBITDEPTH && ARCH_X86_64
// vpx_fdct8x8_ssse3 is only available in 64 bit builds.
static const FuncInfo dct_ssse3_func_info = {
&fdct_wrapper<vpx_fdct8x8_ssse3>, &idct_wrapper<vpx_idct8x8_64_add_sse2>, 8, 1
};
// TODO(johannkoenig): high bit depth fdct8x8.
INSTANTIATE_TEST_CASE_P(SSSE3, TransDCT,
::testing::Values(make_tuple(0, &dct_ssse3_func_info, 0,
VPX_BITS_8)));
#endif // HAVE_SSSE3 && !CONFIG_VP9_HIGHBITDEPTH && ARCH_X86_64
#if HAVE_AVX2 && !CONFIG_VP9_HIGHBITDEPTH
static const FuncInfo dct_avx2_func_info = {
&fdct_wrapper<vpx_fdct32x32_avx2>, &idct_wrapper<vpx_idct32x32_1024_add_sse2>,
32, 1
};
// TODO(johannkoenig): high bit depth fdct32x32.
INSTANTIATE_TEST_CASE_P(AVX2, TransDCT,
::testing::Values(make_tuple(0, &dct_avx2_func_info, 0,
VPX_BITS_8)));
#endif // HAVE_AVX2 && !CONFIG_VP9_HIGHBITDEPTH
#if HAVE_NEON
static const FuncInfo dct_neon_func_info[4] = {
{ &fdct_wrapper<vpx_fdct4x4_neon>, &idct_wrapper<vpx_idct4x4_16_add_neon>, 4,
1 },
{ &fdct_wrapper<vpx_fdct8x8_neon>, &idct_wrapper<vpx_idct8x8_64_add_neon>, 8,
1 },
{ &fdct_wrapper<vpx_fdct16x16_neon>,
&idct_wrapper<vpx_idct16x16_256_add_neon>, 16, 1 },
{ &fdct_wrapper<vpx_fdct32x32_neon>,
&idct_wrapper<vpx_idct32x32_1024_add_neon>, 32, 1 }
};
INSTANTIATE_TEST_CASE_P(
NEON, TransDCT,
::testing::Combine(::testing::Range(0, 4),
::testing::Values(dct_neon_func_info),
::testing::Values(0), ::testing::Values(VPX_BITS_8)));
#endif // HAVE_NEON
#if HAVE_MSA && !CONFIG_VP9_HIGHBITDEPTH
static const FuncInfo dct_msa_func_info[4] = {
{ &fdct_wrapper<vpx_fdct4x4_msa>, &idct_wrapper<vpx_idct4x4_16_add_msa>, 4,
1 },
{ &fdct_wrapper<vpx_fdct8x8_msa>, &idct_wrapper<vpx_idct8x8_64_add_msa>, 8,
1 },
{ &fdct_wrapper<vpx_fdct16x16_msa>, &idct_wrapper<vpx_idct16x16_256_add_msa>,
16, 1 },
{ &fdct_wrapper<vpx_fdct32x32_msa>, &idct_wrapper<vpx_idct32x32_1024_add_msa>,
32, 1 }
};
INSTANTIATE_TEST_CASE_P(MSA, TransDCT,
::testing::Combine(::testing::Range(0, 4),
::testing::Values(dct_msa_func_info),
::testing::Values(0),
::testing::Values(VPX_BITS_8)));
#endif // HAVE_MSA && !CONFIG_VP9_HIGHBITDEPTH
#if HAVE_VSX && !CONFIG_VP9_HIGHBITDEPTH
static const FuncInfo dct_vsx_func_info = {
&fdct_wrapper<vpx_fdct4x4_c>, &idct_wrapper<vpx_idct4x4_16_add_vsx>, 4, 1
};
INSTANTIATE_TEST_CASE_P(VSX, TransDCT,
::testing::Values(make_tuple(0, &dct_vsx_func_info, 0,
VPX_BITS_8)));
#endif // HAVE_VSX && !CONFIG_VP9_HIGHBITDEPTH &&
#endif // !CONFIG_EMULATE_HARDWARE
/* -------------------------------------------------------------------------- */
class TransHT : public TransTestBase {
public:
TransHT() { fwd_txfm_ref = fht_ref; }
};
TEST_P(TransHT, AccuracyCheck) {
RunAccuracyCheck(size_ == 16 && bit_depth_ > 10 && pixel_size_ == 2 ? 2 : 1);
}
TEST_P(TransHT, CoeffCheck) { RunCoeffCheck(); }
TEST_P(TransHT, MemCheck) { RunMemCheck(); }
TEST_P(TransHT, InvAccuracyCheck) { RunInvAccuracyCheck(1); }
static const FuncInfo ht_c_func_info[] = {
#if CONFIG_VP9_HIGHBITDEPTH
{ &vp9_highbd_fht4x4_c, &highbd_iht_wrapper<vp9_highbd_iht4x4_16_add_c>, 4,
2 },
{ &vp9_highbd_fht8x8_c, &highbd_iht_wrapper<vp9_highbd_iht8x8_64_add_c>, 8,
2 },
{ &vp9_highbd_fht16x16_c, &highbd_iht_wrapper<vp9_highbd_iht16x16_256_add_c>,
16, 2 },
#endif
{ &vp9_fht4x4_c, &iht_wrapper<vp9_iht4x4_16_add_c>, 4, 1 },
{ &vp9_fht8x8_c, &iht_wrapper<vp9_iht8x8_64_add_c>, 8, 1 },
{ &vp9_fht16x16_c, &iht_wrapper<vp9_iht16x16_256_add_c>, 16, 1 }
};
INSTANTIATE_TEST_CASE_P(
C, TransHT,
::testing::Combine(
::testing::Range(0, static_cast<int>(sizeof(ht_c_func_info) /
sizeof(ht_c_func_info[0]))),
::testing::Values(ht_c_func_info), ::testing::Range(0, 4),
::testing::Values(VPX_BITS_8, VPX_BITS_10, VPX_BITS_12)));
#if !CONFIG_EMULATE_HARDWARE
#if HAVE_NEON
static const FuncInfo ht_neon_func_info[] = {
#if CONFIG_VP9_HIGHBITDEPTH
{ &vp9_highbd_fht4x4_c, &highbd_iht_wrapper<vp9_highbd_iht4x4_16_add_neon>, 4,
2 },
{ &vp9_highbd_fht8x8_c, &highbd_iht_wrapper<vp9_highbd_iht8x8_64_add_neon>, 8,
2 },
{ &vp9_highbd_fht16x16_c,
&highbd_iht_wrapper<vp9_highbd_iht16x16_256_add_neon>, 16, 2 },
#endif
{ &vp9_fht4x4_c, &iht_wrapper<vp9_iht4x4_16_add_neon>, 4, 1 },
{ &vp9_fht8x8_c, &iht_wrapper<vp9_iht8x8_64_add_neon>, 8, 1 },
{ &vp9_fht16x16_c, &iht_wrapper<vp9_iht16x16_256_add_neon>, 16, 1 }
};
INSTANTIATE_TEST_CASE_P(
NEON, TransHT,
::testing::Combine(
::testing::Range(0, static_cast<int>(sizeof(ht_neon_func_info) /
sizeof(ht_neon_func_info[0]))),
::testing::Values(ht_neon_func_info), ::testing::Range(0, 4),
::testing::Values(VPX_BITS_8, VPX_BITS_10, VPX_BITS_12)));
#endif // HAVE_NEON
#if HAVE_SSE2
static const FuncInfo ht_sse2_func_info[3] = {
{ &vp9_fht4x4_sse2, &iht_wrapper<vp9_iht4x4_16_add_sse2>, 4, 1 },
{ &vp9_fht8x8_sse2, &iht_wrapper<vp9_iht8x8_64_add_sse2>, 8, 1 },
{ &vp9_fht16x16_sse2, &iht_wrapper<vp9_iht16x16_256_add_sse2>, 16, 1 }
};
INSTANTIATE_TEST_CASE_P(SSE2, TransHT,
::testing::Combine(::testing::Range(0, 3),
::testing::Values(ht_sse2_func_info),
::testing::Range(0, 4),
::testing::Values(VPX_BITS_8)));
#endif // HAVE_SSE2
#if HAVE_SSE4_1 && CONFIG_VP9_HIGHBITDEPTH
static const FuncInfo ht_sse4_1_func_info[3] = {
{ &vp9_highbd_fht4x4_c, &highbd_iht_wrapper<vp9_highbd_iht4x4_16_add_sse4_1>,
4, 2 },
{ vp9_highbd_fht8x8_c, &highbd_iht_wrapper<vp9_highbd_iht8x8_64_add_sse4_1>,
8, 2 },
{ &vp9_highbd_fht16x16_c,
&highbd_iht_wrapper<vp9_highbd_iht16x16_256_add_sse4_1>, 16, 2 }
};
INSTANTIATE_TEST_CASE_P(
SSE4_1, TransHT,
::testing::Combine(::testing::Range(0, 3),
::testing::Values(ht_sse4_1_func_info),
::testing::Range(0, 4),
::testing::Values(VPX_BITS_8, VPX_BITS_10,
VPX_BITS_12)));
#endif // HAVE_SSE4_1 && CONFIG_VP9_HIGHBITDEPTH
#endif // !CONFIG_EMULATE_HARDWARE
/* -------------------------------------------------------------------------- */
class TransWHT : public TransTestBase {
public:
TransWHT() { fwd_txfm_ref = fwht_ref; }
};
TEST_P(TransWHT, AccuracyCheck) { RunAccuracyCheck(0); }
TEST_P(TransWHT, CoeffCheck) { RunCoeffCheck(); }
TEST_P(TransWHT, MemCheck) { RunMemCheck(); }
TEST_P(TransWHT, InvAccuracyCheck) { RunInvAccuracyCheck(0); }
static const FuncInfo wht_c_func_info[] = {
#if CONFIG_VP9_HIGHBITDEPTH
{ &fdct_wrapper<vp9_highbd_fwht4x4_c>,
&highbd_idct_wrapper<vpx_highbd_iwht4x4_16_add_c>, 4, 2 },
#endif
{ &fdct_wrapper<vp9_fwht4x4_c>, &idct_wrapper<vpx_iwht4x4_16_add_c>, 4, 1 }
};
INSTANTIATE_TEST_CASE_P(
C, TransWHT,
::testing::Combine(
::testing::Range(0, static_cast<int>(sizeof(wht_c_func_info) /
sizeof(wht_c_func_info[0]))),
::testing::Values(wht_c_func_info), ::testing::Values(0),
::testing::Values(VPX_BITS_8, VPX_BITS_10, VPX_BITS_12)));
#if HAVE_SSE2 && !CONFIG_EMULATE_HARDWARE
static const FuncInfo wht_sse2_func_info = {
&fdct_wrapper<vp9_fwht4x4_sse2>, &idct_wrapper<vpx_iwht4x4_16_add_sse2>, 4, 1
};
INSTANTIATE_TEST_CASE_P(SSE2, TransWHT,
::testing::Values(make_tuple(0, &wht_sse2_func_info, 0,
VPX_BITS_8)));
#endif // HAVE_SSE2 && !CONFIG_EMULATE_HARDWARE
} // namespace

View File

@ -7,10 +7,11 @@
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#include "third_party/googletest/src/include/gtest/gtest.h"
#include "test/ivf_video_source.h"
#include "./vpx_config.h"
#include "test/ivf_video_source.h"
#include "vpx/vp8dx.h"
#include "vpx/vpx_decoder.h"
@ -27,7 +28,7 @@ TEST(DecodeAPI, InvalidParams) {
&vpx_codec_vp9_dx_algo,
#endif
};
uint8_t buf[1] = {0};
uint8_t buf[1] = { 0 };
vpx_codec_ctx_t dec;
EXPECT_EQ(VPX_CODEC_INVALID_PARAM, vpx_codec_dec_init(NULL, NULL, NULL, 0));
@ -50,8 +51,7 @@ TEST(DecodeAPI, InvalidParams) {
vpx_codec_decode(&dec, buf, NELEMENTS(buf), NULL, 0));
EXPECT_EQ(VPX_CODEC_INVALID_PARAM,
vpx_codec_decode(&dec, NULL, NELEMENTS(buf), NULL, 0));
EXPECT_EQ(VPX_CODEC_INVALID_PARAM,
vpx_codec_decode(&dec, buf, 0, NULL, 0));
EXPECT_EQ(VPX_CODEC_INVALID_PARAM, vpx_codec_decode(&dec, buf, 0, NULL, 0));
EXPECT_EQ(VPX_CODEC_OK, vpx_codec_destroy(&dec));
}
@ -76,12 +76,9 @@ TEST(DecodeAPI, OptionalParams) {
// Test VP9 codec controls after a decode error to ensure the code doesn't
// misbehave.
void TestVp9Controls(vpx_codec_ctx_t *dec) {
static const int kControls[] = {
VP8D_GET_LAST_REF_UPDATES,
VP8D_GET_FRAME_CORRUPTED,
VP9D_GET_DISPLAY_SIZE,
VP9D_GET_FRAME_SIZE
};
static const int kControls[] = { VP8D_GET_LAST_REF_UPDATES,
VP8D_GET_FRAME_CORRUPTED,
VP9D_GET_DISPLAY_SIZE, VP9D_GET_FRAME_SIZE };
int val[2];
for (int i = 0; i < NELEMENTS(kControls); ++i) {
@ -90,9 +87,7 @@ void TestVp9Controls(vpx_codec_ctx_t *dec) {
case VP8D_GET_FRAME_CORRUPTED:
EXPECT_EQ(VPX_CODEC_ERROR, res) << kControls[i];
break;
default:
EXPECT_EQ(VPX_CODEC_OK, res) << kControls[i];
break;
default: EXPECT_EQ(VPX_CODEC_OK, res) << kControls[i]; break;
}
EXPECT_EQ(VPX_CODEC_INVALID_PARAM,
vpx_codec_control_(dec, kControls[i], NULL));
@ -129,14 +124,69 @@ TEST(DecodeAPI, Vp9InvalidDecode) {
vpx_codec_ctx_t dec;
EXPECT_EQ(VPX_CODEC_OK, vpx_codec_dec_init(&dec, codec, NULL, 0));
const uint32_t frame_size = static_cast<uint32_t>(video.frame_size());
#if CONFIG_VP9_HIGHBITDEPTH
EXPECT_EQ(VPX_CODEC_MEM_ERROR,
vpx_codec_decode(&dec, video.cxdata(), frame_size, NULL, 0));
#else
EXPECT_EQ(VPX_CODEC_UNSUP_BITSTREAM,
vpx_codec_decode(&dec, video.cxdata(), frame_size, NULL, 0));
#endif
vpx_codec_iter_t iter = NULL;
EXPECT_EQ(NULL, vpx_codec_get_frame(&dec, &iter));
TestVp9Controls(&dec);
EXPECT_EQ(VPX_CODEC_OK, vpx_codec_destroy(&dec));
}
TEST(DecodeAPI, Vp9PeekSI) {
const vpx_codec_iface_t *const codec = &vpx_codec_vp9_dx_algo;
// The first 9 bytes are valid and the rest of the bytes are made up. Until
// size 10, this should return VPX_CODEC_UNSUP_BITSTREAM and after that it
// should return VPX_CODEC_CORRUPT_FRAME.
const uint8_t data[32] = {
0x85, 0xa4, 0xc1, 0xa1, 0x38, 0x81, 0xa3, 0x49, 0x83, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
};
for (uint32_t data_sz = 1; data_sz <= 32; ++data_sz) {
// Verify behavior of vpx_codec_decode. vpx_codec_decode doesn't even get
// to decoder_peek_si_internal on frames of size < 8.
if (data_sz >= 8) {
vpx_codec_ctx_t dec;
EXPECT_EQ(VPX_CODEC_OK, vpx_codec_dec_init(&dec, codec, NULL, 0));
EXPECT_EQ(
(data_sz < 10) ? VPX_CODEC_UNSUP_BITSTREAM : VPX_CODEC_CORRUPT_FRAME,
vpx_codec_decode(&dec, data, data_sz, NULL, 0));
vpx_codec_iter_t iter = NULL;
EXPECT_EQ(NULL, vpx_codec_get_frame(&dec, &iter));
EXPECT_EQ(VPX_CODEC_OK, vpx_codec_destroy(&dec));
}
// Verify behavior of vpx_codec_peek_stream_info.
vpx_codec_stream_info_t si;
si.sz = sizeof(si);
EXPECT_EQ((data_sz < 10) ? VPX_CODEC_UNSUP_BITSTREAM : VPX_CODEC_OK,
vpx_codec_peek_stream_info(codec, data, data_sz, &si));
}
}
#endif // CONFIG_VP9_DECODER
TEST(DecodeAPI, HighBitDepthCapability) {
// VP8 should not claim VP9 HBD as a capability.
#if CONFIG_VP8_DECODER
const vpx_codec_caps_t vp8_caps = vpx_codec_get_caps(&vpx_codec_vp8_dx_algo);
EXPECT_EQ(vp8_caps & VPX_CODEC_CAP_HIGHBITDEPTH, 0);
#endif
#if CONFIG_VP9_DECODER
const vpx_codec_caps_t vp9_caps = vpx_codec_get_caps(&vpx_codec_vp9_dx_algo);
#if CONFIG_VP9_HIGHBITDEPTH
EXPECT_EQ(vp9_caps & VPX_CODEC_CAP_HIGHBITDEPTH, VPX_CODEC_CAP_HIGHBITDEPTH);
#else
EXPECT_EQ(vp9_caps & VPX_CODEC_CAP_HIGHBITDEPTH, 0);
#endif
#endif
}
} // namespace

View File

@ -21,21 +21,20 @@
#include "./ivfenc.h"
#include "./vpx_version.h"
using std::tr1::make_tuple;
using ::testing::make_tuple;
namespace {
#define VIDEO_NAME 0
#define THREADS 1
const int kMaxPsnr = 100;
const double kUsecsInSec = 1000000.0;
const char kNewEncodeOutputFile[] = "new_encode.ivf";
/*
DecodePerfTest takes a tuple of filename + number of threads to decode with
*/
typedef std::tr1::tuple<const char *, unsigned> DecodePerfParam;
typedef ::testing::tuple<const char *, unsigned> DecodePerfParam;
const DecodePerfParam kVP9DecodePerfVectors[] = {
make_tuple("vp90-2-bbb_426x240_tile_1x1_180kbps.webm", 1),
@ -70,8 +69,7 @@ const DecodePerfParam kVP9DecodePerfVectors[] = {
power/temp/min max frame decode times/etc
*/
class DecodePerfTest : public ::testing::TestWithParam<DecodePerfParam> {
};
class DecodePerfTest : public ::testing::TestWithParam<DecodePerfParam> {};
TEST_P(DecodePerfTest, PerfTest) {
const char *const video_name = GET_PARAM(VIDEO_NAME);
@ -92,8 +90,7 @@ TEST_P(DecodePerfTest, PerfTest) {
}
vpx_usec_timer_mark(&t);
const double elapsed_secs = double(vpx_usec_timer_elapsed(&t))
/ kUsecsInSec;
const double elapsed_secs = double(vpx_usec_timer_elapsed(&t)) / kUsecsInSec;
const unsigned frames = video.frame_number();
const double fps = double(frames) / elapsed_secs;
@ -111,17 +108,13 @@ TEST_P(DecodePerfTest, PerfTest) {
INSTANTIATE_TEST_CASE_P(VP9, DecodePerfTest,
::testing::ValuesIn(kVP9DecodePerfVectors));
class VP9NewEncodeDecodePerfTest :
public ::libvpx_test::EncoderTest,
public ::libvpx_test::CodecTestWithParam<libvpx_test::TestMode> {
class VP9NewEncodeDecodePerfTest
: public ::libvpx_test::EncoderTest,
public ::libvpx_test::CodecTestWithParam<libvpx_test::TestMode> {
protected:
VP9NewEncodeDecodePerfTest()
: EncoderTest(GET_PARAM(0)),
encoding_mode_(GET_PARAM(1)),
speed_(0),
outfile_(0),
out_frames_(0) {
}
: EncoderTest(GET_PARAM(0)), encoding_mode_(GET_PARAM(1)), speed_(0),
outfile_(0), out_frames_(0) {}
virtual ~VP9NewEncodeDecodePerfTest() {}
@ -160,8 +153,9 @@ class VP9NewEncodeDecodePerfTest :
virtual void EndPassHook() {
if (outfile_ != NULL) {
if (!fseek(outfile_, 0, SEEK_SET))
if (!fseek(outfile_, 0, SEEK_SET)) {
ivf_write_file_header(outfile_, &cfg_, VP9_FOURCC, out_frames_);
}
fclose(outfile_);
outfile_ = NULL;
}
@ -171,8 +165,9 @@ class VP9NewEncodeDecodePerfTest :
++out_frames_;
// Write initial file header if first frame.
if (pkt->data.frame.pts == 0)
if (pkt->data.frame.pts == 0) {
ivf_write_file_header(outfile_, &cfg_, VP9_FOURCC, out_frames_);
}
// Write frame header and data.
ivf_write_frame_header(outfile_, out_frames_, pkt->data.frame.sz);
@ -180,11 +175,9 @@ class VP9NewEncodeDecodePerfTest :
pkt->data.frame.sz);
}
virtual bool DoDecode() { return false; }
virtual bool DoDecode() const { return false; }
void set_speed(unsigned int speed) {
speed_ = speed;
}
void set_speed(unsigned int speed) { speed_ = speed; }
private:
libvpx_test::TestMode encoding_mode_;
@ -196,10 +189,7 @@ class VP9NewEncodeDecodePerfTest :
struct EncodePerfTestVideo {
EncodePerfTestVideo(const char *name_, uint32_t width_, uint32_t height_,
uint32_t bitrate_, int frames_)
: name(name_),
width(width_),
height(height_),
bitrate(bitrate_),
: name(name_), width(width_), height(height_), bitrate(bitrate_),
frames(frames_) {}
const char *name;
uint32_t width;
@ -225,10 +215,8 @@ TEST_P(VP9NewEncodeDecodePerfTest, PerfTest) {
const char *video_name = kVP9EncodePerfTestVectors[i].name;
libvpx_test::I420VideoSource video(
video_name,
kVP9EncodePerfTestVectors[i].width,
kVP9EncodePerfTestVectors[i].height,
timebase.den, timebase.num, 0,
video_name, kVP9EncodePerfTestVectors[i].width,
kVP9EncodePerfTestVectors[i].height, timebase.den, timebase.num, 0,
kVP9EncodePerfTestVectors[i].frames);
set_speed(2);
@ -268,6 +256,6 @@ TEST_P(VP9NewEncodeDecodePerfTest, PerfTest) {
printf("}\n");
}
VP9_INSTANTIATE_TEST_CASE(
VP9NewEncodeDecodePerfTest, ::testing::Values(::libvpx_test::kTwoPassGood));
VP9_INSTANTIATE_TEST_CASE(VP9NewEncodeDecodePerfTest,
::testing::Values(::libvpx_test::kTwoPassGood));
} // namespace

124
test/decode_svc_test.cc Normal file
View File

@ -0,0 +1,124 @@
/*
* Copyright (c) 2016 The WebM project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#include <string>
#include "test/codec_factory.h"
#include "test/decode_test_driver.h"
#include "test/ivf_video_source.h"
#include "test/test_vectors.h"
#include "test/util.h"
namespace {
const unsigned int kNumFrames = 19;
class DecodeSvcTest : public ::libvpx_test::DecoderTest,
public ::libvpx_test::CodecTestWithParam<const char *> {
protected:
DecodeSvcTest() : DecoderTest(GET_PARAM(::libvpx_test::kCodecFactoryParam)) {}
virtual ~DecodeSvcTest() {}
virtual void PreDecodeFrameHook(
const libvpx_test::CompressedVideoSource &video,
libvpx_test::Decoder *decoder) {
if (video.frame_number() == 0)
decoder->Control(VP9_DECODE_SVC_SPATIAL_LAYER, spatial_layer_);
}
virtual void DecompressedFrameHook(const vpx_image_t &img,
const unsigned int frame_number) {
ASSERT_EQ(img.d_w, width_);
ASSERT_EQ(img.d_h, height_);
total_frames_ = frame_number;
}
int spatial_layer_;
unsigned int width_;
unsigned int height_;
unsigned int total_frames_;
};
// SVC test vector is 1280x720, with 3 spatial layers, and 20 frames.
// Decode the SVC test vector, which has 3 spatial layers, and decode up to
// spatial layer 0. Verify the resolution of each decoded frame and the total
// number of frames decoded. This results in 1/4x1/4 resolution (320x180).
TEST_P(DecodeSvcTest, DecodeSvcTestUpToSpatialLayer0) {
const std::string filename = GET_PARAM(1);
testing::internal::scoped_ptr<libvpx_test::CompressedVideoSource> video;
video.reset(new libvpx_test::IVFVideoSource(filename));
ASSERT_TRUE(video.get() != NULL);
video->Init();
total_frames_ = 0;
spatial_layer_ = 0;
width_ = 320;
height_ = 180;
ASSERT_NO_FATAL_FAILURE(RunLoop(video.get()));
ASSERT_EQ(total_frames_, kNumFrames);
}
// Decode the SVC test vector, which has 3 spatial layers, and decode up to
// spatial layer 1. Verify the resolution of each decoded frame and the total
// number of frames decoded. This results in 1/2x1/2 resolution (640x360).
TEST_P(DecodeSvcTest, DecodeSvcTestUpToSpatialLayer1) {
const std::string filename = GET_PARAM(1);
testing::internal::scoped_ptr<libvpx_test::CompressedVideoSource> video;
video.reset(new libvpx_test::IVFVideoSource(filename));
ASSERT_TRUE(video.get() != NULL);
video->Init();
total_frames_ = 0;
spatial_layer_ = 1;
width_ = 640;
height_ = 360;
ASSERT_NO_FATAL_FAILURE(RunLoop(video.get()));
ASSERT_EQ(total_frames_, kNumFrames);
}
// Decode the SVC test vector, which has 3 spatial layers, and decode up to
// spatial layer 2. Verify the resolution of each decoded frame and the total
// number of frames decoded. This results in the full resolution (1280x720).
TEST_P(DecodeSvcTest, DecodeSvcTestUpToSpatialLayer2) {
const std::string filename = GET_PARAM(1);
testing::internal::scoped_ptr<libvpx_test::CompressedVideoSource> video;
video.reset(new libvpx_test::IVFVideoSource(filename));
ASSERT_TRUE(video.get() != NULL);
video->Init();
total_frames_ = 0;
spatial_layer_ = 2;
width_ = 1280;
height_ = 720;
ASSERT_NO_FATAL_FAILURE(RunLoop(video.get()));
ASSERT_EQ(total_frames_, kNumFrames);
}
// Decode the SVC test vector, which has 3 spatial layers, and decode up to
// spatial layer 10. Verify the resolution of each decoded frame and the total
// number of frames decoded. This is beyond the number of spatial layers, so
// the decoding should result in the full resolution (1280x720).
TEST_P(DecodeSvcTest, DecodeSvcTestUpToSpatialLayer10) {
const std::string filename = GET_PARAM(1);
testing::internal::scoped_ptr<libvpx_test::CompressedVideoSource> video;
video.reset(new libvpx_test::IVFVideoSource(filename));
ASSERT_TRUE(video.get() != NULL);
video->Init();
total_frames_ = 0;
spatial_layer_ = 10;
width_ = 1280;
height_ = 720;
ASSERT_NO_FATAL_FAILURE(RunLoop(video.get()));
ASSERT_EQ(total_frames_, kNumFrames);
}
VP9_INSTANTIATE_TEST_CASE(
DecodeSvcTest, ::testing::ValuesIn(libvpx_test::kVP9TestVectorsSvc,
libvpx_test::kVP9TestVectorsSvc +
libvpx_test::kNumVP9TestVectorsSvc));
} // namespace

View File

@ -7,9 +7,11 @@
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#include "third_party/googletest/src/include/gtest/gtest.h"
#include "test/codec_factory.h"
#include "test/decode_test_driver.h"
#include "third_party/googletest/src/include/gtest/gtest.h"
#include "test/register_state_check.h"
#include "test/video_source.h"
@ -19,9 +21,8 @@ const char kVP8Name[] = "WebM Project VP8";
vpx_codec_err_t Decoder::PeekStream(const uint8_t *cxdata, size_t size,
vpx_codec_stream_info_t *stream_info) {
return vpx_codec_peek_stream_info(CodecInterface(),
cxdata, static_cast<unsigned int>(size),
stream_info);
return vpx_codec_peek_stream_info(
CodecInterface(), cxdata, static_cast<unsigned int>(size), stream_info);
}
vpx_codec_err_t Decoder::DecodeFrame(const uint8_t *cxdata, size_t size) {
@ -33,9 +34,8 @@ vpx_codec_err_t Decoder::DecodeFrame(const uint8_t *cxdata, size_t size,
vpx_codec_err_t res_dec;
InitOnce();
API_REGISTER_STATE_CHECK(
res_dec = vpx_codec_decode(&decoder_,
cxdata, static_cast<unsigned int>(size),
user_priv, 0));
res_dec = vpx_codec_decode(
&decoder_, cxdata, static_cast<unsigned int>(size), user_priv, 0));
return res_dec;
}
@ -52,20 +52,21 @@ void DecoderTest::HandlePeekResult(Decoder *const decoder,
/* Vp8's implementation of PeekStream returns an error if the frame you
* pass it is not a keyframe, so we only expect VPX_CODEC_OK on the first
* frame, which must be a keyframe. */
if (video->frame_number() == 0)
ASSERT_EQ(VPX_CODEC_OK, res_peek) << "Peek return failed: "
<< vpx_codec_err_to_string(res_peek);
if (video->frame_number() == 0) {
ASSERT_EQ(VPX_CODEC_OK, res_peek)
<< "Peek return failed: " << vpx_codec_err_to_string(res_peek);
}
} else {
/* The Vp9 implementation of PeekStream returns an error only if the
* data passed to it isn't a valid Vp9 chunk. */
ASSERT_EQ(VPX_CODEC_OK, res_peek) << "Peek return failed: "
<< vpx_codec_err_to_string(res_peek);
ASSERT_EQ(VPX_CODEC_OK, res_peek)
<< "Peek return failed: " << vpx_codec_err_to_string(res_peek);
}
}
void DecoderTest::RunLoop(CompressedVideoSource *video,
const vpx_codec_dec_cfg_t &dec_cfg) {
Decoder* const decoder = codec_->CreateDecoder(dec_cfg, flags_, 0);
Decoder *const decoder = codec_->CreateDecoder(dec_cfg, flags_);
ASSERT_TRUE(decoder != NULL);
bool end_of_file = false;
@ -78,16 +79,14 @@ void DecoderTest::RunLoop(CompressedVideoSource *video,
stream_info.sz = sizeof(stream_info);
if (video->cxdata() != NULL) {
const vpx_codec_err_t res_peek = decoder->PeekStream(video->cxdata(),
video->frame_size(),
&stream_info);
const vpx_codec_err_t res_peek = decoder->PeekStream(
video->cxdata(), video->frame_size(), &stream_info);
HandlePeekResult(decoder, video, res_peek);
ASSERT_FALSE(::testing::Test::HasFailure());
vpx_codec_err_t res_dec = decoder->DecodeFrame(video->cxdata(),
video->frame_size());
if (!HandleDecodeResult(res_dec, *video, decoder))
break;
vpx_codec_err_t res_dec =
decoder->DecodeFrame(video->cxdata(), video->frame_size());
if (!HandleDecodeResult(res_dec, *video, decoder)) break;
} else {
// Signal end of the file to the decoder.
const vpx_codec_err_t res_dec = decoder->DecodeFrame(NULL, 0);
@ -99,8 +98,9 @@ void DecoderTest::RunLoop(CompressedVideoSource *video,
const vpx_image_t *img = NULL;
// Get decompressed data
while ((img = dec_iter.Next()))
while ((img = dec_iter.Next())) {
DecompressedFrameHook(*img, video->frame_number());
}
}
delete decoder;
}
@ -114,8 +114,6 @@ void DecoderTest::set_cfg(const vpx_codec_dec_cfg_t &dec_cfg) {
memcpy(&cfg_, &dec_cfg, sizeof(cfg_));
}
void DecoderTest::set_flags(const vpx_codec_flags_t flags) {
flags_ = flags;
}
void DecoderTest::set_flags(const vpx_codec_flags_t flags) { flags_ = flags; }
} // namespace libvpx_test

View File

@ -26,13 +26,11 @@ class DxDataIterator {
explicit DxDataIterator(vpx_codec_ctx_t *decoder)
: decoder_(decoder), iter_(NULL) {}
const vpx_image_t *Next() {
return vpx_codec_get_frame(decoder_, &iter_);
}
const vpx_image_t *Next() { return vpx_codec_get_frame(decoder_, &iter_); }
private:
vpx_codec_ctx_t *decoder_;
vpx_codec_iter_t iter_;
vpx_codec_ctx_t *decoder_;
vpx_codec_iter_t iter_;
};
// Provides a simplified interface to manage one video decoding.
@ -40,20 +38,17 @@ class DxDataIterator {
// as more tests are added.
class Decoder {
public:
Decoder(vpx_codec_dec_cfg_t cfg, unsigned long deadline)
: cfg_(cfg), flags_(0), deadline_(deadline), init_done_(false) {
explicit Decoder(vpx_codec_dec_cfg_t cfg)
: cfg_(cfg), flags_(0), init_done_(false) {
memset(&decoder_, 0, sizeof(decoder_));
}
Decoder(vpx_codec_dec_cfg_t cfg, const vpx_codec_flags_t flag,
unsigned long deadline) // NOLINT
: cfg_(cfg), flags_(flag), deadline_(deadline), init_done_(false) {
Decoder(vpx_codec_dec_cfg_t cfg, const vpx_codec_flags_t flag)
: cfg_(cfg), flags_(flag), init_done_(false) {
memset(&decoder_, 0, sizeof(decoder_));
}
virtual ~Decoder() {
vpx_codec_destroy(&decoder_);
}
virtual ~Decoder() { vpx_codec_destroy(&decoder_); }
vpx_codec_err_t PeekStream(const uint8_t *cxdata, size_t size,
vpx_codec_stream_info_t *stream_info);
@ -63,17 +58,9 @@ class Decoder {
vpx_codec_err_t DecodeFrame(const uint8_t *cxdata, size_t size,
void *user_priv);
DxDataIterator GetDxData() {
return DxDataIterator(&decoder_);
}
DxDataIterator GetDxData() { return DxDataIterator(&decoder_); }
void set_deadline(unsigned long deadline) {
deadline_ = deadline;
}
void Control(int ctrl_id, int arg) {
Control(ctrl_id, arg, VPX_CODEC_OK);
}
void Control(int ctrl_id, int arg) { Control(ctrl_id, arg, VPX_CODEC_OK); }
void Control(int ctrl_id, const void *arg) {
InitOnce();
@ -87,7 +74,7 @@ class Decoder {
ASSERT_EQ(expected_value, res) << DecodeError();
}
const char* DecodeError() {
const char *DecodeError() {
const char *detail = vpx_codec_error_detail(&decoder_);
return detail ? detail : vpx_codec_error(&decoder_);
}
@ -97,38 +84,34 @@ class Decoder {
vpx_get_frame_buffer_cb_fn_t cb_get,
vpx_release_frame_buffer_cb_fn_t cb_release, void *user_priv) {
InitOnce();
return vpx_codec_set_frame_buffer_functions(
&decoder_, cb_get, cb_release, user_priv);
return vpx_codec_set_frame_buffer_functions(&decoder_, cb_get, cb_release,
user_priv);
}
const char* GetDecoderName() const {
const char *GetDecoderName() const {
return vpx_codec_iface_name(CodecInterface());
}
bool IsVP8() const;
vpx_codec_ctx_t * GetDecoder() {
return &decoder_;
}
vpx_codec_ctx_t *GetDecoder() { return &decoder_; }
protected:
virtual vpx_codec_iface_t* CodecInterface() const = 0;
virtual vpx_codec_iface_t *CodecInterface() const = 0;
void InitOnce() {
if (!init_done_) {
const vpx_codec_err_t res = vpx_codec_dec_init(&decoder_,
CodecInterface(),
&cfg_, flags_);
const vpx_codec_err_t res =
vpx_codec_dec_init(&decoder_, CodecInterface(), &cfg_, flags_);
ASSERT_EQ(VPX_CODEC_OK, res) << DecodeError();
init_done_ = true;
}
}
vpx_codec_ctx_t decoder_;
vpx_codec_ctx_t decoder_;
vpx_codec_dec_cfg_t cfg_;
vpx_codec_flags_t flags_;
unsigned int deadline_;
bool init_done_;
vpx_codec_flags_t flags_;
bool init_done_;
};
// Common test functionality for all Decoder tests.
@ -143,37 +126,35 @@ class DecoderTest {
virtual void set_flags(const vpx_codec_flags_t flags);
// Hook to be called before decompressing every frame.
virtual void PreDecodeFrameHook(const CompressedVideoSource& /*video*/,
Decoder* /*decoder*/) {}
virtual void PreDecodeFrameHook(const CompressedVideoSource & /*video*/,
Decoder * /*decoder*/) {}
// Hook to be called to handle decode result. Return true to continue.
virtual bool HandleDecodeResult(const vpx_codec_err_t res_dec,
const CompressedVideoSource& /*video*/,
const CompressedVideoSource & /*video*/,
Decoder *decoder) {
EXPECT_EQ(VPX_CODEC_OK, res_dec) << decoder->DecodeError();
return VPX_CODEC_OK == res_dec;
}
// Hook to be called on every decompressed frame.
virtual void DecompressedFrameHook(const vpx_image_t& /*img*/,
virtual void DecompressedFrameHook(const vpx_image_t & /*img*/,
const unsigned int /*frame_number*/) {}
// Hook to be called on peek result
virtual void HandlePeekResult(Decoder* const decoder,
virtual void HandlePeekResult(Decoder *const decoder,
CompressedVideoSource *video,
const vpx_codec_err_t res_peek);
protected:
explicit DecoderTest(const CodecFactory *codec)
: codec_(codec),
cfg_(),
flags_(0) {}
: codec_(codec), cfg_(), flags_(0) {}
virtual ~DecoderTest() {}
const CodecFactory *codec_;
vpx_codec_dec_cfg_t cfg_;
vpx_codec_flags_t flags_;
vpx_codec_flags_t flags_;
};
} // namespace libvpx_test

195
test/encode_api_test.cc Normal file
View File

@ -0,0 +1,195 @@
/*
* Copyright (c) 2016 The WebM project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#include "third_party/googletest/src/include/gtest/gtest.h"
#include "./vpx_config.h"
#include "vpx/vp8cx.h"
#include "vpx/vpx_encoder.h"
namespace {
#define NELEMENTS(x) static_cast<int>(sizeof(x) / sizeof(x[0]))
TEST(EncodeAPI, InvalidParams) {
static const vpx_codec_iface_t *kCodecs[] = {
#if CONFIG_VP8_ENCODER
&vpx_codec_vp8_cx_algo,
#endif
#if CONFIG_VP9_ENCODER
&vpx_codec_vp9_cx_algo,
#endif
};
uint8_t buf[1] = { 0 };
vpx_image_t img;
vpx_codec_ctx_t enc;
vpx_codec_enc_cfg_t cfg;
EXPECT_EQ(&img, vpx_img_wrap(&img, VPX_IMG_FMT_I420, 1, 1, 1, buf));
EXPECT_EQ(VPX_CODEC_INVALID_PARAM, vpx_codec_enc_init(NULL, NULL, NULL, 0));
EXPECT_EQ(VPX_CODEC_INVALID_PARAM, vpx_codec_enc_init(&enc, NULL, NULL, 0));
EXPECT_EQ(VPX_CODEC_INVALID_PARAM, vpx_codec_encode(NULL, NULL, 0, 0, 0, 0));
EXPECT_EQ(VPX_CODEC_INVALID_PARAM, vpx_codec_encode(NULL, &img, 0, 0, 0, 0));
EXPECT_EQ(VPX_CODEC_INVALID_PARAM, vpx_codec_destroy(NULL));
EXPECT_EQ(VPX_CODEC_INVALID_PARAM,
vpx_codec_enc_config_default(NULL, NULL, 0));
EXPECT_EQ(VPX_CODEC_INVALID_PARAM,
vpx_codec_enc_config_default(NULL, &cfg, 0));
EXPECT_TRUE(vpx_codec_error(NULL) != NULL);
for (int i = 0; i < NELEMENTS(kCodecs); ++i) {
SCOPED_TRACE(vpx_codec_iface_name(kCodecs[i]));
EXPECT_EQ(VPX_CODEC_INVALID_PARAM,
vpx_codec_enc_init(NULL, kCodecs[i], NULL, 0));
EXPECT_EQ(VPX_CODEC_INVALID_PARAM,
vpx_codec_enc_init(&enc, kCodecs[i], NULL, 0));
EXPECT_EQ(VPX_CODEC_INVALID_PARAM,
vpx_codec_enc_config_default(kCodecs[i], &cfg, 1));
EXPECT_EQ(VPX_CODEC_OK, vpx_codec_enc_config_default(kCodecs[i], &cfg, 0));
EXPECT_EQ(VPX_CODEC_OK, vpx_codec_enc_init(&enc, kCodecs[i], &cfg, 0));
EXPECT_EQ(VPX_CODEC_OK, vpx_codec_encode(&enc, NULL, 0, 0, 0, 0));
EXPECT_EQ(VPX_CODEC_OK, vpx_codec_destroy(&enc));
}
}
TEST(EncodeAPI, HighBitDepthCapability) {
// VP8 should not claim VP9 HBD as a capability.
#if CONFIG_VP8_ENCODER
const vpx_codec_caps_t vp8_caps = vpx_codec_get_caps(&vpx_codec_vp8_cx_algo);
EXPECT_EQ(vp8_caps & VPX_CODEC_CAP_HIGHBITDEPTH, 0);
#endif
#if CONFIG_VP9_ENCODER
const vpx_codec_caps_t vp9_caps = vpx_codec_get_caps(&vpx_codec_vp9_cx_algo);
#if CONFIG_VP9_HIGHBITDEPTH
EXPECT_EQ(vp9_caps & VPX_CODEC_CAP_HIGHBITDEPTH, VPX_CODEC_CAP_HIGHBITDEPTH);
#else
EXPECT_EQ(vp9_caps & VPX_CODEC_CAP_HIGHBITDEPTH, 0);
#endif
#endif
}
#if CONFIG_VP8_ENCODER
TEST(EncodeAPI, ImageSizeSetting) {
const int width = 711;
const int height = 360;
const int bps = 12;
vpx_image_t img;
vpx_codec_ctx_t enc;
vpx_codec_enc_cfg_t cfg;
uint8_t *img_buf = reinterpret_cast<uint8_t *>(
calloc(width * height * bps / 8, sizeof(*img_buf)));
vpx_codec_enc_config_default(vpx_codec_vp8_cx(), &cfg, 0);
cfg.g_w = width;
cfg.g_h = height;
vpx_img_wrap(&img, VPX_IMG_FMT_I420, width, height, 1, img_buf);
vpx_codec_enc_init(&enc, vpx_codec_vp8_cx(), &cfg, 0);
EXPECT_EQ(VPX_CODEC_OK, vpx_codec_encode(&enc, &img, 0, 1, 0, 0));
free(img_buf);
vpx_codec_destroy(&enc);
}
#endif
// Set up 2 spatial streams with 2 temporal layers per stream, and generate
// invalid configuration by setting the temporal layer rate allocation
// (ts_target_bitrate[]) to 0 for both layers. This should fail independent of
// CONFIG_MULTI_RES_ENCODING.
TEST(EncodeAPI, MultiResEncode) {
static const vpx_codec_iface_t *kCodecs[] = {
#if CONFIG_VP8_ENCODER
&vpx_codec_vp8_cx_algo,
#endif
#if CONFIG_VP9_ENCODER
&vpx_codec_vp9_cx_algo,
#endif
};
const int width = 1280;
const int height = 720;
const int width_down = width / 2;
const int height_down = height / 2;
const int target_bitrate = 1000;
const int framerate = 30;
for (int c = 0; c < NELEMENTS(kCodecs); ++c) {
const vpx_codec_iface_t *const iface = kCodecs[c];
vpx_codec_ctx_t enc[2];
vpx_codec_enc_cfg_t cfg[2];
vpx_rational_t dsf[2] = { { 2, 1 }, { 2, 1 } };
memset(enc, 0, sizeof(enc));
for (int i = 0; i < 2; i++) {
vpx_codec_enc_config_default(iface, &cfg[i], 0);
}
/* Highest-resolution encoder settings */
cfg[0].g_w = width;
cfg[0].g_h = height;
cfg[0].rc_dropframe_thresh = 0;
cfg[0].rc_end_usage = VPX_CBR;
cfg[0].rc_resize_allowed = 0;
cfg[0].rc_min_quantizer = 2;
cfg[0].rc_max_quantizer = 56;
cfg[0].rc_undershoot_pct = 100;
cfg[0].rc_overshoot_pct = 15;
cfg[0].rc_buf_initial_sz = 500;
cfg[0].rc_buf_optimal_sz = 600;
cfg[0].rc_buf_sz = 1000;
cfg[0].g_error_resilient = 1; /* Enable error resilient mode */
cfg[0].g_lag_in_frames = 0;
cfg[0].kf_mode = VPX_KF_AUTO;
cfg[0].kf_min_dist = 3000;
cfg[0].kf_max_dist = 3000;
cfg[0].rc_target_bitrate = target_bitrate; /* Set target bitrate */
cfg[0].g_timebase.num = 1; /* Set fps */
cfg[0].g_timebase.den = framerate;
memcpy(&cfg[1], &cfg[0], sizeof(cfg[0]));
cfg[1].rc_target_bitrate = 500;
cfg[1].g_w = width_down;
cfg[1].g_h = height_down;
for (int i = 0; i < 2; i++) {
cfg[i].ts_number_layers = 2;
cfg[i].ts_periodicity = 2;
cfg[i].ts_rate_decimator[0] = 2;
cfg[i].ts_rate_decimator[1] = 1;
cfg[i].ts_layer_id[0] = 0;
cfg[i].ts_layer_id[1] = 1;
// Invalid parameters.
cfg[i].ts_target_bitrate[0] = 0;
cfg[i].ts_target_bitrate[1] = 0;
}
// VP9 should report incapable, VP8 invalid for all configurations.
const char kVP9Name[] = "WebM Project VP9";
const bool is_vp9 = strncmp(kVP9Name, vpx_codec_iface_name(iface),
sizeof(kVP9Name) - 1) == 0;
EXPECT_EQ(is_vp9 ? VPX_CODEC_INCAPABLE : VPX_CODEC_INVALID_PARAM,
vpx_codec_enc_init_multi(&enc[0], iface, &cfg[0], 2, 0, &dsf[0]));
for (int i = 0; i < 2; i++) {
vpx_codec_destroy(&enc[i]);
}
}
}
} // namespace

View File

@ -26,10 +26,7 @@ const double kUsecsInSec = 1000000.0;
struct EncodePerfTestVideo {
EncodePerfTestVideo(const char *name_, uint32_t width_, uint32_t height_,
uint32_t bitrate_, int frames_)
: name(name_),
width(width_),
height(height_),
bitrate(bitrate_),
: name(name_), width(width_), height(height_), bitrate(bitrate_),
frames(frames_) {}
const char *name;
uint32_t width;
@ -45,8 +42,8 @@ const EncodePerfTestVideo kVP9EncodePerfTestVectors[] = {
EncodePerfTestVideo("macmarcostationary_640_480_30.yuv", 640, 480, 200, 718),
EncodePerfTestVideo("niklas_640_480_30.yuv", 640, 480, 200, 471),
EncodePerfTestVideo("tacomanarrows_640_480_30.yuv", 640, 480, 200, 300),
EncodePerfTestVideo("tacomasmallcameramovement_640_480_30.yuv",
640, 480, 200, 300),
EncodePerfTestVideo("tacomasmallcameramovement_640_480_30.yuv", 640, 480, 200,
300),
EncodePerfTestVideo("thaloundeskmtg_640_480_30.yuv", 640, 480, 200, 300),
EncodePerfTestVideo("niklas_1280_720_30.yuv", 1280, 720, 600, 470),
};
@ -61,12 +58,8 @@ class VP9EncodePerfTest
public ::libvpx_test::CodecTestWithParam<libvpx_test::TestMode> {
protected:
VP9EncodePerfTest()
: EncoderTest(GET_PARAM(0)),
min_psnr_(kMaxPsnr),
nframes_(0),
encoding_mode_(GET_PARAM(1)),
speed_(0),
threads_(1) {}
: EncoderTest(GET_PARAM(0)), min_psnr_(kMaxPsnr), nframes_(0),
encoding_mode_(GET_PARAM(1)), speed_(0), threads_(1) {}
virtual ~VP9EncodePerfTest() {}
@ -107,24 +100,18 @@ class VP9EncodePerfTest
virtual void PSNRPktHook(const vpx_codec_cx_pkt_t *pkt) {
if (pkt->data.psnr.psnr[0] < min_psnr_) {
min_psnr_= pkt->data.psnr.psnr[0];
min_psnr_ = pkt->data.psnr.psnr[0];
}
}
// for performance reasons don't decode
virtual bool DoDecode() { return 0; }
virtual bool DoDecode() const { return false; }
double min_psnr() const {
return min_psnr_;
}
double min_psnr() const { return min_psnr_; }
void set_speed(unsigned int speed) {
speed_ = speed;
}
void set_speed(unsigned int speed) { speed_ = speed; }
void set_threads(unsigned int threads) {
threads_ = threads;
}
void set_threads(unsigned int threads) { threads_ = threads; }
private:
double min_psnr_;
@ -139,11 +126,12 @@ TEST_P(VP9EncodePerfTest, PerfTest) {
for (size_t j = 0; j < NELEMENTS(kEncodePerfTestSpeeds); ++j) {
for (size_t k = 0; k < NELEMENTS(kEncodePerfTestThreads); ++k) {
if (kVP9EncodePerfTestVectors[i].width < 512 &&
kEncodePerfTestThreads[k] > 1)
kEncodePerfTestThreads[k] > 1) {
continue;
else if (kVP9EncodePerfTestVectors[i].width < 1024 &&
kEncodePerfTestThreads[k] > 2)
} else if (kVP9EncodePerfTestVectors[i].width < 1024 &&
kEncodePerfTestThreads[k] > 2) {
continue;
}
set_threads(kEncodePerfTestThreads[k]);
SetUp();
@ -157,10 +145,8 @@ TEST_P(VP9EncodePerfTest, PerfTest) {
const unsigned frames = kVP9EncodePerfTestVectors[i].frames;
const char *video_name = kVP9EncodePerfTestVectors[i].name;
libvpx_test::I420VideoSource video(
video_name,
kVP9EncodePerfTestVectors[i].width,
kVP9EncodePerfTestVectors[i].height,
timebase.den, timebase.num, 0,
video_name, kVP9EncodePerfTestVectors[i].width,
kVP9EncodePerfTestVectors[i].height, timebase.den, timebase.num, 0,
kVP9EncodePerfTestVectors[i].frames);
set_speed(kEncodePerfTestSpeeds[j]);
@ -197,6 +183,6 @@ TEST_P(VP9EncodePerfTest, PerfTest) {
}
}
VP9_INSTANTIATE_TEST_CASE(
VP9EncodePerfTest, ::testing::Values(::libvpx_test::kRealTime));
VP9_INSTANTIATE_TEST_CASE(VP9EncodePerfTest,
::testing::Values(::libvpx_test::kRealTime));
} // namespace

View File

@ -10,13 +10,14 @@
#include <string>
#include "third_party/googletest/src/include/gtest/gtest.h"
#include "./vpx_config.h"
#include "test/codec_factory.h"
#include "test/encode_test_driver.h"
#include "test/decode_test_driver.h"
#include "test/encode_test_driver.h"
#include "test/register_state_check.h"
#include "test/video_source.h"
#include "third_party/googletest/src/include/gtest/gtest.h"
namespace libvpx_test {
void Encoder::InitEncoder(VideoSource *video) {
@ -29,10 +30,7 @@ void Encoder::InitEncoder(VideoSource *video) {
cfg_.g_timebase = video->timebase();
cfg_.rc_twopass_stats_in = stats_->buf();
// Default to 1 thread.
cfg_.g_threads = 1;
res = vpx_codec_enc_init(&encoder_, CodecInterface(), &cfg_,
init_flags_);
res = vpx_codec_enc_init(&encoder_, CodecInterface(), &cfg_, init_flags_);
ASSERT_EQ(VPX_CODEC_OK, res) << EncoderError();
#if CONFIG_VP9_ENCODER
@ -54,17 +52,17 @@ void Encoder::InitEncoder(VideoSource *video) {
}
void Encoder::EncodeFrame(VideoSource *video, const unsigned long frame_flags) {
if (video->img())
if (video->img()) {
EncodeFrameInternal(*video, frame_flags);
else
} else {
Flush();
}
// Handle twopass stats
CxDataIterator iter = GetCxData();
while (const vpx_codec_cx_pkt_t *pkt = iter.Next()) {
if (pkt->kind != VPX_CODEC_STATS_PKT)
continue;
if (pkt->kind != VPX_CODEC_STATS_PKT) continue;
stats_->Append(*pkt);
}
@ -84,15 +82,15 @@ void Encoder::EncodeFrameInternal(const VideoSource &video,
}
// Encode the frame
API_REGISTER_STATE_CHECK(
res = vpx_codec_encode(&encoder_, img, video.pts(), video.duration(),
frame_flags, deadline_));
API_REGISTER_STATE_CHECK(res = vpx_codec_encode(&encoder_, img, video.pts(),
video.duration(), frame_flags,
deadline_));
ASSERT_EQ(VPX_CODEC_OK, res) << EncoderError();
}
void Encoder::Flush() {
const vpx_codec_err_t res = vpx_codec_encode(&encoder_, NULL, 0, 0, 0,
deadline_);
const vpx_codec_err_t res =
vpx_codec_encode(&encoder_, NULL, 0, 0, 0, deadline_);
if (!encoder_.priv)
ASSERT_EQ(VPX_CODEC_ERROR, res) << EncoderError();
else
@ -107,60 +105,57 @@ void EncoderTest::InitializeConfig() {
void EncoderTest::SetMode(TestMode mode) {
switch (mode) {
case kRealTime:
deadline_ = VPX_DL_REALTIME;
break;
case kRealTime: deadline_ = VPX_DL_REALTIME; break;
case kOnePassGood:
case kTwoPassGood:
deadline_ = VPX_DL_GOOD_QUALITY;
break;
case kTwoPassGood: deadline_ = VPX_DL_GOOD_QUALITY; break;
case kOnePassBest:
case kTwoPassBest:
deadline_ = VPX_DL_BEST_QUALITY;
break;
case kTwoPassBest: deadline_ = VPX_DL_BEST_QUALITY; break;
default:
ASSERT_TRUE(false) << "Unexpected mode " << mode;
default: ASSERT_TRUE(false) << "Unexpected mode " << mode;
}
if (mode == kTwoPassGood || mode == kTwoPassBest)
if (mode == kTwoPassGood || mode == kTwoPassBest) {
passes_ = 2;
else
} else {
passes_ = 1;
}
}
// The function should return "true" most of the time, therefore no early
// break-out is implemented within the match checking process.
static bool compare_img(const vpx_image_t *img1,
const vpx_image_t *img2) {
bool match = (img1->fmt == img2->fmt) &&
(img1->cs == img2->cs) &&
(img1->d_w == img2->d_w) &&
(img1->d_h == img2->d_h);
static bool compare_img(const vpx_image_t *img1, const vpx_image_t *img2) {
bool match = (img1->fmt == img2->fmt) && (img1->cs == img2->cs) &&
(img1->d_w == img2->d_w) && (img1->d_h == img2->d_h);
const unsigned int width_y = img1->d_w;
const unsigned int width_y = img1->d_w;
const unsigned int height_y = img1->d_h;
unsigned int i;
for (i = 0; i < height_y; ++i)
for (i = 0; i < height_y; ++i) {
match = (memcmp(img1->planes[VPX_PLANE_Y] + i * img1->stride[VPX_PLANE_Y],
img2->planes[VPX_PLANE_Y] + i * img2->stride[VPX_PLANE_Y],
width_y) == 0) && match;
const unsigned int width_uv = (img1->d_w + 1) >> 1;
width_y) == 0) &&
match;
}
const unsigned int width_uv = (img1->d_w + 1) >> 1;
const unsigned int height_uv = (img1->d_h + 1) >> 1;
for (i = 0; i < height_uv; ++i)
for (i = 0; i < height_uv; ++i) {
match = (memcmp(img1->planes[VPX_PLANE_U] + i * img1->stride[VPX_PLANE_U],
img2->planes[VPX_PLANE_U] + i * img2->stride[VPX_PLANE_U],
width_uv) == 0) && match;
for (i = 0; i < height_uv; ++i)
width_uv) == 0) &&
match;
}
for (i = 0; i < height_uv; ++i) {
match = (memcmp(img1->planes[VPX_PLANE_V] + i * img1->stride[VPX_PLANE_V],
img2->planes[VPX_PLANE_V] + i * img2->stride[VPX_PLANE_V],
width_uv) == 0) && match;
width_uv) == 0) &&
match;
}
return match;
}
void EncoderTest::MismatchHook(const vpx_image_t* /*img1*/,
const vpx_image_t* /*img2*/) {
void EncoderTest::MismatchHook(const vpx_image_t * /*img1*/,
const vpx_image_t * /*img2*/) {
ASSERT_TRUE(0) << "Encode/Decode mismatch found";
}
@ -173,35 +168,41 @@ void EncoderTest::RunLoop(VideoSource *video) {
for (unsigned int pass = 0; pass < passes_; pass++) {
last_pts_ = 0;
if (passes_ == 1)
if (passes_ == 1) {
cfg_.g_pass = VPX_RC_ONE_PASS;
else if (pass == 0)
} else if (pass == 0) {
cfg_.g_pass = VPX_RC_FIRST_PASS;
else
} else {
cfg_.g_pass = VPX_RC_LAST_PASS;
}
BeginPassHook(pass);
Encoder* const encoder = codec_->CreateEncoder(cfg_, deadline_, init_flags_,
&stats_);
ASSERT_TRUE(encoder != NULL);
testing::internal::scoped_ptr<Encoder> encoder(
codec_->CreateEncoder(cfg_, deadline_, init_flags_, &stats_));
ASSERT_TRUE(encoder.get() != NULL);
video->Begin();
ASSERT_NO_FATAL_FAILURE(video->Begin());
encoder->InitEncoder(video);
ASSERT_FALSE(::testing::Test::HasFatalFailure());
unsigned long dec_init_flags = 0; // NOLINT
// Use fragment decoder if encoder outputs partitions.
// NOTE: fragment decoder and partition encoder are only supported by VP8.
if (init_flags_ & VPX_CODEC_USE_OUTPUT_PARTITION)
if (init_flags_ & VPX_CODEC_USE_OUTPUT_PARTITION) {
dec_init_flags |= VPX_CODEC_USE_INPUT_FRAGMENTS;
Decoder* const decoder = codec_->CreateDecoder(dec_cfg, dec_init_flags, 0);
}
testing::internal::scoped_ptr<Decoder> decoder(
codec_->CreateDecoder(dec_cfg, dec_init_flags));
bool again;
for (again = true; again; video->Next()) {
again = (video->img() != NULL);
PreEncodeFrameHook(video);
PreEncodeFrameHook(video, encoder);
PreEncodeFrameHook(video, encoder.get());
encoder->EncodeFrame(video, frame_flags_);
PostEncodeFrameHook();
CxDataIterator iter = encoder->GetCxData();
bool has_cxdata = false;
@ -212,12 +213,11 @@ void EncoderTest::RunLoop(VideoSource *video) {
switch (pkt->kind) {
case VPX_CODEC_CX_FRAME_PKT:
has_cxdata = true;
if (decoder && DoDecode()) {
if (decoder.get() != NULL && DoDecode()) {
vpx_codec_err_t res_dec = decoder->DecodeFrame(
(const uint8_t*)pkt->data.frame.buf, pkt->data.frame.sz);
(const uint8_t *)pkt->data.frame.buf, pkt->data.frame.sz);
if (!HandleDecodeResult(res_dec, *video, decoder))
break;
if (!HandleDecodeResult(res_dec, *video, decoder.get())) break;
has_dxdata = true;
}
@ -226,20 +226,18 @@ void EncoderTest::RunLoop(VideoSource *video) {
FramePktHook(pkt);
break;
case VPX_CODEC_PSNR_PKT:
PSNRPktHook(pkt);
break;
case VPX_CODEC_PSNR_PKT: PSNRPktHook(pkt); break;
default:
break;
case VPX_CODEC_STATS_PKT: StatsPktHook(pkt); break;
default: break;
}
}
// Flush the decoder when there are no more fragments.
if ((init_flags_ & VPX_CODEC_USE_OUTPUT_PARTITION) && has_dxdata) {
const vpx_codec_err_t res_dec = decoder->DecodeFrame(NULL, 0);
if (!HandleDecodeResult(res_dec, *video, decoder))
break;
if (!HandleDecodeResult(res_dec, *video, decoder.get())) break;
}
if (has_dxdata && has_cxdata) {
@ -252,21 +250,14 @@ void EncoderTest::RunLoop(VideoSource *video) {
MismatchHook(img_enc, img_dec);
}
}
if (img_dec)
DecompressedFrameHook(*img_dec, video->pts());
if (img_dec) DecompressedFrameHook(*img_dec, video->pts());
}
if (!Continue())
break;
if (!Continue()) break;
}
EndPassHook();
if (decoder)
delete decoder;
delete encoder;
if (!Continue())
break;
if (!Continue()) break;
}
}

View File

@ -13,12 +13,13 @@
#include <string>
#include <vector>
#include "./vpx_config.h"
#include "third_party/googletest/src/include/gtest/gtest.h"
#include "vpx/vpx_encoder.h"
#include "./vpx_config.h"
#if CONFIG_VP8_ENCODER || CONFIG_VP9_ENCODER
#include "vpx/vp8cx.h"
#endif
#include "vpx/vpx_encoder.h"
namespace libvpx_test {
@ -32,19 +33,17 @@ enum TestMode {
kTwoPassGood,
kTwoPassBest
};
#define ALL_TEST_MODES ::testing::Values(::libvpx_test::kRealTime, \
::libvpx_test::kOnePassGood, \
::libvpx_test::kOnePassBest, \
::libvpx_test::kTwoPassGood, \
::libvpx_test::kTwoPassBest)
#define ALL_TEST_MODES \
::testing::Values(::libvpx_test::kRealTime, ::libvpx_test::kOnePassGood, \
::libvpx_test::kOnePassBest, ::libvpx_test::kTwoPassGood, \
::libvpx_test::kTwoPassBest)
#define ONE_PASS_TEST_MODES ::testing::Values(::libvpx_test::kRealTime, \
::libvpx_test::kOnePassGood, \
::libvpx_test::kOnePassBest)
#define TWO_PASS_TEST_MODES ::testing::Values(::libvpx_test::kTwoPassGood, \
::libvpx_test::kTwoPassBest)
#define ONE_PASS_TEST_MODES \
::testing::Values(::libvpx_test::kRealTime, ::libvpx_test::kOnePassGood, \
::libvpx_test::kOnePassBest)
#define TWO_PASS_TEST_MODES \
::testing::Values(::libvpx_test::kTwoPassGood, ::libvpx_test::kTwoPassBest)
// Provides an object to handle the libvpx get_cx_data() iteration pattern
class CxDataIterator {
@ -57,8 +56,8 @@ class CxDataIterator {
}
private:
vpx_codec_ctx_t *encoder_;
vpx_codec_iter_t iter_;
vpx_codec_ctx_t *encoder_;
vpx_codec_iter_t iter_;
};
// Implements an in-memory store for libvpx twopass statistics
@ -74,15 +73,12 @@ class TwopassStatsStore {
return buf;
}
void Reset() {
buffer_.clear();
}
void Reset() { buffer_.clear(); }
protected:
std::string buffer_;
std::string buffer_;
};
// Provides a simplified interface to manage one video encoding pass, given
// a configuration and video source.
//
@ -96,13 +92,9 @@ class Encoder {
memset(&encoder_, 0, sizeof(encoder_));
}
virtual ~Encoder() {
vpx_codec_destroy(&encoder_);
}
virtual ~Encoder() { vpx_codec_destroy(&encoder_); }
CxDataIterator GetCxData() {
return CxDataIterator(&encoder_);
}
CxDataIterator GetCxData() { return CxDataIterator(&encoder_); }
void InitEncoder(VideoSource *video);
@ -114,15 +106,18 @@ class Encoder {
void EncodeFrame(VideoSource *video, const unsigned long frame_flags);
// Convenience wrapper for EncodeFrame()
void EncodeFrame(VideoSource *video) {
EncodeFrame(video, 0);
}
void EncodeFrame(VideoSource *video) { EncodeFrame(video, 0); }
void Control(int ctrl_id, int arg) {
const vpx_codec_err_t res = vpx_codec_control_(&encoder_, ctrl_id, arg);
ASSERT_EQ(VPX_CODEC_OK, res) << EncoderError();
}
void Control(int ctrl_id, int *arg) {
const vpx_codec_err_t res = vpx_codec_control_(&encoder_, ctrl_id, arg);
ASSERT_EQ(VPX_CODEC_OK, res) << EncoderError();
}
void Control(int ctrl_id, struct vpx_scaling_mode *arg) {
const vpx_codec_err_t res = vpx_codec_control_(&encoder_, ctrl_id, arg);
ASSERT_EQ(VPX_CODEC_OK, res) << EncoderError();
@ -133,25 +128,41 @@ class Encoder {
ASSERT_EQ(VPX_CODEC_OK, res) << EncoderError();
}
void Control(int ctrl_id, struct vpx_svc_ref_frame_config *arg) {
const vpx_codec_err_t res = vpx_codec_control_(&encoder_, ctrl_id, arg);
ASSERT_EQ(VPX_CODEC_OK, res) << EncoderError();
}
void Control(int ctrl_id, struct vpx_svc_parameters *arg) {
const vpx_codec_err_t res = vpx_codec_control_(&encoder_, ctrl_id, arg);
ASSERT_EQ(VPX_CODEC_OK, res) << EncoderError();
}
void Control(int ctrl_id, struct vpx_svc_frame_drop *arg) {
const vpx_codec_err_t res = vpx_codec_control_(&encoder_, ctrl_id, arg);
ASSERT_EQ(VPX_CODEC_OK, res) << EncoderError();
}
#if CONFIG_VP8_ENCODER || CONFIG_VP9_ENCODER
void Control(int ctrl_id, vpx_active_map_t *arg) {
const vpx_codec_err_t res = vpx_codec_control_(&encoder_, ctrl_id, arg);
ASSERT_EQ(VPX_CODEC_OK, res) << EncoderError();
}
#endif
void Control(int ctrl_id, vpx_roi_map_t *arg) {
const vpx_codec_err_t res = vpx_codec_control_(&encoder_, ctrl_id, arg);
ASSERT_EQ(VPX_CODEC_OK, res) << EncoderError();
}
#endif
void Config(const vpx_codec_enc_cfg_t *cfg) {
const vpx_codec_err_t res = vpx_codec_enc_config_set(&encoder_, cfg);
ASSERT_EQ(VPX_CODEC_OK, res) << EncoderError();
cfg_ = *cfg;
}
void set_deadline(unsigned long deadline) {
deadline_ = deadline;
}
void set_deadline(unsigned long deadline) { deadline_ = deadline; }
protected:
virtual vpx_codec_iface_t* CodecInterface() const = 0;
virtual vpx_codec_iface_t *CodecInterface() const = 0;
const char *EncoderError() {
const char *detail = vpx_codec_error_detail(&encoder_);
@ -165,11 +176,11 @@ class Encoder {
// Flush the encoder on EOS
void Flush();
vpx_codec_ctx_t encoder_;
vpx_codec_enc_cfg_t cfg_;
unsigned long deadline_;
unsigned long init_flags_;
TwopassStatsStore *stats_;
vpx_codec_ctx_t encoder_;
vpx_codec_enc_cfg_t cfg_;
unsigned long deadline_;
unsigned long init_flags_;
TwopassStatsStore *stats_;
};
// Common test functionality for all Encoder tests.
@ -183,7 +194,10 @@ class EncoderTest {
protected:
explicit EncoderTest(const CodecFactory *codec)
: codec_(codec), abort_(false), init_flags_(0), frame_flags_(0),
last_pts_(0) {}
last_pts_(0) {
// Default to 1 thread.
cfg_.g_threads = 1;
}
virtual ~EncoderTest() {}
@ -208,36 +222,40 @@ class EncoderTest {
virtual void EndPassHook() {}
// Hook to be called before encoding a frame.
virtual void PreEncodeFrameHook(VideoSource* /*video*/) {}
virtual void PreEncodeFrameHook(VideoSource* /*video*/,
Encoder* /*encoder*/) {}
virtual void PreEncodeFrameHook(VideoSource * /*video*/) {}
virtual void PreEncodeFrameHook(VideoSource * /*video*/,
Encoder * /*encoder*/) {}
virtual void PostEncodeFrameHook() {}
// Hook to be called on every compressed data packet.
virtual void FramePktHook(const vpx_codec_cx_pkt_t* /*pkt*/) {}
virtual void FramePktHook(const vpx_codec_cx_pkt_t * /*pkt*/) {}
// Hook to be called on every PSNR packet.
virtual void PSNRPktHook(const vpx_codec_cx_pkt_t* /*pkt*/) {}
virtual void PSNRPktHook(const vpx_codec_cx_pkt_t * /*pkt*/) {}
// Hook to be called on every first pass stats packet.
virtual void StatsPktHook(const vpx_codec_cx_pkt_t * /*pkt*/) {}
// Hook to determine whether the encode loop should continue.
virtual bool Continue() const {
return !(::testing::Test::HasFatalFailure() || abort_);
}
const CodecFactory *codec_;
const CodecFactory *codec_;
// Hook to determine whether to decode frame after encoding
virtual bool DoDecode() const { return 1; }
// Hook to handle encode/decode mismatch
virtual void MismatchHook(const vpx_image_t *img1,
const vpx_image_t *img2);
virtual void MismatchHook(const vpx_image_t *img1, const vpx_image_t *img2);
// Hook to be called on every decompressed frame.
virtual void DecompressedFrameHook(const vpx_image_t& /*img*/,
virtual void DecompressedFrameHook(const vpx_image_t & /*img*/,
vpx_codec_pts_t /*pts*/) {}
// Hook to be called to handle decode result. Return true to continue.
virtual bool HandleDecodeResult(const vpx_codec_err_t res_dec,
const VideoSource& /*video*/,
const VideoSource & /*video*/,
Decoder *decoder) {
EXPECT_EQ(VPX_CODEC_OK, res_dec) << decoder->DecodeError();
return VPX_CODEC_OK == res_dec;
@ -249,15 +267,15 @@ class EncoderTest {
return pkt;
}
bool abort_;
vpx_codec_enc_cfg_t cfg_;
vpx_codec_dec_cfg_t dec_cfg_;
unsigned int passes_;
unsigned long deadline_;
TwopassStatsStore stats_;
unsigned long init_flags_;
unsigned long frame_flags_;
vpx_codec_pts_t last_pts_;
bool abort_;
vpx_codec_enc_cfg_t cfg_;
vpx_codec_dec_cfg_t dec_cfg_;
unsigned int passes_;
unsigned long deadline_;
TwopassStatsStore stats_;
unsigned long init_flags_;
unsigned long frame_flags_;
vpx_codec_pts_t last_pts_;
};
} // namespace libvpx_test

View File

@ -19,15 +19,13 @@ namespace {
const int kMaxErrorFrames = 12;
const int kMaxDroppableFrames = 12;
class ErrorResilienceTestLarge : public ::libvpx_test::EncoderTest,
public ::libvpx_test::CodecTestWithParam<libvpx_test::TestMode> {
class ErrorResilienceTestLarge
: public ::libvpx_test::EncoderTest,
public ::libvpx_test::CodecTestWith2Params<libvpx_test::TestMode, bool> {
protected:
ErrorResilienceTestLarge()
: EncoderTest(GET_PARAM(0)),
psnr_(0.0),
nframes_(0),
mismatch_psnr_(0.0),
mismatch_nframes_(0),
: EncoderTest(GET_PARAM(0)), svc_support_(GET_PARAM(2)), psnr_(0.0),
nframes_(0), mismatch_psnr_(0.0), mismatch_nframes_(0),
encoding_mode_(GET_PARAM(1)) {
Reset();
}
@ -65,81 +63,69 @@ class ErrorResilienceTestLarge : public ::libvpx_test::EncoderTest,
// LAST is updated on base/layer 0, GOLDEN updated on layer 1.
// Non-zero pattern_switch parameter means pattern will switch to
// not using LAST for frame_num >= pattern_switch.
int SetFrameFlags(int frame_num,
int num_temp_layers,
int pattern_switch) {
int SetFrameFlags(int frame_num, int num_temp_layers, int pattern_switch) {
int frame_flags = 0;
if (num_temp_layers == 2) {
if (frame_num % 2 == 0) {
if (frame_num < pattern_switch || pattern_switch == 0) {
// Layer 0: predict from LAST and ARF, update LAST.
frame_flags = VP8_EFLAG_NO_REF_GF |
VP8_EFLAG_NO_UPD_GF |
VP8_EFLAG_NO_UPD_ARF;
} else {
// Layer 0: predict from GF and ARF, update GF.
frame_flags = VP8_EFLAG_NO_REF_LAST |
VP8_EFLAG_NO_UPD_LAST |
VP8_EFLAG_NO_UPD_ARF;
}
if (frame_num % 2 == 0) {
if (frame_num < pattern_switch || pattern_switch == 0) {
// Layer 0: predict from LAST and ARF, update LAST.
frame_flags =
VP8_EFLAG_NO_REF_GF | VP8_EFLAG_NO_UPD_GF | VP8_EFLAG_NO_UPD_ARF;
} else {
if (frame_num < pattern_switch || pattern_switch == 0) {
// Layer 1: predict from L, GF, and ARF, update GF.
frame_flags = VP8_EFLAG_NO_UPD_ARF |
VP8_EFLAG_NO_UPD_LAST;
} else {
// Layer 1: predict from GF and ARF, update GF.
frame_flags = VP8_EFLAG_NO_REF_LAST |
VP8_EFLAG_NO_UPD_LAST |
VP8_EFLAG_NO_UPD_ARF;
}
// Layer 0: predict from GF and ARF, update GF.
frame_flags = VP8_EFLAG_NO_REF_LAST | VP8_EFLAG_NO_UPD_LAST |
VP8_EFLAG_NO_UPD_ARF;
}
} else {
if (frame_num < pattern_switch || pattern_switch == 0) {
// Layer 1: predict from L, GF, and ARF, update GF.
frame_flags = VP8_EFLAG_NO_UPD_ARF | VP8_EFLAG_NO_UPD_LAST;
} else {
// Layer 1: predict from GF and ARF, update GF.
frame_flags = VP8_EFLAG_NO_REF_LAST | VP8_EFLAG_NO_UPD_LAST |
VP8_EFLAG_NO_UPD_ARF;
}
}
}
return frame_flags;
}
virtual void PreEncodeFrameHook(libvpx_test::VideoSource *video,
::libvpx_test::Encoder *encoder) {
frame_flags_ &= ~(VP8_EFLAG_NO_UPD_LAST |
VP8_EFLAG_NO_UPD_GF |
VP8_EFLAG_NO_UPD_ARF);
virtual void PreEncodeFrameHook(libvpx_test::VideoSource *video) {
frame_flags_ &=
~(VP8_EFLAG_NO_UPD_LAST | VP8_EFLAG_NO_UPD_GF | VP8_EFLAG_NO_UPD_ARF);
// For temporal layer case.
if (cfg_.ts_number_layers > 1) {
frame_flags_ = SetFrameFlags(video->frame(),
cfg_.ts_number_layers,
pattern_switch_);
frame_flags_ =
SetFrameFlags(video->frame(), cfg_.ts_number_layers, pattern_switch_);
for (unsigned int i = 0; i < droppable_nframes_; ++i) {
if (droppable_frames_[i] == video->frame()) {
std::cout << "Encoding droppable frame: "
<< droppable_frames_[i] << "\n";
std::cout << "Encoding droppable frame: " << droppable_frames_[i]
<< "\n";
}
}
} else {
if (droppable_nframes_ > 0 &&
(cfg_.g_pass == VPX_RC_LAST_PASS || cfg_.g_pass == VPX_RC_ONE_PASS)) {
for (unsigned int i = 0; i < droppable_nframes_; ++i) {
if (droppable_frames_[i] == video->frame()) {
std::cout << "Encoding droppable frame: "
<< droppable_frames_[i] << "\n";
frame_flags_ |= (VP8_EFLAG_NO_UPD_LAST |
VP8_EFLAG_NO_UPD_GF |
VP8_EFLAG_NO_UPD_ARF);
return;
}
}
}
if (droppable_nframes_ > 0 &&
(cfg_.g_pass == VPX_RC_LAST_PASS || cfg_.g_pass == VPX_RC_ONE_PASS)) {
for (unsigned int i = 0; i < droppable_nframes_; ++i) {
if (droppable_frames_[i] == video->frame()) {
std::cout << "Encoding droppable frame: " << droppable_frames_[i]
<< "\n";
frame_flags_ |= (VP8_EFLAG_NO_UPD_LAST | VP8_EFLAG_NO_UPD_GF |
VP8_EFLAG_NO_UPD_ARF);
return;
}
}
}
}
}
double GetAveragePsnr() const {
if (nframes_)
return psnr_ / nframes_;
if (nframes_) return psnr_ / nframes_;
return 0.0;
}
double GetAverageMismatchPsnr() const {
if (mismatch_nframes_)
return mismatch_psnr_ / mismatch_nframes_;
if (mismatch_nframes_) return mismatch_psnr_ / mismatch_nframes_;
return 0.0;
}
@ -157,8 +143,7 @@ class ErrorResilienceTestLarge : public ::libvpx_test::EncoderTest,
return 1;
}
virtual void MismatchHook(const vpx_image_t *img1,
const vpx_image_t *img2) {
virtual void MismatchHook(const vpx_image_t *img1, const vpx_image_t *img2) {
double mismatch_psnr = compute_psnr(img1, img2);
mismatch_psnr_ += mismatch_psnr;
++mismatch_nframes_;
@ -166,32 +151,34 @@ class ErrorResilienceTestLarge : public ::libvpx_test::EncoderTest,
}
void SetErrorFrames(int num, unsigned int *list) {
if (num > kMaxErrorFrames)
if (num > kMaxErrorFrames) {
num = kMaxErrorFrames;
else if (num < 0)
} else if (num < 0) {
num = 0;
}
error_nframes_ = num;
for (unsigned int i = 0; i < error_nframes_; ++i)
for (unsigned int i = 0; i < error_nframes_; ++i) {
error_frames_[i] = list[i];
}
}
void SetDroppableFrames(int num, unsigned int *list) {
if (num > kMaxDroppableFrames)
if (num > kMaxDroppableFrames) {
num = kMaxDroppableFrames;
else if (num < 0)
} else if (num < 0) {
num = 0;
}
droppable_nframes_ = num;
for (unsigned int i = 0; i < droppable_nframes_; ++i)
for (unsigned int i = 0; i < droppable_nframes_; ++i) {
droppable_frames_[i] = list[i];
}
}
unsigned int GetMismatchFrames() {
return mismatch_nframes_;
}
unsigned int GetMismatchFrames() { return mismatch_nframes_; }
void SetPatternSwitch(int frame_switch) {
pattern_switch_ = frame_switch;
}
void SetPatternSwitch(int frame_switch) { pattern_switch_ = frame_switch; }
bool svc_support_;
private:
double psnr_;
@ -262,15 +249,14 @@ TEST_P(ErrorResilienceTestLarge, DropFramesWithoutRecovery) {
// In addition to isolated loss/drop, add a long consecutive series
// (of size 9) of dropped frames.
unsigned int num_droppable_frames = 11;
unsigned int droppable_frame_list[] = {5, 16, 22, 23, 24, 25, 26, 27, 28,
29, 30};
unsigned int droppable_frame_list[] = { 5, 16, 22, 23, 24, 25,
26, 27, 28, 29, 30 };
SetDroppableFrames(num_droppable_frames, droppable_frame_list);
SetErrorFrames(num_droppable_frames, droppable_frame_list);
ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
// Test that no mismatches have been found
std::cout << " Mismatch frames: "
<< GetMismatchFrames() << "\n";
EXPECT_EQ(GetMismatchFrames(), (unsigned int) 0);
std::cout << " Mismatch frames: " << GetMismatchFrames() << "\n";
EXPECT_EQ(GetMismatchFrames(), (unsigned int)0);
// Reset previously set of error/droppable frames.
Reset();
@ -302,6 +288,9 @@ TEST_P(ErrorResilienceTestLarge, DropFramesWithoutRecovery) {
// two layer temporal pattern. The base layer does not predict from the top
// layer, so successful decoding is expected.
TEST_P(ErrorResilienceTestLarge, 2LayersDropEnhancement) {
// This test doesn't run if SVC is not supported.
if (!svc_support_) return;
const vpx_rational timebase = { 33333333, 1000000000 };
cfg_.g_timebase = timebase;
cfg_.rc_target_bitrate = 500;
@ -330,14 +319,13 @@ TEST_P(ErrorResilienceTestLarge, 2LayersDropEnhancement) {
// The odd frames are the enhancement layer for 2 layer pattern, so set
// those frames as droppable. Drop the last 7 frames.
unsigned int num_droppable_frames = 7;
unsigned int droppable_frame_list[] = {27, 29, 31, 33, 35, 37, 39};
unsigned int droppable_frame_list[] = { 27, 29, 31, 33, 35, 37, 39 };
SetDroppableFrames(num_droppable_frames, droppable_frame_list);
SetErrorFrames(num_droppable_frames, droppable_frame_list);
ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
// Test that no mismatches have been found
std::cout << " Mismatch frames: "
<< GetMismatchFrames() << "\n";
EXPECT_EQ(GetMismatchFrames(), (unsigned int) 0);
std::cout << " Mismatch frames: " << GetMismatchFrames() << "\n";
EXPECT_EQ(GetMismatchFrames(), (unsigned int)0);
// Reset previously set of error/droppable frames.
Reset();
@ -347,6 +335,9 @@ TEST_P(ErrorResilienceTestLarge, 2LayersDropEnhancement) {
// for a two layer temporal pattern, where at some point in the
// sequence, the LAST ref is not used anymore.
TEST_P(ErrorResilienceTestLarge, 2LayersNoRefLast) {
// This test doesn't run if SVC is not supported.
if (!svc_support_) return;
const vpx_rational timebase = { 33333333, 1000000000 };
cfg_.g_timebase = timebase;
cfg_.rc_target_bitrate = 500;
@ -374,20 +365,19 @@ TEST_P(ErrorResilienceTestLarge, 2LayersNoRefLast) {
ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
// Test that no mismatches have been found
std::cout << " Mismatch frames: "
<< GetMismatchFrames() << "\n";
EXPECT_EQ(GetMismatchFrames(), (unsigned int) 0);
std::cout << " Mismatch frames: " << GetMismatchFrames() << "\n";
EXPECT_EQ(GetMismatchFrames(), (unsigned int)0);
// Reset previously set of error/droppable frames.
Reset();
}
class ErrorResilienceTestLargeCodecControls : public ::libvpx_test::EncoderTest,
public ::libvpx_test::CodecTestWithParam<libvpx_test::TestMode> {
class ErrorResilienceTestLargeCodecControls
: public ::libvpx_test::EncoderTest,
public ::libvpx_test::CodecTestWithParam<libvpx_test::TestMode> {
protected:
ErrorResilienceTestLargeCodecControls()
: EncoderTest(GET_PARAM(0)),
encoding_mode_(GET_PARAM(1)) {
: EncoderTest(GET_PARAM(0)), encoding_mode_(GET_PARAM(1)) {
Reset();
}
@ -426,8 +416,8 @@ class ErrorResilienceTestLargeCodecControls : public ::libvpx_test::EncoderTest,
if (num_temp_layers == 2) {
if (frame_num % 2 == 0) {
// Layer 0: predict from L and ARF, update L.
frame_flags = VP8_EFLAG_NO_REF_GF | VP8_EFLAG_NO_UPD_GF |
VP8_EFLAG_NO_UPD_ARF;
frame_flags =
VP8_EFLAG_NO_REF_GF | VP8_EFLAG_NO_UPD_GF | VP8_EFLAG_NO_UPD_ARF;
} else {
// Layer 1: predict from L, G and ARF, and update G.
frame_flags = VP8_EFLAG_NO_UPD_ARF | VP8_EFLAG_NO_UPD_LAST |
@ -440,9 +430,9 @@ class ErrorResilienceTestLargeCodecControls : public ::libvpx_test::EncoderTest,
VP8_EFLAG_NO_REF_GF | VP8_EFLAG_NO_REF_ARF;
} else if ((frame_num - 2) % 4 == 0) {
// Layer 1: predict from L, G, update G.
frame_flags = VP8_EFLAG_NO_UPD_ARF | VP8_EFLAG_NO_UPD_LAST |
VP8_EFLAG_NO_REF_ARF;
} else if ((frame_num - 1) % 2 == 0) {
frame_flags =
VP8_EFLAG_NO_UPD_ARF | VP8_EFLAG_NO_UPD_LAST | VP8_EFLAG_NO_REF_ARF;
} else if ((frame_num - 1) % 2 == 0) {
// Layer 2: predict from L, G, ARF; update ARG.
frame_flags = VP8_EFLAG_NO_UPD_GF | VP8_EFLAG_NO_UPD_LAST;
}
@ -456,7 +446,7 @@ class ErrorResilienceTestLargeCodecControls : public ::libvpx_test::EncoderTest,
if (frame_num % 2 == 0) {
layer_id = 0;
} else {
layer_id = 1;
layer_id = 1;
}
} else if (num_temp_layers == 3) {
if (frame_num % 4 == 0) {
@ -473,16 +463,16 @@ class ErrorResilienceTestLargeCodecControls : public ::libvpx_test::EncoderTest,
virtual void PreEncodeFrameHook(libvpx_test::VideoSource *video,
libvpx_test::Encoder *encoder) {
if (cfg_.ts_number_layers > 1) {
int layer_id = SetLayerId(video->frame(), cfg_.ts_number_layers);
int frame_flags = SetFrameFlags(video->frame(), cfg_.ts_number_layers);
if (video->frame() > 0) {
encoder->Control(VP8E_SET_TEMPORAL_LAYER_ID, layer_id);
encoder->Control(VP8E_SET_FRAME_FLAGS, frame_flags);
}
const vpx_rational_t tb = video->timebase();
timebase_ = static_cast<double>(tb.num) / tb.den;
duration_ = 0;
return;
int layer_id = SetLayerId(video->frame(), cfg_.ts_number_layers);
int frame_flags = SetFrameFlags(video->frame(), cfg_.ts_number_layers);
if (video->frame() > 0) {
encoder->Control(VP8E_SET_TEMPORAL_LAYER_ID, layer_id);
encoder->Control(VP8E_SET_FRAME_FLAGS, frame_flags);
}
const vpx_rational_t tb = video->timebase();
timebase_ = static_cast<double>(tb.num) / tb.den;
duration_ = 0;
return;
}
}
@ -508,26 +498,28 @@ class ErrorResilienceTestLargeCodecControls : public ::libvpx_test::EncoderTest,
virtual void EndPassHook(void) {
duration_ = (last_pts_ + 1) * timebase_;
if (cfg_.ts_number_layers > 1) {
if (cfg_.ts_number_layers > 1) {
for (int layer = 0; layer < static_cast<int>(cfg_.ts_number_layers);
++layer) {
++layer) {
if (bits_total_[layer]) {
// Effective file datarate:
effective_datarate_[layer] = (bits_total_[layer] / 1000.0) / duration_;
effective_datarate_[layer] =
(bits_total_[layer] / 1000.0) / duration_;
}
}
}
}
double effective_datarate_[3];
private:
libvpx_test::TestMode encoding_mode_;
vpx_codec_pts_t last_pts_;
double timebase_;
int64_t bits_total_[3];
double duration_;
int tot_frame_number_;
};
private:
libvpx_test::TestMode encoding_mode_;
vpx_codec_pts_t last_pts_;
double timebase_;
int64_t bits_total_[3];
double duration_;
int tot_frame_number_;
};
// Check two codec controls used for:
// (1) for setting temporal layer id, and (2) for settings encoder flags.
@ -571,16 +563,20 @@ TEST_P(ErrorResilienceTestLargeCodecControls, CodecControl3TemporalLayers) {
for (int j = 0; j < static_cast<int>(cfg_.ts_number_layers); ++j) {
ASSERT_GE(effective_datarate_[j], cfg_.ts_target_bitrate[j] * 0.75)
<< " The datarate for the file is lower than target by too much, "
"for layer: " << j;
"for layer: "
<< j;
ASSERT_LE(effective_datarate_[j], cfg_.ts_target_bitrate[j] * 1.25)
<< " The datarate for the file is greater than target by too much, "
"for layer: " << j;
"for layer: "
<< j;
}
}
}
VP8_INSTANTIATE_TEST_CASE(ErrorResilienceTestLarge, ONE_PASS_TEST_MODES);
VP8_INSTANTIATE_TEST_CASE(ErrorResilienceTestLarge, ONE_PASS_TEST_MODES,
::testing::Values(true));
VP8_INSTANTIATE_TEST_CASE(ErrorResilienceTestLargeCodecControls,
ONE_PASS_TEST_MODES);
VP9_INSTANTIATE_TEST_CASE(ErrorResilienceTestLarge, ONE_PASS_TEST_MODES);
VP9_INSTANTIATE_TEST_CASE(ErrorResilienceTestLarge, ONE_PASS_TEST_MODES,
::testing::Values(true));
} // namespace

View File

@ -15,7 +15,7 @@
example_tests=$(ls $(dirname $0)/*.sh)
# List of script names to exclude.
exclude_list="examples tools_common"
exclude_list="examples stress tools_common"
# Filter out the scripts in $exclude_list.
for word in ${exclude_list}; do

View File

@ -24,7 +24,6 @@
namespace {
const int kVideoNameParam = 1;
const char kVP9TestFile[] = "vp90-2-02-size-lf-1920x1080.webm";
struct ExternalFrameBuffer {
uint8_t *data;
@ -36,20 +35,18 @@ struct ExternalFrameBuffer {
class ExternalFrameBufferList {
public:
ExternalFrameBufferList()
: num_buffers_(0),
ext_fb_list_(NULL) {}
: num_buffers_(0), num_used_buffers_(0), ext_fb_list_(NULL) {}
virtual ~ExternalFrameBufferList() {
for (int i = 0; i < num_buffers_; ++i) {
delete [] ext_fb_list_[i].data;
delete[] ext_fb_list_[i].data;
}
delete [] ext_fb_list_;
delete[] ext_fb_list_;
}
// Creates the list to hold the external buffers. Returns true on success.
bool CreateBufferList(int num_buffers) {
if (num_buffers < 0)
return false;
if (num_buffers < 0) return false;
num_buffers_ = num_buffers;
ext_fb_list_ = new ExternalFrameBuffer[num_buffers_];
@ -65,17 +62,18 @@ class ExternalFrameBufferList {
int GetFreeFrameBuffer(size_t min_size, vpx_codec_frame_buffer_t *fb) {
EXPECT_TRUE(fb != NULL);
const int idx = FindFreeBufferIndex();
if (idx == num_buffers_)
return -1;
if (idx == num_buffers_) return -1;
if (ext_fb_list_[idx].size < min_size) {
delete [] ext_fb_list_[idx].data;
delete[] ext_fb_list_[idx].data;
ext_fb_list_[idx].data = new uint8_t[min_size];
memset(ext_fb_list_[idx].data, 0, min_size);
ext_fb_list_[idx].size = min_size;
}
SetFrameBuffer(idx, fb);
num_used_buffers_++;
return 0;
}
@ -84,11 +82,10 @@ class ExternalFrameBufferList {
int GetZeroFrameBuffer(size_t min_size, vpx_codec_frame_buffer_t *fb) {
EXPECT_TRUE(fb != NULL);
const int idx = FindFreeBufferIndex();
if (idx == num_buffers_)
return -1;
if (idx == num_buffers_) return -1;
if (ext_fb_list_[idx].size < min_size) {
delete [] ext_fb_list_[idx].data;
delete[] ext_fb_list_[idx].data;
ext_fb_list_[idx].data = NULL;
ext_fb_list_[idx].size = min_size;
}
@ -105,13 +102,14 @@ class ExternalFrameBufferList {
return -1;
}
ExternalFrameBuffer *const ext_fb =
reinterpret_cast<ExternalFrameBuffer*>(fb->priv);
reinterpret_cast<ExternalFrameBuffer *>(fb->priv);
if (ext_fb == NULL) {
EXPECT_TRUE(ext_fb != NULL);
return -1;
}
EXPECT_EQ(1, ext_fb->in_use);
ext_fb->in_use = 0;
num_used_buffers_--;
return 0;
}
@ -120,13 +118,15 @@ class ExternalFrameBufferList {
void CheckXImageFrameBuffer(const vpx_image_t *img) {
if (img->fb_priv != NULL) {
const struct ExternalFrameBuffer *const ext_fb =
reinterpret_cast<ExternalFrameBuffer*>(img->fb_priv);
reinterpret_cast<ExternalFrameBuffer *>(img->fb_priv);
ASSERT_TRUE(img->planes[0] >= ext_fb->data &&
img->planes[0] < (ext_fb->data + ext_fb->size));
}
}
int num_used_buffers() const { return num_used_buffers_; }
private:
// Returns the index of the first free frame buffer. Returns |num_buffers_|
// if there are no free frame buffers.
@ -134,8 +134,7 @@ class ExternalFrameBufferList {
int i;
// Find a free frame buffer.
for (i = 0; i < num_buffers_; ++i) {
if (!ext_fb_list_[i].in_use)
break;
if (!ext_fb_list_[i].in_use) break;
}
return i;
}
@ -152,24 +151,26 @@ class ExternalFrameBufferList {
}
int num_buffers_;
int num_used_buffers_;
ExternalFrameBuffer *ext_fb_list_;
};
#if CONFIG_WEBM_IO
// Callback used by libvpx to request the application to return a frame
// buffer of at least |min_size| in bytes.
int get_vp9_frame_buffer(void *user_priv, size_t min_size,
vpx_codec_frame_buffer_t *fb) {
ExternalFrameBufferList *const fb_list =
reinterpret_cast<ExternalFrameBufferList*>(user_priv);
reinterpret_cast<ExternalFrameBufferList *>(user_priv);
return fb_list->GetFreeFrameBuffer(min_size, fb);
}
// Callback used by libvpx to tell the application that |fb| is not needed
// anymore.
int release_vp9_frame_buffer(void *user_priv,
vpx_codec_frame_buffer_t *fb) {
int release_vp9_frame_buffer(void *user_priv, vpx_codec_frame_buffer_t *fb) {
ExternalFrameBufferList *const fb_list =
reinterpret_cast<ExternalFrameBufferList*>(user_priv);
reinterpret_cast<ExternalFrameBufferList *>(user_priv);
return fb_list->ReturnFrameBuffer(fb);
}
@ -177,7 +178,7 @@ int release_vp9_frame_buffer(void *user_priv,
int get_vp9_zero_frame_buffer(void *user_priv, size_t min_size,
vpx_codec_frame_buffer_t *fb) {
ExternalFrameBufferList *const fb_list =
reinterpret_cast<ExternalFrameBufferList*>(user_priv);
reinterpret_cast<ExternalFrameBufferList *>(user_priv);
return fb_list->GetZeroFrameBuffer(min_size, fb);
}
@ -185,7 +186,7 @@ int get_vp9_zero_frame_buffer(void *user_priv, size_t min_size,
int get_vp9_one_less_byte_frame_buffer(void *user_priv, size_t min_size,
vpx_codec_frame_buffer_t *fb) {
ExternalFrameBufferList *const fb_list =
reinterpret_cast<ExternalFrameBufferList*>(user_priv);
reinterpret_cast<ExternalFrameBufferList *>(user_priv);
return fb_list->GetFreeFrameBuffer(min_size - 1, fb);
}
@ -197,19 +198,19 @@ int do_not_release_vp9_frame_buffer(void *user_priv,
return 0;
}
#endif // CONFIG_WEBM_IO
// Class for testing passing in external frame buffers to libvpx.
class ExternalFrameBufferMD5Test
: public ::libvpx_test::DecoderTest,
public ::libvpx_test::CodecTestWithParam<const char*> {
public ::libvpx_test::CodecTestWithParam<const char *> {
protected:
ExternalFrameBufferMD5Test()
: DecoderTest(GET_PARAM(::libvpx_test::kCodecFactoryParam)),
md5_file_(NULL),
num_buffers_(0) {}
md5_file_(NULL), num_buffers_(0) {}
virtual ~ExternalFrameBufferMD5Test() {
if (md5_file_ != NULL)
fclose(md5_file_);
if (md5_file_ != NULL) fclose(md5_file_);
}
virtual void PreDecodeFrameHook(
@ -219,15 +220,15 @@ class ExternalFrameBufferMD5Test
// Have libvpx use frame buffers we create.
ASSERT_TRUE(fb_list_.CreateBufferList(num_buffers_));
ASSERT_EQ(VPX_CODEC_OK,
decoder->SetFrameBufferFunctions(
GetVP9FrameBuffer, ReleaseVP9FrameBuffer, this));
decoder->SetFrameBufferFunctions(GetVP9FrameBuffer,
ReleaseVP9FrameBuffer, this));
}
}
void OpenMD5File(const std::string &md5_file_name_) {
md5_file_ = libvpx_test::OpenTestDataFile(md5_file_name_);
ASSERT_TRUE(md5_file_ != NULL) << "Md5 file open failed. Filename: "
<< md5_file_name_;
ASSERT_TRUE(md5_file_ != NULL)
<< "Md5 file open failed. Filename: " << md5_file_name_;
}
virtual void DecompressedFrameHook(const vpx_image_t &img,
@ -255,7 +256,7 @@ class ExternalFrameBufferMD5Test
static int GetVP9FrameBuffer(void *user_priv, size_t min_size,
vpx_codec_frame_buffer_t *fb) {
ExternalFrameBufferMD5Test *const md5Test =
reinterpret_cast<ExternalFrameBufferMD5Test*>(user_priv);
reinterpret_cast<ExternalFrameBufferMD5Test *>(user_priv);
return md5Test->fb_list_.GetFreeFrameBuffer(min_size, fb);
}
@ -264,7 +265,7 @@ class ExternalFrameBufferMD5Test
static int ReleaseVP9FrameBuffer(void *user_priv,
vpx_codec_frame_buffer_t *fb) {
ExternalFrameBufferMD5Test *const md5Test =
reinterpret_cast<ExternalFrameBufferMD5Test*>(user_priv);
reinterpret_cast<ExternalFrameBufferMD5Test *>(user_priv);
return md5Test->fb_list_.ReturnFrameBuffer(fb);
}
@ -278,13 +279,13 @@ class ExternalFrameBufferMD5Test
};
#if CONFIG_WEBM_IO
const char kVP9TestFile[] = "vp90-2-02-size-lf-1920x1080.webm";
const char kVP9NonRefTestFile[] = "vp90-2-22-svc_1280x720_1.webm";
// Class for testing passing in external frame buffers to libvpx.
class ExternalFrameBufferTest : public ::testing::Test {
protected:
ExternalFrameBufferTest()
: video_(NULL),
decoder_(NULL),
num_buffers_(0) {}
ExternalFrameBufferTest() : video_(NULL), decoder_(NULL), num_buffers_(0) {}
virtual void SetUp() {
video_ = new libvpx_test::WebMVideoSource(kVP9TestFile);
@ -299,13 +300,14 @@ class ExternalFrameBufferTest : public ::testing::Test {
virtual void TearDown() {
delete decoder_;
decoder_ = NULL;
delete video_;
video_ = NULL;
}
// Passes the external frame buffer information to libvpx.
vpx_codec_err_t SetFrameBufferFunctions(
int num_buffers,
vpx_get_frame_buffer_cb_fn_t cb_get,
int num_buffers, vpx_get_frame_buffer_cb_fn_t cb_get,
vpx_release_frame_buffer_cb_fn_t cb_release) {
if (num_buffers > 0) {
num_buffers_ = num_buffers;
@ -319,8 +321,7 @@ class ExternalFrameBufferTest : public ::testing::Test {
const vpx_codec_err_t res =
decoder_->DecodeFrame(video_->cxdata(), video_->frame_size());
CheckDecodedFrames();
if (res == VPX_CODEC_OK)
video_->Next();
if (res == VPX_CODEC_OK) video_->Next();
return res;
}
@ -328,14 +329,13 @@ class ExternalFrameBufferTest : public ::testing::Test {
for (; video_->cxdata() != NULL; video_->Next()) {
const vpx_codec_err_t res =
decoder_->DecodeFrame(video_->cxdata(), video_->frame_size());
if (res != VPX_CODEC_OK)
return res;
if (res != VPX_CODEC_OK) return res;
CheckDecodedFrames();
}
return VPX_CODEC_OK;
}
private:
protected:
void CheckDecodedFrames() {
libvpx_test::DxDataIterator dec_iter = decoder_->GetDxData();
const vpx_image_t *img = NULL;
@ -351,6 +351,25 @@ class ExternalFrameBufferTest : public ::testing::Test {
int num_buffers_;
ExternalFrameBufferList fb_list_;
};
class ExternalFrameBufferNonRefTest : public ExternalFrameBufferTest {
protected:
virtual void SetUp() {
video_ = new libvpx_test::WebMVideoSource(kVP9NonRefTestFile);
ASSERT_TRUE(video_ != NULL);
video_->Init();
video_->Begin();
vpx_codec_dec_cfg_t cfg = vpx_codec_dec_cfg_t();
decoder_ = new libvpx_test::VP9Decoder(cfg, 0);
ASSERT_TRUE(decoder_ != NULL);
}
virtual void CheckFrameBufferRelease() {
TearDown();
ASSERT_EQ(0, fb_list_.num_used_buffers());
}
};
#endif // CONFIG_WEBM_IO
// This test runs through the set of test vectors, and decodes them.
@ -360,7 +379,6 @@ class ExternalFrameBufferTest : public ::testing::Test {
// Otherwise, the test failed.
TEST_P(ExternalFrameBufferMD5Test, ExtFBMD5Match) {
const std::string filename = GET_PARAM(kVideoNameParam);
libvpx_test::CompressedVideoSource *video = NULL;
// Number of buffers equals #VP9_MAXIMUM_REF_BUFFERS +
// #VPX_MAXIMUM_WORK_BUFFERS + four jitter buffers.
@ -375,18 +393,19 @@ TEST_P(ExternalFrameBufferMD5Test, ExtFBMD5Match) {
#endif
// Open compressed video file.
testing::internal::scoped_ptr<libvpx_test::CompressedVideoSource> video;
if (filename.substr(filename.length() - 3, 3) == "ivf") {
video = new libvpx_test::IVFVideoSource(filename);
video.reset(new libvpx_test::IVFVideoSource(filename));
} else {
#if CONFIG_WEBM_IO
video = new libvpx_test::WebMVideoSource(filename);
video.reset(new libvpx_test::WebMVideoSource(filename));
#else
fprintf(stderr, "WebM IO is disabled, skipping test vector %s\n",
filename.c_str());
return;
#endif
}
ASSERT_TRUE(video != NULL);
ASSERT_TRUE(video.get() != NULL);
video->Init();
// Construct md5 file name.
@ -394,8 +413,7 @@ TEST_P(ExternalFrameBufferMD5Test, ExtFBMD5Match) {
OpenMD5File(md5_filename);
// Decode frame, and check the md5 matching.
ASSERT_NO_FATAL_FAILURE(RunLoop(video));
delete video;
ASSERT_NO_FATAL_FAILURE(RunLoop(video.get()));
}
#if CONFIG_WEBM_IO
@ -404,8 +422,8 @@ TEST_F(ExternalFrameBufferTest, MinFrameBuffers) {
// #VP9_MAXIMUM_REF_BUFFERS + #VPX_MAXIMUM_WORK_BUFFERS.
const int num_buffers = VP9_MAXIMUM_REF_BUFFERS + VPX_MAXIMUM_WORK_BUFFERS;
ASSERT_EQ(VPX_CODEC_OK,
SetFrameBufferFunctions(
num_buffers, get_vp9_frame_buffer, release_vp9_frame_buffer));
SetFrameBufferFunctions(num_buffers, get_vp9_frame_buffer,
release_vp9_frame_buffer));
ASSERT_EQ(VPX_CODEC_OK, DecodeRemainingFrames());
}
@ -416,8 +434,8 @@ TEST_F(ExternalFrameBufferTest, EightJitterBuffers) {
const int num_buffers =
VP9_MAXIMUM_REF_BUFFERS + VPX_MAXIMUM_WORK_BUFFERS + jitter_buffers;
ASSERT_EQ(VPX_CODEC_OK,
SetFrameBufferFunctions(
num_buffers, get_vp9_frame_buffer, release_vp9_frame_buffer));
SetFrameBufferFunctions(num_buffers, get_vp9_frame_buffer,
release_vp9_frame_buffer));
ASSERT_EQ(VPX_CODEC_OK, DecodeRemainingFrames());
}
@ -427,9 +445,11 @@ TEST_F(ExternalFrameBufferTest, NotEnoughBuffers) {
// only use 5 frame buffers at one time.
const int num_buffers = 2;
ASSERT_EQ(VPX_CODEC_OK,
SetFrameBufferFunctions(
num_buffers, get_vp9_frame_buffer, release_vp9_frame_buffer));
SetFrameBufferFunctions(num_buffers, get_vp9_frame_buffer,
release_vp9_frame_buffer));
ASSERT_EQ(VPX_CODEC_OK, DecodeOneFrame());
// Only run this on long clips. Decoding a very short clip will return
// VPX_CODEC_OK even with only 2 buffers.
ASSERT_EQ(VPX_CODEC_MEM_ERROR, DecodeRemainingFrames());
}
@ -452,18 +472,17 @@ TEST_F(ExternalFrameBufferTest, NullRealloc) {
TEST_F(ExternalFrameBufferTest, ReallocOneLessByte) {
const int num_buffers = VP9_MAXIMUM_REF_BUFFERS + VPX_MAXIMUM_WORK_BUFFERS;
ASSERT_EQ(VPX_CODEC_OK,
SetFrameBufferFunctions(
num_buffers, get_vp9_one_less_byte_frame_buffer,
release_vp9_frame_buffer));
ASSERT_EQ(VPX_CODEC_OK, SetFrameBufferFunctions(
num_buffers, get_vp9_one_less_byte_frame_buffer,
release_vp9_frame_buffer));
ASSERT_EQ(VPX_CODEC_MEM_ERROR, DecodeOneFrame());
}
TEST_F(ExternalFrameBufferTest, NullGetFunction) {
const int num_buffers = VP9_MAXIMUM_REF_BUFFERS + VPX_MAXIMUM_WORK_BUFFERS;
ASSERT_EQ(VPX_CODEC_INVALID_PARAM,
SetFrameBufferFunctions(num_buffers, NULL,
release_vp9_frame_buffer));
ASSERT_EQ(
VPX_CODEC_INVALID_PARAM,
SetFrameBufferFunctions(num_buffers, NULL, release_vp9_frame_buffer));
}
TEST_F(ExternalFrameBufferTest, NullReleaseFunction) {
@ -476,13 +495,23 @@ TEST_F(ExternalFrameBufferTest, SetAfterDecode) {
const int num_buffers = VP9_MAXIMUM_REF_BUFFERS + VPX_MAXIMUM_WORK_BUFFERS;
ASSERT_EQ(VPX_CODEC_OK, DecodeOneFrame());
ASSERT_EQ(VPX_CODEC_ERROR,
SetFrameBufferFunctions(
num_buffers, get_vp9_frame_buffer, release_vp9_frame_buffer));
SetFrameBufferFunctions(num_buffers, get_vp9_frame_buffer,
release_vp9_frame_buffer));
}
TEST_F(ExternalFrameBufferNonRefTest, ReleaseNonRefFrameBuffer) {
const int num_buffers = VP9_MAXIMUM_REF_BUFFERS + VPX_MAXIMUM_WORK_BUFFERS;
ASSERT_EQ(VPX_CODEC_OK,
SetFrameBufferFunctions(num_buffers, get_vp9_frame_buffer,
release_vp9_frame_buffer));
ASSERT_EQ(VPX_CODEC_OK, DecodeRemainingFrames());
CheckFrameBufferRelease();
}
#endif // CONFIG_WEBM_IO
VP9_INSTANTIATE_TEST_CASE(ExternalFrameBufferMD5Test,
::testing::ValuesIn(libvpx_test::kVP9TestVectors,
libvpx_test::kVP9TestVectors +
libvpx_test::kNumVP9TestVectors));
VP9_INSTANTIATE_TEST_CASE(
ExternalFrameBufferMD5Test,
::testing::ValuesIn(libvpx_test::kVP9TestVectors,
libvpx_test::kVP9TestVectors +
libvpx_test::kNumVP9TestVectors));
} // namespace

View File

@ -1,539 +0,0 @@
/*
* Copyright (c) 2012 The WebM project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#include <math.h>
#include <stdlib.h>
#include <string.h>
#include "third_party/googletest/src/include/gtest/gtest.h"
#include "test/acm_random.h"
#include "test/clear_system_state.h"
#include "test/register_state_check.h"
#include "test/util.h"
#include "./vp9_rtcd.h"
#include "vp9/common/vp9_entropy.h"
#include "vpx/vpx_codec.h"
#include "vpx/vpx_integer.h"
using libvpx_test::ACMRandom;
namespace {
const int kNumCoeffs = 16;
typedef void (*FdctFunc)(const int16_t *in, tran_low_t *out, int stride);
typedef void (*IdctFunc)(const tran_low_t *in, uint8_t *out, int stride);
typedef void (*FhtFunc)(const int16_t *in, tran_low_t *out, int stride,
int tx_type);
typedef void (*IhtFunc)(const tran_low_t *in, uint8_t *out, int stride,
int tx_type);
typedef std::tr1::tuple<FdctFunc, IdctFunc, int, vpx_bit_depth_t> Dct4x4Param;
typedef std::tr1::tuple<FhtFunc, IhtFunc, int, vpx_bit_depth_t> Ht4x4Param;
void fdct4x4_ref(const int16_t *in, tran_low_t *out, int stride,
int tx_type) {
vp9_fdct4x4_c(in, out, stride);
}
void fht4x4_ref(const int16_t *in, tran_low_t *out, int stride, int tx_type) {
vp9_fht4x4_c(in, out, stride, tx_type);
}
void fwht4x4_ref(const int16_t *in, tran_low_t *out, int stride,
int tx_type) {
vp9_fwht4x4_c(in, out, stride);
}
#if CONFIG_VP9_HIGHBITDEPTH
void idct4x4_10(const tran_low_t *in, uint8_t *out, int stride) {
vp9_highbd_idct4x4_16_add_c(in, out, stride, 10);
}
void idct4x4_12(const tran_low_t *in, uint8_t *out, int stride) {
vp9_highbd_idct4x4_16_add_c(in, out, stride, 12);
}
void iht4x4_10(const tran_low_t *in, uint8_t *out, int stride, int tx_type) {
vp9_highbd_iht4x4_16_add_c(in, out, stride, tx_type, 10);
}
void iht4x4_12(const tran_low_t *in, uint8_t *out, int stride, int tx_type) {
vp9_highbd_iht4x4_16_add_c(in, out, stride, tx_type, 12);
}
void iwht4x4_10(const tran_low_t *in, uint8_t *out, int stride) {
vp9_highbd_iwht4x4_16_add_c(in, out, stride, 10);
}
void iwht4x4_12(const tran_low_t *in, uint8_t *out, int stride) {
vp9_highbd_iwht4x4_16_add_c(in, out, stride, 12);
}
#if HAVE_SSE2
void idct4x4_10_sse2(const tran_low_t *in, uint8_t *out, int stride) {
vp9_highbd_idct4x4_16_add_sse2(in, out, stride, 10);
}
void idct4x4_12_sse2(const tran_low_t *in, uint8_t *out, int stride) {
vp9_highbd_idct4x4_16_add_sse2(in, out, stride, 12);
}
#endif // HAVE_SSE2
#endif // CONFIG_VP9_HIGHBITDEPTH
class Trans4x4TestBase {
public:
virtual ~Trans4x4TestBase() {}
protected:
virtual void RunFwdTxfm(const int16_t *in, tran_low_t *out, int stride) = 0;
virtual void RunInvTxfm(const tran_low_t *out, uint8_t *dst, int stride) = 0;
void RunAccuracyCheck(int limit) {
ACMRandom rnd(ACMRandom::DeterministicSeed());
uint32_t max_error = 0;
int64_t total_error = 0;
const int count_test_block = 10000;
for (int i = 0; i < count_test_block; ++i) {
DECLARE_ALIGNED_ARRAY(16, int16_t, test_input_block, kNumCoeffs);
DECLARE_ALIGNED_ARRAY(16, tran_low_t, test_temp_block, kNumCoeffs);
DECLARE_ALIGNED_ARRAY(16, uint8_t, dst, kNumCoeffs);
DECLARE_ALIGNED_ARRAY(16, uint8_t, src, kNumCoeffs);
#if CONFIG_VP9_HIGHBITDEPTH
DECLARE_ALIGNED_ARRAY(16, uint16_t, dst16, kNumCoeffs);
DECLARE_ALIGNED_ARRAY(16, uint16_t, src16, kNumCoeffs);
#endif
// Initialize a test block with input range [-255, 255].
for (int j = 0; j < kNumCoeffs; ++j) {
if (bit_depth_ == VPX_BITS_8) {
src[j] = rnd.Rand8();
dst[j] = rnd.Rand8();
test_input_block[j] = src[j] - dst[j];
#if CONFIG_VP9_HIGHBITDEPTH
} else {
src16[j] = rnd.Rand16() & mask_;
dst16[j] = rnd.Rand16() & mask_;
test_input_block[j] = src16[j] - dst16[j];
#endif
}
}
ASM_REGISTER_STATE_CHECK(RunFwdTxfm(test_input_block,
test_temp_block, pitch_));
if (bit_depth_ == VPX_BITS_8) {
ASM_REGISTER_STATE_CHECK(RunInvTxfm(test_temp_block, dst, pitch_));
#if CONFIG_VP9_HIGHBITDEPTH
} else {
ASM_REGISTER_STATE_CHECK(RunInvTxfm(test_temp_block,
CONVERT_TO_BYTEPTR(dst16), pitch_));
#endif
}
for (int j = 0; j < kNumCoeffs; ++j) {
#if CONFIG_VP9_HIGHBITDEPTH
const uint32_t diff =
bit_depth_ == VPX_BITS_8 ? dst[j] - src[j] : dst16[j] - src16[j];
#else
const uint32_t diff = dst[j] - src[j];
#endif
const uint32_t error = diff * diff;
if (max_error < error)
max_error = error;
total_error += error;
}
}
EXPECT_GE(static_cast<uint32_t>(limit), max_error)
<< "Error: 4x4 FHT/IHT has an individual round trip error > "
<< limit;
EXPECT_GE(count_test_block * limit, total_error)
<< "Error: 4x4 FHT/IHT has average round trip error > " << limit
<< " per block";
}
void RunCoeffCheck() {
ACMRandom rnd(ACMRandom::DeterministicSeed());
const int count_test_block = 5000;
DECLARE_ALIGNED_ARRAY(16, int16_t, input_block, kNumCoeffs);
DECLARE_ALIGNED_ARRAY(16, tran_low_t, output_ref_block, kNumCoeffs);
DECLARE_ALIGNED_ARRAY(16, tran_low_t, output_block, kNumCoeffs);
for (int i = 0; i < count_test_block; ++i) {
// Initialize a test block with input range [-mask_, mask_].
for (int j = 0; j < kNumCoeffs; ++j)
input_block[j] = (rnd.Rand16() & mask_) - (rnd.Rand16() & mask_);
fwd_txfm_ref(input_block, output_ref_block, pitch_, tx_type_);
ASM_REGISTER_STATE_CHECK(RunFwdTxfm(input_block, output_block, pitch_));
// The minimum quant value is 4.
for (int j = 0; j < kNumCoeffs; ++j)
EXPECT_EQ(output_block[j], output_ref_block[j]);
}
}
void RunMemCheck() {
ACMRandom rnd(ACMRandom::DeterministicSeed());
const int count_test_block = 5000;
DECLARE_ALIGNED_ARRAY(16, int16_t, input_block, kNumCoeffs);
DECLARE_ALIGNED_ARRAY(16, int16_t, input_extreme_block, kNumCoeffs);
DECLARE_ALIGNED_ARRAY(16, tran_low_t, output_ref_block, kNumCoeffs);
DECLARE_ALIGNED_ARRAY(16, tran_low_t, output_block, kNumCoeffs);
for (int i = 0; i < count_test_block; ++i) {
// Initialize a test block with input range [-mask_, mask_].
for (int j = 0; j < kNumCoeffs; ++j) {
input_block[j] = (rnd.Rand16() & mask_) - (rnd.Rand16() & mask_);
input_extreme_block[j] = rnd.Rand8() % 2 ? mask_ : -mask_;
}
if (i == 0) {
for (int j = 0; j < kNumCoeffs; ++j)
input_extreme_block[j] = mask_;
} else if (i == 1) {
for (int j = 0; j < kNumCoeffs; ++j)
input_extreme_block[j] = -mask_;
}
fwd_txfm_ref(input_extreme_block, output_ref_block, pitch_, tx_type_);
ASM_REGISTER_STATE_CHECK(RunFwdTxfm(input_extreme_block,
output_block, pitch_));
// The minimum quant value is 4.
for (int j = 0; j < kNumCoeffs; ++j) {
EXPECT_EQ(output_block[j], output_ref_block[j]);
EXPECT_GE(4 * DCT_MAX_VALUE << (bit_depth_ - 8), abs(output_block[j]))
<< "Error: 4x4 FDCT has coefficient larger than 4*DCT_MAX_VALUE";
}
}
}
void RunInvAccuracyCheck(int limit) {
ACMRandom rnd(ACMRandom::DeterministicSeed());
const int count_test_block = 1000;
DECLARE_ALIGNED_ARRAY(16, int16_t, in, kNumCoeffs);
DECLARE_ALIGNED_ARRAY(16, tran_low_t, coeff, kNumCoeffs);
DECLARE_ALIGNED_ARRAY(16, uint8_t, dst, kNumCoeffs);
DECLARE_ALIGNED_ARRAY(16, uint8_t, src, kNumCoeffs);
#if CONFIG_VP9_HIGHBITDEPTH
DECLARE_ALIGNED_ARRAY(16, uint16_t, dst16, kNumCoeffs);
DECLARE_ALIGNED_ARRAY(16, uint16_t, src16, kNumCoeffs);
#endif
for (int i = 0; i < count_test_block; ++i) {
// Initialize a test block with input range [-mask_, mask_].
for (int j = 0; j < kNumCoeffs; ++j) {
if (bit_depth_ == VPX_BITS_8) {
src[j] = rnd.Rand8();
dst[j] = rnd.Rand8();
in[j] = src[j] - dst[j];
#if CONFIG_VP9_HIGHBITDEPTH
} else {
src16[j] = rnd.Rand16() & mask_;
dst16[j] = rnd.Rand16() & mask_;
in[j] = src16[j] - dst16[j];
#endif
}
}
fwd_txfm_ref(in, coeff, pitch_, tx_type_);
if (bit_depth_ == VPX_BITS_8) {
ASM_REGISTER_STATE_CHECK(RunInvTxfm(coeff, dst, pitch_));
#if CONFIG_VP9_HIGHBITDEPTH
} else {
ASM_REGISTER_STATE_CHECK(RunInvTxfm(coeff, CONVERT_TO_BYTEPTR(dst16),
pitch_));
#endif
}
for (int j = 0; j < kNumCoeffs; ++j) {
#if CONFIG_VP9_HIGHBITDEPTH
const uint32_t diff =
bit_depth_ == VPX_BITS_8 ? dst[j] - src[j] : dst16[j] - src16[j];
#else
const uint32_t diff = dst[j] - src[j];
#endif
const uint32_t error = diff * diff;
EXPECT_GE(static_cast<uint32_t>(limit), error)
<< "Error: 4x4 IDCT has error " << error
<< " at index " << j;
}
}
}
int pitch_;
int tx_type_;
FhtFunc fwd_txfm_ref;
vpx_bit_depth_t bit_depth_;
int mask_;
};
class Trans4x4DCT
: public Trans4x4TestBase,
public ::testing::TestWithParam<Dct4x4Param> {
public:
virtual ~Trans4x4DCT() {}
virtual void SetUp() {
fwd_txfm_ = GET_PARAM(0);
inv_txfm_ = GET_PARAM(1);
tx_type_ = GET_PARAM(2);
pitch_ = 4;
fwd_txfm_ref = fdct4x4_ref;
bit_depth_ = GET_PARAM(3);
mask_ = (1 << bit_depth_) - 1;
}
virtual void TearDown() { libvpx_test::ClearSystemState(); }
protected:
void RunFwdTxfm(const int16_t *in, tran_low_t *out, int stride) {
fwd_txfm_(in, out, stride);
}
void RunInvTxfm(const tran_low_t *out, uint8_t *dst, int stride) {
inv_txfm_(out, dst, stride);
}
FdctFunc fwd_txfm_;
IdctFunc inv_txfm_;
};
TEST_P(Trans4x4DCT, AccuracyCheck) {
RunAccuracyCheck(1);
}
TEST_P(Trans4x4DCT, CoeffCheck) {
RunCoeffCheck();
}
TEST_P(Trans4x4DCT, MemCheck) {
RunMemCheck();
}
TEST_P(Trans4x4DCT, InvAccuracyCheck) {
RunInvAccuracyCheck(1);
}
class Trans4x4HT
: public Trans4x4TestBase,
public ::testing::TestWithParam<Ht4x4Param> {
public:
virtual ~Trans4x4HT() {}
virtual void SetUp() {
fwd_txfm_ = GET_PARAM(0);
inv_txfm_ = GET_PARAM(1);
tx_type_ = GET_PARAM(2);
pitch_ = 4;
fwd_txfm_ref = fht4x4_ref;
bit_depth_ = GET_PARAM(3);
mask_ = (1 << bit_depth_) - 1;
}
virtual void TearDown() { libvpx_test::ClearSystemState(); }
protected:
void RunFwdTxfm(const int16_t *in, tran_low_t *out, int stride) {
fwd_txfm_(in, out, stride, tx_type_);
}
void RunInvTxfm(const tran_low_t *out, uint8_t *dst, int stride) {
inv_txfm_(out, dst, stride, tx_type_);
}
FhtFunc fwd_txfm_;
IhtFunc inv_txfm_;
};
TEST_P(Trans4x4HT, AccuracyCheck) {
RunAccuracyCheck(1);
}
TEST_P(Trans4x4HT, CoeffCheck) {
RunCoeffCheck();
}
TEST_P(Trans4x4HT, MemCheck) {
RunMemCheck();
}
TEST_P(Trans4x4HT, InvAccuracyCheck) {
RunInvAccuracyCheck(1);
}
class Trans4x4WHT
: public Trans4x4TestBase,
public ::testing::TestWithParam<Dct4x4Param> {
public:
virtual ~Trans4x4WHT() {}
virtual void SetUp() {
fwd_txfm_ = GET_PARAM(0);
inv_txfm_ = GET_PARAM(1);
tx_type_ = GET_PARAM(2);
pitch_ = 4;
fwd_txfm_ref = fwht4x4_ref;
bit_depth_ = GET_PARAM(3);
mask_ = (1 << bit_depth_) - 1;
}
virtual void TearDown() { libvpx_test::ClearSystemState(); }
protected:
void RunFwdTxfm(const int16_t *in, tran_low_t *out, int stride) {
fwd_txfm_(in, out, stride);
}
void RunInvTxfm(const tran_low_t *out, uint8_t *dst, int stride) {
inv_txfm_(out, dst, stride);
}
FdctFunc fwd_txfm_;
IdctFunc inv_txfm_;
};
TEST_P(Trans4x4WHT, AccuracyCheck) {
RunAccuracyCheck(0);
}
TEST_P(Trans4x4WHT, CoeffCheck) {
RunCoeffCheck();
}
TEST_P(Trans4x4WHT, MemCheck) {
RunMemCheck();
}
TEST_P(Trans4x4WHT, InvAccuracyCheck) {
RunInvAccuracyCheck(0);
}
using std::tr1::make_tuple;
#if CONFIG_VP9_HIGHBITDEPTH
INSTANTIATE_TEST_CASE_P(
C, Trans4x4DCT,
::testing::Values(
make_tuple(&vp9_highbd_fdct4x4_c, &idct4x4_10, 0, VPX_BITS_10),
make_tuple(&vp9_highbd_fdct4x4_c, &idct4x4_12, 0, VPX_BITS_12),
make_tuple(&vp9_fdct4x4_c, &vp9_idct4x4_16_add_c, 0, VPX_BITS_8)));
#else
INSTANTIATE_TEST_CASE_P(
C, Trans4x4DCT,
::testing::Values(
make_tuple(&vp9_fdct4x4_c, &vp9_idct4x4_16_add_c, 0, VPX_BITS_8)));
#endif // CONFIG_VP9_HIGHBITDEPTH
#if CONFIG_VP9_HIGHBITDEPTH
INSTANTIATE_TEST_CASE_P(
C, Trans4x4HT,
::testing::Values(
make_tuple(&vp9_highbd_fht4x4_c, &iht4x4_10, 0, VPX_BITS_10),
make_tuple(&vp9_highbd_fht4x4_c, &iht4x4_10, 1, VPX_BITS_10),
make_tuple(&vp9_highbd_fht4x4_c, &iht4x4_10, 2, VPX_BITS_10),
make_tuple(&vp9_highbd_fht4x4_c, &iht4x4_10, 3, VPX_BITS_10),
make_tuple(&vp9_highbd_fht4x4_c, &iht4x4_12, 0, VPX_BITS_12),
make_tuple(&vp9_highbd_fht4x4_c, &iht4x4_12, 1, VPX_BITS_12),
make_tuple(&vp9_highbd_fht4x4_c, &iht4x4_12, 2, VPX_BITS_12),
make_tuple(&vp9_highbd_fht4x4_c, &iht4x4_12, 3, VPX_BITS_12),
make_tuple(&vp9_fht4x4_c, &vp9_iht4x4_16_add_c, 0, VPX_BITS_8),
make_tuple(&vp9_fht4x4_c, &vp9_iht4x4_16_add_c, 1, VPX_BITS_8),
make_tuple(&vp9_fht4x4_c, &vp9_iht4x4_16_add_c, 2, VPX_BITS_8),
make_tuple(&vp9_fht4x4_c, &vp9_iht4x4_16_add_c, 3, VPX_BITS_8)));
#else
INSTANTIATE_TEST_CASE_P(
C, Trans4x4HT,
::testing::Values(
make_tuple(&vp9_fht4x4_c, &vp9_iht4x4_16_add_c, 0, VPX_BITS_8),
make_tuple(&vp9_fht4x4_c, &vp9_iht4x4_16_add_c, 1, VPX_BITS_8),
make_tuple(&vp9_fht4x4_c, &vp9_iht4x4_16_add_c, 2, VPX_BITS_8),
make_tuple(&vp9_fht4x4_c, &vp9_iht4x4_16_add_c, 3, VPX_BITS_8)));
#endif // CONFIG_VP9_HIGHBITDEPTH
#if CONFIG_VP9_HIGHBITDEPTH
INSTANTIATE_TEST_CASE_P(
C, Trans4x4WHT,
::testing::Values(
make_tuple(&vp9_highbd_fwht4x4_c, &iwht4x4_10, 0, VPX_BITS_10),
make_tuple(&vp9_highbd_fwht4x4_c, &iwht4x4_12, 0, VPX_BITS_12),
make_tuple(&vp9_fwht4x4_c, &vp9_iwht4x4_16_add_c, 0, VPX_BITS_8)));
#else
INSTANTIATE_TEST_CASE_P(
C, Trans4x4WHT,
::testing::Values(
make_tuple(&vp9_fwht4x4_c, &vp9_iwht4x4_16_add_c, 0, VPX_BITS_8)));
#endif // CONFIG_VP9_HIGHBITDEPTH
#if HAVE_NEON_ASM && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
INSTANTIATE_TEST_CASE_P(
NEON, Trans4x4DCT,
::testing::Values(
make_tuple(&vp9_fdct4x4_c,
&vp9_idct4x4_16_add_neon, 0, VPX_BITS_8)));
#endif // HAVE_NEON_ASM && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
#if HAVE_NEON && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
INSTANTIATE_TEST_CASE_P(
NEON, Trans4x4HT,
::testing::Values(
make_tuple(&vp9_fht4x4_c, &vp9_iht4x4_16_add_neon, 0, VPX_BITS_8),
make_tuple(&vp9_fht4x4_c, &vp9_iht4x4_16_add_neon, 1, VPX_BITS_8),
make_tuple(&vp9_fht4x4_c, &vp9_iht4x4_16_add_neon, 2, VPX_BITS_8),
make_tuple(&vp9_fht4x4_c, &vp9_iht4x4_16_add_neon, 3, VPX_BITS_8)));
#endif // HAVE_NEON && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
#if CONFIG_USE_X86INC && HAVE_MMX && !CONFIG_VP9_HIGHBITDEPTH && \
!CONFIG_EMULATE_HARDWARE
INSTANTIATE_TEST_CASE_P(
MMX, Trans4x4WHT,
::testing::Values(
make_tuple(&vp9_fwht4x4_mmx, &vp9_iwht4x4_16_add_c, 0, VPX_BITS_8)));
#endif
#if HAVE_SSE2 && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
INSTANTIATE_TEST_CASE_P(
SSE2, Trans4x4DCT,
::testing::Values(
make_tuple(&vp9_fdct4x4_sse2,
&vp9_idct4x4_16_add_sse2, 0, VPX_BITS_8)));
INSTANTIATE_TEST_CASE_P(
SSE2, Trans4x4HT,
::testing::Values(
make_tuple(&vp9_fht4x4_sse2, &vp9_iht4x4_16_add_sse2, 0, VPX_BITS_8),
make_tuple(&vp9_fht4x4_sse2, &vp9_iht4x4_16_add_sse2, 1, VPX_BITS_8),
make_tuple(&vp9_fht4x4_sse2, &vp9_iht4x4_16_add_sse2, 2, VPX_BITS_8),
make_tuple(&vp9_fht4x4_sse2, &vp9_iht4x4_16_add_sse2, 3, VPX_BITS_8)));
#endif // HAVE_SSE2 && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
#if HAVE_SSE2 && CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
INSTANTIATE_TEST_CASE_P(
SSE2, Trans4x4DCT,
::testing::Values(
make_tuple(&vp9_highbd_fdct4x4_c, &idct4x4_10_sse2, 0, VPX_BITS_10),
make_tuple(&vp9_highbd_fdct4x4_sse2, &idct4x4_10_sse2, 0, VPX_BITS_10),
make_tuple(&vp9_highbd_fdct4x4_c, &idct4x4_12_sse2, 0, VPX_BITS_12),
make_tuple(&vp9_highbd_fdct4x4_sse2, &idct4x4_12_sse2, 0, VPX_BITS_12),
make_tuple(&vp9_fdct4x4_sse2, &vp9_idct4x4_16_add_c, 0,
VPX_BITS_8)));
INSTANTIATE_TEST_CASE_P(
SSE2, Trans4x4HT,
::testing::Values(
make_tuple(&vp9_highbd_fht4x4_sse2, &iht4x4_10, 0, VPX_BITS_10),
make_tuple(&vp9_highbd_fht4x4_sse2, &iht4x4_10, 1, VPX_BITS_10),
make_tuple(&vp9_highbd_fht4x4_sse2, &iht4x4_10, 2, VPX_BITS_10),
make_tuple(&vp9_highbd_fht4x4_sse2, &iht4x4_10, 3, VPX_BITS_10),
make_tuple(&vp9_highbd_fht4x4_sse2, &iht4x4_12, 0, VPX_BITS_12),
make_tuple(&vp9_highbd_fht4x4_sse2, &iht4x4_12, 1, VPX_BITS_12),
make_tuple(&vp9_highbd_fht4x4_sse2, &iht4x4_12, 2, VPX_BITS_12),
make_tuple(&vp9_highbd_fht4x4_sse2, &iht4x4_12, 3, VPX_BITS_12),
make_tuple(&vp9_fht4x4_sse2, &vp9_iht4x4_16_add_c, 0, VPX_BITS_8),
make_tuple(&vp9_fht4x4_sse2, &vp9_iht4x4_16_add_c, 1, VPX_BITS_8),
make_tuple(&vp9_fht4x4_sse2, &vp9_iht4x4_16_add_c, 2, VPX_BITS_8),
make_tuple(&vp9_fht4x4_sse2, &vp9_iht4x4_16_add_c, 3, VPX_BITS_8)));
#endif // HAVE_SSE2 && CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
} // namespace

View File

@ -13,56 +13,26 @@
#include <string.h>
#include "third_party/googletest/src/include/gtest/gtest.h"
#include "./vp9_rtcd.h"
#include "./vpx_dsp_rtcd.h"
#include "test/acm_random.h"
#include "test/clear_system_state.h"
#include "test/register_state_check.h"
#include "test/util.h"
#include "./vp9_rtcd.h"
#include "vp9/common/vp9_entropy.h"
#include "vp9/common/vp9_scan.h"
#include "vpx/vpx_codec.h"
#include "vpx/vpx_integer.h"
const int kNumCoeffs = 64;
const double kPi = 3.141592653589793238462643383279502884;
void reference_8x8_dct_1d(const double in[8], double out[8], int stride) {
const double kInvSqrt2 = 0.707106781186547524400844362104;
for (int k = 0; k < 8; k++) {
out[k] = 0.0;
for (int n = 0; n < 8; n++)
out[k] += in[n] * cos(kPi * (2 * n + 1) * k / 16.0);
if (k == 0)
out[k] = out[k] * kInvSqrt2;
}
}
void reference_8x8_dct_2d(const int16_t input[kNumCoeffs],
double output[kNumCoeffs]) {
// First transform columns
for (int i = 0; i < 8; ++i) {
double temp_in[8], temp_out[8];
for (int j = 0; j < 8; ++j)
temp_in[j] = input[j*8 + i];
reference_8x8_dct_1d(temp_in, temp_out, 1);
for (int j = 0; j < 8; ++j)
output[j * 8 + i] = temp_out[j];
}
// Then transform rows
for (int i = 0; i < 8; ++i) {
double temp_in[8], temp_out[8];
for (int j = 0; j < 8; ++j)
temp_in[j] = output[j + i*8];
reference_8x8_dct_1d(temp_in, temp_out, 1);
// Scale by some magic number
for (int j = 0; j < 8; ++j)
output[j + i * 8] = temp_out[j] * 2;
}
}
#include "vpx_ports/mem.h"
using libvpx_test::ACMRandom;
namespace {
const int kNumCoeffs = 64;
const double kPi = 3.141592653589793238462643383279502884;
const int kSignBiasMaxDiff255 = 1500;
const int kSignBiasMaxDiff15 = 10000;
@ -73,12 +43,43 @@ typedef void (*FhtFunc)(const int16_t *in, tran_low_t *out, int stride,
typedef void (*IhtFunc)(const tran_low_t *in, uint8_t *out, int stride,
int tx_type);
typedef std::tr1::tuple<FdctFunc, IdctFunc, int, vpx_bit_depth_t> Dct8x8Param;
typedef std::tr1::tuple<FhtFunc, IhtFunc, int, vpx_bit_depth_t> Ht8x8Param;
typedef std::tr1::tuple<IdctFunc, IdctFunc, int, vpx_bit_depth_t> Idct8x8Param;
typedef ::testing::tuple<FdctFunc, IdctFunc, int, vpx_bit_depth_t> Dct8x8Param;
typedef ::testing::tuple<FhtFunc, IhtFunc, int, vpx_bit_depth_t> Ht8x8Param;
typedef ::testing::tuple<IdctFunc, IdctFunc, int, vpx_bit_depth_t> Idct8x8Param;
void fdct8x8_ref(const int16_t *in, tran_low_t *out, int stride, int tx_type) {
vp9_fdct8x8_c(in, out, stride);
void reference_8x8_dct_1d(const double in[8], double out[8]) {
const double kInvSqrt2 = 0.707106781186547524400844362104;
for (int k = 0; k < 8; k++) {
out[k] = 0.0;
for (int n = 0; n < 8; n++) {
out[k] += in[n] * cos(kPi * (2 * n + 1) * k / 16.0);
}
if (k == 0) out[k] = out[k] * kInvSqrt2;
}
}
void reference_8x8_dct_2d(const int16_t input[kNumCoeffs],
double output[kNumCoeffs]) {
// First transform columns
for (int i = 0; i < 8; ++i) {
double temp_in[8], temp_out[8];
for (int j = 0; j < 8; ++j) temp_in[j] = input[j * 8 + i];
reference_8x8_dct_1d(temp_in, temp_out);
for (int j = 0; j < 8; ++j) output[j * 8 + i] = temp_out[j];
}
// Then transform rows
for (int i = 0; i < 8; ++i) {
double temp_in[8], temp_out[8];
for (int j = 0; j < 8; ++j) temp_in[j] = output[j + i * 8];
reference_8x8_dct_1d(temp_in, temp_out);
// Scale by some magic number
for (int j = 0; j < 8; ++j) output[j + i * 8] = temp_out[j] * 2;
}
}
void fdct8x8_ref(const int16_t *in, tran_low_t *out, int stride,
int /*tx_type*/) {
vpx_fdct8x8_c(in, out, stride);
}
void fht8x8_ref(const int16_t *in, tran_low_t *out, int stride, int tx_type) {
@ -87,44 +88,45 @@ void fht8x8_ref(const int16_t *in, tran_low_t *out, int stride, int tx_type) {
#if CONFIG_VP9_HIGHBITDEPTH
void idct8x8_10(const tran_low_t *in, uint8_t *out, int stride) {
vp9_highbd_idct8x8_64_add_c(in, out, stride, 10);
vpx_highbd_idct8x8_64_add_c(in, CAST_TO_SHORTPTR(out), stride, 10);
}
void idct8x8_12(const tran_low_t *in, uint8_t *out, int stride) {
vp9_highbd_idct8x8_64_add_c(in, out, stride, 12);
vpx_highbd_idct8x8_64_add_c(in, CAST_TO_SHORTPTR(out), stride, 12);
}
void iht8x8_10(const tran_low_t *in, uint8_t *out, int stride, int tx_type) {
vp9_highbd_iht8x8_64_add_c(in, out, stride, tx_type, 10);
vp9_highbd_iht8x8_64_add_c(in, CAST_TO_SHORTPTR(out), stride, tx_type, 10);
}
void iht8x8_12(const tran_low_t *in, uint8_t *out, int stride, int tx_type) {
vp9_highbd_iht8x8_64_add_c(in, out, stride, tx_type, 12);
}
void idct8x8_10_add_10_c(const tran_low_t *in, uint8_t *out, int stride) {
vp9_highbd_idct8x8_10_add_c(in, out, stride, 10);
}
void idct8x8_10_add_12_c(const tran_low_t *in, uint8_t *out, int stride) {
vp9_highbd_idct8x8_10_add_c(in, out, stride, 12);
vp9_highbd_iht8x8_64_add_c(in, CAST_TO_SHORTPTR(out), stride, tx_type, 12);
}
#if HAVE_SSE2
void idct8x8_10_add_10_sse2(const tran_low_t *in, uint8_t *out, int stride) {
vp9_highbd_idct8x8_10_add_sse2(in, out, stride, 10);
void idct8x8_12_add_10_c(const tran_low_t *in, uint8_t *out, int stride) {
vpx_highbd_idct8x8_12_add_c(in, CAST_TO_SHORTPTR(out), stride, 10);
}
void idct8x8_10_add_12_sse2(const tran_low_t *in, uint8_t *out, int stride) {
vp9_highbd_idct8x8_10_add_sse2(in, out, stride, 12);
void idct8x8_12_add_12_c(const tran_low_t *in, uint8_t *out, int stride) {
vpx_highbd_idct8x8_12_add_c(in, CAST_TO_SHORTPTR(out), stride, 12);
}
void idct8x8_12_add_10_sse2(const tran_low_t *in, uint8_t *out, int stride) {
vpx_highbd_idct8x8_12_add_sse2(in, CAST_TO_SHORTPTR(out), stride, 10);
}
void idct8x8_12_add_12_sse2(const tran_low_t *in, uint8_t *out, int stride) {
vpx_highbd_idct8x8_12_add_sse2(in, CAST_TO_SHORTPTR(out), stride, 12);
}
void idct8x8_64_add_10_sse2(const tran_low_t *in, uint8_t *out, int stride) {
vp9_highbd_idct8x8_64_add_sse2(in, out, stride, 10);
vpx_highbd_idct8x8_64_add_sse2(in, CAST_TO_SHORTPTR(out), stride, 10);
}
void idct8x8_64_add_12_sse2(const tran_low_t *in, uint8_t *out, int stride) {
vp9_highbd_idct8x8_64_add_sse2(in, out, stride, 12);
vpx_highbd_idct8x8_64_add_sse2(in, CAST_TO_SHORTPTR(out), stride, 12);
}
#endif // HAVE_SSE2
#endif // CONFIG_VP9_HIGHBITDEPTH
@ -139,8 +141,8 @@ class FwdTrans8x8TestBase {
void RunSignBiasCheck() {
ACMRandom rnd(ACMRandom::DeterministicSeed());
DECLARE_ALIGNED_ARRAY(16, int16_t, test_input_block, 64);
DECLARE_ALIGNED_ARRAY(16, tran_low_t, test_output_block, 64);
DECLARE_ALIGNED(16, int16_t, test_input_block[64]);
DECLARE_ALIGNED(16, tran_low_t, test_output_block[64]);
int count_sign_block[64][2];
const int count_test_block = 100000;
@ -148,17 +150,19 @@ class FwdTrans8x8TestBase {
for (int i = 0; i < count_test_block; ++i) {
// Initialize a test block with input range [-255, 255].
for (int j = 0; j < 64; ++j)
for (int j = 0; j < 64; ++j) {
test_input_block[j] = ((rnd.Rand16() >> (16 - bit_depth_)) & mask_) -
((rnd.Rand16() >> (16 - bit_depth_)) & mask_);
}
ASM_REGISTER_STATE_CHECK(
RunFwdTxfm(test_input_block, test_output_block, pitch_));
for (int j = 0; j < 64; ++j) {
if (test_output_block[j] < 0)
if (test_output_block[j] < 0) {
++count_sign_block[j][0];
else if (test_output_block[j] > 0)
} else if (test_output_block[j] > 0) {
++count_sign_block[j][1];
}
}
}
@ -170,25 +174,26 @@ class FwdTrans8x8TestBase {
<< 1. * max_diff / count_test_block * 100 << "%"
<< " for input range [-255, 255] at index " << j
<< " count0: " << count_sign_block[j][0]
<< " count1: " << count_sign_block[j][1]
<< " diff: " << diff;
<< " count1: " << count_sign_block[j][1] << " diff: " << diff;
}
memset(count_sign_block, 0, sizeof(count_sign_block));
for (int i = 0; i < count_test_block; ++i) {
// Initialize a test block with input range [-mask_ / 16, mask_ / 16].
for (int j = 0; j < 64; ++j)
test_input_block[j] = ((rnd.Rand16() & mask_) >> 4) -
((rnd.Rand16() & mask_) >> 4);
for (int j = 0; j < 64; ++j) {
test_input_block[j] =
((rnd.Rand16() & mask_) >> 4) - ((rnd.Rand16() & mask_) >> 4);
}
ASM_REGISTER_STATE_CHECK(
RunFwdTxfm(test_input_block, test_output_block, pitch_));
for (int j = 0; j < 64; ++j) {
if (test_output_block[j] < 0)
if (test_output_block[j] < 0) {
++count_sign_block[j][0];
else if (test_output_block[j] > 0)
} else if (test_output_block[j] > 0) {
++count_sign_block[j][1];
}
}
}
@ -200,8 +205,7 @@ class FwdTrans8x8TestBase {
<< 1. * max_diff / count_test_block * 100 << "%"
<< " for input range [-15, 15] at index " << j
<< " count0: " << count_sign_block[j][0]
<< " count1: " << count_sign_block[j][1]
<< " diff: " << diff;
<< " count1: " << count_sign_block[j][1] << " diff: " << diff;
}
}
@ -210,13 +214,13 @@ class FwdTrans8x8TestBase {
int max_error = 0;
int total_error = 0;
const int count_test_block = 100000;
DECLARE_ALIGNED_ARRAY(16, int16_t, test_input_block, 64);
DECLARE_ALIGNED_ARRAY(16, tran_low_t, test_temp_block, 64);
DECLARE_ALIGNED_ARRAY(16, uint8_t, dst, 64);
DECLARE_ALIGNED_ARRAY(16, uint8_t, src, 64);
DECLARE_ALIGNED(16, int16_t, test_input_block[64]);
DECLARE_ALIGNED(16, tran_low_t, test_temp_block[64]);
DECLARE_ALIGNED(16, uint8_t, dst[64]);
DECLARE_ALIGNED(16, uint8_t, src[64]);
#if CONFIG_VP9_HIGHBITDEPTH
DECLARE_ALIGNED_ARRAY(16, uint16_t, dst16, 64);
DECLARE_ALIGNED_ARRAY(16, uint16_t, src16, 64);
DECLARE_ALIGNED(16, uint16_t, dst16[64]);
DECLARE_ALIGNED(16, uint16_t, src16[64]);
#endif
for (int i = 0; i < count_test_block; ++i) {
@ -238,23 +242,22 @@ class FwdTrans8x8TestBase {
ASM_REGISTER_STATE_CHECK(
RunFwdTxfm(test_input_block, test_temp_block, pitch_));
for (int j = 0; j < 64; ++j) {
if (test_temp_block[j] > 0) {
test_temp_block[j] += 2;
test_temp_block[j] /= 4;
test_temp_block[j] *= 4;
} else {
test_temp_block[j] -= 2;
test_temp_block[j] /= 4;
test_temp_block[j] *= 4;
}
if (test_temp_block[j] > 0) {
test_temp_block[j] += 2;
test_temp_block[j] /= 4;
test_temp_block[j] *= 4;
} else {
test_temp_block[j] -= 2;
test_temp_block[j] /= 4;
test_temp_block[j] *= 4;
}
}
if (bit_depth_ == VPX_BITS_8) {
ASM_REGISTER_STATE_CHECK(
RunInvTxfm(test_temp_block, dst, pitch_));
ASM_REGISTER_STATE_CHECK(RunInvTxfm(test_temp_block, dst, pitch_));
#if CONFIG_VP9_HIGHBITDEPTH
} else {
ASM_REGISTER_STATE_CHECK(
RunInvTxfm(test_temp_block, CONVERT_TO_BYTEPTR(dst16), pitch_));
RunInvTxfm(test_temp_block, CAST_TO_BYTEPTR(dst16), pitch_));
#endif
}
@ -266,19 +269,18 @@ class FwdTrans8x8TestBase {
const int diff = dst[j] - src[j];
#endif
const int error = diff * diff;
if (max_error < error)
max_error = error;
if (max_error < error) max_error = error;
total_error += error;
}
}
EXPECT_GE(1 << 2 * (bit_depth_ - 8), max_error)
<< "Error: 8x8 FDCT/IDCT or FHT/IHT has an individual"
<< " roundtrip error > 1";
<< "Error: 8x8 FDCT/IDCT or FHT/IHT has an individual"
<< " roundtrip error > 1";
EXPECT_GE((count_test_block << 2 * (bit_depth_ - 8))/5, total_error)
<< "Error: 8x8 FDCT/IDCT or FHT/IHT has average roundtrip "
<< "error > 1/5 per block";
EXPECT_GE((count_test_block << 2 * (bit_depth_ - 8)) / 5, total_error)
<< "Error: 8x8 FDCT/IDCT or FHT/IHT has average roundtrip "
<< "error > 1/5 per block";
}
void RunExtremalCheck() {
@ -287,14 +289,14 @@ class FwdTrans8x8TestBase {
int total_error = 0;
int total_coeff_error = 0;
const int count_test_block = 100000;
DECLARE_ALIGNED_ARRAY(16, int16_t, test_input_block, 64);
DECLARE_ALIGNED_ARRAY(16, tran_low_t, test_temp_block, 64);
DECLARE_ALIGNED_ARRAY(16, tran_low_t, ref_temp_block, 64);
DECLARE_ALIGNED_ARRAY(16, uint8_t, dst, 64);
DECLARE_ALIGNED_ARRAY(16, uint8_t, src, 64);
DECLARE_ALIGNED(16, int16_t, test_input_block[64]);
DECLARE_ALIGNED(16, tran_low_t, test_temp_block[64]);
DECLARE_ALIGNED(16, tran_low_t, ref_temp_block[64]);
DECLARE_ALIGNED(16, uint8_t, dst[64]);
DECLARE_ALIGNED(16, uint8_t, src[64]);
#if CONFIG_VP9_HIGHBITDEPTH
DECLARE_ALIGNED_ARRAY(16, uint16_t, dst16, 64);
DECLARE_ALIGNED_ARRAY(16, uint16_t, src16, 64);
DECLARE_ALIGNED(16, uint16_t, dst16[64]);
DECLARE_ALIGNED(16, uint16_t, src16[64]);
#endif
for (int i = 0; i < count_test_block; ++i) {
@ -334,12 +336,11 @@ class FwdTrans8x8TestBase {
ASM_REGISTER_STATE_CHECK(
fwd_txfm_ref(test_input_block, ref_temp_block, pitch_, tx_type_));
if (bit_depth_ == VPX_BITS_8) {
ASM_REGISTER_STATE_CHECK(
RunInvTxfm(test_temp_block, dst, pitch_));
ASM_REGISTER_STATE_CHECK(RunInvTxfm(test_temp_block, dst, pitch_));
#if CONFIG_VP9_HIGHBITDEPTH
} else {
ASM_REGISTER_STATE_CHECK(
RunInvTxfm(test_temp_block, CONVERT_TO_BYTEPTR(dst16), pitch_));
RunInvTxfm(test_temp_block, CAST_TO_BYTEPTR(dst16), pitch_));
#endif
}
@ -351,8 +352,7 @@ class FwdTrans8x8TestBase {
const int diff = dst[j] - src[j];
#endif
const int error = diff * diff;
if (max_error < error)
max_error = error;
if (max_error < error) max_error = error;
total_error += error;
const int coeff_diff = test_temp_block[j] - ref_temp_block[j];
@ -363,7 +363,7 @@ class FwdTrans8x8TestBase {
<< "Error: Extremal 8x8 FDCT/IDCT or FHT/IHT has"
<< "an individual roundtrip error > 1";
EXPECT_GE((count_test_block << 2 * (bit_depth_ - 8))/5, total_error)
EXPECT_GE((count_test_block << 2 * (bit_depth_ - 8)) / 5, total_error)
<< "Error: Extremal 8x8 FDCT/IDCT or FHT/IHT has average"
<< " roundtrip error > 1/5 per block";
@ -376,13 +376,13 @@ class FwdTrans8x8TestBase {
void RunInvAccuracyCheck() {
ACMRandom rnd(ACMRandom::DeterministicSeed());
const int count_test_block = 1000;
DECLARE_ALIGNED_ARRAY(16, int16_t, in, kNumCoeffs);
DECLARE_ALIGNED_ARRAY(16, tran_low_t, coeff, kNumCoeffs);
DECLARE_ALIGNED_ARRAY(16, uint8_t, dst, kNumCoeffs);
DECLARE_ALIGNED_ARRAY(16, uint8_t, src, kNumCoeffs);
DECLARE_ALIGNED(16, int16_t, in[kNumCoeffs]);
DECLARE_ALIGNED(16, tran_low_t, coeff[kNumCoeffs]);
DECLARE_ALIGNED(16, uint8_t, dst[kNumCoeffs]);
DECLARE_ALIGNED(16, uint8_t, src[kNumCoeffs]);
#if CONFIG_VP9_HIGHBITDEPTH
DECLARE_ALIGNED_ARRAY(16, uint16_t, src16, kNumCoeffs);
DECLARE_ALIGNED_ARRAY(16, uint16_t, dst16, kNumCoeffs);
DECLARE_ALIGNED(16, uint16_t, src16[kNumCoeffs]);
DECLARE_ALIGNED(16, uint16_t, dst16[kNumCoeffs]);
#endif
for (int i = 0; i < count_test_block; ++i) {
@ -404,29 +404,29 @@ class FwdTrans8x8TestBase {
}
reference_8x8_dct_2d(in, out_r);
for (int j = 0; j < kNumCoeffs; ++j)
for (int j = 0; j < kNumCoeffs; ++j) {
coeff[j] = static_cast<tran_low_t>(round(out_r[j]));
}
if (bit_depth_ == VPX_BITS_8) {
ASM_REGISTER_STATE_CHECK(RunInvTxfm(coeff, dst, pitch_));
#if CONFIG_VP9_HIGHBITDEPTH
} else {
ASM_REGISTER_STATE_CHECK(RunInvTxfm(coeff, CONVERT_TO_BYTEPTR(dst16),
pitch_));
ASM_REGISTER_STATE_CHECK(
RunInvTxfm(coeff, CAST_TO_BYTEPTR(dst16), pitch_));
#endif
}
for (int j = 0; j < kNumCoeffs; ++j) {
#if CONFIG_VP9_HIGHBITDEPTH
const uint32_t diff =
const int diff =
bit_depth_ == VPX_BITS_8 ? dst[j] - src[j] : dst16[j] - src16[j];
#else
const uint32_t diff = dst[j] - src[j];
const int diff = dst[j] - src[j];
#endif
const uint32_t error = diff * diff;
EXPECT_GE(1u << 2 * (bit_depth_ - 8), error)
<< "Error: 8x8 IDCT has error " << error
<< " at index " << j;
<< "Error: 8x8 IDCT has error " << error << " at index " << j;
}
}
}
@ -434,42 +434,43 @@ class FwdTrans8x8TestBase {
void RunFwdAccuracyCheck() {
ACMRandom rnd(ACMRandom::DeterministicSeed());
const int count_test_block = 1000;
DECLARE_ALIGNED_ARRAY(16, int16_t, in, kNumCoeffs);
DECLARE_ALIGNED_ARRAY(16, tran_low_t, coeff_r, kNumCoeffs);
DECLARE_ALIGNED_ARRAY(16, tran_low_t, coeff, kNumCoeffs);
DECLARE_ALIGNED(16, int16_t, in[kNumCoeffs]);
DECLARE_ALIGNED(16, tran_low_t, coeff_r[kNumCoeffs]);
DECLARE_ALIGNED(16, tran_low_t, coeff[kNumCoeffs]);
for (int i = 0; i < count_test_block; ++i) {
double out_r[kNumCoeffs];
// Initialize a test block with input range [-mask_, mask_].
for (int j = 0; j < kNumCoeffs; ++j)
for (int j = 0; j < kNumCoeffs; ++j) {
in[j] = rnd.Rand8() % 2 == 0 ? mask_ : -mask_;
}
RunFwdTxfm(in, coeff, pitch_);
reference_8x8_dct_2d(in, out_r);
for (int j = 0; j < kNumCoeffs; ++j)
for (int j = 0; j < kNumCoeffs; ++j) {
coeff_r[j] = static_cast<tran_low_t>(round(out_r[j]));
}
for (int j = 0; j < kNumCoeffs; ++j) {
const uint32_t diff = coeff[j] - coeff_r[j];
const int32_t diff = coeff[j] - coeff_r[j];
const uint32_t error = diff * diff;
EXPECT_GE(9u << 2 * (bit_depth_ - 8), error)
<< "Error: 8x8 DCT has error " << error
<< " at index " << j;
<< "Error: 8x8 DCT has error " << error << " at index " << j;
}
}
}
void CompareInvReference(IdctFunc ref_txfm, int thresh) {
void CompareInvReference(IdctFunc ref_txfm, int thresh) {
ACMRandom rnd(ACMRandom::DeterministicSeed());
const int count_test_block = 10000;
const int eob = 12;
DECLARE_ALIGNED_ARRAY(16, tran_low_t, coeff, kNumCoeffs);
DECLARE_ALIGNED_ARRAY(16, uint8_t, dst, kNumCoeffs);
DECLARE_ALIGNED_ARRAY(16, uint8_t, ref, kNumCoeffs);
DECLARE_ALIGNED(16, tran_low_t, coeff[kNumCoeffs]);
DECLARE_ALIGNED(16, uint8_t, dst[kNumCoeffs]);
DECLARE_ALIGNED(16, uint8_t, ref[kNumCoeffs]);
#if CONFIG_VP9_HIGHBITDEPTH
DECLARE_ALIGNED_ARRAY(16, uint16_t, dst16, kNumCoeffs);
DECLARE_ALIGNED_ARRAY(16, uint16_t, ref16, kNumCoeffs);
DECLARE_ALIGNED(16, uint16_t, dst16[kNumCoeffs]);
DECLARE_ALIGNED(16, uint16_t, ref16[kNumCoeffs]);
#endif
const int16_t *scan = vp9_default_scan_orders[TX_8X8].scan;
@ -477,7 +478,7 @@ void CompareInvReference(IdctFunc ref_txfm, int thresh) {
for (int j = 0; j < kNumCoeffs; ++j) {
if (j < eob) {
// Random values less than the threshold, either positive or negative
coeff[scan[j]] = rnd(thresh) * (1-2*(i%2));
coeff[scan[j]] = rnd(thresh) * (1 - 2 * (i % 2));
} else {
coeff[scan[j]] = 0;
}
@ -496,23 +497,22 @@ void CompareInvReference(IdctFunc ref_txfm, int thresh) {
ASM_REGISTER_STATE_CHECK(RunInvTxfm(coeff, dst, pitch_));
#if CONFIG_VP9_HIGHBITDEPTH
} else {
ref_txfm(coeff, CONVERT_TO_BYTEPTR(ref16), pitch_);
ASM_REGISTER_STATE_CHECK(RunInvTxfm(coeff, CONVERT_TO_BYTEPTR(dst16),
pitch_));
ref_txfm(coeff, CAST_TO_BYTEPTR(ref16), pitch_);
ASM_REGISTER_STATE_CHECK(
RunInvTxfm(coeff, CAST_TO_BYTEPTR(dst16), pitch_));
#endif
}
for (int j = 0; j < kNumCoeffs; ++j) {
#if CONFIG_VP9_HIGHBITDEPTH
const uint32_t diff =
const int diff =
bit_depth_ == VPX_BITS_8 ? dst[j] - ref[j] : dst16[j] - ref16[j];
#else
const uint32_t diff = dst[j] - ref[j];
const int diff = dst[j] - ref[j];
#endif
const uint32_t error = diff * diff;
EXPECT_EQ(0u, error)
<< "Error: 8x8 IDCT has error " << error
<< " at index " << j;
<< "Error: 8x8 IDCT has error " << error << " at index " << j;
}
}
}
@ -523,17 +523,16 @@ void CompareInvReference(IdctFunc ref_txfm, int thresh) {
int mask_;
};
class FwdTrans8x8DCT
: public FwdTrans8x8TestBase,
public ::testing::TestWithParam<Dct8x8Param> {
class FwdTrans8x8DCT : public FwdTrans8x8TestBase,
public ::testing::TestWithParam<Dct8x8Param> {
public:
virtual ~FwdTrans8x8DCT() {}
virtual void SetUp() {
fwd_txfm_ = GET_PARAM(0);
inv_txfm_ = GET_PARAM(1);
tx_type_ = GET_PARAM(2);
pitch_ = 8;
tx_type_ = GET_PARAM(2);
pitch_ = 8;
fwd_txfm_ref = fdct8x8_ref;
bit_depth_ = GET_PARAM(3);
mask_ = (1 << bit_depth_) - 1;
@ -553,37 +552,26 @@ class FwdTrans8x8DCT
IdctFunc inv_txfm_;
};
TEST_P(FwdTrans8x8DCT, SignBiasCheck) {
RunSignBiasCheck();
}
TEST_P(FwdTrans8x8DCT, SignBiasCheck) { RunSignBiasCheck(); }
TEST_P(FwdTrans8x8DCT, RoundTripErrorCheck) {
RunRoundTripErrorCheck();
}
TEST_P(FwdTrans8x8DCT, RoundTripErrorCheck) { RunRoundTripErrorCheck(); }
TEST_P(FwdTrans8x8DCT, ExtremalCheck) {
RunExtremalCheck();
}
TEST_P(FwdTrans8x8DCT, ExtremalCheck) { RunExtremalCheck(); }
TEST_P(FwdTrans8x8DCT, FwdAccuracyCheck) {
RunFwdAccuracyCheck();
}
TEST_P(FwdTrans8x8DCT, FwdAccuracyCheck) { RunFwdAccuracyCheck(); }
TEST_P(FwdTrans8x8DCT, InvAccuracyCheck) {
RunInvAccuracyCheck();
}
TEST_P(FwdTrans8x8DCT, InvAccuracyCheck) { RunInvAccuracyCheck(); }
class FwdTrans8x8HT
: public FwdTrans8x8TestBase,
public ::testing::TestWithParam<Ht8x8Param> {
class FwdTrans8x8HT : public FwdTrans8x8TestBase,
public ::testing::TestWithParam<Ht8x8Param> {
public:
virtual ~FwdTrans8x8HT() {}
virtual void SetUp() {
fwd_txfm_ = GET_PARAM(0);
inv_txfm_ = GET_PARAM(1);
tx_type_ = GET_PARAM(2);
pitch_ = 8;
tx_type_ = GET_PARAM(2);
pitch_ = 8;
fwd_txfm_ref = fht8x8_ref;
bit_depth_ = GET_PARAM(3);
mask_ = (1 << bit_depth_) - 1;
@ -603,21 +591,14 @@ class FwdTrans8x8HT
IhtFunc inv_txfm_;
};
TEST_P(FwdTrans8x8HT, SignBiasCheck) {
RunSignBiasCheck();
}
TEST_P(FwdTrans8x8HT, SignBiasCheck) { RunSignBiasCheck(); }
TEST_P(FwdTrans8x8HT, RoundTripErrorCheck) {
RunRoundTripErrorCheck();
}
TEST_P(FwdTrans8x8HT, RoundTripErrorCheck) { RunRoundTripErrorCheck(); }
TEST_P(FwdTrans8x8HT, ExtremalCheck) {
RunExtremalCheck();
}
TEST_P(FwdTrans8x8HT, ExtremalCheck) { RunExtremalCheck(); }
class InvTrans8x8DCT
: public FwdTrans8x8TestBase,
public ::testing::TestWithParam<Idct8x8Param> {
class InvTrans8x8DCT : public FwdTrans8x8TestBase,
public ::testing::TestWithParam<Idct8x8Param> {
public:
virtual ~InvTrans8x8DCT() {}
@ -636,7 +617,7 @@ class InvTrans8x8DCT
void RunInvTxfm(tran_low_t *out, uint8_t *dst, int stride) {
inv_txfm_(out, dst, stride);
}
void RunFwdTxfm(int16_t *out, tran_low_t *dst, int stride) {}
void RunFwdTxfm(int16_t * /*out*/, tran_low_t * /*dst*/, int /*stride*/) {}
IdctFunc ref_txfm_;
IdctFunc inv_txfm_;
@ -647,20 +628,20 @@ TEST_P(InvTrans8x8DCT, CompareReference) {
CompareInvReference(ref_txfm_, thresh_);
}
using std::tr1::make_tuple;
using ::testing::make_tuple;
#if CONFIG_VP9_HIGHBITDEPTH
INSTANTIATE_TEST_CASE_P(
C, FwdTrans8x8DCT,
::testing::Values(
make_tuple(&vp9_fdct8x8_c, &vp9_idct8x8_64_add_c, 0, VPX_BITS_8),
make_tuple(&vp9_highbd_fdct8x8_c, &idct8x8_10, 0, VPX_BITS_10),
make_tuple(&vp9_highbd_fdct8x8_c, &idct8x8_12, 0, VPX_BITS_12)));
make_tuple(&vpx_fdct8x8_c, &vpx_idct8x8_64_add_c, 0, VPX_BITS_8),
make_tuple(&vpx_highbd_fdct8x8_c, &idct8x8_10, 0, VPX_BITS_10),
make_tuple(&vpx_highbd_fdct8x8_c, &idct8x8_12, 0, VPX_BITS_12)));
#else
INSTANTIATE_TEST_CASE_P(
C, FwdTrans8x8DCT,
::testing::Values(
make_tuple(&vp9_fdct8x8_c, &vp9_idct8x8_64_add_c, 0, VPX_BITS_8)));
INSTANTIATE_TEST_CASE_P(C, FwdTrans8x8DCT,
::testing::Values(make_tuple(&vpx_fdct8x8_c,
&vpx_idct8x8_64_add_c, 0,
VPX_BITS_8)));
#endif // CONFIG_VP9_HIGHBITDEPTH
#if CONFIG_VP9_HIGHBITDEPTH
@ -680,8 +661,6 @@ INSTANTIATE_TEST_CASE_P(
make_tuple(&vp9_fht8x8_c, &vp9_iht8x8_64_add_c, 2, VPX_BITS_8),
make_tuple(&vp9_fht8x8_c, &vp9_iht8x8_64_add_c, 3, VPX_BITS_8)));
#else
// TODO(jingning): re-enable after this handles the expanded range [0, 65535]
// returned from Rand16().
INSTANTIATE_TEST_CASE_P(
C, FwdTrans8x8HT,
::testing::Values(
@ -691,17 +670,13 @@ INSTANTIATE_TEST_CASE_P(
make_tuple(&vp9_fht8x8_c, &vp9_iht8x8_64_add_c, 3, VPX_BITS_8)));
#endif // CONFIG_VP9_HIGHBITDEPTH
#if HAVE_NEON_ASM && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
// TODO(jingning): re-enable after this handles the expanded range [0, 65535]
// returned from Rand16().
INSTANTIATE_TEST_CASE_P(
NEON, FwdTrans8x8DCT,
::testing::Values(
make_tuple(&vp9_fdct8x8_neon, &vp9_idct8x8_64_add_neon, 0,
VPX_BITS_8)));
#endif // HAVE_NEON_ASM && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
#if HAVE_NEON && !CONFIG_EMULATE_HARDWARE
INSTANTIATE_TEST_CASE_P(NEON, FwdTrans8x8DCT,
::testing::Values(make_tuple(&vpx_fdct8x8_neon,
&vpx_idct8x8_64_add_neon,
0, VPX_BITS_8)));
#if HAVE_NEON && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
#if !CONFIG_VP9_HIGHBITDEPTH
INSTANTIATE_TEST_CASE_P(
NEON, FwdTrans8x8HT,
::testing::Values(
@ -709,16 +684,14 @@ INSTANTIATE_TEST_CASE_P(
make_tuple(&vp9_fht8x8_c, &vp9_iht8x8_64_add_neon, 1, VPX_BITS_8),
make_tuple(&vp9_fht8x8_c, &vp9_iht8x8_64_add_neon, 2, VPX_BITS_8),
make_tuple(&vp9_fht8x8_c, &vp9_iht8x8_64_add_neon, 3, VPX_BITS_8)));
#endif // HAVE_NEON && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
#endif // !CONFIG_VP9_HIGHBITDEPTH
#endif // HAVE_NEON && !CONFIG_EMULATE_HARDWARE
#if HAVE_SSE2 && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
// TODO(jingning): re-enable after these handle the expanded range [0, 65535]
// returned from Rand16().
INSTANTIATE_TEST_CASE_P(
SSE2, FwdTrans8x8DCT,
::testing::Values(
make_tuple(&vp9_fdct8x8_sse2, &vp9_idct8x8_64_add_sse2, 0,
VPX_BITS_8)));
INSTANTIATE_TEST_CASE_P(SSE2, FwdTrans8x8DCT,
::testing::Values(make_tuple(&vpx_fdct8x8_sse2,
&vpx_idct8x8_64_add_sse2,
0, VPX_BITS_8)));
INSTANTIATE_TEST_CASE_P(
SSE2, FwdTrans8x8HT,
::testing::Values(
@ -731,19 +704,17 @@ INSTANTIATE_TEST_CASE_P(
#if HAVE_SSE2 && CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
INSTANTIATE_TEST_CASE_P(
SSE2, FwdTrans8x8DCT,
::testing::Values(
make_tuple(&vp9_fdct8x8_sse2, &vp9_idct8x8_64_add_c, 0, VPX_BITS_8),
make_tuple(&vp9_highbd_fdct8x8_c,
&idct8x8_64_add_10_sse2, 12, VPX_BITS_10),
make_tuple(&vp9_highbd_fdct8x8_sse2,
&idct8x8_64_add_10_sse2, 12, VPX_BITS_10),
make_tuple(&vp9_highbd_fdct8x8_c,
&idct8x8_64_add_12_sse2, 12, VPX_BITS_12),
make_tuple(&vp9_highbd_fdct8x8_sse2,
&idct8x8_64_add_12_sse2, 12, VPX_BITS_12)));
::testing::Values(make_tuple(&vpx_fdct8x8_sse2, &vpx_idct8x8_64_add_c, 0,
VPX_BITS_8),
make_tuple(&vpx_highbd_fdct8x8_c, &idct8x8_64_add_10_sse2,
12, VPX_BITS_10),
make_tuple(&vpx_highbd_fdct8x8_sse2,
&idct8x8_64_add_10_sse2, 12, VPX_BITS_10),
make_tuple(&vpx_highbd_fdct8x8_c, &idct8x8_64_add_12_sse2,
12, VPX_BITS_12),
make_tuple(&vpx_highbd_fdct8x8_sse2,
&idct8x8_64_add_12_sse2, 12, VPX_BITS_12)));
// TODO(jingning): re-enable after these handle the expanded range [0, 65535]
// returned from Rand16().
INSTANTIATE_TEST_CASE_P(
SSE2, FwdTrans8x8HT,
::testing::Values(
@ -757,24 +728,40 @@ INSTANTIATE_TEST_CASE_P(
INSTANTIATE_TEST_CASE_P(
SSE2, InvTrans8x8DCT,
::testing::Values(
make_tuple(&idct8x8_10_add_10_c,
&idct8x8_10_add_10_sse2, 6225, VPX_BITS_10),
make_tuple(&idct8x8_10,
&idct8x8_64_add_10_sse2, 6225, VPX_BITS_10),
make_tuple(&idct8x8_10_add_12_c,
&idct8x8_10_add_12_sse2, 6225, VPX_BITS_12),
make_tuple(&idct8x8_12,
&idct8x8_64_add_12_sse2, 6225, VPX_BITS_12)));
make_tuple(&idct8x8_12_add_10_c, &idct8x8_12_add_10_sse2, 6225,
VPX_BITS_10),
make_tuple(&idct8x8_10, &idct8x8_64_add_10_sse2, 6225, VPX_BITS_10),
make_tuple(&idct8x8_12_add_12_c, &idct8x8_12_add_12_sse2, 6225,
VPX_BITS_12),
make_tuple(&idct8x8_12, &idct8x8_64_add_12_sse2, 6225, VPX_BITS_12)));
#endif // HAVE_SSE2 && CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
#if HAVE_SSSE3 && ARCH_X86_64 && !CONFIG_VP9_HIGHBITDEPTH && \
!CONFIG_EMULATE_HARDWARE
// TODO(jingning): re-enable after this handles the expanded range [0, 65535]
// returned from Rand16().
INSTANTIATE_TEST_CASE_P(
SSSE3, FwdTrans8x8DCT,
::testing::Values(
make_tuple(&vp9_fdct8x8_ssse3, &vp9_idct8x8_64_add_ssse3, 0,
VPX_BITS_8)));
INSTANTIATE_TEST_CASE_P(SSSE3, FwdTrans8x8DCT,
::testing::Values(make_tuple(&vpx_fdct8x8_ssse3,
&vpx_idct8x8_64_add_sse2,
0, VPX_BITS_8)));
#endif
#if HAVE_MSA && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
INSTANTIATE_TEST_CASE_P(MSA, FwdTrans8x8DCT,
::testing::Values(make_tuple(&vpx_fdct8x8_msa,
&vpx_idct8x8_64_add_msa, 0,
VPX_BITS_8)));
INSTANTIATE_TEST_CASE_P(
MSA, FwdTrans8x8HT,
::testing::Values(
make_tuple(&vp9_fht8x8_msa, &vp9_iht8x8_64_add_msa, 0, VPX_BITS_8),
make_tuple(&vp9_fht8x8_msa, &vp9_iht8x8_64_add_msa, 1, VPX_BITS_8),
make_tuple(&vp9_fht8x8_msa, &vp9_iht8x8_64_add_msa, 2, VPX_BITS_8),
make_tuple(&vp9_fht8x8_msa, &vp9_iht8x8_64_add_msa, 3, VPX_BITS_8)));
#endif // HAVE_MSA && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
#if HAVE_VSX && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
INSTANTIATE_TEST_CASE_P(VSX, FwdTrans8x8DCT,
::testing::Values(make_tuple(&vpx_fdct8x8_c,
&vpx_idct8x8_64_add_vsx, 0,
VPX_BITS_8)));
#endif // HAVE_VSX && !CONFIG_VP9_HIGHBITDEPTH && !CONFIG_EMULATE_HARDWARE
} // namespace

View File

@ -13,12 +13,11 @@
namespace {
class VP9FrameSizeTestsLarge
: public ::libvpx_test::EncoderTest,
public ::testing::Test {
class VP9FrameSizeTestsLarge : public ::libvpx_test::EncoderTest,
public ::testing::Test {
protected:
VP9FrameSizeTestsLarge() : EncoderTest(&::libvpx_test::kVP9),
expected_res_(VPX_CODEC_OK) {}
VP9FrameSizeTestsLarge()
: EncoderTest(&::libvpx_test::kVP9), expected_res_(VPX_CODEC_OK) {}
virtual ~VP9FrameSizeTestsLarge() {}
virtual void SetUp() {
@ -27,7 +26,7 @@ class VP9FrameSizeTestsLarge
}
virtual bool HandleDecodeResult(const vpx_codec_err_t res_dec,
const libvpx_test::VideoSource& /*video*/,
const libvpx_test::VideoSource & /*video*/,
libvpx_test::Decoder *decoder) {
EXPECT_EQ(expected_res_, res_dec) << decoder->DecodeError();
return !::testing::Test::HasFailure();
@ -67,14 +66,14 @@ TEST_F(VP9FrameSizeTestsLarge, ValidSizes) {
expected_res_ = VPX_CODEC_OK;
ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
#else
// This test produces a pretty large single frame allocation, (roughly
// 25 megabits). The encoder allocates a good number of these frames
// one for each lag in frames (for 2 pass), and then one for each possible
// reference buffer (8) - we can end up with up to 30 buffers of roughly this
// size or almost 1 gig of memory.
// In total the allocations will exceed 2GiB which may cause a failure with
// mingw + wine, use a smaller size in that case.
#if defined(_WIN32) && !defined(_WIN64)
// This test produces a pretty large single frame allocation, (roughly
// 25 megabits). The encoder allocates a good number of these frames
// one for each lag in frames (for 2 pass), and then one for each possible
// reference buffer (8) - we can end up with up to 30 buffers of roughly this
// size or almost 1 gig of memory.
// In total the allocations will exceed 2GiB which may cause a failure with
// mingw + wine, use a smaller size in that case.
#if defined(_WIN32) && !defined(_WIN64) || defined(__OS2__)
video.SetSize(4096, 3072);
#else
video.SetSize(4096, 4096);

293
test/hadamard_test.cc Normal file
View File

@ -0,0 +1,293 @@
/*
* Copyright (c) 2016 The WebM project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#include <algorithm>
#include "third_party/googletest/src/include/gtest/gtest.h"
#include "./vpx_dsp_rtcd.h"
#include "vpx_ports/vpx_timer.h"
#include "test/acm_random.h"
#include "test/register_state_check.h"
namespace {
using ::libvpx_test::ACMRandom;
typedef void (*HadamardFunc)(const int16_t *a, ptrdiff_t a_stride,
tran_low_t *b);
void hadamard_loop(const int16_t *a, int a_stride, int16_t *out) {
int16_t b[8];
for (int i = 0; i < 8; i += 2) {
b[i + 0] = a[i * a_stride] + a[(i + 1) * a_stride];
b[i + 1] = a[i * a_stride] - a[(i + 1) * a_stride];
}
int16_t c[8];
for (int i = 0; i < 8; i += 4) {
c[i + 0] = b[i + 0] + b[i + 2];
c[i + 1] = b[i + 1] + b[i + 3];
c[i + 2] = b[i + 0] - b[i + 2];
c[i + 3] = b[i + 1] - b[i + 3];
}
out[0] = c[0] + c[4];
out[7] = c[1] + c[5];
out[3] = c[2] + c[6];
out[4] = c[3] + c[7];
out[2] = c[0] - c[4];
out[6] = c[1] - c[5];
out[1] = c[2] - c[6];
out[5] = c[3] - c[7];
}
void reference_hadamard8x8(const int16_t *a, int a_stride, tran_low_t *b) {
int16_t buf[64];
int16_t buf2[64];
for (int i = 0; i < 8; ++i) hadamard_loop(a + i, a_stride, buf + i * 8);
for (int i = 0; i < 8; ++i) hadamard_loop(buf + i, 8, buf2 + i * 8);
for (int i = 0; i < 64; ++i) b[i] = (tran_low_t)buf2[i];
}
void reference_hadamard16x16(const int16_t *a, int a_stride, tran_low_t *b) {
/* The source is a 16x16 block. The destination is rearranged to 8x32.
* Input is 9 bit. */
reference_hadamard8x8(a + 0 + 0 * a_stride, a_stride, b + 0);
reference_hadamard8x8(a + 8 + 0 * a_stride, a_stride, b + 64);
reference_hadamard8x8(a + 0 + 8 * a_stride, a_stride, b + 128);
reference_hadamard8x8(a + 8 + 8 * a_stride, a_stride, b + 192);
/* Overlay the 8x8 blocks and combine. */
for (int i = 0; i < 64; ++i) {
/* 8x8 steps the range up to 15 bits. */
const tran_low_t a0 = b[0];
const tran_low_t a1 = b[64];
const tran_low_t a2 = b[128];
const tran_low_t a3 = b[192];
/* Prevent the result from escaping int16_t. */
const tran_low_t b0 = (a0 + a1) >> 1;
const tran_low_t b1 = (a0 - a1) >> 1;
const tran_low_t b2 = (a2 + a3) >> 1;
const tran_low_t b3 = (a2 - a3) >> 1;
/* Store a 16 bit value. */
b[0] = b0 + b2;
b[64] = b1 + b3;
b[128] = b0 - b2;
b[192] = b1 - b3;
++b;
}
}
class HadamardTestBase : public ::testing::TestWithParam<HadamardFunc> {
public:
virtual void SetUp() {
h_func_ = GetParam();
rnd_.Reset(ACMRandom::DeterministicSeed());
}
protected:
HadamardFunc h_func_;
ACMRandom rnd_;
};
void HadamardSpeedTest(const char *name, HadamardFunc const func,
const int16_t *input, int stride, tran_low_t *output,
int times) {
int i;
vpx_usec_timer timer;
vpx_usec_timer_start(&timer);
for (i = 0; i < times; ++i) {
func(input, stride, output);
}
vpx_usec_timer_mark(&timer);
const int elapsed_time = static_cast<int>(vpx_usec_timer_elapsed(&timer));
printf("%s[%12d runs]: %d us\n", name, times, elapsed_time);
}
class Hadamard8x8Test : public HadamardTestBase {};
void HadamardSpeedTest8x8(HadamardFunc const func, int times) {
DECLARE_ALIGNED(16, int16_t, input[64]);
DECLARE_ALIGNED(16, tran_low_t, output[64]);
memset(input, 1, sizeof(input));
HadamardSpeedTest("Hadamard8x8", func, input, 8, output, times);
}
TEST_P(Hadamard8x8Test, CompareReferenceRandom) {
DECLARE_ALIGNED(16, int16_t, a[64]);
DECLARE_ALIGNED(16, tran_low_t, b[64]);
tran_low_t b_ref[64];
for (int i = 0; i < 64; ++i) {
a[i] = rnd_.Rand9Signed();
}
memset(b, 0, sizeof(b));
memset(b_ref, 0, sizeof(b_ref));
reference_hadamard8x8(a, 8, b_ref);
ASM_REGISTER_STATE_CHECK(h_func_(a, 8, b));
// The order of the output is not important. Sort before checking.
std::sort(b, b + 64);
std::sort(b_ref, b_ref + 64);
EXPECT_EQ(0, memcmp(b, b_ref, sizeof(b)));
}
TEST_P(Hadamard8x8Test, VaryStride) {
DECLARE_ALIGNED(16, int16_t, a[64 * 8]);
DECLARE_ALIGNED(16, tran_low_t, b[64]);
tran_low_t b_ref[64];
for (int i = 0; i < 64 * 8; ++i) {
a[i] = rnd_.Rand9Signed();
}
for (int i = 8; i < 64; i += 8) {
memset(b, 0, sizeof(b));
memset(b_ref, 0, sizeof(b_ref));
reference_hadamard8x8(a, i, b_ref);
ASM_REGISTER_STATE_CHECK(h_func_(a, i, b));
// The order of the output is not important. Sort before checking.
std::sort(b, b + 64);
std::sort(b_ref, b_ref + 64);
EXPECT_EQ(0, memcmp(b, b_ref, sizeof(b)));
}
}
TEST_P(Hadamard8x8Test, DISABLED_Speed) {
HadamardSpeedTest8x8(h_func_, 10);
HadamardSpeedTest8x8(h_func_, 10000);
HadamardSpeedTest8x8(h_func_, 10000000);
}
INSTANTIATE_TEST_CASE_P(C, Hadamard8x8Test,
::testing::Values(&vpx_hadamard_8x8_c));
#if HAVE_SSE2
INSTANTIATE_TEST_CASE_P(SSE2, Hadamard8x8Test,
::testing::Values(&vpx_hadamard_8x8_sse2));
#endif // HAVE_SSE2
#if HAVE_SSSE3 && ARCH_X86_64
INSTANTIATE_TEST_CASE_P(SSSE3, Hadamard8x8Test,
::testing::Values(&vpx_hadamard_8x8_ssse3));
#endif // HAVE_SSSE3 && ARCH_X86_64
#if HAVE_NEON
INSTANTIATE_TEST_CASE_P(NEON, Hadamard8x8Test,
::testing::Values(&vpx_hadamard_8x8_neon));
#endif // HAVE_NEON
// TODO(jingning): Remove highbitdepth flag when the SIMD functions are
// in place and turn on the unit test.
#if !CONFIG_VP9_HIGHBITDEPTH
#if HAVE_MSA
INSTANTIATE_TEST_CASE_P(MSA, Hadamard8x8Test,
::testing::Values(&vpx_hadamard_8x8_msa));
#endif // HAVE_MSA
#endif // !CONFIG_VP9_HIGHBITDEPTH
#if HAVE_VSX
INSTANTIATE_TEST_CASE_P(VSX, Hadamard8x8Test,
::testing::Values(&vpx_hadamard_8x8_vsx));
#endif // HAVE_VSX
class Hadamard16x16Test : public HadamardTestBase {};
void HadamardSpeedTest16x16(HadamardFunc const func, int times) {
DECLARE_ALIGNED(16, int16_t, input[256]);
DECLARE_ALIGNED(16, tran_low_t, output[256]);
memset(input, 1, sizeof(input));
HadamardSpeedTest("Hadamard16x16", func, input, 16, output, times);
}
TEST_P(Hadamard16x16Test, CompareReferenceRandom) {
DECLARE_ALIGNED(16, int16_t, a[16 * 16]);
DECLARE_ALIGNED(16, tran_low_t, b[16 * 16]);
tran_low_t b_ref[16 * 16];
for (int i = 0; i < 16 * 16; ++i) {
a[i] = rnd_.Rand9Signed();
}
memset(b, 0, sizeof(b));
memset(b_ref, 0, sizeof(b_ref));
reference_hadamard16x16(a, 16, b_ref);
ASM_REGISTER_STATE_CHECK(h_func_(a, 16, b));
// The order of the output is not important. Sort before checking.
std::sort(b, b + 16 * 16);
std::sort(b_ref, b_ref + 16 * 16);
EXPECT_EQ(0, memcmp(b, b_ref, sizeof(b)));
}
TEST_P(Hadamard16x16Test, VaryStride) {
DECLARE_ALIGNED(16, int16_t, a[16 * 16 * 8]);
DECLARE_ALIGNED(16, tran_low_t, b[16 * 16]);
tran_low_t b_ref[16 * 16];
for (int i = 0; i < 16 * 16 * 8; ++i) {
a[i] = rnd_.Rand9Signed();
}
for (int i = 8; i < 64; i += 8) {
memset(b, 0, sizeof(b));
memset(b_ref, 0, sizeof(b_ref));
reference_hadamard16x16(a, i, b_ref);
ASM_REGISTER_STATE_CHECK(h_func_(a, i, b));
// The order of the output is not important. Sort before checking.
std::sort(b, b + 16 * 16);
std::sort(b_ref, b_ref + 16 * 16);
EXPECT_EQ(0, memcmp(b, b_ref, sizeof(b)));
}
}
TEST_P(Hadamard16x16Test, DISABLED_Speed) {
HadamardSpeedTest16x16(h_func_, 10);
HadamardSpeedTest16x16(h_func_, 10000);
HadamardSpeedTest16x16(h_func_, 10000000);
}
INSTANTIATE_TEST_CASE_P(C, Hadamard16x16Test,
::testing::Values(&vpx_hadamard_16x16_c));
#if HAVE_SSE2
INSTANTIATE_TEST_CASE_P(SSE2, Hadamard16x16Test,
::testing::Values(&vpx_hadamard_16x16_sse2));
#endif // HAVE_SSE2
#if HAVE_AVX2
INSTANTIATE_TEST_CASE_P(AVX2, Hadamard16x16Test,
::testing::Values(&vpx_hadamard_16x16_avx2));
#endif // HAVE_AVX2
#if HAVE_VSX
INSTANTIATE_TEST_CASE_P(VSX, Hadamard16x16Test,
::testing::Values(&vpx_hadamard_16x16_vsx));
#endif // HAVE_VSX
#if HAVE_NEON
INSTANTIATE_TEST_CASE_P(NEON, Hadamard16x16Test,
::testing::Values(&vpx_hadamard_16x16_neon));
#endif // HAVE_NEON
#if !CONFIG_VP9_HIGHBITDEPTH
#if HAVE_MSA
INSTANTIATE_TEST_CASE_P(MSA, Hadamard16x16Test,
::testing::Values(&vpx_hadamard_16x16_msa));
#endif // HAVE_MSA
#endif // !CONFIG_VP9_HIGHBITDEPTH
} // namespace

View File

@ -21,14 +21,11 @@ namespace libvpx_test {
// so that we can do actual file encodes.
class I420VideoSource : public YUVVideoSource {
public:
I420VideoSource(const std::string &file_name,
unsigned int width, unsigned int height,
int rate_numerator, int rate_denominator,
I420VideoSource(const std::string &file_name, unsigned int width,
unsigned int height, int rate_numerator, int rate_denominator,
unsigned int start, int limit)
: YUVVideoSource(file_name, VPX_IMG_FMT_I420,
width, height,
rate_numerator, rate_denominator,
start, limit) {}
: YUVVideoSource(file_name, VPX_IMG_FMT_I420, width, height,
rate_numerator, rate_denominator, start, limit) {}
};
} // namespace libvpx_test

View File

@ -14,33 +14,24 @@
#include "third_party/googletest/src/include/gtest/gtest.h"
#include "./vp9_rtcd.h"
#include "./vpx_dsp_rtcd.h"
#include "test/acm_random.h"
#include "vpx/vpx_integer.h"
#include "vpx_ports/msvc.h" // for round()
using libvpx_test::ACMRandom;
namespace {
#ifdef _MSC_VER
static int round(double x) {
if (x < 0)
return static_cast<int>(ceil(x - 0.5));
else
return static_cast<int>(floor(x + 0.5));
}
#endif
void reference_dct_1d(double input[8], double output[8]) {
const double kPi = 3.141592653589793238462643383279502884;
const double kInvSqrt2 = 0.707106781186547524400844362104;
for (int k = 0; k < 8; k++) {
output[k] = 0.0;
for (int n = 0; n < 8; n++)
output[k] += input[n]*cos(kPi*(2*n+1)*k/16.0);
if (k == 0)
output[k] = output[k]*kInvSqrt2;
for (int n = 0; n < 8; n++) {
output[k] += input[n] * cos(kPi * (2 * n + 1) * k / 16.0);
}
if (k == 0) output[k] = output[k] * kInvSqrt2;
}
}
@ -48,61 +39,19 @@ void reference_dct_2d(int16_t input[64], double output[64]) {
// First transform columns
for (int i = 0; i < 8; ++i) {
double temp_in[8], temp_out[8];
for (int j = 0; j < 8; ++j)
temp_in[j] = input[j*8 + i];
for (int j = 0; j < 8; ++j) temp_in[j] = input[j * 8 + i];
reference_dct_1d(temp_in, temp_out);
for (int j = 0; j < 8; ++j)
output[j*8 + i] = temp_out[j];
for (int j = 0; j < 8; ++j) output[j * 8 + i] = temp_out[j];
}
// Then transform rows
for (int i = 0; i < 8; ++i) {
double temp_in[8], temp_out[8];
for (int j = 0; j < 8; ++j)
temp_in[j] = output[j + i*8];
for (int j = 0; j < 8; ++j) temp_in[j] = output[j + i * 8];
reference_dct_1d(temp_in, temp_out);
for (int j = 0; j < 8; ++j)
output[j + i*8] = temp_out[j];
for (int j = 0; j < 8; ++j) output[j + i * 8] = temp_out[j];
}
// Scale by some magic number
for (int i = 0; i < 64; ++i)
output[i] *= 2;
}
void reference_idct_1d(double input[8], double output[8]) {
const double kPi = 3.141592653589793238462643383279502884;
const double kSqrt2 = 1.414213562373095048801688724209698;
for (int k = 0; k < 8; k++) {
output[k] = 0.0;
for (int n = 0; n < 8; n++) {
output[k] += input[n]*cos(kPi*(2*k+1)*n/16.0);
if (n == 0)
output[k] = output[k]/kSqrt2;
}
}
}
void reference_idct_2d(double input[64], int16_t output[64]) {
double out[64], out2[64];
// First transform rows
for (int i = 0; i < 8; ++i) {
double temp_in[8], temp_out[8];
for (int j = 0; j < 8; ++j)
temp_in[j] = input[j + i*8];
reference_idct_1d(temp_in, temp_out);
for (int j = 0; j < 8; ++j)
out[j + i*8] = temp_out[j];
}
// Then transform columns
for (int i = 0; i < 8; ++i) {
double temp_in[8], temp_out[8];
for (int j = 0; j < 8; ++j)
temp_in[j] = out[j*8 + i];
reference_idct_1d(temp_in, temp_out);
for (int j = 0; j < 8; ++j)
out2[j*8 + i] = temp_out[j];
}
for (int i = 0; i < 64; ++i)
output[i] = round(out2[i]/32);
for (int i = 0; i < 64; ++i) output[i] *= 2;
}
TEST(VP9Idct8x8Test, AccuracyCheck) {
@ -119,19 +68,18 @@ TEST(VP9Idct8x8Test, AccuracyCheck) {
dst[j] = rnd.Rand8();
}
// Initialize a test block with input range [-255, 255].
for (int j = 0; j < 64; ++j)
input[j] = src[j] - dst[j];
for (int j = 0; j < 64; ++j) input[j] = src[j] - dst[j];
reference_dct_2d(input, output_r);
for (int j = 0; j < 64; ++j)
coeff[j] = round(output_r[j]);
vp9_idct8x8_64_add_c(coeff, dst, 8);
for (int j = 0; j < 64; ++j) {
coeff[j] = static_cast<tran_low_t>(round(output_r[j]));
}
vpx_idct8x8_64_add_c(coeff, dst, 8);
for (int j = 0; j < 64; ++j) {
const int diff = dst[j] - src[j];
const int error = diff * diff;
EXPECT_GE(1, error)
<< "Error: 8x8 FDCT/IDCT has error " << error
<< " at index " << j;
EXPECT_GE(1, error) << "Error: 8x8 FDCT/IDCT has error " << error
<< " at index " << j;
}
}
}

View File

@ -10,107 +10,168 @@
#include "./vpx_config.h"
#include "./vp8_rtcd.h"
#include "test/clear_system_state.h"
#include "test/register_state_check.h"
#include "third_party/googletest/src/include/gtest/gtest.h"
#include "test/buffer.h"
#include "test/clear_system_state.h"
#include "test/register_state_check.h"
#include "vpx/vpx_integer.h"
typedef void (*IdctFunc)(int16_t *input, unsigned char *pred_ptr,
int pred_stride, unsigned char *dst_ptr,
int dst_stride);
namespace {
using libvpx_test::Buffer;
class IDCTTest : public ::testing::TestWithParam<IdctFunc> {
protected:
virtual void SetUp() {
int i;
UUT = GetParam();
memset(input, 0, sizeof(input));
/* Set up guard blocks */
for (i = 0; i < 256; i++) output[i] = ((i & 0xF) < 4 && (i < 64)) ? 0 : -1;
input = new Buffer<int16_t>(4, 4, 0);
ASSERT_TRUE(input != NULL);
ASSERT_TRUE(input->Init());
predict = new Buffer<uint8_t>(4, 4, 3);
ASSERT_TRUE(predict != NULL);
ASSERT_TRUE(predict->Init());
output = new Buffer<uint8_t>(4, 4, 3);
ASSERT_TRUE(output != NULL);
ASSERT_TRUE(output->Init());
}
virtual void TearDown() { libvpx_test::ClearSystemState(); }
virtual void TearDown() {
delete input;
delete predict;
delete output;
libvpx_test::ClearSystemState();
}
IdctFunc UUT;
int16_t input[16];
unsigned char output[256];
unsigned char predict[256];
Buffer<int16_t> *input;
Buffer<uint8_t> *predict;
Buffer<uint8_t> *output;
};
TEST_P(IDCTTest, TestGuardBlocks) {
int i;
for (i = 0; i < 256; i++)
if ((i & 0xF) < 4 && i < 64)
EXPECT_EQ(0, output[i]) << i;
else
EXPECT_EQ(255, output[i]);
}
TEST_P(IDCTTest, TestAllZeros) {
int i;
// When the input is '0' the output will be '0'.
input->Set(0);
predict->Set(0);
output->Set(0);
ASM_REGISTER_STATE_CHECK(UUT(input, output, 16, output, 16));
ASM_REGISTER_STATE_CHECK(UUT(input->TopLeftPixel(), predict->TopLeftPixel(),
predict->stride(), output->TopLeftPixel(),
output->stride()));
for (i = 0; i < 256; i++)
if ((i & 0xF) < 4 && i < 64)
EXPECT_EQ(0, output[i]) << "i==" << i;
else
EXPECT_EQ(255, output[i]) << "i==" << i;
ASSERT_TRUE(input->CheckValues(0));
ASSERT_TRUE(input->CheckPadding());
ASSERT_TRUE(output->CheckValues(0));
ASSERT_TRUE(output->CheckPadding());
}
TEST_P(IDCTTest, TestAllOnes) {
int i;
input->Set(0);
// When the first element is '4' it will fill the output buffer with '1'.
input->TopLeftPixel()[0] = 4;
predict->Set(0);
output->Set(0);
input[0] = 4;
ASM_REGISTER_STATE_CHECK(UUT(input, output, 16, output, 16));
ASM_REGISTER_STATE_CHECK(UUT(input->TopLeftPixel(), predict->TopLeftPixel(),
predict->stride(), output->TopLeftPixel(),
output->stride()));
for (i = 0; i < 256; i++)
if ((i & 0xF) < 4 && i < 64)
EXPECT_EQ(1, output[i]) << "i==" << i;
else
EXPECT_EQ(255, output[i]) << "i==" << i;
ASSERT_TRUE(output->CheckValues(1));
ASSERT_TRUE(output->CheckPadding());
}
TEST_P(IDCTTest, TestAddOne) {
int i;
// Set the transform output to '1' and make sure it gets added to the
// prediction buffer.
input->Set(0);
input->TopLeftPixel()[0] = 4;
output->Set(0);
for (i = 0; i < 256; i++) predict[i] = i;
input[0] = 4;
ASM_REGISTER_STATE_CHECK(UUT(input, predict, 16, output, 16));
uint8_t *pred = predict->TopLeftPixel();
for (int y = 0; y < 4; ++y) {
for (int x = 0; x < 4; ++x) {
pred[y * predict->stride() + x] = y * 4 + x;
}
}
for (i = 0; i < 256; i++)
if ((i & 0xF) < 4 && i < 64)
EXPECT_EQ(i + 1, output[i]) << "i==" << i;
else
EXPECT_EQ(255, output[i]) << "i==" << i;
ASM_REGISTER_STATE_CHECK(UUT(input->TopLeftPixel(), predict->TopLeftPixel(),
predict->stride(), output->TopLeftPixel(),
output->stride()));
uint8_t const *out = output->TopLeftPixel();
for (int y = 0; y < 4; ++y) {
for (int x = 0; x < 4; ++x) {
EXPECT_EQ(1 + y * 4 + x, out[y * output->stride() + x]);
}
}
if (HasFailure()) {
output->DumpBuffer();
}
ASSERT_TRUE(output->CheckPadding());
}
TEST_P(IDCTTest, TestWithData) {
int i;
// Test a single known input.
predict->Set(0);
for (i = 0; i < 16; i++) input[i] = i;
int16_t *in = input->TopLeftPixel();
for (int y = 0; y < 4; ++y) {
for (int x = 0; x < 4; ++x) {
in[y * input->stride() + x] = y * 4 + x;
}
}
ASM_REGISTER_STATE_CHECK(UUT(input, output, 16, output, 16));
ASM_REGISTER_STATE_CHECK(UUT(input->TopLeftPixel(), predict->TopLeftPixel(),
predict->stride(), output->TopLeftPixel(),
output->stride()));
for (i = 0; i < 256; i++)
if ((i & 0xF) > 3 || i > 63)
EXPECT_EQ(255, output[i]) << "i==" << i;
else if (i == 0)
EXPECT_EQ(11, output[i]) << "i==" << i;
else if (i == 34)
EXPECT_EQ(1, output[i]) << "i==" << i;
else if (i == 2 || i == 17 || i == 32)
EXPECT_EQ(3, output[i]) << "i==" << i;
else
EXPECT_EQ(0, output[i]) << "i==" << i;
uint8_t *out = output->TopLeftPixel();
for (int y = 0; y < 4; ++y) {
for (int x = 0; x < 4; ++x) {
switch (y * 4 + x) {
case 0: EXPECT_EQ(11, out[y * output->stride() + x]); break;
case 2:
case 5:
case 8: EXPECT_EQ(3, out[y * output->stride() + x]); break;
case 10: EXPECT_EQ(1, out[y * output->stride() + x]); break;
default: EXPECT_EQ(0, out[y * output->stride() + x]);
}
}
}
if (HasFailure()) {
output->DumpBuffer();
}
ASSERT_TRUE(output->CheckPadding());
}
INSTANTIATE_TEST_CASE_P(C, IDCTTest, ::testing::Values(vp8_short_idct4x4llm_c));
#if HAVE_NEON
INSTANTIATE_TEST_CASE_P(NEON, IDCTTest,
::testing::Values(vp8_short_idct4x4llm_neon));
#endif // HAVE_NEON
#if HAVE_MMX
INSTANTIATE_TEST_CASE_P(MMX, IDCTTest,
::testing::Values(vp8_short_idct4x4llm_mmx));
#endif
}
#endif // HAVE_MMX
#if HAVE_MSA
INSTANTIATE_TEST_CASE_P(MSA, IDCTTest,
::testing::Values(vp8_short_idct4x4llm_msa));
#endif // HAVE_MSA
#if HAVE_MMI
INSTANTIATE_TEST_CASE_P(MMI, IDCTTest,
::testing::Values(vp8_short_idct4x4llm_mmi));
#endif // HAVE_MMI
} // namespace

View File

@ -1,396 +0,0 @@
/*
* Copyright (c) 2012 The WebM project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#include <string.h>
#include "test/acm_random.h"
#include "test/clear_system_state.h"
#include "test/register_state_check.h"
#include "third_party/googletest/src/include/gtest/gtest.h"
#include "./vpx_config.h"
#include "./vp8_rtcd.h"
#include "vp8/common/blockd.h"
#include "vpx_mem/vpx_mem.h"
namespace {
using libvpx_test::ACMRandom;
class IntraPredBase {
public:
virtual ~IntraPredBase() { libvpx_test::ClearSystemState(); }
protected:
void SetupMacroblock(MACROBLOCKD *mbptr,
MODE_INFO *miptr,
uint8_t *data,
int block_size,
int stride,
int num_planes) {
mbptr_ = mbptr;
miptr_ = miptr;
mbptr_->up_available = 1;
mbptr_->left_available = 1;
mbptr_->mode_info_context = miptr_;
stride_ = stride;
block_size_ = block_size;
num_planes_ = num_planes;
for (int p = 0; p < num_planes; p++)
data_ptr_[p] = data + stride * (block_size + 1) * p +
stride + block_size;
}
void FillRandom() {
// Fill edges with random data
ACMRandom rnd(ACMRandom::DeterministicSeed());
for (int p = 0; p < num_planes_; p++) {
for (int x = -1 ; x <= block_size_; x++)
data_ptr_[p][x - stride_] = rnd.Rand8();
for (int y = 0; y < block_size_; y++)
data_ptr_[p][y * stride_ - 1] = rnd.Rand8();
}
}
virtual void Predict(MB_PREDICTION_MODE mode) = 0;
void SetLeftUnavailable() {
mbptr_->left_available = 0;
for (int p = 0; p < num_planes_; p++)
for (int i = -1; i < block_size_; ++i)
data_ptr_[p][stride_ * i - 1] = 129;
}
void SetTopUnavailable() {
mbptr_->up_available = 0;
for (int p = 0; p < num_planes_; p++)
memset(&data_ptr_[p][-1 - stride_], 127, block_size_ + 2);
}
void SetTopLeftUnavailable() {
SetLeftUnavailable();
SetTopUnavailable();
}
int BlockSizeLog2Min1() const {
switch (block_size_) {
case 16:
return 3;
case 8:
return 2;
default:
return 0;
}
}
// check DC prediction output against a reference
void CheckDCPrediction() const {
for (int p = 0; p < num_planes_; p++) {
// calculate expected DC
int expected;
if (mbptr_->up_available || mbptr_->left_available) {
int sum = 0, shift = BlockSizeLog2Min1() + mbptr_->up_available +
mbptr_->left_available;
if (mbptr_->up_available)
for (int x = 0; x < block_size_; x++)
sum += data_ptr_[p][x - stride_];
if (mbptr_->left_available)
for (int y = 0; y < block_size_; y++)
sum += data_ptr_[p][y * stride_ - 1];
expected = (sum + (1 << (shift - 1))) >> shift;
} else {
expected = 0x80;
}
// check that all subsequent lines are equal to the first
for (int y = 1; y < block_size_; ++y)
ASSERT_EQ(0, memcmp(data_ptr_[p], &data_ptr_[p][y * stride_],
block_size_));
// within the first line, ensure that each pixel has the same value
for (int x = 1; x < block_size_; ++x)
ASSERT_EQ(data_ptr_[p][0], data_ptr_[p][x]);
// now ensure that that pixel has the expected (DC) value
ASSERT_EQ(expected, data_ptr_[p][0]);
}
}
// check V prediction output against a reference
void CheckVPrediction() const {
// check that all lines equal the top border
for (int p = 0; p < num_planes_; p++)
for (int y = 0; y < block_size_; y++)
ASSERT_EQ(0, memcmp(&data_ptr_[p][-stride_],
&data_ptr_[p][y * stride_], block_size_));
}
// check H prediction output against a reference
void CheckHPrediction() const {
// for each line, ensure that each pixel is equal to the left border
for (int p = 0; p < num_planes_; p++)
for (int y = 0; y < block_size_; y++)
for (int x = 0; x < block_size_; x++)
ASSERT_EQ(data_ptr_[p][-1 + y * stride_],
data_ptr_[p][x + y * stride_]);
}
static int ClipByte(int value) {
if (value > 255)
return 255;
else if (value < 0)
return 0;
return value;
}
// check TM prediction output against a reference
void CheckTMPrediction() const {
for (int p = 0; p < num_planes_; p++)
for (int y = 0; y < block_size_; y++)
for (int x = 0; x < block_size_; x++) {
const int expected = ClipByte(data_ptr_[p][x - stride_]
+ data_ptr_[p][stride_ * y - 1]
- data_ptr_[p][-1 - stride_]);
ASSERT_EQ(expected, data_ptr_[p][y * stride_ + x]);
}
}
// Actual test
void RunTest() {
{
SCOPED_TRACE("DC_PRED");
FillRandom();
Predict(DC_PRED);
CheckDCPrediction();
}
{
SCOPED_TRACE("DC_PRED LEFT");
FillRandom();
SetLeftUnavailable();
Predict(DC_PRED);
CheckDCPrediction();
}
{
SCOPED_TRACE("DC_PRED TOP");
FillRandom();
SetTopUnavailable();
Predict(DC_PRED);
CheckDCPrediction();
}
{
SCOPED_TRACE("DC_PRED TOP_LEFT");
FillRandom();
SetTopLeftUnavailable();
Predict(DC_PRED);
CheckDCPrediction();
}
{
SCOPED_TRACE("H_PRED");
FillRandom();
Predict(H_PRED);
CheckHPrediction();
}
{
SCOPED_TRACE("V_PRED");
FillRandom();
Predict(V_PRED);
CheckVPrediction();
}
{
SCOPED_TRACE("TM_PRED");
FillRandom();
Predict(TM_PRED);
CheckTMPrediction();
}
}
MACROBLOCKD *mbptr_;
MODE_INFO *miptr_;
uint8_t *data_ptr_[2]; // in the case of Y, only [0] is used
int stride_;
int block_size_;
int num_planes_;
};
typedef void (*IntraPredYFunc)(MACROBLOCKD *x,
uint8_t *yabove_row,
uint8_t *yleft,
int left_stride,
uint8_t *ypred_ptr,
int y_stride);
class IntraPredYTest
: public IntraPredBase,
public ::testing::TestWithParam<IntraPredYFunc> {
public:
static void SetUpTestCase() {
mb_ = reinterpret_cast<MACROBLOCKD*>(
vpx_memalign(32, sizeof(MACROBLOCKD)));
mi_ = reinterpret_cast<MODE_INFO*>(
vpx_memalign(32, sizeof(MODE_INFO)));
data_array_ = reinterpret_cast<uint8_t*>(
vpx_memalign(kDataAlignment, kDataBufferSize));
}
static void TearDownTestCase() {
vpx_free(data_array_);
vpx_free(mi_);
vpx_free(mb_);
data_array_ = NULL;
}
protected:
static const int kBlockSize = 16;
static const int kDataAlignment = 16;
static const int kStride = kBlockSize * 3;
// We use 48 so that the data pointer of the first pixel in each row of
// each macroblock is 16-byte aligned, and this gives us access to the
// top-left and top-right corner pixels belonging to the top-left/right
// macroblocks.
// We use 17 lines so we have one line above us for top-prediction.
static const int kDataBufferSize = kStride * (kBlockSize + 1);
virtual void SetUp() {
pred_fn_ = GetParam();
SetupMacroblock(mb_, mi_, data_array_, kBlockSize, kStride, 1);
}
virtual void Predict(MB_PREDICTION_MODE mode) {
mbptr_->mode_info_context->mbmi.mode = mode;
ASM_REGISTER_STATE_CHECK(pred_fn_(mbptr_,
data_ptr_[0] - kStride,
data_ptr_[0] - 1, kStride,
data_ptr_[0], kStride));
}
IntraPredYFunc pred_fn_;
static uint8_t* data_array_;
static MACROBLOCKD * mb_;
static MODE_INFO *mi_;
};
MACROBLOCKD* IntraPredYTest::mb_ = NULL;
MODE_INFO* IntraPredYTest::mi_ = NULL;
uint8_t* IntraPredYTest::data_array_ = NULL;
TEST_P(IntraPredYTest, IntraPredTests) {
RunTest();
}
INSTANTIATE_TEST_CASE_P(C, IntraPredYTest,
::testing::Values(
vp8_build_intra_predictors_mby_s_c));
#if HAVE_SSE2
INSTANTIATE_TEST_CASE_P(SSE2, IntraPredYTest,
::testing::Values(
vp8_build_intra_predictors_mby_s_sse2));
#endif
#if HAVE_SSSE3
INSTANTIATE_TEST_CASE_P(SSSE3, IntraPredYTest,
::testing::Values(
vp8_build_intra_predictors_mby_s_ssse3));
#endif
#if HAVE_NEON
INSTANTIATE_TEST_CASE_P(NEON, IntraPredYTest,
::testing::Values(
vp8_build_intra_predictors_mby_s_neon));
#endif
typedef void (*IntraPredUvFunc)(MACROBLOCKD *x,
uint8_t *uabove_row,
uint8_t *vabove_row,
uint8_t *uleft,
uint8_t *vleft,
int left_stride,
uint8_t *upred_ptr,
uint8_t *vpred_ptr,
int pred_stride);
class IntraPredUVTest
: public IntraPredBase,
public ::testing::TestWithParam<IntraPredUvFunc> {
public:
static void SetUpTestCase() {
mb_ = reinterpret_cast<MACROBLOCKD*>(
vpx_memalign(32, sizeof(MACROBLOCKD)));
mi_ = reinterpret_cast<MODE_INFO*>(
vpx_memalign(32, sizeof(MODE_INFO)));
data_array_ = reinterpret_cast<uint8_t*>(
vpx_memalign(kDataAlignment, kDataBufferSize));
}
static void TearDownTestCase() {
vpx_free(data_array_);
vpx_free(mi_);
vpx_free(mb_);
data_array_ = NULL;
}
protected:
static const int kBlockSize = 8;
static const int kDataAlignment = 8;
static const int kStride = kBlockSize * 3;
// We use 24 so that the data pointer of the first pixel in each row of
// each macroblock is 8-byte aligned, and this gives us access to the
// top-left and top-right corner pixels belonging to the top-left/right
// macroblocks.
// We use 9 lines so we have one line above us for top-prediction.
// [0] = U, [1] = V
static const int kDataBufferSize = 2 * kStride * (kBlockSize + 1);
virtual void SetUp() {
pred_fn_ = GetParam();
SetupMacroblock(mb_, mi_, data_array_, kBlockSize, kStride, 2);
}
virtual void Predict(MB_PREDICTION_MODE mode) {
mbptr_->mode_info_context->mbmi.uv_mode = mode;
pred_fn_(mbptr_, data_ptr_[0] - kStride, data_ptr_[1] - kStride,
data_ptr_[0] - 1, data_ptr_[1] - 1, kStride,
data_ptr_[0], data_ptr_[1], kStride);
}
IntraPredUvFunc pred_fn_;
// We use 24 so that the data pointer of the first pixel in each row of
// each macroblock is 8-byte aligned, and this gives us access to the
// top-left and top-right corner pixels belonging to the top-left/right
// macroblocks.
// We use 9 lines so we have one line above us for top-prediction.
// [0] = U, [1] = V
static uint8_t* data_array_;
static MACROBLOCKD* mb_;
static MODE_INFO* mi_;
};
MACROBLOCKD* IntraPredUVTest::mb_ = NULL;
MODE_INFO* IntraPredUVTest::mi_ = NULL;
uint8_t* IntraPredUVTest::data_array_ = NULL;
TEST_P(IntraPredUVTest, IntraPredTests) {
RunTest();
}
INSTANTIATE_TEST_CASE_P(C, IntraPredUVTest,
::testing::Values(
vp8_build_intra_predictors_mbuv_s_c));
#if HAVE_SSE2
INSTANTIATE_TEST_CASE_P(SSE2, IntraPredUVTest,
::testing::Values(
vp8_build_intra_predictors_mbuv_s_sse2));
#endif
#if HAVE_SSSE3
INSTANTIATE_TEST_CASE_P(SSSE3, IntraPredUVTest,
::testing::Values(
vp8_build_intra_predictors_mbuv_s_ssse3));
#endif
#if HAVE_NEON
INSTANTIATE_TEST_CASE_P(NEON, IntraPredUVTest,
::testing::Values(
vp8_build_intra_predictors_mbuv_s_neon));
#endif
} // namespace

View File

@ -34,21 +34,19 @@ std::ostream &operator<<(std::ostream &os, const DecodeParam &dp) {
return os << "threads: " << dp.threads << " file: " << dp.filename;
}
class InvalidFileTest
: public ::libvpx_test::DecoderTest,
public ::libvpx_test::CodecTestWithParam<DecodeParam> {
class InvalidFileTest : public ::libvpx_test::DecoderTest,
public ::libvpx_test::CodecTestWithParam<DecodeParam> {
protected:
InvalidFileTest() : DecoderTest(GET_PARAM(0)), res_file_(NULL) {}
virtual ~InvalidFileTest() {
if (res_file_ != NULL)
fclose(res_file_);
if (res_file_ != NULL) fclose(res_file_);
}
void OpenResFile(const std::string &res_file_name_) {
res_file_ = libvpx_test::OpenTestDataFile(res_file_name_);
ASSERT_TRUE(res_file_ != NULL) << "Result file open failed. Filename: "
<< res_file_name_;
ASSERT_TRUE(res_file_ != NULL)
<< "Result file open failed. Filename: " << res_file_name_;
}
virtual bool HandleDecodeResult(
@ -63,32 +61,47 @@ class InvalidFileTest
EXPECT_NE(res, EOF) << "Read result data failed";
// Check results match.
EXPECT_EQ(expected_res_dec, res_dec)
<< "Results don't match: frame number = " << video.frame_number()
<< ". (" << decoder->DecodeError() << ")";
const DecodeParam input = GET_PARAM(1);
if (input.threads > 1) {
// The serial decode check is too strict for tile-threaded decoding as
// there is no guarantee on the decode order nor which specific error
// will take precedence. Currently a tile-level error is not forwarded so
// the frame will simply be marked corrupt.
EXPECT_TRUE(res_dec == expected_res_dec ||
res_dec == VPX_CODEC_CORRUPT_FRAME)
<< "Results don't match: frame number = " << video.frame_number()
<< ". (" << decoder->DecodeError()
<< "). Expected: " << expected_res_dec << " or "
<< VPX_CODEC_CORRUPT_FRAME;
} else {
EXPECT_EQ(expected_res_dec, res_dec)
<< "Results don't match: frame number = " << video.frame_number()
<< ". (" << decoder->DecodeError() << ")";
}
return !HasFailure();
}
void RunTest() {
const DecodeParam input = GET_PARAM(1);
libvpx_test::CompressedVideoSource *video = NULL;
vpx_codec_dec_cfg_t cfg = vpx_codec_dec_cfg_t();
cfg.threads = input.threads;
const std::string filename = input.filename;
// Open compressed video file.
testing::internal::scoped_ptr<libvpx_test::CompressedVideoSource> video;
if (filename.substr(filename.length() - 3, 3) == "ivf") {
video = new libvpx_test::IVFVideoSource(filename);
video.reset(new libvpx_test::IVFVideoSource(filename));
} else if (filename.substr(filename.length() - 4, 4) == "webm") {
#if CONFIG_WEBM_IO
video = new libvpx_test::WebMVideoSource(filename);
video.reset(new libvpx_test::WebMVideoSource(filename));
#else
fprintf(stderr, "WebM IO is disabled, skipping test vector %s\n",
filename.c_str());
return;
#endif
}
ASSERT_TRUE(video.get() != NULL);
video->Init();
// Construct result file name. The file holds a list of expected integer
@ -98,35 +111,58 @@ class InvalidFileTest
OpenResFile(res_filename);
// Decode frame, and check the md5 matching.
ASSERT_NO_FATAL_FAILURE(RunLoop(video, cfg));
delete video;
ASSERT_NO_FATAL_FAILURE(RunLoop(video.get(), cfg));
}
private:
FILE *res_file_;
};
TEST_P(InvalidFileTest, ReturnCode) {
RunTest();
}
TEST_P(InvalidFileTest, ReturnCode) { RunTest(); }
#if CONFIG_VP8_DECODER
const DecodeParam kVP8InvalidFileTests[] = {
{ 1, "invalid-bug-1443.ivf" },
{ 1, "invalid-token-partition.ivf" },
};
VP8_INSTANTIATE_TEST_CASE(InvalidFileTest,
::testing::ValuesIn(kVP8InvalidFileTests));
#endif // CONFIG_VP8_DECODER
#if CONFIG_VP9_DECODER
const DecodeParam kVP9InvalidFileTests[] = {
{1, "invalid-vp90-02-v2.webm"},
{1, "invalid-vp90-2-00-quantizer-00.webm.ivf.s5861_r01-05_b6-.v2.ivf"},
{1, "invalid-vp90-03-v3.webm"},
{1, "invalid-vp90-2-00-quantizer-11.webm.ivf.s52984_r01-05_b6-.ivf"},
{1, "invalid-vp90-2-00-quantizer-11.webm.ivf.s52984_r01-05_b6-z.ivf"},
{1, "invalid-vp90-2-12-droppable_1.ivf.s3676_r01-05_b6-.ivf"},
{1, "invalid-vp90-2-05-resize.ivf.s59293_r01-05_b6-.ivf"},
{1, "invalid-vp90-2-09-subpixel-00.ivf.s20492_r01-05_b6-.v2.ivf"},
{1, "invalid-vp91-2-mixedrefcsp-444to420.ivf"},
{1, "invalid-vp90-2-12-droppable_1.ivf.s73804_r01-05_b6-.ivf"},
{1, "invalid-vp90-2-03-size-224x196.webm.ivf.s44156_r01-05_b6-.ivf"},
{1, "invalid-vp90-2-03-size-202x210.webm.ivf.s113306_r01-05_b6-.ivf"},
{ 1, "invalid-vp90-02-v2.webm" },
#if CONFIG_VP9_HIGHBITDEPTH
{ 1, "invalid-vp90-2-00-quantizer-00.webm.ivf.s5861_r01-05_b6-.v2.ivf" },
{ 1,
"invalid-vp90-2-21-resize_inter_320x180_5_3-4.webm.ivf.s45551_r01-05_b6-."
"ivf" },
#endif
{ 1, "invalid-vp90-03-v3.webm" },
{ 1, "invalid-vp90-2-00-quantizer-11.webm.ivf.s52984_r01-05_b6-.ivf" },
{ 1, "invalid-vp90-2-00-quantizer-11.webm.ivf.s52984_r01-05_b6-z.ivf" },
// This file will cause a large allocation which is expected to fail in 32-bit
// environments. Test x86 for coverage purposes as the allocation failure will
// be in platform agnostic code.
#if ARCH_X86
{ 1, "invalid-vp90-2-00-quantizer-63.ivf.kf_65527x61446.ivf" },
#endif
{ 1, "invalid-vp90-2-12-droppable_1.ivf.s3676_r01-05_b6-.ivf" },
{ 1, "invalid-vp90-2-05-resize.ivf.s59293_r01-05_b6-.ivf" },
{ 1, "invalid-vp90-2-09-subpixel-00.ivf.s20492_r01-05_b6-.v2.ivf" },
{ 1, "invalid-vp91-2-mixedrefcsp-444to420.ivf" },
{ 1, "invalid-vp90-2-12-droppable_1.ivf.s73804_r01-05_b6-.ivf" },
{ 1, "invalid-vp90-2-03-size-224x196.webm.ivf.s44156_r01-05_b6-.ivf" },
{ 1, "invalid-vp90-2-03-size-202x210.webm.ivf.s113306_r01-05_b6-.ivf" },
{ 1,
"invalid-vp90-2-10-show-existing-frame.webm.ivf.s180315_r01-05_b6-.ivf" },
{ 1, "invalid-crbug-667044.webm" },
};
VP9_INSTANTIATE_TEST_CASE(InvalidFileTest,
::testing::ValuesIn(kVP9InvalidFileTests));
#endif // CONFIG_VP9_DECODER
// This class will include test vectors that are expected to fail
// peek. However they are still expected to have no fatal failures.
@ -134,34 +170,46 @@ class InvalidFileInvalidPeekTest : public InvalidFileTest {
protected:
InvalidFileInvalidPeekTest() : InvalidFileTest() {}
virtual void HandlePeekResult(libvpx_test::Decoder *const /*decoder*/,
libvpx_test::CompressedVideoSource* /*video*/,
libvpx_test::CompressedVideoSource * /*video*/,
const vpx_codec_err_t /*res_peek*/) {}
};
TEST_P(InvalidFileInvalidPeekTest, ReturnCode) {
RunTest();
}
TEST_P(InvalidFileInvalidPeekTest, ReturnCode) { RunTest(); }
#if CONFIG_VP8_DECODER
const DecodeParam kVP8InvalidPeekTests[] = {
{ 1, "invalid-vp80-00-comprehensive-018.ivf.2kf_0x6.ivf" },
};
VP8_INSTANTIATE_TEST_CASE(InvalidFileInvalidPeekTest,
::testing::ValuesIn(kVP8InvalidPeekTests));
#endif // CONFIG_VP8_DECODER
#if CONFIG_VP9_DECODER
const DecodeParam kVP9InvalidFileInvalidPeekTests[] = {
{1, "invalid-vp90-01-v2.webm"},
{ 1, "invalid-vp90-01-v3.webm" },
};
VP9_INSTANTIATE_TEST_CASE(InvalidFileInvalidPeekTest,
::testing::ValuesIn(kVP9InvalidFileInvalidPeekTests));
const DecodeParam kMultiThreadedVP9InvalidFileTests[] = {
{4, "invalid-vp90-2-08-tile_1x4_frame_parallel_all_key.webm"},
{4, "invalid-"
"vp90-2-08-tile_1x2_frame_parallel.webm.ivf.s47039_r01-05_b6-.ivf"},
{4, "invalid-vp90-2-08-tile_1x8_frame_parallel.webm.ivf.s288_r01-05_b6-.ivf"},
{2, "invalid-vp90-2-09-aq2.webm.ivf.s3984_r01-05_b6-.v2.ivf"},
{4, "invalid-vp90-2-09-subpixel-00.ivf.s19552_r01-05_b6-.v2.ivf"},
{ 4, "invalid-vp90-2-08-tile_1x4_frame_parallel_all_key.webm" },
{ 4,
"invalid-"
"vp90-2-08-tile_1x2_frame_parallel.webm.ivf.s47039_r01-05_b6-.ivf" },
{ 4,
"invalid-vp90-2-08-tile_1x8_frame_parallel.webm.ivf.s288_r01-05_b6-.ivf" },
{ 2, "invalid-vp90-2-09-aq2.webm.ivf.s3984_r01-05_b6-.v2.ivf" },
{ 4, "invalid-vp90-2-09-subpixel-00.ivf.s19552_r01-05_b6-.v2.ivf" },
{ 2, "invalid-crbug-629481.webm" },
};
INSTANTIATE_TEST_CASE_P(
VP9MultiThreaded, InvalidFileTest,
::testing::Combine(
::testing::Values(
static_cast<const libvpx_test::CodecFactory*>(&libvpx_test::kVP9)),
static_cast<const libvpx_test::CodecFactory *>(&libvpx_test::kVP9)),
::testing::ValuesIn(kMultiThreadedVP9InvalidFileTests)));
#endif // CONFIG_VP9_DECODER
} // namespace

View File

@ -29,19 +29,13 @@ static unsigned int MemGetLe32(const uint8_t *mem) {
class IVFVideoSource : public CompressedVideoSource {
public:
explicit IVFVideoSource(const std::string &file_name)
: file_name_(file_name),
input_file_(NULL),
compressed_frame_buf_(NULL),
frame_sz_(0),
frame_(0),
end_of_file_(false) {
}
: file_name_(file_name), input_file_(NULL), compressed_frame_buf_(NULL),
frame_sz_(0), frame_(0), end_of_file_(false) {}
virtual ~IVFVideoSource() {
delete[] compressed_frame_buf_;
if (input_file_)
fclose(input_file_);
if (input_file_) fclose(input_file_);
}
virtual void Init() {
@ -53,16 +47,17 @@ class IVFVideoSource : public CompressedVideoSource {
virtual void Begin() {
input_file_ = OpenTestDataFile(file_name_);
ASSERT_TRUE(input_file_ != NULL) << "Input file open failed. Filename: "
<< file_name_;
ASSERT_TRUE(input_file_ != NULL)
<< "Input file open failed. Filename: " << file_name_;
// Read file header
uint8_t file_hdr[kIvfFileHdrSize];
ASSERT_EQ(kIvfFileHdrSize, fread(file_hdr, 1, kIvfFileHdrSize, input_file_))
<< "File header read failed.";
// Check file header
ASSERT_TRUE(file_hdr[0] == 'D' && file_hdr[1] == 'K' && file_hdr[2] == 'I'
&& file_hdr[3] == 'F') << "Input is not an IVF file.";
ASSERT_TRUE(file_hdr[0] == 'D' && file_hdr[1] == 'K' &&
file_hdr[2] == 'I' && file_hdr[3] == 'F')
<< "Input is not an IVF file.";
FillFrame();
}
@ -76,8 +71,8 @@ class IVFVideoSource : public CompressedVideoSource {
ASSERT_TRUE(input_file_ != NULL);
uint8_t frame_hdr[kIvfFrameHdrSize];
// Check frame header and read a frame from input_file.
if (fread(frame_hdr, 1, kIvfFrameHdrSize, input_file_)
!= kIvfFrameHdrSize) {
if (fread(frame_hdr, 1, kIvfFrameHdrSize, input_file_) !=
kIvfFrameHdrSize) {
end_of_file_ = true;
} else {
end_of_file_ = false;

View File

@ -17,8 +17,9 @@
namespace {
class KeyframeTest : public ::libvpx_test::EncoderTest,
public ::libvpx_test::CodecTestWithParam<libvpx_test::TestMode> {
class KeyframeTest
: public ::libvpx_test::EncoderTest,
public ::libvpx_test::CodecTestWithParam<libvpx_test::TestMode> {
protected:
KeyframeTest() : EncoderTest(GET_PARAM(0)) {}
virtual ~KeyframeTest() {}
@ -34,10 +35,12 @@ class KeyframeTest : public ::libvpx_test::EncoderTest,
virtual void PreEncodeFrameHook(::libvpx_test::VideoSource *video,
::libvpx_test::Encoder *encoder) {
if (kf_do_force_kf_)
if (kf_do_force_kf_) {
frame_flags_ = (video->frame() % 3) ? 0 : VPX_EFLAG_FORCE_KF;
if (set_cpu_used_ && video->frame() == 1)
}
if (set_cpu_used_ && video->frame() == 1) {
encoder->Control(VP8E_SET_CPUUSED, set_cpu_used_);
}
}
virtual void FramePktHook(const vpx_codec_cx_pkt_t *pkt) {
@ -65,8 +68,9 @@ TEST_P(KeyframeTest, TestRandomVideoSource) {
// In realtime mode - auto placed keyframes are exceedingly rare, don't
// bother with this check if(GetParam() > 0)
if (GET_PARAM(1) > 0)
if (GET_PARAM(1) > 0) {
EXPECT_GT(kf_count_, 1);
}
}
TEST_P(KeyframeTest, TestDisableKeyframes) {
@ -114,8 +118,7 @@ TEST_P(KeyframeTest, TestAutoKeyframe) {
// may not produce a keyframe like we expect. This is necessary when running
// on very slow environments (like Valgrind). The step -11 was determined
// experimentally as the fastest mode that still throws the keyframe.
if (deadline_ == VPX_DL_REALTIME)
set_cpu_used_ = -11;
if (deadline_ == VPX_DL_REALTIME) set_cpu_used_ = -11;
// This clip has a cut scene every 30 frames -> Frame 0, 30, 60, 90, 120.
// I check only the first 40 frames to make sure there's a keyframe at frame
@ -127,15 +130,16 @@ TEST_P(KeyframeTest, TestAutoKeyframe) {
// In realtime mode - auto placed keyframes are exceedingly rare, don't
// bother with this check
if (GET_PARAM(1) > 0)
if (GET_PARAM(1) > 0) {
EXPECT_EQ(2u, kf_pts_list_.size()) << " Not the right number of keyframes ";
}
// Verify that keyframes match the file keyframes in the file.
for (std::vector<vpx_codec_pts_t>::const_iterator iter = kf_pts_list_.begin();
iter != kf_pts_list_.end(); ++iter) {
if (deadline_ == VPX_DL_REALTIME && *iter > 0)
EXPECT_EQ(0, (*iter - 1) % 30) << "Unexpected keyframe at frame "
<< *iter;
EXPECT_EQ(0, (*iter - 1) % 30)
<< "Unexpected keyframe at frame " << *iter;
else
EXPECT_EQ(0, *iter % 30) << "Unexpected keyframe at frame " << *iter;
}

Some files were not shown because too many files have changed in this diff Show More