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
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
Hide 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[] = {
...
@@ -1602,6 +1602,7 @@ static const AVCodecDescriptor codec_descriptors[] = {
.
name
=
"av1"
,
.
name
=
"av1"
,
.
long_name
=
NULL_IF_CONFIG_SMALL
(
"Alliance for Open Media AV1"
),
.
long_name
=
NULL_IF_CONFIG_SMALL
(
"Alliance for Open Media AV1"
),
.
props
=
AV_CODEC_PROP_LOSSY
,
.
props
=
AV_CODEC_PROP_LOSSY
,
.
profiles
=
NULL_IF_CONFIG_SMALL
(
ff_av1_profiles
),
},
},
{
{
.
id
=
AV_CODEC_ID_BITPACKED
,
.
id
=
AV_CODEC_ID_BITPACKED
,
...
...
libavcodec/libaomdec.c
View file @
c0f0c9f5
...
@@ -31,6 +31,7 @@
...
@@ -31,6 +31,7 @@
#include "avcodec.h"
#include "avcodec.h"
#include "internal.h"
#include "internal.h"
#include "profiles.h"
typedef
struct
AV1DecodeContext
{
typedef
struct
AV1DecodeContext
{
struct
aom_codec_ctx
decoder
;
struct
aom_codec_ctx
decoder
;
...
@@ -98,23 +99,29 @@ static int set_pix_fmt(AVCodecContext *avctx, struct aom_image *img)
...
@@ -98,23 +99,29 @@ static int set_pix_fmt(AVCodecContext *avctx, struct aom_image *img)
switch
(
img
->
fmt
)
{
switch
(
img
->
fmt
)
{
case
AOM_IMG_FMT_I420
:
case
AOM_IMG_FMT_I420
:
avctx
->
pix_fmt
=
AV_PIX_FMT_YUV420P
;
avctx
->
pix_fmt
=
AV_PIX_FMT_YUV420P
;
avctx
->
profile
=
FF_PROFILE_AV1_MAIN
;
return
0
;
return
0
;
case
AOM_IMG_FMT_I422
:
case
AOM_IMG_FMT_I422
:
avctx
->
pix_fmt
=
AV_PIX_FMT_YUV422P
;
avctx
->
pix_fmt
=
AV_PIX_FMT_YUV422P
;
avctx
->
profile
=
FF_PROFILE_AV1_PROFESSIONAL
;
return
0
;
return
0
;
case
AOM_IMG_FMT_I444
:
case
AOM_IMG_FMT_I444
:
avctx
->
pix_fmt
=
avctx
->
colorspace
==
AVCOL_SPC_RGB
?
avctx
->
pix_fmt
=
avctx
->
colorspace
==
AVCOL_SPC_RGB
?
AV_PIX_FMT_GBRP
:
AV_PIX_FMT_YUV444P
;
AV_PIX_FMT_GBRP
:
AV_PIX_FMT_YUV444P
;
avctx
->
profile
=
FF_PROFILE_AV1_HIGH
;
return
0
;
return
0
;
case
AOM_IMG_FMT_I42016
:
case
AOM_IMG_FMT_I42016
:
if
(
img
->
bit_depth
==
8
)
{
if
(
img
->
bit_depth
==
8
)
{
avctx
->
pix_fmt
=
AV_PIX_FMT_YUV420P
;
avctx
->
pix_fmt
=
AV_PIX_FMT_YUV420P
;
avctx
->
profile
=
FF_PROFILE_AV1_MAIN
;
return
0
;
return
0
;
}
else
if
(
img
->
bit_depth
==
10
)
{
}
else
if
(
img
->
bit_depth
==
10
)
{
avctx
->
pix_fmt
=
AV_PIX_FMT_YUV420P10
;
avctx
->
pix_fmt
=
AV_PIX_FMT_YUV420P10
;
avctx
->
profile
=
FF_PROFILE_AV1_MAIN
;
return
0
;
return
0
;
}
else
if
(
img
->
bit_depth
==
12
)
{
}
else
if
(
img
->
bit_depth
==
12
)
{
avctx
->
pix_fmt
=
AV_PIX_FMT_YUV420P12
;
avctx
->
pix_fmt
=
AV_PIX_FMT_YUV420P12
;
avctx
->
profile
=
FF_PROFILE_AV1_PROFESSIONAL
;
return
0
;
return
0
;
}
else
{
}
else
{
return
AVERROR_INVALIDDATA
;
return
AVERROR_INVALIDDATA
;
...
@@ -122,12 +129,15 @@ static int set_pix_fmt(AVCodecContext *avctx, struct aom_image *img)
...
@@ -122,12 +129,15 @@ static int set_pix_fmt(AVCodecContext *avctx, struct aom_image *img)
case
AOM_IMG_FMT_I42216
:
case
AOM_IMG_FMT_I42216
:
if
(
img
->
bit_depth
==
8
)
{
if
(
img
->
bit_depth
==
8
)
{
avctx
->
pix_fmt
=
AV_PIX_FMT_YUV422P
;
avctx
->
pix_fmt
=
AV_PIX_FMT_YUV422P
;
avctx
->
profile
=
FF_PROFILE_AV1_PROFESSIONAL
;
return
0
;
return
0
;
}
else
if
(
img
->
bit_depth
==
10
)
{
}
else
if
(
img
->
bit_depth
==
10
)
{
avctx
->
pix_fmt
=
AV_PIX_FMT_YUV422P10
;
avctx
->
pix_fmt
=
AV_PIX_FMT_YUV422P10
;
avctx
->
profile
=
FF_PROFILE_AV1_PROFESSIONAL
;
return
0
;
return
0
;
}
else
if
(
img
->
bit_depth
==
12
)
{
}
else
if
(
img
->
bit_depth
==
12
)
{
avctx
->
pix_fmt
=
AV_PIX_FMT_YUV422P12
;
avctx
->
pix_fmt
=
AV_PIX_FMT_YUV422P12
;
avctx
->
profile
=
FF_PROFILE_AV1_PROFESSIONAL
;
return
0
;
return
0
;
}
else
{
}
else
{
return
AVERROR_INVALIDDATA
;
return
AVERROR_INVALIDDATA
;
...
@@ -136,14 +146,17 @@ static int set_pix_fmt(AVCodecContext *avctx, struct aom_image *img)
...
@@ -136,14 +146,17 @@ static int set_pix_fmt(AVCodecContext *avctx, struct aom_image *img)
if
(
img
->
bit_depth
==
8
)
{
if
(
img
->
bit_depth
==
8
)
{
avctx
->
pix_fmt
=
avctx
->
colorspace
==
AVCOL_SPC_RGB
?
avctx
->
pix_fmt
=
avctx
->
colorspace
==
AVCOL_SPC_RGB
?
AV_PIX_FMT_GBRP
:
AV_PIX_FMT_YUV444P
;
AV_PIX_FMT_GBRP
:
AV_PIX_FMT_YUV444P
;
avctx
->
profile
=
FF_PROFILE_AV1_HIGH
;
return
0
;
return
0
;
}
else
if
(
img
->
bit_depth
==
10
)
{
}
else
if
(
img
->
bit_depth
==
10
)
{
avctx
->
pix_fmt
=
avctx
->
colorspace
==
AVCOL_SPC_RGB
?
avctx
->
pix_fmt
=
avctx
->
colorspace
==
AVCOL_SPC_RGB
?
AV_PIX_FMT_GBRP10
:
AV_PIX_FMT_YUV444P10
;
AV_PIX_FMT_GBRP10
:
AV_PIX_FMT_YUV444P10
;
avctx
->
profile
=
FF_PROFILE_AV1_HIGH
;
return
0
;
return
0
;
}
else
if
(
img
->
bit_depth
==
12
)
{
}
else
if
(
img
->
bit_depth
==
12
)
{
avctx
->
pix_fmt
=
avctx
->
colorspace
==
AVCOL_SPC_RGB
?
avctx
->
pix_fmt
=
avctx
->
colorspace
==
AVCOL_SPC_RGB
?
AV_PIX_FMT_GBRP12
:
AV_PIX_FMT_YUV444P12
;
AV_PIX_FMT_GBRP12
:
AV_PIX_FMT_YUV444P12
;
avctx
->
profile
=
FF_PROFILE_AV1_PROFESSIONAL
;
return
0
;
return
0
;
}
else
{
}
else
{
return
AVERROR_INVALIDDATA
;
return
AVERROR_INVALIDDATA
;
...
@@ -229,5 +242,6 @@ AVCodec ff_libaom_av1_decoder = {
...
@@ -229,5 +242,6 @@ AVCodec ff_libaom_av1_decoder = {
.
close
=
aom_free
,
.
close
=
aom_free
,
.
decode
=
aom_decode
,
.
decode
=
aom_decode
,
.
capabilities
=
AV_CODEC_CAP_AUTO_THREADS
|
AV_CODEC_CAP_DR1
,
.
capabilities
=
AV_CODEC_CAP_AUTO_THREADS
|
AV_CODEC_CAP_DR1
,
.
profiles
=
NULL_IF_CONFIG_SMALL
(
ff_av1_profiles
),
.
wrapper_name
=
"libaom"
,
.
wrapper_name
=
"libaom"
,
};
};
libavcodec/libaomenc.c
View file @
c0f0c9f5
...
@@ -35,6 +35,7 @@
...
@@ -35,6 +35,7 @@
#include "avcodec.h"
#include "avcodec.h"
#include "internal.h"
#include "internal.h"
#include "profiles.h"
/*
/*
* Portion of struct aom_codec_cx_pkt from aom_encoder.h.
* Portion of struct aom_codec_cx_pkt from aom_encoder.h.
...
@@ -735,6 +736,7 @@ AVCodec ff_libaom_av1_encoder = {
...
@@ -735,6 +736,7 @@ AVCodec ff_libaom_av1_encoder = {
.
encode2
=
aom_encode
,
.
encode2
=
aom_encode
,
.
close
=
aom_free
,
.
close
=
aom_free
,
.
capabilities
=
AV_CODEC_CAP_DELAY
|
AV_CODEC_CAP_AUTO_THREADS
|
AV_CODEC_CAP_EXPERIMENTAL
,
.
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
,
.
priv_class
=
&
class_aom
,
.
defaults
=
defaults
,
.
defaults
=
defaults
,
.
init_static_data
=
av1_init_static
,
.
init_static_data
=
av1_init_static
,
...
...
libavcodec/profiles.c
View file @
c0f0c9f5
...
@@ -140,6 +140,13 @@ const AVProfile ff_vp9_profiles[] = {
...
@@ -140,6 +140,13 @@ const AVProfile ff_vp9_profiles[] = {
{
FF_PROFILE_UNKNOWN
},
{
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
[]
=
{
const
AVProfile
ff_sbc_profiles
[]
=
{
{
FF_PROFILE_SBC_MSBC
,
"mSBC"
},
{
FF_PROFILE_SBC_MSBC
,
"mSBC"
},
{
FF_PROFILE_UNKNOWN
},
{
FF_PROFILE_UNKNOWN
},
...
...
libavcodec/profiles.h
View file @
c0f0c9f5
...
@@ -31,6 +31,7 @@ extern const AVProfile ff_mpeg2_video_profiles[];
...
@@ -31,6 +31,7 @@ extern const AVProfile ff_mpeg2_video_profiles[];
extern
const
AVProfile
ff_mpeg4_video_profiles
[];
extern
const
AVProfile
ff_mpeg4_video_profiles
[];
extern
const
AVProfile
ff_vc1_profiles
[];
extern
const
AVProfile
ff_vc1_profiles
[];
extern
const
AVProfile
ff_vp9_profiles
[];
extern
const
AVProfile
ff_vp9_profiles
[];
extern
const
AVProfile
ff_av1_profiles
[];
extern
const
AVProfile
ff_sbc_profiles
[];
extern
const
AVProfile
ff_sbc_profiles
[];
#endif
/* AVCODEC_PROFILES_H */
#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