summaryrefslogtreecommitdiffstats
path: root/libavcodec/h264.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-12-21 17:18:43 +0100
committerMichael Niedermayer <michaelni@gmx.at>2012-12-21 17:18:43 +0100
commita41bf09d9c56215448f14fb086c9f882eb41ecac (patch)
tree541da01619d95763ff0ee46ae0df50125505b3c4 /libavcodec/h264.c
parentfb3f28ee289b9ea5106d5a7fa00a1018eb379e65 (diff)
parent6906b19346ae8a330bfaa1c16ce535be10789723 (diff)
downloadffmpeg-streaming-a41bf09d9c56215448f14fb086c9f882eb41ecac.zip
ffmpeg-streaming-a41bf09d9c56215448f14fb086c9f882eb41ecac.tar.gz
Merge commit '6906b19346ae8a330bfaa1c16ce535be10789723'
* commit '6906b19346ae8a330bfaa1c16ce535be10789723': lavc: add missing files for arm lavc: introduce VideoDSPContext Conflicts: configure libavcodec/arm/dsputil_init_armv5te.c libavcodec/dsputil.c libavcodec/dsputil.h libavcodec/dsputil_template.c libavcodec/h264.c libavcodec/mpegvideo.h libavcodec/mpegvideo_enc.c libavcodec/x86/dsputil_mmx.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/h264.c')
-rw-r--r--libavcodec/h264.c56
1 files changed, 29 insertions, 27 deletions
diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index a312325..3bd840d 100644
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
@@ -505,11 +505,11 @@ static av_always_inline void mc_dir_part(H264Context *h, Picture *pic,
full_my < 0 - extra_height ||
full_mx + 16 /*FIXME*/ > pic_width + extra_width ||
full_my + 16 /*FIXME*/ > pic_height + extra_height) {
- s->dsp.emulated_edge_mc(s->edge_emu_buffer,
- src_y - (2 << pixel_shift) - 2 * h->mb_linesize,
- h->mb_linesize,
- 16 + 5, 16 + 5 /*FIXME*/, full_mx - 2,
- full_my - 2, pic_width, pic_height);
+ s->vdsp.emulated_edge_mc(s->edge_emu_buffer,
+ src_y - (2 << pixel_shift) - 2 * h->mb_linesize,
+ h->mb_linesize,
+ 16 + 5, 16 + 5 /*FIXME*/, full_mx - 2,
+ full_my - 2, pic_width, pic_height);
src_y = s->edge_emu_buffer + (2 << pixel_shift) + 2 * h->mb_linesize;
emu = 1;
}
@@ -524,12 +524,12 @@ static av_always_inline void mc_dir_part(H264Context *h, Picture *pic,
if (chroma_idc == 3 /* yuv444 */) {
src_cb = pic->f.data[1] + offset;
if (emu) {
- s->dsp.emulated_edge_mc(s->edge_emu_buffer,
- src_cb - (2 << pixel_shift) - 2 * h->mb_linesize,
- h->mb_linesize,
- 16 + 5, 16 + 5 /*FIXME*/,
- full_mx - 2, full_my - 2,
- pic_width, pic_height);
+ s->vdsp.emulated_edge_mc(s->edge_emu_buffer,
+ src_cb - (2 << pixel_shift) - 2 * h->mb_linesize,
+ h->mb_linesize,
+ 16 + 5, 16 + 5 /*FIXME*/,
+ full_mx - 2, full_my - 2,
+ pic_width, pic_height);
src_cb = s->edge_emu_buffer + (2 << pixel_shift) + 2 * h->mb_linesize;
}
qpix_op[luma_xy](dest_cb, src_cb, h->mb_linesize); // FIXME try variable height perhaps?
@@ -538,12 +538,12 @@ static av_always_inline void mc_dir_part(H264Context *h, Picture *pic,
src_cr = pic->f.data[2] + offset;
if (emu) {
- s->dsp.emulated_edge_mc(s->edge_emu_buffer,
- src_cr - (2 << pixel_shift) - 2 * h->mb_linesize,
- h->mb_linesize,
- 16 + 5, 16 + 5 /*FIXME*/,
- full_mx - 2, full_my - 2,
- pic_width, pic_height);
+ s->vdsp.emulated_edge_mc(s->edge_emu_buffer,
+ src_cr - (2 << pixel_shift) - 2 * h->mb_linesize,
+ h->mb_linesize,
+ 16 + 5, 16 + 5 /*FIXME*/,
+ full_mx - 2, full_my - 2,
+ pic_width, pic_height);
src_cr = s->edge_emu_buffer + (2 << pixel_shift) + 2 * h->mb_linesize;
}
qpix_op[luma_xy](dest_cr, src_cr, h->mb_linesize); // FIXME try variable height perhaps?
@@ -565,9 +565,9 @@ static av_always_inline void mc_dir_part(H264Context *h, Picture *pic,
(my >> ysh) * h->mb_uvlinesize;
if (emu) {
- s->dsp.emulated_edge_mc(s->edge_emu_buffer, src_cb, h->mb_uvlinesize,
- 9, 8 * chroma_idc + 1, (mx >> 3), (my >> ysh),
- pic_width >> 1, pic_height >> (chroma_idc == 1 /* yuv420 */));
+ s->vdsp.emulated_edge_mc(s->edge_emu_buffer, src_cb, h->mb_uvlinesize,
+ 9, 8 * chroma_idc + 1, (mx >> 3), (my >> ysh),
+ pic_width >> 1, pic_height >> (chroma_idc == 1 /* yuv420 */));
src_cb = s->edge_emu_buffer;
}
chroma_op(dest_cb, src_cb, h->mb_uvlinesize,
@@ -575,9 +575,9 @@ static av_always_inline void mc_dir_part(H264Context *h, Picture *pic,
mx & 7, (my << (chroma_idc == 2 /* yuv422 */)) & 7);
if (emu) {
- s->dsp.emulated_edge_mc(s->edge_emu_buffer, src_cr, h->mb_uvlinesize,
- 9, 8 * chroma_idc + 1, (mx >> 3), (my >> ysh),
- pic_width >> 1, pic_height >> (chroma_idc == 1 /* yuv420 */));
+ s->vdsp.emulated_edge_mc(s->edge_emu_buffer, src_cr, h->mb_uvlinesize,
+ 9, 8 * chroma_idc + 1, (mx >> 3), (my >> ysh),
+ pic_width >> 1, pic_height >> (chroma_idc == 1 /* yuv420 */));
src_cr = s->edge_emu_buffer;
}
chroma_op(dest_cr, src_cr, h->mb_uvlinesize, height >> (chroma_idc == 1 /* yuv420 */),
@@ -754,13 +754,13 @@ static av_always_inline void prefetch_motion(H264Context *h, int list,
int off = (mx << pixel_shift) +
(my + (s->mb_x & 3) * 4) * h->mb_linesize +
(64 << pixel_shift);
- s->dsp.prefetch(src[0] + off, s->linesize, 4);
+ s->vdsp.prefetch(src[0] + off, s->linesize, 4);
if (chroma_idc == 3 /* yuv444 */) {
- s->dsp.prefetch(src[1] + off, s->linesize, 4);
- s->dsp.prefetch(src[2] + off, s->linesize, 4);
+ s->vdsp.prefetch(src[1] + off, s->linesize, 4);
+ s->vdsp.prefetch(src[2] + off, s->linesize, 4);
} else {
off= (((mx>>1)+64)<<pixel_shift) + ((my>>1) + (s->mb_x&7))*s->uvlinesize;
- s->dsp.prefetch(src[1] + off, src[2] - src[1], 2);
+ s->vdsp.prefetch(src[1] + off, src[2] - src[1], 2);
}
}
}
@@ -996,6 +996,7 @@ static av_cold void common_init(H264Context *h)
s->dsp.dct_bits = 16;
/* needed so that IDCT permutation is known early */
ff_dsputil_init(&s->dsp, s->avctx);
+ ff_videodsp_init(&s->vdsp, 8);
memset(h->pps.scaling_matrix4, 16, 6 * 16 * sizeof(uint8_t));
memset(h->pps.scaling_matrix8, 16, 2 * 64 * sizeof(uint8_t));
@@ -2457,6 +2458,7 @@ static int h264_set_parameter_from_sps(H264Context *h)
h->sps.chroma_format_idc);
s->dsp.dct_bits = h->sps.bit_depth_luma > 8 ? 32 : 16;
ff_dsputil_init(&s->dsp, s->avctx);
+ ff_videodsp_init(&s->vdsp, h->sps.bit_depth_luma);
} else {
av_log(s->avctx, AV_LOG_ERROR, "Unsupported bit depth: %d\n",
h->sps.bit_depth_luma);
OpenPOWER on IntegriCloud