Mercurial > libavcodec.hg
comparison rv10.c @ 10018:46f8d58fbdfb libavcodec
Split RV10 encoder off into its own file.
author | diego |
---|---|
date | Mon, 03 Aug 2009 23:22:46 +0000 |
parents | 988e20e4da2f |
children | 16f0933d2c7f |
comparison
equal
deleted
inserted
replaced
10017:988e20e4da2f | 10018:46f8d58fbdfb |
---|---|
1 /* | 1 /* |
2 * RV10 codec | 2 * RV10/RV20 decoder |
3 * Copyright (c) 2000,2001 Fabrice Bellard | 3 * Copyright (c) 2000,2001 Fabrice Bellard |
4 * Copyright (c) 2002-2004 Michael Niedermayer | 4 * Copyright (c) 2002-2004 Michael Niedermayer |
5 * | 5 * |
6 * This file is part of FFmpeg. | 6 * This file is part of FFmpeg. |
7 * | 7 * |
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | 20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
21 */ | 21 */ |
22 | 22 |
23 /** | 23 /** |
24 * @file libavcodec/rv10.c | 24 * @file libavcodec/rv10.c |
25 * RV10 codec. | 25 * RV10/RV20 decoder |
26 */ | 26 */ |
27 | 27 |
28 #include "avcodec.h" | 28 #include "avcodec.h" |
29 #include "dsputil.h" | 29 #include "dsputil.h" |
30 #include "mpegvideo.h" | 30 #include "mpegvideo.h" |
227 } | 227 } |
228 } | 228 } |
229 return -code; | 229 return -code; |
230 } | 230 } |
231 | 231 |
232 | |
233 #if CONFIG_RV10_ENCODER | |
234 /* write RV 1.0 compatible frame header */ | |
235 void rv10_encode_picture_header(MpegEncContext *s, int picture_number) | |
236 { | |
237 int full_frame= 0; | |
238 | |
239 align_put_bits(&s->pb); | |
240 | |
241 put_bits(&s->pb, 1, 1); /* marker */ | |
242 | |
243 put_bits(&s->pb, 1, (s->pict_type == FF_P_TYPE)); | |
244 | |
245 put_bits(&s->pb, 1, 0); /* not PB frame */ | |
246 | |
247 put_bits(&s->pb, 5, s->qscale); | |
248 | |
249 if (s->pict_type == FF_I_TYPE) { | |
250 /* specific MPEG like DC coding not used */ | |
251 } | |
252 /* if multiple packets per frame are sent, the position at which | |
253 to display the macroblocks is coded here */ | |
254 if(!full_frame){ | |
255 put_bits(&s->pb, 6, 0); /* mb_x */ | |
256 put_bits(&s->pb, 6, 0); /* mb_y */ | |
257 put_bits(&s->pb, 12, s->mb_width * s->mb_height); | |
258 } | |
259 | |
260 put_bits(&s->pb, 3, 0); /* ignored */ | |
261 } | |
262 #endif /* CONFIG_RV10_ENCODER */ | |
263 | |
264 /* read RV 1.0 compatible frame header */ | 232 /* read RV 1.0 compatible frame header */ |
265 static int rv10_decode_picture_header(MpegEncContext *s) | 233 static int rv10_decode_picture_header(MpegEncContext *s) |
266 { | 234 { |
267 int mb_count, pb_frame, marker, unk, mb_xy; | 235 int mb_count, pb_frame, marker, unk, mb_xy; |
268 | 236 |
749 CODEC_CAP_DR1 | CODEC_CAP_DELAY, | 717 CODEC_CAP_DR1 | CODEC_CAP_DELAY, |
750 .flush= ff_mpeg_flush, | 718 .flush= ff_mpeg_flush, |
751 .long_name = NULL_IF_CONFIG_SMALL("RealVideo 2.0"), | 719 .long_name = NULL_IF_CONFIG_SMALL("RealVideo 2.0"), |
752 .pix_fmts= ff_pixfmt_list_420, | 720 .pix_fmts= ff_pixfmt_list_420, |
753 }; | 721 }; |
754 | |
755 AVCodec rv10_encoder = { | |
756 "rv10", | |
757 CODEC_TYPE_VIDEO, | |
758 CODEC_ID_RV10, | |
759 sizeof(MpegEncContext), | |
760 MPV_encode_init, | |
761 MPV_encode_picture, | |
762 MPV_encode_end, | |
763 .pix_fmts= (enum PixelFormat[]){PIX_FMT_YUV420P, PIX_FMT_NONE}, | |
764 .long_name= NULL_IF_CONFIG_SMALL("RealVideo 1.0"), | |
765 }; |