comparison avienc.c @ 76:d03c70b7b50d libavformat

huffyuv encoding fixed
author michaelni
date Sat, 08 Mar 2003 11:21:33 +0000
parents 78bec272ce3a
children f416fa1f5f1c
comparison
equal deleted inserted replaced
75:78bec272ce3a 76:d03c70b7b50d
127 } 127 }
128 128
129 /* BITMAPINFOHEADER header */ 129 /* BITMAPINFOHEADER header */
130 void put_bmp_header(ByteIOContext *pb, AVCodecContext *enc, const CodecTag *tags, int for_asf) 130 void put_bmp_header(ByteIOContext *pb, AVCodecContext *enc, const CodecTag *tags, int for_asf)
131 { 131 {
132 put_le32(pb, 40); /* size */ 132 put_le32(pb, 40 + enc->extradata_size); /* size */
133 put_le32(pb, enc->width); 133 put_le32(pb, enc->width);
134 put_le32(pb, enc->height); 134 put_le32(pb, enc->height);
135 put_le16(pb, 1); /* planes */ 135 put_le16(pb, 1); /* planes */
136 put_le16(pb, 24); /* depth */ 136
137 put_le16(pb, enc->bits_per_sample ? enc->bits_per_sample : 24); /* depth */
137 /* compression type */ 138 /* compression type */
138 put_le32(pb, for_asf ? codec_get_asf_tag(tags, enc->codec_id) : codec_get_tag(tags, enc->codec_id)); 139 put_le32(pb, for_asf ? codec_get_asf_tag(tags, enc->codec_id) : codec_get_tag(tags, enc->codec_id));
139 put_le32(pb, enc->width * enc->height * 3); 140 put_le32(pb, enc->width * enc->height * 3);
140 put_le32(pb, 0); 141 put_le32(pb, 0);
141 put_le32(pb, 0); 142 put_le32(pb, 0);
142 put_le32(pb, 0); 143 put_le32(pb, 0);
143 put_le32(pb, 0); 144 put_le32(pb, 0);
145
146 put_buffer(pb, enc->extradata, enc->extradata_size);
147
148 if (enc->extradata_size & 1)
149 put_byte(pb, 0);
144 } 150 }
145 151
146 static void parse_specific_params(AVCodecContext *stream, int *au_byterate, int *au_ssize, int *au_scale) 152 static void parse_specific_params(AVCodecContext *stream, int *au_byterate, int *au_ssize, int *au_scale)
147 { 153 {
148 switch(stream->codec_id) { 154 switch(stream->codec_id) {