47 |
* 22.12.2001 lock based interpolation |
* 22.12.2001 lock based interpolation |
48 |
* 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> |
49 |
* |
* |
50 |
* $Id: decoder.c,v 1.17 2002-05-09 00:15:51 chenm001 Exp $ |
* $Id: decoder.c,v 1.18 2002-05-20 17:12:53 Isibaar Exp $ |
51 |
* |
* |
52 |
*************************************************************************/ |
*************************************************************************/ |
53 |
|
|
1145 |
vop_type=BitstreamReadHeaders(&bs, dec, &rounding, &quant, &fcode_forward, &fcode_backward, &intra_dc_threshold); |
vop_type=BitstreamReadHeaders(&bs, dec, &rounding, &quant, &fcode_forward, &fcode_backward, &intra_dc_threshold); |
1146 |
|
|
1147 |
dec->p_bmv.x=dec->p_bmv.y=dec->p_fmv.y=dec->p_fmv.y=0; // init pred vector to 0 |
dec->p_bmv.x=dec->p_bmv.y=dec->p_fmv.y=dec->p_fmv.y=0; // init pred vector to 0 |
1148 |
|
|
1149 |
switch (vop_type) |
switch (vop_type) |
1150 |
{ |
{ |
1151 |
case P_VOP : |
case P_VOP : |
1159 |
break; |
break; |
1160 |
|
|
1161 |
case B_VOP : |
case B_VOP : |
1162 |
|
#ifdef BFRAMES |
1163 |
if (dec->time_pp > dec->time_bp){ |
if (dec->time_pp > dec->time_bp){ |
1164 |
DEBUG1("B_VOP Time=",dec->time); |
DEBUG1("B_VOP Time=",dec->time); |
1165 |
decoder_bframe(dec, &bs, quant, fcode_forward, fcode_backward); |
decoder_bframe(dec, &bs, quant, fcode_forward, fcode_backward); |
1166 |
} else { |
} else { |
1167 |
DEBUG("broken B-frame!"); |
DEBUG("broken B-frame!"); |
1168 |
} |
} |
1169 |
|
#endif |
1170 |
break; |
break; |
1171 |
|
|
1172 |
case N_VOP : // vop not coded |
case N_VOP : // vop not coded |
1178 |
|
|
1179 |
frame->length = BitstreamPos(&bs) / 8; |
frame->length = BitstreamPos(&bs) / 8; |
1180 |
|
|
1181 |
|
#ifdef BFRAMES |
1182 |
// test if no B_VOP |
// test if no B_VOP |
1183 |
if (dec->low_delay){ |
if (dec->low_delay){ |
1184 |
|
#endif |
1185 |
image_output(&dec->cur, dec->width, dec->height, dec->edged_width, |
image_output(&dec->cur, dec->width, dec->height, dec->edged_width, |
1186 |
frame->image, frame->stride, frame->colorspace); |
frame->image, frame->stride, frame->colorspace); |
1187 |
|
#ifdef BFRAMES |
1188 |
} else { |
} else { |
1189 |
if (dec->frames >= 1){ |
if (dec->frames >= 1){ |
1190 |
start_timer(); |
start_timer(); |
1199 |
stop_conv_timer(); |
stop_conv_timer(); |
1200 |
} |
} |
1201 |
} |
} |
1202 |
|
#endif |
1203 |
|
|
1204 |
if (vop_type==I_VOP || vop_type==P_VOP){ |
if (vop_type==I_VOP || vop_type==P_VOP){ |
1205 |
image_swap(&dec->refn[0], &dec->refn[1]); |
image_swap(&dec->refn[0], &dec->refn[1]); |
1206 |
image_swap(&dec->cur, &dec->refn[0]); |
image_swap(&dec->cur, &dec->refn[0]); |