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
d36a2466
Commit
d36a2466
authored
Jun 05, 2002
by
Fabrice Bellard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added inlined put/add functions
Originally committed as revision 671 to
svn://svn.ffmpeg.org/ffmpeg/trunk
parent
ad31c904
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
118 additions
and
13 deletions
+118
-13
simple_idct.c
libavcodec/simple_idct.c
+116
-12
simple_idct.h
libavcodec/simple_idct.h
+2
-1
No files found.
libavcodec/simple_idct.c
View file @
d36a2466
...
...
@@ -22,7 +22,7 @@
written by Aaron Holtzman <aholtzma@ess.engr.uvic.ca>)
*/
#include "avcodec.h"
#include "dsputil.h"
#include "simple_idct.h"
#if 0
...
...
@@ -261,9 +261,83 @@ static inline void idctRowCondDC (int16_t * row)
}
#endif
/* not ARCH_ALPHA */
static
inline
void
idctSparseCol
(
int16_t
*
col
)
static
inline
void
idctSparseColPut
(
UINT8
*
dest
,
int
line_size
,
int16_t
*
col
)
{
int
a0
,
a1
,
a2
,
a3
,
b0
,
b1
,
b2
,
b3
;
UINT8
*
cm
=
cropTbl
+
MAX_NEG_CROP
;
/* XXX: I did that only to give same values as previous code */
a0
=
W4
*
(
col
[
8
*
0
]
+
((
1
<<
(
COL_SHIFT
-
1
))
/
W4
));
a1
=
a0
;
a2
=
a0
;
a3
=
a0
;
a0
+=
+
W2
*
col
[
8
*
2
];
a1
+=
+
W6
*
col
[
8
*
2
];
a2
+=
-
W6
*
col
[
8
*
2
];
a3
+=
-
W2
*
col
[
8
*
2
];
MUL16
(
b0
,
W1
,
col
[
8
*
1
]);
MUL16
(
b1
,
W3
,
col
[
8
*
1
]);
MUL16
(
b2
,
W5
,
col
[
8
*
1
]);
MUL16
(
b3
,
W7
,
col
[
8
*
1
]);
MAC16
(
b0
,
+
W3
,
col
[
8
*
3
]);
MAC16
(
b1
,
-
W7
,
col
[
8
*
3
]);
MAC16
(
b2
,
-
W1
,
col
[
8
*
3
]);
MAC16
(
b3
,
-
W5
,
col
[
8
*
3
]);
if
(
col
[
8
*
4
]){
a0
+=
+
W4
*
col
[
8
*
4
];
a1
+=
-
W4
*
col
[
8
*
4
];
a2
+=
-
W4
*
col
[
8
*
4
];
a3
+=
+
W4
*
col
[
8
*
4
];
}
if
(
col
[
8
*
5
])
{
MAC16
(
b0
,
+
W5
,
col
[
8
*
5
]);
MAC16
(
b1
,
-
W1
,
col
[
8
*
5
]);
MAC16
(
b2
,
+
W7
,
col
[
8
*
5
]);
MAC16
(
b3
,
+
W3
,
col
[
8
*
5
]);
}
if
(
col
[
8
*
6
]){
a0
+=
+
W6
*
col
[
8
*
6
];
a1
+=
-
W2
*
col
[
8
*
6
];
a2
+=
+
W2
*
col
[
8
*
6
];
a3
+=
-
W6
*
col
[
8
*
6
];
}
if
(
col
[
8
*
7
])
{
MAC16
(
b0
,
+
W7
,
col
[
8
*
7
]);
MAC16
(
b1
,
-
W5
,
col
[
8
*
7
]);
MAC16
(
b2
,
+
W3
,
col
[
8
*
7
]);
MAC16
(
b3
,
-
W1
,
col
[
8
*
7
]);
}
dest
[
0
]
=
cm
[(
a0
+
b0
)
>>
COL_SHIFT
];
dest
+=
line_size
;
dest
[
0
]
=
cm
[(
a1
+
b1
)
>>
COL_SHIFT
];
dest
+=
line_size
;
dest
[
0
]
=
cm
[(
a2
+
b2
)
>>
COL_SHIFT
];
dest
+=
line_size
;
dest
[
0
]
=
cm
[(
a3
+
b3
)
>>
COL_SHIFT
];
dest
+=
line_size
;
dest
[
0
]
=
cm
[(
a3
-
b3
)
>>
COL_SHIFT
];
dest
+=
line_size
;
dest
[
0
]
=
cm
[(
a2
-
b2
)
>>
COL_SHIFT
];
dest
+=
line_size
;
dest
[
0
]
=
cm
[(
a1
-
b1
)
>>
COL_SHIFT
];
dest
+=
line_size
;
dest
[
0
]
=
cm
[(
a0
-
b0
)
>>
COL_SHIFT
];
}
static
inline
void
idctSparseColAdd
(
UINT8
*
dest
,
int
line_size
,
int16_t
*
col
)
{
int
a0
,
a1
,
a2
,
a3
,
b0
,
b1
,
b2
,
b3
;
UINT8
*
cm
=
cropTbl
+
MAX_NEG_CROP
;
/* XXX: I did that only to give same values as previous code */
a0
=
W4
*
(
col
[
8
*
0
]
+
((
1
<<
(
COL_SHIFT
-
1
))
/
W4
));
...
...
@@ -314,14 +388,21 @@ static inline void idctSparseCol (int16_t * col)
MAC16
(
b3
,
-
W1
,
col
[
8
*
7
]);
}
col
[
8
*
0
]
=
(
a0
+
b0
)
>>
COL_SHIFT
;
col
[
8
*
7
]
=
(
a0
-
b0
)
>>
COL_SHIFT
;
col
[
8
*
1
]
=
(
a1
+
b1
)
>>
COL_SHIFT
;
col
[
8
*
6
]
=
(
a1
-
b1
)
>>
COL_SHIFT
;
col
[
8
*
2
]
=
(
a2
+
b2
)
>>
COL_SHIFT
;
col
[
8
*
5
]
=
(
a2
-
b2
)
>>
COL_SHIFT
;
col
[
8
*
3
]
=
(
a3
+
b3
)
>>
COL_SHIFT
;
col
[
8
*
4
]
=
(
a3
-
b3
)
>>
COL_SHIFT
;
dest
[
0
]
=
cm
[
dest
[
0
]
+
((
a0
+
b0
)
>>
COL_SHIFT
)];
dest
+=
line_size
;
dest
[
0
]
=
cm
[
dest
[
0
]
+
((
a1
+
b1
)
>>
COL_SHIFT
)];
dest
+=
line_size
;
dest
[
0
]
=
cm
[
dest
[
0
]
+
((
a2
+
b2
)
>>
COL_SHIFT
)];
dest
+=
line_size
;
dest
[
0
]
=
cm
[
dest
[
0
]
+
((
a3
+
b3
)
>>
COL_SHIFT
)];
dest
+=
line_size
;
dest
[
0
]
=
cm
[
dest
[
0
]
+
((
a3
-
b3
)
>>
COL_SHIFT
)];
dest
+=
line_size
;
dest
[
0
]
=
cm
[
dest
[
0
]
+
((
a2
-
b2
)
>>
COL_SHIFT
)];
dest
+=
line_size
;
dest
[
0
]
=
cm
[
dest
[
0
]
+
((
a1
-
b1
)
>>
COL_SHIFT
)];
dest
+=
line_size
;
dest
[
0
]
=
cm
[
dest
[
0
]
+
((
a0
-
b0
)
>>
COL_SHIFT
)];
}
#ifdef ARCH_ALPHA
...
...
@@ -389,16 +470,39 @@ void simple_idct (short *block)
}
}
/* XXX: suppress this mess */
void
simple_idct_put
(
UINT8
*
dest
,
int
line_size
,
DCTELEM
*
block
)
{
simple_idct
(
block
);
put_pixels_clamped
(
block
,
dest
,
line_size
);
}
void
simple_idct_add
(
UINT8
*
dest
,
int
line_size
,
DCTELEM
*
block
)
{
simple_idct
(
block
);
add_pixels_clamped
(
block
,
dest
,
line_size
);
}
#else
void
simple_idct
(
short
*
block
)
void
simple_idct_put
(
UINT8
*
dest
,
int
line_size
,
INT16
*
block
)
{
int
i
;
for
(
i
=
0
;
i
<
8
;
i
++
)
idctRowCondDC
(
block
+
i
*
8
);
for
(
i
=
0
;
i
<
8
;
i
++
)
idctSparseColPut
(
dest
+
i
,
line_size
,
block
+
i
);
}
void
simple_idct_add
(
UINT8
*
dest
,
int
line_size
,
INT16
*
block
)
{
int
i
;
for
(
i
=
0
;
i
<
8
;
i
++
)
idctRowCondDC
(
block
+
i
*
8
);
for
(
i
=
0
;
i
<
8
;
i
++
)
idctSparseCol
(
block
+
i
);
idctSparseCol
Add
(
dest
+
i
,
line_size
,
block
+
i
);
}
#endif
...
...
libavcodec/simple_idct.h
View file @
d36a2466
...
...
@@ -18,5 +18,6 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
void
simple_idct
(
short
*
block
);
void
simple_idct_put
(
UINT8
*
dest
,
int
line_size
,
INT16
*
block
);
void
simple_idct_add
(
UINT8
*
dest
,
int
line_size
,
INT16
*
block
);
void
simple_idct_mmx
(
short
*
block
);
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