comparison h264.c @ 2757:fa1c8955e291 libavcodec

remove mixed code/declarations
author mru
date Sat, 04 Jun 2005 15:49:54 +0000
parents 975074f04b95
children a7925aaeea1e
comparison
equal deleted inserted replaced
2756:d8874c8749ec 2757:fa1c8955e291
2310 const int l##y = (SRC(-1,y-1) + 2*SRC(-1,y) + SRC(-1,y+1) + 2) >> 2; 2310 const int l##y = (SRC(-1,y-1) + 2*SRC(-1,y) + SRC(-1,y+1) + 2) >> 2;
2311 #define PREDICT_8x8_LOAD_LEFT \ 2311 #define PREDICT_8x8_LOAD_LEFT \
2312 const int l0 = ((has_topleft ? SRC(-1,-1) : SRC(-1,0)) \ 2312 const int l0 = ((has_topleft ? SRC(-1,-1) : SRC(-1,0)) \
2313 + 2*SRC(-1,0) + SRC(-1,1) + 2) >> 2; \ 2313 + 2*SRC(-1,0) + SRC(-1,1) + 2) >> 2; \
2314 PL(1) PL(2) PL(3) PL(4) PL(5) PL(6) \ 2314 PL(1) PL(2) PL(3) PL(4) PL(5) PL(6) \
2315 const int l7 = (SRC(-1,6) + 3*SRC(-1,7) + 2) >> 2; 2315 const int l7 = (SRC(-1,6) + 3*SRC(-1,7) + 2) >> 2
2316 2316
2317 #define PT(x) \ 2317 #define PT(x) \
2318 const int t##x = (SRC(x-1,-1) + 2*SRC(x,-1) + SRC(x+1,-1) + 2) >> 2; 2318 const int t##x = (SRC(x-1,-1) + 2*SRC(x,-1) + SRC(x+1,-1) + 2) >> 2;
2319 #define PREDICT_8x8_LOAD_TOP \ 2319 #define PREDICT_8x8_LOAD_TOP \
2320 const int t0 = ((has_topleft ? SRC(-1,-1) : SRC(0,-1)) \ 2320 const int t0 = ((has_topleft ? SRC(-1,-1) : SRC(0,-1)) \
2321 + 2*SRC(0,-1) + SRC(1,-1) + 2) >> 2; \ 2321 + 2*SRC(0,-1) + SRC(1,-1) + 2) >> 2; \
2322 PT(1) PT(2) PT(3) PT(4) PT(5) PT(6) \ 2322 PT(1) PT(2) PT(3) PT(4) PT(5) PT(6) \
2323 const int t7 = ((has_topright ? SRC(8,-1) : SRC(7,-1)) \ 2323 const int t7 = ((has_topright ? SRC(8,-1) : SRC(7,-1)) \
2324 + 2*SRC(7,-1) + SRC(6,-1) + 2) >> 2; \ 2324 + 2*SRC(7,-1) + SRC(6,-1) + 2) >> 2
2325 2325
2326 #define PTR(x) \ 2326 #define PTR(x) \
2327 t##x = (SRC(x-1,-1) + 2*SRC(x,-1) + SRC(x+1,-1) + 2) >> 2; 2327 t##x = (SRC(x-1,-1) + 2*SRC(x,-1) + SRC(x+1,-1) + 2) >> 2;
2328 #define PREDICT_8x8_LOAD_TOPRIGHT \ 2328 #define PREDICT_8x8_LOAD_TOPRIGHT \
2329 int t8, t9, t10, t11, t12, t13, t14, t15; \ 2329 int t8, t9, t10, t11, t12, t13, t14, t15; \
2331 PTR(8) PTR(9) PTR(10) PTR(11) PTR(12) PTR(13) PTR(14) \ 2331 PTR(8) PTR(9) PTR(10) PTR(11) PTR(12) PTR(13) PTR(14) \
2332 t15 = (SRC(14,-1) + 3*SRC(15,-1) + 2) >> 2; \ 2332 t15 = (SRC(14,-1) + 3*SRC(15,-1) + 2) >> 2; \
2333 } else t8=t9=t10=t11=t12=t13=t14=t15= SRC(7,-1); 2333 } else t8=t9=t10=t11=t12=t13=t14=t15= SRC(7,-1);
2334 2334
2335 #define PREDICT_8x8_LOAD_TOPLEFT \ 2335 #define PREDICT_8x8_LOAD_TOPLEFT \
2336 const int lt = (SRC(-1,0) + 2*SRC(-1,-1) + SRC(0,-1) + 2) >> 2; 2336 const int lt = (SRC(-1,0) + 2*SRC(-1,-1) + SRC(0,-1) + 2) >> 2
2337 2337
2338 #define PREDICT_8x8_DC(v) \ 2338 #define PREDICT_8x8_DC(v) \
2339 int y; \ 2339 int y; \
2340 for( y = 0; y < 8; y++ ) { \ 2340 for( y = 0; y < 8; y++ ) { \
2341 ((uint32_t*)src)[0] = \ 2341 ((uint32_t*)src)[0] = \
4964 }else{ 4964 }else{
4965 for(i8x8=0; i8x8<4; i8x8++){ 4965 for(i8x8=0; i8x8<4; i8x8++){
4966 if(cbp & (1<<i8x8)){ 4966 if(cbp & (1<<i8x8)){
4967 if(IS_8x8DCT(mb_type)){ 4967 if(IS_8x8DCT(mb_type)){
4968 DCTELEM *buf = &h->mb[64*i8x8]; 4968 DCTELEM *buf = &h->mb[64*i8x8];
4969 uint8_t *nnz;
4969 for(i4x4=0; i4x4<4; i4x4++){ 4970 for(i4x4=0; i4x4<4; i4x4++){
4970 if( decode_residual(h, gb, buf, i4x4+4*i8x8, zigzag_scan8x8_cavlc+16*i4x4, 4971 if( decode_residual(h, gb, buf, i4x4+4*i8x8, zigzag_scan8x8_cavlc+16*i4x4,
4971 h->dequant8_coeff[s->qscale], 16) <0 ) 4972 h->dequant8_coeff[s->qscale], 16) <0 )
4972 return -1; 4973 return -1;
4973 } 4974 }
4974 if(s->qscale < 12){ 4975 if(s->qscale < 12){
4975 int i; 4976 int i;
4976 for(i=0; i<64; i++) 4977 for(i=0; i<64; i++)
4977 buf[i] = (buf[i] + 2) >> 2; 4978 buf[i] = (buf[i] + 2) >> 2;
4978 } 4979 }
4979 uint8_t * const nnz= &h->non_zero_count_cache[ scan8[4*i8x8] ]; 4980 nnz= &h->non_zero_count_cache[ scan8[4*i8x8] ];
4980 nnz[0] |= nnz[1] | nnz[8] | nnz[9]; 4981 nnz[0] |= nnz[1] | nnz[8] | nnz[9];
4981 }else{ 4982 }else{
4982 for(i4x4=0; i4x4<4; i4x4++){ 4983 for(i4x4=0; i4x4<4; i4x4++){
4983 const int index= i4x4 + 4*i8x8; 4984 const int index= i4x4 + 4*i8x8;
4984 4985