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
e3e6f18f
Commit
e3e6f18f
authored
Jul 21, 2008
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplify slice type checks.
Originally committed as revision 14323 to
svn://svn.ffmpeg.org/ffmpeg/trunk
parent
72caa912
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
7 deletions
+9
-7
h264.c
libavcodec/h264.c
+8
-7
h264.h
libavcodec/h264.h
+1
-0
No files found.
libavcodec/h264.c
View file @
e3e6f18f
...
...
@@ -3031,7 +3031,7 @@ static int decode_ref_pic_list_reordering(H264Context *h){
print_short_term
(
h
);
print_long_term
(
h
);
if
(
h
->
slice_type
==
FF_I_TYPE
||
h
->
slice_type
==
FF_S
I_TYPE
)
return
0
;
//FIXME move before func
if
(
h
->
slice_type
_nos
==
FF_
I_TYPE
)
return
0
;
//FIXME move before func
for
(
list
=
0
;
list
<
h
->
list_count
;
list
++
){
memcpy
(
h
->
ref_list
[
list
],
h
->
default_ref_list
[
list
],
sizeof
(
Picture
)
*
h
->
ref_count
[
list
]);
...
...
@@ -3908,6 +3908,7 @@ static int decode_slice_header(H264Context *h, H264Context *h0){
default_ref_list_done
=
1
;
}
h
->
slice_type
=
slice_type
;
h
->
slice_type_nos
=
slice_type
&
3
;
s
->
pict_type
=
h
->
slice_type
;
// to make a few old func happy, it's wrong though
if
(
s
->
pict_type
==
FF_B_TYPE
&&
s0
->
last_picture_ptr
==
NULL
)
{
...
...
@@ -4113,7 +4114,7 @@ static int decode_slice_header(H264Context *h, H264Context *h0){
h
->
ref_count
[
0
]
=
h
->
pps
.
ref_count
[
0
];
h
->
ref_count
[
1
]
=
h
->
pps
.
ref_count
[
1
];
if
(
h
->
slice_type
==
FF_P_TYPE
||
h
->
slice_type
==
FF_SP_TYPE
||
h
->
slice_type
==
FF_B
_TYPE
){
if
(
h
->
slice_type
_nos
!=
FF_I
_TYPE
){
if
(
h
->
slice_type
==
FF_B_TYPE
){
h
->
direct_spatial_mv_pred
=
get_bits1
(
&
s
->
gb
);
if
(
FIELD_PICTURE
&&
h
->
direct_spatial_mv_pred
)
...
...
@@ -4146,7 +4147,7 @@ static int decode_slice_header(H264Context *h, H264Context *h0){
if
(
decode_ref_pic_list_reordering
(
h
)
<
0
)
return
-
1
;
if
(
(
h
->
pps
.
weighted_pred
&&
(
h
->
slice_type
==
FF_P_TYPE
||
h
->
slice_type
==
FF_S
P_TYPE
))
if
(
(
h
->
pps
.
weighted_pred
&&
(
h
->
slice_type
_nos
==
FF_
P_TYPE
))
||
(
h
->
pps
.
weighted_bipred_idc
==
1
&&
h
->
slice_type
==
FF_B_TYPE
)
)
pred_weight_table
(
h
);
else
if
(
h
->
pps
.
weighted_bipred_idc
==
2
&&
h
->
slice_type
==
FF_B_TYPE
)
...
...
@@ -4169,7 +4170,7 @@ static int decode_slice_header(H264Context *h, H264Context *h0){
+
(
h
->
ref_list
[
j
][
i
].
reference
&
3
);
}
if
(
h
->
slice_type
!=
FF_I_TYPE
&&
h
->
slice_type
!=
FF_S
I_TYPE
&&
h
->
pps
.
cabac
){
if
(
h
->
slice_type
_nos
!=
FF_
I_TYPE
&&
h
->
pps
.
cabac
){
tmp
=
get_ue_golomb
(
&
s
->
gb
);
if
(
tmp
>
2
){
av_log
(
s
->
avctx
,
AV_LOG_ERROR
,
"cabac_init_idc overflow
\n
"
);
...
...
@@ -4521,7 +4522,7 @@ static int decode_mb_cavlc(H264Context *h){
tprintf
(
s
->
avctx
,
"pic:%d mb:%d/%d
\n
"
,
h
->
frame_num
,
s
->
mb_x
,
s
->
mb_y
);
cbp
=
0
;
/* avoid warning. FIXME: find a solution without slowing
down the code */
if
(
h
->
slice_type
!=
FF_I_TYPE
&&
h
->
slice_type
!=
FF_S
I_TYPE
){
if
(
h
->
slice_type
_nos
!=
FF_
I_TYPE
){
if
(
s
->
mb_skip_run
==-
1
)
s
->
mb_skip_run
=
get_ue_golomb
(
&
s
->
gb
);
...
...
@@ -4687,7 +4688,7 @@ decode_intra_mb:
h
->
ref_cache
[
1
][
scan8
[
12
]]
=
PART_NOT_AVAILABLE
;
}
}
else
{
assert
(
h
->
slice_type
==
FF_P_TYPE
||
h
->
slice_type
==
FF_S
P_TYPE
);
//FIXME SP correct ?
assert
(
h
->
slice_type
_nos
==
FF_
P_TYPE
);
//FIXME SP correct ?
for
(
i
=
0
;
i
<
4
;
i
++
){
h
->
sub_mb_type
[
i
]
=
get_ue_golomb
(
&
s
->
gb
);
if
(
h
->
sub_mb_type
[
i
]
>=
4
){
...
...
@@ -5636,7 +5637,7 @@ static int decode_mb_cabac(H264Context *h) {
s
->
dsp
.
clear_blocks
(
h
->
mb
);
//FIXME avoid if already clear (move after skip handlong?)
tprintf
(
s
->
avctx
,
"pic:%d mb:%d/%d
\n
"
,
h
->
frame_num
,
s
->
mb_x
,
s
->
mb_y
);
if
(
h
->
slice_type
!=
FF_I_TYPE
&&
h
->
slice_type
!=
FF_S
I_TYPE
)
{
if
(
h
->
slice_type
_nos
!=
FF_
I_TYPE
)
{
int
skip
;
/* a skipped mb needs the aff flag from the following mb */
if
(
FRAME_MBAFF
&&
s
->
mb_x
==
0
&&
(
s
->
mb_y
&
1
)
==
0
)
...
...
libavcodec/h264.h
View file @
e3e6f18f
...
...
@@ -270,6 +270,7 @@ typedef struct H264Context{
uint8_t
*
slice_table_base
;
uint8_t
*
slice_table
;
///< slice_table_base + 2*mb_stride + 1
int
slice_type
;
int
slice_type_nos
;
///< S free slice type (SI/SP are remapped to I/P)
int
slice_type_fixed
;
//interlacing specific flags
...
...
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