History

Fold ALIGN 16 and the function label into WELS_EXTERN

This simplifies the structure for all x86 assembly functions, reducing the amount of duplicated code structure.

Martin Storsjö committed 12 years ago

Commit eec96821 parent 918b21121 files · +75 −411Browse files

Showing the changes to codec/processing/src (3 of 21 files). Show all

Unified · Split

3 files
  1. codec/processing/src/asm/denoisefilter.asm +2 −6
  2. codec/processing/src/asm/downsample_bilinear.asm +9 −29
  3. codec/processing/src/asm/vaa.asm +12 −36
codec/processing/src/asm/denoisefilter.asm+2−6
@@ -163,8 +163,6 @@ SECTION .text · 162 unmodified lines
163163 paddw %3, %2
164164 %endmacro
165165
166−ALIGN 16
167−WELS_EXTERN BilateralLumaFilter8_sse2
168166 ;***********************************************************************
169167 ; BilateralLumaFilter8_sse2(uint8_t *pixels, int stride);
170168 ;***********************************************************************
@@ -173,7 +171,7 @@ WELS_EXTERN BilateralLumaFilter8_sse2 · 2 unmodified lines
173171 ; 6 7 8
174172 ; 0: the center point
175173
176−BilateralLumaFilter8_sse2:
174+WELS_EXTERN BilateralLumaFilter8_sse2
177175
178176 push r3
179177 %assign push_num 1
@@ -219,7 +217,6 @@ BilateralLumaFilter8_sse2: · 39 unmodified lines
219217
220218 ret
221219
222−WELS_EXTERN WaverageChromaFilter8_sse2
223220 ;***********************************************************************
224221 ; void WaverageChromaFilter8_sse2(uint8_t *pixels, int stride);
225222 ;***********************************************************************
@@ -230,8 +227,7 @@ WELS_EXTERN WaverageChromaFilter8_sse2 · 4 unmodified lines
230227 ;1 2 4 2 1
231228 ;1 1 2 1 1
232229
233−ALIGN 16
234−WaverageChromaFilter8_sse2:
230+WELS_EXTERN WaverageChromaFilter8_sse2
235231
236232 push r3
237233
codec/processing/src/asm/downsample_bilinear.asm+9−29
@@ -66,22 +66,18 @@ shufb_mask_high: · 65 unmodified lines
6666 db 01h, 80h, 03h, 80h, 05h, 80h, 07h, 80h, 09h, 80h, 0bh, 80h, 0dh, 80h, 0fh, 80h
6767
6868
69−ALIGN 16
70−
7169 ;***********************************************************************
7270 ; Code
7371 ;***********************************************************************
7472
7573 SECTION .text
7674
77−WELS_EXTERN DyadicBilinearDownsamplerWidthx32_sse
7875 ;***********************************************************************
7976 ; void DyadicBilinearDownsamplerWidthx32_sse( unsigned char* pDst, const int iDstStride,
8077 ; unsigned char* pSrc, const int iSrcStride,
8178 ; const int iSrcWidth, const int iSrcHeight );
8279 ;***********************************************************************
83−ALIGN 16
84−DyadicBilinearDownsamplerWidthx32_sse:
80+WELS_EXTERN DyadicBilinearDownsamplerWidthx32_sse
8581 push ebx
8682 push edx
8783 push esi
@@ -227,14 +223,12 @@ DyadicBilinearDownsamplerWidthx32_sse: · 139 unmodified lines
227223 pop ebx
228224 ret
229225
230−WELS_EXTERN DyadicBilinearDownsamplerWidthx16_sse
231226 ;***********************************************************************
232227 ; void DyadicBilinearDownsamplerWidthx16_sse( unsigned char* pDst, const int iDstStride,
233228 ; unsigned char* pSrc, const int iSrcStride,
234229 ; const int iSrcWidth, const int iSrcHeight );
235230 ;***********************************************************************
236−ALIGN 16
237−DyadicBilinearDownsamplerWidthx16_sse:
231+WELS_EXTERN DyadicBilinearDownsamplerWidthx16_sse
238232 push ebx
239233 push edx
240234 push esi
@@ -331,14 +325,12 @@ DyadicBilinearDownsamplerWidthx16_sse: · 90 unmodified lines
331325 pop ebx
332326 ret
333327
334−WELS_EXTERN DyadicBilinearDownsamplerWidthx8_sse
335328 ;***********************************************************************
336329 ; void DyadicBilinearDownsamplerWidthx8_sse( unsigned char* pDst, const int iDstStride,
337330 ; unsigned char* pSrc, const int iSrcStride,
338331 ; const int iSrcWidth, const int iSrcHeight );
339332 ;***********************************************************************
340−ALIGN 16
341−DyadicBilinearDownsamplerWidthx8_sse:
333+WELS_EXTERN DyadicBilinearDownsamplerWidthx8_sse
342334 push ebx
343335 push edx
344336 push esi
@@ -422,14 +414,12 @@ DyadicBilinearDownsamplerWidthx8_sse: · 77 unmodified lines
422414
423415
424416 ; got about 50% improvement over DyadicBilinearDownsamplerWidthx32_sse
425−WELS_EXTERN DyadicBilinearDownsamplerWidthx32_ssse3
426417 ;***********************************************************************
427418 ; void DyadicBilinearDownsamplerWidthx32_ssse3( unsigned char* pDst, const int iDstStride,
428419 ; unsigned char* pSrc, const int iSrcStride,
429420 ; const int iSrcWidth, const int iSrcHeight );
430421 ;***********************************************************************
431−ALIGN 16
432−DyadicBilinearDownsamplerWidthx32_ssse3:
422+WELS_EXTERN DyadicBilinearDownsamplerWidthx32_ssse3
433423 push ebx
434424 push edx
435425 push esi
@@ -533,14 +523,12 @@ DyadicBilinearDownsamplerWidthx32_ssse3: · 97 unmodified lines
533523 pop ebx
534524 ret
535525
536−WELS_EXTERN DyadicBilinearDownsamplerWidthx16_ssse3
537526 ;***********************************************************************
538527 ; void DyadicBilinearDownsamplerWidthx16_ssse3( unsigned char* pDst, const int iDstStride,
539528 ; unsigned char* pSrc, const int iSrcStride,
540529 ; const int iSrcWidth, const int iSrcHeight );
541530 ;***********************************************************************
542−ALIGN 16
543−DyadicBilinearDownsamplerWidthx16_ssse3:
531+WELS_EXTERN DyadicBilinearDownsamplerWidthx16_ssse3
544532 push ebx
545533 push edx
546534 push esi
@@ -623,14 +611,12 @@ DyadicBilinearDownsamplerWidthx16_ssse3: · 76 unmodified lines
623611 ret
624612
625613 ; got about 65% improvement over DyadicBilinearDownsamplerWidthx32_sse
626−WELS_EXTERN DyadicBilinearDownsamplerWidthx32_sse4
627614 ;***********************************************************************
628615 ; void DyadicBilinearDownsamplerWidthx32_sse4( unsigned char* pDst, const int iDstStride,
629616 ; unsigned char* pSrc, const int iSrcStride,
630617 ; const int iSrcWidth, const int iSrcHeight );
631618 ;***********************************************************************
632−ALIGN 16
633−DyadicBilinearDownsamplerWidthx32_sse4:
619+WELS_EXTERN DyadicBilinearDownsamplerWidthx32_sse4
634620 push ebx
635621 push edx
636622 push esi
@@ -733,14 +719,12 @@ DyadicBilinearDownsamplerWidthx32_sse4: · 96 unmodified lines
733719 pop ebx
734720 ret
735721
736−WELS_EXTERN DyadicBilinearDownsamplerWidthx16_sse4
737722 ;***********************************************************************
738723 ; void DyadicBilinearDownsamplerWidthx16_sse4( unsigned char* pDst, const int iDstStride,
739724 ; unsigned char* pSrc, const int iSrcStride,
740725 ; const int iSrcWidth, const int iSrcHeight );
741726 ;***********************************************************************
742−ALIGN 16
743−DyadicBilinearDownsamplerWidthx16_sse4:
727+WELS_EXTERN DyadicBilinearDownsamplerWidthx16_sse4
744728 push ebx
745729 push edx
746730 push esi
@@ -825,7 +809,6 @@ DyadicBilinearDownsamplerWidthx16_sse4: · 78 unmodified lines
825809
826810
827811
828−WELS_EXTERN GeneralBilinearAccurateDownsampler_sse2
829812 ;**************************************************************************************************************
830813 ;int GeneralBilinearAccurateDownsampler_sse2( unsigned char* pDst, const int iDstStride, const int iDstWidth, const int iDstHeight,
831814 ; unsigned char* pSrc, const int iSrcStride, const int iSrcWidth, const int iSrcHeight,
@@ -833,8 +816,7 @@ WELS_EXTERN GeneralBilinearAccurateDownsampler_sse2 · 1 unmodified line
833816 ;{
834817 ;**************************************************************************************************************
835818
836−ALIGN 16
837−GeneralBilinearAccurateDownsampler_sse2:
819+WELS_EXTERN GeneralBilinearAccurateDownsampler_sse2
838820 push ebp
839821 push esi
840822 push edi
@@ -1029,7 +1011,6 @@ LAST_ROW_END: · 188 unmodified lines
10291011
10301012
10311013
1032−WELS_EXTERN GeneralBilinearFastDownsampler_sse2
10331014 ;**************************************************************************************************************
10341015 ;int GeneralBilinearFastDownsampler_sse2( unsigned char* pDst, const int iDstStride, const int iDstWidth, const int iDstHeight,
10351016 ; unsigned char* pSrc, const int iSrcStride, const int iSrcWidth, const int iSrcHeight,
@@ -1037,8 +1018,7 @@ WELS_EXTERN GeneralBilinearFastDownsampler_sse2 · 1 unmodified line
10371018 ;{
10381019 ;**************************************************************************************************************
10391020
1040−ALIGN 16
1041−GeneralBilinearFastDownsampler_sse2:
1021+WELS_EXTERN GeneralBilinearFastDownsampler_sse2
10421022 push ebp
10431023 push esi
10441024 push edi
codec/processing/src/asm/vaa.asm+12−36
@@ -255,12 +255,10 @@ SECTION .text · 254 unmodified lines
255255
256256 %ifdef X86_32
257257
258−WELS_EXTERN SampleVariance16x16_sse2
259258 ;***********************************************************************
260259 ; void SampleVariance16x16_sse2( uint8_t * y_ref, int32_t y_ref_stride, uint8_t * y_src, int32_t y_src_stride,SMotionTextureUnit* pMotionTexture );
261260 ;***********************************************************************
262−ALIGN 16
263−SampleVariance16x16_sse2:
261+WELS_EXTERN SampleVariance16x16_sse2
264262 push esi
265263 push edi
266264 push ebx
@@ -357,15 +355,13 @@ SampleVariance16x16_sse2: · 90 unmodified lines
357355
358356
359357
360−WELS_EXTERN VAACalcSad_sse2
361358 ;*************************************************************************************************************
362359 ;void VAACalcSad_sse2( const uint8_t *cur_data, const uint8_t *ref_data, int32_t iPicWidth, int32_t iPicHeight
363360 ; int32_t iPicStride, int32_t *psadframe, int32_t *psad8x8)
364361 ;*************************************************************************************************************
365362
366363
367−ALIGN 16
368−VAACalcSad_sse2:
364+WELS_EXTERN VAACalcSad_sse2
369365 %define cur_data esp + pushsize + 4
370366 %define ref_data esp + pushsize + 8
371367 %define iPicWidth esp + pushsize + 12
@@ -451,12 +447,10 @@ width_loop: · 79 unmodified lines
451447
452448 %else ;64-bit
453449
454−WELS_EXTERN SampleVariance16x16_sse2
455450 ;***********************************************************************
456451 ; void SampleVariance16x16_sse2( uint8_t * y_ref, int32_t y_ref_stride, uint8_t * y_src, int32_t y_src_stride,SMotionTextureUnit* pMotionTexture );
457452 ;***********************************************************************
458−ALIGN 16
459−SampleVariance16x16_sse2:
453+WELS_EXTERN SampleVariance16x16_sse2
460454 %define SUM r10;[esp]
461455 %define SUM_CUR r11;[esp+4]
462456 %define SQR r13;[esp+8]
@@ -549,15 +543,13 @@ SampleVariance16x16_sse2: · 86 unmodified lines
549543 ret
550544
551545
552−WELS_EXTERN VAACalcSad_sse2
553546 ;*************************************************************************************************************
554547 ;void VAACalcSad_sse2( const uint8_t *cur_data, const uint8_t *ref_data, int32_t iPicWidth, int32_t iPicHeight
555548 ; int32_t iPicStride, int32_t *psadframe, int32_t *psad8x8)
556549 ;*************************************************************************************************************
557550
558551
559−ALIGN 16
560−VAACalcSad_sse2:
552+WELS_EXTERN VAACalcSad_sse2
561553 %define cur_data r0
562554 %define ref_data r1
563555 %define iPicWidth r2
@@ -647,15 +639,13 @@ width_loop: · 83 unmodified lines
647639
648640
649641 %ifdef X86_32
650−WELS_EXTERN VAACalcSadVar_sse2
651642 ;*************************************************************************************************************
652643 ;void VAACalcSadVar_sse2( const uint8_t *cur_data, const uint8_t *ref_data, int32_t iPicWidth, int32_t iPicHeight
653644 ; int32_t iPicStride, int32_t *psadframe, int32_t *psad8x8, int32_t *psum16x16, int32_t *psqsum16x16)
654645 ;*************************************************************************************************************
655646
656647
657−ALIGN 16
658−VAACalcSadVar_sse2:
648+WELS_EXTERN VAACalcSadVar_sse2
659649 %define localsize 8
660650 %define cur_data esp + pushsize + localsize + 4
661651 %define ref_data esp + pushsize + localsize + 8
@@ -783,15 +773,13 @@ var_width_loop: · 121 unmodified lines
783773
784774 %else ;64-bit
785775
786−WELS_EXTERN VAACalcSadVar_sse2
787776 ;*************************************************************************************************************
788777 ;void VAACalcSadVar_sse2( const uint8_t *cur_data, const uint8_t *ref_data, int32_t iPicWidth, int32_t iPicHeight
789778 ; int32_t iPicStride, int32_t *psadframe, int32_t *psad8x8, int32_t *psum16x16, int32_t *psqsum16x16)
790779 ;*************************************************************************************************************
791780
792781
793−ALIGN 16
794−VAACalcSadVar_sse2:
782+WELS_EXTERN VAACalcSadVar_sse2
795783 %define cur_data arg1 ;r0
796784 %define ref_data arg2 ;r1
797785 %define iPicWidth arg3 ;r2
@@ -926,15 +914,13 @@ var_width_loop: · 128 unmodified lines
926914
927915 %ifdef X86_32
928916
929−WELS_EXTERN VAACalcSadSsd_sse2
930917 ;*************************************************************************************************************
931918 ;void VAACalcSadSsd_sse2(const uint8_t *cur_data, const uint8_t *ref_data, int32_t iPicWidth, int32_t iPicHeight,
932919 ; int32_t iPicStride,int32_t *psadframe, int32_t *psad8x8, int32_t *psum16x16, int32_t *psqsum16x16, int32_t *psqdiff16x16)
933920 ;*************************************************************************************************************
934921
935922
936−ALIGN 16
937−VAACalcSadSsd_sse2:
923+WELS_EXTERN VAACalcSadSsd_sse2
938924 %define localsize 12
939925 %define cur_data esp + pushsize + localsize + 4
940926 %define ref_data esp + pushsize + localsize + 8
@@ -1082,15 +1068,13 @@ sqdiff_width_loop: · 141 unmodified lines
10821068 %else
10831069
10841070
1085−WELS_EXTERN VAACalcSadSsd_sse2
10861071 ;*************************************************************************************************************
10871072 ;void VAACalcSadSsd_sse2(const uint8_t *cur_data, const uint8_t *ref_data, int32_t iPicWidth, int32_t iPicHeight,
10881073 ; int32_t iPicStride,int32_t *psadframe, int32_t *psad8x8, int32_t *psum16x16, int32_t *psqsum16x16, int32_t *psqdiff16x16)
10891074 ;*************************************************************************************************************
10901075
10911076
1092−ALIGN 16
1093−VAACalcSadSsd_sse2:
1077+WELS_EXTERN VAACalcSadSsd_sse2
10941078 %define localsize 12
10951079 %define cur_data arg1;r0
10961080 %define ref_data arg2;r1
@@ -1246,15 +1230,13 @@ sqdiff_width_loop: · 149 unmodified lines
12461230 %endif
12471231
12481232 %ifdef X86_32
1249−WELS_EXTERN VAACalcSadBgd_sse2
12501233 ;*************************************************************************************************************
12511234 ;void VAACalcSadBgd_sse2(const uint8_t *cur_data, const uint8_t *ref_data, int32_t iPicWidth, int32_t iPicHeight,
12521235 ; int32_t iPicStride, int32_t *psadframe, int32_t *psad8x8, int32_t *p_sd8x8, uint8_t *p_mad8x8)
12531236 ;*************************************************************************************************************
12541237
12551238
1256−ALIGN 16
1257−VAACalcSadBgd_sse2:
1239+WELS_EXTERN VAACalcSadBgd_sse2
12581240 %define localsize 12
12591241 %define cur_data esp + pushsize + localsize + 4
12601242 %define ref_data esp + pushsize + localsize + 8
@@ -1425,7 +1407,6 @@ bgd_width_loop: · 164 unmodified lines
14251407
14261408
14271409
1428−WELS_EXTERN VAACalcSadSsdBgd_sse2
14291410 ;*************************************************************************************************************
14301411 ;void VAACalcSadSsdBgd_sse2(const uint8_t *cur_data, const uint8_t *ref_data, int32_t iPicWidth, int32_t iPicHeight,
14311412 ; int32_t iPicStride, int32_t *psadframe, int32_t *psad8x8, int32_t *psum16x16, int32_t *psqsum16x16,
@@ -1433,8 +1414,7 @@ WELS_EXTERN VAACalcSadSsdBgd_sse2 · 1 unmodified line
14331414 ;*************************************************************************************************************
14341415
14351416
1436−ALIGN 16
1437−VAACalcSadSsdBgd_sse2:
1417+WELS_EXTERN VAACalcSadSsdBgd_sse2
14381418 %define localsize 16
14391419 %define cur_data esp + pushsize + localsize + 4
14401420 %define ref_data esp + pushsize + localsize + 8
@@ -1656,15 +1636,13 @@ sqdiff_bgd_width_loop: · 215 unmodified lines
16561636 ret
16571637 %else
16581638
1659−WELS_EXTERN VAACalcSadBgd_sse2
16601639 ;*************************************************************************************************************
16611640 ;void VAACalcSadBgd_sse2(const uint8_t *cur_data, const uint8_t *ref_data, int32_t iPicWidth, int32_t iPicHeight,
16621641 ; int32_t iPicStride, int32_t *psadframe, int32_t *psad8x8, int32_t *p_sd8x8, uint8_t *p_mad8x8)
16631642 ;*************************************************************************************************************
16641643
16651644
1666−ALIGN 16
1667−VAACalcSadBgd_sse2:
1645+WELS_EXTERN VAACalcSadBgd_sse2
16681646 %define cur_data arg1;
16691647 %define ref_data arg2;
16701648 %define iPicWidth arg3;
@@ -1827,7 +1805,6 @@ bgd_width_loop: · 156 unmodified lines
18271805
18281806
18291807
1830−WELS_EXTERN VAACalcSadSsdBgd_sse2
18311808 ;*************************************************************************************************************
18321809 ;void VAACalcSadSsdBgd_sse2(const uint8_t *cur_data, const uint8_t *ref_data, int32_t iPicWidth, int32_t iPicHeight,
18331810 ; int32_t iPicStride, int32_t *psadframe, int32_t *psad8x8, int32_t *psum16x16, int32_t *psqsum16x16,
@@ -1835,8 +1812,7 @@ WELS_EXTERN VAACalcSadSsdBgd_sse2 · 1 unmodified line
18351812 ;*************************************************************************************************************
18361813
18371814
1838−ALIGN 16
1839−VAACalcSadSsdBgd_sse2:
1815+WELS_EXTERN VAACalcSadSsdBgd_sse2
18401816 %define cur_data arg1;
18411817 %define ref_data arg2;
18421818 %define iPicWidth arg3;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t