601 Commits

Author SHA1 Message Date
brandtr
8180fa66de Fix VideoProcessorIntegrationTest on iOS.
BUG=webrtc:6634

Review-Url: https://codereview.webrtc.org/3013463002
Cr-Commit-Position: refs/heads/master@{#19730}
2017-09-07 15:57:46 +00:00
danilchap
56359be7fe Update thread annotiation macros in modules to use RTC_ prefix
BUG=webrtc:8198

Review-Url: https://codereview.webrtc.org/3010223002
Cr-Commit-Position: refs/heads/master@{#19728}
2017-09-07 14:53:45 +00:00
brandtr
df23299259 Add VideoProcessorIntegrationTest for MediaCodec implementations.
* Add VideoProcessorIntegrationTestMediaCodec tests, including
  a standard foreman test and a forced SW fallback test.
* Morph PlotVideoProcessorIntegrationTest into
  VideoProcessorIntegrationTestParameterized. This test is intended
  to be patched locally, depending on what metric is of interest.
  It is run on the bots to ensure that it doesn't break.
* Remove the plot_videoprocessor_integrationtest binary. The test
  above is instead moved to the modules_tests binary.

BUG=webrtc:6634

Review-Url: https://codereview.webrtc.org/3011043002
Cr-Commit-Position: refs/heads/master@{#19727}
2017-09-07 14:50:06 +00:00
sprang
ff19d35bae Fix FrameConfigs used for VP8 with four temporal layers.
sync flag should only be true if:

* temporal layer > 0
* frame predics _only_ from tl0 (last)

Furthermore, flags should not predict from a buffer unless it has been
previously updated in the current iteration for the pattern.

I also added an experiment with an alternative pattern for a three
layer setup, where loose some efficieny by halving the pattern but
gain a little bit by updating arf for the top layer. The theory is that
this will cause fewer frame drops since we don't have as much
dependency on previous frames in the upper layer (which might not be
retransmitted).

BUG=webrtc:8162

Review-Url: https://codereview.webrtc.org/3003823003
Cr-Commit-Position: refs/heads/master@{#19716}
2017-09-06 14:14:02 +00:00
asapersson
a505fb021f vp8_impl.cc: Rename postproc field trial string for arm.
BUG=webrtc:6634

Review-Url: https://codereview.webrtc.org/3006143002
Cr-Commit-Position: refs/heads/master@{#19713}
2017-09-06 12:34:11 +00:00
brandtr
d635e5b8ed Add ability to instantiate VideoEncoderSoftwareFallback in VP tests.
* Split TestConfig::hw_codec into hw_encoder and hw_decoder.
* Add TestConfig::sw_fallback_encoder.

BUG=webrtc:6634

Review-Url: https://codereview.webrtc.org/3009963002
Cr-Commit-Position: refs/heads/master@{#19710}
2017-09-06 11:48:22 +00:00
brandtr
8935d97f16 Clean up Stats class used in VideoProcessor tests.
* Reorder and rename members of FrameStatistic.
* Rename corresponding temp variables used in the summary calculations.
* Make Stats class less structy.
* Try to enforce consistent frame numbers at all times.
* Remove VideoProcessor::FrameInfo struct and use the Stats class
  for keeping track of encode/decode start times, etc.

BUG=webrtc:6634

Review-Url: https://codereview.webrtc.org/3011923002
Cr-Commit-Position: refs/heads/master@{#19703}
2017-09-06 08:53:22 +00:00
kwiberg
84f6a3fc6b Move optional.h to webrtc/api/
We use Optional in our public API, so its header should be in
webrtc/api/.

BUG=webrtc:8205

Review-Url: https://codereview.webrtc.org/3011943002
Cr-Commit-Position: refs/heads/master@{#19693}
2017-09-05 15:43:13 +00:00
brandtr
83e887cdcb Delete video_quality_measurement.
We don't use it and we don't plan on using it.

BUG=none

Review-Url: https://codereview.webrtc.org/3005993002
Cr-Commit-Position: refs/heads/master@{#19655}
2017-09-04 11:52:31 +00:00
brandtr
ffbe1cd07e Remove VideoProcessorIntegrationTest::SetTestConfig.
BUG=webrtc:6634

Review-Url: https://codereview.webrtc.org/3004983002
Cr-Commit-Position: refs/heads/master@{#19648}
2017-09-04 10:03:40 +00:00
brandtr
12a47f6965 Split up VideoProcessorIntegrationTest files.
Changes made:
* VideoProcessorIntegrationTest definition goes in .h file.
* Member function definitions go into .cc file.
* Tests move to _libvpx.cc and _openh264.cc files.

BUG=webrtc:6634

Review-Url: https://codereview.webrtc.org/3008913002
Cr-Commit-Position: refs/heads/master@{#19637}
2017-09-01 07:10:27 +00:00
oprypin
6e09d875fb Replace remaining gflags usages with rtc_base/flags
Continued from https://codereview.webrtc.org/2995363002

BUG=webrtc:7644

Review-Url: https://codereview.webrtc.org/3005483002
Cr-Commit-Position: refs/heads/master@{#19624}
2017-08-31 10:21:39 +00:00
asapersson
f2972ba166 Add some unit tests to TestVp8Impl.
BUG=webrtc:6634

Review-Url: https://codereview.webrtc.org/3005533003
Cr-Commit-Position: refs/heads/master@{#19623}
2017-08-31 10:01:26 +00:00
brandtr
b57f42676e VideoProcessorIntegrationTest: make it runnable on a task queue.
* First do all frame processing, then do all rate control
  statistics calculations. This means that we only need to
  synchronize once.
* Run the VideoProcessor on a task queue, thus supporting Android
  HW codecs.
* Add some unit tests for the VideoProcessor.

BUG=webrtc:6634

Review-Url: https://codereview.webrtc.org/2997283002
Cr-Commit-Position: refs/heads/master@{#19604}
2017-08-30 13:29:51 +00:00
asapersson
a16c70b8ba Verify parsed QP value when frame is encoded instead of storing parsed value and verifying later.
Removes:
- VideoProcessor: GetQpFromEncoder, GetQpFromBitstream
- FrameInfo: qp_encoder, qp_bitstream

BUG=webrtc:6634

Review-Url: https://codereview.webrtc.org/3007753002
Cr-Commit-Position: refs/heads/master@{#19579}
2017-08-29 12:39:36 +00:00
magjed
a3d4f68fb4 Android: Replace webrtc_jni namespace with nested jni namespace
This CL replaces:
namespace webrtc_jni {
with:
namespace webrtc {
namespace jni {

The main benefit is that we don't have to use the webrtc:: qualifier
inside the jni namespace so we can reduce some clutter.

BUG=None

Review-Url: https://codereview.webrtc.org/3009613002
Cr-Commit-Position: refs/heads/master@{#19569}
2017-08-28 23:24:06 +00:00
brandtr
9dbd084761 Delete batch mode from VideoProcessorIntegrationTest.
After landing https://codereview.webrtc.org/2997283002/,
batch mode will no longer be needed.

BUG=webrtc:6634

Review-Url: https://codereview.webrtc.org/3005593002
Cr-Commit-Position: refs/heads/master@{#19520}
2017-08-25 14:11:19 +00:00
brandtr
ee95f87488 Change frame bookkeeping in VideoProcessorIntegrationTest.
Now we always process |rate_profile.num_frames| number of frames.
This means that the output of the tests in
videoprocessor_integrationtest.cc will be slightly different,
as we will no process 300 frames, instead of 299. No rate control
or quality thresholds need to be updated, however.

BUG=webrtc:6634

Review-Url: https://codereview.webrtc.org/3004583002
Cr-Commit-Position: refs/heads/master@{#19515}
2017-08-25 11:51:54 +00:00
brandtr
87f5c5a4d3 Make rate control and quality thresholds optional in VideoProcessorIntegrationTest.
This CL is split out from https://codereview.webrtc.org/2997283002/.

BUG=webrtc:6634

Review-Url: https://codereview.webrtc.org/3008543002
Cr-Commit-Position: refs/heads/master@{#19513}
2017-08-25 11:33:49 +00:00
kthelgason
1cdddc96fa Make CodecType conversion functions non-optional.
We can't handle no value here anyway and end up setting a default
at each call site. The defaults aren't even the same in each place.

BUG=None

Review-Url: https://codereview.webrtc.org/2998293002
Cr-Commit-Position: refs/heads/master@{#19485}
2017-08-24 10:52:48 +00:00
asapersson
aaaf2db253 Minor changes to TestVp8Impl.
BUG=webrtc:6634

Review-Url: https://codereview.webrtc.org/3001663002
Cr-Commit-Position: refs/heads/master@{#19447}
2017-08-22 12:42:06 +00:00
brandtr
4553562fe3 Remove unnecessary RTPFragmentationHeader from VideoProcessor callbacks.
This test is and should be independent of RTP, so we don't need the
information provided in this struct.

BUG=webrtc:6634

Review-Url: https://codereview.webrtc.org/2995403002
Cr-Commit-Position: refs/heads/master@{#19443}
2017-08-22 10:33:11 +00:00
brandtr
c8c59059b7 VideoProcessor: make it runnable on a task queue.
* Guard members with a SequencedTaskChecker.
* Intercept encoder/decoder callbacks, and post onto task queue if needed.

BUG=webrtc:6634

Review-Url: https://codereview.webrtc.org/2996253002
Cr-Commit-Position: refs/heads/master@{#19428}
2017-08-21 13:44:16 +00:00
asapersson
0069b45179 TestVp8Impl: Remove unused arguments and member variable.
Make WaitForEncodedFrame void.
Verify QP for each encoded frame.
Add SetupCodecSettings.

BUG=webrtc:6634

Review-Url: https://codereview.webrtc.org/2995213002
Cr-Commit-Position: refs/heads/master@{#19426}
2017-08-21 12:50:46 +00:00
hbos
228fb0e1ec H264: Don't disable compiler warning by using NO_THREAD_SAFETY_ANALYSIS.
The LockManagerOperation global function uses void** which does not work
well with the thread_annotations.h macros and produce compiler warnings
on clang (chromium default). Workarounds to this is hacky and unhelpful
so we disable the analysis for this function, which isn't helpful in
this case anyway.

webrtc_h264_config is no longer needed and is removed.

BUG=8090, 8119

Review-Url: https://codereview.webrtc.org/3000263002
Cr-Commit-Position: refs/heads/master@{#19425}
2017-08-21 12:17:17 +00:00
brandtr
ed0e436688 VideoProcessorIntegrationTest: mini-fixes in preparation for task queue CL.
* Rename some members.
* Shorten visualization file names.
* Make some member functions static, in preparation for moving them
  to be helper functions in an anonymous namespace.

BUG=webrtc:6634

Review-Url: https://codereview.webrtc.org/3001193002
Cr-Commit-Position: refs/heads/master@{#19424}
2017-08-21 11:15:24 +00:00
brandtr
bdd555c7a7 VideoProcessor: mini-fixes in preparation for task queue CL.
* Make ProcessFrame return void.
* Make |encode_callback_| and |decode_callback_| direct members.
* Remove ::EncodedFrameSize() and ::EncodedFrameType()
* Remove unused |timestamp| member from FrameInfo.
* Reorder printf output from PrintCodecSettings.
* Make some member functions const.

BUG=webrtc:6634

Review-Url: https://codereview.webrtc.org/2998063002
Cr-Commit-Position: refs/heads/master@{#19421}
2017-08-21 08:34:04 +00:00
sprang
ba050a6d6d Reland of Add a flags field to video timing extension. (patchset #1 id:1 of https://codereview.webrtc.org/2995953002/ )
Reason for revert:
Create reland CL to add fix to.

Original issue's description:
> Revert of Add a flags field to video timing extension. (patchset #15 id:280001 of https://codereview.webrtc.org/3000753002/ )
>
> Reason for revert:
> Speculative revet for breaking remoting_unittests in fyi bots.
> https://build.chromium.org/p/chromium.webrtc.fyi/waterfall?builder=Win7%20Tester
>
> Original issue's description:
> > Add a flags field to video timing extension.
> >
> > The rtp header extension for video timing shuold have an additional
> > field for signaling metadata, such as what triggered the extension for
> > this particular frame. This will allow separating frames select because
> > of outlier sizes from regular frames, for more accurate stats.
> >
> > This implementation is backwards compatible in that it can read video
> > timing extensions without the new flag field, but it always sends with
> > it included.
> >
> > BUG=webrtc:7594
> >
> > Review-Url: https://codereview.webrtc.org/3000753002
> > Cr-Commit-Position: refs/heads/master@{#19353}
> > Committed: cf5d485e14
>
> TBR=danilchap@webrtc.org,kthelgason@webrtc.org,stefan@webrtc.org,sprang@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:7594
>
> Review-Url: https://codereview.webrtc.org/2995953002
> Cr-Commit-Position: refs/heads/master@{#19360}
> Committed: f0f7378b05

TBR=danilchap@webrtc.org,kthelgason@webrtc.org,stefan@webrtc.org,emircan@google.com
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=webrtc:7594

Review-Url: https://codereview.webrtc.org/2996153002
Cr-Commit-Position: refs/heads/master@{#19405}
2017-08-18 09:51:12 +00:00
asapersson
142fcc96d6 Move kMinPixelsPerFrame constant in VideoStreamEncoder to VideoEncoder::ScalingSettings.
Make it possible for forced VP8 SW fallback encoder to set min_pixels_per_frame via GetScalingSettings().

Add a min required resolution (in addition to bitrate) before releasing forced SW fallback.

BUG=webrtc:6634

Review-Url: https://codereview.webrtc.org/3000693003
Cr-Commit-Position: refs/heads/master@{#19390}
2017-08-17 15:58:54 +00:00
sprang
3958ed8e6f RTC_CHECK instead of assert in vp9_impl.cc
BUG=None

Review-Url: https://codereview.webrtc.org/2994403002
Cr-Commit-Position: refs/heads/master@{#19387}
2017-08-17 15:12:10 +00:00
asapersson
22c76c4e65 Add support for a forced software encoder fallback.
Make it possible to switch from VP8 HW -> VP8 SW -> VP8 HW depending on bitrate and resolution.

BUG=webrtc:6634

Review-Url: https://codereview.webrtc.org/2988963002
Cr-Commit-Position: refs/heads/master@{#19362}
2017-08-16 07:53:59 +00:00
emircan
f0f7378b05 Revert of Add a flags field to video timing extension. (patchset #15 id:280001 of https://codereview.webrtc.org/3000753002/ )
Reason for revert:
Speculative revet for breaking remoting_unittests in fyi bots.
https://build.chromium.org/p/chromium.webrtc.fyi/waterfall?builder=Win7%20Tester

Original issue's description:
> Add a flags field to video timing extension.
>
> The rtp header extension for video timing shuold have an additional
> field for signaling metadata, such as what triggered the extension for
> this particular frame. This will allow separating frames select because
> of outlier sizes from regular frames, for more accurate stats.
>
> This implementation is backwards compatible in that it can read video
> timing extensions without the new flag field, but it always sends with
> it included.
>
> BUG=webrtc:7594
>
> Review-Url: https://codereview.webrtc.org/3000753002
> Cr-Commit-Position: refs/heads/master@{#19353}
> Committed: cf5d485e14

TBR=danilchap@webrtc.org,kthelgason@webrtc.org,stefan@webrtc.org,sprang@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:7594

Review-Url: https://codereview.webrtc.org/2995953002
Cr-Commit-Position: refs/heads/master@{#19360}
2017-08-15 19:31:23 +00:00
sprang
cf5d485e14 Add a flags field to video timing extension.
The rtp header extension for video timing shuold have an additional
field for signaling metadata, such as what triggered the extension for
this particular frame. This will allow separating frames select because
of outlier sizes from regular frames, for more accurate stats.

This implementation is backwards compatible in that it can read video
timing extensions without the new flag field, but it always sends with
it included.

BUG=webrtc:7594

Review-Url: https://codereview.webrtc.org/3000753002
Cr-Commit-Position: refs/heads/master@{#19353}
2017-08-15 12:33:27 +00:00
brandtr
deac84107f Rename SetProcessParams -> SetTestConfig.
Also remove |key_frame_interval| from argument list, since it is always
set to -1.

BUG=webrtc:6634

Review-Url: https://codereview.webrtc.org/2999643002
Cr-Commit-Position: refs/heads/master@{#19331}
2017-08-14 08:29:18 +00:00
brandtr
ef8eb8c10d Reorganize code in plot_videoprocessor_integrationtest.cc.
* Don't loop over fps, but do loop over codec implementation type.
* Order codec settings as they are defined in the test.

BUG=webrtc:6634

Review-Url: https://codereview.webrtc.org/3000613002
Cr-Commit-Position: refs/heads/master@{#19330}
2017-08-14 08:06:16 +00:00
brandtr
77920a415b Minor improvements to VideoProcessorIntegrationTest.
* Create all encoders/decoders using factories.
* Add ::Release() method, to mirror the existing ::Init().
* Remove unnecessary ::test prefixes.
* Reorganize constants and members.
* Remove extraneous packet loss rate assignments.
* Remove members |start_frame_rate_| and |num_temporal_layers_|.
* Explicitly give ::SetUpObjects(.) access to initial rates.
* Change visualization output file names.

BUG=webrtc:6634

Review-Url: https://codereview.webrtc.org/2999613002
Cr-Commit-Position: refs/heads/master@{#19326}
2017-08-11 14:48:15 +00:00
mflodman
351424e942 Removing VCMCodecDataBase::Codec and VideoCodingModule::Codec.
This CL brings us one step closer to removing CodecDatabase and
GenericEncoder, by removing the static VCM::Codec(). Codec specific
methods are moved to video_encoder.cc (they already belonged to this
class) and getting default generic codec settings has been moved to a
test specific file.

This CL also makes video_encoder.h pass style guide and lint checks,
since these checks are triggered with the new video_encoder.cc file.

BUG=webrtc:8064

Review-Url: https://codereview.webrtc.org/2993923002
Cr-Commit-Position: refs/heads/master@{#19303}
2017-08-10 09:43:14 +00:00
asapersson
e5d02f9204 vp8_impl.cc: Make it possible to base postproc deblocking level for arm on qp (e.g. turn off deblocking for low qp values).
BUG=webrtc:6634

Review-Url: https://codereview.webrtc.org/2970923002
Cr-Commit-Position: refs/heads/master@{#19300}
2017-08-10 06:37:05 +00:00
brandtr
07734a5995 Move ownership of webrtc::VideoCodec into TestConfig.
BUG=webrtc:6634

Review-Url: https://codereview.webrtc.org/2995603002
Cr-Commit-Position: refs/heads/master@{#19271}
2017-08-08 15:35:53 +00:00
brandtr
c287c80781 Remove source file writer from VideoProcessor.
It serves a very limited purpose: converting from the input YUV
file to an output Y4M file. The experimenter can do this manually,
if this is of interest. (It is generally not.)

BUG=webrtc:6634

Review-Url: https://codereview.webrtc.org/2993063002
Cr-Commit-Position: refs/heads/master@{#19257}
2017-08-07 15:30:43 +00:00
brandtr
c409552052 Remove VideoProcessor interface.
BUG=webrtc:6634

Review-Url: https://codereview.webrtc.org/2994613002
Cr-Commit-Position: refs/heads/master@{#19256}
2017-08-07 15:12:33 +00:00
magjed
73c0eb5014 ObjC: Implement HW codecs in ObjC instead of C++
The current ObjC HW encoder is implemented as a C++
webrtc::VideoEncoder. We then wrap it two times in the following way:
webrtc::VideoEncoder -> RTCVideoEncoder -> webrtc::VideoEncoder.
This was originally done to minimize the code diff when landing the
injectable encoder.

This CL removes the first wrapping and implements the ObjC HW encoder
as a RTCVideoEncoder directly. Similarly, the decoder is implemented
as a RTCVideoDecoder directly.

Based on andersc@ CL: https://codereview.webrtc.org/2978623002/.

BUG=webrtc:7924

Review-Url: https://codereview.webrtc.org/2987413002
Cr-Commit-Position: refs/heads/master@{#19255}
2017-08-07 13:55:28 +00:00
brandtr
bea36fdee8 Minor improvements to VideoProcessor and corresponding test.
- Make all overridden methods of VideoProcessorImpl public,
  in preparation of the removal of the VideoProcessor interface.
- Place corresponding method definitions in correct order
  in .cc file.
- Harmonize the stdout printing.
- Make timestamp calculations adhere to set frame rate.

Except for the last bullet, these changes should not lead to
different functionality.

BUG=webrtc:6634

Review-Url: https://codereview.webrtc.org/2995513002
Cr-Commit-Position: refs/heads/master@{#19254}
2017-08-07 10:36:54 +00:00
brandtr
669ea1917e Rename WEBRTC_VIDEOPROCESSOR_H264_TESTS define to WEBRTC_USE_H264.
This is the name used in other parts of the code.

BUG=none

Review-Url: https://codereview.webrtc.org/2996463003
Cr-Commit-Position: refs/heads/master@{#19253}
2017-08-07 10:35:13 +00:00
mflodman
463d7ccb36 Remove video_coding/codecs/OWNERS.
video_coding/OWNERS/ should be enough.

BUG=webrtc:8064
R=stefan@webrtc.org

Review-Url: https://codereview.webrtc.org/2992283002 .
Cr-Commit-Position: refs/heads/master@{#19246}
2017-08-04 10:58:25 +00:00
asapersson
8339e1a7aa Remove ProcessParams struct.
Add SetProcessParams method for configuring process settings (removes intermediate step of configuring settings via ProcessParams).

BUG=webrtc:6634

Review-Url: https://codereview.webrtc.org/2962293002
Cr-Commit-Position: refs/heads/master@{#19206}
2017-08-02 07:17:18 +00:00
pbos
1777c5fec5 Move temporal-layer properties to FrameConfig.
Removes keying on pattern_idx inside TemporalLayers implementations for
several properties that are different between screencast temporal layers
and normal/default temporal layers.

This is a step towards sharing PopulateCodecSpecific between the layer
patterns and code deduplication to longer term be able to separate the
packetizer step from encoder settings, so that temporal patterns can be
used for asynchronous hardware encoders where there may be outstanding
frames.

BUG=chromium:702017, webrtc:7349
R=brandtr@webrtc.org

Review-Url: https://codereview.webrtc.org/2924993002
Cr-Commit-Position: refs/heads/master@{#19097}
2017-07-20 00:04:02 +00:00
sprang
f03ea04176 Fix potential incorrect sync flags used with screenshare TL stream.
BUG=webrtc:7980

Review-Url: https://codereview.webrtc.org/2978743002
Cr-Commit-Position: refs/heads/master@{#18999}
2017-07-13 10:53:51 +00:00
jianj
23173a372b vp9: Use 2 threads for 360p.
BUG=None

Review-Url: https://codereview.webrtc.org/2977843002
Cr-Commit-Position: refs/heads/master@{#18990}
2017-07-12 23:11:09 +00:00
jianj
822e593437 vp9: Turn off FRAME_PARALLEL_DECODING.
This is removed from libvpx.

BUG=None

Review-Url: https://codereview.webrtc.org/2975113002
Cr-Commit-Position: refs/heads/master@{#18989}
2017-07-12 23:09:58 +00:00