comparison huffyuv.c @ 7776:dbcdd0165e55 libavcodec

Replace generic CONFIG_DECODERS preprocessor conditionals by more specific CONFIG_FOO_DECODER conditionals where appropriate.
author diego
date Tue, 02 Sep 2008 23:25:57 +0000
parents e943e1409077
children 6efb15a24e91
comparison
equal deleted inserted replaced
7775:490ee89408c5 7776:dbcdd0165e55
475 assert(s->width>0 && s->height>0); 475 assert(s->width>0 && s->height>0);
476 476
477 return 0; 477 return 0;
478 } 478 }
479 479
480 #ifdef CONFIG_DECODERS 480 #if defined(CONFIG_HUFFYUV_DECODER) || defined(CONFIG_FFVHUFF_DECODER)
481 static av_cold int decode_init(AVCodecContext *avctx) 481 static av_cold int decode_init(AVCodecContext *avctx)
482 { 482 {
483 HYuvContext *s = avctx->priv_data; 483 HYuvContext *s = avctx->priv_data;
484 484
485 common_init(avctx); 485 common_init(avctx);
571 571
572 // av_log(NULL, AV_LOG_DEBUG, "pred:%d bpp:%d hbpp:%d il:%d\n", s->predictor, s->bitstream_bpp, avctx->bits_per_sample, s->interlaced); 572 // av_log(NULL, AV_LOG_DEBUG, "pred:%d bpp:%d hbpp:%d il:%d\n", s->predictor, s->bitstream_bpp, avctx->bits_per_sample, s->interlaced);
573 573
574 return 0; 574 return 0;
575 } 575 }
576 #endif 576 #endif /* defined(CONFIG_HUFFYUV_DECODER) || defined(CONFIG_FFVHUFF_DECODER) */
577 577
578 #ifdef CONFIG_ENCODERS 578 #ifdef CONFIG_ENCODERS
579 static int store_table(HYuvContext *s, uint8_t *len, uint8_t *buf){ 579 static int store_table(HYuvContext *s, uint8_t *len, uint8_t *buf){
580 int i; 580 int i;
581 int index= 0; 581 int index= 0;
929 } 929 }
930 } 930 }
931 return 0; 931 return 0;
932 } 932 }
933 933
934 #ifdef CONFIG_DECODERS 934 #if defined(CONFIG_HUFFYUV_DECODER) || defined(CONFIG_FFVHUFF_DECODER)
935 static void draw_slice(HYuvContext *s, int y){ 935 static void draw_slice(HYuvContext *s, int y){
936 int h, cy; 936 int h, cy;
937 int offset[4]; 937 int offset[4];
938 938
939 if(s->avctx->draw_horiz_band==NULL) 939 if(s->avctx->draw_horiz_band==NULL)
1196 *picture= *p; 1196 *picture= *p;
1197 *data_size = sizeof(AVFrame); 1197 *data_size = sizeof(AVFrame);
1198 1198
1199 return (get_bits_count(&s->gb)+31)/32*4 + table_size; 1199 return (get_bits_count(&s->gb)+31)/32*4 + table_size;
1200 } 1200 }
1201 #endif 1201 #endif /* defined(CONFIG_HUFFYUV_DECODER) || defined(CONFIG_FFVHUFF_DECODER) */
1202 1202
1203 static int common_end(HYuvContext *s){ 1203 static int common_end(HYuvContext *s){
1204 int i; 1204 int i;
1205 1205
1206 for(i=0; i<3; i++){ 1206 for(i=0; i<3; i++){
1207 av_freep(&s->temp[i]); 1207 av_freep(&s->temp[i]);
1208 } 1208 }
1209 return 0; 1209 return 0;
1210 } 1210 }
1211 1211
1212 #ifdef CONFIG_DECODERS 1212 #if defined(CONFIG_HUFFYUV_DECODER) || defined(CONFIG_FFVHUFF_DECODER)
1213 static av_cold int decode_end(AVCodecContext *avctx) 1213 static av_cold int decode_end(AVCodecContext *avctx)
1214 { 1214 {
1215 HYuvContext *s = avctx->priv_data; 1215 HYuvContext *s = avctx->priv_data;
1216 int i; 1216 int i;
1217 1217
1222 free_vlc(&s->vlc[i]); 1222 free_vlc(&s->vlc[i]);
1223 } 1223 }
1224 1224
1225 return 0; 1225 return 0;
1226 } 1226 }
1227 #endif 1227 #endif /* defined(CONFIG_HUFFYUV_DECODER) || defined(CONFIG_FFVHUFF_DECODER) */
1228 1228
1229 #ifdef CONFIG_ENCODERS 1229 #ifdef CONFIG_ENCODERS
1230 static int encode_frame(AVCodecContext *avctx, unsigned char *buf, int buf_size, void *data){ 1230 static int encode_frame(AVCodecContext *avctx, unsigned char *buf, int buf_size, void *data){
1231 HYuvContext *s = avctx->priv_data; 1231 HYuvContext *s = avctx->priv_data;
1232 AVFrame *pict = data; 1232 AVFrame *pict = data;
1431 1431
1432 return 0; 1432 return 0;
1433 } 1433 }
1434 #endif /* CONFIG_ENCODERS */ 1434 #endif /* CONFIG_ENCODERS */
1435 1435
1436 #ifdef CONFIG_DECODERS 1436 #ifdef CONFIG_HUFFYUV_DECODER
1437 AVCodec huffyuv_decoder = { 1437 AVCodec huffyuv_decoder = {
1438 "huffyuv", 1438 "huffyuv",
1439 CODEC_TYPE_VIDEO, 1439 CODEC_TYPE_VIDEO,
1440 CODEC_ID_HUFFYUV, 1440 CODEC_ID_HUFFYUV,
1441 sizeof(HYuvContext), 1441 sizeof(HYuvContext),
1445 decode_frame, 1445 decode_frame,
1446 CODEC_CAP_DR1 | CODEC_CAP_DRAW_HORIZ_BAND, 1446 CODEC_CAP_DR1 | CODEC_CAP_DRAW_HORIZ_BAND,
1447 NULL, 1447 NULL,
1448 .long_name = NULL_IF_CONFIG_SMALL("Huffyuv / HuffYUV"), 1448 .long_name = NULL_IF_CONFIG_SMALL("Huffyuv / HuffYUV"),
1449 }; 1449 };
1450 1450 #endif
1451
1452 #ifdef CONFIG_FFVHUFF_DECODER
1451 AVCodec ffvhuff_decoder = { 1453 AVCodec ffvhuff_decoder = {
1452 "ffvhuff", 1454 "ffvhuff",
1453 CODEC_TYPE_VIDEO, 1455 CODEC_TYPE_VIDEO,
1454 CODEC_ID_FFVHUFF, 1456 CODEC_ID_FFVHUFF,
1455 sizeof(HYuvContext), 1457 sizeof(HYuvContext),