1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-21 10:55:51 +02:00

libavcodec: Enable runtime detection for MIPS MMI & MSA

Apply optimized functions according to cpuflags.
MSA is usually put after MMI as it's generally faster than MMI.

Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Reviewed-by: Shiyou Yin <yinshiyou-hf@loongson.cn>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Jiaxun Yang 2020-07-18 23:35:40 +08:00 committed by Michael Niedermayer
parent e387fcd01c
commit e2fa12e3ae
25 changed files with 1599 additions and 1763 deletions

View File

@ -19,36 +19,26 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "libavutil/mips/cpu.h"
#include "blockdsp_mips.h"
#if HAVE_MSA
static av_cold void blockdsp_init_msa(BlockDSPContext *c)
{
c->clear_block = ff_clear_block_msa;
c->clear_blocks = ff_clear_blocks_msa;
c->fill_block_tab[0] = ff_fill_block16_msa;
c->fill_block_tab[1] = ff_fill_block8_msa;
}
#endif // #if HAVE_MSA
#if HAVE_MMI
static av_cold void blockdsp_init_mmi(BlockDSPContext *c)
{
c->clear_block = ff_clear_block_mmi;
c->clear_blocks = ff_clear_blocks_mmi;
c->fill_block_tab[0] = ff_fill_block16_mmi;
c->fill_block_tab[1] = ff_fill_block8_mmi;
}
#endif /* HAVE_MMI */
void ff_blockdsp_init_mips(BlockDSPContext *c)
{
#if HAVE_MMI
blockdsp_init_mmi(c);
#endif /* HAVE_MMI */
#if HAVE_MSA
blockdsp_init_msa(c);
#endif // #if HAVE_MSA
int cpu_flags = av_get_cpu_flags();
if (have_mmi(cpu_flags)) {
c->clear_block = ff_clear_block_mmi;
c->clear_blocks = ff_clear_blocks_mmi;
c->fill_block_tab[0] = ff_fill_block16_mmi;
c->fill_block_tab[1] = ff_fill_block8_mmi;
}
if (have_msa(cpu_flags)) {
c->clear_block = ff_clear_block_msa;
c->clear_blocks = ff_clear_blocks_msa;
c->fill_block_tab[0] = ff_fill_block16_msa;
c->fill_block_tab[1] = ff_fill_block8_msa;
}
}

View File

@ -25,7 +25,7 @@
#define AVCODEC_MIPS_CABAC_H
#include "libavcodec/cabac.h"
#include "libavutil/mips/mmiutils.h"
#include "libavutil/mips/asmdefs.h"
#include "config.h"
#define get_cabac_inline get_cabac_inline_mips

View File

@ -18,19 +18,15 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "libavutil/mips/cpu.h"
#include "h263dsp_mips.h"
#if HAVE_MSA
static av_cold void h263dsp_init_msa(H263DSPContext *c)
{
c->h263_h_loop_filter = ff_h263_h_loop_filter_msa;
c->h263_v_loop_filter = ff_h263_v_loop_filter_msa;
}
#endif // #if HAVE_MSA
av_cold void ff_h263dsp_init_mips(H263DSPContext *c)
{
#if HAVE_MSA
h263dsp_init_msa(c);
#endif // #if HAVE_MSA
int cpu_flags = av_get_cpu_flags();
if (have_msa(cpu_flags)){
c->h263_h_loop_filter = ff_h263_h_loop_filter_msa;
c->h263_v_loop_filter = ff_h263_v_loop_filter_msa;
}
}

View File

@ -19,45 +19,34 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "libavutil/mips/cpu.h"
#include "h264chroma_mips.h"
#if HAVE_MSA
static av_cold void h264chroma_init_msa(H264ChromaContext *c, int bit_depth)
{
const int high_bit_depth = bit_depth > 8;
if (!high_bit_depth) {
c->put_h264_chroma_pixels_tab[0] = ff_put_h264_chroma_mc8_msa;
c->put_h264_chroma_pixels_tab[1] = ff_put_h264_chroma_mc4_msa;
c->put_h264_chroma_pixels_tab[2] = ff_put_h264_chroma_mc2_msa;
c->avg_h264_chroma_pixels_tab[0] = ff_avg_h264_chroma_mc8_msa;
c->avg_h264_chroma_pixels_tab[1] = ff_avg_h264_chroma_mc4_msa;
c->avg_h264_chroma_pixels_tab[2] = ff_avg_h264_chroma_mc2_msa;
}
}
#endif // #if HAVE_MSA
#if HAVE_MMI
static av_cold void h264chroma_init_mmi(H264ChromaContext *c, int bit_depth)
{
int high_bit_depth = bit_depth > 8;
if (!high_bit_depth) {
c->put_h264_chroma_pixels_tab[0] = ff_put_h264_chroma_mc8_mmi;
c->avg_h264_chroma_pixels_tab[0] = ff_avg_h264_chroma_mc8_mmi;
c->put_h264_chroma_pixels_tab[1] = ff_put_h264_chroma_mc4_mmi;
c->avg_h264_chroma_pixels_tab[1] = ff_avg_h264_chroma_mc4_mmi;
}
}
#endif /* HAVE_MMI */
av_cold void ff_h264chroma_init_mips(H264ChromaContext *c, int bit_depth)
{
#if HAVE_MMI
h264chroma_init_mmi(c, bit_depth);
#endif /* HAVE_MMI */
#if HAVE_MSA
h264chroma_init_msa(c, bit_depth);
#endif // #if HAVE_MSA
int cpu_flags = av_get_cpu_flags();
int high_bit_depth = bit_depth > 8;
/* MMI apears to be faster than MSA here */
if (have_msa(cpu_flags)) {
if (!high_bit_depth) {
c->put_h264_chroma_pixels_tab[0] = ff_put_h264_chroma_mc8_msa;
c->put_h264_chroma_pixels_tab[1] = ff_put_h264_chroma_mc4_msa;
c->put_h264_chroma_pixels_tab[2] = ff_put_h264_chroma_mc2_msa;
c->avg_h264_chroma_pixels_tab[0] = ff_avg_h264_chroma_mc8_msa;
c->avg_h264_chroma_pixels_tab[1] = ff_avg_h264_chroma_mc4_msa;
c->avg_h264_chroma_pixels_tab[2] = ff_avg_h264_chroma_mc2_msa;
}
}
if (have_mmi(cpu_flags)) {
if (!high_bit_depth) {
c->put_h264_chroma_pixels_tab[0] = ff_put_h264_chroma_mc8_mmi;
c->avg_h264_chroma_pixels_tab[0] = ff_avg_h264_chroma_mc8_mmi;
c->put_h264_chroma_pixels_tab[1] = ff_put_h264_chroma_mc4_mmi;
c->avg_h264_chroma_pixels_tab[1] = ff_avg_h264_chroma_mc4_mmi;
}
}
}

View File

@ -19,129 +19,116 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "libavutil/mips/cpu.h"
#include "h264dsp_mips.h"
#if HAVE_MSA
static av_cold void h264dsp_init_msa(H264DSPContext *c,
const int bit_depth,
const int chroma_format_idc)
{
if (8 == bit_depth) {
c->h264_v_loop_filter_luma = ff_h264_v_lpf_luma_inter_msa;
c->h264_h_loop_filter_luma = ff_h264_h_lpf_luma_inter_msa;
c->h264_h_loop_filter_luma_mbaff =
ff_h264_h_loop_filter_luma_mbaff_msa;
c->h264_v_loop_filter_luma_intra = ff_h264_v_lpf_luma_intra_msa;
c->h264_h_loop_filter_luma_intra = ff_h264_h_lpf_luma_intra_msa;
c->h264_h_loop_filter_luma_mbaff_intra =
ff_h264_h_loop_filter_luma_mbaff_intra_msa;
c->h264_v_loop_filter_chroma = ff_h264_v_lpf_chroma_inter_msa;
if (chroma_format_idc <= 1)
c->h264_h_loop_filter_chroma = ff_h264_h_lpf_chroma_inter_msa;
else
c->h264_h_loop_filter_chroma =
ff_h264_h_loop_filter_chroma422_msa;
if (chroma_format_idc > 1)
c->h264_h_loop_filter_chroma_mbaff =
ff_h264_h_loop_filter_chroma422_mbaff_msa;
c->h264_v_loop_filter_chroma_intra =
ff_h264_v_lpf_chroma_intra_msa;
if (chroma_format_idc <= 1)
c->h264_h_loop_filter_chroma_intra =
ff_h264_h_lpf_chroma_intra_msa;
/* Weighted MC */
c->weight_h264_pixels_tab[0] = ff_weight_h264_pixels16_8_msa;
c->weight_h264_pixels_tab[1] = ff_weight_h264_pixels8_8_msa;
c->weight_h264_pixels_tab[2] = ff_weight_h264_pixels4_8_msa;
c->biweight_h264_pixels_tab[0] = ff_biweight_h264_pixels16_8_msa;
c->biweight_h264_pixels_tab[1] = ff_biweight_h264_pixels8_8_msa;
c->biweight_h264_pixels_tab[2] = ff_biweight_h264_pixels4_8_msa;
c->h264_idct_add = ff_h264_idct_add_msa;
c->h264_idct8_add = ff_h264_idct8_addblk_msa;
c->h264_idct_dc_add = ff_h264_idct4x4_addblk_dc_msa;
c->h264_idct8_dc_add = ff_h264_idct8_dc_addblk_msa;
c->h264_idct_add16 = ff_h264_idct_add16_msa;
c->h264_idct8_add4 = ff_h264_idct8_add4_msa;
if (chroma_format_idc <= 1)
c->h264_idct_add8 = ff_h264_idct_add8_msa;
else
c->h264_idct_add8 = ff_h264_idct_add8_422_msa;
c->h264_idct_add16intra = ff_h264_idct_add16_intra_msa;
c->h264_luma_dc_dequant_idct = ff_h264_deq_idct_luma_dc_msa;
} // if (8 == bit_depth)
}
#endif // #if HAVE_MSA
#if HAVE_MMI
static av_cold void h264dsp_init_mmi(H264DSPContext * c, const int bit_depth,
const int chroma_format_idc)
{
if (bit_depth == 8) {
c->h264_add_pixels4_clear = ff_h264_add_pixels4_8_mmi;
c->h264_idct_add = ff_h264_idct_add_8_mmi;
c->h264_idct8_add = ff_h264_idct8_add_8_mmi;
c->h264_idct_dc_add = ff_h264_idct_dc_add_8_mmi;
c->h264_idct8_dc_add = ff_h264_idct8_dc_add_8_mmi;
c->h264_idct_add16 = ff_h264_idct_add16_8_mmi;
c->h264_idct_add16intra = ff_h264_idct_add16intra_8_mmi;
c->h264_idct8_add4 = ff_h264_idct8_add4_8_mmi;
if (chroma_format_idc <= 1)
c->h264_idct_add8 = ff_h264_idct_add8_8_mmi;
else
c->h264_idct_add8 = ff_h264_idct_add8_422_8_mmi;
c->h264_luma_dc_dequant_idct = ff_h264_luma_dc_dequant_idct_8_mmi;
if (chroma_format_idc <= 1)
c->h264_chroma_dc_dequant_idct =
ff_h264_chroma_dc_dequant_idct_8_mmi;
else
c->h264_chroma_dc_dequant_idct =
ff_h264_chroma422_dc_dequant_idct_8_mmi;
c->weight_h264_pixels_tab[0] = ff_h264_weight_pixels16_8_mmi;
c->weight_h264_pixels_tab[1] = ff_h264_weight_pixels8_8_mmi;
c->weight_h264_pixels_tab[2] = ff_h264_weight_pixels4_8_mmi;
c->biweight_h264_pixels_tab[0] = ff_h264_biweight_pixels16_8_mmi;
c->biweight_h264_pixels_tab[1] = ff_h264_biweight_pixels8_8_mmi;
c->biweight_h264_pixels_tab[2] = ff_h264_biweight_pixels4_8_mmi;
c->h264_v_loop_filter_chroma = ff_deblock_v_chroma_8_mmi;
c->h264_v_loop_filter_chroma_intra = ff_deblock_v_chroma_intra_8_mmi;
if (chroma_format_idc <= 1) {
c->h264_h_loop_filter_chroma =
ff_deblock_h_chroma_8_mmi;
c->h264_h_loop_filter_chroma_intra =
ff_deblock_h_chroma_intra_8_mmi;
}
c->h264_v_loop_filter_luma = ff_deblock_v_luma_8_mmi;
c->h264_v_loop_filter_luma_intra = ff_deblock_v_luma_intra_8_mmi;
c->h264_h_loop_filter_luma = ff_deblock_h_luma_8_mmi;
c->h264_h_loop_filter_luma_intra = ff_deblock_h_luma_intra_8_mmi;
}
}
#endif /* HAVE_MMI */
av_cold void ff_h264dsp_init_mips(H264DSPContext *c, const int bit_depth,
const int chroma_format_idc)
{
#if HAVE_MMI
h264dsp_init_mmi(c, bit_depth, chroma_format_idc);
#endif /* HAVE_MMI */
#if HAVE_MSA
h264dsp_init_msa(c, bit_depth, chroma_format_idc);
#endif // #if HAVE_MSA
int cpu_flags = av_get_cpu_flags();
if (have_mmi(cpu_flags)) {
if (bit_depth == 8) {
c->h264_add_pixels4_clear = ff_h264_add_pixels4_8_mmi;
c->h264_idct_add = ff_h264_idct_add_8_mmi;
c->h264_idct8_add = ff_h264_idct8_add_8_mmi;
c->h264_idct_dc_add = ff_h264_idct_dc_add_8_mmi;
c->h264_idct8_dc_add = ff_h264_idct8_dc_add_8_mmi;
c->h264_idct_add16 = ff_h264_idct_add16_8_mmi;
c->h264_idct_add16intra = ff_h264_idct_add16intra_8_mmi;
c->h264_idct8_add4 = ff_h264_idct8_add4_8_mmi;
if (chroma_format_idc <= 1)
c->h264_idct_add8 = ff_h264_idct_add8_8_mmi;
else
c->h264_idct_add8 = ff_h264_idct_add8_422_8_mmi;
c->h264_luma_dc_dequant_idct = ff_h264_luma_dc_dequant_idct_8_mmi;
if (chroma_format_idc <= 1)
c->h264_chroma_dc_dequant_idct =
ff_h264_chroma_dc_dequant_idct_8_mmi;
else
c->h264_chroma_dc_dequant_idct =
ff_h264_chroma422_dc_dequant_idct_8_mmi;
c->weight_h264_pixels_tab[0] = ff_h264_weight_pixels16_8_mmi;
c->weight_h264_pixels_tab[1] = ff_h264_weight_pixels8_8_mmi;
c->weight_h264_pixels_tab[2] = ff_h264_weight_pixels4_8_mmi;
c->biweight_h264_pixels_tab[0] = ff_h264_biweight_pixels16_8_mmi;
c->biweight_h264_pixels_tab[1] = ff_h264_biweight_pixels8_8_mmi;
c->biweight_h264_pixels_tab[2] = ff_h264_biweight_pixels4_8_mmi;
c->h264_v_loop_filter_chroma = ff_deblock_v_chroma_8_mmi;
c->h264_v_loop_filter_chroma_intra = ff_deblock_v_chroma_intra_8_mmi;
if (chroma_format_idc <= 1) {
c->h264_h_loop_filter_chroma =
ff_deblock_h_chroma_8_mmi;
c->h264_h_loop_filter_chroma_intra =
ff_deblock_h_chroma_intra_8_mmi;
}
c->h264_v_loop_filter_luma = ff_deblock_v_luma_8_mmi;
c->h264_v_loop_filter_luma_intra = ff_deblock_v_luma_intra_8_mmi;
c->h264_h_loop_filter_luma = ff_deblock_h_luma_8_mmi;
c->h264_h_loop_filter_luma_intra = ff_deblock_h_luma_intra_8_mmi;
}
}
if (have_msa(cpu_flags)) {
if (bit_depth == 8) {
c->h264_v_loop_filter_luma = ff_h264_v_lpf_luma_inter_msa;
c->h264_h_loop_filter_luma = ff_h264_h_lpf_luma_inter_msa;
c->h264_h_loop_filter_luma_mbaff =
ff_h264_h_loop_filter_luma_mbaff_msa;
c->h264_v_loop_filter_luma_intra = ff_h264_v_lpf_luma_intra_msa;
c->h264_h_loop_filter_luma_intra = ff_h264_h_lpf_luma_intra_msa;
c->h264_h_loop_filter_luma_mbaff_intra =
ff_h264_h_loop_filter_luma_mbaff_intra_msa;
c->h264_v_loop_filter_chroma = ff_h264_v_lpf_chroma_inter_msa;
if (chroma_format_idc <= 1)
c->h264_h_loop_filter_chroma = ff_h264_h_lpf_chroma_inter_msa;
else
c->h264_h_loop_filter_chroma =
ff_h264_h_loop_filter_chroma422_msa;
if (chroma_format_idc > 1)
c->h264_h_loop_filter_chroma_mbaff =
ff_h264_h_loop_filter_chroma422_mbaff_msa;
c->h264_v_loop_filter_chroma_intra =
ff_h264_v_lpf_chroma_intra_msa;
if (chroma_format_idc <= 1)
c->h264_h_loop_filter_chroma_intra =
ff_h264_h_lpf_chroma_intra_msa;
/* Weighted MC */
c->weight_h264_pixels_tab[0] = ff_weight_h264_pixels16_8_msa;
c->weight_h264_pixels_tab[1] = ff_weight_h264_pixels8_8_msa;
c->weight_h264_pixels_tab[2] = ff_weight_h264_pixels4_8_msa;
c->biweight_h264_pixels_tab[0] = ff_biweight_h264_pixels16_8_msa;
c->biweight_h264_pixels_tab[1] = ff_biweight_h264_pixels8_8_msa;
c->biweight_h264_pixels_tab[2] = ff_biweight_h264_pixels4_8_msa;
c->h264_idct_add = ff_h264_idct_add_msa;
c->h264_idct8_add = ff_h264_idct8_addblk_msa;
c->h264_idct_dc_add = ff_h264_idct4x4_addblk_dc_msa;
c->h264_idct8_dc_add = ff_h264_idct8_dc_addblk_msa;
c->h264_idct_add16 = ff_h264_idct_add16_msa;
c->h264_idct8_add4 = ff_h264_idct8_add4_msa;
if (chroma_format_idc <= 1)
c->h264_idct_add8 = ff_h264_idct_add8_msa;
else
c->h264_idct_add8 = ff_h264_idct_add8_422_msa;
c->h264_idct_add16intra = ff_h264_idct_add16_intra_msa;
c->h264_luma_dc_dequant_idct = ff_h264_deq_idct_luma_dc_msa;
}
}
}

View File

