[FFmpeg-cvslog] avcodec/vc2enc: Avoid relocations for short strings

Andreas Rheinhardt git at videolan.org
Fri May 31 15:30:12 EEST 2024


ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinhardt at outlook.com> | Mon May 27 17:15:09 2024 +0200| [c30928566623110354e4cb3a10f28183cee01684] | committer: Andreas Rheinhardt

avcodec/vc2enc: Avoid relocations for short strings

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.

Reviewed-by: Lynne <dev at lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c30928566623110354e4cb3a10f28183cee01684
---

 libavcodec/vc2enc.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/libavcodec/vc2enc.c b/libavcodec/vc2enc.c
index 3285218724..cad7390055 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;
+    uint8_t interlaced, level;
+    char name[13];
 } VC2BaseVideoFormat;
 
 static const VC2BaseVideoFormat base_video_fmts[] = {



More information about the ffmpeg-cvslog mailing list