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
22ddd60b
Commit
22ddd60b
authored
Aug 26, 2003
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixing CODEC_FLAG_GLOBAL_HEADER
Originally committed as revision 2167 to
svn://svn.ffmpeg.org/ffmpeg/trunk
parent
922bc38d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
8 deletions
+21
-8
h263.c
libavcodec/h263.c
+15
-7
mpegvideo.c
libavcodec/mpegvideo.c
+6
-1
No files found.
libavcodec/h263.c
View file @
22ddd60b
...
...
@@ -69,6 +69,8 @@ static int h263_pred_dc(MpegEncContext * s, int n, uint16_t **dc_val_ptr);
#ifdef CONFIG_ENCODERS
static
void
mpeg4_inv_pred_ac
(
MpegEncContext
*
s
,
DCTELEM
*
block
,
int
n
,
int
dir
);
static
void
mpeg4_encode_visual_object_header
(
MpegEncContext
*
s
);
static
void
mpeg4_encode_vol_header
(
MpegEncContext
*
s
,
int
vo_number
,
int
vol_number
);
#endif //CONFIG_ENCODERS
static
void
mpeg4_decode_sprite_trajectory
(
MpegEncContext
*
s
);
static
inline
int
ff_mpeg4_pred_dc
(
MpegEncContext
*
s
,
int
n
,
uint16_t
**
dc_val_ptr
,
int
*
dir_ptr
);
...
...
@@ -1579,6 +1581,19 @@ void h263_encode_init(MpegEncContext *s)
s
->
luma_dc_vlc_length
=
uni_DCtab_lum_len
;
s
->
chroma_dc_vlc_length
=
uni_DCtab_chrom_len
;
s
->
ac_esc_length
=
7
+
2
+
1
+
6
+
1
+
12
+
1
;
if
(
s
->
flags
&
CODEC_FLAG_GLOBAL_HEADER
){
s
->
avctx
->
extradata
=
av_malloc
(
1024
);
init_put_bits
(
&
s
->
pb
,
s
->
avctx
->
extradata
,
1024
,
NULL
,
NULL
);
mpeg4_encode_visual_object_header
(
s
);
mpeg4_encode_vol_header
(
s
,
0
,
0
);
// ff_mpeg4_stuffing(&s->pb); ?
flush_put_bits
(
&
s
->
pb
);
s
->
avctx
->
extradata_size
=
(
get_bit_count
(
&
s
->
pb
)
+
7
)
>>
3
;
}
break
;
case
CODEC_ID_H263P
:
s
->
fcode_tab
=
umv_fcode_tab
;
...
...
@@ -1715,13 +1730,6 @@ void ff_mpeg4_stuffing(PutBitContext * pbc)
void
ff_set_mpeg4_time
(
MpegEncContext
*
s
,
int
picture_number
){
int
time_div
,
time_mod
;
if
(
s
->
pict_type
==
I_TYPE
){
//we will encode a vol header
int
dummy
;
av_reduce
(
&
s
->
time_increment_resolution
,
&
dummy
,
s
->
avctx
->
frame_rate
,
s
->
avctx
->
frame_rate_base
,
(
1
<<
16
)
-
1
);
s
->
time_increment_bits
=
av_log2
(
s
->
time_increment_resolution
-
1
)
+
1
;
}
if
(
s
->
current_picture
.
pts
)
s
->
time
=
(
s
->
current_picture
.
pts
*
s
->
time_increment_resolution
+
500
*
1000
)
/
(
1000
*
1000
);
else
...
...
libavcodec/mpegvideo.c
View file @
22ddd60b
...
...
@@ -549,7 +549,7 @@ void MPV_common_end(MpegEncContext *s)
int
MPV_encode_init
(
AVCodecContext
*
avctx
)
{
MpegEncContext
*
s
=
avctx
->
priv_data
;
int
i
;
int
i
,
dummy
;
int
chroma_h_shift
,
chroma_v_shift
;
avctx
->
pix_fmt
=
PIX_FMT_YUV420P
;
// FIXME
...
...
@@ -646,6 +646,9 @@ int MPV_encode_init(AVCodecContext *avctx)
avcodec_get_chroma_sub_sample
(
avctx
->
pix_fmt
,
&
chroma_h_shift
,
&
chroma_v_shift
);
av_reduce
(
&
s
->
time_increment_resolution
,
&
dummy
,
s
->
avctx
->
frame_rate
,
s
->
avctx
->
frame_rate_base
,
(
1
<<
16
)
-
1
);
s
->
time_increment_bits
=
av_log2
(
s
->
time_increment_resolution
-
1
)
+
1
;
switch
(
avctx
->
codec
->
id
)
{
case
CODEC_ID_MPEG1VIDEO
:
s
->
out_format
=
FMT_MPEG1
;
...
...
@@ -872,6 +875,8 @@ int MPV_encode_end(AVCodecContext *avctx)
MPV_common_end
(
s
);
if
(
s
->
out_format
==
FMT_MJPEG
)
mjpeg_close
(
s
);
av_freep
(
&
avctx
->
extradata
);
return
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