Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
FFmpeg
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
libremedia
Tethys
FFmpeg
Commits
6ab6c7c3
Commit
6ab6c7c3
authored
18 years ago
by
Luca Barbato
Browse files
Options
Downloads
Patches
Plain Diff
make postproc use avutil
Originally committed as revision 6524 to
svn://svn.ffmpeg.org/ffmpeg/trunk
parent
4bef236b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
libpostproc/Makefile
+1
-1
1 addition, 1 deletion
libpostproc/Makefile
libpostproc/postprocess.c
+19
-23
19 additions, 23 deletions
libpostproc/postprocess.c
libpostproc/postprocess_internal.h
+8
-6
8 additions, 6 deletions
libpostproc/postprocess_internal.h
with
28 additions
and
30 deletions
libpostproc/Makefile
+
1
−
1
View file @
6ab6c7c3
...
...
@@ -15,7 +15,7 @@ SHARED_OBJS=postprocess_pic.o
HEADERS
=
postprocess.h
CFLAGS
=
-I
..
-I
$(
SRC_PATH
)
/libav
codec
$(
OPTFLAGS
)
CFLAGS
=
-I
..
-I
$(
SRC_PATH
)
/libav
util
$(
OPTFLAGS
)
# -I/usr/X11R6/include/
include
$(SRC_PATH)/common.mak
...
...
This diff is collapsed.
Click to expand it.
libpostproc/postprocess.c
+
19
−
23
View file @
6ab6c7c3
...
...
@@ -72,6 +72,7 @@ try to unroll inner for(x=0 ... loop to avoid these damn if(x ... checks
//Changelog: use the Subversion log
#include
"config.h"
#include
"avutil.h"
#include
<inttypes.h>
#include
<stdio.h>
#include
<stdlib.h>
...
...
@@ -96,10 +97,6 @@ try to unroll inner for(x=0 ... loop to avoid these damn if(x ... checks
#include
<altivec.h>
#endif
#ifndef HAVE_MEMALIGN
#define memalign(a,b) malloc(b)
#endif
#define MIN(a,b) ((a) > (b) ? (b) : (a))
#define MAX(a,b) ((a) < (b) ? (b) : (a))
#define ABS(a) ((a) > 0 ? (a) : (-(a)))
...
...
@@ -428,7 +425,7 @@ static inline void horizX1Filter(uint8_t *src, int stride, int QP)
if
(
lut
==
NULL
)
{
int
i
;
lut
=
(
uint64_t
*
)
memalign
(
8
,
256
*
8
);
lut
=
av_malloc
(
256
*
8
);
for
(
i
=
0
;
i
<
256
;
i
++
)
{
int
v
=
i
<
128
?
2
*
i
:
2
*
(
i
-
256
);
...
...
@@ -771,7 +768,7 @@ pp_mode_t *pp_get_mode_by_name_and_quality(char *name, int quality)
struct
PPMode
*
ppMode
;
char
*
filterToken
;
ppMode
=
memalign
(
8
,
sizeof
(
PPMode
));
ppMode
=
av_malloc
(
sizeof
(
PPMode
));
ppMode
->
lumMode
=
0
;
ppMode
->
chromMode
=
0
;
...
...
@@ -949,20 +946,19 @@ pp_mode_t *pp_get_mode_by_name_and_quality(char *name, int quality)
if
(
ppMode
->
error
)
{
fprintf
(
stderr
,
"%d errors in postprocess string
\"
%s
\"\n
"
,
ppMode
->
error
,
name
);
free
(
ppMode
);
av_
free
(
ppMode
);
return
NULL
;
}
return
ppMode
;
}
void
pp_free_mode
(
pp_mode_t
*
mode
){
if
(
mode
)
free
(
mode
);
av_
free
(
mode
);
}
static
void
reallocAlign
(
void
**
p
,
int
alignment
,
int
size
){
if
(
*
p
)
free
(
*
p
);
*
p
=
memalign
(
alignment
,
size
);
memset
(
*
p
,
0
,
size
);
av_free
(
p
);
*
p
=
av_mallocz
(
size
);
}
static
void
reallocBuffers
(
PPContext
*
c
,
int
width
,
int
height
,
int
stride
,
int
qpStride
){
...
...
@@ -1002,7 +998,7 @@ static void global_init(void){
}
pp_context_t
*
pp_get_context
(
int
width
,
int
height
,
int
cpuCaps
){
PPContext
*
c
=
memalign
(
32
,
sizeof
(
PPContext
));
PPContext
*
c
=
av_malloc
(
sizeof
(
PPContext
));
int
stride
=
(
width
+
15
)
&
(
~
15
);
//assumed / will realloc if needed
int
qpStride
=
(
width
+
15
)
/
16
+
2
;
//assumed / will realloc if needed
...
...
@@ -1029,21 +1025,21 @@ void pp_free_context(void *vc){
PPContext
*
c
=
(
PPContext
*
)
vc
;
int
i
;
for
(
i
=
0
;
i
<
3
;
i
++
)
free
(
c
->
tempBlured
[
i
]);
for
(
i
=
0
;
i
<
3
;
i
++
)
free
(
c
->
tempBluredPast
[
i
]);
for
(
i
=
0
;
i
<
3
;
i
++
)
av_
free
(
c
->
tempBlured
[
i
]);
for
(
i
=
0
;
i
<
3
;
i
++
)
av_
free
(
c
->
tempBluredPast
[
i
]);
free
(
c
->
tempBlocks
);
free
(
c
->
yHistogram
);
free
(
c
->
tempDst
);
free
(
c
->
tempSrc
);
free
(
c
->
deintTemp
);
free
(
c
->
stdQPTable
);
free
(
c
->
nonBQPTable
);
free
(
c
->
forcedQPTable
);
av_
free
(
c
->
tempBlocks
);
av_
free
(
c
->
yHistogram
);
av_
free
(
c
->
tempDst
);
av_
free
(
c
->
tempSrc
);
av_
free
(
c
->
deintTemp
);
av_
free
(
c
->
stdQPTable
);
av_
free
(
c
->
nonBQPTable
);
av_
free
(
c
->
forcedQPTable
);
memset
(
c
,
0
,
sizeof
(
PPContext
));
free
(
c
);
av_
free
(
c
);
}
void
pp_postprocess
(
uint8_t
*
src
[
3
],
int
srcStride
[
3
],
...
...
This diff is collapsed.
Click to expand it.
libpostproc/postprocess_internal.h
+
8
−
6
View file @
6ab6c7c3
...
...
@@ -21,6 +21,8 @@
* internal api header.
*/
#include
"avutil.h"
#define V_DEBLOCK 0x01
#define H_DEBLOCK 0x02
#define DERING 0x04
...
...
@@ -124,8 +126,8 @@ typedef struct PPContext{
*/
uint64_t
*
yHistogram
;
uint64_t
__attribute__
((
aligned
(
8
)))
packedYOffset
;
uint64_t
__attribute__
((
aligned
(
8
)))
packedYScale
;
DECLARE_ALIGNED
(
8
,
uint64_t
,
packedYOffset
)
;
DECLARE_ALIGNED
(
8
,
uint64_t
,
packedYScale
)
;
/** Temporal noise reducing buffers */
uint8_t
*
tempBlured
[
3
];
...
...
@@ -137,11 +139,11 @@ typedef struct PPContext{
uint8_t
*
deintTemp
;
uint64_t
__attribute__
((
aligned
(
8
)))
pQPb
;
uint64_t
__attribute__
((
aligned
(
8
)))
pQPb2
;
DECLARE_ALIGNED
(
8
,
uint64_t
,
pQPb
)
;
DECLARE_ALIGNED
(
8
,
uint64_t
,
pQPb2
)
;
uint64_t
__attribute__
((
aligned
(
8
)))
mmxDcOffset
[
64
];
uint64_t
__attribute__
((
aligned
(
8
)))
mmxDcThreshold
[
64
];
DECLARE_ALIGNED
(
8
,
uint64_t
,
mmxDcOffset
[
64
]
)
;
DECLARE_ALIGNED
(
8
,
uint64_t
,
mmxDcThreshold
[
64
]
)
;
QP_STORE_T
*
stdQPTable
;
///< used to fix MPEG2 style qscale
QP_STORE_T
*
nonBQPTable
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment