Commit e3c24f66 authored by Michael Niedermayer's avatar Michael Niedermayer

Merge remote-tracking branch 'qatar/master'

* qatar/master:
  configure: Use linker hardening flags on mingw
  vc1: Make INIT_LUT() self contained
  vc1: Simplify code by using INIT_LUT()
  vc1: Move INIT_LUT() further up to allow using it in more places
  vc1dec: Remove some now unused variables
  vc1dec: Do not allow field_mode to change after the first header
  vc1, mss2: Check for any negative return value from ff_vc1_parse_frame_header
  vc1dec: Fix current ptr selection in vc1_mc_4mv_chroma()
  vc1dec: Factorize picture pointer selection in vc1_mc_4mv_chroma()
  vc1dec: Factorize picture pointer selection code
  vc1dec: Factorize srcU/V offseting
  vc1dec: Fix tff == 0 handling in init_block_index()
  vc1dec: Update destination pointers in context for fields

Conflicts:
	libavcodec/vc1.c
	libavcodec/vc1dec.c
Merged-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parents c45b823b 225a5f91
......@@ -3367,6 +3367,8 @@ case $target_os in
elif enabled arm; then
LIBTARGET=arm-wince
fi
check_ldflags -Wl,--nxcompat
check_ldflags -Wl,--dynamicbase
shlibdir_default="$bindir_default"
SLIBPREF=""
SLIBSUF=".dll"
......
......@@ -388,7 +388,7 @@ static int decode_wmv9(AVCodecContext *avctx, const uint8_t *buf, int buf_size,
s->loop_filter = avctx->skip_loop_filter < AVDISCARD_ALL;
if (ff_vc1_parse_frame_header(v, &s->gb) == -1) {
if (ff_vc1_parse_frame_header(v, &s->gb) < 0) {
av_log(v->s.avctx, AV_LOG_ERROR, "header error\n");
return AVERROR_INVALIDDATA;
}
......
......@@ -873,7 +873,7 @@ int ff_vc1_parse_frame_header_adv(VC1Context *v, GetBitContext* gb)
fcm = PROGRESSIVE;
}
if (!v->first_pic_header_flag && v->field_mode != field_mode)
return -1;
return AVERROR_INVALIDDATA;
v->field_mode = field_mode;
v->fcm = fcm;
......
......@@ -85,7 +85,6 @@ static void init_block_index(VC1Context *v)
}
}
/** @} */ //Bitplane group
static void vc1_put_signed_blocks_clamped(VC1Context *v)
......@@ -348,7 +347,6 @@ static void vc1_mc_1mv(VC1Context *v, int dir)
H264ChromaContext *h264chroma = &v->h264chroma;
uint8_t *srcY, *srcU, *srcV;
int dxy, mx, my, uvmx, uvmy, src_x, src_y, uvsrc_x, uvsrc_y;
int off, off_uv;
int v_edge_pos = s->v_edge_pos >> v->field_mode;
int i;
uint8_t (*luty)[256], (*lutuv)[256];
......@@ -514,21 +512,19 @@ static void vc1_mc_1mv(VC1Context *v, int dir)
srcY += s->mspel * (1 + s->linesize);
}
off = 0;
off_uv = 0;
if (s->mspel) {
dxy = ((my & 3) << 2) | (mx & 3);
v->vc1dsp.put_vc1_mspel_pixels_tab[dxy](s->dest[0] + off , srcY , s->linesize, v->rnd);
v->vc1dsp.put_vc1_mspel_pixels_tab[dxy](s->dest[0] + off + 8, srcY + 8, s->linesize, v->rnd);
v->vc1dsp.put_vc1_mspel_pixels_tab[dxy](s->dest[0] , srcY , s->linesize, v->rnd);
v->vc1dsp.put_vc1_mspel_pixels_tab[dxy](s->dest[0] + 8, srcY + 8, s->linesize, v->rnd);
srcY += s->linesize * 8;
v->vc1dsp.put_vc1_mspel_pixels_tab[dxy](s->dest[0] + off + 8 * s->linesize , srcY , s->linesize, v->rnd);
v->vc1dsp.put_vc1_mspel_pixels_tab[dxy](s->dest[0] + off + 8 * s->linesize + 8, srcY + 8, s->linesize, v->rnd);
v->vc1dsp.put_vc1_mspel_pixels_tab[dxy](s->dest[0] + 8 * s->linesize , srcY , s->linesize, v->rnd);
v->vc1dsp.put_vc1_mspel_pixels_tab[dxy](s->dest[0] + 8 * s->linesize + 8, srcY + 8, s->linesize, v->rnd);
} else { // hpel mc - always used for luma
dxy = (my & 2) | ((mx & 2) >> 1);
if (!v->rnd)
s->hdsp.put_pixels_tab[0][dxy](s->dest[0] + off, srcY, s->linesize, 16);
s->hdsp.put_pixels_tab[0][dxy](s->dest[0], srcY, s->linesize, 16);
else
s->hdsp.put_no_rnd_pixels_tab[0][dxy](s->dest[0] + off, srcY, s->linesize, 16);
s->hdsp.put_no_rnd_pixels_tab[0][dxy](s->dest[0], srcY, s->linesize, 16);
}
if (s->flags & CODEC_FLAG_GRAY) return;
......@@ -536,11 +532,11 @@ static void vc1_mc_1mv(VC1Context *v, int dir)
uvmx = (uvmx & 3) << 1;
uvmy = (uvmy & 3) << 1;
if (!v->rnd) {
h264chroma->put_h264_chroma_pixels_tab[0](s->dest[1] + off_uv, srcU, s->uvlinesize, 8, uvmx, uvmy);
h264chroma->put_h264_chroma_pixels_tab[0](s->dest[2] + off_uv, srcV, s->uvlinesize, 8, uvmx, uvmy);
h264chroma->put_h264_chroma_pixels_tab[0](s->dest[1], srcU, s->uvlinesize, 8, uvmx, uvmy);
h264chroma->put_h264_chroma_pixels_tab[0](s->dest[2], srcV, s->uvlinesize, 8, uvmx, uvmy);
} else {
v->vc1dsp.put_no_rnd_vc1_chroma_pixels_tab[0](s->dest[1] + off_uv, srcU, s->uvlinesize, 8, uvmx, uvmy);
v->vc1dsp.put_no_rnd_vc1_chroma_pixels_tab[0](s->dest[2] + off_uv, srcV, s->uvlinesize, 8, uvmx, uvmy);
v->vc1dsp.put_no_rnd_vc1_chroma_pixels_tab[0](s->dest[1], srcU, s->uvlinesize, 8, uvmx, uvmy);
v->vc1dsp.put_no_rnd_vc1_chroma_pixels_tab[0](s->dest[2], srcV, s->uvlinesize, 8, uvmx, uvmy);
}
}
......@@ -809,7 +805,7 @@ static void vc1_mc_4mv_chroma(VC1Context *v, int dir)
int k, tx = 0, ty = 0;
int mvx[4], mvy[4], intra[4], mv_f[4];
int valid_count;
int chroma_ref_type = v->cur_field_type, off = 0;
int chroma_ref_type = v->cur_field_type;
int v_edge_pos = s->v_edge_pos >> v->field_mode;
uint8_t (*lutuv)[256];
int use_ic;
......@@ -904,7 +900,6 @@ static void vc1_mc_4mv_chroma(VC1Context *v, int dir)
srcU += s->current_picture_ptr->f.linesize[1];
srcV += s->current_picture_ptr->f.linesize[2];
}
off = 0;
}
if (v->rangeredfrm || use_ic
......@@ -959,11 +954,11 @@ static void vc1_mc_4mv_chroma(VC1Context *v, int dir)
uvmx = (uvmx & 3) << 1;
uvmy = (uvmy & 3) << 1;
if (!v->rnd) {
h264chroma->put_h264_chroma_pixels_tab[0](s->dest[1] + off, srcU, s->uvlinesize, 8, uvmx, uvmy);
h264chroma->put_h264_chroma_pixels_tab[0](s->dest[2] + off, srcV, s->uvlinesize, 8, uvmx, uvmy);
h264chroma->put_h264_chroma_pixels_tab[0](s->dest[1], srcU, s->uvlinesize, 8, uvmx, uvmy);
h264chroma->put_h264_chroma_pixels_tab[0](s->dest[2], srcV, s->uvlinesize, 8, uvmx, uvmy);
} else {
v->vc1dsp.put_no_rnd_vc1_chroma_pixels_tab[0](s->dest[1] + off, srcU, s->uvlinesize, 8, uvmx, uvmy);
v->vc1dsp.put_no_rnd_vc1_chroma_pixels_tab[0](s->dest[2] + off, srcV, s->uvlinesize, 8, uvmx, uvmy);
v->vc1dsp.put_no_rnd_vc1_chroma_pixels_tab[0](s->dest[1], srcU, s->uvlinesize, 8, uvmx, uvmy);
v->vc1dsp.put_no_rnd_vc1_chroma_pixels_tab[0](s->dest[2], srcV, s->uvlinesize, 8, uvmx, uvmy);
}
}
......@@ -2023,8 +2018,8 @@ static void vc1_interp_mc(VC1Context *v)
srcY += s->mspel * (1 + s->linesize);
}
off = 0;
off_uv = 0;
off = 0;
off_uv = 0;
if (s->mspel) {
dxy = ((my & 3) << 2) | (mx & 3);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment