aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-05-15 20:09:20 +0200
committerMichael Niedermayer <michaelni@gmx.at>2013-05-15 20:09:20 +0200
commite3c24f663ea795c5455301d5f00e46ca455e7afb (patch)
treefa719d8ed76011266829f3a5c954224ab41842fd /libavcodec
parentc45b823bf80fdb5dd6dedb67cd56935b83c17ba5 (diff)
parent225a5f91cc83f684e948d3c23ce5e5de0c041ecb (diff)
downloadffmpeg-e3c24f663ea795c5455301d5f00e46ca455e7afb.tar.gz
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: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/mss2.c2
-rw-r--r--libavcodec/vc1.c2
-rw-r--r--libavcodec/vc1dec.c39
3 files changed, 19 insertions, 24 deletions
diff --git a/libavcodec/mss2.c b/libavcodec/mss2.c
index fcdbbd2562..54b9fb5f80 100644
--- a/libavcodec/mss2.c
+++ b/libavcodec/mss2.c
@@ -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;
}
diff --git a/libavcodec/vc1.c b/libavcodec/vc1.c
index f039d722e7..818e8d3c0d 100644
--- a/libavcodec/vc1.c
+++ b/libavcodec/vc1.c
@@ -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;
diff --git a/libavcodec/vc1dec.c b/libavcodec/vc1dec.c
index 3fbbeaefb0..4cdf470969 100644
--- a/libavcodec/vc1dec.c
+++ b/libavcodec/vc1dec.c
@@ -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);