diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-02-07 13:09:35 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-02-07 13:09:35 +0100 |
commit | c4e394e46008c9e208f666d156f49f7ba500d73a (patch) | |
tree | 4c70acf89ede1f9d24ec3056bb2d586f98a12bcd /libavcodec/vc1dec.c | |
parent | b5884db437eebe136efef63a8186b7b4b51b5525 (diff) | |
parent | 79dad2a932534d1155079f937649e099f9e5cc27 (diff) | |
download | ffmpeg-c4e394e46008c9e208f666d156f49f7ba500d73a.tar.gz |
Merge commit '79dad2a932534d1155079f937649e099f9e5cc27'
* commit '79dad2a932534d1155079f937649e099f9e5cc27':
dsputil: Separate h264chroma
Conflicts:
libavcodec/dsputil_template.c
libavcodec/ppc/dsputil_ppc.c
libavcodec/vc1dec.c
libavcodec/vc1dsp.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/vc1dec.c')
-rw-r--r-- | libavcodec/vc1dec.c | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/libavcodec/vc1dec.c b/libavcodec/vc1dec.c index 80eaca9e7c..013e96b107 100644 --- a/libavcodec/vc1dec.c +++ b/libavcodec/vc1dec.c @@ -31,6 +31,7 @@ #include "avcodec.h" #include "mpegvideo.h" #include "h263.h" +#include "h264chroma.h" #include "vc1.h" #include "vc1data.h" #include "vc1acdata.h" @@ -334,6 +335,7 @@ static void vc1_mc_1mv(VC1Context *v, int dir) { MpegEncContext *s = &v->s; DSPContext *dsp = &v->s.dsp; + H264ChromaContext *h264chroma = &v->h264chroma; uint8_t *srcY, *srcU, *srcV; int dxy, mx, my, uvmx, uvmy, src_x, src_y, uvsrc_x, uvsrc_y; int off, off_uv; @@ -525,8 +527,8 @@ static void vc1_mc_1mv(VC1Context *v, int dir) uvmx = (uvmx & 3) << 1; uvmy = (uvmy & 3) << 1; if (!v->rnd) { - dsp->put_h264_chroma_pixels_tab[0](s->dest[1] + off_uv, srcU, s->uvlinesize, 8, uvmx, uvmy); - dsp->put_h264_chroma_pixels_tab[0](s->dest[2] + off_uv, srcV, s->uvlinesize, 8, uvmx, uvmy); + h264chroma->put_h264_chroma_pixels_tab[0](s->dest[1] + off_uv, srcU, s->uvlinesize, 8, uvmx, uvmy); + h264chroma->put_h264_chroma_pixels_tab[0](s->dest[2] + off_uv, srcV, s->uvlinesize, 8, uvmx, uvmy); } else { v->vc1dsp.put_no_rnd_vc1_chroma_pixels_tab[0](s->dest[1] + off_uv, srcU, s->uvlinesize, 8, uvmx, uvmy); v->vc1dsp.put_no_rnd_vc1_chroma_pixels_tab[0](s->dest[2] + off_uv, srcV, s->uvlinesize, 8, uvmx, uvmy); @@ -780,7 +782,7 @@ static av_always_inline int get_chroma_mv(int *mvx, int *mvy, int *a, int flag, static void vc1_mc_4mv_chroma(VC1Context *v, int dir) { MpegEncContext *s = &v->s; - DSPContext *dsp = &v->s.dsp; + H264ChromaContext *h264chroma = &v->h264chroma; uint8_t *srcU, *srcV; int uvmx, uvmy, uvsrc_x, uvsrc_y; int k, tx = 0, ty = 0; @@ -932,8 +934,8 @@ static void vc1_mc_4mv_chroma(VC1Context *v, int dir) uvmx = (uvmx & 3) << 1; uvmy = (uvmy & 3) << 1; if (!v->rnd) { - dsp->put_h264_chroma_pixels_tab[0](s->dest[1] + off, srcU, s->uvlinesize, 8, uvmx, uvmy); - dsp->put_h264_chroma_pixels_tab[0](s->dest[2] + off, srcV, s->uvlinesize, 8, uvmx, uvmy); + h264chroma->put_h264_chroma_pixels_tab[0](s->dest[1] + off, srcU, s->uvlinesize, 8, uvmx, uvmy); + h264chroma->put_h264_chroma_pixels_tab[0](s->dest[2] + off, srcV, s->uvlinesize, 8, uvmx, uvmy); } else { v->vc1dsp.put_no_rnd_vc1_chroma_pixels_tab[0](s->dest[1] + off, srcU, s->uvlinesize, 8, uvmx, uvmy); v->vc1dsp.put_no_rnd_vc1_chroma_pixels_tab[0](s->dest[2] + off, srcV, s->uvlinesize, 8, uvmx, uvmy); @@ -945,7 +947,7 @@ static void vc1_mc_4mv_chroma(VC1Context *v, int dir) static void vc1_mc_4mv_chroma4(VC1Context *v) { MpegEncContext *s = &v->s; - DSPContext *dsp = &v->s.dsp; + H264ChromaContext *h264chroma = &v->h264chroma; uint8_t *srcU, *srcV; int uvsrc_x, uvsrc_y; int uvmx_field[4], uvmy_field[4]; @@ -1018,8 +1020,8 @@ static void vc1_mc_4mv_chroma4(VC1Context *v) } } if (!v->rnd) { - dsp->put_h264_chroma_pixels_tab[1](s->dest[1] + off, srcU, s->uvlinesize << fieldmv, 4, uvmx_field[i], uvmy_field[i]); - dsp->put_h264_chroma_pixels_tab[1](s->dest[2] + off, srcV, s->uvlinesize << fieldmv, 4, uvmx_field[i], uvmy_field[i]); + h264chroma->put_h264_chroma_pixels_tab[1](s->dest[1] + off, srcU, s->uvlinesize << fieldmv, 4, uvmx_field[i], uvmy_field[i]); + h264chroma->put_h264_chroma_pixels_tab[1](s->dest[2] + off, srcV, s->uvlinesize << fieldmv, 4, uvmx_field[i], uvmy_field[i]); } else { v->vc1dsp.put_no_rnd_vc1_chroma_pixels_tab[1](s->dest[1] + off, srcU, s->uvlinesize << fieldmv, 4, uvmx_field[i], uvmy_field[i]); v->vc1dsp.put_no_rnd_vc1_chroma_pixels_tab[1](s->dest[2] + off, srcV, s->uvlinesize << fieldmv, 4, uvmx_field[i], uvmy_field[i]); @@ -1848,6 +1850,7 @@ static void vc1_interp_mc(VC1Context *v) { MpegEncContext *s = &v->s; DSPContext *dsp = &v->s.dsp; + H264ChromaContext *h264chroma = &v->h264chroma; uint8_t *srcY, *srcU, *srcV; int dxy, mx, my, uvmx, uvmy, src_x, src_y, uvsrc_x, uvsrc_y; int off, off_uv; @@ -1977,8 +1980,8 @@ static void vc1_interp_mc(VC1Context *v) uvmx = (uvmx & 3) << 1; uvmy = (uvmy & 3) << 1; if (!v->rnd) { - dsp->avg_h264_chroma_pixels_tab[0](s->dest[1] + off_uv, srcU, s->uvlinesize, 8, uvmx, uvmy); - dsp->avg_h264_chroma_pixels_tab[0](s->dest[2] + off_uv, srcV, s->uvlinesize, 8, uvmx, uvmy); + h264chroma->avg_h264_chroma_pixels_tab[0](s->dest[1] + off_uv, srcU, s->uvlinesize, 8, uvmx, uvmy); + h264chroma->avg_h264_chroma_pixels_tab[0](s->dest[2] + off_uv, srcV, s->uvlinesize, 8, uvmx, uvmy); } else { v->vc1dsp.avg_no_rnd_vc1_chroma_pixels_tab[0](s->dest[1] + off_uv, srcU, s->uvlinesize, 8, uvmx, uvmy); v->vc1dsp.avg_no_rnd_vc1_chroma_pixels_tab[0](s->dest[2] + off_uv, srcV, s->uvlinesize, 8, uvmx, uvmy); @@ -5195,6 +5198,8 @@ static av_cold int vc1_decode_init(AVCodecContext *avctx) // again once we know all necessary settings. // That this is necessary might indicate a bug. ff_vc1_decode_end(avctx); + + ff_h264chroma_init(&v->h264chroma, 8); ff_vc1dsp_init(&v->vc1dsp); if (avctx->codec_id == AV_CODEC_ID_WMV3 || avctx->codec_id == AV_CODEC_ID_WMV3IMAGE) { |