@ -19,134 +19,121 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "libavutil/mips/cpu.h"
#include "config.h"
#include "h264dsp_mips.h"
#include "h264pred_mips.h"
#if HAVE_MSA
static av_cold void h264_pred_init_msa(H264PredContext *h, int codec_id,
const int bit_depth,
const int chroma_format_idc)
{
if (8 == bit_depth) {
if (chroma_format_idc == 1) {
h->pred8x8[VERT_PRED8x8] = ff_h264_intra_pred_vert_8x8_msa;
h->pred8x8[HOR_PRED8x8] = ff_h264_intra_pred_horiz_8x8_msa;
}
if (codec_id != AV_CODEC_ID_VP7 && codec_id != AV_CODEC_ID_VP8) {
if (chroma_format_idc == 1) {
h->pred8x8[PLANE_PRED8x8] = ff_h264_intra_predict_plane_8x8_msa;
}
}
if (codec_id != AV_CODEC_ID_RV40 && codec_id != AV_CODEC_ID_VP7
&& codec_id != AV_CODEC_ID_VP8) {
if (chroma_format_idc == 1) {
h->pred8x8[DC_PRED8x8] = ff_h264_intra_predict_dc_4blk_8x8_msa;
h->pred8x8[LEFT_DC_PRED8x8] =
ff_h264_intra_predict_hor_dc_8x8_msa;
h->pred8x8[TOP_DC_PRED8x8] =
ff_h264_intra_predict_vert_dc_8x8_msa;
h->pred8x8[ALZHEIMER_DC_L0T_PRED8x8] =
ff_h264_intra_predict_mad_cow_dc_l0t_8x8_msa;
h->pred8x8[ALZHEIMER_DC_0LT_PRED8x8] =
ff_h264_intra_predict_mad_cow_dc_0lt_8x8_msa;
h->pred8x8[ALZHEIMER_DC_L00_PRED8x8] =
ff_h264_intra_predict_mad_cow_dc_l00_8x8_msa;
h->pred8x8[ALZHEIMER_DC_0L0_PRED8x8] =
ff_h264_intra_predict_mad_cow_dc_0l0_8x8_msa;
}
} else {
if (codec_id == AV_CODEC_ID_VP7 || codec_id == AV_CODEC_ID_VP8) {
h->pred8x8[7] = ff_vp8_pred8x8_127_dc_8_msa;
h->pred8x8[8] = ff_vp8_pred8x8_129_dc_8_msa;
}
}
if (chroma_format_idc == 1) {
h->pred8x8[DC_128_PRED8x8] = ff_h264_intra_pred_dc_128_8x8_msa;
}
h->pred16x16[DC_PRED8x8] = ff_h264_intra_pred_dc_16x16_msa;
h->pred16x16[VERT_PRED8x8] = ff_h264_intra_pred_vert_16x16_msa;
h->pred16x16[HOR_PRED8x8] = ff_h264_intra_pred_horiz_16x16_msa;
switch (codec_id) {
case AV_CODEC_ID_SVQ3:
case AV_CODEC_ID_RV40:
break;
case AV_CODEC_ID_VP7:
case AV_CODEC_ID_VP8:
h->pred16x16[7] = ff_vp8_pred16x16_127_dc_8_msa;
h->pred16x16[8] = ff_vp8_pred16x16_129_dc_8_msa;
break;
default:
h->pred16x16[PLANE_PRED8x8] =
ff_h264_intra_predict_plane_16x16_msa;
break;
}
h->pred16x16[LEFT_DC_PRED8x8] = ff_h264_intra_pred_dc_left_16x16_msa;
h->pred16x16[TOP_DC_PRED8x8] = ff_h264_intra_pred_dc_top_16x16_msa;
h->pred16x16[DC_128_PRED8x8] = ff_h264_intra_pred_dc_128_16x16_msa;
}
}
#endif // #if HAVE_MSA
#if HAVE_MMI
static av_cold void h264_pred_init_mmi(H264PredContext *h, int codec_id,
const int bit_depth, const int chroma_format_idc)
{
if (bit_depth == 8) {
if (chroma_format_idc == 1) {
h->pred8x8 [VERT_PRED8x8 ] = ff_pred8x8_vertical_8_mmi;
h->pred8x8 [HOR_PRED8x8 ] = ff_pred8x8_horizontal_8_mmi;
} else {
h->pred8x8 [VERT_PRED8x8 ] = ff_pred8x16_vertical_8_mmi;
h->pred8x8 [HOR_PRED8x8 ] = ff_pred8x16_horizontal_8_mmi;
}
h->pred16x16[DC_PRED8x8 ] = ff_pred16x16_dc_8_mmi;
h->pred16x16[VERT_PRED8x8 ] = ff_pred16x16_vertical_8_mmi;
h->pred16x16[HOR_PRED8x8 ] = ff_pred16x16_horizontal_8_mmi;
h->pred8x8l [TOP_DC_PRED ] = ff_pred8x8l_top_dc_8_mmi;
h->pred8x8l [DC_PRED ] = ff_pred8x8l_dc_8_mmi;
#if ARCH_MIPS64
switch (codec_id) {
case AV_CODEC_ID_SVQ3:
h->pred16x16[PLANE_PRED8x8 ] = ff_pred16x16_plane_svq3_8_mmi;
break;
case AV_CODEC_ID_RV40:
h->pred16x16[PLANE_PRED8x8 ] = ff_pred16x16_plane_rv40_8_mmi;
break;
case AV_CODEC_ID_VP7:
case AV_CODEC_ID_VP8:
break;
default:
h->pred16x16[PLANE_PRED8x8 ] = ff_pred16x16_plane_h264_8_mmi;
break;
}
#endif
if (codec_id == AV_CODEC_ID_SVQ3 || codec_id == AV_CODEC_ID_H264) {
if (chroma_format_idc == 1) {
h->pred8x8[TOP_DC_PRED8x8 ] = ff_pred8x8_top_dc_8_mmi;
h->pred8x8[DC_PRED8x8 ] = ff_pred8x8_dc_8_mmi;
}
}
}
}
#endif /* HAVE_MMI */
av_cold void ff_h264_pred_init_mips(H264PredContext *h, int codec_id,
int bit_depth,
const int chroma_format_idc)
{
#if HAVE_MMI
h264_pred_init_mmi(h, codec_id, bit_depth, chroma_format_idc);
#endif /* HAVE_MMI */
#if HAVE_MSA
h264_pred_init_msa(h, codec_id, bit_depth, chroma_format_idc);
#endif // #if HAVE_MSA
int cpu_flags = av_get_cpu_flags();
if (have_mmi(cpu_flags)) {
if (bit_depth == 8) {
if (chroma_format_idc == 1) {
h->pred8x8 [VERT_PRED8x8 ] = ff_pred8x8_vertical_8_mmi;
h->pred8x8 [HOR_PRED8x8 ] = ff_pred8x8_horizontal_8_mmi;
} else {
h->pred8x8 [VERT_PRED8x8 ] = ff_pred8x16_vertical_8_mmi;
h->pred8x8 [HOR_PRED8x8 ] = ff_pred8x16_horizontal_8_mmi;
}
h->pred16x16[DC_PRED8x8 ] = ff_pred16x16_dc_8_mmi;
h->pred16x16[VERT_PRED8x8 ] = ff_pred16x16_vertical_8_mmi;
h->pred16x16[HOR_PRED8x8 ] = ff_pred16x16_horizontal_8_mmi;
h->pred8x8l [TOP_DC_PRED ] = ff_pred8x8l_top_dc_8_mmi;
h->pred8x8l [DC_PRED ] = ff_pred8x8l_dc_8_mmi;
#if ARCH_MIPS64
switch (codec_id) {
case AV_CODEC_ID_SVQ3:
h->pred16x16[PLANE_PRED8x8 ] = ff_pred16x16_plane_svq3_8_mmi;
break;
case AV_CODEC_ID_RV40:
h->pred16x16[PLANE_PRED8x8 ] = ff_pred16x16_plane_rv40_8_mmi;
break;
case AV_CODEC_ID_VP7:
case AV_CODEC_ID_VP8:
break;
default:
h->pred16x16[PLANE_PRED8x8 ] = ff_pred16x16_plane_h264_8_mmi;
break;
}
#endif
if (codec_id == AV_CODEC_ID_SVQ3 || codec_id == AV_CODEC_ID_H264) {
if (chroma_format_idc == 1) {
h->pred8x8[TOP_DC_PRED8x8 ] = ff_pred8x8_top_dc_8_mmi;
h->pred8x8[DC_PRED8x8 ] = ff_pred8x8_dc_8_mmi;
}
}
}
}
if (have_msa(cpu_flags)) {
if (8 == bit_depth) {
if (chroma_format_idc == 1) {
h->pred8x8[VERT_PRED8x8] = ff_h264_intra_pred_vert_8x8_msa;
h->pred8x8[HOR_PRED8x8] = ff_h264_intra_pred_horiz_8x8_msa;
}
if (codec_id != AV_CODEC_ID_VP7 && codec_id != AV_CODEC_ID_VP8) {
if (chroma_format_idc == 1) {
h->pred8x8[PLANE_PRED8x8] = ff_h264_intra_predict_plane_8x8_msa;
}
}
if (codec_id != AV_CODEC_ID_RV40 && codec_id != AV_CODEC_ID_VP7
&& codec_id != AV_CODEC_ID_VP8) {
if (chroma_format_idc == 1) {
h->pred8x8[DC_PRED8x8] = ff_h264_intra_predict_dc_4blk_8x8_msa;
h->pred8x8[LEFT_DC_PRED8x8] =
ff_h264_intra_predict_hor_dc_8x8_msa;
h->pred8x8[TOP_DC_PRED8x8] =
ff_h264_intra_predict_vert_dc_8x8_msa;
h->pred8x8[ALZHEIMER_DC_L0T_PRED8x8] =
ff_h264_intra_predict_mad_cow_dc_l0t_8x8_msa;
h->pred8x8[ALZHEIMER_DC_0LT_PRED8x8] =
ff_h264_intra_predict_mad_cow_dc_0lt_8x8_msa;
h->pred8x8[ALZHEIMER_DC_L00_PRED8x8] =
ff_h264_intra_predict_mad_cow_dc_l00_8x8_msa;
h->pred8x8[ALZHEIMER_DC_0L0_PRED8x8] =
ff_h264_intra_predict_mad_cow_dc_0l0_8x8_msa;
}
} else {
if (codec_id == AV_CODEC_ID_VP7 || codec_id == AV_CODEC_ID_VP8) {
h->pred8x8[7] = ff_vp8_pred8x8_127_dc_8_msa;
h->pred8x8[8] = ff_vp8_pred8x8_129_dc_8_msa;
}
}
if (chroma_format_idc == 1) {
h->pred8x8[DC_128_PRED8x8] = ff_h264_intra_pred_dc_128_8x8_msa;
}
h->pred16x16[DC_PRED8x8] = ff_h264_intra_pred_dc_16x16_msa;
h->pred16x16[VERT_PRED8x8] = ff_h264_intra_pred_vert_16x16_msa;
h->pred16x16[HOR_PRED8x8] = ff_h264_intra_pred_horiz_16x16_msa;
switch (codec_id) {
case AV_CODEC_ID_SVQ3:
case AV_CODEC_ID_RV40:
break;
case AV_CODEC_ID_VP7:
case AV_CODEC_ID_VP8:
h->pred16x16[7] = ff_vp8_pred16x16_127_dc_8_msa;
h->pred16x16[8] = ff_vp8_pred16x16_129_dc_8_msa;
break;
default:
h->pred16x16[PLANE_PRED8x8] =
ff_h264_intra_predict_plane_16x16_msa;
break;
}
h->pred16x16[LEFT_DC_PRED8x8] = ff_h264_intra_pred_dc_left_16x16_msa;
h->pred16x16[TOP_DC_PRED8x8] = ff_h264_intra_pred_dc_top_16x16_msa;
h->pred16x16[DC_128_PRED8x8] = ff_h264_intra_pred_dc_128_16x16_msa;
}
}
}

View File

