1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

avcodec/h264_levels, h265_profile_level: Avoid relocations

H.264 and H.265 levels' names are usually of the form "x" or "x.y"
with x and y being single digits; the one exception are the H.264 1b
levels. All of those levels' names fit into a char[4] and it is likely
that this future levels will do so, too.

Therefore this commit changes the H26(4|5)LevelDescriptor structures
to use such a char [4] instead of a pointer to a const char. This makes
the structures smaller (when sizeof(char*) == 8) and avoids relocations,
thereby moving the corresponding arrays from .data.rel.ro into .rodata.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
Andreas Rheinhardt 2021-09-01 16:15:54 +02:00
parent a590dfc242
commit 0172deccc4
2 changed files with 2 additions and 2 deletions

View File

@ -23,7 +23,7 @@
#include <stdint.h>
typedef struct H264LevelDescriptor {
const char *name;
char name[4]; // Large enough for all current levels like "4.1"
uint8_t level_idc;
uint8_t constraint_set3_flag;
uint32_t max_mbps;

View File

@ -25,7 +25,7 @@
typedef struct H265LevelDescriptor {
const char *name;
char name[4]; // Large enough for all current levels like "4.1"
uint8_t level_idc;
// Table A.6.