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)
607 }
else if (level != 0) {
638 int n,
int coded,
const uint8_t *scan_table)
678 if (dc_pred_dir == 0)
688 qadd = (s->
qscale - 1) | 1;
757 if(sign) level= -
level;
760 #if 0 // waste of time / this will detect very few errors
762 const int abs_level=
FFABS(level);
763 const int run1= run - rl->
max_run[last][abs_level] - run_diff;
765 if(abs_level <= rl->max_level[last][run]){
767 return DECODING_AC_LOST;
769 if(abs_level <= rl->max_level[last][run]*2){
771 return DECODING_AC_LOST;
773 if(run1>=0 && abs_level <= rl->max_level[last][run1]){
775 return DECODING_AC_LOST;
781 if (level>0) level= level * qmul + qadd;
782 else level= level * qmul - qadd;
783 #if 0 // waste of time too :(
784 if(level>2048 || level<-2048){
786 return DECODING_AC_LOST;
794 else if((i>62 && i<192) || i>192+63)
801 i+= run + rl->
max_run[run>>7][level/qmul] + run_diff;
807 else if((i>62 && i<192) || i>192+63)
816 level = level + rl->
max_level[run>>7][(run-1)&63] * qmul;
822 else if((i>62 && i<192) || i>192+63)
833 else if((i>62 && i<192) || i>192+63)
851 block[scan_table[i]] =
level;
855 block[scan_table[i]] =
level;
873 int *mx_ptr,
int *my_ptr)