From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org> Subject: [FFmpeg-devel] [PATCH 01/12] swscale/csputils: Remove unused ff_sws_matrix3x3_rmul() Date: Mon, 31 Mar 2025 21:56:38 +0200 Message-ID: <AS8P250MB0744F8C41AE8B7F0D27B81AD8FAD2@AS8P250MB0744.EURP250.PROD.OUTLOOK.COM> (raw) [-- Attachment #1: Type: text/plain, Size: 29 bytes --] Patches attached. - Andreas [-- Attachment #2: 0001-swscale-csputils-Remove-unused-ff_sws_matrix3x3_rmul.patch --] [-- Type: text/x-patch, Size: 1834 bytes --] From 739aeedc6f7d57b33a7f61dab65a09a722e71994 Mon Sep 17 00:00:00 2001 From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> Date: Mon, 31 Mar 2025 14:26:24 +0200 Subject: [PATCH 01/12] swscale/csputils: Remove unused ff_sws_matrix3x3_rmul() Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> --- libswscale/csputils.c | 13 ------------- libswscale/csputils.h | 1 - 2 files changed, 14 deletions(-) diff --git a/libswscale/csputils.c b/libswscale/csputils.c index 728871d293..6ab6ac3f7a 100644 --- a/libswscale/csputils.c +++ b/libswscale/csputils.c @@ -36,19 +36,6 @@ void ff_sws_matrix3x3_mul(SwsMatrix3x3 *a, const SwsMatrix3x3 *b) } } -void ff_sws_matrix3x3_rmul(const SwsMatrix3x3 *a, SwsMatrix3x3 *b) -{ - float b00 = b->m[0][0], b01 = b->m[0][1], b02 = b->m[0][2], - b10 = b->m[1][0], b11 = b->m[1][1], b12 = b->m[1][2], - b20 = b->m[2][0], b21 = b->m[2][1], b22 = b->m[2][2]; - - for (int i = 0; i < 3; i++) { - b->m[i][0] = a->m[i][0] * b00 + a->m[i][1] * b10 + a->m[i][2] * b20; - b->m[i][1] = a->m[i][0] * b01 + a->m[i][1] * b11 + a->m[i][2] * b21; - b->m[i][2] = a->m[i][0] * b02 + a->m[i][1] * b12 + a->m[i][2] * b22; - } -} - void ff_sws_matrix3x3_invert(SwsMatrix3x3 *mat) { double m00 = mat->m[0][0], m01 = mat->m[0][1], m02 = mat->m[0][2], diff --git a/libswscale/csputils.h b/libswscale/csputils.h index e4e1260916..c28e4ac7ae 100644 --- a/libswscale/csputils.h +++ b/libswscale/csputils.h @@ -49,7 +49,6 @@ typedef struct SwsMatrix3x3 { } SwsMatrix3x3; void ff_sws_matrix3x3_mul(SwsMatrix3x3 *a, const SwsMatrix3x3 *b); -void ff_sws_matrix3x3_rmul(const SwsMatrix3x3 *a, SwsMatrix3x3 *b); void ff_sws_matrix3x3_invert(SwsMatrix3x3 *mat); void ff_sws_matrix3x3_apply(const SwsMatrix3x3 *mat, float vec[3]); -- 2.45.2 [-- Attachment #3: 0002-postproc-postprocess-Remove-unused-b02.patch --] [-- Type: text/x-patch, Size: 2255 bytes --] From 3997c3968b37d237daf67b6e3d2a35812fa1a7ca Mon Sep 17 00:00:00 2001 From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> Date: Mon, 31 Mar 2025 15:18:01 +0200 Subject: [PATCH 02/12] postproc/postprocess: Remove unused b02 The line which appears to be using it was always commented out (since it has been added in 70c5ae870bf2ed776c82f8d8192e3c2db720b8e9). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> --- libpostproc/postprocess.c | 1 - libpostproc/postprocess_template.c | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/libpostproc/postprocess.c b/libpostproc/postprocess.c index 015bc9d501..fd74f5c72c 100644 --- a/libpostproc/postprocess.c +++ b/libpostproc/postprocess.c @@ -101,7 +101,6 @@ DECLARE_ASM_CONST(8, uint64_t, w04)= 0x0004000400040004LL; DECLARE_ASM_CONST(8, uint64_t, w20)= 0x0020002000200020LL; DECLARE_ASM_CONST(8, uint64_t, b00)= 0x0000000000000000LL; DECLARE_ASM_CONST(8, uint64_t, b01)= 0x0101010101010101LL; -DECLARE_ASM_CONST(8, uint64_t, b02)= 0x0202020202020202LL; DECLARE_ASM_CONST(8, uint64_t, b08)= 0x0808080808080808LL; DECLARE_ASM_CONST(8, uint64_t, b80)= 0x8080808080808080LL; #endif diff --git a/libpostproc/postprocess_template.c b/libpostproc/postprocess_template.c index d56b45d3b4..1fa4123896 100644 --- a/libpostproc/postprocess_template.c +++ b/libpostproc/postprocess_template.c @@ -980,7 +980,6 @@ FIND_MIN_MAX((%0, %1, 8)) PMINUB(t1, pplx, t0)\ "paddb " #sx ", " #ppsx " \n\t"\ "paddb " #psx ", " #ppsx " \n\t"\ - "#paddb "MANGLE(b02)", " #ppsx " \n\t"\ "pand "MANGLE(b08)", " #ppsx " \n\t"\ "pcmpeqb " #lx ", " #ppsx " \n\t"\ "pand " #ppsx ", " #pplx " \n\t"\ @@ -1018,7 +1017,7 @@ DERING_CORE((%0, %1, 8) ,(%%FF_REGd, %1, 4),%%mm2,%%mm4,%%mm0,%%mm3,%%mm5, "1: \n\t" : : "r" (src), "r" ((x86_reg)stride), "m" (c->pQPb), "m"(c->pQPb2), "q"(tmp) - NAMED_CONSTRAINTS_ADD(deringThreshold,b00,b02,b08) + NAMED_CONSTRAINTS_ADD(deringThreshold,b00,b08) : "%"FF_REG_a, "%"FF_REG_d ); #else // HAVE_7REGS && TEMPLATE_PP_MMXEXT -- 2.45.2 [-- Attachment #4: 0003-postproc-postprocess_template-Use-immediate-instead-.patch --] [-- Type: text/x-patch, Size: 3443 bytes --] From 27a529f48ebe346fdfb2ce4c38159a465c3594cf Mon Sep 17 00:00:00 2001 From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> Date: Mon, 31 Mar 2025 16:26:55 +0200 Subject: [PATCH 03/12] postproc/postprocess_template: Use immediate instead of memory load Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> --- libpostproc/postprocess.c | 5 ++--- libpostproc/postprocess_altivec_template.c | 2 +- libpostproc/postprocess_template.c | 6 +++--- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/libpostproc/postprocess.c b/libpostproc/postprocess.c index fd74f5c72c..0223bab548 100644 --- a/libpostproc/postprocess.c +++ b/libpostproc/postprocess.c @@ -95,6 +95,8 @@ try to unroll inner for(x=0 ... loop to avoid these damn if(x ... checks #define TEMP_STRIDE 8 //#define NUM_BLOCKS_AT_ONCE 16 //not used yet +#define DERING_THRESHOLD 20 + #if ARCH_X86 && HAVE_INLINE_ASM DECLARE_ASM_CONST(8, uint64_t, w05)= 0x0005000500050005LL; DECLARE_ASM_CONST(8, uint64_t, w04)= 0x0004000400040004LL; @@ -105,9 +107,6 @@ DECLARE_ASM_CONST(8, uint64_t, b08)= 0x0808080808080808LL; DECLARE_ASM_CONST(8, uint64_t, b80)= 0x8080808080808080LL; #endif -DECLARE_ASM_CONST(8, int, deringThreshold)= 20; - - static const struct PPFilter filters[]= { {"hb", "hdeblock", 1, 1, 3, H_DEBLOCK}, diff --git a/libpostproc/postprocess_altivec_template.c b/libpostproc/postprocess_altivec_template.c index a9d4cd29a3..827d6300e5 100644 --- a/libpostproc/postprocess_altivec_template.c +++ b/libpostproc/postprocess_altivec_template.c @@ -573,7 +573,7 @@ static inline void dering_altivec(uint8_t src[], int stride, PPContext *c) { src & stride :-( */ uint8_t *srcCopy = src; - DECLARE_ALIGNED(16, uint8_t, dt)[16] = { deringThreshold }; + DECLARE_ALIGNED(16, uint8_t, dt)[16] = { DERING_THRESHOLD }; const vector signed int zero = vec_splat_s32(0); vector unsigned char v_dt = vec_splat(vec_ld(0, dt), 0); diff --git a/libpostproc/postprocess_template.c b/libpostproc/postprocess_template.c index 1fa4123896..f0e3c50d88 100644 --- a/libpostproc/postprocess_template.c +++ b/libpostproc/postprocess_template.c @@ -888,7 +888,7 @@ FIND_MIN_MAX((%0, %1, 8)) "psubb %%mm7, %%mm6 \n\t" // max - min "push %%"FF_REG_a" \n\t" "movd %%mm6, %%eax \n\t" - "cmpb "MANGLE(deringThreshold)", %%al \n\t" + "cmpb $"AV_STRINGIFY(DERING_THRESHOLD)", %%al \n\t" "pop %%"FF_REG_a" \n\t" " jb 1f \n\t" PAVGB(%%mm0, %%mm7) // a=(max + min)/2 @@ -1017,7 +1017,7 @@ DERING_CORE((%0, %1, 8) ,(%%FF_REGd, %1, 4),%%mm2,%%mm4,%%mm0,%%mm3,%%mm5, "1: \n\t" : : "r" (src), "r" ((x86_reg)stride), "m" (c->pQPb), "m"(c->pQPb2), "q"(tmp) - NAMED_CONSTRAINTS_ADD(deringThreshold,b00,b08) + NAMED_CONSTRAINTS_ADD(b00,b08) : "%"FF_REG_a, "%"FF_REG_d ); #else // HAVE_7REGS && TEMPLATE_PP_MMXEXT @@ -1041,7 +1041,7 @@ DERING_CORE((%0, %1, 8) ,(%%FF_REGd, %1, 4),%%mm2,%%mm4,%%mm0,%%mm3,%%mm5, } avg= (min + max + 1)>>1; - if(max - min <deringThreshold) return; + if (max - min < DERING_THRESHOLD) return; for(y=0; y<10; y++){ int t = 0; -- 2.45.2 [-- Attachment #5: 0004-avcodec-aac-aacdec_lpd-Make-ff_aac_lpd_mode_tab-stat.patch --] [-- Type: text/x-patch, Size: 1190 bytes --] From a8bcf491993d3eae4545a82c91a5d27fbeb872c7 Mon Sep 17 00:00:00 2001 From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> Date: Mon, 31 Mar 2025 17:43:54 +0200 Subject: [PATCH 04/12] avcodec/aac/aacdec_lpd: Make ff_aac_lpd_mode_tab static Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> --- libavcodec/aac/aacdec_lpd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavcodec/aac/aacdec_lpd.c b/libavcodec/aac/aacdec_lpd.c index a4b91a510f..0dd8cbe741 100644 --- a/libavcodec/aac/aacdec_lpd.c +++ b/libavcodec/aac/aacdec_lpd.c @@ -22,7 +22,7 @@ #include "aacdec_usac.h" #include "libavcodec/unary.h" -const uint8_t ff_aac_lpd_mode_tab[32][4] = { +static const uint8_t aac_lpd_mode_tab[32][4] = { { 0, 0, 0, 0 }, { 1, 0, 0, 0 }, { 0, 1, 0, 0 }, @@ -159,7 +159,7 @@ int ff_aac_ldp_parse_channel_stream(AACDecContext *ac, AACUSACConfig *usac, ce->ldp.core_mode_last = get_bits1(gb); ce->ldp.fac_data_present = get_bits1(gb); - mod = ff_aac_lpd_mode_tab[ce->ldp.lpd_mode]; + mod = aac_lpd_mode_tab[ce->ldp.lpd_mode]; first_ldp_flag = !ce->ldp.core_mode_last; if (first_ldp_flag) -- 2.45.2 [-- Attachment #6: 0005-avcodec-aac-aacdec_lpd-Remove-dead-code.patch --] [-- Type: text/x-patch, Size: 3220 bytes --] From da8b42a4a789f21e33163284b8b3f550bd0511f1 Mon Sep 17 00:00:00 2001 From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> Date: Mon, 31 Mar 2025 17:45:38 +0200 Subject: [PATCH 05/12] avcodec/aac/aacdec_lpd: Remove dead code Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> --- libavcodec/aac/aacdec_lpd.c | 63 ------------------------------------- 1 file changed, 63 deletions(-) diff --git a/libavcodec/aac/aacdec_lpd.c b/libavcodec/aac/aacdec_lpd.c index 0dd8cbe741..93be7a74d1 100644 --- a/libavcodec/aac/aacdec_lpd.c +++ b/libavcodec/aac/aacdec_lpd.c @@ -22,42 +22,6 @@ #include "aacdec_usac.h" #include "libavcodec/unary.h" -static const uint8_t aac_lpd_mode_tab[32][4] = { - { 0, 0, 0, 0 }, - { 1, 0, 0, 0 }, - { 0, 1, 0, 0 }, - { 1, 1, 0, 0 }, - { 0, 0, 1, 0 }, - { 1, 0, 1, 0 }, - { 0, 1, 1, 0 }, - { 1, 1, 1, 0 }, - { 0, 0, 0, 1 }, - { 1, 0, 0, 1 }, - { 0, 1, 0, 1 }, - { 1, 1, 0, 1 }, - { 0, 0, 1, 1 }, - { 1, 0, 1, 1 }, - { 0, 1, 1, 1 }, - { 1, 1, 1, 1 }, - { 2, 2, 0, 0 }, - { 2, 2, 1, 0 }, - { 2, 2, 0, 1 }, - { 2, 2, 1, 1 }, - { 0, 0, 2, 2 }, - { 1, 0, 2, 2 }, - { 0, 1, 2, 2 }, - { 1, 1, 2, 2 }, - { 2, 2, 2, 2 }, - { 3, 3, 3, 3 }, - /* Larger values are reserved, but permit them for resilience */ - { 0, 0, 0, 0 }, - { 0, 0, 0, 0 }, - { 0, 0, 0, 0 }, - { 0, 0, 0, 0 }, - { 0, 0, 0, 0 }, - { 0, 0, 0, 0 }, -}; - static void parse_qn(GetBitContext *gb, int *qn, int nk_mode, int no_qn) { if (nk_mode == 1) { @@ -148,8 +112,6 @@ int ff_aac_parse_fac_data(AACUsacElemData *ce, GetBitContext *gb, int ff_aac_ldp_parse_channel_stream(AACDecContext *ac, AACUSACConfig *usac, AACUsacElemData *ce, GetBitContext *gb) { - int k; - const uint8_t *mod; int first_ldp_flag; ce->ldp.acelp_core_mode = get_bits(gb, 3); @@ -159,35 +121,10 @@ int ff_aac_ldp_parse_channel_stream(AACDecContext *ac, AACUSACConfig *usac, ce->ldp.core_mode_last = get_bits1(gb); ce->ldp.fac_data_present = get_bits1(gb); - mod = aac_lpd_mode_tab[ce->ldp.lpd_mode]; - first_ldp_flag = !ce->ldp.core_mode_last; if (first_ldp_flag) ce->ldp.last_lpd_mode = -1; /* last_ldp_mode is a **STATEFUL** value */ - k = 0; - while (k < 0) { - if (!k) { - if (ce->ldp.core_mode_last && ce->ldp.fac_data_present) - ff_aac_parse_fac_data(ce, gb, 0, usac->core_frame_len/8); - } else { - if (!ce->ldp.last_lpd_mode && mod[k] > 0 || - ce->ldp.last_lpd_mode && !mod[k]) - ff_aac_parse_fac_data(ce, gb, 0, usac->core_frame_len/8); - } - if (!mod[k]) { -// parse_acelp_coding(); - ce->ldp.last_lpd_mode = 0; - k++; - } else { -// parse_tcx_coding(); - ce->ldp.last_lpd_mode = mod[k]; - k += (1 << (mod[k] - 1)); - } - } - -// parse_lpc_data(first_lpd_flag); - if (!ce->ldp.core_mode_last && ce->ldp.fac_data_present) { uint16_t len_8 = usac->core_frame_len / 8; uint16_t len_16 = usac->core_frame_len / 16; -- 2.45.2 [-- Attachment #7: 0006-avcodec-aactab-Remove-unused-arrays.patch --] [-- Type: text/x-patch, Size: 3125 bytes --] From a388691e14698d0dd54ef12c536bd8eebca04890 Mon Sep 17 00:00:00 2001 From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> Date: Mon, 31 Mar 2025 17:47:51 +0200 Subject: [PATCH 06/12] avcodec/aactab: Remove unused arrays Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> --- libavcodec/aactab.c | 34 ---------------------------------- libavcodec/aactab.h | 4 ---- 2 files changed, 38 deletions(-) diff --git a/libavcodec/aactab.c b/libavcodec/aactab.c index 8d4587d241..4e2739ecb1 100644 --- a/libavcodec/aactab.c +++ b/libavcodec/aactab.c @@ -3884,31 +3884,6 @@ const DECLARE_ALIGNED(32, int, ff_aac_eld_window_480_fixed)[1800] = { 0xffedebe1, 0xffee287d, 0xffee654e, 0xffeea23f, }; -/* As specified by ISO/IEC 23003 */ -#define USAC_EMPH_COEFF 0.68 - -DECLARE_ALIGNED(16, const float, ff_aac_deemph_weights)[16] = { - USAC_EMPH_COEFF, - USAC_EMPH_COEFF*USAC_EMPH_COEFF, - USAC_EMPH_COEFF*USAC_EMPH_COEFF*USAC_EMPH_COEFF, - USAC_EMPH_COEFF*USAC_EMPH_COEFF*USAC_EMPH_COEFF*USAC_EMPH_COEFF, - - 0, - USAC_EMPH_COEFF, - USAC_EMPH_COEFF*USAC_EMPH_COEFF, - USAC_EMPH_COEFF*USAC_EMPH_COEFF*USAC_EMPH_COEFF, - - 0, - 0, - USAC_EMPH_COEFF, - USAC_EMPH_COEFF*USAC_EMPH_COEFF, - - 0, - 0, - 0, - USAC_EMPH_COEFF, -}; - const int ff_aac_usac_samplerate[32] = { 96000, 88200, 64000, 48000, 44100, 32000, 24000, 22050, 16000, 12000, 11025, 8000, 7350, -1, -1, 57600, @@ -3936,12 +3911,3 @@ const float ff_aac_usac_mdst_filt_cur[4 /* Window */][4 /* Shape */][7] = { 0.207421, 0.001416, 0.635010, 0.000000, -0.635010, -0.001416, -0.207421 }, { 0.207421, -0.001416, 0.635010, 0.000000, -0.635010, 0.001416, -0.207421 } } }; - -/* Window type (everything/longstop+stopstart), sine or kbd */ -const float ff_aac_usac_mdst_filt_prev[2 /* Window */][2 /* sine/kbd */][7] = -{ - { { 0.000000, 0.106103, 0.250000, 0.318310, 0.250000, 0.106103, 0.000000 }, - { 0.059509, 0.123714, 0.186579, 0.213077, 0.186579, 0.123714, 0.059509 } }, - { { 0.038498, 0.039212, 0.039645, 0.039790, 0.039645, 0.039212, 0.038498 }, - { 0.026142, 0.026413, 0.026577, 0.026631, 0.026577, 0.026413, 0.026142 } } -}; diff --git a/libavcodec/aactab.h b/libavcodec/aactab.h index 84879aa8f8..e286d98385 100644 --- a/libavcodec/aactab.h +++ b/libavcodec/aactab.h @@ -64,8 +64,6 @@ DECLARE_ALIGNED(32, extern const float, ff_aac_eld_window_480)[1800]; DECLARE_ALIGNED(32, extern const int, ff_aac_eld_window_480_fixed)[1800]; // @} -extern const float ff_aac_deemph_weights[16]; - /* Initializes data shared between float decoder and encoder. */ void ff_aac_float_common_init(void); @@ -125,7 +123,5 @@ extern const int ff_aac_usac_samplerate[32]; /* Window type (only long+eight, start/stop/stopstart), sine+sine, kbd+kbd, sine+kbd, kbd+sine */ extern const float ff_aac_usac_mdst_filt_cur[4 /* Window */][4 /* Shape */][7]; -/* Window type (everything/longstop+stopstart), sine or kbd */ -extern const float ff_aac_usac_mdst_filt_prev[2 /* Window */][2 /* sine/kbd */][7]; #endif /* AVCODEC_AACTAB_H */ -- 2.45.2 [-- Attachment #8: 0007-avcodec-vulkan_video-Remove-unused-ff_vk_h26-45-_pro.patch --] [-- Type: text/x-patch, Size: 2343 bytes --] From 520fa33b01b549753d2d4144ab9975f2f00daeb7 Mon Sep 17 00:00:00 2001 From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> Date: Mon, 31 Mar 2025 18:39:09 +0200 Subject: [PATCH 07/12] avcodec/vulkan_video: Remove unused ff_vk_h26[45]_profile_to_av() Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> --- libavcodec/vulkan_video.c | 21 --------------------- libavcodec/vulkan_video.h | 2 -- 2 files changed, 23 deletions(-) diff --git a/libavcodec/vulkan_video.c b/libavcodec/vulkan_video.c index 183044b3ff..1d44406aa1 100644 --- a/libavcodec/vulkan_video.c +++ b/libavcodec/vulkan_video.c @@ -247,27 +247,6 @@ StdVideoH265ProfileIdc ff_vk_h265_profile_to_vk(int profile) } } -int ff_vk_h264_profile_to_av(StdVideoH264ProfileIdc profile) -{ - switch (profile) { - case STD_VIDEO_H264_PROFILE_IDC_BASELINE: return AV_PROFILE_H264_CONSTRAINED_BASELINE; - case STD_VIDEO_H264_PROFILE_IDC_MAIN: return AV_PROFILE_H264_MAIN; - case STD_VIDEO_H264_PROFILE_IDC_HIGH: return AV_PROFILE_H264_HIGH; - case STD_VIDEO_H264_PROFILE_IDC_HIGH_444_PREDICTIVE: return AV_PROFILE_H264_HIGH_444_PREDICTIVE; - default: return AV_PROFILE_UNKNOWN; - } -} - -int ff_vk_h265_profile_to_av(StdVideoH264ProfileIdc profile) -{ - switch (profile) { - case STD_VIDEO_H265_PROFILE_IDC_MAIN: return AV_PROFILE_HEVC_MAIN; - case STD_VIDEO_H265_PROFILE_IDC_MAIN_10: return AV_PROFILE_HEVC_MAIN_10; - case STD_VIDEO_H265_PROFILE_IDC_FORMAT_RANGE_EXTENSIONS: return AV_PROFILE_HEVC_REXT; - default: return AV_PROFILE_UNKNOWN; - } -} - int ff_vk_create_view(FFVulkanContext *s, FFVkVideoCommon *common, VkImageView *view, VkImageAspectFlags *aspect, AVVkFrame *src, VkFormat vkf, int is_dpb) diff --git a/libavcodec/vulkan_video.h b/libavcodec/vulkan_video.h index f791225e12..0348c3b804 100644 --- a/libavcodec/vulkan_video.h +++ b/libavcodec/vulkan_video.h @@ -77,8 +77,6 @@ StdVideoH265LevelIdc ff_vk_h265_level_to_vk(int level_idc); */ StdVideoH264ProfileIdc ff_vk_h264_profile_to_vk(int profile); StdVideoH265ProfileIdc ff_vk_h265_profile_to_vk(int profile); -int ff_vk_h264_profile_to_av(StdVideoH264ProfileIdc profile); -int ff_vk_h265_profile_to_av(StdVideoH264ProfileIdc profile); /** * Creates image views for video frames. -- 2.45.2 [-- Attachment #9: 0008-avcodec-x86-h26x-h265dsp-Remove-unused-functions.patch --] [-- Type: text/x-patch, Size: 2409 bytes --] From 0db381ca5a9038a4dbd25a7192c81ca94bef067b Mon Sep 17 00:00:00 2001 From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> Date: Mon, 31 Mar 2025 19:49:32 +0200 Subject: [PATCH 08/12] avcodec/x86/h26x/h265dsp: Remove unused functions The ff_h2656_put_{uni_,}8tap_hv{32,64,128}_8_avx2 and ff_h2656_put_{uni_,}4tap_hv{64,128}_8_avx2 functions were unused and have been removed. This saved 3712B of .text here. (ff_h2656_put_{uni_,}4tap_hv32_8_avx2 are now only called from exactly one callsite (in ff_hevc_put_{uni_,}epel_hv32_8_avx2) and could be inlined.) Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> --- libavcodec/x86/h26x/h2656_inter.asm | 1 - libavcodec/x86/h26x/h2656dsp.c | 13 ++++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/libavcodec/x86/h26x/h2656_inter.asm b/libavcodec/x86/h26x/h2656_inter.asm index cbba0c1ea5..49a95d58fb 100644 --- a/libavcodec/x86/h26x/h2656_inter.asm +++ b/libavcodec/x86/h26x/h2656_inter.asm @@ -1126,7 +1126,6 @@ H2656PUT_8TAP 32, 8 H2656PUT_8TAP 16, 10 H2656PUT_8TAP 16, 12 -H2656PUT_8TAP_HV 32, 8 H2656PUT_8TAP_HV 16, 10 H2656PUT_8TAP_HV 16, 12 diff --git a/libavcodec/x86/h26x/h2656dsp.c b/libavcodec/x86/h26x/h2656dsp.c index c402f9e21c..1d8ec1898d 100644 --- a/libavcodec/x86/h26x/h2656dsp.c +++ b/libavcodec/x86/h26x/h2656dsp.c @@ -80,9 +80,7 @@ mc_rep_funcs(8tap_hv, 8, 8, 16, sse4) #if HAVE_AVX2_EXTERNAL -#define MC_REP_FUNCS_AVX2(fname) \ - mc_rep_funcs(fname, 8, 32, 64, avx2) \ - mc_rep_funcs(fname, 8, 32,128, avx2) \ +#define MC_REP_FUNCS_AVX2_NO8(fname) \ mc_rep_funcs(fname,10, 16, 32, avx2) \ mc_rep_funcs(fname,10, 16, 64, avx2) \ mc_rep_funcs(fname,10, 16,128, avx2) \ @@ -90,12 +88,17 @@ mc_rep_funcs(8tap_hv, 8, 8, 16, sse4) mc_rep_funcs(fname,12, 16, 64, avx2) \ mc_rep_funcs(fname,12, 16,128, avx2) \ +#define MC_REP_FUNCS_AVX2(fname) \ + mc_rep_funcs(fname, 8, 32, 64, avx2) \ + mc_rep_funcs(fname, 8, 32,128, avx2) \ + MC_REP_FUNCS_AVX2_NO8(fname) + MC_REP_FUNCS_AVX2(pixels) MC_REP_FUNCS_AVX2(8tap_h) MC_REP_FUNCS_AVX2(8tap_v) -MC_REP_FUNCS_AVX2(8tap_hv) +MC_REP_FUNCS_AVX2_NO8(8tap_hv) MC_REP_FUNCS_AVX2(4tap_h) MC_REP_FUNCS_AVX2(4tap_v) -MC_REP_FUNCS_AVX2(4tap_hv) +MC_REP_FUNCS_AVX2_NO8(4tap_hv) #endif #endif -- 2.45.2 [-- Attachment #10: 0009-avfilter-palette-Remove-unused-ff_srgb_u8_to_linear_.patch --] [-- Type: text/x-patch, Size: 1422 bytes --] From c3348d5dcc9bf458d208a398554fb796358e97ef Mon Sep 17 00:00:00 2001 From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> Date: Mon, 31 Mar 2025 20:27:55 +0200 Subject: [PATCH 09/12] avfilter/palette: Remove unused ff_srgb_u8_to_linear_int() Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> --- libavfilter/palette.c | 5 ----- libavfilter/palette.h | 6 ------ 2 files changed, 11 deletions(-) diff --git a/libavfilter/palette.c b/libavfilter/palette.c index bba136408c..e5ea0cab67 100644 --- a/libavfilter/palette.c +++ b/libavfilter/palette.c @@ -110,11 +110,6 @@ static const uint8_t linear2srgb[P + 1] = { 0xfc, 0xfc, 0xfc, 0xfc, 0xfd, 0xfd, 0xfd, 0xfd, 0xfd, 0xfe, 0xfe, 0xfe, 0xfe, 0xff, 0xff, 0xff, }; -int32_t ff_srgb_u8_to_linear_int(uint8_t x) -{ - return (int32_t)srgb2linear[x]; -} - uint8_t ff_linear_int_to_srgb_u8(int32_t x) { if (x <= 0) { diff --git a/libavfilter/palette.h b/libavfilter/palette.h index d3acc854ba..056ea36b93 100644 --- a/libavfilter/palette.h +++ b/libavfilter/palette.h @@ -31,12 +31,6 @@ struct Lab { int32_t L, a, b; }; -/** - * Map sRGB 8-bit color component to a 16-bit linear value (gamma - * expand from electrical to optical value). - */ -int32_t ff_srgb_u8_to_linear_int(uint8_t x); - /** * Map a 16-bit linear value to a sRGB 8-bit color component (gamma * compressed from optical to electrical value). -- 2.45.2 [-- Attachment #11: 0010-doc-in-out-devs-Remove-documentation-for-removed-dev.patch --] [-- Type: text/x-patch, Size: 5540 bytes --] From ed5ef06f3eaf385768e9f46f51a9dc7a737987e4 Mon Sep 17 00:00:00 2001 From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> Date: Mon, 31 Mar 2025 20:57:54 +0200 Subject: [PATCH 10/12] doc/{in,out}devs: Remove documentation for removed devices Namely bktr, opengl and sdl2. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> --- doc/indevs.texi | 35 --------------- doc/outdevs.texi | 111 ----------------------------------------------- 2 files changed, 146 deletions(-) diff --git a/doc/indevs.texi b/doc/indevs.texi index cdf44a6638..998bd845e8 100644 --- a/doc/indevs.texi +++ b/doc/indevs.texi @@ -220,41 +220,6 @@ $ ffmpeg -f avfoundation -capture_raw_data true -i "zr100:none" out.dv @end itemize -@section bktr - -BSD video input device. Deprecated and will be removed - please contact -the developers if you are interested in maintaining it. - -@subsection Options - -@table @option - -@item framerate -Set the frame rate. - -@item video_size -Set the video frame size. Default is @code{vga}. - -@item standard - -Available values are: -@table @samp -@item pal - -@item ntsc - -@item secam - -@item paln - -@item palm - -@item ntscj - -@end table - -@end table - @section decklink The decklink input device provides capture capabilities for Blackmagic diff --git a/doc/outdevs.texi b/doc/outdevs.texi index 9ee857528e..86c78f31b7 100644 --- a/doc/outdevs.texi +++ b/doc/outdevs.texi @@ -301,45 +301,6 @@ ffmpeg -re -i INPUT -c:v rawvideo -pix_fmt bgra -f fbdev /dev/fb0 See also @url{http://linux-fbdev.sourceforge.net/}, and fbset(1). -@section opengl -OpenGL output device. Deprecated and will be removed. - -To enable this output device you need to configure FFmpeg with @code{--enable-opengl}. - -This output device allows one to render to OpenGL context. -Context may be provided by application or default SDL window is created. - -When device renders to external context, application must implement handlers for following messages: -@code{AV_DEV_TO_APP_CREATE_WINDOW_BUFFER} - create OpenGL context on current thread. -@code{AV_DEV_TO_APP_PREPARE_WINDOW_BUFFER} - make OpenGL context current. -@code{AV_DEV_TO_APP_DISPLAY_WINDOW_BUFFER} - swap buffers. -@code{AV_DEV_TO_APP_DESTROY_WINDOW_BUFFER} - destroy OpenGL context. -Application is also required to inform a device about current resolution by sending @code{AV_APP_TO_DEV_WINDOW_SIZE} message. - -@subsection Options -@table @option - -@item background -Set background color. Black is a default. -@item no_window -Disables default SDL window when set to non-zero value. -Application must provide OpenGL context and both @code{window_size_cb} and @code{window_swap_buffers_cb} callbacks when set. -@item window_title -Set the SDL window title, if not specified default to the filename specified for the output device. -Ignored when @option{no_window} is set. -@item window_size -Set preferred window size, can be a string of the form widthxheight or a video size abbreviation. -If not specified it defaults to the size of the input video, downscaled according to the aspect ratio. -Mostly usable when @option{no_window} is not set. - -@end table - -@subsection Examples -Play a file on SDL window using OpenGL rendering: -@example -ffmpeg -i INPUT -f opengl "window title" -@end example - @section oss OSS (Open Sound System) output device. @@ -406,78 +367,6 @@ Play a file on default device on default server: ffmpeg -i INPUT -f pulse "stream name" @end example -@section sdl - -SDL (Simple DirectMedia Layer) output device. Deprecated and will be removed. - -For monitoring purposes in FFmpeg, pipes and a video player such as ffplay can be used: - -@example -ffmpeg -i INPUT -f nut -c:v rawvideo - | ffplay - -@end example - -"sdl2" can be used as alias for "sdl". - -This output device allows one to show a video stream in an SDL -window. Only one SDL window is allowed per application, so you can -have only one instance of this output device in an application. - -To enable this output device you need libsdl installed on your system -when configuring your build. - -For more information about SDL, check: -@url{http://www.libsdl.org/} - -@subsection Options - -@table @option - -@item window_borderless -Set SDL window border off. -Default value is 0 (enable window border). - -@item window_enable_quit -Enable quit action (using window button or keyboard key) -when non-zero value is provided. -Default value is 1 (enable quit action). - -@item window_fullscreen -Set fullscreen mode when non-zero value is provided. -Default value is zero. - -@item window_size -Set the SDL window size, can be a string of the form -@var{width}x@var{height} or a video size abbreviation. -If not specified it defaults to the size of the input video, -downscaled according to the aspect ratio. - -@item window_title -Set the SDL window title, if not specified default to the filename -specified for the output device. - -@item window_x -@item window_y -Set the position of the window on the screen. -@end table - -@subsection Interactive commands - -The window created by the device can be controlled through the -following interactive commands. - -@table @key -@item q, ESC -Quit the device immediately. -@end table - -@subsection Examples - -The following command shows the @command{ffmpeg} output is an -SDL window, forcing its size to the qcif format: -@example -ffmpeg -i INPUT -c:v rawvideo -pix_fmt yuv420p -window_size qcif -f sdl "SDL output" -@end example - @section sndio sndio audio output device. -- 2.45.2 [-- Attachment #12: 0011-avcodec-vdpau-Only-include-mpegvideodec.h-when-used.patch --] [-- Type: text/x-patch, Size: 1530 bytes --] From 67d7df54e02ee50dd885562356958dd6e60a71e3 Mon Sep 17 00:00:00 2001 From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> Date: Mon, 31 Mar 2025 21:27:29 +0200 Subject: [PATCH 11/12] avcodec/vdpau: Only include mpegvideodec.h when used mpegvideodec.h includes mpegvideodata.h which in turn contains a "static const uint8_t *const ff_mpeg1_dc_scale_table = ff_mpeg12_dc_scale_table[0]"; yet if mpegvideo is disabled, ff_mpeg12_dc_scale_table is not available, yet a non-optimizing compiler (like GCC with -O0) may emit ff_mpeg1_dc_scale_table and therefore a reference to ff_mpeg12_dc_scale_table nevertheless. Fix this by only including mpegvideodec.h if it is needed. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> --- libavcodec/vdpau.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libavcodec/vdpau.c b/libavcodec/vdpau.c index 23c2e3a55d..e99ac5338d 100644 --- a/libavcodec/vdpau.c +++ b/libavcodec/vdpau.c @@ -28,7 +28,6 @@ #include "decode.h" #include "hwaccel_internal.h" #include "internal.h" -#include "mpegvideodec.h" #include "vdpau.h" #include "vdpau_internal.h" @@ -353,6 +352,8 @@ int ff_vdpau_common_end_frame(AVCodecContext *avctx, AVFrame *frame, #if CONFIG_MPEG1_VDPAU_HWACCEL || \ CONFIG_MPEG2_VDPAU_HWACCEL || CONFIG_MPEG4_VDPAU_HWACCEL || \ CONFIG_VC1_VDPAU_HWACCEL || CONFIG_WMV3_VDPAU_HWACCEL +#include "mpegvideodec.h" + int ff_vdpau_mpeg_end_frame(AVCodecContext *avctx) { MpegEncContext *s = avctx->priv_data; -- 2.45.2 [-- Attachment #13: 0012-avutil-Makefile-Only-include-half2float-float2half-w.patch --] [-- Type: text/x-patch, Size: 2347 bytes --] From 3735fc2cb1f8f03ba338c12ed6242c31ce34445b Mon Sep 17 00:00:00 2001 From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> Date: Mon, 31 Mar 2025 21:40:49 +0200 Subject: [PATCH 12/12] avutil/Makefile: Only include half2float, float2half when needed They are not needed for shared builds (and because --gc-sections is not the default for shared builds, they were included by default included in libavutil since bf22c4cc3e005c01f50e233b1582fd1d8051aed9). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> --- libavutil/Makefile | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/libavutil/Makefile b/libavutil/Makefile index 6fe92aa1c9..9ef118016b 100644 --- a/libavutil/Makefile +++ b/libavutil/Makefile @@ -139,12 +139,10 @@ OBJS = adler32.o \ file.o \ file_open.o \ float_dsp.o \ - float2half.o \ float_scalarproduct.o \ film_grain_params.o \ fixed_dsp.o \ frame.o \ - half2float.o \ hash.o \ hdr_dynamic_metadata.o \ hdr_dynamic_vivid_metadata.o \ @@ -221,6 +219,13 @@ OBJS-$(!CONFIG_VULKAN) += hwcontext_stub.o OBJS += $(COMPAT_OBJS:%=../compat/%) +# Object files to satisfy dependencies of other libraries for static builds +STLIBOBJS-$(CONFIG_EXR_DECODER) += half2float.o float2half.o +STLIBOBJS-$(CONFIG_EXR_ENCODER) += float2half.o +STLIBOBJS-$(CONFIG_PHM_DECODER) += half2float.o +STLIBOBJS-$(CONFIG_PHM_ENCODER) += float2half.o +STLIBOBJS-$(CONFIG_SWSCALE) += half2float.o + # Windows resource file SHLIBOBJS-$(HAVE_GNU_WINDRES) += avutilres.o -- 2.45.2 [-- Attachment #14: Type: text/plain, Size: 251 bytes --] _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
next reply other threads:[~2025-03-31 19:56 UTC|newest] Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top 2025-03-31 19:56 Andreas Rheinhardt [this message] 2025-04-02 14:23 ` Andreas Rheinhardt
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=AS8P250MB0744F8C41AE8B7F0D27B81AD8FAD2@AS8P250MB0744.EURP250.PROD.OUTLOOK.COM \ --to=andreas.rheinhardt@outlook.com \ --cc=ffmpeg-devel@ffmpeg.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel This inbox may be cloned and mirrored by anyone: git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git # If you have public-inbox 1.1+ installed, you may # initialize and index your mirror using the following commands: public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \ ffmpegdev@gitmailbox.com public-inbox-index ffmpegdev Example config snippet for mirrors. AGPL code for this site: git clone https://public-inbox.org/public-inbox.git