init commit

This commit is contained in:
Carlos
2026-02-21 10:33:18 +01:00
parent c863a943ed
commit 9d955bf338
9512 changed files with 2015317 additions and 1305 deletions

View File

@@ -0,0 +1,12 @@
import type { SpsInfo } from '../../containers/avc/parse-avc';
export declare const avcState: () => {
getPrevPicOrderCntLsb(): number;
getPrevPicOrderCntMsb(): number;
setPrevPicOrderCntLsb(value: number): void;
setPrevPicOrderCntMsb(value: number): void;
setSps(value: SpsInfo): void;
getSps(): SpsInfo | null;
getMaxFramesInBuffer(): number | null;
clear(): void;
};
export type AvcState = ReturnType<typeof avcState>;

View File

@@ -0,0 +1,44 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.avcState = void 0;
const max_buffer_size_1 = require("../../containers/avc/max-buffer-size");
const avcState = () => {
let prevPicOrderCntLsb = 0;
let prevPicOrderCntMsb = 0;
let sps = null;
let maxFramesInBuffer = null;
return {
getPrevPicOrderCntLsb() {
return prevPicOrderCntLsb;
},
getPrevPicOrderCntMsb() {
return prevPicOrderCntMsb;
},
setPrevPicOrderCntLsb(value) {
prevPicOrderCntLsb = value;
},
setPrevPicOrderCntMsb(value) {
prevPicOrderCntMsb = value;
},
setSps(value) {
const macroblockBufferSize = (0, max_buffer_size_1.macroBlocksPerFrame)(value);
const maxBufferSize = (0, max_buffer_size_1.maxMacroblockBufferSize)(value);
const maxFrames = Math.min(16, Math.floor(maxBufferSize / macroblockBufferSize));
maxFramesInBuffer = maxFrames;
sps = value;
},
getSps() {
return sps;
},
getMaxFramesInBuffer() {
return maxFramesInBuffer;
},
clear() {
maxFramesInBuffer = null;
sps = null;
prevPicOrderCntLsb = 0;
prevPicOrderCntMsb = 0;
},
};
};
exports.avcState = avcState;