comparison idcinvideo.c @ 6812:0d01bae8d207 libavcodec

cosmetics: s/Id/id/ in libavcodec where Id refers to id Software. patch by Stefano Sabatini, stefano.sabatini-lala poste it
author diego
date Thu, 15 May 2008 22:51:38 +0000
parents 5b3acf9fd50a
children e943e1409077
comparison
equal deleted inserted replaced
6811:6a85ed5b605a 6812:0d01bae8d207
1 /* 1 /*
2 * Id Quake II CIN Video Decoder 2 * id Quake II CIN Video Decoder
3 * Copyright (C) 2003 the ffmpeg project 3 * Copyright (C) 2003 the ffmpeg project
4 * 4 *
5 * This file is part of FFmpeg. 5 * This file is part of FFmpeg.
6 * 6 *
7 * FFmpeg is free software; you can redistribute it and/or 7 * FFmpeg is free software; you can redistribute it and/or
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 */ 20 */
21 21
22 /** 22 /**
23 * @file idcinvideo.c 23 * @file idcinvideo.c
24 * Id Quake II Cin Video Decoder by Dr. Tim Ferguson 24 * id Quake II Cin Video Decoder by Dr. Tim Ferguson
25 * For more information about the Id CIN format, visit: 25 * For more information about the id CIN format, visit:
26 * http://www.csse.monash.edu.au/~timf/ 26 * http://www.csse.monash.edu.au/~timf/
27 * 27 *
28 * This video decoder outputs PAL8 colorspace data. Interacting with this 28 * This video decoder outputs PAL8 colorspace data. Interacting with this
29 * decoder is a little involved. During initialization, the demuxer must 29 * decoder is a little involved. During initialization, the demuxer must
30 * transmit the 65536-byte Huffman table(s) to the decoder via extradata. 30 * transmit the 65536-byte Huffman table(s) to the decoder via extradata.
31 * Then, whenever a palette change is encountered while demuxing the file, 31 * Then, whenever a palette change is encountered while demuxing the file,
32 * the demuxer must use the same extradata space to transmit an 32 * the demuxer must use the same extradata space to transmit an
33 * AVPaletteControl structure. 33 * AVPaletteControl structure.
34 * 34 *
35 * Id CIN video is purely Huffman-coded, intraframe-only codec. It achieves 35 * id CIN video is purely Huffman-coded, intraframe-only codec. It achieves
36 * a little more compression by exploiting the fact that adjacent pixels 36 * a little more compression by exploiting the fact that adjacent pixels
37 * tend to be similar. 37 * tend to be similar.
38 * 38 *
39 * Note that this decoder could use ffmpeg's optimized VLC facilities 39 * Note that this decoder could use ffmpeg's optimized VLC facilities
40 * rather than naive, tree-based Huffman decoding. However, there are 256 40 * rather than naive, tree-based Huffman decoding. However, there are 256
152 s->avctx = avctx; 152 s->avctx = avctx;
153 avctx->pix_fmt = PIX_FMT_PAL8; 153 avctx->pix_fmt = PIX_FMT_PAL8;
154 154
155 /* make sure the Huffman tables make it */ 155 /* make sure the Huffman tables make it */
156 if (s->avctx->extradata_size != HUFFMAN_TABLE_SIZE) { 156 if (s->avctx->extradata_size != HUFFMAN_TABLE_SIZE) {
157 av_log(s->avctx, AV_LOG_ERROR, " Id CIN video: expected extradata size of %d\n", HUFFMAN_TABLE_SIZE); 157 av_log(s->avctx, AV_LOG_ERROR, " id CIN video: expected extradata size of %d\n", HUFFMAN_TABLE_SIZE);
158 return -1; 158 return -1;
159 } 159 }
160 160
161 /* build the 256 Huffman decode trees */ 161 /* build the 256 Huffman decode trees */
162 histograms = (unsigned char *)s->avctx->extradata; 162 histograms = (unsigned char *)s->avctx->extradata;
219 219
220 if (s->frame.data[0]) 220 if (s->frame.data[0])
221 avctx->release_buffer(avctx, &s->frame); 221 avctx->release_buffer(avctx, &s->frame);
222 222
223 if (avctx->get_buffer(avctx, &s->frame)) { 223 if (avctx->get_buffer(avctx, &s->frame)) {
224 av_log(avctx, AV_LOG_ERROR, " Id CIN Video: get_buffer() failed\n"); 224 av_log(avctx, AV_LOG_ERROR, " id CIN Video: get_buffer() failed\n");
225 return -1; 225 return -1;
226 } 226 }
227 227
228 idcin_decode_vlcs(s); 228 idcin_decode_vlcs(s);
229 229
260 idcin_decode_init, 260 idcin_decode_init,
261 NULL, 261 NULL,
262 idcin_decode_end, 262 idcin_decode_end,
263 idcin_decode_frame, 263 idcin_decode_frame,
264 CODEC_CAP_DR1, 264 CODEC_CAP_DR1,
265 .long_name = "Id Quake II CIN video", 265 .long_name = "id Quake II CIN video",
266 }; 266 };
267 267