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
c0f0c9f5
Commit
c0f0c9f5
authored
Mar 29, 2018
by
James Almer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcode/profiles: add AV1 profiles
Signed-off-by:
James Almer
<
jamrial@gmail.com
>
parent
99cc3cf7
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
25 additions
and
0 deletions
+25
-0
codec_desc.c
libavcodec/codec_desc.c
+1
-0
libaomdec.c
libavcodec/libaomdec.c
+14
-0
libaomenc.c
libavcodec/libaomenc.c
+2
-0
profiles.c
libavcodec/profiles.c
+7
-0
profiles.h
libavcodec/profiles.h
+1
-0
No files found.
libavcodec/codec_desc.c
View file @
c0f0c9f5
...
...
@@ -1602,6 +1602,7 @@ static const AVCodecDescriptor codec_descriptors[] = {
.
name
=
"av1"
,
.
long_name
=
NULL_IF_CONFIG_SMALL
(
"Alliance for Open Media AV1"
),
.
props
=
AV_CODEC_PROP_LOSSY
,
.
profiles
=
NULL_IF_CONFIG_SMALL
(
ff_av1_profiles
),
},
{
.
id
=
AV_CODEC_ID_BITPACKED
,
...
...
libavcodec/libaomdec.c
View file @
c0f0c9f5
...
...
@@ -31,6 +31,7 @@
#include "avcodec.h"
#include "internal.h"
#include "profiles.h"
typedef
struct
AV1DecodeContext
{
struct
aom_codec_ctx
decoder
;
...
...
@@ -98,23 +99,29 @@ static int set_pix_fmt(AVCodecContext *avctx, struct aom_image *img)
switch
(
img
->
fmt
)
{
case
AOM_IMG_FMT_I420
:
avctx
->
pix_fmt
=
AV_PIX_FMT_YUV420P
;
avctx
->
profile
=
FF_PROFILE_AV1_MAIN
;
return
0
;
case
AOM_IMG_FMT_I422
:
avctx
->
pix_fmt
=
AV_PIX_FMT_YUV422P
;
avctx
->
profile
=
FF_PROFILE_AV1_PROFESSIONAL
;
return
0
;
case
AOM_IMG_FMT_I444
:
avctx
->
pix_fmt
=
avctx
->
colorspace
==
AVCOL_SPC_RGB
?
AV_PIX_FMT_GBRP
:
AV_PIX_FMT_YUV444P
;
avctx
->
profile
=
FF_PROFILE_AV1_HIGH
;
return
0
;
case
AOM_IMG_FMT_I42016
:
if
(
img
->
bit_depth
==
8
)
{
avctx
->
pix_fmt
=
AV_PIX_FMT_YUV420P
;
avctx
->
profile
=
FF_PROFILE_AV1_MAIN
;
return
0
;
}
else
if
(
img
->
bit_depth
==
10
)
{
avctx
->
pix_fmt
=
AV_PIX_FMT_YUV420P10
;
avctx
->
profile
=
FF_PROFILE_AV1_MAIN
;
return
0
;
}
else
if
(
img
->
bit_depth
==
12
)
{
avctx
->
pix_fmt
=
AV_PIX_FMT_YUV420P12
;
avctx
->
profile
=
FF_PROFILE_AV1_PROFESSIONAL
;
return
0
;
}
else
{
return
AVERROR_INVALIDDATA
;
...
...
@@ -122,12 +129,15 @@ static int set_pix_fmt(AVCodecContext *avctx, struct aom_image *img)
case
AOM_IMG_FMT_I42216
:
if
(
img
->
bit_depth
==
8
)
{
avctx
->
pix_fmt
=
AV_PIX_FMT_YUV422P
;
avctx
->
profile
=
FF_PROFILE_AV1_PROFESSIONAL
;
return
0
;
}
else
if
(
img
->
bit_depth
==
10
)
{
avctx
->
pix_fmt
=
AV_PIX_FMT_YUV422P10
;
avctx
->
profile
=
FF_PROFILE_AV1_PROFESSIONAL
;
return
0
;
}
else
if
(
img
->
bit_depth
==
12
)
{
avctx
->
pix_fmt
=
AV_PIX_FMT_YUV422P12
;
avctx
->
profile
=
FF_PROFILE_AV1_PROFESSIONAL
;
return
0
;
}
else
{
return
AVERROR_INVALIDDATA
;
...
...
@@ -136,14 +146,17 @@ static int set_pix_fmt(AVCodecContext *avctx, struct aom_image *img)
if
(
img
->
bit_depth
==
8
)
{
avctx
->
pix_fmt
=
avctx
->
colorspace
==
AVCOL_SPC_RGB
?
AV_PIX_FMT_GBRP
:
AV_PIX_FMT_YUV444P
;
avctx
->
profile
=
FF_PROFILE_AV1_HIGH
;
return
0
;
}
else
if
(
img
->
bit_depth
==
10
)
{
avctx
->
pix_fmt
=
avctx
->
colorspace
==
AVCOL_SPC_RGB
?
AV_PIX_FMT_GBRP10
:
AV_PIX_FMT_YUV444P10
;
avctx
->
profile
=
FF_PROFILE_AV1_HIGH
;
return
0
;
}
else
if
(
img
->
bit_depth
==
12
)
{
avctx
->
pix_fmt
=
avctx
->
colorspace
==
AVCOL_SPC_RGB
?
AV_PIX_FMT_GBRP12
:
AV_PIX_FMT_YUV444P12
;
avctx
->
profile
=
FF_PROFILE_AV1_PROFESSIONAL
;
return
0
;
}
else
{
return
AVERROR_INVALIDDATA
;
...
...
@@ -229,5 +242,6 @@ AVCodec ff_libaom_av1_decoder = {
.
close
=
aom_free
,
.
decode
=
aom_decode
,
.
capabilities
=
AV_CODEC_CAP_AUTO_THREADS
|
AV_CODEC_CAP_DR1
,
.
profiles
=
NULL_IF_CONFIG_SMALL
(
ff_av1_profiles
),
.
wrapper_name
=
"libaom"
,
};
libavcodec/libaomenc.c
View file @
c0f0c9f5
...
...
@@ -35,6 +35,7 @@
#include "avcodec.h"
#include "internal.h"
#include "profiles.h"
/*
* Portion of struct aom_codec_cx_pkt from aom_encoder.h.
...
...
@@ -735,6 +736,7 @@ AVCodec ff_libaom_av1_encoder = {
.
encode2
=
aom_encode
,
.
close
=
aom_free
,
.
capabilities
=
AV_CODEC_CAP_DELAY
|
AV_CODEC_CAP_AUTO_THREADS
|
AV_CODEC_CAP_EXPERIMENTAL
,
.
profiles
=
NULL_IF_CONFIG_SMALL
(
ff_av1_profiles
),
.
priv_class
=
&
class_aom
,
.
defaults
=
defaults
,
.
init_static_data
=
av1_init_static
,
...
...
libavcodec/profiles.c
View file @
c0f0c9f5
...
...
@@ -140,6 +140,13 @@ const AVProfile ff_vp9_profiles[] = {
{
FF_PROFILE_UNKNOWN
},
};
const
AVProfile
ff_av1_profiles
[]
=
{
{
FF_PROFILE_AV1_MAIN
,
"Main"
},
{
FF_PROFILE_AV1_HIGH
,
"High"
},
{
FF_PROFILE_AV1_PROFESSIONAL
,
"Professional"
},
{
FF_PROFILE_UNKNOWN
},
};
const
AVProfile
ff_sbc_profiles
[]
=
{
{
FF_PROFILE_SBC_MSBC
,
"mSBC"
},
{
FF_PROFILE_UNKNOWN
},
...
...
libavcodec/profiles.h
View file @
c0f0c9f5
...
...
@@ -31,6 +31,7 @@ extern const AVProfile ff_mpeg2_video_profiles[];
extern
const
AVProfile
ff_mpeg4_video_profiles
[];
extern
const
AVProfile
ff_vc1_profiles
[];
extern
const
AVProfile
ff_vp9_profiles
[];
extern
const
AVProfile
ff_av1_profiles
[];
extern
const
AVProfile
ff_sbc_profiles
[];
#endif
/* AVCODEC_PROFILES_H */
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