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
8393b80b
Commit
8393b80b
authored
Sep 09, 2013
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec/ffv1dec: Support decoding planes as raw PCM in 1.4
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
77f521d9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
9 deletions
+29
-9
ffv1.h
libavcodec/ffv1.h
+2
-0
ffv1dec.c
libavcodec/ffv1dec.c
+27
-9
No files found.
libavcodec/ffv1.h
View file @
8393b80b
...
...
@@ -128,6 +128,8 @@ typedef struct FFV1Context {
int
slice_height
;
int
slice_x
;
int
slice_y
;
int
slice_reset_contexts
;
int
slice_coding_mode
;
}
FFV1Context
;
int
ffv1_common_init
(
AVCodecContext
*
avctx
);
...
...
libavcodec/ffv1dec.c
View file @
8393b80b
...
...
@@ -105,6 +105,19 @@ static av_always_inline void decode_line(FFV1Context *s, int w,
int
run_mode
=
0
;
int
run_index
=
s
->
run_index
;
if
(
s
->
slice_coding_mode
==
1
)
{
int
i
;
for
(
x
=
0
;
x
<
w
;
x
++
)
{
int
v
=
0
;
for
(
i
=
0
;
i
<
bits
;
i
++
)
{
uint8_t
state
=
128
;
v
+=
v
+
get_rac
(
c
,
&
state
);
}
sample
[
1
][
x
]
=
v
;
}
return
;
}
for
(
x
=
0
;
x
<
w
;
x
++
)
{
int
diff
,
context
,
sign
;
...
...
@@ -233,10 +246,10 @@ static void decode_rgb_frame(FFV1Context *s, uint8_t *src[3], int w, int h, int
sample
[
p
][
1
][
-
1
]
=
sample
[
p
][
0
][
0
];
sample
[
p
][
0
][
w
]
=
sample
[
p
][
0
][
w
-
1
];
if
(
lbd
)
if
(
lbd
&&
s
->
slice_coding_mode
==
0
)
decode_line
(
s
,
w
,
sample
[
p
],
(
p
+
1
)
/
2
,
9
);
else
decode_line
(
s
,
w
,
sample
[
p
],
(
p
+
1
)
/
2
,
bits
+
1
);
decode_line
(
s
,
w
,
sample
[
p
],
(
p
+
1
)
/
2
,
bits
+
(
s
->
slice_coding_mode
!=
1
)
);
}
for
(
x
=
0
;
x
<
w
;
x
++
)
{
int
g
=
sample
[
0
][
1
][
x
];
...
...
@@ -244,11 +257,13 @@ static void decode_rgb_frame(FFV1Context *s, uint8_t *src[3], int w, int h, int
int
r
=
sample
[
2
][
1
][
x
];
int
a
=
sample
[
3
][
1
][
x
];
b
-=
offset
;
r
-=
offset
;
g
-=
(
b
+
r
)
>>
2
;
b
+=
g
;
r
+=
g
;
if
(
s
->
slice_coding_mode
!=
1
)
{
b
-=
offset
;
r
-=
offset
;
g
-=
(
b
+
r
)
>>
2
;
b
+=
g
;
r
+=
g
;
}
if
(
lbd
)
*
((
uint32_t
*
)(
src
[
0
]
+
x
*
4
+
stride
[
0
]
*
y
))
=
b
+
(
g
<<
8
)
+
(
r
<<
16
)
+
(
a
<<
24
);
...
...
@@ -315,7 +330,10 @@ static int decode_slice_header(FFV1Context *f, FFV1Context *fs)
}
f
->
cur
->
sample_aspect_ratio
.
num
=
get_symbol
(
c
,
state
,
0
);
f
->
cur
->
sample_aspect_ratio
.
den
=
get_symbol
(
c
,
state
,
0
);
if
(
fs
->
version
>
3
)
{
fs
->
slice_reset_contexts
=
get_rac
(
c
,
state
);
fs
->
slice_coding_mode
=
get_symbol
(
c
,
state
,
0
);
}
return
0
;
}
...
...
@@ -373,7 +391,7 @@ static int decode_slice(AVCodecContext *c, void *arg)
}
if
((
ret
=
ffv1_init_slice_state
(
f
,
fs
))
<
0
)
return
ret
;
if
(
f
->
cur
->
key_frame
)
if
(
f
->
cur
->
key_frame
||
fs
->
slice_reset_contexts
)
ffv1_clear_slice_state
(
f
,
fs
);
width
=
fs
->
slice_width
;
...
...
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