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
e1319aa1
Commit
e1319aa1
authored
Jul 10, 2015
by
Luca Barbato
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
libx264: Add support for the MPEG2 encoder
parent
0cf5588d
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
49 additions
and
8 deletions
+49
-8
configure
configure
+5
-1
Makefile
libavcodec/Makefile
+1
-0
allcodecs.c
libavcodec/allcodecs.c
+1
-0
libx264.c
libavcodec/libx264.c
+42
-7
No files found.
configure
View file @
e1319aa1
...
@@ -1607,6 +1607,7 @@ CONFIG_EXTRA="
...
@@ -1607,6 +1607,7 @@ CONFIG_EXTRA="
imdct15
imdct15
intrax8
intrax8
jpegtables
jpegtables
libx262
lgplv3
lgplv3
lpc
lpc
me_cmp
me_cmp
...
@@ -2108,6 +2109,7 @@ libvpx_vp9_decoder_deps="libvpx"
...
@@ -2108,6 +2109,7 @@ libvpx_vp9_decoder_deps="libvpx"
libvpx_vp9_encoder_deps
=
"libvpx"
libvpx_vp9_encoder_deps
=
"libvpx"
libwavpack_encoder_deps
=
"libwavpack"
libwavpack_encoder_deps
=
"libwavpack"
libwebp_encoder_deps
=
"libwebp"
libwebp_encoder_deps
=
"libwebp"
libx262_encoder_deps
=
"libx262"
libx264_encoder_deps
=
"libx264"
libx264_encoder_deps
=
"libx264"
libx265_encoder_deps
=
"libx265"
libx265_encoder_deps
=
"libx265"
libxavs_encoder_deps
=
"libxavs"
libxavs_encoder_deps
=
"libxavs"
...
@@ -4351,7 +4353,9 @@ enabled libwavpack && require libwavpack wavpack/wavpack.h WavpackOpenFil
...
@@ -4351,7 +4353,9 @@ enabled libwavpack && require libwavpack wavpack/wavpack.h WavpackOpenFil
enabled libwebp
&&
require_pkg_config libwebp webp/encode.h WebPGetEncoderVersion
enabled libwebp
&&
require_pkg_config libwebp webp/encode.h WebPGetEncoderVersion
enabled libx264
&&
require_pkg_config x264
"stdint.h x264.h"
x264_encoder_encode
&&
enabled libx264
&&
require_pkg_config x264
"stdint.h x264.h"
x264_encoder_encode
&&
{
check_cpp_condition x264.h
"X264_BUILD >= 118"
||
{
check_cpp_condition x264.h
"X264_BUILD >= 118"
||
die
"ERROR: libx264 version must be >= 0.118."
;
}
die
"ERROR: libx264 version must be >= 0.118."
;
}
&&
{
check_cpp_condition x264.h
"X264_MPEG2"
&&
enable
libx262
;
}
enabled libx265
&&
require_pkg_config x265 x265.h x265_api_get
&&
enabled libx265
&&
require_pkg_config x265 x265.h x265_api_get
&&
{
check_cpp_condition x265.h
"X265_BUILD >= 57"
||
{
check_cpp_condition x265.h
"X265_BUILD >= 57"
||
die
"ERROR: libx265 version must be >= 57."
;
}
die
"ERROR: libx265 version must be >= 57."
;
}
...
...
libavcodec/Makefile
View file @
e1319aa1
...
@@ -671,6 +671,7 @@ OBJS-$(CONFIG_LIBVPX_VP9_DECODER) += libvpxdec.o libvpx.o
...
@@ -671,6 +671,7 @@ OBJS-$(CONFIG_LIBVPX_VP9_DECODER) += libvpxdec.o libvpx.o
OBJS-$(CONFIG_LIBVPX_VP9_ENCODER)
+=
libvpxenc.o
libvpx.o
OBJS-$(CONFIG_LIBVPX_VP9_ENCODER)
+=
libvpxenc.o
libvpx.o
OBJS-$(CONFIG_LIBWAVPACK_ENCODER)
+=
libwavpackenc.o
OBJS-$(CONFIG_LIBWAVPACK_ENCODER)
+=
libwavpackenc.o
OBJS-$(CONFIG_LIBWEBP_ENCODER)
+=
libwebpenc.o
OBJS-$(CONFIG_LIBWEBP_ENCODER)
+=
libwebpenc.o
OBJS-$(CONFIG_LIBX262_ENCODER)
+=
libx264.o
OBJS-$(CONFIG_LIBX264_ENCODER)
+=
libx264.o
OBJS-$(CONFIG_LIBX264_ENCODER)
+=
libx264.o
OBJS-$(CONFIG_LIBX265_ENCODER)
+=
libx265.o
OBJS-$(CONFIG_LIBX265_ENCODER)
+=
libx265.o
OBJS-$(CONFIG_LIBXAVS_ENCODER)
+=
libxavs.o
OBJS-$(CONFIG_LIBXAVS_ENCODER)
+=
libxavs.o
...
...
libavcodec/allcodecs.c
View file @
e1319aa1
...
@@ -473,6 +473,7 @@ void avcodec_register_all(void)
...
@@ -473,6 +473,7 @@ void avcodec_register_all(void)
REGISTER_ENCDEC
(
LIBVPX_VP9
,
libvpx_vp9
);
REGISTER_ENCDEC
(
LIBVPX_VP9
,
libvpx_vp9
);
REGISTER_ENCODER
(
LIBWAVPACK
,
libwavpack
);
REGISTER_ENCODER
(
LIBWAVPACK
,
libwavpack
);
REGISTER_ENCODER
(
LIBWEBP
,
libwebp
);
REGISTER_ENCODER
(
LIBWEBP
,
libwebp
);
REGISTER_ENCODER
(
LIBX262
,
libx262
);
REGISTER_ENCODER
(
LIBX264
,
libx264
);
REGISTER_ENCODER
(
LIBX264
,
libx264
);
REGISTER_ENCODER
(
LIBX265
,
libx265
);
REGISTER_ENCODER
(
LIBX265
,
libx265
);
REGISTER_ENCODER
(
LIBXAVS
,
libxavs
);
REGISTER_ENCODER
(
LIBXAVS
,
libxavs
);
...
...
libavcodec/libx264.c
View file @
e1319aa1
...
@@ -323,7 +323,14 @@ static av_cold int X264_init(AVCodecContext *avctx)
...
@@ -323,7 +323,14 @@ static av_cold int X264_init(AVCodecContext *avctx)
{
{
X264Context
*
x4
=
avctx
->
priv_data
;
X264Context
*
x4
=
avctx
->
priv_data
;
#if CONFIG_LIBX262_ENCODER
if
(
avctx
->
codec_id
==
AV_CODEC_ID_MPEG2VIDEO
)
{
x4
->
params
.
b_mpeg2
=
1
;
x264_param_default_mpeg2
(
&
x4
->
params
);
}
else
#else
x264_param_default
(
&
x4
->
params
);
x264_param_default
(
&
x4
->
params
);
#endif
x4
->
params
.
b_deblocking_filter
=
avctx
->
flags
&
CODEC_FLAG_LOOP_FILTER
;
x4
->
params
.
b_deblocking_filter
=
avctx
->
flags
&
CODEC_FLAG_LOOP_FILTER
;
...
@@ -663,13 +670,6 @@ static const AVOption options[] = {
...
@@ -663,13 +670,6 @@ static const AVOption options[] = {
{
NULL
},
{
NULL
},
};
};
static
const
AVClass
class
=
{
.
class_name
=
"libx264"
,
.
item_name
=
av_default_item_name
,
.
option
=
options
,
.
version
=
LIBAVUTIL_VERSION_INT
,
};
static
const
AVCodecDefault
x264_defaults
[]
=
{
static
const
AVCodecDefault
x264_defaults
[]
=
{
{
"b"
,
"0"
},
{
"b"
,
"0"
},
{
"bf"
,
"-1"
},
{
"bf"
,
"-1"
},
...
@@ -698,6 +698,14 @@ static const AVCodecDefault x264_defaults[] = {
...
@@ -698,6 +698,14 @@ static const AVCodecDefault x264_defaults[] = {
{
NULL
},
{
NULL
},
};
};
#if CONFIG_LIBX264_ENCODER
static
const
AVClass
class
=
{
.
class_name
=
"libx264"
,
.
item_name
=
av_default_item_name
,
.
option
=
options
,
.
version
=
LIBAVUTIL_VERSION_INT
,
};
AVCodec
ff_libx264_encoder
=
{
AVCodec
ff_libx264_encoder
=
{
.
name
=
"libx264"
,
.
name
=
"libx264"
,
.
long_name
=
NULL_IF_CONFIG_SMALL
(
"libx264 H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10"
),
.
long_name
=
NULL_IF_CONFIG_SMALL
(
"libx264 H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10"
),
...
@@ -714,3 +722,30 @@ AVCodec ff_libx264_encoder = {
...
@@ -714,3 +722,30 @@ AVCodec ff_libx264_encoder = {
.
caps_internal
=
FF_CODEC_CAP_INIT_THREADSAFE
|
.
caps_internal
=
FF_CODEC_CAP_INIT_THREADSAFE
|
FF_CODEC_CAP_INIT_CLEANUP
,
FF_CODEC_CAP_INIT_CLEANUP
,
};
};
#endif
#if CONFIG_LIBX262_ENCODER
static
const
AVClass
X262_class
=
{
.
class_name
=
"libx262"
,
.
item_name
=
av_default_item_name
,
.
option
=
options
,
.
version
=
LIBAVUTIL_VERSION_INT
,
};
AVCodec
ff_libx262_encoder
=
{
.
name
=
"libx262"
,
.
long_name
=
NULL_IF_CONFIG_SMALL
(
"libx262 MPEG2VIDEO"
),
.
type
=
AVMEDIA_TYPE_VIDEO
,
.
id
=
AV_CODEC_ID_MPEG2VIDEO
,
.
priv_data_size
=
sizeof
(
X264Context
),
.
init
=
X264_init
,
.
encode2
=
X264_frame
,
.
close
=
X264_close
,
.
capabilities
=
CODEC_CAP_DELAY
|
CODEC_CAP_AUTO_THREADS
,
.
priv_class
=
&
X262_class
,
.
defaults
=
x264_defaults
,
.
pix_fmts
=
pix_fmts_8bit
,
.
caps_internal
=
FF_CODEC_CAP_INIT_THREADSAFE
|
FF_CODEC_CAP_INIT_CLEANUP
,
};
#endif
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