Closed Bug 1759324 Opened 3 years ago Closed 3 years ago

Update libvpx to v1.11.0

Categories

(Core :: WebRTC, task, P2)

task

Tracking

()

RESOLVED FIXED
101 Branch
Tracking Status
firefox101 --- fixed

People

(Reporter: johann.koenig, Assigned: johann.koenig)

References

Details

Attachments

(3 files)

Steps to reproduce:

libvpx was last updated to v1.8.2 in bug #1525393

There have since been a few new releases:

2021-09-27 v1.11.0 "Smew Duck"
This maintenance release adds support for VBR mode in VP9 rate control
interface, new codec controls to get quantization parameters and loop filter
levels, and includes several improvements to NEON and numerous bug fixes.

  • Upgrading:
    New codec control is added to get quantization parameters and loop filter
    levels.

    VBR mode is supported in VP9 rate control library.

  • Enhancement:
    Numerous improvements for Neon optimizations.
    Code clean-up and refactoring.
    Calculation of rd multiplier is changed with BDRATE gains.

  • Bug fixes:
    Fix to overflow on duration.
    Fix to several instances of -Wunused-but-set-variable.
    Fix to avoid chroma resampling for 420mpeg2 input.
    Fix to overflow in calc_iframe_target_size.
    Fix to disallow skipping transform and quantization.
    Fix some -Wsign-compare warnings in simple_encode.
    Fix input file path in simple_encode_test.
    Fix valid range for under/over_shoot pct.

2021-03-09 v1.10.0 "Ruddy Duck"
This maintenance release adds support for darwin20 and new codec controls, as
well as numerous bug fixes.

  • Upgrading:
    New codec control is added to disable loopfilter for VP9.

    New encoder control is added to disable feature to increase Q on overshoot
    detection for CBR.

    Configure support for darwin20 is added.

    New codec control is added for VP9 rate control. The control ID of this
    interface is VP9E_SET_EXTERNAL_RATE_CONTROL. To make VP9 use a customized
    external rate control model, users will have to implement each callback
    function in vpx_rc_funcs_t and register them using libvpx API
    vpx_codec_control_() with the control ID.

  • Enhancement:
    Use -std=gnu++11 instead of -std=c++11 for c++ files.

  • Bug fixes:
    Override assembler with --as option of configure for MSVS.
    Fix several compilation issues with gcc 4.8.5.
    Fix to resetting rate control for temporal layers.
    Fix to the rate control stats of SVC example encoder when number of spatial
    layers is 1.
    Fix to reusing motion vectors from the base spatial layer in SVC.
    2 pass related flags removed from SVC example encoder.

2020-07-29 v1.9.0 "Quacking Duck"
This release adds support for NV12, a separate library for rate control, as
well as incremental improvements.

  • Upgrading:
    NV12 support is added to this release.
    A new interface is added for VP9 rate control. The new library libvp9rc.a
    must be linked by applications.
    Googletest is updated to v1.10.0.
    simple_encode.cc is compiled into a new library libsimple_encode.a with
    CONFIG_RATE_CTRL.

  • Enhancement:
    Various changes to improve VP9 SVC, rate control, quality and speed to real
    time encoding.

  • Bug fixes:
    Fix key frame update refresh simulcast flexible svc.
    Fix to disable_16x16part speed feature for real time encoding.
    Fix some signed integer overflows for VP9 rate control.
    Fix initialization of delta_q_uv.
    Fix condition in regulate_q for cyclic refresh.
    Various fixes to dynamic resizing for VP9 SVC.

Actual results:

$ cd media/libvpx
$ ./update.py --commit v1.11.0
https://chromium.googlesource.com/webm/libvpx/+archive/v1.11.0.tar.gz
patching file libvpx/vp8/encoder/block.h
patching file libvpx/vp8/vp8_cx_iface.c
Hunk #1 succeeded at 921 (offset 66 lines).
patching file libvpx/vp9/vp9_cx_iface.c
Hunk #1 succeeded at 1353 with fuzz 1 (offset 224 lines).
patching file libvpx/vpx_dsp/vpx_dsp.mk
patching file libvpx/vpx_ports/vpx_ports.mk
Hunk #1 succeeded at 23 (offset 2 lines).
$ ./generate_sources_mozbuild.shCreate temporary directory.
Generate config files.
#define HAVE_UNISTD_H 1
#define HAVE_UNISTD_H 1
#define HAVE_UNISTD_H 1
#define HAVE_UNISTD_H 1
#define HAVE_UNISTD_H 0
#define HAVE_UNISTD_H 0
#define HAVE_UNISTD_H 1
#define HAVE_UNISTD_H 1
#define HAVE_UNISTD_H 0
#define HAVE_UNISTD_H 1
Remove temporary directory.
Create temporary directory.
Generate config/linux/x64/_rtcd.h files.
Generate config/linux/ia32/
_rtcd.h files.
Generate config/mac/x64/_rtcd.h files.
Generate config/mac/ia32/
_rtcd.h files.
Generate config/win/x64/_rtcd.h files.
Generate config/win/ia32/
_rtcd.h files.
Generate config/linux/arm/_rtcd.h files.
Generate config/linux/arm64/
_rtcd.h files.
Generate config/win/aarch64/_rtcd.h files.
Generate config/generic/
_rtcd.h files.
Prepare Makefile.
Generate X86_64 source list.
Generate IA32 source list.
Generate ARM source list.
Generate ARM64 source list.
Generate generic source list.
Remove temporary directory.