@ -19,231 +19,221 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "libavutil/mips/cpu.h"
#include "h264dsp_mips.h"
#if HAVE_MSA
static av_cold void h264qpel_init_msa(H264QpelContext *c, int bit_depth)
{
if (8 == bit_depth) {
c->put_h264_qpel_pixels_tab[0][0] = ff_put_h264_qpel16_mc00_msa;
c->put_h264_qpel_pixels_tab[0][1] = ff_put_h264_qpel16_mc10_msa;
c->put_h264_qpel_pixels_tab[0][2] = ff_put_h264_qpel16_mc20_msa;
c->put_h264_qpel_pixels_tab[0][3] = ff_put_h264_qpel16_mc30_msa;
c->put_h264_qpel_pixels_tab[0][4] = ff_put_h264_qpel16_mc01_msa;
c->put_h264_qpel_pixels_tab[0][5] = ff_put_h264_qpel16_mc11_msa;
c->put_h264_qpel_pixels_tab[0][6] = ff_put_h264_qpel16_mc21_msa;
c->put_h264_qpel_pixels_tab[0][7] = ff_put_h264_qpel16_mc31_msa;
c->put_h264_qpel_pixels_tab[0][8] = ff_put_h264_qpel16_mc02_msa;
c->put_h264_qpel_pixels_tab[0][9] = ff_put_h264_qpel16_mc12_msa;
c->put_h264_qpel_pixels_tab[0][10] = ff_put_h264_qpel16_mc22_msa;
c->put_h264_qpel_pixels_tab[0][11] = ff_put_h264_qpel16_mc32_msa;
c->put_h264_qpel_pixels_tab[0][12] = ff_put_h264_qpel16_mc03_msa;
c->put_h264_qpel_pixels_tab[0][13] = ff_put_h264_qpel16_mc13_msa;
c->put_h264_qpel_pixels_tab[0][14] = ff_put_h264_qpel16_mc23_msa;
c->put_h264_qpel_pixels_tab[0][15] = ff_put_h264_qpel16_mc33_msa;
c->put_h264_qpel_pixels_tab[1][0] = ff_put_h264_qpel8_mc00_msa;
c->put_h264_qpel_pixels_tab[1][1] = ff_put_h264_qpel8_mc10_msa;
c->put_h264_qpel_pixels_tab[1][2] = ff_put_h264_qpel8_mc20_msa;
c->put_h264_qpel_pixels_tab[1][3] = ff_put_h264_qpel8_mc30_msa;
c->put_h264_qpel_pixels_tab[1][4] = ff_put_h264_qpel8_mc01_msa;
c->put_h264_qpel_pixels_tab[1][5] = ff_put_h264_qpel8_mc11_msa;
c->put_h264_qpel_pixels_tab[1][6] = ff_put_h264_qpel8_mc21_msa;
c->put_h264_qpel_pixels_tab[1][7] = ff_put_h264_qpel8_mc31_msa;
c->put_h264_qpel_pixels_tab[1][8] = ff_put_h264_qpel8_mc02_msa;
c->put_h264_qpel_pixels_tab[1][9] = ff_put_h264_qpel8_mc12_msa;
c->put_h264_qpel_pixels_tab[1][10] = ff_put_h264_qpel8_mc22_msa;
c->put_h264_qpel_pixels_tab[1][11] = ff_put_h264_qpel8_mc32_msa;
c->put_h264_qpel_pixels_tab[1][12] = ff_put_h264_qpel8_mc03_msa;
c->put_h264_qpel_pixels_tab[1][13] = ff_put_h264_qpel8_mc13_msa;
c->put_h264_qpel_pixels_tab[1][14] = ff_put_h264_qpel8_mc23_msa;
c->put_h264_qpel_pixels_tab[1][15] = ff_put_h264_qpel8_mc33_msa;
c->put_h264_qpel_pixels_tab[2][1] = ff_put_h264_qpel4_mc10_msa;
c->put_h264_qpel_pixels_tab[2][2] = ff_put_h264_qpel4_mc20_msa;
c->put_h264_qpel_pixels_tab[2][3] = ff_put_h264_qpel4_mc30_msa;
c->put_h264_qpel_pixels_tab[2][4] = ff_put_h264_qpel4_mc01_msa;
c->put_h264_qpel_pixels_tab[2][5] = ff_put_h264_qpel4_mc11_msa;
c->put_h264_qpel_pixels_tab[2][6] = ff_put_h264_qpel4_mc21_msa;
c->put_h264_qpel_pixels_tab[2][7] = ff_put_h264_qpel4_mc31_msa;
c->put_h264_qpel_pixels_tab[2][8] = ff_put_h264_qpel4_mc02_msa;
c->put_h264_qpel_pixels_tab[2][9] = ff_put_h264_qpel4_mc12_msa;
c->put_h264_qpel_pixels_tab[2][10] = ff_put_h264_qpel4_mc22_msa;
c->put_h264_qpel_pixels_tab[2][11] = ff_put_h264_qpel4_mc32_msa;
c->put_h264_qpel_pixels_tab[2][12] = ff_put_h264_qpel4_mc03_msa;
c->put_h264_qpel_pixels_tab[2][13] = ff_put_h264_qpel4_mc13_msa;
c->put_h264_qpel_pixels_tab[2][14] = ff_put_h264_qpel4_mc23_msa;
c->put_h264_qpel_pixels_tab[2][15] = ff_put_h264_qpel4_mc33_msa;
c->avg_h264_qpel_pixels_tab[0][0] = ff_avg_h264_qpel16_mc00_msa;
c->avg_h264_qpel_pixels_tab[0][1] = ff_avg_h264_qpel16_mc10_msa;
c->avg_h264_qpel_pixels_tab[0][2] = ff_avg_h264_qpel16_mc20_msa;
c->avg_h264_qpel_pixels_tab[0][3] = ff_avg_h264_qpel16_mc30_msa;
c->avg_h264_qpel_pixels_tab[0][4] = ff_avg_h264_qpel16_mc01_msa;
c->avg_h264_qpel_pixels_tab[0][5] = ff_avg_h264_qpel16_mc11_msa;
c->avg_h264_qpel_pixels_tab[0][6] = ff_avg_h264_qpel16_mc21_msa;
c->avg_h264_qpel_pixels_tab[0][7] = ff_avg_h264_qpel16_mc31_msa;
c->avg_h264_qpel_pixels_tab[0][8] = ff_avg_h264_qpel16_mc02_msa;
c->avg_h264_qpel_pixels_tab[0][9] = ff_avg_h264_qpel16_mc12_msa;
c->avg_h264_qpel_pixels_tab[0][10] = ff_avg_h264_qpel16_mc22_msa;
c->avg_h264_qpel_pixels_tab[0][11] = ff_avg_h264_qpel16_mc32_msa;
c->avg_h264_qpel_pixels_tab[0][12] = ff_avg_h264_qpel16_mc03_msa;
c->avg_h264_qpel_pixels_tab[0][13] = ff_avg_h264_qpel16_mc13_msa;
c->avg_h264_qpel_pixels_tab[0][14] = ff_avg_h264_qpel16_mc23_msa;
c->avg_h264_qpel_pixels_tab[0][15] = ff_avg_h264_qpel16_mc33_msa;
c->avg_h264_qpel_pixels_tab[1][0] = ff_avg_h264_qpel8_mc00_msa;
c->avg_h264_qpel_pixels_tab[1][1] = ff_avg_h264_qpel8_mc10_msa;
c->avg_h264_qpel_pixels_tab[1][2] = ff_avg_h264_qpel8_mc20_msa;
c->avg_h264_qpel_pixels_tab[1][3] = ff_avg_h264_qpel8_mc30_msa;
c->avg_h264_qpel_pixels_tab[1][4] = ff_avg_h264_qpel8_mc01_msa;
c->avg_h264_qpel_pixels_tab[1][5] = ff_avg_h264_qpel8_mc11_msa;
c->avg_h264_qpel_pixels_tab[1][6] = ff_avg_h264_qpel8_mc21_msa;
c->avg_h264_qpel_pixels_tab[1][7] = ff_avg_h264_qpel8_mc31_msa;
c->avg_h264_qpel_pixels_tab[1][8] = ff_avg_h264_qpel8_mc02_msa;
c->avg_h264_qpel_pixels_tab[1][9] = ff_avg_h264_qpel8_mc12_msa;
c->avg_h264_qpel_pixels_tab[1][10] = ff_avg_h264_qpel8_mc22_msa;
c->avg_h264_qpel_pixels_tab[1][11] = ff_avg_h264_qpel8_mc32_msa;
c->avg_h264_qpel_pixels_tab[1][12] = ff_avg_h264_qpel8_mc03_msa;
c->avg_h264_qpel_pixels_tab[1][13] = ff_avg_h264_qpel8_mc13_msa;
c->avg_h264_qpel_pixels_tab[1][14] = ff_avg_h264_qpel8_mc23_msa;
c->avg_h264_qpel_pixels_tab[1][15] = ff_avg_h264_qpel8_mc33_msa;
c->avg_h264_qpel_pixels_tab[2][0] = ff_avg_h264_qpel4_mc00_msa;
c->avg_h264_qpel_pixels_tab[2][1] = ff_avg_h264_qpel4_mc10_msa;
c->avg_h264_qpel_pixels_tab[2][2] = ff_avg_h264_qpel4_mc20_msa;
c->avg_h264_qpel_pixels_tab[2][3] = ff_avg_h264_qpel4_mc30_msa;
c->avg_h264_qpel_pixels_tab[2][4] = ff_avg_h264_qpel4_mc01_msa;
c->avg_h264_qpel_pixels_tab[2][5] = ff_avg_h264_qpel4_mc11_msa;
c->avg_h264_qpel_pixels_tab[2][6] = ff_avg_h264_qpel4_mc21_msa;
c->avg_h264_qpel_pixels_tab[2][7] = ff_avg_h264_qpel4_mc31_msa;
c->avg_h264_qpel_pixels_tab[2][8] = ff_avg_h264_qpel4_mc02_msa;
c->avg_h264_qpel_pixels_tab[2][9] = ff_avg_h264_qpel4_mc12_msa;
c->avg_h264_qpel_pixels_tab[2][10] = ff_avg_h264_qpel4_mc22_msa;
c->avg_h264_qpel_pixels_tab[2][11] = ff_avg_h264_qpel4_mc32_msa;
c->avg_h264_qpel_pixels_tab[2][12] = ff_avg_h264_qpel4_mc03_msa;
c->avg_h264_qpel_pixels_tab[2][13] = ff_avg_h264_qpel4_mc13_msa;
c->avg_h264_qpel_pixels_tab[2][14] = ff_avg_h264_qpel4_mc23_msa;
c->avg_h264_qpel_pixels_tab[2][15] = ff_avg_h264_qpel4_mc33_msa;
}
}
#endif // #if HAVE_MSA
#if HAVE_MMI
static av_cold void h264qpel_init_mmi(H264QpelContext *c, int bit_depth)
{
if (8 == bit_depth) {
c->put_h264_qpel_pixels_tab[0][0] = ff_put_h264_qpel16_mc00_mmi;
c->put_h264_qpel_pixels_tab[0][1] = ff_put_h264_qpel16_mc10_mmi;
c->put_h264_qpel_pixels_tab[0][2] = ff_put_h264_qpel16_mc20_mmi;
c->put_h264_qpel_pixels_tab[0][3] = ff_put_h264_qpel16_mc30_mmi;
c->put_h264_qpel_pixels_tab[0][4] = ff_put_h264_qpel16_mc01_mmi;
c->put_h264_qpel_pixels_tab[0][5] = ff_put_h264_qpel16_mc11_mmi;
c->put_h264_qpel_pixels_tab[0][6] = ff_put_h264_qpel16_mc21_mmi;
c->put_h264_qpel_pixels_tab[0][7] = ff_put_h264_qpel16_mc31_mmi;
c->put_h264_qpel_pixels_tab[0][8] = ff_put_h264_qpel16_mc02_mmi;
c->put_h264_qpel_pixels_tab[0][9] = ff_put_h264_qpel16_mc12_mmi;
c->put_h264_qpel_pixels_tab[0][10] = ff_put_h264_qpel16_mc22_mmi;
c->put_h264_qpel_pixels_tab[0][11] = ff_put_h264_qpel16_mc32_mmi;
c->put_h264_qpel_pixels_tab[0][12] = ff_put_h264_qpel16_mc03_mmi;
c->put_h264_qpel_pixels_tab[0][13] = ff_put_h264_qpel16_mc13_mmi;
c->put_h264_qpel_pixels_tab[0][14] = ff_put_h264_qpel16_mc23_mmi;
c->put_h264_qpel_pixels_tab[0][15] = ff_put_h264_qpel16_mc33_mmi;
c->put_h264_qpel_pixels_tab[1][0] = ff_put_h264_qpel8_mc00_mmi;
c->put_h264_qpel_pixels_tab[1][1] = ff_put_h264_qpel8_mc10_mmi;
c->put_h264_qpel_pixels_tab[1][2] = ff_put_h264_qpel8_mc20_mmi;
c->put_h264_qpel_pixels_tab[1][3] = ff_put_h264_qpel8_mc30_mmi;
c->put_h264_qpel_pixels_tab[1][4] = ff_put_h264_qpel8_mc01_mmi;
c->put_h264_qpel_pixels_tab[1][5] = ff_put_h264_qpel8_mc11_mmi;
c->put_h264_qpel_pixels_tab[1][6] = ff_put_h264_qpel8_mc21_mmi;
c->put_h264_qpel_pixels_tab[1][7] = ff_put_h264_qpel8_mc31_mmi;
c->put_h264_qpel_pixels_tab[1][8] = ff_put_h264_qpel8_mc02_mmi;
c->put_h264_qpel_pixels_tab[1][9] = ff_put_h264_qpel8_mc12_mmi;
c->put_h264_qpel_pixels_tab[1][10] = ff_put_h264_qpel8_mc22_mmi;
c->put_h264_qpel_pixels_tab[1][11] = ff_put_h264_qpel8_mc32_mmi;
c->put_h264_qpel_pixels_tab[1][12] = ff_put_h264_qpel8_mc03_mmi;
c->put_h264_qpel_pixels_tab[1][13] = ff_put_h264_qpel8_mc13_mmi;
c->put_h264_qpel_pixels_tab[1][14] = ff_put_h264_qpel8_mc23_mmi;
c->put_h264_qpel_pixels_tab[1][15] = ff_put_h264_qpel8_mc33_mmi;
c->put_h264_qpel_pixels_tab[2][0] = ff_put_h264_qpel4_mc00_mmi;
c->put_h264_qpel_pixels_tab[2][1] = ff_put_h264_qpel4_mc10_mmi;
c->put_h264_qpel_pixels_tab[2][2] = ff_put_h264_qpel4_mc20_mmi;
c->put_h264_qpel_pixels_tab[2][3] = ff_put_h264_qpel4_mc30_mmi;
c->put_h264_qpel_pixels_tab[2][4] = ff_put_h264_qpel4_mc01_mmi;
c->put_h264_qpel_pixels_tab[2][5] = ff_put_h264_qpel4_mc11_mmi;
c->put_h264_qpel_pixels_tab[2][6] = ff_put_h264_qpel4_mc21_mmi;
c->put_h264_qpel_pixels_tab[2][7] = ff_put_h264_qpel4_mc31_mmi;
c->put_h264_qpel_pixels_tab[2][8] = ff_put_h264_qpel4_mc02_mmi;
c->put_h264_qpel_pixels_tab[2][9] = ff_put_h264_qpel4_mc12_mmi;
c->put_h264_qpel_pixels_tab[2][10] = ff_put_h264_qpel4_mc22_mmi;
c->put_h264_qpel_pixels_tab[2][11] = ff_put_h264_qpel4_mc32_mmi;
c->put_h264_qpel_pixels_tab[2][12] = ff_put_h264_qpel4_mc03_mmi;
c->put_h264_qpel_pixels_tab[2][13] = ff_put_h264_qpel4_mc13_mmi;
c->put_h264_qpel_pixels_tab[2][14] = ff_put_h264_qpel4_mc23_mmi;
c->put_h264_qpel_pixels_tab[2][15] = ff_put_h264_qpel4_mc33_mmi;
c->avg_h264_qpel_pixels_tab[0][0] = ff_avg_h264_qpel16_mc00_mmi;
c->avg_h264_qpel_pixels_tab[0][1] = ff_avg_h264_qpel16_mc10_mmi;
c->avg_h264_qpel_pixels_tab[0][2] = ff_avg_h264_qpel16_mc20_mmi;
c->avg_h264_qpel_pixels_tab[0][3] = ff_avg_h264_qpel16_mc30_mmi;
c->avg_h264_qpel_pixels_tab[0][4] = ff_avg_h264_qpel16_mc01_mmi;
c->avg_h264_qpel_pixels_tab[0][5] = ff_avg_h264_qpel16_mc11_mmi;
c->avg_h264_qpel_pixels_tab[0][6] = ff_avg_h264_qpel16_mc21_mmi;
c->avg_h264_qpel_pixels_tab[0][7] = ff_avg_h264_qpel16_mc31_mmi;
c->avg_h264_qpel_pixels_tab[0][8] = ff_avg_h264_qpel16_mc02_mmi;
c->avg_h264_qpel_pixels_tab[0][9] = ff_avg_h264_qpel16_mc12_mmi;
c->avg_h264_qpel_pixels_tab[0][10] = ff_avg_h264_qpel16_mc22_mmi;
c->avg_h264_qpel_pixels_tab[0][11] = ff_avg_h264_qpel16_mc32_mmi;
c->avg_h264_qpel_pixels_tab[0][12] = ff_avg_h264_qpel16_mc03_mmi;
c->avg_h264_qpel_pixels_tab[0][13] = ff_avg_h264_qpel16_mc13_mmi;
c->avg_h264_qpel_pixels_tab[0][14] = ff_avg_h264_qpel16_mc23_mmi;
c->avg_h264_qpel_pixels_tab[0][15] = ff_avg_h264_qpel16_mc33_mmi;
c->avg_h264_qpel_pixels_tab[1][0] = ff_avg_h264_qpel8_mc00_mmi;
c->avg_h264_qpel_pixels_tab[1][1] = ff_avg_h264_qpel8_mc10_mmi;
c->avg_h264_qpel_pixels_tab[1][2] = ff_avg_h264_qpel8_mc20_mmi;
c->avg_h264_qpel_pixels_tab[1][3] = ff_avg_h264_qpel8_mc30_mmi;
c->avg_h264_qpel_pixels_tab[1][4] = ff_avg_h264_qpel8_mc01_mmi;
c->avg_h264_qpel_pixels_tab[1][5] = ff_avg_h264_qpel8_mc11_mmi;
c->avg_h264_qpel_pixels_tab[1][6] = ff_avg_h264_qpel8_mc21_mmi;
c->avg_h264_qpel_pixels_tab[1][7] = ff_avg_h264_qpel8_mc31_mmi;
c->avg_h264_qpel_pixels_tab[1][8] = ff_avg_h264_qpel8_mc02_mmi;
c->avg_h264_qpel_pixels_tab[1][9] = ff_avg_h264_qpel8_mc12_mmi;
c->avg_h264_qpel_pixels_tab[1][10] = ff_avg_h264_qpel8_mc22_mmi;
c->avg_h264_qpel_pixels_tab[1][11] = ff_avg_h264_qpel8_mc32_mmi;
c->avg_h264_qpel_pixels_tab[1][12] = ff_avg_h264_qpel8_mc03_mmi;
c->avg_h264_qpel_pixels_tab[1][13] = ff_avg_h264_qpel8_mc13_mmi;
c->avg_h264_qpel_pixels_tab[1][14] = ff_avg_h264_qpel8_mc23_mmi;
c->avg_h264_qpel_pixels_tab[1][15] = ff_avg_h264_qpel8_mc33_mmi;
c->avg_h264_qpel_pixels_tab[2][0] = ff_avg_h264_qpel4_mc00_mmi;
c->avg_h264_qpel_pixels_tab[2][1] = ff_avg_h264_qpel4_mc10_mmi;
c->avg_h264_qpel_pixels_tab[2][2] = ff_avg_h264_qpel4_mc20_mmi;
c->avg_h264_qpel_pixels_tab[2][3] = ff_avg_h264_qpel4_mc30_mmi;
c->avg_h264_qpel_pixels_tab[2][4] = ff_avg_h264_qpel4_mc01_mmi;
c->avg_h264_qpel_pixels_tab[2][5] = ff_avg_h264_qpel4_mc11_mmi;
c->avg_h264_qpel_pixels_tab[2][6] = ff_avg_h264_qpel4_mc21_mmi;
c->avg_h264_qpel_pixels_tab[2][7] = ff_avg_h264_qpel4_mc31_mmi;
c->avg_h264_qpel_pixels_tab[2][8] = ff_avg_h264_qpel4_mc02_mmi;
c->avg_h264_qpel_pixels_tab[2][9] = ff_avg_h264_qpel4_mc12_mmi;
c->avg_h264_qpel_pixels_tab[2][10] = ff_avg_h264_qpel4_mc22_mmi;
c->avg_h264_qpel_pixels_tab[2][11] = ff_avg_h264_qpel4_mc32_mmi;
c->avg_h264_qpel_pixels_tab[2][12] = ff_avg_h264_qpel4_mc03_mmi;
c->avg_h264_qpel_pixels_tab[2][13] = ff_avg_h264_qpel4_mc13_mmi;
c->avg_h264_qpel_pixels_tab[2][14] = ff_avg_h264_qpel4_mc23_mmi;
c->avg_h264_qpel_pixels_tab[2][15] = ff_avg_h264_qpel4_mc33_mmi;
}
}
#endif /* HAVE_MMI */
av_cold void ff_h264qpel_init_mips(H264QpelContext *c, int bit_depth)
{
#if HAVE_MMI
h264qpel_init_mmi(c, bit_depth);
#endif /* HAVE_MMI */
#if HAVE_MSA
h264qpel_init_msa(c, bit_depth);
#endif // #if HAVE_MSA
int cpu_flags = av_get_cpu_flags();
if (have_mmi(cpu_flags)) {
if (bit_depth == 8) {
c->put_h264_qpel_pixels_tab[0][0] = ff_put_h264_qpel16_mc00_mmi;
c->put_h264_qpel_pixels_tab[0][1] = ff_put_h264_qpel16_mc10_mmi;
c->put_h264_qpel_pixels_tab[0][2] = ff_put_h264_qpel16_mc20_mmi;
c->put_h264_qpel_pixels_tab[0][3] = ff_put_h264_qpel16_mc30_mmi;
c->put_h264_qpel_pixels_tab[0][4] = ff_put_h264_qpel16_mc01_mmi;
c->put_h264_qpel_pixels_tab[0][5] = ff_put_h264_qpel16_mc11_mmi;
c->put_h264_qpel_pixels_tab[0][6] = ff_put_h264_qpel16_mc21_mmi;
c->put_h264_qpel_pixels_tab[0][7] = ff_put_h264_qpel16_mc31_mmi;
c->put_h264_qpel_pixels_tab[0][8] = ff_put_h264_qpel16_mc02_mmi;
c->put_h264_qpel_pixels_tab[0][9] = ff_put_h264_qpel16_mc12_mmi;
c->put_h264_qpel_pixels_tab[0][10] = ff_put_h264_qpel16_mc22_mmi;
c->put_h264_qpel_pixels_tab[0][11] = ff_put_h264_qpel16_mc32_mmi;
c->put_h264_qpel_pixels_tab[0][12] = ff_put_h264_qpel16_mc03_mmi;
c->put_h264_qpel_pixels_tab[0][13] = ff_put_h264_qpel16_mc13_mmi;
c->put_h264_qpel_pixels_tab[0][14] = ff_put_h264_qpel16_mc23_mmi;
c->put_h264_qpel_pixels_tab[0][15] = ff_put_h264_qpel16_mc33_mmi;
c->put_h264_qpel_pixels_tab[1][0] = ff_put_h264_qpel8_mc00_mmi;
c->put_h264_qpel_pixels_tab[1][1] = ff_put_h264_qpel8_mc10_mmi;
c->put_h264_qpel_pixels_tab[1][2] = ff_put_h264_qpel8_mc20_mmi;
c->put_h264_qpel_pixels_tab[1][3] = ff_put_h264_qpel8_mc30_mmi;
c->put_h264_qpel_pixels_tab[1][4] = ff_put_h264_qpel8_mc01_mmi;
c->put_h264_qpel_pixels_tab[1][5] = ff_put_h264_qpel8_mc11_mmi;
c->put_h264_qpel_pixels_tab[1][6] = ff_put_h264_qpel8_mc21_mmi;
c->put_h264_qpel_pixels_tab[1][7] = ff_put_h264_qpel8_mc31_mmi;
c->put_h264_qpel_pixels_tab[1][8] = ff_put_h264_qpel8_mc02_mmi;
c->put_h264_qpel_pixels_tab[1][9] = ff_put_h264_qpel8_mc12_mmi;
c->put_h264_qpel_pixels_tab[1][10] = ff_put_h264_qpel8_mc22_mmi;
c->put_h264_qpel_pixels_tab[1][11] = ff_put_h264_qpel8_mc32_mmi;
c->put_h264_qpel_pixels_tab[1][12] = ff_put_h264_qpel8_mc03_mmi;
c->put_h264_qpel_pixels_tab[1][13] = ff_put_h264_qpel8_mc13_mmi;
c->put_h264_qpel_pixels_tab[1][14] = ff_put_h264_qpel8_mc23_mmi;
c->put_h264_qpel_pixels_tab[1][15] = ff_put_h264_qpel8_mc33_mmi;
c->put_h264_qpel_pixels_tab[2][0] = ff_put_h264_qpel4_mc00_mmi;
c->put_h264_qpel_pixels_tab[2][1] = ff_put_h264_qpel4_mc10_mmi;
c->put_h264_qpel_pixels_tab[2][2] = ff_put_h264_qpel4_mc20_mmi;
c->put_h264_qpel_pixels_tab[2][3] = ff_put_h264_qpel4_mc30_mmi;
c->put_h264_qpel_pixels_tab[2][4] = ff_put_h264_qpel4_mc01_mmi;
c->put_h264_qpel_pixels_tab[2][5] = ff_put_h264_qpel4_mc11_mmi;
c->put_h264_qpel_pixels_tab[2][6] = ff_put_h264_qpel4_mc21_mmi;
c->put_h264_qpel_pixels_tab[2][7] = ff_put_h264_qpel4_mc31_mmi;
c->put_h264_qpel_pixels_tab[2][8] = ff_put_h264_qpel4_mc02_mmi;
c->put_h264_qpel_pixels_tab[2][9] = ff_put_h264_qpel4_mc12_mmi;
c->put_h264_qpel_pixels_tab[2][10] = ff_put_h264_qpel4_mc22_mmi;
c->put_h264_qpel_pixels_tab[2][11] = ff_put_h264_qpel4_mc32_mmi;
c->put_h264_qpel_pixels_tab[2][12] = ff_put_h264_qpel4_mc03_mmi;
c->put_h264_qpel_pixels_tab[2][13] = ff_put_h264_qpel4_mc13_mmi;
c->put_h264_qpel_pixels_tab[2][14] = ff_put_h264_qpel4_mc23_mmi;
c->put_h264_qpel_pixels_tab[2][15] = ff_put_h264_qpel4_mc33_mmi;
c->avg_h264_qpel_pixels_tab[0][0] = ff_avg_h264_qpel16_mc00_mmi;
c->avg_h264_qpel_pixels_tab[0][1] = ff_avg_h264_qpel16_mc10_mmi;
c->avg_h264_qpel_pixels_tab[0][2] = ff_avg_h264_qpel16_mc20_mmi;
c->avg_h264_qpel_pixels_tab[0][3] = ff_avg_h264_qpel16_mc30_mmi;
c->avg_h264_qpel_pixels_tab[0][4] = ff_avg_h264_qpel16_mc01_mmi;
c->avg_h264_qpel_pixels_tab[0][5] = ff_avg_h264_qpel16_mc11_mmi;
c->avg_h264_qpel_pixels_tab[0][6] = ff_avg_h264_qpel16_mc21_mmi;
c->avg_h264_qpel_pixels_tab[0][7] = ff_avg_h264_qpel16_mc31_mmi;
c->avg_h264_qpel_pixels_tab[0][8] = ff_avg_h264_qpel16_mc02_mmi;
c->avg_h264_qpel_pixels_tab[0][9] = ff_avg_h264_qpel16_mc12_mmi;
c->avg_h264_qpel_pixels_tab[0][10] = ff_avg_h264_qpel16_mc22_mmi;
c->avg_h264_qpel_pixels_tab[0][11] = ff_avg_h264_qpel16_mc32_mmi;
c->avg_h264_qpel_pixels_tab[0][12] = ff_avg_h264_qpel16_mc03_mmi;
c->avg_h264_qpel_pixels_tab[0][13] = ff_avg_h264_qpel16_mc13_mmi;
c->avg_h264_qpel_pixels_tab[0][14] = ff_avg_h264_qpel16_mc23_mmi;
c->avg_h264_qpel_pixels_tab[0][15] = ff_avg_h264_qpel16_mc33_mmi;
c->avg_h264_qpel_pixels_tab[1][0] = ff_avg_h264_qpel8_mc00_mmi;
c->avg_h264_qpel_pixels_tab[1][1] = ff_avg_h264_qpel8_mc10_mmi;
c->avg_h264_qpel_pixels_tab[1][2] = ff_avg_h264_qpel8_mc20_mmi;
c->avg_h264_qpel_pixels_tab[1][3] = ff_avg_h264_qpel8_mc30_mmi;
c->avg_h264_qpel_pixels_tab[1][4] = ff_avg_h264_qpel8_mc01_mmi;
c->avg_h264_qpel_pixels_tab[1][5] = ff_avg_h264_qpel8_mc11_mmi;
c->avg_h264_qpel_pixels_tab[1][6] = ff_avg_h264_qpel8_mc21_mmi;
c->avg_h264_qpel_pixels_tab[1][7] = ff_avg_h264_qpel8_mc31_mmi;
c->avg_h264_qpel_pixels_tab[1][8] = ff_avg_h264_qpel8_mc02_mmi;
c->avg_h264_qpel_pixels_tab[1][9] = ff_avg_h264_qpel8_mc12_mmi;
c->avg_h264_qpel_pixels_tab[1][10] = ff_avg_h264_qpel8_mc22_mmi;
c->avg_h264_qpel_pixels_tab[1][11] = ff_avg_h264_qpel8_mc32_mmi;
c->avg_h264_qpel_pixels_tab[1][12] = ff_avg_h264_qpel8_mc03_mmi;
c->avg_h264_qpel_pixels_tab[1][13] = ff_avg_h264_qpel8_mc13_mmi;
c->avg_h264_qpel_pixels_tab[1][14] = ff_avg_h264_qpel8_mc23_mmi;
c->avg_h264_qpel_pixels_tab[1][15] = ff_avg_h264_qpel8_mc33_mmi;
c->avg_h264_qpel_pixels_tab[2][0] = ff_avg_h264_qpel4_mc00_mmi;
c->avg_h264_qpel_pixels_tab[2][1] = ff_avg_h264_qpel4_mc10_mmi;
c->avg_h264_qpel_pixels_tab[2][2] = ff_avg_h264_qpel4_mc20_mmi;
c->avg_h264_qpel_pixels_tab[2][3] = ff_avg_h264_qpel4_mc30_mmi;
c->avg_h264_qpel_pixels_tab[2][4] = ff_avg_h264_qpel4_mc01_mmi;
c->avg_h264_qpel_pixels_tab[2][5] = ff_avg_h264_qpel4_mc11_mmi;
c->avg_h264_qpel_pixels_tab[2][6] = ff_avg_h264_qpel4_mc21_mmi;
c->avg_h264_qpel_pixels_tab[2][7] = ff_avg_h264_qpel4_mc31_mmi;
c->avg_h264_qpel_pixels_tab[2][8] = ff_avg_h264_qpel4_mc02_mmi;
c->avg_h264_qpel_pixels_tab[2][9] = ff_avg_h264_qpel4_mc12_mmi;
c->avg_h264_qpel_pixels_tab[2][10] = ff_avg_h264_qpel4_mc22_mmi;
c->avg_h264_qpel_pixels_tab[2][11] = ff_avg_h264_qpel4_mc32_mmi;
c->avg_h264_qpel_pixels_tab[2][12] = ff_avg_h264_qpel4_mc03_mmi;
c->avg_h264_qpel_pixels_tab[2][13] = ff_avg_h264_qpel4_mc13_mmi;
c->avg_h264_qpel_pixels_tab[2][14] = ff_avg_h264_qpel4_mc23_mmi;
c->avg_h264_qpel_pixels_tab[2][15] = ff_avg_h264_qpel4_mc33_mmi;
}
}
if (have_msa(cpu_flags)) {
if (bit_depth == 8) {
c->put_h264_qpel_pixels_tab[0][0] = ff_put_h264_qpel16_mc00_msa;
c->put_h264_qpel_pixels_tab[0][1] = ff_put_h264_qpel16_mc10_msa;
c->put_h264_qpel_pixels_tab[0][2] = ff_put_h264_qpel16_mc20_msa;
c->put_h264_qpel_pixels_tab[0][3] = ff_put_h264_qpel16_mc30_msa;
c->put_h264_qpel_pixels_tab[0][4] = ff_put_h264_qpel16_mc01_msa;
c->put_h264_qpel_pixels_tab[0][5] = ff_put_h264_qpel16_mc11_msa;
c->put_h264_qpel_pixels_tab[0][6] = ff_put_h264_qpel16_mc21_msa;
c->put_h264_qpel_pixels_tab[0][7] = ff_put_h264_qpel16_mc31_msa;
c->put_h264_qpel_pixels_tab[0][8] = ff_put_h264_qpel16_mc02_msa;
c->put_h264_qpel_pixels_tab[0][9] = ff_put_h264_qpel16_mc12_msa;
c->put_h264_qpel_pixels_tab[0][10] = ff_put_h264_qpel16_mc22_msa;
c->put_h264_qpel_pixels_tab[0][11] = ff_put_h264_qpel16_mc32_msa;
c->put_h264_qpel_pixels_tab[0][12] = ff_put_h264_qpel16_mc03_msa;
c->put_h264_qpel_pixels_tab[0][13] = ff_put_h264_qpel16_mc13_msa;
c->put_h264_qpel_pixels_tab[0][14] = ff_put_h264_qpel16_mc23_msa;
c->put_h264_qpel_pixels_tab[0][15] = ff_put_h264_qpel16_mc33_msa;
c->put_h264_qpel_pixels_tab[1][0] = ff_put_h264_qpel8_mc00_msa;
c->put_h264_qpel_pixels_tab[1][1] = ff_put_h264_qpel8_mc10_msa;
c->put_h264_qpel_pixels_tab[1][2] = ff_put_h264_qpel8_mc20_msa;
c->put_h264_qpel_pixels_tab[1][3] = ff_put_h264_qpel8_mc30_msa;
c->put_h264_qpel_pixels_tab[1][4] = ff_put_h264_qpel8_mc01_msa;
c->put_h264_qpel_pixels_tab[1][5] = ff_put_h264_qpel8_mc11_msa;
c->put_h264_qpel_pixels_tab[1][6] = ff_put_h264_qpel8_mc21_msa;
c->put_h264_qpel_pixels_tab[1][7] = ff_put_h264_qpel8_mc31_msa;
c->put_h264_qpel_pixels_tab[1][8] = ff_put_h264_qpel8_mc02_msa;
c->put_h264_qpel_pixels_tab[1][9] = ff_put_h264_qpel8_mc12_msa;
c->put_h264_qpel_pixels_tab[1][10] = ff_put_h264_qpel8_mc22_msa;
c->put_h264_qpel_pixels_tab[1][11] = ff_put_h264_qpel8_mc32_msa;
c->put_h264_qpel_pixels_tab[1][12] = ff_put_h264_qpel8_mc03_msa;
c->put_h264_qpel_pixels_tab[1][13] = ff_put_h264_qpel8_mc13_msa;
c->put_h264_qpel_pixels_tab[1][14] = ff_put_h264_qpel8_mc23_msa;
c->put_h264_qpel_pixels_tab[1][15] = ff_put_h264_qpel8_mc33_msa;
c->put_h264_qpel_pixels_tab[2][1] = ff_put_h264_qpel4_mc10_msa;
c->put_h264_qpel_pixels_tab[2][2] = ff_put_h264_qpel4_mc20_msa;
c->put_h264_qpel_pixels_tab[2][3] = ff_put_h264_qpel4_mc30_msa;
c->put_h264_qpel_pixels_tab[2][4] = ff_put_h264_qpel4_mc01_msa;
c->put_h264_qpel_pixels_tab[2][5] = ff_put_h264_qpel4_mc11_msa;
c->put_h264_qpel_pixels_tab[2][6] = ff_put_h264_qpel4_mc21_msa;
c->put_h264_qpel_pixels_tab[2][7] = ff_put_h264_qpel4_mc31_msa;
c->put_h264_qpel_pixels_tab[2][8] = ff_put_h264_qpel4_mc02_msa;
c->put_h264_qpel_pixels_tab[2][9] = ff_put_h264_qpel4_mc12_msa;
c->put_h264_qpel_pixels_tab[2][10] = ff_put_h264_qpel4_mc22_msa;
c->put_h264_qpel_pixels_tab[2][11] = ff_put_h264_qpel4_mc32_msa;
c->put_h264_qpel_pixels_tab[2][12] = ff_put_h264_qpel4_mc03_msa;
c->put_h264_qpel_pixels_tab[2][13] = ff_put_h264_qpel4_mc13_msa;
c->put_h264_qpel_pixels_tab[2][14] = ff_put_h264_qpel4_mc23_msa;
c->put_h264_qpel_pixels_tab[2][15] = ff_put_h264_qpel4_mc33_msa;
c->avg_h264_qpel_pixels_tab[0][0] = ff_avg_h264_qpel16_mc00_msa;
c->avg_h264_qpel_pixels_tab[0][1] = ff_avg_h264_qpel16_mc10_msa;
c->avg_h264_qpel_pixels_tab[0][2] = ff_avg_h264_qpel16_mc20_msa;
c->avg_h264_qpel_pixels_tab[0][3] = ff_avg_h264_qpel16_mc30_msa;
c->avg_h264_qpel_pixels_tab[0][4] = ff_avg_h264_qpel16_mc01_msa;
c->avg_h264_qpel_pixels_tab[0][5] = ff_avg_h264_qpel16_mc11_msa;
c->avg_h264_qpel_pixels_tab[0][6] = ff_avg_h264_qpel16_mc21_msa;
c->avg_h264_qpel_pixels_tab[0][7] = ff_avg_h264_qpel16_mc31_msa;
c->avg_h264_qpel_pixels_tab[0][8] = ff_avg_h264_qpel16_mc02_msa;
c->avg_h264_qpel_pixels_tab[0][9] = ff_avg_h264_qpel16_mc12_msa;
c->avg_h264_qpel_pixels_tab[0][10] = ff_avg_h264_qpel16_mc22_msa;
c->avg_h264_qpel_pixels_tab[0][11] = ff_avg_h264_qpel16_mc32_msa;
c->avg_h264_qpel_pixels_tab[0][12] = ff_avg_h264_qpel16_mc03_msa;
c->avg_h264_qpel_pixels_tab[0][13] = ff_avg_h264_qpel16_mc13_msa;
c->avg_h264_qpel_pixels_tab[0][14] = ff_avg_h264_qpel16_mc23_msa;
c->avg_h264_qpel_pixels_tab[0][15] = ff_avg_h264_qpel16_mc33_msa;
c->avg_h264_qpel_pixels_tab[1][0] = ff_avg_h264_qpel8_mc00_msa;
c->avg_h264_qpel_pixels_tab[1][1] = ff_avg_h264_qpel8_mc10_msa;
c->avg_h264_qpel_pixels_tab[1][2] = ff_avg_h264_qpel8_mc20_msa;
c->avg_h264_qpel_pixels_tab[1][3] = ff_avg_h264_qpel8_mc30_msa;
c->avg_h264_qpel_pixels_tab[1][4] = ff_avg_h264_qpel8_mc01_msa;
c->avg_h264_qpel_pixels_tab[1][5] = ff_avg_h264_qpel8_mc11_msa;
c->avg_h264_qpel_pixels_tab[1][6] = ff_avg_h264_qpel8_mc21_msa;
c->avg_h264_qpel_pixels_tab[1][7] = ff_avg_h264_qpel8_mc31_msa;
c->avg_h264_qpel_pixels_tab[1][8] = ff_avg_h264_qpel8_mc02_msa;
c->avg_h264_qpel_pixels_tab[1][9] = ff_avg_h264_qpel8_mc12_msa;
c->avg_h264_qpel_pixels_tab[1][10] = ff_avg_h264_qpel8_mc22_msa;
c->avg_h264_qpel_pixels_tab[1][11] = ff_avg_h264_qpel8_mc32_msa;
c->avg_h264_qpel_pixels_tab[1][12] = ff_avg_h264_qpel8_mc03_msa;
c->avg_h264_qpel_pixels_tab[1][13] = ff_avg_h264_qpel8_mc13_msa;
c->avg_h264_qpel_pixels_tab[1][14] = ff_avg_h264_qpel8_mc23_msa;
c->avg_h264_qpel_pixels_tab[1][15] = ff_avg_h264_qpel8_mc33_msa;
c->avg_h264_qpel_pixels_tab[2][0] = ff_avg_h264_qpel4_mc00_msa;
c->avg_h264_qpel_pixels_tab[2][1] = ff_avg_h264_qpel4_mc10_msa;
c->avg_h264_qpel_pixels_tab[2][2] = ff_avg_h264_qpel4_mc20_msa;
c->avg_h264_qpel_pixels_tab[2][3] = ff_avg_h264_qpel4_mc30_msa;
c->avg_h264_qpel_pixels_tab[2][4] = ff_avg_h264_qpel4_mc01_msa;
c->avg_h264_qpel_pixels_tab[2][5] = ff_avg_h264_qpel4_mc11_msa;
c->avg_h264_qpel_pixels_tab[2][6] = ff_avg_h264_qpel4_mc21_msa;
c->avg_h264_qpel_pixels_tab[2][7] = ff_avg_h264_qpel4_mc31_msa;
c->avg_h264_qpel_pixels_tab[2][8] = ff_avg_h264_qpel4_mc02_msa;
c->avg_h264_qpel_pixels_tab[2][9] = ff_avg_h264_qpel4_mc12_msa;
c->avg_h264_qpel_pixels_tab[2][10] = ff_avg_h264_qpel4_mc22_msa;
c->avg_h264_qpel_pixels_tab[2][11] = ff_avg_h264_qpel4_mc32_msa;
c->avg_h264_qpel_pixels_tab[2][12] = ff_avg_h264_qpel4_mc03_msa;
c->avg_h264_qpel_pixels_tab[2][13] = ff_avg_h264_qpel4_mc13_msa;
c->avg_h264_qpel_pixels_tab[2][14] = ff_avg_h264_qpel4_mc23_msa;
c->avg_h264_qpel_pixels_tab[2][15] = ff_avg_h264_qpel4_mc33_msa;
}
}
}

