diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2015-06-08 20:58:13 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2015-06-08 21:05:12 +0200 |
commit | db8ae37a783aba18d8f869dae1824a3e3f984bf8 (patch) | |
tree | 280cfe9fdd15922660e34052e0dce0e93ab335c5 /libavcodec/mpegvideo_motion.c | |
parent | 34d278f9838e355b3b2c7a9c0f77d7fcaf37ce49 (diff) | |
parent | da0c8664b4dc906696803685f7e53ade68594ab8 (diff) | |
download | ffmpeg-db8ae37a783aba18d8f869dae1824a3e3f984bf8.tar.gz |
Merge commit 'da0c8664b4dc906696803685f7e53ade68594ab8'
* commit 'da0c8664b4dc906696803685f7e53ade68594ab8':
mpegvideo: Move various temporary buffers to a separate context
Conflicts:
libavcodec/mpegvideo.c
libavcodec/mpegvideo_enc.c
libavcodec/mpegvideo_motion.c
libavcodec/rv34.c
libavcodec/vc1_mc.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/mpegvideo_motion.c')
-rw-r--r-- | libavcodec/mpegvideo_motion.c | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/libavcodec/mpegvideo_motion.c b/libavcodec/mpegvideo_motion.c index 060f3f25b1..f1956f0e73 100644 --- a/libavcodec/mpegvideo_motion.c +++ b/libavcodec/mpegvideo_motion.c @@ -64,12 +64,12 @@ static void gmc1_motion(MpegEncContext *s, if ((unsigned)src_x >= FFMAX(s->h_edge_pos - 17, 0) || (unsigned)src_y >= FFMAX(s->v_edge_pos - 17, 0)) { - s->vdsp.emulated_edge_mc(s->edge_emu_buffer, ptr, + s->vdsp.emulated_edge_mc(s->sc.edge_emu_buffer, ptr, linesize, linesize, 17, 17, src_x, src_y, s->h_edge_pos, s->v_edge_pos); - ptr = s->edge_emu_buffer; + ptr = s->sc.edge_emu_buffer; } if ((motion_x | motion_y) & 7) { @@ -108,12 +108,12 @@ static void gmc1_motion(MpegEncContext *s, ptr = ref_picture[1] + offset; if ((unsigned)src_x >= FFMAX((s->h_edge_pos >> 1) - 9, 0) || (unsigned)src_y >= FFMAX((s->v_edge_pos >> 1) - 9, 0)) { - s->vdsp.emulated_edge_mc(s->edge_emu_buffer, ptr, + s->vdsp.emulated_edge_mc(s->sc.edge_emu_buffer, ptr, uvlinesize, uvlinesize, 9, 9, src_x, src_y, s->h_edge_pos >> 1, s->v_edge_pos >> 1); - ptr = s->edge_emu_buffer; + ptr = s->sc.edge_emu_buffer; emu = 1; } s->mdsp.gmc1(dest_cb, ptr, uvlinesize, 8, @@ -121,12 +121,12 @@ static void gmc1_motion(MpegEncContext *s, ptr = ref_picture[2] + offset; if (emu) { - s->vdsp.emulated_edge_mc(s->edge_emu_buffer, ptr, + s->vdsp.emulated_edge_mc(s->sc.edge_emu_buffer, ptr, uvlinesize, uvlinesize, 9, 9, src_x, src_y, s->h_edge_pos >> 1, s->v_edge_pos >> 1); - ptr = s->edge_emu_buffer; + ptr = s->sc.edge_emu_buffer; } s->mdsp.gmc1(dest_cr, ptr, uvlinesize, 8, motion_x & 15, motion_y & 15, 128 - s->no_rounding); @@ -213,12 +213,12 @@ static inline int hpel_motion(MpegEncContext *s, if ((unsigned)src_x >= FFMAX(s->h_edge_pos - (motion_x & 1) - 7, 0) || (unsigned)src_y >= FFMAX(s->v_edge_pos - (motion_y & 1) - 7, 0)) { - s->vdsp.emulated_edge_mc(s->edge_emu_buffer, src, + s->vdsp.emulated_edge_mc(s->sc.edge_emu_buffer, src, s->linesize, s->linesize, 9, 9, src_x, src_y, s->h_edge_pos, s->v_edge_pos); - src = s->edge_emu_buffer; + src = s->sc.edge_emu_buffer; emu = 1; } pix_op[dxy](dest, src, s->linesize, 8); @@ -318,14 +318,14 @@ void mpeg_motion_internal(MpegEncContext *s, return; } src_y = (unsigned)src_y << field_based; - s->vdsp.emulated_edge_mc(s->edge_emu_buffer, ptr_y, + s->vdsp.emulated_edge_mc(s->sc.edge_emu_buffer, ptr_y, s->linesize, s->linesize, 17, 17 + field_based, src_x, src_y, s->h_edge_pos, s->v_edge_pos); - ptr_y = s->edge_emu_buffer; + ptr_y = s->sc.edge_emu_buffer; if (!CONFIG_GRAY || !(s->avctx->flags & CODEC_FLAG_GRAY)) { - uint8_t *ubuf = s->edge_emu_buffer + 18 * s->linesize; + uint8_t *ubuf = s->sc.edge_emu_buffer + 18 * s->linesize; uint8_t *vbuf = ubuf + 9 * s->uvlinesize; uvsrc_y = (unsigned)uvsrc_y << field_based; s->vdsp.emulated_edge_mc(ubuf, ptr_cb, @@ -478,7 +478,7 @@ static inline void obmc_motion(MpegEncContext *s, if (i && mv[i][0] == mv[MID][0] && mv[i][1] == mv[MID][1]) { ptr[i] = ptr[MID]; } else { - ptr[i] = s->obmc_scratchpad + 8 * (i & 1) + + ptr[i] = s->sc.obmc_scratchpad + 8 * (i & 1) + s->linesize * 8 * (i >> 1); hpel_motion(s, ptr[i], src, src_x, src_y, pix_op, mv[i][0], mv[i][1]); @@ -541,14 +541,14 @@ static inline void qpel_motion(MpegEncContext *s, if ((unsigned)src_x >= FFMAX(s->h_edge_pos - (motion_x & 3) - 15 , 0) || (unsigned)src_y >= FFMAX( v_edge_pos - (motion_y & 3) - h + 1, 0)) { - s->vdsp.emulated_edge_mc(s->edge_emu_buffer, ptr_y, + s->vdsp.emulated_edge_mc(s->sc.edge_emu_buffer, ptr_y, s->linesize, s->linesize, 17, 17 + field_based, src_x, src_y << field_based, s->h_edge_pos, s->v_edge_pos); - ptr_y = s->edge_emu_buffer; + ptr_y = s->sc.edge_emu_buffer; if (!CONFIG_GRAY || !(s->avctx->flags & CODEC_FLAG_GRAY)) { - uint8_t *ubuf = s->edge_emu_buffer + 18 * s->linesize; + uint8_t *ubuf = s->sc.edge_emu_buffer + 18 * s->linesize; uint8_t *vbuf = ubuf + 9 * s->uvlinesize; s->vdsp.emulated_edge_mc(ubuf, ptr_cb, s->uvlinesize, s->uvlinesize, @@ -625,22 +625,22 @@ static void chroma_4mv_motion(MpegEncContext *s, ptr = ref_picture[1] + offset; if ((unsigned)src_x >= FFMAX((s->h_edge_pos >> 1) - (dxy & 1) - 7, 0) || (unsigned)src_y >= FFMAX((s->v_edge_pos >> 1) - (dxy >> 1) - 7, 0)) { - s->vdsp.emulated_edge_mc(s->edge_emu_buffer, ptr, + s->vdsp.emulated_edge_mc(s->sc.edge_emu_buffer, ptr, s->uvlinesize, s->uvlinesize, 9, 9, src_x, src_y, s->h_edge_pos >> 1, s->v_edge_pos >> 1); - ptr = s->edge_emu_buffer; + ptr = s->sc.edge_emu_buffer; emu = 1; } pix_op[dxy](dest_cb, ptr, s->uvlinesize, 8); ptr = ref_picture[2] + offset; if (emu) { - s->vdsp.emulated_edge_mc(s->edge_emu_buffer, ptr, + s->vdsp.emulated_edge_mc(s->sc.edge_emu_buffer, ptr, s->uvlinesize, s->uvlinesize, 9, 9, src_x, src_y, s->h_edge_pos >> 1, s->v_edge_pos >> 1); - ptr = s->edge_emu_buffer; + ptr = s->sc.edge_emu_buffer; } pix_op[dxy](dest_cr, ptr, s->uvlinesize, 8); } @@ -783,13 +783,13 @@ static inline void apply_8x8(MpegEncContext *s, ptr = ref_picture[0] + (src_y * s->linesize) + (src_x); if ((unsigned)src_x >= FFMAX(s->h_edge_pos - (motion_x & 3) - 7, 0) || (unsigned)src_y >= FFMAX(s->v_edge_pos - (motion_y & 3) - 7, 0)) { - s->vdsp.emulated_edge_mc(s->edge_emu_buffer, ptr, + s->vdsp.emulated_edge_mc(s->sc.edge_emu_buffer, ptr, s->linesize, s->linesize, 9, 9, src_x, src_y, s->h_edge_pos, s->v_edge_pos); - ptr = s->edge_emu_buffer; + ptr = s->sc.edge_emu_buffer; } dest = dest_y + ((i & 1) * 8) + (i >> 1) * 8 * s->linesize; qpix_op[1][dxy](dest, ptr, s->linesize); |