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
a93faf30
Commit
a93faf30
authored
Apr 10, 2017
by
Paul B Mahol
Committed by
Luca Barbato
Apr 15, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
utvideodec: Support UQRA and UQRG
parent
ac29b82e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
45 additions
and
0 deletions
+45
-0
utvideodec.c
libavcodec/utvideodec.c
+43
-0
riff.c
libavformat/riff.c
+2
-0
No files found.
libavcodec/utvideodec.c
View file @
a93faf30
...
...
@@ -351,6 +351,28 @@ static void restore_rgb_planes(uint8_t *src, int step, ptrdiff_t stride,
}
}
static
void
restore_rgb_planes10
(
AVFrame
*
frame
,
int
width
,
int
height
)
{
uint16_t
*
src_r
=
(
uint16_t
*
)
frame
->
data
[
2
];
uint16_t
*
src_g
=
(
uint16_t
*
)
frame
->
data
[
0
];
uint16_t
*
src_b
=
(
uint16_t
*
)
frame
->
data
[
1
];
int
r
,
g
,
b
;
int
i
,
j
;
for
(
j
=
0
;
j
<
height
;
j
++
)
{
for
(
i
=
0
;
i
<
width
;
i
++
)
{
r
=
src_r
[
i
];
g
=
src_g
[
i
];
b
=
src_b
[
i
];
src_r
[
i
]
=
(
r
+
g
-
0x200
)
&
0x3FF
;
src_b
[
i
]
=
(
b
+
g
-
0x200
)
&
0x3FF
;
}
src_r
+=
frame
->
linesize
[
2
]
/
2
;
src_g
+=
frame
->
linesize
[
0
]
/
2
;
src_b
+=
frame
->
linesize
[
1
]
/
2
;
}
}
static
void
restore_median
(
uint8_t
*
src
,
int
step
,
ptrdiff_t
stride
,
int
width
,
int
height
,
int
slices
,
int
rmode
)
{
...
...
@@ -605,6 +627,19 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
restore_rgb_planes
(
frame
.
f
->
data
[
0
],
c
->
planes
,
frame
.
f
->
linesize
[
0
],
avctx
->
width
,
avctx
->
height
);
break
;
case
AV_PIX_FMT_GBRAP10
:
case
AV_PIX_FMT_GBRP10
:
for
(
i
=
0
;
i
<
c
->
planes
;
i
++
)
{
ret
=
decode_plane10
(
c
,
i
,
(
uint16_t
*
)
frame
.
f
->
data
[
i
],
1
,
frame
.
f
->
linesize
[
i
]
/
2
,
avctx
->
width
,
avctx
->
height
,
plane_start
[
i
],
plane_start
[
i
+
1
]
-
1024
,
c
->
frame_pred
==
PRED_LEFT
);
if
(
ret
)
return
ret
;
}
restore_rgb_planes10
(
frame
.
f
,
avctx
->
width
,
avctx
->
height
);
break
;
case
AV_PIX_FMT_YUV420P
:
for
(
i
=
0
;
i
<
3
;
i
++
)
{
ret
=
decode_plane
(
c
,
i
,
frame
.
f
->
data
[
i
],
1
,
frame
.
f
->
linesize
[
i
],
...
...
@@ -731,6 +766,14 @@ static av_cold int decode_init(AVCodecContext *avctx)
c
->
planes
=
3
;
avctx
->
pix_fmt
=
AV_PIX_FMT_YUV422P10
;
break
;
case
MKTAG
(
'U'
,
'Q'
,
'R'
,
'G'
):
c
->
planes
=
3
;
avctx
->
pix_fmt
=
AV_PIX_FMT_GBRP10
;
break
;
case
MKTAG
(
'U'
,
'Q'
,
'R'
,
'A'
):
c
->
planes
=
4
;
avctx
->
pix_fmt
=
AV_PIX_FMT_GBRAP10
;
break
;
case
MKTAG
(
'U'
,
'L'
,
'H'
,
'0'
):
c
->
planes
=
3
;
avctx
->
pix_fmt
=
AV_PIX_FMT_YUV420P
;
...
...
libavformat/riff.c
View file @
a93faf30
...
...
@@ -343,6 +343,8 @@ const AVCodecTag ff_codec_bmp_tags[] = {
{
AV_CODEC_ID_UTVIDEO
,
MKTAG
(
'U'
,
'L'
,
'H'
,
'0'
)
},
{
AV_CODEC_ID_UTVIDEO
,
MKTAG
(
'U'
,
'L'
,
'H'
,
'2'
)
},
{
AV_CODEC_ID_UTVIDEO
,
MKTAG
(
'U'
,
'Q'
,
'Y'
,
'2'
)
},
{
AV_CODEC_ID_UTVIDEO
,
MKTAG
(
'U'
,
'Q'
,
'R'
,
'A'
)
},
{
AV_CODEC_ID_UTVIDEO
,
MKTAG
(
'U'
,
'Q'
,
'R'
,
'G'
)
},
{
AV_CODEC_ID_VBLE
,
MKTAG
(
'V'
,
'B'
,
'L'
,
'E'
)
},
{
AV_CODEC_ID_ESCAPE130
,
MKTAG
(
'E'
,
'1'
,
'3'
,
'0'
)
},
{
AV_CODEC_ID_DXTORY
,
MKTAG
(
'x'
,
't'
,
'o'
,
'r'
)
},
...
...
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