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
70e74e00
Commit
70e74e00
authored
Dec 20, 2013
by
Stefano Sabatini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavfi/hue: force table initialization for the first frame
parent
b07a5e9b
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
vf_hue.c
libavfilter/vf_hue.c
+6
-2
No files found.
libavfilter/vf_hue.c
View file @
70e74e00
...
@@ -73,6 +73,7 @@ typedef struct {
...
@@ -73,6 +73,7 @@ typedef struct {
AVExpr
*
brightness_pexpr
;
AVExpr
*
brightness_pexpr
;
int
hsub
;
int
hsub
;
int
vsub
;
int
vsub
;
int
is_first
;
int32_t
hue_sin
;
int32_t
hue_sin
;
int32_t
hue_cos
;
int32_t
hue_cos
;
double
var_values
[
VAR_NB
];
double
var_values
[
VAR_NB
];
...
@@ -207,6 +208,7 @@ static av_cold int init(AVFilterContext *ctx)
...
@@ -207,6 +208,7 @@ static av_cold int init(AVFilterContext *ctx)
"H_expr:%s h_deg_expr:%s s_expr:%s b_expr:%s
\n
"
,
"H_expr:%s h_deg_expr:%s s_expr:%s b_expr:%s
\n
"
,
hue
->
hue_expr
,
hue
->
hue_deg_expr
,
hue
->
saturation_expr
,
hue
->
brightness_expr
);
hue
->
hue_expr
,
hue
->
hue_deg_expr
,
hue
->
saturation_expr
,
hue
->
brightness_expr
);
compute_sin_and_cos
(
hue
);
compute_sin_and_cos
(
hue
);
hue
->
is_first
=
1
;
return
0
;
return
0
;
}
}
...
@@ -356,10 +358,10 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *inpic)
...
@@ -356,10 +358,10 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *inpic)
hue
->
var_values
[
VAR_T
],
(
int
)
hue
->
var_values
[
VAR_N
]);
hue
->
var_values
[
VAR_T
],
(
int
)
hue
->
var_values
[
VAR_N
]);
compute_sin_and_cos
(
hue
);
compute_sin_and_cos
(
hue
);
if
(
old_hue_sin
!=
hue
->
hue_sin
||
old_hue_cos
!=
hue
->
hue_cos
)
if
(
hue
->
is_first
||
(
old_hue_sin
!=
hue
->
hue_sin
||
old_hue_cos
!=
hue
->
hue_cos
)
)
create_chrominance_lut
(
hue
,
hue
->
hue_cos
,
hue
->
hue_sin
);
create_chrominance_lut
(
hue
,
hue
->
hue_cos
,
hue
->
hue_sin
);
if
(
old_brightness
!=
hue
->
brightness
&&
hue
->
brightness
)
if
(
hue
->
is_first
||
(
old_brightness
!=
hue
->
brightness
&&
hue
->
brightness
)
)
create_luma_lut
(
hue
);
create_luma_lut
(
hue
);
if
(
!
direct
)
{
if
(
!
direct
)
{
...
@@ -383,6 +385,8 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *inpic)
...
@@ -383,6 +385,8 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *inpic)
if
(
!
direct
)
if
(
!
direct
)
av_frame_free
(
&
inpic
);
av_frame_free
(
&
inpic
);
hue
->
is_first
=
0
;
return
ff_filter_frame
(
outlink
,
outpic
);
return
ff_filter_frame
(
outlink
,
outpic
);
}
}
...
...
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