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
a4dae92b
Commit
a4dae92b
authored
Jan 04, 2005
by
Loren Merritt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Sort B-frames into display order.
Originally committed as revision 3799 to
svn://svn.ffmpeg.org/ffmpeg/trunk
parent
96db7add
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
39 additions
and
9 deletions
+39
-9
h264.c
libavcodec/h264.c
+39
-9
No files found.
libavcodec/h264.c
View file @
a4dae92b
...
...
@@ -281,6 +281,7 @@ typedef struct H264Context{
Picture
default_ref_list
[
2
][
32
];
Picture
ref_list
[
2
][
32
];
//FIXME size?
Picture
field_ref_list
[
2
][
32
];
//FIXME size?
Picture
*
delayed_pic
[
16
];
//FIXME size?
/**
* memory management control operations buffer.
...
...
@@ -2929,20 +2930,30 @@ static int pred_weight_table(H264Context *h){
* instantaneous decoder refresh.
*/
static
void
idr
(
H264Context
*
h
){
int
i
;
int
i
,
j
;
#define CHECK_DELAY(pic) \
for(j = 0; h->delayed_pic[j]; j++) \
if(pic == h->delayed_pic[j]){ \
pic->reference=1; \
break; \
}
for
(
i
=
0
;
i
<
h
->
long_ref_count
;
i
++
){
h
->
long_ref
[
i
]
->
reference
=
0
;
CHECK_DELAY
(
h
->
long_ref
[
i
]);
h
->
long_ref
[
i
]
=
NULL
;
}
h
->
long_ref_count
=
0
;
for
(
i
=
0
;
i
<
h
->
short_ref_count
;
i
++
){
h
->
short_ref
[
i
]
->
reference
=
0
;
CHECK_DELAY
(
h
->
short_ref
[
i
]);
h
->
short_ref
[
i
]
=
NULL
;
}
h
->
short_ref_count
=
0
;
}
#undef CHECK_DELAY
/**
*
...
...
@@ -6088,19 +6099,38 @@ static int decode_frame(AVCodecContext *avctx,
//FIXME do something with unavailable reference frames
// if(ret==FRAME_SKIPED) return get_consumed_bytes(s, buf_index, buf_size);
#if 0
if(s->pict_type==B_TYPE || s->low_delay){
*pict= *(AVFrame*)&s->current_picture;
} else {
*pict= *(AVFrame*)&s->last_picture;
}
#endif
if
(
!
s
->
current_picture_ptr
){
av_log
(
h
->
s
.
avctx
,
AV_LOG_DEBUG
,
"error, NO frame
\n
"
);
return
-
1
;
}
*
pict
=
*
(
AVFrame
*
)
&
s
->
current_picture
;
//FIXME
{
/* Sort B-frames into display order
* FIXME doesn't allow for multiple delayed frames */
Picture
*
cur
=
s
->
current_picture_ptr
;
Picture
*
prev
=
h
->
delayed_pic
[
0
];
Picture
*
out
;
if
(
cur
->
pict_type
==
B_TYPE
||
(
!
h
->
sps
.
gaps_in_frame_num_allowed_flag
&&
prev
&&
cur
->
poc
-
prev
->
poc
>
2
)){
s
->
low_delay
=
0
;
s
->
avctx
->
has_b_frames
=
1
;
}
if
(
s
->
low_delay
||
!
prev
||
cur
->
pict_type
==
B_TYPE
)
out
=
cur
;
else
{
out
=
prev
;
if
(
prev
->
reference
==
1
)
prev
->
reference
=
0
;
}
if
(
!
s
->
low_delay
&&
(
!
prev
||
out
==
prev
))
h
->
delayed_pic
[
0
]
=
cur
;
*
pict
=
*
(
AVFrame
*
)
out
;
}
ff_print_debug_info
(
s
,
pict
);
assert
(
pict
->
data
[
0
]);
//printf("out %d\n", (int)pict->data[0]);
...
...
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