Skip to content
GitLab
Menu
Projects
Groups
Snippets
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
mirror
libavif
Commits
af0f3260
Commit
af0f3260
authored
3 years ago
by
Joe Drago
Browse files
Options
Download
Email Patches
Plain Diff
Rename CPU count helper function, document its failure case
parent
82cb73bf
feature_645
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
apps/avifdec.c
+1
-1
apps/avifdec.c
apps/avifenc.c
+1
-1
apps/avifenc.c
apps/shared/avifutil.c
+5
-5
apps/shared/avifutil.c
apps/shared/avifutil.h
+1
-1
apps/shared/avifutil.h
with
8 additions
and
8 deletions
+8
-8
apps/avifdec.c
+
1
-
1
View file @
af0f3260
...
...
@@ -75,7 +75,7 @@ int main(int argc, char * argv[])
}
else
if
(
!
strcmp
(
arg
,
"-j"
)
||
!
strcmp
(
arg
,
"--jobs"
))
{
NEXTARG
();
if
(
!
strcmp
(
arg
,
"all"
))
{
jobs
=
avifQuery
MaxThreads
();
jobs
=
avifQuery
CPUCount
();
}
else
{
jobs
=
atoi
(
arg
);
if
(
jobs
<
1
)
{
...
...
This diff is collapsed.
Click to expand it.
apps/avifenc.c
+
1
-
1
View file @
af0f3260
...
...
@@ -488,7 +488,7 @@ int main(int argc, char * argv[])
}
else
if
(
!
strcmp
(
arg
,
"-j"
)
||
!
strcmp
(
arg
,
"--jobs"
))
{
NEXTARG
();
if
(
!
strcmp
(
arg
,
"all"
))
{
jobs
=
avifQuery
MaxThreads
();
jobs
=
avifQuery
CPUCount
();
}
else
{
jobs
=
atoi
(
arg
);
if
(
jobs
<
1
)
{
...
...
This diff is collapsed.
Click to expand it.
apps/shared/avifutil.c
+
5
-
5
View file @
af0f3260
...
...
@@ -222,7 +222,7 @@ void avifDumpDiagnostics(const avifDiagnostics * diag)
}
// ---------------------------------------------------------------------------
// avifQuery
MaxThreads
(separated into OS implementations)
// avifQuery
CPUCount
(separated into OS implementations)
#if defined(_WIN32)
...
...
@@ -232,7 +232,7 @@ void avifDumpDiagnostics(const avifDiagnostics * diag)
#pragma warning(disable : 5032)
#include
<windows.h>
int
avifQuery
MaxThreads
(
void
)
int
avifQuery
CPUCount
(
void
)
{
int
numCPU
;
SYSTEM_INFO
sysinfo
;
...
...
@@ -247,7 +247,7 @@ int avifQueryMaxThreads(void)
#include
<sys/sysctl.h>
int
avifQuery
MaxThreads
()
int
avifQuery
CPUCount
()
{
int
mib
[
4
];
int
numCPU
;
...
...
@@ -273,7 +273,7 @@ int avifQueryMaxThreads()
// Emscripten
int
avifQuery
MaxThreads
()
int
avifQuery
CPUCount
()
{
return
1
;
}
...
...
@@ -284,7 +284,7 @@ int avifQueryMaxThreads()
#include
<unistd.h>
int
avifQuery
MaxThreads
()
int
avifQuery
CPUCount
()
{
int
numCPU
=
(
int
)
sysconf
(
_SC_NPROCESSORS_ONLN
);
return
(
numCPU
>
0
)
?
numCPU
:
1
;
...
...
This diff is collapsed.
Click to expand it.
apps/shared/avifutil.h
+
1
-
1
View file @
af0f3260
...
...
@@ -24,7 +24,7 @@ void avifImageDump(avifImage * avif, uint32_t gridCols, uint32_t gridRows);
void
avifContainerDump
(
avifDecoder
*
decoder
);
void
avifPrintVersions
(
void
);
void
avifDumpDiagnostics
(
const
avifDiagnostics
*
diag
);
int
avifQuery
MaxThreads
(
void
);
int
avifQuery
CPUCount
(
void
);
// Returns 1 if it cannot query or fails to query
typedef
enum
avifAppFileFormat
{
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets