From a37ef12b6d7201ffdae7eb6a04dd9a45e1a5d3a4 Mon Sep 17 00:00:00 2001 From: chengshouping Date: Tue, 2 Sep 2025 16:48:47 +0800 Subject: [PATCH] ffmpeg-7.1.1_opt --- .../ffmpeg/huawei_ffmpeg-7.1.1_opt.patch | 75 +++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 open_source/ffmpeg/huawei_ffmpeg-7.1.1_opt.patch diff --git a/open_source/ffmpeg/huawei_ffmpeg-7.1.1_opt.patch b/open_source/ffmpeg/huawei_ffmpeg-7.1.1_opt.patch new file mode 100644 index 0000000..2afb04d --- /dev/null +++ b/open_source/ffmpeg/huawei_ffmpeg-7.1.1_opt.patch @@ -0,0 +1,75 @@ +diff --git a/libswscale/yuv2rgb.c b/libswscale/yuv2rgb.c +index 52fe209..75bc9cc 100644 +--- a/libswscale/yuv2rgb.c ++++ b/libswscale/yuv2rgb.c +@@ -527,7 +527,69 @@ YUV420FUNC(yuva2rgba_c, uint32_t, 1, 0, PUTRGBA, 8, 1) + YUV420FUNC(yuva2rgba_c, uint32_t, 1, 24, PUTRGBA, 8, 1) + YUV420FUNC(yuva2argb_c, uint32_t, 1, 0, PUTRGBA, 8, 1) + #endif +-YUV420FUNC(yuv2rgb_c_24_rgb, uint8_t, 0, 0, PUTRGB24, 24, 1) ++static int yuv2rgb_c_24_rgb(SwsContext * c, ++ const uint8_t *src[], ++ int srcStride[], ++ int srcSliceY, ++ int srcSliceH, ++ uint8_t *dst[], ++ int dstStride[]) ++{ ++ int y; ++ typedef uint8_t dst_type; ++ int alpha = 0; ++ int yuv422 = 0; ++ int nb_dst_planes = 0; ++ int abase = 0; ++ int dst_delta = 24; ++ unsigned int h_size = c->dstW >> 3; ++#pragma omp parallel for schedule(auto) num_threads(12) ++ for (y = 0; y < srcSliceH; y += 2) { ++ int yd = y + srcSliceY; ++ dst_type *dst_1 = (dst_type *)(dst[0] + (yd)*dstStride[0]); ++ dst_type *dst_2 = (dst_type *)(dst[0] + (yd + 1) * dstStride[0]); ++ dst_type av_unused *dst1_1, *dst1_2, *dst2_1, *dst2_2; ++ dst_type av_unused *r, *g, *b; ++ const uint8_t *py_1 = src[0] + y * srcStride[0]; ++ const uint8_t *py_2 = py_1 + srcStride[0]; ++ const uint8_t av_unused *pu_1 = src[1] + (y >> !yuv422) * srcStride[1]; ++ const uint8_t av_unused *pv_1 = src[2] + (y >> !yuv422) * srcStride[2]; ++ const uint8_t av_unused *pu_2, *pv_2; ++ const uint8_t av_unused *pa_1, *pa_2; ++ for (int i = 0; i < h_size; i++) { ++ int av_unused U, V, Y; ++ LOADCHROMA(1, 0); ++ PUTRGB24(1, 0, abase); ++ PUTRGB24(2, 0, abase); ++ ++ LOADCHROMA(1, 1); ++ PUTRGB24(2, 1, abase); ++ PUTRGB24(1, 1, abase); ++ ++ LOADCHROMA(1, 2); ++ PUTRGB24(1, 2, abase); ++ PUTRGB24(2, 2, abase); ++ ++ LOADCHROMA(1, 3); ++ PUTRGB24(2, 3, abase); ++ PUTRGB24(1, 3, abase); ++ ENDYUV2RGBLINE(dst_delta, 0, alpha, 0, nb_dst_planes) ++ LOADCHROMA(1, 0); ++ PUTRGB24(1, 0, abase); ++ PUTRGB24(2, 0, abase); ++ ++ LOADCHROMA(1, 1); ++ PUTRGB24(2, 1, abase); ++ PUTRGB24(1, 1, abase); ++ ENDYUV2RGBLINE(dst_delta, 1, alpha, 0, nb_dst_planes) ++ LOADCHROMA(1, 0); ++ PUTRGB24(1, 0, abase); ++ PUTRGB24(2, 0, abase); ++ } ++ } ++ return srcSliceH; ++} ++// YUV420FUNC(yuv2rgb_c_24_rgb, uint8_t, 0, 0, PUTRGB24, 24, 1) + YUV420FUNC(yuv2rgb_c_24_bgr, uint8_t, 0, 0, PUTBGR24, 24, 1) + YUV420FUNC(yuv420p_gbrp_c, uint8_t, 0, 0, PUTGBRP, 8, 3) + YUV420FUNC_DITHER(yuv2rgb_c_16_ordered_dither, uint16_t, LOADDITHER16, PUTRGB16, 8) -- Gitee