diff options
author | Ronald S. Bultje <rsbultje@gmail.com> | 2013-09-20 08:01:19 -0400 |
---|---|---|
committer | Ronald S. Bultje <rsbultje@gmail.com> | 2013-09-28 20:28:08 -0400 |
commit | face578d56c2d1375e40d5e2a28acc122132bc55 (patch) | |
tree | 8a4fe63c8066b59ea41dd09285b4a82587a65030 /libavcodec/vc1dec.c | |
parent | f574b4da567cc1c175ab5463fb5b3901cbaa5595 (diff) | |
download | ffmpeg-face578d56c2d1375e40d5e2a28acc122132bc55.tar.gz |
Rewrite emu_edge functions to have separate src/dst_stride arguments.
This allows supporting files for which the image stride is smaller than
the max. 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.c | 47 |
1 files changed, 26 insertions, 21 deletions
diff --git a/libavcodec/vc1dec.c b/libavcodec/vc1dec.c index 439d68eee9..399e0d2264 100644 --- a/libavcodec/vc1dec.c +++ b/libavcodec/vc1dec.c @@ -454,15 +454,18 @@ 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, s->linesize, + srcY, 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, - 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, - uvsrc_x, uvsrc_y, s->h_edge_pos >> 1, v_edge_pos >> 1); + s->vdsp.emulated_edge_mc(uvbuf, s->uvlinesize, srcU, 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, s->uvlinesize, srcV, s->uvlinesize, + 8 + 1, 8 + 1, uvsrc_x, uvsrc_y, + s->h_edge_pos >> 1, v_edge_pos >> 1); srcU = uvbuf; srcV = uvbuf + 16; /* if we deal with range reduction we need to scale source blocks */ @@ -697,7 +700,7 @@ 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, s->linesize, srcY, 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); @@ -912,11 +915,11 @@ 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, - 8 + 1, 8 + 1, uvsrc_x, uvsrc_y, + s->vdsp.emulated_edge_mc(s->edge_emu_buffer, s->uvlinesize, srcU, + 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, - 8 + 1, 8 + 1, uvsrc_x, uvsrc_y, + s->vdsp.emulated_edge_mc(s->edge_emu_buffer + 16, s->uvlinesize, srcV, + s->uvlinesize, 8 + 1, 8 + 1, uvsrc_x, uvsrc_y, s->h_edge_pos >> 1, v_edge_pos >> 1); srcU = s->edge_emu_buffer; srcV = s->edge_emu_buffer + 16; @@ -1033,12 +1036,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, - 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, - 5, (5 << fieldmv), uvsrc_x, uvsrc_y, - s->h_edge_pos >> 1, v_edge_pos); + s->vdsp.emulated_edge_mc(s->edge_emu_buffer, s->uvlinesize, srcU, + 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, s->uvlinesize, srcV, + s->uvlinesize, 5, (5 << fieldmv), uvsrc_x, + uvsrc_y, s->h_edge_pos >> 1, v_edge_pos); srcU = s->edge_emu_buffer; srcV = s->edge_emu_buffer + 16; @@ -1966,15 +1969,17 @@ 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, s->linesize, srcY, 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, - 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, - uvsrc_x, uvsrc_y, s->h_edge_pos >> 1, v_edge_pos >> 1); + s->vdsp.emulated_edge_mc(uvbuf, s->uvlinesize, srcU, 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, s->uvlinesize, srcV, s->uvlinesize, + 8 + 1, 8 + 1, uvsrc_x, uvsrc_y, + s->h_edge_pos >> 1, v_edge_pos >> 1); srcU = uvbuf; srcV = uvbuf + 16; /* if we deal with range reduction we need to scale source blocks */ |