Skip to content

Commit 897b015

Browse files
author
Christopher Degawa
authored
Fix more conflicts with SVT-AV1 for FFmpeg (#82)
Signed-off-by: Christopher Degawa <ccom@randomderp.com>
1 parent 09092bb commit 897b015

16 files changed

+93
-246
lines changed

Source/Lib/ASM_AVX2/EbNoiseExtractAVX2.c

Lines changed: 13 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -8,25 +8,18 @@
88
#include "immintrin.h"
99
#include "EbUtility.h"
1010

11-
EB_EXTERN EB_ALIGN(16) const uint8_t filter_type[] = {
11+
static EB_ALIGN(16) const uint8_t filter_type[] = {
1212
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
1313
};
1414

15-
EB_EXTERN EB_ALIGN(16) const uint8_t weak_chroma_filter[2][32] = {
15+
static EB_ALIGN(16) const uint8_t weak_chroma_filter[2][32] = {
1616
{ 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 },
1717
{ 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 },
1818
};
1919

20-
inline void eb_vp9_luma_weak_filter_avx2_intrin(
21-
__m256i top,
22-
__m256i curr,
23-
__m256i bottom,
24-
__m256i curr_prev,
25-
__m256i curr_next,
26-
uint8_t *ptr_denoised,
27-
uint8_t *ptr_noise
28-
)
29-
{
20+
static inline void eb_vp9_luma_weak_filter_avx2_intrin(
21+
__m256i top, __m256i curr, __m256i bottom, __m256i curr_prev,
22+
__m256i curr_next, uint8_t *ptr_denoised, uint8_t *ptr_noise) {
3023
__m256i top_first_half,
3124
bottom_first_half,
3225
filter_first_half,
@@ -74,21 +67,11 @@ inline void eb_vp9_luma_weak_filter_avx2_intrin(
7467
_mm256_storeu_si256((__m256i *)(ptr_denoised ), filter_first_half);
7568

7669
_mm256_storeu_si256((__m256i *)(ptr_noise), _mm256_subs_epu8(curr, filter_first_half));
77-
7870
}
79-
inline void eb_vp9_chroma_weak_luma_strong_filter_avx2_intrin(
80-
__m256i top,
81-
__m256i curr,
82-
__m256i bottom,
83-
__m256i curr_prev,
84-
__m256i curr_next,
85-
__m256i top_prev,
86-
__m256i top_next,
87-
__m256i bottom_prev,
88-
__m256i bottom_next,
89-
uint8_t *ptr_denoised
90-
)
91-
{
71+
static inline void eb_vp9_chroma_weak_luma_strong_filter_avx2_intrin(
72+
__m256i top, __m256i curr, __m256i bottom, __m256i curr_prev,
73+
__m256i curr_next, __m256i top_prev, __m256i top_next, __m256i bottom_prev,
74+
__m256i bottom_next, uint8_t *ptr_denoised) {
9275
__m256i filter_first_half,
9376
filter_second_half,
9477
curr_next_first_half,
@@ -174,22 +157,12 @@ inline void eb_vp9_chroma_weak_luma_strong_filter_avx2_intrin(
174157

175158
filter_first_half = _mm256_permute4x64_epi64(_mm256_packus_epi16(filter_first_half, filter_second_half), 216);
176159
_mm256_storeu_si256((__m256i *)(ptr_denoised), filter_first_half);
177-
178160
}
179161

180-
inline void eb_vp9_chroma_strong_avx2_intrin(
181-
__m256i top,
182-
__m256i curr,
183-
__m256i bottom,
184-
__m256i curr_prev,
185-
__m256i curr_next,
186-
__m256i top_prev,
187-
__m256i top_next,
188-
__m256i bottom_prev,
189-
__m256i bottom_next,
190-
uint8_t *ptr_denoised
191-
)
192-
{
162+
static inline void eb_vp9_chroma_strong_avx2_intrin(
163+
__m256i top, __m256i curr, __m256i bottom, __m256i curr_prev,
164+
__m256i curr_next, __m256i top_prev, __m256i top_next, __m256i bottom_prev,
165+
__m256i bottom_next, uint8_t *ptr_denoised) {
193166
__m256i curr_left_mid_first_halflo,
194167
curr_left_mid_first_halfhi,
195168
curr_prev_permutation,
@@ -266,7 +239,6 @@ inline void eb_vp9_chroma_strong_avx2_intrin(
266239

267240
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);
268241
_mm256_storeu_si256((__m256i *)(ptr_denoised), curr_left_mid_first_halflo);
269-
270242
}
271243
/*******************************************
272244
* eb_vp9_noise_extract_luma_weak

Source/Lib/ASM_AVX2/EbNoiseExtractAVX2.h

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -51,39 +51,6 @@ void eb_vp9_noise_extract_luma_strong_avx2_intrin(
5151
uint32_t sb_origin_y,
5252
uint32_t sb_origin_x);
5353

54-
void eb_vp9_chroma_strong_avx2_intrin(
55-
__m256i top,
56-
__m256i curr,
57-
__m256i bottom,
58-
__m256i curr_prev,
59-
__m256i curr_next,
60-
__m256i top_prev,
61-
__m256i top_next,
62-
__m256i bottom_prev,
63-
__m256i bottom_next,
64-
uint8_t *ptr_denoised);
65-
66-
void eb_vp9_luma_weak_filter_avx2_intrin(
67-
__m256i top,
68-
__m256i curr,
69-
__m256i bottom,
70-
__m256i curr_prev,
71-
__m256i curr_next,
72-
uint8_t *ptr_denoised,
73-
uint8_t *ptr_noise);
74-
75-
void eb_vp9_chroma_weak_luma_strong_filter_avx2_intrin(
76-
__m256i top,
77-
__m256i curr,
78-
__m256i bottom,
79-
__m256i curr_prev,
80-
__m256i curr_next,
81-
__m256i top_prev,
82-
__m256i top_next,
83-
__m256i bottom_prev,
84-
__m256i bottom_next,
85-
uint8_t *ptr_denoised);
86-
8754
#ifdef __cplusplus
8855
}
8956
#endif

Source/Lib/Codec/EbEncDecProcess.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4693,7 +4693,7 @@ static void perform_dist_rate_calc(
46934693
* of the segment-row (B) as this would block other
46944694
* threads from performing an update (A).
46954695
******************************************************/
4696-
EB_BOOL assign_enc_dec_segments(
4696+
static EB_BOOL assign_enc_dec_segments(
46974697
EncDecSegments *segment_ptr,
46984698
uint16_t *segment_in_out_index,
46994699
EncDecTasks *task_ptr,
@@ -4952,7 +4952,7 @@ static void perform_dist_rate_calc(
49524952
eb_vp9_release_mutex(encode_context_ptr->total_number_of_recon_frame_mutex);
49534953
}
49544954

4955-
void pad_ref_and_set_flags(
4955+
static void pad_ref_and_set_flags(
49564956
PictureControlSet *picture_control_set_ptr,
49574957
SequenceControlSet *sequence_control_set_ptr
49584958
)

Source/Lib/Codec/EbEncHandle.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ uint32_t lib_mutex_count = 0;
127127
uint8_t eb_vp9_num_groups = 0;
128128
#ifdef _WIN32
129129
GROUP_AFFINITY eb_vp9_group_affinity;
130-
EbBool alternate_groups = 0;
130+
EbBool eb_vp9_alternate_groups = 0;
131131
#elif defined(__linux__)
132132
cpu_set_t eb_vp9_group_affinity;
133133
typedef struct logicalProcessorGroup {
@@ -589,15 +589,15 @@ static EbErrorType eb_enc_handle_ctor(
589589
}
590590

591591
#ifdef _WIN32
592-
uint64_t get_affinity_mask(uint32_t lpnum) {
592+
static uint64_t get_affinity_mask(uint32_t lpnum) {
593593
uint64_t mask = 0x1;
594594
for (uint32_t i = lpnum - 1; i > 0; i--)
595595
mask += (uint64_t)1 << i;
596596
return mask;
597597
}
598598
#endif
599599

600-
void eb_set_thread_management_parameters( EbSvtVp9EncConfiguration *config_ptr){
600+
static void eb_set_thread_management_parameters( EbSvtVp9EncConfiguration *config_ptr){
601601

602602
uint32_t num_logical_processors = get_num_cores();
603603
#ifdef _WIN32
@@ -617,7 +617,7 @@ void eb_set_thread_management_parameters( EbSvtVp9EncConfiguration *config_ptr){
617617
uint32_t num_lp_per_group = num_logical_processors / eb_vp9_num_groups;
618618
if (config_ptr->target_socket == -1) {
619619
if (config_ptr->logical_processors > num_lp_per_group) {
620-
alternate_groups = EB_TRUE;
620+
eb_vp9_alternate_groups = EB_TRUE;
621621
SVT_LOG("SVT [WARNING]: -lp(logical processors) setting is ignored. Run on both sockets. \n");
622622
}
623623
else
@@ -1917,7 +1917,7 @@ static int32_t compute_default_intra_period(
19171917
return intra_period;
19181918
}
19191919

1920-
void set_default_configuration_parameters(
1920+
static void set_default_configuration_parameters(
19211921
SequenceControlSet *sequence_control_set_ptr) {
19221922

19231923
// No Cropping Window
@@ -1946,7 +1946,7 @@ static uint32_t compute_default_look_ahead(
19461946
return lad;
19471947
}
19481948

1949-
void copy_api_from_app(
1949+
static void copy_api_from_app(
19501950
SequenceControlSet *sequence_control_set_ptr,
19511951
EbSvtVp9EncConfiguration *p_component_parameter_structure) {
19521952

@@ -2405,7 +2405,7 @@ static EbErrorType verify_settings(
24052405
/**********************************
24062406
* Set Parameter
24072407
**********************************/
2408-
void set_param_based_on_input(
2408+
static void set_param_based_on_input(
24092409
SequenceControlSet *sequence_control_set_ptr) {
24102410

24112411
// Update picture width, and picture height

0 commit comments

Comments
 (0)