File diff suppressed because it is too large Load Diff

View File

@ -18,32 +18,28 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "libavutil/mips/cpu.h"
#include "config.h"
#include "libavutil/attributes.h"
#include "libavcodec/mips/hevcpred_mips.h"
#if HAVE_MSA
static av_cold void hevc_pred_init_msa(HEVCPredContext *c, const int bit_depth)
{
if (8 == bit_depth) {
c->intra_pred[2] = ff_intra_pred_8_16x16_msa;
c->intra_pred[3] = ff_intra_pred_8_32x32_msa;
c->pred_planar[0] = ff_hevc_intra_pred_planar_0_msa;
c->pred_planar[1] = ff_hevc_intra_pred_planar_1_msa;
c->pred_planar[2] = ff_hevc_intra_pred_planar_2_msa;
c->pred_planar[3] = ff_hevc_intra_pred_planar_3_msa;
c->pred_dc = ff_hevc_intra_pred_dc_msa;
c->pred_angular[0] = ff_pred_intra_pred_angular_0_msa;
c->pred_angular[1] = ff_pred_intra_pred_angular_1_msa;
c->pred_angular[2] = ff_pred_intra_pred_angular_2_msa;
c->pred_angular[3] = ff_pred_intra_pred_angular_3_msa;
}
}
#endif // #if HAVE_MSA
void ff_hevc_pred_init_mips(HEVCPredContext *c, const int bit_depth)
{
#if HAVE_MSA
hevc_pred_init_msa(c, bit_depth);
#endif // #if HAVE_MSA
int cpu_flags = av_get_cpu_flags();
if (have_msa(cpu_flags)) {
if (bit_depth == 8) {
c->intra_pred[2] = ff_intra_pred_8_16x16_msa;
c->intra_pred[3] = ff_intra_pred_8_32x32_msa;
c->pred_planar[0] = ff_hevc_intra_pred_planar_0_msa;
c->pred_planar[1] = ff_hevc_intra_pred_planar_1_msa;
c->pred_planar[2] = ff_hevc_intra_pred_planar_2_msa;
c->pred_planar[3] = ff_hevc_intra_pred_planar_3_msa;
c->pred_dc = ff_hevc_intra_pred_dc_msa;
c->pred_angular[0] = ff_pred_intra_pred_angular_0_msa;
c->pred_angular[1] = ff_pred_intra_pred_angular_1_msa;
c->pred_angular[2] = ff_pred_intra_pred_angular_2_msa;
c->pred_angular[3] = ff_pred_intra_pred_angular_3_msa;
}
}
}

View File

@ -19,104 +19,94 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "libavutil/mips/cpu.h"
#include "../hpeldsp.h"
#include "libavcodec/mips/hpeldsp_mips.h"
#if HAVE_MSA
static void ff_hpeldsp_init_msa(HpelDSPContext *c, int flags)
{
c->put_pixels_tab[0][0] = ff_put_pixels16_msa;
c->put_pixels_tab[0][1] = ff_put_pixels16_x2_msa;
c->put_pixels_tab[0][2] = ff_put_pixels16_y2_msa;
c->put_pixels_tab[0][3] = ff_put_pixels16_xy2_msa;
c->put_pixels_tab[1][0] = ff_put_pixels8_msa;
c->put_pixels_tab[1][1] = ff_put_pixels8_x2_msa;
c->put_pixels_tab[1][2] = ff_put_pixels8_y2_msa;
c->put_pixels_tab[1][3] = ff_put_pixels8_xy2_msa;
c->put_pixels_tab[2][1] = ff_put_pixels4_x2_msa;
c->put_pixels_tab[2][2] = ff_put_pixels4_y2_msa;
c->put_pixels_tab[2][3] = ff_put_pixels4_xy2_msa;
c->put_no_rnd_pixels_tab[0][0] = ff_put_pixels16_msa;
c->put_no_rnd_pixels_tab[0][1] = ff_put_no_rnd_pixels16_x2_msa;
c->put_no_rnd_pixels_tab[0][2] = ff_put_no_rnd_pixels16_y2_msa;
c->put_no_rnd_pixels_tab[0][3] = ff_put_no_rnd_pixels16_xy2_msa;
c->put_no_rnd_pixels_tab[1][0] = ff_put_pixels8_msa;
c->put_no_rnd_pixels_tab[1][1] = ff_put_no_rnd_pixels8_x2_msa;
c->put_no_rnd_pixels_tab[1][2] = ff_put_no_rnd_pixels8_y2_msa;
c->put_no_rnd_pixels_tab[1][3] = ff_put_no_rnd_pixels8_xy2_msa;
c->avg_pixels_tab[0][0] = ff_avg_pixels16_msa;
c->avg_pixels_tab[0][1] = ff_avg_pixels16_x2_msa;
c->avg_pixels_tab[0][2] = ff_avg_pixels16_y2_msa;
c->avg_pixels_tab[0][3] = ff_avg_pixels16_xy2_msa;
c->avg_pixels_tab[1][0] = ff_avg_pixels8_msa;
c->avg_pixels_tab[1][1] = ff_avg_pixels8_x2_msa;
c->avg_pixels_tab[1][2] = ff_avg_pixels8_y2_msa;
c->avg_pixels_tab[1][3] = ff_avg_pixels8_xy2_msa;
c->avg_pixels_tab[2][0] = ff_avg_pixels4_msa;
c->avg_pixels_tab[2][1] = ff_avg_pixels4_x2_msa;
c->avg_pixels_tab[2][2] = ff_avg_pixels4_y2_msa;
c->avg_pixels_tab[2][3] = ff_avg_pixels4_xy2_msa;
}
#endif // #if HAVE_MSA
#if HAVE_MMI
static void ff_hpeldsp_init_mmi(HpelDSPContext *c, int flags)
{
c->put_pixels_tab[0][0] = ff_put_pixels16_8_mmi;
c->put_pixels_tab[0][1] = ff_put_pixels16_x2_8_mmi;
c->put_pixels_tab[0][2] = ff_put_pixels16_y2_8_mmi;
c->put_pixels_tab[0][3] = ff_put_pixels16_xy2_8_mmi;
c->put_pixels_tab[1][0] = ff_put_pixels8_8_mmi;
c->put_pixels_tab[1][1] = ff_put_pixels8_x2_8_mmi;
c->put_pixels_tab[1][2] = ff_put_pixels8_y2_8_mmi;
c->put_pixels_tab[1][3] = ff_put_pixels8_xy2_8_mmi;
c->put_pixels_tab[2][0] = ff_put_pixels4_8_mmi;
c->put_pixels_tab[2][1] = ff_put_pixels4_x2_8_mmi;
c->put_pixels_tab[2][2] = ff_put_pixels4_y2_8_mmi;
c->put_pixels_tab[2][3] = ff_put_pixels4_xy2_8_mmi;
c->put_no_rnd_pixels_tab[0][0] = ff_put_pixels16_8_mmi;
c->put_no_rnd_pixels_tab[0][1] = ff_put_no_rnd_pixels16_x2_8_mmi;
c->put_no_rnd_pixels_tab[0][2] = ff_put_no_rnd_pixels16_y2_8_mmi;
c->put_no_rnd_pixels_tab[0][3] = ff_put_no_rnd_pixels16_xy2_8_mmi;
c->put_no_rnd_pixels_tab[1][0] = ff_put_pixels8_8_mmi;
c->put_no_rnd_pixels_tab[1][1] = ff_put_no_rnd_pixels8_x2_8_mmi;
c->put_no_rnd_pixels_tab[1][2] = ff_put_no_rnd_pixels8_y2_8_mmi;
c->put_no_rnd_pixels_tab[1][3] = ff_put_no_rnd_pixels8_xy2_8_mmi;
c->avg_pixels_tab[0][0] = ff_avg_pixels16_8_mmi;
c->avg_pixels_tab[0][1] = ff_avg_pixels16_x2_8_mmi;
c->avg_pixels_tab[0][2] = ff_avg_pixels16_y2_8_mmi;
c->avg_pixels_tab[0][3] = ff_avg_pixels16_xy2_8_mmi;
c->avg_pixels_tab[1][0] = ff_avg_pixels8_8_mmi;
c->avg_pixels_tab[1][1] = ff_avg_pixels8_x2_8_mmi;
c->avg_pixels_tab[1][2] = ff_avg_pixels8_y2_8_mmi;
c->avg_pixels_tab[1][3] = ff_avg_pixels8_xy2_8_mmi;
c->avg_pixels_tab[2][0] = ff_avg_pixels4_8_mmi;
c->avg_pixels_tab[2][1] = ff_avg_pixels4_x2_8_mmi;
c->avg_pixels_tab[2][2] = ff_avg_pixels4_y2_8_mmi;
c->avg_pixels_tab[2][3] = ff_avg_pixels4_xy2_8_mmi;
}
#endif // #if HAVE_MMI
void ff_hpeldsp_init_mips(HpelDSPContext *c, int flags)
{
#if HAVE_MMI
ff_hpeldsp_init_mmi(c, flags);
#endif // #if HAVE_MMI
#if HAVE_MSA
ff_hpeldsp_init_msa(c, flags);
#endif // #if HAVE_MSA
int cpu_flags = av_get_cpu_flags();
if (have_mmi(cpu_flags)) {
c->put_pixels_tab[0][0] = ff_put_pixels16_8_mmi;
c->put_pixels_tab[0][1] = ff_put_pixels16_x2_8_mmi;
c->put_pixels_tab[0][2] = ff_put_pixels16_y2_8_mmi;
c->put_pixels_tab[0][3] = ff_put_pixels16_xy2_8_mmi;
c->put_pixels_tab[1][0] = ff_put_pixels8_8_mmi;
c->put_pixels_tab[1][1] = ff_put_pixels8_x2_8_mmi;
c->put_pixels_tab[1][2] = ff_put_pixels8_y2_8_mmi;
c->put_pixels_tab[1][3] = ff_put_pixels8_xy2_8_mmi;
c->put_pixels_tab[2][0] = ff_put_pixels4_8_mmi;
c->put_pixels_tab[2][1] = ff_put_pixels4_x2_8_mmi;
c->put_pixels_tab[2][2] = ff_put_pixels4_y2_8_mmi;
c->put_pixels_tab[2][3] = ff_put_pixels4_xy2_8_mmi;
c->put_no_rnd_pixels_tab[0][0] = ff_put_pixels16_8_mmi;
c->put_no_rnd_pixels_tab[0][1] = ff_put_no_rnd_pixels16_x2_8_mmi;
c->put_no_rnd_pixels_tab[0][2] = ff_put_no_rnd_pixels16_y2_8_mmi;
c->put_no_rnd_pixels_tab[0][3] = ff_put_no_rnd_pixels16_xy2_8_mmi;
c->put_no_rnd_pixels_tab[1][0] = ff_put_pixels8_8_mmi;
c->put_no_rnd_pixels_tab[1][1] = ff_put_no_rnd_pixels8_x2_8_mmi;
c->put_no_rnd_pixels_tab[1][2] = ff_put_no_rnd_pixels8_y2_8_mmi;
c->put_no_rnd_pixels_tab[1][3] = ff_put_no_rnd_pixels8_xy2_8_mmi;
c->avg_pixels_tab[0][0] = ff_avg_pixels16_8_mmi;
c->avg_pixels_tab[0][1] = ff_avg_pixels16_x2_8_mmi;
c->avg_pixels_tab[0][2] = ff_avg_pixels16_y2_8_mmi;
c->avg_pixels_tab[0][3] = ff_avg_pixels16_xy2_8_mmi;
c->avg_pixels_tab[1][0] = ff_avg_pixels8_8_mmi;
c->avg_pixels_tab[1][1] = ff_avg_pixels8_x2_8_mmi;
c->avg_pixels_tab[1][2] = ff_avg_pixels8_y2_8_mmi;
c->avg_pixels_tab[1][3] = ff_avg_pixels8_xy2_8_mmi;
c->avg_pixels_tab[2][0] = ff_avg_pixels4_8_mmi;
c->avg_pixels_tab[2][1] = ff_avg_pixels4_x2_8_mmi;
c->avg_pixels_tab[2][2] = ff_avg_pixels4_y2_8_mmi;
c->avg_pixels_tab[2][3] = ff_avg_pixels4_xy2_8_mmi;
}
if (have_msa(cpu_flags)) {
c->put_pixels_tab[0][0] = ff_put_pixels16_msa;
c->put_pixels_tab[0][1] = ff_put_pixels16_x2_msa;
c->put_pixels_tab[0][2] = ff_put_pixels16_y2_msa;
c->put_pixels_tab[0][3] = ff_put_pixels16_xy2_msa;
c->put_pixels_tab[1][0] = ff_put_pixels8_msa;
c->put_pixels_tab[1][1] = ff_put_pixels8_x2_msa;
c->put_pixels_tab[1][2] = ff_put_pixels8_y2_msa;
c->put_pixels_tab[1][3] = ff_put_pixels8_xy2_msa;
c->put_pixels_tab[2][1] = ff_put_pixels4_x2_msa;
c->put_pixels_tab[2][2] = ff_put_pixels4_y2_msa;
c->put_pixels_tab[2][3] = ff_put_pixels4_xy2_msa;
c->put_no_rnd_pixels_tab[0][0] = ff_put_pixels16_msa;
c->put_no_rnd_pixels_tab[0][1] = ff_put_no_rnd_pixels16_x2_msa;
c->put_no_rnd_pixels_tab[0][2] = ff_put_no_rnd_pixels16_y2_msa;
c->put_no_rnd_pixels_tab[0][3] = ff_put_no_rnd_pixels16_xy2_msa;
c->put_no_rnd_pixels_tab[1][0] = ff_put_pixels8_msa;
c->put_no_rnd_pixels_tab[1][1] = ff_put_no_rnd_pixels8_x2_msa;
c->put_no_rnd_pixels_tab[1][2] = ff_put_no_rnd_pixels8_y2_msa;
c->put_no_rnd_pixels_tab[1][3] = ff_put_no_rnd_pixels8_xy2_msa;
c->avg_pixels_tab[0][0] = ff_avg_pixels16_msa;
c->avg_pixels_tab[0][1] = ff_avg_pixels16_x2_msa;
c->avg_pixels_tab[0][2] = ff_avg_pixels16_y2_msa;
c->avg_pixels_tab[0][3] = ff_avg_pixels16_xy2_msa;
c->avg_pixels_tab[1][0] = ff_avg_pixels8_msa;
c->avg_pixels_tab[1][1] = ff_avg_pixels8_x2_msa;
c->avg_pixels_tab[1][2] = ff_avg_pixels8_y2_msa;
c->avg_pixels_tab[1][3] = ff_avg_pixels8_xy2_msa;
c->avg_pixels_tab[2][0] = ff_avg_pixels4_msa;
c->avg_pixels_tab[2][1] = ff_avg_pixels4_x2_msa;
c->avg_pixels_tab[2][2] = ff_avg_pixels4_y2_msa;
c->avg_pixels_tab[2][3] = ff_avg_pixels4_xy2_msa;
}
}

