зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1860623 - Update libvpx to b759032a0ed2b57ea3412f6820eda377a2dad480 r=webrtc-reviewers,ng
This patch updates libvpx by two steps: 1. ./mach vendor media/libvpx/moz.yaml --patch-mode=none 2. ./mach vendor media/libvpx/moz.yaml --patch-mode=only The first step pulls the upstream repo files to gecko, and the second step applies the local patches. Differential Revision: https://phabricator.services.mozilla.com/D192108
This commit is contained in:
Родитель
a10a5ff60a
Коммит
bf30345a7b
|
@ -12,6 +12,7 @@
|
|||
.equ HAVE_NEON , 0
|
||||
.equ HAVE_NEON_DOTPROD , 0
|
||||
.equ HAVE_NEON_I8MM , 0
|
||||
.equ HAVE_SVE , 0
|
||||
.equ HAVE_MIPS32 , 0
|
||||
.equ HAVE_DSPR2 , 0
|
||||
.equ HAVE_MSA , 0
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
#define HAVE_NEON 0
|
||||
#define HAVE_NEON_DOTPROD 0
|
||||
#define HAVE_NEON_I8MM 0
|
||||
#define HAVE_SVE 0
|
||||
#define HAVE_MIPS32 0
|
||||
#define HAVE_DSPR2 0
|
||||
#define HAVE_MSA 0
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
.equ HAVE_NEON , 1
|
||||
.equ HAVE_NEON_DOTPROD , 0
|
||||
.equ HAVE_NEON_I8MM , 0
|
||||
.equ HAVE_SVE , 0
|
||||
.equ HAVE_MIPS32 , 0
|
||||
.equ HAVE_DSPR2 , 0
|
||||
.equ HAVE_MSA , 0
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
#define HAVE_NEON 1
|
||||
#define HAVE_NEON_DOTPROD 0
|
||||
#define HAVE_NEON_I8MM 0
|
||||
#define HAVE_SVE 0
|
||||
#define HAVE_MIPS32 0
|
||||
#define HAVE_DSPR2 0
|
||||
#define HAVE_MSA 0
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
.equ HAVE_NEON , 1
|
||||
.equ HAVE_NEON_DOTPROD , 1
|
||||
.equ HAVE_NEON_I8MM , 1
|
||||
.equ HAVE_SVE , 1
|
||||
.equ HAVE_MIPS32 , 0
|
||||
.equ HAVE_DSPR2 , 0
|
||||
.equ HAVE_MSA , 0
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
#define HAVE_NEON 1
|
||||
#define HAVE_NEON_DOTPROD 1
|
||||
#define HAVE_NEON_I8MM 1
|
||||
#define HAVE_SVE 1
|
||||
#define HAVE_MIPS32 0
|
||||
#define HAVE_DSPR2 0
|
||||
#define HAVE_MSA 0
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
%define HAVE_NEON 0
|
||||
%define HAVE_NEON_DOTPROD 0
|
||||
%define HAVE_NEON_I8MM 0
|
||||
%define HAVE_SVE 0
|
||||
%define HAVE_MIPS32 0
|
||||
%define HAVE_DSPR2 0
|
||||
%define HAVE_MSA 0
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
#define HAVE_NEON 0
|
||||
#define HAVE_NEON_DOTPROD 0
|
||||
#define HAVE_NEON_I8MM 0
|
||||
#define HAVE_SVE 0
|
||||
#define HAVE_MIPS32 0
|
||||
#define HAVE_DSPR2 0
|
||||
#define HAVE_MSA 0
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
%define HAVE_NEON 0
|
||||
%define HAVE_NEON_DOTPROD 0
|
||||
%define HAVE_NEON_I8MM 0
|
||||
%define HAVE_SVE 0
|
||||
%define HAVE_MIPS32 0
|
||||
%define HAVE_DSPR2 0
|
||||
%define HAVE_MSA 0
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
#define HAVE_NEON 0
|
||||
#define HAVE_NEON_DOTPROD 0
|
||||
#define HAVE_NEON_I8MM 0
|
||||
#define HAVE_SVE 0
|
||||
#define HAVE_MIPS32 0
|
||||
#define HAVE_DSPR2 0
|
||||
#define HAVE_MSA 0
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
%define HAVE_NEON 0
|
||||
%define HAVE_NEON_DOTPROD 0
|
||||
%define HAVE_NEON_I8MM 0
|
||||
%define HAVE_SVE 0
|
||||
%define HAVE_MIPS32 0
|
||||
%define HAVE_DSPR2 0
|
||||
%define HAVE_MSA 0
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
#define HAVE_NEON 0
|
||||
#define HAVE_NEON_DOTPROD 0
|
||||
#define HAVE_NEON_I8MM 0
|
||||
#define HAVE_SVE 0
|
||||
#define HAVE_MIPS32 0
|
||||
#define HAVE_DSPR2 0
|
||||
#define HAVE_MSA 0
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
%define HAVE_NEON 0
|
||||
%define HAVE_NEON_DOTPROD 0
|
||||
%define HAVE_NEON_I8MM 0
|
||||
%define HAVE_SVE 0
|
||||
%define HAVE_MIPS32 0
|
||||
%define HAVE_DSPR2 0
|
||||
%define HAVE_MSA 0
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
#define HAVE_NEON 0
|
||||
#define HAVE_NEON_DOTPROD 0
|
||||
#define HAVE_NEON_I8MM 0
|
||||
#define HAVE_SVE 0
|
||||
#define HAVE_MIPS32 0
|
||||
#define HAVE_DSPR2 0
|
||||
#define HAVE_MSA 0
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
.equ HAVE_NEON , 1
|
||||
.equ HAVE_NEON_DOTPROD , 1
|
||||
.equ HAVE_NEON_I8MM , 1
|
||||
.equ HAVE_SVE , 1
|
||||
.equ HAVE_MIPS32 , 0
|
||||
.equ HAVE_DSPR2 , 0
|
||||
.equ HAVE_MSA , 0
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
#define HAVE_NEON 1
|
||||
#define HAVE_NEON_DOTPROD 1
|
||||
#define HAVE_NEON_I8MM 1
|
||||
#define HAVE_SVE 1
|
||||
#define HAVE_MIPS32 0
|
||||
#define HAVE_DSPR2 0
|
||||
#define HAVE_MSA 0
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
%define HAVE_NEON 0
|
||||
%define HAVE_NEON_DOTPROD 0
|
||||
%define HAVE_NEON_I8MM 0
|
||||
%define HAVE_SVE 0
|
||||
%define HAVE_MIPS32 0
|
||||
%define HAVE_DSPR2 0
|
||||
%define HAVE_MSA 0
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
#define HAVE_NEON 0
|
||||
#define HAVE_NEON_DOTPROD 0
|
||||
#define HAVE_NEON_I8MM 0
|
||||
#define HAVE_SVE 0
|
||||
#define HAVE_MIPS32 0
|
||||
#define HAVE_DSPR2 0
|
||||
#define HAVE_MSA 0
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
%define HAVE_NEON 0
|
||||
%define HAVE_NEON_DOTPROD 0
|
||||
%define HAVE_NEON_I8MM 0
|
||||
%define HAVE_SVE 0
|
||||
%define HAVE_MIPS32 0
|
||||
%define HAVE_DSPR2 0
|
||||
%define HAVE_MSA 0
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
#define HAVE_NEON 0
|
||||
#define HAVE_NEON_DOTPROD 0
|
||||
#define HAVE_NEON_I8MM 0
|
||||
#define HAVE_SVE 0
|
||||
#define HAVE_MIPS32 0
|
||||
#define HAVE_DSPR2 0
|
||||
#define HAVE_MSA 0
|
||||
|
|
|
@ -148,6 +148,8 @@ $(BUILD_PFX)%_neon_dotprod.c.d: CFLAGS += -march=armv8.2-a+dotprod
|
|||
$(BUILD_PFX)%_neon_dotprod.c.o: CFLAGS += -march=armv8.2-a+dotprod
|
||||
$(BUILD_PFX)%_neon_i8mm.c.d: CFLAGS += -march=armv8.2-a+dotprod+i8mm
|
||||
$(BUILD_PFX)%_neon_i8mm.c.o: CFLAGS += -march=armv8.2-a+dotprod+i8mm
|
||||
$(BUILD_PFX)%_sve.c.d: CFLAGS += -march=armv8.2-a+dotprod+i8mm+sve
|
||||
$(BUILD_PFX)%_sve.c.o: CFLAGS += -march=armv8.2-a+dotprod+i8mm+sve
|
||||
|
||||
# POWER
|
||||
$(BUILD_PFX)%_vsx.c.d: CFLAGS += -maltivec -mvsx
|
||||
|
|
|
@ -487,7 +487,7 @@ if ($opts{arch} eq 'x86') {
|
|||
@ALL_ARCHS = filter(qw/neon_asm neon/);
|
||||
arm;
|
||||
} elsif ($opts{arch} eq 'armv8' || $opts{arch} eq 'arm64' ) {
|
||||
@ALL_ARCHS = filter(qw/neon neon_dotprod neon_i8mm/);
|
||||
@ALL_ARCHS = filter(qw/neon neon_dotprod neon_i8mm sve/);
|
||||
@REQUIRES = filter(qw/neon/);
|
||||
&require(@REQUIRES);
|
||||
arm;
|
||||
|
|
|
@ -257,6 +257,7 @@ ARCH_EXT_LIST_AARCH64="
|
|||
neon
|
||||
neon_dotprod
|
||||
neon_i8mm
|
||||
sve
|
||||
"
|
||||
|
||||
ARCH_EXT_LIST_X86="
|
||||
|
|
|
@ -409,6 +409,34 @@ TEST(EncodeAPI, ConfigResizeChangeThreadCount) {
|
|||
}
|
||||
|
||||
#if CONFIG_VP9_ENCODER
|
||||
// Frame size needed to trigger the overflow exceeds the max buffer allowed on
|
||||
// 32-bit systems defined by VPX_MAX_ALLOCABLE_MEMORY
|
||||
#if VPX_ARCH_X86_64 || VPX_ARCH_AARCH64
|
||||
TEST(EncodeAPI, ConfigLargeTargetBitrateVp9) {
|
||||
constexpr int kWidth = 12383;
|
||||
constexpr int kHeight = 8192;
|
||||
constexpr auto *iface = &vpx_codec_vp9_cx_algo;
|
||||
SCOPED_TRACE(vpx_codec_iface_name(iface));
|
||||
vpx_codec_enc_cfg_t cfg = {};
|
||||
struct Encoder {
|
||||
~Encoder() { EXPECT_EQ(vpx_codec_destroy(&ctx), VPX_CODEC_OK); }
|
||||
vpx_codec_ctx_t ctx = {};
|
||||
} enc;
|
||||
|
||||
ASSERT_EQ(vpx_codec_enc_config_default(iface, &cfg, 0), VPX_CODEC_OK);
|
||||
// The following setting will cause avg_frame_bandwidth in rate control to be
|
||||
// larger than INT_MAX
|
||||
cfg.rc_target_bitrate = INT_MAX;
|
||||
// Framerate 0.1 (equivalent to timebase 10) is the smallest framerate allowed
|
||||
// by libvpx
|
||||
cfg.g_timebase.den = 1;
|
||||
cfg.g_timebase.num = 10;
|
||||
EXPECT_NO_FATAL_FAILURE(InitCodec(*iface, kWidth, kHeight, &enc.ctx, &cfg))
|
||||
<< "target bitrate: " << cfg.rc_target_bitrate << " framerate: "
|
||||
<< static_cast<double>(cfg.g_timebase.den) / cfg.g_timebase.num;
|
||||
}
|
||||
#endif // VPX_ARCH_X86_64 || VPX_ARCH_AARCH64
|
||||
|
||||
class EncodeApiGetTplStatsTest
|
||||
: public ::libvpx_test::EncoderTest,
|
||||
public ::testing::TestWithParam<const libvpx_test::CodecFactory *> {
|
||||
|
|
|
@ -10,9 +10,14 @@
|
|||
|
||||
#include "test/init_vpx_test.h"
|
||||
|
||||
#include "./vpx_config.h"
|
||||
|
||||
#if !CONFIG_SHARED
|
||||
#include <string>
|
||||
#include "third_party/googletest/src/include/gtest/gtest.h"
|
||||
#include "./vpx_config.h"
|
||||
#if VPX_ARCH_ARM
|
||||
#include "vpx_ports/arm.h"
|
||||
#endif
|
||||
#if VPX_ARCH_X86 || VPX_ARCH_X86_64
|
||||
#include "vpx_ports/x86.h"
|
||||
#endif
|
||||
|
@ -27,7 +32,7 @@ extern void vpx_dsp_rtcd();
|
|||
extern void vpx_scale_rtcd();
|
||||
}
|
||||
|
||||
#if VPX_ARCH_X86 || VPX_ARCH_X86_64
|
||||
#if VPX_ARCH_ARM || VPX_ARCH_X86 || VPX_ARCH_X86_64
|
||||
static void append_negative_gtest_filter(const char *str) {
|
||||
std::string filter = GTEST_FLAG_GET(filter);
|
||||
// Negative patterns begin with one '-' followed by a ':' separated list.
|
||||
|
@ -35,10 +40,28 @@ static void append_negative_gtest_filter(const char *str) {
|
|||
filter += str;
|
||||
GTEST_FLAG_SET(filter, filter);
|
||||
}
|
||||
#endif // VPX_ARCH_X86 || VPX_ARCH_X86_64
|
||||
#endif // VPX_ARCH_ARM || VPX_ARCH_X86 || VPX_ARCH_X86_64
|
||||
#endif // !CONFIG_SHARED
|
||||
|
||||
namespace libvpx_test {
|
||||
void init_vpx_test() {
|
||||
#if !CONFIG_SHARED
|
||||
#if VPX_ARCH_AARCH64
|
||||
const int caps = arm_cpu_caps();
|
||||
if (!(caps & HAS_NEON_DOTPROD)) {
|
||||
append_negative_gtest_filter(":NEON_DOTPROD.*:NEON_DOTPROD/*");
|
||||
}
|
||||
if (!(caps & HAS_NEON_I8MM)) {
|
||||
append_negative_gtest_filter(":NEON_I8MM.*:NEON_I8MM/*");
|
||||
}
|
||||
if (!(caps & HAS_SVE)) {
|
||||
append_negative_gtest_filter(":SVE.*:SVE/*");
|
||||
}
|
||||
#elif VPX_ARCH_ARM
|
||||
const int caps = arm_cpu_caps();
|
||||
if (!(caps & HAS_NEON)) append_negative_gtest_filter(":NEON.*:NEON/*");
|
||||
#endif // VPX_ARCH_ARM
|
||||
|
||||
#if VPX_ARCH_X86 || VPX_ARCH_X86_64
|
||||
const int simd_caps = x86_simd_caps();
|
||||
if (!(simd_caps & HAS_MMX)) append_negative_gtest_filter(":MMX.*:MMX/*");
|
||||
|
@ -58,9 +81,8 @@ void init_vpx_test() {
|
|||
}
|
||||
#endif // VPX_ARCH_X86 || VPX_ARCH_X86_64
|
||||
|
||||
#if !CONFIG_SHARED
|
||||
// Shared library builds don't support whitebox tests
|
||||
// that exercise internal symbols.
|
||||
// Shared library builds don't support whitebox tests that exercise internal
|
||||
// symbols.
|
||||
#if CONFIG_VP8
|
||||
vp8_rtcd();
|
||||
#endif // CONFIG_VP8
|
||||
|
|
|
@ -95,7 +95,7 @@ TEST_P(RealtimeTest, IntegerOverflow) { TestIntegerOverflow(2048, 2048); }
|
|||
|
||||
TEST_P(RealtimeTest, IntegerOverflowLarge) {
|
||||
if (IsVP9()) {
|
||||
#if VPX_ARCH_X86_64
|
||||
#if VPX_ARCH_AARCH64 || VPX_ARCH_X86_64
|
||||
TestIntegerOverflow(16384, 16384);
|
||||
#else
|
||||
TestIntegerOverflow(4096, 4096);
|
||||
|
|
|
@ -240,7 +240,7 @@ struct VP8_COMP *vp8_create_compressor(VP8_CONFIG *oxcf);
|
|||
void vp8_remove_compressor(struct VP8_COMP **comp);
|
||||
|
||||
void vp8_init_config(struct VP8_COMP *onyx, VP8_CONFIG *oxcf);
|
||||
void vp8_change_config(struct VP8_COMP *cpi, VP8_CONFIG *oxcf);
|
||||
void vp8_change_config(struct VP8_COMP *cpi, const VP8_CONFIG *oxcf);
|
||||
|
||||
int vp8_receive_raw_frame(struct VP8_COMP *cpi, unsigned int frame_flags,
|
||||
YV12_BUFFER_CONFIG *sd, int64_t time_stamp,
|
||||
|
|
|
@ -7,6 +7,8 @@
|
|||
* in the file PATENTS. All contributing project authors may
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
#include <stdio.h>
|
||||
#include <limits.h>
|
||||
|
||||
#include "vpx_config.h"
|
||||
#include "vp8_rtcd.h"
|
||||
|
@ -29,9 +31,9 @@
|
|||
#include "rdopt.h"
|
||||
#include "pickinter.h"
|
||||
#include "vp8/common/findnearmv.h"
|
||||
#include <stdio.h>
|
||||
#include <limits.h>
|
||||
#include "vp8/common/invtrans.h"
|
||||
#include "vpx/internal/vpx_codec_internal.h"
|
||||
#include "vpx_mem/vpx_mem.h"
|
||||
#include "vpx_ports/vpx_timer.h"
|
||||
#if CONFIG_REALTIME_ONLY & CONFIG_ONTHEFLY_BITPACKING
|
||||
#include "bitstream.h"
|
||||
|
@ -750,6 +752,15 @@ void vp8_encode_frame(VP8_COMP *cpi) {
|
|||
vp8cx_init_mbrthread_data(cpi, x, cpi->mb_row_ei,
|
||||
cpi->encoding_thread_count);
|
||||
|
||||
if (cpi->mt_current_mb_col_size != cm->mb_rows) {
|
||||
vpx_free(cpi->mt_current_mb_col);
|
||||
cpi->mt_current_mb_col = NULL;
|
||||
cpi->mt_current_mb_col_size = 0;
|
||||
CHECK_MEM_ERROR(
|
||||
&cpi->common.error, cpi->mt_current_mb_col,
|
||||
vpx_malloc(sizeof(*cpi->mt_current_mb_col) * cm->mb_rows));
|
||||
cpi->mt_current_mb_col_size = cm->mb_rows;
|
||||
}
|
||||
for (i = 0; i < cm->mb_rows; ++i)
|
||||
vpx_atomic_store_release(&cpi->mt_current_mb_col[i], -1);
|
||||
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
* in the file PATENTS. All contributing project authors may
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
#include <stddef.h>
|
||||
|
||||
#include "onyx_int.h"
|
||||
#include "vp8/common/threading.h"
|
||||
|
@ -487,15 +488,10 @@ void vp8cx_init_mbrthread_data(VP8_COMP *cpi, MACROBLOCK *x,
|
|||
|
||||
int vp8cx_create_encoder_threads(VP8_COMP *cpi) {
|
||||
const VP8_COMMON *cm = &cpi->common;
|
||||
|
||||
vpx_atomic_init(&cpi->b_multi_threaded, 0);
|
||||
cpi->encoding_thread_count = 0;
|
||||
cpi->b_lpf_running = 0;
|
||||
int th_count = 0;
|
||||
|
||||
if (cm->processor_core_count > 1 && cpi->oxcf.multi_threaded > 1) {
|
||||
int ithread;
|
||||
int th_count = cpi->oxcf.multi_threaded - 1;
|
||||
int rc = 0;
|
||||
th_count = cpi->oxcf.multi_threaded - 1;
|
||||
|
||||
/* don't allocate more threads than cores available */
|
||||
if (cpi->oxcf.multi_threaded > cm->processor_core_count) {
|
||||
|
@ -507,8 +503,13 @@ int vp8cx_create_encoder_threads(VP8_COMP *cpi) {
|
|||
if (th_count > ((cm->mb_cols / cpi->mt_sync_range) - 1)) {
|
||||
th_count = (cm->mb_cols / cpi->mt_sync_range) - 1;
|
||||
}
|
||||
}
|
||||
if (th_count == cpi->encoding_thread_count) return 0;
|
||||
|
||||
if (th_count == 0) return 0;
|
||||
vp8cx_remove_encoder_threads(cpi);
|
||||
if (th_count != 0) {
|
||||
int ithread;
|
||||
int rc = 0;
|
||||
|
||||
CHECK_MEM_ERROR(&cpi->common.error, cpi->h_encoding_thread,
|
||||
vpx_malloc(sizeof(pthread_t) * th_count));
|
||||
|
@ -553,6 +554,8 @@ int vp8cx_create_encoder_threads(VP8_COMP *cpi) {
|
|||
/* shutdown other threads */
|
||||
vpx_atomic_store_release(&cpi->b_multi_threaded, 0);
|
||||
for (--ithread; ithread >= 0; ithread--) {
|
||||
sem_post(&cpi->h_event_start_encoding[ithread]);
|
||||
sem_post(&cpi->h_event_end_encoding[ithread]);
|
||||
pthread_join(cpi->h_encoding_thread[ithread], 0);
|
||||
sem_destroy(&cpi->h_event_start_encoding[ithread]);
|
||||
sem_destroy(&cpi->h_event_end_encoding[ithread]);
|
||||
|
@ -560,10 +563,16 @@ int vp8cx_create_encoder_threads(VP8_COMP *cpi) {
|
|||
|
||||
/* free thread related resources */
|
||||
vpx_free(cpi->h_event_start_encoding);
|
||||
cpi->h_event_start_encoding = NULL;
|
||||
vpx_free(cpi->h_event_end_encoding);
|
||||
cpi->h_event_end_encoding = NULL;
|
||||
vpx_free(cpi->h_encoding_thread);
|
||||
cpi->h_encoding_thread = NULL;
|
||||
vpx_free(cpi->mb_row_ei);
|
||||
cpi->mb_row_ei = NULL;
|
||||
vpx_free(cpi->en_thread_data);
|
||||
cpi->en_thread_data = NULL;
|
||||
cpi->encoding_thread_count = 0;
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
@ -592,10 +601,16 @@ int vp8cx_create_encoder_threads(VP8_COMP *cpi) {
|
|||
|
||||
/* free thread related resources */
|
||||
vpx_free(cpi->h_event_start_encoding);
|
||||
cpi->h_event_start_encoding = NULL;
|
||||
vpx_free(cpi->h_event_end_encoding);
|
||||
cpi->h_event_end_encoding = NULL;
|
||||
vpx_free(cpi->h_encoding_thread);
|
||||
cpi->h_encoding_thread = NULL;
|
||||
vpx_free(cpi->mb_row_ei);
|
||||
cpi->mb_row_ei = NULL;
|
||||
vpx_free(cpi->en_thread_data);
|
||||
cpi->en_thread_data = NULL;
|
||||
cpi->encoding_thread_count = 0;
|
||||
|
||||
return -2;
|
||||
}
|
||||
|
@ -627,13 +642,23 @@ void vp8cx_remove_encoder_threads(VP8_COMP *cpi) {
|
|||
|
||||
sem_destroy(&cpi->h_event_end_lpf);
|
||||
sem_destroy(&cpi->h_event_start_lpf);
|
||||
cpi->b_lpf_running = 0;
|
||||
|
||||
/* free thread related resources */
|
||||
vpx_free(cpi->mt_current_mb_col);
|
||||
cpi->mt_current_mb_col = NULL;
|
||||
cpi->mt_current_mb_col_size = 0;
|
||||
vpx_free(cpi->h_event_start_encoding);
|
||||
cpi->h_event_start_encoding = NULL;
|
||||
vpx_free(cpi->h_event_end_encoding);
|
||||
cpi->h_event_end_encoding = NULL;
|
||||
vpx_free(cpi->h_encoding_thread);
|
||||
cpi->h_encoding_thread = NULL;
|
||||
vpx_free(cpi->mb_row_ei);
|
||||
cpi->mb_row_ei = NULL;
|
||||
vpx_free(cpi->en_thread_data);
|
||||
cpi->en_thread_data = NULL;
|
||||
cpi->encoding_thread_count = 0;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -1123,8 +1123,8 @@ int vp8_diamond_search_sad_c(MACROBLOCK *x, BLOCK *b, BLOCKD *d, int_mv *ref_mv,
|
|||
}
|
||||
}
|
||||
|
||||
this_mv.as_mv.row = best_mv->as_mv.row << 3;
|
||||
this_mv.as_mv.col = best_mv->as_mv.col << 3;
|
||||
this_mv.as_mv.row = best_mv->as_mv.row * 8;
|
||||
this_mv.as_mv.col = best_mv->as_mv.col * 8;
|
||||
|
||||
return fn_ptr->vf(what, what_stride, best_address, in_what_stride, &thissad) +
|
||||
mv_err_cost(&this_mv, center_mv, mvcost, x->errorperbit);
|
||||
|
@ -1441,8 +1441,8 @@ int vp8_refining_search_sad_c(MACROBLOCK *x, BLOCK *b, BLOCKD *d,
|
|||
}
|
||||
}
|
||||
|
||||
this_mv.as_mv.row = ref_mv->as_mv.row << 3;
|
||||
this_mv.as_mv.col = ref_mv->as_mv.col << 3;
|
||||
this_mv.as_mv.row = ref_mv->as_mv.row * 8;
|
||||
this_mv.as_mv.col = ref_mv->as_mv.col * 8;
|
||||
|
||||
return fn_ptr->vf(what, what_stride, best_address, in_what_stride, &thissad) +
|
||||
mv_err_cost(&this_mv, center_mv, mvcost, x->errorperbit);
|
||||
|
|
|
@ -270,7 +270,7 @@ static int rescale(int val, int num, int denom) {
|
|||
return (int)(llval * llnum / llden);
|
||||
}
|
||||
|
||||
void vp8_init_temporal_layer_context(VP8_COMP *cpi, VP8_CONFIG *oxcf,
|
||||
void vp8_init_temporal_layer_context(VP8_COMP *cpi, const VP8_CONFIG *oxcf,
|
||||
const int layer,
|
||||
double prev_layer_framerate) {
|
||||
LAYER_CONTEXT *lc = &cpi->layer_context[layer];
|
||||
|
@ -328,7 +328,7 @@ void vp8_init_temporal_layer_context(VP8_COMP *cpi, VP8_CONFIG *oxcf,
|
|||
// for any "new" layers. For "existing" layers, let them inherit the parameters
|
||||
// from the previous layer state (at the same layer #). In future we may want
|
||||
// to better map the previous layer state(s) to the "new" ones.
|
||||
void vp8_reset_temporal_layer_change(VP8_COMP *cpi, VP8_CONFIG *oxcf,
|
||||
void vp8_reset_temporal_layer_change(VP8_COMP *cpi, const VP8_CONFIG *oxcf,
|
||||
const int prev_num_layers) {
|
||||
int i;
|
||||
double prev_layer_framerate = 0;
|
||||
|
@ -442,11 +442,6 @@ static void dealloc_compressor_data(VP8_COMP *cpi) {
|
|||
|
||||
vpx_free(cpi->mb.pip);
|
||||
cpi->mb.pip = 0;
|
||||
|
||||
#if CONFIG_MULTITHREAD
|
||||
vpx_free(cpi->mt_current_mb_col);
|
||||
cpi->mt_current_mb_col = NULL;
|
||||
#endif
|
||||
}
|
||||
|
||||
static void enable_segmentation(VP8_COMP *cpi) {
|
||||
|
@ -1224,17 +1219,6 @@ void vp8_alloc_compressor_data(VP8_COMP *cpi) {
|
|||
} else {
|
||||
cpi->mt_sync_range = 16;
|
||||
}
|
||||
|
||||
if (cpi->oxcf.multi_threaded > 1) {
|
||||
int i;
|
||||
|
||||
vpx_free(cpi->mt_current_mb_col);
|
||||
CHECK_MEM_ERROR(&cpi->common.error, cpi->mt_current_mb_col,
|
||||
vpx_malloc(sizeof(*cpi->mt_current_mb_col) * cm->mb_rows));
|
||||
for (i = 0; i < cm->mb_rows; ++i)
|
||||
vpx_atomic_init(&cpi->mt_current_mb_col[i], 0);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
vpx_free(cpi->tplist);
|
||||
|
@ -1428,7 +1412,7 @@ void vp8_update_layer_contexts(VP8_COMP *cpi) {
|
|||
}
|
||||
}
|
||||
|
||||
void vp8_change_config(VP8_COMP *cpi, VP8_CONFIG *oxcf) {
|
||||
void vp8_change_config(VP8_COMP *cpi, const VP8_CONFIG *oxcf) {
|
||||
VP8_COMMON *cm = &cpi->common;
|
||||
int last_w, last_h;
|
||||
unsigned int prev_number_of_layers;
|
||||
|
@ -1447,11 +1431,6 @@ void vp8_change_config(VP8_COMP *cpi, VP8_CONFIG *oxcf) {
|
|||
last_h = cpi->oxcf.Height;
|
||||
prev_number_of_layers = cpi->oxcf.number_of_layers;
|
||||
|
||||
if (cpi->initial_width) {
|
||||
// TODO(https://crbug.com/1486441): Allow changing thread counts; the
|
||||
// allocation is done once in vp8_create_compressor().
|
||||
oxcf->multi_threaded = cpi->oxcf.multi_threaded;
|
||||
}
|
||||
cpi->oxcf = *oxcf;
|
||||
|
||||
switch (cpi->oxcf.Mode) {
|
||||
|
|
|
@ -526,6 +526,7 @@ typedef struct VP8_COMP {
|
|||
#if CONFIG_MULTITHREAD
|
||||
/* multithread data */
|
||||
vpx_atomic_int *mt_current_mb_col;
|
||||
int mt_current_mb_col_size;
|
||||
int mt_sync_range;
|
||||
vpx_atomic_int b_multi_threaded;
|
||||
int encoding_thread_count;
|
||||
|
@ -713,9 +714,9 @@ void vp8_initialize_enc(void);
|
|||
|
||||
void vp8_alloc_compressor_data(VP8_COMP *cpi);
|
||||
int vp8_reverse_trans(int x);
|
||||
void vp8_reset_temporal_layer_change(VP8_COMP *cpi, VP8_CONFIG *oxcf,
|
||||
void vp8_reset_temporal_layer_change(VP8_COMP *cpi, const VP8_CONFIG *oxcf,
|
||||
const int prev_num_layers);
|
||||
void vp8_init_temporal_layer_context(VP8_COMP *cpi, VP8_CONFIG *oxcf,
|
||||
void vp8_init_temporal_layer_context(VP8_COMP *cpi, const VP8_CONFIG *oxcf,
|
||||
const int layer,
|
||||
double prev_layer_framerate);
|
||||
void vp8_update_layer_contexts(VP8_COMP *cpi);
|
||||
|
|
|
@ -19,6 +19,9 @@
|
|||
#include "vpx_ports/static_assert.h"
|
||||
#include "vpx_ports/system_state.h"
|
||||
#include "vpx_util/vpx_timestamp.h"
|
||||
#if CONFIG_MULTITHREAD
|
||||
#include "vp8/encoder/ethreading.h"
|
||||
#endif
|
||||
#include "vp8/encoder/onyx_int.h"
|
||||
#include "vpx/vp8cx.h"
|
||||
#include "vp8/encoder/firstpass.h"
|
||||
|
@ -488,6 +491,9 @@ static vpx_codec_err_t vp8e_set_config(vpx_codec_alg_priv_t *ctx,
|
|||
ctx->cfg = *cfg;
|
||||
set_vp8e_config(&ctx->oxcf, ctx->cfg, ctx->vp8_cfg, NULL);
|
||||
vp8_change_config(ctx->cpi, &ctx->oxcf);
|
||||
#if CONFIG_MULTITHREAD
|
||||
if (vp8cx_create_encoder_threads(ctx->cpi)) return VPX_CODEC_ERROR;
|
||||
#endif
|
||||
ctx->cpi->common.error.setjmp = 0;
|
||||
return VPX_CODEC_OK;
|
||||
}
|
||||
|
|
|
@ -4419,6 +4419,19 @@ static int rd_pick_partition(VP9_COMP *cpi, ThreadData *td,
|
|||
restore_context(x, mi_row, mi_col, a, l, sa, sl, bsize);
|
||||
}
|
||||
|
||||
if (bsize == BLOCK_64X64 && best_rdc.rdcost == INT64_MAX) {
|
||||
vp9_rd_cost_reset(&this_rdc);
|
||||
rd_pick_sb_modes(cpi, tile_data, x, mi_row, mi_col, &this_rdc, BLOCK_64X64,
|
||||
ctx, INT_MAX, INT64_MAX);
|
||||
ctx->rdcost = this_rdc.rdcost;
|
||||
vp9_rd_cost_update(partition_mul, x->rddiv, &this_rdc);
|
||||
if (this_rdc.rdcost < best_rdc.rdcost) {
|
||||
best_rdc = this_rdc;
|
||||
should_encode_sb = 1;
|
||||
pc_tree->partitioning = PARTITION_NONE;
|
||||
}
|
||||
}
|
||||
|
||||
*rd_cost = best_rdc;
|
||||
|
||||
if (should_encode_sb && pc_tree->index != 3) {
|
||||
|
|
|
@ -24,6 +24,7 @@
|
|||
#if CONFIG_INTERNAL_STATS
|
||||
#include "vpx_dsp/ssim.h"
|
||||
#endif
|
||||
#include "vpx_mem/vpx_mem.h"
|
||||
#include "vpx_ports/mem.h"
|
||||
#include "vpx_ports/system_state.h"
|
||||
#include "vpx_ports/vpx_once.h"
|
||||
|
@ -33,6 +34,7 @@
|
|||
#endif // CONFIG_BITSTREAM_DEBUG || CONFIG_MISMATCH_DEBUG
|
||||
|
||||
#include "vp9/common/vp9_alloccommon.h"
|
||||
#include "vp9/common/vp9_blockd.h"
|
||||
#include "vp9/common/vp9_filter.h"
|
||||
#include "vp9/common/vp9_idct.h"
|
||||
#if CONFIG_VP9_POSTPROC
|
||||
|
|
|
@ -2643,7 +2643,8 @@ void vp9_rc_update_framerate(VP9_COMP *cpi) {
|
|||
RATE_CONTROL *const rc = &cpi->rc;
|
||||
int vbr_max_bits;
|
||||
|
||||
rc->avg_frame_bandwidth = (int)(oxcf->target_bandwidth / cpi->framerate);
|
||||
rc->avg_frame_bandwidth =
|
||||
(int)VPXMIN(oxcf->target_bandwidth / cpi->framerate, INT_MAX);
|
||||
rc->min_frame_bandwidth =
|
||||
(int)(rc->avg_frame_bandwidth * oxcf->two_pass_vbrmin_section / 100);
|
||||
|
||||
|
|
|
@ -232,7 +232,8 @@ void vp9_update_layer_context_change_config(VP9_COMP *const cpi,
|
|||
VPXMIN(lrc->bits_off_target, lrc->maximum_buffer_size);
|
||||
lrc->buffer_level = VPXMIN(lrc->buffer_level, lrc->maximum_buffer_size);
|
||||
lc->framerate = cpi->framerate / oxcf->ts_rate_decimator[tl];
|
||||
lrc->avg_frame_bandwidth = (int)(lc->target_bandwidth / lc->framerate);
|
||||
lrc->avg_frame_bandwidth =
|
||||
(int)VPXMIN(lc->target_bandwidth / lc->framerate, INT_MAX);
|
||||
lrc->max_frame_bandwidth = rc->max_frame_bandwidth;
|
||||
lrc->worst_quality = rc->worst_quality;
|
||||
lrc->best_quality = rc->best_quality;
|
||||
|
@ -272,7 +273,8 @@ void vp9_update_layer_context_change_config(VP9_COMP *const cpi,
|
|||
} else {
|
||||
lc->framerate = cpi->framerate;
|
||||
}
|
||||
lrc->avg_frame_bandwidth = (int)(lc->target_bandwidth / lc->framerate);
|
||||
lrc->avg_frame_bandwidth =
|
||||
(int)VPXMIN(lc->target_bandwidth / lc->framerate, INT_MAX);
|
||||
lrc->max_frame_bandwidth = rc->max_frame_bandwidth;
|
||||
// Update qp-related quantities.
|
||||
lrc->worst_quality = rc->worst_quality;
|
||||
|
@ -314,7 +316,8 @@ void vp9_update_temporal_layer_framerate(VP9_COMP *const cpi) {
|
|||
const int tl = svc->temporal_layer_id;
|
||||
|
||||
lc->framerate = cpi->framerate / oxcf->ts_rate_decimator[tl];
|
||||
lrc->avg_frame_bandwidth = (int)(lc->target_bandwidth / lc->framerate);
|
||||
lrc->avg_frame_bandwidth =
|
||||
(int)VPXMIN(lc->target_bandwidth / lc->framerate, INT_MAX);
|
||||
lrc->max_frame_bandwidth = cpi->rc.max_frame_bandwidth;
|
||||
// Update the average layer frame size (non-cumulative per-frame-bw).
|
||||
if (tl == 0) {
|
||||
|
@ -336,7 +339,8 @@ void vp9_update_spatial_layer_framerate(VP9_COMP *const cpi, double framerate) {
|
|||
RATE_CONTROL *const lrc = &lc->rc;
|
||||
|
||||
lc->framerate = framerate;
|
||||
lrc->avg_frame_bandwidth = (int)(lc->target_bandwidth / lc->framerate);
|
||||
lrc->avg_frame_bandwidth =
|
||||
(int)VPXMIN(lc->target_bandwidth / lc->framerate, INT_MAX);
|
||||
lrc->min_frame_bandwidth =
|
||||
(int)(lrc->avg_frame_bandwidth * oxcf->two_pass_vbrmin_section / 100);
|
||||
lrc->max_frame_bandwidth = (int)(((int64_t)lrc->avg_frame_bandwidth *
|
||||
|
|
|
@ -77,7 +77,7 @@ static int arm_get_cpu_caps(void) {
|
|||
}
|
||||
#endif // defined(PF_ARM_V82_DP_INSTRUCTIONS_AVAILABLE)
|
||||
#endif // HAVE_NEON_DOTPROD
|
||||
// No I8MM feature detection available on Windows at time of writing.
|
||||
// No I8MM or SVE feature detection available on Windows at time of writing.
|
||||
return flags;
|
||||
}
|
||||
|
||||
|
@ -98,6 +98,7 @@ static int arm_get_cpu_caps(void) {
|
|||
// Define hwcap values ourselves: building with an old auxv header where these
|
||||
// hwcap values are not defined should not prevent features from being enabled.
|
||||
#define VPX_AARCH64_HWCAP_ASIMDDP (1 << 20)
|
||||
#define VPX_AARCH64_HWCAP_SVE (1 << 22)
|
||||
#define VPX_AARCH64_HWCAP2_I8MM (1 << 13)
|
||||
|
||||
static int arm_get_cpu_caps(void) {
|
||||
|
@ -117,6 +118,11 @@ static int arm_get_cpu_caps(void) {
|
|||
flags |= HAS_NEON_I8MM;
|
||||
}
|
||||
#endif // HAVE_NEON_I8MM
|
||||
#if HAVE_SVE
|
||||
if (hwcap & VPX_AARCH64_HWCAP_SVE) {
|
||||
flags |= HAS_SVE;
|
||||
}
|
||||
#endif // HAVE_SVE
|
||||
return flags;
|
||||
}
|
||||
|
||||
|
@ -129,6 +135,10 @@ static int arm_get_cpu_caps(void) {
|
|||
#ifndef ZX_ARM64_FEATURE_ISA_I8MM
|
||||
#define ZX_ARM64_FEATURE_ISA_I8MM ((uint32_t)(1u << 19))
|
||||
#endif
|
||||
// Added in https://fuchsia-review.googlesource.com/c/fuchsia/+/895083.
|
||||
#ifndef ZX_ARM64_FEATURE_ISA_SVE
|
||||
#define ZX_ARM64_FEATURE_ISA_SVE ((uint32_t)(1u << 20))
|
||||
#endif
|
||||
|
||||
static int arm_get_cpu_caps(void) {
|
||||
int flags = 0;
|
||||
|
@ -150,6 +160,11 @@ static int arm_get_cpu_caps(void) {
|
|||
flags |= HAS_NEON_I8MM;
|
||||
}
|
||||
#endif // HAVE_NEON_I8MM
|
||||
#if HAVE_SVE
|
||||
if (features & ZX_ARM64_FEATURE_ISA_SVE) {
|
||||
flags |= HAS_SVE;
|
||||
}
|
||||
#endif // HAVE_SVE
|
||||
return flags;
|
||||
}
|
||||
|
||||
|
@ -170,5 +185,13 @@ int arm_cpu_caps(void) {
|
|||
flags &= ~HAS_NEON_I8MM;
|
||||
}
|
||||
|
||||
// Restrict flags: FEAT_SVE assumes that FEAT_{DotProd,I8MM} are available.
|
||||
if (!(flags & HAS_NEON_DOTPROD)) {
|
||||
flags &= ~HAS_SVE;
|
||||
}
|
||||
if (!(flags & HAS_NEON_I8MM)) {
|
||||
flags &= ~HAS_SVE;
|
||||
}
|
||||
|
||||
return flags;
|
||||
}
|
||||
|
|
|
@ -23,6 +23,8 @@ extern "C" {
|
|||
#define HAS_NEON_DOTPROD (1 << 1)
|
||||
// Armv8.2-A optional Neon i8mm instructions, mandatory from Armv8.6-A.
|
||||
#define HAS_NEON_I8MM (1 << 2)
|
||||
// Armv8.2-A optional SVE instructions, mandatory from Armv9.0-A.
|
||||
#define HAS_SVE (1 << 3)
|
||||
|
||||
int arm_cpu_caps(void);
|
||||
|
||||
|
|
|
@ -20,11 +20,11 @@ origin:
|
|||
|
||||
# Human-readable identifier for this version/release
|
||||
# Generally "version NNN", "tag SSS", "bookmark SSS"
|
||||
release: 25a9a8e35aafe8391c5b79115bf944e27445317e (Wed Oct 04 13:42:09 2023).
|
||||
release: b759032a0ed2b57ea3412f6820eda377a2dad480 (Fri Oct 27 17:02:46 2023).
|
||||
|
||||
# Revision to pull in
|
||||
# Must be a long or short commit SHA (long preferred)
|
||||
revision: 25a9a8e35aafe8391c5b79115bf944e27445317e
|
||||
revision: b759032a0ed2b57ea3412f6820eda377a2dad480
|
||||
|
||||
# The package's license, where possible using the mnemonic from
|
||||
# https://spdx.org/licenses/
|
||||
|
|
Загрузка…
Ссылка в новой задаче