Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SSE dectetion made wrong assumptions on SSSE3-less processor #140

Open
wants to merge 2 commits into
base: frame-parallel
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions libde265/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ set (libde265_sources
acceleration.h
fallback.cc fallback.h fallback-motion.cc fallback-motion.h
fallback-dct.h fallback-dct.cc fallback-sao.h fallback-sao.cc
fallback-intra-dc.cc
quality.cc quality.h
configparam.cc configparam.h
image-io.h image-io.cc
Expand Down
13 changes: 8 additions & 5 deletions libde265/x86/sse.cc
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ void init_acceleration_functions_sse(struct acceleration_functions* accel,
int have_SSE = !!(edx & (1<<25));
int have_SSE2 = !!(edx & (1<<26));
int have_SSE3 = !!(ecx & (1<< 0));
int have_SSSE3 = !!(edx & (1<< 9));
int have_SSSE3 = !!(ecx & (1<< 9));
int have_SSE4_1 = !!(ecx & (1<<19));
int have_SSE4_2 = !!(ecx & (1<<20));
int have_AVX = !!(ecx & (1<<28));
Expand All @@ -94,22 +94,25 @@ void init_acceleration_functions_sse(struct acceleration_functions* accel,
}

#if HAVE_SSE4_1
if (have_SSE2) {
if (have_SSE4_1) {
accel->put_unweighted_pred_8 = put_pred_8_sse2;
accel->put_weighted_pred_avg_8 = put_bipred_8_sse2;
}

if (have_SSSE3) { accel->put_weighted_pred_8 = put_weighted_pred_8_ssse3; }

if (have_SSE2) { accel->put_weighted_bipred_8 = put_weighted_bipred_8_sse2; }

if (have_SSE2) { accel->put_hevc_epel_8 = put_hevc_chroma_direct_8_sse2; }
if (have_SSE4_1) { accel->put_hevc_epel_8 = put_hevc_chroma_direct_8_sse2; }

if (have_SSE4_1) { // TODO: check requirements
accel->put_hevc_epel_h_8 = ff_hevc_put_hevc_epel_h_8_sse;
accel->put_hevc_epel_v_8 = ff_hevc_put_hevc_epel_v_8_sse;
accel->put_hevc_epel_hv_8 = ff_hevc_put_hevc_epel_hv_8_sse;
}

if (have_SSE2) { accel->put_hevc_qpel_8[0][0] = put_hevc_luma_direct_8_sse2; }
if (have_SSE4_1) { accel->put_hevc_qpel_8[0][0] = put_hevc_luma_direct_8_sse2; }

if (have_SSE4_1) { // TODO: check requirements
accel->put_hevc_qpel_8[0][1] = ff_hevc_put_hevc_qpel_v_1_8_sse;
accel->put_hevc_qpel_8[0][2] = ff_hevc_put_hevc_qpel_v_2_8_sse;
Expand Down Expand Up @@ -152,6 +155,6 @@ void init_acceleration_functions_sse(struct acceleration_functions* accel,
if (have_SSSE3) { accel->intra_dc_noavg_8[3] = intra_dc_noavg_8_32x32_ssse3; }
accel->intra_dc_avg_8[3] = nullptr;

if (have_SSE2) { accel->sao_band_8 = sao_band_8bit_sse2; }
if (have_SSSE3) { accel->sao_band_8 = sao_band_8bit_sse2; }
#endif
}