2021-01-07 12:10:20 +00:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2015 Henrik Gramner
|
|
|
|
* Copyright (c) 2021 Josh Dekker
|
|
|
|
*
|
|
|
|
* This file is part of FFmpeg.
|
|
|
|
*
|
|
|
|
* FFmpeg is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* FFmpeg is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License along
|
|
|
|
* with FFmpeg; if not, write to the Free Software Foundation, Inc.,
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <string.h>
|
|
|
|
#include "checkasm.h"
|
2024-05-29 07:50:48 +00:00
|
|
|
#include "libavcodec/hevc/dsp.h"
|
2021-01-07 12:10:20 +00:00
|
|
|
#include "libavutil/common.h"
|
|
|
|
#include "libavutil/internal.h"
|
|
|
|
#include "libavutil/intreadwrite.h"
|
|
|
|
|
|
|
|
static const uint32_t pixel_mask[] = { 0xffffffff, 0x01ff01ff, 0x03ff03ff, 0x07ff07ff, 0x0fff0fff };
|
|
|
|
static const uint32_t pixel_mask16[] = { 0x00ff00ff, 0x01ff01ff, 0x03ff03ff, 0x07ff07ff, 0x0fff0fff };
|
|
|
|
static const int sizes[] = { -1, 4, 6, 8, 12, 16, 24, 32, 48, 64 };
|
|
|
|
static const int weights[] = { 0, 128, 255, -1 };
|
|
|
|
static const int denoms[] = {0, 7, 12, -1 };
|
|
|
|
static const int offsets[] = {0, 255, -1 };
|
|
|
|
|
|
|
|
#define SIZEOF_PIXEL ((bit_depth + 7) / 8)
|
|
|
|
#define BUF_SIZE (2 * MAX_PB_SIZE * (2 * 4 + MAX_PB_SIZE))
|
|
|
|
|
2024-03-12 13:12:29 +00:00
|
|
|
#define checkasm_check_pixel(buf1, stride1, buf2, stride2, ...) \
|
|
|
|
((bit_depth > 8) ? \
|
|
|
|
checkasm_check(uint16_t, (const uint16_t*)buf1, stride1, \
|
|
|
|
(const uint16_t*)buf2, stride2, \
|
|
|
|
__VA_ARGS__) : \
|
|
|
|
checkasm_check(uint8_t, (const uint8_t*) buf1, stride1, \
|
|
|
|
(const uint8_t*) buf2, stride2, \
|
|
|
|
__VA_ARGS__))
|
|
|
|
|
2021-01-07 12:10:20 +00:00
|
|
|
#define randomize_buffers() \
|
|
|
|
do { \
|
|
|
|
uint32_t mask = pixel_mask[bit_depth - 8]; \
|
|
|
|
int k; \
|
2021-09-28 14:13:03 +00:00
|
|
|
for (k = 0; k < BUF_SIZE + SRC_EXTRA; k += 4) { \
|
2021-01-07 12:10:20 +00:00
|
|
|
uint32_t r = rnd() & mask; \
|
|
|
|
AV_WN32A(buf0 + k, r); \
|
|
|
|
AV_WN32A(buf1 + k, r); \
|
2021-09-28 14:13:03 +00:00
|
|
|
if (k >= BUF_SIZE) \
|
|
|
|
continue; \
|
2021-01-07 12:10:20 +00:00
|
|
|
r = rnd(); \
|
|
|
|
AV_WN32A(dst0 + k, r); \
|
|
|
|
AV_WN32A(dst1 + k, r); \
|
|
|
|
} \
|
|
|
|
} while (0)
|
|
|
|
|
|
|
|
#define randomize_buffers_ref() \
|
|
|
|
randomize_buffers(); \
|
|
|
|
do { \
|
|
|
|
uint32_t mask = pixel_mask16[bit_depth - 8]; \
|
|
|
|
int k; \
|
|
|
|
for (k = 0; k < BUF_SIZE; k += 2) { \
|
|
|
|
uint32_t r = rnd() & mask; \
|
|
|
|
AV_WN32A(ref0 + k, r); \
|
|
|
|
AV_WN32A(ref1 + k, r); \
|
|
|
|
} \
|
|
|
|
} while (0)
|
|
|
|
|
|
|
|
#define src0 (buf0 + 2 * 4 * MAX_PB_SIZE) /* hevc qpel functions read data from negative src pointer offsets */
|
|
|
|
#define src1 (buf1 + 2 * 4 * MAX_PB_SIZE)
|
|
|
|
|
2021-09-28 14:13:03 +00:00
|
|
|
/* FIXME: Does the need for SRC_EXTRA for these tests indicate a bug? */
|
|
|
|
#define SRC_EXTRA 8
|
|
|
|
|
2021-08-05 08:26:48 +00:00
|
|
|
static void checkasm_check_hevc_qpel(void)
|
2021-01-07 12:10:20 +00:00
|
|
|
{
|
2021-09-28 14:13:03 +00:00
|
|
|
LOCAL_ALIGNED_32(uint8_t, buf0, [BUF_SIZE + SRC_EXTRA]);
|
|
|
|
LOCAL_ALIGNED_32(uint8_t, buf1, [BUF_SIZE + SRC_EXTRA]);
|
2021-01-07 12:10:20 +00:00
|
|
|
LOCAL_ALIGNED_32(uint8_t, dst0, [BUF_SIZE]);
|
|
|
|
LOCAL_ALIGNED_32(uint8_t, dst1, [BUF_SIZE]);
|
|
|
|
|
|
|
|
HEVCDSPContext h;
|
2024-03-12 13:12:29 +00:00
|
|
|
int size, bit_depth, i, j;
|
2024-05-12 23:22:25 +00:00
|
|
|
declare_func(void, int16_t *dst, const uint8_t *src, ptrdiff_t srcstride,
|
2023-08-31 20:23:54 +00:00
|
|
|
int height, intptr_t mx, intptr_t my, int width);
|
2021-01-07 12:10:20 +00:00
|
|
|
|
|
|
|
for (bit_depth = 8; bit_depth <= 12; bit_depth++) {
|
|
|
|
ff_hevc_dsp_init(&h, bit_depth);
|
|
|
|
|
|
|
|
for (i = 0; i < 2; i++) {
|
|
|
|
for (j = 0; j < 2; j++) {
|
|
|
|
for (size = 1; size < 10; size++) {
|
|
|
|
const char *type;
|
|
|
|
switch ((j << 1) | i) {
|
|
|
|
case 0: type = "pel_pixels"; break; // 0 0
|
|
|
|
case 1: type = "qpel_h"; break; // 0 1
|
|
|
|
case 2: type = "qpel_v"; break; // 1 0
|
|
|
|
case 3: type = "qpel_hv"; break; // 1 1
|
|
|
|
}
|
|
|
|
|
2024-03-12 13:12:28 +00:00
|
|
|
if (check_func(h.put_hevc_qpel[size][j][i],
|
|
|
|
"put_hevc_%s%d_%d", type, sizes[size], bit_depth)) {
|
2021-01-07 12:10:20 +00:00
|
|
|
int16_t *dstw0 = (int16_t *) dst0, *dstw1 = (int16_t *) dst1;
|
|
|
|
randomize_buffers();
|
|
|
|
call_ref(dstw0, src0, sizes[size] * SIZEOF_PIXEL, sizes[size], i, j, sizes[size]);
|
|
|
|
call_new(dstw1, src1, sizes[size] * SIZEOF_PIXEL, sizes[size], i, j, sizes[size]);
|
2024-03-12 13:12:29 +00:00
|
|
|
checkasm_check(int16_t, dstw0, MAX_PB_SIZE * sizeof(int16_t),
|
|
|
|
dstw1, MAX_PB_SIZE * sizeof(int16_t),
|
|
|
|
size[sizes], size[sizes], "dst");
|
2021-01-07 12:10:20 +00:00
|
|
|
bench_new(dstw1, src1, sizes[size] * SIZEOF_PIXEL, sizes[size], i, j, sizes[size]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
report("qpel");
|
|
|
|
}
|
|
|
|
|
2021-08-05 08:26:48 +00:00
|
|
|
static void checkasm_check_hevc_qpel_uni(void)
|
2021-01-07 12:10:20 +00:00
|
|
|
{
|
2021-09-28 14:13:03 +00:00
|
|
|
LOCAL_ALIGNED_32(uint8_t, buf0, [BUF_SIZE + SRC_EXTRA]);
|
|
|
|
LOCAL_ALIGNED_32(uint8_t, buf1, [BUF_SIZE + SRC_EXTRA]);
|
2021-01-07 12:10:20 +00:00
|
|
|
LOCAL_ALIGNED_32(uint8_t, dst0, [BUF_SIZE]);
|
|
|
|
LOCAL_ALIGNED_32(uint8_t, dst1, [BUF_SIZE]);
|
|
|
|
|
|
|
|
HEVCDSPContext h;
|
|
|
|
int size, bit_depth, i, j;
|
2024-05-12 23:22:25 +00:00
|
|
|
declare_func(void, uint8_t *dst, ptrdiff_t dststride, const uint8_t *src, ptrdiff_t srcstride,
|
2023-08-31 20:23:54 +00:00
|
|
|
int height, intptr_t mx, intptr_t my, int width);
|
2021-01-07 12:10:20 +00:00
|
|
|
|
|
|
|
for (bit_depth = 8; bit_depth <= 12; bit_depth++) {
|
|
|
|
ff_hevc_dsp_init(&h, bit_depth);
|
|
|
|
|
|
|
|
for (i = 0; i < 2; i++) {
|
|
|
|
for (j = 0; j < 2; j++) {
|
|
|
|
for (size = 1; size < 10; size++) {
|
|
|
|
const char *type;
|
|
|
|
switch ((j << 1) | i) {
|
|
|
|
case 0: type = "pel_uni_pixels"; break; // 0 0
|
|
|
|
case 1: type = "qpel_uni_h"; break; // 0 1
|
|
|
|
case 2: type = "qpel_uni_v"; break; // 1 0
|
|
|
|
case 3: type = "qpel_uni_hv"; break; // 1 1
|
|
|
|
}
|
|
|
|
|
2024-03-12 13:12:28 +00:00
|
|
|
if (check_func(h.put_hevc_qpel_uni[size][j][i],
|
|
|
|
"put_hevc_%s%d_%d", type, sizes[size], bit_depth)) {
|
2021-01-07 12:10:20 +00:00
|
|
|
randomize_buffers();
|
2024-03-12 13:12:28 +00:00
|
|
|
call_ref(dst0, sizes[size] * SIZEOF_PIXEL,
|
|
|
|
src0, sizes[size] * SIZEOF_PIXEL,
|
|
|
|
sizes[size], i, j, sizes[size]);
|
|
|
|
call_new(dst1, sizes[size] * SIZEOF_PIXEL,
|
|
|
|
src1, sizes[size] * SIZEOF_PIXEL,
|
|
|
|
sizes[size], i, j, sizes[size]);
|
2024-03-12 13:12:29 +00:00
|
|
|
checkasm_check_pixel(dst0, sizes[size] * SIZEOF_PIXEL,
|
|
|
|
dst1, sizes[size] * SIZEOF_PIXEL,
|
|
|
|
size[sizes], size[sizes], "dst");
|
2024-03-12 13:12:28 +00:00
|
|
|
bench_new(dst1, sizes[size] * SIZEOF_PIXEL,
|
|
|
|
src1, sizes[size] * SIZEOF_PIXEL,
|
|
|
|
sizes[size], i, j, sizes[size]);
|
2021-01-07 12:10:20 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
report("qpel_uni");
|
|
|
|
}
|
|
|
|
|
2021-08-05 08:26:48 +00:00
|
|
|
static void checkasm_check_hevc_qpel_uni_w(void)
|
2021-01-07 12:10:20 +00:00
|
|
|
{
|
2021-09-28 14:13:03 +00:00
|
|
|
LOCAL_ALIGNED_32(uint8_t, buf0, [BUF_SIZE + SRC_EXTRA]);
|
|
|
|
LOCAL_ALIGNED_32(uint8_t, buf1, [BUF_SIZE + SRC_EXTRA]);
|
2021-01-07 12:10:20 +00:00
|
|
|
LOCAL_ALIGNED_32(uint8_t, dst0, [BUF_SIZE]);
|
|
|
|
LOCAL_ALIGNED_32(uint8_t, dst1, [BUF_SIZE]);
|
|
|
|
|
|
|
|
HEVCDSPContext h;
|
|
|
|
int size, bit_depth, i, j;
|
|
|
|
const int *denom, *wx, *ox;
|
2024-05-12 23:22:25 +00:00
|
|
|
declare_func(void, uint8_t *dst, ptrdiff_t dststride, const uint8_t *src, ptrdiff_t srcstride,
|
2023-08-31 20:23:54 +00:00
|
|
|
int height, int denom, int wx, int ox, intptr_t mx, intptr_t my, int width);
|
2021-01-07 12:10:20 +00:00
|
|
|
|
|
|
|
for (bit_depth = 8; bit_depth <= 12; bit_depth++) {
|
|
|
|
ff_hevc_dsp_init(&h, bit_depth);
|
|
|
|
|
|
|
|
for (i = 0; i < 2; i++) {
|
|
|
|
for (j = 0; j < 2; j++) {
|
|
|
|
for (size = 1; size < 10; size++) {
|
|
|
|
const char *type;
|
|
|
|
switch ((j << 1) | i) {
|
|
|
|
case 0: type = "pel_uni_w_pixels"; break; // 0 0
|
|
|
|
case 1: type = "qpel_uni_w_h"; break; // 0 1
|
|
|
|
case 2: type = "qpel_uni_w_v"; break; // 1 0
|
|
|
|
case 3: type = "qpel_uni_w_hv"; break; // 1 1
|
|
|
|
}
|
|
|
|
|
2024-03-12 13:12:28 +00:00
|
|
|
if (check_func(h.put_hevc_qpel_uni_w[size][j][i],
|
|
|
|
"put_hevc_%s%d_%d", type, sizes[size], bit_depth)) {
|
2021-01-07 12:10:20 +00:00
|
|
|
for (denom = denoms; *denom >= 0; denom++) {
|
|
|
|
for (wx = weights; *wx >= 0; wx++) {
|
|
|
|
for (ox = offsets; *ox >= 0; ox++) {
|
|
|
|
randomize_buffers();
|
2024-03-12 13:12:28 +00:00
|
|
|
call_ref(dst0, sizes[size] * SIZEOF_PIXEL,
|
|
|
|
src0, sizes[size] * SIZEOF_PIXEL,
|
|
|
|
sizes[size], *denom, *wx, *ox, i, j, sizes[size]);
|
|
|
|
call_new(dst1, sizes[size] * SIZEOF_PIXEL,
|
|
|
|
src1, sizes[size] * SIZEOF_PIXEL,
|
|
|
|
sizes[size], *denom, *wx, *ox, i, j, sizes[size]);
|
2024-03-12 13:12:29 +00:00
|
|
|
checkasm_check_pixel(dst0, sizes[size] * SIZEOF_PIXEL,
|
|
|
|
dst1, sizes[size] * SIZEOF_PIXEL,
|
|
|
|
size[sizes], size[sizes], "dst");
|
2024-03-12 13:12:28 +00:00
|
|
|
bench_new(dst1, sizes[size] * SIZEOF_PIXEL,
|
|
|
|
src1, sizes[size] * SIZEOF_PIXEL,
|
|
|
|
sizes[size], *denom, *wx, *ox, i, j, sizes[size]);
|
2021-01-07 12:10:20 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
report("qpel_uni_w");
|
|
|
|
}
|
|
|
|
|
2021-08-05 08:26:48 +00:00
|
|
|
static void checkasm_check_hevc_qpel_bi(void)
|
2021-01-07 12:10:20 +00:00
|
|
|
{
|
2021-09-28 14:13:03 +00:00
|
|
|
LOCAL_ALIGNED_32(uint8_t, buf0, [BUF_SIZE + SRC_EXTRA]);
|
|
|
|
LOCAL_ALIGNED_32(uint8_t, buf1, [BUF_SIZE + SRC_EXTRA]);
|
2021-01-07 12:10:20 +00:00
|
|
|
LOCAL_ALIGNED_32(uint8_t, dst0, [BUF_SIZE]);
|
|
|
|
LOCAL_ALIGNED_32(uint8_t, dst1, [BUF_SIZE]);
|
|
|
|
LOCAL_ALIGNED_32(int16_t, ref0, [BUF_SIZE]);
|
|
|
|
LOCAL_ALIGNED_32(int16_t, ref1, [BUF_SIZE]);
|
|
|
|
|
|
|
|
HEVCDSPContext h;
|
|
|
|
int size, bit_depth, i, j;
|
2024-05-12 23:22:25 +00:00
|
|
|
declare_func(void, uint8_t *dst, ptrdiff_t dststride, const uint8_t *src, ptrdiff_t srcstride,
|
|
|
|
const int16_t *src2,
|
2023-08-31 20:23:54 +00:00
|
|
|
int height, intptr_t mx, intptr_t my, int width);
|
2021-01-07 12:10:20 +00:00
|
|
|
|
|
|
|
for (bit_depth = 8; bit_depth <= 12; bit_depth++) {
|
|
|
|
ff_hevc_dsp_init(&h, bit_depth);
|
|
|
|
|
|
|
|
for (i = 0; i < 2; i++) {
|
|
|
|
for (j = 0; j < 2; j++) {
|
|
|
|
for (size = 1; size < 10; size++) {
|
|
|
|
const char *type;
|
|
|
|
switch ((j << 1) | i) {
|
|
|
|
case 0: type = "pel_bi_pixels"; break; // 0 0
|
|
|
|
case 1: type = "qpel_bi_h"; break; // 0 1
|
|
|
|
case 2: type = "qpel_bi_v"; break; // 1 0
|
|
|
|
case 3: type = "qpel_bi_hv"; break; // 1 1
|
|
|
|
}
|
|
|
|
|
2024-03-12 13:12:28 +00:00
|
|
|
if (check_func(h.put_hevc_qpel_bi[size][j][i],
|
|
|
|
"put_hevc_%s%d_%d", type, sizes[size], bit_depth)) {
|
2021-01-07 12:10:20 +00:00
|
|
|
randomize_buffers_ref();
|
2024-03-12 13:12:28 +00:00
|
|
|
call_ref(dst0, sizes[size] * SIZEOF_PIXEL,
|
|
|
|
src0, sizes[size] * SIZEOF_PIXEL,
|
|
|
|
ref0, sizes[size], i, j, sizes[size]);
|
|
|
|
call_new(dst1, sizes[size] * SIZEOF_PIXEL,
|
|
|
|
src1, sizes[size] * SIZEOF_PIXEL,
|
|
|
|
ref1, sizes[size], i, j, sizes[size]);
|
2024-03-12 13:12:29 +00:00
|
|
|
checkasm_check_pixel(dst0, sizes[size] * SIZEOF_PIXEL,
|
|
|
|
dst1, sizes[size] * SIZEOF_PIXEL,
|
|
|
|
size[sizes], size[sizes], "dst");
|
2024-03-12 13:12:28 +00:00
|
|
|
bench_new(dst1, sizes[size] * SIZEOF_PIXEL,
|
|
|
|
src1, sizes[size] * SIZEOF_PIXEL,
|
|
|
|
ref1, sizes[size], i, j, sizes[size]);
|
2021-01-07 12:10:20 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
report("qpel_bi");
|
|
|
|
}
|
|
|
|
|
2021-08-05 08:26:48 +00:00
|
|
|
static void checkasm_check_hevc_qpel_bi_w(void)
|
2021-01-07 12:10:20 +00:00
|
|
|
{
|
2021-09-28 14:13:03 +00:00
|
|
|
LOCAL_ALIGNED_32(uint8_t, buf0, [BUF_SIZE + SRC_EXTRA]);
|
|
|
|
LOCAL_ALIGNED_32(uint8_t, buf1, [BUF_SIZE + SRC_EXTRA]);
|
2021-01-07 12:10:20 +00:00
|
|
|
LOCAL_ALIGNED_32(uint8_t, dst0, [BUF_SIZE]);
|
|
|
|
LOCAL_ALIGNED_32(uint8_t, dst1, [BUF_SIZE]);
|
|
|
|
LOCAL_ALIGNED_32(int16_t, ref0, [BUF_SIZE]);
|
|
|
|
LOCAL_ALIGNED_32(int16_t, ref1, [BUF_SIZE]);
|
|
|
|
|
|
|
|
HEVCDSPContext h;
|
|
|
|
int size, bit_depth, i, j;
|
|
|
|
const int *denom, *wx, *ox;
|
2024-05-12 23:22:25 +00:00
|
|
|
declare_func(void, uint8_t *dst, ptrdiff_t dststride, const uint8_t *src, ptrdiff_t srcstride,
|
|
|
|
const int16_t *src2,
|
2023-08-31 20:23:54 +00:00
|
|
|
int height, int denom, int wx0, int wx1,
|
|
|
|
int ox0, int ox1, intptr_t mx, intptr_t my, int width);
|
2021-01-07 12:10:20 +00:00
|
|
|
|
|
|
|
for (bit_depth = 8; bit_depth <= 12; bit_depth++) {
|
|
|
|
ff_hevc_dsp_init(&h, bit_depth);
|
|
|
|
|
|
|
|
for (i = 0; i < 2; i++) {
|
|
|
|
for (j = 0; j < 2; j++) {
|
|
|
|
for (size = 1; size < 10; size++) {
|
|
|
|
const char *type;
|
|
|
|
switch ((j << 1) | i) {
|
|
|
|
case 0: type = "pel_bi_w_pixels"; break; // 0 0
|
|
|
|
case 1: type = "qpel_bi_w_h"; break; // 0 1
|
|
|
|
case 2: type = "qpel_bi_w_v"; break; // 1 0
|
|
|
|
case 3: type = "qpel_bi_w_hv"; break; // 1 1
|
|
|
|
}
|
|
|
|
|
2024-03-12 13:12:28 +00:00
|
|
|
if (check_func(h.put_hevc_qpel_bi_w[size][j][i],
|
|
|
|
"put_hevc_%s%d_%d", type, sizes[size], bit_depth)) {
|
2021-01-07 12:10:20 +00:00
|
|
|
for (denom = denoms; *denom >= 0; denom++) {
|
|
|
|
for (wx = weights; *wx >= 0; wx++) {
|
|
|
|
for (ox = offsets; *ox >= 0; ox++) {
|
|
|
|
randomize_buffers_ref();
|
2024-03-12 13:12:28 +00:00
|
|
|
call_ref(dst0, sizes[size] * SIZEOF_PIXEL,
|
|
|
|
src0, sizes[size] * SIZEOF_PIXEL,
|
|
|
|
ref0, sizes[size], *denom, *wx, *wx, *ox, *ox, i, j, sizes[size]);
|
|
|
|
call_new(dst1, sizes[size] * SIZEOF_PIXEL,
|
|
|
|
src1, sizes[size] * SIZEOF_PIXEL,
|
|
|
|
ref1, sizes[size], *denom, *wx, *wx, *ox, *ox, i, j, sizes[size]);
|
2024-03-12 13:12:29 +00:00
|
|
|
checkasm_check_pixel(dst0, sizes[size] * SIZEOF_PIXEL,
|
|
|
|
dst1, sizes[size] * SIZEOF_PIXEL,
|
|
|
|
size[sizes], size[sizes], "dst");
|
2024-03-12 13:12:28 +00:00
|
|
|
bench_new(dst1, sizes[size] * SIZEOF_PIXEL,
|
|
|
|
src1, sizes[size] * SIZEOF_PIXEL,
|
|
|
|
ref1, sizes[size], *denom, *wx, *wx, *ox, *ox, i, j, sizes[size]);
|
2021-01-07 12:10:20 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
report("qpel_bi_w");
|
|
|
|
}
|
|
|
|
|
2021-09-28 14:13:03 +00:00
|
|
|
#undef SRC_EXTRA
|
|
|
|
#define SRC_EXTRA 0
|
|
|
|
|
2021-08-05 08:26:48 +00:00
|
|
|
static void checkasm_check_hevc_epel(void)
|
2021-01-07 12:10:20 +00:00
|
|
|
{
|
|
|
|
LOCAL_ALIGNED_32(uint8_t, buf0, [BUF_SIZE]);
|
|
|
|
LOCAL_ALIGNED_32(uint8_t, buf1, [BUF_SIZE]);
|
|
|
|
LOCAL_ALIGNED_32(uint8_t, dst0, [BUF_SIZE]);
|
|
|
|
LOCAL_ALIGNED_32(uint8_t, dst1, [BUF_SIZE]);
|
|
|
|
|
|
|
|
HEVCDSPContext h;
|
2024-03-12 13:12:29 +00:00
|
|
|
int size, bit_depth, i, j;
|
2024-05-12 23:22:25 +00:00
|
|
|
declare_func(void, int16_t *dst, const uint8_t *src, ptrdiff_t srcstride,
|
2023-08-31 20:23:54 +00:00
|
|
|
int height, intptr_t mx, intptr_t my, int width);
|
2021-01-07 12:10:20 +00:00
|
|
|
|
|
|
|
for (bit_depth = 8; bit_depth <= 12; bit_depth++) {
|
|
|
|
ff_hevc_dsp_init(&h, bit_depth);
|
|
|
|
|
|
|
|
for (i = 0; i < 2; i++) {
|
|
|
|
for (j = 0; j < 2; j++) {
|
|
|
|
for (size = 1; size < 10; size++) {
|
|
|
|
const char *type;
|
|
|
|
switch ((j << 1) | i) {
|
|
|
|
case 0: type = "pel_pixels"; break; // 0 0
|
|
|
|
case 1: type = "epel_h"; break; // 0 1
|
|
|
|
case 2: type = "epel_v"; break; // 1 0
|
|
|
|
case 3: type = "epel_hv"; break; // 1 1
|
|
|
|
}
|
|
|
|
|
2024-03-12 13:12:28 +00:00
|
|
|
if (check_func(h.put_hevc_epel[size][j][i],
|
|
|
|
"put_hevc_%s%d_%d", type, sizes[size], bit_depth)) {
|
2021-01-07 12:10:20 +00:00
|
|
|
int16_t *dstw0 = (int16_t *) dst0, *dstw1 = (int16_t *) dst1;
|
|
|
|
randomize_buffers();
|
|
|
|
call_ref(dstw0, src0, sizes[size] * SIZEOF_PIXEL, sizes[size], i, j, sizes[size]);
|
|
|
|
call_new(dstw1, src1, sizes[size] * SIZEOF_PIXEL, sizes[size], i, j, sizes[size]);
|
2024-03-12 13:12:29 +00:00
|
|
|
checkasm_check(int16_t, dstw0, MAX_PB_SIZE * sizeof(int16_t),
|
|
|
|
dstw1, MAX_PB_SIZE * sizeof(int16_t),
|
|
|
|
size[sizes], size[sizes], "dst");
|
2021-01-07 12:10:20 +00:00
|
|
|
bench_new(dstw1, src1, sizes[size] * SIZEOF_PIXEL, sizes[size], i, j, sizes[size]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
report("epel");
|
|
|
|
}
|
|
|
|
|
2021-08-05 08:26:48 +00:00
|
|
|
static void checkasm_check_hevc_epel_uni(void)
|
2021-01-07 12:10:20 +00:00
|
|
|
{
|
|
|
|
LOCAL_ALIGNED_32(uint8_t, buf0, [BUF_SIZE]);
|
|
|
|
LOCAL_ALIGNED_32(uint8_t, buf1, [BUF_SIZE]);
|
|
|
|
LOCAL_ALIGNED_32(uint8_t, dst0, [BUF_SIZE]);
|
|
|
|
LOCAL_ALIGNED_32(uint8_t, dst1, [BUF_SIZE]);
|
|
|
|
|
|
|
|
HEVCDSPContext h;
|
|
|
|
int size, bit_depth, i, j;
|
2024-05-12 23:22:25 +00:00
|
|
|
declare_func(void, uint8_t *dst, ptrdiff_t dststride, const uint8_t *src, ptrdiff_t srcstride,
|
2023-08-31 20:23:54 +00:00
|
|
|
int height, intptr_t mx, intptr_t my, int width);
|
2021-01-07 12:10:20 +00:00
|
|
|
|
|
|
|
for (bit_depth = 8; bit_depth <= 12; bit_depth++) {
|
|
|
|
ff_hevc_dsp_init(&h, bit_depth);
|
|
|
|
|
|
|
|
for (i = 0; i < 2; i++) {
|
|
|
|
for (j = 0; j < 2; j++) {
|
|
|
|
for (size = 1; size < 10; size++) {
|
|
|
|
const char *type;
|
|
|
|
switch ((j << 1) | i) {
|
|
|
|
case 0: type = "pel_uni_pixels"; break; // 0 0
|
|
|
|
case 1: type = "epel_uni_h"; break; // 0 1
|
|
|
|
case 2: type = "epel_uni_v"; break; // 1 0
|
|
|
|
case 3: type = "epel_uni_hv"; break; // 1 1
|
|
|
|
}
|
|
|
|
|
2024-03-12 13:12:28 +00:00
|
|
|
if (check_func(h.put_hevc_epel_uni[size][j][i],
|
|
|
|
"put_hevc_%s%d_%d", type, sizes[size], bit_depth)) {
|
2021-01-07 12:10:20 +00:00
|
|
|
randomize_buffers();
|
2024-03-12 13:12:28 +00:00
|
|
|
call_ref(dst0, sizes[size] * SIZEOF_PIXEL,
|
|
|
|
src0, sizes[size] * SIZEOF_PIXEL,
|
|
|
|
sizes[size], i, j, sizes[size]);
|
|
|
|
call_new(dst1, sizes[size] * SIZEOF_PIXEL,
|
|
|
|
src1, sizes[size] * SIZEOF_PIXEL,
|
|
|
|
sizes[size], i, j, sizes[size]);
|
2024-03-12 13:12:29 +00:00
|
|
|
checkasm_check_pixel(dst0, sizes[size] * SIZEOF_PIXEL,
|
|
|
|
dst1, sizes[size] * SIZEOF_PIXEL,
|
|
|
|
size[sizes], size[sizes], "dst");
|
2024-03-12 13:12:28 +00:00
|
|
|
bench_new(dst1, sizes[size] * SIZEOF_PIXEL,
|
|
|
|
src1, sizes[size] * SIZEOF_PIXEL,
|
|
|
|
sizes[size], i, j, sizes[size]);
|
2021-01-07 12:10:20 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
report("epel_uni");
|
|
|
|
}
|
|
|
|
|
2021-08-05 08:26:48 +00:00
|
|
|
static void checkasm_check_hevc_epel_uni_w(void)
|
2021-01-07 12:10:20 +00:00
|
|
|
{
|
|
|
|
LOCAL_ALIGNED_32(uint8_t, buf0, [BUF_SIZE]);
|
|
|
|
LOCAL_ALIGNED_32(uint8_t, buf1, [BUF_SIZE]);
|
|
|
|
LOCAL_ALIGNED_32(uint8_t, dst0, [BUF_SIZE]);
|
|
|
|
LOCAL_ALIGNED_32(uint8_t, dst1, [BUF_SIZE]);
|
|
|
|
|
|
|
|
HEVCDSPContext h;
|
|
|
|
int size, bit_depth, i, j;
|
|
|
|
const int *denom, *wx, *ox;
|
2024-05-12 23:22:25 +00:00
|
|
|
declare_func(void, uint8_t *dst, ptrdiff_t dststride, const uint8_t *src, ptrdiff_t srcstride,
|
2023-08-31 20:23:54 +00:00
|
|
|
int height, int denom, int wx, int ox, intptr_t mx, intptr_t my, int width);
|
2021-01-07 12:10:20 +00:00
|
|
|
|
|
|
|
for (bit_depth = 8; bit_depth <= 12; bit_depth++) {
|
|
|
|
ff_hevc_dsp_init(&h, bit_depth);
|
|
|
|
|
|
|
|
for (i = 0; i < 2; i++) {
|
|
|
|
for (j = 0; j < 2; j++) {
|
|
|
|
for (size = 1; size < 10; size++) {
|
|
|
|
const char *type;
|
|
|
|
switch ((j << 1) | i) {
|
|
|
|
case 0: type = "pel_uni_w_pixels"; break; // 0 0
|
|
|
|
case 1: type = "epel_uni_w_h"; break; // 0 1
|
|
|
|
case 2: type = "epel_uni_w_v"; break; // 1 0
|
|
|
|
case 3: type = "epel_uni_w_hv"; break; // 1 1
|
|
|
|
}
|
|
|
|
|
2024-03-12 13:12:28 +00:00
|
|
|
if (check_func(h.put_hevc_epel_uni_w[size][j][i],
|
|
|
|
"put_hevc_%s%d_%d", type, sizes[size], bit_depth)) {
|
2021-01-07 12:10:20 +00:00
|
|
|
for (denom = denoms; *denom >= 0; denom++) {
|
|
|
|
for (wx = weights; *wx >= 0; wx++) {
|
|
|
|
for (ox = offsets; *ox >= 0; ox++) {
|
|
|
|
randomize_buffers();
|
2024-03-12 13:12:28 +00:00
|
|
|
call_ref(dst0, sizes[size] * SIZEOF_PIXEL,
|
|
|
|
src0, sizes[size] * SIZEOF_PIXEL,
|
|
|
|
sizes[size], *denom, *wx, *ox, i, j, sizes[size]);
|
|
|
|
call_new(dst1, sizes[size] * SIZEOF_PIXEL,
|
|
|
|
src1, sizes[size] * SIZEOF_PIXEL,
|
|
|
|
sizes[size], *denom, *wx, *ox, i, j, sizes[size]);
|
2024-03-12 13:12:29 +00:00
|
|
|
checkasm_check_pixel(dst0, sizes[size] * SIZEOF_PIXEL,
|
|
|
|
dst1, sizes[size] * SIZEOF_PIXEL,
|
|
|
|
size[sizes], size[sizes], "dst");
|
2024-03-12 13:12:28 +00:00
|
|
|
bench_new(dst1, sizes[size] * SIZEOF_PIXEL,
|
|
|
|
src1, sizes[size] * SIZEOF_PIXEL,
|
|
|
|
sizes[size], *denom, *wx, *ox, i, j, sizes[size]);
|
2021-01-07 12:10:20 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
report("epel_uni_w");
|
|
|
|
}
|
|
|
|
|
2021-08-05 08:26:48 +00:00
|
|
|
static void checkasm_check_hevc_epel_bi(void)
|
2021-01-07 12:10:20 +00:00
|
|
|
{
|
|
|
|
LOCAL_ALIGNED_32(uint8_t, buf0, [BUF_SIZE]);
|
|
|
|
LOCAL_ALIGNED_32(uint8_t, buf1, [BUF_SIZE]);
|
|
|
|
LOCAL_ALIGNED_32(uint8_t, dst0, [BUF_SIZE]);
|
|
|
|
LOCAL_ALIGNED_32(uint8_t, dst1, [BUF_SIZE]);
|
|
|
|
LOCAL_ALIGNED_32(int16_t, ref0, [BUF_SIZE]);
|
|
|
|
LOCAL_ALIGNED_32(int16_t, ref1, [BUF_SIZE]);
|
|
|
|
|
|
|
|
HEVCDSPContext h;
|
|
|
|
int size, bit_depth, i, j;
|
2024-05-12 23:22:25 +00:00
|
|
|
declare_func(void, uint8_t *dst, ptrdiff_t dststride, const uint8_t *src, ptrdiff_t srcstride,
|
|
|
|
const int16_t *src2,
|
2023-08-31 20:23:54 +00:00
|
|
|
int height, intptr_t mx, intptr_t my, int width);
|
2021-01-07 12:10:20 +00:00
|
|
|
|
|
|
|
for (bit_depth = 8; bit_depth <= 12; bit_depth++) {
|
|
|
|
ff_hevc_dsp_init(&h, bit_depth);
|
|
|
|
|
|
|
|
for (i = 0; i < 2; i++) {
|
|
|
|
for (j = 0; j < 2; j++) {
|
|
|
|
for (size = 1; size < 10; size++) {
|
|
|
|
const char *type;
|
|
|
|
switch ((j << 1) | i) {
|
|
|
|
case 0: type = "pel_bi_pixels"; break; // 0 0
|
|
|
|
case 1: type = "epel_bi_h"; break; // 0 1
|
|
|
|
case 2: type = "epel_bi_v"; break; // 1 0
|
|
|
|
case 3: type = "epel_bi_hv"; break; // 1 1
|
|
|
|
}
|
|
|
|
|
2024-03-12 13:12:28 +00:00
|
|
|
if (check_func(h.put_hevc_epel_bi[size][j][i],
|
|
|
|
"put_hevc_%s%d_%d", type, sizes[size], bit_depth)) {
|
2021-01-07 12:10:20 +00:00
|
|
|
randomize_buffers_ref();
|
2024-03-12 13:12:28 +00:00
|
|
|
call_ref(dst0, sizes[size] * SIZEOF_PIXEL,
|
|
|
|
src0, sizes[size] * SIZEOF_PIXEL,
|
|
|
|
ref0, sizes[size], i, j, sizes[size]);
|
|
|
|
call_new(dst1, sizes[size] * SIZEOF_PIXEL,
|
|
|
|
src1, sizes[size] * SIZEOF_PIXEL,
|
|
|
|
ref1, sizes[size], i, j, sizes[size]);
|
2024-03-12 13:12:29 +00:00
|
|
|
checkasm_check_pixel(dst0, sizes[size] * SIZEOF_PIXEL,
|
|
|
|
dst1, sizes[size] * SIZEOF_PIXEL,
|
|
|
|
size[sizes], size[sizes], "dst");
|
2024-03-12 13:12:28 +00:00
|
|
|
bench_new(dst1, sizes[size] * SIZEOF_PIXEL,
|
|
|
|
src1, sizes[size] * SIZEOF_PIXEL,
|
|
|
|
ref1, sizes[size], i, j, sizes[size]);
|
2021-01-07 12:10:20 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
report("epel_bi");
|
|
|
|
}
|
|
|
|
|
2021-08-05 08:26:48 +00:00
|
|
|
static void checkasm_check_hevc_epel_bi_w(void)
|
2021-01-07 12:10:20 +00:00
|
|
|
{
|
|
|
|
LOCAL_ALIGNED_32(uint8_t, buf0, [BUF_SIZE]);
|
|
|
|
LOCAL_ALIGNED_32(uint8_t, buf1, [BUF_SIZE]);
|
|
|
|
LOCAL_ALIGNED_32(uint8_t, dst0, [BUF_SIZE]);
|
|
|
|
LOCAL_ALIGNED_32(uint8_t, dst1, [BUF_SIZE]);
|
|
|
|
LOCAL_ALIGNED_32(int16_t, ref0, [BUF_SIZE]);
|
|
|
|
LOCAL_ALIGNED_32(int16_t, ref1, [BUF_SIZE]);
|
|
|
|
|
|
|
|
HEVCDSPContext h;
|
|
|
|
int size, bit_depth, i, j;
|
|
|
|
const int *denom, *wx, *ox;
|
2024-05-12 23:22:25 +00:00
|
|
|
declare_func(void, uint8_t *dst, ptrdiff_t dststride, const uint8_t *src, ptrdiff_t srcstride,
|
|
|
|
const int16_t *src2,
|
2023-08-31 20:23:54 +00:00
|
|
|
int height, int denom, int wx0, int wx1,
|
|
|
|
int ox0, int ox1, intptr_t mx, intptr_t my, int width);
|
2021-01-07 12:10:20 +00:00
|
|
|
|
|
|
|
for (bit_depth = 8; bit_depth <= 12; bit_depth++) {
|
|
|
|
ff_hevc_dsp_init(&h, bit_depth);
|
|
|
|
|
|
|
|
for (i = 0; i < 2; i++) {
|
|
|
|
for (j = 0; j < 2; j++) {
|
|
|
|
for (size = 1; size < 10; size++) {
|
|
|
|
const char *type;
|
|
|
|
switch ((j << 1) | i) {
|
|
|
|
case 0: type = "pel_bi_w_pixels"; break; // 0 0
|
|
|
|
case 1: type = "epel_bi_w_h"; break; // 0 1
|
|
|
|
case 2: type = "epel_bi_w_v"; break; // 1 0
|
|
|
|
case 3: type = "epel_bi_w_hv"; break; // 1 1
|
|
|
|
}
|
|
|
|
|
2024-03-12 13:12:28 +00:00
|
|
|
if (check_func(h.put_hevc_epel_bi_w[size][j][i],
|
|
|
|
"put_hevc_%s%d_%d", type, sizes[size], bit_depth)) {
|
2021-01-07 12:10:20 +00:00
|
|
|
for (denom = denoms; *denom >= 0; denom++) {
|
|
|
|
for (wx = weights; *wx >= 0; wx++) {
|
|
|
|
for (ox = offsets; *ox >= 0; ox++) {
|
|
|
|
randomize_buffers_ref();
|
2024-03-12 13:12:28 +00:00
|
|
|
call_ref(dst0, sizes[size] * SIZEOF_PIXEL,
|
|
|
|
src0, sizes[size] * SIZEOF_PIXEL,
|
|
|
|
ref0, sizes[size], *denom, *wx, *wx, *ox, *ox, i, j, sizes[size]);
|
|
|
|
call_new(dst1, sizes[size] * SIZEOF_PIXEL,
|
|
|
|
src1, sizes[size] * SIZEOF_PIXEL,
|
|
|
|
ref1, sizes[size], *denom, *wx, *wx, *ox, *ox, i, j, sizes[size]);
|
2024-03-12 13:12:29 +00:00
|
|
|
checkasm_check_pixel(dst0, sizes[size] * SIZEOF_PIXEL,
|
|
|
|
dst1, sizes[size] * SIZEOF_PIXEL,
|
|
|
|
size[sizes], size[sizes], "dst");
|
2024-03-12 13:12:28 +00:00
|
|
|
bench_new(dst1, sizes[size] * SIZEOF_PIXEL,
|
|
|
|
src1, sizes[size] * SIZEOF_PIXEL,
|
|
|
|
ref1, sizes[size], *denom, *wx, *wx, *ox, *ox, i, j, sizes[size]);
|
2021-01-07 12:10:20 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
report("epel_bi_w");
|
|
|
|
}
|
2021-08-05 08:26:48 +00:00
|
|
|
|
|
|
|
void checkasm_check_hevc_pel(void)
|
|
|
|
{
|
|
|
|
checkasm_check_hevc_qpel();
|
|
|
|
checkasm_check_hevc_qpel_uni();
|
|
|
|
checkasm_check_hevc_qpel_uni_w();
|
|
|
|
checkasm_check_hevc_qpel_bi();
|
|
|
|
checkasm_check_hevc_qpel_bi_w();
|
|
|
|
checkasm_check_hevc_epel();
|
|
|
|
checkasm_check_hevc_epel_uni();
|
|
|
|
checkasm_check_hevc_epel_uni_w();
|
|
|
|
checkasm_check_hevc_epel_bi();
|
|
|
|
checkasm_check_hevc_epel_bi_w();
|
|
|
|
}
|