Skip to content

Commit 12a1bc9

Browse files
committed
Fix H.263 SAC decoder & AV1 symbol decoder
1 parent d53c4aa commit 12a1bc9

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

ArithmeticCoding/ArithmeticCoding.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
88

99
<AssemblyTitle>Arithmetic Coding for .NET</AssemblyTitle>
10-
<AssemblyVersion>1.0.6</AssemblyVersion>
10+
<AssemblyVersion>1.0.7</AssemblyVersion>
1111
<Company>winscripter</Company>
1212
<Copyright>Copyright (c) 2023-2025, winscripter</Copyright>
1313
<LangVersion>14</LangVersion>
@@ -22,7 +22,7 @@
2222
<PackageTags>h264;h.264;cabac;entropy coding;entropy;arithmetic;arithmetic coding;av1;av1 symbol;av1 decoder;av1 symbol decoder;h.264 decoder;h264 decoder;h264 entropy;h.264 entropy;h263;h.263;h263 arithmetic;h.263 arithmetic;syntax based arithmetic;arithmetic decoder;arithmetic decoding;arithmetic encoder;arithmetic encoding;h263 sac;h.263 sac;h263 sac decoder;h.263 sac decoder;h263 sac encoder; h.263 sac encoder</PackageTags>
2323
<PackageLicenseExpression>MIT</PackageLicenseExpression>
2424
<PackageRequireLicenseAcceptance>True</PackageRequireLicenseAcceptance>
25-
<Version>1.0.6</Version>
25+
<Version>1.0.7</Version>
2626
</PropertyGroup>
2727

2828
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|netstandard2.0|AnyCPU'">

ArithmeticCoding/Av1/Av1SymbolDecoder.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ public int ReadSymbol(Span<int> cdf)
114114
this.symbolValue = (int)Math.Pow(paddedData, (((this.symbolValue + 1) << bits) - 1));
115115
this.symbolMaxBits -= bits;
116116

117-
int N = cdf.Length;
117+
int N = cdf.Length - 1;
118118

119119
if (!this.disableCdfUpdate)
120120
{

ArithmeticCoding/H263/H263SyntaxBasedArithmeticDecoder.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public int DecodeSymbol(ReadOnlySpan<int> cumulativeFrequencies, IH263PscFifo ps
6868
this.Length = this.High - this.Low + 1;
6969
this.Cumulative = (-1 + (this.CodeValue - this.Low + 1) *cumulativeFrequencies[0]) / this.Length;
7070

71-
for (int index = 1; cumulativeFrequencies[index] > this.Cumulative; index++)
71+
for (this.Index = 1; cumulativeFrequencies[this.Index] > this.Cumulative; this.Index++)
7272
{
7373
}
7474

@@ -115,7 +115,7 @@ public async Task<int> DecodeSymbol(int[] cumulativeFrequencies, IH263PscFifo ps
115115
this.Length = this.High - this.Low + 1;
116116
this.Cumulative = (-1 + (this.CodeValue - this.Low + 1) * cumulativeFrequencies[0]) / this.Length;
117117

118-
for (int index = 1; cumulativeFrequencies[index] > this.Cumulative; index++)
118+
for (this.Index = 1; cumulativeFrequencies[this.Index] > this.Cumulative; this.Index++)
119119
{
120120
}
121121

0 commit comments

Comments
 (0)