tav: ictcp decoding fix

This commit is contained in:
minjaesong
2025-10-02 20:20:11 +09:00
parent 0666734c9d
commit d4fae0071b
4 changed files with 55 additions and 31 deletions

View File

@@ -657,6 +657,8 @@ try {
akku: akku2,
fileName: fullFilePathStr,
fileOrd: currentFileIndex,
resolution: `${header.width}x${header.height}`,
colourSpace: header.version % 2 == 0 ? "ICtCp" : "YCoCg",
currentStatus: 1
}
gui.printBottomBar(guiStatus)

View File

@@ -74,18 +74,17 @@ let notifHideTimer = 0
const NOTIF_SHOWUPTIME = 3000000000
let [cy, cx] = con.getyx()
let seqreadserial = require("seqread")
let seqreadtape = require("seqreadtape")
let gui = require("playgui")
let seqread = undefined
let fullFilePathStr = fullFilePath.full
// Select seqread driver to use
if (fullFilePathStr.startsWith('$:/TAPE') || fullFilePathStr.startsWith('$:\\TAPE')) {
seqread = seqreadtape
seqread = require("seqreadtape")
seqread.prepare(fullFilePathStr)
seqread.seek(0)
} else {
seqread = seqreadserial
seqread = require("seqread")
seqread.prepare(fullFilePathStr)
}
@@ -746,20 +745,29 @@ try {
if (interactive) {
notifHideTimer += (t2 - t1)
if (!notifHidden && notifHideTimer > (NOTIF_SHOWUPTIME + FRAME_TIME)) {
con.move(1, 1)
print(' '.repeat(79))
// clearing function here
notifHidden = true
}
if (!hasSubtitle) {
con.move(31, 1)
con.color_pair(253, 0)
print(`Frame: ${frameCount}/${totalFrames} (${((frameCount / akku2 * 100)|0) / 100}f) `)
con.move(32, 1)
con.color_pair(253, 0)
print(`VRate: ${(getVideoRate() / 1024 * 8)|0} kbps `)
con.move(1, 1)
con.color_pair(253, 0)
let guiStatus = {
fps: fps,
videoRate: getVideoRate(),
frameCount: frameCount,
totalFrames: totalFrames,
qY: qualityY,
qCo: qualityCo,
qCg: qualityCg,
akku: akku2,
fileName: fullFilePathStr,
fileOrd: 1,
resolution: `${width}x${height}${(isInterlaced) ? 'i' : ''}`,
colourSpace: colorSpace,
currentStatus: 1
}
gui.printBottomBar(guiStatus)
gui.printTopBar(guiStatus, 1)
}
t1 = t2

View File

@@ -218,7 +218,9 @@ status = {
akku: float,
fileName: String,
fileOrd: int,
currentStatus: int (0: stop/init, 1: play, 2: pause)
currentStatus: int (0: stop/init, 1: play, 2: pause),
resolution: string,
colourSpace: string
}
*/
@@ -258,8 +260,10 @@ function printTopBar(status, moreInfo) {
let sF = `F ${(''+status.frameCount).padStart((''+status.totalFrames).length, ' ')}/${status.totalFrames}`
let sQ = `Q${(''+status.qY).padStart(4,' ')},${(''+status.qCo).padStart(2,' ')},${(''+status.qCg).padStart(2,' ')}`
let sFPS = `${(status.frameCount / status.akku).toFixed(2)}f`
let sRes = `${status.resolution}`
let sCol = `${status.colourSpace}`
let sLeft = sF + BAR + sQ + BAR + sFPS + BAR
let sLeft = sF + BAR + sQ + BAR + sFPS + BAR + sRes + BAR + sCol + BAR
let filenameSpace = 80 - sLeft.length
if (filename.length > filenameSpace) {
filename = filename.slice(0, filenameSpace - 1) + '~'