MCPcopy Create free account
hub / github.com/Tencent/libpag / init

Method init

exporter/src/export/encode/VideoEncoder.cpp:75–99  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

73}
74
75bool PAGEncoder::init(int width, int height, double frameRate, bool hasAlpha,
76 int maxKeyFrameInterval, int quality) {
77 inputWidth = width;
78 inputHeight = height;
79 internalWidth = SIZE_ALIGN(width);
80 internalHeight = SIZE_ALIGN(height);
81 this->hasAlpha = hasAlpha;
82 if (hasAlpha) {
83 if (internalWidth < internalHeight) {
84 alphaStartX = internalWidth + paddingX;
85 alphaStartY = 0;
86 internalWidth = internalWidth * 2 + paddingX;
87 } else {
88 alphaStartX = 0;
89 alphaStartY = internalHeight + paddingY;
90 internalHeight = internalHeight * 2 + paddingY;
91 }
92 }
93
94 encoder->open(internalWidth, internalHeight, frameRate, hasAlpha, maxKeyFrameInterval, quality);
95 colorspace_init();
96 c264_csp_init(0);
97
98 return true;
99}
100
101void PAGEncoder::getAlphaStartXY(int32_t* pAlphaStartX, int32_t* pAlphaStartY) {
102 *pAlphaStartX = alphaStartX;

Callers 2

GetVideoSequenceFunction · 0.45
GetAudioSequenceFunction · 0.45

Calls 3

colorspace_initFunction · 0.85
c264_csp_initFunction · 0.85
openMethod · 0.45

Tested by

no test coverage detected