[FFmpeg-devel] [PATCH 5/9] avcodec/mips: [loongson] optimize ff_put_pixels16_8 V2.
Shiyou Yin
yinshiyou-hf at loongson.cn
Thu Jul 12 15:44:56 EEST 2018
Remove useless variable addr used in function ff_put_pixels16_8.
Change-Id: I8b8c996a73ad13676852baa5ef4060d73882c0ab
Signed-off-by: Shiyou Yin <yinshiyou-hf at loongson.cn>
---
libavcodec/mips/hpeldsp_mmi.c | 43 ++++++++++++++++++++-----------------------
1 file changed, 20 insertions(+), 23 deletions(-)
diff --git a/libavcodec/mips/hpeldsp_mmi.c b/libavcodec/mips/hpeldsp_mmi.c
index 2dbef22..1bba70e 100644
--- a/libavcodec/mips/hpeldsp_mmi.c
+++ b/libavcodec/mips/hpeldsp_mmi.c
@@ -111,44 +111,41 @@ void ff_put_pixels16_8_mmi(uint8_t *block, const uint8_t *pixels,
ptrdiff_t line_size, int h)
{
double ftmp[4];
- mips_reg addr[2];
DECLARE_VAR_ALL64;
- DECLARE_VAR_ADDRT;
__asm__ volatile (
- PTR_ADDU "%[addr1], %[line_size], %[line_size] \n\t"
- "1: \n\t"
- PTR_ADDU "%[addr0], %[pixels], %[line_size] \n\t"
+ "1: \n\t"
MMI_ULDC1(%[ftmp0], %[pixels], 0x00)
MMI_ULDC1(%[ftmp2], %[pixels], 0x08)
- MMI_ULDC1(%[ftmp1], %[addr0], 0x00)
- MMI_ULDC1(%[ftmp3], %[addr0], 0x08)
+ PTR_ADDU "%[pixels], %[pixels], %[line_size] \n\t"
+ MMI_ULDC1(%[ftmp1], %[pixels], 0x00)
+ MMI_ULDC1(%[ftmp3], %[pixels], 0x08)
MMI_SDC1(%[ftmp0], %[block], 0x00)
- MMI_SDXC1(%[ftmp1], %[block], %[line_size], 0x00)
MMI_SDC1(%[ftmp2], %[block], 0x08)
- MMI_SDXC1(%[ftmp3], %[block], %[line_size], 0x08)
- PTR_ADDU "%[pixels], %[pixels], %[addr1] \n\t"
- PTR_ADDU "%[block], %[block], %[addr1] \n\t"
+ PTR_ADDU "%[block], %[block], %[line_size] \n\t"
+ MMI_SDC1(%[ftmp1], %[block], 0x00)
+ MMI_SDC1(%[ftmp3], %[block], 0x08)
+ PTR_ADDU "%[pixels], %[pixels], %[line_size] \n\t"
+ PTR_ADDU "%[block], %[block], %[line_size] \n\t"
- PTR_ADDU "%[addr0], %[pixels], %[line_size] \n\t"
MMI_ULDC1(%[ftmp0], %[pixels], 0x00)
MMI_ULDC1(%[ftmp2], %[pixels], 0x08)
- MMI_ULDC1(%[ftmp1], %[addr0], 0x00)
- MMI_ULDC1(%[ftmp3], %[addr0], 0x08)
+ PTR_ADDU "%[pixels], %[pixels], %[line_size] \n\t"
+ MMI_ULDC1(%[ftmp1], %[pixels], 0x00)
+ MMI_ULDC1(%[ftmp3], %[pixels], 0x08)
MMI_SDC1(%[ftmp0], %[block], 0x00)
- MMI_SDXC1(%[ftmp1], %[block], %[line_size], 0x00)
MMI_SDC1(%[ftmp2], %[block], 0x08)
- MMI_SDXC1(%[ftmp3], %[block], %[line_size], 0x08)
- PTR_ADDU "%[pixels], %[pixels], %[addr1] \n\t"
- PTR_ADDU "%[block], %[block], %[addr1] \n\t"
-
- PTR_ADDI "%[h], %[h], -0x04 \n\t"
- "bnez %[h], 1b \n\t"
+ PTR_ADDU "%[block], %[block], %[line_size] \n\t"
+ MMI_SDC1(%[ftmp1], %[block], 0x00)
+ MMI_SDC1(%[ftmp3], %[block], 0x08)
+ PTR_ADDU "%[pixels], %[pixels], %[line_size] \n\t"
+ PTR_ADDU "%[block], %[block], %[line_size] \n\t"
+
+ PTR_ADDI "%[h], %[h], -0x04 \n\t"
+ "bnez %[h], 1b \n\t"
: [ftmp0]"=&f"(ftmp[0]), [ftmp1]"=&f"(ftmp[1]),
[ftmp2]"=&f"(ftmp[2]), [ftmp3]"=&f"(ftmp[3]),
RESTRICT_ASM_ALL64
- RESTRICT_ASM_ADDRT
- [addr0]"=&r"(addr[0]), [addr1]"=&r"(addr[1]),
[block]"+&r"(block), [pixels]"+&r"(pixels),
[h]"+&r"(h)
: [line_size]"r"((mips_reg)line_size)
--
2.1.0
More information about the ffmpeg-devel
mailing list