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
9e9286e9
Commit
9e9286e9
authored
Jun 10, 2016
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec/sheervideo: add support for 10-bit interlaced YCbCr(A) 4:2:2
Signed-off-by:
Paul B Mahol
<
onemda@gmail.com
>
parent
f0e7b064
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
242 additions
and
0 deletions
+242
-0
sheervideo.c
libavcodec/sheervideo.c
+242
-0
No files found.
libavcodec/sheervideo.c
View file @
9e9286e9
...
@@ -694,6 +694,73 @@ static const uint8_t l_y_yry10[1024] = {
...
@@ -694,6 +694,73 @@ static const uint8_t l_y_yry10[1024] = {
7
,
7
,
7
,
7
,
6
,
6
,
6
,
6
,
6
,
6
,
6
,
5
,
5
,
5
,
5
,
5
,
7
,
7
,
7
,
7
,
6
,
6
,
6
,
6
,
6
,
6
,
6
,
5
,
5
,
5
,
5
,
5
,
};
};
static
const
uint8_t
l_y_yry10i
[
1024
]
=
{
3
,
5
,
5
,
5
,
6
,
6
,
6
,
6
,
6
,
6
,
6
,
6
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
8
,
8
,
8
,
8
,
8
,
8
,
8
,
8
,
8
,
8
,
8
,
8
,
9
,
9
,
9
,
9
,
9
,
9
,
9
,
9
,
9
,
9
,
9
,
9
,
9
,
9
,
9
,
9
,
9
,
9
,
9
,
10
,
10
,
10
,
10
,
10
,
10
,
10
,
10
,
10
,
10
,
10
,
10
,
10
,
10
,
10
,
10
,
10
,
10
,
10
,
10
,
10
,
10
,
10
,
10
,
10
,
10
,
10
,
11
,
11
,
11
,
11
,
11
,
11
,
11
,
11
,
11
,
11
,
11
,
11
,
11
,
11
,
11
,
11
,
11
,
11
,
11
,
11
,
11
,
11
,
11
,
11
,
11
,
11
,
11
,
12
,
12
,
12
,
12
,
12
,
12
,
12
,
12
,
12
,
12
,
12
,
12
,
12
,
12
,
12
,
12
,
12
,
12
,
12
,
12
,
12
,
12
,
12
,
12
,
12
,
12
,
12
,
12
,
12
,
12
,
12
,
12
,
12
,
12
,
12
,
12
,
12
,
12
,
12
,
12
,
13
,
13
,
13
,
13
,
13
,
13
,
13
,
13
,
13
,
13
,
13
,
13
,
13
,
13
,
13
,
13
,
13
,
13
,
13
,
13
,
13
,
13
,
13
,
13
,
13
,
13
,
13
,
13
,
13
,
13
,
13
,
13
,
13
,
13
,
13
,
13
,
13
,
13
,
13
,
13
,
13
,
13
,
13
,
13
,
13
,
13
,
13
,
13
,
14
,
14
,
14
,
14
,
14
,
14
,
14
,
14
,
14
,
14
,
14
,
14
,
14
,
14
,
14
,
14
,
14
,
14
,
14
,
14
,
14
,
14
,
14
,
14
,
14
,
14
,
14
,
14
,
14
,
14
,
14
,
14
,
14
,
14
,
14
,
14
,
14
,
14
,
14
,
14
,
14
,
14
,
14
,
14
,
14
,
14
,
14
,
14
,
14
,
14
,
14
,
14
,
14
,
14
,
14
,
14
,
14
,
14
,
14
,
14
,
14
,
14
,
14
,
14
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
14
,
14
,
14
,
14
,
14
,
14
,
14
,
14
,
14
,
14
,
14
,
14
,
14
,
14
,
14
,
14
,
14
,
14
,
14
,
14
,
14
,
14
,
14
,
14
,
14
,
14
,
14
,
14
,
14
,
14
,
14
,
14
,
14
,
14
,
14
,
14
,
14
,
14
,
14
,
14
,
14
,
14
,
14
,
14
,
14
,
14
,
14
,
14
,
14
,
14
,
14
,
14
,
14
,
14
,
14
,
14
,
14
,
14
,
14
,
14
,
14
,
14
,
14
,
14
,
14
,
13
,
13
,
13
,
13
,
13
,
13
,
13
,
13
,
13
,
13
,
13
,
13
,
13
,
13
,
13
,
13
,
13
,
13
,
13
,
13
,
13
,
13
,
13
,
13
,
13
,
13
,
13
,
13
,
13
,
13
,
13
,
13
,
13
,
13
,
13
,
13
,
13
,
13
,
13
,
13
,
13
,
13
,
13
,
13
,
13
,
13
,
13
,
13
,
13
,
12
,
12
,
12
,
12
,
12
,
12
,
12
,
12
,
12
,
12
,
12
,
12
,
12
,
12
,
12
,
12
,
12
,
12
,
12
,
12
,
12
,
12
,
12
,
12
,
12
,
12
,
12
,
12
,
12
,
12
,
12
,
12
,
12
,
12
,
12
,
12
,
12
,
12
,
11
,
11
,
11
,
11
,
11
,
11
,
11
,
11
,
11
,
11
,
11
,
11
,
11
,
11
,
11
,
11
,
11
,
11
,
11
,
11
,
11
,
11
,
11
,
11
,
11
,
11
,
10
,
10
,
10
,
10
,
10
,
10
,
10
,
10
,
10
,
10
,
10
,
10
,
10
,
10
,
10
,
10
,
10
,
10
,
10
,
10
,
10
,
10
,
10
,
10
,
10
,
10
,
9
,
9
,
9
,
9
,
9
,
9
,
9
,
9
,
9
,
9
,
9
,
9
,
9
,
9
,
9
,
9
,
9
,
9
,
9
,
9
,
8
,
8
,
8
,
8
,
8
,
8
,
8
,
8
,
8
,
8
,
8
,
8
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
6
,
6
,
6
,
6
,
6
,
6
,
6
,
6
,
5
,
5
,
5
,
};
static
const
uint8_t
l_u_yry10
[
1024
]
=
{
static
const
uint8_t
l_u_yry10
[
1024
]
=
{
2
,
3
,
3
,
4
,
5
,
6
,
7
,
7
,
8
,
8
,
8
,
9
,
9
,
10
,
10
,
10
,
2
,
3
,
3
,
4
,
5
,
6
,
7
,
7
,
8
,
8
,
8
,
9
,
9
,
10
,
10
,
10
,
10
,
11
,
11
,
11
,
11
,
11
,
12
,
12
,
12
,
12
,
12
,
13
,
13
,
13
,
13
,
13
,
10
,
11
,
11
,
11
,
11
,
11
,
12
,
12
,
12
,
12
,
12
,
13
,
13
,
13
,
13
,
13
,
...
@@ -761,6 +828,73 @@ static const uint8_t l_u_yry10[1024] = {
...
@@ -761,6 +828,73 @@ static const uint8_t l_u_yry10[1024] = {
10
,
10
,
10
,
10
,
9
,
9
,
9
,
8
,
8
,
7
,
7
,
6
,
5
,
4
,
4
,
3
,
10
,
10
,
10
,
10
,
9
,
9
,
9
,
8
,
8
,
7
,
7
,
6
,
5
,
4
,
4
,
3
,
};
};
static
const
uint8_t
l_u_yry10i
[
1024
]
=
{
2
,
4
,
4
,
4
,
5
,
6
,
6
,
6
,
7
,
7
,
7
,
8
,
8
,
8
,
9
,
9
,
9
,
9
,
9
,
9
,
10
,
10
,
10
,
10
,
10
,
10
,
10
,
11
,
11
,
11
,
11
,
11
,
11
,
11
,
12
,
12
,
12
,
12
,
12
,
12
,
12
,
12
,
12
,
12
,
12
,
12
,
13
,
13
,
13
,
13
,
13
,
13
,
13
,
13
,
13
,
13
,
13
,
14
,
14
,
14
,
14
,
14
,
14
,
14
,
14
,
14
,
14
,
14
,
14
,
14
,
14
,
14
,
14
,
14
,
14
,
14
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
16
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
15
,
14
,
14
,
14
,
14
,
14
,
14
,
14
,
14
,
14
,
14
,
14
,
14
,
14
,
14
,
14
,
14
,
14
,
14
,
13
,
13
,
13
,
13
,
13
,
13
,
13
,
13
,
13
,
13
,
13
,
13
,
12
,
12
,
12
,
12
,
12
,
12
,
12
,
12
,
12
,
12
,
12
,
12
,
11
,
11
,
11
,
11
,
11
,
11
,
11
,
11
,
10
,
10
,
10
,
10
,
10
,
10
,
9
,
9
,
9
,
9
,
9
,
8
,
8
,
8
,
8
,
7
,
7
,
7
,
6
,
6
,
5
,
5
,
4
,
4
,
3
,
};
static
const
uint8_t
l_y_ybri
[
256
]
=
{
static
const
uint8_t
l_y_ybri
[
256
]
=
{
3
,
3
,
4
,
4
,
5
,
5
,
6
,
6
,
6
,
7
,
7
,
7
,
7
,
7
,
8
,
8
,
3
,
3
,
4
,
4
,
5
,
5
,
6
,
6
,
6
,
7
,
7
,
7
,
7
,
7
,
8
,
8
,
8
,
8
,
8
,
9
,
9
,
9
,
9
,
9
,
9
,
9
,
10
,
10
,
10
,
10
,
10
,
10
,
8
,
8
,
8
,
9
,
9
,
9
,
9
,
9
,
9
,
9
,
10
,
10
,
10
,
10
,
10
,
10
,
...
@@ -1084,6 +1218,48 @@ static void decode_ybr10(AVCodecContext *avctx, AVFrame *p, GetBitContext *gb)
...
@@ -1084,6 +1218,48 @@ static void decode_ybr10(AVCodecContext *avctx, AVFrame *p, GetBitContext *gb)
}
}
}
}
static
void
decode_yry10i
(
AVCodecContext
*
avctx
,
AVFrame
*
p
,
GetBitContext
*
gb
)
{
SheerVideoContext
*
s
=
avctx
->
priv_data
;
uint16_t
*
dst_y
,
*
dst_u
,
*
dst_v
;
int
x
,
y
;
dst_y
=
(
uint16_t
*
)
p
->
data
[
0
];
dst_u
=
(
uint16_t
*
)
p
->
data
[
1
];
dst_v
=
(
uint16_t
*
)
p
->
data
[
2
];
for
(
y
=
0
;
y
<
avctx
->
height
;
y
++
)
{
if
(
get_bits1
(
gb
))
{
for
(
x
=
0
;
x
<
avctx
->
width
;
x
+=
2
)
{
dst_y
[
x
]
=
get_bits
(
gb
,
10
);
dst_u
[
x
/
2
]
=
get_bits
(
gb
,
10
);
dst_y
[
x
+
1
]
=
get_bits
(
gb
,
10
);
dst_v
[
x
/
2
]
=
get_bits
(
gb
,
10
);
}
}
else
{
int
pred
[
4
]
=
{
502
,
512
,
512
,
0
};
for
(
x
=
0
;
x
<
avctx
->
width
;
x
+=
2
)
{
int
y1
,
y2
,
u
,
v
;
y1
=
get_vlc2
(
gb
,
s
->
vlc
[
0
].
table
,
s
->
vlc
[
0
].
bits
,
2
);
u
=
get_vlc2
(
gb
,
s
->
vlc
[
1
].
table
,
s
->
vlc
[
1
].
bits
,
2
);
y2
=
get_vlc2
(
gb
,
s
->
vlc
[
0
].
table
,
s
->
vlc
[
0
].
bits
,
2
);
v
=
get_vlc2
(
gb
,
s
->
vlc
[
1
].
table
,
s
->
vlc
[
1
].
bits
,
2
);
dst_y
[
x
]
=
pred
[
0
]
=
(
y1
+
pred
[
0
])
&
0x3ff
;
dst_u
[
x
/
2
]
=
pred
[
1
]
=
(
u
+
pred
[
1
])
&
0x3ff
;
dst_y
[
x
+
1
]
=
pred
[
0
]
=
(
y2
+
pred
[
0
])
&
0x3ff
;
dst_v
[
x
/
2
]
=
pred
[
2
]
=
(
v
+
pred
[
2
])
&
0x3ff
;
}
}
dst_y
+=
p
->
linesize
[
0
]
/
2
;
dst_u
+=
p
->
linesize
[
1
]
/
2
;
dst_v
+=
p
->
linesize
[
2
]
/
2
;
}
}
static
void
decode_yry10
(
AVCodecContext
*
avctx
,
AVFrame
*
p
,
GetBitContext
*
gb
)
static
void
decode_yry10
(
AVCodecContext
*
avctx
,
AVFrame
*
p
,
GetBitContext
*
gb
)
{
{
SheerVideoContext
*
s
=
avctx
->
priv_data
;
SheerVideoContext
*
s
=
avctx
->
priv_data
;
...
@@ -1167,6 +1343,56 @@ static void decode_yry10(AVCodecContext *avctx, AVFrame *p, GetBitContext *gb)
...
@@ -1167,6 +1343,56 @@ static void decode_yry10(AVCodecContext *avctx, AVFrame *p, GetBitContext *gb)
}
}
}
}
static
void
decode_ca2i
(
AVCodecContext
*
avctx
,
AVFrame
*
p
,
GetBitContext
*
gb
)
{
SheerVideoContext
*
s
=
avctx
->
priv_data
;
uint16_t
*
dst_y
,
*
dst_u
,
*
dst_v
,
*
dst_a
;
int
x
,
y
;
dst_y
=
(
uint16_t
*
)
p
->
data
[
0
];
dst_u
=
(
uint16_t
*
)
p
->
data
[
1
];
dst_v
=
(
uint16_t
*
)
p
->
data
[
2
];
dst_a
=
(
uint16_t
*
)
p
->
data
[
3
];
for
(
y
=
0
;
y
<
avctx
->
height
;
y
++
)
{
if
(
get_bits1
(
gb
))
{
for
(
x
=
0
;
x
<
avctx
->
width
;
x
+=
2
)
{
dst_a
[
x
]
=
get_bits
(
gb
,
10
);
dst_y
[
x
]
=
get_bits
(
gb
,
10
);
dst_u
[
x
/
2
]
=
get_bits
(
gb
,
10
);
dst_a
[
x
+
1
]
=
get_bits
(
gb
,
10
);
dst_y
[
x
+
1
]
=
get_bits
(
gb
,
10
);
dst_v
[
x
/
2
]
=
get_bits
(
gb
,
10
);
}
}
else
{
int
pred
[
4
]
=
{
502
,
512
,
512
,
502
};
for
(
x
=
0
;
x
<
avctx
->
width
;
x
+=
2
)
{
int
y1
,
y2
,
u
,
v
,
a1
,
a2
;
a1
=
get_vlc2
(
gb
,
s
->
vlc
[
1
].
table
,
s
->
vlc
[
1
].
bits
,
2
);
y1
=
get_vlc2
(
gb
,
s
->
vlc
[
0
].
table
,
s
->
vlc
[
0
].
bits
,
2
);
u
=
get_vlc2
(
gb
,
s
->
vlc
[
1
].
table
,
s
->
vlc
[
1
].
bits
,
2
);
a2
=
get_vlc2
(
gb
,
s
->
vlc
[
1
].
table
,
s
->
vlc
[
1
].
bits
,
2
);
y2
=
get_vlc2
(
gb
,
s
->
vlc
[
0
].
table
,
s
->
vlc
[
0
].
bits
,
2
);
v
=
get_vlc2
(
gb
,
s
->
vlc
[
1
].
table
,
s
->
vlc
[
1
].
bits
,
2
);
dst_y
[
x
]
=
pred
[
0
]
=
(
y1
+
pred
[
0
])
&
0x3ff
;
dst_u
[
x
/
2
]
=
pred
[
1
]
=
(
u
+
pred
[
1
])
&
0x3ff
;
dst_y
[
x
+
1
]
=
pred
[
0
]
=
(
y2
+
pred
[
0
])
&
0x3ff
;
dst_a
[
x
]
=
pred
[
3
]
=
(
a1
+
pred
[
3
])
&
0x3ff
;
dst_v
[
x
/
2
]
=
pred
[
2
]
=
(
v
+
pred
[
2
])
&
0x3ff
;
dst_a
[
x
+
1
]
=
pred
[
3
]
=
(
a2
+
pred
[
3
])
&
0x3ff
;
}
}
dst_y
+=
p
->
linesize
[
0
]
/
2
;
dst_u
+=
p
->
linesize
[
1
]
/
2
;
dst_v
+=
p
->
linesize
[
2
]
/
2
;
dst_a
+=
p
->
linesize
[
3
]
/
2
;
}
}
static
void
decode_ca2p
(
AVCodecContext
*
avctx
,
AVFrame
*
p
,
GetBitContext
*
gb
)
static
void
decode_ca2p
(
AVCodecContext
*
avctx
,
AVFrame
*
p
,
GetBitContext
*
gb
)
{
{
SheerVideoContext
*
s
=
avctx
->
priv_data
;
SheerVideoContext
*
s
=
avctx
->
priv_data
;
...
@@ -2610,6 +2836,14 @@ static int decode_frame(AVCodecContext *avctx,
...
@@ -2610,6 +2836,14 @@ static int decode_frame(AVCodecContext *avctx,
build_vlc
(
&
s
->
vlc
[
1
],
l_u_yry10
,
1024
);
build_vlc
(
&
s
->
vlc
[
1
],
l_u_yry10
,
1024
);
}
}
break
;
break
;
case
MKTAG
(
0xa2
,
'Y'
,
'R'
,
'y'
):
avctx
->
pix_fmt
=
AV_PIX_FMT_YUV422P10
;
s
->
decode_frame
=
decode_yry10i
;
if
(
s
->
format
!=
format
)
{
build_vlc
(
&
s
->
vlc
[
0
],
l_y_yry10i
,
1024
);
build_vlc
(
&
s
->
vlc
[
1
],
l_u_yry10i
,
1024
);
}
break
;
case
MKTAG
(
'C'
,
'A'
,
'2'
,
'p'
):
case
MKTAG
(
'C'
,
'A'
,
'2'
,
'p'
):
avctx
->
pix_fmt
=
AV_PIX_FMT_YUVA422P10
;
avctx
->
pix_fmt
=
AV_PIX_FMT_YUVA422P10
;
s
->
decode_frame
=
decode_ca2p
;
s
->
decode_frame
=
decode_ca2p
;
...
@@ -2618,6 +2852,14 @@ static int decode_frame(AVCodecContext *avctx,
...
@@ -2618,6 +2852,14 @@ static int decode_frame(AVCodecContext *avctx,
build_vlc
(
&
s
->
vlc
[
1
],
l_u_yry10
,
1024
);
build_vlc
(
&
s
->
vlc
[
1
],
l_u_yry10
,
1024
);
}
}
break
;
break
;
case
MKTAG
(
'C'
,
'A'
,
'2'
,
'i'
):
avctx
->
pix_fmt
=
AV_PIX_FMT_YUVA422P10
;
s
->
decode_frame
=
decode_ca2i
;
if
(
s
->
format
!=
format
)
{
build_vlc
(
&
s
->
vlc
[
0
],
l_y_yry10i
,
1024
);
build_vlc
(
&
s
->
vlc
[
1
],
l_u_yry10i
,
1024
);
}
break
;
default:
default:
avpriv_request_sample
(
avctx
,
"unsupported format: 0x%X"
,
format
);
avpriv_request_sample
(
avctx
,
"unsupported format: 0x%X"
,
format
);
return
AVERROR_PATCHWELCOME
;
return
AVERROR_PATCHWELCOME
;
...
...
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