Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
ffmpeg
Project
Project
Details
Activity
Releases
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Stefan Westerfeld
ffmpeg
Commits
71ed92e9
Commit
71ed92e9
authored
Nov 04, 2022
by
Clément Bœsch
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avfilter/paletteuse: name target color arg consistently in colormap functions
parent
755c427f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
vf_paletteuse.c
libavfilter/vf_paletteuse.c
+4
-4
No files found.
libavfilter/vf_paletteuse.c
View file @
71ed92e9
...
...
@@ -180,7 +180,7 @@ static av_always_inline int diff(const uint32_t a, const uint32_t b, const int t
}
}
static
av_always_inline
uint8_t
colormap_nearest_bruteforce
(
const
uint32_t
*
palette
,
const
uint32_t
argb
,
const
int
trans_thresh
)
static
av_always_inline
uint8_t
colormap_nearest_bruteforce
(
const
uint32_t
*
palette
,
const
uint32_t
target
,
const
int
trans_thresh
)
{
int
i
,
pal_id
=
-
1
,
min_dist
=
INT_MAX
;
...
...
@@ -188,7 +188,7 @@ static av_always_inline uint8_t colormap_nearest_bruteforce(const uint32_t *pale
const
uint32_t
c
=
palette
[
i
];
if
(
c
>>
24
>=
trans_thresh
)
{
// ignore transparent entry
const
int
d
=
diff
(
palette
[
i
],
argb
,
trans_thresh
);
const
int
d
=
diff
(
palette
[
i
],
target
,
trans_thresh
);
if
(
d
<
min_dist
)
{
pal_id
=
i
;
min_dist
=
d
;
...
...
@@ -235,10 +235,10 @@ static void colormap_nearest_node(const struct color_node *map,
}
}
static
av_always_inline
uint8_t
colormap_nearest_recursive
(
const
struct
color_node
*
node
,
const
uint8_t
rgb
,
const
int
trans_thresh
)
static
av_always_inline
uint8_t
colormap_nearest_recursive
(
const
struct
color_node
*
node
,
const
uint8_t
target
,
const
int
trans_thresh
)
{
struct
nearest_color
res
=
{.
dist_sqd
=
INT_MAX
,
.
node_pos
=
-
1
};
colormap_nearest_node
(
node
,
0
,
rgb
,
trans_thresh
,
&
res
);
colormap_nearest_node
(
node
,
0
,
target
,
trans_thresh
,
&
res
);
return
node
[
res
.
node_pos
].
palette_id
;
}
...
...
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