Skip to content

Commit

Permalink
Merge commit '6516e974f8c40d0e49b19a4b55b1c98e7432edbb'
Browse files Browse the repository at this point in the history
  • Loading branch information
Sibras committed Aug 1, 2020
2 parents 5a058e3 + 6516e97 commit b6b5b70
Show file tree
Hide file tree
Showing 262 changed files with 9,990 additions and 13,945 deletions.
6 changes: 6 additions & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ Angie Chiang <angiebird@google.com>
Aron Rosenberg <arosenberg@logitech.com>
Attila Nagy <attilanagy@google.com>
Birk Magnussen <birk.magnussen@googlemail.com>
Brian Foley <bpfoley@google.com>
Brion Vibber <bvibber@wikimedia.org>
changjun.yang <changjun.yang@intel.com>
Charles 'Buck' Krasic <ckrasic@google.com>
Expand All @@ -33,6 +34,7 @@ Chi Yo Tsai <chiyotsai@google.com>
chm <chm@rock-chips.com>
Chris Cunningham <chcunningham@chromium.org>
Christian Duvivier <cduvivier@google.com>
Clement Courbet <courbet@google.com>
Daniele Castagna <dcastagna@chromium.org>
Daniel Kang <ddkang@google.com>
Dan Zhu <zxdan@google.com>
Expand Down Expand Up @@ -91,6 +93,7 @@ John Koleszar <jkoleszar@google.com>
Johnny Klonaris <google@jawknee.com>
John Stark <jhnstrk@gmail.com>
Jon Kunkee <jkunkee@microsoft.com>
Jorge E. Moreira <jemoreira@google.com>
Joshua Bleecher Snyder <josh@treelinelabs.com>
Joshua Litt <joshualitt@google.com>
Julia Robson <juliamrobson@gmail.com>
Expand Down Expand Up @@ -125,6 +128,7 @@ Mirko Bonadei <mbonadei@google.com>
Moriyoshi Koizumi <mozo@mozo.jp>
Morton Jonuschat <yabawock@gmail.com>
Nathan E. Egge <negge@mozilla.com>
Neil Birkbeck <neil.birkbeck@gmail.com>
Nico Weber <thakis@chromium.org>
Niveditha Rau <niveditha.rau@gmail.com>
Parag Salasakar <img.mips1@gmail.com>
Expand Down Expand Up @@ -165,6 +169,7 @@ Shimon Doodkin <helpmepro1@gmail.com>
Shiyou Yin <yinshiyou-hf@loongson.cn>
Shubham Tandle <shubham.tandle@ittiam.com>
Shunyao Li <shunyaoli@google.com>
Sreerenj Balachandran <bsreerenj@gmail.com>
Stefan Holmer <holmer@google.com>
Suman Sunkara <sunkaras@google.com>
Supradeep T R <supradeep.tr@ittiam.com>
Expand All @@ -185,6 +190,7 @@ Vignesh Venkatasubramanian <vigneshv@google.com>
Vitaly Buka <vitalybuka@chromium.org>
Vlad Tsyrklevich <vtsyrklevich@chromium.org>
Wan-Teh Chang <wtc@google.com>
Wonkap Jang <wonkap@google.com>
xiwei gu <guxiwei-hf@loongson.cn>
Yaowu Xu <yaowu@google.com>
Yi Luo <luoyi@google.com>
Expand Down
26 changes: 25 additions & 1 deletion CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,27 @@
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.

2019-12-09 v1.8.2 "Pekin Duck"
This release collects incremental improvements to many aspects of the library.

Expand Down Expand Up @@ -362,7 +386,7 @@
of particular interest to real time streaming applications.

Temporal scalability allows the encoder to produce a stream that can
be decimated to different frame rates, with independent rate targetting
be decimated to different frame rates, with independent rate targeting
for each substream.

Multiframe quality enhancement postprocessing can make visual quality
Expand Down
30 changes: 30 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# How to Contribute

We'd love to accept your patches and contributions to this project. There are
just a few small guidelines you need to follow.

## Contributor License Agreement

