libavcodec/rv34dsp.h
Go to the documentation of this file.
00001 /*
00002  * RV30/40 decoder motion compensation functions
00003  * Copyright (c) 2008 Konstantin Shishkov
00004  *
00005  * This file is part of Libav.
00006  *
00007  * Libav is free software; you can redistribute it and/or
00008  * modify it under the terms of the GNU Lesser General Public
00009  * License as published by the Free Software Foundation; either
00010  * version 2.1 of the License, or (at your option) any later version.
00011  *
00012  * Libav is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015  * Lesser General Public License for more details.
00016  *
00017  * You should have received a copy of the GNU Lesser General Public
00018  * License along with Libav; if not, write to the Free Software
00019  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
00020  */
00021 
00027 #ifndef AVCODEC_RV34DSP_H
00028 #define AVCODEC_RV34DSP_H
00029 
00030 #include "dsputil.h"
00031 
00032 typedef void (*rv40_weight_func)(uint8_t *dst/*align width (8 or 16)*/,
00033                                  uint8_t *src1/*align width (8 or 16)*/,
00034                                  uint8_t *src2/*align width (8 or 16)*/,
00035                                  int w1, int w2, int stride);
00036 
00037 typedef void (*rv34_inv_transform_func)(DCTELEM *block);
00038 
00039 typedef void (*rv34_idct_add_func)(uint8_t *dst, int stride, DCTELEM *block);
00040 typedef void (*rv34_idct_dc_add_func)(uint8_t *dst, int stride,
00041                                       int   dc);
00042 
00043 typedef void (*rv40_weak_loop_filter_func)(uint8_t *src, int stride,
00044                                            int filter_p1, int filter_q1,
00045                                            int alpha, int beta,
00046                                            int lims, int lim_q1, int lim_p1);
00047 
00048 typedef void (*rv40_strong_loop_filter_func)(uint8_t *src, int stride,
00049                                              int alpha, int lims,
00050                                              int dmode, int chroma);
00051 
00052 typedef int (*rv40_loop_filter_strength_func)(uint8_t *src, int stride,
00053                                               int beta, int beta2, int edge,
00054                                               int *p1, int *q1);
00055 
00056 typedef struct RV34DSPContext {
00057     qpel_mc_func put_pixels_tab[4][16];
00058     qpel_mc_func avg_pixels_tab[4][16];
00059     h264_chroma_mc_func put_chroma_pixels_tab[3];
00060     h264_chroma_mc_func avg_chroma_pixels_tab[3];
00061     rv40_weight_func rv40_weight_pixels_tab[2];
00062     rv34_inv_transform_func rv34_inv_transform;
00063     rv34_inv_transform_func rv34_inv_transform_dc;
00064     rv34_idct_add_func rv34_idct_add;
00065     rv34_idct_dc_add_func rv34_idct_dc_add;
00066     rv40_weak_loop_filter_func rv40_weak_loop_filter[2];
00067     rv40_strong_loop_filter_func rv40_strong_loop_filter[2];
00068     rv40_loop_filter_strength_func rv40_loop_filter_strength[2];
00069 } RV34DSPContext;
00070 
00071 void ff_rv30dsp_init(RV34DSPContext *c, DSPContext* dsp);
00072 void ff_rv34dsp_init(RV34DSPContext *c, DSPContext* dsp);
00073 void ff_rv40dsp_init(RV34DSPContext *c, DSPContext* dsp);
00074 
00075 void ff_rv34dsp_init_neon(RV34DSPContext *c, DSPContext *dsp);
00076 void ff_rv34dsp_init_x86(RV34DSPContext *c, DSPContext *dsp);
00077 
00078 void ff_rv40dsp_init_x86(RV34DSPContext *c, DSPContext *dsp);
00079 void ff_rv40dsp_init_neon(RV34DSPContext *c, DSPContext *dsp);
00080 
00081 #endif /* AVCODEC_RV34DSP_H */