diff mbox series

[FFmpeg-devel] configure: Make nvenc select atsc_a53

Message ID PR3PR03MB6665176333AFAA4B13105D758F4B9@PR3PR03MB6665.eurprd03.prod.outlook.com
State Superseded
Headers show
Series [FFmpeg-devel] configure: Make nvenc select atsc_a53 | expand

Checks

Context Check Description
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished
andriy/make_ppc success Make finished
andriy/make_fate_ppc success Make fate finished

Commit Message

Andreas Rheinhardt Jan. 5, 2022, 5:39 a.m. UTC
It is the common code (that is compiled depending upon CONFIG_NVENC)
that uses ff_alloc_a53_sei(), so it is natural to make nvenc itself
select atsc_a53.
This fixes compilation errors in case nvenc is enabled
(e.g. autodected) with both nvenc-based encoders disabled.
(This works in case of static linking (nothing pulls in nvenc.o),
but it fails with shared builds.)

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
It would also be obviously desirable to disable nvenc if it is
not needed if it is only autodetected and not explicitly enabled.
Maybe it should even be unconditionally disabled if unused.

There is btw a similar issue with crystalhd: If it is enabled,
yet all the decoders are disabled and if one uses -O0, then
the unused functions in crystalhd.c are not stripped away and
linking errors ensue.

 configure | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Timo Rothenpieler Jan. 5, 2022, 1:03 p.m. UTC | #1
On 05.01.2022 06:39, Andreas Rheinhardt wrote:
> It is the common code (that is compiled depending upon CONFIG_NVENC)
> that uses ff_alloc_a53_sei(), so it is natural to make nvenc itself
> select atsc_a53.
> This fixes compilation errors in case nvenc is enabled
> (e.g. autodected) with both nvenc-based encoders disabled.
> (This works in case of static linking (nothing pulls in nvenc.o),
> but it fails with shared builds.)

The correct way to do this would probably just be to stop building 
nvenc.c when just nvenc is enabled, but instead move it to the two nvenc 
encoders.
It being like it currently is mainly has historical reasons, as it 
started out as single file encoder.

> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
> ---
> It would also be obviously desirable to disable nvenc if it is
> not needed if it is only autodetected and not explicitly enabled.
> Maybe it should even be unconditionally disabled if unused.

I don't think configure has any capability to do that? i.e. disable 
flags that nothing uses?
But if both encoders are disabled, nvenc.c should not be built at all 
anymore if changed as suggested above.
diff mbox series

Patch

diff --git a/configure b/configure
index 8392c26015..f76876ceff 100755
--- a/configure
+++ b/configure
@@ -3153,6 +3153,7 @@  sharpen_npp_filter_deps="ffnvcodec libnpp"
 amf_deps_any="libdl LoadLibrary"
 nvenc_deps="ffnvcodec"
 nvenc_deps_any="libdl LoadLibrary"
+nvenc_select="atsc_a53"
 
 aac_mf_encoder_deps="mediafoundation"
 ac3_mf_encoder_deps="mediafoundation"
@@ -3168,7 +3169,6 @@  h264_mediacodec_decoder_select="h264_mp4toannexb_bsf h264_parser"
 h264_mf_encoder_deps="mediafoundation"
 h264_mmal_decoder_deps="mmal"
 h264_nvenc_encoder_deps="nvenc"
-h264_nvenc_encoder_select="atsc_a53"
 h264_omx_encoder_deps="omx"
 h264_qsv_decoder_select="h264_mp4toannexb_bsf qsvdec"
 h264_qsv_encoder_select="atsc_a53 qsvenc"
@@ -3185,7 +3185,6 @@  hevc_mediacodec_decoder_deps="mediacodec"
 hevc_mediacodec_decoder_select="hevc_mp4toannexb_bsf hevc_parser"
 hevc_mf_encoder_deps="mediafoundation"
 hevc_nvenc_encoder_deps="nvenc"
-hevc_nvenc_encoder_select="atsc_a53"
 hevc_qsv_decoder_select="hevc_mp4toannexb_bsf qsvdec"
 hevc_qsv_encoder_select="hevcparse qsvenc"
 hevc_rkmpp_decoder_deps="rkmpp"