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
4df01d5d
Commit
4df01d5d
authored
Jan 09, 2015
by
Arwa Arif
Committed by
Michael Niedermayer
Jan 10, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avfilter: Factorize the use of norm_qscale in pp7
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
aab74a38
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
13 deletions
+16
-13
internal.h
libavfilter/internal.h
+15
-0
vf_pp7.c
libavfilter/vf_pp7.c
+1
-13
No files found.
libavfilter/internal.h
View file @
4df01d5d
...
...
@@ -31,6 +31,7 @@
#include "thread.h"
#include "version.h"
#include "video.h"
#include "libavcodec/avcodec.h"
#define POOL_SIZE 32
typedef
struct
AVFilterPool
{
...
...
@@ -374,4 +375,18 @@ AVFilterContext *ff_filter_alloc(const AVFilter *filter, const char *inst_name);
*/
void
ff_filter_graph_remove_filter
(
AVFilterGraph
*
graph
,
AVFilterContext
*
filter
);
/**
* Normalize the qscale factor
*/
static
inline
int
ff_norm_qscale
(
int
qscale
,
int
type
)
{
switch
(
type
)
{
case
FF_QSCALE_TYPE_MPEG1
:
return
qscale
;
case
FF_QSCALE_TYPE_MPEG2
:
return
qscale
>>
1
;
case
FF_QSCALE_TYPE_H264
:
return
qscale
>>
2
;
case
FF_QSCALE_TYPE_VP56
:
return
(
63
-
qscale
+
2
)
>>
2
;
}
return
qscale
;
}
#endif
/* AVFILTER_INTERNAL_H */
libavfilter/vf_pp7.c
View file @
4df01d5d
...
...
@@ -33,7 +33,6 @@
#include "libavutil/pixdesc.h"
#include "internal.h"
#include "vf_pp7.h"
#include "libavcodec/avcodec.h"
enum
mode
{
MODE_HARD
,
...
...
@@ -87,17 +86,6 @@ static const int thres[16] = {
N
/
(
SN2
*
SN0
),
N
/
(
SN2
*
SN2
),
N
/
(
SN2
*
SN0
),
N
/
(
SN2
*
SN2
),
};
static
inline
int
norm_qscale
(
int
qscale
,
int
type
)
{
switch
(
type
)
{
case
FF_QSCALE_TYPE_MPEG1
:
return
qscale
;
case
FF_QSCALE_TYPE_MPEG2
:
return
qscale
>>
1
;
case
FF_QSCALE_TYPE_H264
:
return
qscale
>>
2
;
case
FF_QSCALE_TYPE_VP56
:
return
(
63
-
qscale
+
2
)
>>
2
;
}
return
qscale
;
}
static
void
init_thres2
(
PP7Context
*
p
)
{
int
qp
,
i
;
...
...
@@ -259,7 +247,7 @@ static void filter(PP7Context *p, uint8_t *dst, uint8_t *src,
qp
=
p
->
qp
;
else
{
qp
=
qp_store
[
(
FFMIN
(
x
,
width
-
1
)
>>
qps
)
+
(
FFMIN
(
y
,
height
-
1
)
>>
qps
)
*
qp_stride
];
qp
=
norm_qscale
(
qp
,
p
->
qscale_type
);
qp
=
ff_
norm_qscale
(
qp
,
p
->
qscale_type
);
}
for
(;
x
<
end
;
x
++
)
{
const
int
index
=
x
+
y
*
stride
+
(
8
-
3
)
*
(
1
+
stride
)
+
8
;
//FIXME silly offset
...
...
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