View File

@ -19,56 +19,44 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "libavutil/mips/cpu.h"
#include "idctdsp_mips.h"
#include "xvididct_mips.h"
#if HAVE_MSA
static av_cold void idctdsp_init_msa(IDCTDSPContext *c, AVCodecContext *avctx,
unsigned high_bit_depth)
{
if ((avctx->lowres != 1) && (avctx->lowres != 2) && (avctx->lowres != 3) &&
(avctx->bits_per_raw_sample != 10) &&
(avctx->bits_per_raw_sample != 12) &&
(avctx->idct_algo == FF_IDCT_AUTO)) {
c->idct_put = ff_simple_idct_put_msa;
c->idct_add = ff_simple_idct_add_msa;
c->idct = ff_simple_idct_msa;
c->perm_type = FF_IDCT_PERM_NONE;
}
c->put_pixels_clamped = ff_put_pixels_clamped_msa;
c->put_signed_pixels_clamped = ff_put_signed_pixels_clamped_msa;
c->add_pixels_clamped = ff_add_pixels_clamped_msa;
}
#endif // #if HAVE_MSA
#if HAVE_MMI
static av_cold void idctdsp_init_mmi(IDCTDSPContext *c, AVCodecContext *avctx,
unsigned high_bit_depth)
{
if ((avctx->lowres != 1) && (avctx->lowres != 2) && (avctx->lowres != 3) &&
(avctx->bits_per_raw_sample != 10) &&
(avctx->bits_per_raw_sample != 12) &&
((avctx->idct_algo == FF_IDCT_AUTO) || (avctx->idct_algo == FF_IDCT_SIMPLE))) {
c->idct_put = ff_simple_idct_put_8_mmi;
c->idct_add = ff_simple_idct_add_8_mmi;
c->idct = ff_simple_idct_8_mmi;
c->perm_type = FF_IDCT_PERM_NONE;
}
c->put_pixels_clamped = ff_put_pixels_clamped_mmi;
c->add_pixels_clamped = ff_add_pixels_clamped_mmi;
c->put_signed_pixels_clamped = ff_put_signed_pixels_clamped_mmi;
}
#endif /* HAVE_MMI */
av_cold void ff_idctdsp_init_mips(IDCTDSPContext *c, AVCodecContext *avctx,
unsigned high_bit_depth)
{
#if HAVE_MMI
idctdsp_init_mmi(c, avctx, high_bit_depth);
#endif /* HAVE_MMI */
#if HAVE_MSA
idctdsp_init_msa(c, avctx, high_bit_depth);
#endif // #if HAVE_MSA
int cpu_flags = av_get_cpu_flags();
if (have_mmi(cpu_flags)) {
if ((avctx->lowres != 1) && (avctx->lowres != 2) && (avctx->lowres != 3) &&
(avctx->bits_per_raw_sample != 10) &&
(avctx->bits_per_raw_sample != 12) &&
((avctx->idct_algo == FF_IDCT_AUTO) || (avctx->idct_algo == FF_IDCT_SIMPLE))) {
c->idct_put = ff_simple_idct_put_8_mmi;
c->idct_add = ff_simple_idct_add_8_mmi;
c->idct = ff_simple_idct_8_mmi;
c->perm_type = FF_IDCT_PERM_NONE;
}
c->put_pixels_clamped = ff_put_pixels_clamped_mmi;
c->add_pixels_clamped = ff_add_pixels_clamped_mmi;
c->put_signed_pixels_clamped = ff_put_signed_pixels_clamped_mmi;
}
if (have_msa(cpu_flags)) {
if ((avctx->lowres != 1) && (avctx->lowres != 2) && (avctx->lowres != 3) &&
(avctx->bits_per_raw_sample != 10) &&
(avctx->bits_per_raw_sample != 12) &&
(avctx->idct_algo == FF_IDCT_AUTO)) {
c->idct_put = ff_simple_idct_put_msa;
c->idct_add = ff_simple_idct_add_msa;
c->idct = ff_simple_idct_msa;
c->perm_type = FF_IDCT_PERM_NONE;
}
c->put_pixels_clamped = ff_put_pixels_clamped_msa;
c->put_signed_pixels_clamped = ff_put_signed_pixels_clamped_msa;
c->add_pixels_clamped = ff_add_pixels_clamped_msa;
}
}

View File

@ -18,39 +18,35 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "libavutil/mips/cpu.h"
#include "me_cmp_mips.h"
#if HAVE_MSA
static av_cold void me_cmp_msa(MECmpContext *c, AVCodecContext *avctx)
{
#if BIT_DEPTH == 8
c->pix_abs[0][0] = ff_pix_abs16_msa;
c->pix_abs[0][1] = ff_pix_abs16_x2_msa;
c->pix_abs[0][2] = ff_pix_abs16_y2_msa;
c->pix_abs[0][3] = ff_pix_abs16_xy2_msa;
c->pix_abs[1][0] = ff_pix_abs8_msa;
c->pix_abs[1][1] = ff_pix_abs8_x2_msa;
c->pix_abs[1][2] = ff_pix_abs8_y2_msa;
c->pix_abs[1][3] = ff_pix_abs8_xy2_msa;
c->hadamard8_diff[0] = ff_hadamard8_diff16_msa;
c->hadamard8_diff[1] = ff_hadamard8_diff8x8_msa;
c->hadamard8_diff[4] = ff_hadamard8_intra16_msa;
c->hadamard8_diff[5] = ff_hadamard8_intra8x8_msa;
c->sad[0] = ff_pix_abs16_msa;
c->sad[1] = ff_pix_abs8_msa;
c->sse[0] = ff_sse16_msa;
c->sse[1] = ff_sse8_msa;
c->sse[2] = ff_sse4_msa;
#endif
}
#endif // #if HAVE_MSA
av_cold void ff_me_cmp_init_mips(MECmpContext *c, AVCodecContext *avctx)
{
#if HAVE_MSA
me_cmp_msa(c, avctx);
#endif // #if HAVE_MSA
int cpu_flags = av_get_cpu_flags();
if (have_msa(cpu_flags)) {
#if BIT_DEPTH == 8
c->pix_abs[0][0] = ff_pix_abs16_msa;
c->pix_abs[0][1] = ff_pix_abs16_x2_msa;
c->pix_abs[0][2] = ff_pix_abs16_y2_msa;
c->pix_abs[0][3] = ff_pix_abs16_xy2_msa;
c->pix_abs[1][0] = ff_pix_abs8_msa;
c->pix_abs[1][1] = ff_pix_abs8_x2_msa;
c->pix_abs[1][2] = ff_pix_abs8_y2_msa;
c->pix_abs[1][3] = ff_pix_abs8_xy2_msa;
c->hadamard8_diff[0] = ff_hadamard8_diff16_msa;
c->hadamard8_diff[1] = ff_hadamard8_diff8x8_msa;
c->hadamard8_diff[4] = ff_hadamard8_intra16_msa;
c->hadamard8_diff[5] = ff_hadamard8_intra8x8_msa;
c->sad[0] = ff_pix_abs16_msa;
c->sad[1] = ff_pix_abs8_msa;
c->sse[0] = ff_sse16_msa;
c->sse[1] = ff_sse8_msa;
c->sse[2] = ff_sse4_msa;
#endif
}
}

View File

@ -18,41 +18,31 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "libavutil/mips/cpu.h"
#include "h263dsp_mips.h"
#include "mpegvideo_mips.h"
#if HAVE_MSA
static av_cold void dct_unquantize_init_msa(MpegEncContext *s)
{
s->dct_unquantize_h263_intra = ff_dct_unquantize_h263_intra_msa;
s->dct_unquantize_h263_inter = ff_dct_unquantize_h263_inter_msa;
if (!s->q_scale_type)
s->dct_unquantize_mpeg2_inter = ff_dct_unquantize_mpeg2_inter_msa;
}
#endif // #if HAVE_MSA
#if HAVE_MMI
static av_cold void dct_unquantize_init_mmi(MpegEncContext *s)
{
s->dct_unquantize_h263_intra = ff_dct_unquantize_h263_intra_mmi;
s->dct_unquantize_h263_inter = ff_dct_unquantize_h263_inter_mmi;
s->dct_unquantize_mpeg1_intra = ff_dct_unquantize_mpeg1_intra_mmi;
s->dct_unquantize_mpeg1_inter = ff_dct_unquantize_mpeg1_inter_mmi;
if (!(s->avctx->flags & AV_CODEC_FLAG_BITEXACT))
if (!s->q_scale_type)
s->dct_unquantize_mpeg2_intra = ff_dct_unquantize_mpeg2_intra_mmi;
s->denoise_dct= ff_denoise_dct_mmi;
}
#endif /* HAVE_MMI */
av_cold void ff_mpv_common_init_mips(MpegEncContext *s)
{
#if HAVE_MMI
dct_unquantize_init_mmi(s);
#endif /* HAVE_MMI */
#if HAVE_MSA
dct_unquantize_init_msa(s);
#endif // #if HAVE_MSA
int cpu_flags = av_get_cpu_flags();
if (have_mmi(cpu_flags)) {
s->dct_unquantize_h263_intra = ff_dct_unquantize_h263_intra_mmi;
s->dct_unquantize_h263_inter = ff_dct_unquantize_h263_inter_mmi;
s->dct_unquantize_mpeg1_intra = ff_dct_unquantize_mpeg1_intra_mmi;
s->dct_unquantize_mpeg1_inter = ff_dct_unquantize_mpeg1_inter_mmi;
if (!(s->avctx->flags & AV_CODEC_FLAG_BITEXACT))
if (!s->q_scale_type)
s->dct_unquantize_mpeg2_intra = ff_dct_unquantize_mpeg2_intra_mmi;
s->denoise_dct= ff_denoise_dct_mmi;
}
if (have_msa(cpu_flags)) {
s->dct_unquantize_h263_intra = ff_dct_unquantize_h263_intra_msa;
s->dct_unquantize_h263_inter = ff_dct_unquantize_h263_inter_msa;
if (!s->q_scale_type)
s->dct_unquantize_mpeg2_inter = ff_dct_unquantize_mpeg2_inter_msa;
}
}

View File

@ -18,23 +18,18 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "libavutil/mips/cpu.h"
#include "libavcodec/bit_depth_template.c"
#include "h263dsp_mips.h"
#if HAVE_MSA
static av_cold void mpegvideoencdsp_init_msa(MpegvideoEncDSPContext *c,
AVCodecContext *avctx)
{
#if BIT_DEPTH == 8
c->pix_sum = ff_pix_sum_msa;
#endif
}
#endif // #if HAVE_MSA
av_cold void ff_mpegvideoencdsp_init_mips(MpegvideoEncDSPContext *c,
AVCodecContext *avctx)
{
#if HAVE_MSA
mpegvideoencdsp_init_msa(c, avctx);
#endif // #if HAVE_MSA
int cpu_flags = av_get_cpu_flags();
if (have_msa(cpu_flags)) {
#if BIT_DEPTH == 8
c->pix_sum = ff_pix_sum_msa;
#endif
}
}

View File

@ -19,51 +19,38 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "libavutil/mips/cpu.h"
#include "pixblockdsp_mips.h"
#if HAVE_MSA
static av_cold void pixblockdsp_init_msa(PixblockDSPContext *c,
AVCodecContext *avctx,
unsigned high_bit_depth)
{
c->diff_pixels = ff_diff_pixels_msa;
switch (avctx->bits_per_raw_sample) {
case 9:
case 10:
case 12:
case 14:
c->get_pixels = ff_get_pixels_16_msa;
break;
default:
if (avctx->bits_per_raw_sample <= 8 || avctx->codec_type !=
AVMEDIA_TYPE_VIDEO) {
c->get_pixels = ff_get_pixels_8_msa;
}
break;
}
}
#endif // #if HAVE_MSA
#if HAVE_MMI
static av_cold void pixblockdsp_init_mmi(PixblockDSPContext *c,
AVCodecContext *avctx, unsigned high_bit_depth)
{
c->diff_pixels = ff_diff_pixels_mmi;
if (!high_bit_depth || avctx->codec_type != AVMEDIA_TYPE_VIDEO) {
c->get_pixels = ff_get_pixels_8_mmi;
}
}
#endif /* HAVE_MMI */
void ff_pixblockdsp_init_mips(PixblockDSPContext *c, AVCodecContext *avctx,
unsigned high_bit_depth)
{
#if HAVE_MMI
pixblockdsp_init_mmi(c, avctx, high_bit_depth);
#endif /* HAVE_MMI */
#if HAVE_MSA
pixblockdsp_init_msa(c, avctx, high_bit_depth);
#endif // #if HAVE_MSA
int cpu_flags = av_get_cpu_flags();
if (have_mmi(cpu_flags)) {
c->diff_pixels = ff_diff_pixels_mmi;
if (!high_bit_depth || avctx->codec_type != AVMEDIA_TYPE_VIDEO) {
c->get_pixels = ff_get_pixels_8_mmi;
}
}
if (have_msa(cpu_flags)) {
c->diff_pixels = ff_diff_pixels_msa;
switch (avctx->bits_per_raw_sample) {
case 9:
case 10:
case 12:
case 14:
c->get_pixels = ff_get_pixels_16_msa;
break;
default:
if (avctx->bits_per_raw_sample <= 8 || avctx->codec_type !=
AVMEDIA_TYPE_VIDEO) {
c->get_pixels = ff_get_pixels_8_msa;
}
break;
}
}
}

View File

