aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/rv34.c
diff options
context:
space:
mode:
authorKostya Shishkov <kostya.shishkov@gmail.com>2011-08-09 11:00:09 +0200
committerRonald S. Bultje <rsbultje@gmail.com>2011-08-11 16:07:15 -0700
commitd241f51e0f7c08060d2fa72117e2a1f273ab0c72 (patch)
tree59716c878cbf5be19e11f5c7833818f8e1a83bc4 /libavcodec/rv34.c
parent21d70372341d0e7a1c5ac34c4522850f40c503d5 (diff)
downloadffmpeg-d241f51e0f7c08060d2fa72117e2a1f273ab0c72.tar.gz
Move RV3/4-specific DSP functions into their own context
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
Diffstat (limited to 'libavcodec/rv34.c')
-rw-r--r--libavcodec/rv34.c39
1 files changed, 19 insertions, 20 deletions
diff --git a/libavcodec/rv34.c b/libavcodec/rv34.c
index f9773cdc45..f8192a8f8f 100644
--- a/libavcodec/rv34.c
+++ b/libavcodec/rv34.c
@@ -809,24 +809,18 @@ static void rv34_mc_1mv(RV34DecContext *r, const int block_type,
const int width, const int height, int dir)
{
rv34_mc(r, block_type, xoff, yoff, mv_off, width, height, dir, r->rv30,
- r->rv30 ? r->s.dsp.put_rv30_tpel_pixels_tab
- : r->s.dsp.put_rv40_qpel_pixels_tab,
- r->rv30 ? r->s.dsp.put_h264_chroma_pixels_tab
- : r->s.dsp.put_rv40_chroma_pixels_tab);
+ r->rdsp.put_pixels_tab,
+ r->rdsp.put_chroma_pixels_tab);
}
static void rv34_mc_2mv(RV34DecContext *r, const int block_type)
{
rv34_mc(r, block_type, 0, 0, 0, 2, 2, 0, r->rv30,
- r->rv30 ? r->s.dsp.put_rv30_tpel_pixels_tab
- : r->s.dsp.put_rv40_qpel_pixels_tab,
- r->rv30 ? r->s.dsp.put_h264_chroma_pixels_tab
- : r->s.dsp.put_rv40_chroma_pixels_tab);
+ r->rdsp.put_pixels_tab,
+ r->rdsp.put_chroma_pixels_tab);
rv34_mc(r, block_type, 0, 0, 0, 2, 2, 1, r->rv30,
- r->rv30 ? r->s.dsp.avg_rv30_tpel_pixels_tab
- : r->s.dsp.avg_rv40_qpel_pixels_tab,
- r->rv30 ? r->s.dsp.avg_h264_chroma_pixels_tab
- : r->s.dsp.avg_rv40_chroma_pixels_tab);
+ r->rdsp.avg_pixels_tab,
+ r->rdsp.avg_chroma_pixels_tab);
}
static void rv34_mc_2mv_skip(RV34DecContext *r)
@@ -835,15 +829,11 @@ static void rv34_mc_2mv_skip(RV34DecContext *r)
for(j = 0; j < 2; j++)
for(i = 0; i < 2; i++){
rv34_mc(r, RV34_MB_P_8x8, i*8, j*8, i+j*r->s.b8_stride, 1, 1, 0, r->rv30,
- r->rv30 ? r->s.dsp.put_rv30_tpel_pixels_tab
- : r->s.dsp.put_rv40_qpel_pixels_tab,
- r->rv30 ? r->s.dsp.put_h264_chroma_pixels_tab
- : r->s.dsp.put_rv40_chroma_pixels_tab);
+ r->rdsp.put_pixels_tab,
+ r->rdsp.put_chroma_pixels_tab);
rv34_mc(r, RV34_MB_P_8x8, i*8, j*8, i+j*r->s.b8_stride, 1, 1, 1, r->rv30,
- r->rv30 ? r->s.dsp.avg_rv30_tpel_pixels_tab
- : r->s.dsp.avg_rv40_qpel_pixels_tab,
- r->rv30 ? r->s.dsp.avg_h264_chroma_pixels_tab
- : r->s.dsp.avg_rv40_chroma_pixels_tab);
+ r->rdsp.avg_pixels_tab,
+ r->rdsp.avg_chroma_pixels_tab);
}
}
@@ -1363,6 +1353,15 @@ av_cold int ff_rv34_decode_init(AVCodecContext *avctx)
ff_h264_pred_init(&r->h, CODEC_ID_RV40, 8);
+#if CONFIG_RV30_DECODER
+ if (avctx->codec_id == CODEC_ID_RV30)
+ ff_rv30dsp_init(&r->rdsp, &r->s.dsp);
+#endif
+#if CONFIG_RV40_DECODER
+ if (avctx->codec_id == CODEC_ID_RV40)
+ ff_rv40dsp_init(&r->rdsp, &r->s.dsp);
+#endif
+
r->intra_types_stride = 4*s->mb_stride + 4;
r->intra_types_hist = av_malloc(r->intra_types_stride * 4 * 2 * sizeof(*r->intra_types_hist));
r->intra_types = r->intra_types_hist + r->intra_types_stride * 4;