mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-12-18 21:10:10 +01:00
lavc/vp8dsp: avoid one multiplication on RISC-V
Use shifts rather than multiply, and save one instruction.
This commit is contained in:
@@ -84,6 +84,7 @@ av_cold void ff_vp78dsp_init_riscv(VP8DSPContext *c)
|
|||||||
c->put_vp8_bilinear_pixels_tab[2][2][1] = ff_put_vp8_bilin4_hv_rvv;
|
c->put_vp8_bilinear_pixels_tab[2][2][1] = ff_put_vp8_bilin4_hv_rvv;
|
||||||
c->put_vp8_bilinear_pixels_tab[2][2][2] = ff_put_vp8_bilin4_hv_rvv;
|
c->put_vp8_bilinear_pixels_tab[2][2][2] = ff_put_vp8_bilin4_hv_rvv;
|
||||||
|
|
||||||
|
if (flags & AV_CPU_FLAG_RVB_ADDR) {
|
||||||
c->put_vp8_epel_pixels_tab[0][0][2] = ff_put_vp8_epel16_h6_rvv;
|
c->put_vp8_epel_pixels_tab[0][0][2] = ff_put_vp8_epel16_h6_rvv;
|
||||||
c->put_vp8_epel_pixels_tab[1][0][2] = ff_put_vp8_epel8_h6_rvv;
|
c->put_vp8_epel_pixels_tab[1][0][2] = ff_put_vp8_epel8_h6_rvv;
|
||||||
c->put_vp8_epel_pixels_tab[2][0][2] = ff_put_vp8_epel4_h6_rvv;
|
c->put_vp8_epel_pixels_tab[2][0][2] = ff_put_vp8_epel4_h6_rvv;
|
||||||
@@ -112,6 +113,7 @@ av_cold void ff_vp78dsp_init_riscv(VP8DSPContext *c)
|
|||||||
c->put_vp8_epel_pixels_tab[2][1][2] = ff_put_vp8_epel4_h6v4_rvv;
|
c->put_vp8_epel_pixels_tab[2][1][2] = ff_put_vp8_epel4_h6v4_rvv;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -182,15 +182,14 @@ const subpel_filters
|
|||||||
endconst
|
endconst
|
||||||
|
|
||||||
.macro epel_filter size type regtype
|
.macro epel_filter size type regtype
|
||||||
lla \regtype\()2, subpel_filters
|
|
||||||
.ifc \type,v
|
.ifc \type,v
|
||||||
addi \regtype\()0, a6, -1
|
addi \regtype\()0, a6, -1
|
||||||
.else
|
.else
|
||||||
addi \regtype\()0, a5, -1
|
addi \regtype\()0, a5, -1
|
||||||
.endif
|
.endif
|
||||||
li \regtype\()1, 6
|
lla \regtype\()2, subpel_filters
|
||||||
mul \regtype\()0, \regtype\()0, \regtype\()1
|
sh1add \regtype\()0, \regtype\()0, \regtype\()0
|
||||||
add \regtype\()0, \regtype\()0, \regtype\()2
|
sh1add \regtype\()0, \regtype\()0, \regtype\()2
|
||||||
.irp n,1,2,3,4
|
.irp n,1,2,3,4
|
||||||
lb \regtype\n, \n(\regtype\()0)
|
lb \regtype\n, \n(\regtype\()0)
|
||||||
.endr
|
.endr
|
||||||
|
|||||||
Reference in New Issue
Block a user