37 #define V2_INTRA_CBPC_VLC_BITS 3
38 #define V2_MB_TYPE_VLC_BITS 7
40 #define V2_MV_VLC_BITS 9
41 #define TEX_VLC_BITS 9
43 #define DEFAULT_INTER_INDEX 3
77 av_dlog(s,
"MV code %d at %d %d pred: %d\n", code, s->
mb_x,s->
mb_y, pred);
87 val = (val - 1) << shift;
129 if(code<0 || code>7){
183 for (i = 0; i < 6; i++) {
232 int val = ((code >> (5 - i)) & 1);
238 cbp |= val << (5 - i);
258 ((cbp & 3) ? 1 : 0) +((cbp & 0x3C)? 2 : 0),
274 for (i = 0; i < 6; i++) {
289 static volatile int done = 0;
384 if (CONFIG_WMV2_DECODER)
402 if(start_code!=0x00000100){
420 if(!had_i)
return -1;
556 if(left>=length && left<length+8)
565 else if(left<length+8)
611 }
else if (level != 0) {
642 int n,
int coded,
const uint8_t *scan_table)
682 if (dc_pred_dir == 0)
692 qadd = (s->
qscale - 1) | 1;
761 if(sign) level= -
level;
764 #if 0 // waste of time / this will detect very few errors
766 const int abs_level=
FFABS(level);
767 const int run1= run - rl->
max_run[last][abs_level] - run_diff;
769 if(abs_level <= rl->max_level[last][run]){
771 return DECODING_AC_LOST;
773 if(abs_level <= rl->max_level[last][run]*2){
775 return DECODING_AC_LOST;
777 if(run1>=0 && abs_level <= rl->max_level[last][run1]){
779 return DECODING_AC_LOST;
785 if (level>0) level= level * qmul + qadd;
786 else level= level * qmul - qadd;
787 #if 0 // waste of time too :(
788 if(level>2048 || level<-2048){
790 return DECODING_AC_LOST;
798 else if((i>62 && i<192) || i>192+63)
805 i+= run + rl->
max_run[run>>7][level/qmul] + run_diff;
811 else if((i>62 && i<192) || i>192+63)
820 level = level + rl->
max_level[run>>7][(run-1)&63] * qmul;
826 else if((i>62 && i<192) || i>192+63)
837 else if((i>62 && i<192) || i>192+63)
855 block[scan_table[i]] =
level;
859 block[scan_table[i]] =
level;
877 int *mx_ptr,
int *my_ptr)