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
1031fabd
Commit
1031fabd
authored
Dec 29, 2003
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
picture number fixes
Originally committed as revision 2634 to
svn://svn.ffmpeg.org/ffmpeg/trunk
parent
622eb836
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
18 deletions
+11
-18
mpegvideo.c
libavcodec/mpegvideo.c
+7
-15
mpegvideo.h
libavcodec/mpegvideo.h
+3
-2
ratecontrol.c
libavcodec/ratecontrol.c
+1
-1
No files found.
libavcodec/mpegvideo.c
View file @
1031fabd
...
...
@@ -427,6 +427,7 @@ int MPV_common_init(MpegEncContext *s)
if
(
!
s
->
encoding
)
s
->
progressive_sequence
=
1
;
s
->
progressive_frame
=
1
;
s
->
coded_picture_number
=
0
;
y_size
=
(
2
*
s
->
mb_width
+
2
)
*
(
2
*
s
->
mb_height
+
2
);
c_size
=
(
s
->
mb_width
+
2
)
*
(
s
->
mb_height
+
2
);
...
...
@@ -975,6 +976,7 @@ int MPV_encode_init(AVCodecContext *avctx)
return
-
1
;
s
->
picture_number
=
0
;
s
->
input_picture_number
=
0
;
s
->
picture_in_gop_number
=
0
;
s
->
fake_picture_number
=
0
;
/* motion detector init */
...
...
@@ -1153,8 +1155,7 @@ alloc:
pic
->
reference
=
s
->
pict_type
!=
B_TYPE
?
3
:
0
;
if
(
s
->
current_picture_ptr
)
//FIXME broken, we need a coded_picture_number in MpegEncContext
pic
->
coded_picture_number
=
s
->
current_picture_ptr
->
coded_picture_number
+
1
;
pic
->
coded_picture_number
=
s
->
coded_picture_number
++
;
if
(
alloc_picture
(
s
,
(
Picture
*
)
pic
,
0
)
<
0
)
return
-
1
;
...
...
@@ -1644,9 +1645,7 @@ static int load_input_picture(MpegEncContext *s, AVFrame *pic_arg){
}
copy_picture_attributes
(
pic
,
pic_arg
);
if
(
s
->
input_picture
[
encoding_delay
])
pic
->
display_picture_number
=
s
->
input_picture
[
encoding_delay
]
->
display_picture_number
+
1
;
pic
->
display_picture_number
=
s
->
input_picture_number
++
;
}
/* shift buffer entries */
...
...
@@ -1660,10 +1659,6 @@ static int load_input_picture(MpegEncContext *s, AVFrame *pic_arg){
static
void
select_input_picture
(
MpegEncContext
*
s
){
int
i
;
int
coded_pic_num
=
0
;
if
(
s
->
reordered_input_picture
[
0
])
coded_pic_num
=
s
->
reordered_input_picture
[
0
]
->
coded_picture_number
+
1
;
for
(
i
=
1
;
i
<
MAX_PICTURE_COUNT
;
i
++
)
s
->
reordered_input_picture
[
i
-
1
]
=
s
->
reordered_input_picture
[
i
];
...
...
@@ -1674,7 +1669,7 @@ static void select_input_picture(MpegEncContext *s){
if
(
/*s->picture_in_gop_number >= s->gop_size ||*/
s
->
next_picture_ptr
==
NULL
||
s
->
intra_only
){
s
->
reordered_input_picture
[
0
]
=
s
->
input_picture
[
0
];
s
->
reordered_input_picture
[
0
]
->
pict_type
=
I_TYPE
;
s
->
reordered_input_picture
[
0
]
->
coded_picture_number
=
coded_pic_num
;
s
->
reordered_input_picture
[
0
]
->
coded_picture_number
=
s
->
coded_picture_number
++
;
}
else
{
int
b_frames
;
...
...
@@ -1735,12 +1730,11 @@ static void select_input_picture(MpegEncContext *s){
s
->
reordered_input_picture
[
0
]
->
pict_type
=
I_TYPE
;
else
s
->
reordered_input_picture
[
0
]
->
pict_type
=
P_TYPE
;
s
->
reordered_input_picture
[
0
]
->
coded_picture_number
=
coded_pic_num
;
s
->
reordered_input_picture
[
0
]
->
coded_picture_number
=
s
->
coded_picture_number
++
;
for
(
i
=
0
;
i
<
b_frames
;
i
++
){
coded_pic_num
++
;
s
->
reordered_input_picture
[
i
+
1
]
=
s
->
input_picture
[
i
];
s
->
reordered_input_picture
[
i
+
1
]
->
pict_type
=
B_TYPE
;
s
->
reordered_input_picture
[
i
+
1
]
->
coded_picture_number
=
coded_pic_num
;
s
->
reordered_input_picture
[
i
+
1
]
->
coded_picture_number
=
s
->
coded_picture_number
++
;
}
}
}
...
...
@@ -1839,8 +1833,6 @@ int MPV_encode_picture(AVCodecContext *avctx,
}
}
s
->
input_picture_number
++
;
flush_put_bits
(
&
s
->
pb
);
s
->
frame_bits
=
(
pbBufPtr
(
&
s
->
pb
)
-
s
->
pb
.
buf
)
*
8
;
...
...
libavcodec/mpegvideo.h
View file @
1031fabd
...
...
@@ -260,8 +260,9 @@ typedef struct MpegEncContext {
/* sequence parameters */
int
context_initialized
;
int
input_picture_number
;
int
picture_number
;
int
input_picture_number
;
///< used to set pic->display_picture_number, shouldnt be used for/by anything else
int
coded_picture_number
;
///< used to set pic->coded_picture_number, shouldnt be used for/by anything else
int
picture_number
;
//FIXME remove, unclear definition
int
picture_in_gop_number
;
///< 0-> first pic in gop, ...
int
b_frames_since_non_b
;
///< used for encoding, relative to not yet reordered input
int
mb_width
,
mb_height
;
///< number of MBs horizontally & vertically
...
...
libavcodec/ratecontrol.c
View file @
1031fabd
...
...
@@ -39,7 +39,7 @@ static double get_qscale(MpegEncContext *s, RateControlEntry *rce, double rate_f
void
ff_write_pass1_stats
(
MpegEncContext
*
s
){
sprintf
(
s
->
avctx
->
stats_out
,
"in:%d out:%d type:%d q:%d itex:%d ptex:%d mv:%d misc:%d fcode:%d bcode:%d mc-var:%d var:%d icount:%d;
\n
"
,
s
->
picture_number
,
s
->
input_picture_number
-
s
->
max_b_frames
,
s
->
pict_type
,
s
->
current_picture_ptr
->
display_picture_number
,
s
->
current_picture_ptr
->
coded_picture_number
,
s
->
pict_type
,
s
->
current_picture
.
quality
,
s
->
i_tex_bits
,
s
->
p_tex_bits
,
s
->
mv_bits
,
s
->
misc_bits
,
s
->
f_code
,
s
->
b_code
,
s
->
current_picture
.
mc_mb_var_sum
,
s
->
current_picture
.
mb_var_sum
,
s
->
i_count
);
}
...
...
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