comparison h264.c @ 8389:0694c0750694 libavcodec

indent
author michael
date Thu, 18 Dec 2008 18:14:38 +0000
parents 9eb29759df54
children 31f8d52753e4
comparison
equal deleted inserted replaced
8388:9eb29759df54 8389:0694c0750694
2461 idct_add = s->dsp.add_pixels4; 2461 idct_add = s->dsp.add_pixels4;
2462 }else{ 2462 }else{
2463 idct_dc_add = s->dsp.h264_idct_dc_add; 2463 idct_dc_add = s->dsp.h264_idct_dc_add;
2464 idct_add = s->dsp.h264_idct_add; 2464 idct_add = s->dsp.h264_idct_add;
2465 } 2465 }
2466 for(i=0; i<16; i++){ 2466 for(i=0; i<16; i++){
2467 uint8_t * const ptr= dest_y + block_offset[i]; 2467 uint8_t * const ptr= dest_y + block_offset[i];
2468 const int dir= h->intra4x4_pred_mode_cache[ scan8[i] ]; 2468 const int dir= h->intra4x4_pred_mode_cache[ scan8[i] ];
2469 2469
2470 if(transform_bypass && h->sps.profile_idc==244 && dir<=1){ 2470 if(transform_bypass && h->sps.profile_idc==244 && dir<=1){
2471 h->hpc.pred4x4_add[dir](ptr, h->mb + i*16, linesize); 2471 h->hpc.pred4x4_add[dir](ptr, h->mb + i*16, linesize);
2472 }else{ 2472 }else{
2473 uint8_t *topright; 2473 uint8_t *topright;
2474 int nnz, tr; 2474 int nnz, tr;
2475 if(dir == DIAG_DOWN_LEFT_PRED || dir == VERT_LEFT_PRED){ 2475 if(dir == DIAG_DOWN_LEFT_PRED || dir == VERT_LEFT_PRED){
2476 const int topright_avail= (h->topright_samples_available<<i)&0x8000; 2476 const int topright_avail= (h->topright_samples_available<<i)&0x8000;
2477 assert(mb_y || linesize <= block_offset[i]); 2477 assert(mb_y || linesize <= block_offset[i]);
2478 if(!topright_avail){ 2478 if(!topright_avail){
2479 tr= ptr[3 - linesize]*0x01010101; 2479 tr= ptr[3 - linesize]*0x01010101;
2480 topright= (uint8_t*) &tr; 2480 topright= (uint8_t*) &tr;
2481 }else
2482 topright= ptr + 4 - linesize;
2481 }else 2483 }else
2482 topright= ptr + 4 - linesize; 2484 topright= NULL;
2483 }else 2485
2484 topright= NULL; 2486 h->hpc.pred4x4[ dir ](ptr, topright, linesize);
2485 2487 nnz = h->non_zero_count_cache[ scan8[i] ];
2486 h->hpc.pred4x4[ dir ](ptr, topright, linesize); 2488 if(nnz){
2487 nnz = h->non_zero_count_cache[ scan8[i] ]; 2489 if(is_h264){
2488 if(nnz){ 2490 if(nnz == 1 && h->mb[i*16])
2489 if(is_h264){ 2491 idct_dc_add(ptr, h->mb + i*16, linesize);
2490 if(nnz == 1 && h->mb[i*16]) 2492 else
2491 idct_dc_add(ptr, h->mb + i*16, linesize); 2493 idct_add (ptr, h->mb + i*16, linesize);
2492 else 2494 }else
2493 idct_add (ptr, h->mb + i*16, linesize); 2495 svq3_add_idct_c(ptr, h->mb + i*16, linesize, s->qscale, 0);
2494 }else 2496 }
2495 svq3_add_idct_c(ptr, h->mb + i*16, linesize, s->qscale, 0);
2496 } 2497 }
2497 } 2498 }
2498 }
2499 } 2499 }
2500 } 2500 }
2501 }else{ 2501 }else{
2502 h->hpc.pred16x16[ h->intra16x16_pred_mode ](dest_y , linesize); 2502 h->hpc.pred16x16[ h->intra16x16_pred_mode ](dest_y , linesize);
2503 if(is_h264){ 2503 if(is_h264){
2574 }else{ 2574 }else{
2575 idct_add = s->dsp.h264_idct_add; 2575 idct_add = s->dsp.h264_idct_add;
2576 idct_dc_add = s->dsp.h264_idct_dc_add; 2576 idct_dc_add = s->dsp.h264_idct_dc_add;
2577 chroma_dc_dequant_idct_c(h->mb + 16*16, h->chroma_qp[0], h->dequant4_coeff[IS_INTRA(mb_type) ? 1:4][h->chroma_qp[0]][0]); 2577 chroma_dc_dequant_idct_c(h->mb + 16*16, h->chroma_qp[0], h->dequant4_coeff[IS_INTRA(mb_type) ? 1:4][h->chroma_qp[0]][0]);
2578 chroma_dc_dequant_idct_c(h->mb + 16*16+4*16, h->chroma_qp[1], h->dequant4_coeff[IS_INTRA(mb_type) ? 2:5][h->chroma_qp[1]][0]); 2578 chroma_dc_dequant_idct_c(h->mb + 16*16+4*16, h->chroma_qp[1], h->dequant4_coeff[IS_INTRA(mb_type) ? 2:5][h->chroma_qp[1]][0]);
2579 if(is_h264){ 2579 if(is_h264){
2580 for(i=16; i<16+8; i++){ 2580 for(i=16; i<16+8; i++){
2581 if(h->non_zero_count_cache[ scan8[i] ]) 2581 if(h->non_zero_count_cache[ scan8[i] ])
2582 idct_add (dest[(i&4)>>2] + block_offset[i], h->mb + i*16, uvlinesize); 2582 idct_add (dest[(i&4)>>2] + block_offset[i], h->mb + i*16, uvlinesize);
2583 else if(h->mb[i*16]) 2583 else if(h->mb[i*16])
2584 idct_dc_add(dest[(i&4)>>2] + block_offset[i], h->mb + i*16, uvlinesize); 2584 idct_dc_add(dest[(i&4)>>2] + block_offset[i], h->mb + i*16, uvlinesize);
2585 } 2585 }
2586 }else{ 2586 }else{
2587 for(i=16; i<16+8; i++){ 2587 for(i=16; i<16+8; i++){
2588 if(h->non_zero_count_cache[ scan8[i] ] || h->mb[i*16]){ 2588 if(h->non_zero_count_cache[ scan8[i] ] || h->mb[i*16]){
2589 uint8_t * const ptr= dest[(i&4)>>2] + block_offset[i]; 2589 uint8_t * const ptr= dest[(i&4)>>2] + block_offset[i];
2590 svq3_add_idct_c(ptr, h->mb + i*16, uvlinesize, chroma_qp[s->qscale + 12] - 12, 2); 2590 svq3_add_idct_c(ptr, h->mb + i*16, uvlinesize, chroma_qp[s->qscale + 12] - 12, 2);
2591 }
2591 } 2592 }
2592 }
2593 } 2593 }
2594 } 2594 }
2595 } 2595 }
2596 } 2596 }
2597 if(h->deblocking_filter) { 2597 if(h->deblocking_filter) {