Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
ffmpeg
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ffmpeg
Commits
4629993d
Commit
4629993d
authored
Feb 26, 2015
by
Clément Bœsch
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avfilter/paletteuse: use AV_QSORT()
See previous commit for a rationale.
parent
321de034
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletion
+4
-1
vf_paletteuse.c
libavfilter/vf_paletteuse.c
+4
-1
No files found.
libavfilter/vf_paletteuse.c
View file @
4629993d
...
...
@@ -25,6 +25,7 @@
#include "libavutil/bprint.h"
#include "libavutil/opt.h"
#include "libavutil/qsort.h"
#include "dualinput.h"
#include "avfilter.h"
...
...
@@ -592,6 +593,7 @@ static int get_next_color(const uint8_t *color_used, const uint32_t *palette,
unsigned
nb_color
=
0
;
struct
color_rect
ranges
;
struct
color
tmp_pal
[
256
];
cmp_func
cmpf
;
ranges
.
min
[
0
]
=
ranges
.
min
[
1
]
=
ranges
.
min
[
2
]
=
0xff
;
ranges
.
max
[
0
]
=
ranges
.
max
[
1
]
=
ranges
.
max
[
2
]
=
0x00
;
...
...
@@ -631,10 +633,11 @@ static int get_next_color(const uint8_t *color_used, const uint32_t *palette,
if
(
wr
>=
wg
&&
wr
>=
wb
)
longest
=
0
;
if
(
wg
>=
wr
&&
wg
>=
wb
)
longest
=
1
;
if
(
wb
>=
wr
&&
wb
>=
wg
)
longest
=
2
;
cmpf
=
cmp_funcs
[
longest
];
*
component
=
longest
;
/* sort along this axis to get median */
qsort
(
tmp_pal
,
nb_color
,
sizeof
(
*
tmp_pal
),
cmp_funcs
[
longest
]
);
AV_QSORT
(
tmp_pal
,
nb_color
,
struct
color
,
cmpf
);
return
tmp_pal
[
nb_color
>>
1
].
pal_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