Compare commits

..

No commits in common. "master" and "master" have entirely different histories.

View File

@ -160,7 +160,6 @@
#include "sup.h" #include "sup.h"
#include "ass.h" #include "ass.h"
#include "abstract_lists.h" #include "abstract_lists.h"
#include <emmintrin.h> // 包含SSE指令集的头文件
/* AVIS input code taken from muxers.c from the x264 project (GPLv2 or later). /* AVIS input code taken from muxers.c from the x264 project (GPLv2 or later).
* Authors: Laurent Aimar <fenrir@via.ecp.fr> * Authors: Laurent Aimar <fenrir@via.ecp.fr>
@ -546,33 +545,10 @@ int detect_sse2 ()
int is_identical (stream_info_t *s_info, char *img, char *img_old) int is_identical (stream_info_t *s_info, char *img, char *img_old)
{ {
if (detect_sse2())
// 按128位加载两个图像数据 return asm_is_identical_sse2(s_info, img, img_old);
__m128i* ptr1 = (__m128i*)img; else
__m128i* ptr2 = (__m128i*)img_old; return is_identical_c(s_info, img, img_old);
// 计算比较的次数(以128位为单位)
int num_iterations = size / 16;
// 逐一比较图像数据使用SSE指令进行并行比较
for (int i = 0; i < num_iterations; ++i) {
__m128i xmm1 = _mm_load_si128(ptr1 + i); // 加载128位数据
__m128i xmm2 = _mm_load_si128(ptr2 + i); // 加载128位数据
// 比较两个128位数据是否相等
__m128i cmp_result = _mm_cmpeq_epi8(xmm1, xmm2);
// 判断比较结果是否全为1
int result_mask = _mm_movemask_epi8(cmp_result);
// 如果存在不相等的元素返回0
if (result_mask != 0xFFFF) {
return 0;
}
}
// 如果所有元素都相等返回1
return 1;
} }
int is_empty (stream_info_t *s_info, char *img) int is_empty (stream_info_t *s_info, char *img)