avcodec/x86/hevc/add_res: Port ff_hevc_add_residual_4_8_mmxext to SSE2
No change in performance here. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
@@ -27,9 +27,9 @@ cextern pw_1023
|
||||
%define max_pixels_10 pw_1023
|
||||
|
||||
; the add_res macros and functions were largely inspired by h264_idct.asm from the x264 project
|
||||
%macro ADD_RES_MMX_4_8 1
|
||||
mova m0, [r1+%1]
|
||||
mova m2, [r1+%1+8]
|
||||
%macro ADD_RES_4_8 1
|
||||
movq m0, [r1+%1]
|
||||
movq m2, [r1+%1+8]
|
||||
|
||||
movd m1, [r0]
|
||||
movd m3, [r0+r2]
|
||||
@@ -45,14 +45,13 @@ cextern pw_1023
|
||||
movd [r0+r2], m2
|
||||
%endmacro
|
||||
|
||||
|
||||
INIT_MMX mmxext
|
||||
; void ff_hevc_add_residual_4_8_mmxext(uint8_t *dst, const int16_t *res, ptrdiff_t stride)
|
||||
cglobal hevc_add_residual_4_8, 3, 3, 6
|
||||
INIT_XMM sse2
|
||||
; void ff_hevc_add_residual_4_8_sse2(uint8_t *dst, const int16_t *res, ptrdiff_t stride)
|
||||
cglobal hevc_add_residual_4_8, 3, 3, 5
|
||||
pxor m4, m4
|
||||
ADD_RES_MMX_4_8 0
|
||||
ADD_RES_4_8 0
|
||||
lea r0, [r0+r2*2]
|
||||
ADD_RES_MMX_4_8 16
|
||||
ADD_RES_4_8 16
|
||||
RET
|
||||
|
||||
%macro ADD_RES_SSE_8_8 1
|
||||
|
||||
@@ -167,7 +167,7 @@ void ff_hevc_put_qpel_hv8_8_avx512icl(int16_t *dst, const uint8_t *_src, ptrdiff
|
||||
// TRANSFORM_ADD
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void ff_hevc_add_residual_4_8_mmxext(uint8_t *dst, const int16_t *res, ptrdiff_t stride);
|
||||
void ff_hevc_add_residual_4_8_sse2(uint8_t *dst, const int16_t *res, ptrdiff_t stride);
|
||||
void ff_hevc_add_residual_8_8_sse2(uint8_t *dst, const int16_t *res, ptrdiff_t stride);
|
||||
void ff_hevc_add_residual_16_8_sse2(uint8_t *dst, const int16_t *res, ptrdiff_t stride);
|
||||
void ff_hevc_add_residual_32_8_sse2(uint8_t *dst, const int16_t *res, ptrdiff_t stride);
|
||||
|
||||
@@ -817,10 +817,9 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth)
|
||||
int cpu_flags = av_get_cpu_flags();
|
||||
|
||||
if (bit_depth == 8) {
|
||||
if (EXTERNAL_MMXEXT(cpu_flags)) {
|
||||
c->add_residual[0] = ff_hevc_add_residual_4_8_mmxext;
|
||||
}
|
||||
if (EXTERNAL_SSE2(cpu_flags)) {
|
||||
c->add_residual[0] = ff_hevc_add_residual_4_8_sse2;
|
||||
|
||||
c->hevc_v_loop_filter_chroma = ff_hevc_v_loop_filter_chroma_8_sse2;
|
||||
c->hevc_h_loop_filter_chroma = ff_hevc_h_loop_filter_chroma_8_sse2;
|
||||
#if ARCH_X86_64
|
||||
|
||||
Reference in New Issue
Block a user