51 #define V2_INTRA_CBPC_VLC_BITS 3
52 #define V2_MB_TYPE_VLC_BITS 7
54 #define V2_MV_VLC_BITS 9
55 #define TEX_VLC_BITS 9
57 #define DEFAULT_INTER_INDEX 3
63 int level, uni_code, uni_len;
68 for(level=-256; level<256; level++){
79 l= (-
level) ^ ((1 << size) - 1);
86 uni_code ^= (1<<uni_len)-1;
89 uni_code<<=
size; uni_code|=l;
92 uni_code<<=1; uni_code|=1;
102 uni_code ^= (1<<uni_len)-1;
105 uni_code<<=
size; uni_code|=l;
108 uni_code<<=1; uni_code|=1;
140 #if CONFIG_VC1_DECODER
213 return FASTDIV((sum + (scale>>1)), scale);
218 int16_t **dc_val_ptr,
int *dir_ptr)
237 b = dc_val[ - 1 -
wrap];
248 #if ARCH_X86 && HAVE_7REGS && HAVE_EBX_AVAILABLE
250 "movl %3, %%eax \n\t"
251 "shrl $1, %%eax \n\t"
252 "addl %%eax, %2 \n\t"
253 "addl %%eax, %1 \n\t"
254 "addl %0, %%eax \n\t"
256 "movl %%edx, %0 \n\t"
257 "movl %1, %%eax \n\t"
259 "movl %%edx, %1 \n\t"
260 "movl %2, %%eax \n\t"
262 "movl %%edx, %2 \n\t"
263 :
"+b" (
a),
"+c" (b),
"+D" (
c)
273 a = (a + (8 >> 1)) / 8;
274 b = (b + (8 >> 1)) / 8;
275 c = (c + (8 >> 1)) / 8;
277 a =
FASTDIV((a + (scale >> 1)), scale);
278 b =
FASTDIV((b + (scale >> 1)), scale);
279 c =
FASTDIV((c + (scale >> 1)), scale);
296 if (abs(a - b) < abs(b - c)) {
311 if(s->
mb_x==0) a= (1024 + (scale>>1))/
scale;
312 else a=
get_dc(dest-8, wrap, scale*8);
313 if(s->
mb_y==0) c= (1024 + (scale>>1))/
scale;
314 else c=
get_dc(dest-8*wrap, wrap, scale*8);
341 if (abs(a - b) < abs(b - c)) {
350 if (abs(a - b) <= abs(b - c)) {
360 *dc_val_ptr = &dc_val[0];
378 int code, val, sign,
shift;
381 av_dlog(s,
"MV code %d at %d %d pred: %d\n", code, s->
mb_x,s->
mb_y, pred);
391 val = (val - 1) << shift;
433 if(code<0 || code>7){
487 for (i = 0; i < 6; i++) {
536 int val = ((code >> (5 - i)) & 1);
542 cbp |= val << (5 - i);
562 ((cbp & 3) ? 1 : 0) +((cbp & 0x3C)? 2 : 0),
578 for (i = 0; i < 6; i++) {
593 static volatile int done = 0;
688 if (CONFIG_WMV2_DECODER)
706 if(start_code!=0x00000100){
724 if(!had_i)
return -1;
860 if(left>=length && left<length+8)
869 else if(left<length+8)
911 }
else if (level != 0) {
942 int n,
int coded,
const uint8_t *scan_table)
983 if (dc_pred_dir == 0)
993 qadd = (s->
qscale - 1) | 1;
1062 if(sign) level= -
level;
1065 #if 0 // waste of time / this will detect very few errors
1067 const int abs_level=
FFABS(level);
1068 const int run1= run - rl->
max_run[last][abs_level] - run_diff;
1070 if(abs_level <= rl->max_level[last][run]){
1072 return DECODING_AC_LOST;
1074 if(abs_level <= rl->max_level[last][run]*2){
1076 return DECODING_AC_LOST;
1078 if(run1>=0 && abs_level <= rl->max_level[last][run1]){
1080 return DECODING_AC_LOST;
1086 if (level>0) level= level * qmul + qadd;
1087 else level= level * qmul - qadd;
1088 #if 0 // waste of time too :(
1089 if(level>2048 || level<-2048){
1091 return DECODING_AC_LOST;
1096 #ifdef ERROR_DETAILS
1099 else if((i>62 && i<192) || i>192+63)
1106 i+= run + rl->
max_run[run>>7][level/qmul] + run_diff;
1109 #ifdef ERROR_DETAILS
1112 else if((i>62 && i<192) || i>192+63)
1121 level = level + rl->
max_level[run>>7][(run-1)&63] * qmul;
1124 #ifdef ERROR_DETAILS
1127 else if((i>62 && i<192) || i>192+63)
1135 #ifdef ERROR_DETAILS
1138 else if((i>62 && i<192) || i>192+63)
1156 block[scan_table[i]] =
level;
1160 block[scan_table[i]] =
level;
1178 int *mx_ptr,
int *my_ptr)
1190 if (code == mv->
n) {
1216 .
name =
"msmpeg4v1",
1230 .
name =
"msmpeg4v2",