Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
7f9b67bc
Commit
7f9b67bc
authored
Nov 21, 2017
by
Martin Vignali
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec/huffyuvdsp(enc) : move duplicate macro to a template file
parent
4a6aa6d1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
80 additions
and
109 deletions
+80
-109
huffyuvdsp.asm
libavcodec/x86/huffyuvdsp.asm
+1
-55
huffyuvdsp_init.c
libavcodec/x86/huffyuvdsp_init.c
+1
-0
huffyuvdsp_template.asm
libavcodec/x86/huffyuvdsp_template.asm
+76
-0
huffyuvencdsp.asm
libavcodec/x86/huffyuvencdsp.asm
+2
-54
No files found.
libavcodec/x86/huffyuvdsp.asm
View file @
7f9b67bc
...
...
@@ -24,61 +24,7 @@
SECTION
.
text
%macro
INT16_LOOP
2
; %1 = a/u (aligned/unaligned), %2 = add/sub
movd
m4
,
maskd
SPLATW
m4
,
m4
add
wd
,
wd
test
wq
,
2
*
mmsize
-
1
jz
%%
.
tomainloop
push
tmpq
%%
.
wordloop
:
sub
wq
,
2
%ifidn
%2
,
add
mov
tmpw
,
[
srcq
+
wq
]
add
tmpw
,
[
dstq
+
wq
]
%else
mov
tmpw
,
[
src1q
+
wq
]
sub
tmpw
,
[
src2q
+
wq
]
%endif
and
tmpw
,
maskw
mov
[
dstq
+
wq
]
,
tmpw
test
wq
,
2
*
mmsize
-
1
jnz
%%
.
wordloop
pop
tmpq
%%
.
tomainloop
:
%ifidn
%2
,
add
add
srcq
,
wq
%else
add
src1q
,
wq
add
src2q
,
wq
%endif
add
dstq
,
wq
neg
wq
jz
%%
.
end
%%
.
loop
:
%ifidn
%2
,
add
mov%1
m0
,
[
srcq
+
wq
]
mov%1
m1
,
[
dstq
+
wq
]
mov%1
m2
,
[
srcq
+
wq
+
mmsize
]
mov%1
m3
,
[
dstq
+
wq
+
mmsize
]
%else
mov%1
m0
,
[
src1q
+
wq
]
mov%1
m1
,
[
src2q
+
wq
]
mov%1
m2
,
[
src1q
+
wq
+
mmsize
]
mov%1
m3
,
[
src2q
+
wq
+
mmsize
]
%endif
p%2
w
m0
,
m1
p%2
w
m2
,
m3
pand
m0
,
m4
pand
m2
,
m4
mov%1
[
dstq
+
wq
]
,
m0
mov%1
[
dstq
+
wq
+
mmsize
]
,
m2
add
wq
,
2
*
mmsize
jl
%%
.
loop
%%
.
end
:
RET
%endmacro
%include
"libavcodec/x86/huffyuvdsp_template.asm"
%if
ARCH_X86_32
INIT_MMX
mmx
...
...
libavcodec/x86/huffyuvdsp_init.c
View file @
7f9b67bc
...
...
@@ -28,6 +28,7 @@
void
ff_add_int16_mmx
(
uint16_t
*
dst
,
const
uint16_t
*
src
,
unsigned
mask
,
int
w
);
void
ff_add_int16_sse2
(
uint16_t
*
dst
,
const
uint16_t
*
src
,
unsigned
mask
,
int
w
);
void
ff_add_hfyu_left_pred_bgr32_mmx
(
uint8_t
*
dst
,
const
uint8_t
*
src
,
intptr_t
w
,
uint8_t
*
left
);
void
ff_add_hfyu_left_pred_bgr32_sse2
(
uint8_t
*
dst
,
const
uint8_t
*
src
,
...
...
libavcodec/x86/huffyuvdsp_template.asm
0 → 100644
View file @
7f9b67bc
;******************************************************************************
;* SIMD-optimized HuffYUV functions
;* Copyright (c) 2008 Loren Merritt
;* Copyright (c) 2014 Christophe Gisquet
;*
;* This file is part of FFmpeg.
;*
;* FFmpeg is free software; you can redistribute it and/or
;* modify it under the terms of the GNU Lesser General Public
;* License as published by the Free Software Foundation; either
;* version 2.1 of the License, or (at your option) any later version.
;*
;* FFmpeg is distributed in the hope that it will be useful,
;* but WITHOUT ANY WARRANTY; without even the implied warranty of
;* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;* Lesser General Public License for more details.
;*
;* You should have received a copy of the GNU Lesser General Public
;* License along with FFmpeg; if not, write to the Free Software
;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
;******************************************************************************
%macro
INT16_LOOP
2
; %1 = a/u (aligned/unaligned), %2 = add/sub
movd
m4
,
maskd
SPLATW
m4
,
m4
add
wd
,
wd
test
wq
,
2
*
mmsize
-
1
jz
%%
.
tomainloop
push
tmpq
%%
.
wordloop
:
sub
wq
,
2
%ifidn
%2
,
add
mov
tmpw
,
[
srcq
+
wq
]
add
tmpw
,
[
dstq
+
wq
]
%else
mov
tmpw
,
[
src1q
+
wq
]
sub
tmpw
,
[
src2q
+
wq
]
%endif
and
tmpw
,
maskw
mov
[
dstq
+
wq
]
,
tmpw
test
wq
,
2
*
mmsize
-
1
jnz
%%
.
wordloop
pop
tmpq
%%
.
tomainloop
:
%ifidn
%2
,
add
add
srcq
,
wq
%else
add
src1q
,
wq
add
src2q
,
wq
%endif
add
dstq
,
wq
neg
wq
jz
%%
.
end
%%
.
loop
:
%ifidn
%2
,
add
mov%1
m0
,
[
srcq
+
wq
]
mov%1
m1
,
[
dstq
+
wq
]
mov%1
m2
,
[
srcq
+
wq
+
mmsize
]
mov%1
m3
,
[
dstq
+
wq
+
mmsize
]
%else
mov%1
m0
,
[
src1q
+
wq
]
mov%1
m1
,
[
src2q
+
wq
]
mov%1
m2
,
[
src1q
+
wq
+
mmsize
]
mov%1
m3
,
[
src2q
+
wq
+
mmsize
]
%endif
p%2
w
m0
,
m1
p%2
w
m2
,
m3
pand
m0
,
m4
pand
m2
,
m4
mov%1
[
dstq
+
wq
]
,
m0
mov%1
[
dstq
+
wq
+
mmsize
]
,
m2
add
wq
,
2
*
mmsize
jl
%%
.
loop
%%
.
end
:
RET
%endmacro
libavcodec/x86/huffyuvencdsp.asm
View file @
7f9b67bc
...
...
@@ -27,62 +27,10 @@
SECTION
.
text
%include
"libavcodec/x86/huffyuvdsp_template.asm"
; void ff_diff_int16(uint8_t *dst, const uint8_t *src1, const uint8_t *src2,
; unsigned mask, int w);
%macro
INT16_LOOP
2
; %1 = a/u (aligned/unaligned), %2 = add/sub
movd
m4
,
maskd
SPLATW
m4
,
m4
add
wd
,
wd
test
wq
,
2
*
mmsize
-
1
jz
%%
.
tomainloop
push
tmpq
%%
.
wordloop
:
sub
wq
,
2
%ifidn
%2
,
add
mov
tmpw
,
[
srcq
+
wq
]
add
tmpw
,
[
dstq
+
wq
]
%else
mov
tmpw
,
[
src1q
+
wq
]
sub
tmpw
,
[
src2q
+
wq
]
%endif
and
tmpw
,
maskw
mov
[
dstq
+
wq
]
,
tmpw
test
wq
,
2
*
mmsize
-
1
jnz
%%
.
wordloop
pop
tmpq
%%
.
tomainloop
:
%ifidn
%2
,
add
add
srcq
,
wq
%else
add
src1q
,
wq
add
src2q
,
wq
%endif
add
dstq
,
wq
neg
wq
jz
%%
.
end
%%
.
loop
:
%ifidn
%2
,
add
mov%1
m0
,
[
srcq
+
wq
]
mov%1
m1
,
[
dstq
+
wq
]
mov%1
m2
,
[
srcq
+
wq
+
mmsize
]
mov%1
m3
,
[
dstq
+
wq
+
mmsize
]
%else
mov%1
m0
,
[
src1q
+
wq
]
mov%1
m1
,
[
src2q
+
wq
]
mov%1
m2
,
[
src1q
+
wq
+
mmsize
]
mov%1
m3
,
[
src2q
+
wq
+
mmsize
]
%endif
p%2
w
m0
,
m1
p%2
w
m2
,
m3
pand
m0
,
m4
pand
m2
,
m4
mov%1
[
dstq
+
wq
]
,
m0
mov%1
[
dstq
+
wq
+
mmsize
]
,
m2
add
wq
,
2
*
mmsize
jl
%%
.
loop
%%
.
end
:
RET
%endmacro
%if
ARCH_X86_32
INIT_MMX
mmx
...
...
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