comparison h264.c @ 8357:1ef90fd7706a libavcodec

Fix indention, also do a little vertical alignment of changed lines.
author michael
date Tue, 16 Dec 2008 22:16:11 +0000
parents 179f8e1327ce
children 156137b60026
comparison
equal deleted inserted replaced
8356:0030146fc2ba 8357:1ef90fd7706a
2446 uint8_t * const ptr= dest_y + block_offset[i]; 2446 uint8_t * const ptr= dest_y + block_offset[i];
2447 const int dir= h->intra4x4_pred_mode_cache[ scan8[i] ]; 2447 const int dir= h->intra4x4_pred_mode_cache[ scan8[i] ];
2448 if(transform_bypass && h->sps.profile_idc==244 && dir<=1){ 2448 if(transform_bypass && h->sps.profile_idc==244 && dir<=1){
2449 h->hpc.pred8x8l_add[dir](ptr, h->mb + i*16, linesize); 2449 h->hpc.pred8x8l_add[dir](ptr, h->mb + i*16, linesize);
2450 }else{ 2450 }else{
2451 const int nnz = h->non_zero_count_cache[ scan8[i] ]; 2451 const int nnz = h->non_zero_count_cache[ scan8[i] ];
2452 h->hpc.pred8x8l[ dir ](ptr, (h->topleft_samples_available<<i)&0x8000, 2452 h->hpc.pred8x8l[ dir ](ptr, (h->topleft_samples_available<<i)&0x8000,
2453 (h->topright_samples_available<<i)&0x4000, linesize); 2453 (h->topright_samples_available<<i)&0x4000, linesize);
2454 if(nnz){ 2454 if(nnz){
2455 if(nnz == 1 && h->mb[i*16]) 2455 if(nnz == 1 && h->mb[i*16])
2456 idct_dc_add(ptr, h->mb + i*16, linesize); 2456 idct_dc_add(ptr, h->mb + i*16, linesize);
2457 else 2457 else
2458 idct_add(ptr, h->mb + i*16, linesize); 2458 idct_add (ptr, h->mb + i*16, linesize);
2459 } 2459 }
2460 } 2460 }
2461 } 2461 }
2462 }else 2462 }else
2463 for(i=0; i<16; i++){ 2463 for(i=0; i<16; i++){
2464 uint8_t * const ptr= dest_y + block_offset[i]; 2464 uint8_t * const ptr= dest_y + block_offset[i];
2465 const int dir= h->intra4x4_pred_mode_cache[ scan8[i] ]; 2465 const int dir= h->intra4x4_pred_mode_cache[ scan8[i] ];
2466 2466
2467 if(transform_bypass && h->sps.profile_idc==244 && dir<=1){ 2467 if(transform_bypass && h->sps.profile_idc==244 && dir<=1){
2468 h->hpc.pred4x4_add[dir](ptr, h->mb + i*16, linesize); 2468 h->hpc.pred4x4_add[dir](ptr, h->mb + i*16, linesize);
2469 }else{ 2469 }else{
2470 uint8_t *topright; 2470 uint8_t *topright;
2471 int nnz, tr; 2471 int nnz, tr;
2472 if(dir == DIAG_DOWN_LEFT_PRED || dir == VERT_LEFT_PRED){ 2472 if(dir == DIAG_DOWN_LEFT_PRED || dir == VERT_LEFT_PRED){
2473 const int topright_avail= (h->topright_samples_available<<i)&0x8000; 2473 const int topright_avail= (h->topright_samples_available<<i)&0x8000;
2474 assert(mb_y || linesize <= block_offset[i]); 2474 assert(mb_y || linesize <= block_offset[i]);
2475 if(!topright_avail){ 2475 if(!topright_avail){
2476 tr= ptr[3 - linesize]*0x01010101; 2476 tr= ptr[3 - linesize]*0x01010101;
2477 topright= (uint8_t*) &tr; 2477 topright= (uint8_t*) &tr;
2478 }else
2479 topright= ptr + 4 - linesize;
2478 }else 2480 }else
2479 topright= ptr + 4 - linesize; 2481 topright= NULL;
2480 }else 2482
2481 topright= NULL; 2483 h->hpc.pred4x4[ dir ](ptr, topright, linesize);
2482 2484 nnz = h->non_zero_count_cache[ scan8[i] ];
2483 h->hpc.pred4x4[ dir ](ptr, topright, linesize); 2485 if(nnz){
2484 nnz = h->non_zero_count_cache[ scan8[i] ]; 2486 if(is_h264){
2485 if(nnz){ 2487 if(nnz == 1 && h->mb[i*16])
2486 if(is_h264){ 2488 idct_dc_add(ptr, h->mb + i*16, linesize);
2487 if(nnz == 1 && h->mb[i*16]) 2489 else
2488 idct_dc_add(ptr, h->mb + i*16, linesize); 2490 idct_add (ptr, h->mb + i*16, linesize);
2489 else 2491 }else
2490 idct_add(ptr, h->mb + i*16, linesize); 2492 svq3_add_idct_c(ptr, h->mb + i*16, linesize, s->qscale, 0);
2491 }else 2493 }
2492 svq3_add_idct_c(ptr, h->mb + i*16, linesize, s->qscale, 0);
2493 }
2494 } 2494 }
2495 } 2495 }
2496 } 2496 }
2497 }else{ 2497 }else{
2498 h->hpc.pred16x16[ h->intra16x16_pred_mode ](dest_y , linesize); 2498 h->hpc.pred16x16[ h->intra16x16_pred_mode ](dest_y , linesize);
2516 if(is_h264){ 2516 if(is_h264){
2517 if(IS_INTRA16x16(mb_type)){ 2517 if(IS_INTRA16x16(mb_type)){
2518 if(transform_bypass && h->sps.profile_idc==244 && (h->intra16x16_pred_mode==VERT_PRED8x8 || h->intra16x16_pred_mode==HOR_PRED8x8)){ 2518 if(transform_bypass && h->sps.profile_idc==244 && (h->intra16x16_pred_mode==VERT_PRED8x8 || h->intra16x16_pred_mode==HOR_PRED8x8)){
2519 h->hpc.pred16x16_add[h->intra16x16_pred_mode](dest_y, block_offset, h->mb, linesize); 2519 h->hpc.pred16x16_add[h->intra16x16_pred_mode](dest_y, block_offset, h->mb, linesize);
2520 }else{ 2520 }else{
2521 for(i=0; i<16; i++){ 2521 for(i=0; i<16; i++){
2522 if(h->non_zero_count_cache[ scan8[i] ]) 2522 if(h->non_zero_count_cache[ scan8[i] ])
2523 idct_add(dest_y + block_offset[i], h->mb + i*16, linesize); 2523 idct_add (dest_y + block_offset[i], h->mb + i*16, linesize);
2524 else if(h->mb[i*16]) 2524 else if(h->mb[i*16])
2525 idct_dc_add(dest_y + block_offset[i], h->mb + i*16, linesize); 2525 idct_dc_add(dest_y + block_offset[i], h->mb + i*16, linesize);
2526 } 2526 }
2527 } 2527 }
2528 }else{ 2528 }else{
2529 const int di = IS_8x8DCT(mb_type) ? 4 : 1; 2529 const int di = IS_8x8DCT(mb_type) ? 4 : 1;
2530 for(i=0; i<16; i+=di){ 2530 for(i=0; i<16; i+=di){
2531 int nnz = h->non_zero_count_cache[ scan8[i] ]; 2531 int nnz = h->non_zero_count_cache[ scan8[i] ];
2560 if(is_h264){ 2560 if(is_h264){
2561 if(transform_bypass && IS_INTRA(mb_type) && h->sps.profile_idc==244 && (h->chroma_pred_mode==VERT_PRED8x8 || h->chroma_pred_mode==HOR_PRED8x8)){ 2561 if(transform_bypass && IS_INTRA(mb_type) && h->sps.profile_idc==244 && (h->chroma_pred_mode==VERT_PRED8x8 || h->chroma_pred_mode==HOR_PRED8x8)){
2562 h->hpc.pred8x8_add[h->chroma_pred_mode](dest[0], block_offset + 16, h->mb + 16*16, uvlinesize); 2562 h->hpc.pred8x8_add[h->chroma_pred_mode](dest[0], block_offset + 16, h->mb + 16*16, uvlinesize);
2563 h->hpc.pred8x8_add[h->chroma_pred_mode](dest[1], block_offset + 20, h->mb + 20*16, uvlinesize); 2563 h->hpc.pred8x8_add[h->chroma_pred_mode](dest[1], block_offset + 20, h->mb + 20*16, uvlinesize);
2564 }else{ 2564 }else{
2565 for(i=16; i<16+8; i++){ 2565 for(i=16; i<16+8; i++){
2566 if(h->non_zero_count_cache[ scan8[i] ]) 2566 if(h->non_zero_count_cache[ scan8[i] ])
2567 idct_add(dest[(i&4)>>2] + block_offset[i], h->mb + i*16, uvlinesize); 2567 idct_add (dest[(i&4)>>2] + block_offset[i], h->mb + i*16, uvlinesize);
2568 else if(h->mb[i*16]) 2568 else if(h->mb[i*16])
2569 idct_dc_add(dest[(i&4)>>2] + block_offset[i], h->mb + i*16, uvlinesize); 2569 idct_dc_add(dest[(i&4)>>2] + block_offset[i], h->mb + i*16, uvlinesize);
2570 } 2570 }
2571 } 2571 }
2572 }else{ 2572 }else{
2573 for(i=16; i<16+8; i++){ 2573 for(i=16; i<16+8; i++){
2574 if(h->non_zero_count_cache[ scan8[i] ] || h->mb[i*16]){ 2574 if(h->non_zero_count_cache[ scan8[i] ] || h->mb[i*16]){
2575 uint8_t * const ptr= dest[(i&4)>>2] + block_offset[i]; 2575 uint8_t * const ptr= dest[(i&4)>>2] + block_offset[i];