60 for(i=0;i<tab->
n;i++) {
82 int run_diff= intra ? 0 : 1;
122 static int init_done=0;
143 for (level = 1; level <=
MAX_LEVEL; level++) {
145 for(run=0; run<=
MAX_RUN; run++){
147 for(last=0; last<2; last++){
161 int best = 0, best_size = INT_MAX;
162 int chroma_best = 0, best_chroma_size = INT_MAX;
175 for(run=0; run<=
MAX_RUN; run++){
177 const int last_size= size + chroma_size;
178 for(last=0; last<2; last++){
185 chroma_size+= intra_chroma_count*rl_length[i+3][
level][
run][last];
192 if(last_size == size+chroma_size)
break;
199 if(chroma_size<best_chroma_size){
200 best_chroma_size= chroma_size;
317 if ((
unsigned)mx >= 64 ||
349 int range, bit_size, sign, code,
bits;
357 range = 1 << bit_size;
370 code = (val >> bit_size) + 1;
371 bits = val & (range - 1);
381 int16_t
block[6][64],
382 int motion_x,
int motion_y)
384 int cbp, coded_cbp, i;
393 for (i = 0; i < 6; i++) {
413 if((cbp&3) != 3) coded_cbp= cbp ^ 0x3C;
440 for (i = 0; i < 6; i++) {
448 for (i = 0; i < 6; i++) {
451 cbp |= val << (5 - i);
458 coded_cbp |= val << (5 - i);
495 for (i = 0; i < 6; i++) {
543 extquant = (level + 3) & 0x3;
544 code = ((level+3)>>2);
545 }
else if( s->
qscale == 2 ) {
546 extquant = (level + 1) & 0x1;
547 code = ((level+1)>>1);
566 extrabits = 3 - s->
qscale;
570 else if(extrabits > 0)
584 int level,
run, last, i, j, last_index;
585 int last_non_zero, sign, slevel;
586 int code, run_diff, dc_pred_dir;
612 for(last_index=63; last_index>=0; last_index--){
613 if(block[scantable[last_index]])
break;
619 last_non_zero = i - 1;
620 for (; i <= last_index; i++) {
624 run = i - last_non_zero - 1;
625 last = (i == last_index);