@ -18,150 +18,146 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "libavutil/mips/cpu.h"
#include "qpeldsp_mips.h"
#if HAVE_MSA
static av_cold void qpeldsp_init_msa(QpelDSPContext *c)
{
c->put_qpel_pixels_tab[0][0] = ff_copy_16x16_msa;
c->put_qpel_pixels_tab[0][1] = ff_horiz_mc_qpel_aver_src0_16width_msa;
c->put_qpel_pixels_tab[0][2] = ff_horiz_mc_qpel_16width_msa;
c->put_qpel_pixels_tab[0][3] = ff_horiz_mc_qpel_aver_src1_16width_msa;
c->put_qpel_pixels_tab[0][4] = ff_vert_mc_qpel_aver_src0_16x16_msa;
c->put_qpel_pixels_tab[0][5] = ff_hv_mc_qpel_aver_hv_src00_16x16_msa;
c->put_qpel_pixels_tab[0][6] = ff_hv_mc_qpel_aver_v_src0_16x16_msa;
c->put_qpel_pixels_tab[0][7] = ff_hv_mc_qpel_aver_hv_src10_16x16_msa;
c->put_qpel_pixels_tab[0][8] = ff_vert_mc_qpel_16x16_msa;
c->put_qpel_pixels_tab[0][9] = ff_hv_mc_qpel_aver_h_src0_16x16_msa;
c->put_qpel_pixels_tab[0][10] = ff_hv_mc_qpel_16x16_msa;
c->put_qpel_pixels_tab[0][11] = ff_hv_mc_qpel_aver_h_src1_16x16_msa;
c->put_qpel_pixels_tab[0][12] = ff_vert_mc_qpel_aver_src1_16x16_msa;
c->put_qpel_pixels_tab[0][13] = ff_hv_mc_qpel_aver_hv_src01_16x16_msa;
c->put_qpel_pixels_tab[0][14] = ff_hv_mc_qpel_aver_v_src1_16x16_msa;
c->put_qpel_pixels_tab[0][15] = ff_hv_mc_qpel_aver_hv_src11_16x16_msa;
c->put_qpel_pixels_tab[1][0] = ff_copy_8x8_msa;
c->put_qpel_pixels_tab[1][1] = ff_horiz_mc_qpel_aver_src0_8width_msa;
c->put_qpel_pixels_tab[1][2] = ff_horiz_mc_qpel_8width_msa;
c->put_qpel_pixels_tab[1][3] = ff_horiz_mc_qpel_aver_src1_8width_msa;
c->put_qpel_pixels_tab[1][4] = ff_vert_mc_qpel_aver_src0_8x8_msa;
c->put_qpel_pixels_tab[1][5] = ff_hv_mc_qpel_aver_hv_src00_8x8_msa;
c->put_qpel_pixels_tab[1][6] = ff_hv_mc_qpel_aver_v_src0_8x8_msa;
c->put_qpel_pixels_tab[1][7] = ff_hv_mc_qpel_aver_hv_src10_8x8_msa;
c->put_qpel_pixels_tab[1][8] = ff_vert_mc_qpel_8x8_msa;
c->put_qpel_pixels_tab[1][9] = ff_hv_mc_qpel_aver_h_src0_8x8_msa;
c->put_qpel_pixels_tab[1][10] = ff_hv_mc_qpel_8x8_msa;
c->put_qpel_pixels_tab[1][11] = ff_hv_mc_qpel_aver_h_src1_8x8_msa;
c->put_qpel_pixels_tab[1][12] = ff_vert_mc_qpel_aver_src1_8x8_msa;
c->put_qpel_pixels_tab[1][13] = ff_hv_mc_qpel_aver_hv_src01_8x8_msa;
c->put_qpel_pixels_tab[1][14] = ff_hv_mc_qpel_aver_v_src1_8x8_msa;
c->put_qpel_pixels_tab[1][15] = ff_hv_mc_qpel_aver_hv_src11_8x8_msa;
c->put_no_rnd_qpel_pixels_tab[0][0] = ff_copy_16x16_msa;
c->put_no_rnd_qpel_pixels_tab[0][1] =
ff_horiz_mc_qpel_no_rnd_aver_src0_16width_msa;
c->put_no_rnd_qpel_pixels_tab[0][2] = ff_horiz_mc_qpel_no_rnd_16width_msa;
c->put_no_rnd_qpel_pixels_tab[0][3] =
ff_horiz_mc_qpel_no_rnd_aver_src1_16width_msa;
c->put_no_rnd_qpel_pixels_tab[0][4] =
ff_vert_mc_qpel_no_rnd_aver_src0_16x16_msa;
c->put_no_rnd_qpel_pixels_tab[0][5] =
ff_hv_mc_qpel_no_rnd_aver_hv_src00_16x16_msa;
c->put_no_rnd_qpel_pixels_tab[0][6] =
ff_hv_mc_qpel_no_rnd_aver_v_src0_16x16_msa;
c->put_no_rnd_qpel_pixels_tab[0][7] =
ff_hv_mc_qpel_no_rnd_aver_hv_src10_16x16_msa;
c->put_no_rnd_qpel_pixels_tab[0][8] = ff_vert_mc_qpel_no_rnd_16x16_msa;
c->put_no_rnd_qpel_pixels_tab[0][9] =
ff_hv_mc_qpel_no_rnd_aver_h_src0_16x16_msa;
c->put_no_rnd_qpel_pixels_tab[0][10] = ff_hv_mc_qpel_no_rnd_16x16_msa;
c->put_no_rnd_qpel_pixels_tab[0][11] =
ff_hv_mc_qpel_no_rnd_aver_h_src1_16x16_msa;
c->put_no_rnd_qpel_pixels_tab[0][12] =
ff_vert_mc_qpel_no_rnd_aver_src1_16x16_msa;
c->put_no_rnd_qpel_pixels_tab[0][13] =
ff_hv_mc_qpel_no_rnd_aver_hv_src01_16x16_msa;
c->put_no_rnd_qpel_pixels_tab[0][14] =
ff_hv_mc_qpel_no_rnd_aver_v_src1_16x16_msa;
c->put_no_rnd_qpel_pixels_tab[0][15] =
ff_hv_mc_qpel_no_rnd_aver_hv_src11_16x16_msa;
c->put_no_rnd_qpel_pixels_tab[1][0] = ff_copy_8x8_msa;
c->put_no_rnd_qpel_pixels_tab[1][1] =
ff_horiz_mc_qpel_no_rnd_aver_src0_8width_msa;
c->put_no_rnd_qpel_pixels_tab[1][2] = ff_horiz_mc_qpel_no_rnd_8width_msa;
c->put_no_rnd_qpel_pixels_tab[1][3] =
ff_horiz_mc_qpel_no_rnd_aver_src1_8width_msa;
c->put_no_rnd_qpel_pixels_tab[1][4] =
ff_vert_mc_qpel_no_rnd_aver_src0_8x8_msa;
c->put_no_rnd_qpel_pixels_tab[1][5] =
ff_hv_mc_qpel_no_rnd_aver_hv_src00_8x8_msa;
c->put_no_rnd_qpel_pixels_tab[1][6] =
ff_hv_mc_qpel_no_rnd_aver_v_src0_8x8_msa;
c->put_no_rnd_qpel_pixels_tab[1][7] =
ff_hv_mc_qpel_no_rnd_aver_hv_src10_8x8_msa;
c->put_no_rnd_qpel_pixels_tab[1][8] = ff_vert_mc_qpel_no_rnd_8x8_msa;
c->put_no_rnd_qpel_pixels_tab[1][9] =
ff_hv_mc_qpel_no_rnd_aver_h_src0_8x8_msa;
c->put_no_rnd_qpel_pixels_tab[1][10] = ff_hv_mc_qpel_no_rnd_8x8_msa;
c->put_no_rnd_qpel_pixels_tab[1][11] =
ff_hv_mc_qpel_no_rnd_aver_h_src1_8x8_msa;
c->put_no_rnd_qpel_pixels_tab[1][12] =
ff_vert_mc_qpel_no_rnd_aver_src1_8x8_msa;
c->put_no_rnd_qpel_pixels_tab[1][13] =
ff_hv_mc_qpel_no_rnd_aver_hv_src01_8x8_msa;
c->put_no_rnd_qpel_pixels_tab[1][14] =
ff_hv_mc_qpel_no_rnd_aver_v_src1_8x8_msa;
c->put_no_rnd_qpel_pixels_tab[1][15] =
ff_hv_mc_qpel_no_rnd_aver_hv_src11_8x8_msa;
c->avg_qpel_pixels_tab[0][0] = ff_avg_width16_msa;
c->avg_qpel_pixels_tab[0][1] =
ff_horiz_mc_qpel_avg_dst_aver_src0_16width_msa;
c->avg_qpel_pixels_tab[0][2] = ff_horiz_mc_qpel_avg_dst_16width_msa;
c->avg_qpel_pixels_tab[0][3] =
ff_horiz_mc_qpel_avg_dst_aver_src1_16width_msa;
c->avg_qpel_pixels_tab[0][4] = ff_vert_mc_qpel_avg_dst_aver_src0_16x16_msa;
c->avg_qpel_pixels_tab[0][5] =
ff_hv_mc_qpel_avg_dst_aver_hv_src00_16x16_msa;
c->avg_qpel_pixels_tab[0][6] = ff_hv_mc_qpel_avg_dst_aver_v_src0_16x16_msa;
c->avg_qpel_pixels_tab[0][7] =
ff_hv_mc_qpel_avg_dst_aver_hv_src10_16x16_msa;
c->avg_qpel_pixels_tab[0][8] = ff_vert_mc_qpel_avg_dst_16x16_msa;
c->avg_qpel_pixels_tab[0][9] = ff_hv_mc_qpel_avg_dst_aver_h_src0_16x16_msa;
c->avg_qpel_pixels_tab[0][10] = ff_hv_mc_qpel_avg_dst_16x16_msa;
c->avg_qpel_pixels_tab[0][11] = ff_hv_mc_qpel_avg_dst_aver_h_src1_16x16_msa;
c->avg_qpel_pixels_tab[0][12] = ff_vert_mc_qpel_avg_dst_aver_src1_16x16_msa;
c->avg_qpel_pixels_tab[0][13] =
ff_hv_mc_qpel_avg_dst_aver_hv_src01_16x16_msa;
c->avg_qpel_pixels_tab[0][14] = ff_hv_mc_qpel_avg_dst_aver_v_src1_16x16_msa;
c->avg_qpel_pixels_tab[0][15] =
ff_hv_mc_qpel_avg_dst_aver_hv_src11_16x16_msa;
c->avg_qpel_pixels_tab[1][0] = ff_avg_width8_msa;
c->avg_qpel_pixels_tab[1][1] =
ff_horiz_mc_qpel_avg_dst_aver_src0_8width_msa;
c->avg_qpel_pixels_tab[1][2] = ff_horiz_mc_qpel_avg_dst_8width_msa;
c->avg_qpel_pixels_tab[1][3] =
ff_horiz_mc_qpel_avg_dst_aver_src1_8width_msa;
c->avg_qpel_pixels_tab[1][4] = ff_vert_mc_qpel_avg_dst_aver_src0_8x8_msa;
c->avg_qpel_pixels_tab[1][5] = ff_hv_mc_qpel_avg_dst_aver_hv_src00_8x8_msa;
c->avg_qpel_pixels_tab[1][6] = ff_hv_mc_qpel_avg_dst_aver_v_src0_8x8_msa;
c->avg_qpel_pixels_tab[1][7] = ff_hv_mc_qpel_avg_dst_aver_hv_src10_8x8_msa;
c->avg_qpel_pixels_tab[1][8] = ff_vert_mc_qpel_avg_dst_8x8_msa;
c->avg_qpel_pixels_tab[1][9] = ff_hv_mc_qpel_avg_dst_aver_h_src0_8x8_msa;
c->avg_qpel_pixels_tab[1][10] = ff_hv_mc_qpel_avg_dst_8x8_msa;
c->avg_qpel_pixels_tab[1][11] = ff_hv_mc_qpel_avg_dst_aver_h_src1_8x8_msa;
c->avg_qpel_pixels_tab[1][12] = ff_vert_mc_qpel_avg_dst_aver_src1_8x8_msa;
c->avg_qpel_pixels_tab[1][13] = ff_hv_mc_qpel_avg_dst_aver_hv_src01_8x8_msa;
c->avg_qpel_pixels_tab[1][14] = ff_hv_mc_qpel_avg_dst_aver_v_src1_8x8_msa;
c->avg_qpel_pixels_tab[1][15] = ff_hv_mc_qpel_avg_dst_aver_hv_src11_8x8_msa;
}
#endif // #if HAVE_MSA
void ff_qpeldsp_init_mips(QpelDSPContext *c)
{
#if HAVE_MSA
qpeldsp_init_msa(c);
#endif // #if HAVE_MSA
int cpu_flags = av_get_cpu_flags();
if (have_msa(cpu_flags)) {
c->put_qpel_pixels_tab[0][0] = ff_copy_16x16_msa;
c->put_qpel_pixels_tab[0][1] = ff_horiz_mc_qpel_aver_src0_16width_msa;
c->put_qpel_pixels_tab[0][2] = ff_horiz_mc_qpel_16width_msa;
c->put_qpel_pixels_tab[0][3] = ff_horiz_mc_qpel_aver_src1_16width_msa;
c->put_qpel_pixels_tab[0][4] = ff_vert_mc_qpel_aver_src0_16x16_msa;
c->put_qpel_pixels_tab[0][5] = ff_hv_mc_qpel_aver_hv_src00_16x16_msa;
c->put_qpel_pixels_tab[0][6] = ff_hv_mc_qpel_aver_v_src0_16x16_msa;
c->put_qpel_pixels_tab[0][7] = ff_hv_mc_qpel_aver_hv_src10_16x16_msa;
c->put_qpel_pixels_tab[0][8] = ff_vert_mc_qpel_16x16_msa;
c->put_qpel_pixels_tab[0][9] = ff_hv_mc_qpel_aver_h_src0_16x16_msa;
c->put_qpel_pixels_tab[0][10] = ff_hv_mc_qpel_16x16_msa;
c->put_qpel_pixels_tab[0][11] = ff_hv_mc_qpel_aver_h_src1_16x16_msa;
c->put_qpel_pixels_tab[0][12] = ff_vert_mc_qpel_aver_src1_16x16_msa;
c->put_qpel_pixels_tab[0][13] = ff_hv_mc_qpel_aver_hv_src01_16x16_msa;
c->put_qpel_pixels_tab[0][14] = ff_hv_mc_qpel_aver_v_src1_16x16_msa;
c->put_qpel_pixels_tab[0][15] = ff_hv_mc_qpel_aver_hv_src11_16x16_msa;
c->put_qpel_pixels_tab[1][0] = ff_copy_8x8_msa;
c->put_qpel_pixels_tab[1][1] = ff_horiz_mc_qpel_aver_src0_8width_msa;
c->put_qpel_pixels_tab[1][2] = ff_horiz_mc_qpel_8width_msa;
c->put_qpel_pixels_tab[1][3] = ff_horiz_mc_qpel_aver_src1_8width_msa;
c->put_qpel_pixels_tab[1][4] = ff_vert_mc_qpel_aver_src0_8x8_msa;
c->put_qpel_pixels_tab[1][5] = ff_hv_mc_qpel_aver_hv_src00_8x8_msa;
c->put_qpel_pixels_tab[1][6] = ff_hv_mc_qpel_aver_v_src0_8x8_msa;
c->put_qpel_pixels_tab[1][7] = ff_hv_mc_qpel_aver_hv_src10_8x8_msa;
c->put_qpel_pixels_tab[1][8] = ff_vert_mc_qpel_8x8_msa;
c->put_qpel_pixels_tab[1][9] = ff_hv_mc_qpel_aver_h_src0_8x8_msa;
c->put_qpel_pixels_tab[1][10] = ff_hv_mc_qpel_8x8_msa;
c->put_qpel_pixels_tab[1][11] = ff_hv_mc_qpel_aver_h_src1_8x8_msa;
c->put_qpel_pixels_tab[1][12] = ff_vert_mc_qpel_aver_src1_8x8_msa;
c->put_qpel_pixels_tab[1][13] = ff_hv_mc_qpel_aver_hv_src01_8x8_msa;
c->put_qpel_pixels_tab[1][14] = ff_hv_mc_qpel_aver_v_src1_8x8_msa;
c->put_qpel_pixels_tab[1][15] = ff_hv_mc_qpel_aver_hv_src11_8x8_msa;
c->put_no_rnd_qpel_pixels_tab[0][0] = ff_copy_16x16_msa;
c->put_no_rnd_qpel_pixels_tab[0][1] =
ff_horiz_mc_qpel_no_rnd_aver_src0_16width_msa;
c->put_no_rnd_qpel_pixels_tab[0][2] = ff_horiz_mc_qpel_no_rnd_16width_msa;
c->put_no_rnd_qpel_pixels_tab[0][3] =
ff_horiz_mc_qpel_no_rnd_aver_src1_16width_msa;
c->put_no_rnd_qpel_pixels_tab[0][4] =
ff_vert_mc_qpel_no_rnd_aver_src0_16x16_msa;
c->put_no_rnd_qpel_pixels_tab[0][5] =
ff_hv_mc_qpel_no_rnd_aver_hv_src00_16x16_msa;
c->put_no_rnd_qpel_pixels_tab[0][6] =
ff_hv_mc_qpel_no_rnd_aver_v_src0_16x16_msa;
c->put_no_rnd_qpel_pixels_tab[0][7] =
ff_hv_mc_qpel_no_rnd_aver_hv_src10_16x16_msa;
c->put_no_rnd_qpel_pixels_tab[0][8] = ff_vert_mc_qpel_no_rnd_16x16_msa;
c->put_no_rnd_qpel_pixels_tab[0][9] =
ff_hv_mc_qpel_no_rnd_aver_h_src0_16x16_msa;
c->put_no_rnd_qpel_pixels_tab[0][10] = ff_hv_mc_qpel_no_rnd_16x16_msa;
c->put_no_rnd_qpel_pixels_tab[0][11] =
ff_hv_mc_qpel_no_rnd_aver_h_src1_16x16_msa;
c->put_no_rnd_qpel_pixels_tab[0][12] =
ff_vert_mc_qpel_no_rnd_aver_src1_16x16_msa;
c->put_no_rnd_qpel_pixels_tab[0][13] =
ff_hv_mc_qpel_no_rnd_aver_hv_src01_16x16_msa;
c->put_no_rnd_qpel_pixels_tab[0][14] =
ff_hv_mc_qpel_no_rnd_aver_v_src1_16x16_msa;
c->put_no_rnd_qpel_pixels_tab[0][15] =
ff_hv_mc_qpel_no_rnd_aver_hv_src11_16x16_msa;
c->put_no_rnd_qpel_pixels_tab[1][0] = ff_copy_8x8_msa;
c->put_no_rnd_qpel_pixels_tab[1][1] =
ff_horiz_mc_qpel_no_rnd_aver_src0_8width_msa;
c->put_no_rnd_qpel_pixels_tab[1][2] = ff_horiz_mc_qpel_no_rnd_8width_msa;
c->put_no_rnd_qpel_pixels_tab[1][3] =
ff_horiz_mc_qpel_no_rnd_aver_src1_8width_msa;
c->put_no_rnd_qpel_pixels_tab[1][4] =
ff_vert_mc_qpel_no_rnd_aver_src0_8x8_msa;
c->put_no_rnd_qpel_pixels_tab[1][5] =
ff_hv_mc_qpel_no_rnd_aver_hv_src00_8x8_msa;
c->put_no_rnd_qpel_pixels_tab[1][6] =
ff_hv_mc_qpel_no_rnd_aver_v_src0_8x8_msa;
c->put_no_rnd_qpel_pixels_tab[1][7] =
ff_hv_mc_qpel_no_rnd_aver_hv_src10_8x8_msa;
c->put_no_rnd_qpel_pixels_tab[1][8] = ff_vert_mc_qpel_no_rnd_8x8_msa;
c->put_no_rnd_qpel_pixels_tab[1][9] =
ff_hv_mc_qpel_no_rnd_aver_h_src0_8x8_msa;
c->put_no_rnd_qpel_pixels_tab[1][10] = ff_hv_mc_qpel_no_rnd_8x8_msa;
c->put_no_rnd_qpel_pixels_tab[1][11] =
ff_hv_mc_qpel_no_rnd_aver_h_src1_8x8_msa;
c->put_no_rnd_qpel_pixels_tab[1][12] =
ff_vert_mc_qpel_no_rnd_aver_src1_8x8_msa;
c->put_no_rnd_qpel_pixels_tab[1][13] =
ff_hv_mc_qpel_no_rnd_aver_hv_src01_8x8_msa;
c->put_no_rnd_qpel_pixels_tab[1][14] =
ff_hv_mc_qpel_no_rnd_aver_v_src1_8x8_msa;
c->put_no_rnd_qpel_pixels_tab[1][15] =
ff_hv_mc_qpel_no_rnd_aver_hv_src11_8x8_msa;
c->avg_qpel_pixels_tab[0][0] = ff_avg_width16_msa;
c->avg_qpel_pixels_tab[0][1] =
ff_horiz_mc_qpel_avg_dst_aver_src0_16width_msa;
c->avg_qpel_pixels_tab[0][2] = ff_horiz_mc_qpel_avg_dst_16width_msa;
c->avg_qpel_pixels_tab[0][3] =
ff_horiz_mc_qpel_avg_dst_aver_src1_16width_msa;
c->avg_qpel_pixels_tab[0][4] = ff_vert_mc_qpel_avg_dst_aver_src0_16x16_msa;
c->avg_qpel_pixels_tab[0][5] =
ff_hv_mc_qpel_avg_dst_aver_hv_src00_16x16_msa;
c->avg_qpel_pixels_tab[0][6] = ff_hv_mc_qpel_avg_dst_aver_v_src0_16x16_msa;
c->avg_qpel_pixels_tab[0][7] =
ff_hv_mc_qpel_avg_dst_aver_hv_src10_16x16_msa;
c->avg_qpel_pixels_tab[0][8] = ff_vert_mc_qpel_avg_dst_16x16_msa;
c->avg_qpel_pixels_tab[0][9] = ff_hv_mc_qpel_avg_dst_aver_h_src0_16x16_msa;
c->avg_qpel_pixels_tab[0][10] = ff_hv_mc_qpel_avg_dst_16x16_msa;
c->avg_qpel_pixels_tab[0][11] = ff_hv_mc_qpel_avg_dst_aver_h_src1_16x16_msa;
c->avg_qpel_pixels_tab[0][12] = ff_vert_mc_qpel_avg_dst_aver_src1_16x16_msa;
c->avg_qpel_pixels_tab[0][13] =
ff_hv_mc_qpel_avg_dst_aver_hv_src01_16x16_msa;
c->avg_qpel_pixels_tab[0][14] = ff_hv_mc_qpel_avg_dst_aver_v_src1_16x16_msa;
c->avg_qpel_pixels_tab[0][15] =
ff_hv_mc_qpel_avg_dst_aver_hv_src11_16x16_msa;
c->avg_qpel_pixels_tab[1][0] = ff_avg_width8_msa;
c->avg_qpel_pixels_tab[1][1] =
ff_horiz_mc_qpel_avg_dst_aver_src0_8width_msa;
c->avg_qpel_pixels_tab[1][2] = ff_horiz_mc_qpel_avg_dst_8width_msa;
c->avg_qpel_pixels_tab[1][3] =
ff_horiz_mc_qpel_avg_dst_aver_src1_8width_msa;
c->avg_qpel_pixels_tab[1][4] = ff_vert_mc_qpel_avg_dst_aver_src0_8x8_msa;
c->avg_qpel_pixels_tab[1][5] = ff_hv_mc_qpel_avg_dst_aver_hv_src00_8x8_msa;
c->avg_qpel_pixels_tab[1][6] = ff_hv_mc_qpel_avg_dst_aver_v_src0_8x8_msa;
c->avg_qpel_pixels_tab[1][7] = ff_hv_mc_qpel_avg_dst_aver_hv_src10_8x8_msa;
c->avg_qpel_pixels_tab[1][8] = ff_vert_mc_qpel_avg_dst_8x8_msa;
c->avg_qpel_pixels_tab[1][9] = ff_hv_mc_qpel_avg_dst_aver_h_src0_8x8_msa;
c->avg_qpel_pixels_tab[1][10] = ff_hv_mc_qpel_avg_dst_8x8_msa;
c->avg_qpel_pixels_tab[1][11] = ff_hv_mc_qpel_avg_dst_aver_h_src1_8x8_msa;
c->avg_qpel_pixels_tab[1][12] = ff_vert_mc_qpel_avg_dst_aver_src1_8x8_msa;
c->avg_qpel_pixels_tab[1][13] = ff_hv_mc_qpel_avg_dst_aver_hv_src01_8x8_msa;
c->avg_qpel_pixels_tab[1][14] = ff_hv_mc_qpel_avg_dst_aver_v_src1_8x8_msa;
c->avg_qpel_pixels_tab[1][15] = ff_hv_mc_qpel_avg_dst_aver_hv_src11_8x8_msa;
}
}

