mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-27 09:37:31 +09:00
update libaom to rev 5bdd95475e07ac8641114cb139105b8d734a1b60 (without moz.build and aom_ports/aom_once.h)
This commit is contained in:
parent
402c27b560
commit
fb515ea77b
177 changed files with 21088 additions and 11681 deletions
79
third_party/aom/aom_dsp/avg.c
vendored
79
third_party/aom/aom_dsp/avg.c
vendored
|
|
@ -14,6 +14,40 @@
|
|||
#include "config/aom_dsp_rtcd.h"
|
||||
#include "aom_ports/mem.h"
|
||||
|
||||
void aom_minmax_8x8_c(const uint8_t *s, int p, const uint8_t *d, int dp,
|
||||
int *min, int *max) {
|
||||
int i, j;
|
||||
*min = 255;
|
||||
*max = 0;
|
||||
for (i = 0; i < 8; ++i, s += p, d += dp) {
|
||||
for (j = 0; j < 8; ++j) {
|
||||
int diff = abs(s[j] - d[j]);
|
||||
*min = diff < *min ? diff : *min;
|
||||
*max = diff > *max ? diff : *max;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
unsigned int aom_avg_4x4_c(const uint8_t *s, int p) {
|
||||
int i, j;
|
||||
int sum = 0;
|
||||
for (i = 0; i < 4; ++i, s += p)
|
||||
for (j = 0; j < 4; sum += s[j], ++j) {
|
||||
}
|
||||
|
||||
return (sum + 8) >> 4;
|
||||
}
|
||||
|
||||
unsigned int aom_avg_8x8_c(const uint8_t *s, int p) {
|
||||
int i, j;
|
||||
int sum = 0;
|
||||
for (i = 0; i < 8; ++i, s += p)
|
||||
for (j = 0; j < 8; sum += s[j], ++j) {
|
||||
}
|
||||
|
||||
return (sum + 32) >> 6;
|
||||
}
|
||||
|
||||
// src_diff: first pass, 9 bit, dynamic range [-255, 255]
|
||||
// second pass, 12 bit, dynamic range [-2040, 2040]
|
||||
static void hadamard_col8(const int16_t *src_diff, ptrdiff_t src_stride,
|
||||
|
|
@ -146,3 +180,48 @@ int aom_satd_c(const tran_low_t *coeff, int length) {
|
|||
// satd: 26 bits, dynamic range [-32640 * 1024, 32640 * 1024]
|
||||
return satd;
|
||||
}
|
||||
|
||||
// Integer projection onto row vectors.
|
||||
// height: value range {16, 32, 64, 128}.
|
||||
void aom_int_pro_row_c(int16_t hbuf[16], const uint8_t *ref,
|
||||
const int ref_stride, const int height) {
|
||||
int idx;
|
||||
const int norm_factor = height >> 1;
|
||||
for (idx = 0; idx < 16; ++idx) {
|
||||
int i;
|
||||
hbuf[idx] = 0;
|
||||
// hbuf[idx]: 14 bit, dynamic range [0, 32640].
|
||||
for (i = 0; i < height; ++i) hbuf[idx] += ref[i * ref_stride];
|
||||
// hbuf[idx]: 9 bit, dynamic range [0, 1020].
|
||||
hbuf[idx] /= norm_factor;
|
||||
++ref;
|
||||
}
|
||||
}
|
||||
|
||||
// width: value range {16, 32, 64, 128}.
|
||||
int16_t aom_int_pro_col_c(const uint8_t *ref, const int width) {
|
||||
int idx;
|
||||
int16_t sum = 0;
|
||||
// sum: 14 bit, dynamic range [0, 32640]
|
||||
for (idx = 0; idx < width; ++idx) sum += ref[idx];
|
||||
return sum;
|
||||
}
|
||||
|
||||
// ref: [0 - 510]
|
||||
// src: [0 - 510]
|
||||
// bwl: {2, 3, 4, 5}
|
||||
int aom_vector_var_c(const int16_t *ref, const int16_t *src, const int bwl) {
|
||||
int i;
|
||||
int width = 4 << bwl;
|
||||
int sse = 0, mean = 0, var;
|
||||
|
||||
for (i = 0; i < width; ++i) {
|
||||
int diff = ref[i] - src[i]; // diff: dynamic range [-510, 510], 10 bits.
|
||||
mean += diff; // mean: dynamic range 16 bits.
|
||||
sse += diff * diff; // sse: dynamic range 26 bits.
|
||||
}
|
||||
|
||||
// (mean * mean): dynamic range 31 bits.
|
||||
var = sse - ((mean * mean) >> (bwl + 2));
|
||||
return var;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue