Mercurial > libavcodec.hg
comparison cyuv.c @ 10706:29d5a7712fb9 libavcodec
Add Auravision Aura decoding support
author | kostya |
---|---|
date | Wed, 23 Dec 2009 13:04:57 +0000 |
parents | 126c0fef9167 |
children | 22afa8a8f4d5 |
comparison
equal
deleted
inserted
replaced
10705:126c0fef9167 | 10706:29d5a7712fb9 |
---|---|
80 unsigned char y_pred, u_pred, v_pred; | 80 unsigned char y_pred, u_pred, v_pred; |
81 int stream_ptr; | 81 int stream_ptr; |
82 unsigned char cur_byte; | 82 unsigned char cur_byte; |
83 int pixel_groups; | 83 int pixel_groups; |
84 | 84 |
85 if (avctx->codec_id == CODEC_ID_AURA) { | |
86 y_table = u_table; | |
87 u_table = v_table; | |
88 } | |
85 /* sanity check the buffer size: A buffer has 3x16-bytes tables | 89 /* sanity check the buffer size: A buffer has 3x16-bytes tables |
86 * followed by (height) lines each with 3 bytes to represent groups | 90 * followed by (height) lines each with 3 bytes to represent groups |
87 * of 4 pixels. Thus, the total size of the buffer ought to be: | 91 * of 4 pixels. Thus, the total size of the buffer ought to be: |
88 * (3 * 16) + height * (width * 3 / 4) */ | 92 * (3 * 16) + height * (width * 3 / 4) */ |
89 if (buf_size != 48 + s->height * (s->width * 3 / 4)) { | 93 if (buf_size != 48 + s->height * (s->width * 3 / 4)) { |
161 *(AVFrame*)data= s->frame; | 165 *(AVFrame*)data= s->frame; |
162 | 166 |
163 return buf_size; | 167 return buf_size; |
164 } | 168 } |
165 | 169 |
170 #if CONFIG_AURA_DECODER | |
171 AVCodec aura_decoder = { | |
172 "aura", | |
173 CODEC_TYPE_VIDEO, | |
174 CODEC_ID_AURA, | |
175 sizeof(CyuvDecodeContext), | |
176 cyuv_decode_init, | |
177 NULL, | |
178 NULL, | |
179 cyuv_decode_frame, | |
180 CODEC_CAP_DR1, | |
181 NULL, | |
182 .long_name = NULL_IF_CONFIG_SMALL("Auravision AURA"), | |
183 }; | |
184 #endif | |
185 | |
186 #if CONFIG_CYUV_DECODER | |
166 AVCodec cyuv_decoder = { | 187 AVCodec cyuv_decoder = { |
167 "cyuv", | 188 "cyuv", |
168 CODEC_TYPE_VIDEO, | 189 CODEC_TYPE_VIDEO, |
169 CODEC_ID_CYUV, | 190 CODEC_ID_CYUV, |
170 sizeof(CyuvDecodeContext), | 191 sizeof(CyuvDecodeContext), |
174 cyuv_decode_frame, | 195 cyuv_decode_frame, |
175 CODEC_CAP_DR1, | 196 CODEC_CAP_DR1, |
176 NULL, | 197 NULL, |
177 .long_name = NULL_IF_CONFIG_SMALL("Creative YUV (CYUV)"), | 198 .long_name = NULL_IF_CONFIG_SMALL("Creative YUV (CYUV)"), |
178 }; | 199 }; |
179 | 200 #endif |