Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
FFmpeg
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
libremedia
Tethys
FFmpeg
Commits
dab1f543
Commit
dab1f543
authored
12 years ago
by
Luca Barbato
Browse files
Options
Downloads
Patches
Plain Diff
libvpx: support vp9
This feature is experimental use at your risk
parent
23a610b9
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
libavcodec/allcodecs.c
+1
-0
1 addition, 0 deletions
libavcodec/allcodecs.c
libavcodec/codec_desc.c
+7
-0
7 additions, 0 deletions
libavcodec/codec_desc.c
libavcodec/libvpxdec.c
+24
-2
24 additions, 2 deletions
libavcodec/libvpxdec.c
libavcodec/libvpxenc.c
+36
-2
36 additions, 2 deletions
libavcodec/libvpxenc.c
with
68 additions
and
4 deletions
libavcodec/allcodecs.c
+
1
−
0
View file @
dab1f543
...
...
@@ -427,6 +427,7 @@ void avcodec_register_all(void)
REGISTER_ENCODER
(
LIBVO_AMRWBENC
,
libvo_amrwbenc
);
REGISTER_ENCODER
(
LIBVORBIS
,
libvorbis
);
REGISTER_ENCDEC
(
LIBVPX
,
libvpx
);
REGISTER_ENCDEC
(
LIBVPX
,
libvpx_vp9
);
REGISTER_ENCODER
(
LIBX264
,
libx264
);
REGISTER_ENCODER
(
LIBXAVS
,
libxavs
);
REGISTER_ENCODER
(
LIBXVID
,
libxvid
);
...
...
This diff is collapsed.
Click to expand it.
libavcodec/codec_desc.c
+
7
−
0
View file @
dab1f543
...
...
@@ -1012,6 +1012,13 @@ static const AVCodecDescriptor codec_descriptors[] = {
.
long_name
=
NULL_IF_CONFIG_SMALL
(
"On2 VP8"
),
.
props
=
AV_CODEC_PROP_LOSSY
,
},
{
.
id
=
AV_CODEC_ID_VP9
,
.
type
=
AVMEDIA_TYPE_VIDEO
,
.
name
=
"vp9"
,
.
long_name
=
NULL_IF_CONFIG_SMALL
(
"Google VP9"
),
.
props
=
AV_CODEC_PROP_LOSSY
,
},
{
.
id
=
AV_CODEC_ID_PICTOR
,
.
type
=
AVMEDIA_TYPE_VIDEO
,
...
...
This diff is collapsed.
Click to expand it.
libavcodec/libvpxdec.c
+
24
−
2
View file @
dab1f543
...
...
@@ -35,10 +35,10 @@ typedef struct VP8DecoderContext {
struct
vpx_codec_ctx
decoder
;
}
VP8Context
;
static
av_cold
int
vp8_init
(
AVCodecContext
*
avctx
)
static
av_cold
int
vpx_init
(
AVCodecContext
*
avctx
,
const
struct
vpx_codec_iface
*
iface
)
{
VP8Context
*
ctx
=
avctx
->
priv_data
;
const
struct
vpx_codec_iface
*
iface
=
&
vpx_codec_vp8_dx_algo
;
struct
vpx_codec_dec_cfg
deccfg
=
{
/* token partitions+1 would be a decent choice */
.
threads
=
FFMIN
(
avctx
->
thread_count
,
16
)
...
...
@@ -58,6 +58,11 @@ static av_cold int vp8_init(AVCodecContext *avctx)
return
0
;
}
static
av_cold
int
vp8_init
(
AVCodecContext
*
avctx
)
{
return
vpx_init
(
avctx
,
&
vpx_codec_vp8_dx_algo
);
}
static
int
vp8_decode
(
AVCodecContext
*
avctx
,
void
*
data
,
int
*
got_frame
,
AVPacket
*
avpkt
)
{
...
...
@@ -123,3 +128,20 @@ AVCodec ff_libvpx_decoder = {
.
capabilities
=
CODEC_CAP_AUTO_THREADS
,
.
long_name
=
NULL_IF_CONFIG_SMALL
(
"libvpx VP8"
),
};
static
av_cold
int
vp9_init
(
AVCodecContext
*
avctx
)
{
return
vpx_init
(
avctx
,
&
vpx_codec_vp9_dx_algo
);
}
AVCodec
ff_libvpx_vp9_decoder
=
{
.
name
=
"libvpx-vp9"
,
.
type
=
AVMEDIA_TYPE_VIDEO
,
.
id
=
AV_CODEC_ID_VP9
,
.
priv_data_size
=
sizeof
(
VP8Context
),
.
init
=
vp9_init
,
.
close
=
vp8_free
,
.
decode
=
vp8_decode
,
.
capabilities
=
CODEC_CAP_AUTO_THREADS
|
CODEC_CAP_EXPERIMENTAL
,
.
long_name
=
NULL_IF_CONFIG_SMALL
(
"libvpx VP9"
),
};
This diff is collapsed.
Click to expand it.
libavcodec/libvpxenc.c
+
36
−
2
View file @
dab1f543
...
...
@@ -214,10 +214,10 @@ static av_cold int vp8_free(AVCodecContext *avctx)
return
0
;
}
static
av_cold
int
vp8_init
(
AVCodecContext
*
avctx
)
static
av_cold
int
vpx_init
(
AVCodecContext
*
avctx
,
const
struct
vpx_codec_iface
*
iface
)
{
VP8Context
*
ctx
=
avctx
->
priv_data
;
const
struct
vpx_codec_iface
*
iface
=
&
vpx_codec_vp8_cx_algo
;
struct
vpx_codec_enc_cfg
enccfg
;
int
res
;
...
...
@@ -362,6 +362,11 @@ static av_cold int vp8_init(AVCodecContext *avctx)
return
0
;
}
static
av_cold
int
vp8_init
(
AVCodecContext
*
avctx
)
{
return
vpx_init
(
avctx
,
&
vpx_codec_vp8_cx_algo
);
}
static
inline
void
cx_pktcpy
(
struct
FrameListData
*
dst
,
const
struct
vpx_codec_cx_pkt
*
src
)
{
...
...
@@ -594,3 +599,32 @@ AVCodec ff_libvpx_encoder = {
.
priv_class
=
&
class
,
.
defaults
=
defaults
,
};
static
av_cold
int
vp9_init
(
AVCodecContext
*
avctx
)
{
return
vpx_init
(
avctx
,
&
vpx_codec_vp9_cx_algo
);
}
static
const
AVClass
class_vp9
=
{
.
class_name
=
"libvpx encoder"
,
.
item_name
=
av_default_item_name
,
.
option
=
options
,
.
version
=
LIBAVUTIL_VERSION_INT
,
};
AVCodec
ff_libvpx_vp9_encoder
=
{
.
name
=
"libvpx-vp9"
,
.
type
=
AVMEDIA_TYPE_VIDEO
,
.
id
=
AV_CODEC_ID_VP9
,
.
priv_data_size
=
sizeof
(
VP8Context
),
.
init
=
vp9_init
,
.
encode2
=
vp8_encode
,
.
close
=
vp8_free
,
.
capabilities
=
CODEC_CAP_DELAY
|
CODEC_CAP_AUTO_THREADS
|
CODEC_CAP_EXPERIMENTAL
,
.
pix_fmts
=
(
const
enum
AVPixelFormat
[]){
AV_PIX_FMT_YUV420P
,
AV_PIX_FMT_NONE
},
.
long_name
=
NULL_IF_CONFIG_SMALL
(
"libvpx VP9"
),
.
priv_class
=
&
class_vp9
,
.
defaults
=
defaults
,
};
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment