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
c6558e88
Commit
c6558e88
authored
Dec 26, 2017
by
Luca Barbato
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
x264: Support version 153
It has native simultaneus 8 and 10 bit support.
parent
2beba58e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
0 deletions
+30
-0
libx264.c
libavcodec/libx264.c
+30
-0
No files found.
libavcodec/libx264.c
View file @
c6558e88
...
@@ -243,7 +243,11 @@ static int X264_frame(AVCodecContext *ctx, AVPacket *pkt, const AVFrame *frame,
...
@@ -243,7 +243,11 @@ static int X264_frame(AVCodecContext *ctx, AVPacket *pkt, const AVFrame *frame,
x264_picture_init
(
&
x4
->
pic
);
x264_picture_init
(
&
x4
->
pic
);
x4
->
pic
.
img
.
i_csp
=
x4
->
params
.
i_csp
;
x4
->
pic
.
img
.
i_csp
=
x4
->
params
.
i_csp
;
#if X264_BUILD >= 153
if
(
x4
->
params
.
i_bitdepth
>
8
)
#else
if
(
x264_bit_depth
>
8
)
if
(
x264_bit_depth
>
8
)
#endif
x4
->
pic
.
img
.
i_csp
|=
X264_CSP_HIGH_DEPTH
;
x4
->
pic
.
img
.
i_csp
|=
X264_CSP_HIGH_DEPTH
;
x4
->
pic
.
img
.
i_plane
=
3
;
x4
->
pic
.
img
.
i_plane
=
3
;
...
@@ -395,6 +399,9 @@ static av_cold int X264_init(AVCodecContext *avctx)
...
@@ -395,6 +399,9 @@ static av_cold int X264_init(AVCodecContext *avctx)
x4
->
params
.
p_log_private
=
avctx
;
x4
->
params
.
p_log_private
=
avctx
;
x4
->
params
.
i_log_level
=
X264_LOG_DEBUG
;
x4
->
params
.
i_log_level
=
X264_LOG_DEBUG
;
x4
->
params
.
i_csp
=
convert_pix_fmt
(
avctx
->
pix_fmt
);
x4
->
params
.
i_csp
=
convert_pix_fmt
(
avctx
->
pix_fmt
);
#if X264_BUILD >= 153
x4
->
params
.
i_bitdepth
=
av_pix_fmt_desc_get
(
avctx
->
pix_fmt
)
->
comp
[
0
].
depth
;
#endif
if
(
avctx
->
bit_rate
)
{
if
(
avctx
->
bit_rate
)
{
x4
->
params
.
rc
.
i_bitrate
=
avctx
->
bit_rate
/
1000
;
x4
->
params
.
rc
.
i_bitrate
=
avctx
->
bit_rate
/
1000
;
...
@@ -659,6 +666,7 @@ FF_ENABLE_DEPRECATION_WARNINGS
...
@@ -659,6 +666,7 @@ FF_ENABLE_DEPRECATION_WARNINGS
return
0
;
return
0
;
}
}
#if X264_BUILD < 153
static
const
enum
AVPixelFormat
pix_fmts_8bit
[]
=
{
static
const
enum
AVPixelFormat
pix_fmts_8bit
[]
=
{
AV_PIX_FMT_YUV420P
,
AV_PIX_FMT_YUV420P
,
AV_PIX_FMT_YUVJ420P
,
AV_PIX_FMT_YUVJ420P
,
...
@@ -685,15 +693,37 @@ static const enum AVPixelFormat pix_fmts_10bit[] = {
...
@@ -685,15 +693,37 @@ static const enum AVPixelFormat pix_fmts_10bit[] = {
AV_PIX_FMT_NV20
,
AV_PIX_FMT_NV20
,
AV_PIX_FMT_NONE
AV_PIX_FMT_NONE
};
};
#else
static
const
enum
AVPixelFormat
pix_fmts_all
[]
=
{
AV_PIX_FMT_YUV420P
,
AV_PIX_FMT_YUVJ420P
,
AV_PIX_FMT_YUV422P
,
AV_PIX_FMT_YUVJ422P
,
AV_PIX_FMT_YUV444P
,
AV_PIX_FMT_YUVJ444P
,
AV_PIX_FMT_NV12
,
AV_PIX_FMT_NV16
,
AV_PIX_FMT_NV21
,
AV_PIX_FMT_YUV420P10
,
AV_PIX_FMT_YUV422P10
,
AV_PIX_FMT_YUV444P10
,
AV_PIX_FMT_NV20
,
AV_PIX_FMT_NONE
};
#endif
static
av_cold
void
X264_init_static
(
AVCodec
*
codec
)
static
av_cold
void
X264_init_static
(
AVCodec
*
codec
)
{
{
#if X264_BUILD < 153
if
(
x264_bit_depth
==
8
)
if
(
x264_bit_depth
==
8
)
codec
->
pix_fmts
=
pix_fmts_8bit
;
codec
->
pix_fmts
=
pix_fmts_8bit
;
else
if
(
x264_bit_depth
==
9
)
else
if
(
x264_bit_depth
==
9
)
codec
->
pix_fmts
=
pix_fmts_9bit
;
codec
->
pix_fmts
=
pix_fmts_9bit
;
else
if
(
x264_bit_depth
==
10
)
else
if
(
x264_bit_depth
==
10
)
codec
->
pix_fmts
=
pix_fmts_10bit
;
codec
->
pix_fmts
=
pix_fmts_10bit
;
#else
codec
->
pix_fmts
=
pix_fmts_all
;
#endif
}
}
#define OFFSET(x) offsetof(X264Context, x)
#define OFFSET(x) offsetof(X264Context, x)
...
...
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