[FFmpeg-devel] [PATCH 5/7] avcodec/vc2enc: Avoid relocations for short strings

Lynne dev at lynne.ee
Tue May 28 17:25:16 EEST 2024


On 28/05/2024 04:49, Andreas Rheinhardt wrote:
> These strings are so short that they can be put directly
> into the containing structure, avoiding the pointer
> and putting it into .rodata.
> Also use chars for interlaced and level while at it, as
> these are so small.
> 
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>
> ---
>   libavcodec/vc2enc.c | 5 +++--
>   1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/libavcodec/vc2enc.c b/libavcodec/vc2enc.c
> index 3285218724..8b9641916a 100644
> --- a/libavcodec/vc2enc.c
> +++ b/libavcodec/vc2enc.c
> @@ -41,8 +41,9 @@
>   typedef struct VC2BaseVideoFormat {
>       enum AVPixelFormat pix_fmt;
>       AVRational time_base;
> -    int width, height, interlaced, level;
> -    const char *name;
> +    int width, height;
> +    char interlaced, level;
> +    char name[13];
>   } VC2BaseVideoFormat;
>   
>   static const VC2BaseVideoFormat base_video_fmts[] = {

Patchset LGTM if interlaced and level are uint8_t like other commented.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_0xA2FEA5F03F034464.asc
Type: application/pgp-keys
Size: 624 bytes
Desc: OpenPGP public key
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20240528/2b1fd035/attachment.key>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature.asc
Type: application/pgp-signature
Size: 236 bytes
Desc: OpenPGP digital signature
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20240528/2b1fd035/attachment.sig>


More information about the ffmpeg-devel mailing list