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
094845aa
Commit
094845aa
authored
Jul 16, 2012
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ffv1dec: add simple error concealment in case of CRC errors on slices.
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
371d37fc
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
0 deletions
+23
-0
ffv1.c
libavcodec/ffv1.c
+23
-0
No files found.
libavcodec/ffv1.c
View file @
094845aa
...
...
@@ -37,6 +37,7 @@
#include "libavutil/avassert.h"
#include "libavutil/crc.h"
#include "libavutil/opt.h"
#include "libavutil/imgutils.h"
#ifdef __INTEL_COMPILER
#undef av_flatten
...
...
@@ -197,6 +198,7 @@ typedef struct FFV1Context{
int
gob_count
;
int
packed_at_lsb
;
int
ec
;
int
slice_damaged
;
int
key_frame_ok
;
int
quant_table_count
;
...
...
@@ -2015,6 +2017,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac
}
buf_p
-=
v
;
fs
->
slice_damaged
=
0
;
if
(
f
->
ec
){
unsigned
crc
=
av_crc
(
av_crc_get_table
(
AV_CRC_32_IEEE
),
0
,
buf_p
,
v
);
if
(
crc
){
...
...
@@ -2027,6 +2030,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac
}
else
{
av_log
(
f
->
avctx
,
AV_LOG_ERROR
,
"
\n
"
);
}
fs
->
slice_damaged
=
1
;
}
}
...
...
@@ -2036,6 +2040,25 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac
}
avctx
->
execute
(
avctx
,
decode_slice
,
&
f
->
slice_context
[
0
],
NULL
,
f
->
slice_count
,
sizeof
(
void
*
));
for
(
i
=
f
->
slice_count
-
1
;
i
>=
0
;
i
--
){
FFV1Context
*
fs
=
f
->
slice_context
[
i
];
int
j
;
if
(
fs
->
slice_damaged
&&
f
->
last_picture
.
data
[
0
]){
uint8_t
*
dst
[
4
],
*
src
[
4
];
for
(
j
=
0
;
j
<
4
;
j
++
){
int
sh
=
(
j
==
1
||
j
==
2
)
?
f
->
chroma_h_shift
:
0
;
int
sv
=
(
j
==
1
||
j
==
2
)
?
f
->
chroma_v_shift
:
0
;
dst
[
j
]
=
f
->
picture
.
data
[
j
]
+
f
->
picture
.
linesize
[
j
]
*
(
fs
->
slice_y
>>
sv
)
+
(
fs
->
slice_x
>>
sh
);
src
[
j
]
=
f
->
last_picture
.
data
[
j
]
+
f
->
last_picture
.
linesize
[
j
]
*
(
fs
->
slice_y
>>
sv
)
+
(
fs
->
slice_x
>>
sh
);
}
av_image_copy
(
dst
,
f
->
picture
.
linesize
,
src
,
f
->
last_picture
.
linesize
,
avctx
->
pix_fmt
,
fs
->
slice_width
,
fs
->
slice_height
);
}
}
f
->
picture_number
++
;
*
picture
=
*
p
;
...
...
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