57 for(i=0;i<tab->
n;i++) {
77 int run_diff= intra ? 0 : 1;
117 static int init_done=0;
136 for (level = 1; level <=
MAX_LEVEL; level++) {
138 for(run=0; run<=
MAX_RUN; run++){
140 for(last=0; last<2; last++){
152 int best = 0, best_size = INT_MAX;
153 int chroma_best = 0, best_chroma_size = INT_MAX;
166 for(run=0; run<=
MAX_RUN; run++){
168 const int last_size= size + chroma_size;
169 for(last=0; last<2; last++){
176 chroma_size+= intra_chroma_count*rl_length[i+3][
level][
run][last];
183 if(last_size == size+chroma_size)
break;
190 if(chroma_size<best_chroma_size){
191 best_chroma_size= chroma_size;
308 if ((
unsigned)mx >= 64 ||
340 int range, bit_size, sign, code,
bits;
348 range = 1 << bit_size;
361 code = (val >> bit_size) + 1;
362 bits = val & (range - 1);
372 int16_t
block[6][64],
373 int motion_x,
int motion_y)
375 int cbp, coded_cbp, i;
384 for (i = 0; i < 6; i++) {
404 if((cbp&3) != 3) coded_cbp= cbp ^ 0x3C;
431 for (i = 0; i < 6; i++) {
439 for (i = 0; i < 6; i++) {
442 cbp |= val << (5 - i);
449 coded_cbp |= val << (5 - i);
486 for (i = 0; i < 6; i++) {
534 extquant = (level + 3) & 0x3;
535 code = ((level+3)>>2);
536 }
else if( s->
qscale == 2 ) {
537 extquant = (level + 1) & 0x1;
538 code = ((level+1)>>1);
557 extrabits = 3 - s->
qscale;
561 else if(extrabits > 0)
575 int level,
run, last, i, j, last_index;
576 int last_non_zero, sign, slevel;
577 int code, run_diff, dc_pred_dir;
603 for(last_index=63; last_index>=0; last_index--){
604 if(block[scantable[last_index]])
break;
610 last_non_zero = i - 1;
611 for (; i <= last_index; i++) {
615 run = i - last_non_zero - 1;
616 last = (i == last_index);