if (s->mb_x) {
topleft_mb_pos = (s->mb_y - 1) * s->mb_stride + s->mb_x - 1;
fieldtx = v->fieldtx_plane[topleft_mb_pos];
- stride_y = (s->linesize) << fieldtx;
+ stride_y = s->linesize << fieldtx;
v_dist = (16 - fieldtx) >> (fieldtx == 0);
s->dsp.put_signed_pixels_clamped(v->block[v->topleft_blk_idx][0],
s->dest[0] - 16 * s->linesize - 16,
uvmy = uvmy - 2 + 4 * v->cur_field_type;
}
- if (v->fastuvmc && (v->fcm != 1)) { // fastuvmc shall be ignored for interlaced frame picture
+ // fastuvmc shall be ignored for interlaced frame picture
+ if (v->fastuvmc && (v->fcm != ILACE_FRAME)) {
uvmx = uvmx + ((uvmx < 0) ? (uvmx & 1) : -(uvmx & 1));
uvmy = uvmy + ((uvmy < 0) ? (uvmy & 1) : -(uvmy & 1));
}
uint8_t *srcY;
int dxy, mx, my, src_x, src_y;
int off;
- int fieldmv = (v->fcm == 1) ? v->blk_mv_type[s->block_index[n]] : 0;
+ int fieldmv = (v->fcm == ILACE_FRAME) ? v->blk_mv_type[s->block_index[n]] : 0;
int v_edge_pos = s->v_edge_pos >> v->field_mode;
if (!v->field_mode && !v->s.last_picture.f.data[0])
v->mv_f[1][s->block_index[k] + v->blocks_off] = f;
}
- if (v->fcm == 1) { // not sure if needed for other types of picture
+ if (v->fcm == ILACE_FRAME) { // not sure if needed for other types of picture
int qx, qy;
int width = s->avctx->coded_width;
int height = s->avctx->coded_height >> 1;
my -= 8 * (qy - height - 1);
}
- if ((v->fcm == 1) && fieldmv)
+ if ((v->fcm == ILACE_FRAME) && fieldmv)
off = ((n > 1) ? s->linesize : 0) + (n & 1) * 8;
else
off = s->linesize * 4 * (n & 2) + (n & 1) * 8;
src_y = av_clip(src_y, -16, s->mb_height * 16);
} else {
src_x = av_clip(src_x, -17, s->avctx->coded_width);
- if (v->fcm == 1) {
+ if (v->fcm == ILACE_FRAME) {
if (src_y & 1)
src_y = av_clip(src_y, -17, s->avctx->coded_height + 1);
else
if (!v->field_mode || (v->field_mode && !v->numref)) {
valid_count = get_chroma_mv(mvx, mvy, intra, 0, &tx, &ty);
if (!valid_count) {
- s->current_picture.f.motion_val[1][s->block_index[0]][0] = 0;
- s->current_picture.f.motion_val[1][s->block_index[0]][1] = 0;
+ s->current_picture.f.motion_val[1][s->block_index[0] + v->blocks_off][0] = 0;
+ s->current_picture.f.motion_val[1][s->block_index[0] + v->blocks_off][1] = 0;
v->luma_mv[s->mb_x][0] = v->luma_mv[s->mb_x][1] = 0;
return; //no need to do MC for intra blocks
}
if (dominant)
chroma_ref_type = !v->cur_field_type;
}
- s->current_picture.f.motion_val[1][s->block_index[0]][0] = tx;
- s->current_picture.f.motion_val[1][s->block_index[0]][1] = ty;
+ s->current_picture.f.motion_val[1][s->block_index[0] + v->blocks_off][0] = tx;
+ s->current_picture.f.motion_val[1][s->block_index[0] + v->blocks_off][1] = ty;
uvmx = (tx + ((tx & 3) == 3)) >> 1;
uvmy = (ty + ((ty & 3) == 3)) >> 1;
int k;
if (v->s.ac_pred) {
- if (!use_pred && v->fcm == 1) {
+ if (!use_pred && v->fcm == ILACE_FRAME) {
zz_table = v->zzi_8x8;
} else {
if (!dc_pred_dir) // top
zz_table = v->zz_8x8[3];
}
} else {
- if (v->fcm != 1)
+ if (v->fcm != ILACE_FRAME)
zz_table = v->zz_8x8[1];
else
zz_table = v->zzi_8x8;
i += skip;
if (i > 63)
break;
- if (v->fcm == 0)
+ if (v->fcm == PROGRESSIVE)
block[v->zz_8x8[0][i++]] = value;
else {
- if (use_pred && (v->fcm == 1)) {
+ if (use_pred && (v->fcm == ILACE_FRAME)) {
if (!dc_pred_dir) // top
block[v->zz_8x8[2][i++]] = value;
else // left
i += skip;
if (i > 63)
break;
- if (!v->interlace)
+ if (!v->fcm)
idx = v->zz_8x8[0][i++];
else
idx = v->zzi_8x8[i++];
i += skip;
if (i > 15)
break;
- if (!v->interlace)
+ if (!v->fcm)
idx = ff_vc1_simple_progressive_4x4_zz[i++];
else
idx = ff_vc1_adv_interlaced_4x4_zz[i++];
i += skip;
if (i > 31)
break;
- if (!v->interlace)
+ if (!v->fcm)
idx = v->zz_8x4[i++] + off;
else
idx = ff_vc1_adv_interlaced_8x4_zz[i++] + off;
i += skip;
if (i > 31)
break;
- if (!v->interlace)
+ if (!v->fcm)
idx = v->zz_4x8[i++] + off;
else
idx = ff_vc1_adv_interlaced_4x8_zz[i++] + off;
vc1_apply_p_v_loop_filter(v, i);
}
- /* V always preceedes H, therefore we run H one MB before V;
+ /* V always precedes H, therefore we run H one MB before V;
* at the end of a row, we catch up to complete the row */
if (s->mb_x) {
for (i = 0; i < 6; i++) {
int skipped, fourmv;
int block_cbp = 0, pat, block_tt = 0, block_intra = 0;
- mquant = v->pq; /* Loosy initialization */
+ mquant = v->pq; /* lossy initialization */
if (v->mv_type_is_raw)
fourmv = get_bits1(gb);
int dmv_x[2], dmv_y[2];
int bmvtype = BMV_TYPE_BACKWARD;
- mquant = v->pq; /* Loosy initialization */
+ mquant = v->pq; /* lossy initialization */
s->mb_intra = 0;
if (v->dmb_is_raw)
for (; s->mb_x < s->mb_width; s->mb_x++) {
ff_update_block_index(s);
- if (v->fcm == 2)
+ if (v->fcm == ILACE_FIELD)
vc1_decode_p_mb_intfi(v);
- else if (v->fcm == 1)
+ else if (v->fcm == ILACE_FRAME)
vc1_decode_p_mb_intfr(v);
else vc1_decode_p_mb(v);
- if (s->mb_y != s->start_mb_y && apply_loop_filter && v->fcm == 0)
+ if (s->mb_y != s->start_mb_y && apply_loop_filter && v->fcm == PROGRESSIVE)
vc1_apply_p_loop_filter(v);
if (get_bits_count(&s->gb) > v->bits || get_bits_count(&s->gb) < 0) {
// TODO: may need modification to handle slice coding
for (; s->mb_x < s->mb_width; s->mb_x++) {
ff_update_block_index(s);
- if (v->fcm == 2)
+ if (v->fcm == ILACE_FIELD)
vc1_decode_b_mb_intfi(v);
else
vc1_decode_b_mb(v);