comparison h264_cavlc.c @ 10996:26f9c146ef2a libavcodec

a[b-1] -> (a-1)[b]. Helps gcc not to add seperate -1 instructions.
author michael
date Sun, 24 Jan 2010 18:42:22 +0000
parents 5352afcd6748
children b2e1b3baef0a
comparison
equal deleted inserted replaced
10995:5352afcd6748 10996:26f9c146ef2a
476 476
477 if(total_coeff == max_coeff) 477 if(total_coeff == max_coeff)
478 zeros_left=0; 478 zeros_left=0;
479 else{ 479 else{
480 if(n == CHROMA_DC_BLOCK_INDEX) 480 if(n == CHROMA_DC_BLOCK_INDEX)
481 zeros_left= get_vlc2(gb, chroma_dc_total_zeros_vlc[ total_coeff-1 ].table, CHROMA_DC_TOTAL_ZEROS_VLC_BITS, 1); 481 zeros_left= get_vlc2(gb, (chroma_dc_total_zeros_vlc-1)[ total_coeff ].table, CHROMA_DC_TOTAL_ZEROS_VLC_BITS, 1);
482 else 482 else
483 zeros_left= get_vlc2(gb, total_zeros_vlc[ total_coeff-1 ].table, TOTAL_ZEROS_VLC_BITS, 1); 483 zeros_left= get_vlc2(gb, (total_zeros_vlc-1)[ total_coeff ].table, TOTAL_ZEROS_VLC_BITS, 1);
484 } 484 }
485 485
486 coeff_num = zeros_left + total_coeff - 1; 486 coeff_num = zeros_left + total_coeff - 1;
487 j = scantable[coeff_num]; 487 j = scantable[coeff_num];
488 if(n > 24){ 488 if(n > 24){
489 block[j] = level[0]; 489 block[j] = level[0];
490 for(i=1;i<total_coeff;i++) { 490 for(i=1;i<total_coeff;i++) {
491 if(zeros_left <= 0) 491 if(zeros_left <= 0)
492 run_before = 0; 492 run_before = 0;
493 else if(zeros_left < 7){ 493 else if(zeros_left < 7){
494 run_before= get_vlc2(gb, run_vlc[zeros_left-1].table, RUN_VLC_BITS, 1); 494 run_before= get_vlc2(gb, (run_vlc-1)[zeros_left].table, RUN_VLC_BITS, 1);
495 }else{ 495 }else{
496 run_before= get_vlc2(gb, run7_vlc.table, RUN7_VLC_BITS, 2); 496 run_before= get_vlc2(gb, run7_vlc.table, RUN7_VLC_BITS, 2);
497 } 497 }
498 zeros_left -= run_before; 498 zeros_left -= run_before;
499 coeff_num -= 1 + run_before; 499 coeff_num -= 1 + run_before;
505 block[j] = (level[0] * qmul[j] + 32)>>6; 505 block[j] = (level[0] * qmul[j] + 32)>>6;
506 for(i=1;i<total_coeff;i++) { 506 for(i=1;i<total_coeff;i++) {
507 if(zeros_left <= 0) 507 if(zeros_left <= 0)
508 run_before = 0; 508 run_before = 0;
509 else if(zeros_left < 7){ 509 else if(zeros_left < 7){
510 run_before= get_vlc2(gb, run_vlc[zeros_left-1].table, RUN_VLC_BITS, 1); 510 run_before= get_vlc2(gb, (run_vlc-1)[zeros_left].table, RUN_VLC_BITS, 1);
511 }else{ 511 }else{
512 run_before= get_vlc2(gb, run7_vlc.table, RUN7_VLC_BITS, 2); 512 run_before= get_vlc2(gb, run7_vlc.table, RUN7_VLC_BITS, 2);
513 } 513 }
514 zeros_left -= run_before; 514 zeros_left -= run_before;
515 coeff_num -= 1 + run_before; 515 coeff_num -= 1 + run_before;