Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
F
flac
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Hugo Beauzée-Luyssen
flac
Commits
faafa4c8
Commit
faafa4c8
authored
Aug 31, 2018
by
lvqcl
Committed by
Erik de Castro Lopo
Sep 02, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cosmetic changes in lpc_asm.nasm and utf8.c
parent
0897458f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
38 deletions
+30
-38
src/libFLAC/ia32/lpc_asm.nasm
src/libFLAC/ia32/lpc_asm.nasm
+29
-29
src/share/utf8/utf8.c
src/share/utf8/utf8.c
+1
-9
No files found.
src/libFLAC/ia32/lpc_asm.nasm
View file @
faafa4c8
...
...
@@ -637,7 +637,7 @@ cident FLAC__lpc_compute_autocorrelation_asm_ia32_sse_lag_16_old
sub
esp
,
32
;ASSERT(lag > 0)
;ASSERT(lag <= 1
2
)
;ASSERT(lag <= 1
6
)
;ASSERT(lag <= data_len)
;ASSERT(data_len > 0)
...
...
@@ -654,7 +654,7 @@ cident FLAC__lpc_compute_autocorrelation_asm_ia32_sse_lag_16_old
movss
xmm0
,
[
eax
]
; xmm0 = 0,0,0,data[0]
add
eax
,
4
movaps
xmm1
,
xmm0
; xmm1 = 0,0,0,data[0]
shufps
xmm0
,
xmm0
,
0
; xmm0 == data[sample],data[sample],data[sample],data[sample] = data[0],data[0],data[0],data[0]
shufps
xmm0
,
xmm0
,
0
; xmm0 == data[sample],data[sample],data[sample],data[sample] = data[0],data[0],data[0],data[0]
xorps
xmm2
,
xmm2
; xmm2 = 0,0,0,0
xorps
xmm3
,
xmm3
; xmm3 = 0,0,0,0
xorps
xmm4
,
xmm4
; xmm4 = 0,0,0,0
...
...
@@ -666,7 +666,7 @@ cident FLAC__lpc_compute_autocorrelation_asm_ia32_sse_lag_16_old
ALIGN
16
.loop_start:
; start by reading the next sample
movss
xmm0
,
[
eax
]
; xmm0 = 0,0,0,data[sample]
movss
xmm0
,
[
eax
]
; xmm0 = 0,0,0,data[sample]
add
eax
,
4
shufps
xmm0
,
xmm0
,
0
; xmm0 = data[sample],data[sample],data[sample],data[sample]
...
...
@@ -699,7 +699,7 @@ cident FLAC__lpc_compute_autocorrelation_asm_ia32_sse_lag_16_old
jnz
.loop_start
.loop_end:
; store autoc
mov
edx
,
[
ebp
+
20
]
; edx == autoc
mov
edx
,
[
ebp
+
20
]
; edx == autoc
movups
[
edx
],
xmm5
movups
[
edx
+
16
],
xmm6
movaps
xmm5
,
[
esp
]
...
...
@@ -1520,7 +1520,7 @@ cident FLAC__lpc_compute_residual_from_qlp_coefficients_wide_asm_ia32
mov
ebx
,
[
esp
+
24
]
; ebx = data_len
test
ebx
,
ebx
jz
near
.end
; do nothing if data_len == 0
jz
near
.end
; do nothing if data_len == 0
.begin:
mov
eax
,
[
esp
+
32
]
; eax = order
...
...
@@ -1530,13 +1530,13 @@ cident FLAC__lpc_compute_residual_from_qlp_coefficients_wide_asm_ia32
mov
esi
,
[
esp
+
40
]
; esi = residual[]
mov
edi
,
[
esp
+
20
]
; edi = data[]
mov
ecx
,
[
esp
+
28
]
; ecx = qlp_coeff[]
mov
ebp
,
[
ecx
]
; ebp = qlp_coeff[0]
mov
ebp
,
[
ecx
]
; ebp = qlp_coeff[0]
mov
eax
,
[
edi
-
4
]
; eax = data[-1]
mov
ecx
,
[
esp
+
36
]
; cl = lp_quantization
ALIGN
16
.i_1_loop_i:
imul
ebp
; edx:eax = qlp_coeff[0] * (FLAC__int64)data[i-1]
shrd
eax
,
edx
,
cl
; 0 <= lp_quantization <= 15
imul
ebp
; edx:eax = qlp_coeff[0] * (FLAC__int64)data[i-1]
shrd
eax
,
edx
,
cl
; 0 <= lp_quantization <= 15
neg
eax
add
eax
,
[
edi
]
mov
[
esi
],
eax
...
...
@@ -1577,15 +1577,15 @@ cident FLAC__lpc_compute_residual_from_qlp_coefficients_wide_asm_ia32
;edi = data[]
;ebp = @address
mov
eax
,
[
ebx
+
124
]
; eax = qlp_coeff[31]
mov
eax
,
[
ebx
+
124
]
; eax = qlp_coeff[31]
imul
dword
[
edi
-
128
]
; edx:eax = qlp_coeff[31] * data[i-32]
add
ecx
,
eax
adc
esi
,
edx
; sum += qlp_coeff[31] * data[i-32]
adc
esi
,
edx
; sum += qlp_coeff[31] * data[i-32]
mov
eax
,
[
ebx
+
120
]
; eax = qlp_coeff[30]
mov
eax
,
[
ebx
+
120
]
; eax = qlp_coeff[30]
imul
dword
[
edi
-
124
]
; edx:eax = qlp_coeff[30] * data[i-31]
add
ecx
,
eax
adc
esi
,
edx
; sum += qlp_coeff[30] * data[i-31]
adc
esi
,
edx
; sum += qlp_coeff[30] * data[i-31]
mov
eax
,
[
ebx
+
116
]
imul
dword
[
edi
-
120
]
...
...
@@ -1732,23 +1732,23 @@ cident FLAC__lpc_compute_residual_from_qlp_coefficients_wide_asm_ia32
add
ecx
,
eax
adc
esi
,
edx
mov
eax
,
[
ebx
]
; eax = qlp_coeff[ 0] (NOTE: one byte missing from instruction)
mov
eax
,
[
ebx
]
; eax = qlp_coeff[ 0] (NOTE: one byte missing from instruction)
imul
dword
[
edi
-
4
]
; edx:eax = qlp_coeff[ 0] * data[i- 1]
add
ecx
,
eax
adc
esi
,
edx
; sum += qlp_coeff[ 0] * data[i- 1]
adc
esi
,
edx
; sum += qlp_coeff[ 0] * data[i- 1]
.jumper_0:
mov
edx
,
ecx
;esi:edx = sum
mov
ecx
,
[
esp
+
36
]
; cl = lp_quantization
shrd
edx
,
esi
,
cl
; edx = (sum >> lp_quantization)
shrd
edx
,
esi
,
cl
; edx = (sum >> lp_quantization)
;eax = --
;ecx = --
;edx = sum >> lp_q
;esi = --
neg
edx
; edx = -(sum >> lp_quantization)
neg
edx
; edx = -(sum >> lp_quantization)
mov
eax
,
[
esp
+
40
]
; residual[] - data[]
add
edx
,
[
edi
]
; edx = data[i] - (sum >> lp_quantization)
add
edx
,
[
edi
]
; edx = data[i] - (sum >> lp_quantization)
mov
[
edi
+
eax
],
edx
add
edi
,
4
...
...
@@ -1801,7 +1801,7 @@ cident FLAC__lpc_restore_signal_wide_asm_ia32
mov
ebx
,
[
esp
+
24
]
; ebx = data_len
test
ebx
,
ebx
jz
near
.end
; do nothing if data_len == 0
jz
near
.end
; do nothing if data_len == 0
.begin:
mov
eax
,
[
esp
+
32
]
; eax = order
...
...
@@ -1811,13 +1811,13 @@ cident FLAC__lpc_restore_signal_wide_asm_ia32
mov
esi
,
[
esp
+
20
]
; esi = residual[]
mov
edi
,
[
esp
+
40
]
; edi = data[]
mov
ecx
,
[
esp
+
28
]
; ecx = qlp_coeff[]
mov
ebp
,
[
ecx
]
; ebp = qlp_coeff[0]
mov
ebp
,
[
ecx
]
; ebp = qlp_coeff[0]
mov
eax
,
[
edi
-
4
]
; eax = data[-1]
mov
ecx
,
[
esp
+
36
]
; cl = lp_quantization
ALIGN
16
.x87_1_loop_i:
imul
ebp
; edx:eax = qlp_coeff[0] * (FLAC__int64)data[i-1]
shrd
eax
,
edx
,
cl
; 0 <= lp_quantization <= 15
imul
ebp
; edx:eax = qlp_coeff[0] * (FLAC__int64)data[i-1]
shrd
eax
,
edx
,
cl
; 0 <= lp_quantization <= 15
;
add
eax
,
[
esi
]
mov
[
edi
],
eax
...
...
@@ -1858,15 +1858,15 @@ cident FLAC__lpc_restore_signal_wide_asm_ia32
;edi = data[]
;ebp = @address
mov
eax
,
[
ebx
+
124
]
; eax = qlp_coeff[31]
mov
eax
,
[
ebx
+
124
]
; eax = qlp_coeff[31]
imul
dword
[
edi
-
128
]
; edx:eax = qlp_coeff[31] * data[i-32]
add
ecx
,
eax
adc
esi
,
edx
; sum += qlp_coeff[31] * data[i-32]
adc
esi
,
edx
; sum += qlp_coeff[31] * data[i-32]
mov
eax
,
[
ebx
+
120
]
; eax = qlp_coeff[30]
mov
eax
,
[
ebx
+
120
]
; eax = qlp_coeff[30]
imul
dword
[
edi
-
124
]
; edx:eax = qlp_coeff[30] * data[i-31]
add
ecx
,
eax
adc
esi
,
edx
; sum += qlp_coeff[30] * data[i-31]
adc
esi
,
edx
; sum += qlp_coeff[30] * data[i-31]
mov
eax
,
[
ebx
+
116
]
imul
dword
[
edi
-
120
]
...
...
@@ -2013,16 +2013,16 @@ cident FLAC__lpc_restore_signal_wide_asm_ia32
add
ecx
,
eax
adc
esi
,
edx
mov
eax
,
[
ebx
]
; eax = qlp_coeff[ 0] (NOTE: one byte missing from instruction)
mov
eax
,
[
ebx
]
; eax = qlp_coeff[ 0] (NOTE: one byte missing from instruction)
imul
dword
[
edi
-
4
]
; edx:eax = qlp_coeff[ 0] * data[i- 1]
add
ecx
,
eax
adc
esi
,
edx
; sum += qlp_coeff[ 0] * data[i- 1]
adc
esi
,
edx
; sum += qlp_coeff[ 0] * data[i- 1]
.jumper_0:
mov
edx
,
ecx
;esi:edx = sum
mov
ecx
,
[
esp
+
36
]
; cl = lp_quantization
shrd
edx
,
esi
,
cl
; edx = (sum >> lp_quantization)
shrd
edx
,
esi
,
cl
; edx = (sum >> lp_quantization)
;eax = --
;ecx = --
;edx = sum >> lp_q
...
...
@@ -2030,7 +2030,7 @@ cident FLAC__lpc_restore_signal_wide_asm_ia32
;
mov
eax
,
[
esp
+
20
]
; residual[] - data[]
add
edx
,
[
edi
+
eax
]
; edx = residual[i] + (sum >> lp_quantization)
mov
[
edi
],
edx
; data[i] = residual[i] + (sum >> lp_quantization)
mov
[
edi
],
edx
; data[i] = residual[i] + (sum >> lp_quantization)
add
edi
,
4
dec
dword
[
esp
+
24
]
...
...
src/share/utf8/utf8.c
View file @
faafa4c8
...
...
@@ -49,26 +49,22 @@ int utf8_encode(const char *from, char **to)
len
=
MultiByteToWideChar
(
CP_ACP
,
MB_PRECOMPOSED
,
from
,
-
1
,
NULL
,
0
);
if
(
len
==
0
)
break
;
unicode
=
(
wchar_t
*
)
safe_malloc_mul_2op_
((
size_t
)
len
,
sizeof
(
wchar_t
));
if
(
unicode
==
NULL
)
break
;
len
=
MultiByteToWideChar
(
CP_ACP
,
MB_PRECOMPOSED
,
from
,
-
1
,
unicode
,
len
);
if
(
len
==
0
)
break
;
len
=
WideCharToMultiByte
(
CP_UTF8
,
0
,
unicode
,
-
1
,
NULL
,
0
,
NULL
,
NULL
);
if
(
len
==
0
)
break
;
utf8
=
(
char
*
)
safe_malloc_mul_2op_
((
size_t
)
len
,
sizeof
(
char
));
if
(
utf8
==
NULL
)
break
;
len
=
WideCharToMultiByte
(
CP_UTF8
,
0
,
unicode
,
-
1
,
utf8
,
len
,
NULL
,
NULL
);
if
(
len
==
0
)
break
;
ret
=
0
;
}
while
(
0
);
free
(
unicode
);
if
(
ret
==
0
)
{
...
...
@@ -92,19 +88,15 @@ int utf8_decode(const char *from, char **to)
len
=
MultiByteToWideChar
(
CP_UTF8
,
0
,
from
,
-
1
,
NULL
,
0
);
if
(
len
==
0
)
break
;
unicode
=
(
wchar_t
*
)
safe_malloc_mul_2op_
((
size_t
)
len
,
sizeof
(
wchar_t
));
if
(
unicode
==
NULL
)
break
;
len
=
MultiByteToWideChar
(
CP_UTF8
,
0
,
from
,
-
1
,
unicode
,
len
);
if
(
len
==
0
)
break
;
len
=
WideCharToMultiByte
(
CP_ACP
,
WC_COMPOSITECHECK
,
unicode
,
-
1
,
NULL
,
0
,
NULL
,
NULL
);
if
(
len
==
0
)
break
;
acp
=
(
char
*
)
safe_malloc_mul_2op_
((
size_t
)
len
,
sizeof
(
char
));
if
(
acp
==
NULL
)
break
;
len
=
WideCharToMultiByte
(
CP_ACP
,
WC_COMPOSITECHECK
,
unicode
,
-
1
,
acp
,
len
,
NULL
,
NULL
);
if
(
len
==
0
)
break
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment