mirror of
https://mirror.skon.top/https://github.com/FFmpeg/FFmpeg
synced 2026-04-20 21:00:41 +08:00
avcodec/x86/huffyuvencdsp: Remove MMX sub_hfyu_median_pred_int16
Superseded by SSE2 and AVX2. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
@@ -39,7 +39,6 @@
|
||||
#include "huffyuvencdsp.h"
|
||||
#include "lossless_videoencdsp.h"
|
||||
#include "put_bits.h"
|
||||
#include "libavutil/emms.h"
|
||||
#include "libavutil/mem.h"
|
||||
#include "libavutil/opt.h"
|
||||
#include "libavutil/pixdesc.h"
|
||||
@@ -940,7 +939,6 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
|
||||
} else {
|
||||
av_log(avctx, AV_LOG_ERROR, "Format not supported!\n");
|
||||
}
|
||||
emms_c();
|
||||
|
||||
size += (put_bits_count(&s->pb) + 31) / 8;
|
||||
put_bits(&s->pb, 16, 0);
|
||||
|
||||
@@ -55,46 +55,6 @@ INIT_YMM avx2
|
||||
DIFF_INT16
|
||||
%endif
|
||||
|
||||
INIT_MMX mmxext
|
||||
cglobal sub_hfyu_median_pred_int16, 7,7,0, dst, src1, src2, mask, w, left, left_top
|
||||
add wd, wd
|
||||
movd mm7, maskd
|
||||
SPLATW mm7, mm7
|
||||
movq mm0, [src1q]
|
||||
movq mm2, [src2q]
|
||||
psllq mm0, 16
|
||||
psllq mm2, 16
|
||||
movd mm6, [left_topq]
|
||||
por mm0, mm6
|
||||
movd mm6, [leftq]
|
||||
por mm2, mm6
|
||||
xor maskq, maskq
|
||||
.loop:
|
||||
movq mm1, [src1q + maskq]
|
||||
movq mm3, [src2q + maskq]
|
||||
movq mm4, mm2
|
||||
psubw mm2, mm0
|
||||
paddw mm2, mm1
|
||||
pand mm2, mm7
|
||||
movq mm5, mm4
|
||||
pmaxsw mm4, mm1
|
||||
pminsw mm1, mm5
|
||||
pminsw mm4, mm2
|
||||
pmaxsw mm4, mm1
|
||||
psubw mm3, mm4
|
||||
pand mm3, mm7
|
||||
movq [dstq + maskq], mm3
|
||||
add maskq, 8
|
||||
movq mm0, [src1q + maskq - 2]
|
||||
movq mm2, [src2q + maskq - 2]
|
||||
cmp maskq, wq
|
||||
jb .loop
|
||||
movzx maskd, word [src1q + wq - 2]
|
||||
mov [left_topq], maskd
|
||||
movzx maskd, word [src2q + wq - 2]
|
||||
mov [leftq], maskd
|
||||
RET
|
||||
|
||||
%macro SUB_HFYU_MEDIAN_PRED_INT16 1 ; u,s for pmaxuw vs pmaxsw
|
||||
cglobal sub_hfyu_median_pred_int16, 7,7,6, dst, src1, src2, mask, w, left, left_top
|
||||
movd xm5, maskd
|
||||
|
||||
@@ -31,8 +31,6 @@ void ff_diff_int16_sse2(uint16_t *dst, const uint16_t *src1, const uint16_t *src
|
||||
unsigned mask, int w);
|
||||
void ff_diff_int16_avx2(uint16_t *dst, const uint16_t *src1, const uint16_t *src2,
|
||||
unsigned mask, int w);
|
||||
void ff_sub_hfyu_median_pred_int16_mmxext(uint16_t *dst, const uint16_t *src1, const uint16_t *src2,
|
||||
unsigned mask, int w, int *left, int *left_top);
|
||||
void ff_sub_hfyu_median_pred_int16_sse2(uint16_t *dst, const uint16_t *src1, const uint16_t *src2,
|
||||
unsigned mask, int w, int *left, int *left_top);
|
||||
void ff_sub_hfyu_median_pred_int16_avx2(uint16_t *dst, const uint16_t *src1, const uint16_t *src2,
|
||||
@@ -42,10 +40,6 @@ av_cold void ff_huffyuvencdsp_init_x86(HuffYUVEncDSPContext *c, int bpp, int wid
|
||||
{
|
||||
av_unused int cpu_flags = av_get_cpu_flags();
|
||||
|
||||
if (EXTERNAL_MMXEXT(cpu_flags) && bpp < 16) {
|
||||
c->sub_hfyu_median_pred_int16 = ff_sub_hfyu_median_pred_int16_mmxext;
|
||||
}
|
||||
|
||||
if (EXTERNAL_SSE2(cpu_flags)) {
|
||||
c->diff_int16 = ff_diff_int16_sse2;
|
||||
if (bpp < 16 && width >= 8)
|
||||
|
||||
@@ -42,8 +42,8 @@ static void check_sub_hfyu_median_pred_int16(const char *aligned, unsigned width
|
||||
static const int bpps[] = { 9, 16, };
|
||||
HuffYUVEncDSPContext c;
|
||||
|
||||
declare_func_emms(AV_CPU_FLAG_MMXEXT, void, uint16_t *dst, const uint16_t *src1,
|
||||
const uint16_t *src2, unsigned mask, int w, int *left, int *left_top);
|
||||
declare_func(void, uint16_t *dst, const uint16_t *src1,
|
||||
const uint16_t *src2, unsigned mask, int w, int *left, int *left_top);
|
||||
|
||||
for (size_t i = 0; i < FF_ARRAY_ELEMS(bpps); ++i) {
|
||||
const int bpp = bpps[i];
|
||||
|
||||
Reference in New Issue
Block a user