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
fb580731
Commit
fb580731
authored
Feb 14, 2018
by
Jérôme Martinez
Committed by
Michael Niedermayer
Feb 15, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec/ffv1: Support for GBRAP10 and GBRAP12
Signed-off-by:
Michael Niedermayer
<
michael@niedermayer.cc
>
parent
aa628080
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
4 deletions
+9
-4
ffv1dec.c
libavcodec/ffv1dec.c
+4
-0
ffv1dec_template.c
libavcodec/ffv1dec_template.c
+1
-3
ffv1enc.c
libavcodec/ffv1enc.c
+3
-0
ffv1enc_template.c
libavcodec/ffv1enc_template.c
+1
-1
No files found.
libavcodec/ffv1dec.c
View file @
fb580731
...
...
@@ -688,8 +688,12 @@ static int read_header(FFV1Context *f)
f
->
avctx
->
pix_fmt
=
AV_PIX_FMT_GBRP9
;
else
if
(
f
->
avctx
->
bits_per_raw_sample
==
10
&&
!
f
->
transparency
)
f
->
avctx
->
pix_fmt
=
AV_PIX_FMT_GBRP10
;
else
if
(
f
->
avctx
->
bits_per_raw_sample
==
10
&&
f
->
transparency
)
f
->
avctx
->
pix_fmt
=
AV_PIX_FMT_GBRAP10
;
else
if
(
f
->
avctx
->
bits_per_raw_sample
==
12
&&
!
f
->
transparency
)
f
->
avctx
->
pix_fmt
=
AV_PIX_FMT_GBRP12
;
else
if
(
f
->
avctx
->
bits_per_raw_sample
==
12
&&
f
->
transparency
)
f
->
avctx
->
pix_fmt
=
AV_PIX_FMT_GBRAP12
;
else
if
(
f
->
avctx
->
bits_per_raw_sample
==
14
&&
!
f
->
transparency
)
f
->
avctx
->
pix_fmt
=
AV_PIX_FMT_GBRP14
;
else
if
(
f
->
avctx
->
bits_per_raw_sample
==
16
&&
!
f
->
transparency
)
{
...
...
libavcodec/ffv1dec_template.c
View file @
fb580731
...
...
@@ -155,7 +155,7 @@ static void RENAME(decode_rgb_frame)(FFV1Context *s, uint8_t *src[4], int w, int
if
(
lbd
)
*
((
uint32_t
*
)(
src
[
0
]
+
x
*
4
+
stride
[
0
]
*
y
))
=
b
+
((
unsigned
)
g
<<
8
)
+
((
unsigned
)
r
<<
16
)
+
((
unsigned
)
a
<<
24
);
else
if
(
sizeof
(
TYPE
)
==
4
)
{
else
if
(
sizeof
(
TYPE
)
==
4
||
transparency
)
{
*
((
uint16_t
*
)(
src
[
0
]
+
x
*
2
+
stride
[
0
]
*
y
))
=
g
;
*
((
uint16_t
*
)(
src
[
1
]
+
x
*
2
+
stride
[
1
]
*
y
))
=
b
;
*
((
uint16_t
*
)(
src
[
2
]
+
x
*
2
+
stride
[
2
]
*
y
))
=
r
;
...
...
@@ -165,8 +165,6 @@ static void RENAME(decode_rgb_frame)(FFV1Context *s, uint8_t *src[4], int w, int
*
((
uint16_t
*
)(
src
[
0
]
+
x
*
2
+
stride
[
0
]
*
y
))
=
b
;
*
((
uint16_t
*
)(
src
[
1
]
+
x
*
2
+
stride
[
1
]
*
y
))
=
g
;
*
((
uint16_t
*
)(
src
[
2
]
+
x
*
2
+
stride
[
2
]
*
y
))
=
r
;
if
(
transparency
)
*
((
uint16_t
*
)(
src
[
3
]
+
x
*
2
+
stride
[
3
]
*
y
))
=
a
;
}
}
}
...
...
libavcodec/ffv1enc.c
View file @
fb580731
...
...
@@ -648,9 +648,11 @@ FF_ENABLE_DEPRECATION_WARNINGS
if
(
!
avctx
->
bits_per_raw_sample
)
s
->
bits_per_raw_sample
=
9
;
case
AV_PIX_FMT_GBRP10
:
case
AV_PIX_FMT_GBRAP10
:
if
(
!
avctx
->
bits_per_raw_sample
&&
!
s
->
bits_per_raw_sample
)
s
->
bits_per_raw_sample
=
10
;
case
AV_PIX_FMT_GBRP12
:
case
AV_PIX_FMT_GBRAP12
:
if
(
!
avctx
->
bits_per_raw_sample
&&
!
s
->
bits_per_raw_sample
)
s
->
bits_per_raw_sample
=
12
;
case
AV_PIX_FMT_GBRP14
:
...
...
@@ -1326,6 +1328,7 @@ AVCodec ff_ffv1_encoder = {
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_GBRAP10
,
AV_PIX_FMT_GBRAP12
,
AV_PIX_FMT_YA8
,
AV_PIX_FMT_GRAY10
,
AV_PIX_FMT_GRAY12
,
AV_PIX_FMT_GBRP16
,
AV_PIX_FMT_RGB48
,
...
...
libavcodec/ffv1enc_template.c
View file @
fb580731
...
...
@@ -160,7 +160,7 @@ static int RENAME(encode_rgb_frame)(FFV1Context *s, const uint8_t *src[4],
b
=
p
[
2
];
if
(
transparency
)
a
=
p
[
3
];
}
else
if
(
sizeof
(
TYPE
)
==
4
)
{
}
else
if
(
sizeof
(
TYPE
)
==
4
||
transparency
)
{
g
=
*
((
const
uint16_t
*
)(
src
[
0
]
+
x
*
2
+
stride
[
0
]
*
y
));
b
=
*
((
const
uint16_t
*
)(
src
[
1
]
+
x
*
2
+
stride
[
1
]
*
y
));
r
=
*
((
const
uint16_t
*
)(
src
[
2
]
+
x
*
2
+
stride
[
2
]
*
y
));
...
...
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