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
2d420087
Commit
2d420087
authored
Jul 07, 2012
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sanm: make use of dsputil
About 27% faster decoding. Signed-off-by:
Paul B Mahol
<
onemda@gmail.com
>
parent
acdf9a6c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
7 deletions
+17
-7
sanm.c
libavcodec/sanm.c
+17
-7
No files found.
libavcodec/sanm.c
View file @
2d420087
...
...
@@ -25,6 +25,7 @@
#include "avcodec.h"
#include "bytestream.h"
#include "libavutil/bswap.h"
#include "libavcodec/dsputil.h"
#include "sanm_data.h"
#define NGLYPHS 256
...
...
@@ -449,8 +450,7 @@ static int old_codec37(SANMVideoContext *ctx, int top,
int
code
;
if
(
skip_run
)
{
skip_run
--
;
for
(
k
=
0
;
k
<
4
;
k
++
)
memcpy
(
dst
+
i
+
k
*
stride
,
prev
+
i
+
k
*
stride
,
4
);
copy_block4
(
dst
+
i
,
prev
+
i
,
stride
,
stride
,
4
);
continue
;
}
if
(
bytestream2_get_bytes_left
(
&
ctx
->
gb
)
<
1
)
...
...
@@ -501,8 +501,7 @@ static int old_codec37(SANMVideoContext *ctx, int top,
int
code
;
if
(
skip_run
)
{
skip_run
--
;
for
(
k
=
0
;
k
<
4
;
k
++
)
memcpy
(
dst
+
i
+
k
*
stride
,
prev
+
i
+
k
*
stride
,
4
);
copy_block4
(
dst
+
i
,
prev
+
i
,
stride
,
stride
,
4
);
continue
;
}
code
=
bytestream2_get_byte
(
&
ctx
->
gb
);
...
...
@@ -769,10 +768,21 @@ static int decode_nop(SANMVideoContext *ctx)
static
void
copy_block
(
uint16_t
*
pdest
,
uint16_t
*
psrc
,
int
block_size
,
int
pitch
)
{
int
y
;
uint8_t
*
dst
=
(
uint8_t
*
)
pdest
;
uint8_t
*
src
=
(
uint8_t
*
)
psrc
;
int
stride
=
pitch
*
2
;
for
(
y
=
0
;
y
<
block_size
;
y
++
,
pdest
+=
pitch
,
psrc
+=
pitch
)
memcpy
(
pdest
,
psrc
,
block_size
*
sizeof
(
pdest
[
0
]));
switch
(
block_size
)
{
case
2
:
copy_block4
(
dst
,
src
,
stride
,
stride
,
2
);
break
;
case
4
:
copy_block8
(
dst
,
src
,
stride
,
stride
,
4
);
break
;
case
8
:
copy_block16
(
dst
,
src
,
stride
,
stride
,
8
);
break
;
}
}
static
void
fill_block
(
uint16_t
*
pdest
,
uint16_t
color
,
int
block_size
,
int
pitch
)
...
...
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