Mercurial > libavcodec.hg
comparison ffv1.c @ 9552:4fd9ac9978e5 libavcodec
indent
author | michael |
---|---|
date | Fri, 24 Apr 2009 13:38:28 +0000 |
parents | c005889b5389 |
children | 88dcf5f43a9c |
comparison
equal
deleted
inserted
replaced
9551:710cf96d899b | 9552:4fd9ac9978e5 |
---|---|
262 if(v){ | 262 if(v){ |
263 const int a= FFABS(v); | 263 const int a= FFABS(v); |
264 const int e= av_log2(a); | 264 const int e= av_log2(a); |
265 put_rac(c, state+0, 0); | 265 put_rac(c, state+0, 0); |
266 if(e<=9){ | 266 if(e<=9){ |
267 for(i=0; i<e; i++){ | 267 for(i=0; i<e; i++){ |
268 put_rac(c, state+1+i, 1); //1..10 | 268 put_rac(c, state+1+i, 1); //1..10 |
269 } | 269 } |
270 put_rac(c, state+1+i, 0); | 270 put_rac(c, state+1+i, 0); |
271 | 271 |
272 for(i=e-1; i>=0; i--){ | 272 for(i=e-1; i>=0; i--){ |
273 put_rac(c, state+22+i, (a>>i)&1); //22..31 | 273 put_rac(c, state+22+i, (a>>i)&1); //22..31 |
274 } | 274 } |
275 | 275 |
276 if(is_signed) | 276 if(is_signed) |
277 put_rac(c, state+11 + e, v < 0); //11..21 | 277 put_rac(c, state+11 + e, v < 0); //11..21 |
278 }else{ | 278 }else{ |
279 for(i=0; i<e; i++){ | 279 for(i=0; i<e; i++){ |
280 put_rac(c, state+1+FFMIN(i,9), 1); //1..10 | 280 put_rac(c, state+1+FFMIN(i,9), 1); //1..10 |
281 } | 281 } |
282 put_rac(c, state+1+9, 0); | 282 put_rac(c, state+1+9, 0); |
500 | 500 |
501 sample[0][-1]= sample[1][0 ]; | 501 sample[0][-1]= sample[1][0 ]; |
502 sample[1][ w]= sample[1][w-1]; | 502 sample[1][ w]= sample[1][w-1]; |
503 //{START_TIMER | 503 //{START_TIMER |
504 if(s->avctx->bits_per_raw_sample<=8){ | 504 if(s->avctx->bits_per_raw_sample<=8){ |
505 for(x=0; x<w; x++){ | 505 for(x=0; x<w; x++){ |
506 sample[0][x]= src[x + stride*y]; | 506 sample[0][x]= src[x + stride*y]; |
507 } | 507 } |
508 encode_line(s, w, sample, plane_index, 8); | 508 encode_line(s, w, sample, plane_index, 8); |
509 }else{ | 509 }else{ |
510 for(x=0; x<w; x++){ | 510 for(x=0; x<w; x++){ |
511 sample[0][x]= ((uint16_t*)(src + stride*y))[x] >> (16 - s->avctx->bits_per_raw_sample); | 511 sample[0][x]= ((uint16_t*)(src + stride*y))[x] >> (16 - s->avctx->bits_per_raw_sample); |
512 } | 512 } |
513 encode_line(s, w, sample, plane_index, s->avctx->bits_per_raw_sample); | 513 encode_line(s, w, sample, plane_index, s->avctx->bits_per_raw_sample); |
620 s->ac= avctx->coder_type; | 620 s->ac= avctx->coder_type; |
621 | 621 |
622 s->plane_count=2; | 622 s->plane_count=2; |
623 for(i=0; i<256; i++){ | 623 for(i=0; i<256; i++){ |
624 if(avctx->bits_per_raw_sample <=8){ | 624 if(avctx->bits_per_raw_sample <=8){ |
625 s->quant_table[0][i]= quant11[i]; | 625 s->quant_table[0][i]= quant11[i]; |
626 s->quant_table[1][i]= 11*quant11[i]; | 626 s->quant_table[1][i]= 11*quant11[i]; |
627 if(avctx->context_model==0){ | 627 if(avctx->context_model==0){ |
628 s->quant_table[2][i]= 11*11*quant11[i]; | 628 s->quant_table[2][i]= 11*11*quant11[i]; |
629 s->quant_table[3][i]= | 629 s->quant_table[3][i]= |
630 s->quant_table[4][i]=0; | 630 s->quant_table[4][i]=0; |
631 }else{ | 631 }else{ |
632 s->quant_table[2][i]= 11*11*quant5 [i]; | 632 s->quant_table[2][i]= 11*11*quant5 [i]; |
633 s->quant_table[3][i]= 5*11*11*quant5 [i]; | 633 s->quant_table[3][i]= 5*11*11*quant5 [i]; |
634 s->quant_table[4][i]= 5*5*11*11*quant5 [i]; | 634 s->quant_table[4][i]= 5*5*11*11*quant5 [i]; |
635 } | 635 } |
636 }else{ | 636 }else{ |
637 s->quant_table[0][i]= quant9_10bit[i]; | 637 s->quant_table[0][i]= quant9_10bit[i]; |
638 s->quant_table[1][i]= 11*quant9_10bit[i]; | 638 s->quant_table[1][i]= 11*quant9_10bit[i]; |
639 if(avctx->context_model==0){ | 639 if(avctx->context_model==0){ |
640 s->quant_table[2][i]= 11*11*quant9_10bit[i]; | 640 s->quant_table[2][i]= 11*11*quant9_10bit[i]; |
873 sample[1][-1]= sample[0][0 ]; | 873 sample[1][-1]= sample[0][0 ]; |
874 sample[0][ w]= sample[0][w-1]; | 874 sample[0][ w]= sample[0][w-1]; |
875 | 875 |
876 //{START_TIMER | 876 //{START_TIMER |
877 if(s->avctx->bits_per_raw_sample <= 8){ | 877 if(s->avctx->bits_per_raw_sample <= 8){ |
878 decode_line(s, w, sample, plane_index, 8); | 878 decode_line(s, w, sample, plane_index, 8); |
879 for(x=0; x<w; x++){ | 879 for(x=0; x<w; x++){ |
880 src[x + stride*y]= sample[1][x]; | 880 src[x + stride*y]= sample[1][x]; |
881 } | 881 } |
882 }else{ | 882 }else{ |
883 decode_line(s, w, sample, plane_index, s->avctx->bits_per_raw_sample); | 883 decode_line(s, w, sample, plane_index, s->avctx->bits_per_raw_sample); |
884 for(x=0; x<w; x++){ | 884 for(x=0; x<w; x++){ |
885 ((uint16_t*)(src + stride*y))[x]= sample[1][x] << (16 - s->avctx->bits_per_raw_sample); | 885 ((uint16_t*)(src + stride*y))[x]= sample[1][x] << (16 - s->avctx->bits_per_raw_sample); |
886 } | 886 } |
978 get_rac(c, state); //transparency plane | 978 get_rac(c, state); //transparency plane |
979 f->plane_count= 2; | 979 f->plane_count= 2; |
980 | 980 |
981 if(f->colorspace==0){ | 981 if(f->colorspace==0){ |
982 if(f->avctx->bits_per_raw_sample<=8){ | 982 if(f->avctx->bits_per_raw_sample<=8){ |
983 switch(16*f->chroma_h_shift + f->chroma_v_shift){ | 983 switch(16*f->chroma_h_shift + f->chroma_v_shift){ |
984 case 0x00: f->avctx->pix_fmt= PIX_FMT_YUV444P; break; | 984 case 0x00: f->avctx->pix_fmt= PIX_FMT_YUV444P; break; |
985 case 0x10: f->avctx->pix_fmt= PIX_FMT_YUV422P; break; | 985 case 0x10: f->avctx->pix_fmt= PIX_FMT_YUV422P; break; |
986 case 0x11: f->avctx->pix_fmt= PIX_FMT_YUV420P; break; | 986 case 0x11: f->avctx->pix_fmt= PIX_FMT_YUV420P; break; |
987 case 0x20: f->avctx->pix_fmt= PIX_FMT_YUV411P; break; | 987 case 0x20: f->avctx->pix_fmt= PIX_FMT_YUV411P; break; |
988 case 0x22: f->avctx->pix_fmt= PIX_FMT_YUV410P; break; | 988 case 0x22: f->avctx->pix_fmt= PIX_FMT_YUV410P; break; |
989 default: | 989 default: |
990 av_log(f->avctx, AV_LOG_ERROR, "format not supported\n"); | 990 av_log(f->avctx, AV_LOG_ERROR, "format not supported\n"); |
991 return -1; | 991 return -1; |
992 } | 992 } |
993 }else{ | 993 }else{ |
994 switch(16*f->chroma_h_shift + f->chroma_v_shift){ | 994 switch(16*f->chroma_h_shift + f->chroma_v_shift){ |
995 case 0x00: f->avctx->pix_fmt= PIX_FMT_YUV444P16; break; | 995 case 0x00: f->avctx->pix_fmt= PIX_FMT_YUV444P16; break; |
996 case 0x10: f->avctx->pix_fmt= PIX_FMT_YUV422P16; break; | 996 case 0x10: f->avctx->pix_fmt= PIX_FMT_YUV422P16; break; |
997 case 0x11: f->avctx->pix_fmt= PIX_FMT_YUV420P16; break; | 997 case 0x11: f->avctx->pix_fmt= PIX_FMT_YUV420P16; break; |