Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
FFmpeg
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
libremedia
Tethys
FFmpeg
Commits
bf89e6b1
Commit
bf89e6b1
authored
23 years ago
by
Fabrice Bellard
Browse files
Options
Downloads
Patches
Plain Diff
added draw_horiz_band test
Originally committed as revision 98 to
svn://svn.ffmpeg.org/ffmpeg/trunk
parent
0617e073
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
libavcodec/avcodec.h
+19
-3
19 additions, 3 deletions
libavcodec/avcodec.h
libavcodec/h263dec.c
+23
-4
23 additions, 4 deletions
libavcodec/h263dec.c
with
42 additions
and
7 deletions
libavcodec/avcodec.h
+
19
−
3
View file @
bf89e6b1
...
...
@@ -8,7 +8,7 @@ enum CodecID {
CODEC_ID_MP2
,
CODEC_ID_AC3
,
CODEC_ID_MJPEG
,
CODEC_ID_
O
PE
NDIVX
,
CODEC_ID_
M
PE
G4
,
CODEC_ID_PCM
,
CODEC_ID_RAWVIDEO
,
CODEC_ID_MSMPEG4
,
...
...
@@ -45,6 +45,11 @@ extern int motion_estimation_method;
#define CODEC_FLAG_HQ 0x0001
/* high quality (non real time) encoding */
#define CODEC_FLAG_QSCALE 0x0002
/* use fixed qscale */
/* codec capabilities */
/* decoder can use draw_horiz_band callback */
#define CODEC_CAP_DRAW_HORIZ_BAND 0x0001
#define FRAME_RATE_BASE 10000
typedef
struct
AVCodecContext
{
...
...
@@ -57,6 +62,15 @@ typedef struct AVCodecContext {
int
width
,
height
;
int
gop_size
;
/* 0 = intra only */
int
pix_fmt
;
/* pixel format, see PIX_FMT_xxx */
/* if non NULL, 'draw_horiz_band' is called by the libavcodec
decoder to draw an horizontal band. It improve cache usage. Not
all codecs can do that. You must check the codec capabilities
before */
void
(
*
draw_horiz_band
)(
struct
AVCodecContext
*
s
,
UINT8
**
src_ptr
,
int
linesize
,
int
y
,
int
width
,
int
height
);
/* audio only */
int
sample_rate
;
/* samples per sec */
int
channels
;
...
...
@@ -72,6 +86,7 @@ typedef struct AVCodecContext {
void
*
priv_data
;
/* the following fields are ignored */
void
*
opaque
;
/* can be used to carry app specific stuff */
char
codec_name
[
32
];
int
codec_type
;
/* see CODEC_TYPE_xxx */
int
codec_id
;
/* see CODEC_ID_xxx */
...
...
@@ -88,6 +103,7 @@ typedef struct AVCodec {
int
(
*
close
)(
AVCodecContext
*
);
int
(
*
decode
)(
AVCodecContext
*
,
void
*
outdata
,
int
*
outdata_size
,
UINT8
*
buf
,
int
buf_size
);
int
capabilities
;
struct
AVCodec
*
next
;
}
AVCodec
;
...
...
@@ -104,11 +120,11 @@ extern AVCodec h263_encoder;
extern
AVCodec
h263p_encoder
;
extern
AVCodec
rv10_encoder
;
extern
AVCodec
mjpeg_encoder
;
extern
AVCodec
o
pe
ndivx
_encoder
;
extern
AVCodec
m
pe
g4
_encoder
;
extern
AVCodec
msmpeg4_encoder
;
extern
AVCodec
h263_decoder
;
extern
AVCodec
o
pe
ndivx
_decoder
;
extern
AVCodec
m
pe
g4
_decoder
;
extern
AVCodec
msmpeg4_decoder
;
extern
AVCodec
mpeg_decoder
;
extern
AVCodec
h263i_decoder
;
...
...
This diff is collapsed.
Click to expand it.
libavcodec/h263dec.c
+
23
−
4
View file @
bf89e6b1
...
...
@@ -30,6 +30,7 @@ static int h263_decode_init(AVCodecContext *avctx)
MpegEncContext
*
s
=
avctx
->
priv_data
;
int
i
;
s
->
avctx
=
avctx
;
s
->
out_format
=
FMT_H263
;
s
->
width
=
avctx
->
width
;
...
...
@@ -39,7 +40,7 @@ static int h263_decode_init(AVCodecContext *avctx)
switch
(
avctx
->
codec
->
id
)
{
case
CODEC_ID_H263
:
break
;
case
CODEC_ID_
O
PE
NDIVX
:
case
CODEC_ID_
M
PE
G4
:
s
->
time_increment_bits
=
4
;
/* default value for broken headers */
s
->
h263_pred
=
1
;
break
;
...
...
@@ -148,6 +149,20 @@ static int h263_decode_frame(AVCodecContext *avctx,
}
MPV_decode_mb
(
s
,
s
->
block
);
}
if
(
avctx
->
draw_horiz_band
)
{
UINT8
*
src_ptr
[
3
];
int
y
,
h
,
offset
;
y
=
s
->
mb_y
*
16
;
h
=
s
->
height
-
y
;
if
(
h
>
16
)
h
=
16
;
offset
=
y
*
s
->
linesize
;
src_ptr
[
0
]
=
s
->
current_picture
[
0
]
+
offset
;
src_ptr
[
1
]
=
s
->
current_picture
[
1
]
+
(
offset
>>
2
);
src_ptr
[
2
]
=
s
->
current_picture
[
2
]
+
(
offset
>>
2
);
avctx
->
draw_horiz_band
(
avctx
,
src_ptr
,
s
->
linesize
,
y
,
s
->
width
,
h
);
}
}
MPV_frame_end
(
s
);
...
...
@@ -164,15 +179,16 @@ static int h263_decode_frame(AVCodecContext *avctx,
return
buf_size
;
}
AVCodec
o
pe
ndivx
_decoder
=
{
"
o
pe
ndivx
"
,
AVCodec
m
pe
g4
_decoder
=
{
"
m
pe
g4
"
,
CODEC_TYPE_VIDEO
,
CODEC_ID_
O
PE
NDIVX
,
CODEC_ID_
M
PE
G4
,
sizeof
(
MpegEncContext
),
h263_decode_init
,
NULL
,
h263_decode_end
,
h263_decode_frame
,
CODEC_CAP_DRAW_HORIZ_BAND
,
};
AVCodec
h263_decoder
=
{
...
...
@@ -184,6 +200,7 @@ AVCodec h263_decoder = {
NULL
,
h263_decode_end
,
h263_decode_frame
,
CODEC_CAP_DRAW_HORIZ_BAND
,
};
AVCodec
msmpeg4_decoder
=
{
...
...
@@ -195,6 +212,7 @@ AVCodec msmpeg4_decoder = {
NULL
,
h263_decode_end
,
h263_decode_frame
,
CODEC_CAP_DRAW_HORIZ_BAND
,
};
AVCodec
h263i_decoder
=
{
...
...
@@ -206,5 +224,6 @@ AVCodec h263i_decoder = {
NULL
,
h263_decode_end
,
h263_decode_frame
,
CODEC_CAP_DRAW_HORIZ_BAND
,
};
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment