aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Android.bp43
-rw-r--r--Android.bp.in2
-rw-r--r--METADATA3
-rw-r--r--OWNERS4
-rw-r--r--README.version1
-rw-r--r--libvpx/build/make/Android.mk3
-rw-r--r--libvpx/test/android/Android.mk6
-rw-r--r--libvpx/test/realtime_test.cc8
-rw-r--r--libvpx/third_party/libwebm/Android.mk3
-rw-r--r--libvpx/vp8/encoder/bitstream.c2
-rw-r--r--libvpx/vp8/encoder/onyx_if.c7
-rw-r--r--libvpx/vp9/encoder/vp9_pickmode.c2
-rw-r--r--libvpx/vp9/encoder/vp9_ratectrl.c6
-rw-r--r--libvpx/vp9/vp9_cx_iface.c11
-rw-r--r--libvpx_blocklist.txt (renamed from libvpx_blacklist.txt)3
-rw-r--r--libwebm/Android.bp15
-rw-r--r--libwebm/README.android2
-rw-r--r--libwebm/mkvparser/mkvparser.cc9
18 files changed, 111 insertions, 19 deletions
diff --git a/Android.bp b/Android.bp
index 448ebb62a..216ef220c 100644
--- a/Android.bp
+++ b/Android.bp
@@ -1,6 +1,37 @@
// THIS FILE IS AUTOGENERATED, DO NOT EDIT
// Generated from Android.bp.in, run ./generate_config.sh to regenerate
+package {
+ default_applicable_licenses: ["external_libvpx_license"],
+}
+
+// Added automatically by a large-scale-change that took the approach of
+// 'apply every license found to every target'. While this makes sure we respect
+// every license restriction, it may not be entirely correct.
+//
+// e.g. GPL in an MIT project might only apply to the contrib/ directory.
+//
+// Please consider splitting the single license below into multiple licenses,
+// taking care not to lose any license_kind information, and overriding the
+// default license using the 'licenses: [...]' property on targets as needed.
+//
+// For unused files, consider creating a 'fileGroup' with "//visibility:private"
+// to attach the license to, and including a comment whether the files may be
+// used in the current project.
+// See: http://go/android-license-faq
+license {
+ name: "external_libvpx_license",
+ visibility: [":__subpackages__"],
+ license_kinds: [
+ "SPDX-license-identifier-BSD",
+ "SPDX-license-identifier-ISC",
+ "legacy_unencumbered",
+ ],
+ license_text: [
+ "NOTICE",
+ ],
+}
+
libvpx_arm_neon_c_srcs = [
"libvpx/vp8/common/alloccommon.c",
"libvpx/vp8/common/arm/loopfilter_arm.c",
@@ -1098,6 +1129,14 @@ cc_library {
darwin: {
enabled: false,
},
+ android: {
+ sanitize: {
+ cfi: true,
+ config: {
+ cfi_assembly_support: true,
+ },
+ },
+ },
},
arch: {
@@ -1144,9 +1183,7 @@ cc_library {
sanitize: {
integer_overflow: true,
misc_undefined: ["bounds"],
- // Enable CFI if this becomes a shared library.
- // cfi: true,
- blacklist: "libvpx_blacklist.txt",
+ blocklist: "libvpx_blocklist.txt",
},
min_sdk_version: "29",
}
diff --git a/Android.bp.in b/Android.bp.in
index 612551c88..8ed278fdb 100644
--- a/Android.bp.in
+++ b/Android.bp.in
@@ -56,7 +56,7 @@ cc_library {
misc_undefined: ["bounds"],
// Enable CFI if this becomes a shared library.
// cfi: true,
- blacklist: "libvpx_blacklist.txt",
+ blocklist: "libvpx_blocklist.txt",
},
}
diff --git a/METADATA b/METADATA
new file mode 100644
index 000000000..d97975ca3
--- /dev/null
+++ b/METADATA
@@ -0,0 +1,3 @@
+third_party {
+ license_type: NOTICE
+}
diff --git a/OWNERS b/OWNERS
index 92de0d772..dbf2c0e2e 100644
--- a/OWNERS
+++ b/OWNERS
@@ -1,5 +1,5 @@
-# Default code reviewers picked from top 3 or more developers.
-# Please update this list if you find better candidates.
+# owners for external/libvpx
+include platform/frameworks/av:/media/janitors/codec_OWNERS
jianj@google.com
marcone@google.com
jzern@google.com
diff --git a/README.version b/README.version
index b36802890..7e8c25da3 100644
--- a/README.version
+++ b/README.version
@@ -10,3 +10,4 @@ Local Modifications:
223645aa8 vpx_codec_enc_config_default: rm unnecessary loop
5e065cf9d vp8/{ratectrl,onyx_if}: fix some signed integer overflows
5eab093a7 vp9_ratectrl: fix some signed integer overflows
+ baefbe85d Cap target bitrate to raw rate internally
diff --git a/libvpx/build/make/Android.mk b/libvpx/build/make/Android.mk
index 6cb3af027..b8032e67a 100644
--- a/libvpx/build/make/Android.mk
+++ b/libvpx/build/make/Android.mk
@@ -166,6 +166,9 @@ LOCAL_CFLAGS += \
-I$(ASM_CNV_PATH)/libvpx
LOCAL_MODULE := libvpx
+LOCAL_LICENSE_KINDS := SPDX-license-identifier-BSD
+LOCAL_LICENSE_CONDITIONS := notice
+LOCAL_NOTICE_FILE := $(LOCAL_PATH)/../../LICENSE $(LOCAL_PATH)/../../PATENTS
ifeq ($(CONFIG_RUNTIME_CPU_DETECT),yes)
LOCAL_STATIC_LIBRARIES := cpufeatures
diff --git a/libvpx/test/android/Android.mk b/libvpx/test/android/Android.mk
index 7318de2fc..9c61ec534 100644
--- a/libvpx/test/android/Android.mk
+++ b/libvpx/test/android/Android.mk
@@ -30,6 +30,9 @@ include $(CLEAR_VARS)
LOCAL_ARM_MODE := arm
LOCAL_CPP_EXTENSION := .cc
LOCAL_MODULE := gtest
+LOCAL_LICENSE_KINDS := SPDX-license-identifier-BSD
+LOCAL_LICENSE_CONDITIONS := notice
+LOCAL_NOTICE_FILE := $(LOCAL_PATH)/../../LICENSE $(LOCAL_PATH)/../../PATENTS
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/
@@ -40,6 +43,9 @@ include $(BUILD_STATIC_LIBRARY)
include $(CLEAR_VARS)
LOCAL_ARM_MODE := arm
LOCAL_MODULE := libvpx_test
+LOCAL_LICENSE_KINDS := SPDX-license-identifier-BSD
+LOCAL_LICENSE_CONDITIONS := notice
+LOCAL_NOTICE_FILE := $(LOCAL_PATH)/../../LICENSE $(LOCAL_PATH)/../../PATENTS
LOCAL_STATIC_LIBRARIES := gtest libwebm
ifeq ($(ENABLE_SHARED),1)
diff --git a/libvpx/test/realtime_test.cc b/libvpx/test/realtime_test.cc
index 63f1ac3c2..6378c9f2b 100644
--- a/libvpx/test/realtime_test.cc
+++ b/libvpx/test/realtime_test.cc
@@ -55,6 +55,14 @@ TEST_P(RealtimeTest, RealtimeFirstPassProducesFrames) {
EXPECT_EQ(kFramesToEncode, frame_packets_);
}
+TEST_P(RealtimeTest, IntegerOverflow) {
+ ::libvpx_test::RandomVideoSource video;
+ video.SetSize(800, 480);
+ video.set_limit(20);
+ cfg_.rc_target_bitrate = 140000000;
+ ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
+}
+
VP8_INSTANTIATE_TEST_CASE(RealtimeTest,
::testing::Values(::libvpx_test::kRealTime));
VP9_INSTANTIATE_TEST_CASE(RealtimeTest,
diff --git a/libvpx/third_party/libwebm/Android.mk b/libvpx/third_party/libwebm/Android.mk
index b46ba101d..72e5583c1 100644
--- a/libvpx/third_party/libwebm/Android.mk
+++ b/libvpx/third_party/libwebm/Android.mk
@@ -2,6 +2,9 @@ LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE:= libwebm
+LOCAL_LICENSE_KINDS:= SPDX-license-identifier-BSD
+LOCAL_LICENSE_CONDITIONS:= notice
+LOCAL_NOTICE_FILE:= $(LOCAL_PATH)/LICENSE.TXT $(LOCAL_PATH)/PATENTS.TXT
LOCAL_CPPFLAGS:=-D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS
LOCAL_CPPFLAGS+=-D__STDC_LIMIT_MACROS -std=c++11
LOCAL_C_INCLUDES:= $(LOCAL_PATH)
diff --git a/libvpx/vp8/encoder/bitstream.c b/libvpx/vp8/encoder/bitstream.c
index 3daa4e2c2..80cbb882f 100644
--- a/libvpx/vp8/encoder/bitstream.c
+++ b/libvpx/vp8/encoder/bitstream.c
@@ -222,7 +222,7 @@ void vp8_pack_tokens(vp8_writer *w, const TOKENEXTRA *p, int xcount) {
validate_buffer(w->buffer + w->pos, 1, w->buffer_end, w->error);
- w->buffer[w->pos++] = (lowvalue >> (24 - offset));
+ w->buffer[w->pos++] = (lowvalue >> (24 - offset)) & 0xff;
lowvalue <<= offset;
shift = count;
lowvalue &= 0xffffff;
diff --git a/libvpx/vp8/encoder/onyx_if.c b/libvpx/vp8/encoder/onyx_if.c
index dccc6ebb1..aeed719d1 100644
--- a/libvpx/vp8/encoder/onyx_if.c
+++ b/libvpx/vp8/encoder/onyx_if.c
@@ -1430,6 +1430,7 @@ void vp8_change_config(VP8_COMP *cpi, VP8_CONFIG *oxcf) {
VP8_COMMON *cm = &cpi->common;
int last_w, last_h;
unsigned int prev_number_of_layers;
+ unsigned int raw_target_rate;
if (!cpi) return;
@@ -1570,6 +1571,10 @@ void vp8_change_config(VP8_COMP *cpi, VP8_CONFIG *oxcf) {
cpi->oxcf.maximum_buffer_size_in_ms = 240000;
}
+ raw_target_rate = (unsigned int)((int64_t)cpi->oxcf.Width * cpi->oxcf.Height *
+ 8 * 3 * cpi->framerate / 1000);
+ if (cpi->oxcf.target_bandwidth > raw_target_rate)
+ cpi->oxcf.target_bandwidth = raw_target_rate;
/* Convert target bandwidth from Kbit/s to Bit/s */
cpi->oxcf.target_bandwidth *= 1000;
@@ -3615,7 +3620,7 @@ static void encode_frame_to_data_rate(VP8_COMP *cpi, size_t *size,
if (cpi->this_key_frame_forced) {
if (cpi->active_best_quality > cpi->avg_frame_qindex * 7 / 8) {
cpi->active_best_quality = cpi->avg_frame_qindex * 7 / 8;
- } else if (cpi->active_best_quality<cpi->avg_frame_qindex>> 2) {
+ } else if (cpi->active_best_quality < (cpi->avg_frame_qindex >> 2)) {
cpi->active_best_quality = cpi->avg_frame_qindex >> 2;
}
}
diff --git a/libvpx/vp9/encoder/vp9_pickmode.c b/libvpx/vp9/encoder/vp9_pickmode.c
index 23c943c21..695fd484f 100644
--- a/libvpx/vp9/encoder/vp9_pickmode.c
+++ b/libvpx/vp9/encoder/vp9_pickmode.c
@@ -1127,7 +1127,7 @@ static INLINE void update_thresh_freq_fact_row_mt(
}
static INLINE void update_thresh_freq_fact(
- VP9_COMP *cpi, TileDataEnc *tile_data, int source_variance,
+ VP9_COMP *cpi, TileDataEnc *tile_data, unsigned int source_variance,
BLOCK_SIZE bsize, MV_REFERENCE_FRAME ref_frame, THR_MODES best_mode_idx,
PREDICTION_MODE mode) {
THR_MODES thr_mode_idx = mode_idx[ref_frame][mode_offset(mode)];
diff --git a/libvpx/vp9/encoder/vp9_ratectrl.c b/libvpx/vp9/encoder/vp9_ratectrl.c
index bbe0faaff..f92860e81 100644
--- a/libvpx/vp9/encoder/vp9_ratectrl.c
+++ b/libvpx/vp9/encoder/vp9_ratectrl.c
@@ -1690,8 +1690,10 @@ void vp9_rc_compute_frame_size_bounds(const VP9_COMP *cpi, int frame_target,
} else {
// For very small rate targets where the fractional adjustment
// may be tiny make sure there is at least a minimum range.
- const int tol_low = (cpi->sf.recode_tolerance_low * frame_target) / 100;
- const int tol_high = (cpi->sf.recode_tolerance_high * frame_target) / 100;
+ const int tol_low =
+ (int)(((int64_t)cpi->sf.recode_tolerance_low * frame_target) / 100);
+ const int tol_high =
+ (int)(((int64_t)cpi->sf.recode_tolerance_high * frame_target) / 100);
*frame_under_shoot_limit = VPXMAX(frame_target - tol_low - 100, 0);
*frame_over_shoot_limit =
VPXMIN(frame_target + tol_high + 100, cpi->rc.max_frame_bandwidth);
diff --git a/libvpx/vp9/vp9_cx_iface.c b/libvpx/vp9/vp9_cx_iface.c
index f415e50f7..1b2824545 100644
--- a/libvpx/vp9/vp9_cx_iface.c
+++ b/libvpx/vp9/vp9_cx_iface.c
@@ -481,10 +481,11 @@ static vpx_rational64_t get_g_timebase_in_ts(vpx_rational_t g_timebase) {
}
static vpx_codec_err_t set_encoder_config(
- VP9EncoderConfig *oxcf, const vpx_codec_enc_cfg_t *cfg,
+ VP9EncoderConfig *oxcf, vpx_codec_enc_cfg_t *cfg,
const struct vp9_extracfg *extra_cfg) {
const int is_vbr = cfg->rc_end_usage == VPX_VBR;
int sl, tl;
+ unsigned int raw_target_rate;
oxcf->profile = cfg->g_profile;
oxcf->max_threads = (int)cfg->g_threads;
oxcf->width = cfg->g_w;
@@ -511,8 +512,14 @@ static vpx_codec_err_t set_encoder_config(
cfg->g_pass == VPX_RC_FIRST_PASS ? 0 : cfg->g_lag_in_frames;
oxcf->rc_mode = cfg->rc_end_usage;
+ raw_target_rate =
+ (unsigned int)((int64_t)oxcf->width * oxcf->height * oxcf->bit_depth * 3 *
+ oxcf->init_framerate / 1000);
+ // Cap target bitrate to raw rate
+ cfg->rc_target_bitrate = VPXMIN(raw_target_rate, cfg->rc_target_bitrate);
+
// Convert target bandwidth from Kbit/s to Bit/s
- oxcf->target_bandwidth = 1000 * cfg->rc_target_bitrate;
+ oxcf->target_bandwidth = 1000 * (int64_t)cfg->rc_target_bitrate;
oxcf->rc_max_intra_bitrate_pct = extra_cfg->rc_max_intra_bitrate_pct;
oxcf->rc_max_inter_bitrate_pct = extra_cfg->rc_max_inter_bitrate_pct;
oxcf->gf_cbr_boost_pct = extra_cfg->gf_cbr_boost_pct;
diff --git a/libvpx_blacklist.txt b/libvpx_blocklist.txt
index df3e36c1d..c9ea142e3 100644
--- a/libvpx_blacklist.txt
+++ b/libvpx_blocklist.txt
@@ -1,6 +1,3 @@
-[cfi]
-src:*external/libvpx/*
-
[integer]
# Performance related
fun:read_bool
diff --git a/libwebm/Android.bp b/libwebm/Android.bp
index 6141b100f..f33f16e63 100644
--- a/libwebm/Android.bp
+++ b/libwebm/Android.bp
@@ -1,3 +1,12 @@
+package {
+ // See: http://go/android-license-faq
+ // A large-scale-change added 'default_applicable_licenses' to import
+ // all of the 'license_kinds' from "external_libvpx_license"
+ // to get the below license kinds:
+ // SPDX-license-identifier-BSD
+ default_applicable_licenses: ["external_libvpx_license"],
+}
+
cc_library_static {
name: "libwebm",
srcs: ["mkvparser/mkvparser.cc"],
@@ -11,4 +20,10 @@ cc_library_static {
// cfi: true,
},
min_sdk_version: "29",
+ host_supported: true,
+ target: {
+ darwin: {
+ enabled: false,
+ },
+ },
}
diff --git a/libwebm/README.android b/libwebm/README.android
index c55bd748f..e89a0ffc2 100644
--- a/libwebm/README.android
+++ b/libwebm/README.android
@@ -1,7 +1,7 @@
Name: libwebm
URL: http://www.webmproject.org
-Commit: 81de00c43ea3c087b48a8c20337db7531b9f7612
+Commit: 11cae244cc06c1295bffa9861c610dcde3b9da18
Description:
Contains the sources used to compile libwebm's matroska parser.
diff --git a/libwebm/mkvparser/mkvparser.cc b/libwebm/mkvparser/mkvparser.cc
index ace65bd59..412e6a52c 100644
--- a/libwebm/mkvparser/mkvparser.cc
+++ b/libwebm/mkvparser/mkvparser.cc
@@ -5229,6 +5229,8 @@ bool Projection::Parse(IMkvReader* reader, long long start, long long size,
projection_ptr->type = static_cast<ProjectionType>(projection_type);
} else if (child_id == libwebm::kMkvProjectionPrivate) {
+ if (projection_ptr->private_data != NULL)
+ return false;
unsigned char* data = SafeArrayAlloc<unsigned char>(1, child_size);
if (data == NULL)
@@ -5286,6 +5288,7 @@ VideoTrack::VideoTrack(Segment* pSegment, long long element_start,
m_projection(NULL) {}
VideoTrack::~VideoTrack() {
+ delete[] m_colour_space;
delete m_colour;
delete m_projection;
}
@@ -5307,7 +5310,7 @@ long VideoTrack::Parse(Segment* pSegment, const Info& info,
long long stereo_mode = 0;
double rate = 0.0;
- char* colour_space = NULL;
+ std::unique_ptr<char[]> colour_space_ptr;
IMkvReader* const pReader = pSegment->m_pReader;
@@ -5384,9 +5387,11 @@ long VideoTrack::Parse(Segment* pSegment, const Info& info,
projection_ptr.reset(projection);
}
} else if (id == libwebm::kMkvColourSpace) {
+ char* colour_space = NULL;
const long status = UnserializeString(pReader, pos, size, colour_space);
if (status < 0)
return status;
+ colour_space_ptr.reset(colour_space);
}
pos += size; // consume payload
@@ -5418,7 +5423,7 @@ long VideoTrack::Parse(Segment* pSegment, const Info& info,
pTrack->m_stereo_mode = stereo_mode;
pTrack->m_rate = rate;
pTrack->m_colour = colour_ptr.release();
- pTrack->m_colour_space = colour_space;
+ pTrack->m_colour_space = colour_space_ptr.release();
pTrack->m_projection = projection_ptr.release();
pResult = pTrack;