68 |
|
|
69 |
#include "xvid.h" |
#include "xvid.h" |
70 |
#include "portab.h" |
#include "portab.h" |
71 |
|
#include "global.h" |
72 |
|
|
73 |
#include "decoder.h" |
#include "decoder.h" |
74 |
#include "bitstream/bitstream.h" |
#include "bitstream/bitstream.h" |
81 |
#include "utils/mem_transfer.h" |
#include "utils/mem_transfer.h" |
82 |
#include "image/interpolate8x8.h" |
#include "image/interpolate8x8.h" |
83 |
#include "image/reduced.h" |
#include "image/reduced.h" |
84 |
|
#include "image/font.h" |
85 |
|
|
86 |
#include "bitstream/mbcoding.h" |
#include "bitstream/mbcoding.h" |
87 |
#include "prediction/mbprediction.h" |
#include "prediction/mbprediction.h" |
98 |
{ |
{ |
99 |
/* free existing */ |
/* free existing */ |
100 |
|
|
101 |
|
image_destroy(&dec->cur, dec->edged_width, dec->edged_height); |
102 |
image_destroy(&dec->refn[0], dec->edged_width, dec->edged_height); |
image_destroy(&dec->refn[0], dec->edged_width, dec->edged_height); |
103 |
image_destroy(&dec->refn[1], dec->edged_width, dec->edged_height); |
image_destroy(&dec->refn[1], dec->edged_width, dec->edged_height); |
104 |
image_destroy(&dec->refn[2], dec->edged_width, dec->edged_height); |
image_destroy(&dec->tmp, dec->edged_width, dec->edged_height); |
105 |
image_destroy(&dec->refh, dec->edged_width, dec->edged_height); |
image_destroy(&dec->qtmp, dec->edged_width, dec->edged_height); |
|
image_destroy(&dec->cur, dec->edged_width, dec->edged_height); |
|
106 |
|
|
107 |
if (dec->last_mbs) |
if (dec->last_mbs) |
108 |
xvid_free(dec->last_mbs); |
xvid_free(dec->last_mbs); |
136 |
xvid_free(dec); |
xvid_free(dec); |
137 |
return XVID_ERR_MEMORY; |
return XVID_ERR_MEMORY; |
138 |
} |
} |
139 |
if (image_create(&dec->refn[2], dec->edged_width, dec->edged_height)) { |
if (image_create(&dec->tmp, dec->edged_width, dec->edged_height)) { |
140 |
image_destroy(&dec->cur, dec->edged_width, dec->edged_height); |
image_destroy(&dec->cur, dec->edged_width, dec->edged_height); |
141 |
image_destroy(&dec->refn[0], dec->edged_width, dec->edged_height); |
image_destroy(&dec->refn[0], dec->edged_width, dec->edged_height); |
142 |
image_destroy(&dec->refn[1], dec->edged_width, dec->edged_height); |
image_destroy(&dec->refn[1], dec->edged_width, dec->edged_height); |
144 |
return XVID_ERR_MEMORY; |
return XVID_ERR_MEMORY; |
145 |
} |
} |
146 |
|
|
147 |
if (image_create(&dec->refh, dec->edged_width, dec->edged_height)) { |
if (image_create(&dec->qtmp, dec->edged_width, dec->edged_height)) { |
148 |
image_destroy(&dec->cur, dec->edged_width, dec->edged_height); |
image_destroy(&dec->cur, dec->edged_width, dec->edged_height); |
149 |
image_destroy(&dec->refn[0], dec->edged_width, dec->edged_height); |
image_destroy(&dec->refn[0], dec->edged_width, dec->edged_height); |
150 |
image_destroy(&dec->refn[1], dec->edged_width, dec->edged_height); |
image_destroy(&dec->refn[1], dec->edged_width, dec->edged_height); |
151 |
image_destroy(&dec->refn[2], dec->edged_width, dec->edged_height); |
image_destroy(&dec->tmp, dec->edged_width, dec->edged_height); |
152 |
xvid_free(dec); |
xvid_free(dec); |
153 |
return XVID_ERR_MEMORY; |
return XVID_ERR_MEMORY; |
154 |
} |
} |
160 |
image_destroy(&dec->cur, dec->edged_width, dec->edged_height); |
image_destroy(&dec->cur, dec->edged_width, dec->edged_height); |
161 |
image_destroy(&dec->refn[0], dec->edged_width, dec->edged_height); |
image_destroy(&dec->refn[0], dec->edged_width, dec->edged_height); |
162 |
image_destroy(&dec->refn[1], dec->edged_width, dec->edged_height); |
image_destroy(&dec->refn[1], dec->edged_width, dec->edged_height); |
163 |
image_destroy(&dec->refn[2], dec->edged_width, dec->edged_height); |
image_destroy(&dec->tmp, dec->edged_width, dec->edged_height); |
164 |
image_destroy(&dec->refh, dec->edged_width, dec->edged_height); |
image_destroy(&dec->qtmp, dec->edged_width, dec->edged_height); |
165 |
xvid_free(dec); |
xvid_free(dec); |
166 |
return XVID_ERR_MEMORY; |
return XVID_ERR_MEMORY; |
167 |
} |
} |
177 |
image_destroy(&dec->cur, dec->edged_width, dec->edged_height); |
image_destroy(&dec->cur, dec->edged_width, dec->edged_height); |
178 |
image_destroy(&dec->refn[0], dec->edged_width, dec->edged_height); |
image_destroy(&dec->refn[0], dec->edged_width, dec->edged_height); |
179 |
image_destroy(&dec->refn[1], dec->edged_width, dec->edged_height); |
image_destroy(&dec->refn[1], dec->edged_width, dec->edged_height); |
180 |
image_destroy(&dec->refn[2], dec->edged_width, dec->edged_height); |
image_destroy(&dec->tmp, dec->edged_width, dec->edged_height); |
181 |
image_destroy(&dec->refh, dec->edged_width, dec->edged_height); |
image_destroy(&dec->qtmp, dec->edged_width, dec->edged_height); |
182 |
xvid_free(dec); |
xvid_free(dec); |
183 |
return XVID_ERR_MEMORY; |
return XVID_ERR_MEMORY; |
184 |
} |
} |
208 |
image_null(&dec->cur); |
image_null(&dec->cur); |
209 |
image_null(&dec->refn[0]); |
image_null(&dec->refn[0]); |
210 |
image_null(&dec->refn[1]); |
image_null(&dec->refn[1]); |
211 |
image_null(&dec->refn[2]); |
image_null(&dec->tmp); |
212 |
image_null(&dec->refh); |
image_null(&dec->qtmp); |
213 |
|
|
214 |
dec->mbs = NULL; |
dec->mbs = NULL; |
215 |
dec->last_mbs = NULL; |
dec->last_mbs = NULL; |
218 |
|
|
219 |
// add by chenm001 <chenm001@163.com> |
// add by chenm001 <chenm001@163.com> |
220 |
// for support B-frame to save reference frame's time |
// for support B-frame to save reference frame's time |
221 |
dec->frames = -1; |
dec->frames = 0; |
222 |
dec->time = dec->time_base = dec->last_time_base = 0; |
dec->time = dec->time_base = dec->last_time_base = 0; |
223 |
dec->low_delay = 0; |
dec->low_delay = 0; |
224 |
dec->packed_mode = 0; |
dec->packed_mode = 0; |
239 |
xvid_free(dec->mbs); |
xvid_free(dec->mbs); |
240 |
image_destroy(&dec->refn[0], dec->edged_width, dec->edged_height); |
image_destroy(&dec->refn[0], dec->edged_width, dec->edged_height); |
241 |
image_destroy(&dec->refn[1], dec->edged_width, dec->edged_height); |
image_destroy(&dec->refn[1], dec->edged_width, dec->edged_height); |
242 |
image_destroy(&dec->refn[2], dec->edged_width, dec->edged_height); |
image_destroy(&dec->tmp, dec->edged_width, dec->edged_height); |
243 |
image_destroy(&dec->refh, dec->edged_width, dec->edged_height); |
image_destroy(&dec->qtmp, dec->edged_width, dec->edged_height); |
244 |
image_destroy(&dec->cur, dec->edged_width, dec->edged_height); |
image_destroy(&dec->cur, dec->edged_width, dec->edged_height); |
245 |
xvid_free(dec); |
xvid_free(dec); |
246 |
|
|
385 |
|
|
386 |
|
|
387 |
|
|
|
|
|
|
#define SIGN(X) (((X)>0)?1:-1) |
|
|
#define ABS(X) (((X)>0)?(X):-(X)) |
|
|
|
|
388 |
// decode an inter macroblock |
// decode an inter macroblock |
389 |
|
|
390 |
void |
void |
456 |
else |
else |
457 |
{ |
{ |
458 |
if(dec->quarterpel) { |
if(dec->quarterpel) { |
459 |
interpolate16x16_quarterpel(dec->cur.y, dec->refn[0].y, dec->refh.y, dec->refh.y + 64, |
interpolate16x16_quarterpel(dec->cur.y, dec->refn[0].y, dec->qtmp.y, dec->qtmp.y + 64, |
460 |
dec->refh.y + 128, 16*x_pos, 16*y_pos, |
dec->qtmp.y + 128, 16*x_pos, 16*y_pos, |
461 |
mv[0].x, mv[0].y, stride, rounding); |
mv[0].x, mv[0].y, stride, rounding); |
462 |
} |
} |
463 |
else { |
else { |
510 |
else |
else |
511 |
{ |
{ |
512 |
if(dec->quarterpel) { |
if(dec->quarterpel) { |
513 |
interpolate8x8_quarterpel(dec->cur.y, dec->refn[0].y, dec->refh.y, dec->refh.y + 64, |
interpolate8x8_quarterpel(dec->cur.y, dec->refn[0].y, dec->qtmp.y, dec->qtmp.y + 64, |
514 |
dec->refh.y + 128, 16*x_pos, 16*y_pos, |
dec->qtmp.y + 128, 16*x_pos, 16*y_pos, |
515 |
mv[0].x, mv[0].y, stride, rounding); |
mv[0].x, mv[0].y, stride, rounding); |
516 |
interpolate8x8_quarterpel(dec->cur.y, dec->refn[0].y, dec->refh.y, dec->refh.y + 64, |
interpolate8x8_quarterpel(dec->cur.y, dec->refn[0].y, dec->qtmp.y, dec->qtmp.y + 64, |
517 |
dec->refh.y + 128, 16*x_pos + 8, 16*y_pos, |
dec->qtmp.y + 128, 16*x_pos + 8, 16*y_pos, |
518 |
mv[1].x, mv[1].y, stride, rounding); |
mv[1].x, mv[1].y, stride, rounding); |
519 |
interpolate8x8_quarterpel(dec->cur.y, dec->refn[0].y, dec->refh.y, dec->refh.y + 64, |
interpolate8x8_quarterpel(dec->cur.y, dec->refn[0].y, dec->qtmp.y, dec->qtmp.y + 64, |
520 |
dec->refh.y + 128, 16*x_pos, 16*y_pos + 8, |
dec->qtmp.y + 128, 16*x_pos, 16*y_pos + 8, |
521 |
mv[2].x, mv[2].y, stride, rounding); |
mv[2].x, mv[2].y, stride, rounding); |
522 |
interpolate8x8_quarterpel(dec->cur.y, dec->refn[0].y, dec->refh.y, dec->refh.y + 64, |
interpolate8x8_quarterpel(dec->cur.y, dec->refn[0].y, dec->qtmp.y, dec->qtmp.y + 64, |
523 |
dec->refh.y + 128, 16*x_pos + 8, 16*y_pos + 8, |
dec->qtmp.y + 128, 16*x_pos + 8, 16*y_pos + 8, |
524 |
mv[3].x, mv[3].y, stride, rounding); |
mv[3].x, mv[3].y, stride, rounding); |
525 |
} |
} |
526 |
else { |
else { |
616 |
{ |
{ |
617 |
uint32_t bound; |
uint32_t bound; |
618 |
uint32_t x, y; |
uint32_t x, y; |
619 |
int mb_width = dec->mb_width; |
uint32_t mb_width = dec->mb_width; |
620 |
int mb_height = dec->mb_height; |
uint32_t mb_height = dec->mb_height; |
621 |
|
|
622 |
if (reduced_resolution) |
if (reduced_resolution) |
623 |
{ |
{ |
675 |
|
|
676 |
if (dec->interlacing) { |
if (dec->interlacing) { |
677 |
mb->field_dct = BitstreamGetBit(bs); |
mb->field_dct = BitstreamGetBit(bs); |
678 |
DEBUG1("deci: field_dct: ", mb->field_dct); |
DPRINTF(DPRINTF_MB,"deci: field_dct: %i", mb->field_dct); |
679 |
} |
} |
680 |
|
|
681 |
decoder_mbintra(dec, mb, x, y, acpred_flag, cbp, bs, quant, |
decoder_mbintra(dec, mb, x, y, acpred_flag, cbp, bs, quant, |
765 |
uint32_t x, y; |
uint32_t x, y; |
766 |
uint32_t bound; |
uint32_t bound; |
767 |
int cp_mb, st_mb; |
int cp_mb, st_mb; |
768 |
int mb_width = dec->mb_width; |
uint32_t mb_width = dec->mb_width; |
769 |
int mb_height = dec->mb_height; |
uint32_t mb_height = dec->mb_height; |
770 |
|
|
771 |
if (reduced_resolution) |
if (reduced_resolution) |
772 |
{ |
{ |
853 |
if (dec->interlacing) { |
if (dec->interlacing) { |
854 |
if (cbp || intra) { |
if (cbp || intra) { |
855 |
mb->field_dct = BitstreamGetBit(bs); |
mb->field_dct = BitstreamGetBit(bs); |
856 |
DEBUG1("decp: field_dct: ", mb->field_dct); |
DPRINTF(DPRINTF_MB,"decp: field_dct: %i", mb->field_dct); |
857 |
} |
} |
858 |
|
|
859 |
if (mb->mode == MODE_INTER || mb->mode == MODE_INTER_Q) { |
if (mb->mode == MODE_INTER || mb->mode == MODE_INTER_Q) { |
860 |
mb->field_pred = BitstreamGetBit(bs); |
mb->field_pred = BitstreamGetBit(bs); |
861 |
DEBUG1("decp: field_pred: ", mb->field_pred); |
DPRINTF(DPRINTF_MB, "decp: field_pred: %i", mb->field_pred); |
862 |
|
|
863 |
if (mb->field_pred) { |
if (mb->field_pred) { |
864 |
mb->field_for_top = BitstreamGetBit(bs); |
mb->field_for_top = BitstreamGetBit(bs); |
865 |
DEBUG1("decp: field_for_top: ", mb->field_for_top); |
DPRINTF(DPRINTF_MB,"decp: field_for_top: %i", mb->field_for_top); |
866 |
mb->field_for_bot = BitstreamGetBit(bs); |
mb->field_for_bot = BitstreamGetBit(bs); |
867 |
DEBUG1("decp: field_for_bot: ", mb->field_for_bot); |
DPRINTF(DPRINTF_MB,"decp: field_for_bot: %i", mb->field_for_bot); |
868 |
} |
} |
869 |
} |
} |
870 |
} |
} |
912 |
} |
} |
913 |
else if (gmc_mv) /* not coded S_VOP macroblock */ |
else if (gmc_mv) /* not coded S_VOP macroblock */ |
914 |
{ |
{ |
915 |
mb->mode = MODE_NOT_CODED; |
mb->mode = MODE_NOT_CODED_GMC; |
916 |
mb->mvs[0].x = mb->mvs[1].x = mb->mvs[2].x = mb->mvs[3].x = gmc_sanitize(gmc_mv[0].x, dec->quarterpel, fcode); |
mb->mvs[0].x = mb->mvs[1].x = mb->mvs[2].x = mb->mvs[3].x = gmc_sanitize(gmc_mv[0].x, dec->quarterpel, fcode); |
917 |
mb->mvs[0].y = mb->mvs[1].y = mb->mvs[2].y = mb->mvs[3].y = gmc_sanitize(gmc_mv[0].y, dec->quarterpel, fcode); |
mb->mvs[0].y = mb->mvs[1].y = mb->mvs[2].y = mb->mvs[3].y = gmc_sanitize(gmc_mv[0].y, dec->quarterpel, fcode); |
918 |
decoder_mbinter(dec, mb, x, y, 0, 0, bs, quant, rounding, reduced_resolution); |
decoder_mbinter(dec, mb, x, y, 0, 0, bs, quant, rounding, reduced_resolution); |
1077 |
|
|
1078 |
start_timer(); |
start_timer(); |
1079 |
if(dec->quarterpel) { |
if(dec->quarterpel) { |
1080 |
interpolate16x16_quarterpel(dec->cur.y, dec->refn[ref].y, dec->refh.y, dec->refh.y + 64, |
interpolate16x16_quarterpel(dec->cur.y, dec->refn[ref].y, dec->qtmp.y, dec->qtmp.y + 64, |
1081 |
dec->refh.y + 128, 16*x_pos, 16*y_pos, |
dec->qtmp.y + 128, 16*x_pos, 16*y_pos, |
1082 |
pMB->mvs[0].x, pMB->mvs[0].y, stride, 0); |
pMB->mvs[0].x, pMB->mvs[0].y, stride, 0); |
1083 |
} |
} |
1084 |
else { |
else { |
1232 |
start_timer(); |
start_timer(); |
1233 |
if(dec->quarterpel) { |
if(dec->quarterpel) { |
1234 |
if((pMB->mode == MODE_INTER || pMB->mode == MODE_INTER_Q)) |
if((pMB->mode == MODE_INTER || pMB->mode == MODE_INTER_Q)) |
1235 |
interpolate16x16_quarterpel(dec->cur.y, forward.y, dec->refh.y, dec->refh.y + 64, |
interpolate16x16_quarterpel(dec->cur.y, forward.y, dec->qtmp.y, dec->qtmp.y + 64, |
1236 |
dec->refh.y + 128, 16*x_pos, 16*y_pos, |
dec->qtmp.y + 128, 16*x_pos, 16*y_pos, |
1237 |
pMB->mvs[0].x, pMB->mvs[0].y, stride, 0); |
pMB->mvs[0].x, pMB->mvs[0].y, stride, 0); |
1238 |
else { |
else { |
1239 |
interpolate8x8_quarterpel(dec->cur.y, forward.y, dec->refh.y, dec->refh.y + 64, |
interpolate8x8_quarterpel(dec->cur.y, forward.y, dec->qtmp.y, dec->qtmp.y + 64, |
1240 |
dec->refh.y + 128, 16*x_pos, 16*y_pos, |
dec->qtmp.y + 128, 16*x_pos, 16*y_pos, |
1241 |
pMB->mvs[0].x, pMB->mvs[0].y, stride, 0); |
pMB->mvs[0].x, pMB->mvs[0].y, stride, 0); |
1242 |
interpolate8x8_quarterpel(dec->cur.y, forward.y, dec->refh.y, dec->refh.y + 64, |
interpolate8x8_quarterpel(dec->cur.y, forward.y, dec->qtmp.y, dec->qtmp.y + 64, |
1243 |
dec->refh.y + 128, 16*x_pos + 8, 16*y_pos, |
dec->qtmp.y + 128, 16*x_pos + 8, 16*y_pos, |
1244 |
pMB->mvs[1].x, pMB->mvs[1].y, stride, 0); |
pMB->mvs[1].x, pMB->mvs[1].y, stride, 0); |
1245 |
interpolate8x8_quarterpel(dec->cur.y, forward.y, dec->refh.y, dec->refh.y + 64, |
interpolate8x8_quarterpel(dec->cur.y, forward.y, dec->qtmp.y, dec->qtmp.y + 64, |
1246 |
dec->refh.y + 128, 16*x_pos, 16*y_pos + 8, |
dec->qtmp.y + 128, 16*x_pos, 16*y_pos + 8, |
1247 |
pMB->mvs[2].x, pMB->mvs[2].y, stride, 0); |
pMB->mvs[2].x, pMB->mvs[2].y, stride, 0); |
1248 |
interpolate8x8_quarterpel(dec->cur.y, forward.y, dec->refh.y, dec->refh.y + 64, |
interpolate8x8_quarterpel(dec->cur.y, forward.y, dec->qtmp.y, dec->qtmp.y + 64, |
1249 |
dec->refh.y + 128, 16*x_pos + 8, 16*y_pos + 8, |
dec->qtmp.y + 128, 16*x_pos + 8, 16*y_pos + 8, |
1250 |
pMB->mvs[3].x, pMB->mvs[3].y, stride, 0); |
pMB->mvs[3].x, pMB->mvs[3].y, stride, 0); |
1251 |
} |
} |
1252 |
} |
} |
1270 |
|
|
1271 |
if(dec->quarterpel) { |
if(dec->quarterpel) { |
1272 |
if((pMB->mode == MODE_INTER || pMB->mode == MODE_INTER_Q)) |
if((pMB->mode == MODE_INTER || pMB->mode == MODE_INTER_Q)) |
1273 |
interpolate16x16_quarterpel(dec->refn[2].y, backward.y, dec->refh.y, dec->refh.y + 64, |
interpolate16x16_quarterpel(dec->tmp.y, backward.y, dec->qtmp.y, dec->qtmp.y + 64, |
1274 |
dec->refh.y + 128, 16*x_pos, 16*y_pos, |
dec->qtmp.y + 128, 16*x_pos, 16*y_pos, |
1275 |
pMB->b_mvs[0].x, pMB->b_mvs[0].y, stride, 0); |
pMB->b_mvs[0].x, pMB->b_mvs[0].y, stride, 0); |
1276 |
else { |
else { |
1277 |
interpolate8x8_quarterpel(dec->refn[2].y, backward.y, dec->refh.y, dec->refh.y + 64, |
interpolate8x8_quarterpel(dec->tmp.y, backward.y, dec->qtmp.y, dec->qtmp.y + 64, |
1278 |
dec->refh.y + 128, 16*x_pos, 16*y_pos, |
dec->qtmp.y + 128, 16*x_pos, 16*y_pos, |
1279 |
pMB->b_mvs[0].x, pMB->b_mvs[0].y, stride, 0); |
pMB->b_mvs[0].x, pMB->b_mvs[0].y, stride, 0); |
1280 |
interpolate8x8_quarterpel(dec->refn[2].y, backward.y, dec->refh.y, dec->refh.y + 64, |
interpolate8x8_quarterpel(dec->tmp.y, backward.y, dec->qtmp.y, dec->qtmp.y + 64, |
1281 |
dec->refh.y + 128, 16*x_pos + 8, 16*y_pos, |
dec->qtmp.y + 128, 16*x_pos + 8, 16*y_pos, |
1282 |
pMB->b_mvs[1].x, pMB->b_mvs[1].y, stride, 0); |
pMB->b_mvs[1].x, pMB->b_mvs[1].y, stride, 0); |
1283 |
interpolate8x8_quarterpel(dec->refn[2].y, backward.y, dec->refh.y, dec->refh.y + 64, |
interpolate8x8_quarterpel(dec->tmp.y, backward.y, dec->qtmp.y, dec->qtmp.y + 64, |
1284 |
dec->refh.y + 128, 16*x_pos, 16*y_pos + 8, |
dec->qtmp.y + 128, 16*x_pos, 16*y_pos + 8, |
1285 |
pMB->b_mvs[2].x, pMB->b_mvs[2].y, stride, 0); |
pMB->b_mvs[2].x, pMB->b_mvs[2].y, stride, 0); |
1286 |
interpolate8x8_quarterpel(dec->refn[2].y, backward.y, dec->refh.y, dec->refh.y + 64, |
interpolate8x8_quarterpel(dec->tmp.y, backward.y, dec->qtmp.y, dec->qtmp.y + 64, |
1287 |
dec->refh.y + 128, 16*x_pos + 8, 16*y_pos + 8, |
dec->qtmp.y + 128, 16*x_pos + 8, 16*y_pos + 8, |
1288 |
pMB->b_mvs[3].x, pMB->b_mvs[3].y, stride, 0); |
pMB->b_mvs[3].x, pMB->b_mvs[3].y, stride, 0); |
1289 |
} |
} |
1290 |
} |
} |
1291 |
else { |
else { |
1292 |
interpolate8x8_switch(dec->refn[2].y, backward.y, 16 * x_pos, 16 * y_pos, |
interpolate8x8_switch(dec->tmp.y, backward.y, 16 * x_pos, 16 * y_pos, |
1293 |
pMB->b_mvs[0].x, pMB->b_mvs[0].y, stride, 0); |
pMB->b_mvs[0].x, pMB->b_mvs[0].y, stride, 0); |
1294 |
interpolate8x8_switch(dec->refn[2].y, backward.y, 16 * x_pos + 8, |
interpolate8x8_switch(dec->tmp.y, backward.y, 16 * x_pos + 8, |
1295 |
16 * y_pos, pMB->b_mvs[1].x, pMB->b_mvs[1].y, stride, |
16 * y_pos, pMB->b_mvs[1].x, pMB->b_mvs[1].y, stride, |
1296 |
0); |
0); |
1297 |
interpolate8x8_switch(dec->refn[2].y, backward.y, 16 * x_pos, |
interpolate8x8_switch(dec->tmp.y, backward.y, 16 * x_pos, |
1298 |
16 * y_pos + 8, pMB->b_mvs[2].x, pMB->b_mvs[2].y, |
16 * y_pos + 8, pMB->b_mvs[2].x, pMB->b_mvs[2].y, |
1299 |
stride, 0); |
stride, 0); |
1300 |
interpolate8x8_switch(dec->refn[2].y, backward.y, 16 * x_pos + 8, |
interpolate8x8_switch(dec->tmp.y, backward.y, 16 * x_pos + 8, |
1301 |
16 * y_pos + 8, pMB->b_mvs[3].x, pMB->b_mvs[3].y, |
16 * y_pos + 8, pMB->b_mvs[3].x, pMB->b_mvs[3].y, |
1302 |
stride, 0); |
stride, 0); |
1303 |
} |
} |
1304 |
|
|
1305 |
interpolate8x8_switch(dec->refn[2].u, backward.u, 8 * x_pos, 8 * y_pos, |
interpolate8x8_switch(dec->tmp.u, backward.u, 8 * x_pos, 8 * y_pos, |
1306 |
b_uv_dx, b_uv_dy, stride2, 0); |
b_uv_dx, b_uv_dy, stride2, 0); |
1307 |
interpolate8x8_switch(dec->refn[2].v, backward.v, 8 * x_pos, 8 * y_pos, |
interpolate8x8_switch(dec->tmp.v, backward.v, 8 * x_pos, 8 * y_pos, |
1308 |
b_uv_dx, b_uv_dy, stride2, 0); |
b_uv_dx, b_uv_dy, stride2, 0); |
1309 |
|
|
1310 |
interpolate8x8_avg2(dec->cur.y + (16 * y_pos * stride) + 16 * x_pos, |
interpolate8x8_avg2(dec->cur.y + (16 * y_pos * stride) + 16 * x_pos, |
1311 |
dec->cur.y + (16 * y_pos * stride) + 16 * x_pos, |
dec->cur.y + (16 * y_pos * stride) + 16 * x_pos, |
1312 |
dec->refn[2].y + (16 * y_pos * stride) + 16 * x_pos, |
dec->tmp.y + (16 * y_pos * stride) + 16 * x_pos, |
1313 |
stride, 1, 8); |
stride, 1, 8); |
1314 |
|
|
1315 |
interpolate8x8_avg2(dec->cur.y + (16 * y_pos * stride) + 16 * x_pos + 8, |
interpolate8x8_avg2(dec->cur.y + (16 * y_pos * stride) + 16 * x_pos + 8, |
1316 |
dec->cur.y + (16 * y_pos * stride) + 16 * x_pos + 8, |
dec->cur.y + (16 * y_pos * stride) + 16 * x_pos + 8, |
1317 |
dec->refn[2].y + (16 * y_pos * stride) + 16 * x_pos + 8, |
dec->tmp.y + (16 * y_pos * stride) + 16 * x_pos + 8, |
1318 |
stride, 1, 8); |
stride, 1, 8); |
1319 |
|
|
1320 |
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, |
1321 |
dec->cur.y + ((16 * y_pos + 8) * stride) + 16 * x_pos, |
dec->cur.y + ((16 * y_pos + 8) * stride) + 16 * x_pos, |
1322 |
dec->refn[2].y + ((16 * y_pos + 8) * stride) + 16 * x_pos, |
dec->tmp.y + ((16 * y_pos + 8) * stride) + 16 * x_pos, |
1323 |
stride, 1, 8); |
stride, 1, 8); |
1324 |
|
|
1325 |
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, |
1326 |
dec->cur.y + ((16 * y_pos + 8) * stride) + 16 * x_pos + 8, |
dec->cur.y + ((16 * y_pos + 8) * stride) + 16 * x_pos + 8, |
1327 |
dec->refn[2].y + ((16 * y_pos + 8) * stride) + 16 * x_pos + 8, |
dec->tmp.y + ((16 * y_pos + 8) * stride) + 16 * x_pos + 8, |
1328 |
stride, 1, 8); |
stride, 1, 8); |
1329 |
|
|
1330 |
interpolate8x8_avg2(dec->cur.u + (8 * y_pos * stride2) + 8 * x_pos, |
interpolate8x8_avg2(dec->cur.u + (8 * y_pos * stride2) + 8 * x_pos, |
1331 |
dec->cur.u + (8 * y_pos * stride2) + 8 * x_pos, |
dec->cur.u + (8 * y_pos * stride2) + 8 * x_pos, |
1332 |
dec->refn[2].u + (8 * y_pos * stride2) + 8 * x_pos, |
dec->tmp.u + (8 * y_pos * stride2) + 8 * x_pos, |
1333 |
stride2, 1, 8); |
stride2, 1, 8); |
1334 |
|
|
1335 |
interpolate8x8_avg2(dec->cur.v + (8 * y_pos * stride2) + 8 * x_pos, |
interpolate8x8_avg2(dec->cur.v + (8 * y_pos * stride2) + 8 * x_pos, |
1336 |
dec->cur.v + (8 * y_pos * stride2) + 8 * x_pos, |
dec->cur.v + (8 * y_pos * stride2) + 8 * x_pos, |
1337 |
dec->refn[2].v + (8 * y_pos * stride2) + 8 * x_pos, |
dec->tmp.v + (8 * y_pos * stride2) + 8 * x_pos, |
1338 |
stride2, 1, 8); |
stride2, 1, 8); |
1339 |
|
|
1340 |
stop_comp_timer(); |
stop_comp_timer(); |
1464 |
mb->b_mvs[0] = mb->b_mvs[1] = mb->b_mvs[2] = mb->b_mvs[3] = |
mb->b_mvs[0] = mb->b_mvs[1] = mb->b_mvs[2] = mb->b_mvs[3] = |
1465 |
mb->mvs[0] = mb->mvs[1] = mb->mvs[2] = mb->mvs[3] = zeromv; |
mb->mvs[0] = mb->mvs[1] = mb->mvs[2] = mb->mvs[3] = zeromv; |
1466 |
|
|
1467 |
// the last P_VOP is skip macroblock ? |
// skip if the co-located P_VOP macroblock is not coded |
1468 |
|
// note: gmc+not_coded isn't skipped |
1469 |
|
|
1470 |
if (last_mb->mode == MODE_NOT_CODED) { |
if (last_mb->mode == MODE_NOT_CODED) { |
1471 |
//DEBUG2("Skip MB in B-frame at (X,Y)=!",x,y); |
//DEBUG2("Skip MB in B-frame at (X,Y)=!",x,y); |
1472 |
mb->cbp = 0; |
mb->cbp = 0; |
1580 |
break; |
break; |
1581 |
|
|
1582 |
default: |
default: |
1583 |
DEBUG1("Not support B-frame mb_type =", mb->mb_type); |
DPRINTF(DPRINTF_ERROR,"Not support B-frame mb_type = %i", mb->mb_type); |
1584 |
} |
} |
1585 |
|
|
1586 |
} // end of FOR |
} // end of FOR |
1605 |
*mb2 = temp; |
*mb2 = temp; |
1606 |
} |
} |
1607 |
|
|
1608 |
|
|
1609 |
|
/* perform post processing if necessary, and output the image */ |
1610 |
|
void decoder_output(DECODER * dec, IMAGE * img, MACROBLOCK * mbs, |
1611 |
|
const XVID_DEC_FRAME * frame, int pp_disable) |
1612 |
|
{ |
1613 |
|
|
1614 |
|
if ((frame->general & (XVID_DEC_DEBLOCKY|XVID_DEC_DEBLOCKUV)) && !pp_disable) /* post process */ |
1615 |
|
{ |
1616 |
|
/* note: image is stored to tmp */ |
1617 |
|
image_copy(&dec->tmp, img, dec->edged_width, dec->height); |
1618 |
|
image_deblock_rrv(&dec->tmp, dec->edged_width, |
1619 |
|
mbs, dec->mb_width, dec->mb_height, dec->mb_width, |
1620 |
|
8, frame->general); |
1621 |
|
img = &dec->tmp; |
1622 |
|
} |
1623 |
|
|
1624 |
|
image_output(img, dec->width, dec->height, |
1625 |
|
dec->edged_width, frame->image, frame->stride, |
1626 |
|
frame->colorspace, dec->interlacing); |
1627 |
|
} |
1628 |
|
|
1629 |
|
|
1630 |
int |
int |
1631 |
decoder_decode(DECODER * dec, |
decoder_decode(DECODER * dec, |
1632 |
XVID_DEC_FRAME * frame, XVID_DEC_STATS * stats) |
XVID_DEC_FRAME * frame, XVID_DEC_STATS * stats) |
1642 |
VECTOR gmc_mv[5]; |
VECTOR gmc_mv[5]; |
1643 |
uint32_t vop_type; |
uint32_t vop_type; |
1644 |
int success = 0; |
int success = 0; |
1645 |
|
int output = 0; |
1646 |
|
int seen_something = 0; |
1647 |
|
|
1648 |
start_global_timer(); |
start_global_timer(); |
1649 |
|
|
1650 |
|
dec->low_delay_default = (frame->general & XVID_DEC_LOWDELAY); |
1651 |
dec->out_frm = (frame->colorspace == XVID_CSP_EXTERN) ? frame->image : NULL; |
dec->out_frm = (frame->colorspace == XVID_CSP_EXTERN) ? frame->image : NULL; |
1652 |
|
|
1653 |
|
if ((frame->general & XVID_DEC_DISCONTINUITY)) |
1654 |
|
dec->frames = 0; |
1655 |
|
|
1656 |
|
if (frame->length < 0) /* decoder flush */ |
1657 |
|
{ |
1658 |
|
/* if not decoding "low_delay/packed", and this isn't low_delay and |
1659 |
|
we have a reference frame, then outout the reference frame */ |
1660 |
|
if (!(dec->low_delay_default && dec->packed_mode) && !dec->low_delay && dec->frames>0) |
1661 |
|
{ |
1662 |
|
decoder_output(dec, &dec->refn[0], dec->mbs, frame, dec->last_reduced_resolution); |
1663 |
|
output = 1; |
1664 |
|
} |
1665 |
|
|
1666 |
|
frame->length = 0; |
1667 |
|
if (stats) |
1668 |
|
{ |
1669 |
|
stats->notify = output ? XVID_DEC_VOP : XVID_DEC_NOTHING; |
1670 |
|
stats->data.vop.time_base = (int)dec->time_base; |
1671 |
|
stats->data.vop.time_increment = 0; //XXX: todo |
1672 |
|
} |
1673 |
|
|
1674 |
|
emms(); |
1675 |
|
|
1676 |
|
stop_global_timer(); |
1677 |
|
return XVID_ERR_OK; |
1678 |
|
} |
1679 |
|
|
1680 |
BitstreamInit(&bs, frame->bitstream, frame->length); |
BitstreamInit(&bs, frame->bitstream, frame->length); |
1681 |
|
|
1682 |
// XXX: 0x7f is only valid whilst decoding vfw xvid/divx5 avi's |
// XXX: 0x7f is only valid whilst decoding vfw xvid/divx5 avi's |
1683 |
if(frame->length == 1 && BitstreamShowBits(&bs, 8) == 0x7f) |
if(dec->low_delay_default && frame->length == 1 && BitstreamShowBits(&bs, 8) == 0x7f) |
1684 |
{ |
{ |
1685 |
if (stats) |
if (stats) |
1686 |
stats->notify = XVID_DEC_VOP; |
stats->notify = XVID_DEC_VOP; |
1691 |
return XVID_ERR_OK; |
return XVID_ERR_OK; |
1692 |
} |
} |
1693 |
|
|
1694 |
start: |
repeat: |
|
// add by chenm001 <chenm001@163.com> |
|
|
// for support B-frame to reference last 2 frame |
|
|
dec->frames++; |
|
1695 |
|
|
1696 |
xxx: |
vop_type = BitstreamReadHeaders(&bs, dec, &rounding, &reduced_resolution, |
|
vop_type = |
|
|
BitstreamReadHeaders(&bs, dec, &rounding, &reduced_resolution, |
|
1697 |
&quant, &fcode_forward, &fcode_backward, &intra_dc_threshold, gmc_mv); |
&quant, &fcode_forward, &fcode_backward, &intra_dc_threshold, gmc_mv); |
1698 |
|
|
1699 |
//DPRINTF(DPRINTF_HEADER, "vop_type=%i", vop_type); |
DPRINTF(DPRINTF_HEADER, "vop_type=%i, packed=%i, time=%i, time_pp=%i, time_bp=%i", |
1700 |
|
vop_type, dec->packed_mode, dec->time, dec->time_pp, dec->time_bp); |
1701 |
|
|
1702 |
if (vop_type == -1 && success) |
if (vop_type == - 1) |
1703 |
goto done; |
{ |
1704 |
|
if (success) goto done; |
1705 |
|
emms(); |
1706 |
|
return XVID_ERR_FAIL; |
1707 |
|
} |
1708 |
|
|
1709 |
if (vop_type == -2 || vop_type == -3) |
if (vop_type == -2 || vop_type == -3) |
1710 |
{ |
{ |
1723 |
stats->data.vol.par_width = dec->par_width; |
stats->data.vol.par_width = dec->par_width; |
1724 |
stats->data.vol.par_height = dec->par_height; |
stats->data.vol.par_height = dec->par_height; |
1725 |
frame->length = BitstreamPos(&bs) / 8; |
frame->length = BitstreamPos(&bs) / 8; |
1726 |
|
emms(); |
1727 |
return XVID_ERR_OK; |
return XVID_ERR_OK; |
1728 |
} |
} |
1729 |
goto xxx; |
goto repeat; |
1730 |
} |
} |
1731 |
|
|
1732 |
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 |
1733 |
|
|
|
switch (vop_type) { |
|
|
case P_VOP: |
|
|
decoder_pframe(dec, &bs, rounding, reduced_resolution, quant, |
|
|
fcode_forward, intra_dc_threshold, NULL); |
|
|
#ifdef BFRAMES_DEC |
|
|
DEBUG1("P_VOP Time=", dec->time); |
|
|
#endif |
|
|
break; |
|
1734 |
|
|
1735 |
|
/* packed_mode: special-N_VOP treament */ |
1736 |
|
if (dec->packed_mode && vop_type == N_VOP) |
1737 |
|
{ |
1738 |
|
if (dec->low_delay_default && dec->frames > 0) |
1739 |
|
{ |
1740 |
|
decoder_output(dec, &dec->refn[0], dec->last_mbs, frame, dec->last_reduced_resolution); |
1741 |
|
output = 1; |
1742 |
|
} |
1743 |
|
/* ignore otherwise */ |
1744 |
|
} |
1745 |
|
else if (vop_type != B_VOP) |
1746 |
|
{ |
1747 |
|
switch(vop_type) |
1748 |
|
{ |
1749 |
case I_VOP: |
case I_VOP: |
1750 |
decoder_iframe(dec, &bs, reduced_resolution, quant, intra_dc_threshold); |
decoder_iframe(dec, &bs, reduced_resolution, quant, intra_dc_threshold); |
|
#ifdef BFRAMES_DEC |
|
|
DEBUG1("I_VOP Time=", dec->time); |
|
|
#endif |
|
1751 |
break; |
break; |
1752 |
|
case P_VOP : |
1753 |
case B_VOP: |
decoder_pframe(dec, &bs, rounding, reduced_resolution, quant, |
1754 |
#ifdef BFRAMES_DEC |
fcode_forward, intra_dc_threshold, NULL); |
|
if (dec->time_pp > dec->time_bp) { |
|
|
DEBUG1("B_VOP Time=", dec->time); |
|
|
decoder_bframe(dec, &bs, quant, fcode_forward, fcode_backward); |
|
|
} else { |
|
|
DEBUG("broken B-frame!"); |
|
|
} |
|
|
#else |
|
|
image_copy(&dec->cur, &dec->refn[0], dec->edged_width, dec->height); |
|
|
#endif |
|
1755 |
break; |
break; |
|
|
|
1756 |
case S_VOP : |
case S_VOP : |
1757 |
decoder_pframe(dec, &bs, rounding, reduced_resolution, quant, |
decoder_pframe(dec, &bs, rounding, reduced_resolution, quant, |
1758 |
fcode_forward, intra_dc_threshold, gmc_mv); |
fcode_forward, intra_dc_threshold, gmc_mv); |
1759 |
break; |
break; |
1760 |
|
case N_VOP : |
|
case N_VOP: // vop not coded |
|
|
// when low_delay==0, N_VOP's should interpolate between the past and future frames |
|
1761 |
image_copy(&dec->cur, &dec->refn[0], dec->edged_width, dec->height); |
image_copy(&dec->cur, &dec->refn[0], dec->edged_width, dec->height); |
|
#ifdef BFRAMES_DEC |
|
|
DEBUG1("N_VOP Time=", dec->time); |
|
|
#endif |
|
1762 |
break; |
break; |
|
|
|
|
default: |
|
|
if (stats) |
|
|
stats->notify = 0; |
|
|
|
|
|
emms(); |
|
|
return XVID_ERR_FAIL; |
|
1763 |
} |
} |
1764 |
|
|
|
|
|
1765 |
if (reduced_resolution) |
if (reduced_resolution) |
1766 |
{ |
{ |
1767 |
image_deblock_rrv(&dec->cur, dec->edged_width, dec->mbs, |
image_deblock_rrv(&dec->cur, dec->edged_width, dec->mbs, |
1768 |
(dec->width + 31) / 32, (dec->height + 31) / 32, dec->mb_width); |
(dec->width + 31) / 32, (dec->height + 31) / 32, dec->mb_width, |
1769 |
|
16, XVID_DEC_DEBLOCKY|XVID_DEC_DEBLOCKUV); |
1770 |
} |
} |
1771 |
|
|
1772 |
BitstreamByteAlign(&bs); |
/* note: for packed_mode, output is performed when the special-N_VOP is decoded */ |
1773 |
|
if (!(dec->low_delay_default && dec->packed_mode)) |
1774 |
#ifdef BFRAMES_DEC |
{ |
1775 |
// test if no B_VOP |
if (dec->low_delay) |
1776 |
if (dec->low_delay || dec->frames == 0 || ((dec->packed_mode) && !(frame->length > BitstreamPos(&bs) / 8))) { |
{ |
1777 |
#endif |
decoder_output(dec, &dec->cur, dec->mbs, frame, reduced_resolution); |
1778 |
image_output(&dec->cur, dec->width, dec->height, dec->edged_width, |
output = 1; |
|
frame->image, frame->stride, frame->colorspace, dec->interlacing); |
|
|
|
|
|
#ifdef BFRAMES_DEC |
|
|
} else { |
|
|
if (dec->frames >= 1 && !(dec->packed_mode)) { |
|
|
start_timer(); |
|
|
if ((vop_type == I_VOP || vop_type == P_VOP || vop_type == S_VOP)) { |
|
|
image_output(&dec->refn[0], dec->width, dec->height, |
|
|
dec->edged_width, frame->image, frame->stride, |
|
|
frame->colorspace, dec->interlacing); |
|
|
} else if (vop_type == B_VOP) { |
|
|
image_output(&dec->cur, dec->width, dec->height, |
|
|
dec->edged_width, frame->image, frame->stride, |
|
|
frame->colorspace, dec->interlacing); |
|
1779 |
} |
} |
1780 |
stop_conv_timer(); |
else if (dec->frames > 0) /* is the reference frame valid? */ |
1781 |
|
{ |
1782 |
|
/* output the reference frame */ |
1783 |
|
decoder_output(dec, &dec->refn[0], dec->last_mbs, frame, dec->last_reduced_resolution); |
1784 |
|
output = 1; |
1785 |
} |
} |
1786 |
} |
} |
|
#endif |
|
1787 |
|
|
|
if (vop_type == I_VOP || vop_type == P_VOP || vop_type == S_VOP) { |
|
1788 |
image_swap(&dec->refn[0], &dec->refn[1]); |
image_swap(&dec->refn[0], &dec->refn[1]); |
1789 |
image_swap(&dec->cur, &dec->refn[0]); |
image_swap(&dec->cur, &dec->refn[0]); |
|
|
|
|
// swap MACROBLOCK |
|
|
// the Divx will not set the low_delay flage some times |
|
|
// so follow code will wrong to not swap at that time |
|
|
// this will broken bitstream! so I'm change it, |
|
|
// But that is not the best way! can anyone tell me how |
|
|
// to do another way? |
|
|
// 18-07-2002 MinChen<chenm001@163.com> |
|
|
//if (!dec->low_delay && vop_type == P_VOP) |
|
|
if (vop_type == P_VOP) |
|
1790 |
mb_swap(&dec->mbs, &dec->last_mbs); |
mb_swap(&dec->mbs, &dec->last_mbs); |
1791 |
|
dec->last_reduced_resolution = reduced_resolution; |
1792 |
|
|
1793 |
|
dec->frames++; |
1794 |
|
seen_something = 1; |
1795 |
|
|
1796 |
|
}else{ /* B_VOP */ |
1797 |
|
|
1798 |
|
if (dec->low_delay) |
1799 |
|
{ |
1800 |
|
DPRINTF(DPRINTF_ERROR, "warning: bvop found in low_delay==1 stream"); |
1801 |
|
dec->low_delay = 1; |
1802 |
} |
} |
1803 |
|
|
1804 |
|
if (dec->frames < 2) |
1805 |
|
{ |
1806 |
|
/* attemping to decode a bvop without atleast 2 reference frames */ |
1807 |
|
image_printf(&dec->cur, dec->edged_width, dec->height, 16, 16, |
1808 |
|
"broken b-frame, mising ref frames"); |
1809 |
|
}else if (dec->time_pp <= dec->time_bp) { |
1810 |
|
/* this occurs when dx50_bvop_compatibility==0 sequences are |
1811 |
|
decoded in vfw. */ |
1812 |
|
image_printf(&dec->cur, dec->edged_width, dec->height, 16, 16, |
1813 |
|
"broken b-frame, tpp=%i tbp=%i", dec->time_pp, dec->time_bp); |
1814 |
|
}else{ |
1815 |
|
decoder_bframe(dec, &bs, quant, fcode_forward, fcode_backward); |
1816 |
|
} |
1817 |
|
|
1818 |
if (success == 0 && dec->packed_mode) |
decoder_output(dec, &dec->cur, dec->mbs, frame, reduced_resolution); |
1819 |
|
output = 1; |
1820 |
|
dec->frames++; |
1821 |
|
} |
1822 |
|
|
1823 |
|
BitstreamByteAlign(&bs); |
1824 |
|
|
1825 |
|
/* low_delay_default mode: repeat in packed_mode */ |
1826 |
|
if (dec->low_delay_default && dec->packed_mode && output == 0 && success == 0) |
1827 |
{ |
{ |
1828 |
success = 1; |
success = 1; |
1829 |
// if (frame->length > BitstreamPos(&bs) / 8) // multiple vops packed together |
goto repeat; |
|
goto start; |
|
1830 |
} |
} |
1831 |
|
|
1832 |
done : |
done : |
1833 |
|
|
1834 |
|
/* low_delay_default mode: if we've gotten here without outputting anything, |
1835 |
|
then output the recently decoded frame, or print an error message */ |
1836 |
|
if (dec->low_delay_default && output == 0) |
1837 |
|
{ |
1838 |
|
if (dec->packed_mode && seen_something) |
1839 |
|
{ |
1840 |
|
/* output the recently decoded frame */ |
1841 |
|
decoder_output(dec, &dec->refn[0], dec->last_mbs, frame, dec->last_reduced_resolution); |
1842 |
|
output = 1; |
1843 |
|
} |
1844 |
|
else |
1845 |
|
{ |
1846 |
|
image_clear(&dec->cur, dec->width, dec->height, dec->edged_width, 0, 128, 128); |
1847 |
|
image_printf(&dec->cur, dec->edged_width, dec->height, 16, 16, |
1848 |
|
"warning: nothing to output"); |
1849 |
|
image_printf(&dec->cur, dec->edged_width, dec->height, 16, 64, |
1850 |
|
"bframe decoder lag"); |
1851 |
|
|
1852 |
|
decoder_output(dec, &dec->cur, NULL, frame, 1 /*disable pp*/); |
1853 |
|
} |
1854 |
|
} |
1855 |
|
|
1856 |
frame->length = BitstreamPos(&bs) / 8; |
frame->length = BitstreamPos(&bs) / 8; |
1857 |
|
|
1858 |
if (stats) |
if (stats) |
1859 |
{ |
{ |
1860 |
stats->notify = XVID_DEC_VOP; |
stats->notify = output ? XVID_DEC_VOP : XVID_DEC_NOTHING; |
1861 |
stats->data.vop.time_base = (int)dec->time_base; |
stats->data.vop.time_base = (int)dec->time_base; |
1862 |
stats->data.vop.time_increment = 0; //XXX: todo |
stats->data.vop.time_increment = 0; //XXX: todo |
1863 |
} |
} |