# HG changeset patch # User romansh # Date 1052334105 0 # Node ID 45633cd5518a8206a788463b17a17ccb1b913486 # Parent b7ce3b3dc171cc3082539297b31f32194733dd9c * introducing new public interface in imgconvert.c + avcodec_get_pix_fmt converts textual representation of pixel format into the actual id. Complements avcodec_get_pix_fmt_name. + avpicture_layout serializes given picture into a flat array. Complements avpicture_fill. * adding a new option -pix_fmt to the ffmpeg, in order to control pixel format for the codecs that do support it, like rawvideo, for example. * reducing complexity of the rawvideo codec by splitting it in two and making it more reliable via hooking up to the avpicture_layout. Plus adding new FourCC as described here: http://www.fourcc.org * A tiny fix for avienc.c that makes avih and video strf consistent regarding codec FourCC. diff -r b7ce3b3dc171 -r 45633cd5518a avienc.c --- a/avienc.c Mon May 05 20:47:23 2003 +0000 +++ b/avienc.c Wed May 07 19:01:45 2003 +0000 @@ -211,7 +211,7 @@ put_le16(pb, enc->bits_per_sample ? enc->bits_per_sample : 24); /* depth */ /* compression type */ - put_le32(pb, for_asf ? codec_get_asf_tag(tags, enc->codec_id) : codec_get_tag(tags, enc->codec_id)); + put_le32(pb, for_asf ? codec_get_asf_tag(tags, enc->codec_id) : enc->codec_tag); put_le32(pb, enc->width * enc->height * 3); put_le32(pb, 0); put_le32(pb, 0); diff -r b7ce3b3dc171 -r 45633cd5518a raw.c --- a/raw.c Mon May 05 20:47:23 2003 +0000 +++ b/raw.c Wed May 07 19:01:45 2003 +0000 @@ -65,6 +65,7 @@ st->codec.frame_rate_base = ap->frame_rate_base; st->codec.width = ap->width; st->codec.height = ap->height; + st->codec.pix_fmt = ap->pix_fmt; break; default: return -1; @@ -455,21 +456,9 @@ width = st->codec.width; height = st->codec.height; - switch(st->codec.pix_fmt) { - case PIX_FMT_YUV420P: - packet_size = (width * height * 3) / 2; - break; - case PIX_FMT_YUV422: - packet_size = (width * height * 2); - break; - case PIX_FMT_BGR24: - case PIX_FMT_RGB24: - packet_size = (width * height * 3); - break; - default: + packet_size = avpicture_get_size(st->codec.pix_fmt, width, height); + if (packet_size < 0) av_abort(); - break; - } if (av_new_packet(pkt, packet_size) < 0) return -EIO;