Commit Graph

97 Commits

Author SHA1 Message Date
2bc6864278 Reland of Drop frames until specified bitrate is achieved. (patchset #1 id:1 of https://codereview.webrtc.org/2666303002/ )
Reason for revert:
Perf test broke as it made assumptions that quality scaling was turned off. This turns out not to be the case. Fixed by turning quality scaling off for the tests.

Original issue's description:
> Revert of Drop frames until specified bitrate is achieved. (patchset #12 id:240001 of https://codereview.webrtc.org/2630333002/ )
>
> Reason for revert:
> due to failures on perf tests (not on perf stats, but fails running due to dcheck failures), see e.g., https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20(K%20Nexus5)
>
> Original issue's description:
> > Drop frames until specified bitrate is achieved.
> >
> > This CL fixes a regression introduced with the new quality scaler
> > where the video would no longer start in a scaled mode. This CL adds
> > code that compares incoming captured frames to the target bitrate,
> > and if they are found to be too large, they are dropped and sinkWants
> > set to a lower resolution. The number of dropped frames should be low
> > (0-4 in most cases) and should not introduce a noticeable delay, or
> > at least should be preferrable to having the first 2-4 seconds of video
> > have very low quality.
> >
> > BUG=webrtc:6953
> >
> > Review-Url: https://codereview.webrtc.org/2630333002
> > Cr-Commit-Position: refs/heads/master@{#16391}
> > Committed: 83399caec5
>
> TBR=perkj@webrtc.org,sprang@webrtc.org,stefan@webrtc.org,kthelgason@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:6953
>
> Review-Url: https://codereview.webrtc.org/2666303002
> Cr-Commit-Position: refs/heads/master@{#16395}
> Committed: 35fc2aa82f

TBR=perkj@webrtc.org,sprang@webrtc.org,stefan@webrtc.org,minyue@webrtc.org
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=webrtc:6953

Review-Url: https://codereview.webrtc.org/2675223002
Cr-Commit-Position: refs/heads/master@{#16473}
2017-02-07 15:02:22 +00:00
b1ca073db4 Rename adaptation api methods, extended vie_encoder unit test.
Use AdaptDown/AdaptUp instead of ScaleDown/ScaleUp, since we may want to
adapt using other means than resolution.

Also, extend vie_encoder with unit test that actually uses frames scaled
to resolution as determined by VideoAdapter, since that seems to be the
default implementation.

BUG=webrtc:4172

Review-Url: https://codereview.webrtc.org/2652893015
Cr-Commit-Position: refs/heads/master@{#16402}
2017-02-01 16:38:12 +00:00
35fc2aa82f Revert of Drop frames until specified bitrate is achieved. (patchset #12 id:240001 of https://codereview.webrtc.org/2630333002/ )
Reason for revert:
due to failures on perf tests (not on perf stats, but fails running due to dcheck failures), see e.g., https://build.chromium.org/p/client.webrtc.perf/builders/Android32%20Tests%20(K%20Nexus5)

Original issue's description:
> Drop frames until specified bitrate is achieved.
>
> This CL fixes a regression introduced with the new quality scaler
> where the video would no longer start in a scaled mode. This CL adds
> code that compares incoming captured frames to the target bitrate,
> and if they are found to be too large, they are dropped and sinkWants
> set to a lower resolution. The number of dropped frames should be low
> (0-4 in most cases) and should not introduce a noticeable delay, or
> at least should be preferrable to having the first 2-4 seconds of video
> have very low quality.
>
> BUG=webrtc:6953
>
> Review-Url: https://codereview.webrtc.org/2630333002
> Cr-Commit-Position: refs/heads/master@{#16391}
> Committed: 83399caec5

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

Review-Url: https://codereview.webrtc.org/2666303002
Cr-Commit-Position: refs/heads/master@{#16395}
2017-02-01 11:14:00 +00:00
83399caec5 Drop frames until specified bitrate is achieved.
This CL fixes a regression introduced with the new quality scaler
where the video would no longer start in a scaled mode. This CL adds
code that compares incoming captured frames to the target bitrate,
and if they are found to be too large, they are dropped and sinkWants
set to a lower resolution. The number of dropped frames should be low
(0-4 in most cases) and should not introduce a noticeable delay, or
at least should be preferrable to having the first 2-4 seconds of video
have very low quality.

BUG=webrtc:6953

Review-Url: https://codereview.webrtc.org/2630333002
Cr-Commit-Position: refs/heads/master@{#16391}
2017-02-01 09:31:52 +00:00
429600d7d0 Reland of Add experimental simulcast screen content mode
The original CL was reverted because of a bug discovered by the
chromium bots. Description of that CL:

> Review-Url: https://codereview.webrtc.org/2636443002
> Cr-Commit-Position: refs/heads/master@{#16135}
> Committed: a28e971e3b

The first patch set of this CL is the same as r16135.
Subsequence patch sets are the fixes applied.
Some new test cases have been added, which reveal a few more bugs that
have also been fixed.

BUG=webrtc:4172

Review-Url: https://codereview.webrtc.org/2641133002
Cr-Commit-Position: refs/heads/master@{#16299}
2017-01-26 14:12:26 +00:00
bc5d921659 Rename base/analytics/ to base/numerics/
BUG=webrtc:6832

Review-Url: https://codereview.webrtc.org/2626203002
Cr-Commit-Position: refs/heads/master@{#16060}
2017-01-13 17:14:33 +00:00
c7c26a0e64 Reland of place basictypes.h with stdint.h for int_t types. (patchset #1 id:1 of https://codereview.webrtc.org/2603203003/ )
Reason for revert:
Doing a reland where systeminfo.cc includes basictypes.h so that CPU_X86 etc. are defined when they are checked/used.

Original issue's description:
> Revert of Replace basictypes.h with stdint.h for int_t types. (patchset #1 id:1 of https://codereview.webrtc.org/2604043002/ )
>
> Reason for revert:
> Very likely cause of Chromium import bot breakage (unused function '__cpuid'), TBD why.
>
> Original issue's description:
> > Replace basictypes.h with stdint.h for int_t types.
> >
> > Removes basictypes.h for types that only makes use of it for fixed-size-int
> > typedefs and replaces it with stdint.h.
> >
> > BUG=webrtc:6853
> > R=tommi@webrtc.org
> >
> > Review-Url: https://codereview.webrtc.org/2604043002
> > Cr-Commit-Position: refs/heads/master@{#15867}
> > Committed: 7fd1a75300
>
> TBR=tommi@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:6853
>
> Review-Url: https://codereview.webrtc.org/2603203003
> Cr-Commit-Position: refs/heads/master@{#15869}
> Committed: 7eb0e23bcf

BUG=webrtc:6853
TBR=tommi@webrtc.org

Review-Url: https://codereview.webrtc.org/2609783002
Cr-Commit-Position: refs/heads/master@{#15873}
2017-01-02 16:42:32 +00:00
7eb0e23bcf Revert of Replace basictypes.h with stdint.h for int_t types. (patchset #1 id:1 of https://codereview.webrtc.org/2604043002/ )
Reason for revert:
Very likely cause of Chromium import bot breakage (unused function '__cpuid'), TBD why.

Original issue's description:
> Replace basictypes.h with stdint.h for int_t types.
>
> Removes basictypes.h for types that only makes use of it for fixed-size-int
> typedefs and replaces it with stdint.h.
>
> BUG=webrtc:6853
> R=tommi@webrtc.org
>
> Review-Url: https://codereview.webrtc.org/2604043002
> Cr-Commit-Position: refs/heads/master@{#15867}
> Committed: 7fd1a75300

TBR=tommi@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:6853

Review-Url: https://codereview.webrtc.org/2603203003
Cr-Commit-Position: refs/heads/master@{#15869}
2017-01-02 15:32:25 +00:00
7fd1a75300 Replace basictypes.h with stdint.h for int_t types.
Removes basictypes.h for types that only makes use of it for fixed-size-int
typedefs and replaces it with stdint.h.

BUG=webrtc:6853
R=tommi@webrtc.org

Review-Url: https://codereview.webrtc.org/2604043002
Cr-Commit-Position: refs/heads/master@{#15867}
2017-01-02 14:58:46 +00:00
46711db355 Disable flaky QualityScaler tests for now.
BUG=webrtc:6799
TBR=sprang@webrtc.org

Review-Url: https://codereview.webrtc.org/2564423002
Cr-Commit-Position: refs/heads/master@{#15573}
2016-12-13 13:32:31 +00:00
86cf9a2474 Increase test timeout to combat flakiness.
These tests have been a little flaky on the bots.
Hopefully increasing the timeout by 200% will help.

BUG=webrtc:6799

Review-Url: https://codereview.webrtc.org/2541743006
Cr-Commit-Position: refs/heads/master@{#15355}
2016-12-01 10:57:07 +00:00
876222f77d Move usage of QualityScaler to ViEEncoder.
This brings QualityScaler much more in line with OveruseFrameDetector.
The two classes are conceptually similar, and should be used in the
same way. The biggest changes in this CL are:
- Quality scaling is now only done in ViEEncoder and not in each
  encoder implementation separately.
- QualityScaler now checks the average QP asynchronously, instead of
  having to be polled on each frame.
- QualityScaler is no longer responsible for actually scaling the frames,
  but has a callback to ViEEncoder that it uses to express it's desire
  for lower resolution.

BUG=webrtc:6495

Review-Url: https://codereview.webrtc.org/2398963003
Cr-Commit-Position: refs/heads/master@{#15286}
2016-11-29 09:44:22 +00:00
c7805dbd0e Fix perf regression in screenshare temporal layer bitrate allocation
A recent cl (https://codereview.webrtc.org/2510583002) introduced an
issue where temporal layers may return incorrect bitrates, given that
they are stateful and that the GetPreferredBitrateBps is called.
The fix is to use a temporary simulcast rate allocator instance, without
temporal layers, and get the preferred bitrate from that.

Additionally, some regression in bitrate allocated stems from overly
often reconfiguring the encoder, which yields suboptimal rate control.
The fix here is to limit encoder updates to when values have actually
changed.

As a bonus, dchecks added by this cl found a bug in the (unused) RealtimeTemporalLayers implementation. Fixed that as well.

BUG=webrtc:6301, chromium:666654

Review-Url: https://codereview.webrtc.org/2529073003
Cr-Commit-Position: refs/heads/master@{#15250}
2016-11-25 16:09:51 +00:00
69b627d89d Move smoothing filter to common audio and exp_filter to base/analytics.
An earlier attempt of this work can be found here https://codereview.webrtc.org/2520003005/#ps100001, but was reverted.

PS4 in that CL was not valid since separation of BUILD.gn can cause internal bot to fail.

This is a new attempt, which is the same as https://codereview.webrtc.org/2520003005/#ps100001 but PS4 reverted.

BUG=webrtc:6443
TBR=tommi@webrtc.org, solenberg@webrtc.org

Review-Url: https://codereview.webrtc.org/2532523002
Cr-Commit-Position: refs/heads/master@{#15233}
2016-11-24 19:01:14 +00:00
3c3aef44de Revert of Reland "Move smoothing filter to common audio". (patchset #5 id:100001 of https://codereview.webrtc.org/2520003005/ )
Reason for revert:
Internal bots failed.

Original issue's description:
> Reland "Move smoothing filter to common audio".
>
> The original CL was this https://codereview.webrtc.org/2484153002/
>
> Due to failure with internal trial servers, it was reverted. This CL tries to reland it.
>
> BUG=webrtc:6443
>
> Committed: https://crrev.com/223641f1b903e41e77d88f03199b4cdb65255ec8
> Cr-Commit-Position: refs/heads/master@{#15227}

TBR=tommi@webrtc.org,solenberg@webrtc.org,terelius@webrtc.org,kjellander@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:6443

Review-Url: https://codereview.webrtc.org/2529943002
Cr-Commit-Position: refs/heads/master@{#15228}
2016-11-24 15:13:24 +00:00
223641f1b9 Reland "Move smoothing filter to common audio".
The original CL was this https://codereview.webrtc.org/2484153002/

Due to failure with internal trial servers, it was reverted. This CL tries to reland it.

BUG=webrtc:6443

Review-Url: https://codereview.webrtc.org/2520003005
Cr-Commit-Position: refs/heads/master@{#15227}
2016-11-24 14:08:09 +00:00
10165ab8e7 Unify VideoCodecType to/from string functionality
BUG=None

Review-Url: https://codereview.webrtc.org/2509273002
Cr-Commit-Position: refs/heads/master@{#15200}
2016-11-22 18:17:04 +00:00
b4af3d673a Remove all references to GYP
Remove all .gyp and .gypi files.
Remove entries from OWNERS files for *.isolate, *.gyp, *.gypi
Remove unused scripts in webrtc/build.

BUG=webrtc:6323
R=henrika@webrtc.org, phoglund@webrtc.org

Review URL: https://codereview.webrtc.org/2509703002 .

Cr-Commit-Position: refs/heads/master@{#15107}
2016-11-16 19:11:38 +00:00
08127a9449 Reland #2 of Issue 2434073003: Extract bitrate allocation ...
This is yet another reland of https://codereview.webrtc.org/2434073003/
including two fixes:

1. SimulcastRateAllocator did not handle the screenshare settings properly for numSimulcastStreams = 1. Additional test case was added for that.
2. In VideoSender, when rate allocation is updated after setting a new VideoCodec config, only update the state of the EncoderParameters, but don't actually run SetRateAllocation on the encoder itself. This caused some problems upstreams.

Please review only the changes after patch set 1.

Original description:

Extract bitrate allocation of spatial/temporal layers out of codec impl.

This CL makes a number of intervowen changes:

* Add BitrateAllocation struct, that contains a codec independent view
  of how the target bitrate is distributed over spatial and temporal
  layers.

* Adds the BitrateAllocator interface, which takes a bitrate and frame
  rate and produces a BitrateAllocation.

* A default (non layered) implementation is added, and
  SimulcastRateAllocator is extended to fully handle VP8 allocation.
  This includes capturing TemporalLayer instances created by the
  encoder.

* ViEEncoder now owns both the bitrate allocator and the temporal layer
  factories for VP8. This allows allocation to happen fully outside of
  the encoder implementation.

This refactoring will make it possible for ViEEncoder to signal the
full picture of target bitrates to the RTCP module.

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

Review URL: https://codereview.webrtc.org/2510583002 .

Cr-Commit-Position: refs/heads/master@{#15105}
2016-11-16 15:41:45 +00:00
e3fe4a7c2d Update VideoFrameBuffer-related methods to not use references to scoped_refptr.
Chrome coding standard now discourages use of references to smart
pointers. This cl updates some recent methods to the new conventions.

BUG=webrtc:6672

Review-Url: https://codereview.webrtc.org/2477233004
Cr-Commit-Position: refs/heads/master@{#15028}
2016-11-10 16:44:47 +00:00
1369c83b42 Revert of Issue 2434073003: Extract bitrate allocation ... (patchset #4 id:60001 of https://codereview.webrtc.org/2488833004/ )
Reason for revert:
Seems to be causing flakiness in perf test:
FullStackTest.ScreenshareSlidesVP8_2TL_LossyNet

Original issue's description:
> Reland of Issue 2434073003: Extract bitrate allocation ...
>
> This is a reland of https://codereview.webrtc.org/2434073003/ including
> some fixes for failing test cases.
>
> Original description:
>
> Extract bitrate allocation of spatial/temporal layers out of codec impl.
>
> This CL makes a number of intervowen changes:
>
> * Add BitrateAllocation struct, that contains a codec independent view
>   of how the target bitrate is distributed over spatial and temporal
>   layers.
>
> * Adds the BitrateAllocator interface, which takes a bitrate and frame
>   rate and produces a BitrateAllocation.
>
> * A default (non layered) implementation is added, and
>   SimulcastRateAllocator is extended to fully handle VP8 allocation.
>   This includes capturing TemporalLayer instances created by the
>   encoder.
>
> * ViEEncoder now owns both the bitrate allocator and the temporal layer
>   factories for VP8. This allows allocation to happen fully outside of
>   the encoder implementation.
>
> This refactoring will make it possible for ViEEncoder to signal the
> full picture of target bitrates to the RTCP module.
>
> BUG=webrtc:6301
>
> Committed: https://crrev.com/647bf43dcb2fd16fccf276bd94dc4400728bb405
> Cr-Commit-Position: refs/heads/master@{#15023}

TBR=mflodman@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:6301

Review-Url: https://codereview.webrtc.org/2491393002
Cr-Commit-Position: refs/heads/master@{#15026}
2016-11-10 16:30:39 +00:00
647bf43dcb Reland of Issue 2434073003: Extract bitrate allocation ...
This is a reland of https://codereview.webrtc.org/2434073003/ including
some fixes for failing test cases.

Original description:

Extract bitrate allocation of spatial/temporal layers out of codec impl.

This CL makes a number of intervowen changes:

* Add BitrateAllocation struct, that contains a codec independent view
  of how the target bitrate is distributed over spatial and temporal
  layers.

* Adds the BitrateAllocator interface, which takes a bitrate and frame
  rate and produces a BitrateAllocation.

* A default (non layered) implementation is added, and
  SimulcastRateAllocator is extended to fully handle VP8 allocation.
  This includes capturing TemporalLayer instances created by the
  encoder.

* ViEEncoder now owns both the bitrate allocator and the temporal layer
  factories for VP8. This allows allocation to happen fully outside of
  the encoder implementation.

This refactoring will make it possible for ViEEncoder to signal the
full picture of target bitrates to the RTCP module.

BUG=webrtc:6301

Review-Url: https://codereview.webrtc.org/2488833004
Cr-Commit-Position: refs/heads/master@{#15023}
2016-11-10 14:46:28 +00:00
4bc98d4e1b Revert of Extract bitrate allocation of spatial/temporal layers out of codec impl. (patchset #17 id:320001 of https://codereview.webrtc.org/2434073003/ )
Reason for revert:
Breaks perf tests.

Original issue's description:
> Extract bitrate allocation of spatial/temporal layers out of codec impl.
>
> This CL makes a number of intervowen changes:
>
> * Add BitrateAllocation struct, that contains a codec independent view
>   of how the target bitrate is distributed over spatial and temporal
>   layers.
>
> * Adds the BitrateAllocator interface, which takes a bitrate and frame
>   rate and produces a BitrateAllocation.
>
> * A default (non layered) implementation is added, and
>   SimulcastRateAllocator is extended to fully handle VP8 allocation.
>   This includes capturing TemporalLayer instances created by the
>   encoder.
>
> * ViEEncoder now owns both the bitrate allocator and the temporal layer
>   factories for VP8. This allows allocation to happen fully outside of
>   the encoder implementation.
>
> This refactoring will make it possible for ViEEncoder to signal the
> full picture of target bitrates to the RTCP module.
>
> BUG=webrtc:6301
>
> Committed: https://crrev.com/8f46c679d24a05b3f08e02c6d91ec9637f34e24f
> Cr-Commit-Position: refs/heads/master@{#14998}

TBR=stefan@webrtc.org,perkj@webrtc.org,mflodman@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:6301

Review-Url: https://codereview.webrtc.org/2489843002
Cr-Commit-Position: refs/heads/master@{#15001}
2016-11-09 14:14:56 +00:00
8f46c679d2 Extract bitrate allocation of spatial/temporal layers out of codec impl.
This CL makes a number of intervowen changes:

* Add BitrateAllocation struct, that contains a codec independent view
  of how the target bitrate is distributed over spatial and temporal
  layers.

* Adds the BitrateAllocator interface, which takes a bitrate and frame
  rate and produces a BitrateAllocation.

* A default (non layered) implementation is added, and
  SimulcastRateAllocator is extended to fully handle VP8 allocation.
  This includes capturing TemporalLayer instances created by the
  encoder.

* ViEEncoder now owns both the bitrate allocator and the temporal layer
  factories for VP8. This allows allocation to happen fully outside of
  the encoder implementation.

This refactoring will make it possible for ViEEncoder to signal the
full picture of target bitrates to the RTCP module.

BUG=webrtc:6301

Review-Url: https://codereview.webrtc.org/2434073003
Cr-Commit-Position: refs/heads/master@{#14998}
2016-11-09 13:09:12 +00:00
b906172e02 Reland of Move bitstream parser to more appropriate directory. (patchset #1 id:1 of https://codereview.webrtc.org/2430353004/ )
Reason for revert:
Internal project has been fixed

Original issue's description:
> Revert of Move bitstream parser to more appropriate directory. (patchset #4 id:60001 of https://codereview.webrtc.org/2370853005/ )
>
> Reason for revert:
> Breaks internal project
>
> Original issue's description:
> > Move current bitstream parser to more appropriate directory.
> >
> > This CL groups together the code that has to do with parsing H264 bitstreams.
> > This code logically belongs together, and having it in the same directory not
> > only simplifies things from a project structure perspective, but also makes it
> > easier to refactor out common parts incrementally.
> > An added benefit is that this simplifies modular compilation, where for example
> > one would like a build of WebRTC without the H264 codec-specific parts.
> >
> > BUG=webrtc:6338
> >
> > Committed: https://crrev.com/cc6817e9ce4a5ffc73efb660cf0368afbc7d9a4f
> > Cr-Commit-Position: refs/heads/master@{#14684}
>
> TBR=magjed@webrtc.org,stefan@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:6338
>
> Committed: https://crrev.com/f04f14e772f803de39f8a6128e5157127cd35103
> Cr-Commit-Position: refs/heads/master@{#14685}

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

Review-Url: https://codereview.webrtc.org/2434043002
Cr-Commit-Position: refs/heads/master@{#14783}
2016-10-26 09:48:24 +00:00
55928fef1e QualityScaler reset bugfix
BUG=webrtc:6563
TBR=sprang@webrtc.org

Review-Url: https://codereview.webrtc.org/2434803002
Cr-Commit-Position: refs/heads/master@{#14688}
2016-10-20 07:42:59 +00:00
f04f14e772 Revert of Move bitstream parser to more appropriate directory. (patchset #4 id:60001 of https://codereview.webrtc.org/2370853005/ )
Reason for revert:
Breaks internal project

Original issue's description:
> Move current bitstream parser to more appropriate directory.
>
> This CL groups together the code that has to do with parsing H264 bitstreams.
> This code logically belongs together, and having it in the same directory not
> only simplifies things from a project structure perspective, but also makes it
> easier to refactor out common parts incrementally.
> An added benefit is that this simplifies modular compilation, where for example
> one would like a build of WebRTC without the H264 codec-specific parts.
>
> BUG=webrtc:6338
>
> Committed: https://crrev.com/cc6817e9ce4a5ffc73efb660cf0368afbc7d9a4f
> Cr-Commit-Position: refs/heads/master@{#14684}

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

Review-Url: https://codereview.webrtc.org/2430353004
Cr-Commit-Position: refs/heads/master@{#14685}
2016-10-19 17:34:39 +00:00
cc6817e9ce Move current bitstream parser to more appropriate directory.
This CL groups together the code that has to do with parsing H264 bitstreams.
This code logically belongs together, and having it in the same directory not
only simplifies things from a project structure perspective, but also makes it
easier to refactor out common parts incrementally.
An added benefit is that this simplifies modular compilation, where for example
one would like a build of WebRTC without the H264 codec-specific parts.

BUG=webrtc:6338

Review-Url: https://codereview.webrtc.org/2370853005
Cr-Commit-Position: refs/heads/master@{#14684}
2016-10-19 16:31:15 +00:00
d020f3fea0 Support for parsing CABAC coded bitstreams
Remove check on entropy_coding_mode_flag in PPS parser.
Parse entropy_coding_mode_flag from PPS and store it in the parser struct. Parse out extra data in NALU slices in case of entropy_coding_mode to avoid reporting incorrect QP.

BUG=webrtc:6338

Review-Url: https://codereview.webrtc.org/2373393002
Cr-Commit-Position: refs/heads/master@{#14522}
2016-10-05 09:16:28 +00:00
ac9f876bc0 Sort #includes that got unsorted when gmock.h and gtest.h moved to webrtc/test/
gmock.h and gtest.h were moved (or rather, got wrappers so that we
could put some icky compatibility hacks in one place instead of 500)
in this CL: https://codereview.webrtc.org/2358993004/

NOPRESUBMIT=true
BUG=webrtc:6398

Review-Url: https://codereview.webrtc.org/2381013002
Cr-Commit-Position: refs/heads/master@{#14464}
2016-10-01 05:29:53 +00:00
Per
a48ddb7636 Add VideoSendStream::Stats::prefered_media_bitrate_bps
This cl move calculation of stats for prefered_media_bitrate_bps from webrtcvideoengine2.GetStats to SendStatisticsProxy::OnEncoderReconfigured.
This aligns better with how other send stats are reported and is needed as a prerequisite for moving video encoder configuration due to video resolution change
from WebRtcVideoEngine2 to ViEEncoder.

BUG=webrtc:6371
R=mflodman@webrtc.org, sprang@webrtc.org

Review URL: https://codereview.webrtc.org/2368223002 .

Cr-Commit-Position: refs/heads/master@{#14431}
2016-09-29 09:49:01 +00:00
77eab70470 Enable the -Wundef warning for clang
NOPRESUBMIT=true
BUG=webrtc:6398

Review-Url: https://codereview.webrtc.org/2358993004
Cr-Commit-Position: refs/heads/master@{#14425}
2016-09-29 00:42:08 +00:00
478681e1e6 Move the QP scaling thresholds to the relevant encoders.
Also provide a new set of thresholds for the VideoToolbox encoder. The new thresholds were experimentally determined to work well on the iPhone 6S, and also adequately on the iPhone 5S.

BUG=webrtc:5678

Review-Url: https://codereview.webrtc.org/2309743002
Cr-Commit-Position: refs/heads/master@{#14420}
2016-09-28 15:17:51 +00:00
e75f204b06 Expose Ivf logging through the native API
BUG=webrtc:6300

Review-Url: https://codereview.webrtc.org/2303273002
Cr-Commit-Position: refs/heads/master@{#14419}
2016-09-28 13:19:53 +00:00
5a20ed36e6 Fix undefined reference to log2 on android
R=nisse@webrtc.org
TBR=sakal@webrtc.org, sprang@webrtc.org

Review URL: https://codereview.webrtc.org/2341433004 .

Cr-Commit-Position: refs/heads/master@{#14225}
2016-09-15 08:56:30 +00:00
194f40a2e7 Refactor QualityScaler and MovingAverage
The MovingAverage class was very specific to the QualityScaler. This
commit generalizes the MovingAverage class to be useful in other
situations as well, and adapts the QualityScaler to use the new
MovingAverage.

BUG=webrtc:6304

Review-Url: https://codereview.webrtc.org/2310853002
Cr-Commit-Position: refs/heads/master@{#14207}
2016-09-14 09:15:02 +00:00
78ce619a0c Extract simulcast rate allocation outside of video encoder.
This is a first step to refactor this code.
I'm deprecating https://codereview.webrtc.org/1913073002 and
implementing this in smaller more isolated steps.

BUG=webrtc:5206
R=asapersson@webrtc.org, kjellander@webrtc.org, noahric@chromium.org

Review URL: https://codereview.webrtc.org/2288223002 .

Cr-Commit-Position: refs/heads/master@{#14186}
2016-09-12 14:04:56 +00:00
36a06a94fb Increase QP threshold for H.264 encoder QP based scaling.
BUG=b/30743634

Review-Url: https://codereview.webrtc.org/2272893002
Cr-Commit-Position: refs/heads/master@{#13904}
2016-08-24 19:09:22 +00:00
6c687e72a0 Make prior H264 QP adjustments iOS specific.
BUG=

Review-Url: https://codereview.webrtc.org/2248883002
Cr-Commit-Position: refs/heads/master@{#13764}
2016-08-15 23:38:02 +00:00
6a450105cd Adjust H264 QP thresholds.
NOTRY=True
BUG=

Review-Url: https://codereview.webrtc.org/2228683002
Cr-Commit-Position: refs/heads/master@{#13680}
2016-08-08 22:27:41 +00:00
55b0b37554 Use a better method to generate a random ID in IvfFileWriterTest.
It was generating a random ID using the test case's "this" pointer
and the current time. However, the current time may be imprecise. And
the "this" pointer may have repeatable values.

BUG=webrtc:5898

Review-Url: https://codereview.webrtc.org/2190533004
Cr-Commit-Position: refs/heads/master@{#13560}
2016-07-28 17:51:14 +00:00
4e417b242a Reland of Switch to use SequencedTaskChecker instead of ThreadChecker where needed.
(patchset #1 id:1 of https://codereview.webrtc.org/2149553002/ )"
This reverts commit efd902cb1d9bbd81247a3e168f2080beae761d78.

Originally reviewed in https://codereview.webrtc.org/2149553002

The uptream problem should be fixed by https://codereview.webrtc.org/2145393003/

BUG=webrtc:5687
TBR=tommi@webrtc.org

Review-Url: https://codereview.webrtc.org/2152013002
Cr-Commit-Position: refs/heads/master@{#13483}
2016-07-15 06:36:00 +00:00
ac62bd4a3b Rewrite CreateBlackFrame in webrtcvideoengine.
Don't use VideoFrameBuffer::MutableDataY and friends, instead, use
I420Buffer::SetToBlack.

Also introduce static method I420Buffer::Create, to create an object and
return a scoped_refptr.

TBR=marpan@webrtc.org # Trivial change to video_denoiser.cc
BUG=webrtc:5921

Review-Url: https://codereview.webrtc.org/2078943002
Cr-Commit-Position: refs/heads/master@{#13212}
2016-06-20 10:39:00 +00:00
a6219cc3ef FileWrapper[Impl] modifications and actually remove the "Impl" class.
This is a somewhat involved refactoring of this class. Here's an overview of the changes:

* FileWrapper can now be used as a regular class and instances allocated on the stack.
* The type now has support for move semantics and copy isn't allowed.
* New public ctor with FILE* that can be used instead of OpenFromFileHandle.
* New static Open() method.  The intent of this is to allow opening a file and getting back a FileWrapper instance.  Using this method instead of Create(), will allow us in the future to make the FILE* member pointer, to be const and simplify threading (get rid of the lock).
* Rename the Open() method to is_open() and make it inline.
* The FileWrapper interface is no longer a pure virtual interface.  There's only one implementation so there's no need to go through a vtable for everything.
* Functionality offered by the class, is now reduced.  No support for looping (not clear if that was actually useful to users of that flag), no need to implement the 'read_only_' functionality in the class, since file APIs implement that already, no support for *not* managing the file handle (this wasn't used).  OpenFromFileHandle always "manages" the file.
* Delete the unused WriteText() method and don't support opening files in text mode.  Text mode is only different on Windows and on Windows it translates \n to \r\n, which means that files such as log files, could have a slightly different format on Windows than other platforms.  Besides, tools on Windows can handle UNIX line endings.
* Remove FileName(), change Trace code to manage its own path.
* Rename id_ member variable to file_.
* Removed the open_ member variable since the same functionality can be gotten from just checking the file pointer.
* Don't call CloseFile inside of Write.  Write shouldn't be changing the state of the class beyond just attempting to write.
* Remove concept of looping from FileWrapper and never close inside of Read()
* Changed stream base classes to inherit from a common base class instead of both defining the Rewind method. Ultimately, Id' like to remove these interfaces and just have FileWrapper.
* Remove read_only param from OpenFromFileHandle
* Renamed size_in_bytes_ to position_, since it gets set to 0 when Rewind() is called (and the size actually does not change).
* Switch out rw lock for CriticalSection. The r/w lock was only used for reading when checking the open_ flag.

BUG=

Review-Url: https://codereview.webrtc.org/2054373002
Cr-Commit-Position: refs/heads/master@{#13155}
2016-06-15 17:30:18 +00:00
718a763d59 Refactor scaling.
Introduce a new method I420Buffer::CropAndScale, and a static
convenience helper I420Buffer::CenterCropAndScale. Use them for almost
all scaling needs.

Delete the Scaler class and the cricket::VideoFrame::Stretch* methods.

BUG=webrtc:5682
R=pbos@webrtc.org, perkj@webrtc.org, stefan@webrtc.org

Review URL: https://codereview.webrtc.org/2020593002 .

Cr-Commit-Position: refs/heads/master@{#13110}
2016-06-13 11:06:14 +00:00
52033d6ea1 Add H264 bitstream rewriting to limit frame reordering marker in header
The VUI part an SPS may specify max_num_reorder_frames and
max_dec_frame_buffering. These may cause a decoder to buffer a number
of frame prior allowing decode, leading to delays, even if no frames
using such references (ie B-frames) are sent.

Because of this we update any SPS block emitted by the encoder.

Also, a bunch of refactoring of H264-related code to reduce code
duplication.

BUG=

Review-Url: https://codereview.webrtc.org/1979443004
Cr-Commit-Position: refs/heads/master@{#13010}
2016-06-02 09:43:38 +00:00
73257d1b5a Reduce flakiness in IvfFileWriter tests.
If deleting files fails, wait a sec and retry. This can help in case
and antivirus software or similar has locked the file, preventing it
from being deleted.

BUG=webrtc:5898

Review-Url: https://codereview.webrtc.org/2014823002
Cr-Commit-Position: refs/heads/master@{#12917}
2016-05-26 12:45:57 +00:00
cc1543abf3 Move H264BitstreamParser to video_coding.
Moves parser, used in video_coding/ from rtp_rtcp where it is unused.

BUG=webrtc:5678
R=asapersson@webrtc.org
TBR=glaznev@webrt.org

Review URL: https://codereview.webrtc.org/2007553003 .

Cr-Commit-Position: refs/heads/master@{#12866}
2016-05-24 10:16:39 +00:00
1f53452ca6 Unify hardware and software QP thresholds.
Uses current libvpx (slightly older) thresholds to maintain a larger
window of stable QP, but maintains the newer H264 thresholds.

BUG=
R=glaznev@webrtc.org, mflodman@webrtc.org

Review-Url: https://codereview.webrtc.org/1966213002
Cr-Commit-Position: refs/heads/master@{#12734}
2016-05-13 18:05:38 +00:00
919288f6ba Clamp number of downscales in QualityScaler.
Fixes bug where QualityScaler would be stuck "way below" QVGA (due to
downscale_shift_) even though it would never scale below QVGA. Also
fixes issue where samples would be cleared when either staying at max
resolution or going below QVGA even though no action happened.

BUG=
R=glaznev@webrtc.org

Review URL: https://codereview.webrtc.org/1971693003 .

Cr-Commit-Position: refs/heads/master@{#12691}
2016-05-12 00:17:52 +00:00