19 |
* along with this program ; if not, write to the Free Software |
* along with this program ; if not, write to the Free Software |
20 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
21 |
* |
* |
22 |
* $Id: mbcoding.c,v 1.51 2005-04-04 23:49:37 edgomez Exp $ |
* $Id: mbcoding.c,v 1.52.2.2 2007-06-28 15:00:11 Isibaar Exp $ |
23 |
* |
* |
24 |
****************************************************************************/ |
****************************************************************************/ |
25 |
|
|
1051 |
return (level << 20) >> 20; |
return (level << 20) >> 20; |
1052 |
|
|
1053 |
error: |
error: |
1054 |
*run = VLC_ERROR; |
*run = 64; |
1055 |
return 0; |
return 0; |
1056 |
} |
} |
1057 |
|
|
1067 |
|
|
1068 |
do { |
do { |
1069 |
level = get_coeff(bs, &run, &last, 1, 0); |
level = get_coeff(bs, &run, &last, 1, 0); |
1070 |
if (run == -1) { |
coeff += run; |
1071 |
DPRINTF(XVID_DEBUG_ERROR,"fatal: invalid run"); |
if (coeff & ~63) { |
1072 |
|
DPRINTF(XVID_DEBUG_ERROR,"fatal: invalid run or index"); |
1073 |
break; |
break; |
1074 |
} |
} |
1075 |
coeff += run; |
|
1076 |
block[scan[coeff]] = level; |
block[scan[coeff]] = level; |
1077 |
|
|
1078 |
DPRINTF(XVID_DEBUG_COEFF,"block[%i] %i\n", scan[coeff], level); |
DPRINTF(XVID_DEBUG_COEFF,"block[%i] %i\n", scan[coeff], level); |
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); |
1111 |
if (run == -1) { |
p += run; |
1112 |
DPRINTF(XVID_DEBUG_ERROR,"fatal: invalid run"); |
if (p & ~63) { |
1113 |
|
DPRINTF(XVID_DEBUG_ERROR,"fatal: invalid run or index"); |
1114 |
break; |
break; |
1115 |
} |
} |
|
p += run; |
|
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); |
1146 |
if (run == -1) { |
p += run; |
1147 |
DPRINTF(XVID_DEBUG_ERROR,"fatal: invalid run"); |
if (p & ~63) { |
1148 |
|
DPRINTF(XVID_DEBUG_ERROR,"fatal: invalid run or index"); |
1149 |
break; |
break; |
1150 |
} |
} |
|
p += run; |
|
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; |