55 |
* 22.12.2001 lock based interpolation |
* 22.12.2001 lock based interpolation |
56 |
* 01.12.2001 inital version; (c)2001 peter ross <pross@cs.rmit.edu.au> |
* 01.12.2001 inital version; (c)2001 peter ross <pross@cs.rmit.edu.au> |
57 |
* |
* |
58 |
* $Id: decoder.c,v 1.37.2.3 2002-10-10 12:16:00 Isibaar Exp $ |
* $Id: decoder.c,v 1.37.2.4 2002-10-11 00:44:49 Isibaar Exp $ |
59 |
* |
* |
60 |
*************************************************************************/ |
*************************************************************************/ |
61 |
|
|
749 |
rounding); |
rounding); |
750 |
} else // not coded |
} else // not coded |
751 |
{ |
{ |
|
DEBUG2("P-frame MB at (X,Y)=",x,y); |
|
752 |
mb->mode = MODE_NOT_CODED; |
mb->mode = MODE_NOT_CODED; |
753 |
mb->mvs[0].x = mb->mvs[1].x = mb->mvs[2].x = mb->mvs[3].x = 0; |
mb->mvs[0].x = mb->mvs[1].x = mb->mvs[2].x = mb->mvs[3].x = 0; |
754 |
mb->mvs[0].y = mb->mvs[1].y = mb->mvs[2].y = mb->mvs[3].y = 0; |
mb->mvs[0].y = mb->mvs[1].y = mb->mvs[2].y = mb->mvs[3].y = 0; |
963 |
stop_transfer_timer(); |
stop_transfer_timer(); |
964 |
} |
} |
965 |
|
|
|
|
|
966 |
// add by MinChen <chenm001@163.com> |
// add by MinChen <chenm001@163.com> |
967 |
// decode an B-frame direct & inter macroblock |
// decode an B-frame direct & inter macroblock |
968 |
void |
void |
1080 |
dec->refn[2].y + (16 * y_pos * stride) + 16 * x_pos + 8, |
dec->refn[2].y + (16 * y_pos * stride) + 16 * x_pos + 8, |
1081 |
stride, 0); |
stride, 0); |
1082 |
|
|
1083 |
interpolate8x8_avg2(dec->cur.y + (16 * (y_pos + 8) * stride) + 16 * x_pos, |
interpolate8x8_avg2(dec->cur.y + ((16 * y_pos + 8) * stride) + 16 * x_pos, |
1084 |
dec->cur.y + (16 * (y_pos + 8) * stride) + 16 * x_pos, |
dec->cur.y + ((16 * y_pos + 8) * stride) + 16 * x_pos, |
1085 |
dec->refn[2].y + (16 * (y_pos + 8) * stride) + 16 * x_pos, |
dec->refn[2].y + ((16 * y_pos + 8) * stride) + 16 * x_pos, |
1086 |
stride, 0); |
stride, 0); |
1087 |
|
|
1088 |
interpolate8x8_avg2(dec->cur.y + (16 * (y_pos + 8) * stride) + 16 * x_pos + 8, |
interpolate8x8_avg2(dec->cur.y + ((16 * y_pos + 8) * stride) + 16 * x_pos + 8, |
1089 |
dec->cur.y + (16 * (y_pos + 8) * stride) + 16 * x_pos + 8, |
dec->cur.y + ((16 * y_pos + 8) * stride) + 16 * x_pos + 8, |
1090 |
dec->refn[2].y + (16 * (y_pos + 8) * stride) + 16 * x_pos + 8, |
dec->refn[2].y + ((16 * y_pos + 8) * stride) + 16 * x_pos + 8, |
1091 |
stride, 0); |
stride, 0); |
1092 |
|
|
1093 |
interpolate8x8_avg2(dec->cur.u + (8 * y_pos * stride) + 8 * x_pos, |
interpolate8x8_avg2(dec->cur.u + (8 * y_pos * stride2) + 8 * x_pos, |
1094 |
dec->cur.u + (8 * y_pos * stride) + 8 * x_pos, |
dec->cur.u + (8 * y_pos * stride2) + 8 * x_pos, |
1095 |
dec->refn[2].u + (8 * y_pos * stride) + 8 * x_pos, |
dec->refn[2].u + (8 * y_pos * stride2) + 8 * x_pos, |
1096 |
stride2, 0); |
stride2, 0); |
1097 |
|
|
1098 |
interpolate8x8_avg2(dec->cur.v + (8 * y_pos * stride) + 8 * x_pos, |
interpolate8x8_avg2(dec->cur.v + (8 * y_pos * stride2) + 8 * x_pos, |
1099 |
dec->cur.v + (8 * y_pos * stride) + 8 * x_pos, |
dec->cur.v + (8 * y_pos * stride2) + 8 * x_pos, |
1100 |
dec->refn[2].v + (8 * y_pos * stride) + 8 * x_pos, |
dec->refn[2].v + (8 * y_pos * stride2) + 8 * x_pos, |
1101 |
stride2, 0); |
stride2, 0); |
1102 |
|
|
1103 |
stop_comp_timer(); |
stop_comp_timer(); |
1385 |
|
|
1386 |
BitstreamInit(&bs, frame->bitstream, frame->length); |
BitstreamInit(&bs, frame->bitstream, frame->length); |
1387 |
|
|
1388 |
|
if(BitstreamShowBits(&bs, 8) == 0x7f) { |
1389 |
|
BitstreamGetBits(&bs, 8); |
1390 |
|
return XVID_ERR_FAIL; |
1391 |
|
} |
1392 |
|
|
1393 |
// add by chenm001 <chenm001@163.com> |
// add by chenm001 <chenm001@163.com> |
1394 |
// for support B-frame to reference last 2 frame |
// for support B-frame to reference last 2 frame |
1395 |
dec->frames++; |
dec->frames++; |
1431 |
case N_VOP: // vop not coded |
case N_VOP: // vop not coded |
1432 |
// when low_delay==0, N_VOP's should interpolate between the past and future frames |
// when low_delay==0, N_VOP's should interpolate between the past and future frames |
1433 |
image_copy(&dec->cur, &dec->refn[0], dec->edged_width, dec->height); |
image_copy(&dec->cur, &dec->refn[0], dec->edged_width, dec->height); |
1434 |
|
#ifdef BFRAMES_DEC |
1435 |
|
DEBUG1("N_VOP Time=", dec->time); |
1436 |
|
#endif |
1437 |
break; |
break; |
1438 |
|
|
1439 |
default: |
default: |