summaryrefslogtreecommitdiff
path: root/libavcodec/vc1dec.c
diff options
context:
space:
mode:
authorRonald S. Bultje <rbultje@gmail.com>2013-10-14 03:13:10 +0200
committerLuca Barbato <lu_zero@gentoo.org>2013-11-15 10:16:27 +0100
commit458446acfa1441d283dacf9e6e545beb083b8bb0 (patch)
tree49178dd81fe5208c996c942fb0c7e7a08f2e51db /libavcodec/vc1dec.c
parent3cbe1126530449336e2ce59b194bdb8c4eb4abb4 (diff)
downloadffmpeg-458446acfa1441d283dacf9e6e545beb083b8bb0.tar.gz
lavc: Edge emulation with dst/src linesize
Allow supporting files for which the image stride is smaller than the maximum block size + number of subpel mc taps, e.g. a 64x64 VP9 file or a 16x16 VP8 file with -fflags +emu_edge.
Diffstat (limited to 'libavcodec/vc1dec.c')
-rw-r--r--libavcodec/vc1dec.c37
1 files changed, 26 insertions, 11 deletions
diff --git a/libavcodec/vc1dec.c b/libavcodec/vc1dec.c
index 231f42567e..0f22ebe081 100644
--- a/libavcodec/vc1dec.c
+++ b/libavcodec/vc1dec.c
@@ -452,14 +452,19 @@ static void vc1_mc_1mv(VC1Context *v, int dir)
uint8_t *uvbuf = s->edge_emu_buffer + 19 * s->linesize;
srcY -= s->mspel * (1 + s->linesize);
- s->vdsp.emulated_edge_mc(s->edge_emu_buffer, srcY, s->linesize,
+ s->vdsp.emulated_edge_mc(s->edge_emu_buffer, srcY,
+ s->linesize, s->linesize,
17 + s->mspel * 2, 17 + s->mspel * 2,
src_x - s->mspel, src_y - s->mspel,
s->h_edge_pos, v_edge_pos);
srcY = s->edge_emu_buffer;
- s->vdsp.emulated_edge_mc(uvbuf , srcU, s->uvlinesize, 8 + 1, 8 + 1,
+ s->vdsp.emulated_edge_mc(uvbuf, srcU,
+ s->uvlinesize, s->uvlinesize,
+ 8 + 1, 8 + 1,
uvsrc_x, uvsrc_y, s->h_edge_pos >> 1, v_edge_pos >> 1);
- s->vdsp.emulated_edge_mc(uvbuf + 16, srcV, s->uvlinesize, 8 + 1, 8 + 1,
+ s->vdsp.emulated_edge_mc(uvbuf + 16, srcV,
+ s->uvlinesize, s->uvlinesize,
+ 8 + 1, 8 + 1,
uvsrc_x, uvsrc_y, s->h_edge_pos >> 1, v_edge_pos >> 1);
srcU = uvbuf;
srcV = uvbuf + 16;
@@ -693,7 +698,8 @@ static void vc1_mc_4mv_luma(VC1Context *v, int n, int dir, int avg)
|| (unsigned)(src_y - (s->mspel << fieldmv)) > v_edge_pos - (my & 3) - ((8 + s->mspel * 2) << fieldmv)) {
srcY -= s->mspel * (1 + (s->linesize << fieldmv));
/* check emulate edge stride and offset */
- s->vdsp.emulated_edge_mc(s->edge_emu_buffer, srcY, s->linesize,
+ s->vdsp.emulated_edge_mc(s->edge_emu_buffer, srcY,
+ s->linesize, s->linesize,
9 + s->mspel * 2, (9 + s->mspel * 2) << fieldmv,
src_x - s->mspel, src_y - (s->mspel << fieldmv),
s->h_edge_pos, v_edge_pos);
@@ -908,10 +914,12 @@ static void vc1_mc_4mv_chroma(VC1Context *v, int dir)
|| s->h_edge_pos < 18 || v_edge_pos < 18
|| (unsigned)uvsrc_x > (s->h_edge_pos >> 1) - 9
|| (unsigned)uvsrc_y > (v_edge_pos >> 1) - 9) {
- s->vdsp.emulated_edge_mc(s->edge_emu_buffer , srcU, s->uvlinesize,
+ s->vdsp.emulated_edge_mc(s->edge_emu_buffer, srcU,
+ s->uvlinesize, s->uvlinesize,
8 + 1, 8 + 1, uvsrc_x, uvsrc_y,
s->h_edge_pos >> 1, v_edge_pos >> 1);
- s->vdsp.emulated_edge_mc(s->edge_emu_buffer + 16, srcV, s->uvlinesize,
+ s->vdsp.emulated_edge_mc(s->edge_emu_buffer + 16, srcV,
+ s->uvlinesize, s->uvlinesize,
8 + 1, 8 + 1, uvsrc_x, uvsrc_y,
s->h_edge_pos >> 1, v_edge_pos >> 1);
srcU = s->edge_emu_buffer;
@@ -1024,10 +1032,12 @@ static void vc1_mc_4mv_chroma4(VC1Context *v, int dir, int dir2, int avg)
|| s->h_edge_pos < 10 || v_edge_pos < (5 << fieldmv)
|| (unsigned)uvsrc_x > (s->h_edge_pos >> 1) - 5
|| (unsigned)uvsrc_y > v_edge_pos - (5 << fieldmv)) {
- s->vdsp.emulated_edge_mc(s->edge_emu_buffer, srcU, s->uvlinesize,
+ s->vdsp.emulated_edge_mc(s->edge_emu_buffer, srcU,
+ s->uvlinesize, s->uvlinesize,
5, (5 << fieldmv), uvsrc_x, uvsrc_y,
s->h_edge_pos >> 1, v_edge_pos);
- s->vdsp.emulated_edge_mc(s->edge_emu_buffer + 16, srcV, s->uvlinesize,
+ s->vdsp.emulated_edge_mc(s->edge_emu_buffer + 16, srcV,
+ s->uvlinesize, s->uvlinesize,
5, (5 << fieldmv), uvsrc_x, uvsrc_y,
s->h_edge_pos >> 1, v_edge_pos);
srcU = s->edge_emu_buffer;
@@ -1955,14 +1965,19 @@ static void vc1_interp_mc(VC1Context *v)
uint8_t *uvbuf = s->edge_emu_buffer + 19 * s->linesize;
srcY -= s->mspel * (1 + s->linesize);
- s->vdsp.emulated_edge_mc(s->edge_emu_buffer, srcY, s->linesize,
+ s->vdsp.emulated_edge_mc(s->edge_emu_buffer, srcY,
+ s->linesize, s->linesize,
17 + s->mspel * 2, 17 + s->mspel * 2,
src_x - s->mspel, src_y - s->mspel,
s->h_edge_pos, v_edge_pos);
srcY = s->edge_emu_buffer;
- s->vdsp.emulated_edge_mc(uvbuf , srcU, s->uvlinesize, 8 + 1, 8 + 1,
+ s->vdsp.emulated_edge_mc(uvbuf, srcU,
+ s->uvlinesize, s->uvlinesize,
+ 8 + 1, 8 + 1,
uvsrc_x, uvsrc_y, s->h_edge_pos >> 1, v_edge_pos >> 1);
- s->vdsp.emulated_edge_mc(uvbuf + 16, srcV, s->uvlinesize, 8 + 1, 8 + 1,
+ s->vdsp.emulated_edge_mc(uvbuf + 16, srcV,
+ s->uvlinesize, s->uvlinesize,
+ 8 + 1, 8 + 1,
uvsrc_x, uvsrc_y, s->h_edge_pos >> 1, v_edge_pos >> 1);
srcU = uvbuf;
srcV = uvbuf + 16;