[FFmpeg-devel] [PATCH 01/10] avcodec/libvpxenc: Avoid unused-variable warning if VP9 enc is disabled
Andreas Rheinhardt
andreas.rheinhardt at outlook.com
Wed Apr 3 18:28:08 EEST 2024
Anton Khirnov:
> Quoting Andreas Rheinhardt (2024-03-31 07:30:26)
>> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>
>> ---
>> libavcodec/libvpxenc.c | 7 ++++---
>> 1 file changed, 4 insertions(+), 3 deletions(-)
>>
>> diff --git a/libavcodec/libvpxenc.c b/libavcodec/libvpxenc.c
>> index 635cdf7a0e..bcbdc4981e 100644
>> --- a/libavcodec/libvpxenc.c
>> +++ b/libavcodec/libvpxenc.c
>> @@ -49,6 +49,9 @@
>> #include "libavutil/opt.h"
>> #include "libavutil/pixdesc.h"
>>
>> +#define IS_VP9(avctx) (CONFIG_LIBVPX_VP9_ENCODER && avctx->codec_id == AV_CODEC_ID_VP9)
>> +#define IS_VP8(avctx) (CONFIG_LIBVPX_VP8_ENCODER && avctx->codec_id == AV_CODEC_ID_VP8)
>> +
>> /**
>> * Portion of struct vpx_codec_cx_pkt from vpx_encoder.h.
>> * One encoded frame returned from the library.
>> @@ -359,8 +362,7 @@ static int frame_data_submit(AVCodecContext *avctx, AVFifo *fifo,
>> FrameData fd = { .pts = frame->pts };
>> int ret;
>>
>> -#if CONFIG_LIBVPX_VP9_ENCODER
>> - if (avctx->codec_id == AV_CODEC_ID_VP9 &&
>> + if (IS_VP9(avctx) &&
>
> Weren't we moving towards getting rid of our dependency on DCE?
> I recall some discussions about this in recent years, though I don't
> remember if there was a consensus.
>
This patch does not add any dependency on DCE, because the code block
currently #if'ed away does not contain anything that would cause a
linking failure with a compiler not performing DCE.
- Andreas
More information about the ffmpeg-devel
mailing list