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
1c2a8c7f
Commit
1c2a8c7f
authored
Apr 24, 2002
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec_flush_buffers()
Originally committed as revision 420 to
svn://svn.ffmpeg.org/ffmpeg/trunk
parent
eeba58cc
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
29 additions
and
8 deletions
+29
-8
avcodec.h
libavcodec/avcodec.h
+4
-2
h263.c
libavcodec/h263.c
+2
-2
h263dec.c
libavcodec/h263dec.c
+11
-4
mpegvideo.c
libavcodec/mpegvideo.c
+2
-0
mpegvideo.h
libavcodec/mpegvideo.h
+1
-0
utils.c
libavcodec/utils.c
+9
-0
No files found.
libavcodec/avcodec.h
View file @
1c2a8c7f
...
...
@@ -5,8 +5,8 @@
#define LIBAVCODEC_VERSION_INT 0x000406
#define LIBAVCODEC_VERSION "0.4.6"
#define LIBAVCODEC_BUILD 460
2
#define LIBAVCODEC_BUILD_STR "460
2
"
#define LIBAVCODEC_BUILD 460
3
#define LIBAVCODEC_BUILD_STR "460
3
"
enum
CodecID
{
CODEC_ID_NONE
,
...
...
@@ -340,6 +340,8 @@ int avcodec_close(AVCodecContext *avctx);
void
avcodec_register_all
(
void
);
void
avcodec_flush_buffers
(
AVCodecContext
*
avctx
);
#ifdef FF_POSTPROCESS
#ifndef MBC
#define MBC 128
...
...
libavcodec/h263.c
View file @
1c2a8c7f
...
...
@@ -1034,7 +1034,7 @@ static void mpeg4_encode_vol_header(MpegEncContext * s)
if
(
s
->
low_delay
){
put_bits
(
&
s
->
pb
,
1
,
1
);
/* vol control parameters= yes */
put_bits
(
&
s
->
pb
,
2
,
1
);
/* chroma format
42
2 */
put_bits
(
&
s
->
pb
,
2
,
1
);
/* chroma format
YUV 420/YV1
2 */
put_bits
(
&
s
->
pb
,
1
,
s
->
low_delay
);
put_bits
(
&
s
->
pb
,
1
,
0
);
/* vbv parameters= no */
}
else
{
...
...
@@ -2602,7 +2602,7 @@ int mpeg4_decode_picture_header(MpegEncContext * s)
}
else
{
vo_ver_id
=
1
;
}
//printf("vo type:%d\n",s->vo_type);
s
->
aspect_ratio_info
=
get_bits
(
&
s
->
gb
,
4
);
if
(
s
->
aspect_ratio_info
==
EXTENDET_PAR
){
skip_bits
(
&
s
->
gb
,
8
);
//par_width
...
...
libavcodec/h263dec.c
View file @
1c2a8c7f
...
...
@@ -135,7 +135,6 @@ static int h263_decode_frame(AVCodecContext *avctx,
}
else
{
ret
=
h263_decode_picture_header
(
s
);
}
if
(
ret
==
FRAME_SKIPED
)
return
0
;
/* After H263 & mpeg4 header decode we have the height, width,*/
/* and other parameters. So then we could init the picture */
...
...
@@ -154,8 +153,11 @@ static int h263_decode_frame(AVCodecContext *avctx,
return
-
1
;
}
if
(
ret
==
FRAME_SKIPED
)
return
0
;
if
(
ret
<
0
)
return
-
1
;
/* skip b frames if we dont have reference frames */
if
(
s
->
num_available_buffers
<
2
&&
s
->
pict_type
==
B_TYPE
)
return
0
;
MPV_frame_start
(
s
);
...
...
@@ -222,7 +224,8 @@ static int h263_decode_frame(AVCodecContext *avctx,
}
MPV_decode_mb
(
s
,
s
->
block
);
}
if
(
avctx
->
draw_horiz_band
)
{
if
(
avctx
->
draw_horiz_band
&&
(
s
->
num_available_buffers
>=
1
||
(
!
s
->
has_b_frames
))
)
{
UINT8
*
src_ptr
[
3
];
int
y
,
h
,
offset
;
y
=
s
->
mb_y
*
16
;
...
...
@@ -279,7 +282,11 @@ static int h263_decode_frame(AVCodecContext *avctx,
/* we substract 1 because it is added on utils.c */
avctx
->
frame_number
=
s
->
picture_number
-
1
;
/* dont output the last pic after seeking
note we allready added +1 for the current pix in MPV_frame_end(s) */
if
(
s
->
num_available_buffers
>=
2
||
(
!
s
->
has_b_frames
))
*
data_size
=
sizeof
(
AVPicture
);
return
buf_size
;
}
...
...
libavcodec/mpegvideo.c
View file @
1c2a8c7f
...
...
@@ -629,6 +629,8 @@ void MPV_frame_end(MpegEncContext *s)
s
->
last_non_b_pict_type
=
s
->
pict_type
;
s
->
last_non_b_qscale
=
s
->
qscale
;
s
->
last_non_b_mc_mb_var
=
s
->
mc_mb_var
;
s
->
num_available_buffers
++
;
if
(
s
->
num_available_buffers
>
2
)
s
->
num_available_buffers
=
2
;
}
}
...
...
libavcodec/mpegvideo.h
View file @
1c2a8c7f
...
...
@@ -129,6 +129,7 @@ typedef struct MpegEncContext {
UINT8
*
aux_picture
[
3
];
/* aux picture (for B frames only) */
UINT8
*
aux_picture_base
[
3
];
/* real start of the picture */
UINT8
*
current_picture
[
3
];
/* buffer to store the decompressed current picture */
int
num_available_buffers
;
/* is 0 at the start & after seeking, after the first I frame its 1 after next I/P 2 */
int
last_dc
[
3
];
/* last DC values for MPEG1 */
INT16
*
dc_val
[
3
];
/* used for mpeg4 DC prediction, all 3 arrays must be continuous */
int
y_dc_scale
,
c_dc_scale
;
...
...
libavcodec/utils.c
View file @
1c2a8c7f
...
...
@@ -22,6 +22,7 @@
#include "common.h"
#include "dsputil.h"
#include "avcodec.h"
#include "mpegvideo.h"
#ifdef HAVE_MALLOC_H
#include <malloc.h>
#else
...
...
@@ -479,6 +480,14 @@ PCM_CODEC(CODEC_ID_PCM_MULAW, pcm_mulaw);
#undef PCM_CODEC
}
/* this should be called after seeking and before trying to decode the next frame */
void
avcodec_flush_buffers
(
AVCodecContext
*
avctx
)
{
MpegEncContext
*
s
=
avctx
->
priv_data
;
s
->
num_available_buffers
=
0
;
}
static
int
encode_init
(
AVCodecContext
*
s
)
{
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