diff --git a/src/components/Analyzer.tsx b/src/components/Analyzer.tsx index addae88..3a82160 100644 --- a/src/components/Analyzer.tsx +++ b/src/components/Analyzer.tsx @@ -51,6 +51,8 @@ enum HistogramTab { TransformType, PredictionMode, UVPredictionMode, + MotionMode, + CompoundType, Skip, DualFilterType } @@ -249,7 +251,7 @@ export class FrameInfoComponent extends React.Component<{ Video{this.props.activeGroup} - Frame{this.props.activeFrame + 1} + Frame Number{frame.json.frame} Frame Type{frame.json.frameType} @@ -362,6 +364,12 @@ export class ModeInfoComponent extends React.Component<{ UV Mode{getProperty("uv_mode")} + + Motion Mode{getProperty("motion_mode")} + + + Compound Type{getProperty("compound_type")} + Skip{getProperty("skip")} @@ -408,6 +416,8 @@ export class AnalyzerView extends React.Component x.predictionModeHist); case HistogramTab.UVPredictionMode: return frames.map(x => x.uvPredictionModeHist); + case HistogramTab.MotionMode: + return frames.map(x => x.motionModeHist); + case HistogramTab.CompoundType: + return frames.map(x => x.compoundTypeHist); case HistogramTab.Skip: return frames.map(x => x.skipHist); case HistogramTab.DualFilterType: @@ -1199,6 +1234,8 @@ export class AnalyzerView extends React.Component + + @@ -1679,6 +1718,22 @@ export class AnalyzerView extends React.Component { + ctx.fillStyle = getColor(motionModeTypeGrid[r][c], palette.motion_mode); + return true; + }); + } + drawCompoundType(frame: AnalyzerFrame, ctx: CanvasRenderingContext2D, src: Rectangle, dst: Rectangle) { + let compoundTypeMap = reverseMap(frame.json["compound_typeMap"]); + let compoundTypeGrid = frame.json["compound_type"]; + this.fillBlock(frame, ctx, src, dst, (blockSize, c, r, sc, sr) => { + ctx.fillStyle = getColor(compoundTypeGrid[r][c], palette.compound_type); + return true; + }); + } drawSegment(frame: AnalyzerFrame, ctx: CanvasRenderingContext2D, src: Rectangle, dst: Rectangle) { let segGrid = frame.json["seg_id"]; let segMapByValue = reverseMap(frame.json["seg_idMap"]); @@ -1693,7 +1748,7 @@ export class AnalyzerView extends React.Component { ctx.fillStyle = getColor(transformTypeMapByValue[typeGrid[r][c]], palette.transformType); return true; - }); + }, VisitMode.TransformBlock); } drawBits(frame: AnalyzerFrame, ctx: CanvasRenderingContext2D, src: Rectangle, dst: Rectangle) { let { blocks, total } = frame.accounting.countBits(this.state.showBitsFilter); @@ -1746,6 +1801,7 @@ export class AnalyzerView extends React.Component { let v = data[i][k]; ctx.fillStyle = this.props.color(k); if (this.props.horizontal) { let y = (h - ((t + v) * h)); - r.set(i * bw, y | 0, bw - 1, (v * h + (y - (y | 0))) | 0); + r.set(ii * bw, y | 0, bw - 1, (v * h + (y - (y | 0))) | 0); } else { - r.set((t * w | 0), bh * i, (v * w) | 0, bh - 1); + r.set((t * w | 0), bh * ii, (v * w) | 0, bh - 1); } if (r.containsPoint(this.position)) { ctx.globalAlpha = 1; @@ -142,9 +148,9 @@ export class HistogramComponent extends React.Component<{ if (this.props.highlight == i) { ctx.fillStyle = "white"; if (this.props.horizontal) { - ctx.fillRect(i * bw, 0, bw - 1, this.ratio * 4); + ctx.fillRect(ii * bw, 0, bw - 1, this.ratio * 4); } else { - ctx.fillRect(0, i * bh, this.ratio * 4, bh - 1); + ctx.fillRect(0, ii * bh, this.ratio * 4, bh - 1); } } } @@ -177,4 +183,4 @@ export class HistogramComponent extends React.Component<{ this.canvas = self} width="256" height="256"> } -} \ No newline at end of file +} diff --git a/src/components/Loader.tsx b/src/components/Loader.tsx index e89b4b6..b59da5b 100644 --- a/src/components/Loader.tsx +++ b/src/components/Loader.tsx @@ -112,7 +112,7 @@ export class LoaderComponent extends React.Component { // If we use the split view, we don't need any layers making decoding faster. if (!this.props.split && !this.props.bench) { - decoder.setLayers(0xffffffff); + decoder.setLayers(0xffffffffff); } if (this.props.bench == 1) { decoder.shouldReadImageData = false; diff --git a/src/components/analyzerTools.ts b/src/components/analyzerTools.ts index e0d86f0..d8b57ce 100644 --- a/src/components/analyzerTools.ts +++ b/src/components/analyzerTools.ts @@ -290,6 +290,7 @@ export class Histogram { export class AnalyzerFrame { json: { + frame: number; frameType: number; showFrame: number; baseQIndex: number; @@ -314,6 +315,8 @@ export class AnalyzerFrame { transformTypeHist: Histogram; predictionModeHist: Histogram; uvPredictionModeHist: Histogram; + motionModeHist: Histogram; + compoundTypeHist: Histogram; skipHist: Histogram; dualFilterTypeHist: Histogram; frameImage: FrameImage; @@ -420,6 +423,8 @@ function readFrameFromJson(json): AnalyzerFrame { uncompress(json["transformType"]); uncompress(json["mode"]); uncompress(json["uv_mode"]); + uncompress(json["motion_mode"]); + uncompress(json["compound_type"]); uncompress(json["skip"]); uncompress(json["filter"]); uncompress(json["cdef_level"]); @@ -441,6 +446,8 @@ function readFrameFromJson(json): AnalyzerFrame { frame.transformTypeHist = getHistogramFromJson(json, "transformType"); frame.predictionModeHist = getHistogramFromJson(json, "mode"); frame.uvPredictionModeHist = getHistogramFromJson(json, "uv_mode"); + frame.motionModeHist = getHistogramFromJson(json, "motion_mode"); + frame.compoundTypeHist = getHistogramFromJson(json, "compound_type"); frame.dualFilterTypeHist = getHistogramFromJson(json, "dualFilterType"); frame.miSizeLog2 = log2(json.config.MI_SIZE); frame.miSuperSizeLog2 = log2(64); // TODO: Does this ever change? @@ -974,6 +981,17 @@ export const palette = { 7: "#682bff", 8: "#e62b00", }, + motion_mode: { + 0: "#a45a00", + 1: "#00a781", + 2: "#ff70a6", + }, + compound_type: { + 0: "#00372a", + 1: "#ff9556", + 2: "#7a0032", + }, + transformType: { DCT_DCT: "#f4ffc3", ADST_DCT: "#622cd8",