Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
ffmpeg
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ffmpeg
Commits
4f22e39e
Commit
4f22e39e
authored
Mar 17, 2014
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec/error_resilience: fix the case when MVs are not available
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
8ef9dcf1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
2 deletions
+29
-2
error_resilience.c
libavcodec/error_resilience.c
+26
-2
error_resilience.h
libavcodec/error_resilience.h
+3
-0
No files found.
libavcodec/error_resilience.c
View file @
4f22e39e
...
...
@@ -904,8 +904,25 @@ void ff_er_frame_end(ERContext *s)
}
if
(
!
s
->
cur_pic
.
motion_val
[
0
]
||
!
s
->
cur_pic
.
ref_index
[
0
])
{
av_log
(
s
->
avctx
,
AV_LOG_ERROR
,
"MVs not available, ER not possible.
\n
"
);
return
;
av_log
(
s
->
avctx
,
AV_LOG_ERROR
,
"Warning MVs not available
\n
"
);
for
(
i
=
0
;
i
<
2
;
i
++
)
{
s
->
ref_index_buf
[
i
]
=
av_buffer_allocz
(
s
->
mb_stride
*
s
->
mb_height
*
4
*
sizeof
(
uint8_t
));
s
->
motion_val_buf
[
i
]
=
av_buffer_allocz
((
size
+
4
)
*
2
*
sizeof
(
uint16_t
));
if
(
!
s
->
ref_index_buf
[
i
]
||
!
s
->
motion_val_buf
[
i
])
break
;
s
->
cur_pic
.
ref_index
[
i
]
=
s
->
ref_index_buf
[
i
]
->
data
;
s
->
cur_pic
.
motion_val
[
i
]
=
(
int16_t
(
*
)[
2
])
s
->
motion_val_buf
[
i
]
->
data
+
4
;
}
if
(
i
<
2
)
{
for
(
i
=
0
;
i
<
2
;
i
++
)
{
av_buffer_unref
(
&
s
->
ref_index_buf
[
i
]);
av_buffer_unref
(
&
s
->
motion_val_buf
[
i
]);
s
->
cur_pic
.
ref_index
[
i
]
=
NULL
;
s
->
cur_pic
.
motion_val
[
i
]
=
NULL
;
}
return
;
}
}
if
(
s
->
avctx
->
debug
&
FF_DEBUG_ER
)
{
...
...
@@ -1279,6 +1296,13 @@ ec_clean:
s
->
mbintra_table
[
mb_xy
]
=
1
;
}
for
(
i
=
0
;
i
<
2
;
i
++
)
{
av_buffer_unref
(
&
s
->
ref_index_buf
[
i
]);
av_buffer_unref
(
&
s
->
motion_val_buf
[
i
]);
s
->
cur_pic
.
ref_index
[
i
]
=
NULL
;
s
->
cur_pic
.
motion_val
[
i
]
=
NULL
;
}
memset
(
&
s
->
cur_pic
,
0
,
sizeof
(
ERPicture
));
memset
(
&
s
->
last_pic
,
0
,
sizeof
(
ERPicture
));
memset
(
&
s
->
next_pic
,
0
,
sizeof
(
ERPicture
));
...
...
libavcodec/error_resilience.h
View file @
4f22e39e
...
...
@@ -72,6 +72,9 @@ typedef struct ERContext {
ERPicture
last_pic
;
ERPicture
next_pic
;
AVBufferRef
*
ref_index_buf
[
2
];
AVBufferRef
*
motion_val_buf
[
2
];
uint16_t
pp_time
;
uint16_t
pb_time
;
int
quarter_sample
;
...
...
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