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
2142b2ef
Commit
2142b2ef
authored
Feb 21, 2014
by
Derek Buitenhuis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
libx265: Support 4:4:4
Signed-off-by:
Derek Buitenhuis
<
derek.buitenhuis@gmail.com
>
parent
d00a504b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
0 deletions
+23
-0
libx265.c
libavcodec/libx265.c
+23
-0
No files found.
libavcodec/libx265.c
View file @
2142b2ef
...
...
@@ -81,6 +81,15 @@ static av_cold int libx265_encode_init(AVCodecContext *avctx)
int
ret
;
int
i
;
if
(
avctx
->
strict_std_compliance
>
FF_COMPLIANCE_EXPERIMENTAL
&&
!
av_pix_fmt_desc_get
(
avctx
->
pix_fmt
)
->
log2_chroma_w
&&
!
av_pix_fmt_desc_get
(
avctx
->
pix_fmt
)
->
log2_chroma_h
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"4:4:4 support is not fully defined for HEVC yet. "
"Set -strict experimental to encode anyway.
\n
"
);
return
AVERROR
(
ENOSYS
);
}
avctx
->
coded_frame
=
av_frame_alloc
();
if
(
!
avctx
->
coded_frame
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"Could not allocate frame.
\n
"
);
...
...
@@ -109,6 +118,17 @@ static av_cold int libx265_encode_init(AVCodecContext *avctx)
else
if
(
x265_max_bit_depth
==
12
)
ctx
->
params
->
internalBitDepth
=
10
;
switch
(
avctx
->
pix_fmt
)
{
case
AV_PIX_FMT_YUV420P
:
case
AV_PIX_FMT_YUV420P10
:
ctx
->
params
->
internalCsp
=
X265_CSP_I420
;
break
;
case
AV_PIX_FMT_YUV444P
:
case
AV_PIX_FMT_YUV444P10
:
ctx
->
params
->
internalCsp
=
X265_CSP_I444
;
break
;
}
if
(
avctx
->
bit_rate
>
0
)
{
ctx
->
params
->
rc
.
bitrate
=
avctx
->
bit_rate
/
1000
;
ctx
->
params
->
rc
.
rateControlMode
=
X265_RC_ABR
;
...
...
@@ -243,12 +263,15 @@ static int libx265_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
static
const
enum
AVPixelFormat
x265_csp_eight
[]
=
{
AV_PIX_FMT_YUV420P
,
AV_PIX_FMT_YUV444P
,
AV_PIX_FMT_NONE
};
static
const
enum
AVPixelFormat
x265_csp_twelve
[]
=
{
AV_PIX_FMT_YUV420P
,
AV_PIX_FMT_YUV444P
,
AV_PIX_FMT_YUV420P10
,
AV_PIX_FMT_YUV444P10
,
AV_PIX_FMT_NONE
};
...
...
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