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
ae573824
Commit
ae573824
authored
May 27, 2013
by
Clément Bœsch
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavfi/lut3d: move lut3d init to its definition scope.
parent
158d96e3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
51 additions
and
54 deletions
+51
-54
vf_lut3d.c
libavfilter/vf_lut3d.c
+51
-54
No files found.
libavfilter/vf_lut3d.c
View file @
ae573824
...
...
@@ -410,60 +410,6 @@ static void set_identity_matrix(LUT3DContext *lut3d, int size)
}
}
#if CONFIG_LUT3D_FILTER
/* TODO: move to the CONFIG_LUT3D_FILTER definition scope at the bottom */
static
av_cold
int
lut3d_init
(
AVFilterContext
*
ctx
)
{
int
ret
;
FILE
*
f
;
const
char
*
ext
;
LUT3DContext
*
lut3d
=
ctx
->
priv
;
if
(
!
lut3d
->
file
)
{
set_identity_matrix
(
lut3d
,
32
);
return
0
;
}
f
=
fopen
(
lut3d
->
file
,
"r"
);
if
(
!
f
)
{
ret
=
AVERROR
(
errno
);
av_log
(
ctx
,
AV_LOG_ERROR
,
"%s: %s
\n
"
,
lut3d
->
file
,
av_err2str
(
ret
));
return
ret
;
}
ext
=
strrchr
(
lut3d
->
file
,
'.'
);
if
(
!
ext
)
{
av_log
(
ctx
,
AV_LOG_ERROR
,
"Unable to guess the format from the extension
\n
"
);
ret
=
AVERROR_INVALIDDATA
;
goto
end
;
}
ext
++
;
if
(
!
av_strcasecmp
(
ext
,
"dat"
))
{
lut3d
->
lutsize
=
33
;
ret
=
parse_dat
(
ctx
,
f
);
}
else
if
(
!
av_strcasecmp
(
ext
,
"3dl"
))
{
ret
=
parse_3dl
(
ctx
,
f
);
}
else
if
(
!
av_strcasecmp
(
ext
,
"cube"
))
{
ret
=
parse_cube
(
ctx
,
f
);
}
else
if
(
!
av_strcasecmp
(
ext
,
"m3d"
))
{
ret
=
parse_m3d
(
ctx
,
f
);
}
else
{
av_log
(
ctx
,
AV_LOG_ERROR
,
"Unrecognized '.%s' file type
\n
"
,
ext
);
ret
=
AVERROR
(
EINVAL
);
}
if
(
!
ret
&&
!
lut3d
->
lutsize
)
{
av_log
(
ctx
,
AV_LOG_ERROR
,
"3D LUT is empty
\n
"
);
ret
=
AVERROR_INVALIDDATA
;
}
end
:
fclose
(
f
);
return
ret
;
}
#endif
static
int
query_formats
(
AVFilterContext
*
ctx
)
{
static
const
enum
AVPixelFormat
pix_fmts
[]
=
{
...
...
@@ -583,6 +529,57 @@ static const AVOption lut3d_options[] = {
AVFILTER_DEFINE_CLASS
(
lut3d
);
static
av_cold
int
lut3d_init
(
AVFilterContext
*
ctx
)
{
int
ret
;
FILE
*
f
;
const
char
*
ext
;
LUT3DContext
*
lut3d
=
ctx
->
priv
;
if
(
!
lut3d
->
file
)
{
set_identity_matrix
(
lut3d
,
32
);
return
0
;
}
f
=
fopen
(
lut3d
->
file
,
"r"
);
if
(
!
f
)
{
ret
=
AVERROR
(
errno
);
av_log
(
ctx
,
AV_LOG_ERROR
,
"%s: %s
\n
"
,
lut3d
->
file
,
av_err2str
(
ret
));
return
ret
;
}
ext
=
strrchr
(
lut3d
->
file
,
'.'
);
if
(
!
ext
)
{
av_log
(
ctx
,
AV_LOG_ERROR
,
"Unable to guess the format from the extension
\n
"
);
ret
=
AVERROR_INVALIDDATA
;
goto
end
;
}
ext
++
;
if
(
!
av_strcasecmp
(
ext
,
"dat"
))
{
lut3d
->
lutsize
=
33
;
ret
=
parse_dat
(
ctx
,
f
);
}
else
if
(
!
av_strcasecmp
(
ext
,
"3dl"
))
{
ret
=
parse_3dl
(
ctx
,
f
);
}
else
if
(
!
av_strcasecmp
(
ext
,
"cube"
))
{
ret
=
parse_cube
(
ctx
,
f
);
}
else
if
(
!
av_strcasecmp
(
ext
,
"m3d"
))
{
ret
=
parse_m3d
(
ctx
,
f
);
}
else
{
av_log
(
ctx
,
AV_LOG_ERROR
,
"Unrecognized '.%s' file type
\n
"
,
ext
);
ret
=
AVERROR
(
EINVAL
);
}
if
(
!
ret
&&
!
lut3d
->
lutsize
)
{
av_log
(
ctx
,
AV_LOG_ERROR
,
"3D LUT is empty
\n
"
);
ret
=
AVERROR_INVALIDDATA
;
}
end:
fclose
(
f
);
return
ret
;
}
static
const
AVFilterPad
lut3d_inputs
[]
=
{
{
.
name
=
"default"
,
...
...
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