diff options
author | Anton Khirnov <anton@khirnov.net> | 2015-01-29 13:06:25 +0100 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2015-03-21 11:27:16 +0100 |
commit | c28ed1d743443e783537d279ae721be3bbdf7646 (patch) | |
tree | 9d9177a0fb4622a085b87c8732078c37342b4bf0 /libavcodec/svq3.c | |
parent | b53569e0681ff7bc99103ab4c961dbac3cc0fce6 (diff) | |
download | ffmpeg-c28ed1d743443e783537d279ae721be3bbdf7646.tar.gz |
h264: move [uv]linesize to the per-slice context
While it is a per-frame variable, it is only really used in the
low-level decoding code, so it is more efficient to store it in the
slice context.
Diffstat (limited to 'libavcodec/svq3.c')
-rw-r--r-- | libavcodec/svq3.c | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/libavcodec/svq3.c b/libavcodec/svq3.c index d28b2d2f19..00e7c89e8f 100644 --- a/libavcodec/svq3.c +++ b/libavcodec/svq3.c @@ -313,23 +313,23 @@ static inline void svq3_mc_dir_part(SVQ3Context *s, } /* form component predictions */ - dest = h->cur_pic.f.data[0] + x + y * h->linesize; - src = pic->f.data[0] + mx + my * h->linesize; + dest = h->cur_pic.f.data[0] + x + y * sl->linesize; + src = pic->f.data[0] + mx + my * sl->linesize; if (emu) { h->vdsp.emulated_edge_mc(sl->edge_emu_buffer, src, - h->linesize, h->linesize, + sl->linesize, sl->linesize, width + 1, height + 1, mx, my, s->h_edge_pos, s->v_edge_pos); src = sl->edge_emu_buffer; } if (thirdpel) (avg ? s->tdsp.avg_tpel_pixels_tab - : s->tdsp.put_tpel_pixels_tab)[dxy](dest, src, h->linesize, + : s->tdsp.put_tpel_pixels_tab)[dxy](dest, src, sl->linesize, width, height); else (avg ? s->hdsp.avg_pixels_tab - : s->hdsp.put_pixels_tab)[blocksize][dxy](dest, src, h->linesize, + : s->hdsp.put_pixels_tab)[blocksize][dxy](dest, src, sl->linesize, height); if (!(h->flags & CODEC_FLAG_GRAY)) { @@ -340,12 +340,12 @@ static inline void svq3_mc_dir_part(SVQ3Context *s, blocksize++; for (i = 1; i < 3; i++) { - dest = h->cur_pic.f.data[i] + (x >> 1) + (y >> 1) * h->uvlinesize; - src = pic->f.data[i] + mx + my * h->uvlinesize; + dest = h->cur_pic.f.data[i] + (x >> 1) + (y >> 1) * sl->uvlinesize; + src = pic->f.data[i] + mx + my * sl->uvlinesize; if (emu) { h->vdsp.emulated_edge_mc(sl->edge_emu_buffer, src, - h->uvlinesize, h->uvlinesize, + sl->uvlinesize, sl->uvlinesize, width + 1, height + 1, mx, my, (s->h_edge_pos >> 1), s->v_edge_pos >> 1); @@ -354,12 +354,12 @@ static inline void svq3_mc_dir_part(SVQ3Context *s, if (thirdpel) (avg ? s->tdsp.avg_tpel_pixels_tab : s->tdsp.put_tpel_pixels_tab)[dxy](dest, src, - h->uvlinesize, + sl->uvlinesize, width, height); else (avg ? s->hdsp.avg_pixels_tab : s->hdsp.put_pixels_tab)[blocksize][dxy](dest, src, - h->uvlinesize, + sl->uvlinesize, height); } } @@ -1101,8 +1101,8 @@ static int get_buffer(AVCodecContext *avctx, H264Picture *pic) return AVERROR(ENOMEM); } - h->linesize = pic->f.linesize[0]; - h->uvlinesize = pic->f.linesize[1]; + sl->linesize = pic->f.linesize[0]; + sl->uvlinesize = pic->f.linesize[1]; return 0; fail: @@ -1162,14 +1162,14 @@ static int svq3_decode_frame(AVCodecContext *avctx, void *data, return ret; for (i = 0; i < 16; i++) { - h->block_offset[i] = (4 * ((scan8[i] - scan8[0]) & 7)) + 4 * h->linesize * ((scan8[i] - scan8[0]) >> 3); - h->block_offset[48 + i] = (4 * ((scan8[i] - scan8[0]) & 7)) + 8 * h->linesize * ((scan8[i] - scan8[0]) >> 3); + h->block_offset[i] = (4 * ((scan8[i] - scan8[0]) & 7)) + 4 * sl->linesize * ((scan8[i] - scan8[0]) >> 3); + h->block_offset[48 + i] = (4 * ((scan8[i] - scan8[0]) & 7)) + 8 * sl->linesize * ((scan8[i] - scan8[0]) >> 3); } for (i = 0; i < 16; i++) { h->block_offset[16 + i] = - h->block_offset[32 + i] = (4 * ((scan8[i] - scan8[0]) & 7)) + 4 * h->uvlinesize * ((scan8[i] - scan8[0]) >> 3); + h->block_offset[32 + i] = (4 * ((scan8[i] - scan8[0]) & 7)) + 4 * sl->uvlinesize * ((scan8[i] - scan8[0]) >> 3); h->block_offset[48 + 16 + i] = - h->block_offset[48 + 32 + i] = (4 * ((scan8[i] - scan8[0]) & 7)) + 8 * h->uvlinesize * ((scan8[i] - scan8[0]) >> 3); + h->block_offset[48 + 32 + i] = (4 * ((scan8[i] - scan8[0]) & 7)) + 8 * sl->uvlinesize * ((scan8[i] - scan8[0]) >> 3); } if (h->pict_type != AV_PICTURE_TYPE_I) { |