View File

@ -18,6 +18,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "libavutil/mips/cpu.h"
#include "libavutil/attributes.h"
#include "libavcodec/vc1dsp.h"
#include "vc1dsp_mips.h"
@ -27,104 +28,93 @@
dsp->OP##vc1_mspel_pixels_tab[1][X+4*Y] = ff_##OP##vc1_mspel_mc##X##Y##INSN; \
dsp->OP##vc1_mspel_pixels_tab[0][X+4*Y] = ff_##OP##vc1_mspel_mc##X##Y##_16##INSN
#if HAVE_MMI
static av_cold void vc1dsp_init_mmi(VC1DSPContext *dsp)
{
#if _MIPS_SIM != _ABIO32
dsp->vc1_inv_trans_8x8 = ff_vc1_inv_trans_8x8_mmi;
dsp->vc1_inv_trans_4x8 = ff_vc1_inv_trans_4x8_mmi;
dsp->vc1_inv_trans_8x4 = ff_vc1_inv_trans_8x4_mmi;
#endif
dsp->vc1_inv_trans_4x4 = ff_vc1_inv_trans_4x4_mmi;
dsp->vc1_inv_trans_8x8_dc = ff_vc1_inv_trans_8x8_dc_mmi;
dsp->vc1_inv_trans_4x8_dc = ff_vc1_inv_trans_4x8_dc_mmi;
dsp->vc1_inv_trans_8x4_dc = ff_vc1_inv_trans_8x4_dc_mmi;
dsp->vc1_inv_trans_4x4_dc = ff_vc1_inv_trans_4x4_dc_mmi;
dsp->vc1_h_overlap = ff_vc1_h_overlap_mmi;
dsp->vc1_v_overlap = ff_vc1_v_overlap_mmi;
dsp->vc1_h_s_overlap = ff_vc1_h_s_overlap_mmi;
dsp->vc1_v_s_overlap = ff_vc1_v_s_overlap_mmi;
dsp->vc1_v_loop_filter4 = ff_vc1_v_loop_filter4_mmi;
dsp->vc1_h_loop_filter4 = ff_vc1_h_loop_filter4_mmi;
dsp->vc1_v_loop_filter8 = ff_vc1_v_loop_filter8_mmi;
dsp->vc1_h_loop_filter8 = ff_vc1_h_loop_filter8_mmi;
dsp->vc1_v_loop_filter16 = ff_vc1_v_loop_filter16_mmi;
dsp->vc1_h_loop_filter16 = ff_vc1_h_loop_filter16_mmi;
FN_ASSIGN(put_, 0, 0, _mmi);
FN_ASSIGN(put_, 0, 1, _mmi);
FN_ASSIGN(put_, 0, 2, _mmi);
FN_ASSIGN(put_, 0, 3, _mmi);
FN_ASSIGN(put_, 1, 0, _mmi);
//FN_ASSIGN(put_, 1, 1, _mmi);//FIXME
//FN_ASSIGN(put_, 1, 2, _mmi);//FIXME
//FN_ASSIGN(put_, 1, 3, _mmi);//FIXME
FN_ASSIGN(put_, 2, 0, _mmi);
//FN_ASSIGN(put_, 2, 1, _mmi);//FIXME
//FN_ASSIGN(put_, 2, 2, _mmi);//FIXME
//FN_ASSIGN(put_, 2, 3, _mmi);//FIXME
FN_ASSIGN(put_, 3, 0, _mmi);
//FN_ASSIGN(put_, 3, 1, _mmi);//FIXME
//FN_ASSIGN(put_, 3, 2, _mmi);//FIXME
//FN_ASSIGN(put_, 3, 3, _mmi);//FIXME
FN_ASSIGN(avg_, 0, 0, _mmi);
FN_ASSIGN(avg_, 0, 1, _mmi);
FN_ASSIGN(avg_, 0, 2, _mmi);
FN_ASSIGN(avg_, 0, 3, _mmi);
FN_ASSIGN(avg_, 1, 0, _mmi);
//FN_ASSIGN(avg_, 1, 1, _mmi);//FIXME
//FN_ASSIGN(avg_, 1, 2, _mmi);//FIXME
//FN_ASSIGN(avg_, 1, 3, _mmi);//FIXME
FN_ASSIGN(avg_, 2, 0, _mmi);
//FN_ASSIGN(avg_, 2, 1, _mmi);//FIXME
//FN_ASSIGN(avg_, 2, 2, _mmi);//FIXME
//FN_ASSIGN(avg_, 2, 3, _mmi);//FIXME
FN_ASSIGN(avg_, 3, 0, _mmi);
//FN_ASSIGN(avg_, 3, 1, _mmi);//FIXME
//FN_ASSIGN(avg_, 3, 2, _mmi);//FIXME
//FN_ASSIGN(avg_, 3, 3, _mmi);//FIXME
dsp->put_no_rnd_vc1_chroma_pixels_tab[0] = ff_put_no_rnd_vc1_chroma_mc8_mmi;
dsp->avg_no_rnd_vc1_chroma_pixels_tab[0] = ff_avg_no_rnd_vc1_chroma_mc8_mmi;
dsp->put_no_rnd_vc1_chroma_pixels_tab[1] = ff_put_no_rnd_vc1_chroma_mc4_mmi;
dsp->avg_no_rnd_vc1_chroma_pixels_tab[1] = ff_avg_no_rnd_vc1_chroma_mc4_mmi;
}
#endif /* HAVE_MMI */
#if HAVE_MSA
static av_cold void vc1dsp_init_msa(VC1DSPContext *dsp)
{
dsp->vc1_inv_trans_8x8 = ff_vc1_inv_trans_8x8_msa;
dsp->vc1_inv_trans_4x8 = ff_vc1_inv_trans_4x8_msa;
dsp->vc1_inv_trans_8x4 = ff_vc1_inv_trans_8x4_msa;
FN_ASSIGN(put_, 1, 1, _msa);
FN_ASSIGN(put_, 1, 2, _msa);
FN_ASSIGN(put_, 1, 3, _msa);
FN_ASSIGN(put_, 2, 1, _msa);
FN_ASSIGN(put_, 2, 2, _msa);
FN_ASSIGN(put_, 2, 3, _msa);
FN_ASSIGN(put_, 3, 1, _msa);
FN_ASSIGN(put_, 3, 2, _msa);
FN_ASSIGN(put_, 3, 3, _msa);
}
#endif /* HAVE_MSA */
av_cold void ff_vc1dsp_init_mips(VC1DSPContext *dsp)
{
#if HAVE_MMI
vc1dsp_init_mmi(dsp);
#endif /* HAVE_MMI */
#if HAVE_MSA
vc1dsp_init_msa(dsp);
#endif /* HAVE_MSA */
int cpu_flags = av_get_cpu_flags();
if (have_mmi(cpu_flags)) {
#if _MIPS_SIM != _ABIO32
dsp->vc1_inv_trans_8x8 = ff_vc1_inv_trans_8x8_mmi;
dsp->vc1_inv_trans_4x8 = ff_vc1_inv_trans_4x8_mmi;
dsp->vc1_inv_trans_8x4 = ff_vc1_inv_trans_8x4_mmi;
#endif
dsp->vc1_inv_trans_4x4 = ff_vc1_inv_trans_4x4_mmi;
dsp->vc1_inv_trans_8x8_dc = ff_vc1_inv_trans_8x8_dc_mmi;
dsp->vc1_inv_trans_4x8_dc = ff_vc1_inv_trans_4x8_dc_mmi;
dsp->vc1_inv_trans_8x4_dc = ff_vc1_inv_trans_8x4_dc_mmi;
dsp->vc1_inv_trans_4x4_dc = ff_vc1_inv_trans_4x4_dc_mmi;
dsp->vc1_h_overlap = ff_vc1_h_overlap_mmi;
dsp->vc1_v_overlap = ff_vc1_v_overlap_mmi;
dsp->vc1_h_s_overlap = ff_vc1_h_s_overlap_mmi;
dsp->vc1_v_s_overlap = ff_vc1_v_s_overlap_mmi;
dsp->vc1_v_loop_filter4 = ff_vc1_v_loop_filter4_mmi;
dsp->vc1_h_loop_filter4 = ff_vc1_h_loop_filter4_mmi;
dsp->vc1_v_loop_filter8 = ff_vc1_v_loop_filter8_mmi;
dsp->vc1_h_loop_filter8 = ff_vc1_h_loop_filter8_mmi;
dsp->vc1_v_loop_filter16 = ff_vc1_v_loop_filter16_mmi;
dsp->vc1_h_loop_filter16 = ff_vc1_h_loop_filter16_mmi;
FN_ASSIGN(put_, 0, 0, _mmi);
FN_ASSIGN(put_, 0, 1, _mmi);
FN_ASSIGN(put_, 0, 2, _mmi);
FN_ASSIGN(put_, 0, 3, _mmi);
FN_ASSIGN(put_, 1, 0, _mmi);
//FN_ASSIGN(put_, 1, 1, _mmi);//FIXME
//FN_ASSIGN(put_, 1, 2, _mmi);//FIXME
//FN_ASSIGN(put_, 1, 3, _mmi);//FIXME
FN_ASSIGN(put_, 2, 0, _mmi);
//FN_ASSIGN(put_, 2, 1, _mmi);//FIXME
//FN_ASSIGN(put_, 2, 2, _mmi);//FIXME
//FN_ASSIGN(put_, 2, 3, _mmi);//FIXME
FN_ASSIGN(put_, 3, 0, _mmi);
//FN_ASSIGN(put_, 3, 1, _mmi);//FIXME
//FN_ASSIGN(put_, 3, 2, _mmi);//FIXME
//FN_ASSIGN(put_, 3, 3, _mmi);//FIXME
FN_ASSIGN(avg_, 0, 0, _mmi);
FN_ASSIGN(avg_, 0, 1, _mmi);
FN_ASSIGN(avg_, 0, 2, _mmi);
FN_ASSIGN(avg_, 0, 3, _mmi);
FN_ASSIGN(avg_, 1, 0, _mmi);
//FN_ASSIGN(avg_, 1, 1, _mmi);//FIXME
//FN_ASSIGN(avg_, 1, 2, _mmi);//FIXME
//FN_ASSIGN(avg_, 1, 3, _mmi);//FIXME
FN_ASSIGN(avg_, 2, 0, _mmi);
//FN_ASSIGN(avg_, 2, 1, _mmi);//FIXME
//FN_ASSIGN(avg_, 2, 2, _mmi);//FIXME
//FN_ASSIGN(avg_, 2, 3, _mmi);//FIXME
FN_ASSIGN(avg_, 3, 0, _mmi);
//FN_ASSIGN(avg_, 3, 1, _mmi);//FIXME
//FN_ASSIGN(avg_, 3, 2, _mmi);//FIXME
//FN_ASSIGN(avg_, 3, 3, _mmi);//FIXME
dsp->put_no_rnd_vc1_chroma_pixels_tab[0] = ff_put_no_rnd_vc1_chroma_mc8_mmi;
dsp->avg_no_rnd_vc1_chroma_pixels_tab[0] = ff_avg_no_rnd_vc1_chroma_mc8_mmi;
dsp->put_no_rnd_vc1_chroma_pixels_tab[1] = ff_put_no_rnd_vc1_chroma_mc4_mmi;
dsp->avg_no_rnd_vc1_chroma_pixels_tab[1] = ff_avg_no_rnd_vc1_chroma_mc4_mmi;
}
if (have_msa(cpu_flags)) {
dsp->vc1_inv_trans_8x8 = ff_vc1_inv_trans_8x8_msa;
dsp->vc1_inv_trans_4x8 = ff_vc1_inv_trans_4x8_msa;
dsp->vc1_inv_trans_8x4 = ff_vc1_inv_trans_8x4_msa;
FN_ASSIGN(put_, 1, 1, _msa);
FN_ASSIGN(put_, 1, 2, _msa);
FN_ASSIGN(put_, 1, 3, _msa);
FN_ASSIGN(put_, 2, 1, _msa);
FN_ASSIGN(put_, 2, 2, _msa);
FN_ASSIGN(put_, 2, 3, _msa);
FN_ASSIGN(put_, 3, 1, _msa);
FN_ASSIGN(put_, 3, 2, _msa);
FN_ASSIGN(put_, 3, 3, _msa);
}
}

View File

@ -18,12 +18,12 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "libavutil/mips/cpu.h"
#include "config.h"
#include "libavutil/attributes.h"
#include "libavutil/mips/asmdefs.h"
#include "libavcodec/videodsp.h"
#if HAVE_MSA
static void prefetch_mips(uint8_t *mem, ptrdiff_t stride, int h)
{
register const uint8_t *p = mem;
@ -41,11 +41,11 @@ static void prefetch_mips(uint8_t *mem, ptrdiff_t stride, int h)
: [stride] "r" (stride)
);
}
#endif // #if HAVE_MSA
av_cold void ff_videodsp_init_mips(VideoDSPContext *ctx, int bpc)
{
#if HAVE_MSA
ctx->prefetch = prefetch_mips;
#endif // #if HAVE_MSA
int cpu_flags = av_get_cpu_flags();
if (have_msa(cpu_flags))
ctx->prefetch = prefetch_mips;
}

View File

@ -19,42 +19,32 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "libavutil/mips/cpu.h"
#include "config.h"
#include "libavutil/attributes.h"
#include "libavcodec/avcodec.h"
#include "libavcodec/vp3dsp.h"
#include "vp3dsp_mips.h"
#if HAVE_MSA
static av_cold void vp3dsp_init_msa(VP3DSPContext *c, int flags)
{
c->put_no_rnd_pixels_l2 = ff_put_no_rnd_pixels_l2_msa;
c->idct_add = ff_vp3_idct_add_msa;
c->idct_put = ff_vp3_idct_put_msa;
c->idct_dc_add = ff_vp3_idct_dc_add_msa;
c->v_loop_filter = ff_vp3_v_loop_filter_msa;
c->h_loop_filter = ff_vp3_h_loop_filter_msa;
}
#endif /* HAVE_MSA */
#if HAVE_MMI
static av_cold void vp3dsp_init_mmi(VP3DSPContext *c, int flags)
{
c->put_no_rnd_pixels_l2 = ff_put_no_rnd_pixels_l2_mmi;
c->idct_add = ff_vp3_idct_add_mmi;
c->idct_put = ff_vp3_idct_put_mmi;
c->idct_dc_add = ff_vp3_idct_dc_add_mmi;
}
#endif /* HAVE_MMI */
av_cold void ff_vp3dsp_init_mips(VP3DSPContext *c, int flags)
{
#if HAVE_MMI
vp3dsp_init_mmi(c, flags);
#endif /* HAVE_MMI */
#if HAVE_MSA
vp3dsp_init_msa(c, flags);
#endif /* HAVE_MSA */
int cpu_flags = av_get_cpu_flags();
if (have_mmi(cpu_flags)) {
c->put_no_rnd_pixels_l2 = ff_put_no_rnd_pixels_l2_mmi;
c->idct_add = ff_vp3_idct_add_mmi;
c->idct_put = ff_vp3_idct_put_mmi;
c->idct_dc_add = ff_vp3_idct_dc_add_mmi;
}
if (have_msa(cpu_flags)) {
c->put_no_rnd_pixels_l2 = ff_put_no_rnd_pixels_l2_msa;
c->idct_add = ff_vp3_idct_add_msa;
c->idct_put = ff_vp3_idct_put_msa;
c->idct_dc_add = ff_vp3_idct_dc_add_msa;
c->v_loop_filter = ff_vp3_v_loop_filter_msa;
c->h_loop_filter = ff_vp3_h_loop_filter_msa;
}
}

View File