Expected results:

0:20.92 Your build was successful!

Assignee: nobody → johann.koenig
Attachment #9267540 - Attachment description: WIP: Bug 1759324 - update libvpx to v1.11.0 → Bug 1759324 - update libvpx to v1.11.0
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true

Adjust for minor offsets since v1.8.2

Depends on D140925

Attachment #9267542 - Attachment description: WIP: Bug 1759324 - update libvpx patches → Bug 1759324 - update libvpx patches

I'm not sure how to remove the "Changes Planned" tags from the patches. They are complete as far as I can tell.

Flags: needinfo?(dminor)
Flags: needinfo?(bvandyk)

Just want to mention that we usually use ffvpx or HW platform decoder (Windows, MacOS) for decoding vp8 and vp9. libvpx is only a back up option for us, and almost no chance to use it AFAIK. (maybe for WebRTC encoding, but I am not sure)

(In reply to johann.koenig from comment #3)

I'm not sure how to remove the "Changes Planned" tags from the patches. They are complete as far as I can tell.

I think you can change this through the Add Action menu in Phabricator. If you submitted this through MozPhab, there's also a --no-wip flag I believe.

Flags: needinfo?(dminor)

I believe WebRTC uses it for both encoding and decoding.

Thanks for pointing out the --no-wip flag. I could not find any "Add Action" menu on the site.

I check our codebase again. For encoding, we use platform encoder on Windows, MacOS and Android [1]. So it seems to me that only on Linux we would use libvpx. For decoding, we would also try to get the platform decoder first [2]. However, currently decoding for vpx is controlled by this pref [3] which is only enabled on Nightly. So on Beta and Release, we do use libvpx for vpx decoding for WebRTC.

[1]
Creating platform encoder in WebRTC
https://searchfox.org/mozilla-central/rev/b0779bcc485dc1c04334dfb9ea024cbfff7b961a/dom/media/webrtc/libwebrtcglue/WebrtcMediaDataEncoderCodec.cpp#163

Platform encoder
https://searchfox.org/mozilla-central/source/dom/media/platforms/wmf/WMFEncoderModule.cpp#18
https://searchfox.org/mozilla-central/source/dom/media/platforms/apple/AppleEncoderModule.cpp#18
https://searchfox.org/mozilla-central/source/dom/media/platforms/android/AndroidEncoderModule.cpp#29

[2]
https://searchfox.org/mozilla-central/rev/b0779bcc485dc1c04334dfb9ea024cbfff7b961a/dom/media/webrtc/libwebrtcglue/WebrtcVideoCodecFactory.cpp#29-30,45

[3]
https://searchfox.org/mozilla-central/source/modules/libpref/init/StaticPrefList.yaml#9381-9390

Component: Audio/Video → WebRTC

I believe our MediaRecorder also uses a TrackEncoder the uses libvpx. That's a platform agnostic use case we should also keep an eye on for bustages as part of updates. Holding NI while I clear my plate to get time to look at this in more detail.

Is it correct to interpret the patches as?

  1. Pull new version of libvpx ontop of old version with not further changes.
  2. Make further changes in the form of updating Mozilla specific patches.

Step 1 included running the script to update the configuration files as well. There were no manual changes to files under media/livpx/livpx

I did specify python3 at the top of update.py because it defaulted to python2 on my system.

This was changed in
https://hg.mozilla.org/mozilla-central/rev/3153ea8804088b11769353a828b1aeb276bdd69b

libvpx became more restrictive about these values here:
https://chromium-review.googlesource.com/c/webm/libvpx/+/2844345/2/vp8/vp8_cx_iface.c

Reset these to the original values which are the same ones used in WebRTC

Severity: -- → N/A
Type: enhancement → task
Priority: -- → P2
Pushed by bvandyk@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/30ec14bee9ea fix vp8 under/overshoot percentages r=bryce

Try run prior to landing: https://treeherder.mozilla.org/jobs?repo=try&revision=1ad7c4d1876f62c3561e663a196f1235fa1c60d8

(the patches there are a little haxxed to get the to apply locally, but are the same code as the ones in phabricator.)

Keywords: leave-open
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 101 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: