[FFmpeg-devel] [PATCH v2] avcodec/amfenc: add smart access video option

Mark Thompson sw at jkqxz.net
Mon Nov 27 15:14:43 EET 2023


On 26/11/2023 14:40, Dmitrii Ovchinnikov wrote:
>>> The code looks significantly duplicated.
> 
> This is not moved to amfenc.c since the property has different names
>   for different encoders, and many other properties (also common to
> different encoders, but with different names) are separated in this way.

Seems like we could template this to avoid the duplication, something like:

#define PER_CODEC_OPTION(name) \
   (ctx->codec == AV1  ? AMF_VIDEO_ENCODER_AV1_  ## name : \
    ctx->codec == HEVC ? AMF_VIDEO_ENCODER_HEVC_ ## name : \
                         AMF_VIDEO_ENCODER_      ## name)

?

Thanks,

- Mark


More information about the ffmpeg-devel mailing list