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
3c55baf0
Commit
3c55baf0
authored
Sep 04, 2016
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avccodec/utvideoenc: support encoding ULY4 and ULH4
Signed-off-by:
Paul B Mahol
<
onemda@gmail.com
>
parent
28b920c0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
1 deletion
+21
-1
utvideo.h
libavcodec/utvideo.h
+1
-0
utvideoenc.c
libavcodec/utvideoenc.c
+20
-1
No files found.
libavcodec/utvideo.h
View file @
3c55baf0
...
...
@@ -56,6 +56,7 @@ enum {
UTVIDEO_RGBA
=
MKTAG
(
0x00
,
0x00
,
0x02
,
0x18
),
UTVIDEO_420
=
MKTAG
(
'Y'
,
'V'
,
'1'
,
'2'
),
UTVIDEO_422
=
MKTAG
(
'Y'
,
'U'
,
'Y'
,
'2'
),
UTVIDEO_444
=
MKTAG
(
'Y'
,
'V'
,
'2'
,
'4'
),
};
/* Mapping of libavcodec prediction modes to Ut Video's */
...
...
libavcodec/utvideoenc.c
View file @
3c55baf0
...
...
@@ -104,6 +104,14 @@ static av_cold int utvideo_encode_init(AVCodecContext *avctx)
avctx
->
codec_tag
=
MKTAG
(
'U'
,
'L'
,
'Y'
,
'2'
);
original_format
=
UTVIDEO_422
;
break
;
case
AV_PIX_FMT_YUV444P
:
c
->
planes
=
3
;
if
(
avctx
->
colorspace
==
AVCOL_SPC_BT709
)
avctx
->
codec_tag
=
MKTAG
(
'U'
,
'L'
,
'H'
,
'4'
);
else
avctx
->
codec_tag
=
MKTAG
(
'U'
,
'L'
,
'Y'
,
'4'
);
original_format
=
UTVIDEO_444
;
break
;
default:
av_log
(
avctx
,
AV_LOG_ERROR
,
"Unknown pixel format: %d
\n
"
,
avctx
->
pix_fmt
);
...
...
@@ -579,6 +587,17 @@ static int utvideo_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
}
}
break
;
case
AV_PIX_FMT_YUV444P
:
for
(
i
=
0
;
i
<
c
->
planes
;
i
++
)
{
ret
=
encode_plane
(
avctx
,
pic
->
data
[
i
],
c
->
slice_buffer
[
0
],
pic
->
linesize
[
i
],
i
,
width
,
height
,
&
pb
);
if
(
ret
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"Error encoding plane %d.
\n
"
,
i
);
return
ret
;
}
}
break
;
case
AV_PIX_FMT_YUV422P
:
for
(
i
=
0
;
i
<
c
->
planes
;
i
++
)
{
ret
=
encode_plane
(
avctx
,
pic
->
data
[
i
],
c
->
slice_buffer
[
0
],
...
...
@@ -668,6 +687,6 @@ AVCodec ff_utvideo_encoder = {
.
capabilities
=
AV_CODEC_CAP_FRAME_THREADS
|
AV_CODEC_CAP_INTRA_ONLY
,
.
pix_fmts
=
(
const
enum
AVPixelFormat
[])
{
AV_PIX_FMT_RGB24
,
AV_PIX_FMT_RGBA
,
AV_PIX_FMT_YUV422P
,
AV_PIX_FMT_YUV420P
,
AV_PIX_FMT_NONE
AV_PIX_FMT_YUV420P
,
AV_PIX_FMT_
YUV444P
,
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