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
7eae8cd8
Commit
7eae8cd8
authored
Jun 07, 2014
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec/h264: fix frame skip code
Fixes Ticket3475 Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
9025072e
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
11 deletions
+16
-11
h264.c
libavcodec/h264.c
+5
-11
h264.h
libavcodec/h264.h
+2
-0
h264_slice.c
libavcodec/h264_slice.c
+9
-0
No files found.
libavcodec/h264.c
View file @
7eae8cd8
...
@@ -1617,14 +1617,7 @@ again:
...
@@ -1617,14 +1617,7 @@ again:
ff_vdpau_h264_picture_start
(
h
);
ff_vdpau_h264_picture_start
(
h
);
}
}
if
(
hx
->
redundant_pic_count
==
0
&&
if
(
hx
->
redundant_pic_count
==
0
)
{
(
avctx
->
skip_frame
<
AVDISCARD_NONREF
||
hx
->
nal_ref_idc
)
&&
(
avctx
->
skip_frame
<
AVDISCARD_BIDIR
||
hx
->
slice_type_nos
!=
AV_PICTURE_TYPE_B
)
&&
(
avctx
->
skip_frame
<
AVDISCARD_NONINTRA
||
hx
->
slice_type_nos
==
AV_PICTURE_TYPE_I
)
&&
avctx
->
skip_frame
<
AVDISCARD_ALL
)
{
if
(
avctx
->
hwaccel
)
{
if
(
avctx
->
hwaccel
)
{
ret
=
avctx
->
hwaccel
->
decode_slice
(
avctx
,
ret
=
avctx
->
hwaccel
->
decode_slice
(
avctx
,
&
buf
[
buf_index
-
consumed
],
&
buf
[
buf_index
-
consumed
],
...
@@ -1655,7 +1648,7 @@ again:
...
@@ -1655,7 +1648,7 @@ again:
hx
->
intra_gb_ptr
=
hx
->
intra_gb_ptr
=
hx
->
inter_gb_ptr
=
NULL
;
hx
->
inter_gb_ptr
=
NULL
;
if
((
err
=
ff_h264_decode_slice_header
(
hx
,
h
))
<
0
)
{
if
((
err
=
ff_h264_decode_slice_header
(
hx
,
h
)))
{
/* make sure data_partitioning is cleared if it was set
/* make sure data_partitioning is cleared if it was set
* before, so we don't try decoding a slice without a valid
* before, so we don't try decoding a slice without a valid
* slice header later */
* slice header later */
...
@@ -1730,7 +1723,8 @@ again:
...
@@ -1730,7 +1723,8 @@ again:
context_count
=
0
;
context_count
=
0
;
}
}
if
(
err
<
0
)
{
if
(
err
<
0
||
err
==
SLICE_SKIPED
)
{
if
(
err
<
0
)
av_log
(
h
->
avctx
,
AV_LOG_ERROR
,
"decode_slice_header error
\n
"
);
av_log
(
h
->
avctx
,
AV_LOG_ERROR
,
"decode_slice_header error
\n
"
);
h
->
ref_count
[
0
]
=
h
->
ref_count
[
1
]
=
h
->
list_count
=
0
;
h
->
ref_count
[
0
]
=
h
->
ref_count
[
1
]
=
h
->
list_count
=
0
;
}
else
if
(
err
==
1
)
{
}
else
if
(
err
==
1
)
{
...
...
libavcodec/h264.h
View file @
7eae8cd8
...
@@ -1098,6 +1098,8 @@ int ff_pred_weight_table(H264Context *h);
...
@@ -1098,6 +1098,8 @@ int ff_pred_weight_table(H264Context *h);
int
ff_set_ref_count
(
H264Context
*
h
);
int
ff_set_ref_count
(
H264Context
*
h
);
int
ff_h264_decode_slice_header
(
H264Context
*
h
,
H264Context
*
h0
);
int
ff_h264_decode_slice_header
(
H264Context
*
h
,
H264Context
*
h0
);
#define SLICE_SKIPED 2
int
ff_h264_execute_decode_slices
(
H264Context
*
h
,
unsigned
context_count
);
int
ff_h264_execute_decode_slices
(
H264Context
*
h
,
unsigned
context_count
);
int
ff_h264_update_thread_context
(
AVCodecContext
*
dst
,
int
ff_h264_update_thread_context
(
AVCodecContext
*
dst
,
const
AVCodecContext
*
src
);
const
AVCodecContext
*
src
);
...
...
libavcodec/h264_slice.c
View file @
7eae8cd8
...
@@ -1321,6 +1321,15 @@ int ff_h264_decode_slice_header(H264Context *h, H264Context *h0)
...
@@ -1321,6 +1321,15 @@ int ff_h264_decode_slice_header(H264Context *h, H264Context *h0)
return
AVERROR_INVALIDDATA
;
return
AVERROR_INVALIDDATA
;
}
}
if
(
(
h
->
avctx
->
skip_frame
>=
AVDISCARD_NONREF
&&
!
h
->
nal_ref_idc
)
||
(
h
->
avctx
->
skip_frame
>=
AVDISCARD_BIDIR
&&
h
->
slice_type_nos
==
AV_PICTURE_TYPE_B
)
||
(
h
->
avctx
->
skip_frame
>=
AVDISCARD_NONINTRA
&&
h
->
slice_type_nos
!=
AV_PICTURE_TYPE_I
)
||
(
h
->
avctx
->
skip_frame
>=
AVDISCARD_NONKEY
&&
h
->
nal_unit_type
!=
NAL_IDR_SLICE
)
||
h
->
avctx
->
skip_frame
>=
AVDISCARD_ALL
)
{
return
SLICE_SKIPED
;
}
// to make a few old functions happy, it's wrong though
// to make a few old functions happy, it's wrong though
h
->
pict_type
=
h
->
slice_type
;
h
->
pict_type
=
h
->
slice_type
;
...
...
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