aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/mpegvideo.c
diff options
context:
space:
mode:
authorGarrick Meeker <gmeeker@theoryllc.com>2003-07-09 23:10:59 +0000
committerMichael Niedermayer <michaelni@gmx.at>2003-07-09 23:10:59 +0000
commitd4f5d74a54183a0198053b0ceb0faa21ad686551 (patch)
tree69655576785813053b765c0ab095e191c86c0f30 /libavcodec/mpegvideo.c
parentb64dcbe3254337952627098756a454f572c55480 (diff)
downloadffmpeg-d4f5d74a54183a0198053b0ceb0faa21ad686551.tar.gz
flash video (flv) support patch by (Garrick Meeker <gmeeker at theoryllc dot com>)
Originally committed as revision 2024 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/mpegvideo.c')
-rw-r--r--libavcodec/mpegvideo.c34
1 files changed, 30 insertions, 4 deletions
diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c
index 927e973c0e..8b9caaf802 100644
--- a/libavcodec/mpegvideo.c
+++ b/libavcodec/mpegvideo.c
@@ -670,6 +670,14 @@ int MPV_encode_init(AVCodecContext *avctx)
avctx->delay=0;
s->low_delay=1;
break;
+ case CODEC_ID_FLV1:
+ s->out_format = FMT_H263;
+ s->h263_flv = 2; /* format = 1; 11-bit codes */
+ s->unrestricted_mv = 1;
+ s->rtp_mode=0; /* don't allow GOB */
+ avctx->delay=0;
+ s->low_delay=1;
+ break;
case CODEC_ID_RV10:
s->out_format = FMT_H263;
s->h263_rv10 = 1;
@@ -2997,6 +3005,7 @@ static void encode_mb(MpegEncContext *s, int motion_x, int motion_y)
ff_wmv2_encode_mb(s, s->block, motion_x, motion_y); break;
case CODEC_ID_H263:
case CODEC_ID_H263P:
+ case CODEC_ID_FLV1:
case CODEC_ID_RV10:
h263_encode_mb(s, s->block, motion_x, motion_y); break;
#endif
@@ -3348,6 +3357,7 @@ static void encode_picture(MpegEncContext *s, int picture_number)
break;
case CODEC_ID_H263:
case CODEC_ID_H263P:
+ case CODEC_ID_FLV1:
ff_clean_h263_qscales(s);
break;
}
@@ -3427,11 +3437,17 @@ static void encode_picture(MpegEncContext *s, int picture_number)
s->last_mv_dir = 0;
#ifdef CONFIG_RISKY
- if (s->codec_id==CODEC_ID_H263 || s->codec_id==CODEC_ID_H263P)
+ switch(s->codec_id){
+ case CODEC_ID_H263:
+ case CODEC_ID_H263P:
+ case CODEC_ID_FLV1:
s->gob_index = ff_h263_get_gob_height(s);
-
- if(s->codec_id==CODEC_ID_MPEG4 && s->partitioned_frame)
- ff_mpeg4_init_partitions(s);
+ break;
+ case CODEC_ID_MPEG4:
+ if(s->partitioned_frame)
+ ff_mpeg4_init_partitions(s);
+ break;
+ }
#endif
s->resync_mb_x=0;
@@ -4439,6 +4455,16 @@ AVCodec h263p_encoder = {
MPV_encode_end,
};
+AVCodec flv_encoder = {
+ "flv",
+ CODEC_TYPE_VIDEO,
+ CODEC_ID_FLV1,
+ sizeof(MpegEncContext),
+ MPV_encode_init,
+ MPV_encode_picture,
+ MPV_encode_end,
+};
+
AVCodec rv10_encoder = {
"rv10",
CODEC_TYPE_VIDEO,