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
6c51fd3f
Commit
6c51fd3f
authored
Feb 02, 2008
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
const
Originally committed as revision 11816 to
svn://svn.ffmpeg.org/ffmpeg/trunk
parent
4d65da42
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
20 deletions
+20
-20
postprocess.c
libpostproc/postprocess.c
+9
-9
postprocess.h
libpostproc/postprocess.h
+3
-3
postprocess_template.c
libpostproc/postprocess_template.c
+8
-8
No files found.
libpostproc/postprocess.c
View file @
6c51fd3f
...
@@ -643,8 +643,8 @@ static av_always_inline void do_a_deblock_C(uint8_t *src, int step, int stride,
...
@@ -643,8 +643,8 @@ static av_always_inline void do_a_deblock_C(uint8_t *src, int step, int stride,
// minor note: the HAVE_xyz is messed up after that line so do not use it.
// minor note: the HAVE_xyz is messed up after that line so do not use it.
static
inline
void
postProcess
(
uint8_t
src
[],
int
srcStride
,
uint8_t
dst
[],
int
dstStride
,
int
width
,
int
height
,
static
inline
void
postProcess
(
const
uint8_t
src
[],
int
srcStride
,
uint8_t
dst
[],
int
dstStride
,
int
width
,
int
height
,
QP_STORE_T
QPs
[],
int
QPStride
,
int
isColor
,
pp_mode_t
*
vm
,
pp_context_t
*
vc
)
const
QP_STORE_T
QPs
[],
int
QPStride
,
int
isColor
,
pp_mode_t
*
vm
,
pp_context_t
*
vc
)
{
{
PPContext
*
c
=
(
PPContext
*
)
vc
;
PPContext
*
c
=
(
PPContext
*
)
vc
;
PPMode
*
ppMode
=
(
PPMode
*
)
vm
;
PPMode
*
ppMode
=
(
PPMode
*
)
vm
;
...
@@ -1021,10 +1021,10 @@ void pp_free_context(void *vc){
...
@@ -1021,10 +1021,10 @@ void pp_free_context(void *vc){
av_free
(
c
);
av_free
(
c
);
}
}
void
pp_postprocess
(
uint8_t
*
src
[
3
],
int
srcStride
[
3
],
void
pp_postprocess
(
const
uint8_t
*
src
[
3
],
const
int
srcStride
[
3
],
uint8_t
*
dst
[
3
],
int
dstStride
[
3
],
uint8_t
*
dst
[
3
],
const
int
dstStride
[
3
],
int
width
,
int
height
,
int
width
,
int
height
,
QP_STORE_T
*
QP_store
,
int
QPStride
,
const
QP_STORE_T
*
QP_store
,
int
QPStride
,
pp_mode_t
*
vm
,
void
*
vc
,
int
pict_type
)
pp_mode_t
*
vm
,
void
*
vc
,
int
pict_type
)
{
{
int
mbWidth
=
(
width
+
15
)
>>
4
;
int
mbWidth
=
(
width
+
15
)
>>
4
;
...
@@ -1046,16 +1046,16 @@ void pp_postprocess(uint8_t * src[3], int srcStride[3],
...
@@ -1046,16 +1046,16 @@ void pp_postprocess(uint8_t * src[3], int srcStride[3],
QP_store
=
c
->
forcedQPTable
;
QP_store
=
c
->
forcedQPTable
;
absQPStride
=
QPStride
=
0
;
absQPStride
=
QPStride
=
0
;
if
(
mode
->
lumMode
&
FORCE_QUANT
)
if
(
mode
->
lumMode
&
FORCE_QUANT
)
for
(
i
=
0
;
i
<
mbWidth
;
i
++
)
QP_stor
e
[
i
]
=
mode
->
forcedQuant
;
for
(
i
=
0
;
i
<
mbWidth
;
i
++
)
c
->
forcedQPTabl
e
[
i
]
=
mode
->
forcedQuant
;
else
else
for
(
i
=
0
;
i
<
mbWidth
;
i
++
)
QP_stor
e
[
i
]
=
1
;
for
(
i
=
0
;
i
<
mbWidth
;
i
++
)
c
->
forcedQPTabl
e
[
i
]
=
1
;
}
}
if
(
pict_type
&
PP_PICT_TYPE_QP2
){
if
(
pict_type
&
PP_PICT_TYPE_QP2
){
int
i
;
int
i
;
const
int
count
=
mbHeight
*
absQPStride
;
const
int
count
=
mbHeight
*
absQPStride
;
for
(
i
=
0
;
i
<
(
count
>>
2
);
i
++
){
for
(
i
=
0
;
i
<
(
count
>>
2
);
i
++
){
((
uint32_t
*
)
c
->
stdQPTable
)[
i
]
=
(((
uint32_t
*
)
QP_store
)[
i
]
>>
1
)
&
0x7F7F7F7F
;
((
uint32_t
*
)
c
->
stdQPTable
)[
i
]
=
(((
const
uint32_t
*
)
QP_store
)[
i
]
>>
1
)
&
0x7F7F7F7F
;
}
}
for
(
i
<<=
2
;
i
<
count
;
i
++
){
for
(
i
<<=
2
;
i
<
count
;
i
++
){
c
->
stdQPTable
[
i
]
=
QP_store
[
i
]
>>
1
;
c
->
stdQPTable
[
i
]
=
QP_store
[
i
]
>>
1
;
...
@@ -1081,7 +1081,7 @@ for(y=0; y<mbHeight; y++){
...
@@ -1081,7 +1081,7 @@ for(y=0; y<mbHeight; y++){
int
i
;
int
i
;
const
int
count
=
mbHeight
*
QPStride
;
const
int
count
=
mbHeight
*
QPStride
;
for
(
i
=
0
;
i
<
(
count
>>
2
);
i
++
){
for
(
i
=
0
;
i
<
(
count
>>
2
);
i
++
){
((
uint32_t
*
)
c
->
nonBQPTable
)[
i
]
=
((
uint32_t
*
)
QP_store
)[
i
]
&
0x3F3F3F3F
;
((
uint32_t
*
)
c
->
nonBQPTable
)[
i
]
=
((
const
uint32_t
*
)
QP_store
)[
i
]
&
0x3F3F3F3F
;
}
}
for
(
i
<<=
2
;
i
<
count
;
i
++
){
for
(
i
<<=
2
;
i
<
count
;
i
++
){
c
->
nonBQPTable
[
i
]
=
QP_store
[
i
]
&
0x3F
;
c
->
nonBQPTable
[
i
]
=
QP_store
[
i
]
&
0x3F
;
...
...
libpostproc/postprocess.h
View file @
6c51fd3f
...
@@ -48,10 +48,10 @@ extern const char *const pp_help; ///< a simple help text
...
@@ -48,10 +48,10 @@ extern const char *const pp_help; ///< a simple help text
extern
const
char
pp_help
[];
///< a simple help text
extern
const
char
pp_help
[];
///< a simple help text
#endif
#endif
void
pp_postprocess
(
uint8_t
*
src
[
3
],
int
srcStride
[
3
],
void
pp_postprocess
(
const
uint8_t
*
src
[
3
],
const
int
srcStride
[
3
],
uint8_t
*
dst
[
3
],
int
dstStride
[
3
],
uint8_t
*
dst
[
3
],
const
int
dstStride
[
3
],
int
horizontalSize
,
int
verticalSize
,
int
horizontalSize
,
int
verticalSize
,
QP_STORE_T
*
QP_store
,
int
QP_stride
,
const
QP_STORE_T
*
QP_store
,
int
QP_stride
,
pp_mode_t
*
mode
,
pp_context_t
*
ppContext
,
int
pict_type
);
pp_mode_t
*
mode
,
pp_context_t
*
ppContext
,
int
pict_type
);
...
...
libpostproc/postprocess_template.c
View file @
6c51fd3f
...
@@ -3180,8 +3180,8 @@ asm volatile(
...
@@ -3180,8 +3180,8 @@ asm volatile(
}
}
#endif //HAVE_MMX
#endif //HAVE_MMX
static
void
RENAME
(
postProcess
)(
uint8_t
src
[],
int
srcStride
,
uint8_t
dst
[],
int
dstStride
,
int
width
,
int
height
,
static
void
RENAME
(
postProcess
)(
const
uint8_t
src
[],
int
srcStride
,
uint8_t
dst
[],
int
dstStride
,
int
width
,
int
height
,
QP_STORE_T
QPs
[],
int
QPStride
,
int
isColor
,
PPContext
*
c
);
const
QP_STORE_T
QPs
[],
int
QPStride
,
int
isColor
,
PPContext
*
c
);
/**
/**
* Copies a block from src to dst and fixes the blacklevel.
* Copies a block from src to dst and fixes the blacklevel.
...
@@ -3189,7 +3189,7 @@ static void RENAME(postProcess)(uint8_t src[], int srcStride, uint8_t dst[], int
...
@@ -3189,7 +3189,7 @@ static void RENAME(postProcess)(uint8_t src[], int srcStride, uint8_t dst[], int
*/
*/
#undef SCALED_CPY
#undef SCALED_CPY
static
inline
void
RENAME
(
blockCopy
)(
uint8_t
dst
[],
int
dstStride
,
uint8_t
src
[],
int
srcStride
,
static
inline
void
RENAME
(
blockCopy
)(
uint8_t
dst
[],
int
dstStride
,
const
uint8_t
src
[],
int
srcStride
,
int
levelFix
,
int64_t
*
packedOffsetAndScale
)
int
levelFix
,
int64_t
*
packedOffsetAndScale
)
{
{
#ifndef HAVE_MMX
#ifndef HAVE_MMX
...
@@ -3346,8 +3346,8 @@ static inline void RENAME(duplicate)(uint8_t src[], int stride)
...
@@ -3346,8 +3346,8 @@ static inline void RENAME(duplicate)(uint8_t src[], int stride)
/**
/**
* Filters array of bytes (Y or U or V values)
* Filters array of bytes (Y or U or V values)
*/
*/
static
void
RENAME
(
postProcess
)(
uint8_t
src
[],
int
srcStride
,
uint8_t
dst
[],
int
dstStride
,
int
width
,
int
height
,
static
void
RENAME
(
postProcess
)(
const
uint8_t
src
[],
int
srcStride
,
uint8_t
dst
[],
int
dstStride
,
int
width
,
int
height
,
QP_STORE_T
QPs
[],
int
QPStride
,
int
isColor
,
PPContext
*
c2
)
const
QP_STORE_T
QPs
[],
int
QPStride
,
int
isColor
,
PPContext
*
c2
)
{
{
DECLARE_ALIGNED
(
8
,
PPContext
,
c
)
=
*
c2
;
//copy to stack for faster access
DECLARE_ALIGNED
(
8
,
PPContext
,
c
)
=
*
c2
;
//copy to stack for faster access
int
x
,
y
;
int
x
,
y
;
...
@@ -3462,7 +3462,7 @@ static void RENAME(postProcess)(uint8_t src[], int srcStride, uint8_t dst[], int
...
@@ -3462,7 +3462,7 @@ static void RENAME(postProcess)(uint8_t src[], int srcStride, uint8_t dst[], int
/* copy & deinterlace first row of blocks */
/* copy & deinterlace first row of blocks */
y
=-
BLOCK_SIZE
;
y
=-
BLOCK_SIZE
;
{
{
uint8_t
*
srcBlock
=
&
(
src
[
y
*
srcStride
]);
const
uint8_t
*
srcBlock
=
&
(
src
[
y
*
srcStride
]);
uint8_t
*
dstBlock
=
tempDst
+
dstStride
;
uint8_t
*
dstBlock
=
tempDst
+
dstStride
;
// From this point on it is guaranteed that we can read and write 16 lines downward
// From this point on it is guaranteed that we can read and write 16 lines downward
...
@@ -3545,13 +3545,13 @@ static void RENAME(postProcess)(uint8_t src[], int srcStride, uint8_t dst[], int
...
@@ -3545,13 +3545,13 @@ static void RENAME(postProcess)(uint8_t src[], int srcStride, uint8_t dst[], int
for
(
y
=
0
;
y
<
height
;
y
+=
BLOCK_SIZE
)
for
(
y
=
0
;
y
<
height
;
y
+=
BLOCK_SIZE
)
{
{
//1% speedup if these are here instead of the inner loop
//1% speedup if these are here instead of the inner loop
uint8_t
*
srcBlock
=
&
(
src
[
y
*
srcStride
]);
const
uint8_t
*
srcBlock
=
&
(
src
[
y
*
srcStride
]);
uint8_t
*
dstBlock
=
&
(
dst
[
y
*
dstStride
]);
uint8_t
*
dstBlock
=
&
(
dst
[
y
*
dstStride
]);
#ifdef HAVE_MMX
#ifdef HAVE_MMX
uint8_t
*
tempBlock1
=
c
.
tempBlocks
;
uint8_t
*
tempBlock1
=
c
.
tempBlocks
;
uint8_t
*
tempBlock2
=
c
.
tempBlocks
+
8
;
uint8_t
*
tempBlock2
=
c
.
tempBlocks
+
8
;
#endif
#endif
int8_t
*
QPptr
=
&
QPs
[(
y
>>
qpVShift
)
*
QPStride
];
const
int8_t
*
QPptr
=
&
QPs
[(
y
>>
qpVShift
)
*
QPStride
];
int8_t
*
nonBQPptr
=
&
c
.
nonBQPTable
[(
y
>>
qpVShift
)
*
FFABS
(
QPStride
)];
int8_t
*
nonBQPptr
=
&
c
.
nonBQPTable
[(
y
>>
qpVShift
)
*
FFABS
(
QPStride
)];
int
QP
=
0
;
int
QP
=
0
;
/* can we mess with a 8x16 block from srcBlock/dstBlock downwards and 1 line upwards
/* can we mess with a 8x16 block from srcBlock/dstBlock downwards and 1 line upwards
...
...
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