gpt4 book ai didi

c - 为什么这段代码通过了编译器并成为验证码?

转载 作者:太空宇宙 更新时间:2023-11-04 01:05:49 25 4
gpt4 key购买 nike

以下是开源项目 X264 的代码片段,在尝试将其移植以支持 VS 编译器 cl.exe 时出现构建错误。 cl.exe[X264_PULLDOWN_22] 视为 lambda 的开始。那么谁能解释一下这行在 C 语言中的含义。

typedef struct
{
int mod;
uint8_t pattern[24];
float fps_factor;
} cli_pulldown_t;

enum pulldown_type_e
{
X264_PULLDOWN_22 = 1,
X264_PULLDOWN_32,
X264_PULLDOWN_64,
X264_PULLDOWN_DOUBLE,
X264_PULLDOWN_TRIPLE,
X264_PULLDOWN_EURO
};

#define TB PIC_STRUCT_TOP_BOTTOM
#define BT PIC_STRUCT_BOTTOM_TOP
#define TBT PIC_STRUCT_TOP_BOTTOM_TOP
#define BTB PIC_STRUCT_BOTTOM_TOP_BOTTOM

static const cli_pulldown_t pulldown_values[] =
{
/*WHAT DOES THIS LINE MEAN???, how can you assign to [X264_PULLDOWN_22]*/
[X264_PULLDOWN_22] = {1, {TB}, 1.0},
[X264_PULLDOWN_32] = {4, {TBT, BT, BTB, TB}, 1.25},
[X264_PULLDOWN_64] = {2, {PIC_STRUCT_DOUBLE, PIC_STRUCT_TRIPLE}, 1.0},
[X264_PULLDOWN_DOUBLE] = {1, {PIC_STRUCT_DOUBLE}, 2.0},
[X264_PULLDOWN_TRIPLE] = {1, {PIC_STRUCT_TRIPLE}, 3.0},
[X264_PULLDOWN_EURO] = {24, {TBT, BT, BT, BT, BT, BT, BT, BT, BT, BT, BT, BT,
BTB, TB, TB, TB, TB, TB, TB, TB, TB, TB, TB, TB}, 25.0/24.0}
};

最佳答案

这就是所谓的指定初始化程序。您可以阅读更多相关信息 here .

关于c - 为什么这段代码通过了编译器并成为验证码?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23472817/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com