swscale/la: Add output_lasx.c file.

ffmpeg -i 1_h264_1080p_30fps_3Mbps.mp4 -f rawvideo -s 640x480 -pix_fmt
rgb24 -y /dev/null -an
before: 150fps
after:  183fps

Signed-off-by: Hao Chen <chenhao@loongson.cn>
Reviewed-by: yinshiyou-hf@loongson.cn
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Hao Chen 2022-09-09 17:00:26 +08:00 committed by Michael Niedermayer
parent 74d09b068d
commit 925ac0da32
No known key found for this signature in database
GPG Key ID: B18E8928B3948D64
4 changed files with 1993 additions and 1 deletions

View File

@ -2,4 +2,5 @@ OBJS-$(CONFIG_SWSCALE) += loongarch/swscale_init_loongarch.o
LASX-OBJS-$(CONFIG_SWSCALE) += loongarch/swscale_lasx.o \
loongarch/input_lasx.o \
loongarch/yuv2rgb_lasx.o \
loongarch/rgb2rgb_lasx.o
loongarch/rgb2rgb_lasx.o \
loongarch/output_lasx.o

File diff suppressed because it is too large Load Diff

View File

@ -28,6 +28,7 @@ av_cold void ff_sws_init_swscale_loongarch(SwsContext *c)
{
int cpu_flags = av_get_cpu_flags();
if (have_lasx(cpu_flags)) {
ff_sws_init_output_loongarch(c);
if (c->srcBpc == 8) {
if (c->dstBpc <= 14) {
c->hyScale = c->hcScale = ff_hscale_8_to_15_lasx;
@ -47,6 +48,8 @@ av_cold void ff_sws_init_swscale_loongarch(SwsContext *c)
}
break;
}
if (c->dstBpc == 8)
c->yuv2planeX = ff_yuv2planeX_8_lasx;
}
}

View File

@ -69,4 +69,10 @@ void ff_interleave_bytes_lasx(const uint8_t *src1, const uint8_t *src2,
uint8_t *dest, int width, int height,
int src1Stride, int src2Stride, int dstStride);
av_cold void ff_sws_init_output_loongarch(SwsContext *c);
void ff_yuv2planeX_8_lasx(const int16_t *filter, int filterSize,
const int16_t **src, uint8_t *dest, int dstW,
const uint8_t *dither, int offset);
#endif /* SWSCALE_LOONGARCH_SWSCALE_LOONGARCH_H */