373 |
DECLARE_ALIGNED_MATRIX(block, 1, 64, int16_t, CACHE_LINE); |
DECLARE_ALIGNED_MATRIX(block, 1, 64, int16_t, CACHE_LINE); |
374 |
DECLARE_ALIGNED_MATRIX(data, 6, 64, int16_t, CACHE_LINE); |
DECLARE_ALIGNED_MATRIX(data, 6, 64, int16_t, CACHE_LINE); |
375 |
|
|
376 |
int stride = dec->edged_width, next_block = stride * (reduced_resolution ? 16 : 8); |
int stride = dec->edged_width; |
377 |
|
int next_block = stride * (reduced_resolution ? 16 : 8); |
378 |
const int stride2 = stride/2; |
const int stride2 = stride/2; |
379 |
int i; |
int i; |
380 |
const uint32_t iQuant = pMB->quant; |
const uint32_t iQuant = pMB->quant; |
451 |
{ |
{ |
452 |
uint32_t stride = dec->edged_width; |
uint32_t stride = dec->edged_width; |
453 |
uint32_t stride2 = stride / 2; |
uint32_t stride2 = stride / 2; |
|
uint32_t next_block = stride * (reduced_resolution ? 16 : 8); |
|
454 |
uint32_t i; |
uint32_t i; |
455 |
|
|
456 |
uint8_t *pY_Cur, *pU_Cur, *pV_Cur; |
uint8_t *pY_Cur, *pU_Cur, *pV_Cur; |
963 |
{ |
{ |
964 |
uint32_t stride = dec->edged_width; |
uint32_t stride = dec->edged_width; |
965 |
uint32_t stride2 = stride / 2; |
uint32_t stride2 = stride / 2; |
|
uint32_t next_block = stride * 8; |
|
966 |
int uv_dx, uv_dy; |
int uv_dx, uv_dy; |
967 |
int b_uv_dx, b_uv_dy; |
int b_uv_dx, b_uv_dy; |
968 |
uint8_t *pY_Cur, *pU_Cur, *pV_Cur; |
uint8_t *pY_Cur, *pU_Cur, *pV_Cur; |
1164 |
const int64_t TRB = dec->time_pp - dec->time_bp, TRD = dec->time_pp; |
const int64_t TRB = dec->time_pp - dec->time_bp, TRD = dec->time_pp; |
1165 |
int i; |
int i; |
1166 |
|
|
|
#ifdef BFRAMES_DEC_DEBUG |
|
|
FILE *fp; |
|
|
static char first=0; |
|
|
#define BFRAME_DEBUG |
|
|
if (!first && fp) { \ |
|
|
fprintf(fp,"Y=%3d X=%3d MB=%2d CBP=%02X\n",y,x,mb->mode,mb->cbp); \ |
|
|
} |
|
|
#endif |
|
|
|
|
1167 |
start_timer(); |
start_timer(); |
1168 |
image_setedges(&dec->refn[0], dec->edged_width, dec->edged_height, |
image_setedges(&dec->refn[0], dec->edged_width, dec->edged_height, |
1169 |
dec->width, dec->height); |
dec->width, dec->height); |
1171 |
dec->width, dec->height); |
dec->width, dec->height); |
1172 |
stop_edges_timer(); |
stop_edges_timer(); |
1173 |
|
|
|
#ifdef BFRAMES_DEC_DEBUG |
|
|
if (!first){ |
|
|
fp=fopen("C:\\XVIDDBG.TXT","w"); |
|
|
} |
|
|
#endif |
|
|
|
|
1174 |
for (y = 0; y < dec->mb_height; y++) { |
for (y = 0; y < dec->mb_height; y++) { |
1175 |
/* Initialize Pred Motion Vector */ |
/* Initialize Pred Motion Vector */ |
1176 |
dec->p_fmv = dec->p_bmv = zeromv; |
dec->p_fmv = dec->p_bmv = zeromv; |
1177 |
for (x = 0; x < dec->mb_width; x++) { |
for (x = 0; x < dec->mb_width; x++) { |
1178 |
MACROBLOCK *mb = &dec->mbs[y * dec->mb_width + x]; |
MACROBLOCK *mb = &dec->mbs[y * dec->mb_width + x]; |
1179 |
MACROBLOCK *last_mb = &dec->last_mbs[y * dec->mb_width + x]; |
MACROBLOCK *last_mb = &dec->last_mbs[y * dec->mb_width + x]; |
1180 |
|
const int fcode_max = (fcode_forward>fcode_backward) ? fcode_forward : fcode_backward; |
1181 |
|
uint32_t intra_dc_threshold; /* fake variable */ |
1182 |
|
|
1183 |
|
if (check_resync_marker(bs, fcode_max - 1)) { |
1184 |
|
int bound = read_video_packet_header(bs, dec, fcode_max - 1, &quant, |
1185 |
|
&fcode_forward, &fcode_backward, &intra_dc_threshold); |
1186 |
|
x = bound % dec->mb_width; |
1187 |
|
y = bound / dec->mb_width; |
1188 |
|
/* reset predicted macroblocks */ |
1189 |
|
dec->p_fmv = dec->p_bmv = zeromv; |
1190 |
|
} |
1191 |
|
|
1192 |
mv = |
mv = |
1193 |
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] = |
1300 |
} |
} |
1301 |
} /* End of for */ |
} /* End of for */ |
1302 |
} |
} |
|
|
|
|
#ifdef BFRAMES_DEC_DEBUG |
|
|
if (!first){ |
|
|
first=1; |
|
|
if (fp) |
|
|
fclose(fp); |
|
|
} |
|
|
#endif |
|
1303 |
} |
} |
1304 |
|
|
1305 |
/* perform post processing if necessary, and output the image */ |
/* perform post processing if necessary, and output the image */ |