comparison fraps.c @ 6270:d2af52426ef7 libavcodec

const
author michael
date Fri, 01 Feb 2008 15:28:46 +0000
parents ffac546a3861
children 3356be010cfe
comparison
equal deleted inserted replaced
6269:83cb2494fb8a 6270:d2af52426ef7
82 82
83 /** 83 /**
84 * decode Fraps v2 packed plane 84 * decode Fraps v2 packed plane
85 */ 85 */
86 static int fraps2_decode_plane(FrapsContext *s, uint8_t *dst, int stride, int w, 86 static int fraps2_decode_plane(FrapsContext *s, uint8_t *dst, int stride, int w,
87 int h, uint8_t *src, int size, int Uoff) 87 int h, const uint8_t *src, int size, int Uoff)
88 { 88 {
89 int i, j; 89 int i, j;
90 GetBitContext gb; 90 GetBitContext gb;
91 VLC vlc; 91 VLC vlc;
92 Node nodes[512]; 92 Node nodes[512];
126 * @param buf_size size of input data frame 126 * @param buf_size size of input data frame
127 * @return number of consumed bytes on success or negative if decode fails 127 * @return number of consumed bytes on success or negative if decode fails
128 */ 128 */
129 static int decode_frame(AVCodecContext *avctx, 129 static int decode_frame(AVCodecContext *avctx,
130 void *data, int *data_size, 130 void *data, int *data_size,
131 uint8_t *buf, int buf_size) 131 const uint8_t *buf, int buf_size)
132 { 132 {
133 FrapsContext * const s = avctx->priv_data; 133 FrapsContext * const s = avctx->priv_data;
134 AVFrame *frame = data; 134 AVFrame *frame = data;
135 AVFrame * const f = (AVFrame*)&s->frame; 135 AVFrame * const f = (AVFrame*)&s->frame;
136 uint32_t header; 136 uint32_t header;
137 unsigned int version,header_size; 137 unsigned int version,header_size;
138 unsigned int x, y; 138 unsigned int x, y;
139 uint32_t *buf32; 139 const uint32_t *buf32;
140 uint32_t *luma1,*luma2,*cb,*cr; 140 uint32_t *luma1,*luma2,*cb,*cr;
141 uint32_t offs[4]; 141 uint32_t offs[4];
142 int i, is_chroma, planes; 142 int i, is_chroma, planes;
143 143
144 144
188 /* bit 31 means same as previous pic */ 188 /* bit 31 means same as previous pic */
189 f->pict_type = (header & (1<<31))? FF_P_TYPE : FF_I_TYPE; 189 f->pict_type = (header & (1<<31))? FF_P_TYPE : FF_I_TYPE;
190 f->key_frame = f->pict_type == FF_I_TYPE; 190 f->key_frame = f->pict_type == FF_I_TYPE;
191 191
192 if (f->pict_type == FF_I_TYPE) { 192 if (f->pict_type == FF_I_TYPE) {
193 buf32=(uint32_t*)buf; 193 buf32=(const uint32_t*)buf;
194 for(y=0; y<avctx->height/2; y++){ 194 for(y=0; y<avctx->height/2; y++){
195 luma1=(uint32_t*)&f->data[0][ y*2*f->linesize[0] ]; 195 luma1=(uint32_t*)&f->data[0][ y*2*f->linesize[0] ];
196 luma2=(uint32_t*)&f->data[0][ (y*2+1)*f->linesize[0] ]; 196 luma2=(uint32_t*)&f->data[0][ (y*2+1)*f->linesize[0] ];
197 cr=(uint32_t*)&f->data[1][ y*f->linesize[1] ]; 197 cr=(uint32_t*)&f->data[1][ y*f->linesize[1] ];
198 cb=(uint32_t*)&f->data[2][ y*f->linesize[2] ]; 198 cb=(uint32_t*)&f->data[2][ y*f->linesize[2] ];