tests/checkasm/hevc_*: Avoid using declare_func_emms where possible

Only the idct_dc and add_residual functions have MMX versions,
so one can use the version with the stricter check (that checks
that the MMX registers have not been clobbered) for all the other
checks.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
pull/390/head
Andreas Rheinhardt 1 year ago
parent 13c988556b
commit 3f82b38516
  1. 2
      tests/checkasm/hevc_deblock.c
  2. 2
      tests/checkasm/hevc_idct.c
  3. 52
      tests/checkasm/hevc_pel.c
  4. 8
      tests/checkasm/hevc_sao.c

@ -55,7 +55,7 @@ static void check_deblock_chroma(HEVCDSPContext *h, int bit_depth)
LOCAL_ALIGNED_32(uint8_t, buf0, [BUF_SIZE]);
LOCAL_ALIGNED_32(uint8_t, buf1, [BUF_SIZE]);
declare_func_emms(AV_CPU_FLAG_MMX, void, uint8_t *pix, ptrdiff_t stride, int32_t *tc, uint8_t *no_p, uint8_t *no_q);
declare_func(void, uint8_t *pix, ptrdiff_t stride, int32_t *tc, uint8_t *no_p, uint8_t *no_q);
if (check_func(h->hevc_h_loop_filter_chroma, "hevc_h_loop_filter_chroma%d", bit_depth)) {
for (int i = 0; i < 4; i++) {

@ -91,7 +91,7 @@ static void check_transform_luma(HEVCDSPContext *h, int bit_depth)
int block_size = 4;
int size = block_size * block_size;
declare_func_emms(AV_CPU_FLAG_MMXEXT, void, int16_t *coeffs);
declare_func(void, int16_t *coeffs);
randomize_buffers(coeffs0, size);
memcpy(coeffs1, coeffs0, sizeof(*coeffs0) * size);

@ -79,8 +79,8 @@ static void checkasm_check_hevc_qpel(void)
HEVCDSPContext h;
int size, bit_depth, i, j, row;
declare_func_emms(AV_CPU_FLAG_MMX | AV_CPU_FLAG_MMXEXT, void, int16_t *dst, uint8_t *src, ptrdiff_t srcstride,
int height, intptr_t mx, intptr_t my, int width);
declare_func(void, int16_t *dst, uint8_t *src, ptrdiff_t srcstride,
int height, intptr_t mx, intptr_t my, int width);
for (bit_depth = 8; bit_depth <= 12; bit_depth++) {
ff_hevc_dsp_init(&h, bit_depth);
@ -123,8 +123,8 @@ static void checkasm_check_hevc_qpel_uni(void)
HEVCDSPContext h;
int size, bit_depth, i, j;
declare_func_emms(AV_CPU_FLAG_MMX | AV_CPU_FLAG_MMXEXT, void, uint8_t *dst, ptrdiff_t dststride, uint8_t *src, ptrdiff_t srcstride,
int height, intptr_t mx, intptr_t my, int width);
declare_func(void, uint8_t *dst, ptrdiff_t dststride, uint8_t *src, ptrdiff_t srcstride,
int height, intptr_t mx, intptr_t my, int width);
for (bit_depth = 8; bit_depth <= 12; bit_depth++) {
ff_hevc_dsp_init(&h, bit_depth);
@ -165,8 +165,8 @@ static void checkasm_check_hevc_qpel_uni_w(void)
HEVCDSPContext h;
int size, bit_depth, i, j;
const int *denom, *wx, *ox;
declare_func_emms(AV_CPU_FLAG_MMX | AV_CPU_FLAG_MMXEXT, void, uint8_t *dst, ptrdiff_t dststride, uint8_t *src, ptrdiff_t srcstride,
int height, int denom, int wx, int ox, intptr_t mx, intptr_t my, int width);
declare_func(void, uint8_t *dst, ptrdiff_t dststride, uint8_t *src, ptrdiff_t srcstride,
int height, int denom, int wx, int ox, intptr_t mx, intptr_t my, int width);
for (bit_depth = 8; bit_depth <= 12; bit_depth++) {
ff_hevc_dsp_init(&h, bit_depth);
@ -214,9 +214,9 @@ static void checkasm_check_hevc_qpel_bi(void)
HEVCDSPContext h;
int size, bit_depth, i, j;
declare_func_emms(AV_CPU_FLAG_MMX | AV_CPU_FLAG_MMXEXT, void, uint8_t *dst, ptrdiff_t dststride, uint8_t *src, ptrdiff_t srcstride,
int16_t *src2,
int height, intptr_t mx, intptr_t my, int width);
declare_func(void, uint8_t *dst, ptrdiff_t dststride, uint8_t *src, ptrdiff_t srcstride,
int16_t *src2,
int height, intptr_t mx, intptr_t my, int width);
for (bit_depth = 8; bit_depth <= 12; bit_depth++) {
ff_hevc_dsp_init(&h, bit_depth);
@ -259,10 +259,10 @@ static void checkasm_check_hevc_qpel_bi_w(void)
HEVCDSPContext h;
int size, bit_depth, i, j;
const int *denom, *wx, *ox;
declare_func_emms(AV_CPU_FLAG_MMX | AV_CPU_FLAG_MMXEXT, void, uint8_t *dst, ptrdiff_t dststride, uint8_t *src, ptrdiff_t srcstride,
int16_t *src2,
int height, int denom, int wx0, int wx1,
int ox0, int ox1, intptr_t mx, intptr_t my, int width);
declare_func(void, uint8_t *dst, ptrdiff_t dststride, uint8_t *src, ptrdiff_t srcstride,
int16_t *src2,
int height, int denom, int wx0, int wx1,
int ox0, int ox1, intptr_t mx, intptr_t my, int width);
for (bit_depth = 8; bit_depth <= 12; bit_depth++) {
ff_hevc_dsp_init(&h, bit_depth);
@ -311,8 +311,8 @@ static void checkasm_check_hevc_epel(void)
HEVCDSPContext h;
int size, bit_depth, i, j, row;
declare_func_emms(AV_CPU_FLAG_MMX | AV_CPU_FLAG_MMXEXT, void, int16_t *dst, uint8_t *src, ptrdiff_t srcstride,
int height, intptr_t mx, intptr_t my, int width);
declare_func(void, int16_t *dst, uint8_t *src, ptrdiff_t srcstride,
int height, intptr_t mx, intptr_t my, int width);
for (bit_depth = 8; bit_depth <= 12; bit_depth++) {
ff_hevc_dsp_init(&h, bit_depth);
@ -355,8 +355,8 @@ static void checkasm_check_hevc_epel_uni(void)
HEVCDSPContext h;
int size, bit_depth, i, j;
declare_func_emms(AV_CPU_FLAG_MMX | AV_CPU_FLAG_MMXEXT, void, uint8_t *dst, ptrdiff_t dststride, uint8_t *src, ptrdiff_t srcstride,
int height, intptr_t mx, intptr_t my, int width);
declare_func(void, uint8_t *dst, ptrdiff_t dststride, uint8_t *src, ptrdiff_t srcstride,
int height, intptr_t mx, intptr_t my, int width);
for (bit_depth = 8; bit_depth <= 12; bit_depth++) {
ff_hevc_dsp_init(&h, bit_depth);
@ -397,8 +397,8 @@ static void checkasm_check_hevc_epel_uni_w(void)
HEVCDSPContext h;
int size, bit_depth, i, j;
const int *denom, *wx, *ox;
declare_func_emms(AV_CPU_FLAG_MMX | AV_CPU_FLAG_MMXEXT, void, uint8_t *dst, ptrdiff_t dststride, uint8_t *src, ptrdiff_t srcstride,
int height, int denom, int wx, int ox, intptr_t mx, intptr_t my, int width);
declare_func(void, uint8_t *dst, ptrdiff_t dststride, uint8_t *src, ptrdiff_t srcstride,
int height, int denom, int wx, int ox, intptr_t mx, intptr_t my, int width);
for (bit_depth = 8; bit_depth <= 12; bit_depth++) {
ff_hevc_dsp_init(&h, bit_depth);
@ -446,9 +446,9 @@ static void checkasm_check_hevc_epel_bi(void)
HEVCDSPContext h;
int size, bit_depth, i, j;
declare_func_emms(AV_CPU_FLAG_MMX | AV_CPU_FLAG_MMXEXT, void, uint8_t *dst, ptrdiff_t dststride, uint8_t *src, ptrdiff_t srcstride,
int16_t *src2,
int height, intptr_t mx, intptr_t my, int width);
declare_func(void, uint8_t *dst, ptrdiff_t dststride, uint8_t *src, ptrdiff_t srcstride,
int16_t *src2,
int height, intptr_t mx, intptr_t my, int width);
for (bit_depth = 8; bit_depth <= 12; bit_depth++) {
ff_hevc_dsp_init(&h, bit_depth);
@ -491,10 +491,10 @@ static void checkasm_check_hevc_epel_bi_w(void)
HEVCDSPContext h;
int size, bit_depth, i, j;
const int *denom, *wx, *ox;
declare_func_emms(AV_CPU_FLAG_MMX | AV_CPU_FLAG_MMXEXT, void, uint8_t *dst, ptrdiff_t dststride, uint8_t *src, ptrdiff_t srcstride,
int16_t *src2,
int height, int denom, int wx0, int wx1,
int ox0, int ox1, intptr_t mx, intptr_t my, int width);
declare_func(void, uint8_t *dst, ptrdiff_t dststride, uint8_t *src, ptrdiff_t srcstride,
int16_t *src2,
int height, int denom, int wx0, int wx1,
int ox0, int ox1, intptr_t mx, intptr_t my, int width);
for (bit_depth = 8; bit_depth <= 12; bit_depth++) {
ff_hevc_dsp_init(&h, bit_depth);

@ -80,8 +80,8 @@ static void check_sao_band(HEVCDSPContext *h, int bit_depth)
int block_size = sao_size[i];
int prev_size = i > 0 ? sao_size[i - 1] : 0;
ptrdiff_t stride = PIXEL_STRIDE*SIZEOF_PIXEL;
declare_func_emms(AV_CPU_FLAG_MMX, void, uint8_t *dst, uint8_t *src, ptrdiff_t dst_stride, ptrdiff_t src_stride,
int16_t *sao_offset_val, int sao_left_class, int width, int height);
declare_func(void, uint8_t *dst, uint8_t *src, ptrdiff_t dst_stride, ptrdiff_t src_stride,
int16_t *sao_offset_val, int sao_left_class, int width, int height);
if (check_func(h->sao_band_filter[i], "hevc_sao_band_%d_%d", block_size, bit_depth)) {
@ -118,8 +118,8 @@ static void check_sao_edge(HEVCDSPContext *h, int bit_depth)
int prev_size = i > 0 ? sao_size[i - 1] : 0;
ptrdiff_t stride = PIXEL_STRIDE*SIZEOF_PIXEL;
int offset = (AV_INPUT_BUFFER_PADDING_SIZE + PIXEL_STRIDE)*SIZEOF_PIXEL;
declare_func_emms(AV_CPU_FLAG_MMX, void, uint8_t *dst, uint8_t *src, ptrdiff_t stride_dst,
int16_t *sao_offset_val, int eo, int width, int height);
declare_func(void, uint8_t *dst, uint8_t *src, ptrdiff_t stride_dst,
int16_t *sao_offset_val, int eo, int width, int height);
for (int w = prev_size + 4; w <= block_size; w += 4) {
randomize_buffers(src0, src1, BUF_SIZE);

Loading…
Cancel
Save