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

Fix more conflicts with SVT-AV1 #82

Merged
merged 2 commits into from
Aug 19, 2020
Merged
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
54 changes: 13 additions & 41 deletions Source/Lib/ASM_AVX2/EbNoiseExtractAVX2.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,18 @@
#include "immintrin.h"
#include "EbUtility.h"

EB_EXTERN EB_ALIGN(16) const uint8_t filter_type[] = {
static EB_ALIGN(16) const uint8_t filter_type[] = {
1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4
};

EB_EXTERN EB_ALIGN(16) const uint8_t weak_chroma_filter[2][32] = {
static EB_ALIGN(16) const uint8_t weak_chroma_filter[2][32] = {
{ 2, 4, 2, 4, 2, 4, 2, 4, 2, 4, 2, 4, 2, 4, 2, 4, 2, 4, 2, 4, 2, 4, 2, 4, 2, 4, 2, 4, 2, 4, 2, 4 },
{ 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2 },
};

inline void eb_vp9_luma_weak_filter_avx2_intrin(
__m256i top,
__m256i curr,
__m256i bottom,
__m256i curr_prev,
__m256i curr_next,
uint8_t *ptr_denoised,
uint8_t *ptr_noise
)
{
static inline void eb_vp9_luma_weak_filter_avx2_intrin(
__m256i top, __m256i curr, __m256i bottom, __m256i curr_prev,
__m256i curr_next, uint8_t *ptr_denoised, uint8_t *ptr_noise) {
__m256i top_first_half,
bottom_first_half,
filter_first_half,
Expand Down Expand Up @@ -74,21 +67,11 @@ inline void eb_vp9_luma_weak_filter_avx2_intrin(
_mm256_storeu_si256((__m256i *)(ptr_denoised ), filter_first_half);

_mm256_storeu_si256((__m256i *)(ptr_noise), _mm256_subs_epu8(curr, filter_first_half));

}
inline void eb_vp9_chroma_weak_luma_strong_filter_avx2_intrin(
__m256i top,
__m256i curr,
__m256i bottom,
__m256i curr_prev,
__m256i curr_next,
__m256i top_prev,
__m256i top_next,
__m256i bottom_prev,
__m256i bottom_next,
uint8_t *ptr_denoised
)
{
static inline void eb_vp9_chroma_weak_luma_strong_filter_avx2_intrin(
__m256i top, __m256i curr, __m256i bottom, __m256i curr_prev,
__m256i curr_next, __m256i top_prev, __m256i top_next, __m256i bottom_prev,
__m256i bottom_next, uint8_t *ptr_denoised) {
__m256i filter_first_half,
filter_second_half,
curr_next_first_half,
Expand Down Expand Up @@ -174,22 +157,12 @@ inline void eb_vp9_chroma_weak_luma_strong_filter_avx2_intrin(

filter_first_half = _mm256_permute4x64_epi64(_mm256_packus_epi16(filter_first_half, filter_second_half), 216);
_mm256_storeu_si256((__m256i *)(ptr_denoised), filter_first_half);

}

inline void eb_vp9_chroma_strong_avx2_intrin(
__m256i top,
__m256i curr,
__m256i bottom,
__m256i curr_prev,
__m256i curr_next,
__m256i top_prev,
__m256i top_next,
__m256i bottom_prev,
__m256i bottom_next,
uint8_t *ptr_denoised
)
{
static inline void eb_vp9_chroma_strong_avx2_intrin(
__m256i top, __m256i curr, __m256i bottom, __m256i curr_prev,
__m256i curr_next, __m256i top_prev, __m256i top_next, __m256i bottom_prev,
__m256i bottom_next, uint8_t *ptr_denoised) {
__m256i curr_left_mid_first_halflo,
curr_left_mid_first_halfhi,
curr_prev_permutation,
Expand Down Expand Up @@ -266,7 +239,6 @@ inline void eb_vp9_chroma_strong_avx2_intrin(

curr_left_mid_first_halflo = _mm256_insertf128_si256(curr_left_mid_first_halflo, _mm_packus_epi16(_mm256_extracti128_si256(curr_left_mid_first_halfhi, 0), _mm256_extracti128_si256(curr_left_mid_first_halfhi, 1)), 1);
_mm256_storeu_si256((__m256i *)(ptr_denoised), curr_left_mid_first_halflo);

}
/*******************************************
* eb_vp9_noise_extract_luma_weak
Expand Down
33 changes: 0 additions & 33 deletions Source/Lib/ASM_AVX2/EbNoiseExtractAVX2.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,39 +51,6 @@ void eb_vp9_noise_extract_luma_strong_avx2_intrin(
uint32_t sb_origin_y,
uint32_t sb_origin_x);

void eb_vp9_chroma_strong_avx2_intrin(
__m256i top,
__m256i curr,
__m256i bottom,
__m256i curr_prev,
__m256i curr_next,
__m256i top_prev,
__m256i top_next,
__m256i bottom_prev,
__m256i bottom_next,
uint8_t *ptr_denoised);

void eb_vp9_luma_weak_filter_avx2_intrin(
__m256i top,
__m256i curr,
__m256i bottom,
__m256i curr_prev,
__m256i curr_next,
uint8_t *ptr_denoised,
uint8_t *ptr_noise);

void eb_vp9_chroma_weak_luma_strong_filter_avx2_intrin(
__m256i top,
__m256i curr,
__m256i bottom,
__m256i curr_prev,
__m256i curr_next,
__m256i top_prev,
__m256i top_next,
__m256i bottom_prev,
__m256i bottom_next,
uint8_t *ptr_denoised);

#ifdef __cplusplus
}
#endif
Expand Down
4 changes: 2 additions & 2 deletions Source/Lib/Codec/EbEncDecProcess.c
Original file line number Diff line number Diff line change
Expand Up @@ -4693,7 +4693,7 @@ static void perform_dist_rate_calc(
* of the segment-row (B) as this would block other
* threads from performing an update (A).
******************************************************/
EB_BOOL assign_enc_dec_segments(
static EB_BOOL assign_enc_dec_segments(
EncDecSegments *segment_ptr,
uint16_t *segment_in_out_index,
EncDecTasks *task_ptr,
Expand Down Expand Up @@ -4952,7 +4952,7 @@ static void perform_dist_rate_calc(
eb_vp9_release_mutex(encode_context_ptr->total_number_of_recon_frame_mutex);
}

void pad_ref_and_set_flags(
static void pad_ref_and_set_flags(
PictureControlSet *picture_control_set_ptr,
SequenceControlSet *sequence_control_set_ptr
)
Expand Down
14 changes: 7 additions & 7 deletions Source/Lib/Codec/EbEncHandle.c
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ uint32_t lib_mutex_count = 0;
uint8_t eb_vp9_num_groups = 0;
#ifdef _WIN32
GROUP_AFFINITY eb_vp9_group_affinity;
EbBool alternate_groups = 0;
EbBool eb_vp9_alternate_groups = 0;
#elif defined(__linux__)
cpu_set_t eb_vp9_group_affinity;
typedef struct logicalProcessorGroup {
Expand Down Expand Up @@ -589,15 +589,15 @@ static EbErrorType eb_enc_handle_ctor(
}

#ifdef _WIN32
uint64_t get_affinity_mask(uint32_t lpnum) {
static uint64_t get_affinity_mask(uint32_t lpnum) {
uint64_t mask = 0x1;
for (uint32_t i = lpnum - 1; i > 0; i--)
mask += (uint64_t)1 << i;
return mask;
}
#endif

void eb_set_thread_management_parameters( EbSvtVp9EncConfiguration *config_ptr){
static void eb_set_thread_management_parameters( EbSvtVp9EncConfiguration *config_ptr){

uint32_t num_logical_processors = get_num_cores();
#ifdef _WIN32
Expand All @@ -617,7 +617,7 @@ void eb_set_thread_management_parameters( EbSvtVp9EncConfiguration *config_ptr){
uint32_t num_lp_per_group = num_logical_processors / eb_vp9_num_groups;
if (config_ptr->target_socket == -1) {
if (config_ptr->logical_processors > num_lp_per_group) {
alternate_groups = EB_TRUE;
eb_vp9_alternate_groups = EB_TRUE;
SVT_LOG("SVT [WARNING]: -lp(logical processors) setting is ignored. Run on both sockets. \n");
}
else
Expand Down Expand Up @@ -1917,7 +1917,7 @@ static int32_t compute_default_intra_period(
return intra_period;
}

void set_default_configuration_parameters(
static void set_default_configuration_parameters(
SequenceControlSet *sequence_control_set_ptr) {

// No Cropping Window
Expand Down Expand Up @@ -1946,7 +1946,7 @@ static uint32_t compute_default_look_ahead(
return lad;
}

void copy_api_from_app(
static void copy_api_from_app(
SequenceControlSet *sequence_control_set_ptr,
EbSvtVp9EncConfiguration *p_component_parameter_structure) {

Expand Down Expand Up @@ -2405,7 +2405,7 @@ static EbErrorType verify_settings(
/**********************************
* Set Parameter
**********************************/
void set_param_based_on_input(
static void set_param_based_on_input(
SequenceControlSet *sequence_control_set_ptr) {

// Update picture width, and picture height
Expand Down
Loading