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
d1a16564
Commit
d1a16564
authored
Sep 09, 2013
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec/ffv1: YUVA(444,422,420) 9, 10 and 16 bit support
Signed-off-by:
Paul B Mahol
<
onemda@gmail.com
>
parent
a27227d4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
5 deletions
+34
-5
ffv1dec.c
libavcodec/ffv1dec.c
+20
-0
ffv1enc.c
libavcodec/ffv1enc.c
+14
-5
No files found.
libavcodec/ffv1dec.c
View file @
d1a16564
...
...
@@ -668,6 +668,13 @@ static int read_header(FFV1Context *f)
case
0x10
:
f
->
avctx
->
pix_fmt
=
AV_PIX_FMT_YUV422P9
;
break
;
case
0x11
:
f
->
avctx
->
pix_fmt
=
AV_PIX_FMT_YUV420P9
;
break
;
}
}
else
if
(
f
->
avctx
->
bits_per_raw_sample
==
9
&&
f
->
transparency
)
{
f
->
packed_at_lsb
=
1
;
switch
(
16
*
f
->
chroma_h_shift
+
f
->
chroma_v_shift
)
{
case
0x00
:
f
->
avctx
->
pix_fmt
=
AV_PIX_FMT_YUVA444P9
;
break
;
case
0x10
:
f
->
avctx
->
pix_fmt
=
AV_PIX_FMT_YUVA422P9
;
break
;
case
0x11
:
f
->
avctx
->
pix_fmt
=
AV_PIX_FMT_YUVA420P9
;
break
;
}
}
else
if
(
f
->
avctx
->
bits_per_raw_sample
==
10
&&
!
f
->
transparency
)
{
f
->
packed_at_lsb
=
1
;
switch
(
16
*
f
->
chroma_h_shift
+
f
->
chroma_v_shift
)
{
...
...
@@ -675,12 +682,25 @@ static int read_header(FFV1Context *f)
case
0x10
:
f
->
avctx
->
pix_fmt
=
AV_PIX_FMT_YUV422P10
;
break
;
case
0x11
:
f
->
avctx
->
pix_fmt
=
AV_PIX_FMT_YUV420P10
;
break
;
}
}
else
if
(
f
->
avctx
->
bits_per_raw_sample
==
10
&&
f
->
transparency
)
{
f
->
packed_at_lsb
=
1
;
switch
(
16
*
f
->
chroma_h_shift
+
f
->
chroma_v_shift
)
{
case
0x00
:
f
->
avctx
->
pix_fmt
=
AV_PIX_FMT_YUVA444P10
;
break
;
case
0x10
:
f
->
avctx
->
pix_fmt
=
AV_PIX_FMT_YUVA422P10
;
break
;
case
0x11
:
f
->
avctx
->
pix_fmt
=
AV_PIX_FMT_YUVA420P10
;
break
;
}
}
else
if
(
f
->
avctx
->
bits_per_raw_sample
==
16
&&
!
f
->
transparency
){
switch
(
16
*
f
->
chroma_h_shift
+
f
->
chroma_v_shift
)
{
case
0x00
:
f
->
avctx
->
pix_fmt
=
AV_PIX_FMT_YUV444P16
;
break
;
case
0x10
:
f
->
avctx
->
pix_fmt
=
AV_PIX_FMT_YUV422P16
;
break
;
case
0x11
:
f
->
avctx
->
pix_fmt
=
AV_PIX_FMT_YUV420P16
;
break
;
}
}
else
if
(
f
->
avctx
->
bits_per_raw_sample
==
16
&&
f
->
transparency
){
switch
(
16
*
f
->
chroma_h_shift
+
f
->
chroma_v_shift
)
{
case
0x00
:
f
->
avctx
->
pix_fmt
=
AV_PIX_FMT_YUVA444P16
;
break
;
case
0x10
:
f
->
avctx
->
pix_fmt
=
AV_PIX_FMT_YUVA422P16
;
break
;
case
0x11
:
f
->
avctx
->
pix_fmt
=
AV_PIX_FMT_YUVA420P16
;
break
;
}
}
}
else
if
(
f
->
colorspace
==
1
)
{
if
(
f
->
chroma_h_shift
||
f
->
chroma_v_shift
)
{
...
...
libavcodec/ffv1enc.c
View file @
d1a16564
...
...
@@ -692,11 +692,17 @@ static av_cold int encode_init(AVCodecContext *avctx)
case
AV_PIX_FMT_YUV444P9
:
case
AV_PIX_FMT_YUV422P9
:
case
AV_PIX_FMT_YUV420P9
:
case
AV_PIX_FMT_YUVA444P9
:
case
AV_PIX_FMT_YUVA422P9
:
case
AV_PIX_FMT_YUVA420P9
:
if
(
!
avctx
->
bits_per_raw_sample
)
s
->
bits_per_raw_sample
=
9
;
case
AV_PIX_FMT_YUV444P10
:
case
AV_PIX_FMT_YUV420P10
:
case
AV_PIX_FMT_YUV422P10
:
case
AV_PIX_FMT_YUVA444P10
:
case
AV_PIX_FMT_YUVA422P10
:
case
AV_PIX_FMT_YUVA420P10
:
s
->
packed_at_lsb
=
1
;
if
(
!
avctx
->
bits_per_raw_sample
&&
!
s
->
bits_per_raw_sample
)
s
->
bits_per_raw_sample
=
10
;
...
...
@@ -704,6 +710,9 @@ static av_cold int encode_init(AVCodecContext *avctx)
case
AV_PIX_FMT_YUV444P16
:
case
AV_PIX_FMT_YUV422P16
:
case
AV_PIX_FMT_YUV420P16
:
case
AV_PIX_FMT_YUVA444P16
:
case
AV_PIX_FMT_YUVA422P16
:
case
AV_PIX_FMT_YUVA420P16
:
if
(
!
avctx
->
bits_per_raw_sample
&&
!
s
->
bits_per_raw_sample
)
{
s
->
bits_per_raw_sample
=
16
;
}
else
if
(
!
s
->
bits_per_raw_sample
)
{
...
...
@@ -729,15 +738,12 @@ static av_cold int encode_init(AVCodecContext *avctx)
case
AV_PIX_FMT_YUV420P
:
case
AV_PIX_FMT_YUV411P
:
case
AV_PIX_FMT_YUV410P
:
s
->
chroma_planes
=
desc
->
nb_components
<
3
?
0
:
1
;
s
->
colorspace
=
0
;
break
;
case
AV_PIX_FMT_YUVA444P
:
case
AV_PIX_FMT_YUVA422P
:
case
AV_PIX_FMT_YUVA420P
:
s
->
chroma_planes
=
1
;
s
->
chroma_planes
=
desc
->
nb_components
<
3
?
0
:
1
;
s
->
colorspace
=
0
;
s
->
transparency
=
1
;
s
->
transparency
=
desc
->
nb_components
==
4
;
break
;
case
AV_PIX_FMT_RGB32
:
s
->
colorspace
=
1
;
...
...
@@ -1218,6 +1224,9 @@ AVCodec ff_ffv1_encoder = {
AV_PIX_FMT_YUV410P
,
AV_PIX_FMT_0RGB32
,
AV_PIX_FMT_RGB32
,
AV_PIX_FMT_YUV420P16
,
AV_PIX_FMT_YUV422P16
,
AV_PIX_FMT_YUV444P16
,
AV_PIX_FMT_YUV444P9
,
AV_PIX_FMT_YUV422P9
,
AV_PIX_FMT_YUV420P9
,
AV_PIX_FMT_YUV420P10
,
AV_PIX_FMT_YUV422P10
,
AV_PIX_FMT_YUV444P10
,
AV_PIX_FMT_YUVA444P16
,
AV_PIX_FMT_YUVA422P16
,
AV_PIX_FMT_YUVA420P16
,
AV_PIX_FMT_YUVA444P10
,
AV_PIX_FMT_YUVA422P10
,
AV_PIX_FMT_YUVA420P10
,
AV_PIX_FMT_YUVA444P9
,
AV_PIX_FMT_YUVA422P9
,
AV_PIX_FMT_YUVA420P9
,
AV_PIX_FMT_GRAY16
,
AV_PIX_FMT_GRAY8
,
AV_PIX_FMT_GBRP9
,
AV_PIX_FMT_GBRP10
,
AV_PIX_FMT_GBRP12
,
AV_PIX_FMT_GBRP14
,
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