aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/h263dec.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2002-07-14 18:37:35 +0000
committerMichael Niedermayer <michaelni@gmx.at>2002-07-14 18:37:35 +0000
commit93a21abde5c7788e339e5a0fd1f3f02aec676112 (patch)
tree9e9bac40bf3451590a1da8384d6f0d3401741032 /libavcodec/h263dec.c
parent4f68b0847e2884ad5818d98715a0f1440b7b60a5 (diff)
downloadffmpeg-93a21abde5c7788e339e5a0fd1f3f02aec676112.tar.gz
direct rendering method 1 support
Originally committed as revision 759 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/h263dec.c')
-rw-r--r--libavcodec/h263dec.c31
1 files changed, 16 insertions, 15 deletions
diff --git a/libavcodec/h263dec.c b/libavcodec/h263dec.c
index 95b4eaf1cd..7bcd0b197e 100644
--- a/libavcodec/h263dec.c
+++ b/libavcodec/h263dec.c
@@ -89,7 +89,7 @@ static int h263_decode_init(AVCodecContext *avctx)
}
s->codec_id= avctx->codec->id;
avctx->mbskip_table= s->mbskip_table;
-
+
/* for h263, we allocate the images after having read the header */
if (avctx->codec->id != CODEC_ID_H263 && avctx->codec->id != CODEC_ID_MPEG4)
if (MPV_common_init(s) < 0)
@@ -155,21 +155,22 @@ uint64_t time= rdtsc();
ret = h263_decode_picture_header(s);
}
+
/* After H263 & mpeg4 header decode we have the height, width,*/
/* and other parameters. So then we could init the picture */
/* FIXME: By the way H263 decoder is evolving it should have */
/* an H263EncContext */
+ if (s->width != avctx->width || s->height != avctx->height) {
+ /* H.263 could change picture size any time */
+ MPV_common_end(s);
+ s->context_initialized=0;
+ }
if (!s->context_initialized) {
avctx->width = s->width;
avctx->height = s->height;
avctx->aspect_ratio_info= s->aspect_ratio_info;
if (MPV_common_init(s) < 0)
return -1;
- } else if (s->width != avctx->width || s->height != avctx->height) {
- /* H.263 could change picture size any time */
- MPV_common_end(s);
- if (MPV_common_init(s) < 0)
- return -1;
}
if(ret==FRAME_SKIPED) return buf_size;
@@ -190,7 +191,7 @@ uint64_t time= rdtsc();
s->next_p_frame_damaged=0;
}
- MPV_frame_start(s);
+ MPV_frame_start(s, avctx);
#ifdef DEBUG
printf("qscale=%d\n", s->qscale);
@@ -459,7 +460,7 @@ AVCodec mpeg4_decoder = {
NULL,
h263_decode_end,
h263_decode_frame,
- CODEC_CAP_DRAW_HORIZ_BAND,
+ CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1,
};
AVCodec h263_decoder = {
@@ -471,7 +472,7 @@ AVCodec h263_decoder = {
NULL,
h263_decode_end,
h263_decode_frame,
- CODEC_CAP_DRAW_HORIZ_BAND,
+ CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1,
};
AVCodec msmpeg4v1_decoder = {
@@ -483,7 +484,7 @@ AVCodec msmpeg4v1_decoder = {
NULL,
h263_decode_end,
h263_decode_frame,
- CODEC_CAP_DRAW_HORIZ_BAND,
+ CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1,
};
AVCodec msmpeg4v2_decoder = {
@@ -495,7 +496,7 @@ AVCodec msmpeg4v2_decoder = {
NULL,
h263_decode_end,
h263_decode_frame,
- CODEC_CAP_DRAW_HORIZ_BAND,
+ CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1,
};
AVCodec msmpeg4v3_decoder = {
@@ -507,7 +508,7 @@ AVCodec msmpeg4v3_decoder = {
NULL,
h263_decode_end,
h263_decode_frame,
- CODEC_CAP_DRAW_HORIZ_BAND,
+ CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1,
};
AVCodec wmv1_decoder = {
@@ -519,7 +520,7 @@ AVCodec wmv1_decoder = {
NULL,
h263_decode_end,
h263_decode_frame,
- CODEC_CAP_DRAW_HORIZ_BAND,
+ CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1,
};
AVCodec wmv2_decoder = {
@@ -531,7 +532,7 @@ AVCodec wmv2_decoder = {
NULL,
h263_decode_end,
h263_decode_frame,
- CODEC_CAP_DRAW_HORIZ_BAND,
+ CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1,
};
AVCodec h263i_decoder = {
@@ -543,6 +544,6 @@ AVCodec h263i_decoder = {
NULL,
h263_decode_end,
h263_decode_frame,
- CODEC_CAP_DRAW_HORIZ_BAND,
+ CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1,
};