Contributions to this project must be accompanied by a Contributor License
Agreement. You (or your employer) retain the copyright to your contribution;
this simply gives us permission to use and redistribute your contributions as
part of the project. Head over to <https://cla.developers.google.com/> to see
your current agreements on file or to sign a new one.

You generally only need to submit a CLA once, so if you've already submitted one
(even if it was for a different project), you probably don't need to do it
again.

## Code reviews

All submissions, including submissions by project members, require review. We
use a [Gerrit](https://www.gerritcodereview.com) instance hosted at
https://chromium-review.googlesource.com for this purpose.

See https://www.webmproject.org/code/contribute/submitting-patches for an
example of a typical gerrit workflow.

## Community Guidelines

This project follows
[Google's Open Source Community Guidelines](https://opensource.google.com/conduct/).
3 changes: 2 additions & 1 deletion README
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
README - 9 December 2019
README - 20 July 2020

Welcome to the WebM VP8/VP9 Codec SDK!

Expand Down Expand Up @@ -112,6 +112,7 @@ COMPILING THE APPLICATIONS/LIBRARIES:
x86_64-darwin16-gcc
x86_64-darwin17-gcc
x86_64-darwin18-gcc
x86_64-darwin19-gcc
x86_64-iphonesimulator-gcc
x86_64-linux-gcc
x86_64-linux-icc
Expand Down
8 changes: 6 additions & 2 deletions build/make/configure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -767,9 +767,9 @@ process_common_toolchain() {

# detect tgt_os
case "$gcctarget" in
*darwin1[0-8]*)
*darwin1[0-9]*)
tgt_isa=x86_64
tgt_os=`echo $gcctarget | sed 's/.*\(darwin1[0-8]\).*/\1/'`
tgt_os=`echo $gcctarget | sed 's/.*\(darwin1[0-9]\).*/\1/'`
;;
x86_64*mingw32*)
tgt_os=win64
Expand Down Expand Up @@ -907,6 +907,10 @@ process_common_toolchain() {
add_cflags "-mmacosx-version-min=10.14"
add_ldflags "-mmacosx-version-min=10.14"
;;
*-darwin19-*)
add_cflags "-mmacosx-version-min=10.15"
add_ldflags "-mmacosx-version-min=10.15"
;;
*-iphonesimulator-*)
add_cflags "-miphoneos-version-min=${IOS_VERSION_MIN}"
add_ldflags "-miphoneos-version-min=${IOS_VERSION_MIN}"
Expand Down
3 changes: 3 additions & 0 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ 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-darwin18-gcc"
all_platforms="${all_platforms} x86_64-darwin19-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"
Expand Down Expand Up @@ -627,6 +628,7 @@ process_toolchain() {
check_add_cflags -Wmissing-declarations
check_add_cflags -Wmissing-prototypes
check_add_cflags -Wuninitialized
check_add_cflags -Wunreachable-code-loop-increment
check_add_cflags -Wunused
check_add_cflags -Wextra
# check_add_cflags also adds to cxxflags. gtest does not do well with
Expand Down Expand Up @@ -732,6 +734,7 @@ process_toolchain() {
# GTestLog must be modified to use Android logging utilities.
;;
*-darwin-*)
check_add_cxxflags -std=c++11
# iOS/ARM builds do not work with gtest. This does not match
# x86 targets.
;;
Expand Down
2 changes: 2 additions & 0 deletions examples.mk
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ endif
# while EXAMPLES demonstrate specific portions of the API.
UTILS-$(CONFIG_DECODERS) += vpxdec.c
vpxdec.SRCS += md5_utils.c md5_utils.h
vpxdec.SRCS += vpx_ports/compiler_attributes.h
vpxdec.SRCS += vpx_ports/mem_ops.h
vpxdec.SRCS += vpx_ports/mem_ops_aligned.h
vpxdec.SRCS += vpx_ports/msvc.h
Expand Down Expand Up @@ -167,6 +168,7 @@ decode_to_md5.SRCS += y4minput.c y4minput.h
decode_to_md5.SRCS += tools_common.h tools_common.c
decode_to_md5.SRCS += video_common.h
decode_to_md5.SRCS += video_reader.h video_reader.c
decode_to_md5.SRCS += vpx_ports/compiler_attributes.h
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
Expand Down
2 changes: 1 addition & 1 deletion examples/decode_with_drops.c
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ int main(int argc, char **argv) {
printf("Using %s\n", vpx_codec_iface_name(decoder->codec_interface()));

if (vpx_codec_dec_init(&codec, decoder->codec_interface(), NULL, 0))
die_codec(&codec, "Failed to initialize decoder.");
die("Failed to initialize decoder.");

while (vpx_video_reader_read_frame(reader)) {
vpx_codec_iter_t iter = NULL;
Expand Down
4 changes: 2 additions & 2 deletions examples/postproc.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,9 @@ int main(int argc, char **argv) {
res = vpx_codec_dec_init(&codec, decoder->codec_interface(), NULL,
VPX_CODEC_USE_POSTPROC);
if (res == VPX_CODEC_INCAPABLE)
die_codec(&codec, "Postproc not supported by this decoder.");
die("Postproc not supported by this decoder.");

if (res) die_codec(&codec, "Failed to initialize decoder.");
if (res) die("Failed to initialize decoder.");

while (vpx_video_reader_read_frame(reader)) {
vpx_codec_iter_t iter = NULL;
Expand Down
2 changes: 1 addition & 1 deletion examples/set_maps.c
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ int main(int argc, char **argv) {
die("Failed to open %s for reading.", argv[4]);

if (vpx_codec_enc_init(&codec, encoder->codec_interface(), &cfg, 0))
die_codec(&codec, "Failed to initialize encoder");
die("Failed to initialize encoder");

// Encode frames.
while (vpx_img_read(&raw, infile)) {
Expand Down
2 changes: 1 addition & 1 deletion examples/simple_decoder.c
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ int main(int argc, char **argv) {
printf("Using %s\n", vpx_codec_iface_name(decoder->codec_interface()));

if (vpx_codec_dec_init(&codec, decoder->codec_interface(), NULL, 0))
die_codec(&codec, "Failed to initialize decoder.");
die("Failed to initialize decoder.");

while (vpx_video_reader_read_frame(reader)) {
vpx_codec_iter_t iter = NULL;
Expand Down
2 changes: 1 addition & 1 deletion examples/simple_encoder.c
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ int main(int argc, char **argv) {
die("Failed to open %s for reading.", infile_arg);

if (vpx_codec_enc_init(&codec, encoder->codec_interface(), &cfg, 0))
die_codec(&codec, "Failed to initialize encoder");
die("Failed to initialize encoder");

// Encode frames.
while (vpx_img_read(&raw, infile)) {
Expand Down
4 changes: 2 additions & 2 deletions examples/twopass_encoder.c
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ static vpx_fixed_buf_t pass0(vpx_image_t *raw, FILE *infile,
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");
die("Failed to initialize encoder");

// Calculate frame statistics.
while (vpx_img_read(raw, infile)) {
Expand Down Expand Up @@ -164,7 +164,7 @@ static void pass1(vpx_image_t *raw, FILE *infile, const char *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");
die("Failed to initialize encoder");

// Encode frames.
while (vpx_img_read(raw, infile)) {
Expand Down
2 changes: 1 addition & 1 deletion examples/vp8cx_set_ref.c
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ int main(int argc, char **argv) {
die("Failed to open %s for reading.", argv[3]);

if (vpx_codec_enc_init(&codec, encoder->codec_interface(), &cfg, 0))
die_codec(&codec, "Failed to initialize encoder");
die("Failed to initialize encoder");

// Encode frames.
while (vpx_img_read(&raw, infile)) {
Expand Down
2 changes: 1 addition & 1 deletion examples/vp9_lossless_encoder.c
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ int main(int argc, char **argv) {
die("Failed to open %s for reading.", argv[3]);

if (vpx_codec_enc_init(&codec, encoder->codec_interface(), &cfg, 0))
die_codec(&codec, "Failed to initialize encoder");
die("Failed to initialize encoder");

if (vpx_codec_control_(&codec, VP9E_SET_LOSSLESS, 1))
die_codec(&codec, "Failed to use lossless mode");
Expand Down
2 changes: 1 addition & 1 deletion examples/vp9cx_set_ref.c
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ int main(int argc, char **argv) {
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");
die("Failed to initialize encoder");

// Disable alt_ref.
if (vpx_codec_control(&ecodec, VP8E_SET_ENABLEAUTOALTREF, 0))
Expand Down
7 changes: 7 additions & 0 deletions examples/vpx_dec_fuzzer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,13 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
return 0;
}

if (threads > 1) {
const int enable = (data[IVF_FILE_HDR_SZ] & 0xa0) != 0;
const vpx_codec_err_t err =
vpx_codec_control(&codec, VP9D_SET_LOOP_FILTER_OPT, enable);
static_cast<void>(err);
}

data += IVF_FILE_HDR_SZ;
size -= IVF_FILE_HDR_SZ;

Expand Down
2 changes: 1 addition & 1 deletion examples/vpx_temporal_svc_encoder.c
Original file line number Diff line number Diff line change
Expand Up @@ -815,7 +815,7 @@ int main(int argc, char **argv) {
#else
if (vpx_codec_enc_init(&codec, encoder->codec_interface(), &cfg, 0))
#endif // CONFIG_VP9_HIGHBITDEPTH
die_codec(&codec, "Failed to initialize encoder");
die("Failed to initialize encoder");

if (strncmp(encoder->name, "vp8", 3) == 0) {
vpx_codec_control(&codec, VP8E_SET_CPUUSED, -speed);
Expand Down
30 changes: 19 additions & 11 deletions ivfenc.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,27 +13,35 @@
#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_with_video_info(FILE *outfile, unsigned int fourcc,
int frame_cnt, int frame_width,
int frame_height,
vpx_rational_t timebase) {
char header[32];

header[0] = 'D';
header[1] = 'K';
header[2] = 'I';
header[3] = 'F';
mem_put_le16(header + 4, 0); // version
mem_put_le16(header + 6, 32); // header size
mem_put_le32(header + 8, fourcc); // fourcc
mem_put_le16(header + 12, cfg->g_w); // width
mem_put_le16(header + 14, cfg->g_h); // height
mem_put_le32(header + 16, cfg->g_timebase.den); // rate
mem_put_le32(header + 20, cfg->g_timebase.num); // scale
mem_put_le32(header + 24, frame_cnt); // length
mem_put_le32(header + 28, 0); // unused
mem_put_le16(header + 4, 0); // version
mem_put_le16(header + 6, 32); // header size
mem_put_le32(header + 8, fourcc); // fourcc
mem_put_le16(header + 12, frame_width); // width
mem_put_le16(header + 14, frame_height); // height
mem_put_le32(header + 16, timebase.den); // rate
mem_put_le32(header + 20, timebase.num); // scale
mem_put_le32(header + 24, frame_cnt); // length
mem_put_le32(header + 28, 0); // unused

fwrite(header, 1, 32, outfile);
}

void ivf_write_file_header(FILE *outfile, const struct vpx_codec_enc_cfg *cfg,
unsigned int fourcc, int frame_cnt) {
ivf_write_file_header_with_video_info(outfile, fourcc, frame_cnt, cfg->g_w,
cfg->g_h, cfg->g_timebase);
}

void ivf_write_frame_header(FILE *outfile, int64_t pts, size_t frame_size) {
char header[12];

Expand Down
7 changes: 7 additions & 0 deletions ivfenc.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,20 @@

#include "./tools_common.h"

#include "vpx/vpx_encoder.h"

struct vpx_codec_enc_cfg;
struct vpx_codec_cx_pkt;

#ifdef __cplusplus
extern "C" {
#endif

void ivf_write_file_header_with_video_info(FILE *outfile, unsigned int fourcc,
int frame_cnt, int frame_width,
int frame_height,
vpx_rational_t timebase);

void ivf_write_file_header(FILE *outfile, const struct vpx_codec_enc_cfg *cfg,
uint32_t fourcc, int frame_cnt);

Expand Down
Loading

0 comments on commit b6b5b70

Please sign in to comment.