@ -24,6 +24,7 @@
* VP8 compatible video decoder
*/
#include "libavutil/mips/cpu.h"
#include "config.h"
#include "libavutil/attributes.h"
#include "libavcodec/vp8dsp.h"
@ -71,132 +72,123 @@
dsp->put_vp8_bilinear_pixels_tab[IDX][0][0] = \
ff_put_vp8_pixels##SIZE##_msa;
#if HAVE_MSA
static av_cold void vp8dsp_init_msa(VP8DSPContext *dsp)
{
dsp->vp8_luma_dc_wht = ff_vp8_luma_dc_wht_msa;
dsp->vp8_idct_add = ff_vp8_idct_add_msa;
dsp->vp8_idct_dc_add = ff_vp8_idct_dc_add_msa;
dsp->vp8_idct_dc_add4y = ff_vp8_idct_dc_add4y_msa;
dsp->vp8_idct_dc_add4uv = ff_vp8_idct_dc_add4uv_msa;
VP8_MC_MIPS_FUNC(0, 16);
VP8_MC_MIPS_FUNC(1, 8);
VP8_MC_MIPS_FUNC(2, 4);
VP8_BILINEAR_MC_MIPS_FUNC(0, 16);
VP8_BILINEAR_MC_MIPS_FUNC(1, 8);
VP8_BILINEAR_MC_MIPS_FUNC(2, 4);
VP8_MC_MIPS_COPY(0, 16);
VP8_MC_MIPS_COPY(1, 8);
dsp->vp8_v_loop_filter16y = ff_vp8_v_loop_filter16_msa;
dsp->vp8_h_loop_filter16y = ff_vp8_h_loop_filter16_msa;
dsp->vp8_v_loop_filter8uv = ff_vp8_v_loop_filter8uv_msa;
dsp->vp8_h_loop_filter8uv = ff_vp8_h_loop_filter8uv_msa;
dsp->vp8_v_loop_filter16y_inner = ff_vp8_v_loop_filter16_inner_msa;
dsp->vp8_h_loop_filter16y_inner = ff_vp8_h_loop_filter16_inner_msa;
dsp->vp8_v_loop_filter8uv_inner = ff_vp8_v_loop_filter8uv_inner_msa;
dsp->vp8_h_loop_filter8uv_inner = ff_vp8_h_loop_filter8uv_inner_msa;
dsp->vp8_v_loop_filter_simple = ff_vp8_v_loop_filter_simple_msa;
dsp->vp8_h_loop_filter_simple = ff_vp8_h_loop_filter_simple_msa;
}
#endif // #if HAVE_MSA
#if HAVE_MMI
static av_cold void vp8dsp_init_mmi(VP8DSPContext *dsp)
{
dsp->vp8_luma_dc_wht = ff_vp8_luma_dc_wht_mmi;
dsp->vp8_luma_dc_wht_dc = ff_vp8_luma_dc_wht_dc_mmi;
dsp->vp8_idct_add = ff_vp8_idct_add_mmi;
dsp->vp8_idct_dc_add = ff_vp8_idct_dc_add_mmi;
dsp->vp8_idct_dc_add4y = ff_vp8_idct_dc_add4y_mmi;
dsp->vp8_idct_dc_add4uv = ff_vp8_idct_dc_add4uv_mmi;
dsp->put_vp8_epel_pixels_tab[0][0][1] = ff_put_vp8_epel16_h4_mmi;
dsp->put_vp8_epel_pixels_tab[0][0][2] = ff_put_vp8_epel16_h6_mmi;
dsp->put_vp8_epel_pixels_tab[0][1][0] = ff_put_vp8_epel16_v4_mmi;
dsp->put_vp8_epel_pixels_tab[0][1][1] = ff_put_vp8_epel16_h4v4_mmi;
dsp->put_vp8_epel_pixels_tab[0][1][2] = ff_put_vp8_epel16_h6v4_mmi;
dsp->put_vp8_epel_pixels_tab[0][2][0] = ff_put_vp8_epel16_v6_mmi;
dsp->put_vp8_epel_pixels_tab[0][2][1] = ff_put_vp8_epel16_h4v6_mmi;
dsp->put_vp8_epel_pixels_tab[0][2][2] = ff_put_vp8_epel16_h6v6_mmi;
dsp->put_vp8_epel_pixels_tab[1][0][1] = ff_put_vp8_epel8_h4_mmi;
dsp->put_vp8_epel_pixels_tab[1][0][2] = ff_put_vp8_epel8_h6_mmi;
dsp->put_vp8_epel_pixels_tab[1][1][0] = ff_put_vp8_epel8_v4_mmi;
dsp->put_vp8_epel_pixels_tab[1][1][1] = ff_put_vp8_epel8_h4v4_mmi;
dsp->put_vp8_epel_pixels_tab[1][1][2] = ff_put_vp8_epel8_h6v4_mmi;
dsp->put_vp8_epel_pixels_tab[1][2][0] = ff_put_vp8_epel8_v6_mmi;
dsp->put_vp8_epel_pixels_tab[1][2][1] = ff_put_vp8_epel8_h4v6_mmi;
dsp->put_vp8_epel_pixels_tab[1][2][2] = ff_put_vp8_epel8_h6v6_mmi;
dsp->put_vp8_epel_pixels_tab[2][0][1] = ff_put_vp8_epel4_h4_mmi;
dsp->put_vp8_epel_pixels_tab[2][0][2] = ff_put_vp8_epel4_h6_mmi;
dsp->put_vp8_epel_pixels_tab[2][1][0] = ff_put_vp8_epel4_v4_mmi;
dsp->put_vp8_epel_pixels_tab[2][1][1] = ff_put_vp8_epel4_h4v4_mmi;
dsp->put_vp8_epel_pixels_tab[2][1][2] = ff_put_vp8_epel4_h6v4_mmi;
dsp->put_vp8_epel_pixels_tab[2][2][0] = ff_put_vp8_epel4_v6_mmi;
dsp->put_vp8_epel_pixels_tab[2][2][1] = ff_put_vp8_epel4_h4v6_mmi;
dsp->put_vp8_epel_pixels_tab[2][2][2] = ff_put_vp8_epel4_h6v6_mmi;
dsp->put_vp8_bilinear_pixels_tab[0][0][1] = ff_put_vp8_bilinear16_h_mmi;
dsp->put_vp8_bilinear_pixels_tab[0][0][2] = ff_put_vp8_bilinear16_h_mmi;
dsp->put_vp8_bilinear_pixels_tab[0][1][0] = ff_put_vp8_bilinear16_v_mmi;
dsp->put_vp8_bilinear_pixels_tab[0][1][1] = ff_put_vp8_bilinear16_hv_mmi;
dsp->put_vp8_bilinear_pixels_tab[0][1][2] = ff_put_vp8_bilinear16_hv_mmi;
dsp->put_vp8_bilinear_pixels_tab[0][2][0] = ff_put_vp8_bilinear16_v_mmi;
dsp->put_vp8_bilinear_pixels_tab[0][2][1] = ff_put_vp8_bilinear16_hv_mmi;
dsp->put_vp8_bilinear_pixels_tab[0][2][2] = ff_put_vp8_bilinear16_hv_mmi;
dsp->put_vp8_bilinear_pixels_tab[1][0][1] = ff_put_vp8_bilinear8_h_mmi;
dsp->put_vp8_bilinear_pixels_tab[1][0][2] = ff_put_vp8_bilinear8_h_mmi;
dsp->put_vp8_bilinear_pixels_tab[1][1][0] = ff_put_vp8_bilinear8_v_mmi;
dsp->put_vp8_bilinear_pixels_tab[1][1][1] = ff_put_vp8_bilinear8_hv_mmi;
dsp->put_vp8_bilinear_pixels_tab[1][1][2] = ff_put_vp8_bilinear8_hv_mmi;
dsp->put_vp8_bilinear_pixels_tab[1][2][0] = ff_put_vp8_bilinear8_v_mmi;
dsp->put_vp8_bilinear_pixels_tab[1][2][1] = ff_put_vp8_bilinear8_hv_mmi;
dsp->put_vp8_bilinear_pixels_tab[1][2][2] = ff_put_vp8_bilinear8_hv_mmi;
dsp->put_vp8_bilinear_pixels_tab[2][0][1] = ff_put_vp8_bilinear4_h_mmi;
dsp->put_vp8_bilinear_pixels_tab[2][0][2] = ff_put_vp8_bilinear4_h_mmi;
dsp->put_vp8_bilinear_pixels_tab[2][1][0] = ff_put_vp8_bilinear4_v_mmi;
dsp->put_vp8_bilinear_pixels_tab[2][1][1] = ff_put_vp8_bilinear4_hv_mmi;
dsp->put_vp8_bilinear_pixels_tab[2][1][2] = ff_put_vp8_bilinear4_hv_mmi;
dsp->put_vp8_bilinear_pixels_tab[2][2][0] = ff_put_vp8_bilinear4_v_mmi;
dsp->put_vp8_bilinear_pixels_tab[2][2][1] = ff_put_vp8_bilinear4_hv_mmi;
dsp->put_vp8_bilinear_pixels_tab[2][2][2] = ff_put_vp8_bilinear4_hv_mmi;
dsp->put_vp8_epel_pixels_tab[0][0][0] = ff_put_vp8_pixels16_mmi;
dsp->put_vp8_bilinear_pixels_tab[0][0][0] = ff_put_vp8_pixels16_mmi;
dsp->put_vp8_epel_pixels_tab[1][0][0] = ff_put_vp8_pixels8_mmi;
dsp->put_vp8_bilinear_pixels_tab[1][0][0] = ff_put_vp8_pixels8_mmi;
dsp->vp8_v_loop_filter16y = ff_vp8_v_loop_filter16_mmi;
dsp->vp8_h_loop_filter16y = ff_vp8_h_loop_filter16_mmi;
dsp->vp8_v_loop_filter8uv = ff_vp8_v_loop_filter8uv_mmi;
dsp->vp8_h_loop_filter8uv = ff_vp8_h_loop_filter8uv_mmi;
dsp->vp8_v_loop_filter16y_inner = ff_vp8_v_loop_filter16_inner_mmi;
dsp->vp8_h_loop_filter16y_inner = ff_vp8_h_loop_filter16_inner_mmi;
dsp->vp8_v_loop_filter8uv_inner = ff_vp8_v_loop_filter8uv_inner_mmi;
dsp->vp8_h_loop_filter8uv_inner = ff_vp8_h_loop_filter8uv_inner_mmi;
dsp->vp8_v_loop_filter_simple = ff_vp8_v_loop_filter_simple_mmi;
dsp->vp8_h_loop_filter_simple = ff_vp8_h_loop_filter_simple_mmi;
}
#endif /* HAVE_MMI */
av_cold void ff_vp8dsp_init_mips(VP8DSPContext *dsp)
{
#if HAVE_MMI
vp8dsp_init_mmi(dsp);
#endif /* HAVE_MMI */
#if HAVE_MSA
vp8dsp_init_msa(dsp);
#endif // #if HAVE_MSA
int cpu_flags = av_get_cpu_flags();
if (have_mmi(cpu_flags)) {
dsp->vp8_luma_dc_wht = ff_vp8_luma_dc_wht_mmi;
dsp->vp8_luma_dc_wht_dc = ff_vp8_luma_dc_wht_dc_mmi;
dsp->vp8_idct_add = ff_vp8_idct_add_mmi;
dsp->vp8_idct_dc_add = ff_vp8_idct_dc_add_mmi;
dsp->vp8_idct_dc_add4y = ff_vp8_idct_dc_add4y_mmi;
dsp->vp8_idct_dc_add4uv = ff_vp8_idct_dc_add4uv_mmi;
dsp->put_vp8_epel_pixels_tab[0][0][1] = ff_put_vp8_epel16_h4_mmi;
dsp->put_vp8_epel_pixels_tab[0][0][2] = ff_put_vp8_epel16_h6_mmi;
dsp->put_vp8_epel_pixels_tab[0][1][0] = ff_put_vp8_epel16_v4_mmi;
dsp->put_vp8_epel_pixels_tab[0][1][1] = ff_put_vp8_epel16_h4v4_mmi;
dsp->put_vp8_epel_pixels_tab[0][1][2] = ff_put_vp8_epel16_h6v4_mmi;
dsp->put_vp8_epel_pixels_tab[0][2][0] = ff_put_vp8_epel16_v6_mmi;
dsp->put_vp8_epel_pixels_tab[0][2][1] = ff_put_vp8_epel16_h4v6_mmi;
dsp->put_vp8_epel_pixels_tab[0][2][2] = ff_put_vp8_epel16_h6v6_mmi;
dsp->put_vp8_epel_pixels_tab[1][0][1] = ff_put_vp8_epel8_h4_mmi;
dsp->put_vp8_epel_pixels_tab[1][0][2] = ff_put_vp8_epel8_h6_mmi;
dsp->put_vp8_epel_pixels_tab[1][1][0] = ff_put_vp8_epel8_v4_mmi;
dsp->put_vp8_epel_pixels_tab[1][1][1] = ff_put_vp8_epel8_h4v4_mmi;
dsp->put_vp8_epel_pixels_tab[1][1][2] = ff_put_vp8_epel8_h6v4_mmi;
dsp->put_vp8_epel_pixels_tab[1][2][0] = ff_put_vp8_epel8_v6_mmi;
dsp->put_vp8_epel_pixels_tab[1][2][1] = ff_put_vp8_epel8_h4v6_mmi;
dsp->put_vp8_epel_pixels_tab[1][2][2] = ff_put_vp8_epel8_h6v6_mmi;
dsp->put_vp8_epel_pixels_tab[2][0][1] = ff_put_vp8_epel4_h4_mmi;
dsp->put_vp8_epel_pixels_tab[2][0][2] = ff_put_vp8_epel4_h6_mmi;
dsp->put_vp8_epel_pixels_tab[2][1][0] = ff_put_vp8_epel4_v4_mmi;
dsp->put_vp8_epel_pixels_tab[2][1][1] = ff_put_vp8_epel4_h4v4_mmi;
dsp->put_vp8_epel_pixels_tab[2][1][2] = ff_put_vp8_epel4_h6v4_mmi;
dsp->put_vp8_epel_pixels_tab[2][2][0] = ff_put_vp8_epel4_v6_mmi;
dsp->put_vp8_epel_pixels_tab[2][2][1] = ff_put_vp8_epel4_h4v6_mmi;
dsp->put_vp8_epel_pixels_tab[2][2][2] = ff_put_vp8_epel4_h6v6_mmi;
dsp->put_vp8_bilinear_pixels_tab[0][0][1] = ff_put_vp8_bilinear16_h_mmi;
dsp->put_vp8_bilinear_pixels_tab[0][0][2] = ff_put_vp8_bilinear16_h_mmi;
dsp->put_vp8_bilinear_pixels_tab[0][1][0] = ff_put_vp8_bilinear16_v_mmi;
dsp->put_vp8_bilinear_pixels_tab[0][1][1] = ff_put_vp8_bilinear16_hv_mmi;
dsp->put_vp8_bilinear_pixels_tab[0][1][2] = ff_put_vp8_bilinear16_hv_mmi;
dsp->put_vp8_bilinear_pixels_tab[0][2][0] = ff_put_vp8_bilinear16_v_mmi;
dsp->put_vp8_bilinear_pixels_tab[0][2][1] = ff_put_vp8_bilinear16_hv_mmi;
dsp->put_vp8_bilinear_pixels_tab[0][2][2] = ff_put_vp8_bilinear16_hv_mmi;
dsp->put_vp8_bilinear_pixels_tab[1][0][1] = ff_put_vp8_bilinear8_h_mmi;
dsp->put_vp8_bilinear_pixels_tab[1][0][2] = ff_put_vp8_bilinear8_h_mmi;
dsp->put_vp8_bilinear_pixels_tab[1][1][0] = ff_put_vp8_bilinear8_v_mmi;
dsp->put_vp8_bilinear_pixels_tab[1][1][1] = ff_put_vp8_bilinear8_hv_mmi;
dsp->put_vp8_bilinear_pixels_tab[1][1][2] = ff_put_vp8_bilinear8_hv_mmi;
dsp->put_vp8_bilinear_pixels_tab[1][2][0] = ff_put_vp8_bilinear8_v_mmi;
dsp->put_vp8_bilinear_pixels_tab[1][2][1] = ff_put_vp8_bilinear8_hv_mmi;
dsp->put_vp8_bilinear_pixels_tab[1][2][2] = ff_put_vp8_bilinear8_hv_mmi;
dsp->put_vp8_bilinear_pixels_tab[2][0][1] = ff_put_vp8_bilinear4_h_mmi;
dsp->put_vp8_bilinear_pixels_tab[2][0][2] = ff_put_vp8_bilinear4_h_mmi;
dsp->put_vp8_bilinear_pixels_tab[2][1][0] = ff_put_vp8_bilinear4_v_mmi;
dsp->put_vp8_bilinear_pixels_tab[2][1][1] = ff_put_vp8_bilinear4_hv_mmi;
dsp->put_vp8_bilinear_pixels_tab[2][1][2] = ff_put_vp8_bilinear4_hv_mmi;
dsp->put_vp8_bilinear_pixels_tab[2][2][0] = ff_put_vp8_bilinear4_v_mmi;
dsp->put_vp8_bilinear_pixels_tab[2][2][1] = ff_put_vp8_bilinear4_hv_mmi;
dsp->put_vp8_bilinear_pixels_tab[2][2][2] = ff_put_vp8_bilinear4_hv_mmi;
dsp->put_vp8_epel_pixels_tab[0][0][0] = ff_put_vp8_pixels16_mmi;
dsp->put_vp8_bilinear_pixels_tab[0][0][0] = ff_put_vp8_pixels16_mmi;
dsp->put_vp8_epel_pixels_tab[1][0][0] = ff_put_vp8_pixels8_mmi;
dsp->put_vp8_bilinear_pixels_tab[1][0][0] = ff_put_vp8_pixels8_mmi;
dsp->vp8_v_loop_filter16y = ff_vp8_v_loop_filter16_mmi;
dsp->vp8_h_loop_filter16y = ff_vp8_h_loop_filter16_mmi;
dsp->vp8_v_loop_filter8uv = ff_vp8_v_loop_filter8uv_mmi;
dsp->vp8_h_loop_filter8uv = ff_vp8_h_loop_filter8uv_mmi;
dsp->vp8_v_loop_filter16y_inner = ff_vp8_v_loop_filter16_inner_mmi;
dsp->vp8_h_loop_filter16y_inner = ff_vp8_h_loop_filter16_inner_mmi;
dsp->vp8_v_loop_filter8uv_inner = ff_vp8_v_loop_filter8uv_inner_mmi;
dsp->vp8_h_loop_filter8uv_inner = ff_vp8_h_loop_filter8uv_inner_mmi;
dsp->vp8_v_loop_filter_simple = ff_vp8_v_loop_filter_simple_mmi;
dsp->vp8_h_loop_filter_simple = ff_vp8_h_loop_filter_simple_mmi;
}
if (have_msa(cpu_flags)) {
dsp->vp8_luma_dc_wht = ff_vp8_luma_dc_wht_msa;
dsp->vp8_idct_add = ff_vp8_idct_add_msa;
dsp->vp8_idct_dc_add = ff_vp8_idct_dc_add_msa;
dsp->vp8_idct_dc_add4y = ff_vp8_idct_dc_add4y_msa;
dsp->vp8_idct_dc_add4uv = ff_vp8_idct_dc_add4uv_msa;
VP8_MC_MIPS_FUNC(0, 16);
VP8_MC_MIPS_FUNC(1, 8);
VP8_MC_MIPS_FUNC(2, 4);
VP8_BILINEAR_MC_MIPS_FUNC(0, 16);
VP8_BILINEAR_MC_MIPS_FUNC(1, 8);
VP8_BILINEAR_MC_MIPS_FUNC(2, 4);
VP8_MC_MIPS_COPY(0, 16);
VP8_MC_MIPS_COPY(1, 8);
dsp->vp8_v_loop_filter16y = ff_vp8_v_loop_filter16_msa;
dsp->vp8_h_loop_filter16y = ff_vp8_h_loop_filter16_msa;
dsp->vp8_v_loop_filter8uv = ff_vp8_v_loop_filter8uv_msa;
dsp->vp8_h_loop_filter8uv = ff_vp8_h_loop_filter8uv_msa;
dsp->vp8_v_loop_filter16y_inner = ff_vp8_v_loop_filter16_inner_msa;
dsp->vp8_h_loop_filter16y_inner = ff_vp8_h_loop_filter16_inner_msa;
dsp->vp8_v_loop_filter8uv_inner = ff_vp8_v_loop_filter8uv_inner_msa;
dsp->vp8_h_loop_filter8uv_inner = ff_vp8_h_loop_filter8uv_inner_msa;
dsp->vp8_v_loop_filter_simple = ff_vp8_v_loop_filter_simple_msa;
dsp->vp8_h_loop_filter_simple = ff_vp8_h_loop_filter_simple_msa;
}
}

View File

@ -18,6 +18,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "libavutil/mips/cpu.h"
#include "config.h"
#include "libavutil/common.h"
#include "libavcodec/vp9dsp.h"
@ -209,10 +210,17 @@ static av_cold void vp9dsp_init_mmi(VP9DSPContext *dsp, int bpp)
av_cold void ff_vp9dsp_init_mips(VP9DSPContext *dsp, int bpp)
{
#if HAVE_MSA || HAVE_MMI
int cpu_flags = av_get_cpu_flags();
#endif
#if HAVE_MMI
vp9dsp_init_mmi(dsp, bpp);
#endif // #if HAVE_MMI
if (have_mmi(cpu_flags))
vp9dsp_init_mmi(dsp, bpp);
#endif
#if HAVE_MSA
vp9dsp_init_msa(dsp, bpp);
#endif // #if HAVE_MSA
if (have_msa(cpu_flags))
vp9dsp_init_msa(dsp, bpp);
#endif
}

View File

@ -18,21 +18,17 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "libavutil/mips/cpu.h"
#include "config.h"
#include "libavutil/attributes.h"
#include "wmv2dsp_mips.h"
#if HAVE_MMI
static av_cold void wmv2dsp_init_mmi(WMV2DSPContext *c)
{
c->idct_add = ff_wmv2_idct_add_mmi;
c->idct_put = ff_wmv2_idct_put_mmi;
}
#endif /* HAVE_MMI */
av_cold void ff_wmv2dsp_init_mips(WMV2DSPContext *c)
{
#if HAVE_MMI
wmv2dsp_init_mmi(c);
#endif /* HAVE_MMI */
int cpu_flags = av_get_cpu_flags();
if (have_mmi(cpu_flags)) {
c->idct_add = ff_wmv2_idct_add_mmi;
c->idct_put = ff_wmv2_idct_put_mmi;
}
}

View File

@ -23,7 +23,7 @@
#include "libavcodec/wmv2dsp.h"
void ff_wmv2_idct_add_mmi(uint8_t *dest, int line_size, int16_t *block);
void ff_wmv2_idct_put_mmi(uint8_t *dest, int line_size, int16_t *block);
void ff_wmv2_idct_add_mmi(uint8_t *dest, ptrdiff_t line_size, int16_t *block);
void ff_wmv2_idct_put_mmi(uint8_t *dest, ptrdiff_t line_size, int16_t *block);
#endif /* AVCODEC_MIPS_WMV2DSP_MIPS_H */

View File

@ -95,7 +95,7 @@ static void wmv2_idct_col_mmi(short * b)
b[56] = (a0 + a2 - a1 - a5 + 8192) >> 14;
}
void ff_wmv2_idct_add_mmi(uint8_t *dest, int line_size, int16_t *block)
void ff_wmv2_idct_add_mmi(uint8_t *dest, ptrdiff_t line_size, int16_t *block)
{
int i;
double ftmp[11];
@ -212,7 +212,7 @@ void ff_wmv2_idct_add_mmi(uint8_t *dest, int line_size, int16_t *block)
);
}
void ff_wmv2_idct_put_mmi(uint8_t *dest, int line_size, int16_t *block)
void ff_wmv2_idct_put_mmi(uint8_t *dest, ptrdiff_t line_size, int16_t *block)
{
int i;
double ftmp[8];

View File

@ -18,28 +18,23 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "libavutil/mips/cpu.h"
#include "xvididct_mips.h"
#if HAVE_MMI
static av_cold void xvid_idct_init_mmi(IDCTDSPContext *c, AVCodecContext *avctx,
unsigned high_bit_depth)
{
if (!high_bit_depth) {
if (avctx->idct_algo == FF_IDCT_AUTO ||
avctx->idct_algo == FF_IDCT_XVID) {
c->idct_put = ff_xvid_idct_put_mmi;
c->idct_add = ff_xvid_idct_add_mmi;
c->idct = ff_xvid_idct_mmi;
c->perm_type = FF_IDCT_PERM_NONE;
}
}
}
#endif /* HAVE_MMI */
av_cold void ff_xvid_idct_init_mips(IDCTDSPContext *c, AVCodecContext *avctx,
unsigned high_bit_depth)
{
#if HAVE_MMI
xvid_idct_init_mmi(c, avctx, high_bit_depth);
#endif /* HAVE_MMI */
int cpu_flags = av_get_cpu_flags();
if (have_mmi(cpu_flags)) {
if (!high_bit_depth) {
if (avctx->idct_algo == FF_IDCT_AUTO ||
avctx->idct_algo == FF_IDCT_XVID) {
c->idct_put = ff_xvid_idct_put_mmi;
c->idct_add = ff_xvid_idct_add_mmi;
c->idct = ff_xvid_idct_mmi;
c->perm_type = FF_IDCT_PERM_NONE;
}
}
}
}