Browse Source

avcodec/mips: loongson optimize h264pred with mmi v3

1. no longer use the register names directly and optimized code format
2. to be compatible with O32, specify type of address variable with mips_reg and handle the address variable with PTR_ operator
3. ff_pred16x16_plane_ functions only support N64 ABI now

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
tags/n3.1
Zhou Xiaoyong Michael Niedermayer 9 years ago
parent
commit
c749be9eb3
4 changed files with 859 additions and 646 deletions
  1. +1
    -0
      libavcodec/mips/constants.c
  2. +1
    -0
      libavcodec/mips/constants.h
  3. +2
    -3
      libavcodec/mips/h264pred_init_mips.c
  4. +855
    -643
      libavcodec/mips/h264pred_mmi.c

+ 1
- 0
libavcodec/mips/constants.c View File

@@ -24,6 +24,7 @@
#include "constants.h"

DECLARE_ALIGNED(8, const uint64_t, ff_pw_1) = {0x0001000100010001ULL};
DECLARE_ALIGNED(8, const uint64_t, ff_pw_2) = {0x0002000200020002ULL};
DECLARE_ALIGNED(8, const uint64_t, ff_pw_3) = {0x0003000300030003ULL};
DECLARE_ALIGNED(8, const uint64_t, ff_pw_4) = {0x0004000400040004ULL};
DECLARE_ALIGNED(8, const uint64_t, ff_pw_5) = {0x0005000500050005ULL};


+ 1
- 0
libavcodec/mips/constants.h View File

@@ -25,6 +25,7 @@
#include <stdint.h>

extern const uint64_t ff_pw_1;
extern const uint64_t ff_pw_2;
extern const uint64_t ff_pw_3;
extern const uint64_t ff_pw_4;
extern const uint64_t ff_pw_5;


+ 2
- 3
libavcodec/mips/h264pred_init_mips.c View File

@@ -115,23 +115,22 @@ static av_cold void h264_pred_init_mmi(H264PredContext *h, int codec_id,
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) {


+ 855
- 643
libavcodec/mips/h264pred_mmi.c
File diff suppressed because it is too large
View File


Loading…
Cancel
Save