[libvpx] Update to v1.17.0-97-gd3335af9e

This commit is contained in:
Andrey Volk committed 2026-11-16 23:18:46 +03:00
1 parent 7481baed18
commit a55111af58
615 files changed
+68654 -28912

No files matched your search

@@ -83,7 +83,7 @@ class ExhaustNeighbor(MotionEST):
self.beta = beta
self.metric = metric
super(ExhaustNeighbor, self).__init__(cur_f, ref_f, blk_size)
self.assign = np.zeros((self.num_row, self.num_col), dtype=np.bool)
self.assign = np.zeros((self.num_row, self.num_col), dtype=bool)
"""
estimate neighbor loss:
@@ -29,7 +29,7 @@ class GroundTruth(MotionEST):
def __init__(self, cur_f, ref_f, blk_sz, gt_path, mf=None, mask=None):
self.name = 'ground truth'
super(GroundTruth, self).__init__(cur_f, ref_f, blk_sz)
self.mask = np.zeros((self.num_row, self.num_col), dtype=np.bool)
self.mask = np.zeros((self.num_row, self.num_col), dtype=bool)
if gt_path:
with open(gt_path) as gt_file:
lines = gt_file.readlines()
@@ -42,7 +42,7 @@ class GroundTruth(MotionEST):
self.mask[i, -j - 1] = True
continue
#the order of original file is flipped on the x axis
self.mf[i, -j - 1] = np.array([float(y), -float(x)], dtype=np.int)
self.mf[i, -j - 1] = np.array([float(y), -float(x)], dtype=int)
else:
self.mf = mf
self.mask = mask
@@ -28,8 +28,8 @@ class MotionEST(object):
self.ref_f = ref_f
self.blk_sz = blk_sz
#convert RGB to YUV
self.cur_yuv = np.array(self.cur_f.convert('YCbCr'), dtype=np.int)
self.ref_yuv = np.array(self.ref_f.convert('YCbCr'), dtype=np.int)
self.cur_yuv = np.array(self.cur_f.convert('YCbCr'), dtype=int)
self.ref_yuv = np.array(self.ref_f.convert('YCbCr'), dtype=int)
#frame size
self.width = self.cur_f.size[0]
self.height = self.cur_f.size[1]
@@ -18,7 +18,7 @@ from PIL import Image, ImageDraw
def MSE(blk1, blk2):
return np.mean(
LA.norm(
np.array(blk1, dtype=np.int) - np.array(blk2, dtype=np.int), axis=2))
np.array(blk1, dtype=int) - np.array(blk2, dtype=int), axis=2))
def drawMF(img, blk_sz, mf):
+24
View File
@@ -0,0 +1,24 @@
# Using Profile Guided Optimizations to identify compiler optimization failures
When using Clang, the `-Rpass-missed` flag enables the verbose log of failed
compiler optimizations. However, the extensive log messages can obscure
potential optimization opportunities.
Use the following steps to generate a more transparent optimization report
using a previously created PGO profile file. The report also includes code
hotness diagnostics:
```bash
$ ../libvpx/configure --use-profile=perf.profdata \
--extra-cflags="-fsave-optimization-record -fdiagnostics-show-hotness"
```
Convert the generated YAML files into a detailed HTML report using the
[optviewer2](https://github.com/OfekShilon/optview2) tool:
```bash
$ opt-viewer.py --output-dir=out/ --source-dir=libvpx .
```
The HTML report displays each code line's relative hotness, cross-referenced
with the failed compiler optimizations.
+12 -8
View File
@@ -68,19 +68,23 @@ echo "test_libvpx, etc) to link the stack traces to source code lines."
cflags="-fsanitize=${sanitizer}"
ldflags="-fsanitize=${sanitizer}"
# http://code.google.com/p/webm/issues/detail?id=570
cflags="${cflags} -fno-strict-aliasing"
# Useful backtraces.
cflags="${cflags} -fno-omit-frame-pointer"
# Exact backtraces.
cflags="${cflags} -fno-optimize-sibling-calls"
if [ "${sanitizer}" = "cfi" ]; then
# https://clang.llvm.org/docs/ControlFlowIntegrity.html
cflags="${cflags} -fno-sanitize-trap=cfi -flto -fvisibility=hidden"
ldflags="${ldflags} -fno-sanitize-trap=cfi -flto -fuse-ld=gold"
export AR="llvm-ar"
fi
case "${sanitizer}" in
cfi)
# https://clang.llvm.org/docs/ControlFlowIntegrity.html
cflags="${cflags} -fno-sanitize-trap=cfi -flto -fvisibility=hidden"
ldflags="${ldflags} -fno-sanitize-trap=cfi -flto -fuse-ld=gold"
export AR="llvm-ar"
;;
integer|undefined)
# https://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html
cflags="${cflags} -fsanitize=float-cast-overflow"
;;
esac
set -x
export CC="clang"
+52 -27
View File
@@ -150,12 +150,15 @@ static void close_input_file(input_file_t *in) {
}
}
static size_t read_input_file(input_file_t *in, unsigned char **y,
unsigned char **u, unsigned char **v, int bd) {
// Returns 1 on success, 0 on failure due to a read error or eof (or format
// error in the case of y4m).
static int read_input_file(input_file_t *in, unsigned char **y,
unsigned char **u, unsigned char **v, int bd) {
size_t r1 = 0;
switch (in->type) {
case Y4M:
r1 = y4m_input_fetch_frame(&in->y4m, in->file, &in->img);
if (r1 == (size_t)-1) return 0;
*y = in->img.planes[0];
*u = in->img.planes[1];
*v = in->img.planes[2];
@@ -175,7 +178,7 @@ static size_t read_input_file(input_file_t *in, unsigned char **y,
break;
}
return r1;
return r1 != 0;
}
static void ssim_parms_8x8(const uint8_t *s, int sp, const uint8_t *r, int rp,
@@ -328,20 +331,33 @@ int main(int argc, char *argv[]) {
memset(in, 0, sizeof(in));
if (argc < 2) {
if (argc < 3) {
fprintf(stderr,
"Usage: %s file1.{yuv|y4m} file2.{yuv|y4m}"
"[WxH tl_skip={0,1,3} frame_stats_file bits]\n",
" [WxH tl_skip={0,1,3} frame_stats_file bits]\n",
argv[0]);
return 1;
}
if (argc > 3) {
sscanf(argv[3], "%dx%d", &w, &h);
if (sscanf(argv[3], "%dx%d", &w, &h) != 2) {
fprintf(stderr, "arguments for w/h not assigned!\n");
goto clean_up;
}
// Limit width/height to 4K. The frame_size set in the function
// open_input_file() will still be within range of int.
if (w < 1 || w > 4096 || h < 1 || h > 4096) {
fprintf(stderr,
"width or height is too large (above 4096) or below 1!\n");
goto clean_up;
}
}
if (argc > 6) {
sscanf(argv[6], "%d", &bit_depth);
if (sscanf(argv[6], "%d", &bit_depth) != 1) {
fprintf(stderr, "argument for bit_depth not assigned!\n");
goto clean_up;
}
}
if (open_input_file(argv[1], &in[0], w, h, bit_depth) < 0) {
@@ -386,7 +402,10 @@ int main(int argc, char *argv[]) {
// encoding in mode 10. 7 would be reasonable for comparing TL0 of a 4-layer
// encoding.
if (argc > 4) {
sscanf(argv[4], "%d", &tl_skip);
if (sscanf(argv[4], "%d", &tl_skip) != 1) {
fprintf(stderr, "argument for tl_skip not assigned!\n");
goto clean_up;
}
if (argc > 5) {
framestats = fopen(argv[5], "w");
if (!framestats) {
@@ -399,31 +418,37 @@ int main(int argc, char *argv[]) {
}
while (1) {
size_t r1, r2;
int r1, r2;
unsigned char *y[2], *u[2], *v[2];
r1 = read_input_file(&in[0], &y[0], &u[0], &v[0], bit_depth);
if (r1) {
// Reading parts of file1.yuv that were not used in temporal layer.
if (tl_skips_remaining > 0) {
--tl_skips_remaining;
continue;
if (r1 == 0) {
if (ferror(in[0].file)) {
fprintf(stderr, "Failed to read data from '%s'\n", argv[1]);
return_value = 1;
goto clean_up;
}
// Use frame, but skip |tl_skip| after it.
tl_skips_remaining = tl_skip;
}
r2 = read_input_file(&in[1], &y[1], &u[1], &v[1], bit_depth);
if (r1 && r2 && r1 != r2) {
fprintf(stderr, "Failed to read data: %s [%d/%d]\n", strerror(errno),
(int)r1, (int)r2);
return_value = 1;
goto clean_up;
} else if (r1 == 0 || r2 == 0) {
break;
}
// Reading parts of file1.yuv that were not used in temporal layer.
if (tl_skips_remaining > 0) {
--tl_skips_remaining;
continue;
}
// Use frame, but skip |tl_skip| after it.
tl_skips_remaining = tl_skip;
r2 = read_input_file(&in[1], &y[1], &u[1], &v[1], bit_depth);
if (r2 == 0) {
if (ferror(in[1].file)) {
fprintf(stderr, "Failed to read data from '%s'\n", argv[2]);
return_value = 1;
goto clean_up;
}
break;
}
#if CONFIG_VP9_HIGHBITDEPTH
#define psnr_and_ssim(ssim, psnr, buf0, buf1, w, h) \
do { \