| 1067 |
|
|
| 1068 |
do { |
do { |
| 1069 |
level = get_coeff(bs, &run, &last, 1, 0); |
level = get_coeff(bs, &run, &last, 1, 0); |
|
if (run == -1) { |
|
|
DPRINTF(XVID_DEBUG_ERROR,"fatal: invalid run"); |
|
|
break; |
|
|
} |
|
| 1070 |
coeff += run; |
coeff += run; |
| 1071 |
|
if ((run|coeff)&~63) { |
| 1072 |
#ifdef _DEBUG |
DPRINTF(XVID_DEBUG_ERROR,"fatal: invalid run or index"); |
| 1073 |
if(coeff>=64) { |
break; |
|
DPRINTF(XVID_DEBUG_ERROR,"error: overflow in coefficient index\n"); |
|
|
return; |
|
| 1074 |
} |
} |
|
#endif |
|
| 1075 |
|
|
| 1076 |
block[scan[coeff]] = level; |
block[scan[coeff]] = level; |
| 1077 |
|
|
| 1108 |
p = 0; |
p = 0; |
| 1109 |
do { |
do { |
| 1110 |
level = get_coeff(bs, &run, &last, 0, 0); |
level = get_coeff(bs, &run, &last, 0, 0); |
|
if (run == -1) { |
|
|
DPRINTF(XVID_DEBUG_ERROR,"fatal: invalid run"); |
|
|
break; |
|
|
} |
|
| 1111 |
p += run; |
p += run; |
| 1112 |
|
if ((run|p)&~63) { |
| 1113 |
#ifdef _DEBUG |
DPRINTF(XVID_DEBUG_ERROR,"fatal: invalid run or index"); |
| 1114 |
if(p>=64) { |
break; |
|
DPRINTF(XVID_DEBUG_ERROR,"error: overflow in coefficient index\n"); |
|
|
return; |
|
| 1115 |
} |
} |
|
#endif |
|
| 1116 |
|
|
| 1117 |
if (level < 0) { |
if (level < 0) { |
| 1118 |
level = level*quant_m_2 - quant_add; |
level = level*quant_m_2 - quant_add; |
| 1143 |
p = 0; |
p = 0; |
| 1144 |
do { |
do { |
| 1145 |
level = get_coeff(bs, &run, &last, 0, 0); |
level = get_coeff(bs, &run, &last, 0, 0); |
|
if (run == -1) { |
|
|
DPRINTF(XVID_DEBUG_ERROR,"fatal: invalid run"); |
|
|
break; |
|
|
} |
|
| 1146 |
p += run; |
p += run; |
| 1147 |
|
if ((run|p)&~63) { |
| 1148 |
#ifdef _DEBUG |
DPRINTF(XVID_DEBUG_ERROR,"fatal: invalid run or index"); |
| 1149 |
if(p>=64) { |
break; |
|
DPRINTF(XVID_DEBUG_ERROR,"error: overflow in coefficient index\n"); |
|
|
return; |
|
| 1150 |
} |
} |
|
#endif |
|
| 1151 |
|
|
| 1152 |
if (level < 0) { |
if (level < 0) { |
| 1153 |
level = ((2 * -level + 1) * matrix[scan[p]] * quant) >> 4; |
level = ((2 * -level + 1) * matrix[scan[p]] * quant) >> 4; |