58 for(i=0;i<tab->
n;i++) {
78 int run_diff= intra ? 0 : 1;
118 static int init_done=0;
137 for (level = 1; level <=
MAX_LEVEL; level++) {
139 for(run=0; run<=
MAX_RUN; run++){
141 for(last=0; last<2; last++){
153 int best = 0, best_size = INT_MAX;
154 int chroma_best = 0, best_chroma_size = INT_MAX;
167 for(run=0; run<=
MAX_RUN; run++){
169 const int last_size= size + chroma_size;
170 for(last=0; last<2; last++){
177 chroma_size+= intra_chroma_count*rl_length[i+3][
level][
run][last];
184 if(last_size == size+chroma_size)
break;
191 if(chroma_size<best_chroma_size){
192 best_chroma_size= chroma_size;
309 if ((
unsigned)mx >= 64 ||
341 int range, bit_size, sign, code,
bits;
349 range = 1 << bit_size;
362 code = (val >> bit_size) + 1;
363 bits = val & (range - 1);
373 int16_t
block[6][64],
374 int motion_x,
int motion_y)
376 int cbp, coded_cbp, i;
385 for (i = 0; i < 6; i++) {
405 if((cbp&3) != 3) coded_cbp= cbp ^ 0x3C;
432 for (i = 0; i < 6; i++) {
440 for (i = 0; i < 6; i++) {
443 cbp |= val << (5 - i);
450 coded_cbp |= val << (5 - i);
487 for (i = 0; i < 6; i++) {
535 extquant = (level + 3) & 0x3;
536 code = ((level+3)>>2);
537 }
else if( s->
qscale == 2 ) {
538 extquant = (level + 1) & 0x1;
539 code = ((level+1)>>1);
558 extrabits = 3 - s->
qscale;
562 else if(extrabits > 0)
576 int level,
run, last, i, j, last_index;
577 int last_non_zero, sign, slevel;
578 int code, run_diff, dc_pred_dir;
604 for(last_index=63; last_index>=0; last_index--){
605 if(block[scantable[last_index]])
break;
611 last_non_zero = i - 1;
612 for (; i <= last_index; i++) {
616 run = i - last_non_zero - 1;
617 last = (i == last_index);