Fix gcc/clang warnings and errors in cfg.c

This commit is contained in:
Miika Metsoila 2017-12-08 16:09:00 +02:00
parent bac07457ea
commit b3486b5114

View file

@ -1453,7 +1453,7 @@ int kvz_config_validate(const kvz_config *const cfg)
error = 1; error = 1;
} }
if (validate_hevc_level(cfg)) { if (validate_hevc_level((kvz_config *const) cfg)) {
// a level error found and it's not okay // a level error found and it's not okay
error = 1; error = 1;
} }
@ -1463,29 +1463,29 @@ int kvz_config_validate(const kvz_config *const cfg)
static int validate_hevc_level(kvz_config *const cfg) { static int validate_hevc_level(kvz_config *const cfg) {
static const struct { uint32_t lsr; uint32_t lps; uint32_t main_bitrate; } LEVEL_CONSTRAINTS[13] = { static const struct { uint32_t lsr; uint32_t lps; uint32_t main_bitrate; } LEVEL_CONSTRAINTS[13] = {
{ 552'960, 36'864, 128 }, // 1 { 552960, 36864, 128 }, // 1
{ 3'686'400, 122'880, 1500 }, // 2 { 3686400, 122880, 1500 }, // 2
{ 7'372'800, 245'760, 3000 }, // 2.1 { 7372800, 245760, 3000 }, // 2.1
{ 16'588'800, 552'960, 6000 }, // 3 { 16588800, 552960, 6000 }, // 3
{ 33'177'600, 983'040, 10'000 }, // 3.1 { 33177600, 983040, 10000 }, // 3.1
{ 66'846'720, 2'228'224, 12'000 }, // 4 { 66846720, 2228224, 12000 }, // 4
{ 133'693'440, 2'228'224, 20'000 }, // 4.1 { 133693440, 2228224, 20000 }, // 4.1
{ 267'386'880, 8'912'896, 25'000 }, // 5 { 267386880, 8912896, 25000 }, // 5
{ 534'773'760, 8'912'896, 40'000 }, // 5.1 { 534773760, 8912896, 40000 }, // 5.1
{ 1'069'547'520, 8'912'896, 60'000 }, // 5.2 { 1069547520, 8912896, 60000 }, // 5.2
{ 1'069'547'520, 35'651'584, 60'000 }, // 6 { 1069547520, 35651584, 60000 }, // 6
{ 2'139'095'040, 35'651'584, 120'000 }, // 6.1 { 2139095040, 35651584, 120000 }, // 6.1
{ 4'278'190'080, 35'651'584, 240'000 }, // 6.2 { 4278190080, 35651584, 240000 }, // 6.2
}; };
// bit rates for the high-tiers of the levels from 4 to 6.2 // bit rates for the high-tiers of the levels from 4 to 6.2
static const uint32_t HIGH_TIER_BITRATES[8] = { static const uint32_t HIGH_TIER_BITRATES[8] = {
30'000, 50'000, 100'000, 160'000, 240'000, 240'000, 480'000, 800'000 30000, 50000, 100000, 160000, 240000, 240000, 480000, 800000
}; };
int level_error = 0; int level_error = 0;